WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Clean Input Data before Checkout and Saving (1 post)

  1. gdisalvo
    Member
    Posted 10 months ago #

    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.

    http://wordpress.org/plugins/woocommerce/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.