PageSourceSearch

https://interocean-mall.com/js/shop.override.js

js interocean-mall.com collected 2026-09-24 10:52:18 UTC 8,575 bytes, 207 lines download raw bytes

1jQuery(function($){
2	
3	var currentLang = getCookie("googtrans");
4
5    $(".2017_renewal_itemform select.it_supply").on("shop_sel_supply_process", function(e, param){
6        
7        var add_exec = param.add_exec;
8        var $el = $(this);
9        var val = $el.val();
10		
11        //블랙캣77님이 해당 코드에 도움을 주셨습니다.
12        var eq = $("select.it_supply").index($(this));
13        var item = $el.closest(".sit_option").find("label").eq(eq).text();
14        
15        if(!val) {
16            alert(item+"을(를) 선택해 주십시오.");
17            return false;
18        }
19
20        var info = val.split(",");
21
22        // 재고체크
23        if(parseInt(info[2]) < 1) {
24            alert(info[0]+"은(는) 재고가 부족하여 구매할 수 없습니다.");
25            return false;
26        }
27
28        var id = item+chr(30)+info[0];
29        var option = item+":"+info[0];
30        var price = info[1];
31        var stock = info[2];
32
33        // 금액 음수 체크
34        if(parseInt(price) < 0) {
35            alert("구매금액이 음수인 상품은 구매할 수 없습니다.");
36            return false;
37        }
38
39        if(add_exec) {
40            if(same_option_check(option))
41                return false;
42
43            add_sel_option(1, id, option, price, stock);
44        }
45
46        return false;
47    });
48
49    if (typeof add_sel_option === "function") {
50
51        add_sel_option = (function() {
52            var cached_function = add_sel_option;
53
54            return function() {
55                
56                if( $(".2017_renewal_itemform").length ){
57                    var a = arguments;
58                    var type=a[0],
59                        id=a[1],
60                        option=a[2],
61                        price=a[3],
62                        stock=a[4];
63
64                    var item_code = $("input[name='it_id[]']").val();
65                    var opt = "";
66                    var li_class = "sit_opt_list";
67                    if(type)
68                        li_class = "sit_spl_list";
69
70                    var opt_prc;
71                    if(parseInt(price) >= 0)
72                        opt_prc = "+"+number_format(String(price))+"원";
73                    else
74                        opt_prc = number_format(String(price))+"원";
75
76                    opt += "<li class=\""+li_class+"\">";
77                    opt += "<input type=\"hidden\" name=\"io_type["+item_code+"][]\" value=\""+type+"\">";
78                    opt += "<input type=\"hidden\" name=\"io_id["+item_code+"][]\" value=\""+id+"\">";
79                    opt += "<input type=\"hidden\" name=\"io_value["+item_code+"][]\" value=\""+option+"\">";
80                    opt += "<input type=\"hidden\" class=\"io_price\" value=\""+price+"\">";
81                    opt += "<input type=\"hidden\" class=\"io_stock\" value=\""+stock+"\">";
82                    opt += "<div class=\"opt_name\">";
83                    opt += "<span class=\"sit_opt_subj\">"+option+"</span>";
84                    opt += "</div>";
85                    opt += "<div class=\"opt_count\">";
86                    opt += "<button type=\"button\" class=\"sit_qty_minus\"><i class=\"fa fa-minus\" aria-hidden=\"true\"></i><span class=\"sound_only\">감소</span></button>";
87                    opt += "<input type=\"text\" name=\"ct_qty["+item_code+"][]\" value=\"1\" class=\"num_input\" size=\"5\">";
88                    opt += "<button type=\"button\" class=\"sit_qty_plus\"><i class=\"fa fa-plus\" aria-hidden=\"true\"></i><span class=\"sound_only\">증가</span></button>";
89                    opt += "<span class=\"sit_opt_prc\">"+opt_prc+"</span>";
90                    opt += "<button type=\"button\" class=\"sit_opt_del\"><i class=\"fa fa-times\" aria-hidden=\"true\"></i><span class=\"sound_only\">삭제</span></button></div>";
91                    opt += "</li>";
92
93                    if($("#sit_sel_option > ul").length < 1) {
94                        $("#sit_sel_option").html("<ul id=\"sit_opt_added\"></ul>");
95                        $("#sit_sel_option > ul").html(opt);
96                    } else{
97                        if(type) {
98                            if($("#sit_sel_option .sit_spl_list").length > 0) {
99                                $("#sit_sel_option .sit_spl_list:last").after(opt);
100                            } else {
101                                if($("#sit_sel_option .sit_opt_list").length > 0) {
102                                    $("#sit_sel_option .sit_opt_list:last").after(opt);
103                                } else {
104                                    $("#sit_sel_option > ul").html(opt);
105                                }
106                            }
107                        } else {
108                            if($("#sit_sel_option .sit_opt_list").length > 0) {
109                                $("#sit_sel_option .sit_opt_list:last").after(opt);
110                            } else {
111                                if($("#sit_sel_option .sit_spl_list").length > 0) {
112                                    $("#sit_sel_option .sit_spl_list:first").before(opt);
113                                } else {
114                                    $("#sit_sel_option > ul").html(opt);
115                                }
116                            }
117                        }
118                    }
119
120                    price_calculate();
121
122                    $("#sit_sel_option").trigger("add_sit_sel_option", [opt]);
123
124                } else {
125
126                    cached_function.apply(this, arguments); // use .apply() to call it
127
128                }   //end if
129
130            };
131        }());
132    }   //end if check function
133
134    // 상세페이지 총 금액 계산하는 함수
135    if (typeof price_calculate === "function") {
136        price_calculate = (function() {
137            var cached_function = price_calculate;
138
139            return function() {
140                
141                if( $(".2017_renewal_itemform").length ){
142
143                    var it_price = parseInt($("input#it_price").val());
144                    
145                    if (currentLang == "/en/en") {
146						it_price = parseFloat($("input#it_price").val());
147					}
148
149                    if(isNaN(it_price))
150                        return;
151
152                    var $el_prc = $("input.io_price");
153                    var $el_qty = $("input[name^=ct_qty]");
154                    var $el_type = $("input[name^=io_type]");
155                    var price, type, qty, total = 0;
156
157                    $el_prc.each(function(index) {
158						if (currentLang == "/en/en") {
159	                        price = parseFloat($(this).val());
160	                        qty = parseFloat($el_qty.eq(index).val());
161                        }else{
162							price = parseInt($(this).val());
163	                        qty = parseInt($el_qty.eq(index).val());
164						}
165                        type = $el_type.eq(index).val();
166
167                        if(type == "0") { // 선택옵션
168                            total += (it_price + price) * qty;
169                        } else { // 추가옵션
170                            total += price * qty;
171                        }
172                        // 옵션이 있는경우  total 계산 변경
173                        var origin_price = $("#sit_opt_added li").find("input.sit_opt_prc_origin").val();
174                        if (origin_price) {
175                            total = 0;
176                            $(".sit_opt_prc").each(function() {
177                                var tot = $(this).text();
178                                var numberOnlyTot = tot.replace(/[^0-9]/g, '');
179                                var intTot = parseInt(numberOnlyTot, 10) || 0;
180                                total += intTot;
181                            })
182                        }
183
184                        if (currentLang == "/en/en") {
185							total = parseFloat(total).toFixed(2);
186						}
187                    });
188
189					if (currentLang == "/en/en") {
190
191                   		$("#sit_tot_price").empty().html("<span>The total amount :</span><strong>"+String(total)+"</strong> USD");
192                    }
193                    else
194                    {
195						$("#sit_tot_price").empty().html("<span>총 금액 :</span><strong>"+number_format(String(total))+"</strong> 원");
196					}
197                    
198                    $("#sit_tot_price").trigger("price_calculate", [total]);
199                } else {
200                    cached_function.apply(this, arguments); // use .apply() to call it
201                }
202                
203            };
204        }());
205    }   //end if check function
206
207});

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.