PageSourceSearch

https://gpm.pl/pub/js/shop.js?v=68

js gpm.pl collected 2026-10-02 12:13:24 UTC 16,526 bytes, 468 lines download raw bytes

1var refreshId;
2
3function changeCurrency(newCur) {
4    $.ajax({
5        url : '/shop/index/currency-change?code=' + newCur,
6        success : function(output) {
7            alert(txtChangeCurrency+': ' + output);
8            window.location.reload(true);
9        }
10    });
11}
12
13$.ajax({
14  url : '/user/index/discount-info-ajax',
15    success : function(output) {
16        $("#rabaty").html(output);
17    }
18});
19
20$.ajax({
21  url : '/user/index/user-login',
22    success : function(output) {
23        $("#loginlinks").html(output);
24    }
25});
26
27//$( "#rabaty" ).load( "/user/index/discount-info-ajax", function() {
28 // alert( "Load was performed." );
29//});
30
31
32function basketAdd(aid, quantityName)
33{
34    if(1==2){
35        showAlert("Sklep nieczynny od 04.09.2026r. do 21.09.2026r.","alert","","OK",hideAlert,hideAlert);
36    }else{
37        if(quantityName){
38            if($('#itemnumber').val() > $('#details-stock').val() && $('#details-unlimited').val() == 0){
39                showAlert(txtAmoutStorage+" "+$('#details-stock').val(),"alert","","OK",hideAlert,hideAlert);
40                $("#itemnumber").val($('#details-stock').val());
41                return;
42            }
43            var quantity = $('#'+quantityName).val();
44        }else{
45            var quantity = 1;
46        }
47        if(quantity>0){
48            $.ajax({
49                url: '/shop/index/basket-add?id='+aid+'&q='+quantity+"&lg="+lg,
50                success: basketAddAnswer
51            });
52            showPreloader();
53        }else{
54            alert("noProduct");
55        }
56    }
57}
58
59function cubyAdd(aid)
60{
61	$.ajax({
62	url: '/user/index/cuby-add/id/'+aid,
63	success: cubyAddAnswer
64	});
65	showPreloader();
66}
67
68function cubyAddAnswer(data){
69	ans = jQuery.parseJSON(data);
70	$('#store-amount').html(ans.quantity+" "+txtProducts);
71	hidePreloader();
72	if(ans.code=="ok"){
73            showAlert(ans.msg,"confirm",txtGotoCart, txtContinue, gotoCart, hideAlert);
74	}else{
75            showAlert(ans.msg,"alert","",txtContinue,hideAlert,hideAlert);
76	}
77}
78
79function cuby2basket(cid, sid)
80{
81    $.ajax({
82        url: '/user/index/cuby-basket?sid='+sid+'&cid='+cid,
83        success: cuby2basketAns
84    });
85	showPreloader();
86}
87
88function cuby2basketAns(data)
89{
90    ans = jQuery.parseJSON(data);
91    if (ans.code == 'ok') {
92        window.location.reload(true);
93        return;
94    }
95    alert(ans.msg);
96	hidePreloader();
97}
98
99function cubyRemove(cid)
100{
101    if (confirm(txtRemoveFromCuby)) {
102        $.ajax({
103            url: '/user/index/cuby-remove/id/'+cid,
104            success: cubyRemoveAns
105        });
106        showPreloader();
107    }
108}
109
110function cubyRemoveAns(data)
111{
112    ans = jQuery.parseJSON(data);
113    if (ans.code == 'ok') {
114        window.location.reload(true);
115        return;
116    }
117    alert(ans.msg)
118    hidePreloader();
119}
120
121function basket2cuby(cid, sid)
122{
123    $.ajax({
124        url: '/user/index/basket-cuby?sid='+sid+'&cid='+cid,
125        success: basket2cubyAns
126    });
127    showPreloader();
128}
129
130function basket2cubyAns(data)
131{
132    ans = jQuery.parseJSON(data);
133    if (ans.code == 'ok') {
134        window.location.reload(true);
135        return;
136    }
137    alert(ans.msg);
138    hidePreloader();
139}
140function basketRemove(aid)
141{
142  if (confirm(txtRemoveFromBasket)) {
143    $('#quantity_'+aid).val(0);
144    $('#basket_form').submit();
145  }
146}
147
148function basketReset()
149{
150  $('#basket_form_operation').val('reset');
151  $('#basket_form').submit();
152}
153function basketShipping(obj,lg)
154{
155    $.ajax({
156        url: '/'+paymentsUrl+'?ship_id='+obj+"&lg="+lg,
157        success: basketShippingAnswer
158    });
159    showPreloader();
160
161    return;
162
163    //$('#basketVal').text(parseFloat($('#basketSum').val()) + parseFloat($('#'+$(obj).attr('id')+'Val').val()));
164    //return;
165}
166
167function basketPaymentsRefresh(){
168
169    var chck = $("#payments_div input[type='radio']:checked");
170    var total = parseFloat($('#sum_item').val());
171
172    total += parseFloat($('#shipper_cost').val());
173
174    jQuery.each(chck, function(index) {
175        total += parseFloat($(this).attr('alt'));
176    });
177
178    totalround = total.toFixed(2);
179
180    $('#sum_price').html(totalround);
181    $('#sum_price_minibasket').html(totalround);
182}
183function basketShippingAnswer(data)
184{
185    $('#payments_div').html(data);
186
187    basketPaymentsRefresh();
188    hidePreloader();
189}
190
191function basketChoosenShipping(id, pid, lg)
192{
193//    alert("basketChoosenShipping: "+id+", "+pid+", "+lg);
194    $.ajax({
195        url: '/'+paymentsUrl+'?ship_id='+id+"&lg="+lg+"&pid="+pid,
196        success: basketChoosenShippingAnswer
197    });
198    showPreloader();
199}
200function basketChoosenShippingAnswer(data)
201{
202    $('#payments_div').html(data);
203    hidePreloader();
204}
205function gotoStep(num){
206    suf = '';
207	r_s = false;
208	r_p = false;
209	eachGo = true;
210	fields = [];
211	form_selector = '';
212
213	if(1==2){
214	    showAlert("Sklep nieczynny od 11.05.2026r. do 18.05.2026r.","alert","","OK",hideAlert,hideAlert);
215	}else{
216        if(num == 4){
217            if($('.tab-wrap').length>0){
218                        jQuery.each($('.tab-wrap'), function(index) {
219                            if($(this).css('display')=='block'){
220                                if($(this).attr('id')=='form-1'){
221                                    fields = ['data[email]', 'data[password]'];
222                                }else if($(this).attr('id')=='form-2' && $('#invoice').attr('checked')){
223                                    fields = ['data[email]', 'data[password]', 'data[password2]', 'data[send_name]', 'data[send_address]', 'data[send_address_1]', 'data[send_phone]', 'data[send_zip]', 'data[send_city]', 'data[invoice_name]', 'data[invoice_address]', 'data[invoice_address_1]', 'data[invoice_nip]', 'data[invoice_zip]', 'data[invoice_city]'];
224                                    form_selector = "#registry_form_registry";
225                                    if(!$('#reg_check_3_2').attr('checked')){
226                                        showAlert(txt_regulation,"alert","","OK",hideAlert,hideAlert);
227                                        eachGo = false;
228                                        return;
229                                    }
230                                }else if($(this).attr('id')=='form-2'){
231                                    fields = ['data[email]', 'data[password]', 'data[password2]', 'data[send_name]', 'data[send_address]', 'data[send_address_1]', 'data[send_phone]', 'data[send_zip]', 'data[send_city]'];
232                                    form_selector = "#registry_form_registry";
233                                    if(!$('#reg_check_3_2').attr('checked')){
234                                        showAlert(txt_regulation,"alert","","OK",hideAlert,hideAlert);
235                                        eachGo = false;
236                                        return;
237                                    }
238                                }else if($(this).attr('id')=='form-3' && $('#invoice2').attr('checked')){
239                                    fields = ['data[email]', 'data[send_name]', 'data[send_address]', 'data[send_address_1]', 'data[send_phone]', 'data[send_zip]', 'data[send_city]', 'data[invoice_name]', 'data[invoice_address]', 'data[invoice_address_1]', 'data[invoice_nip]', 'data[invoice_zip]', 'data[invoice_city]'];
240                                    form_selector = "#basket_form_no-registry";
241                                    if(!$('#reg_check_3_3').attr('checked')){
242                                        showAlert(txt_regulation,"alert","","OK",hideAlert,hideAlert);
243                                        eachGo = false;
244                                        return;
245                                    }
246                                }else if($(this).attr('id')=='form-3'){
247                                    fields = ['data[email]', 'data[send_name]', 'data[send_address]', 'data[send_address_1]', 'data[send_phone]', 'data[send_zip]', 'data[send_city]'];
248                                    form_selector = "#basket_form_no-registry";
249                                    if(!$('#reg_check_3_3').attr('checked')){
250                                        showAlert(txt_regulation,"alert","","OK",hideAlert,hideAlert);
251                                        eachGo = false;
252                                        return;
253                                    }
254                                }
255                            }
256                        });
257            }else{
258                        if($('#invoice').attr('checked')){
259                            fields = ['data[send_name]', 'data[send_address]', 'data[send_address_1]', 'data[send_phone]', 'data[send_zip]', 'data[send_city]', 'data[invoice_name]', 'data[invoice_address]', 'data[invoice_address_1]', 'data[invoice_nip]', 'data[invoice_zip]', 'data[invoice_city]'];
260                        }else{
261                            fields = ['data[send_name]', 'data[send_address]', 'data[send_address_1]', 'data[send_phone]', 'data[send_zip]', 'data[send_city]'];
262                        }
263                        form_selector = "#basket_form_user-logged";
264            }
265
266
267            jQuery.each(fields, function() {
268                        if(!$(form_selector+' input[name$="'+this+'"]').val()){
269                            $(form_selector+' input[name$="'+this+'"]').next().show();
270                            $(form_selector+' input[name$="'+this+'"]').addClass('reqInpErr');
271                            eachGo = false;
272                            return;
273                        }else{
274                            $(form_selector+' input[name$="'+this+'"]').next().hide();
275                            $(form_selector+' input[name$="'+this+'"]').removeClass('reqInpErr');
276                        }
277            });
278
279            if (!eachGo){
280                        return;
281            }
282
283        }else if(num == 3){
284                if($('#shipper_country').val() != 0){
285                    r_s=true;
286                }
287                if($('#shipper').val() == 66 && !$('#selectedpoint').val()){
288                    alert('Wybierz paczkomat');
289                    return false;
290                }
291                payRadio = $('#payments_div input:radio');
292                jQuery.each(payRadio, function(index) {
293                    if($(this).attr('checked')){
294                        r_p=true;
295                    }
296                });
297                if(!r_s){
298                    alert(txtChooseCoutry);
299                    return;
300                }
301                if(!r_p){
302                    alert(txtChoosePay);
303                    return;
304                }
305        }
306
307        jQuery.each(fields, function() {
308                if(!$('input[name$="data['+this+']"]').val()){
309                    $('input[name$="data['+this+']"]').next().show();
310                    $('input[name$="data['+this+']"]').addClass('reqInpErr');
311                    eachGo = false;
312                    return;
313                }else{
314                    $('input[name$="data['+this+']"]').next().hide();
315                    $('input[name$="data['+this+']"]').removeClass('reqInpErr');
316                }
317        });
318
319
320        if (num == 4) {
321            var logged = true;
322            jQuery.each($('.tab-wrap'), function(index) {
323                        if($(this).css('display')=='block'){
324                            if($(this).attr('id')=='form-1'){
325                                $('#login_form').submit();
326                            }else if($(this).attr('id')=='form-2'){
327                                $('#basket_form_operation_registry').val('step_'+num);
328                                showPreloader();
329                                sendBasketRegistryForm();
330                                //$.ajax({
331                                    //url: '/user/index/email-unique/e/'+$(form_selector+' input[name$="data[email]"]').val(),
332                                    //success:
333                                //});
334                            }else if($(this).attr('id')=='form-3'){
335                                $('#basket_form_operation_no-registry').val('step_'+num);
336                                showPreloader();
337                                sendBasketNoregistryForm();
338                                //$.ajax({
339                                    //url: '/user/index/email-unique/e/'+$(form_selector+' input[name$="data[email]"]').val(),
340                                    //success: sendBasketNoregistryForm
341                                //});
342                            }
343                        logged = false;
344                        }
345            });
346            if (logged) {
347                $('#basket_form_user-logged').submit();
348            }
349        }else{
350                $('#basket_form_operation').val('step_'+num);
351                $('#basket_form').submit();
352        }
353	}
354
355}
356function sendBasketRegistryForm(data){
357    hidePreloader();
358    if(data=='0'){
359        showAlert(txtEmaiExist,"confirm",txtLogin, txtStay, gotoLogin, hideAlert);
360    }else{
361        $('#registry_form_registry').submit();
362    }
363}
364function sendBasketNoregistryForm(data){
365    hidePreloader();
366    if(data=='0'){
367        showAlert(txt_user_registry_err_email,"confirm",txtLogin, txtStay, gotoLogin, hideAlert);
368    }else{
369        $('#basket_form_no-registry').submit();
370    }
371}
372function quantityStep(id,q){
373    if(($('#quantity_'+id).val() > 0 && ($('#quantity_'+id).val() < $('#s_id_'+id).val() || q==-1)) || $('#unlimited_id_'+id).val()==1){
374        $('#quantity_'+id).val()
375        $.ajax({
376            url: '/shop/index/basket-add?id='+id+'&q='+q,
377            success: quantityChangeAnswer
378        });
379        showPreloader();
380    }else if($('#quantity_'+id).val() == $('#s_id_'+id).val() && q==1){
381        showAlert(txtAmoutStorage+" "+$('#s_id_'+id).val(),"alert","","OK",hideAlert,hideAlert);
382    }
383}
384function detailsAmountChange(){
385
386}
387function quantityJump(id){
388    refreshId=id;
389    difference = 0;
390
391    if(parseFloat($("#quantity_"+id).val()) > parseFloat($('#s_id_'+id).val()) && $('#unlimited_id_'+id).val()==0){
392        showAlert(txtAmoutStorage+" "+$('#s_id_'+id).val(),"alert","","OK",hideAlert,hideAlert);
393        $("#quantity_"+id).val($('#s_id_'+id).val());
394        return;
395    }else if($("#quantity_"+id).val() != $('#q_id_'+id).val() && $("#quantity_"+id).val() > 0){
396        difference = parseFloat($("#quantity_"+id).val()) - parseFloat($('#q_id_'+id).val());
397    }else if($("#quantity_"+id).val() == 0){
398        difference = 0;
399    }
400
401    $.ajax({
402        url: '/shop/index/basket-add?id='+id+'&q='+difference,
403        success: quantityChangeAnswer
404    });
405    showPreloader();
406}
407function quantityJump2(id){
408    refreshId=id;
409    difference = 0;
410
411    if(parseFloat($("#quantity_"+id).val()) > parseFloat($('#s_id_'+id).val()) && $('#unlimited_id_'+id).val()==0){
412        showAlert(txtAmoutStorage+" "+$('#s_id_'+id).val(),"alert","","OK",hideAlert,hideAlert);
413        $("#quantity_"+id).val($('#s_id_'+id).val());
414        return;
415    }else if($("#quantity_"+id).val() != $('#q_id_'+id).val() && $("#quantity_"+id).val() > 0){
416        difference = parseFloat($("#quantity_"+id).val()) - parseFloat($('#q_id_'+id).val());
417    }else if($("#quantity_"+id).val() == 0){
418        difference = 0;
419    }
420
421    $.ajax({
422        url: '/shop/index/basket-add?id='+id+'&q='+difference+'&json=1',
423        success: quantityChangeAnswer2
424    });
425    showPreloader2();
426}
427function quantityStep2(id,q){
428    if(($('#quantity_'+id).val() > 0 && ($('#quantity_'+id).val() < $('#s_id_'+id).val() || q==-1)) || $('#unlimited_id_'+id).val()==1){
429        $('#quantity_'+id).val()
430        $.ajax({
431            url: '/shop/index/basket-add?id='+id+'&q='+q+'&json=1',
432            success: quantityChangeAnswer2
433        });
434        showPreloader2();
435    }else if($('#quantity_'+id).val() == $('#s_id_'+id).val() && q==1){
436        showAlert(txtAmoutStorage+" "+$('#s_id_'+id).val(),"alert","","OK",hideAlert,hideAlert);
437    }
438}
439function basketRemove2(aid)
440{
441  if (confirm(txtRemoveFromBasket)) {
442    $('#quantity_'+aid).val(0);
443    quantityJump2(aid,0);
444  }
445}
446function refreshJump(){
447    quantityJump(refreshId);
448}
449function quantityChangeAnswer(data){
450    //alert(data);
451    window.location.reload(true);
452    hidePreloader();
453}
454function quantityChangeAnswer2(data){
455    $('#basket-holder').html(data);
456    $('#mini-basket-items').load('/user/index/mini-panel');
457    hidePreloader2();
458}
459
460function mbShipperCountryChange(obj)
461{
462    obj.value;
463    $.ajax({
464        url: '/shop/index/country-change?c='+obj.value,
465        success: mbShipperCountryChangeAnswer
466    });
467    showPreloader();
468}

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.