Version Description
- Fix: woocommerce checkout hide field based on product id rebuilt
- Fix: woocommerce checkout hide field based on product category rebuilt
Download this release
Release Info
Developer | quadlayers |
Plugin | WooCommerce Checkout Manager |
Version | 4.4.3 |
Comparing to | |
See all releases |
Code changes from version 4.4.2 to 4.4.3
- assets/js/wooccm-admin.js +22 -0
- assets/js/wooccm-admin.min.js +1 -1
- assets/js/wooccm-modal.js +46 -22
- assets/js/wooccm-modal.min.js +1 -1
- includes/templates/functions/add_functions.php +0 -230
- includes/templates/functions/billing_functions.php +0 -220
- includes/templates/functions/shipping_functions.php +0 -230
- new/admin.php +30 -0
- new/admin/pages/billing.php +443 -432
- new/fields_handler.php +101 -48
- readme.txt +5 -1
- woocommerce-checkout-manager.php +27 -2
assets/js/wooccm-admin.js
CHANGED
@@ -1,5 +1,27 @@
|
|
1 |
(function ($) {
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
/* Toggle gateway on/off.
|
4 |
$('#wooccm_billing_settings_add').on('click', function () {
|
5 |
|
1 |
(function ($) {
|
2 |
|
3 |
+
$.fn.serializeArrayAll = function () {
|
4 |
+
var o = {};
|
5 |
+
var a = this.serializeArray();
|
6 |
+
$.each(a, function () {
|
7 |
+
if (o[this.name] !== undefined) {
|
8 |
+
if (!o[this.name].push) {
|
9 |
+
o[this.name] = [o[this.name]];
|
10 |
+
}
|
11 |
+
o[this.name].push(this.value || '');
|
12 |
+
} else {
|
13 |
+
o[this.name] = this.value || '';
|
14 |
+
}
|
15 |
+
});
|
16 |
+
var $radio = $('input[type=radio],input[type=checkbox]', this);
|
17 |
+
$.each($radio, function () {
|
18 |
+
if (!o.hasOwnProperty(this.name)) {
|
19 |
+
o[this.name] = '';
|
20 |
+
}
|
21 |
+
});
|
22 |
+
return o;
|
23 |
+
};
|
24 |
+
|
25 |
/* Toggle gateway on/off.
|
26 |
$('#wooccm_billing_settings_add').on('click', function () {
|
27 |
|
assets/js/wooccm-admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(a){a("#wooccm_billing_fields").on("click",".wooccm-field-toggle-enabled",function(){var b=a(this),d=b.closest("tr"),c=b.find(".woocommerce-input-toggle");a.ajax({url:woocommerce_admin.ajax_url,data:{action:"wooccm_toggle_field_enabled",nonce:wooccm.nonce,field_id:d.data("field_id")},dataType:"json",type:"POST",beforeSend:function(e){c.addClass("woocommerce-input-toggle--loading")},success:function(e){if(true===e.data){c.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");c.addClass("woocommerce-input-toggle--enabled");c.removeClass("woocommerce-input-toggle--loading")}else{if(true!==e.data){c.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");c.addClass("woocommerce-input-toggle--disabled");c.removeClass("woocommerce-input-toggle--loading")}}}});return false})})(jQuery);
|
1 |
+
(function(a){a.fn.serializeArrayAll=function(){var d={};var c=this.serializeArray();a.each(c,function(){if(d[this.name]!==undefined){if(!d[this.name].push){d[this.name]=[d[this.name]]}d[this.name].push(this.value||"")}else{d[this.name]=this.value||""}});var b=a("input[type=radio],input[type=checkbox]",this);a.each(b,function(){if(!d.hasOwnProperty(this.name)){d[this.name]=""}});return d};a("#wooccm_billing_fields").on("click",".wooccm-field-toggle-enabled",function(){var b=a(this),d=b.closest("tr"),c=b.find(".woocommerce-input-toggle");a.ajax({url:woocommerce_admin.ajax_url,data:{action:"wooccm_toggle_field_enabled",nonce:wooccm.nonce,field_id:d.data("field_id")},dataType:"json",type:"POST",beforeSend:function(e){c.addClass("woocommerce-input-toggle--loading")},success:function(e){if(true===e.data){c.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");c.addClass("woocommerce-input-toggle--enabled");c.removeClass("woocommerce-input-toggle--loading")}else{if(true!==e.data){c.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");c.addClass("woocommerce-input-toggle--disabled");c.removeClass("woocommerce-input-toggle--loading")}}}});return false})})(jQuery);
|
assets/js/wooccm-modal.js
CHANGED
@@ -17,7 +17,6 @@
|
|
17 |
var unblock = function ($node) {
|
18 |
$node.removeClass('processing').unblock();
|
19 |
};
|
20 |
-
|
21 |
var wpmi = {
|
22 |
__instance: undefined
|
23 |
};
|
@@ -27,9 +26,9 @@
|
|
27 |
'click .media-modal-backdrop': 'Close',
|
28 |
'click .media-modal-close': 'Close',
|
29 |
'click .media-modal-delete': 'Delete',
|
30 |
-
'click .media-modal-save': 'Save',
|
31 |
'click .media-modal-prev': 'update',
|
32 |
'click .media-modal-next': 'update',
|
|
|
33 |
},
|
34 |
templates: {},
|
35 |
initialize: function (e) {
|
@@ -43,9 +42,7 @@
|
|
43 |
},
|
44 |
render: function (field_id) {
|
45 |
'use strict';
|
46 |
-
|
47 |
var $modal = this;
|
48 |
-
|
49 |
$.ajax({
|
50 |
url: woocommerce_admin.ajax_url,
|
51 |
data: {
|
@@ -76,31 +73,25 @@
|
|
76 |
},
|
77 |
update: function (e) {
|
78 |
'use strict';
|
79 |
-
|
80 |
var $button = $(e.target),
|
81 |
field_id = $button.data('field_id');
|
82 |
-
|
83 |
this.render(field_id);
|
84 |
},
|
85 |
open: function (e) {
|
86 |
'use strict';
|
87 |
-
|
88 |
var $button = $(e.target),
|
89 |
$tr = $button.closest('tr'),
|
90 |
field_id = $tr.data('field_id');
|
91 |
-
|
92 |
this.render(field_id);
|
93 |
-
|
94 |
$('body').addClass('modal-open').append(this.$el);
|
95 |
-
|
96 |
},
|
97 |
/*preserveFocus: function (e) {
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
Close: function (e) {
|
105 |
'use strict';
|
106 |
e.preventDefault();
|
@@ -113,18 +104,51 @@
|
|
113 |
Save: function (e) {
|
114 |
'use strict';
|
115 |
e.preventDefault();
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
},
|
122 |
Delete: function (e) {
|
123 |
'use strict';
|
124 |
e.preventDefault();
|
125 |
-
|
126 |
var $modal = this;
|
127 |
-
|
128 |
$modal.Close(e);
|
129 |
}
|
130 |
});
|
17 |
var unblock = function ($node) {
|
18 |
$node.removeClass('processing').unblock();
|
19 |
};
|
|
|
20 |
var wpmi = {
|
21 |
__instance: undefined
|
22 |
};
|
26 |
'click .media-modal-backdrop': 'Close',
|
27 |
'click .media-modal-close': 'Close',
|
28 |
'click .media-modal-delete': 'Delete',
|
|
|
29 |
'click .media-modal-prev': 'update',
|
30 |
'click .media-modal-next': 'update',
|
31 |
+
'submit .media-modal-form': 'Save',
|
32 |
},
|
33 |
templates: {},
|
34 |
initialize: function (e) {
|
42 |
},
|
43 |
render: function (field_id) {
|
44 |
'use strict';
|
|
|
45 |
var $modal = this;
|
|
|
46 |
$.ajax({
|
47 |
url: woocommerce_admin.ajax_url,
|
48 |
data: {
|
73 |
},
|
74 |
update: function (e) {
|
75 |
'use strict';
|
|
|
76 |
var $button = $(e.target),
|
77 |
field_id = $button.data('field_id');
|
|
|
78 |
this.render(field_id);
|
79 |
},
|
80 |
open: function (e) {
|
81 |
'use strict';
|
|
|
82 |
var $button = $(e.target),
|
83 |
$tr = $button.closest('tr'),
|
84 |
field_id = $tr.data('field_id');
|
|
|
85 |
this.render(field_id);
|
|
|
86 |
$('body').addClass('modal-open').append(this.$el);
|
|
|
87 |
},
|
88 |
/*preserveFocus: function (e) {
|
89 |
+
'use strict';
|
90 |
+
|
91 |
+
if (this.$el[0] !== e.target && !this.$el.has(e.target).length) {
|
92 |
+
this.$el.focus();
|
93 |
+
}
|
94 |
+
},*/
|
95 |
Close: function (e) {
|
96 |
'use strict';
|
97 |
e.preventDefault();
|
104 |
Save: function (e) {
|
105 |
'use strict';
|
106 |
e.preventDefault();
|
107 |
+
var $form = $(e.target),
|
108 |
+
$modal = this.$el,
|
109 |
+
$spinner = $modal.find('.settings-save-status .spinner');
|
110 |
+
//$spinner = settings-save-status
|
111 |
+
//console.log($form.serialize());
|
112 |
|
113 |
+
$.ajax({
|
114 |
+
url: woocommerce_admin.ajax_url,
|
115 |
+
data: {
|
116 |
+
action: 'wooccm_save_field',
|
117 |
+
nonce: wooccm.nonce,
|
118 |
+
field_id: $form.data('field_id'),
|
119 |
+
//options_name: $tr.data('options_name'),
|
120 |
+
//options_key: $tr.data('options_key'),
|
121 |
+
field_data: $form.serializeArrayAll()
|
122 |
+
},
|
123 |
+
//data: $.param({field_data: $form.serializeArrayAll()}) + '&' + $.param({action: 'wooccm_save_field'}) + '&' + $.param({nonce: wooccm.nonce}),
|
124 |
+
dataType: 'json',
|
125 |
+
type: 'POST',
|
126 |
+
beforeSend: function () {
|
127 |
+
$spinner.addClass('is-active');
|
128 |
+
block($modal);
|
129 |
+
},
|
130 |
+
complete: function () {
|
131 |
+
$spinner.removeClass('is-active');
|
132 |
+
unblock($modal);
|
133 |
+
//$modal.Close(e);
|
134 |
+
},
|
135 |
+
error: function () {
|
136 |
+
alert('Error!');
|
137 |
+
},
|
138 |
+
success: function (response) {
|
139 |
+
console.log(response);
|
140 |
+
//$modal.$el.attr('tabindex', '0');
|
141 |
+
//$modal.$el.html($modal.templates.window(response.data));
|
142 |
+
//$(document).on('focusin', $modal.preserveFocus);
|
143 |
+
//$modal.$el.focus().trigger('wc-init-tabbed-panels');
|
144 |
+
}
|
145 |
+
});
|
146 |
+
return false;
|
147 |
},
|
148 |
Delete: function (e) {
|
149 |
'use strict';
|
150 |
e.preventDefault();
|
|
|
151 |
var $modal = this;
|
|
|
152 |
$modal.Close(e);
|
153 |
}
|
154 |
});
|
assets/js/wooccm-modal.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(c){var d=function(f){return f.is(".processing")||f.parents(".processing").length};var e=function(f){if(!d(f)){f.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var b=function(f){f.removeClass("processing").unblock()};var a={__instance:undefined};a.Application=Backbone.View.extend({id:"wpmi_modal",events:{"click .media-modal-backdrop":"Close","click .media-modal-close":"Close","click .media-modal-delete":"Delete","click .media-modal-
|
1 |
+
(function(c){var d=function(f){return f.is(".processing")||f.parents(".processing").length};var e=function(f){if(!d(f)){f.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var b=function(f){f.removeClass("processing").unblock()};var a={__instance:undefined};a.Application=Backbone.View.extend({id:"wpmi_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","submit .media-modal-form":"Save",},templates:{},initialize:function(f){_.bindAll(this,"open","update","render","Close","Save");this.init();this.open(f)},init:function(){this.templates.window=wp.template("wpmi-modal-window")},render:function(g){var f=this;c.ajax({url:woocommerce_admin.ajax_url,data:{action:"wooccm_edit_field",nonce:wooccm.nonce,field_id:g},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(h){f.$el.attr("tabindex","0");f.$el.html(f.templates.window(h.data));f.$el.focus().trigger("wc-init-tabbed-panels")}})},update:function(h){var g=c(h.target),f=g.data("field_id");this.render(f)},open:function(i){var h=c(i.target),g=h.closest("tr"),f=g.data("field_id");this.render(f);c("body").addClass("modal-open").append(this.$el)},Close:function(f){f.preventDefault();this.undelegateEvents();c(document).off("focusin");c("body").removeClass("modal-open");this.remove();a.__instance=undefined},Save:function(i){i.preventDefault();var f=c(i.target),g=this.$el,h=g.find(".settings-save-status .spinner");c.ajax({url:woocommerce_admin.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm.nonce,field_id:f.data("field_id"),field_data:f.serializeArrayAll()},dataType:"json",type:"POST",beforeSend:function(){h.addClass("is-active");e(g)},complete:function(){h.removeClass("is-active");b(g)},error:function(){alert("Error!")},success:function(j){console.log(j)}});return false},Delete:function(g){g.preventDefault();var f=this;f.Close(g)}});c("#wooccm_billing_settings_add").on("click",function(f){f.preventDefault();if(a.__instance===undefined){a.__instance=new a.Application(f)}});c(".wooccm_billing_settings_edit").on("click",function(f){f.preventDefault();if(a.__instance===undefined){a.__instance=new a.Application(f)}})})(jQuery);
|
includes/templates/functions/add_functions.php
CHANGED
@@ -581,235 +581,5 @@ jQuery(document).ready(function($){
|
|
581 |
|
582 |
<?php
|
583 |
|
584 |
-
// ================================ END!!! =====================================
|
585 |
-
// =============================================================================
|
586 |
-
|
587 |
-
// ----------------------------- CLEAR ---------------------------------
|
588 |
-
// ---------------------------------------------------------------------
|
589 |
-
// ---------------------------------------------------------------------
|
590 |
-
|
591 |
-
$categoryarraycm = array();
|
592 |
-
$productsarraycm = array();
|
593 |
-
|
594 |
-
foreach( $options['buttons'] as $btn ) {
|
595 |
-
foreach( $woocommerce->cart->cart_contents as $key => $values ) {
|
596 |
-
|
597 |
-
$multiproductsx = $btn['single_p'];
|
598 |
-
$show_field_single = $btn['single_px'];
|
599 |
-
$multiproductsx_cat = $btn['single_p_cat'];
|
600 |
-
$show_field_single_cat = $btn['single_px_cat'];
|
601 |
-
|
602 |
-
$productsarraycm[] = $values['product_id'];
|
603 |
-
|
604 |
-
// Products
|
605 |
-
// hide field
|
606 |
-
|
607 |
-
// without more
|
608 |
-
if( !empty( $btn['single_p'] ) && empty( $btn['more_content'] ) ) {
|
609 |
-
|
610 |
-
$multiarrayproductsx = explode( ',', $multiproductsx );
|
611 |
-
|
612 |
-
if( in_array( $values['product_id'], $multiarrayproductsx ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
613 |
-
echo '
|
614 |
-
<style type="text/css">
|
615 |
-
.woocommerce form #customer_details #'.$btn['cow'].'_field,
|
616 |
-
.woocommerce-page form #customer_details #'.$btn['cow'].'_field,
|
617 |
-
.woocommerce form.checkout #'.$btn['cow'].'_field {
|
618 |
-
display: none;
|
619 |
-
}
|
620 |
-
</style>';
|
621 |
-
}
|
622 |
-
}
|
623 |
-
|
624 |
-
// show field without more
|
625 |
-
if( !empty( $btn['single_px'] ) && empty( $btn['more_content'] ) ) {
|
626 |
-
|
627 |
-
$show_field_array = explode( '||', $show_field_single );
|
628 |
-
|
629 |
-
if( in_array( $values['product_id'], $show_field_array ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
630 |
-
echo '
|
631 |
-
<style type="text/css">
|
632 |
-
.woocommerce form #customer_details #'.$btn['cow'].'_field,
|
633 |
-
.woocommerce-page form #customer_details #'.$btn['cow'].'_field,
|
634 |
-
.woocommerce form.checkout #'.$btn['cow'].'_field {
|
635 |
-
display: inline-block;
|
636 |
-
}
|
637 |
-
</style>';
|
638 |
-
}
|
639 |
-
|
640 |
-
if( !in_array( $values['product_id'], $show_field_array ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
641 |
-
echo '
|
642 |
-
<style type="text/css">
|
643 |
-
.woocommerce form #customer_details #'.$btn['cow'].'_field,
|
644 |
-
.woocommerce-page form #customer_details #'.$btn['cow'].'_field,
|
645 |
-
.woocommerce form.checkout #'.$btn['cow'].'_field {
|
646 |
-
display: none;
|
647 |
-
}
|
648 |
-
</style>';
|
649 |
-
}
|
650 |
-
}
|
651 |
-
|
652 |
-
// Category
|
653 |
-
// hide field
|
654 |
-
$terms = get_the_terms( $values['product_id'], 'product_cat' );
|
655 |
-
if( !empty($terms) ) {
|
656 |
-
foreach( $terms as $term ) {
|
657 |
-
|
658 |
-
$categoryarraycm[] = $term->slug;
|
659 |
-
|
660 |
-
// without more
|
661 |
-
|
662 |
-
if( !empty( $btn['single_p_cat'] ) && empty( $btn['more_content'] ) ) {
|
663 |
-
|
664 |
-
$multiarrayproductsx_cat = explode( ',', $multiproductsx_cat );
|
665 |
-
|
666 |
-
if( in_array( $term->slug, $multiarrayproductsx_cat ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
667 |
-
echo '
|
668 |
-
<style type="text/css">
|
669 |
-
.woocommerce form #customer_details #'.$btn['cow'].'_field,
|
670 |
-
.woocommerce-page form #customer_details #'.$btn['cow'].'_field,
|
671 |
-
.woocommerce form.checkout #'.$btn['cow'].'_field {
|
672 |
-
display: none;
|
673 |
-
}
|
674 |
-
</style>';
|
675 |
-
}
|
676 |
-
}
|
677 |
-
|
678 |
-
// show field without more
|
679 |
-
if( !empty( $btn['single_px_cat'] ) && empty( $btn['more_content'] ) ) {
|
680 |
-
|
681 |
-
$show_field_array_cat = explode('||',$show_field_single_cat);
|
682 |
-
|
683 |
-
if( in_array( $term->slug, $show_field_array_cat ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
684 |
-
echo '
|
685 |
-
<style type="text/css">
|
686 |
-
.woocommerce form #customer_details #'.$btn['cow'].'_field,
|
687 |
-
.woocommerce-page form #customer_details #'.$btn['cow'].'_field,
|
688 |
-
.woocommerce form.checkout #'.$btn['cow'].'_field {
|
689 |
-
display: inline-block;
|
690 |
-
}
|
691 |
-
</style>';
|
692 |
-
}
|
693 |
-
|
694 |
-
if( !in_array( $term->slug, $show_field_array_cat ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
695 |
-
echo '
|
696 |
-
<style type="text/css">
|
697 |
-
.woocommerce form #customer_details #'.$btn['cow'].'_field,
|
698 |
-
.woocommerce-page form #customer_details #'.$btn['cow'].'_field,
|
699 |
-
.woocommerce form.checkout #'.$btn['cow'].'_field {
|
700 |
-
display: none;
|
701 |
-
}
|
702 |
-
</style>';
|
703 |
-
}
|
704 |
-
}
|
705 |
-
|
706 |
-
}
|
707 |
-
}
|
708 |
-
}
|
709 |
-
// end cart
|
710 |
-
|
711 |
-
// ===========================================================================================
|
712 |
-
|
713 |
-
// Products
|
714 |
-
// hide field
|
715 |
-
|
716 |
-
// with more
|
717 |
-
if( !empty( $btn['single_p'] ) && !empty( $btn['more_content'] ) ) {
|
718 |
-
|
719 |
-
$multiarrayproductsx = explode( ',', $multiproductsx );
|
720 |
-
|
721 |
-
if( array_intersect( $productsarraycm, $multiarrayproductsx ) ) {
|
722 |
-
echo '
|
723 |
-
<style type="text/css">
|
724 |
-
.woocommerce form #customer_details #'.$btn['cow'].'_field,
|
725 |
-
.woocommerce-page form #customer_details #'.$btn['cow'].'_field,
|
726 |
-
.woocommerce form.checkout #'.$btn['cow'].'_field {
|
727 |
-
display: none;
|
728 |
-
}
|
729 |
-
</style>';
|
730 |
-
}
|
731 |
-
}
|
732 |
-
|
733 |
-
// show field with more
|
734 |
-
if( !empty( $btn['single_px'] ) && !empty( $btn['more_content'] ) ) {
|
735 |
-
|
736 |
-
$show_field_array = explode( '||', $show_field_single );
|
737 |
-
|
738 |
-
if( array_intersect( $productsarraycm, $show_field_array ) ) {
|
739 |
-
echo '
|
740 |
-
<style type="text/css">
|
741 |
-
.woocommerce form #customer_details #'.$btn['cow'].'_field,
|
742 |
-
.woocommerce-page form #customer_details #'.$btn['cow'].'_field,
|
743 |
-
.woocommerce form.checkout #'.$btn['cow'].'_field {
|
744 |
-
display: inline-block;
|
745 |
-
}
|
746 |
-
</style>';
|
747 |
-
}
|
748 |
-
|
749 |
-
if( !array_intersect( $productsarraycm, $show_field_array ) ) {
|
750 |
-
echo '
|
751 |
-
<style type="text/css">
|
752 |
-
.woocommerce form #customer_details #'.$btn['cow'].'_field,
|
753 |
-
.woocommerce-page form #customer_details #'.$btn['cow'].'_field,
|
754 |
-
.woocommerce form.checkout #'.$btn['cow'].'_field {
|
755 |
-
display: none;
|
756 |
-
}
|
757 |
-
</style>';
|
758 |
-
}
|
759 |
-
}
|
760 |
-
|
761 |
-
// Category
|
762 |
-
// hide field
|
763 |
-
|
764 |
-
// with more
|
765 |
-
if( !empty( $btn['single_p_cat'] ) && !empty( $btn['more_content'] ) ) {
|
766 |
-
|
767 |
-
$multiarrayproductsx_cat = explode( ',', $multiproductsx_cat );
|
768 |
-
|
769 |
-
if( array_intersect( $categoryarraycm, $multiarrayproductsx_cat ) ) {
|
770 |
-
echo '
|
771 |
-
<style type="text/css">
|
772 |
-
.woocommerce form #customer_details #'.$btn['cow'].'_field,
|
773 |
-
.woocommerce-page form #customer_details #'.$btn['cow'].'_field,
|
774 |
-
.woocommerce form.checkout #'.$btn['cow'].'_field {
|
775 |
-
display: none;
|
776 |
-
}
|
777 |
-
</style>';
|
778 |
-
}
|
779 |
-
}
|
780 |
-
|
781 |
-
// show field with more
|
782 |
-
if( !empty( $btn['single_px_cat'] ) && !empty( $btn['more_content'] ) ) {
|
783 |
-
|
784 |
-
$show_field_array_cat = explode( '||', $show_field_single_cat );
|
785 |
-
|
786 |
-
if( array_intersect( $categoryarraycm, $show_field_array_cat ) ) {
|
787 |
-
echo '
|
788 |
-
<style type="text/css">
|
789 |
-
.woocommerce form #customer_details #'.$btn['cow'].'_field,
|
790 |
-
.woocommerce-page form #customer_details #'.$btn['cow'].'_field,
|
791 |
-
.woocommerce form.checkout #'.$btn['cow'].'_field {
|
792 |
-
display: inline-block;
|
793 |
-
}
|
794 |
-
</style>';
|
795 |
-
}
|
796 |
-
|
797 |
-
if( !array_intersect( $categoryarraycm, $show_field_array_cat ) ) {
|
798 |
-
echo '
|
799 |
-
<style type="text/css">
|
800 |
-
.woocommerce form #customer_details #'.$btn['cow'].'_field,
|
801 |
-
.woocommerce-page form #customer_details #'.$btn['cow'].'_field,
|
802 |
-
.woocommerce form.checkout #'.$btn['cow'].'_field {
|
803 |
-
display: none;
|
804 |
-
}
|
805 |
-
</style>';
|
806 |
-
}
|
807 |
-
}
|
808 |
-
|
809 |
-
$categoryarraycm = array();
|
810 |
-
$productsarraycm = array();
|
811 |
-
|
812 |
-
} // btn cut
|
813 |
-
|
814 |
}
|
815 |
?>
|
581 |
|
582 |
<?php
|
583 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
}
|
585 |
?>
|
includes/templates/functions/billing_functions.php
CHANGED
@@ -608,226 +608,6 @@ function wooccm_billing_override_this() {
|
|
608 |
</script>
|
609 |
|
610 |
<?php
|
611 |
-
// ================================ END!!! =====================================
|
612 |
-
// =============================================================================
|
613 |
-
// ----------------------------- CLEAR ---------------------------------
|
614 |
-
// ---------------------------------------------------------------------
|
615 |
-
// ---------------------------------------------------------------------
|
616 |
-
|
617 |
-
$categoryarraycm = array();
|
618 |
-
$productsarraycm = array();
|
619 |
-
|
620 |
-
foreach ($options['billing_buttons'] as $btn) {
|
621 |
-
foreach ($woocommerce->cart->cart_contents as $key => $values) {
|
622 |
-
|
623 |
-
$multiproductsx = ( isset($btn['single_p']) ? $btn['single_p'] : '' );
|
624 |
-
$show_field_single = ( isset($btn['single_px']) ? $btn['single_px'] : '' );
|
625 |
-
$multiproductsx_cat = ( isset($btn['single_p_cat']) ? $btn['single_p_cat'] : '' );
|
626 |
-
$show_field_single_cat = ( isset($btn['single_px_cat']) ? $btn['single_px_cat'] : '' );
|
627 |
-
|
628 |
-
$productsarraycm[] = $values['product_id'];
|
629 |
-
|
630 |
-
// Products
|
631 |
-
// hide field
|
632 |
-
// without more
|
633 |
-
if (!empty($btn['single_p']) && empty($btn['more_content'])) {
|
634 |
-
|
635 |
-
$multiarrayproductsx = explode(',', $multiproductsx);
|
636 |
-
|
637 |
-
if (in_array($values['product_id'], $multiarrayproductsx) && ( count($woocommerce->cart->cart_contents) < 2 )) {
|
638 |
-
echo '
|
639 |
-
<style type="text/css">
|
640 |
-
.woocommerce form #customer_details #billing_' . $btn['cow'] . '_field,
|
641 |
-
.woocommerce-page form #customer_details #billing_' . $btn['cow'] . '_field,
|
642 |
-
.woocommerce form.checkout #billing_' . $btn['cow'] . '_field {
|
643 |
-
display: none;
|
644 |
-
}
|
645 |
-
</style>';
|
646 |
-
}
|
647 |
-
}
|
648 |
-
|
649 |
-
// show field without more
|
650 |
-
if (!empty($btn['single_px']) && empty($btn['more_content'])) {
|
651 |
-
|
652 |
-
$show_field_array = explode('||', $show_field_single);
|
653 |
-
|
654 |
-
if (in_array($values['product_id'], $show_field_array) && ( count($woocommerce->cart->cart_contents) < 2 )) {
|
655 |
-
echo '
|
656 |
-
<style type="text/css">
|
657 |
-
.woocommerce form #customer_details #billing_' . $btn['cow'] . '_field,
|
658 |
-
.woocommerce-page form #customer_details #billing_' . $btn['cow'] . '_field,
|
659 |
-
.woocommerce form.checkout #billing_' . $btn['cow'] . '_field {
|
660 |
-
display: inline-block;
|
661 |
-
}
|
662 |
-
</style>';
|
663 |
-
}
|
664 |
-
|
665 |
-
if (!in_array($values['product_id'], $show_field_array) && ( count($woocommerce->cart->cart_contents) < 2 )) {
|
666 |
-
echo '
|
667 |
-
<style type="text/css">
|
668 |
-
.woocommerce form #customer_details #billing_' . $btn['cow'] . '_field,
|
669 |
-
.woocommerce-page form #customer_details #billing_' . $btn['cow'] . '_field,
|
670 |
-
.woocommerce form.checkout #billing_' . $btn['cow'] . '_field {
|
671 |
-
display: none;
|
672 |
-
}
|
673 |
-
</style>';
|
674 |
-
}
|
675 |
-
}
|
676 |
-
|
677 |
-
// Category
|
678 |
-
// hide field
|
679 |
-
/*$terms = get_the_terms($values['product_id'], 'product_cat');
|
680 |
-
if (!empty($terms)) {
|
681 |
-
foreach ($terms as $term) {
|
682 |
-
|
683 |
-
$categoryarraycm[] = $term->slug;
|
684 |
-
|
685 |
-
// without more
|
686 |
-
|
687 |
-
if (!empty($btn['single_p_cat']) && empty($btn['more_content'])) {
|
688 |
-
|
689 |
-
$multiarrayproductsx_cat = explode(',', $multiproductsx_cat);
|
690 |
-
|
691 |
-
if (in_array($term->slug, $multiarrayproductsx_cat) && ( count($woocommerce->cart->cart_contents) < 2 )) {
|
692 |
-
echo '
|
693 |
-
<style type="text/css">
|
694 |
-
.woocommerce form #customer_details #billing_' . $btn['cow'] . '_field,
|
695 |
-
.woocommerce-page form #customer_details #billing_' . $btn['cow'] . '_field,
|
696 |
-
.woocommerce form.checkout #billing_' . $btn['cow'] . '_field {
|
697 |
-
display: none;
|
698 |
-
}
|
699 |
-
</style>';
|
700 |
-
}
|
701 |
-
}
|
702 |
-
|
703 |
-
// show field without more
|
704 |
-
/*if (!empty($btn['single_px_cat']) && empty($btn['more_content'])) {
|
705 |
-
|
706 |
-
$show_field_array_cat = explode('||', $show_field_single_cat);
|
707 |
-
|
708 |
-
if (in_array($term->slug, $show_field_array_cat) && ( count($woocommerce->cart->cart_contents) < 2 )) {
|
709 |
-
echo '
|
710 |
-
<style type="text/css">
|
711 |
-
.woocommerce form #customer_details #billing_' . $btn['cow'] . '_field,
|
712 |
-
.woocommerce-page form #customer_details #billing_' . $btn['cow'] . '_field,
|
713 |
-
.woocommerce form.checkout #billing_' . $btn['cow'] . '_field {
|
714 |
-
display: inline-block;
|
715 |
-
}
|
716 |
-
</style>';
|
717 |
-
}
|
718 |
-
|
719 |
-
if (!in_array($term->slug, $show_field_array_cat) && ( count($woocommerce->cart->cart_contents) < 2 )) {
|
720 |
-
echo '
|
721 |
-
<style type="text/css">
|
722 |
-
.woocommerce form #customer_details #billing_' . $btn['cow'] . '_field,
|
723 |
-
.woocommerce-page form #customer_details #billing_' . $btn['cow'] . '_field,
|
724 |
-
.woocommerce form.checkout #billing_' . $btn['cow'] . '_field {
|
725 |
-
display: none;
|
726 |
-
}
|
727 |
-
</style>';
|
728 |
-
}
|
729 |
-
}
|
730 |
-
}
|
731 |
-
}*/
|
732 |
-
}
|
733 |
-
// end cart
|
734 |
-
// ===========================================================================================
|
735 |
-
// Products
|
736 |
-
// hide field
|
737 |
-
// with more
|
738 |
-
if (!empty($btn['single_p']) && !empty($btn['more_content'])) {
|
739 |
-
|
740 |
-
$multiarrayproductsx = explode(',', $multiproductsx);
|
741 |
-
|
742 |
-
if (array_intersect($productsarraycm, $multiarrayproductsx)) {
|
743 |
-
echo '
|
744 |
-
<style type="text/css">
|
745 |
-
.woocommerce form #customer_details #billing_' . $btn['cow'] . '_field,
|
746 |
-
.woocommerce-page form #customer_details #billing_' . $btn['cow'] . '_field,
|
747 |
-
.woocommerce form.checkout #billing_' . $btn['cow'] . '_field {
|
748 |
-
display: none;
|
749 |
-
}
|
750 |
-
</style>';
|
751 |
-
}
|
752 |
-
}
|
753 |
-
|
754 |
-
// show field with more
|
755 |
-
if (!empty($btn['single_px']) && !empty($btn['more_content'])) {
|
756 |
-
|
757 |
-
$show_field_array = explode('||', $show_field_single);
|
758 |
-
|
759 |
-
if (array_intersect($productsarraycm, $show_field_array)) {
|
760 |
-
echo '
|
761 |
-
<style type="text/css">
|
762 |
-
.woocommerce form #customer_details #billing_' . $btn['cow'] . '_field,
|
763 |
-
.woocommerce-page form #customer_details #billing_' . $btn['cow'] . '_field,
|
764 |
-
.woocommerce form.checkout #billing_' . $btn['cow'] . '_field {
|
765 |
-
display: inline-block;
|
766 |
-
}
|
767 |
-
</style>';
|
768 |
-
}
|
769 |
-
|
770 |
-
if (!array_intersect($productsarraycm, $show_field_array)) {
|
771 |
-
echo '
|
772 |
-
<style type="text/css">
|
773 |
-
.woocommerce form #customer_details #billing_' . $btn['cow'] . '_field,
|
774 |
-
.woocommerce-page form #customer_details #billing_' . $btn['cow'] . '_field,
|
775 |
-
.woocommerce form.checkout #billing_' . $btn['cow'] . '_field {
|
776 |
-
display: none;
|
777 |
-
}
|
778 |
-
</style>';
|
779 |
-
}
|
780 |
-
}
|
781 |
-
|
782 |
-
// Category
|
783 |
-
// hide field
|
784 |
-
// with more
|
785 |
-
/*if (!empty($btn['single_p_cat']) && !empty($btn['more_content'])) {
|
786 |
-
|
787 |
-
$multiarrayproductsx_cat = explode(',', $multiproductsx_cat);
|
788 |
-
|
789 |
-
if (array_intersect($categoryarraycm, $multiarrayproductsx_cat)) {
|
790 |
-
echo '
|
791 |
-
<style type="text/css">
|
792 |
-
.woocommerce form #customer_details #billing_' . $btn['cow'] . '_field,
|
793 |
-
.woocommerce-page form #customer_details #billing_' . $btn['cow'] . '_field,
|
794 |
-
.woocommerce form.checkout #billing_' . $btn['cow'] . '_field {
|
795 |
-
display: none;
|
796 |
-
}
|
797 |
-
</style>';
|
798 |
-
}
|
799 |
-
}
|
800 |
-
|
801 |
-
// show field with more
|
802 |
-
if (!empty($btn['single_px_cat']) && !empty($btn['more_content'])) {
|
803 |
-
|
804 |
-
$show_field_array_cat = explode('||', $show_field_single_cat);
|
805 |
-
|
806 |
-
if (array_intersect($categoryarraycm, $show_field_array_cat)) {
|
807 |
-
echo '
|
808 |
-
<style type="text/css">
|
809 |
-
.woocommerce form #customer_details #billing_' . $btn['cow'] . '_field,
|
810 |
-
.woocommerce-page form #customer_details #billing_' . $btn['cow'] . '_field,
|
811 |
-
.woocommerce form.checkout #billing_' . $btn['cow'] . '_field {
|
812 |
-
display: inline-block;
|
813 |
-
}
|
814 |
-
</style>';
|
815 |
-
}
|
816 |
-
|
817 |
-
if (!array_intersect($categoryarraycm, $show_field_array_cat)) {
|
818 |
-
echo '
|
819 |
-
<style type="text/css">
|
820 |
-
.woocommerce form #customer_details #billing_' . $btn['cow'] . '_field,
|
821 |
-
.woocommerce-page form #customer_details #billing_' . $btn['cow'] . '_field,
|
822 |
-
.woocommerce form.checkout #billing_' . $btn['cow'] . '_field {
|
823 |
-
display: none;
|
824 |
-
}
|
825 |
-
</style>';
|
826 |
-
}
|
827 |
-
}*/
|
828 |
|
829 |
-
$categoryarraycm = array();
|
830 |
-
$productsarraycm = array();
|
831 |
-
} // btn cut
|
832 |
}
|
833 |
?>
|
608 |
</script>
|
609 |
|
610 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
611 |
|
|
|
|
|
|
|
612 |
}
|
613 |
?>
|
includes/templates/functions/shipping_functions.php
CHANGED
@@ -615,235 +615,5 @@ jQuery(document).ready(function($){
|
|
615 |
|
616 |
<?php
|
617 |
|
618 |
-
// ================================ END!!! =====================================
|
619 |
-
// =============================================================================
|
620 |
-
|
621 |
-
// ----------------------------- CLEAR ---------------------------------
|
622 |
-
// ---------------------------------------------------------------------
|
623 |
-
// ---------------------------------------------------------------------
|
624 |
-
|
625 |
-
$categoryarraycm = '';
|
626 |
-
$productsarraycm = '';
|
627 |
-
|
628 |
-
foreach( $options['shipping_buttons'] as $btn ) {
|
629 |
-
foreach( $woocommerce->cart->cart_contents as $key => $values ) {
|
630 |
-
|
631 |
-
$multiproductsx = $btn['single_p'];
|
632 |
-
$show_field_single = $btn['single_px'];
|
633 |
-
$multiproductsx_cat = $btn['single_p_cat'];
|
634 |
-
$show_field_single_cat = $btn['single_px_cat'];
|
635 |
-
|
636 |
-
$productsarraycm[] = $values['product_id'];
|
637 |
-
|
638 |
-
// Products
|
639 |
-
// hide field
|
640 |
-
|
641 |
-
// without more
|
642 |
-
if( !empty( $btn['single_p'] ) && empty( $btn['more_content'] ) ) {
|
643 |
-
|
644 |
-
$multiarrayproductsx = explode( ',', $multiproductsx );
|
645 |
-
|
646 |
-
if( in_array( $values['product_id'], $multiarrayproductsx ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
647 |
-
echo '
|
648 |
-
<style type="text/css">
|
649 |
-
.woocommerce form #customer_details #shipping_'.$btn['cow'].'_field,
|
650 |
-
.woocommerce-page form #customer_details #shipping_'.$btn['cow'].'_field,
|
651 |
-
.woocommerce form.checkout #shipping_'.$btn['cow'].'_field {
|
652 |
-
display: none;
|
653 |
-
}
|
654 |
-
</style>';
|
655 |
-
}
|
656 |
-
}
|
657 |
-
|
658 |
-
// show field without more
|
659 |
-
if( !empty( $btn['single_px'] ) && empty( $btn['more_content'] ) ) {
|
660 |
-
|
661 |
-
$show_field_array = explode( '||', $show_field_single );
|
662 |
-
|
663 |
-
if( in_array( $values['product_id'], $show_field_array ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
664 |
-
echo '
|
665 |
-
<style type="text/css">
|
666 |
-
.woocommerce form #customer_details #shipping_'.$btn['cow'].'_field,
|
667 |
-
.woocommerce-page form #customer_details #shipping_'.$btn['cow'].'_field,
|
668 |
-
.woocommerce form.checkout #shipping_'.$btn['cow'].'_field {
|
669 |
-
display: inline-block;
|
670 |
-
}
|
671 |
-
</style>';
|
672 |
-
}
|
673 |
-
|
674 |
-
if( !in_array( $values['product_id'], $show_field_array ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
675 |
-
echo '
|
676 |
-
<style type="text/css">
|
677 |
-
.woocommerce form #customer_details #shipping_'.$btn['cow'].'_field,
|
678 |
-
.woocommerce-page form #customer_details #shipping_'.$btn['cow'].'_field,
|
679 |
-
.woocommerce form.checkout #shipping_'.$btn['cow'].'_field {
|
680 |
-
display: none;
|
681 |
-
}
|
682 |
-
</style>';
|
683 |
-
}
|
684 |
-
}
|
685 |
-
|
686 |
-
// Category
|
687 |
-
// hide field
|
688 |
-
$terms = get_the_terms( $values['product_id'], 'product_cat' );
|
689 |
-
if( !empty($terms) ) {
|
690 |
-
foreach( $terms as $term ) {
|
691 |
-
|
692 |
-
$categoryarraycm[] = $term->slug;
|
693 |
-
|
694 |
-
// without more
|
695 |
-
|
696 |
-
if( !empty( $btn['single_p_cat'] ) && empty( $btn['more_content'] ) ) {
|
697 |
-
|
698 |
-
$multiarrayproductsx_cat = explode( ',', $multiproductsx_cat );
|
699 |
-
|
700 |
-
if( in_array( $term->slug, $multiarrayproductsx_cat ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
701 |
-
echo '
|
702 |
-
<style type="text/css">
|
703 |
-
.woocommerce form #customer_details #shipping_'.$btn['cow'].'_field,
|
704 |
-
.woocommerce-page form #customer_details #shipping_'.$btn['cow'].'_field,
|
705 |
-
.woocommerce form.checkout #shipping_'.$btn['cow'].'_field {
|
706 |
-
display: none;
|
707 |
-
}
|
708 |
-
</style>';
|
709 |
-
}
|
710 |
-
}
|
711 |
-
|
712 |
-
// show field without more
|
713 |
-
if( !empty( $btn['single_px_cat'] ) && empty( $btn['more_content'] ) ) {
|
714 |
-
|
715 |
-
$show_field_array_cat = explode('||',$show_field_single_cat);
|
716 |
-
|
717 |
-
if( in_array( $term->slug, $show_field_array_cat ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
718 |
-
echo '
|
719 |
-
<style type="text/css">
|
720 |
-
.woocommerce form #customer_details #shipping_'.$btn['cow'].'_field,
|
721 |
-
.woocommerce-page form #customer_details #shipping_'.$btn['cow'].'_field,
|
722 |
-
.woocommerce form.checkout #shipping_'.$btn['cow'].'_field {
|
723 |
-
display: inline-block;
|
724 |
-
}
|
725 |
-
</style>';
|
726 |
-
}
|
727 |
-
|
728 |
-
if( !in_array( $term->slug, $show_field_array_cat ) && ( count( $woocommerce->cart->cart_contents ) < 2 ) ) {
|
729 |
-
echo '
|
730 |
-
<style type="text/css">
|
731 |
-
.woocommerce form #customer_details #shipping_'.$btn['cow'].'_field,
|
732 |
-
.woocommerce-page form #customer_details #shipping_'.$btn['cow'].'_field,
|
733 |
-
.woocommerce form.checkout #shipping_'.$btn['cow'].'_field {
|
734 |
-
display: none;
|
735 |
-
}
|
736 |
-
</style>';
|
737 |
-
}
|
738 |
-
}
|
739 |
-
|
740 |
-
}
|
741 |
-
}
|
742 |
-
}
|
743 |
-
// end cart
|
744 |
-
|
745 |
-
// ===========================================================================================
|
746 |
-
|
747 |
-
// Products
|
748 |
-
// hide field
|
749 |
-
|
750 |
-
// with more
|
751 |
-
if( !empty( $btn['single_p'] ) && !empty( $btn['more_content'] ) ) {
|
752 |
-
|
753 |
-
$multiarrayproductsx = explode( ',', $multiproductsx );
|
754 |
-
|
755 |
-
if( array_intersect( $productsarraycm, $multiarrayproductsx ) ) {
|
756 |
-
echo '
|
757 |
-
<style type="text/css">
|
758 |
-
.woocommerce form #customer_details #shipping_'.$btn['cow'].'_field,
|
759 |
-
.woocommerce-page form #customer_details #shipping_'.$btn['cow'].'_field,
|
760 |
-
.woocommerce form.checkout #shipping_'.$btn['cow'].'_field {
|
761 |
-
display: none;
|
762 |
-
}
|
763 |
-
</style>';
|
764 |
-
}
|
765 |
-
}
|
766 |
-
|
767 |
-
// show field with more
|
768 |
-
if( !empty( $btn['single_px'] ) && !empty( $btn['more_content'] ) ) {
|
769 |
-
|
770 |
-
$show_field_array = explode( '||', $show_field_single );
|
771 |
-
|
772 |
-
if( array_intersect( $productsarraycm, $show_field_array ) ) {
|
773 |
-
echo '
|
774 |
-
<style type="text/css">
|
775 |
-
.woocommerce form #customer_details #shipping_'.$btn['cow'].'_field,
|
776 |
-
.woocommerce-page form #customer_details #shipping_'.$btn['cow'].'_field,
|
777 |
-
.woocommerce form.checkout #shipping_'.$btn['cow'].'_field {
|
778 |
-
display: inline-block;
|
779 |
-
}
|
780 |
-
</style>';
|
781 |
-
}
|
782 |
-
|
783 |
-
if( !array_intersect( $productsarraycm, $show_field_array ) ) {
|
784 |
-
echo '
|
785 |
-
<style type="text/css">
|
786 |
-
.woocommerce form #customer_details #shipping_'.$btn['cow'].'_field,
|
787 |
-
.woocommerce-page form #customer_details #shipping_'.$btn['cow'].'_field,
|
788 |
-
.woocommerce form.checkout #shipping_'.$btn['cow'].'_field {
|
789 |
-
display: none;
|
790 |
-
}
|
791 |
-
</style>';
|
792 |
-
}
|
793 |
-
}
|
794 |
-
|
795 |
-
// Category
|
796 |
-
// hide field
|
797 |
-
|
798 |
-
// with more
|
799 |
-
if( !empty( $btn['single_p_cat'] ) && !empty( $btn['more_content'] ) ) {
|
800 |
-
|
801 |
-
$multiarrayproductsx_cat = explode( ',', $multiproductsx_cat );
|
802 |
-
|
803 |
-
if( array_intersect( $categoryarraycm, $multiarrayproductsx_cat ) ) {
|
804 |
-
echo '
|
805 |
-
<style type="text/css">
|
806 |
-
.woocommerce form #customer_details #shipping_'.$btn['cow'].'_field,
|
807 |
-
.woocommerce-page form #customer_details #shipping_'.$btn['cow'].'_field,
|
808 |
-
.woocommerce form.checkout #shipping_'.$btn['cow'].'_field {
|
809 |
-
display: none;
|
810 |
-
}
|
811 |
-
</style>';
|
812 |
-
}
|
813 |
-
}
|
814 |
-
|
815 |
-
// show field with more
|
816 |
-
if( !empty( $btn['single_px_cat'] ) && !empty( $btn['more_content'] ) ) {
|
817 |
-
|
818 |
-
$show_field_array_cat = explode( '||', $show_field_single_cat );
|
819 |
-
|
820 |
-
if( array_intersect( $categoryarraycm, $show_field_array_cat ) ) {
|
821 |
-
echo '
|
822 |
-
<style type="text/css">
|
823 |
-
.woocommerce form #customer_details #shipping_'.$btn['cow'].'_field,
|
824 |
-
.woocommerce-page form #customer_details #shipping_'.$btn['cow'].'_field,
|
825 |
-
.woocommerce form.checkout #shipping_'.$btn['cow'].'_field {
|
826 |
-
display: inline-block;
|
827 |
-
}
|
828 |
-
</style>';
|
829 |
-
}
|
830 |
-
|
831 |
-
if( !array_intersect( $categoryarraycm, $show_field_array_cat ) ) {
|
832 |
-
echo '
|
833 |
-
<style type="text/css">
|
834 |
-
.woocommerce form #customer_details #shipping_'.$btn['cow'].'_field,
|
835 |
-
.woocommerce-page form #customer_details #shipping_'.$btn['cow'].'_field,
|
836 |
-
.woocommerce form.checkout #shipping_'.$btn['cow'].'_field {
|
837 |
-
display: none;
|
838 |
-
}
|
839 |
-
</style>';
|
840 |
-
}
|
841 |
-
}
|
842 |
-
|
843 |
-
$categoryarraycm = '';
|
844 |
-
$productsarraycm = '';
|
845 |
-
|
846 |
-
} // btn cut
|
847 |
-
|
848 |
}
|
849 |
?>
|
615 |
|
616 |
<?php
|
617 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
618 |
}
|
619 |
?>
|
new/admin.php
CHANGED
@@ -88,6 +88,35 @@ if (!class_exists('WOOCCM_Admin')) {
|
|
88 |
wp_die();
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
function add_sections($sections = array()) {
|
92 |
|
93 |
global $current_section;
|
@@ -225,6 +254,7 @@ if (!class_exists('WOOCCM_Admin')) {
|
|
225 |
add_action('wp_ajax_wooccm_toggle_field_enabled', array($this, 'ajax_toggle_field_enabled'));
|
226 |
add_action('wp_ajax_wooccm_add_field', array($this, 'ajax_add_field'));
|
227 |
add_action('wp_ajax_wooccm_edit_field', array($this, 'ajax_edit_field'));
|
|
|
228 |
}
|
229 |
|
230 |
public static function instance() {
|
88 |
wp_die();
|
89 |
}
|
90 |
|
91 |
+
function ajax_save_field() {
|
92 |
+
|
93 |
+
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_admin', 'nonce')) {
|
94 |
+
|
95 |
+
if ($options = get_option('wccs_settings3')) {
|
96 |
+
|
97 |
+
if (array_key_exists('billing_buttons', $options)) {
|
98 |
+
|
99 |
+
$field_data = isset($_REQUEST['field_data']) ? $_REQUEST['field_data'] : false;
|
100 |
+
$field_id = isset($_REQUEST['field_id']) ? absint($_REQUEST['field_id']) : 0;
|
101 |
+
|
102 |
+
if (is_array($field_data)) {
|
103 |
+
|
104 |
+
$options['billing_buttons'][$field_id] = wp_parse_args($field_data, $options['billing_buttons'][$field_id]);
|
105 |
+
|
106 |
+
update_option('wccs_settings3', $options);
|
107 |
+
|
108 |
+
wp_send_json_success($field_data);
|
109 |
+
}
|
110 |
+
|
111 |
+
wp_send_json_error(esc_html__('Undefined field', 'woocommerce-checkout-manager'));
|
112 |
+
}
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-managerS'));
|
117 |
+
wp_die();
|
118 |
+
}
|
119 |
+
|
120 |
function add_sections($sections = array()) {
|
121 |
|
122 |
global $current_section;
|
254 |
add_action('wp_ajax_wooccm_toggle_field_enabled', array($this, 'ajax_toggle_field_enabled'));
|
255 |
add_action('wp_ajax_wooccm_add_field', array($this, 'ajax_add_field'));
|
256 |
add_action('wp_ajax_wooccm_edit_field', array($this, 'ajax_edit_field'));
|
257 |
+
add_action('wp_ajax_wooccm_save_field', array($this, 'ajax_save_field'));
|
258 |
}
|
259 |
|
260 |
public static function instance() {
|
new/admin/pages/billing.php
CHANGED
@@ -116,485 +116,496 @@
|
|
116 |
<div class="media-modal-backdrop"> </div>
|
117 |
<div tabindex="0" id="<?php echo esc_attr(WOOCCM_PREFIX . '_modal'); ?>" class="media-modal wp-core-ui upload-php" role="dialog" aria-modal="true" aria-labelledby="media-frame-title">
|
118 |
<div class="media-modal-content" role="document">
|
119 |
-
<
|
120 |
-
<div class="edit-
|
121 |
-
<
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
<
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
<div class="attachment-details save-ready">
|
132 |
-
<div class="attachment-media-view landscape">
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
<ul class="product_data_tabs wc-tabs">
|
137 |
-
<li class="general_options active">
|
138 |
-
<a href="#general_product_data"><span><?php esc_html_e('General', 'woocommerce-checkout-manager'); ?></span></a>
|
139 |
-
</li>
|
140 |
-
<li class="inventory_options">
|
141 |
-
<a href="#inventory_product_data"><span><?php esc_html_e('Options', 'woocommerce-checkout-manager'); ?></span></a>
|
142 |
-
</li>
|
143 |
-
<li class="shipping_options">
|
144 |
-
<a href="#shipping_product_data"><span><?php esc_html_e('Conditional', 'woocommerce-checkout-manager'); ?></span></a>
|
145 |
-
</li>
|
146 |
-
<li class="linked_product_options">
|
147 |
-
<a href="#linked_product_data"><span><?php esc_html_e('Amount', 'woocommerce-checkout-manager'); ?></span></a>
|
148 |
-
</li>
|
149 |
-
<li class="attribute_options">
|
150 |
-
<a href="#product_attributes"><span><?php esc_html_e('Taxes', 'woocommerce-checkout-manager'); ?></span></a>
|
151 |
-
</li>
|
152 |
-
<li class="variations_options">
|
153 |
-
<a href="#variable_product_options"><span><?php esc_html_e('Display', 'woocommerce-checkout-manager'); ?></span></a>
|
154 |
-
</li>
|
155 |
-
<li class="advanced_options">
|
156 |
-
<a href="#advanced_product_data"><span><?php esc_html_e('Timing', 'woocommerce-checkout-manager'); ?></span></a>
|
157 |
-
</li>
|
158 |
-
<li class="marketplace-suggestions_options">
|
159 |
-
<a href="#marketplace_suggestions"><span><?php esc_html_e('Advanced', 'woocommerce-checkout-manager'); ?></span></a>
|
160 |
-
</li>
|
161 |
-
</ul>
|
162 |
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
<
|
167 |
-
<
|
168 |
-
</
|
169 |
-
|
170 |
-
<
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
<
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
<label><?php esc_html_e('Position', 'woocommerce-checkout-manager'); ?></label>
|
186 |
-
<select class="select short" name="wccs_settings3[billing_buttons][{{data.id}}][position]">
|
187 |
-
<option <# if ( data.position == 'form-row-wide' ) { #>selected<# } #> value="form-row-wide"><?php esc_html_e('Wide', 'woocommerce-checkout-managert'); ?></option>
|
188 |
-
<option <# if ( data.position == 'form-row-first' ) { #>selected<# } #> value="form-row-first"><?php esc_html_e('Left', 'woocommerce-checkout-managert'); ?></option>
|
189 |
-
<option <# if ( data.position == 'form-row-last' ) { #>selected<# } #> value="form-row-last"><?php esc_html_e('Right', 'woocommerce-checkout-managert'); ?></option>
|
190 |
-
</select>
|
191 |
-
<span class="description"><?php esc_html_e('Placement of the checkout field.', 'woocommerce-checkout-managert'); ?></span>
|
192 |
-
</p>
|
193 |
-
<p class="form-field">
|
194 |
-
<label><?php esc_html_e('Clear', 'woocommerce-checkout-manager'); ?></label>
|
195 |
-
<input <# if ( data.clear_row == 'true' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][clear_row]" value="true">
|
196 |
-
<span class="description"><?php esc_html_e('Applies a clear fix to the checkout field.', 'woocommerce-checkout-managert'); ?></span>
|
197 |
-
</p>
|
198 |
-
<p class="form-field">
|
199 |
-
<label><?php esc_html_e('Extra class', 'woocommerce-checkout-manager'); ?></label>
|
200 |
-
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][extra_class]" value="{{data.extra_class}}">
|
201 |
-
</p>
|
202 |
-
</div>
|
203 |
-
<div class="options_group">
|
204 |
-
<p class="form-field">
|
205 |
-
<label><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></label>
|
206 |
-
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][label]" placeholder="<?php esc_html_e('My Field Name', 'woocommerce-checkout-managert'); ?>" value="{{data.label}}">
|
207 |
-
<span class="description"><?php esc_html_e('Placeholder text for the checkout field.', 'woocommerce-checkout-managert'); ?></span>
|
208 |
-
</p>
|
209 |
-
<p class="form-field">
|
210 |
-
<label><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></label>
|
211 |
-
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][placeholder]" title="" placeholder="<?php esc_html_e('Example red', 'woocommerce-checkout-managert'); ?>" value="{{data.placeholder}}">
|
212 |
-
<span class="description"><?php esc_html_e('Placeholder text for the checkout field.', 'woocommerce-checkout-managert'); ?></span>
|
213 |
-
</p>
|
214 |
-
</div>
|
215 |
-
</div>
|
216 |
-
<div id="inventory_product_data" class="panel woocommerce_options_panel hidden" style="display: none;">
|
217 |
|
218 |
-
<div class="
|
219 |
-
<
|
220 |
-
|
221 |
-
<
|
222 |
-
<
|
223 |
-
|
224 |
-
|
225 |
-
<
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
<
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
<
|
234 |
-
<
|
235 |
-
<
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
</div>
|
279 |
-
</div>
|
280 |
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
|
|
|
|
|
|
|
|
296 |
</div>
|
297 |
|
298 |
-
|
299 |
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
<
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
</p>
|
315 |
-
<p class="form-field">
|
316 |
-
<label><?php esc_html_e('Default Color', 'woocommerce-checkout-manager'); ?></label>
|
317 |
-
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][colorpickerd]" id="billing-colorpic0" placeholder="#000000" value="{{data.colorpickerd}}">
|
318 |
-
</p>
|
319 |
-
<p class="form-field">
|
320 |
-
<label><?php esc_html_e('Picker Type', 'woocommerce-checkout-manager'); ?></label>
|
321 |
-
<select class="select short" name="wccs_settings3[billing_buttons][{{data.id}}][colorpickertype]">
|
322 |
-
<option <# if ( data.colorpickertype == 'farbtastic' ) { #>selected<# } #> value="farbtastic" >Farbtastic</option>
|
323 |
-
<option <# if ( data.colorpickertype == 'iris' ) { #>selected<# } #> value="iris">Iris</option>
|
324 |
-
</select>
|
325 |
-
</p>
|
326 |
-
</div>
|
327 |
-
</div>
|
328 |
|
329 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
|
331 |
-
<div class="options_group">
|
332 |
-
<p class="form-field">
|
333 |
-
<label><?php esc_html_e('User Role', 'woocommerce-checkout-manager'); ?></label>
|
334 |
-
<input <# if ( data.user_role == 'user_role' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][user_role]" value="user_role">
|
335 |
-
</p>
|
336 |
-
<p class="form-field">
|
337 |
-
<label><?php esc_html_e('Show for Roles', 'woocommerce-checkout-manager'); ?></label>
|
338 |
-
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][role_options]" placeholder="Option 1||Option 2||Option 3" value="{{data.role_options}}">
|
339 |
-
</p>
|
340 |
-
<p class="form-field">
|
341 |
-
<label><?php esc_html_e('Hide for Roles', 'woocommerce-checkout-manager'); ?></label>
|
342 |
-
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][role_options2]" placeholder="Option 1||Option 2||Option 3" value="{{data.role_options2}}">
|
343 |
-
</p>
|
344 |
</div>
|
345 |
|
346 |
-
<div class="
|
347 |
-
<p class="form-field">
|
348 |
-
<label><?php esc_html_e('More', 'woocommerce-checkout-manager'); ?></label>
|
349 |
-
<input <# if ( data.more_content == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][more_content]" value="1">
|
350 |
-
</p>
|
351 |
-
<p class="form-field">
|
352 |
-
<label><?php esc_html_e('Hide Field from Product', 'woocommerce-checkout-manager'); ?></label>
|
353 |
-
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_p]" placeholder="Product ID(s) e.g 1674||1233" value="{{data.single_p}}">
|
354 |
-
</p>
|
355 |
-
<p class="form-field">
|
356 |
-
<label><?php esc_html_e('Show Field for Product', 'woocommerce-checkout-manager'); ?></label>
|
357 |
-
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_px]" placeholder="Product ID(s) e.g 1674||1233" value="{{data.single_px}}">
|
358 |
-
</p>
|
359 |
-
<p class="form-field">
|
360 |
-
<label><?php esc_html_e('Hide Field from Category', 'woocommerce-checkout-manager'); ?></label>
|
361 |
-
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_p_cat]" placeholder="Category Slug(s) e.g my-cat||my-cat2" value="{{data.single_p_cat}}">
|
362 |
-
</p>
|
363 |
-
<p class="form-field">
|
364 |
-
<label><?php esc_html_e('Show Field for Category', 'woocommerce-checkout-manager'); ?></label>
|
365 |
-
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_px_cat]" placeholder="Category Slug(s) e.g my-cat||my-cat2" value="{{data.sigle_px_cat}}">
|
366 |
-
</p>
|
367 |
-
</div>
|
368 |
-
</div>
|
369 |
|
370 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
371 |
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
|
|
|
|
|
|
|
|
|
|
389 |
</div>
|
390 |
|
391 |
-
<div class="
|
392 |
-
<p class="form-field">
|
393 |
-
<label><?php esc_html_e('Date Format', 'woocommerce-checkout-manager'); ?></label>
|
394 |
-
<input class="short" type="text" placeholder="dd-mm-yy" name="wccs_settings3[billing_buttons][{{data.id}}][format_date]" value="{{data.format_date}}">
|
395 |
-
</p>
|
396 |
-
<p class="form-field">
|
397 |
-
<label><?php esc_html_e('Days Before', 'woocommerce-checkout-manager'); ?></label>
|
398 |
-
<input class="short" type="text" placeholder="+3" name="wccs_settings3[billing_buttons][{{data.id}}][min_before]" value="{{data.min_before}}">
|
399 |
-
</p>
|
400 |
-
<p class="form-field">
|
401 |
-
<label><?php esc_html_e('Days After', 'woocommerce-checkout-manager'); ?></label>
|
402 |
-
<input class="short" type="text" placeholder="3" name="wccs_settings3[billing_buttons][{{data.id}}][max_after]" value="{{data.max_after}}">
|
403 |
-
</p>
|
404 |
-
<p class="form-field">
|
405 |
-
<label><?php esc_html_e('Days Enabler', 'woocommerce-checkout-manager'); ?></label>
|
406 |
-
<input <# if ( data.days_disabler == 'true' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler]" value="true">
|
407 |
-
</p>
|
408 |
-
<p class="form-field">
|
409 |
-
<label><?php esc_html_e('Sundays', 'woocommerce-checkout-manager'); ?></label>
|
410 |
-
<input <# if ( data.days_disabler0 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler0]" value="1">
|
411 |
-
</p>
|
412 |
-
<p class="form-field">
|
413 |
-
<label><?php esc_html_e('Mondays Mondays', 'woocommerce-checkout-manager'); ?></label>
|
414 |
-
<input <# if ( data.days_disabler1 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler1]" value="1">
|
415 |
-
</p>
|
416 |
-
<p class="form-field">
|
417 |
-
<label><?php esc_html_e('Tuesdays', 'woocommerce-checkout-manager'); ?></label>
|
418 |
-
<input <# if ( data.days_disabler2 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler2]" value="1">
|
419 |
-
</p>
|
420 |
-
<p class="form-field">
|
421 |
-
<label><?php esc_html_e('Wednesdays', 'woocommerce-checkout-manager'); ?></label>
|
422 |
-
<input <# if ( data.days_disabler3 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler3]" value="1">
|
423 |
-
</p>
|
424 |
-
<p class="form-field">
|
425 |
-
<label><?php esc_html_e('Thursdays', 'woocommerce-checkout-manager'); ?></label>
|
426 |
-
<input <# if ( data.days_disabler4 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler4]" value="1">
|
427 |
-
</p>
|
428 |
-
<p class="form-field">
|
429 |
-
<label><?php esc_html_e('Fridays', 'woocommerce-checkout-manager'); ?></label>
|
430 |
-
<input <# if ( data.days_disabler5 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler5]" value="1">
|
431 |
-
</p>
|
432 |
-
<p class="form-field">
|
433 |
-
<label><?php esc_html_e('Satudays', 'woocommerce-checkout-manager'); ?></label>
|
434 |
-
<input <# if ( data.days_disabler6 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler6]" value="1">
|
435 |
-
</p>
|
436 |
-
</div>
|
437 |
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
<
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_max_mm]" placeholder="10" title="mm" value="{{data.single_max_mm}}">
|
457 |
-
</p>
|
458 |
-
<p class="form-field">
|
459 |
-
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_max_dd]" placeholder="25" title="dd" value="{{data.single_max_dd}}">
|
460 |
-
</p>
|
461 |
-
</div>
|
462 |
|
463 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
464 |
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
471 |
</div>
|
|
|
472 |
</div>
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
<
|
478 |
-
|
479 |
-
|
480 |
-
<a class="suggestion-dismiss" title="Dismiss this suggestion" href="#"></a>
|
481 |
</div>
|
482 |
</div>
|
483 |
-
<div class="marketplace-
|
484 |
-
<div class="marketplace-suggestion-container-content">
|
485 |
-
<
|
486 |
-
|
|
|
|
|
|
|
|
|
|
|
487 |
</div>
|
488 |
-
<div class="marketplace-suggestion-container-
|
489 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
</div>
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
|
|
|
|
|
|
496 |
</div>
|
497 |
-
<div class="marketplace-suggestion-container-
|
498 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
499 |
</div>
|
500 |
</div>
|
501 |
-
<div class="marketplace-
|
502 |
-
<div class="marketplace-suggestion-container-
|
503 |
-
<
|
504 |
-
<
|
505 |
-
</div>
|
506 |
-
<div class="marketplace-suggestion-container-cta"><a href="https://woocommerce.com/products/min-max-quantities/?wccom-site=http%3A%2F%2Flocalhost%2Fwoocommerce-checkout&wccom-back=%2Fwoocommerce-checkout%2Fwp-admin%2Fpost.php%3Fpost%3D6%26%23038%3Baction%3Dedit&wccom-woo-version=3.7.0&utm_source=editproduct&utm_campaign=marketplacesuggestions&utm_medium=product" target="blank" class="button">Learn More</a>
|
507 |
-
<a class="suggestion-dismiss" title="Dismiss this suggestion" href="#"></a>
|
508 |
</div>
|
509 |
</div>
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
<div class="marketplace-suggestion-placeholder-content">
|
520 |
-
<h4>Enhance your products</h4>
|
521 |
-
<p>Extensions can add new functionality to your product pages that make your store stand out</p>
|
522 |
</div>
|
523 |
-
<a href="https://woocommerce.com/product-category/woocommerce-extensions/?utm_source=editproduct&utm_campaign=marketplacesuggestions&utm_medium=product" target="blank" class="button">Browse the Marketplace</a>
|
524 |
-
<br>
|
525 |
-
<a class="marketplace-suggestion-manage-link" href="http://localhost/woocommerce-checkout/wp-admin/admin.php?page=wc-settings&tab=advanced&section=woocommerce_com">Manage suggestions</a>
|
526 |
</div>
|
|
|
527 |
</div>
|
528 |
-
<div class="clear"></div>
|
529 |
</div>
|
530 |
-
</div>
|
531 |
|
532 |
-
</div>
|
533 |
-
<div class="attachment-info">
|
534 |
-
<span class="settings-save-status">
|
535 |
-
<span class="spinner"></span>
|
536 |
-
<span class="saved">Saved.</span>
|
537 |
-
</span>
|
538 |
-
<div class="details">
|
539 |
-
<div class="filename"><strong>Field id:</strong> #{{data.id}}</div>
|
540 |
-
<div class="filename"><strong>Filed slug:</strong> {{data.cow}}</div>
|
541 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
542 |
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
<span class="name"><?php esc_html_e('Clear', 'woocommerce-checkout-manager'); ?></span>
|
565 |
-
<input <# if ( data.clear_row == 'true' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][clear_row]" value="true">
|
566 |
-
</label>
|
567 |
-
<p class="description"><?php esc_html_e('Applies a clear fix to the checkout field.', 'woocommerce-checkout-managert'); ?></p>
|
568 |
-
<label class="setting">
|
569 |
-
<span class="name"><?php esc_html_e('Extra class', 'woocommerce-checkout-manager'); ?></span>
|
570 |
-
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][extra_class]" value="{{data.extra_class}}">
|
571 |
-
</label>
|
572 |
|
573 |
-
|
574 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
575 |
</div>
|
576 |
-
</div>
|
577 |
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
|
|
|
584 |
</div>
|
585 |
-
</div>
|
586 |
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
|
|
594 |
</div>
|
595 |
</div>
|
596 |
</div>
|
597 |
-
</
|
598 |
</div>
|
599 |
</div>
|
600 |
</script>
|
116 |
<div class="media-modal-backdrop"> </div>
|
117 |
<div tabindex="0" id="<?php echo esc_attr(WOOCCM_PREFIX . '_modal'); ?>" class="media-modal wp-core-ui upload-php" role="dialog" aria-modal="true" aria-labelledby="media-frame-title">
|
118 |
<div class="media-modal-content" role="document">
|
119 |
+
<form class="media-modal-form" method="POST" data-field_id="{{data.id}}">
|
120 |
+
<div class="edit-attachment-frame mode-select hide-menu hide-router">
|
121 |
+
<div class="edit-media-header">
|
122 |
+
<button data-field_id="{{ data.prev_id}}" class="media-modal-prev left dashicons <# if ( data.prev_id < 0 ) { #>disabled<# } #>"><span class="screen-reader-text"><?php esc_html_e('Edit previous media item'); ?></span></button>
|
123 |
+
<button data-field_id="{{ data.next_id}}" class="media-modal-next right dashicons <# if ( data.next_id == data.id ) { #>disabled<# } #>"><span class="screen-reader-text"><?php esc_html_e('Edit next media item'); ?></span></button>
|
124 |
+
<button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php esc_html_e('Close dialog'); ?></span></span>
|
125 |
+
</button>
|
126 |
+
</div>
|
127 |
+
<div class="media-frame-title">
|
128 |
+
<h1><?php esc_html_e('Edit field', 'woocommerce-checkout-manager'); ?> #{{ data.id }}</h1>
|
129 |
+
</div>
|
130 |
+
<div class="media-frame-content" style="bottom:61px;">
|
|
|
|
|
131 |
|
132 |
+
<div class="attachment-details">
|
133 |
+
<div class="attachment-media-view landscape" style="overflow: hidden;">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
+
<div id="woocommerce-product-data">
|
136 |
+
<div class="panel-wrap product_data" style="overflow:visible;">
|
137 |
+
<ul class="product_data_tabs wc-tabs">
|
138 |
+
<li class="general_options active">
|
139 |
+
<a href="#general_product_data"><span><?php esc_html_e('General', 'woocommerce-checkout-manager'); ?></span></a>
|
140 |
+
</li>
|
141 |
+
<li class="shipping_options">
|
142 |
+
<a href="#shipping_product_data"><span><?php esc_html_e('Conditional', 'woocommerce-checkout-manager'); ?></span></a>
|
143 |
+
</li>
|
144 |
+
<li class="linked_product_options">
|
145 |
+
<a href="#linked_product_data"><span><?php esc_html_e('Amount', 'woocommerce-checkout-manager'); ?></span></a>
|
146 |
+
</li>
|
147 |
+
<li class="variations_options">
|
148 |
+
<a href="#variable_product_options"><span><?php esc_html_e('Display', 'woocommerce-checkout-manager'); ?></span></a>
|
149 |
+
</li>
|
150 |
+
<li class="advanced_options">
|
151 |
+
<a href="#advanced_product_data"><span><?php esc_html_e('Timing', 'woocommerce-checkout-manager'); ?></span></a>
|
152 |
+
</li>
|
153 |
+
<li class="marketplace-suggestions_options">
|
154 |
+
<a href="#marketplace_suggestions"><span><?php esc_html_e('Advanced', 'woocommerce-checkout-manager'); ?></span></a>
|
155 |
+
</li>
|
156 |
+
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
|
158 |
+
<div id="general_product_data" class="panel woocommerce_options_panel" style="display: none;">
|
159 |
+
<div class="options_group">
|
160 |
+
<!--<p>
|
161 |
+
<td class="billing-wccs-order-hidden">
|
162 |
+
<input type="hidden" name="order" value="{{data.order}}">
|
163 |
+
</p>-->
|
164 |
+
<!--<p>
|
165 |
+
<label><?php esc_html_e('Disabled', 'woocommerce-checkout-manager'); ?></label>
|
166 |
+
<input name="disabled" type="checkbox" value="{{data.disabled}}">
|
167 |
+
</p>-->
|
168 |
+
<!--<p>
|
169 |
+
<label><?php esc_html_e('Required', 'woocommerce-checkout-manager'); ?></label>
|
170 |
+
<input name="checkbox" type="checkbox" title="Whether or not the checkout field is required" value="{{data.checkbox}}" checked="checked">
|
171 |
+
</p>-->
|
172 |
+
<p class="form-field">
|
173 |
+
<label><?php esc_html_e('Name', 'woocommerce-checkout-manager'); ?></label>
|
174 |
+
<input class="short" type="text" name="cow" placeholder="<?php esc_html_e('MyField', 'woocommerce-checkout-manager'); ?>" value="{{data.cow}}" readonly="readonly">
|
175 |
+
<span class="description"><?php esc_html_e('To edit Abbreviations open General > Switches > Editing Of Abbreviation Fields.', 'woocommerce-checkout-manager'); ?></span>
|
176 |
+
</p>
|
177 |
+
</div>
|
178 |
+
<!--<div class="options_group">
|
179 |
+
<p class="form-field">
|
180 |
+
<label><?php esc_html_e('Position', 'woocommerce-checkout-manager'); ?></label>
|
181 |
+
<select class="select short" name="position">
|
182 |
+
<option <# if ( data.position == 'form-row-wide' ) { #>selected<# } #> value="form-row-wide"><?php esc_html_e('Wide', 'woocommerce-checkout-manager'); ?></option>
|
183 |
+
<option <# if ( data.position == 'form-row-first' ) { #>selected<# } #> value="form-row-first"><?php esc_html_e('Left', 'woocommerce-checkout-manager'); ?></option>
|
184 |
+
<option <# if ( data.position == 'form-row-last' ) { #>selected<# } #> value="form-row-last"><?php esc_html_e('Right', 'woocommerce-checkout-manager'); ?></option>
|
185 |
+
</select>
|
186 |
+
<span class="description"><?php esc_html_e('Placement of the checkout field.', 'woocommerce-checkout-manager'); ?></span>
|
187 |
+
</p>
|
188 |
+
<p class="form-field">
|
189 |
+
<label><?php esc_html_e('Clear', 'woocommerce-checkout-manager'); ?></label>
|
190 |
+
<input <# if ( data.clear_row == 'true' ) { #>checked<# } #> type="checkbox" name="clear_row" value="true">
|
191 |
+
<span class="description"><?php esc_html_e('Applies a clear fix to the checkout field.', 'woocommerce-checkout-manager'); ?></span>
|
192 |
+
</p>
|
193 |
+
<p class="form-field">
|
194 |
+
<label><?php esc_html_e('Extra class', 'woocommerce-checkout-manager'); ?></label>
|
195 |
+
<input class="short" type="text" name="extra_class" value="{{data.extra_class}}">
|
196 |
+
</p>
|
197 |
|