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

    Our developer will check on your query and will get back to you with an update on this soon.

    Regards,
    Kenil Shah

    alasdairmacewan

    (@alasdairmacewan)

    Hi im having the exact same problem, has a solution been found to this issue as i would love to know, many thanks

    Thread Starter denialdesign

    (@denialdesign)

    I think this is the code I used:

    
    add_filter( 'woocommerce_order_item_visible', 'wc_cp_order_item_visible', 10, 2 );
    add_filter( 'woocommerce_widget_cart_item_visible', 'wc_cp_cart_item_visible', 10, 3 );
    add_filter( 'woocommerce_cart_item_visible', 'wc_cp_cart_item_visible' , 10, 3 );
    add_filter( 'woocommerce_checkout_cart_item_visible', 'wc_cp_cart_item_visible', 10, 3 );
    
    /** Visibility of components in orders.
     *
     * @param  boolean $visible
     * @param  array   $order_item
     * @return boolean
     */
    function wc_cp_order_item_visible( $visible, $order_item ) {
    
        if ( ! empty( $order_item[ 'composite_parent' ] ) ) {
            $visible = false;
        }
    
        return $visible;
    }
    
    /**
     * Visibility of components in cart.
     *
     * @param  boolean $visible
     * @param  array   $cart_item
     * @param  string  $cart_item_key
     * @return boolean
     */
    function wc_cp_cart_item_visible( $visible, $cart_item, $cart_item_key ) {
    
        if ( ! empty( $cart_item[ 'composite_parent' ] ) ) {
            $visible = false;
        }
    
        return $visible;
    }
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Hiding Composite Items’ is closed to new replies.