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

[Split checkout] Users without shipping address are not able to reach step2 if there is only a pickup shipping method in step 1 #10479

Closed
RachL opened this issue Feb 24, 2023 · 3 comments · Fixed by #10496
Assignees
Labels
bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround.

Comments

@RachL
Copy link
Contributor

RachL commented Feb 24, 2023

Description

See user info here: https://openfoodnetwork.slack.com/archives/C01V3KW8RSM/p1677251613703549?thread_ts=1677249745.577039&cid=C01V3KW8RSM

when this user tries to go to payment step, they see an error message saying they should add a shipping address. yet the only shipping method is a pickup one (no shipping address required).

couldn't reproduce on staging, couldn't reproduce with my US super admin account 🤔

Steps to Reproduce

  1. Go to https://openfoodnetwork.net/open-food-network-usa/shop#/shop
  2. Go to /cart
  3. Try to go to payment step
  4. See error message on shipping address

Animated Gif/Screenshot

See videos here:

https://openfoodnetwork.slack.com/archives/C01V3KW8RSM/p1677249745577039

Workaround

None

Severity

bug-s2: a non-critical feature is broken, no workaround

Your Environment

  • Version used: v4.1.25
  • Browser name and version: Firefox and chrome
  • Operating System and version (desktop or mobile): Windows and ubuntu
@RachL RachL added the bug-s2 The bug is affecting any of the non-critical features described in S1 and there is no workaround. label Feb 24, 2023
@drummer83
Copy link
Contributor

See #9056.

@rioug rioug self-assigned this Feb 26, 2023
@rioug
Copy link
Collaborator

rioug commented Feb 27, 2023

I managed to reproduce the issue by "massaging" my data , you need to make sure you have Customer with no shipping address when on the checkout page, then the error will trigger. I'll look at fixing it tomorrow

@RachL RachL added bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround. and removed bug-s2 The bug is affecting any of the non-critical features described in S1 and there is no workaround. labels Mar 7, 2023
@RachL RachL changed the title [Split checkout] US user blocked at step 1 [Split checkout] Users without shipping address are not able to reach step2 if there is only a pickup shipping method in step 1 Mar 7, 2023
@audez
Copy link
Collaborator

audez commented Mar 8, 2023

Finally it was it..
The issue is big because it impacts all customers who previously checked out on legacy but didn't choose to save their address, and want to choose a pickup method. All those who are registered in "Customers" list but don't have a shipping address.
Screen Shot 2023-03-08 at 21 22 40
Screen Shot 2023-03-08 at 21 21 55

It was hard to reproduce/understand because there must have been a recent change: if you take a fresh account today and do legacy (or split) checkout without choosing "Save shipping address", it will save the shipping address anyways. This is a new bug i guess (and on split checkout, even if you don't finalize the order the customer is added to the shop list as long as you reached step 2).

So to reproduce the case you have to:

  • Create a fresh account
  • As an admin of a shop with a pickup method, in "Customer" tab, register the mail (don't put the shipping address)
  • As the customer, checkout on split checkout on this shop with pickup method

Workarounds are:

  • Set the shipping address as an admin in Customers tab
  • Checkout on a "Delivery" shipping method then come back
  • Switching shipping method from "Pickup" to "Delivery"

They will all allow to update the shipping address.

The reason of the 422 error is: when sending the request the shipping address fields are empty and the request fails
Screen Shot 2023-03-09 at 10 08 01
Screen Shot 2023-03-09 at 00 12 55

It looks like normally, for pickup methods, the shipping address is inherited from the billing address - you can see it by doing a simple split checkout:
Request URL: https://coopcircuits.fr/checkout/details
Screen Shot 2023-03-09 at 10 53 20

But it seems that for registered user without shipping address, the shipping address is not inherited and will be empty. This would be the case for our users.

For the tests it seems useless to delete a customer info in Customers tab, because the info remains saved in db.

PS: sorry for the misleading #9056 (comment), now i can see in the screens that the failed requests was only when at least one field of shipping address was empty. There was no link with order[bill_address_attributes][id]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants