Skip to content
Snippets Groups Projects

New phone number in the shipping section

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Tomasz Bednarek
    Edited
    new_phone_number_in_the_shipping_section.txt 532 B
    add_filter('woocommerce_checkout_fields','new_phone_field_classic_checkout');
    
    function new_phone_field_classic_checkout($fields) {
        $fields['shipping']['shipping_phone'] = array(
            'type' => 'number',
            'label' => 'Shipping phone',
            'priority' => 111,
            'required' => false,
            'class' => array('form_row_wide'),
            'validate' => array('tel'),
            'autocomplete' => 'tel',
            'placeholder' => 'Shipping phone (if different than in billing)',
        );
        return $fields;
    }
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment