Created
April 22, 2020 09:47
-
-
Save PluginHive/78ca24fde27bf33a4824aceb4f55a4e1 to your computer and use it in GitHub Desktop.
Code snippet to display the Shipping phone number in the FedEx Shipping label in place of the billing phone number. Required plugin: https://www.pluginhive.com/product/woocommerce-fedex-shipping-plugin-with-print-label/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('wf_fedex_request','my_call_back', 10, 2 ); | |
function my_call_back($request,$order){ | |
$phone = !empty($order->shipping_phone) ? $order->shipping_phone : $order->billing_phone; | |
$request['RequestedShipment']['Recipient']['Contact']['PhoneNumber'] = $phone; | |
return $request; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment