Search Knowledge Base by Keyword

Is there any way to print order number generated by WooCommerce to be printed on shipping label?

WooCommerce FedEx Shipping Plugin with Print Label allows you to print shipping labels right from the admin side. But can you print the order number generated by WooCommerce on the shipping label? Find out below.

Customer:

Is there any way to print order number generated by WooCommerce to be printed on shipping label generated by your FedEx shipping label plugin?

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 FedEx 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

 


Last Updated On September 21, 2018

2 thoughts on “Is there any way to print order number generated by WooCommerce to be printed on 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.