• Resolved Atar1

    (@atar1)


    Hello

    I was wondering if there is a way to use a different template for the Invoice and the packing slip. I want the Invoice to display the company logo and the Company address (as that gets sent via mail to the customer) but don’t want it to display on the packing slip (as I print them on already printed paper). Is there a way to achieve this?

    Thanks for your help
    Marco

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @atar1,

    Yes, there is! You can achieve what you describe with the following code snippet:

    /**
     * PDF Invoices & Packing Slips for WooCommerce:
     * Adds custom styles to the PDF documents
     */
    add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) {
    		?>
    		/* Hide the packing slip header and footer */
    		.packing-slip table.head.container,
    		.packing-slip #footer {
    			visibility: hidden;
    		}
    		<?php
    }, 10, 2 );

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

    Please note that I have also added the footer selector (.packing-slip #footer), but feel free to remove it, if you only want to hide the packing slip header (do not forget to remove the comma of the previous line, if you do so).

    Thread Starter Atar1

    (@atar1)

    Hello @yordansoares

    Thank you for helping with my issue.
    I tried your code using the “Snippets” Plugin. However the Packing Slip now does not get displayed at all. Only the Black bar from the table gets displayed. Am I doing something wrong?

    Thank you for your help.

    Thread Starter Atar1

    (@atar1)

    Hello @yordansoares again

    It seemed to be a Problem with the Plugin itself on my local Testsite. I resolved the Problem and the Code is now working as intended. Thanks again and sorry for the hustle.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @atar1,

    I’m glad to hear that you managed to solve the issue with the plugin, and the code snippet is working!

    If you don’t mind and have the time, do you think you could leave us a review?

    Thanks in advance and all the best with your store!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Different templates’ is closed to new replies.