The Product Bundles add-on from WooCommerce allows you to bundle multiple products into a group for sale. Usually, when these are purchased, the Social Checkout for WooCommerce plugin will show sharing links for the bundle product, and all of the individual items in the bundle as well. If you would prefer to just show the main bundle product, and not the individual items, then adding the following snippet to your theme’s functions.php file, or a functionality plugin will exclude them from having sharing links shown.

function lw_woo_sc_order_line_items( $items, $order ) {
    foreach ( $items as $key => $item ) {
        if ( ! empty( $item['item_meta']['_bundled_by'] ) ) {
            unset( $items[ $key ] );
        }
    }
    return $items;
}
add_filter( 'woo_sc_order_line_items', 'lw_woo_sc_order_line_items', 10, 2 );

This entry was posted in .
Bookmark the permalink.