Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Last active April 11, 2025 11:31
Show Gist options
  • Select an option

  • Save webtoffee-git/1fe2875e265cbab130b0ac1a9b8e3c64 to your computer and use it in GitHub Desktop.

Select an option

Save webtoffee-git/1fe2875e265cbab130b0ac1a9b8e3c64 to your computer and use it in GitHub Desktop.
Code for showing total column in packingslip - By WebToffee ( WooCommerce PDF Invoice, Packing Slips, Delivery Notes and Shipping labels )
<?php //do not copy this line of code
add_filter( 'wf_pklist_alter_product_table_head', 'add_total_wieght_column_head', 10, 3);
function add_total_wieght_column_head( $columns_list_arr, $template_type, $order ) {
if ( 'packinglist' === $template_type ) {
if ( isset( $columns_list_arr['-total_weight'] ) ) {
$columns_list_arr['total_weight'] = $columns_list_arr['-total_weight'];
unset( $columns_list_arr['-total_weight'] );
}
}
return $columns_list_arr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment