Skip to content

Instantly share code, notes, and snippets.

@xadapter
Created October 12, 2017 11:28
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 xadapter/07dfe5c8e931e41f1ee85ddc440a7c3b to your computer and use it in GitHub Desktop.
Save xadapter/07dfe5c8e931e41f1ee85ddc440a7c3b to your computer and use it in GitHub Desktop.
Add product dimensions in Packing Slip and Delivery Note with Xadapter Print Invoice, Packing Slip, Delivery Note & Label for WooCommerce
add_filter('woocommerce_order_product_title_for_pk_list', 'xa_product_dimension_add_func',99,2);
function xa_product_dimension_add_func($item_name ='', $product ='')
{
if(!empty($product))
{
return $item_name . ' <small>( '.wc_format_dimensions($product->get_dimensions(false)).' )</small>';
}else
{
return $item_name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment