This is a followup to #2852207: Billing same as shipping.

The current code will copy over the shipping fields even if the shipping country_code is not allowed (not in $store->getBillingCountries()).

We need to define what the expected behavior is in this case. I can think of two possible options:
1) Hide the "Billing same as shipping" checkbox as long as the shipping country_code is not allowed.
2) Show the "Billing same as shipping" checkbox, but show a validation error on submit, asking the user to select a different address/country_code.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bojanz created an issue. See original summary.

plopesc made their first commit to this issue’s fork.

plopesc’s picture

Status: Active » Needs review

Merge Request created following the second approach described in the issue summary.

jsacksick’s picture

Version: 8.x-2.x-dev » 3.x-dev

tbkot made their first commit to this issue’s fork.

tbkot changed the visibility of the branch 8.x-2.x to hidden.

zaporylie made their first commit to this issue’s fork.

zaporylie’s picture

Status: Needs review » Reviewed & tested by the community

I pushed a small commit with updates to inline comments and also updated the method's name for determining isShippingCountrySupportedForBilling. After making a round of manual tests, marking this as RTBC.

  • jsacksick committed 5e4b3f04 on 3.x authored by tbkot
    [#3115647] fix: "Billing same as shipping" does not respect the "...
jsacksick’s picture

Status: Reviewed & tested by the community » Fixed

Merged, thanks everyone!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.