Closed crowgames closed 4 years ago
Hi @crowgames . You can accomplish this by specifying an empty set of shippingOptions
initially. The browser will ask the user to explicitly select their shipping address, at which point the 'shippingaddresschange' update will be fired with redacted address that is sufficient for shipping price caclulations. Please proceed to populate the shippingOptions
field in the response to the shippingaddresschange
event. Ideally you would also designate one of the shipping options selected: true
, which reduces the number of actions that the user has to perform during checkout. Please see a demo at https://rsolomakhin.github.io/pr/us/
Should onshippingaddresschange be triggered through auto-filled/pre-filled values?
Context: To allow for an easy and fast checkout, browsers (e.g. Chrome) pre-fill inputs such as the shipping address with the last observed address. This currently does not trigger an onshippingaddresschange-event though. But if I as a merchant want to calculate shipping costs based on the selected address, I have to rely on this event.
The spec describes relevant events as:
In terms of the specification what would be the intended behavior? Since this is a very common use-case, I think this might need clarification in the spec.