Don't show the stock only one category

  • Posts: 58
  • Thank you received: 0
9 years 4 months ago #235016

-- url of the page with the problem -- : www.polaris-ranger-razor-atv.it/index.ph...t=listing&Itemid=384
-- HikaShop version -- : Hikashop Business 2.6.1
-- Joomla version -- : 3.5

:) Hi all,
Is it possible create two different situation?
i have 2 categories, category one and category two :
tha category one i want to show the stock but in the category two i don't want to show the stock :blink:

Thank you in advance
Marco

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

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
9 years 4 months ago #235021

Hi,

There is no option to do that. You'll have to edit the file "quantity" via the menu Display>Views and 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 add a condition around it so that it only displays when the $this->element->category_name is equal to category one.

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

  • Posts: 58
  • Thank you received: 0
9 years 4 months ago #235272

OK! Thank you very much, Nicolas.
I put these code:

//modifica  marco
$confronto = "Ricambi accessori";
if ( $this->element->category_name != $confronto) {
		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);
		
		
}
//fine modifica di marco

and work very well, but in the category "Ricambi accessori" show angain the NO_STOCK where can i change the code?

Thank in advance
Marco

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

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
9 years 4 months ago #235292

Hi,

It's in the same file, just a bit below in the code:
echo JText::_('NO_STOCK').'<br/>';

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

  • Posts: 58
  • Thank you received: 0
9 years 4 months ago #235859

:) Hi Nicolas,
i put these code around the echo JText::_('NO_STOCK').'</br />';

//modifica  marco
$confro = "Ricambi accessori";

if ( $this->element->category_name != $confro) {
        echo JText::_('NO_STOCK_RICAMBI').'<br/>';
}//fine modifica Marco

But don't work show again NO_STOCK ... where is my error? thank you!

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

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
9 years 4 months ago #235873

Hi,

Well, that's all there is to it.
Either you're not editing the view file for the correct template, or you're not trying to change that display on the product page.
Based on how you configured your store, it's possible that this message also appear on listings and in that case, it's potentially the file add_to_cart_listing that needs to be edited in the same maner.

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

  • Posts: 58
  • Thank you received: 0
9 years 4 months ago #235954

:) Hi Nicolas, i understand my error.
I'm working on the template wrong... the file correct is quantity.php

thank you, your answer help me to understand where is my error

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

Time to create page: 0.082 seconds
Powered by Kunena Forum