Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle shoppingcart error returns properly - part 2 #14214

Merged

Conversation

@matks
Copy link
Contributor

commented Jun 14, 2019

Questions Answers
Branch? develop
Description? Updates returned error message to handle properly "add to cart an out-of-stock product" error in Shopping Cart module, see PrestaShop/ps_shoppingcart#41 (comment)
Type? improvement
Category? FO
BC breaks? no
Deprecations? no
Fixed ticket? Will help to fix #11631
How to test? Please test in combination with PrestaShop/ps_shoppingcart#41, see below

How to test

Please use :

Expected behavior

  • Go to a FO page product with stock.
  • In BO go to this product and update the quantity to 0.
  • Back to FO product page (⚠️ dont refresh the page), add the product to cart.
  • Shopping cart modal does not open and we see a nice error message below the "add to cart button "The item ... in your cart is no longer available in this quantity."
  • If you go on Cart page, you'll see error message "The item ... in your cart is no longer available in this quantity. You cannot proceed with your order until the quantity is adjusted."

This is currently true for a product with combinations. This PR makes it also true for products without combinations and virtual products.


This change is Reviewable

@matks matks requested a review from PrestaShop/prestashop-core-developers as a code owner Jun 14, 2019

@PierreRambaud PierreRambaud added this to the 1.7.7.0 milestone Jun 14, 2019

@marionf

This comment has been minimized.

Copy link
Contributor

commented Jun 17, 2019

@matks

I still have the message "The item XXX in your cart is no longer available in this quantity" instead of "The product is no longer available in this quantity" for standard, virtual and pack products.

capture d'écran_1697

capture d'écran_1696

capture d'écran_1695

For product with combination I well have "The product is no longer available in this quantity"

@matks

This comment has been minimized.

Copy link
Contributor Author

commented Jun 19, 2019

@marionf This PR does not want to be merged 😄 but we're going to do it !

I fixed it, and checkec standard, virtual, pack products, with or without combinations. Also checked the Cart page to make sure messages are not changed there.

Please re-validate 🙏

@marionf

This comment has been minimized.

Copy link
Contributor

commented Jun 26, 2019

@matks

It remains one case to manage with pack:

  • Edit a pack, choose "decrement both" and put 100 in stock
  • Go to the pack in FO
  • Edit the pack and put 0 in stock
  • Go to the pack in FO without refreshing the page and add it to the cart
    You don't have the message on the product page, but you well have it in the cart

https://drive.google.com/file/d/1aAdhf2z9PXoXZ7xeiYyRuAiSjkT417HS/view?usp=sharing

@matks

This comment has been minimized.

Copy link
Contributor Author

commented Jul 17, 2019

@matks

It remains one case to manage with pack:

  • Edit a pack, choose "decrement both" and put 100 in stock
  • Go to the pack in FO
  • Edit the pack and put 0 in stock
  • Go to the pack in FO without refreshing the page and add it to the cart
    You don't have the message on the product page, but you well have it in the cart

https://drive.google.com/file/d/1aAdhf2z9PXoXZ7xeiYyRuAiSjkT417HS/view?usp=sharing

It works if, for each product of the pack, you set the quantity to 0.
In your video, you have set the quantity of the pack to 0 but the "stock management" is set to "decrease the stock of the products" so it's the product quantities which are used, not the pack quantity. The pack quantity is ignored.

@PierreRambaud PierreRambaud merged commit ec0b7b1 into PrestaShop:develop Jul 18, 2019

2 checks passed

PrettyCI Code formatting
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@PierreRambaud

This comment has been minimized.

Copy link
Contributor

commented Jul 18, 2019

Thanks @matks

@matks matks deleted the matks:update-error-cart-out-of-stock-msg-2 branch Jul 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.