Closed Tornevall closed 3 years ago
Added field translations for v1 and v2-RCO so that it will be easier to inherit customer data from RCO to billing/delivery fields. Added function to detect RCO onload. Taking advance of $('body').trigger() to make the update features natural. Besides by doing this we allow others to hook into the feature "on customer change". Discovered bug in RCOv2 that exists on deliveryAddress level (reported). When delivery address is received from RCO iframe, we also open delivery address block in WooCommerce natural flow (this is also where we found the bug).
How to recreate the current bug:
1: Click "Annan leveransadress" in the iframe. 2: onCustomerChange is triggered. 3: When customer is filled in, woocommerce is asked to open the delivery address fields. 4: Customer fills in delivery address data. 5: Customer realizes that the delivery address is not necessary. Customer closes "Annan leveransadress". 6: Customer continues to payment method. 7: onCustomerChange is again triggered but still contains the old delivery address changes.
For the moment, RCO scripts can ignore the billing and shipping fields entirely as the backend scripts fills in the gap automatically.
By means, we don't have to synchronize the default fields at all in the checkout.
RWC-164