- πͺπΈSpain uridrupal
At first glance the patch seems to be working. I can see the button unchecked and allows me to check it as "same billing as shipping".
- last update
10 months ago 150 pass - last update
10 months ago 150 pass - last update
10 months ago 150 pass - Status changed to RTBC
6 months ago 11:46am 27 May 2024 - πΊπ¦Ukraine lobodacyril
It works as expected. I don't see any issues in code.
- π©πͺGermany Anybody Porta Westfalica
We just ran into the same requirement.
I guess in most cases the shipping address should equal the billing address. Most users want to save time by copying the information than having to re-enter it or check it manually.So this should indeed please be configurable and I personally think it should even be enabled by default.
@jsacksick should we turn this into a MR for easier review and merging, or how to proceed after this has been RTBC'd in May? Would be great to get things finished here.
- π©πͺGermany Anybody Porta Westfalica
Sadly I have to put this back to needs work.
The setting correctly appears in the pane settings at e.g.
/admin/commerce/config/checkout-flows/manage/default
(and is enabled by default).Still when using different payment methods like PayPal and Direct debit and switching between them, the checkbox is not checked, even though it should be checked by default.
@rhovland are you planning further work here?
- @anybody opened merge request.
- π©πͺGermany Anybody Porta Westfalica
I created the MR for further work on it.
- π©πͺGermany Anybody Porta Westfalica
Okay this is strange and I couldn't find the root cause yet: Even if I set
$enabled = TRUE
by hard, which essentially means:$inline_form['copy_fields']['enable'] = [ '#type' => 'checkbox', '#title' => $this->getCopyLabel($inline_form), '#default_value' => TRUE, '#ajax' => [ 'callback' => [get_class($this), 'ajaxRefresh'], 'wrapper' => $inline_form['#id'], ], ];
the checkbox is still unchecked?! We'll investigate further...
- First commit to issue fork.
- π©πͺGermany Grevil
Alright, that should be it! Unfortunately our ajax checkbox doesn't use the default value... I'll see if I can find a workaround to disable it (note that is purely visual. Codewise, the checkbox is seen as checked).
See core issue: π Checkboxes default value is ignored by forms system during processing of AJAX request Needs work .
- π©πͺGermany Grevil
Ok unfortunately I have to cut it here.
Last remaining steps:
- Write Tests.
- Implement the update hook based on the @todo comment in the install file.
- Try to find a workaround for π Checkboxes default value is ignored by forms system during processing of AJAX request Needs work .
I'll add some gitlab commits for anyone wanting to finalize this.
- π©πͺGermany Grevil
The new logic also breaks existing tests and maybe some other use cases, this definitly needs further work in general.
- π©πͺGermany Anybody Porta Westfalica
I think we should postpone this on π "My billing information is the same as my shipping information." checkbox state wrong / inconsistent with AJAX Active as it's very confusing to have multiple parallel issues on this topic and not seeing correct results due to π "My billing information is the same as my shipping information." checkbox state wrong / inconsistent with AJAX Active currently.