Hello @fafa24,
Are you trying to attach a screenshot? If so, please use an image sharing service like imgur.com to do it.
Thread Starter
fafa24
(@fafa24)
Sorry I forgot to attach the screenshot file.
Here it is again.
Screenshot
I hope with this link, it will work.
-
This reply was modified 5 years, 1 month ago by
fafa24.
Hello @fafa24,
Thanks for sharing the screenshot.
Please add this code snippet to do it:
add_action('wpo_wcpdf_before_shop_name', function( $template_type, $order ){
if ($template_type == 'invoice') {
if ( $document = wcpdf_get_document( $template_type, $order ) ) {
$document_title = $document->get_title();
printf('<h1 class="document-type-label">%s</h1>', $document_title );
}
}
}, 10, 2);
add_action( 'wpo_wcpdf_custom_styles', function( $template_type, $document ) {
?>
.invoice > .document-type-label {
display: none;
}
<?php
}, 10, 2 );
Let me know if it works! 🙂
Thread Starter
fafa24
(@fafa24)
Thank you! The code works great for the invoice, but not for the delivery note.
I guess for testing I should turn on the “text mode” and later uncheck it again after testing.
Edy
Hello @fafa24,
Oh, sorry! I just realized that you ask the code for packing slips instead of invoices.
Please use this code instead to include the packing slips too:
add_action('wpo_wcpdf_before_shop_name', function( $template_type, $order ){
if ( $document = wcpdf_get_document( $template_type, $order ) ) {
$document_title = $document->get_title();
printf('<h1 class="document-type-label">%s</h1>', $document_title );
}
}, 10, 2);
add_action( 'wpo_wcpdf_custom_styles', function( $template_type, $document ) {
?>
body > .document-type-label {
display: none;
}
<?php
}, 10, 2 );
I would love to know if it works 🙂
Thread Starter
fafa24
(@fafa24)
It’s perfect now! Many thanks
I’m glad to know it!
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!