Hi @schnugo,
That’s quite strange. How did you insert this snippet?
My recommended way is using the Code Snippets plugin. I understand that maybe you might not want to add YET ANOTHER PLUGIN but I really think this is a clean way of managing your extra/external code. 🙂
Install that then add this updated code snippet:
add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_hide_shipping_text', 10, 2 );
function wpo_wcpdf_hide_shipping_text ( $document_type, $document ) {
?>
.shipped_via { display: none !important; }
<?php
}
-
This reply was modified 5 years, 7 months ago by
Darren Peyou.
Thx a lot for your answer. It’s really strange. I had the code in the plugin “Simple Custom CSS”
.shipped_via
{
display: none !important;
}
Now I added your code to the snippet and it worked for the PDF invoice. But when I delete the code above from the plugin “Simple Custom CSS”, the text “via shipping” is shown at the Thank You page!?
Now I use both codes – one in the CSS and one in the snippet and now both “via shipping” are gone 🙂
If there is a better way to manage both with one code, it will be great. Otherwise this solution is fine for me.
Hey @schnugo,
That’s interesting! I truly only knew about hiding it from the invoice. I believe you’ll indeed have to keep both if you’re also trying to hide it from WooCommerce. Glad you figured it out!
Thank you for your help! Have a nice day!