Availability: On Stock / Out of Stock

  • Posts: 344
  • Thank you received: 3
7 years 9 months ago #260776

So I've did a little change to the code and now it looks like this:

if($this->row->product_quantity > 0)
		echo JText::_('IN_STOCK');
	elseif(!$in_stock)
		echo JText::_('NO_STOCK');

And it works perfect.

My only problem is that some of my product has "Quantity: Unlimited"

But when products has the quantity: unlimited status the "in stock" message does not display".

How can I modify the code to display the message "in stock" when the Quantity of the product is set to "Unlimited" ?

Tnx

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

  • Posts: 86
  • Thank you received: 9
  • Hikashop Business
7 years 9 months ago #260789

Fastest way is to change the language string....


Kind regards,
Cornel

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

  • Posts: 344
  • Thank you received: 3
7 years 9 months ago #260806

....and what language string would that be ?

tnx

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

  • Posts: 86
  • Thank you received: 9
  • Hikashop Business
7 years 9 months ago #260823

do a search of "Unlimited" in your language file and change that


Kind regards,
Cornel

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

  • Posts: 12953
  • Thank you received: 1778
7 years 9 months ago #260807

Hello,

The best way will probably to use some php code like this :

if($this->row->product_quantity > 0 || $this->row->product_quantity == -1)
		echo JText::_('IN_STOCK');
else
		echo JText::_('NO_STOCK');
Or
if($this->row->product_quantity != 0)
		echo JText::_('IN_STOCK');
else
		echo JText::_('NO_STOCK');

The following user(s) said Thank You: river

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

  • Posts: 344
  • Thank you received: 3
7 years 9 months ago #260860

Tnx man I used this code

if($this->row->product_quantity > 0 || $this->row->product_quantity == -1)
		echo JText::_('IN_STOCK');
else
		echo JText::_('NO_STOCK');

It works like a charm

you're the best =)

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

Time to create page: 0.061 seconds
Powered by Kunena Forum