Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
7006 Lượt xem

When ordering a product in Odoo webshop, the quantity is default 1. Is it possible to have a minimum quantity (higher then 1)?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi there,

we have the same problem. Would be great if somebody can give a feedback on that.

Thanks!

Ảnh đại diện
Huỷ bỏ

how is it possible to do this for some products only? what would be the code to add to the view?

Câu trả lời hay nhất

Yes, You can set minimum quantity higher than one for order a product in Odoo webshop.

You have to make change in view "Select Quantity" in Odoo to directly  make changes in the current database. For that, open this view from Settings --> Technical --> User Interface --> Views menu. Search for "Select Quantity" view. Open that view and change below line. In below line, I have set default quantity 5, you can set whatever you want.

<input type="text" class="form-control" data-min="1" name="add_qty" value="5"/>

If you want to directly change in code, than open /addons/website_sale/views/templates.xml file and search "Select Quantity",than change the line as like above changes. If you do modification in website_sale module, you have to upgrade website_sale module after making changes in code.


Ảnh đại diện
Huỷ bỏ

how is it possible to do this for some products only? what would be the code to add to the view?