K
K
kamisarlapsha2018-10-27 19:43:33
opencart
kamisarlapsha, 2018-10-27 19:43:33

How can I display product attributes in the OpenCart 2.3 admin panel?

Hello, how can I display attributes instead of a model in the product list?
I tried to do it like this:
I added it to the array in the product

'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']),

It's in product_list.tpl
<?php if($product['attribute_groups']) { ?>
                <?php foreach($product['attribute_groups'] as $attribute_group) { ?>
                    <?php foreach($attribute_group['attribute'] as $attribute) { ?>
                    <div class="description--attribute-name"><?php echo $attribute['name']; ?></div>
                    <?php } ?>
                <?php } ?>
                <?php } ?>

But for some reason it doesn't work. Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zoozag, 2018-10-29
@zoozag

See what the model returns:

$product_attribute_data[] = array(
  'attribute_id'                  => $product_attribute['attribute_id'],
  'product_attribute_description' => $product_attribute_description_data
);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question