How to show remaining quantity with text?

Is there a way to show low stock with a custom text without the use of an addon? For example if the remaining stock is 4 then the default stock status will show 'Only 4 remaining".
If not, then point me to an addon that works with the default “in stock status feature” in that the text is shown where the default ‘in stock’ is usually shown, and not somewhere else.

That bit is pretty simple

You will want to go to Design/layout/product tab
Create new block (HTML with smarty support) in the grid with the “main content” block
Put this code in it

{if $product.amount > 0}

Only {$product.amount} left in stock


Out of stock


As it is that would sit above or below the product details (rather than along side the quantity or similar) e.g. I created the new block below the main content block so it looks like this.

You can format it easily but if you want it somewhere in the middle of the block that will be the tricky bit, you will in esence have to rebuild the product page. That would mean putting a whole heap of similar code in to get the images, buttons etc.

1 Like

There were several ready-to-use solutions on the marketplace. They allow to specify different stock statuses for different amount ranges. Try to search by “stock statuses”

Update: I found an addon on the marketplace by Cart-power. I will take a look at it and see how it works.

Cheers for the replies.

1 Like