Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor kluver

    (@kluver)

    Hi @harutyun06,

    The easiest way to add the shipping method to your footer is with our Premium templates extension. You can then simply use the {{shipping_method}} placeholder in the footer field.

    You can achieve something similar with the following code snippet:

    add_filter( 'wpo_wcpdf_footer_settings_text', 'wpo_wcpdf_add_shipping_method_to_footer', 10, 2 );
    function wpo_wcpdf_add_shipping_method_to_footer( $text, $document ) {
    	if ( $document->get_type() == 'invoice' ) {
    		$text .= sprintf(' <p>%s</p>', $document->order->get_shipping_method() );
    	}
    	return $text;
    }

    This code snippet should be added to the functions.php of your child theme or via a plugin like Code Snippets. If you haven’t worked with code snippets or functions.php before please read this: How to use filters

    Thread Starter harutyun06

    (@harutyun06)

    I am sorry but the code is not working :/

    Plugin Contributor kluver

    (@kluver)

    This is working without any issues on my local environment. How did you add the filter to your site? Are you sure it is being called?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Plugin footer’ is closed to new replies.