Is there any way to Print Order number generated by WooCommerce to be printed on FedEx shipping label?
In this guide, we are going to take a real-life example where a WooCommerce user wanted to print WooCommerce Order number on the FedEx shipping label generated by WooCommerce FedEx Shipping plugin.
WooCommerce FedEx Shipping Plugin with Print Label allows you to print shipping labels right from the admin side. It also allows you to print and display the Order number generated by WooCommerce on the label. This could help you manage your orders and the corresponding shipping labels better.
Let’s take the example of one of our customers who wanted to do that same. Please read along to understand his business requirements.
Is there any way to print order number generated by WooCommerce to be printed on shipping label generated by your WooCommerce FedEx Shipping Plugin with Print Label?
We allow customers to do multiple shipping addresses in the same order, and it would help a lot to be able to group them via order number when we print shipping labels.
The order number comes perfectly in the label generated by our WooCommerce FedEx Shipping Plugin. However, for this, you need to use the below code snippet in functions.php to achieve this.
add_filter(‘wf_fedex_request’,’wf_fedex_label_request_reff_callback’, 10, 2 );
$po_number = ”; $customs_duties_payer = ‘SENDER’;
$reff = array();
$reff[‘CustomerReferences’] = array( ‘CustomerReferenceType’ => ‘P_O_NUMBER’, ‘Value’ => $po_number ); $reff[‘CustomerReferences’] = array( ‘CustomerReferenceType’ => ‘CUSTOMER_REFERENCE’, ‘Value’ => $order->id );
$reff[‘CustomerReferences’] = array( ‘CustomerReferenceType’ => ‘DEPARTMENT_NUMBER’, ‘Value’ => ‘Bill Duties : ‘.$customs_duties_payer);
foreach ($request[‘RequestedShipment’][‘RequestedPackageLineItems’] as $key => $value)
$request[‘RequestedShipment’][‘RequestedPackageLineItems’][$key] += $reff;
return $request; }
After using the code snippet, the order number comes perfectly as shown in the screenshot below:
We hope this guide would have helped you. Please visit WooCommerce FedEx Shipping plugin page to know more details.
If you need any help in understanding the process or have a query, feel free to contact our customer support. Our support team should be able to help you set up FedEx shipping on your WooCommerce website.