• Resolved digitaltreecompany

    (@digitaltreecompany)


    How to remove the “Print PDF Invoice” and “Print PDF Packing Slip” actions from the “Bulk actiona” list?

    I tried unsuccessfully the following snippet:

    function remove_pdf_bulk_actions($bulk_actions) {
    unset($bulk_actions['generate_pdf_invoice']);
    unset($bulk_actions['generate_pdf_packing_slip']);
    return $bulk_actions;
    }

    add_filter('bulk_actions-edit-shop_order', 'remove_pdf_bulk_actions');

    Bonus question: how to remove the “Create PDF” section when editing an order without using the screen filters?

    Thanks a lot for your insights.

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

    (@yordansoares)

    Hi @digitaltreecompany,

    How to remove the “Print PDF Invoice” and “Print PDF Packing Slip” actions from the “Bulk actiona” list? I tried unsuccessfully the following snippet [cod]

    Try this code snippet instead:

    /**
    * PDF Invoices & Packing Slips for WooCommerce:
    * Remove the bulk actions to generate PDF documents from the orders list
    */
    add_filter( 'wpo_wcpdf_bulk_actions', function( $actions ) {
    $actions = array();
    return $actions;
    }, 10, 1 );

    Bonus question: how to remove the “Create PDF” section when editing an order without using the screen filters?

    I just wrote a second code snippet that should work to achieve this:

    /**
    * PDF Invoices & Packing Slips for WooCommerce:
    * Remove the PDF document metaboxes
    */
    add_action( 'add_meta_boxes_shop_order' , function() {
    // "PDF document data" metabox
    remove_meta_box( 'wpo_wcpdf-data-input-box', 'shop_order', 'normal');

    // "Create PDF" metabox
    remove_meta_box( 'wpo_wcpdf-box', 'shop_order', 'side');
    },99 );

    I have included the “PDF document data” metabox, but feel free to remove that line if you desire to keep this metabox enabled.

    Thread Starter digitaltreecompany

    (@digitaltreecompany)

    Hi @yordansoares,

    Thanks a lot for your snippets; they both work perfectly!

    Amazing turnaround, thank you!

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @digitaltreecompany,

    Thanks for confirming that the code snippets worked! ??

    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!

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