Hi,
First of all, I apologize for the delay in getting back to you on this.
Here’s a filter that can hide the shipping method in the invoice print. Add this code snippet in functions.php file of your currently active theme.
/**
* Add this code snippet in the functions.php file of your currently active theme.
* Removing the shipping Via method in WC.
*/
function custom_shipping_to_display_shipped_via( $shipping, $order ) {
// Modify the $shipping string to remove 'via' and the shipping method.
$shipping_method = $order->get_shipping_method();
$via_position = strpos( $shipping, 'via ' . $shipping_method );
if ( $via_position !== false ) {
$shipping_without_via = substr( $shipping, 0, $via_position );
$shipping_without_method = rtrim( $shipping_without_via, ' ' );
$shipping = $shipping_without_method;
}
return $shipping;
}
add_filter( 'woocommerce_order_shipping_to_display_shipped_via', 'custom_shipping_to_display_shipped_via', 10, 2 );
Note: This filter is from Woocmmerece, so it will also hide the shipping method title in your order table. We have specially modified this code for you to hide the shipping method in the value.
Please close this thread if the given solution works for you.
Regards,
Nikhil.