public function addEcommerceItem($sku, $name = '', $category = '', $price = 0.0, $quantity = 1)
    {
        if (empty($sku)) {
            throw new Exception("You must specify a SKU for the Ecommerce item");
        }

        $price = $this->forceDotAsSeparatorForDecimalPoint($price);

        $this->ecommerceItems[] = array($sku, $name, $category, $price, $quantity);
    }
public function addEcommerceItem($sku, $name = '', $category = '', $price = 0.0, $quantity = 1)
    {
        if (empty($sku)) {
            throw new Exception("You must specify a SKU for the Ecommerce item");
        }

        $price = $this->forceDotAsSeparatorForDecimalPoint($price);

        $this->ecommerceItems[] = array($sku, $name, $category, $price, $quantity);
    }
public function addEcommerceItem ( $ sku , $ name = '' , $ category = '' , $ price = 0.0 , $ quantity = 1 ) { if ( empty ( $ sku ) ) { throw new Exception ( "You must specify a SKU for the Ecommerce item" ) ; } $ price = $ this -> forceDotAsSeparatorForDecimalPoint ( $ price ) ; $ this -> ecommerceItems [ ] = array ( $ sku , $ name , $ category , $ price , $ quantity ) ; }
Adds an item in the Ecommerce order.

This should be called before doTrackEcommerceOrder(), or before doTrackEcommerceCartUpdate().
This function can be called for all individual products in the cart (or order).
SKU parameter is mandatory. Other parameters are optional (set to false if value not known).
Ecommerce items added via this function are automatically cleared when doTrackEcommerceOrder() or getUrlTrackEcommerceOrder() is called.

@param string $sku (required) SKU, Product identifier
@param string $name (optional) Product name
@param string|array $category (optional) Product category, or array of product categories (up to 5 categories can be specified for a given product)
@param float|int $price (optional) Individual product price (supports integer and decimal prices)
@param int $quantity (optional) Product quantity. If not specified, will default to 1 in the Reports
@throws Exception
Adds an item in the Ecommerce order .