1

I know how to make the stock show as 'in stock' or 'out of stock' by using: {if total_stock} In Stock {if:else} Out of Stock {/if}

How can I code the following: "In stock" if we have more than 5 items available, "Low stock" if we only have 5 and under or "Out of stock" if we are sold out

1 Answer 1

2

You would want to do something along the lines of:

{if total_stock > 5}
In Stock
{if:elseif total_stock <= 5 && total_stock != 0}
Low Stock
{if:else}
Out of Stock
{/if}

The EE User Guide has all of the other operators you can use.

1
  • I edited my original to include a check that the stock is not 0 Mar 23, 2013 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.