I need help with a loop in opencart.
I want to display 2 - 3 product next to each other other on the product page. similar to how products are displayed in on the compare page. I've achieved the product limit via code already and I've managed to display everything else, pictures, price etc. My issue is the attributes.
I know that i need to reach into this array
$this->data['products'][] = array(
......
'attribute' => $attribute_data,
I've also included this line of code
$attribute_groups = $this->model_catalog_product->getProductAttributes($product_id);
my loop is
<?php foreach ($attribute_group['attribute'] as $key => $attribute) { ?>
<tbody>
<tr>
<td><?php echo $attribute['name']; ?></td>
<td><?php echo $attribute['text']; ?></td>
<?php } ?>
<?php } ?>
This gets me all attributes of the current product but displays errors for any attributes not filled in if there are any related products.
Then I have no idea on how to reach into the array and display the related product attribute details.
please help