• Resolved hmnim

    (@marktiddy)


    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)
  • Hello ?? @marktiddy,

    For reference, this particular forum is meant for general support with the core functionality of WooCommerce itself. For development and custom coding questions, it’s best to ask for insight related to those on either the?WooCommerce Advanced Facebook group?or the?WooCommerce Community Slack.

    Many of our developers hang out there and will be able to offer insights into your question.

    I wish I could help more, but hopefully, this gets you going in the right direction to get some further insight/information.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.