Skip to main content

Don't show the stock only one category

More
10 years 6 months ago #235016 by marcoboni
-- 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.

More
10 years 6 months ago #235021 by nicolas
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:
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.

More
10 years 6 months ago #235272 by marcoboni
OK! Thank you very much, Nicolas.
I put these code:
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.

More
10 years 5 months ago #235292 by nicolas
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.

More
10 years 5 months ago #235859 by marcoboni
:) Hi Nicolas,
i put these code around the echo JText::_('NO_STOCK').'</br />';
Code:
//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.

More
10 years 5 months ago #235873 by nicolas
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.

More
10 years 5 months ago #235954 by marcoboni
:) 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.226 seconds
Powered by Kunena Forum