Tu Carrito

Pos

Punto de Venta

    Total: $0

    `; ventana.document.open(); ventana.document.write(contenido); ventana.document.close(); ventana.focus(); ventana.print(); } function iniciarCamara(){ function onScanSuccess(decodedText) { document.getElementById("scanner").value = decodedText; document.getElementById("scanner").dispatchEvent(new Event('change')); } let scanner = new Html5QrcodeScanner("reader", { fps: 10, qrbox: 250 }); scanner.render(onScanSuccess); } iniciarCamara(); function eliminarProducto(index){ carrito.splice(index, 1); render(); } let timeout = null; document.getElementById("scanner").addEventListener("input", function() { let texto = this.value; clearTimeout(timeout); timeout = setTimeout(() => { if(texto.length < 2){ document.getElementById("resultados").innerHTML = ""; return; } fetch("/wp-admin/admin-ajax.php?action=buscar_lista&texto=" + texto) .then(res => res.json()) .then(data => { let html = ""; data.forEach(p => { html += `
    ${p.nombre}
    $${p.precio}
    `; }); document.getElementById("resultados").innerHTML = html; }); }, 300); // ⏱ espera 300ms }); function seleccionarProducto(id, nombre, precio){ agregarProducto({ id: id, nombre: nombre, precio: precio }); document.getElementById("scanner").value = ""; document.getElementById("resultados").innerHTML = ""; }

    Carrito de compra
    Tu Carrito
    No hay productos en el carrito de compras