Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter inder42218

    (@inder42218)

    Probably, I am asking too much.. Do you have a sample code ? What parameters need to be passed to Filters & also how to get value of billing fields in filter for check .. Thank You….

    I also have same issue. I am using twilio. Customer is receiving text twice for order processing. THanks

    I used this one & it worked. it son latest woocommerce.

    // Reorder Checkout Fields
    add_filter(‘woocommerce_checkout_fields’,’reorder_woo_fields’);

    function reorder_woo_fields($fields) {
    $fields2[‘billing’][‘billing_email’] = $fields[‘billing’][‘billing_email’];
    $fields2[‘billing’][‘billing_phone’] = $fields[‘billing’][‘billing_phone’];
    $fields2[‘billing’][‘billing_first_name’] = $fields[‘billing’][‘billing_first_name’];
    $fields2[‘billing’][‘billing_last_name’] = $fields[‘billing’][‘billing_last_name’];
    $fields2[‘billing’][‘billing_country’] = $fields[‘billing’][‘billing_country’];
    $fields2[‘billing’][‘billing_address_1’] = $fields[‘billing’][‘billing_address_1’];
    $fields2[‘billing’][‘billing_address_2’] = $fields[‘billing’][‘billing_address_2’];
    $fields2[‘billing’][‘billing_city’] = $fields[‘billing’][‘billing_city’];
    $fields2[‘billing’][‘billing_postcode’] = $fields[‘billing’][‘billing_postcode’];
    $fields2[‘billing’][‘billing_state’] = $fields[‘billing’][‘billing_state’];

    // Add full width Classes and Clears to Adjustments
    $fields2[‘billing’][‘billing_email’] = array(
    ‘label’ => __(‘Email’, ‘woocommerce’),
    ‘required’ => true,
    ‘class’ => array(‘form-row-wide’),
    ‘clear’ => true
    );
    $fields2[‘billing’][‘billing_phone’] = array(
    ‘label’ => __(‘Phone’, ‘woocommerce’),
    ‘required’ => false,
    ‘class’ => array(‘form-row-wide’),
    ‘clear’ => true
    );

    return $fields2;
    }

    Can you please paste the full code ? I am a rookie & my code is not working to sequence the fields…

    add_filter( ‘woocommerce_default_address_fields’, ‘yourplugin_move_checkout_fields’ );

    function yourplugin_move_checkout_fields( $fields ) {
    // Author: apppresser.com

    // Move these around as necessary. You’ll see we added email first.
    $billing_order = array(
    “billing_email”,
    “billing_first_name”,
    “billing_last_name”,
    “billing_company”,
    “billing_address_1”,
    “billing_address_2”,
    “billing_postcode”,
    “billing_country”,
    “billing_state”,
    “billing_phone”
    );

    // This sets the billing fields in the order above
    foreach($billing_order as $billing_field) {
    $billing_fields[$billing_field] = $fields[“billing”][$billing_field];

    }

    $fields[“billing”] = $billing_fields;
    $fields[‘billing’][‘billing_first_name’][‘priority’] = 10;
    $fields[‘billing’][‘billing_last_name’][‘priority’] = 20;
    $fields[‘billing’][‘billing_email’][‘priority’] = 30;
    $fields[‘billing’][‘billing_phone’][‘priority’] = 40;
    $fields[‘billing’][‘billing_country’][‘priority’] = 50;
    $fields[‘billing’][‘billing_company’][‘priority’] = 60;
    $fields[‘billing’][‘billing_address_1’][‘priority’] = 70;
    $fields[‘billing’][‘billing_address_2’][‘priority’] = 80;
    $fields[‘billing’][‘billing_city’][‘priority’] = 90;
    $fields[‘billing’][‘billing_postcode’][‘priority’] = 100;

    return $fields;
    }

Viewing 4 replies - 1 through 4 (of 4 total)