PluginProbe
Welcart e-Commerce / 2.11.35
Welcart e-Commerce v2.11.35
2.12.4 2.12.3 2.11.35 2.12.2 2.12.1 2.11.34 2.11.33 2.11.32 2.11.31 2.11.30 1.3.16 1.3.17 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 All 292 releases
usc-e-shop / js / cart_confirm.js

cart_confirm.js in Welcart e-Commerce 2.11.35, at js/cart_confirm.js

54 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // JavaScript
2 jQuery(function($) {
3
4 var wc_check = 'same';
5 var intervalId = setInterval(function(){
6 if (typeof uscesL10n === "undefined" || typeof uscesL10n.cart_url === "undefined") {
7 clearInterval(intervalId);
8 return false;
9 }
10
11 if( 'same' != wc_check ){
12 if( 'different' == wc_check || 'timeover' == wc_check || 'entrydiff' == wc_check ){
13 alert( uscesL10n.check_mes );
14 location.href = uscesL10n.cart_url;
15 }else{
16 return false;
17 }
18 }
19 wc2confirm.check();
20
21 }, 10000);
22
23
24 wc2confirm = {
25 settings: {
26 url: uscesL10n.ajaxurl,
27 type: 'POST',
28 cache: false,
29 data: {}
30 },
31
32 check : function() {
33 if (typeof uscesL10n === "undefined" || typeof uscesL10n.cart_url === "undefined") {
34 return false;
35 }
36 var s = wc2confirm.settings;
37 s.data = {
38 'action' : 'welcart_confirm_check',
39 'uscesid' : uscesL10n.uscesid,
40 'wc_condition' : uscesL10n.condition,
41 'wc_nonce' : uscesL10n.wc_nonce
42 };
43 $.ajax( s ).done(function( response ){
44 data = response.data.replace(/(^\s+)|(\s+$)|(^\r\n)|(\r\n$)|(^\n+)|(\n+$)/g, "");
45 wc_check = data;
46 }).fail(function( msg ){
47 console.log( msg );
48 });
49 return false;
50 }
51 };
52 });
53
54