• Hi.

    Is there any option to hide the parent (Composite) product?.
    I just want the components to be shown on the cart and the purchase, but not the composite.

    Thanks!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WPClever

    (@wpclever)

    Hi,

    Please try below snippet (How to add a snippet?):

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

    The main composite product still is added to the cart (buyer can change the quantity or remove the whole composite) but it will be excluded from the order.

    You also can try another plugin from us https://ww.wp.xz.cn/plugins/wpc-grouped-product/

    This works but hides the composite entirely in the email confirmation. Can you help w that?

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

The topic ‘Hide composite product’ is closed to new replies.