PageSourceSearch

https://www.mlsantosdistribuidora.com.br/js/frontend/components/preventDuplicateOrders.js

js mlsantosdistribuidora.com.br collected 2026-09-29 01:45:46 UTC 772 bytes, 25 lines download raw bytes

1// Variável global para verificar se o pedido já foi processado
2var isOrderProcessed = false;
3
4// Objeto para evitar pedidos duplicados
5const preventDuplicateOrders = {
6    init: function() {
7        $(document).on("submit", "#PedidoAddForm", function(event) {
8            // Verifica se o pedido já foi processado
9            if (isOrderProcessed) {
10                event.preventDefault();
11                return false;
12            } else {
13                isOrderProcessed = true;
14
15                //Datalayer
16                window.dispatchEvent(new CustomEvent("add_payment_info"));
17                window.dispatchEvent(new CustomEvent("add_shipping_info"));
18            }
19        });
20    }
21};
22
23$(document).ready(function() {
24    preventDuplicateOrders.init();
25});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.