• Resolved serena16

    (@serena16)


    Hello,

    I made a user registration form with your plugin. In this form, there’s also a dropdown menu choice (the one named “GAS, referente, email di riferimento”). When a user makes an order in the shop I would like to display this value in the email that Woocommerce sends me with the new order notification.
    Is it possible to take this value and display it somehow?
    Thank you in advance for your help.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Sandip Pokhrel

    (@sandippokharel)

    Hi @serena16

    Thanks for writing in,

    Please refer to the documentation in the link below. You will find custom code snippets to achieve your request.
    https://docs.wpuserregistration.com/docs/custom-code-snippets/#16-toc-title
    I hope this helps.

    Regards!

    Thread Starter serena16

    (@serena16)

    Hi Sandip,

    I’ve actually solved it with this code inside Woocommerce’s email format

    $user_id = get_current_user_id(); // Get the user ID
    $custom_field_value = get_user_meta($user_id, 'user_registration_selezione_gas', true); // Get the custom field value
    
    if ($custom_field_value) {
        echo 'Selected GAS: ' . $custom_field_value;
    }

    where “selezione_gas” was the custom field name.
    Thank you for your help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get field value to display in Woocommerce mail’ is closed to new replies.