Back to PhocacartCart class

Method updateItems

protected
updateItems
()

Method updateItems - Source code

/*
 * UPDATE - protected internal function to update session or database
 */
protected function updateItems()
{
    $session = Factory::getSession();
    if ($this->pos && (int) $this->vendor->id > 0) {
        $this->updateItemsDb();
    } else {
        if ((int) $this->user->id > 0) {
            $this->updateItemsDb();
            $session->set('cart', array(), 'phocaCart');
        } else {
            $session->set('cart', $this->items, 'phocaCart');
        }
    }
    $this->updateShipping();
    $this->updatePayment();
}