예제 #1
0
        if (!$idLinea) {
            $errores = ErpCarrito::getErrores();
        } else {
            $alertas = ErpCarrito::getAlertas();
        }
        break;
    case 'remove':
        $ok = ErpCarrito::removeProduct($datos['Id']);
        if (!$ok) {
            $errores = ErpCarrito::getErrores();
        } else {
            $alertas = ErpCarrito::getAlertas();
        }
        break;
    case 'update':
        $idLinea = ErpCarrito::updateProduct($datos['Id'], $datos['Unidades']);
        if (!$idLinea) {
            $errores = ErpCarrito::getErrores();
        } else {
            $alertas = ErpCarrito::getAlertas();
        }
        break;
}
$status = 'ok';
if (count($errores)) {
    $status = "error";
}
if (count($alertas)) {
    $status = "alerta";
}
$linea = isset($idLinea) ? ErpCarrito::getLinea($idLinea)->iterator() : array();