Display “Out of stock” message in HikaShop when quantity is 0

  • Posts: 12
  • Thank you received: 1
  • Hikashop Business
1 week 4 days ago #368147

-- url of the page with the problem -- : www.fidelebrueder.de/
-- HikaShop version -- : 6.0.0 Business
-- Joomla version -- : 5.3.2
-- PHP version -- : 8.3.23
-- Browser(s) name and version -- : Chrome 138.0.7204.184

Hello,

I am using HikaShop 6 Business and would like to show an “Out of stock” message on the product page when the quantity is 0.

So far I have:

Set “Display out of stock products” to Yes.

Set product quantity to 0 (no variants).

However, in the frontend the add-to-cart button disappears, but there is no visible “Out of stock” text for the customer.

Question:
How can I make HikaShop display an “Out of stock” label or message on the product page when the quantity is 0? Is there a built-in option in v6, or do I need a view override?

Thank you!

Please Log in or Create an account to join the conversation.

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
1 week 4 days ago #368149

Hi,

The out of stock message will appear automatically on the product details page on the frontend once stock for the product goes to 0.
There is no option to not display it.
If you don't see it, either you've already have a view override (made on your end or by your template provider) which removes it, or you have a translation override of the text for it on the frontend which removes it, or you have custom CSS which removes it, or you have some page caching in place preventing you from seeing the change and you need to clear it.
The code to display it is in the view file product / quantity :

<!-- STOCK MESSAGE -->
<?php
$stock_class = ($stock != 0) ? "" : " hikashop_product_no_stock";
?>
<span class="hikashop_product_stock_count<?php echo $stock_class; ?>">
<?php
	if(!empty($this->row->product_stock_message))
		echo JText::sprintf($this->row->product_stock_message, $stock);
	elseif($stock > 0)
		echo (($stock <= $threshold_stock_message && JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK') ? JText::sprintf('X_ITEM_IN_STOCK', $stock) : JText::sprintf('X_ITEMS_IN_STOCK', $stock));
	elseif(!$in_stock)
		echo JText::_('NO_STOCK');
?>
</span>
<!-- EO STOCK MESSAGE -->
So either that code is missing or there is a problem with the translation key NO_STOCK

Please Log in or Create an account to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum