Skip to main content

How to display a stock in "unlimited quantity"

More
14 years 7 months ago #38673 by karolko
Hi,

Is there a way to display stock with unlimited quantity on product listing as "in stock".

I used language override to display X number in stock as "in stock" for items which I have physically in stock. Is there something similar that can be done for "unlimited quantity" stock?

Thanks,

Karol

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

More
14 years 7 months ago #38716 by beiker
Hi Karol. Can you paste a screenshot on this?

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

More
14 years 7 months ago #38739 by karolko
Nicolas,

First picture shows a case on product listing page where:

quantity of a product > 0 and I customized Czech translation of X_ITEMS_IN_STOCK="skladem" (meaning in-stock, without showing number of items in stock)

Second picture shows a case on product listing page where:

quanity of a product = unlimited, nothing is displayed on product listing page about quantity in this case

What I am looking for in second case is to have an option to display some text on product listing page (something like pre-order or available on demand) if the quantity of the product is unlimited.

Thanks,

Karol

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

More
14 years 7 months ago #38918 by nicolas
You will have to edit the file 'quantity' of the view "product" via the menu Display->Views and add the code:
Code:
echo JText::_('X_ITEMS_IN_STOCK');

just before the code:
Code:
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$this->row->product_max_per_order,$this->row->product_min_per_order); }elseif($this->row->product_quantity>0){

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

More
14 years 7 months ago #38927 by karolko
How would the code look like if I wanted to display different text for quantity = unlimited. If I use your code I will get "in-stock" displayed for products of unlimited quantity which is not what I want.

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

More
14 years 7 months ago #39064 by nicolas
Instead of :
echo JText::_('X_ITEMS_IN_STOCK');

you could have:
echo 'Unlimited';

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

More
14 years 7 months ago #39187 by karolko
Thanks Nicolas, working like a charm. :)

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

More
8 years 10 months ago #283104 by natanjarorije
is this also possible in hikashop 3.2.1? The code of the file 'quantity' of the view "product" is different and I tried different things :-(

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

More
8 years 10 months ago #283113 by Jerome
Hello,

The idea is still the same (replacing the display of the translation by a raw text) but the code of HikaShop changed a lot during the past 5 years (and 9 months).

If you want to know which view you need to customize, I recommend you to activate temporally the setting "display view files" :
www.hikashop.com/support/documentation/5...g.html#advanced_main
It will add some "debug" display very useful when you wan to perform view overrides and know what you need to edit.
www.hikashop.com/support/documentation/1...ize-the-display.html

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

More
8 years 10 months ago #283143 by natanjarorije
thank you, great function!! the quantity legacy was used instead of quantity ;-)

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

Time to create page: 0.192 seconds
Powered by Kunena Forum