• Hi,

    how can I hide in the invoices and admin backend (order management) bundled products under the main product? (s. screenshots)

    Screenshot 1
    Screenshot 2

    I only use the plugin to reduce the stock of the individual products contained in the set when placing an order.

    I was able to hide the bundled products in the frontend and in the shopping cart, only for the backend and the invoice I can’t find an option in the settings.

    I found a snippet that does the exact opposite, showing only the bundled products – could this be reversed?

    I hope you can help me because it is very confusing for both the packer and the customer.

    Many thanks in advance.

    BR, Zappo

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @zappob,

    Hi, Please try to add below code to your theme (or child-theme) > functions.php (How to add snippet?):

    add_filter( 'wpo_wcpdf_order_items_data', 'woosb_wcpdf_order_items_data' ); function woosb_wcpdf_order_items_data( $data_list ) { foreach ( $data_list as $key => $data ) { $bundle = wc_get_order_item_meta( $data['item_id'], '_woosb_ids', true ); $bundled_product = wc_get_order_item_meta( $data['item_id'], '_woosb_parent_id', true ); if ( ! empty( $bundle ) ) { // hide bundle //unset( $data_list[ $key ] ); } if ( ! empty( $bundled_product ) ) { // hide bundled product unset( $data_list[ $key ] ); } } return $data_list; } Expand

    Regards,

    Hi!
    I am facing the same issue.
    I tried pasting this code into the code snippets and didn’t work.
    https://snipboard.io/hMjfZk.jpg
    Thanks!

    Thread Starter ZappoB

    (@zappob)

    Hi,

    try this one:

    add_filter( 'woocommerce_order_get_items', 'woosb_exclude_bundled_from_order', 10, 1 );
    function woosb_exclude_bundled_from_order( $items ) {
        foreach ( $items as $key => $item ) {
            if ( $item->meta_exists( '_woosb_parent_id' ) ) {
                unset( $items[ $key ] );
            }
        }
        return $items;
    }

    BR.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide bundled products in invoices and backend admin order management’ is closed to new replies.