protected function prepareItem(array $item, array $data)
    {
        $product = $this->product->getBySku($item['sku'], $item['store_id']);

        if (empty($product['status']) || $data['store_id'] != $product['store_id']) {
            return array();
        }

        $product['price'] = $this->currency->convert($product['price'], $product['currency'], $data['currency']);

        $calculated = $this->product->calculate($product);

        if ($calculated != $product['price']) {
            $item['original_price'] = $product['price'];
        }

        $item['product'] = $product;
        $item['price'] = $calculated;
        $item['total'] = $item['price'] * $item['quantity'];

        return $item;
    }
protected function prepareItem(array $item, array $data)
    {
        $product = $this->product->getBySku($item['sku'], $item['store_id']);

        if (empty($product['status']) || $data['store_id'] != $product['store_id']) {
            return array();
        }

        $product['price'] = $this->currency->convert($product['price'], $product['currency'], $data['currency']);

        $calculated = $this->product->calculate($product);

        if ($calculated != $product['price']) {
            $item['original_price'] = $product['price'];
        }

        $item['product'] = $product;
        $item['price'] = $calculated;
        $item['total'] = $item['price'] * $item['quantity'];

        return $item;
    }
protected function prepareItem ( array $ item , array $ data ) { $ product = $ this -> product -> getBySku ( $ item [ 'sku' ] , $ item [ 'store_id' ] ) ; if ( empty ( $ product [ 'status' ] ) || $ data [ 'store_id' ] != $ product [ 'store_id' ] ) { return array ( ) ; } $ product [ 'price' ] = $ this -> currency -> convert ( $ product [ 'price' ] , $ product [ 'currency' ] , $ data [ 'currency' ] ) ; $ calculated = $ this -> product -> calculate ( $ product ) ; if ( $ calculated != $ product [ 'price' ] ) { $ item [ 'original_price' ] = $ product [ 'price' ] ; } $ item [ 'product' ] = $ product ; $ item [ 'price' ] = $ calculated ; $ item [ 'total' ] = $ item [ 'price' ] * $ item [ 'quantity' ] ; return $ item ; }
Prepare a cart item
@param array $item
@param array $data
@return array
Prepare a cart item