Alldo Group Posted December 6, 2013 Share Posted December 6, 2013 Dear forum! I am trying to add the text "Price from" in the product listing (product-list.tpl), and on the product page (product.tpl). I am trying to add these codes, but it does not work: {if $product.id_attribute_group == 5} <span style="font-weight:bold;">Price from:</span> {/if} ...and... {if $product.id_product_attribute != 0} <span style="font-weight:bold;">Price from:</span> {/if} Problem: The text is always showing, even if the product does not have any attributes. Anyone know how to achieve this? Thanks, Link to comment Share on other sites More sharing options...
NemoPS Posted December 6, 2013 Share Posted December 6, 2013 Oh the product page attriibutes work differently, and $product is an object, not an array You can use something like {foreach from=$groups key=id_attribute_group item=group} and again, inside {foreach from=$group.attributes key=id_attribute item=group_attribute} So you can check the id attribute. Note that it drains some resources. Is the text displayed before or after the attributes box? Link to comment Share on other sites More sharing options...
Recommended Posts