Closed tblivet closed 1 year ago
Questions | Answers |
---|---|
Description? | Correct the issue 536 |
Type? | bug fix |
BC breaks? | no |
Deprecations? | no |
Fixed ticket? | Fixes https://github.com/PrestaShop/hummingbird/issues/536 |
Sponsor company | @PrestaShopCorp |
How to test? | You can refer to the issue |
IMO it would be better to simply disallow changing quantity to 0. This can be done by mistake and then the product would have to be searched again. If a user wants to remove the product from the cart then the Remove button should be clicked.
@SharakPL That was how it was before. It should throw an error message "Minimal quantity for sale is 1".
Also, it's a bit incosistent. What does it do if minimum quantity for sale is higher than 1? 🤔
I am a bit torn apart for the expected behavior here.
@sallemiines could you please check again with product that has minimum order quantity higher than 1? It doesn't look like it's covered.
@tblivet Related function in Classic is inside:
themes/classic/_dev/js/cart.js in updateProductQuantityInCart
function.
if (targetValue === '0') {
$target.closest('.product-line-actions').find('[data-link-action="delete-from-cart"]').click();
} else {
$target.attr('value', targetValue);
sendUpdateQuantityInCartRequest(updateQuantityInCartUrl, getRequestData(qty), $target);
}
It looks that instead of checking minimal quantity you should only check whether the target value is equal to 0.
Is there a place for improvements or does it have to be done like in Classic?
@SharakPL what would be an improvement in your opinion?
To be more clear on what each action does. Decreasing the amount shouldn't delete the product from the cart. If the requested amount is lower than the minimum required for order then it should throw an error:
The minimum amount required for order of this product is X. If you want to remove the product completely from your cart then use the Remove button
Or at least change [ - ] to [ X ] or [ trash_icon ] to indicate that next use of this button will remove it completely instead of just decreasing the amount. Especially useful if the minimum required amount is higher than 1.
The one improvement I see in this change is that if one makes a mistake and changes the value below 1, it could save the cart. I've checked a few stores, and when there are arrows, changing below 1 is forbidden. There's no request, which could also be a good thing.
Something to be decided by @PrestaShop/product-council :)
To summarize:
I've checked a few stores, and when there are arrows, changing below 0 is forbidden.
Did you mean "below 1"?
@SharakPL yes, I edited the message
Hello, On Amazon : You have a text next to 0 which precise that by clicking on 0 you will suppress the article I find it's quite a good idea. Concerning the case where you have a minimum of quantity to order to validate it. I imagine for instance, if you have to order minimum of 30. The list in the arrow will be 0 to let to suppress then directly 30,31,32...
@RosaBenouamer There needs to be a number input, dropdown for selecting count is not good UX. :-)
Hello 👋 With @ga-devfront we have update the PR we now have this behavior :
No response from the people who blocked the PR, additions were made and the behavior seems to be the most common to web standards: Impossible to go below the minimum orderable unless it is 0 in which case the product is deleted. I pass the PR to Waiting for QA