Do the classic checkout OSA bindings only on the classic page
Call `previousInitCheckout` only if there is one.
This commit is contained in:
parent
cb4dd6e592
commit
6704a6426b
|
@ -64,13 +64,15 @@
|
|||
};
|
||||
|
||||
/**
|
||||
* Add source values to checkout.
|
||||
* Add source values to the classic checkout.
|
||||
*/
|
||||
const previousInitCheckout = document.body.oninit_checkout;
|
||||
document.body.oninit_checkout = () => {
|
||||
setFields();
|
||||
previousInitCheckout();
|
||||
};
|
||||
if ( $( '.woocommerce form.checkout' ) !== null ) {
|
||||
const previousInitCheckout = document.body.oninit_checkout;
|
||||
document.body.oninit_checkout = () => {
|
||||
setFields();
|
||||
previousInitCheckout && previousInitCheckout();
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Add source values to register.
|
||||
|
|
Loading…
Reference in New Issue