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

Cart shipping method not being changed when changing shipping address #140

Open
peteeveleigh opened this issue Aug 28, 2024 · 4 comments
Open

Comments

@peteeveleigh
Copy link

Describe the bug

A customer sets a shipping address, then proceeds to choose a shipping method. Both are set on the cart.
They then backtrack through the checkout and change their shipping address. The new address results in the original selected shipping method being invalid but it is not removed from the cart.

The standard Commerce behaviour would be to remove the selected invalid shipping method from the cart and instead apply the first valid one available for the new shipping address.

Steps to reproduce

  1. Set up shipping options specific to different regions; e.g. USA and Canada
  2. Checkout and set the shipping address to, say, USA
  3. Select the USA specific shipping method offered
  4. Go back and update the shipping address to a Canadian address
  5. Examine the shipping method on the cart, it will still be the USA specific method.

Craft CMS version

4.10.4

Plugin version

3.1.8

Multi-site?

No

Additional context

No response

@sjcallender
Copy link

Also, we started support with Craft, but confirmed it's a Postie issue.

@peteeveleigh disabled Postie, then set up a single shipping method with 3 different rules for US, Canada, International. When he changed the shipping address on the front-end, the shipping rate also changed (because the selected shipping method changed by default).

@peteeveleigh
Copy link
Author

Also just confirmed what happens in the CP when using Postie.
If I change the shipping address on the cart in the CP then the original option is greyed out and when I click "Update Order" the first valid shipping method is set on the cart.

So what could be different about doing it on the front end via the update-cart controller?

@engram-design
Copy link
Member

Do you have manualFetchRates enabled? I'm not seeing this behaviour. Rates and their shipping methods are cached based on their cart content and the customer address, so if that changes, new shipping methods are then available.

If the previously-selected shipping method still exists for the new address, but a different price, then nothing will change (apart from the shipping cost, already applied to the order of course), but if the shipping method (the specific service for the provider) is no longer available, the shipping method with in invalidated.

@peteeveleigh
Copy link
Author

@engram-design No, manualFetchRates is not enabled. It's not defined in our config at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants