PrestaShop / hummingbird

77 stars 73 forks source link

Fix minimum qty input on products listing and product detail pages #609

Closed boherm closed 3 months ago

boherm commented 4 months ago
Questions Answers
Description? With this PR, when you add a product with a minimal quantity to your cart, the product quantity should be updated in the quantity input of the product. This is for all products listing pages, product quick view and also product detail page.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes https://github.com/PrestaShop/hummingbird/issues/608 (related to https://github.com/PrestaShop/hummingbird/pull/600)
Sponsor company PrestaShop SA
How to test? 0. Don't forget to rebuild the theme before!
1. Set a minimal quantity for ordering a product in BO.
2. Then go to the FO and search your product in categories pages, and see the value displayed in the quantity input.
3. After added to the cart, you must have "1" in the quantity input instead of the minimal quantity required to put the product on your cart.
SharakPL commented 3 months ago

IMO it would be better to use a different approach. Keep min exactly as it is set in product configuration and if the current product combination is already in the cart then the value should be updated to its amount in the cart and instead of theAdd to cart button there would be Update cart. It would make all calculations obsolete. Just get the product config and its amount in the cart.

boherm commented 3 months ago

Thanks for your comment @SharakPL, your approach with Update cart instead of Add to cart button seems cool, but I think that is a "feature" that need to be discuss together with @PrestaShop/product-council. I don't know if they had this possibility in mind.

boherm commented 3 months ago

Thanks @florine2623 for your message! After some tests, I have totally the same behaviour on my side. But, they are not related to HB theme, and we have the same problems on classic theme.

In fact, this is a problem with the core here and after a small talk with @jolelievre, this could be fix in another PR and directly on the core side.

What do you think? 🤔

florine2623 commented 3 months ago

Hello @boherm and @jolelievre ,

Ok for me to get it fixed on the core directly ^^ I'll let you decide on what to do with this PR ! I'll take off the Waiting for QA label.

Thanks!