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:
Philipp Stracker 2024-09-30 18:59:13 +02:00
parent 89fa0f1fa7
commit 0abb2e0f8d
No known key found for this signature in database
3 changed files with 75 additions and 0 deletions

View file

@ -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.