Skip to content

Instantly share code, notes, and snippets.

@PluginHive
Created April 22, 2020 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PluginHive/78ca24fde27bf33a4824aceb4f55a4e1 to your computer and use it in GitHub Desktop.
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/
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