Laat ik me eerst even voorstellen ik ben Roy en heb een probleempje met een PHP script waar ik op de een of andere manier niet uit kom.
Het is een script dat een lijst genereert in Magento, echter is het 1 lange lijst die wordt gegenereerd in een tabel met rijen. Ik zou dit graag opsplitsen in een tabel met 2 kolommen.
Weet iemand of dit mogelijk is?
Dit is het huidige script:
<?php
$_helper = $this->helper('catalog/output');
$_product = $this->getProduct()
?>
<?php if($_additional = $this->getAdditionalData()): ?>
<div class="box-collateral box-additional innercontent">
<!-- <h2><?php echo $_product->getName().' '.$this->__('Additional Information') ?></h2> -->
<table class="data-table2" id="product-attribute-specs-table">
<col width="50%" />
<col />
<tbody>
<?php foreach ($_additional as $_data): ?>
<tr>
<th class="label"><?php echo $this->htmlEscape($this->__($_data['label'])) ?></th>
<?php
?>
<td class="data <?php echo strtolower($_data['label']); ?>"><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<script type="text/javascript">decorateTable('product-attribute-specs-table')</script>
</div>
<?php endif;?>
_____________________
| Naam: | Attribuut|
_____________________
Ik zou graag willen hebben:
________________________________________________
| Naam: | Attribuut | Naam2: | Attribuut2|
| Naam3: | Attribuut | Naam4: | Attribuut2|
| Naam5: | Attribuut | Naam6: | Attribuut2|
| Naam7: | Attribuut | Naam8: | Attribuut2|
Nu heb ik het volgende geprobeerd, echter komt er niet uit wat ik graag zou willen:
"<?php
$_helper = $this->helper('catalog/output');
$_product = $this->getProduct()
?>
<?php if($_additional = $this->getAdditionalData()): ?>
<?php $rows = count($_additional)/2; ?>
<div class="box-collateral box-additional innercontent">
<!-- <h2><?php echo $_product->getName().' '.$this->__('Additional Information') ?></h2> -->
<table class="data-table2-1" id="product-attribute-specs-table">
<?php foreach ($_additional as $_data): ?>
<tr>
<th class="label"><?php echo $this->htmlEscape($this->__($_data['label'])) ?></th>
<?php
?>
<td class="data <?php echo strtolower($_data['label']); ?>"><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</table>
<script type="text/javascript">decorateTable('product-attribute-specs-table')</script>
</div>
<?php endif;?>
Zou iemand mij hier mee op weg kunnen helpen?
Alvast veel dank!
Gr Roy