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

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.

| improve this answer | |
  • I edited my original to include a check that the stock is not 0 – Justin Long 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.