• How can I check cart contains Composite Products?
    I want to run a codintion on my card if cart contain Composite Products.
    Please let me know what’s the hook or condition.

Viewing 1 replies (of 1 total)
  • Plugin Author WPClever

    (@wpclever)

    Hi @rokeyfx,

    You can check if a cart item has the value for ‘wooco_ids’.
    Example:

    foreach ( WC()->cart->cart_contents as $cart_item_key => $cart_item ) {
        if ( isset( $cart_item['wooco_ids'] ) && ! empty( $cart_item['wooco_ids'] ) ) {
            // this is a composite
        }
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Check cart’ is closed to new replies.