• kader20031

    (@kader20031)


    So I want to catch the data that the user is filling in the checkout form,
    for example first_name, billing address and to make some manipulation on it. I tried this code, but nothing is happening! and I do not understand why is that.

    function my_checkout_update_user_meta( $user_id ) {
    if(pll_current_language() == ‘he’)
    {
    $first_name_input = $_POST[‘billing_first_name’];
    $billing_company_input = $_POST[‘billing_company’];
    update_user_meta( $user_id, ‘billing_address_2’, $billing_company_input );
    update_user_meta( $user_id, ‘billing_company’, $first_name_input );
    }
    }
    add_action( ‘woocommerce_checkout_update_user_meta’, ‘my_checkout_update_user_meta’ );

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

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘manipulate data from user in checkout page’ is closed to new replies.