Jump to content

How to display a note if quatity is 0


Recommended Posts

I'm stuck on how to hide/display something, if product quantity is zero (i.e both the normal quantity and the quantity of every attribute is zero).

I am using the following code in the product template, but running into problems:

{if $product->quantity == 0 && $combination.quantity == 0}
display something here
{/if}

The problem is that it only seems to base the query on the first combination, i.e if there is more than one combination which does have quantity, but the first does not it still displays the message.

Does it need to be in a loop that goes through all the combinations first to see that they are all zero? Can anyone suggest what code I need to use for it to work?

Thanks in advance! :)

Link to comment
Share on other sites

×
×
  • Create New...