Version Description
- Improvement: unnecessary files removed
- Improvement: woocommerce checkout address fields required
- Improvement: woocommerce checkout address fields names
Download this release
Release Info
Developer | quadlayers |
Plugin | WooCommerce Checkout Manager |
Version | 4.4.9 |
Comparing to | |
See all releases |
Code changes from version 4.4.8 to 4.4.9
- assets/js/wooccm-admin.js +31 -0
- assets/js/wooccm-admin.min.js +1 -1
- assets/js/wooccm-checkout.js +98 -4
- assets/js/wooccm-checkout.min.js +1 -1
- assets/js/wooccm-modal.js +107 -73
- assets/js/wooccm-modal.min.js +1 -1
- assets/js/wooccm-order-upload.js +4 -4
- assets/js/wooccm-order-upload.min.js +1 -1
- includes/checkout.php +0 -52
- includes/templates/admin/woocheckout-additional-clone.php +2 -2
- includes/templates/admin/woocheckout-billing-clone.php +2 -2
- includes/templates/admin/woocheckout-billing-tbody.php +4 -3
- includes/templates/admin/woocheckout-billing-thead.php +2 -1
- includes/templates/admin/woocheckout-shipping-clone.php +2 -2
- includes/templates/functions/add_functions.php +0 -337
- includes/templates/functions/billing_functions.php +0 -367
- includes/templates/functions/shipping_functions.php +0 -371
- new/fields_conditional.php +4 -129
- new/fields_display.php +4 -2
- new/fields_filters.php +36 -768
- new/fields_handler.php +15 -5
- new/fields_init.php +91 -48
- new/fields_register.php +6 -1
- new/install.php +1 -1
- readme.txt +6 -1
- woocommerce-checkout-manager.php +32 -22
assets/js/wooccm-admin.js
CHANGED
@@ -22,6 +22,15 @@
|
|
22 |
return o;
|
23 |
};
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
function getEnhancedSelectFormatString() {
|
26 |
return {
|
27 |
'language': {
|
@@ -67,6 +76,28 @@
|
|
67 |
};
|
68 |
}
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
$(document).on('wooccm-enhanced-select', function (e) {
|
71 |
|
72 |
$('.wooccm-enhanced-select').filter(':not(.enhanced)').each(function () {
|
22 |
return o;
|
23 |
};
|
24 |
|
25 |
+
function date_picker_select(datepicker) {
|
26 |
+
var option = $(datepicker).next().is('.hasDatepicker') ? 'minDate' : 'maxDate',
|
27 |
+
otherDateField = 'minDate' === option ? $(datepicker).next() : $(datepicker).prev(),
|
28 |
+
date = $(datepicker).datepicker('getDate');
|
29 |
+
|
30 |
+
$(otherDateField).datepicker('option', option, date);
|
31 |
+
$(datepicker).change();
|
32 |
+
}
|
33 |
+
|
34 |
function getEnhancedSelectFormatString() {
|
35 |
return {
|
36 |
'language': {
|
76 |
};
|
77 |
}
|
78 |
|
79 |
+
$(document).on('wooccm-enhanced-select', function (e) {
|
80 |
+
|
81 |
+
$('.wooccm-enhanced-between-dates').filter(':not(.enhanced)').each(function () {
|
82 |
+
|
83 |
+
$(this).find('input').datepicker({
|
84 |
+
defaultDate: '',
|
85 |
+
dateFormat: 'yy-mm-dd',
|
86 |
+
numberOfMonths: 1,
|
87 |
+
showButtonPanel: true,
|
88 |
+
onSelect: function () {
|
89 |
+
date_picker_select($(this));
|
90 |
+
}
|
91 |
+
});
|
92 |
+
|
93 |
+
$(this).find('input').each(function () {
|
94 |
+
date_picker_select($(this));
|
95 |
+
});
|
96 |
+
|
97 |
+
});
|
98 |
+
|
99 |
+
});
|
100 |
+
|
101 |
$(document).on('wooccm-enhanced-select', function (e) {
|
102 |
|
103 |
$('.wooccm-enhanced-select').filter(':not(.enhanced)').each(function () {
|
assets/js/wooccm-admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(b){b.fn.serializeArrayAll=function(){var
|
1 |
+
(function(b){b.fn.serializeArrayAll=function(){var f={};var e=this.serializeArray();b.each(e,function(){if(f[this.name]!==undefined){if(!f[this.name].push){f[this.name]=[f[this.name]]}f[this.name].push(this.value||"")}else{f[this.name]=this.value||""}});var d=b("input[type=radio],input[type=checkbox]",this);b.each(d,function(){if(!f.hasOwnProperty(this.name)){f[this.name]=""}});return f};function c(f){var e=b(f).next().is(".hasDatepicker")?"minDate":"maxDate",g="minDate"===e?b(f).next():b(f).prev(),d=b(f).datepicker("getDate");b(g).datepicker("option",e,d);b(f).change()}function a(){return{language:{errorLoading:function(){return wc_enhanced_select_params.i18n_searching},inputTooLong:function(d){var e=d.input.length-d.maximum;if(1===e){return wc_enhanced_select_params.i18n_input_too_long_1}return wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",e)},inputTooShort:function(d){var e=d.minimum-d.input.length;if(1===e){return wc_enhanced_select_params.i18n_input_too_short_1}return wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",e)},loadingMore:function(){return wc_enhanced_select_params.i18n_load_more},maximumSelected:function(d){if(d.maximum===1){return wc_enhanced_select_params.i18n_selection_too_long_1}return wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",d.maximum)},noResults:function(){return wc_enhanced_select_params.i18n_no_matches},searching:function(){return wc_enhanced_select_params.i18n_searching}}}}b(document).on("wooccm-enhanced-select",function(d){b(".wooccm-enhanced-between-dates").filter(":not(.enhanced)").each(function(){b(this).find("input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:true,onSelect:function(){c(b(this))}});b(this).find("input").each(function(){c(b(this))})})});b(document).on("wooccm-enhanced-select",function(d){b(".wooccm-enhanced-select").filter(":not(.enhanced)").each(function(){var e=b.extend({minimumResultsForSearch:10,allowClear:b(this).data("allow_clear")?true:false,placeholder:b(this).data("placeholder")},a());b(this).selectWoo(e).addClass("enhanced")});b(".wooccm-product-search").filter(":not(.enhanced)").each(function(){var g={allowClear:b(this).data("allow_clear")?true:false,placeholder:b(this).data("placeholder"),minimumInputLength:b(this).data("minimum_input_length")?b(this).data("minimum_input_length"):"3",escapeMarkup:function(h){return h},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",delay:250,data:function(h){return{term:h.term,action:b(this).data("action")||"wooccm_select_search_products",security:wc_enhanced_select_params.search_products_nonce,selected:b(this).select2("val")||0,exclude:b(this).data("exclude"),include:b(this).data("include"),limit:b(this).data("limit"),display_stock:b(this).data("display_stock")}},processResults:function(i){var h=[];if(i){b.each(i,function(k,j){h.push({id:k,text:j})})}return{results:h}},cache:true}};g=b.extend(g,a());b(this).selectWoo(g).addClass("enhanced");if(b(this).data("sortable")){var f=b(this);var e=b(this).next(".select2-container").find("ul.select2-selection__rendered");e.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:true,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){b(e.find(".select2-selection__choice").get().reverse()).each(function(){var i=b(this).data("data").id;var h=f.find('option[value="'+i+'"]')[0];f.prepend(h)})}})}else{if(b(this).prop("multiple")){b(this).on("change",function(){var h=b(this).children();h.sort(function(j,i){var l=j.text.toLowerCase();var k=i.text.toLowerCase();if(l>k){return 1}if(l<k){return -1}return 0});b(this).html(h)})}}})});b(document).on("click",".wooccm-field-toggle-enabled",function(){var d=b(this),f=d.closest("tr"),e=d.find(".woocommerce-input-toggle");b.ajax({url:woocommerce_admin.ajax_url,data:{action:"wooccm_toggle_field_enabled",nonce:wooccm.nonce,field_id:f.data("field_id")},dataType:"json",type:"POST",beforeSend:function(g){e.addClass("woocommerce-input-toggle--loading")},success:function(g){if(true===g.data){e.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");e.addClass("woocommerce-input-toggle--enabled");e.removeClass("woocommerce-input-toggle--loading")}else{if(true!==g.data){e.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");e.addClass("woocommerce-input-toggle--disabled");e.removeClass("woocommerce-input-toggle--loading")}}}});return false})})(jQuery);
|
assets/js/wooccm-checkout.js
CHANGED
@@ -14,9 +14,11 @@
|
|
14 |
});
|
15 |
}
|
16 |
};
|
|
|
17 |
var unblock = function ($node) {
|
18 |
$node.removeClass('processing').unblock();
|
19 |
};
|
|
|
20 |
var append_image = function (list, i, source, name, filetype) {
|
21 |
|
22 |
var $field_list = $(list),
|
@@ -57,6 +59,44 @@
|
|
57 |
}
|
58 |
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
// Field
|
61 |
// ---------------------------------------------------------------------------
|
62 |
|
@@ -154,7 +194,7 @@
|
|
154 |
if (window.FormData && fileList[$field.attr('id')].length) {
|
155 |
|
156 |
if (!is_blocked($form)) {
|
157 |
-
$place_order.html(wooccm.uploading);
|
158 |
block($form);
|
159 |
}
|
160 |
|
@@ -193,7 +233,7 @@
|
|
193 |
processData: false,
|
194 |
contentType: false,
|
195 |
beforeSend: function (response) {
|
196 |
-
//$place_order.html(wooccm.uploading);
|
197 |
},
|
198 |
success: function (response) {
|
199 |
//$results.removeClass('woocommerce-message');
|
@@ -295,6 +335,54 @@
|
|
295 |
|
296 |
});
|
297 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
// Color fields
|
299 |
// ---------------------------------------------------------------------------
|
300 |
|
@@ -303,20 +391,26 @@
|
|
303 |
var $field = $(field),
|
304 |
$input = $field.find('input[type=text]'),
|
305 |
$container = $field.find('.wooccmcolorpicker_container');
|
|
|
306 |
$input.hide();
|
|
|
307 |
if ($.isFunction($.fn.farbtastic)) {
|
|
|
308 |
$container.farbtastic('#' + $input.attr('id'));
|
|
|
309 |
$container.on('click', function (e) {
|
310 |
$input.fadeIn();
|
311 |
});
|
|
|
312 |
}
|
313 |
|
314 |
});
|
|
|
315 |
$('.wooccm-colorpicker-iris').each(function (i, field) {
|
316 |
|
317 |
var $field = $(field),
|
318 |
-
$input = $field.find('input[type=text]')
|
319 |
-
|
320 |
|
321 |
$input.css('color', '#fff').css('background', $input.val()).hide();
|
322 |
|
14 |
});
|
15 |
}
|
16 |
};
|
17 |
+
|
18 |
var unblock = function ($node) {
|
19 |
$node.removeClass('processing').unblock();
|
20 |
};
|
21 |
+
|
22 |
var append_image = function (list, i, source, name, filetype) {
|
23 |
|
24 |
var $field_list = $(list),
|
59 |
}
|
60 |
|
61 |
|
62 |
+
function field_is_required(field, is_required) {
|
63 |
+
if (is_required) {
|
64 |
+
field.find('label .optional').remove();
|
65 |
+
field.addClass('validate-required');
|
66 |
+
|
67 |
+
if (field.find('label .required').length === 0) {
|
68 |
+
field.find('label').append(
|
69 |
+
' <abbr class="required" title="' +
|
70 |
+
wc_address_i18n_params.i18n_required_text +
|
71 |
+
'">*</abbr>'
|
72 |
+
);
|
73 |
+
}
|
74 |
+
} else {
|
75 |
+
field.find('label .required').remove();
|
76 |
+
field.removeClass('validate-required woocommerce-invalid woocommerce-invalid-required-field');
|
77 |
+
|
78 |
+
if (field.find('label .optional').length === 0) {
|
79 |
+
field.find('label').append(' <span class="optional">(' + wc_address_i18n_params.i18n_optional_text + ')</span>');
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
$(document).on('country_to_state_changing', function (event, country, wrapper) {
|
86 |
+
|
87 |
+
var thisform = wrapper, thislocale;
|
88 |
+
|
89 |
+
var locale_fields = $.parseJSON(wc_address_i18n_params.locale_fields);
|
90 |
+
|
91 |
+
$.each(locale_fields, function (key, value) {
|
92 |
+
|
93 |
+
var field = thisform.find(value),
|
94 |
+
required = field.find('[data-required]').data('required') || 0;
|
95 |
+
|
96 |
+
field_is_required(field, required);
|
97 |
+
});
|
98 |
+
|
99 |
+
});
|
100 |
// Field
|
101 |
// ---------------------------------------------------------------------------
|
102 |
|
194 |
if (window.FormData && fileList[$field.attr('id')].length) {
|
195 |
|
196 |
if (!is_blocked($form)) {
|
197 |
+
$place_order.html(wooccm.message.uploading);
|
198 |
block($form);
|
199 |
}
|
200 |
|
233 |
processData: false,
|
234 |
contentType: false,
|
235 |
beforeSend: function (response) {
|
236 |
+
//$place_order.html(wooccm.message.uploading);
|
237 |
},
|
238 |
success: function (response) {
|
239 |
//$results.removeClass('woocommerce-message');
|
335 |
|
336 |
});
|
337 |
|
338 |
+
// Datepicker fields
|
339 |
+
// ---------------------------------------------------------------------------
|
340 |
+
|
341 |
+
$('.wooccm-type-datepicker').each(function (i, field) {
|
342 |
+
|
343 |
+
var $field = $(field),
|
344 |
+
$input = $field.find('input[type=text]');
|
345 |
+
|
346 |
+
if ($.isFunction($.fn.datepicker)) {
|
347 |
+
|
348 |
+
$input.datepicker({
|
349 |
+
dateFormat: $input.data('formatdate') || 'dd-mm-yy',
|
350 |
+
minDate: $input.data('mindate') || undefined,
|
351 |
+
maxDate: $input.data('maxdate') || undefined,
|
352 |
+
beforeShowDay: function (date) {
|
353 |
+
var day = date.getDay(),
|
354 |
+
disable = $input.data('disable') || false;
|
355 |
+
|
356 |
+
if (!disable) {
|
357 |
+
return [true]
|
358 |
+
} else {
|
359 |
+
return [disable[day] !== undefined];
|
360 |
+
}
|
361 |
+
}
|
362 |
+
});
|
363 |
+
}
|
364 |
+
|
365 |
+
});
|
366 |
+
|
367 |
+
// Timepicker fields
|
368 |
+
// ---------------------------------------------------------------------------
|
369 |
+
|
370 |
+
$('.wooccm-type-timepicker').each(function (i, field) {
|
371 |
+
|
372 |
+
var $field = $(field),
|
373 |
+
$input = $field.find('input[type=text]');
|
374 |
+
|
375 |
+
if ($.isFunction($.fn.timepicker)) {
|
376 |
+
$input.timepicker({
|
377 |
+
showPeriod: true,
|
378 |
+
showLeadingZero: true,
|
379 |
+
hours: $input.data('hours') || undefined,
|
380 |
+
minutes: $input.data('minutes') || undefined,
|
381 |
+
});
|
382 |
+
}
|
383 |
+
|
384 |
+
});
|
385 |
+
|
386 |
// Color fields
|
387 |
// ---------------------------------------------------------------------------
|
388 |
|
391 |
var $field = $(field),
|
392 |
$input = $field.find('input[type=text]'),
|
393 |
$container = $field.find('.wooccmcolorpicker_container');
|
394 |
+
|
395 |
$input.hide();
|
396 |
+
|
397 |
if ($.isFunction($.fn.farbtastic)) {
|
398 |
+
|
399 |
$container.farbtastic('#' + $input.attr('id'));
|
400 |
+
|
401 |
$container.on('click', function (e) {
|
402 |
$input.fadeIn();
|
403 |
});
|
404 |
+
|
405 |
}
|
406 |
|
407 |
});
|
408 |
+
|
409 |
$('.wooccm-colorpicker-iris').each(function (i, field) {
|
410 |
|
411 |
var $field = $(field),
|
412 |
+
$input = $field.find('input[type=text]');//,
|
413 |
+
//$container = $field.find('.wooccmcolorpicker_container');
|
414 |
|
415 |
$input.css('color', '#fff').css('background', $input.val()).hide();
|
416 |
|
assets/js/wooccm-checkout.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(
|
1 |
+
(function(e){var f=function(h){return h.is(".processing")||h.parents(".processing").length};var g=function(h){if(!f(h)){h.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var a=function(h){h.removeClass("processing").unblock()};var d=function(n,l,m,h,k){var o=e(n),p;if(k.match("image.*")){p="image"}else{if(k.match("application/ms.*")){m=wooccm.icons.spreadsheet;p="spreadsheet"}else{if(k.match("application/x.*")){m=wooccm.icons.archive;p="application"}else{if(k.match("audio.*")){m=wooccm.icons.audio;p="audio"}else{if(k.match("text.*")){m=wooccm.icons.text;p="text"}else{if(k.match("video.*")){m=wooccm.icons.video;p="video"}else{m=wooccm.icons.interactive;p="interactive"}}}}}}var j='<span data-file_id="'+l+'" title="'+h+'" class="wooccmupload_file">\n <span class="wooccmupload_file_container">\n <a title="'+h+'" class="wooccmupload_file_delete" class="wooccm_dele wooccm-btn wooccm-btn-danger">×</a>\n <span class="wooccmupload_file_image_container">\n <img class="'+p+'" alt="'+h+'" src="'+m+'"/>\n </span>\n </span>\n </span>';o.append(j).fadeIn()};function b(i,h){if(h){i.find("label .optional").remove();i.addClass("validate-required");if(i.find("label .required").length===0){i.find("label").append(' <abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>')}}else{i.find("label .required").remove();i.removeClass("validate-required woocommerce-invalid woocommerce-invalid-required-field");if(i.find("label .optional").length===0){i.find("label").append(' <span class="optional">('+wc_address_i18n_params.i18n_optional_text+")</span>")}}}e(document).on("country_to_state_changing",function(i,k,m){var j=m,h;var l=e.parseJSON(wc_address_i18n_params.locale_fields);e.each(l,function(n,o){var p=j.find(o),q=p.find("[data-required]").data("required")||0;b(p,q)})});var c=[];e(".wooccmupload-field").each(function(j,m){var k=e(m),l=k.find("[type=file]"),h=k.find(".wooccmupload_button"),n=k.find(".wooccmupload_list");c[k.attr("id")]=[];h.on("click",function(i){i.preventDefault();l.trigger("click")});n.on("click",".wooccmupload_file_delete",function(i){e(this).closest(".wooccmupload_file").remove()});l.on("change",function(o){var i=e(this)[0].files;if(i.length){if(window.FileReader){e.each(i,function(q,p){var r=n.find("span[data-file_id]").length+q;if(r>=wooccm.limit.max_files){alert("Exeeds max files limit of "+wooccm.limit.max_files);return false}if(p.size>wooccm.limit.max_file_size){alert("Exeeds max file size of "+wooccm.limit.max_file_size);return true}reader=new FileReader();reader.onload=(function(s){return function(t){setTimeout(function(){d(n,c[k.attr("id")].push(p)-1,t.target.result,s.name,s.type)},200)}})(p);console.log(p.name);reader.readAsDataURL(p)})}}})});e("#order_review").on("ajaxSuccess",function(l){var k=e(l.target),j=k.find("#place_order"),i=e(".wooccmupload-field"),h=i.length;if(h){j.addClass("wooccm-upload-process")}});e(document).on("click","#place_order.wooccm-upload-process",function(l){l.preventDefault();var i=e("form.checkout"),k=e(this),j=e(".wooccmupload-field"),h=j.length;j.each(function(m,p){var n=e(p),r=n.find(".wooccmupload_field"),q=n.find(".wooccmupload_list");if(window.FormData&&c[n.attr("id")].length){if(!f(i)){k.html(wooccm.message.uploading);g(i)}var o=new FormData();q.find("span[data-file_id]").each(function(t,s){var u=e(s).data("file_id");if(t>wooccm.limit.max_files){console.log("Exeeds max files limit of "+wooccm.limit.max_files);return false}if(c[n.attr("id")][u]===undefined){console.log("Undefined "+u);return true}if(c[n.attr("id")][u].size>wooccm.limit.max_file_size){console.log("Exeeds max file size of "+wooccm.limit.max_files);return true}console.log("We're ready to upload "+c[n.attr("id")][u].name);o.append("wooccm_checkout_attachment_upload[]",c[n.attr("id")][u])});o.append("action","wooccm_checkout_attachment_upload");o.append("nonce",wooccm.nonce);e.ajax({async:false,url:wooccm.ajaxurl,type:"POST",cache:false,data:o,processData:false,contentType:false,beforeSend:function(s){},success:function(s){if(s.success){r.val(s.data)}else{e("body").trigger("update_checkout")}},complete:function(s){h=h-1}})}else{h=h-1}if(h==0){a(i);k.removeClass("wooccm-upload-process").trigger("click")}})});e(document).on("change",".wooccm-add-checkout-fees",function(h){e("body").trigger("update_checkout")});e(".wooccm-conditional-child").each(function(h,m){var j=e(m),l=e(".wooccm-field-"+j.find("[data-conditional-parent]").data("conditional-parent")),k=j.find("[data-conditional-parent-value]").data("conditional-parent-value");if(l.length){l.on("change keyup",function(o){var n=e(o.target),i=n.val();if(n.prop("type")=="checkbox"){i=n.is(":checked")}if(k==i||(e.isArray(i)&&i.indexOf(k)>-1)){j.fadeIn()}else{j.fadeOut()}});l.find("select").trigger("change");l.find("textarea").trigger("keyup");l.find("input[type=button]").trigger("click");l.find("input[type=radio]:checked").trigger("keyup");l.find("input[type=checkbox]:checked").trigger("keyup");l.find("input[type=color]").trigger("keyup");l.find("input[type=date]").trigger("keyup");l.find("input[type=datetime-local]").trigger("keyup");l.find("input[type=email]").trigger("keyup");l.find("input[type=file]").trigger("keyup");l.find("input[type=hidden]").trigger("keyup");l.find("input[type=image]").trigger("keyup");l.find("input[type=month]").trigger("keyup");l.find("input[type=number]").trigger("keyup");l.find("input[type=password]").trigger("keyup");l.find("input[type=range]").trigger("keyup");l.find("input[type=reset]").trigger("keyup");l.find("input[type=search]").trigger("keyup");l.find("input[type=submit]").trigger("keyup");l.find("input[type=tel]").trigger("keyup");l.find("input[type=text]").trigger("keyup");l.find("input[type=time]").trigger("keyup");l.find("input[type=url]").trigger("keyup");l.find("input[type=week]").trigger("keyup")}else{j.show()}});e(".wooccm-type-datepicker").each(function(h,k){var j=e(k),l=j.find("input[type=text]");if(e.isFunction(e.fn.datepicker)){l.datepicker({dateFormat:l.data("formatdate")||"dd-mm-yy",minDate:l.data("mindate")||undefined,maxDate:l.data("maxdate")||undefined,beforeShowDay:function(n){var i=n.getDay(),m=l.data("disable")||false;if(!m){return[true]}else{return[m[i]!==undefined]}}})}});e(".wooccm-type-timepicker").each(function(h,k){var j=e(k),l=j.find("input[type=text]");if(e.isFunction(e.fn.timepicker)){l.timepicker({showPeriod:true,showLeadingZero:true,hours:l.data("hours")||undefined,minutes:l.data("minutes")||undefined,})}});e(".wooccm-colorpicker-farbtastic").each(function(h,k){var j=e(k),m=j.find("input[type=text]"),l=j.find(".wooccmcolorpicker_container");m.hide();if(e.isFunction(e.fn.farbtastic)){l.farbtastic("#"+m.attr("id"));l.on("click",function(i){m.fadeIn()})}});e(".wooccm-colorpicker-iris").each(function(h,k){var j=e(k),l=j.find("input[type=text]");l.css("color","#fff").css("background",l.val()).hide();l.iris({wccmclass:l.attr("id"),palettes:true,color:"",hide:false,change:function(i,m){l.css("color","#000").css("background",m.color.toString()).fadeIn()}})})})(jQuery);
|
assets/js/wooccm-modal.js
CHANGED
@@ -1,8 +1,12 @@
|
|
1 |
(function ($) {
|
2 |
|
|
|
|
|
|
|
3 |
var is_blocked = function ($node) {
|
4 |
return $node.is('.processing') || $node.parents('.processing').length;
|
5 |
};
|
|
|
6 |
var block = function ($node) {
|
7 |
if (!is_blocked($node)) {
|
8 |
$node.addClass('processing').block({
|
@@ -14,35 +18,44 @@
|
|
14 |
});
|
15 |
}
|
16 |
};
|
|
|
17 |
var unblock = function ($node) {
|
18 |
$node.removeClass('processing').unblock();
|
19 |
};
|
20 |
-
|
21 |
-
var
|
22 |
-
|
23 |
-
};
|
24 |
-
|
25 |
-
|
|
|
26 |
events: {
|
27 |
-
'click .media-modal-backdrop': '
|
28 |
-
'click .media-modal-close': '
|
29 |
'click .media-modal-delete': 'Delete',
|
30 |
'click .media-modal-prev': 'update',
|
31 |
'click .media-modal-next': 'update',
|
32 |
-
'
|
|
|
33 |
},
|
34 |
templates: {},
|
35 |
-
initialize: function (
|
36 |
-
'
|
37 |
-
_.bindAll(this, 'open', 'update', 'render', 'Close', 'Save');
|
38 |
this.init();
|
39 |
-
this.open(
|
40 |
},
|
41 |
init: function () {
|
42 |
this.templates.window = wp.template('wpmi-modal-window');
|
43 |
},
|
44 |
-
render: function (
|
45 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
var $modal = this;
|
47 |
$.ajax({
|
48 |
url: woocommerce_admin.ajax_url,
|
@@ -51,7 +64,7 @@
|
|
51 |
nonce: wooccm.nonce,
|
52 |
//options_name: $tr.data('options_name'),
|
53 |
//options_key: $tr.data('options_key'),
|
54 |
-
field_id:
|
55 |
},
|
56 |
dataType: 'json',
|
57 |
type: 'POST',
|
@@ -66,110 +79,131 @@
|
|
66 |
},
|
67 |
success: function (response) {
|
68 |
console.log(response);
|
69 |
-
$modal
|
70 |
-
$modal
|
71 |
-
//$(document).on('focusin', $modal.preserveFocus);
|
72 |
-
$modal.$el.focus().trigger('wc-init-tabbed-panels');
|
73 |
-
$modal.$el.focus().trigger('init_tooltips');
|
74 |
-
///$modal.$el.focus().trigger('wc-enhanced-select-init');
|
75 |
-
$modal.$el.focus().trigger('wooccm-enhanced-select');
|
76 |
}
|
77 |
});
|
78 |
},
|
79 |
update: function (e) {
|
80 |
-
'use strict';
|
81 |
-
|
82 |
e.preventDefault();
|
83 |
|
84 |
-
var $
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
},
|
88 |
open: function (e) {
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
field_id = $tr.data('field_id');
|
93 |
-
this.render(field_id);
|
94 |
$('body').addClass('modal-open').append(this.$el);
|
95 |
},
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
105 |
e.preventDefault();
|
106 |
this.undelegateEvents();
|
107 |
$(document).off('focusin');
|
108 |
$('body').removeClass('modal-open');
|
109 |
this.remove();
|
110 |
-
wpmi.__instance = undefined;
|
111 |
},
|
112 |
-
|
113 |
-
|
114 |
e.preventDefault();
|
115 |
var $form = $(e.target),
|
116 |
$modal = this.$el,
|
117 |
-
$
|
118 |
-
//$spinner = settings-save-status
|
119 |
-
//console.log($form.serialize());
|
120 |
|
121 |
$.ajax({
|
122 |
url: woocommerce_admin.ajax_url,
|
123 |
data: {
|
124 |
action: 'wooccm_save_field',
|
125 |
nonce: wooccm.nonce,
|
126 |
-
field_id:
|
127 |
//options_name: $tr.data('options_name'),
|
128 |
//options_key: $tr.data('options_key'),
|
129 |
field_data: $form.serializeArrayAll()
|
130 |
},
|
131 |
-
//data: $.param({field_data: $form.serializeArrayAll()}) + '&' + $.param({action: 'wooccm_save_field'}) + '&' + $.param({nonce: wooccm.nonce}),
|
132 |
dataType: 'json',
|
133 |
type: 'POST',
|
134 |
beforeSend: function () {
|
135 |
-
$
|
136 |
-
block($modal);
|
137 |
},
|
138 |
complete: function () {
|
139 |
-
$
|
140 |
-
|
141 |
-
|
|
|
142 |
},
|
143 |
error: function () {
|
144 |
alert('Error!');
|
145 |
},
|
146 |
success: function (response) {
|
147 |
console.log(response);
|
148 |
-
//$modal.$el.attr('tabindex', '0');
|
149 |
-
//$modal.$el.html($modal.templates.window(response.data));
|
150 |
-
//$(document).on('focusin', $modal.preserveFocus);
|
151 |
-
//$modal.$el.focus().trigger('wc-init-tabbed-panels');
|
152 |
}
|
153 |
});
|
154 |
return false;
|
155 |
-
},
|
156 |
-
Delete: function (e) {
|
157 |
-
'use strict';
|
158 |
-
e.preventDefault();
|
159 |
-
var $modal = this;
|
160 |
-
$modal.Close(e);
|
161 |
}
|
162 |
});
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
});
|
|
|
169 |
$('.wooccm_billing_settings_edit').on('click', function (e) {
|
170 |
e.preventDefault();
|
171 |
-
|
172 |
-
|
173 |
-
}
|
174 |
});
|
|
|
|
|
175 |
})(jQuery);
|
1 |
(function ($) {
|
2 |
|
3 |
+
var count = 0,
|
4 |
+
timer;
|
5 |
+
|
6 |
var is_blocked = function ($node) {
|
7 |
return $node.is('.processing') || $node.parents('.processing').length;
|
8 |
};
|
9 |
+
|
10 |
var block = function ($node) {
|
11 |
if (!is_blocked($node)) {
|
12 |
$node.addClass('processing').block({
|
18 |
});
|
19 |
}
|
20 |
};
|
21 |
+
|
22 |
var unblock = function ($node) {
|
23 |
$node.removeClass('processing').unblock();
|
24 |
};
|
25 |
+
|
26 |
+
var Field = Backbone.Model.extend({
|
27 |
+
defaults: wooccm.fields.args
|
28 |
+
});
|
29 |
+
|
30 |
+
var FieldView = Backbone.View.extend({
|
31 |
+
id: 'wooccm_modal',
|
32 |
events: {
|
33 |
+
'click .media-modal-backdrop': 'close',
|
34 |
+
'click .media-modal-close': 'close',
|
35 |
'click .media-modal-delete': 'Delete',
|
36 |
'click .media-modal-prev': 'update',
|
37 |
'click .media-modal-next': 'update',
|
38 |
+
'change .media-modal-change': 'change',
|
39 |
+
'submit .media-modal-form': 'save',
|
40 |
},
|
41 |
templates: {},
|
42 |
+
initialize: function () {
|
43 |
+
_.bindAll(this, 'open', 'update', 'change', 'load', 'render', 'close', 'save');
|
|
|
44 |
this.init();
|
45 |
+
this.open();
|
46 |
},
|
47 |
init: function () {
|
48 |
this.templates.window = wp.template('wpmi-modal-window');
|
49 |
},
|
50 |
+
render: function () {
|
51 |
+
this.$el.attr('tabindex', '0');
|
52 |
+
this.$el.html(this.templates.window(this.model.attributes));
|
53 |
+
this.$el.focus().trigger('wc-init-tabbed-panels');
|
54 |
+
this.$el.focus().trigger('init_tooltips');
|
55 |
+
this.$el.focus().trigger('wooccm-enhanced-select');
|
56 |
+
},
|
57 |
+
load: function () {
|
58 |
+
|
59 |
var $modal = this;
|
60 |
$.ajax({
|
61 |
url: woocommerce_admin.ajax_url,
|
64 |
nonce: wooccm.nonce,
|
65 |
//options_name: $tr.data('options_name'),
|
66 |
//options_key: $tr.data('options_key'),
|
67 |
+
field_id: this.model.attributes.id
|
68 |
},
|
69 |
dataType: 'json',
|
70 |
type: 'POST',
|
79 |
},
|
80 |
success: function (response) {
|
81 |
console.log(response);
|
82 |
+
$modal.model.set(response.data)
|
83 |
+
$modal.render();
|
|
|
|
|
|
|
|
|
|
|
84 |
}
|
85 |
});
|
86 |
},
|
87 |
update: function (e) {
|
|
|
|
|
88 |
e.preventDefault();
|
89 |
|
90 |
+
var $modal = this,
|
91 |
+
$button = $(e.target),
|
92 |
+
field_id = $modal.model.get('id');
|
93 |
+
|
94 |
+
count++;
|
95 |
+
|
96 |
+
if (timer) {
|
97 |
+
clearTimeout(timer);
|
98 |
+
}
|
99 |
+
|
100 |
+
timer = setTimeout(function () {
|
101 |
+
|
102 |
+
if ($button.hasClass('media-modal-next')) {
|
103 |
+
field_id = field_id + count;
|
104 |
+
} else {
|
105 |
+
field_id = field_id - count;
|
106 |
+
}
|
107 |
+
|
108 |
+
$modal.model.set({
|
109 |
+
id: field_id
|
110 |
+
});
|
111 |
+
|
112 |
+
count = 0;
|
113 |
+
|
114 |
+
$modal.load();
|
115 |
+
|
116 |
+
}, 300);
|
117 |
},
|
118 |
open: function (e) {
|
119 |
+
|
120 |
+
this.load();
|
121 |
+
|
|
|
|
|
122 |
$('body').addClass('modal-open').append(this.$el);
|
123 |
},
|
124 |
+
change: function (e) {
|
125 |
+
|
126 |
+
e.preventDefault();
|
127 |
+
|
128 |
+
var $field = $(e.target),
|
129 |
+
name = $field.attr('name'),
|
130 |
+
value = $field.val();
|
131 |
+
|
132 |
+
this.model.attributes[name] = value;
|
133 |
+
|
134 |
+
this.render();
|
135 |
+
},
|
136 |
+
close: function (e) {
|
137 |
e.preventDefault();
|
138 |
this.undelegateEvents();
|
139 |
$(document).off('focusin');
|
140 |
$('body').removeClass('modal-open');
|
141 |
this.remove();
|
142 |
+
//wpmi.__instance = undefined;
|
143 |
},
|
144 |
+
save: function (e) {
|
145 |
+
|
146 |
e.preventDefault();
|
147 |
var $form = $(e.target),
|
148 |
$modal = this.$el,
|
149 |
+
$details = $modal.find('.attachment-details');
|
|
|
|
|
150 |
|
151 |
$.ajax({
|
152 |
url: woocommerce_admin.ajax_url,
|
153 |
data: {
|
154 |
action: 'wooccm_save_field',
|
155 |
nonce: wooccm.nonce,
|
156 |
+
field_id: this.model.attributes.id,
|
157 |
//options_name: $tr.data('options_name'),
|
158 |
//options_key: $tr.data('options_key'),
|
159 |
field_data: $form.serializeArrayAll()
|
160 |
},
|
|
|
161 |
dataType: 'json',
|
162 |
type: 'POST',
|
163 |
beforeSend: function () {
|
164 |
+
$details.addClass('save-waiting');
|
165 |
+
//block($modal);
|
166 |
},
|
167 |
complete: function () {
|
168 |
+
$details.addClass('save-complete');
|
169 |
+
$details.removeClass('save-waiting');
|
170 |
+
//unblock($modal);
|
171 |
+
//$modal.close(e);
|
172 |
},
|
173 |
error: function () {
|
174 |
alert('Error!');
|
175 |
},
|
176 |
success: function (response) {
|
177 |
console.log(response);
|
|
|
|
|
|
|
|
|
178 |
}
|
179 |
});
|
180 |
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
}
|
182 |
});
|
183 |
+
|
184 |
+
var FieldModal = Backbone.View.extend({
|
185 |
+
initialize: function (e) {
|
186 |
+
|
187 |
+
var $button = $(e.target),
|
188 |
+
field_id = $button.closest('[data-field_id]').data('field_id');
|
189 |
+
|
190 |
+
var model = new Field();
|
191 |
+
|
192 |
+
model.set({
|
193 |
+
id: field_id
|
194 |
+
});
|
195 |
+
|
196 |
+
new FieldView({
|
197 |
+
model: model
|
198 |
+
});
|
199 |
+
},
|
200 |
});
|
201 |
+
|
202 |
$('.wooccm_billing_settings_edit').on('click', function (e) {
|
203 |
e.preventDefault();
|
204 |
+
|
205 |
+
new FieldModal(e);
|
|
|
206 |
});
|
207 |
+
|
208 |
+
|
209 |
})(jQuery);
|
assets/js/wooccm-modal.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(
|
1 |
+
(function(e){var g=0,b;var d=function(j){return j.is(".processing")||j.parents(".processing").length};var c=function(j){if(!d(j)){j.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var f=function(j){j.removeClass("processing").unblock()};var h=Backbone.Model.extend({defaults:wooccm.fields.args});var i=Backbone.View.extend({id:"wooccm_modal",events:{"click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-delete":"Delete","click .media-modal-prev":"update","click .media-modal-next":"update","change .media-modal-change":"change","submit .media-modal-form":"save",},templates:{},initialize:function(){_.bindAll(this,"open","update","change","load","render","close","save");this.init();this.open()},init:function(){this.templates.window=wp.template("wpmi-modal-window")},render:function(){this.$el.attr("tabindex","0");this.$el.html(this.templates.window(this.model.attributes));this.$el.focus().trigger("wc-init-tabbed-panels");this.$el.focus().trigger("init_tooltips");this.$el.focus().trigger("wooccm-enhanced-select")},load:function(){var j=this;e.ajax({url:woocommerce_admin.ajax_url,data:{action:"wooccm_edit_field",nonce:wooccm.nonce,field_id:this.model.attributes.id},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(k){console.log(k);j.model.set(k.data);j.render()}})},update:function(m){m.preventDefault();var j=this,l=e(m.target),k=j.model.get("id");g++;if(b){clearTimeout(b)}b=setTimeout(function(){if(l.hasClass("media-modal-next")){k=k+g}else{k=k-g}j.model.set({id:k});g=0;j.load()},300)},open:function(j){this.load();e("body").addClass("modal-open").append(this.$el)},change:function(m){m.preventDefault();var k=e(m.target),j=k.attr("name"),l=k.val();this.model.attributes[j]=l;this.render()},close:function(j){j.preventDefault();this.undelegateEvents();e(document).off("focusin");e("body").removeClass("modal-open");this.remove()},save:function(m){m.preventDefault();var k=e(m.target),l=this.$el,j=l.find(".attachment-details");e.ajax({url:woocommerce_admin.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm.nonce,field_id:this.model.attributes.id,field_data:k.serializeArrayAll()},dataType:"json",type:"POST",beforeSend:function(){j.addClass("save-waiting")},complete:function(){j.addClass("save-complete");j.removeClass("save-waiting")},error:function(){alert("Error!")},success:function(n){console.log(n)}});return false}});var a=Backbone.View.extend({initialize:function(m){var l=e(m.target),k=l.closest("[data-field_id]").data("field_id");var j=new h();j.set({id:k});new i({model:j})},});e(".wooccm_billing_settings_edit").on("click",function(j){j.preventDefault();new a(j)})})(jQuery);
|
assets/js/wooccm-order-upload.js
CHANGED
@@ -47,11 +47,11 @@
|
|
47 |
all_attachments_ids: $('#all_attachments_ids').val()
|
48 |
},
|
49 |
beforeSend: function (response) {
|
50 |
-
$('.wccm_results').html(wooccm.saving);
|
51 |
},
|
52 |
success: function (response) {
|
53 |
if (response.success) {
|
54 |
-
$('.wccm_results').html(wooccm.deleted);
|
55 |
} else {
|
56 |
$('.wccm_results').html(response.data);
|
57 |
}
|
@@ -110,7 +110,7 @@
|
|
110 |
contentType: false,
|
111 |
beforeSend: function (response) {
|
112 |
|
113 |
-
$('.wccm_results').html(wooccm.uploading);
|
114 |
|
115 |
block($('#wooccm_order_attachment_inner'));
|
116 |
},
|
@@ -118,7 +118,7 @@
|
|
118 |
|
119 |
if (response.success) {
|
120 |
$('#wooccm_order_attachment_inner').replaceWith(response.data);
|
121 |
-
$('.wccm_results').html(wooccm.success);
|
122 |
} else {
|
123 |
$('.wccm_results').html(response.data);
|
124 |
}
|
47 |
all_attachments_ids: $('#all_attachments_ids').val()
|
48 |
},
|
49 |
beforeSend: function (response) {
|
50 |
+
$('.wccm_results').html(wooccm.message.saving);
|
51 |
},
|
52 |
success: function (response) {
|
53 |
if (response.success) {
|
54 |
+
$('.wccm_results').html(wooccm.message.deleted);
|
55 |
} else {
|
56 |
$('.wccm_results').html(response.data);
|
57 |
}
|
110 |
contentType: false,
|
111 |
beforeSend: function (response) {
|
112 |
|
113 |
+
$('.wccm_results').html(wooccm.message.uploading);
|
114 |
|
115 |
block($('#wooccm_order_attachment_inner'));
|
116 |
},
|
118 |
|
119 |
if (response.success) {
|
120 |
$('#wooccm_order_attachment_inner').replaceWith(response.data);
|
121 |
+
$('.wccm_results').html(wooccm.message.success);
|
122 |
} else {
|
123 |
$('.wccm_results').html(response.data);
|
124 |
}
|
assets/js/wooccm-order-upload.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(b){var c=function(e){return e.is(".processing")||e.parents(".processing").length};var d=function(e){if(!c(e)){e.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var a=function(e){e.removeClass("processing").unblock()};b(document).ready(function(e){e(document).on("click",".wooccm_delete_attachment",function(h){var g=e(this).closest("tr"),f=e(this).data("attachment_id");g.hide();e("#wooccm_order_attachment_update").prop("disabled",false);e("#delete_attachments_ids").val(e("#delete_attachments_ids").val().replace(f,""))});e(document).on("click","#wooccm_order_attachment_update",function(f){e.ajax({url:wooccm.ajaxurl,type:"POST",cache:false,data:{action:"wooccm_order_attachment_update",nonce:wooccm.nonce,delete_attachments_ids:e("#delete_attachments_ids").val(),all_attachments_ids:e("#all_attachments_ids").val()},beforeSend:function(g){e(".wccm_results").html(wooccm.saving)},success:function(g){if(g.success){e(".wccm_results").html(wooccm.deleted)}else{e(".wccm_results").html(g.data)}}})});e(document).on("change","#wooccm_order_attachment_upload",function(m){var l=false,n=e(this).data("order_id");if(window.FormData){l=new FormData()}var k=0,g=this.files.length,h,f,j;for(;k<g;k++){j=this.files[k];if(l){l.append("wooccm_order_attachment_upload[]",j)}}if(l){l.append("action","wooccm_order_attachment_upload");l.append("nonce",wooccm.nonce);l.append("order_id",n);e.ajax({url:wooccm.ajaxurl,type:"POST",cache:false,data:l,processData:false,contentType:false,beforeSend:function(i){e(".wccm_results").html(wooccm.uploading);d(e("#wooccm_order_attachment_inner"))},success:function(i){if(i.success){e("#wooccm_order_attachment_inner").replaceWith(i.data);e(".wccm_results").html(wooccm.success)}else{e(".wccm_results").html(i.data)}a(e("#wooccm_order_attachment_inner"))}})}})})})(jQuery);
|
1 |
+
(function(b){var c=function(e){return e.is(".processing")||e.parents(".processing").length};var d=function(e){if(!c(e)){e.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var a=function(e){e.removeClass("processing").unblock()};b(document).ready(function(e){e(document).on("click",".wooccm_delete_attachment",function(h){var g=e(this).closest("tr"),f=e(this).data("attachment_id");g.hide();e("#wooccm_order_attachment_update").prop("disabled",false);e("#delete_attachments_ids").val(e("#delete_attachments_ids").val().replace(f,""))});e(document).on("click","#wooccm_order_attachment_update",function(f){e.ajax({url:wooccm.ajaxurl,type:"POST",cache:false,data:{action:"wooccm_order_attachment_update",nonce:wooccm.nonce,delete_attachments_ids:e("#delete_attachments_ids").val(),all_attachments_ids:e("#all_attachments_ids").val()},beforeSend:function(g){e(".wccm_results").html(wooccm.message.saving)},success:function(g){if(g.success){e(".wccm_results").html(wooccm.message.deleted)}else{e(".wccm_results").html(g.data)}}})});e(document).on("change","#wooccm_order_attachment_upload",function(m){var l=false,n=e(this).data("order_id");if(window.FormData){l=new FormData()}var k=0,g=this.files.length,h,f,j;for(;k<g;k++){j=this.files[k];if(l){l.append("wooccm_order_attachment_upload[]",j)}}if(l){l.append("action","wooccm_order_attachment_upload");l.append("nonce",wooccm.nonce);l.append("order_id",n);e.ajax({url:wooccm.ajaxurl,type:"POST",cache:false,data:l,processData:false,contentType:false,beforeSend:function(i){e(".wccm_results").html(wooccm.message.uploading);d(e("#wooccm_order_attachment_inner"))},success:function(i){if(i.success){e("#wooccm_order_attachment_inner").replaceWith(i.data);e(".wccm_results").html(wooccm.message.success)}else{e(".wccm_results").html(i.data)}a(e("#wooccm_order_attachment_inner"))}})}})})})(jQuery);
|
includes/checkout.php
CHANGED
@@ -1,57 +1,5 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
// Decides where the Additional Checkout fields appear on the Checkout page
|
4 |
-
/*
|
5 |
-
* 1326
|
6 |
-
* function wooccm_checkout_additional_positioning() {
|
7 |
-
|
8 |
-
$options = get_option( 'wccs_settings' );
|
9 |
-
// Defaults to after_order_notes
|
10 |
-
$position = ( !empty( $options['checkness']['position'] ) ? sanitize_text_field( $options['checkness']['position'] ) : 'after_order_notes' );
|
11 |
-
switch( $position ) {
|
12 |
-
|
13 |
-
case 'before_shipping_form':
|
14 |
-
case 'after_shipping_form':
|
15 |
-
case 'before_billing_form':
|
16 |
-
case 'after_billing_form':
|
17 |
-
case 'after_order_notes':
|
18 |
-
return $position;
|
19 |
-
break;
|
20 |
-
|
21 |
-
}
|
22 |
-
|
23 |
-
} */
|
24 |
-
|
25 |
-
/*
|
26 |
-
* 1326
|
27 |
-
* break i18 address required field
|
28 |
-
* function wooccm_checkout_default_address_fields( $fields = array() ) {
|
29 |
-
|
30 |
-
|
31 |
-
// Billing fields
|
32 |
-
$options = get_option( 'wccs_settings3' );
|
33 |
-
$buttons = ( isset( $options['billing_buttons'] ) ? $options['billing_buttons'] : false );
|
34 |
-
|
35 |
-
if( empty( $buttons ) )
|
36 |
-
return $fields;
|
37 |
-
|
38 |
-
foreach( $buttons as $btn ) {
|
39 |
-
|
40 |
-
if( !empty( $btn['cow'] ) && empty( $btn['deny_checkout'] ) ) {
|
41 |
-
$key = $btn['cow'];
|
42 |
-
|
43 |
-
if( isset( $fields[$key] ) )
|
44 |
-
$fields[$key]['required'] = ( isset( $btn['checkbox'] ) ? absint( $btn['checkbox'] ) : ( isset( $fields[$key]['required'] ) ? absint( $fields[$key]['required'] ) : false ) );
|
45 |
-
|
46 |
-
}
|
47 |
-
|
48 |
-
}
|
49 |
-
|
50 |
-
return $fields;
|
51 |
-
|
52 |
-
}
|
53 |
-
*/
|
54 |
-
|
55 |
function wooccm_autocreate_account($fields) {
|
56 |
|
57 |
$options = get_option('wccs_settings');
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
function wooccm_autocreate_account($fields) {
|
4 |
|
5 |
$options = get_option('wccs_settings');
|
includes/templates/admin/woocheckout-additional-clone.php
CHANGED
@@ -133,11 +133,11 @@ if ( !defined( 'ABSPATH' ) )
|
|
133 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e( 'Options Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
134 |
|
135 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change_tog hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e( 'Swapper Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
136 |
-
|
137 |
<td class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e( 'Time Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
138 |
|
139 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;"><?php _e( 'Date Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
140 |
-
|
141 |
<td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1"><?php _e( 'Hidden Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
142 |
|
143 |
<td class="filter_field add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_color hide_stuff_op more_toggler more_toggler1c"><?php _e( 'More Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
133 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e( 'Options Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
134 |
|
135 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change_tog hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e( 'Swapper Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
136 |
+
<!--
|
137 |
<td class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e( 'Time Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
138 |
|
139 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;"><?php _e( 'Date Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
140 |
+
-->
|
141 |
<td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1"><?php _e( 'Hidden Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
142 |
|
143 |
<td class="filter_field add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_color hide_stuff_op more_toggler more_toggler1c"><?php _e( 'More Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
includes/templates/admin/woocheckout-billing-clone.php
CHANGED
@@ -127,11 +127,11 @@ if ( !defined( 'ABSPATH' ) )
|
|
127 |
<td class="hide_stuff_op wccm1" style="display:none;"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][option_array]" value="" placeholder="Option 1||Option 2||Option 3" /></td>
|
128 |
|
129 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Options Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
130 |
-
|
131 |
<td class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Time Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
132 |
|
133 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;"><?php _e('Date Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
134 |
-
|
135 |
<td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1"><?php _e('Hidden Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
136 |
|
137 |
<td class="filter_field add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_color hide_stuff_op more_toggler more_toggler1c"><?php _e('More Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
127 |
<td class="hide_stuff_op wccm1" style="display:none;"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][option_array]" value="" placeholder="Option 1||Option 2||Option 3" /></td>
|
128 |
|
129 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Options Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
130 |
+
<!--
|
131 |
<td class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Time Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
132 |
|
133 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;"><?php _e('Date Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
134 |
+
-->
|
135 |
<td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1"><?php _e('Hidden Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
136 |
|
137 |
<td class="filter_field add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_color hide_stuff_op more_toggler more_toggler1c"><?php _e('More Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
includes/templates/admin/woocheckout-billing-tbody.php
CHANGED
@@ -230,14 +230,15 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
230 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_color more_toggler1 more_toggler1c" style="display:none;">
|
231 |
<?php _e('Options Toggler', 'woocommerce-checkout-manager' ); ?>
|
232 |
</td>
|
233 |
-
|
234 |
-
|
235 |
<?php _e('Time Toggler', 'woocommerce-checkout-manager' ); ?>
|
236 |
</td>
|
237 |
|
238 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;">
|
239 |
-
<?php _e('Date Toggler', 'woocommerce-checkout-manager' );
|
240 |
</td>
|
|
|
241 |
|
242 |
<td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1">
|
243 |
<?php _e('Hidden Toggler', 'woocommerce-checkout-manager' ); ?>
|
230 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_color more_toggler1 more_toggler1c" style="display:none;">
|
231 |
<?php _e('Options Toggler', 'woocommerce-checkout-manager' ); ?>
|
232 |
</td>
|
233 |
+
<!--
|
234 |
+
<td class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;">
|
235 |
<?php _e('Time Toggler', 'woocommerce-checkout-manager' ); ?>
|
236 |
</td>
|
237 |
|
238 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;">
|
239 |
+
<?php _e('Date Toggler', 'woocommerce-checkout-manager' ); ?>
|
240 |
</td>
|
241 |
+
-->
|
242 |
|
243 |
<td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1">
|
244 |
<?php _e('Hidden Toggler', 'woocommerce-checkout-manager' ); ?>
|
includes/templates/admin/woocheckout-billing-thead.php
CHANGED
@@ -116,7 +116,8 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
116 |
|
117 |
<th style="cursor:pointer;text-align:center;font-size:30px;display:none;" class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_tog hide_stuff_color more_toggler1 more_toggler1c" width="2%"><span class="toggle_shower">≡</span></th>
|
118 |
|
119 |
-
|
|
|
120 |
|
121 |
<th style="cursor:pointer;text-align:center;font-size:30px;display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_days hide_stuff_color_tog hide_stuff_op more_toggler1 more_toggler1c" width="2%"><span class="toggle_shower">≡</span></th>
|
122 |
-->
|
116 |
|
117 |
<th style="cursor:pointer;text-align:center;font-size:30px;display:none;" class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_tog hide_stuff_color more_toggler1 more_toggler1c" width="2%"><span class="toggle_shower">≡</span></th>
|
118 |
|
119 |
+
<!--
|
120 |
+
<th style="cursor:pointer;text-align:center;font-size:30px;display:none;" class="filter_field add_amount_field condition_tick hide_stuff_opcheck hide_stuff_op hide_stuff_change hide_stuff_time_tog hide_stuff_color more_toggler1 more_toggler1c" width="2%"><span class="toggle_shower">≡</span></th>
|
121 |
|
122 |
<th style="cursor:pointer;text-align:center;font-size:30px;display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_days hide_stuff_color_tog hide_stuff_op more_toggler1 more_toggler1c" width="2%"><span class="toggle_shower">≡</span></th>
|
123 |
-->
|
includes/templates/admin/woocheckout-shipping-clone.php
CHANGED
@@ -128,11 +128,11 @@ if ( !defined( 'ABSPATH' ) )
|
|
128 |
<td class="hide_stuff_op wccm1" style="display:none;"><input type="text" name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][option_array]" value="" placeholder="Option 1||Option 2||Option 3" /></td>
|
129 |
|
130 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Options Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
131 |
-
|
132 |
<td class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Time Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
133 |
|
134 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;"><?php _e('Date Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
135 |
-
|
136 |
<td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1"><?php _e('Hidden Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
137 |
|
138 |
<td class="filter_field add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_color hide_stuff_op more_toggler more_toggler1c"><?php _e('More Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
128 |
<td class="hide_stuff_op wccm1" style="display:none;"><input type="text" name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][option_array]" value="" placeholder="Option 1||Option 2||Option 3" /></td>
|
129 |
|
130 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Options Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
131 |
+
<!--
|
132 |
<td class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Time Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
133 |
|
134 |
<td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;"><?php _e('Date Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
135 |
+
-->
|
136 |
<td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1"><?php _e('Hidden Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
137 |
|
138 |
<td class="filter_field add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_color hide_stuff_op more_toggler more_toggler1c"><?php _e('More Toggler', 'woocommerce-checkout-manager' ); ?></td>
|
includes/templates/functions/add_functions.php
DELETED
@@ -1,337 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WooCommerce Checkout Manager
|
4 |
-
*/
|
5 |
-
// Exit if accessed directly
|
6 |
-
if (!defined('ABSPATH'))
|
7 |
-
exit;
|
8 |
-
|
9 |
-
function wooccm_scripts() {
|
10 |
-
|
11 |
-
global $woocommerce;
|
12 |
-
|
13 |
-
$options = get_option('wccs_settings');
|
14 |
-
|
15 |
-
$saved = WC()->session->get('wooccm_retain', array());
|
16 |
-
|
17 |
-
// Check if we have any buttons
|
18 |
-
if (empty($options['buttons']))
|
19 |
-
return;
|
20 |
-
|
21 |
-
foreach ($options['buttons'] as $btn) {
|
22 |
-
|
23 |
-
if ($btn['type'] == 'datepicker') {
|
24 |
-
echo '
|
25 |
-
<script type="text/javascript">
|
26 |
-
jQuery(document).ready(function() {
|
27 |
-
var today = new Date();
|
28 |
-
if( jQuery.isFunction(jQuery.fn.datepicker) ) {
|
29 |
-
jQuery("input#' . $btn['cow'] . '").datepicker({
|
30 |
-
';
|
31 |
-
// Default date format
|
32 |
-
if (empty($btn['format_date']))
|
33 |
-
$btn['format_date'] = apply_filters('wooccm_datepicker_default_date_format', 'dd-mm-yy');
|
34 |
-
if (!empty($btn['format_date'])) {
|
35 |
-
echo 'dateFormat : "' . str_replace(' ', '', $btn['format_date']) . '",';
|
36 |
-
}
|
37 |
-
if (!empty($btn['single_yy'])) {
|
38 |
-
echo 'minDate: new Date( ' . $btn['single_yy'] . ', ' . $btn['single_mm'] . ' - 1, ' . $btn['single_dd'] . '),';
|
39 |
-
}
|
40 |
-
if (!empty($btn['min_before'])) {
|
41 |
-
echo 'minDate: ' . $btn['min_before'] . ',';
|
42 |
-
}
|
43 |
-
if (!empty($btn['single_max_yy'])) {
|
44 |
-
echo 'maxDate: new Date( ' . $btn['single_max_yy'] . ', ' . $btn['single_max_mm'] . ' - 1, ' . $btn['single_max_dd'] . '),';
|
45 |
-
}
|
46 |
-
if (!empty($btn['max_after'])) {
|
47 |
-
echo 'maxDate: ' . $btn['max_after'] . ',';
|
48 |
-
}
|
49 |
-
if (!empty($btn['days_disabler'])) {
|
50 |
-
echo 'beforeShowDay: function(date) { var day = date.getDay(); return [(';
|
51 |
-
if (!empty($btn['days_disabler0'])) {
|
52 |
-
echo 'day == 0';
|
53 |
-
} else {
|
54 |
-
echo 'day == "x"';
|
55 |
-
}
|
56 |
-
if (!empty($btn['days_disabler1'])) {
|
57 |
-
echo ' || day == 1';
|
58 |
-
}
|
59 |
-
if (!empty($btn['days_disabler2'])) {
|
60 |
-
echo ' || day == 2';
|
61 |
-
}
|
62 |
-
if (!empty($btn['days_disabler3'])) {
|
63 |
-
echo ' || day == 3';
|
64 |
-
}
|
65 |
-
if (!empty($btn['days_disabler4'])) {
|
66 |
-
echo ' || day == 4';
|
67 |
-
}
|
68 |
-
if (!empty($btn['days_disabler5'])) {
|
69 |
-
echo ' || day == 5';
|
70 |
-
}
|
71 |
-
if (!empty($btn['days_disabler6'])) {
|
72 |
-
echo '|| day == 6';
|
73 |
-
}
|
74 |
-
echo ')]; }';
|
75 |
-
}
|
76 |
-
do_action('wooccm_js_datepicker_additional_args', $btn);
|
77 |
-
echo '
|
78 |
-
});
|
79 |
-
}
|
80 |
-
});
|
81 |
-
</script>
|
82 |
-
';
|
83 |
-
}
|
84 |
-
|
85 |
-
if ($btn['type'] == 'time') {
|
86 |
-
$args = '
|
87 |
-
showPeriod: true,';
|
88 |
-
if (!empty($btn['start_hour'])) {
|
89 |
-
$args .= '
|
90 |
-
hours: { starts: ' . $btn['start_hour'] . ', ends: ' . $btn['end_hour'] . ' },';
|
91 |
-
}
|
92 |
-
if (!empty($btn['interval_min'])) {
|
93 |
-
$args .= '
|
94 |
-
minutes: {interval: ' . $btn['interval_min'] . ', manual: [' . $btn['manual_min'] . '] },';
|
95 |
-
}
|
96 |
-
$args .= '
|
97 |
-
showLeadingZero: true';
|
98 |
-
$args = apply_filters('wooccm_timepicker_jquery_args', $args, $btn);
|
99 |
-
echo '
|
100 |
-
<!-- Additional section: TimePicker -->
|
101 |
-
<script type="text/javascript">
|
102 |
-
jQuery(document).ready(function() {
|
103 |
-
if( jQuery.isFunction(jQuery.fn.timepicker) ) {
|
104 |
-
jQuery("#' . $btn['cow'] . '_field input#' . $btn['cow'] . '").timepicker({'
|
105 |
-
;
|
106 |
-
echo $args;
|
107 |
-
echo '
|
108 |
-
});
|
109 |
-
}
|
110 |
-
});
|
111 |
-
</script>
|
112 |
-
';
|
113 |
-
}
|
114 |
-
|
115 |
-
if ($btn['type'] == 'password') {
|
116 |
-
echo '
|
117 |
-
<script type="text/javascript">
|
118 |
-
jQuery(document).ready(function() {
|
119 |
-
jQuery("p#' . $btn['cow'] . '_field").css("display");
|
120 |
-
});
|
121 |
-
</script>
|
122 |
-
';
|
123 |
-
}
|
124 |
-
|
125 |
-
/*if ($btn['type'] == 'colorpicker') {
|
126 |
-
switch ($btn['colorpickertype']) {
|
127 |
-
|
128 |
-
case 'farbtastic':
|
129 |
-
?>
|
130 |
-
<script type="text/javascript">
|
131 |
-
jQuery(document).ready(function ($) {
|
132 |
-
jQuery('#<?php echo $btn['cow']; ?>_colorpickerdiv').hide();
|
133 |
-
if (jQuery.isFunction(jQuery.fn.farbtastic)) {
|
134 |
-
jQuery('#<?php echo $btn['cow']; ?>_colorpickerdiv').farbtastic("#<?php echo $btn['cow']; ?>_colorpicker");
|
135 |
-
jQuery("#<?php echo $btn['cow']; ?>_colorpicker").click(function () {
|
136 |
-
jQuery('#<?php echo $btn['cow']; ?>_colorpickerdiv').slideToggle()
|
137 |
-
});
|
138 |
-
}
|
139 |
-
});
|
140 |
-
</script>
|
141 |
-
<?php
|
142 |
-
break;
|
143 |
-
|
144 |
-
case 'iris':
|
145 |
-
?>
|
146 |
-
<script type="text/javascript">
|
147 |
-
jQuery(document).ready(function ($) {
|
148 |
-
|
149 |
-
$('#<?php echo $btn['cow']; ?>_colorpicker').css('color', '#fff');
|
150 |
-
$('#<?php echo $btn['cow']; ?>_colorpicker').css('background', '<?php echo $btn['colorpickerd']; ?>');
|
151 |
-
|
152 |
-
var options = {
|
153 |
-
wccmclass: "<?php echo $btn['cow']; ?>_colorpickerdiv",
|
154 |
-
palettes: true,
|
155 |
-
color: "",
|
156 |
-
hide: false,
|
157 |
-
change: function (event, ui) {
|
158 |
-
$('#<?php echo $btn['cow']; ?>_colorpicker').css('color', '#000');
|
159 |
-
$('#<?php echo $btn['cow']; ?>_colorpicker').css('background', ui.color.toString());
|
160 |
-
}
|
161 |
-
};
|
162 |
-
|
163 |
-
jQuery('#<?php echo $btn['cow']; ?>_colorpicker').iris(options);
|
164 |
-
jQuery('.<?php echo $btn['cow']; ?>_colorpickerdiv').hide();
|
165 |
-
jQuery("#<?php echo $btn['cow']; ?>_colorpicker").click(function () {
|
166 |
-
jQuery('.<?php echo $btn['cow']; ?>_colorpickerdiv').slideToggle()
|
167 |
-
});
|
168 |
-
|
169 |
-
});
|
170 |
-
</script>
|
171 |
-
<?php
|
172 |
-
break;
|
173 |
-
}
|
174 |
-
}*/
|
175 |
-
|
176 |
-
// ============================== radio button & checkbox ===========================================
|
177 |
-
|
178 |
-
/*if (( $btn['type'] == 'wooccmradio' || $btn['type'] == 'checkbox_wccm' ) && !empty($btn['tax_remove'])) {
|
179 |
-
?>
|
180 |
-
<script type="text/javascript">
|
181 |
-
jQuery(document).ready(function ($) {
|
182 |
-
|
183 |
-
<?php if (!empty($saved['wooccm_tax_save_method'])) { ?>
|
184 |
-
jQuery('#<?php echo $btn['cow']; ?>_field input[name=<?php echo $btn['cow']; ?>]').prop("checked", true);
|
185 |
-
<?php } ?>
|
186 |
-
|
187 |
-
jQuery('#<?php echo $btn['cow']; ?>_field input').click(function () {
|
188 |
-
|
189 |
-
$('form.checkout').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_get_script_data.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
190 |
-
|
191 |
-
var ajaxurl = '<?php echo admin_url('/admin-ajax.php'); ?>';
|
192 |
-
data = {
|
193 |
-
action: 'remove_tax_wccm',
|
194 |
-
tax_remove_aj: jQuery('#<?php echo $btn['cow']; ?>_field input[name=<?php echo $btn['cow']; ?>]:checked').val()
|
195 |
-
};
|
196 |
-
|
197 |
-
jQuery.post(ajaxurl, data, function (response) {
|
198 |
-
$('body').trigger('update_checkout');
|
199 |
-
jQuery('form.checkout').unblock();
|
200 |
-
});
|
201 |
-
|
202 |
-
});
|
203 |
-
});
|
204 |
-
</script>
|
205 |
-
<?php
|
206 |
-
}*/
|
207 |
-
|
208 |
-
/*if (( $btn['type'] == 'wooccmradio' || $btn['type'] == 'checkbox_wccm' ) && !empty($btn['add_amount']) && !empty($btn['fee_name']) && !empty($btn['add_amount_field'])) {
|
209 |
-
?>
|
210 |
-
<script type="text/javascript">
|
211 |
-
jQuery(document).ready(function ($) {
|
212 |
-
|
213 |
-
<?php if (!empty($saved['wooccm_addamount453user'])) { ?>
|
214 |
-
jQuery('#<?php echo $btn['cow']; ?>_field input[name=<?php echo $btn['cow']; ?>]').prop("checked", true);
|
215 |
-
<?php } ?>
|
216 |
-
jQuery('#<?php echo $btn['cow']; ?>_field input').click(function () {
|
217 |
-
|
218 |
-
$('form.checkout').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_get_script_data.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
219 |
-
|
220 |
-
var ajaxurl = '<?php echo admin_url('/admin-ajax.php'); ?>';
|
221 |
-
data = {
|
222 |
-
action: 'remove_tax_wccm',
|
223 |
-
add_amount_aj: jQuery('#<?php echo $btn['cow']; ?>_field input[name=<?php echo $btn['cow']; ?>]:checked').val()
|
224 |
-
};
|
225 |
-
|
226 |
-
jQuery.post(ajaxurl, data, function (response) {
|
227 |
-
$('body').trigger('update_checkout');
|
228 |
-
jQuery('form.checkout').unblock();
|
229 |
-
});
|
230 |
-
|
231 |
-
});
|
232 |
-
});
|
233 |
-
</script>
|
234 |
-
<?php
|
235 |
-
}*/
|
236 |
-
|
237 |
-
// =========================================== select options =========================================
|
238 |
-
|
239 |
-
/*if (($btn['type'] == 'wooccmselect') && !empty($btn['tax_remove'])) {
|
240 |
-
?>
|
241 |
-
<script type="text/javascript">
|
242 |
-
jQuery(document).ready(function ($) {
|
243 |
-
|
244 |
-
<?php if (!empty($saved['wooccm_tax_save_method'])) { ?>
|
245 |
-
jQuery('#<?php echo $btn['cow']; ?>_field select').val('<?php echo $saved['wooccm_tax_save_method']; ?>');
|
246 |
-
<?php } ?>
|
247 |
-
jQuery('#<?php echo $btn['cow']; ?>_field select').change(function () {
|
248 |
-
|
249 |
-
$('form.checkout').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_get_script_data.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
250 |
-
|
251 |
-
var ajaxurl = '<?php echo admin_url('/admin-ajax.php'); ?>';
|
252 |
-
data = {
|
253 |
-
action: 'remove_tax_wccm',
|
254 |
-
tax_remove_aj: jQuery('#<?php echo $btn['cow']; ?> option:selected').val()
|
255 |
-
};
|
256 |
-
|
257 |
-
jQuery.post(ajaxurl, data, function (response) {
|
258 |
-
$('body').trigger('update_checkout');
|
259 |
-
jQuery('form.checkout').unblock();
|
260 |
-
});
|
261 |
-
|
262 |
-
});
|
263 |
-
});
|
264 |
-
</script>
|
265 |
-
<?php
|
266 |
-
}*/
|
267 |
-
|
268 |
-
/*if (($btn['type'] == 'wooccmselect') && !empty($btn['add_amount']) && !empty($btn['fee_name']) && !empty($btn['add_amount_field'])) {
|
269 |
-
?>
|
270 |
-
<script type="text/javascript">
|
271 |
-
jQuery(document).ready(function ($) {
|
272 |
-
|
273 |
-
<?php if (!empty($saved['wooccm_addamount453user'])) { ?>
|
274 |
-
jQuery('#<?php echo $btn['cow']; ?>_field select').val('<?php echo $saved['wooccm_addamount453user']; ?>');
|
275 |
-
<?php } ?>
|
276 |
-
|
277 |
-
jQuery('#<?php echo $btn['cow']; ?>_field select').change(function () {
|
278 |
-
|
279 |
-
$('form.checkout').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_get_script_data.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
280 |
-
|
281 |
-
var ajaxurl = '<?php echo admin_url('/admin-ajax.php'); ?>';
|
282 |
-
data = {
|
283 |
-
action: 'remove_tax_wccm',
|
284 |
-
add_amount_aj: jQuery('#<?php echo $btn['cow']; ?> option:selected').val()
|
285 |
-
};
|
286 |
-
|
287 |
-
jQuery.post(ajaxurl, data, function (response) {
|
288 |
-
$('body').trigger('update_checkout');
|
289 |
-
jQuery('form.checkout').unblock();
|
290 |
-
});
|
291 |
-
|
292 |
-
});
|
293 |
-
});
|
294 |
-
</script>
|
295 |
-
<?php
|
296 |
-
}*/
|
297 |
-
|
298 |
-
// =========================================== add apply button ==========================================
|
299 |
-
|
300 |
-
/*if (($btn['type'] == 'text') && !empty($btn['add_amount']) && !empty($btn['fee_name']) && empty($btn['add_amount_field'])) {
|
301 |
-
?>
|
302 |
-
<script type="text/javascript">
|
303 |
-
jQuery(document).ready(function () {
|
304 |
-
jQuery("#<?php echo $btn['cow']; ?>_field").append('<span id="<?php echo $btn['cow']; ?>_applynow"><?php _e('Apply', 'woocommerce-checkout-manager'); ?></span>');
|
305 |
-
});
|
306 |
-
|
307 |
-
jQuery(document).ready(function ($) {
|
308 |
-
|
309 |
-
<?php if (!empty($saved['wooccm_addamount453userf'])) { ?>
|
310 |
-
jQuery('input#<?php echo $btn['cow']; ?>').val('<?php echo $saved['wooccm_addamount453userf']; ?>');
|
311 |
-
<?php } ?>
|
312 |
-
|
313 |
-
jQuery('#<?php echo $btn['cow']; ?>_field #<?php echo $btn['cow']; ?>_applynow').click(function () {
|
314 |
-
|
315 |
-
$('form.checkout').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_get_script_data.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
316 |
-
|
317 |
-
var ajaxurl = '<?php echo admin_url('/admin-ajax.php'); ?>';
|
318 |
-
data = {
|
319 |
-
action: 'remove_tax_wccm',
|
320 |
-
add_amount_faj: jQuery('input#<?php echo $btn['cow']; ?>').val()
|
321 |
-
};
|
322 |
-
|
323 |
-
jQuery.post(ajaxurl, data, function (response) {
|
324 |
-
$('body').trigger('update_checkout');
|
325 |
-
jQuery('form.checkout').unblock();
|
326 |
-
});
|
327 |
-
|
328 |
-
});
|
329 |
-
|
330 |
-
});
|
331 |
-
</script>
|
332 |
-
<?php
|
333 |
-
}*/
|
334 |
-
|
335 |
-
// =====================================================
|
336 |
-
}
|
337 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/templates/functions/billing_functions.php
DELETED
@@ -1,367 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WooCommerce Checkout Manager
|
4 |
-
*/
|
5 |
-
// Exit if accessed directly
|
6 |
-
if (!defined('ABSPATH'))
|
7 |
-
exit;
|
8 |
-
|
9 |
-
function wooccm_billing_hide_required() {
|
10 |
-
|
11 |
-
global $woocommerce;
|
12 |
-
|
13 |
-
$options = get_option('wccs_settings3');
|
14 |
-
|
15 |
-
$billing = array(
|
16 |
-
'address_1',
|
17 |
-
'address_2',
|
18 |
-
'city',
|
19 |
-
'state',
|
20 |
-
'postcode'
|
21 |
-
);
|
22 |
-
|
23 |
-
if (!empty($options['billing_buttons'])) {
|
24 |
-
echo '
|
25 |
-
<style>
|
26 |
-
';
|
27 |
-
foreach ($options['billing_buttons'] as $btn) {
|
28 |
-
if (in_array($btn['cow'], $billing) && empty($btn['checkbox'])) {
|
29 |
-
echo '
|
30 |
-
p#billing_' . $btn['cow'] . '_field .required{
|
31 |
-
display:none;
|
32 |
-
}';
|
33 |
-
}
|
34 |
-
}
|
35 |
-
echo '
|
36 |
-
</style>';
|
37 |
-
}
|
38 |
-
}
|
39 |
-
|
40 |
-
function wooccm_billing_scripts() {
|
41 |
-
|
42 |
-
global $woocommerce;
|
43 |
-
|
44 |
-
$options = get_option('wccs_settings3');
|
45 |
-
|
46 |
-
$saved = WC()->session->get('wooccm_retain', array());
|
47 |
-
|
48 |
-
// Check if we have any buttons
|
49 |
-
if (empty($options['billing_buttons']))
|
50 |
-
return;
|
51 |
-
|
52 |
-
foreach ($options['billing_buttons'] as $btn) {
|
53 |
-
|
54 |
-
if ($btn['type'] == 'datepicker') {
|
55 |
-
echo '
|
56 |
-
<script type="text/javascript">
|
57 |
-
jQuery(document).ready(function() {
|
58 |
-
var today = new Date();
|
59 |
-
if( jQuery.isFunction(jQuery.fn.datepicker) ) {
|
60 |
-
jQuery("input#billing_' . $btn['cow'] . '").datepicker({
|
61 |
-
';
|
62 |
-
// Default date format
|
63 |
-
if (empty($btn['format_date']))
|
64 |
-
$btn['format_date'] = apply_filters('wooccm_datepicker_default_date_format', 'dd-mm-yy');
|
65 |
-
if (!empty($btn['format_date'])) {
|
66 |
-
echo 'dateFormat : "' . str_replace(' ', '', $btn['format_date']) . '",';
|
67 |
-
}
|
68 |
-
if (!empty($btn['single_yy'])) {
|
69 |
-
echo 'minDate: new Date( ' . $btn['single_yy'] . ', ' . $btn['single_mm'] . ' - 1, ' . $btn['single_dd'] . '),';
|
70 |
-
}
|
71 |
-
if (!empty($btn['min_before'])) {
|
72 |
-
echo 'minDate: ' . $btn['min_before'] . ',';
|
73 |
-
}
|
74 |
-
if (!empty($btn['single_max_yy'])) {
|
75 |
-
echo 'maxDate: new Date( ' . $btn['single_max_yy'] . ', ' . $btn['single_max_mm'] . ' - 1, ' . $btn['single_max_dd'] . '),';
|
76 |
-
}
|
77 |
-
if (!empty($btn['max_after'])) {
|
78 |
-
echo 'maxDate: ' . $btn['max_after'] . ',';
|
79 |
-
}
|
80 |
-
if (!empty($btn['days_disabler'])) {
|
81 |
-
echo 'beforeShowDay: function(date) { var day = date.getDay(); return [(';
|
82 |
-
if (!empty($btn['days_disabler0'])) {
|
83 |
-
echo 'day == 0';
|
84 |
-
} else {
|
85 |
-
echo 'day == "x"';
|
86 |
-
}
|
87 |
-
if (!empty($btn['days_disabler1'])) {
|
88 |
-
echo ' || day == 1';
|
89 |
-
}
|
90 |
-
if (!empty($btn['days_disabler2'])) {
|
91 |
-
echo ' || day == 2';
|
92 |
-
}
|
93 |
-
if (!empty($btn['days_disabler3'])) {
|
94 |
-
echo ' || day == 3';
|
95 |
-
}
|
96 |
-
if (!empty($btn['days_disabler4'])) {
|
97 |
-
echo ' || day == 4';
|
98 |
-
}
|
99 |
-
if (!empty($btn['days_disabler5'])) {
|
100 |
-
echo ' || day == 5';
|
101 |
-
}
|
102 |
-
if (!empty($btn['days_disabler6'])) {
|
103 |
-
echo '|| day == 6';
|
104 |
-
}
|
105 |
-
echo ')]; }';
|
106 |
-
}
|
107 |
-
do_action('wooccm_js_datepicker_billing_args', $btn);
|
108 |
-
echo '
|
109 |
-
});
|
110 |
-
}
|
111 |
-
});
|
112 |
-
</script>
|
113 |
-
';
|
114 |
-
}
|
115 |
-
|
116 |
-
if ($btn['type'] == 'time') {
|
117 |
-
$args = '
|
118 |
-
showPeriod: true,';
|
119 |
-
if (!empty($btn['start_hour'])) {
|
120 |
-
$args .= '
|
121 |
-
hours: { starts: ' . $btn['start_hour'] . ', ends: ' . $btn['end_hour'] . ' },';
|
122 |
-
}
|
123 |
-
if (!empty($btn['interval_min'])) {
|
124 |
-
$args .= '
|
125 |
-
minutes: {interval: ' . $btn['interval_min'] . ', manual: [' . $btn['manual_min'] . '] },';
|
126 |
-
}
|
127 |
-
$args .= '
|
128 |
-
showLeadingZero: true';
|
129 |
-
$args = apply_filters('wooccm_timepicker_jquery_args', $args, $btn);
|
130 |
-
echo '
|
131 |
-
<!-- Billing section: TimePicker -->
|
132 |
-
<script type="text/javascript">
|
133 |
-
jQuery(document).ready(function() {
|
134 |
-
if( jQuery.isFunction(jQuery.fn.timepicker) ) {
|
135 |
-
jQuery("#billing_' . $btn['cow'] . '_field input#billing_' . $btn['cow'] . '").timepicker({
|
136 |
-
';
|
137 |
-
echo $args;
|
138 |
-
echo '
|
139 |
-
});
|
140 |
-
}
|
141 |
-
});
|
142 |
-
</script>
|
143 |
-
';
|
144 |
-
}
|
145 |
-
|
146 |
-
if ($btn['type'] == 'password') {
|
147 |
-
echo '
|
148 |
-
<script type="text/javascript">
|
149 |
-
jQuery(document).ready(function() {
|
150 |
-
jQuery("p#billing_' . $btn['cow'] . '_field").css("display");
|
151 |
-
});
|
152 |
-
</script>
|
153 |
-
';
|
154 |
-
}
|
155 |
-
|
156 |
-
/*if ($btn['type'] == 'colorpicker') {
|
157 |
-
switch ($btn['colorpickertype']) {
|
158 |
-
case 'farbtastic':
|
159 |
-
?>
|
160 |
-
<script type="text/javascript">
|
161 |
-
jQuery(document).ready(function ($) {
|
162 |
-
jQuery('#billing_<?php echo $btn['cow']; ?>_colorpicker').hide();
|
163 |
-
if (jQuery.isFunction(jQuery.fn.farbtastic)) {
|
164 |
-
jQuery('#billing_<?php echo $btn['cow']; ?>_colorpicker').farbtastic("#billing_<?php echo $btn['cow']; ?>_colorpicker");
|
165 |
-
jQuery("#billing_<?php echo $btn['cow']; ?>_colorpicker").click(function () {
|
166 |
-
jQuery('#billing_<?php echo $btn['cow']; ?>_colorpicker').slideToggle()
|
167 |
-
});
|
168 |
-
}
|
169 |
-
});
|
170 |
-
</script>
|
171 |
-
<?php
|
172 |
-
break;
|
173 |
-
|
174 |
-
case 'iris':
|
175 |
-
?>
|
176 |
-
<script type="text/javascript">
|
177 |
-
jQuery(document).ready(function ($) {
|
178 |
-
|
179 |
-
$('#<?php echo $btn['cow']; ?>_colorpicker').css('color', '#fff');
|
180 |
-
$('#<?php echo $btn['cow']; ?>_colorpicker').css('background', '<?php echo $btn['colorpickerd']; ?>');
|
181 |
-
|
182 |
-
var options = {
|
183 |
-
wccmclass: "billing_<?php echo $btn['cow']; ?>_colorpicker",
|
184 |
-
palettes: true,
|
185 |
-
color: "",
|
186 |
-
hide: false,
|
187 |
-
change: function (event, ui) {
|
188 |
-
$('#billing_<?php echo $btn['cow']; ?>_colorpicker').css('color', '#000');
|
189 |
-
$('#billing_<?php echo $btn['cow']; ?>_colorpicker').css('background', ui.color.toString());
|
190 |
-
}
|
191 |
-
};
|
192 |
-
|
193 |
-
jQuery('#billing_<?php echo $btn['cow']; ?>_colorpicker').iris(options);
|
194 |
-
jQuery('.billing_<?php echo $btn['cow']; ?>_colorpicker').hide();
|
195 |
-
jQuery("#billing_<?php echo $btn['cow']; ?>_colorpicker").click(function () {
|
196 |
-
jQuery('.billing_<?php echo $btn['cow']; ?>_colorpicker').slideToggle()
|
197 |
-
});
|
198 |
-
|
199 |
-
});
|
200 |
-
</script>
|
201 |
-
<?php
|
202 |
-
break;
|
203 |
-
}
|
204 |
-
}*/
|
205 |
-
|
206 |
-
// ============================== radio button & checkbox ===========================================
|
207 |
-
|
208 |
-
/* if (( $btn['type'] == 'wooccmradio' || $btn['type'] == 'checkbox_wccm' ) && !empty($btn['tax_remove'])) {
|
209 |
-
?>
|
210 |
-
<script type="text/javascript">
|
211 |
-
jQuery(document).ready(function ($) {
|
212 |
-
|
213 |
-
<?php if (!empty($saved['wooccm_tax_save_method'])) { ?>
|
214 |
-
jQuery('#billing_<?php echo $btn['cow']; ?>_field input[name=billing_<?php echo $btn['cow']; ?>]').prop("checked", true);
|
215 |
-
<?php } ?>
|
216 |
-
|
217 |
-
jQuery('#billing_<?php echo $btn['cow']; ?>_field input').click(function () {
|
218 |
-
|
219 |
-
$('form.checkout').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_get_script_data.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
220 |
-
|
221 |
-
var ajaxurl = '<?php echo admin_url('/admin-ajax.php'); ?>';
|
222 |
-
data = {
|
223 |
-
action: 'remove_tax_wccm',
|
224 |
-
tax_remove_aj: jQuery('#billing_<?php echo $btn['cow']; ?>_field input[name=billing_<?php echo $btn['cow']; ?>]:checked').val()
|
225 |
-
};
|
226 |
-
|
227 |
-
jQuery.post(ajaxurl, data, function (response) {
|
228 |
-
$('body').trigger('update_checkout');
|
229 |
-
jQuery('form.checkout').unblock();
|
230 |
-
});
|
231 |
-
|
232 |
-
});
|
233 |
-
});
|
234 |
-
</script>
|
235 |
-
<?php
|
236 |
-
} */
|
237 |
-
|
238 |
-
/* if (( $btn['type'] == 'wooccmradio' || $btn['type'] == 'checkbox_wccm' ) && !empty($btn['add_amount']) && !empty($btn['fee_name']) && !empty($btn['add_amount_field'])) {
|
239 |
-
?>
|
240 |
-
<script type="text/javascript">
|
241 |
-
jQuery(document).ready(function ($) {
|
242 |
-
|
243 |
-
<?php if (!empty($saved['wooccm_addamount453user'])) { ?>
|
244 |
-
jQuery('#billing_<?php echo $btn['cow']; ?>_field input[name=billing_<?php echo $btn['cow']; ?>]').prop("checked", true);
|
245 |
-
<?php } ?>
|
246 |
-
jQuery('#billing_<?php echo $btn['cow']; ?>_field input').click(function () {
|
247 |
-
|
248 |
-
$('form.checkout').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_get_script_data.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
249 |
-
|
250 |
-
var ajaxurl = '<?php echo admin_url('/admin-ajax.php'); ?>';
|
251 |
-
data = {
|
252 |
-
action: 'remove_tax_wccm',
|
253 |
-
add_amount_aj: jQuery('#billing_<?php echo $btn['cow']; ?>_field input[name=billing_<?php echo $btn['cow']; ?>]:checked').val()
|
254 |
-
};
|
255 |
-
|
256 |
-
jQuery.post(ajaxurl, data, function (response) {
|
257 |
-
$('body').trigger('update_checkout');
|
258 |
-
jQuery('form.checkout').unblock();
|
259 |
-
});
|
260 |
-
|
261 |
-
});
|
262 |
-
});
|
263 |
-
</script>
|
264 |
-
<?php
|
265 |
-
} */
|
266 |
-
|
267 |
-
// =========================================== select options =========================================
|
268 |
-
|
269 |
-
/* if ($btn['type'] == 'wooccmselect' && !empty($btn['tax_remove'])) {
|
270 |
-
?>
|
271 |
-
<script type="text/javascript">
|
272 |
-
jQuery(document).ready(function ($) {
|
273 |
-
|
274 |
-
<?php if (!empty($saved['wooccm_tax_save_method'])) { ?>
|
275 |
-
jQuery('#billing_<?php echo $btn['cow']; ?>_field select').val('<?php echo $saved['wooccm_tax_save_method']; ?>');
|
276 |
-
<?php } ?>
|
277 |
-
jQuery('#billing_<?php echo $btn['cow']; ?>_field select').change(function () {
|
278 |
-
|
279 |
-
$('form.checkout').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_get_script_data.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
280 |
-
|
281 |
-
var ajaxurl = '<?php echo admin_url('/admin-ajax.php'); ?>';
|
282 |
-
data = {
|
283 |
-
action: 'remove_tax_wccm',
|
284 |
-
tax_remove_aj: jQuery('#billing_<?php echo $btn['cow']; ?> option:selected').val()
|
285 |
-
};
|
286 |
-
|
287 |
-
jQuery.post(ajaxurl, data, function (response) {
|
288 |
-
$('body').trigger('update_checkout');
|
289 |
-
jQuery('form.checkout').unblock();
|
290 |
-
});
|
291 |
-
|
292 |
-
});
|
293 |
-
});
|
294 |
-
</script>
|
295 |
-
<?php
|
296 |
-
} */
|
297 |
-
|
298 |
-
/* if ($btn['type'] == 'wooccmselect' && !empty($btn['add_amount']) && !empty($btn['fee_name']) && !empty($btn['add_amount_field'])) {
|
299 |
-
?>
|
300 |
-
<script type="text/javascript">
|
301 |
-
jQuery(document).ready(function ($) {
|
302 |
-
|
303 |
-
<?php if (!empty($saved['wooccm_addamount453user'])) { ?>
|
304 |
-
jQuery('#billing_<?php echo $btn['cow']; ?>_field select').val('<?php echo $saved['wooccm_addamount453user']; ?>');
|
305 |
-
<?php } ?>
|
306 |
-
|
307 |
-
jQuery('#billing_<?php echo $btn['cow']; ?>_field select').change(function () {
|
308 |
-
|
309 |
-
$('form.checkout').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_get_script_data.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
310 |
-
|
311 |
-
var ajaxurl = '<?php echo admin_url('/admin-ajax.php'); ?>';
|
312 |
-
data = {
|
313 |
-
action: 'remove_tax_wccm',
|
314 |
-
add_amount_aj: jQuery('#billing_<?php echo $btn['cow']; ?> option:selected').val()
|
315 |
-
};
|
316 |
-
|
317 |
-
jQuery.post(ajaxurl, data, function (response) {
|
318 |
-
$('body').trigger('update_checkout');
|
319 |
-
jQuery('form.checkout').unblock();
|
320 |
-
});
|
321 |
-
|
322 |
-
});
|
323 |
-
});
|
324 |
-
</script>
|
325 |
-
<?php
|
326 |
-
} */
|
327 |
-
|
328 |
-
// =========================================== add apply button ==========================================
|
329 |
-
|
330 |
-
/* if ($btn['type'] == 'text' && !empty($btn['add_amount']) && !empty($btn['fee_name']) && empty($btn['add_amount_field'])) {
|
331 |
-
?>
|
332 |
-
<script type="text/javascript">
|
333 |
-
jQuery(document).ready(function () {
|
334 |
-
jQuery("#billing_<?php echo $btn['cow']; ?>_field").append('<span id="billing_<?php echo $btn['cow']; ?>_applynow"><?php _e('Apply', 'woocommerce-checkout-manager'); ?></span>');
|
335 |
-
});
|
336 |
-
|
337 |
-
jQuery(document).ready(function ($) {
|
338 |
-
|
339 |
-
<?php if (!empty($saved['wooccm_addamount453userf'])) { ?>
|
340 |
-
jQuery('input#billing_<?php echo $btn['cow']; ?>').val('<?php echo $saved['wooccm_addamount453userf']; ?>');
|
341 |
-
<?php } ?>
|
342 |
-
|
343 |
-
jQuery('#billing_<?php echo $btn['cow']; ?>_field #billing_<?php echo $btn['cow']; ?>_applynow').click(function () {
|
344 |
-
|
345 |
-
$('form.checkout').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_get_script_data.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
346 |
-
|
347 |
-
var ajaxurl = '<?php echo admin_url('/admin-ajax.php'); ?>';
|
348 |
-
data = {
|
349 |
-
action: 'remove_tax_wccm',
|
350 |
-
add_amount_faj: jQuery('input#billing_<?php echo $btn['cow']; ?>').val()
|
351 |
-
};
|
352 |
-
|
353 |
-
jQuery.post(ajaxurl, data, function (response) {
|
354 |
-
$('body').trigger('update_checkout');
|
355 |
-
jQuery('form.checkout').unblock();
|
356 |
-
});
|
357 |
-
|
358 |
-
});
|
359 |
-
|
360 |
-
});
|
361 |
-
</script>
|
362 |
-
<?php
|
363 |
-
} */
|
364 |
-
|
365 |
-
// =====================================================
|
366 |
-
}
|
367 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/templates/functions/shipping_functions.php
DELETED
@@ -1,371 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WooCommerce Checkout Manager
|
4 |
-
*/
|
5 |
-
// Exit if accessed directly
|
6 |
-
if (!defined('ABSPATH'))
|
7 |
-
exit;
|
8 |
-
|
9 |
-
function wooccm_shipping_hide_required() {
|
10 |
-
|
11 |
-
global $woocommerce;
|
12 |
-
|
13 |
-
$options = get_option('wccs_settings2');
|
14 |
-
|
15 |
-
$billing = array(
|
16 |
-
'address_1',
|
17 |
-
'address_2',
|
18 |
-
'city',
|
19 |
-
'state',
|
20 |
-
'postcode'
|
21 |
-
);
|
22 |
-
|
23 |
-
if (!empty($options['shipping_buttons'])) {
|
24 |
-
echo '
|
25 |
-
<style>
|
26 |
-
';
|
27 |
-
foreach ($options['shipping_buttons'] as $btn) {
|
28 |
-
if (in_array($btn['cow'], $billing) && empty($btn['checkbox'])) {
|
29 |
-
echo '
|
30 |