Can’t update additional checkout field
-
I’ve created a new checkout field using woocommerce_register_additional_checkout_field and set it with a location of ‘contact’ (see below). This works however, when you go to change the value of this checkbox in the user account it doesn’t update when you save changes it retains it’s existing value meaning a user can’t change their preference.
add_action(
'woocommerce_init',
function() {
woocommerce_register_additional_checkout_field(
array(
'id' => 'namespace/marketing-opt-in',
'label' => 'Do you want to subscribe to our newsletter for exclusive news and discounts?',
'location' => 'contact',
'type' => 'checkbox',
)
);
}
);
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.