Skip to main content

display quantity statut

More
11 years 6 months ago #196295 by saturnales
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6

Hello,


I dont manage to display the quantity statut ( out of stock or available) in the product page.

Its displayed in the wishlist but i just whant to show the same message on the product page.

Thanks

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

More
11 years 6 months ago #196299 by Xavier
Replied by Xavier on topic display quantity statut
Hi,

Do you set a quantity for your products ? If it is, so you should already have a message displayed.
If you have unlimited quantities and want to display a message so you can add that kind of code:
Code:
$text = JText::_('UNLIMITED_ITEMS_IN_STOCK'); echo '<span class="hikashop_product_stock_count">'.$text.'<br/></span>';
Right after:
Code:
if($this->row->product_quantity == -1) { ?>
In the view "product / quantity".
www.hikashop.com/support/support/documen...ize-the-display.html

And then add a translation override on the key "UNLIMITED_ITEMS_IN_STOCK".
www.hikashop.com/support/faq.html#tran

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

More
11 years 6 months ago #196885 by saturnales
Replied by saturnales on topic display quantity statut
I donc have any message concerning the stock in the product page. I just discovered that stock isnt displayed when i'm on catalog mode.

Then, is it simply possible to display the stock even when i dont use the add to cart functionalities ?

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

More
11 years 6 months ago #196905 by Xavier
Replied by Xavier on topic display quantity statut
Hi,

Yes it is possible, you can edit the view "product / show_default" and add the following code where you want:
Code:
if($this->row->product_quantity == 1 && JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK') $text = JText::sprintf('X_ITEM_IN_STOCK', $this->row->product_quantity); else $text = JText::sprintf('X_ITEMS_IN_STOCK', $this->row->product_quantity); echo '<span class="hikashop_product_stock_count">'.$text.'<br/></span>';
That code must be placed between php tags.
The following user(s) said Thank You: saturnales

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

More
11 years 6 months ago #196954 by saturnales
Replied by saturnales on topic display quantity statut
Thanks
I didnt know that I had an access to the product quantity from that view

I dont understand why you did the condition
JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK'

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

More
11 years 6 months ago #196955 by Xavier
Replied by Xavier on topic display quantity statut
Hi,

This condition allow to check if the string "X_ITEM_IN_STOCK" is translated or not, if not so we display the translation for "X_ITEMS_IN_STOCK" which is present in HikaShop since the beginning contrary to the other one which has been added in a more recent version. ;)

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

More
11 years 6 months ago #197073 by saturnales
Replied by saturnales on topic display quantity statut
ok ;)

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

Time to create page: 0.217 seconds
Powered by Kunena Forum