- Posts: 4
- Thank you received: 1
How to Change Default Quantity from unlimited to 1
4 years 9 months ago #338006
by tsmithf
How to Change Default Quantity from unlimited to 1 was created by tsmithf
-- HikaShop version -- : 4.4.4
-- Joomla version -- : 3.10.4
-- PHP version -- : 7.4.26
I have seen various forum posts along similar lines, but have been unable to establish how to set the default quantity number when adding new products.
The site is for antiques, and typically all products are in limited quantities, almost exclusively 1 of each.
How can we set the default quantity to 1?
Thanks
-- Joomla version -- : 3.10.4
-- PHP version -- : 7.4.26
I have seen various forum posts along similar lines, but have been unable to establish how to set the default quantity number when adding new products.
The site is for antiques, and typically all products are in limited quantities, almost exclusively 1 of each.
How can we set the default quantity to 1?
Thanks
Please Log in or Create an account to join the conversation.
4 years 9 months ago - 4 years 9 months ago #338018
by Philip
Replied by Philip on topic How to Change Default Quantity from unlimited to 1
Hello,
We aren't sure to understand your needs well, and so 2 answers :
1. You want define a limited quantities per product :
=> From Main HikaShop Configuration => Products dropdown, select Products, then click the product name to edit.
OR
2. You want to limit the quantity added per cart/order for all (or specific product) :
=> From Main HikaShop Configuration => Products dropdown, select Limit, then click the product name to edit.
See this tutorial to learn more about the limit feature
Hope this will help you to achieved what you need.
Regards
We aren't sure to understand your needs well, and so 2 answers :
1. You want define a limited quantities per product :
=> From Main HikaShop Configuration => Products dropdown, select Products, then click the product name to edit.
OR
2. You want to limit the quantity added per cart/order for all (or specific product) :
=> From Main HikaShop Configuration => Products dropdown, select Limit, then click the product name to edit.
See this tutorial to learn more about the limit feature
Hope this will help you to achieved what you need.
Regards
Last edit: 4 years 9 months ago by Philip.
Please Log in or Create an account to join the conversation.
4 years 9 months ago #338043
by tsmithf
Replied by tsmithf on topic How to Change Default Quantity from unlimited to 1
Please Log in or Create an account to join the conversation.
4 years 9 months ago #338044
by nicolas
Replied by nicolas on topic How to Change Default Quantity from unlimited to 1
Hi,
You can edit the file product / form.php via the menu Display>Views.
There, at the beginning, you can add that code:
You can edit the file product / form.php via the menu Display>Views.
There, at the beginning, you can add that code:
Code:
<?php if(empty($this->product->product_id)) $this->product->product_quantity = 1; ?>
Please Log in or Create an account to join the conversation.
4 years 9 months ago #338056
by tsmithf
Replied by tsmithf on topic How to Change Default Quantity from unlimited to 1
Perfect, thankyou.
The following user(s) said Thank You: Philip
Please Log in or Create an account to join the conversation.
2 years 2 months ago #362027
by HadiTak
Replied by HadiTak on topic How to Change Default Quantity from unlimited to 1
very nice,
also can you tell me same code for new variants quantity?
also can you tell me same code for new variants quantity?
Please Log in or Create an account to join the conversation.
2 years 2 months ago #362034
by nicolas
Replied by nicolas on topic How to Change Default Quantity from unlimited to 1
Hi,
For the variants, first, please note that if you leave their stock to "unlimited", the variants will automatically share the stock of the main product. So you might actually not need to do anything.
Also, the variants are generated automatically when you use the "add variants" button of the product edit interface.
And HikaShop will let MySQL set the default product_quantity based on the default value of that column in the database.
So if you want to change the default from unlimited to another value for variants, you can go in your PHPMyAdmin (access provided by your hosting), open the structure of the hikashop_product table, and edit the column product_quantity. There, change the default from -1 to the value you want and save.
For the variants, first, please note that if you leave their stock to "unlimited", the variants will automatically share the stock of the main product. So you might actually not need to do anything.
Also, the variants are generated automatically when you use the "add variants" button of the product edit interface.
And HikaShop will let MySQL set the default product_quantity based on the default value of that column in the database.
So if you want to change the default from unlimited to another value for variants, you can go in your PHPMyAdmin (access provided by your hosting), open the structure of the hikashop_product table, and edit the column product_quantity. There, change the default from -1 to the value you want and save.
The following user(s) said Thank You: HadiTak
Please Log in or Create an account to join the conversation.
Time to create page: 0.218 seconds