PageSourceSearch

https://rscn.org.jo/frontend/assets/js/pages/cart.js

js rscn.org.jo collected 2026-10-02 05:13:12 UTC 4,330 bytes, 65 lines download raw bytes

1(function ($) {
2    "use strict";
3    $(document).on('click', '.qty_increment_cart', function () {
4        let id = ($(this).attr("data-id"));
5        let $this = $(this);
6        let quantity = $this.parent().find('.qty_value').val();
7        $.ajax({
8            method: "GET",
9            url: $('#CartDecrementFromSession').data("url"),
10            data: {
11                id: id,
12                quantity: quantity,
13            },
14            success: function (data) {
15
16                // let currsym = currencySymbol();
17                $('.totalCountItem').html(data[0]);
18                $('.totalAmount').html(currencyPrice(data[1]));
19                let Img = $('#productImgAsset').data('url');
20                let obj = data[2];
21                let bodyData = '';
22                let bodyArray = [];
23                let i = 1;
24                Object.keys(obj).forEach(function (key) {
25                    var name;
26                    var lang = $('html').attr('lang');
27                    if (lang == 'direction-ltr') {
28                        name = obj[key]['name'] 
29                    } else {
30                        name = obj[key]['options']['name_ar'] 
31                    }
32                    
33                    if(obj[key]['options']['discount_parcent'] > 0){
34                        bodyData = '<div class="product-item cart-product-item"><div class="single-grid-product"><div class="product-top"><a href="#"><img class="product-thumbnal" src="' + Img + '/' + obj[key]['options']['image'] + '" alt="cart"></a></div><div class="product-info"><div class="product-name-part"><h3 class="product-name"><a class="product-link" href="#">' + name + '</a></h3><div class="cart-quantity input-group"><div class="increase-btn dec qtybutton btn qty_decrease" data-id="' + obj[key]['rowId'] + '">-</div><input class="qty-input cart-plus-minus-box qty_value" type="text" name="qtybutton" id="qty_value" value="' + obj[key]['qty'] + '" readonly /><div class="increase-btn inc qtybutton btn qty_increase" data-id="' + obj[key]['rowId'] + '">+</div></div><button class="cart-remove-btn deleteItem" data-id="' + obj[key]['rowId'] + '">Remove</button></div><div class="product-price"><span class="regular-price mr-0">' + currencyPrice(obj[key]['weight'] * obj[key]['qty']) + '</span><span class="price">' + currencyPrice(obj[key]['price'] * obj[key]['qty']) + '</span></div></div></div></div>';
35                        }else{
36                            bodyData = '<div class="product-item cart-product-item"><div class="single-grid-product"><div class="product-top"><a href="#"><img class="product-thumbnal" src="' + Img + '/' + obj[key]['options']['image'] + '" alt="cart"></a></div><div class="product-info"><div class="product-name-part"><h3 class="product-name"><a class="product-link" href="#">' + name + '</a></h3><div class="cart-quantity input-group"><div class="increase-btn dec qtybutton btn qty_decrease" data-id="' + obj[key]['rowId'] + '">-</div><input class="qty-input cart-plus-minus-box qty_value" type="text" name="qtybutton" id="qty_value" value="' + obj[key]['qty'] + '" readonly /><div class="increase-btn inc qtybutton btn qty_increase" data-id="' + obj[key]['rowId'] + '">+</div></div><button class="cart-remove-btn deleteItem" data-id="' + obj[key]['rowId'] + '">Remove</button></div><div class="product-price">' + '<span class="price">' + currencyPrice(obj[key]['price'] * obj[key]['qty']) + '</span></div></div></div></div>';
37                        }                    
38                    bodyArray.push(bodyData);
39                });
40                $("#bodyData").html(bodyArray);
41                let Toast = Swal.mixin({
42                    toast: true,
43                    position: 'bottom-end',
44                    showConfirmButton: false,
45                    timer: 3000,
46                    timerProgressBar: true,
47                    didOpen: (toast) => {
48                        toast.addEventListener('mouseenter', Swal.stopTimer)
49                        toast.addEventListener('mouseleave', Swal.resumeTimer)
50                    }
51                })
52                Toast.fire({
53                    icon: 'success',
54                    title: 'Cart Quantity Decrement'
55                })
56
57            }
58        });
59    });
60    $(document).ready(function () {
61
62
63
64    });
65})(jQuery)

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.