Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

geofflaskey87 on "Woocommerce - Add Shipping Phone Number"

$
0
0

I'm trying to add a shipping phone number to my woocommerce checkout page. I've got the field added with the code supplied. I need to get it to pull through to woocommerce in the admin area, so when orders are sent I can give fed-ex the shipping phone number (it's overnight crab shipping, so they need to be able to contact the recipient.)

here's the code I got from woocommerce

// Hook in
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields( $fields ) {
     $fields['shipping']['shipping_phone'] = array(
        'label'     => __('Phone', 'woocommerce'),
    'placeholder'   => _x('Phone', 'placeholder', 'woocommerce'),
    'required'  => false,
    'class'     => array('form-row-wide'),
    'clear'     => true
     );

     return $fields;
}

Viewing all articles
Browse latest Browse all 8245

Trending Articles