//function ComprarPorWhatsapp(){ function DatosWhatsapp(){ var parametros = { "h" : "comprarporwhatsapp", "nombre": $("#FormNombre").val(), "email": $("#FormEmail").val(), "telefono": $("#FormTelefono").val() }; $.ajax({ data : parametros, url : "funciones.php", type : "post", dataType: "json", success : function (response) { // window.open(response.LinkWhatsapp); $("#LinkPedidoWhatsapp").prop("href", response.LinkWhatsapp); // $("#LinkPedidoWhatsappX").html("Pedido preparado! click para enviar"); // alert("x"); // setTimeout("alert('x')",1000); // setTimeout("$('#LinkPedidoWhatsapp').click()",1000); // window.open(response.LinkWhatsapp); // alert(response); // $("#PopupLogueo").html(response); // Ancho Variable (con el DIV dentro de funciones // $("#PopupLogueo").html(response); // Ancho Variable (con el DIV dentro de funciones // $(".overlay#PopupLogueo").trigger("show"); } }); } function RealizarPedido(){ if ($("#FormNombre").val()=="") $("#FormNombre").focus(); if ($("#FormEmail").val()=="" && $("#FormTelefono").val()=="") $("#FormEmail").focus(); var parametros = { "h" : "realizarpedido", "nombre": $("#FormNombre").val(), "email": $("#FormEmail").val(), "telefono": $("#FormTelefono").val() }; $.ajax({ data : parametros, url : "funciones.php", type : "post", dataType: "json", success : function (response) { // window.open(response.LinkWhatsapp); // $("#LinkPedidoWhatsapp").prop("href", response.LinkWhatsapp); // $("#LinkPedidoWhatsapp").click(); alert(response.NotificacionMensaje); if (response.NotificacionTipo=="success") { location.replace("index.php"); } // $("#PopupLogueo").html(response); // Ancho Variable (con el DIV dentro de funciones // $("#PopupLogueo").html(response); // Ancho Variable (con el DIV dentro de funciones // $(".overlay#PopupLogueo").trigger("show"); } }); } function ActualizarCarrito(id, cant){ var parametros = { "h" : "actualizarcarrito", "Cant": cant, "Id": id }; $.ajax({ data : parametros, url : "funciones.php", type : "post", dataType: "json", success : function (response) { $("#Notificacion").prop("data-notify-type", response.NotificacionTipo); $("#Notificacion").prop("data-notify-msg", response.NotificacionMensaje); $("#Notificacion").click(); // alert(response); // $("#PopupLogueo").html(response); // Ancho Variable (con el DIV dentro de funciones // $("#PopupLogueo").html(response); // Ancho Variable (con el DIV dentro de funciones // $(".overlay#PopupLogueo").trigger("show"); } }); } function LimpiarCarrito(id){ var parametros = { "h" : "limpiarcarrito" }; $.ajax({ data : parametros, url : "funciones.php", type : "post", dataType: "json", success : function (response) { $("#Notificacion").prop("data-notify-type", response.NotificacionTipo); $("#Notificacion").prop("data-notify-msg", response.NotificacionMensaje); $("#Notificacion").click(); $("#CarritoCant").html(response.CantidadEnCarro); $("#CarritoCant").hide(); location.replace("index.php"); } }); } function Comprar(id){ var parametros = { "h" : "comprar", "Id": id }; $.ajax({ data : parametros, url : "funciones.php", type : "post", dataType: "json", success : function (response) { $("#Notificacion").prop("data-notify-type", response.NotificacionTipo); $("#Notificacion").prop("data-notify-msg", response.NotificacionMensaje); $("#Notificacion").click(); $("#CarritoCant").html(response.CantidadEnCarro); $("#CarritoCant").show(); // alert(response); // $("#PopupLogueo").html(response); // Ancho Variable (con el DIV dentro de funciones // $("#PopupLogueo").html(response); // Ancho Variable (con el DIV dentro de funciones // $(".overlay#PopupLogueo").trigger("show"); } }); } function CambiarCantidad (MoM, id){ idJS=id.replace(" ", "-"); Cuantos=$("#DivCantidad"+idJS).val(); if (MoM=="+"){ Cuantos=parseInt(Cuantos)+1; if (Cuantos>9999) Cuantos=9999; } else { Cuantos=parseInt(Cuantos)-1; if (Cuantos<0) Cuantos=0; } $("#DivCantidad"+idJS).val(Cuantos); $("#DivSubTotal"+idJS).html($("#DivPrecioProd"+idJS).html()*Cuantos); ActualizarCarrito(id, Cuantos); }