Saleor: Checkout - cart of death

Created on 25 Sep 2019  路  7Comments  路  Source: mirumee/saleor

What I'm trying to achieve

After completing the second step at checkout (shipping method), I want to be able to remove all products from the cart and add others.

Steps to reproduce the problem

  1. Add any product to the cart
  2. Go to checkout
  3. Login to your account
  4. Fill out the first 2 steps
  5. Back to the cart page and remove all products
  6. Try to add any product to your cart

What I expected to happen

Products should be added to the cart.

What I currently have

checkoutLinesUpdate mutation says This checkout doesn't need shipping and my checkout is locked. I'm not able to add any product as a logged-in user.

bug

Most helpful comment

Hello all. Yep, in my opinion, we should delete shipping information when there are no products in the cart. In addition, we need to prepare data migration to fix existing blocked checkouts.

All 7 comments

we just discovered the same bug using GraphQL. after we delete all lines using checkoutLineDelete mutation it is not possible to add any product back to that cart.

I would like to fix this bug. Any suggestions ? @bogdal

the problem lies in saleor/graphql/checkout/mutations.py:61 where there is a check for checkout.is_shipping_required() which returns any(line.is_shipping_required() for line in self)
obviously when there are no lines in the checkout it will always return False.

Gues, it's really wired behaviour. Maybe we can invalidate such checkout? Or remove shipping info from it.

it seems that removing shipping info is the most relevant solution. no items in the cart -> nothing to deliver -> it makes no sense to keep the shipping info.

Hello all. Yep, in my opinion, we should delete shipping information when there are no products in the cart. In addition, we need to prepare data migration to fix existing blocked checkouts.

I'm taking the hacktoberfest label off from this one, @fowczarek from our team will work on this issue.

Was this page helpful?
0 / 5 - 0 ratings