PiwikTracker::doTrackEcommerceOrder PHP Method

doTrackEcommerceOrder() public method

If the Ecommerce order contains items (products), you must call first the addEcommerceItem() for each item in the order. All revenues (grandTotal, subTotal, tax, shipping, discount) will be individually summed and reported in Piwik reports. Only the parameters $orderId and $grandTotal are required.
public doTrackEcommerceOrder ( string | integer $orderId, float $grandTotal, float $subTotal, float $tax, float $shipping, float $discount ) : mixed
$orderId string | integer (required) Unique Order ID. This will be used to count this order only once in the event the order page is reloaded several times. orderId must be unique for each transaction, even on different days, or the transaction will not be recorded by Piwik.
$grandTotal float (required) Grand Total revenue of the transaction (including tax, shipping, etc.)
$subTotal float (optional) Sub total amount, typically the sum of items prices for all items in this order (before Tax and Shipping costs are applied)
$tax float (optional) Tax amount for this order
$shipping float (optional) Shipping amount for this order
$discount float (optional) Discounted amount in this order
return mixed Response or true if using bulk request
    public function doTrackEcommerceOrder($orderId, $grandTotal, $subTotal = 0.0, $tax = 0.0, $shipping = 0.0, $discount = 0.0)
    {
        $url = $this->getUrlTrackEcommerceOrder($orderId, $grandTotal, $subTotal, $tax, $shipping, $discount);
        return $this->sendRequest($url);
    }