How to display product dimension in Shipment labels in WooCommerce Stamps.com Plugin?

The WooCommerce Stamps.com Shipping plugin does not show product dimensions in shipping label, by default. You can print these product dimensions in your labels using the code snippet given below.

But remember, the following code snippet can only be applied to shipment labels of Stamps domestic service.

Code snippet to display product dimension in Stamps shipping label

Add the following code snippet in the functions.php file of your website theme.

add_filter('wf_stamps_request', 'xa_print_pkg_dimension_stamps', 1, 100);

function xa_print_pkg_dimension_stamps($request) {
$obj = new WF_USPS_Stamps();
if($obj->packing_method != 'weight_based'){
$request['printMemo'] = true;
$request['memo'] = 'Pkg Dimension(L*W*H) = ' . $request['Rate']['Length'] . '*' . $request['Rate']['Width'] . '*' . $request['Rate']['Height'] ;
}
return $request;
}

To know more about the product, check out Stamps.com Shipping Plugin with USPS Postage for WooCommerce.

To know more about other features of the plugin, read product setting up article.

Or check out documentation section for more related articles.

    Leave a Reply