Skip to main content

Low quantity products message

More
5 years 9 months ago #327590 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

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

More
5 years 9 months ago - 5 years 9 months ago #327594 by Mohamed Thelji
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.
Last edit: 5 years 9 months ago by Mohamed Thelji.

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

More
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

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

More
5 years 9 months ago #327656 by Mohamed Thelji
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 :
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.

More
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

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

More
5 years 9 months ago #327684 by nicolas
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:
Code:
?> <div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main"><?php
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.

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

More
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

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

More
5 years 9 months ago #327713 by nicolas
Hi,

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
Powered by Kunena Forum