Last active
April 11, 2025 11:31
-
-
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 )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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