Skip to main content

Show quantity in stock conditionally?

More
14 years 3 months ago #52929 by lovelyweapon
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.

More
14 years 3 months ago #52965 by Xavier
Hi lovelyweapon,

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

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

By:
Code:
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.

More
14 years 3 months ago #53041 by lovelyweapon
Thank you so much! :)

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

Time to create page: 0.173 seconds
Powered by Kunena Forum