PageSourceSearch

https://edeusto.com/modules/weproductcustomization/views/js/budgetfromcart.js

js edeusto.com collected 2026-10-08 09:09:51 UTC 2,448 bytes, 68 lines download raw bytes

1$(document).ready(function () {
2$('#budgetProductsModal').appendTo('body');
3    $('#wpc-budget-from-cart').on('click', function () {
4        const $btn = $(this);
5        const $spinner = $btn.find('.spinner');
6        const $text = $btn.find('.text');
7        const $msg = $('.budget-from-cart-message');
8
9        // Limpiar mensaje anterior
10        $msg.empty().removeClass('success error');
11
12        // Mostrar spinner y desactivar botón
13        $spinner.show();
14        $btn.prop('disabled', true);
15
16        $.ajax({
17            type: 'POST',
18            url: prestashop.urls.base_url + 'index.php?fc=module&module=weproductcustomization&controller=ajax',
19            dataType: 'json',
20            headers: { "cache-control": "no-cache" },
21            data: {
22                ajax: true,
23                op: 'cartToBudget',
24            },
25            success: function (res) {
26                if (res.success === true) {
27                    $msg
28                        .removeClass('error')
29                        .addClass('success')
30                        .html(
31                            '¡Presupuesto creado con éxito! Accede a tus <a href="' +
32                            custom_urls.presupuestos +
33                            '">presupuestos</a>'
34                        );
35                } else {
36                    $msg
37                        .removeClass('success')
38                        .addClass('error')
39                        .text(res.message || 'Ha ocurrido un error al crear el presupuesto.');
40
41                    setTimeout(() => {
42                        $msg.fadeOut(300, () => {
43                            $msg.empty().removeClass('error').show();
44                        });
45                    }, 3000);
46                }
47            },
48            error: function (xhr, status, error) {
49                $msg
50                    .removeClass('success')
51                    .addClass('error')
52                    .text('Error de conexión o del servidor. Inténtalo de nuevo.');
53
54                console.error('AJAX Error:', status, error);
55
56                setTimeout(() => {
57                    $msg.fadeOut(300, () => {
58                        $msg.empty().removeClass('error').show();
59                    });
60                }, 3000);
61            },
62            complete: function () {
63                $spinner.hide();
64                $btn.prop('disabled', false);
65            }
66        });
67    });
68});

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.