mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
✨ Store & restore the Woo form as needed
When Ryan flow starts, the values of the Woo-form are saved in an internal Map, and restored once the Ryan flow is disabled again (change email or select other payment gateway)
This commit is contained in:
parent
89fa0f1fa7
commit
0abb2e0f8d
3 changed files with 75 additions and 0 deletions
|
@ -90,42 +90,52 @@ class ShippingView {
|
|||
key: 'firstName',
|
||||
selector: '#shipping_first_name_field',
|
||||
valuePath: 'shipping.name.firstName',
|
||||
inputName: 'shipping_first_name',
|
||||
},
|
||||
lastName: {
|
||||
selector: '#shipping_last_name_field',
|
||||
valuePath: 'shipping.name.lastName',
|
||||
inputName: 'shipping_last_name',
|
||||
},
|
||||
street1: {
|
||||
selector: '#shipping_address_1_field',
|
||||
valuePath: 'shipping.address.addressLine1',
|
||||
inputName: 'shipping_address_1',
|
||||
},
|
||||
street2: {
|
||||
selector: '#shipping_address_2_field',
|
||||
valuePath: null,
|
||||
inputName: 'shipping_address_2',
|
||||
},
|
||||
postCode: {
|
||||
selector: '#shipping_postcode_field',
|
||||
valuePath: 'shipping.address.postalCode',
|
||||
inputName: 'shipping_postcode',
|
||||
},
|
||||
city: {
|
||||
selector: '#shipping_city_field',
|
||||
valuePath: 'shipping.address.adminArea2',
|
||||
inputName: 'shipping_city',
|
||||
},
|
||||
stateCode: {
|
||||
selector: '#shipping_state_field',
|
||||
valuePath: 'shipping.address.adminArea1',
|
||||
inputName: 'shipping_state',
|
||||
},
|
||||
countryCode: {
|
||||
selector: '#shipping_country_field',
|
||||
valuePath: 'shipping.address.countryCode',
|
||||
inputName: 'shipping_country',
|
||||
},
|
||||
company: {
|
||||
selector: '#shipping_company_field',
|
||||
valuePath: null,
|
||||
inputName: 'shipping_company',
|
||||
},
|
||||
shipDifferentAddress: {
|
||||
selector: '#ship-to-different-address',
|
||||
valuePath: null,
|
||||
inputName: 'ship_to_different_address',
|
||||
},
|
||||
phone: {
|
||||
//'selector': '#billing_phone_field', // There is no shipping phone field.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue