Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #3238679
Not including bundled products in order data
Closed

Comments

  •  1
    Bob Urgo started the conversation

    There are options to hide the bundled products on the cart and checkout but we also need them to not be included in the order data. The SKU we have for bundled products already include all the products so we don't need the individual products in the order data.

    So in the screen shot we would just want the first SKU DD67511SD and not the 5 SKUs that come along with it.

    We didn't see any settings for this and were wondering how to accomplish this.

    Thanks,

    Bob U.

  •  767
    Janilyn replied

    Hi Bob,

    Thanks for contacting WPClever Support Forum.

    We’ve received your ticket and assigned one of our developers to help you with that. 

    He’ll be looking into your question and responding with specific instructions as soon as possible. 

    Please stay patient as we're having very heavy workloads, it might take some time for our developers to reach back.

    Best regards.

    Best regards.

    Janilyn T. - WPClever Support Agent

  •  1,355
    Dustin replied

    Hi Bob,

    This screen only appears for administrators, it will help them manage orders easily and clearly. So, I think you shouldn't hide bundled products.

    If you still want to do that, please add the below custom code (How to add custom code?)

    add_filter( 'woocommerce_admin_html_order_item_class', 'woosb_admin_html_order_item_class', 99, 2 );
    function woosb_admin_html_order_item_class( $class, $item ) {
        if ( isset( $item['woosb_parent_id'] ) || isset( $item['_woosb_parent_id'] ) ) {
            return $class . ' woosb-order-item-child';
        }
        if ( isset( $item['woosb_ids'] ) || isset( $item['_woosb_ids'] ) ) {
            return $class . ' woosb-order-item-parent';
        }
        return $class;
    }
    add_action( 'admin_footer', 'woosb_admin_footer', 99 );
    function woosb_admin_footer() {
        ?>
        <style type="text/css">
            .woosb-order-item-child {
                display: none;
            }
        </style>
        <?php
    }

    Best regards,
    Dustin

  •  1
    Bob Urgo replied

    Dustin,

    I was looking to not just hide the info but not include it as part of the order meta data at all. The SKU we have assigned to a bundle is an actual SKU in our system and our orders come over to our system automatically so when it comes over with a bundle SKU as well as all the SKUs of the products that make up the bundle it basically doubles the price in the system because it is bringing along all the products in the order.

    Let me know if that makes sense or if you need more information.

    Thanks,

    Bob

  •  1,355
    Dustin replied

    In this case, please add the below custom code (How to add custom code?)

    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;
    }

    Best regards,
    Dustin

  •  1
    Bob Urgo replied

    Dustin,

    That did the trick. Thank you so much! You can close this ticket.

    Bob

  •  1,355
    Dustin replied

    You're welcome!smile.png

    If you are satisfied with our plugin and support, please reward it with a full five-star ★★★★★ rating. https://wordpress.org/support/plugin/woo-product-bundle/reviews?rate=5#new-post Thank you in advance! ♥

    Best regards,
    Dustin

  •  4
    Zappo replied

    EDIT: Oh, never mind, your FIRST script does exact that. Sorry for interrupting...
    _______________________________________________

    Hi Dustin,

    I know, this is an old thread, but I used the second script since then, as I had the same need as the TO.

    I've already had a conversation with you, because in our shop only the main product is returned to stock in the event of a cancellation, but not the bundled products.

    Of course, it took a few months to realize the problem and I had a really hard time finding the error... and it's this script. 

    When the script is active, the stock is reduced correctly, both from the main product and from the bundled parts. Only the way back (as described above) is unfortunately not possible.

    Could the script be extended or customized in any way?

    In fact, the bundled products should not be visible at least in the backend during order processing, but they should not appear in the mails either.

    Do you see a possibility here? Many thanks in advance for your help!

    Best regards
    Joerg

    Attached files:  Bildschirmfoto 2025-02-27 um 10.36.14.png

  •  4
    Zappo replied

    Hi Dustin,

    sorry for interrupting again, I'm now confused about the settings in the plugin, your first script below and what is visible in the order details (wp-admin backend order management):

    The settings say: "Hide bundled products on order details: Yes, just show the main bundles" - but the bundled products are visible in the order. So what does this setting do? To hide the bundled products, I have to use the script...

    Also, the "packing list" (Sendungen in German, I don't know the correct English name) includes both, the main product (screenshot red) and the bundlet products (screenshot green), either or would be nice.

    Can you help me here and bring some clarity to the matter?

    Best regard
    Joerg

    Attached files:  Bildschirmfoto 2025-02-28 um 15.04.02.png

  •  1,355
    Dustin replied

    Hi Zappo,

    We provide premium support exclusively for users who have purchased the premium plugin. Please submit a new ticket and provide your license key or email so I can verify your purchase.

    Best regards,
    Dustin