在类别页面上显示所选属性

时间:2014-10-31 18:06:28

标签: php undefined opencart

我正在使用OpenCart v1.5.4。我想在类别页面上也显示产品属性。已搜索但无法找到模块或解决方案。

我正在尝试将某个属性(一个属性组从3个,而不是所有属性)添加到类别页面,我收到此错误:

  

注意:未定义的变量:第79行的/catalog/view/theme/bigshop/template/product/category.tpl中的attribute_groups

有人可以帮忙吗?

这是我在产品页面上使用的代码,但效果很好但不在类别页面上。

<?php if ($attribute_groups) { ?>
    <?php foreach ($attribute_groups as $attribute_group) { ?>
      <?php if ($attribute_group['name'] == 'Product Info') { ?>
        <?php foreach ($attribute_group['attribute'] as $attribute) { ?>
          <span><?php echo $attribute['name']; ?></span> <?php echo html_entity_decode($attribute['text']); ?><br />
        <?php } ?>
      <?php } ?>
    <?php } ?>
  <?php } ?>
  <!-- End Additional Info -->
</div>

0 个答案:

没有答案
相关问题