Auto-recalculate shipping when the address changes

Created on 4 February 2017, almost 8 years ago
Updated 18 December 2024, 1 day ago

Right now people need to click "Recalculate shipping" at checkout when they change the address, to refresh the form.
That should be done automatically like in 1.x.

1) Hide the button.
This should do the trick:

  '#attributes' => [
      'class' => ['js-hide'],
  ],

2) When the address changes (no clue which JS event to use, check 1.x), check that the address is complete, and if it is, click the button.

Notes;
1) The address is complete if all of its required fields are filled.
2) Once the field is complete, we only need to recalculate if one of these fields changed: dependent_locality, locality, postal_code, administrative_area.
We don't care about the name, organization, address lines.

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇷🇸Serbia bojanz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024