- Posts: 21
- Thank you received: 0
Frontoffice notice when product below certain stoc
11 years 2 months ago - 11 years 2 months ago #209992
by Paganikon
Frontoffice notice when product below certain stoc was created by Paganikon
-- url of the page with the problem -- :
www.setup-pilotage.com
-- HikaShop version -- : 2.5.0
Hi, I have one question, couldn't find anything using Search...
I am looking for one feature : is it possible to display a notice on product listing when a products arrives at a certain stock quantity ?
Example : Be careful, only 2 more available
Thanks !
-- HikaShop version -- : 2.5.0
Hi, I have one question, couldn't find anything using Search...
I am looking for one feature : is it possible to display a notice on product listing when a products arrives at a certain stock quantity ?
Example : Be careful, only 2 more available
Thanks !
Last edit: 11 years 2 months ago by Paganikon.
Please Log in or Create an account to join the conversation.
11 years 2 months ago #209996
by Xavier
Replied by Xavier on topic Frontoffice notice when product below certain stoc
Hi,
Yes it is possible via view override, the view to edit is "product / listing_xxx" depending on what kind of listing you are using, by default it is "listing_img_title".
And in that view add some php code to display the stock, something like:
And add a translation override:
Yes it is possible via view override, the view to edit is "product / listing_xxx" depending on what kind of listing you are using, by default it is "listing_img_title".
And in that view add some php code to display the stock, something like:
Code:
<?php echo JText::_('STOCK_AVAILABLE',$this->row->product_quantity;); ?>
And add a translation override:
STOCK_AVAILABLE="Be careful, only %s more available."
Please Log in or Create an account to join the conversation.
11 years 2 months ago #210097
by Paganikon
Replied by Paganikon on topic Frontoffice notice when product below certain stoc
Hi, thanks a lot !
One more thing, how can I display it only when it reaches 2 products left in stock ?
Something like (sorry don't know much about php lol) : if stock <= 2 {display "be careful, only 2 products in stock"}
Thanks ^^
One more thing, how can I display it only when it reaches 2 products left in stock ?
Something like (sorry don't know much about php lol) : if stock <= 2 {display "be careful, only 2 products in stock"}
Thanks ^^
Please Log in or Create an account to join the conversation.
11 years 2 months ago #210099
by Xavier
Replied by Xavier on topic Frontoffice notice when product below certain stoc
Hi,
Like that:
Like that:
Code:
<?php
if($this->row->product_quantity <= 2 && $this->row->product_quantity > 0)
echo JText::_('STOCK_AVAILABLE',$this->row->product_quantity;);
?>
Please Log in or Create an account to join the conversation.
Time to create page: 0.209 seconds