• Resolved bigtiny

    (@bigtiny)


    Hi, I can’t seem to get the right php function code for this:

    (1) remove the logo, shop name and address on my packing slip.
    (2) display delivery instructions on my packing slip.

    Please help!
    Thank you.
    bigtiny

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

    (@yordansoares)

    Hi @bigtiny,

    Hi, I can’t seem to get the right php function code for this:
    (1) remove the logo, shop name and address on my packing slip.

    Add this code snippet to your site to do it:

    /**
     * Remove the logo, shop name and address on packing slip
     */
    add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_custom_styles', 10, 2 );
    function wpo_wcpdf_custom_styles ( $document_type, $document ) {
    	if ( $document_type == 'packing-slip' ) {
    		?>
    		table.head.container {
    			display: none;
    		}
    		<?php
    	}
    }

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

    (2) display delivery instructions on my packing slip.

    If you need to add the same notes for all your packing slips, you can do it using the following code:

    /**
     * Display delivery instructions on packing slip after customer notes
     */
    
    add_action('wpo_wcpdf_after_customer_notes', function( $template_type, $order ){
    	if( $template_type == 'packing-slip' ){
    		?>
    		<h3>Delivery Instructions</h3>
    		<p>Your delivery notes go here :)</p>
    		<?php
    	}
    }, 10, 2);
    Thread Starter bigtiny

    (@bigtiny)

    Hi Yordan

    (1) Thanks so much for the code to remove the logo, shop name and address.
    That works.

    However, I do not need to add the same notes for all your packing slips.

    (2) I wish to display the delivery instructions by my customers on my packing slip.

    (3) I would also like to remove Shipping Method from the packing slip.

    Appreciate your guidance!
    Thank you.
    bigtiny

    Plugin Contributor Yordan Soares

    (@yordansoares)

    I wish to display the delivery instructions by my customers on my packing slip.

    Are you referring to the customer notes? If so, our plugin displays them by default. Maybe you’re using a custom template. You can check this under WooCommerce > PDF Invoices > General > Choose a template: check if Simple is the template selected. If not, try temporarily switching to Simple and try again.

    I would also like to remove Shipping Method from the packing slip.

    Please replace the first code snippet I sent you above for this one to hide the shipping method too:

    /**
     * Remove the logo, address & shop name, and shipping method on packing slip
     */
    add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_custom_styles', 10, 2 );
    function wpo_wcpdf_custom_styles ( $document_type, $document ) {
    	if ( $document_type == 'packing-slip' ) {
    		?>
    		table.head.container,
    		tr.shipping-method {
    			display: none;
    		}
    		<?php
    	}
    }
    Thread Starter bigtiny

    (@bigtiny)

    This totally works!
    You’re brilliant.
    Tysm ??
    bigtiny

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘【Packing Slip】Remove Logo ; Show Delivery Instructions’ is closed to new replies.