public function add(array $product, array $data)
    {
        $result = array();
        $this->hook->attach('product.compare.add.product.before', $product, $data, $result, $this);

        if (!empty($result)) {
            return (array) $result;
        }

        if (!$this->compare->add($product['product_id'])) {
            return $this->getResultError();
        }

        $result = $this->getResultAdded();
        $this->hook->attach('product.compare.add.product.after', $product, $data, $result, $this);
        return (array) $result;
    }
public function add(array $product, array $data)
    {
        $result = array();
        $this->hook->attach('product.compare.add.product.before', $product, $data, $result, $this);

        if (!empty($result)) {
            return (array) $result;
        }

        if (!$this->compare->add($product['product_id'])) {
            return $this->getResultError();
        }

        $result = $this->getResultAdded();
        $this->hook->attach('product.compare.add.product.after', $product, $data, $result, $this);
        return (array) $result;
    }
public function add ( array $ product , array $ data ) { $ result = array ( ) ; $ this -> hook -> attach ( 'product.compare.add.product.before' , $ product , $ data , $ result , $ this ) ; if ( ! empty ( $ result ) ) { return ( array ) $ result ; } if ( ! $ this -> compare -> add ( $ product [ 'product_id' ] ) ) { return $ this -> getResultError ( ) ; } $ result = $ this -> getResultAdded ( ) ; $ this -> hook -> attach ( 'product.compare.add.product.after' , $ product , $ data , $ result , $ this ) ; return ( array ) $ result ; }
Adds a product to comparison and returns an array of results
@param array $product
@param array $data
@return array
Adds a product to comparison and returns an array of results