Support » Plugin: WooCommerce » Clean Input Data before Checkout and Saving

  • Hello Mike or WOO folks,

    I would like to know how to clean the billing data on checkout?
    Billing first name
    Billing Last name
    Billing City
    Billing Phone – I can format once I understand the billing name fields

    In the database some entries are stored with lower case and phone numbers are all different.

    I can use php to clean and format these fields but I am not sure how to get hooked or filtered.

    Here is what I have so far.

    function clean_checkout_field_process() {
    global $woocommerce;

    // Check if set, if billing_first_name.
    if (!$_POST[‘billing_first_name’])
    *** What is this supposed to be to clean data before checkout and saving it to the SQL tables.
    $billing_first_name = ucword (billing_first_name);

    add_action(‘woocommerce_checkout_process’, ‘clean_checkout_field_process’);

    Any help here?

    Most of these other issues listed in support should be resolved if people can Google the answers, but when I need something, I cannot find this obscure request.

  • The topic ‘Clean Input Data before Checkout and Saving’ is closed to new replies.