Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* == Add Shipping Phone - WooCommerce == */
- add_filter( 'woocommerce_checkout_fields', 'sg_shipping_phone_checkout' );
- function sg_shipping_phone_checkout( $fields ) {
- $fields['shipping']['shipping_phone'] = array(
- 'label' => 'Phone',
- 'type' => 'tel',
- 'required' => true,
- 'class' => array( 'form-row-wide' ),
- 'validate' => array( 'phone' ),
- 'autocomplete' => 'tel',
- 'priority' => 25,
- );
- return $fields;
- }
- add_action( 'woocommerce_admin_order_data_after_shipping_address', 'sg_shipping_phone_checkout_display' );
- function sg_shipping_phone_checkout_display( $order ){
- echo '<p><b>Shipping Phone:</b> ' . get_post_meta( $order->get_id(), '_shipping_phone', true ) . '</p>';
- }
- /* == END: Add Shipping Phone - WooCommerce == */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement