WC_Cart::find_product_in_cart PHP Method

find_product_in_cart() public method

Cart item key will be unique based on the item and its properties, such as variations.
public find_product_in_cart ( $cart_id = false ) : string
return string cart item key
    public function find_product_in_cart($cart_id = false)
    {
        if (false !== $cart_id) {
            if (is_array($this->cart_contents) && isset($this->cart_contents[$cart_id])) {
                return $cart_id;
            }
        }
        return '';
    }
WC_Cart