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

    (@yordansoares)

    Hi @holisticmissions,

    You can try with the following snippet:

    /**
    * PDF Invoices & Packing Slips for WooCommerce
    * Apply custom styles to the PDF documents
    */
    add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) {
    ?>
    /* Hide item meta in packing slips */
    .packing-slip .item-meta { display:none }
    <?php
    }, 10, 2 );

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

    Thread Starter holisticmissions

    (@holisticmissions)

    That works to hide everything meta, but it is hiding a couple of things that I would like to display. Also, I would like to hide the Backorder status and ETA date on the invoice as well as the packing slip.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Could you please send me the details of an order which includes both the metas for Backorder and ETA?date?

    ec3fa15c38aed234e9c9accb059d97f4.png

    This is an example screenshot of the order details from a sample order.

    Thread Starter holisticmissions

    (@holisticmissions)

    I am not sure how to embed the image, so here is the image that you can download to view.

    https://ibb.co/DDt5yFVz

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Thanks for sharing that screenshot, @holisticmissions:

    Please try this code snippet:

    /**
    * PDF Invoices & Packing Slips for WooCommerce:
    * Unset specific item meta data from PDF documents
    */
    add_filter( 'wpo_wcpdf_html_filters', function( $filters ) {
    $filters[] = array( 'woocommerce_order_item_get_formatted_meta_data', 'wpo_remove_specific_item_meta_from_pdf_documents', 999, 2 );
    return $filters;
    } );
    function wpo_remove_specific_item_meta_from_pdf_documents( $formatted_meta, $item ){
    foreach( $formatted_meta as $key => $meta ){
    if( in_array( $meta->key, array( 'Backordered', 'ETA' ) ) ) {
    unset( $formatted_meta[$key] );
    }
    }
    return $formatted_meta;
    }

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

    Thread Starter holisticmissions

    (@holisticmissions)

    That works perfectly. Thank you.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    I’m glad to hear that, @holisticmissions!

    If you don’t mind and have the time, do you think you could leave us a review?

    Thanks in advance, and do not hesitate to write again if you need more help! ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.