- Posts: 344
- Thank you received: 3
Availability: On Stock / Out of Stock
9 years 8 months ago #260776
by river
Replied by river on topic Availability: On Stock / Out of Stock
So I've did a little change to the code and now it looks like this:
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
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.
9 years 8 months ago #260789
by kernel64
Kind regards,
Cornel
Replied by kernel64 on topic Availability: On Stock / Out of Stock
Fastest way is to change the language string....
Kind regards,
Cornel
Please Log in or Create an account to join the conversation.
9 years 8 months ago #260806
by river
Replied by river on topic Availability: On Stock / Out of Stock
....and what language string would that be ?
tnx
tnx
Please Log in or Create an account to join the conversation.
9 years 8 months ago #260823
by kernel64
Kind regards,
Cornel
Replied by kernel64 on topic Availability: On Stock / Out of Stock
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.
Less
More
- Posts: 12953
- Thank you received: 1778
9 years 8 months ago #260807
by Mohamed Thelji
Replied by Mohamed Thelji on topic Availability: On Stock / Out of Stock
Hello,
The best way will probably to use some php code like this :
Or
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');
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.
9 years 8 months ago #260860
by river
Replied by river on topic Availability: On Stock / Out of Stock
Tnx man I used this code
It works like a charm
you're the best
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