Answer the question
In order to leave comments, you need to log in
How to display opencart attributes in data for recommended?
Good afternoon, I export goods through the recommended ones. I need to set data-$attribute for them. There are already attributes in opencart, how can I display them as recommended + get them in the format data-attributename='true'
Answer the question
In order to leave comments, you need to log in
featured.php
'attribute_groups' => $this->model_catalog_product->getProductAttributes($product_info['product_id']),
and in the template
<?php if($product['attribute_groups']) { ?>
<div>
<table class="table table-bordered table-condensed table-striped">
<thead>
</thead>
<tbody>
<?php foreach($product['attribute_groups'] as $attribute_group) { ?>
<?php foreach($attribute_group['attribute'] as $attribute) { ?>
<tr>
<td><b><?php echo $attribute['name']; ?></b></td>
<td><?php echo $attribute['text']; ?></td>
</tr>
<?php } ?>
<?php } ?>
</tbody>
</table>
</div>
<?php } ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question