Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Darren Peyou

    (@dpeyou)

    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.
    Thread Starter schnugo

    (@schnugo)

    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.

    Plugin Contributor Darren Peyou

    (@dpeyou)

    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!

    Thread Starter schnugo

    (@schnugo)

    Thank you for your help! Have a nice day!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Remove text “via shipping” in PDF’ is closed to new replies.