Duplicate email address in store checkout template
-
Hello,
I am reporting what appears to be a bug with your cartflows solution. If any other plugin or custom code calls the
WC()->checkout()->get_checkout_fields()
method before your actioncartflows_checkout_form_before
is triggered, the email address field will appear twice on the checkout page using one of your custom checkout templates.The reason for this is because when the
WC()->checkout()->get_checkout_fields()
function is called, WC keeps a reference to the stored fields. If the function is called again, it returns the instance variable$this->fields
rather then running the checkout fields filterwoocommerce_checkout_fields
again.Since your
Cartflows_Checkout_Markup::unset_fields_for_modern_checkout
method isn’t added to the filter sequence until thecartflows_checkout_form_before
action is called, your filter for unsetting the billing email is never called, resulting in a duplicate email address being printed.Thanks,
- The topic ‘Duplicate email address in store checkout template’ is closed to new replies.