- Posts: 41
- Thank you received: 2
Low quantity products message
5 years 9 months ago #327590
by guro
Low quantity products message was created by guro
-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.23
-- PHP version -- : 7.4.13
hello,
could you please tell me how to add a message in the product page for low quantity products. This is important, because we would like to inform our customers for the low stock.
Is it possible?
kind regards,
dimitris
-- Joomla version -- : 3.9.23
-- PHP version -- : 7.4.13
hello,
could you please tell me how to add a message in the product page for low quantity products. This is important, because we would like to inform our customers for the low stock.
Is it possible?
kind regards,
dimitris
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
5 years 9 months ago - 5 years 9 months ago #327594
by Mohamed Thelji
Replied by Mohamed Thelji on topic Low quantity products message
Hello Dimitris,
There's actually no option to achieve that so the solution will be to directly edit the code of the file of the "product" view via "Hikashop->Dispaly->Views".
www.hikashop.com/support/documentation/1...-display.html#layout
Kind regards,
Mohamed.
There's actually no option to achieve that so the solution will be to directly edit the code of the file of the "product" view via "Hikashop->Dispaly->Views".
www.hikashop.com/support/documentation/1...-display.html#layout
Kind regards,
Mohamed.
Last edit: 5 years 9 months ago by Mohamed Thelji.
Please Log in or Create an account to join the conversation.
5 years 9 months ago #327617
by guro
Replied by guro on topic Low quantity products message
Hello Mohamed,
thank you for the quick reply.
I would like to show a message "low quantity" when the quantity of a product is less than 3 items stock and place it over "add to cart" button.
Could you please send to me in which file of "product" view and what to add. I don't have any Php knowledge.
Kind regards,
dimitris
thank you for the quick reply.
I would like to show a message "low quantity" when the quantity of a product is less than 3 items stock and place it over "add to cart" button.
Could you please send to me in which file of "product" view and what to add. I don't have any Php knowledge.
Kind regards,
dimitris
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
5 years 9 months ago #327656
by Mohamed Thelji
Replied by Mohamed Thelji on topic Low quantity products message
Hello Dimitris,
Using the following PHP code and editing the "Show_default" file of the "Product" view of your front-end template via "Hikashop->Display->Views" will do the job :
Kind regards,
Mohamed.
Using the following PHP code and editing the "Show_default" file of the "Product" view of your front-end template via "Hikashop->Display->Views" will do the job :
Code:
if($this->element->product_quantity != '-1' && (int)$this->element->product_quantity < 3)
echo '<p>low quantity</p>';
Kind regards,
Mohamed.
Please Log in or Create an account to join the conversation.
5 years 9 months ago #327680
by guro
Replied by guro on topic Low quantity products message
Hello,
i have tried to put the code with no result.
Could you please tell me in whick "line" of the file show_default file of the product view (of my front-end template) to add this, or you do it this for me?
Kind regards,
dimitris
i have tried to put the code with no result.
Could you please tell me in whick "line" of the file show_default file of the product view (of my front-end template) to add this, or you do it this for me?
Kind regards,
dimitris
Please Log in or Create an account to join the conversation.
5 years 9 months ago #327684
by nicolas
Replied by nicolas on topic Low quantity products message
Hi,
This code is fine but where to add it in that view file depends on where you want the message to appear on the product details page.
Since you want it before the add to cart button area, you could add it just before the code:
Also, note that this code supposes your products don't have variants.
If they do, it requires more complex coding to handle the refresh of the information when the selected variant is changed etc.
Please understand that this is a user support forum, to answer your questions. We can't do custom coding for you as part of that service. If you want us to work on such tasks for you, it's possible but as an extra. In that case, you can request a quote on the job via our contact form:
www.hikashop.com/support/contact-us.html
Make sure you provide precise information on the job when contacting us so that we have the necessary information to reply to you.
This code is fine but where to add it in that view file depends on where you want the message to appear on the product details page.
Since you want it before the add to cart button area, you could add it just before the code:
Code:
?>
<div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main"><?php
If they do, it requires more complex coding to handle the refresh of the information when the selected variant is changed etc.
Please understand that this is a user support forum, to answer your questions. We can't do custom coding for you as part of that service. If you want us to work on such tasks for you, it's possible but as an extra. In that case, you can request a quote on the job via our contact form:
www.hikashop.com/support/contact-us.html
Make sure you provide precise information on the job when contacting us so that we have the necessary information to reply to you.
Please Log in or Create an account to join the conversation.
5 years 9 months ago #327708
by guro
Replied by guro on topic Low quantity products message
Hello Nicolas,
first of all i never believe your code wasn't right. Second, as you said this code works under conditions and dont need it.
ΟΚ. Could you please send me an email to "gurovits@hotmail.com" with the cost?
Kind regards,
Dimitris
first of all i never believe your code wasn't right. Second, as you said this code works under conditions and dont need it.
ΟΚ. Could you please send me an email to "gurovits@hotmail.com" with the cost?
Kind regards,
Dimitris
Please Log in or Create an account to join the conversation.
5 years 9 months ago #327713
by nicolas
Replied by nicolas on topic Low quantity products message
Hi,
We've sent you an email about it.
We've sent you an email about it.
Please Log in or Create an account to join the conversation.
Time to create page: 0.220 seconds