Skip to main content

Availability: On Stock / Out of Stock

More
9 years 8 months ago #260776 by river
So I've did a little change to the code and now it looks like this:
Code:
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.

More
9 years 8 months ago #260789 by kernel64
Fastest way is to change the language string....

Kind regards,
Cornel

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

More
9 years 8 months ago #260806 by river
....and what language string would that be ?

tnx

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

More
9 years 8 months ago #260823 by kernel64
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.

More
9 years 8 months ago #260807 by Mohamed Thelji
Hello,

The best way will probably to use some php code like this :
Code:
if($this->row->product_quantity > 0 || $this->row->product_quantity == -1) echo JText::_('IN_STOCK'); else echo JText::_('NO_STOCK');
Or
Code:
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.

More
9 years 8 months ago #260860 by river
Tnx man I used this code
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.301 seconds
Powered by Kunena Forum