Search Knowledge Base by Keyword

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.

Customer:

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.

PluginHive Support:

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 );
function wf_fedex_label_request_reff_callback($request,$order)
{
$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:

shipping label

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.

Happy selling!

Last Updated On May 14, 2019

2 thoughts on “Is there any way to Print Order number generated by WooCommerce to be printed on FedEx shipping label?

  1. support133 says:

    Hello,

    Is there a way to make that reference number (woocommerce order number) double the size that it is in the label?
    Customer has requested this but we do not see where to edit it.

    Thank you

    • Anindo
      Anindo says:

      Hi,

      Thanks for reaching out to us.

      Unfortunately, the reference number cannot be increased in size. This is because, FedEx manages the complete layout of the label. We just feed information to the API.

      You can also confirm with the FedEx integration team.

Comments are closed.