How to display a stock in "unlimited quantity"

  • Posts: 130
  • Thank you received: 1
12 years 9 months ago #38673

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.

  • Posts: 32
  • Thank you received: 4
12 years 9 months ago #38716

Hi Karol. Can you paste a screenshot on this?

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

  • Posts: 130
  • Thank you received: 1
12 years 9 months ago #38739

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

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 9 months ago #38918

You will have to edit the file 'quantity' of the view "product" via the menu Display->Views and add the code:

echo JText::_('X_ITEMS_IN_STOCK');

just before the 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.

  • Posts: 130
  • Thank you received: 1
12 years 9 months ago #38927

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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 9 months ago #39064

Instead of :
echo JText::_('X_ITEMS_IN_STOCK');

you could have:
echo 'Unlimited';

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

  • Posts: 130
  • Thank you received: 1
12 years 9 months ago #39187

Thanks Nicolas, working like a charm. :)

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

  • Posts: 14
  • Thank you received: 0
7 years 7 hours ago #283104

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.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 11 months ago #283113

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.

  • Posts: 14
  • Thank you received: 0
6 years 11 months ago #283143

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.088 seconds
Powered by Kunena Forum