Title: Remove details in invoice
Last modified: April 15, 2020

---

# Remove details in invoice

 *  Resolved [danekhoo](https://wordpress.org/support/users/danekhoo/)
 * (@danekhoo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/)
 * Hi there,
 * I’ve been using your plugin for many years and we’re very happy with it so far
   as it’s given us zero issues.
 * Lately, we’ve implemented a new product inventory system called ATUM and it’s
   basically allow us to have Build of Materials (BOM) for our unique ordering configurator.
 * How can we disable the BOM list from being printed on the invoice? Below are 
   the sample image.
 * BOM list on Order Details – [https://imgur.com/p9eW5fY](https://imgur.com/p9eW5fY)
   
   PDF details – [https://imgur.com/vmzu41F](https://imgur.com/vmzu41F)
 * Your assistance is much appreciated. Thank you and stay safe!
    -  This topic was modified 6 years, 1 month ago by [danekhoo](https://wordpress.org/support/users/danekhoo/).
    -  This topic was modified 6 years, 1 month ago by [danekhoo](https://wordpress.org/support/users/danekhoo/).

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Contributor [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * (@alexmigf)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/#post-12683204)
 * Hello [@danekhoo](https://wordpress.org/support/users/danekhoo/)
 * First you have to discover what custom field that plugin is giving to the order
   items. Read this about [Finding WooCommerce custom fields](https://docs.wpovernight.com/general/finding-woocommerce-custom-fields/).
 * Then you just need to paste that custom field name (‘custom_meta_name’) on this
   snippet and should do the trick:
 *     ```
       add_filter( 'wpo_wcpdf_order_items_data', 'wpo_wcpdf_hide_products_invoice', 10, 3 );
       function wpo_wcpdf_hide_products_invoice( $items, $order )
       {
   
           if ($order->get_document() == 'invoice') {
   
       		$items = $order->get_items();
   
       		foreach( $items as $key => $item ) {
       			if( wc_get_order_item_meta( $item->get_id(), 'custom_meta_name', true ) ) {
       				unset($items[$key]);
       			}
       		}
   
           }
   
           return $items;
       }
       ```
   
 * If you never worked with filters/actions please read this documentation: [How to use filters](https://docs.wpovernight.com/general/how-to-use-filters/).
    -  This reply was modified 6 years, 1 month ago by [alexmigf](https://wordpress.org/support/users/alexmigf/).
    -  This reply was modified 6 years, 1 month ago by [alexmigf](https://wordpress.org/support/users/alexmigf/).
    -  This reply was modified 6 years, 1 month ago by [alexmigf](https://wordpress.org/support/users/alexmigf/).
 *  Thread Starter [danekhoo](https://wordpress.org/support/users/danekhoo/)
 * (@danekhoo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/#post-12686951)
 * Hi Alex,
 * Thanks for the feedback. I’ve identified the ‘custom_meta_name’ which is
 * But got hit by this fatal Error when generating the invoice:-
 * Fatal error: Call to undefined method Automattic\WooCommerce\Admin\Overrides\
   Order::get_document()
    #0 /home/sabertri/public_html/wp-includes/class-wp-hook.
   php(287): wpo_wcpdf_hide_products_invoice(Array, Object(Automattic\WooCommerce\
   Admin\Overrides\Order), ‘invoice’) #1 /home/sabertri/public_html/wp-includes/
   plugin.php(206): WP_Hook->apply_filters(Array, Array) #2 /home/sabertri/public_html/
   wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/
   abstract-wcpdf-order-document-methods.php(590): apply_filters(‘wpo_wcpdf_order…’,
   Array, Object(Automattic\WooCommerce\Admin\Overrides\Order), ‘invoice’) #3 /home/
   sabertri/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/
   templates/Simple/invoice.php(94): WPO\WC\PDF_Invoices\Documents\Order_Document_Methods-
   >get_order_items() #4 /home/sabertri/public_html/wp-content/plugins/woocommerce-
   pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(
   742): include(‘/home/sabertri/…’) #5 /home/sabertri/public_html/wp-content/plugins/
   woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-
   document.php(646): WPO\WC\PDF_Invoices\Documents\Order_Document->render_template(‘/
   home/sabertri/…’, Array) #6 /home/sabertri/public_html/wp-content/plugins/woocommerce-
   pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(
   628): WPO\WC\PDF_Invoices\Documents\Order_Document->get_html() #7 /home/sabertri/
   public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/
   documents/abstract-wcpdf-order-document.php(664): WPO\WC\PDF_Invoices\Documents\
   Order_Document->get_pdf() #8 /home/sabertri/public_html/wp-content/plugins/woocommerce-
   pdf-invoices-packing-slips/includes/class-wcpdf-main.php(337): WPO\WC\PDF_Invoices\
   Documents\Order_Document->output_pdf(‘inline’) #9 /home/sabertri/public_html/
   wp-includes/class-wp-hook.php(287): WPO\WC\PDF_Invoices\Main->generate_pdf_ajax(”)#
   10 /home/sabertri/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”,
   Array) #11 /home/sabertri/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(
   Array) #12 /home/sabertri/public_html/wp-admin/admin-ajax.php(175): do_action(‘
   wp_ajax_generat…’) #13 {main}
 * Could I be using the wrong meta name?
 *  Plugin Contributor [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * (@alexmigf)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/#post-12687827)
 * Hello [@danekhoo](https://wordpress.org/support/users/danekhoo/)
 * My mistake, sorry. Please update with this one:
 *     ```
       add_filter( 'wpo_wcpdf_order_items_data', 'wpo_wcpdf_hide_products_invoice', 10, 3 );
       function wpo_wcpdf_hide_products_invoice( $items, $order )
       {
   
           if ( wcpdf_get_document( 'invoice', $order, true ) ) {
   
       		$items = $order->get_items();
   
       		foreach( $items as $key => $item ) {
       			if( wc_get_order_item_meta( $item->get_id(), 'custom_meta_name', true ) ) {
       				unset($items[$key]);
       			}
       		}
   
           }
   
           return $items;
       }
       ```
   
 * Let me know.
    -  This reply was modified 6 years, 1 month ago by [alexmigf](https://wordpress.org/support/users/alexmigf/).
    -  This reply was modified 6 years, 1 month ago by [alexmigf](https://wordpress.org/support/users/alexmigf/).
 *  Thread Starter [danekhoo](https://wordpress.org/support/users/danekhoo/)
 * (@danekhoo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/#post-12695999)
 * Hi Alex,
 * The new code does not give an error anymore, however I can’t seemed to selectively
   remove the ones in circle. When I use ‘custom_meta_name’, all of the product 
   items is missing from the invoice.
 * Items required to be remove: [https://imgur.com/vmzu41F](https://imgur.com/vmzu41F)
 * This is the custom fields – [https://imgur.com/mpOxc8A](https://imgur.com/mpOxc8A)
 * Is it possible to find a way to specifically remove them?
 *  Plugin Contributor [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * (@alexmigf)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/#post-12699882)
 * Hello [@danekhoo](https://wordpress.org/support/users/danekhoo/)
 * Looking at your order meta i can’t see how to hide those products. Could you 
   tell me if there’s some specific meta on that products? You can share the screenshot
   of that meta?
    -  This reply was modified 6 years, 1 month ago by [alexmigf](https://wordpress.org/support/users/alexmigf/).
    -  This reply was modified 6 years, 1 month ago by [alexmigf](https://wordpress.org/support/users/alexmigf/).
 *  Thread Starter [danekhoo](https://wordpress.org/support/users/danekhoo/)
 * (@danekhoo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/#post-12700684)
 * Hi Alex,
 * This is an example of one of the products I want to hide.
    – [https://imgur.com/WRIlepO](https://imgur.com/WRIlepO)
 * It seemed to share the same meta of the products that I do not want to hide…
 *  Plugin Contributor [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * (@alexmigf)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/#post-12700703)
 * Hello [@danekhoo](https://wordpress.org/support/users/danekhoo/)
 * That’s from the order items, i mean from the product itself: WordPress Dashboard
   > Products
 * Let me know.
 *  Thread Starter [danekhoo](https://wordpress.org/support/users/danekhoo/)
 * (@danekhoo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/#post-12701185)
 * Hi ALex,
 * Hope these help:-
 * > [View post on imgur.com](https://imgur.com/5lKpR3j)
 * > [View post on imgur.com](https://imgur.com/KSIfus9)
 * > [View post on imgur.com](https://imgur.com/Mm3p3IS)
 * > [View post on imgur.com](https://imgur.com/nVp7iL5)
 * > [View post on imgur.com](https://imgur.com/LcPiAeo)
 * > [View post on imgur.com](https://imgur.com/CQyPkLw)
 * > [View post on imgur.com](https://imgur.com/JYQnCgK)
 * > [View post on imgur.com](https://imgur.com/xxb9QXF)
 * > [View post on imgur.com](https://imgur.com/tm7twce)
 * > [View post on imgur.com](https://imgur.com/5OyoWOg)
 * > [View post on imgur.com](https://imgur.com/IAy6V2M)
 * > [View post on imgur.com](https://imgur.com/xZjD6Sq)
 * > [View post on imgur.com](https://imgur.com/M2j6rBp)
 * > [View post on imgur.com](https://imgur.com/vXOEHDj)
 * Thanks,
    Dane
    -  This reply was modified 6 years, 1 month ago by [Yui](https://wordpress.org/support/users/fierevere/).
    -  This reply was modified 6 years, 1 month ago by [danekhoo](https://wordpress.org/support/users/danekhoo/).
 *  Plugin Contributor [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * (@alexmigf)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/#post-12702220)
 * Hi [@danekhoo](https://wordpress.org/support/users/danekhoo/)
 * I suggest you to contact support from the ATUM inventory manager plugin and ask
   how to detect a BOM element product. With that information we can then incorporate
   that into the code.
 * Let me know.
 *  Thread Starter [danekhoo](https://wordpress.org/support/users/danekhoo/)
 * (@danekhoo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/#post-12705900)
 * Hi Alex,
 * This is their reply:-
 * If they are asking what method we use to get any product’s linked BOM, it’s this
   one:
 * BOMModel::get_linked_bom()
 *  Plugin Contributor [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * (@alexmigf)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/#post-12714372)
 * Hello [@danekhoo](https://wordpress.org/support/users/danekhoo/)
 * You can [drop us an email](https://wordpress.org/support/topic/remove-bom-data/support@wpovernight.com?output_format=md),
   we will try to help you the best we can.
 *  Thread Starter [danekhoo](https://wordpress.org/support/users/danekhoo/)
 * (@danekhoo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/#post-12717291)
 * Hi Alex, email sent. Thanks again.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Remove details in invoice’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

## Tags

 * [hide products](https://wordpress.org/support/topic-tag/hide-products/)

 * 12 replies
 * 2 participants
 * Last reply from: [danekhoo](https://wordpress.org/support/users/danekhoo/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/remove-bom-data/#post-12717291)
 * Status: resolved