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.

    Attached files:  screenshot.png

  •  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,226
    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,226
    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,226
    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