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


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
Out of Stock

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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