Remove stock level display only on category listin

  • Posts: 20
  • Thank you received: 1
9 years 6 months ago #230490

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8

Hello I would like to remove the stock level count from the product listing in categories but show it in the detailed product page.

Is there any way to accomplish this?

Thank you in advance for your help.

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

  • Posts: 84307
  • Thank you received: 13701
  • MODERATOR
9 years 6 months ago #230493

Change the code:

if($this->row->product_quantity == 1 && JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK')
			$text = JText::sprintf('X_ITEM_IN_STOCK', $this->row->product_quantity);
		else
			$text = JText::sprintf('X_ITEMS_IN_STOCK', $this->row->product_quantity);
to:
if(!empty($this->element->product_id)){		if($this->row->product_quantity == 1 && JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK')
			$text = JText::sprintf('X_ITEM_IN_STOCK', $this->row->product_quantity);
		else
			$text = JText::sprintf('X_ITEMS_IN_STOCK', $this->row->product_quantity); }
in the file "quantity" of the view "product" via the menu Display>Views and that should do it.

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

  • Posts: 20
  • Thank you received: 1
9 years 6 months ago #230623

Thank you SOOO much Nicolas!! It worked like a charm :)))))

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

Time to create page: 0.055 seconds
Powered by Kunena Forum