• Resolved Viktor Nagornyy

    (@viktorix)


    This is related to this thread, but I though I’ll keep this separate because it’s related to a specific plugin. Right now, using WooCommerce PDF Invoices & Packing Slips plugin to generate PDFs will include is_order_bump_purchase: true in the PDF.

    I did some testing, it appears that !is_admin() check to unset this order metadata in the class-upsell-order-bump-offer-for-woocommerce-public.php file is not enough.

    I was able to exclude is_order_bump_purchase: true from the packing slip PDF by checking for the plugin’s class like so:

    // Hide bump purchase meta only for Customers.
    			if ( ! is_admin() || class_exists( 'WooCommerce_PDF_Invoices' ) ) {
    
    				foreach ( $formatted_meta as $key => $meta ) {
    
    					if ( ! empty( $meta->key ) && 'is_order_bump_purchase' === $meta->key ) {
    
    						unset( $formatted_meta[ $key ] );
    					}
    				}
    			}

    I don’t know if this is the best solution for this, but it works for now. This will be overwritten on the next update, so I would appreciate a permanent solution.

Viewing 1 replies (of 1 total)
  • MakeWebBetter

    (@makewebbetter)

    Hello,

    Thank you for trying our plugin

    We have checked this from our end and we will try to update it in the core plugin in the upcoming versions,

    If still any issues we are always for help,

    Regards,`

Viewing 1 replies (of 1 total)
  • The topic ‘Remove “is_order_bump_purchase: true” from PDFs’ is closed to new replies.