How to Change Default Quantity from unlimited to 1

  • Posts: 4
  • Thank you received: 1
2 years 4 months ago #338006

-- 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

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

  • Posts: 4509
  • Thank you received: 611
  • MODERATOR
2 years 4 months ago #338018

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

Last edit: 2 years 4 months ago by Philip.

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

  • Posts: 4
  • Thank you received: 1
2 years 4 months ago #338043

We would like the default value for quantity to = 1 when creating a New Product.

Currently the default value is Unlimited, which if the user fails to change when creating a new product will cause a problem as there will always only be one item for sale.

Attachments:

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

  • Posts: 81511
  • Thank you received: 13066
  • MODERATOR
2 years 4 months ago #338044

Hi,

You can edit the file product / form.php via the menu Display>Views.
There, at the beginning, you can add that code:

<?php if(empty($this->product->product_id)) $this->product->product_quantity = 1; ?>

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

  • Posts: 4
  • Thank you received: 1
2 years 4 months ago #338056

Perfect, thankyou.

The following user(s) said Thank You: Philip

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

Time to create page: 0.079 seconds
Powered by Kunena Forum