Piwik\Tracker\GoalManager::insertEcommerceItems PHP Method

insertEcommerceItems() protected method

Inserts in the cart in the DB the new items that were not previously in the cart
protected insertEcommerceItems ( array $goal, array $itemsToInsert ) : void
$goal array
$itemsToInsert array
return void
    protected function insertEcommerceItems($goal, $itemsToInsert)
    {
        if (empty($itemsToInsert)) {
            return;
        }
        Common::printDebug("Ecommerce items that are added to the cart/order");
        Common::printDebug($itemsToInsert);
        $items = array();
        foreach ($itemsToInsert as $item) {
            $items[] = $this->getItemRowEnriched($goal, $item);
        }
        $this->getModel()->createEcommerceItems($items);
    }