Show quantity in stock conditionally?

  • Posts: 11
  • Thank you received: 0
13 years 6 days ago #52929

Hi everyone. I want to know if it's possible to only show the quantity in stock when it is at 1, for each variant? Thanks in advance!

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

  • Posts: 13201
  • Thank you received: 2322
13 years 6 days ago #52965

Hi lovelyweapon,

You have to edit the view produt / quantity.php
In HikaShop > Display > Views.

Then replace the line:

echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity).'</span><br/>';

By:
if($this->row->product_quantity == 1){
	echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity).'</span><br/>';
}

The following user(s) said Thank You: lovelyweapon

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

  • Posts: 11
  • Thank you received: 0
13 years 5 days ago #53041

Thank you so much! :)

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

Time to create page: 0.041 seconds
Powered by Kunena Forum