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
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?