Remove “is_order_bump_purchase: true” from PDFs
-
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.
- The topic ‘Remove “is_order_bump_purchase: true” from PDFs’ is closed to new replies.