{"id":438,"date":"2025-04-13T19:51:22","date_gmt":"2025-04-13T19:51:22","guid":{"rendered":"https:\/\/news.linknogales.com\/?page_id=438"},"modified":"2025-04-13T23:39:22","modified_gmt":"2025-04-13T23:39:22","slug":"438-2","status":"publish","type":"page","link":"https:\/\/news.linknogales.com\/index.php\/438-2\/","title":{"rendered":"MENU TEST"},"content":{"rendered":"\n<div style=\"font-family: Arial, sans-serif; max-width: 400px; margin: auto; padding: 20px; border: 1px solid #ddd; border-radius: 10px;\">\n  <h2 style=\"text-align: center;\">Men\u00fa de Restaurante<\/h2>\n\n  <label><strong>Platillo:<\/strong><\/label><br>\n  <div style=\"display: flex; justify-content: space-between; margin-bottom: 10px;\">\n    <label>\n      <input type=\"radio\" name=\"platillo\" value=\"Tacos al Pastor|80\" onclick=\"calcularTotal()\"> \ud83c\udf2e Tacos al Pastor &#8211; $80\n    <\/label>\n    <label>\n      <input type=\"radio\" name=\"platillo\" value=\"Burritos de Carne|95\" onclick=\"calcularTotal()\"> \ud83c\udf2f Burritos de Carne &#8211; $95\n    <\/label>\n    <label>\n      <input type=\"radio\" name=\"platillo\" value=\"Enchiladas Suizas|100\" onclick=\"calcularTotal()\"> \ud83e\udd58 Enchiladas Suizas &#8211; $100\n    <\/label>\n  <\/div>\n\n  <label><strong>Bebida:<\/strong><\/label><br>\n  <div style=\"display: flex; justify-content: space-between; margin-bottom: 10px;\">\n    <label>\n      <input type=\"radio\" name=\"bebida\" value=\"Agua de Horchata|25\" onclick=\"calcularTotal()\"> \ud83e\udd64 Agua de Horchata &#8211; $25\n    <\/label>\n    <label>\n      <input type=\"radio\" name=\"bebida\" value=\"Refresco|20\" onclick=\"calcularTotal()\"> \ud83e\uddc3 Refresco &#8211; $20\n    <\/label>\n    <label>\n      <input type=\"radio\" name=\"bebida\" value=\"Jugo de Naranja|30\" onclick=\"calcularTotal()\"> \ud83c\udf4a Jugo de Naranja &#8211; $30\n    <\/label>\n  <\/div>\n\n  <label><strong>Tipo de pedido:<\/strong><\/label><br>\n  <div style=\"display: flex; justify-content: space-between; margin-bottom: 10px;\">\n    <label>\n      <input type=\"radio\" name=\"tipoPedido\" value=\"Para llevar\"> \ud83e\udd61 Para llevar\n    <\/label>\n    <label>\n      <input type=\"radio\" name=\"tipoPedido\" value=\"A domicilio\"> \ud83d\ude97 A domicilio\n    <\/label>\n  <\/div>\n\n  <label><strong>Nombre:<\/strong><\/label><br>\n  <input type=\"text\" id=\"nombre\" placeholder=\"Tu nombre\" style=\"width: 100%; margin-bottom: 10px;\" required>\n\n  <label><strong>Direcci\u00f3n de env\u00edo (Referencia):<\/strong><\/label><br>\n  <input type=\"text\" id=\"direccion\" placeholder=\"Escribe tu referencia o direcci\u00f3n\" style=\"width: 100%; margin-bottom: 10px;\" required>\n\n  <button onclick=\"obtenerUbicacion()\" style=\"margin-bottom: 10px; width: 100%; background-color: #007BFF; color: white; border: none; padding: 10px; border-radius: 5px;\">\n    \ud83d\udccd Usar mi ubicaci\u00f3n actual\n  <\/button>\n  <input type=\"hidden\" id=\"ubicacion\">\n\n  <label><strong>Tel\u00e9fono celular:<\/strong><\/label><br>\n  <input type=\"tel\" id=\"telefono\" placeholder=\"Ej. 6311234567\" style=\"width: 100%; margin-bottom: 10px;\" required>\n\n  <p><strong>Total: $<span id=\"total\">0.00<\/span> MXN<\/strong><\/p>\n\n  <button onclick=\"enviarPedido()\" id=\"enviarBtn\" style=\"width: 100%; padding: 10px; background-color: #25D366; color: white; border: none; border-radius: 5px; font-weight: bold;\" disabled>\n    Enviar Pedido por WhatsApp\n  <\/button>\n<\/div>\n\n<script>\n  let ubicacionCompartida = false; \/\/ Flag para verificar si se comparti\u00f3 la ubicaci\u00f3n\n\n  function calcularTotal() {\n    const platillo = document.querySelector('input[name=\"platillo\"]:checked');\n    const bebida = document.querySelector('input[name=\"bebida\"]:checked');\n\n    let total = 0;\n    if (platillo) total += parseInt(platillo.value.split('|')[1]);\n    if (bebida) total += parseInt(bebida.value.split('|')[1]);\n\n    document.getElementById('total').innerText = total.toFixed(2);\n  }\n\n  function obtenerUbicacion() {\n    if (navigator.geolocation) {\n      navigator.geolocation.getCurrentPosition(function(position) {\n        const lat = position.coords.latitude;\n        const lon = position.coords.longitude;\n        const link = `https:\/\/maps.google.com\/?q=${lat},${lon}`;\n        document.getElementById('ubicacion').value = link;\n        ubicacionCompartida = true; \/\/ Se marca que la ubicaci\u00f3n ha sido compartida\n\n        \/\/ Habilitar el bot\u00f3n de env\u00edo solo si la ubicaci\u00f3n fue obtenida\n        document.getElementById('enviarBtn').disabled = false;\n        alert(\"Ubicaci\u00f3n a\u00f1adida. Ahora puedes enviar el pedido.\");\n      }, function(error) {\n        alert(\"No se pudo obtener la ubicaci\u00f3n. Por favor, intenta de nuevo.\");\n      });\n    } else {\n      alert(\"Tu navegador no soporta geolocalizaci\u00f3n.\");\n    }\n  }\n\n  function enviarPedido() {\n    const platillo = document.querySelector('input[name=\"platillo\"]:checked');\n    const bebida = document.querySelector('input[name=\"bebida\"]:checked');\n    const tipoPedido = document.querySelector('input[name=\"tipoPedido\"]:checked').value;\n    const nombre = document.getElementById('nombre').value.trim();\n    const direccion = document.getElementById('direccion').value.trim();\n    const telefono = document.getElementById('telefono').value;\n    const total = document.getElementById('total').innerText;\n    const ubicacion = document.getElementById('ubicacion').value;\n\n    if (!ubicacionCompartida) {\n      alert(\"Es necesario compartirnos tu ubicaci\u00f3n actual para enviar el pedido.\");\n      return;\n    }\n\n    if (!platillo || !bebida || !nombre || !direccion || telefono.length !== 10) {\n      alert(\"Por favor completa todos los campos correctamente.\");\n      return;\n    }\n\n    let mensaje = `\ud83c\udf7d\ufe0f *Nuevo Pedido*\\n\\n\ud83d\udc64 Nombre: ${nombre}\\n\ud83d\udcde Tel\u00e9fono: ${telefono}\\n\ud83d\udccd Direcci\u00f3n: ${direccion}\\n\\n\ud83e\uddfe Pedido:\\n- Platillo: ${platillo.value.split('|')[0]}\\n- Bebida: ${bebida.value.split('|')[0]}\\n- Tipo de pedido: ${tipoPedido}\\n\ud83d\udcb5 Total: $${total} MXN\\n\\n\ud83c\udf0d Ubicaci\u00f3n geolocalizada: ${ubicacion}`;\n\n    const url = `https:\/\/wa.me\/526311256069?text=${encodeURIComponent(mensaje)}`;\n    window.open(url, '_blank');\n  }\n<\/script>\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Men\u00fa de Restaurante Platillo: \ud83c\udf2e Tacos al Pastor &#8211; $80 \ud83c\udf2f Burritos de Carne &#8211; $95 \ud83e\udd58 Enchiladas Suizas &#8211; $100 Bebida: \ud83e\udd64 Agua de Horchata &#8211; $25 \ud83e\uddc3 Refresco &#8211; $20 \ud83c\udf4a Jugo de Naranja &#8211; $30 Tipo de pedido: \ud83e\udd61 Para llevar \ud83d\ude97 A domicilio Nombre: Direcci\u00f3n de env\u00edo (Referencia): \ud83d\udccd Usar mi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-438","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/news.linknogales.com\/index.php\/wp-json\/wp\/v2\/pages\/438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/news.linknogales.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/news.linknogales.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/news.linknogales.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/news.linknogales.com\/index.php\/wp-json\/wp\/v2\/comments?post=438"}],"version-history":[{"count":62,"href":"https:\/\/news.linknogales.com\/index.php\/wp-json\/wp\/v2\/pages\/438\/revisions"}],"predecessor-version":[{"id":518,"href":"https:\/\/news.linknogales.com\/index.php\/wp-json\/wp\/v2\/pages\/438\/revisions\/518"}],"wp:attachment":[{"href":"https:\/\/news.linknogales.com\/index.php\/wp-json\/wp\/v2\/media?parent=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}