Problem/Motivation
If a site has two-or-more payment providers available, when entering billing information for one payment gateway, if the visitor decides to change to the other payment gateway all of the billing address fields previously entered are erased and have to be entered again.
Steps to reproduce
- goto order information step and I can select a payment method (in my case stripe with new credit card)
- click next in order to to review step
- click edit payment information in order to get back to order information pane
- on order information pane the chosen payment with billing information method should be selected
- click on the other payment provider (in my case paypal)..... The billing information is gone now. (returning back to credit card will display billing information again
Well is this "works as designed" or a bug?! In my opinion the billing information should remain.
Because we set at some point the billing profile to the order.
Proposed resolution
Make it work! :-)
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | billing-address-lost-2950877-8.patch | 790 bytes | johnchque |
| #3 | after.png | 144.21 KB | flocondetoile |
| #3 | before.png | 147.52 KB | flocondetoile |
Comments
Comment #2
bojanz commentedThis issue is a bit confusingly worded, it's hard to say what "lost" means. There are also no screenshots. Are the fields not present at all? Or empty? Or is this about retaining inputted but not saved values on payment_method switch?
We have just fixed #3115087: Clear dependent form input when a payment_method is selected at checkout which might be helpful, in at least ensuring that the default values are shown properly.
Generally, if address values are entered for one payment method, then another is selected, those values will not be transferred. However, it might be possible to implement a workaround which transfers the values between two different parts of user input.
Comment #3
flocondetoileMeet same bug on 2.17 and commerce shipping 2.0-RC1.
Let's say if I uncheck billing same as shipping option, and choose "Enter a new address".

Then if I select another payment gateway, the select_address field is reset and the first address is taken instead of the "_new" option selected previously.

Comment #4
flocondetoileNot sure if this is really a "bug".
Comment #5
flocondetoileFrom the
PaymentInformation.phpcheckout pane (line 305), looks like this is intentional.Comment #6
flocondetoileI think we can close this issue, "Works as designed", but I let a maintainer do it.
Comment #7
johnchque@bojanz I've seen the argument for the code in #3115087: Clear dependent form input when a payment_method is selected at checkout. But I wonder what happens when we checkout, we want to edit values, we set new Billing Information and then I want to change the Payment Method?
As for my test, it seems that the new values I just entered are cleared back to the default. Should we avoid maybe unsetting the billing information data?
Comment #8
johnchqueAdding a patch to see if it breaks something in tests.
Comment #9
dwkitchen commentedThe question depends on if we are considering the billing address to be part of the payment information or part of the order.
As this is in the checkout the billing address is for that order, and this is only used when adding a new payment method, so I agree that the new order billing information profile should not be cleared when selecting a new payment method.
This is a required experience for #3170412: Allow a store to always collect a billing address before payment method selection where the payment method is being filtered by the billing profile entered.
Comment #10
damienmckennaI don't see any technical reason why the fields should be erased, it's a user-hostile practice to require visitors to re-enter information when the fields are the same, it's an assumption on the developer's part that the values should be re-entered each time; times I've ran into this on a site I've purposefully canceled the order and went elsewhere.
+1 for this change.
Comment #11
damienmckenna(rewording the issue summary a little)
Comment #12
jsacksick commentedI'll try this but if I remember correctly, if we don't unset the billing information on payment method change... Then if you have an incomplete address with required fields, you'll get validation errors (Will try that later today to confirm).
Comment #13
berdirWe've been using the patch for years, switching a payment gateway disables validation, so validation errors are not visible IMHO.
Comment #14
jsacksick commentedThanks for the feedback, committing this then!
Comment #18
alex.bukach commentedThis fix makes https://www.drupal.org/project/commerce/issues/3115087 relevant again, "Billing same as shipping" becomes unchecked when swithcing to a non-default payment method.
Comment #19
alex.bukach commented