Craft\InstantAnalyticsService::orderComplete PHP Method

orderComplete() public method

Send analytics information for the completed order
public orderComplete ( Commerce_OrderModel $orderModel = null )
$orderModel Commerce_OrderModel the Product or Variant
    public function orderComplete($orderModel = null)
    {
        if ($orderModel) {
            $analytics = $this->eventAnalytics("Commerce", "Purchase", $orderModel->number, $orderModel->totalPrice);
            if ($analytics) {
                $this->addCommerceOrderToAnalytics($analytics, $orderModel);
                // Don't forget to set the product action, in this case to PURCHASE
                $analytics->setProductActionToPurchase();
                $analytics->sendEvent();
                InstantAnalyticsPlugin::log("orderComplete for `Commerce` - `Purchase` - `" . $orderModel->number . "` - `" . $orderModel->totalPrice . "`", LogLevel::Info, false);
            }
        }
    }