Back to PhocacartPos class

Method updateUserCart

public static
updateUserCart
(mixed $vendorId, mixed $ticketId, mixed $unitId = 0, mixed $sectionId = 0, mixed $userId = 0, mixed $loyaltyCardNumber = '')

Method updateUserCart - Source code

public static function updateUserCart($vendorId, $ticketId, $unitId = 0, $sectionId = 0, $userId = 0, $loyaltyCardNumber = '')
{
    // User ID, section ID and unit ID can be null (deselect user)
    if ((int) $vendorId > 0 && (int) $ticketId > 0) {
        $db = Factory::getDBO();
        $date = Factory::getDate();
        $now = $date->toSql();
        /*$app					= JFactory::getApplication();
        		$paramsC 				= PhocacartUtils::getComponentParameters();
        		$pos_payment_force	= $paramsC->get( 'pos_payment_force', 0 );
        		$pos_shipping_force	= $paramsC->get( 'pos_shipping_force', 0 );*/
        $query = 'UPDATE #__phocacart_cart_multiple' . ' SET user_id = ' . (int) $userId . ',' . ' date = ' . $db->quote($now) . ',' . ' loyalty_card_number = ' . $db->quote($loyaltyCardNumber) . ' WHERE vendor_id = ' . (int) $vendorId . ' AND ticket_id = ' . (int) $ticketId . ' AND unit_id = ' . (int) $unitId . ' AND section_id = ' . (int) $sectionId;
        $db->setQuery($query);
        $db->execute();
        return true;
    }
    return false;
}