public function productId(array $condition, array $data)
    {
        if (empty($data['cart']['items']) || !in_array($condition['operator'], array('=', '!='))) {
            return false;
        }

        $ids = array();

        foreach ($data['cart']['items'] as $item) {
            $ids[] = $item['product_id'];
        }

        return $this->compare($ids, $condition['value'], $condition['operator']);
    }
public function productId(array $condition, array $data)
    {
        if (empty($data['cart']['items']) || !in_array($condition['operator'], array('=', '!='))) {
            return false;
        }

        $ids = array();

        foreach ($data['cart']['items'] as $item) {
            $ids[] = $item['product_id'];
        }

        return $this->compare($ids, $condition['value'], $condition['operator']);
    }
public function productId ( array $ condition , array $ data ) { if ( empty ( $ data [ 'cart' ] [ 'items' ] ) || ! in_array ( $ condition [ 'operator' ] , array ( '=' , '!=' ) ) ) { return false ; } $ ids = array ( ) ; foreach ( $ data [ 'cart' ] [ 'items' ] as $ item ) { $ ids [ ] = $ item [ 'product_id' ] ; } return $ this -> compare ( $ ids , $ condition [ 'value' ] , $ condition [ 'operator' ] ) ; }
Whether the cart product ID condition is met
@param array $condition
@param array $data
@return boolean
Whether the cart product ID condition is met