In the checkout page when we checkout the product there is an option to enable ship to different address, Inside this session there was no option to enter additional phone number (ie, shipping person’s phone number) when billing and shipping person are different. So we give the following code :
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;
}
add_action( ‘woocommerce_admin_order_data_after_shipping_address’, ‘my_custom_checkout_field_display_admin_order_meta’, 10, 1 );
function my_custom_checkout_field_display_admin_order_meta($order){
echo ‘
‘.__(‘Phone From Checkout Form’).’: ‘ . get_post_meta( $order->get_id(), ‘_shipping_phone’, true ) . ‘
‘;
}
This field is coming. But now the problem is that in the packing slip if the customer is entering different phone number for billing and packing, and if given different phone number in shipping address this number will not come in the packing slip. Is there is any method to solve this.
Site URL: hidden Theme version: 8.3.1 WooCommerce version: 8.3.1Hello,
Check how it works with the default WC theme – Storefront activated.
Let us know the result in detail, please.
Regards
You must be logged in to reply to this topic.Log in/Sign up
One standard license is valid only for 1 project. Running multiple projects on a single license is a copyright violation.