Jump to content

Adding text "price from" in 1.5.x


Recommended Posts

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

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

×
×
  • Create New...