Fixes AXO module

This commit is contained in:
Pedro Silva 2024-04-10 18:27:21 +01:00
parent c71c56973a
commit 995621ba21
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
8 changed files with 138 additions and 58 deletions

View file

@ -5,7 +5,7 @@ class BillingView {
constructor(selector, elements) {
this.el = elements;
this.billingFormFields = new FormFieldGroup({
this.group = new FormFieldGroup({
baseSelector: '.woocommerce-checkout',
contentSelector: selector,
template: (data) => {
@ -81,42 +81,46 @@ class BillingView {
'selector': '#billing_company_field',
'valuePath': null,
},
phone: {
'selector': '#billing_phone_field',
'valuePath': null,
},
// phone: {
// 'selector': '#billing_phone_field',
// 'valuePath': null,
// },
}
});
}
isActive() {
return this.billingFormFields.active;
return this.group.active;
}
activate() {
this.billingFormFields.activate();
this.group.activate();
}
deactivate() {
this.billingFormFields.deactivate();
this.group.deactivate();
}
refresh() {
this.billingFormFields.refresh();
this.group.refresh();
}
setData(data) {
this.billingFormFields.setData(data);
this.group.setData(data);
}
inputValue(name) {
return this.billingFormFields.inputValue(name);
return this.group.inputValue(name);
}
fullName() {
return `${this.inputValue('firstName')} ${this.inputValue('lastName')}`.trim();
}
copyDataToForm() {
return this.group.copyDataToForm();
}
}
export default BillingView;