Jump to content

Add 'From' to price on Product List if there are attributes

Recommended Posts

Hi all,


I'm working on a website where some products have attributes which will vary in price. So for example, a bag of dog food at 1kg may be £10. A 2kg bag may be £18. These would be variations/attributes of one product.


So as not to mislead customers, on the product list, we'd like to introduce an if statement which detects whether the product has attributes. If the item has variations and can be altered, then on the product list, we'd like it to say 'From:' next to the price.


I have tried things like 

{if ($product.id_product_attribute == 0 )}From {/if}

but that yields nothing.


Any help would be greatly appreciated.



Link to comment
Share on other sites

  • 2 weeks later...
  • 11 months later...

Hello, I just wanted to add I added: {if $product.id_product_attribute}Select options{/if} right before (or after, depending on your likes!) the </h5>

{hook h='displayProductListReviews' product=$product} part of my product-list.tpl file. This added the text I chose (in this case, 'Select options') to products in product list which have attributes. Otherwise this thread was not clear on which file to modify or where to add: {if $product.id_product_attribute}Select options{/if} part. But thanks I am grateful with help of other tutorial I was able to add this feature.
Edited by Elise B. (see edit history)
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...