Hi @pomagaj,
We have applied several changes to the PDF documents to make them compatible with the PDF engines we use (dompdf and mPDF), and this has changed the document structure a bit, including the CSS selectors.
That said, the following code snippet should work for you:
/**
* PDF Invoices & Packing Slips for WooCommerce
* Apply custom styles to the PDF documents
*/
add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) {
?>
/* Hide the weight in all PDF documents */
.item-meta .weight { display:none }
<?php
}, 10, 2 );
Let me know whether it worked or not!
Yes, this code works. Thank you very much!
Hello, how can I hide all the meta fields of the product only for the Packing Slip document? A plugin that allows me to make measurements writes the price in these meta fields and I don’t want it to write the price in this document.
Hi @barisyildirimc,
Try with this code snippet that I just wrote for you:
/**
* PDF Invoices & Packing Slips for WooCommerce
* Apply custom styles to the PDF packing slip
*/
add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) {
if ( 'packing-slip' === $document_type ) {
?>
/* Hide item meta from packing slip */
.item-meta { display:none }
<?php
}
}, 10, 2 );
P.S.: Please open a new topic, if you have more questions! 😉