Funnel Builder by CartFlows – Create High Converting Sales Funnels For WordPress - Version 1.1.6

Version Description

Download this release

Release Info

Developer sandesh055
Plugin Icon Funnel Builder by CartFlows – Create High Converting Sales Funnels For WordPress
Version 1.1.6
Comparing to
See all releases

Code changes from version 1.1.5 to 1.1.6

Files changed (43) hide show
  1. admin/assets/css/global-admin-rtl.css +31 -2
  2. admin/assets/css/global-admin.css +30 -1
  3. admin/assets/js/flow-admin-edit.js +3 -1
  4. admin/meta-assets/css/admin-edit-rtl.css +5 -1
  5. admin/meta-assets/css/admin-edit.css +5 -1
  6. admin/meta-assets/js/admin-edit.js +90 -1
  7. assets/css/checkout-template-divi-rtl.css +78 -4
  8. assets/css/checkout-template-divi.css +76 -2
  9. assets/css/checkout-template-flatsome-rtl.css +127 -0
  10. assets/css/checkout-template-flatsome.css +127 -0
  11. assets/css/checkout-template-rtl.css +78 -8
  12. assets/css/checkout-template-the-seven-rtl.css +179 -0
  13. assets/css/checkout-template-the-seven.css +179 -0
  14. assets/css/checkout-template.css +77 -7
  15. assets/css/frontend-rtl.css +26 -0
  16. assets/css/frontend.css +26 -0
  17. assets/css/import-rtl.css +63 -0
  18. assets/css/import.css +63 -0
  19. assets/js/checkout-template.js +21 -7
  20. cartflows.php +24 -24
  21. changelog.txt +6 -0
  22. classes/class-cartflows-admin.php +437 -420
  23. classes/class-cartflows-compatibility.php +374 -355
  24. classes/class-cartflows-default-meta.php +838 -552
  25. classes/class-cartflows-frontend.php +402 -330
  26. classes/class-cartflows-functions.php +388 -387
  27. classes/class-cartflows-loader.php +419 -419
  28. classes/class-cartflows-meta-fields.php +1482 -989
  29. classes/class-cartflows-thrive-compatibility.php +77 -63
  30. languages/cartflows.pot +1346 -1156
  31. modules/checkout/classes/class-cartflows-checkout-markup.php +1109 -1033
  32. modules/flow/classes/class-cartflows-step-post-type.php +465 -450
  33. readme.txt +8 -1
  34. woocommerce/template/cart/cart-shipping.php +79 -0
  35. woocommerce/template/checkout/form-billing.php +80 -0
  36. woocommerce/template/checkout/form-checkout.php +64 -0
  37. woocommerce/template/checkout/form-coupon.php +42 -0
  38. woocommerce/template/checkout/form-login.php +36 -0
  39. woocommerce/template/checkout/review-order.php +113 -0
  40. woocommerce/template/checkout/thankyou.php +87 -0
  41. woocommerce/template/notices/error.php +35 -0
  42. woocommerce/template/notices/notice.php +34 -0
  43. woocommerce/template/notices/success.php +34 -0
admin/assets/css/global-admin-rtl.css CHANGED
@@ -487,6 +487,12 @@
487
  border-bottom: 1px #FF5050 solid !important;
488
  }
489
 
 
 
 
 
 
 
490
  #show_error {
491
  font-style: italic;
492
  color: #FF5050
@@ -629,9 +635,17 @@
629
  margin-right: 5px;
630
  }
631
 
632
- .wcf-cb-fields{
633
  width: 50%;
634
- float: right;
 
 
 
 
 
 
 
 
635
  }
636
 
637
  .wcf-cb-fields .wcf-field-row-heading,
@@ -805,6 +819,21 @@
805
 
806
  /**
807
  * ******************************
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
808
  * Device Responsive Css
809
  * ******************************
810
  */
487
  border-bottom: 1px #FF5050 solid !important;
488
  }
489
 
490
+ input[type="text"].error,
491
+ input[type="text"].error:focus{
492
+ border-color: red;
493
+ box-shadow: 0 0 2px rgba(30,140,190,0);
494
+ }
495
+
496
  #show_error {
497
  font-style: italic;
498
  color: #FF5050
635
  margin-right: 5px;
636
  }
637
 
638
+ /*.wcf-cb-fields{
639
  width: 50%;
640
+ float: left;
641
+ }*/
642
+
643
+ .wcf-cb-fields,
644
+ .wcf-sb-fields{
645
+ width: 50%;
646
+ display: inline-block;
647
+ position: relative;
648
+ vertical-align: top;
649
  }
650
 
651
  .wcf-cb-fields .wcf-field-row-heading,
819
 
820
  /**
821
  * ******************************
822
+ * Media Query for 768 Devices
823
+ * ******************************
824
+ */
825
+
826
+ @media only screen and (max-width: 768px) {
827
+ .wcf-cb-fields,
828
+ .wcf-sb-fields {
829
+ width: 100%;
830
+ display: block;
831
+ position: relative;
832
+ vertical-align: top;
833
+ }
834
+ }
835
+
836
+ /**
837
  * Device Responsive Css
838
  * ******************************
839
  */
admin/assets/css/global-admin.css CHANGED
@@ -487,6 +487,12 @@
487
  border-bottom: 1px #FF5050 solid !important;
488
  }
489
 
 
 
 
 
 
 
490
  #show_error {
491
  font-style: italic;
492
  color: #FF5050
@@ -629,9 +635,17 @@
629
  margin-left: 5px;
630
  }
631
 
632
- .wcf-cb-fields{
633
  width: 50%;
634
  float: left;
 
 
 
 
 
 
 
 
635
  }
636
 
637
  .wcf-cb-fields .wcf-field-row-heading,
@@ -805,6 +819,21 @@
805
 
806
  /**
807
  * ******************************
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
808
  * Device Responsive Css
809
  * ******************************
810
  */
487
  border-bottom: 1px #FF5050 solid !important;
488
  }
489
 
490
+ input[type="text"].error,
491
+ input[type="text"].error:focus{
492
+ border-color: red;
493
+ box-shadow: 0 0 2px rgba(30,140,190,0);
494
+ }
495
+
496
  #show_error {
497
  font-style: italic;
498
  color: #FF5050
635
  margin-left: 5px;
636
  }
637
 
638
+ /*.wcf-cb-fields{
639
  width: 50%;
640
  float: left;
641
+ }*/
642
+
643
+ .wcf-cb-fields,
644
+ .wcf-sb-fields{
645
+ width: 50%;
646
+ display: inline-block;
647
+ position: relative;
648
+ vertical-align: top;
649
  }
650
 
651
  .wcf-cb-fields .wcf-field-row-heading,
819
 
820
  /**
821
  * ******************************
822
+ * Media Query for 768 Devices
823
+ * ******************************
824
+ */
825
+
826
+ @media only screen and (max-width: 768px) {
827
+ .wcf-cb-fields,
828
+ .wcf-sb-fields {
829
+ width: 100%;
830
+ display: block;
831
+ position: relative;
832
+ vertical-align: top;
833
+ }
834
+ }
835
+
836
+ /**
837
  * Device Responsive Css
838
  * ******************************
839
  */
admin/assets/js/flow-admin-edit.js CHANGED
@@ -97,7 +97,9 @@
97
  $('.wcf-flow-settings .wcf-flow-steps-container').sortable({
98
 
99
  connectWith: '.wcf-flow-steps-container',
100
-
 
 
101
  update: function(event, ui) {
102
 
103
  var $this = $(this),
97
  $('.wcf-flow-settings .wcf-flow-steps-container').sortable({
98
 
99
  connectWith: '.wcf-flow-steps-container',
100
+ forcePlaceholderSize: true,
101
+ placeholder: "sortable-placeholder",
102
+
103
  update: function(event, ui) {
104
 
105
  var $this = $(this),
admin/meta-assets/css/admin-edit-rtl.css CHANGED
@@ -21,7 +21,7 @@
21
  }
22
 
23
  .wcf-tab-content.active {
24
- display: table;
25
  }
26
 
27
  /* Tab Footer */
@@ -178,6 +178,10 @@ body li.select2-results__option.select2-results__message {
178
  display: inline-block;
179
  }
180
 
 
 
 
 
181
  .wcf-cpf-row-setting-field {
182
  width: 75%;
183
  display: inline-block;
21
  }
22
 
23
  .wcf-tab-content.active {
24
+ display: block;
25
  }
26
 
27
  /* Tab Footer */
178
  display: inline-block;
179
  }
180
 
181
+ .wcf-cpf-row-setting-label i{
182
+ color: red;
183
+ }
184
+
185
  .wcf-cpf-row-setting-field {
186
  width: 75%;
187
  display: inline-block;
admin/meta-assets/css/admin-edit.css CHANGED
@@ -21,7 +21,7 @@
21
  }
22
 
23
  .wcf-tab-content.active {
24
- display: table;
25
  }
26
 
27
  /* Tab Footer */
@@ -178,6 +178,10 @@ body li.select2-results__option.select2-results__message {
178
  display: inline-block;
179
  }
180
 
 
 
 
 
181
  .wcf-cpf-row-setting-field {
182
  width: 75%;
183
  display: inline-block;
21
  }
22
 
23
  .wcf-tab-content.active {
24
+ display: block;
25
  }
26
 
27
  /* Tab Footer */
178
  display: inline-block;
179
  }
180
 
181
+ .wcf-cpf-row-setting-label i{
182
+ color: red;
183
+ }
184
+
185
  .wcf-cpf-row-setting-field {
186
  width: 75%;
187
  display: inline-block;
admin/meta-assets/js/admin-edit.js CHANGED
@@ -17,6 +17,8 @@
17
  _bind: function()
18
  {
19
  $( document ).on('click', '.wcf-cpf-add', CartFlowsAdminEdit._add_custom_field );
 
 
20
  $( document ).on('click', '.wcf-cpf-action-remove', CartFlowsAdminEdit._remove_custom_field );
21
 
22
  $( document ).on('change', '.wcf-field-font-family', CartFlowsAdminEdit._set_font_weight_select_options );
@@ -166,7 +168,11 @@
166
  post_id = $('#post_ID').val(),
167
  type = wrap.data('type'),
168
  key = wrap.data('key'),
169
- row = $this.parents('.wcf-field-row');
 
 
 
 
170
 
171
  var delete_status = confirm( "This action will delete this field. Are you sure?" );
172
  if (true == delete_status) {
@@ -244,6 +250,89 @@
244
  }, 1500);
245
 
246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  if( $('.wcf-field-row.field-'+data.field_args.name ).length ) {
248
  $('html, body').animate({
249
  scrollTop: $('.wcf-field-row.field-'+data.field_args.name ).offset().top
17
  _bind: function()
18
  {
19
  $( document ).on('click', '.wcf-cpf-add', CartFlowsAdminEdit._add_custom_field );
20
+ $( document ).on('click', '.wcf-pro-cpf-add', CartFlowsAdminEdit._add_pro_custom_field );
21
+
22
  $( document ).on('click', '.wcf-cpf-action-remove', CartFlowsAdminEdit._remove_custom_field );
23
 
24
  $( document ).on('change', '.wcf-field-font-family', CartFlowsAdminEdit._set_font_weight_select_options );
168
  post_id = $('#post_ID').val(),
169
  type = wrap.data('type'),
170
  key = wrap.data('key'),
171
+ row = $this.parents('.wcf-field-item-edit-active');
172
+
173
+ if( row.length < 1 ){
174
+ row = $this.parents('.wcf-field-row');
175
+ }
176
 
177
  var delete_status = confirm( "This action will delete this field. Are you sure?" );
178
  if (true == delete_status) {
250
  }, 1500);
251
 
252
 
253
+ if( $('.wcf-field-row.field-'+data.field_args.name ).length ) {
254
+ $('html, body').animate({
255
+ scrollTop: $('.wcf-field-row.field-'+data.field_args.name ).offset().top
256
+ }, 800);
257
+ }
258
+ }
259
+ }
260
+ });
261
+
262
+ },
263
+
264
+ _add_pro_custom_field: function(e) {
265
+
266
+ e.preventDefault();
267
+
268
+ var $this = $(this),
269
+ wrap = $this.closest('.wcf-cpf-wrap'),
270
+ post_id = $('#post_ID').val(),
271
+ add_to = wrap.find( '.wcf-cpf-fields.wcf-cpf-add_to select' ).val() || '',
272
+ type = wrap.find( '.wcf-cpf-fields.wcf-cpf-type select' ).val() || '',
273
+ options = wrap.find( '.wcf-cpf-fields.wcf-cpf-options textarea' ).val() || '',
274
+ label = wrap.find( '.wcf-cpf-fields.wcf-cpf-label input' ).val() || '',
275
+ width = wrap.find( '.wcf-cpf-fields.wcf-cpf-width select' ).val() || '',
276
+ placeholder = '',
277
+ is_required = wrap.find( '.wcf-cpf-fields.wcf-cpf-required input[type="checkbox"]:checked' ).val() || '';
278
+ default_value = '';
279
+ // name = wrap.find( '.wcf-cpf-fields.wcf-cpf-name input' ).val() || '';
280
+
281
+ if( 'checkbox' == type ){
282
+ default_value = wrap.find( '.wcf-cpf-fields.wcf-cpf-default select' ).val() || '';
283
+ }else{
284
+ default_value = wrap.find( '.wcf-cpf-fields.wcf-cpf-default input' ).val() || '';
285
+ }
286
+
287
+ if( 'select' != type ){
288
+ placeholder = wrap.find( '.wcf-cpf-fields.wcf-cpf-placeholder input' ).val() || '';
289
+ }
290
+
291
+ if( '' === label ) {
292
+ wrap.find( '.wcf-cpf-fields.wcf-cpf-label input' ).focus();
293
+ wrap.find( '.wcf-cpf-fields.wcf-cpf-label input' ).addClass('error');
294
+ wrap.find( '.wcf-cpf-fields.wcf-cpf-label #wcf-cpf-label-error-msg' ).text( ' This field is required' ).css( 'color', 'red' );
295
+ return;
296
+ }
297
+
298
+ // if( '' === name ) {
299
+ // wrap.find( '.wcf-cpf-fields.wcf-cpf-name input' ).focus();
300
+ // return;
301
+ // }
302
+
303
+ $this.addClass('updating-message').text('Adding Field..');
304
+
305
+ $.ajax({
306
+ url: wcf.ajax_url,
307
+ data: {
308
+ action : "wcf_pro_add_checkout_custom_field",
309
+ post_id : post_id,
310
+ add_to : add_to,
311
+ type : type,
312
+ options : options,
313
+ label : label,
314
+ // name : name,
315
+ placeholder : placeholder,
316
+ width : width,
317
+ default:default_value,
318
+ required: is_required,
319
+ security: cartflows_admin.wcf_pro_add_checkout_custom_field_nonce
320
+ },
321
+ dataType: 'json',
322
+ type: 'POST',
323
+ success: function ( data ) {
324
+ console.log(data);
325
+ if( $('.' + data.add_to_class ).length ) {
326
+ $('.' + data.add_to_class ).append( data.markup );
327
+
328
+ var new_row = $('.wcf-field-row.field-'+data.field_args.name );
329
+
330
+ $this.removeClass('updating-message').text('Added Field!');
331
+ setTimeout(function() {
332
+ $this.text('Add New Field');
333
+ }, 1500);
334
+
335
+
336
  if( $('.wcf-field-row.field-'+data.field_args.name ).length ) {
337
  $('html, body').animate({
338
  scrollTop: $('.wcf-field-row.field-'+data.field_args.name ).offset().top
assets/css/checkout-template-divi-rtl.css CHANGED
@@ -2,7 +2,7 @@
2
  display: inline-block;
3
  width: 55%;
4
  float: right;
5
- padding-left: 00px;
6
  margin: 50px 0 0;
7
  }
8
 
@@ -23,7 +23,9 @@
23
  background-color: #fff;
24
  background-image: none;
25
  border: 1px solid #d4d4d4;
 
26
  border-radius: 3px;
 
27
  box-shadow: none;
28
  }
29
 
@@ -43,15 +45,82 @@
43
  margin-bottom: 8px;
44
  }
45
 
46
- .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked,
 
47
  .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:not(:checked){
48
  color: #666;
49
  cursor: pointer;
50
  display: inline;
51
  line-height: 20px;
52
- margin-left: 10px;
53
  position: relative;
54
- padding-right: 28px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
 
57
  .et_pb_module #wcf-embed-checkout-form .woocommerce-additional-fields > h3,
@@ -108,6 +177,11 @@
108
  }
109
 
110
  .et_pb_module #wcf-embed-checkout-form .wcf-custom-coupon-field{
 
 
 
 
 
111
  display: flex;
112
  margin-bottom: 25px;
113
  margin-top: 25px;
2
  display: inline-block;
3
  width: 55%;
4
  float: right;
5
+ padding-left: 40px;
6
  margin: 50px 0 0;
7
  }
8
 
23
  background-color: #fff;
24
  background-image: none;
25
  border: 1px solid #d4d4d4;
26
+ -webkit-border-radius: 3px;
27
  border-radius: 3px;
28
+ -webkit-box-shadow: none;
29
  box-shadow: none;
30
  }
31
 
45
  margin-bottom: 8px;
46
  }
47
 
48
+
49
+ /*.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked,
50
  .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:not(:checked){
51
  color: #666;
52
  cursor: pointer;
53
  display: inline;
54
  line-height: 20px;
55
+ margin-right: 10px;
56
  position: relative;
57
+ padding-left: 28px;
58
+ }*/
59
+
60
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
61
+ .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before{
62
+ content: "\f147";
63
+ margin: -3px -4px 0 0;
64
+ color: #F16334;
65
+ }
66
+
67
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],
68
+ .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"],
69
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]{
70
+ border: 1px solid #b4b9be;
71
+ background: #fff;
72
+ color: #555;
73
+ clear: none;
74
+ cursor: pointer;
75
+ display: inline-block;
76
+ line-height: 0;
77
+ height: 16px;
78
+ margin: -4px 0 0 4px;
79
+ outline: 0;
80
+ padding: 0!important;
81
+ text-align: center;
82
+ vertical-align: middle;
83
+ width: 16px;
84
+ min-width: 16px;
85
+ -webkit-appearance: none;
86
+ -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
87
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
88
+ -webkit-transition: .05s border-color ease-in-out;
89
+ transition: .05s border-color ease-in-out;
90
+ }
91
+
92
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,
93
+ .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:focus,
94
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus{
95
+ border-color: #F16334;
96
+ -webkit-box-shadow: 0 0 2px rgba(241, 99, 52,.8);
97
+ box-shadow: 0 0 2px rgba(241, 99, 52,.8);
98
+ }
99
+
100
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
101
+ background-color: #F16334;
102
+ -webkit-border-radius: 50px;
103
+ border-radius: 50px;
104
+ content: "\2022";
105
+ font-size: 24px;
106
+ height: 6px;
107
+ line-height: 16px;
108
+ margin: 4px;
109
+ text-indent: -9999px;
110
+ width: 6px;
111
+ }
112
+
113
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
114
+ .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before,
115
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
116
+ display: inline-block;
117
+ float: right;
118
+ font: normal 21px/1 dashicons;
119
+ speak: none;
120
+ vertical-align: middle;
121
+ width: 6px;
122
+ -webkit-font-smoothing: antialiased;
123
+ -moz-osx-font-smoothing: grayscale;
124
  }
125
 
126
  .et_pb_module #wcf-embed-checkout-form .woocommerce-additional-fields > h3,
177
  }
178
 
179
  .et_pb_module #wcf-embed-checkout-form .wcf-custom-coupon-field{
180
+ -js-display: flex;
181
+ display: -webkit-box;
182
+ display: -webkit-flex;
183
+ display: -moz-box;
184
+ display: -ms-flexbox;
185
  display: flex;
186
  margin-bottom: 25px;
187
  margin-top: 25px;
assets/css/checkout-template-divi.css CHANGED
@@ -2,7 +2,7 @@
2
  display: inline-block;
3
  width: 55%;
4
  float: left;
5
- padding-right: 00px;
6
  margin: 50px 0 0;
7
  }
8
 
@@ -23,7 +23,9 @@
23
  background-color: #fff;
24
  background-image: none;
25
  border: 1px solid #d4d4d4;
 
26
  border-radius: 3px;
 
27
  box-shadow: none;
28
  }
29
 
@@ -43,7 +45,8 @@
43
  margin-bottom: 8px;
44
  }
45
 
46
- .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked,
 
47
  .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:not(:checked){
48
  color: #666;
49
  cursor: pointer;
@@ -52,6 +55,72 @@
52
  margin-right: 10px;
53
  position: relative;
54
  padding-left: 28px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
 
57
  .et_pb_module #wcf-embed-checkout-form .woocommerce-additional-fields > h3,
@@ -108,6 +177,11 @@
108
  }
109
 
110
  .et_pb_module #wcf-embed-checkout-form .wcf-custom-coupon-field{
 
 
 
 
 
111
  display: flex;
112
  margin-bottom: 25px;
113
  margin-top: 25px;
2
  display: inline-block;
3
  width: 55%;
4
  float: left;
5
+ padding-right: 40px;
6
  margin: 50px 0 0;
7
  }
8
 
23
  background-color: #fff;
24
  background-image: none;
25
  border: 1px solid #d4d4d4;
26
+ -webkit-border-radius: 3px;
27
  border-radius: 3px;
28
+ -webkit-box-shadow: none;
29
  box-shadow: none;
30
  }
31
 
45
  margin-bottom: 8px;
46
  }
47
 
48
+
49
+ /*.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked,
50
  .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:not(:checked){
51
  color: #666;
52
  cursor: pointer;
55
  margin-right: 10px;
56
  position: relative;
57
  padding-left: 28px;
58
+ }*/
59
+
60
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
61
+ .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before{
62
+ content: "\f147";
63
+ margin: -3px 0 0 -4px;
64
+ color: #F16334;
65
+ }
66
+
67
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],
68
+ .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"],
69
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]{
70
+ border: 1px solid #b4b9be;
71
+ background: #fff;
72
+ color: #555;
73
+ clear: none;
74
+ cursor: pointer;
75
+ display: inline-block;
76
+ line-height: 0;
77
+ height: 16px;
78
+ margin: -4px 4px 0 0;
79
+ outline: 0;
80
+ padding: 0!important;
81
+ text-align: center;
82
+ vertical-align: middle;
83
+ width: 16px;
84
+ min-width: 16px;
85
+ -webkit-appearance: none;
86
+ -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
87
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
88
+ -webkit-transition: .05s border-color ease-in-out;
89
+ transition: .05s border-color ease-in-out;
90
+ }
91
+
92
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,
93
+ .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:focus,
94
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus{
95
+ border-color: #F16334;
96
+ -webkit-box-shadow: 0 0 2px rgba(241, 99, 52,.8);
97
+ box-shadow: 0 0 2px rgba(241, 99, 52,.8);
98
+ }
99
+
100
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
101
+ background-color: #F16334;
102
+ -webkit-border-radius: 50px;
103
+ border-radius: 50px;
104
+ content: "\2022";
105
+ font-size: 24px;
106
+ height: 6px;
107
+ line-height: 16px;
108
+ margin: 4px;
109
+ text-indent: -9999px;
110
+ width: 6px;
111
+ }
112
+
113
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
114
+ .et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before,
115
+ .et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
116
+ display: inline-block;
117
+ float: left;
118
+ font: normal 21px/1 dashicons;
119
+ speak: none;
120
+ vertical-align: middle;
121
+ width: 6px;
122
+ -webkit-font-smoothing: antialiased;
123
+ -moz-osx-font-smoothing: grayscale;
124
  }
125
 
126
  .et_pb_module #wcf-embed-checkout-form .woocommerce-additional-fields > h3,
177
  }
178
 
179
  .et_pb_module #wcf-embed-checkout-form .wcf-custom-coupon-field{
180
+ -js-display: flex;
181
+ display: -webkit-box;
182
+ display: -webkit-flex;
183
+ display: -moz-box;
184
+ display: -ms-flexbox;
185
  display: flex;
186
  margin-bottom: 25px;
187
  margin-top: 25px;
assets/css/checkout-template-flatsome-rtl.css ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * *************************
3
+ * This css is loaded when when the flatsome theme is enabled.
4
+ * Just to add correct the layout of the page.
5
+ * *************************
6
+ */
7
+
8
+ /* Basic */
9
+
10
+ .absolute-footer, html{
11
+ background-color: unset;
12
+ font-family: inherit;
13
+ }
14
+
15
+ body{
16
+ color: #404040;
17
+ font-family: inherit;
18
+ line-height: 1.5;
19
+ }
20
+
21
+ b, strong{
22
+ font-weight: bold;
23
+ }
24
+
25
+ .woocommerce-billing-fields{
26
+ padding-top: 0;
27
+ border-top: unset;
28
+ }
29
+
30
+ .button, button, input, textarea, select, fieldset{
31
+ margin-bottom:inherit;
32
+ }
33
+
34
+ .wcf-embed-checkout-form .woocommerce form .form-row input.input-text,
35
+ .wcf-embed-checkout-form .woocommerce form .form-row textarea,
36
+ .wcf-embed-checkout-form .woocommerce form .form-row select,
37
+ .wcf-embed-checkout-form .woocommerce #order_review .input-text{
38
+ height: auto;
39
+ }
40
+
41
+ #ship-to-different-address label{
42
+ font-weight: inherit;
43
+ }
44
+
45
+ .shop_table tfoot th,
46
+ th, td{
47
+ color: inherit;
48
+ font-size: inherit;
49
+ letter-spacing: inherit;
50
+ text-transform: inherit;
51
+ text-align: inherit;
52
+ }
53
+ span.amount{
54
+ white-space: inherit;
55
+ color: inherit;
56
+ font-weight: inherit;
57
+ }
58
+
59
+ td.product-total,
60
+ .shop_table tfoot tr td,
61
+ .cart_totals tbody tr td,
62
+ .shop_table thead tr th:last-of-type,
63
+ .shop_table tr td:last-of-type{
64
+ text-align: inherit;
65
+ }
66
+
67
+ .shipping__table--multiple th,
68
+ .shipping__table--multiple td{
69
+ display: table-cell;
70
+ width: 50%;
71
+ }
72
+
73
+ .shipping__table--multiple{
74
+ display: block;
75
+ text-align: inherit;
76
+ }
77
+
78
+ tr.shipping input:checked+label{
79
+ font-weight: normal;
80
+ }
81
+
82
+ .widget_shopping_cart_content .blockUI.blockOverlay::before,
83
+ .woocommerce-checkout-review-order .blockUI.blockOverlay::before{
84
+ border-top: inherit !important;
85
+ border-left: inherit !important;
86
+ border-bottom: inherit !important;
87
+ border-right: inherit !important;
88
+ }
89
+
90
+ label, legend{
91
+ color: inherit;
92
+ font-weight: inherit;
93
+ font-size: inherit;
94
+ }
95
+
96
+ .payment_methods p{
97
+ font-size: inherit;
98
+ }
99
+
100
+ .payment_methods li+li {
101
+ padding-top: 0;
102
+ border-top: unset;
103
+ }
104
+
105
+ .wcf-embed-checkout-form .woocommerce-privacy-policy-text{
106
+ font-size: inherit;
107
+ }
108
+
109
+ .wcf-embed-checkout-form .woocommerce-privacy-policy-text p{
110
+ color: #444;
111
+ font-family: inherit;
112
+ font-weight: inherit;
113
+ margin-top: 1rem;
114
+
115
+ }
116
+
117
+ .form-row .select2-container{
118
+ margin-bottom: inherit;
119
+ }
120
+
121
+ @media only screen and (max-width: 768px) {
122
+
123
+ #billing_address_2_field>label{
124
+ opacity: 1;
125
+ overflow: visible;
126
+ }
127
+ }
assets/css/checkout-template-flatsome.css ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * *************************
3
+ * This css is loaded when when the flatsome theme is enabled.
4
+ * Just to add correct the layout of the page.
5
+ * *************************
6
+ */
7
+
8
+ /* Basic */
9
+
10
+ .absolute-footer, html{
11
+ background-color: unset;
12
+ font-family: inherit;
13
+ }
14
+
15
+ body{
16
+ color: #404040;
17
+ font-family: inherit;
18
+ line-height: 1.5;
19
+ }
20
+
21
+ b, strong{
22
+ font-weight: bold;
23
+ }
24
+
25
+ .woocommerce-billing-fields{
26
+ padding-top: 0;
27
+ border-top: unset;
28
+ }
29
+
30
+ .button, button, input, textarea, select, fieldset{
31
+ margin-bottom:inherit;
32
+ }
33
+
34
+ .wcf-embed-checkout-form .woocommerce form .form-row input.input-text,
35
+ .wcf-embed-checkout-form .woocommerce form .form-row textarea,
36
+ .wcf-embed-checkout-form .woocommerce form .form-row select,
37
+ .wcf-embed-checkout-form .woocommerce #order_review .input-text{
38
+ height: auto;
39
+ }
40
+
41
+ #ship-to-different-address label{
42
+ font-weight: inherit;
43
+ }
44
+
45
+ .shop_table tfoot th,
46
+ th, td{
47
+ color: inherit;
48
+ font-size: inherit;
49
+ letter-spacing: inherit;
50
+ text-transform: inherit;
51
+ text-align: inherit;
52
+ }
53
+ span.amount{
54
+ white-space: inherit;
55
+ color: inherit;
56
+ font-weight: inherit;
57
+ }
58
+
59
+ td.product-total,
60
+ .shop_table tfoot tr td,
61
+ .cart_totals tbody tr td,
62
+ .shop_table thead tr th:last-of-type,
63
+ .shop_table tr td:last-of-type{
64
+ text-align: inherit;
65
+ }
66
+
67
+ .shipping__table--multiple th,
68
+ .shipping__table--multiple td{
69
+ display: table-cell;
70
+ width: 50%;
71
+ }
72
+
73
+ .shipping__table--multiple{
74
+ display: block;
75
+ text-align: inherit;
76
+ }
77
+
78
+ tr.shipping input:checked+label{
79
+ font-weight: normal;
80
+ }
81
+
82
+ .widget_shopping_cart_content .blockUI.blockOverlay::before,
83
+ .woocommerce-checkout-review-order .blockUI.blockOverlay::before{
84
+ border-top: inherit !important;
85
+ border-right: inherit !important;
86
+ border-bottom: inherit !important;
87
+ border-left: inherit !important;
88
+ }
89
+
90
+ label, legend{
91
+ color: inherit;
92
+ font-weight: inherit;
93
+ font-size: inherit;
94
+ }
95
+
96
+ .payment_methods p{
97
+ font-size: inherit;
98
+ }
99
+
100
+ .payment_methods li+li {
101
+ padding-top: 0;
102
+ border-top: unset;
103
+ }
104
+
105
+ .wcf-embed-checkout-form .woocommerce-privacy-policy-text{
106
+ font-size: inherit;
107
+ }
108
+
109
+ .wcf-embed-checkout-form .woocommerce-privacy-policy-text p{
110
+ color: #444;
111
+ font-family: inherit;
112
+ font-weight: inherit;
113
+ margin-top: 1rem;
114
+
115
+ }
116
+
117
+ .form-row .select2-container{
118
+ margin-bottom: inherit;
119
+ }
120
+
121
+ @media only screen and (max-width: 768px) {
122
+
123
+ #billing_address_2_field>label{
124
+ opacity: 1;
125
+ overflow: visible;
126
+ }
127
+ }
assets/css/checkout-template-rtl.css CHANGED
@@ -6,6 +6,8 @@
6
 
7
  .cartflows-container .wcf-embed-checkout-form,
8
  .cartflows-container .wcf-embed-checkout-form * {
 
 
9
  box-sizing: border-box;
10
  }
11
 
@@ -17,7 +19,8 @@
17
  .wcf-embed-checkout-form .woocommerce form .form-row-last,
18
  .wcf-embed-checkout-form .woocommerce-page form .form-row-first,
19
  .wcf-embed-checkout-form .woocommerce-page form .form-row-last{
20
- width: 48%;
 
21
  }
22
 
23
  .wcf-embed-checkout-form .woocommerce form .form-row-full,
@@ -26,13 +29,23 @@
26
  clear: both;
27
  }
28
 
 
 
 
 
 
 
 
 
29
  /* To test divi and all */
30
  .wcf-embed-checkout-form .woocommerce form .form-row-first, .woocommerce-page form .form-row-first{
31
  float: right;
 
32
  }
33
 
34
  .wcf-embed-checkout-form .woocommerce form .form-row-last, .woocommerce-page form .form-row-last{
35
  float: left;
 
36
  }
37
 
38
  .wcf-embed-checkout-form .woocommerce form .form-row .required{
@@ -49,7 +62,7 @@
49
  }
50
 
51
  .wcf-embed-checkout-form form .wcf-form-col-3{
52
- width: 33.33%;
53
  float: right;
54
  clear: unset;
55
  }
@@ -130,11 +143,13 @@
130
  * ************************
131
  */
132
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]{
 
133
  border-radius: 50%;
134
  margin-left: 4px;
135
  line-height: 10px;
136
  }
137
 
 
138
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
139
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before{
140
  content: "\f147";
@@ -142,6 +157,7 @@
142
  color: #F16334;
143
  }
144
 
 
145
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],
146
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"],
147
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]{
@@ -161,19 +177,24 @@
161
  width: 16px;
162
  min-width: 16px;
163
  -webkit-appearance: none;
 
164
  box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
 
165
  transition: .05s border-color ease-in-out;
166
  }
167
 
 
168
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,
169
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:focus,
170
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus{
171
  border-color: #F16334;
 
172
  box-shadow: 0 0 2px rgba(241, 99, 52,.8);
173
  }
174
 
175
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
176
  background-color: #F16334;
 
177
  border-radius: 50px;
178
  content: "\2022";
179
  font-size: 24px;
@@ -183,7 +204,7 @@
183
  text-indent: -9999px;
184
  width: 6px;
185
  }
186
-
187
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
188
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before,
189
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
@@ -209,6 +230,7 @@
209
  float: none;
210
  width: 100%;
211
  padding: 0px;
 
212
  border-radius: 0px;
213
  border: none;
214
  border-color: none;
@@ -229,6 +251,7 @@
229
 
230
  .wcf-embed-checkout-form .woocommerce-checkout #payment {
231
  background: unset;
 
232
  border-radius: 0;
233
  }
234
 
@@ -293,7 +316,9 @@
293
  background-image: none;
294
  border: 1px solid;
295
  border-color: #d4d4d4;
 
296
  border-radius: 3px;
 
297
  box-shadow: none;
298
  outline: none;
299
  }
@@ -334,7 +359,9 @@
334
  background-color: #fff;
335
  background-image: none;
336
  border: 1px solid #d4d4d4;
 
337
  border-radius: 3px;
 
338
  box-shadow: none;
339
  }
340
 
@@ -347,6 +374,11 @@
347
  }
348
 
349
  .wcf-embed-checkout-form .wcf-custom-coupon-field {
 
 
 
 
 
350
  display: flex;
351
  margin-bottom: 15px;
352
  margin-top: 25px;
@@ -373,6 +405,7 @@
373
  .wcf-embed-checkout-form textarea:focus,
374
  .wcf-embed-checkout-form .select2-container--open {
375
  border-color: #b3b3b3;
 
376
  box-shadow: none;
377
  outline: none;
378
  }
@@ -412,6 +445,7 @@
412
  padding: 16px 24px;
413
  font-size: 16px;
414
  line-height: 1.5;
 
415
  border-radius: 3px;
416
  color: #fff;
417
  text-transform: uppercase;
@@ -452,6 +486,26 @@
452
  margin:20px 0 0;
453
  }
454
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
  .wcf-embed-checkout-form-two-column .woocommerce-checkout .wcf-order-wrap{
456
  display: inline-block;
457
  float: none;
@@ -459,6 +513,7 @@
459
  border: none;
460
  background-color: inherit/*#F6F6F6*/;
461
  padding: 0 10px;
 
462
  border-radius: 3px;
463
  }
464
 
@@ -477,6 +532,7 @@
477
  background-color: inherit;
478
  border:none;
479
  /*border-top: 1px solid;*/
 
480
  border-radius: 0px;
481
  /*border-color: #dcdcdc;*/
482
  /*padding-top: 20px;*/
@@ -492,18 +548,20 @@
492
  border: none;
493
  }
494
 
495
- .wcf-embed-checkout-form .woocommerce form .form-row-wide, .woocommerce-page form .form-row-wide{
496
  clear: both;
497
- }
498
 
499
  .wcf-embed-checkout-form .woocommerce form .form-row{
500
  margin-bottom: 1.1em;
 
501
  }
502
 
503
  .wcf-embed-checkout-form table.shop_table {
504
  border:none;
505
  border-bottom: 0;
506
  background-color: inherit;
 
507
  border-radius: 0;
508
  font-family: inherit;
509
  font-weight:inherit;
@@ -577,6 +635,17 @@
577
  vertical-align: top;
578
  }
579
 
 
 
 
 
 
 
 
 
 
 
 
580
  .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label,
581
  .wcf-embed-checkout-form .woocommerce-checkout .form-row label{
582
  font-size: 13px;
@@ -664,6 +733,7 @@
664
  padding: 30px 20px 20px;
665
  margin: 2em 0;
666
  text-align: right;
 
667
  border-radius: 5px;
668
  }
669
 
@@ -726,10 +796,10 @@
726
  width: 100%;
727
  }
728
 
729
- .wcf-embed-checkout-form .woocommerce form .form-row-first,
730
  .wcf-embed-checkout-form .woocommerce-page form .form-row-first{
731
- margin-left: 4%;
732
- }
733
 
734
  .wcf-embed-checkout-form .woocommerce-additional-fields > h3,
735
  .wcf-embed-checkout-form .woocommerce-billing-fields > h3,
6
 
7
  .cartflows-container .wcf-embed-checkout-form,
8
  .cartflows-container .wcf-embed-checkout-form * {
9
+ -webkit-box-sizing: border-box;
10
+ -moz-box-sizing: border-box;
11
  box-sizing: border-box;
12
  }
13
 
19
  .wcf-embed-checkout-form .woocommerce form .form-row-last,
20
  .wcf-embed-checkout-form .woocommerce-page form .form-row-first,
21
  .wcf-embed-checkout-form .woocommerce-page form .form-row-last{
22
+ width: 50%;
23
+ display: block;
24
  }
25
 
26
  .wcf-embed-checkout-form .woocommerce form .form-row-full,
29
  clear: both;
30
  }
31
 
32
+ .wcf-embed-checkout-form form .form-row-wide{
33
+ width: 100%;
34
+ }
35
+
36
+ .wcf-embed-checkout-form form .wcf-column-33{
37
+ width: 33.33%;
38
+ }
39
+
40
  /* To test divi and all */
41
  .wcf-embed-checkout-form .woocommerce form .form-row-first, .woocommerce-page form .form-row-first{
42
  float: right;
43
+ clear: right;
44
  }
45
 
46
  .wcf-embed-checkout-form .woocommerce form .form-row-last, .woocommerce-page form .form-row-last{
47
  float: left;
48
+ clear: left;
49
  }
50
 
51
  .wcf-embed-checkout-form .woocommerce form .form-row .required{
62
  }
63
 
64
  .wcf-embed-checkout-form form .wcf-form-col-3{
65
+ width: 32%;
66
  float: right;
67
  clear: unset;
68
  }
143
  * ************************
144
  */
145
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]{
146
+ -webkit-border-radius: 50%;
147
  border-radius: 50%;
148
  margin-left: 4px;
149
  line-height: 10px;
150
  }
151
 
152
+ .wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type="checkbox"]:checked:before,
153
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
154
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before{
155
  content: "\f147";
157
  color: #F16334;
158
  }
159
 
160
+ .wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type="checkbox"],
161
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],
162
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"],
163
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]{
177
  width: 16px;
178
  min-width: 16px;
179
  -webkit-appearance: none;
180
+ -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
181
  box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
182
+ -webkit-transition: .05s border-color ease-in-out;
183
  transition: .05s border-color ease-in-out;
184
  }
185
 
186
+ .wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type="checkbox"]:focus,
187
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,
188
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:focus,
189
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus{
190
  border-color: #F16334;
191
+ -webkit-box-shadow: 0 0 2px rgba(241, 99, 52,.8);
192
  box-shadow: 0 0 2px rgba(241, 99, 52,.8);
193
  }
194
 
195
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
196
  background-color: #F16334;
197
+ -webkit-border-radius: 50px;
198
  border-radius: 50px;
199
  content: "\2022";
200
  font-size: 24px;
204
  text-indent: -9999px;
205
  width: 6px;
206
  }
207
+ .wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type="checkbox"]:checked:before,
208
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
209
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before,
210
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
230
  float: none;
231
  width: 100%;
232
  padding: 0px;
233
+ -webkit-border-radius: 0px;
234
  border-radius: 0px;
235
  border: none;
236
  border-color: none;
251
 
252
  .wcf-embed-checkout-form .woocommerce-checkout #payment {
253
  background: unset;
254
+ -webkit-border-radius: 0;
255
  border-radius: 0;
256
  }
257
 
316
  background-image: none;
317
  border: 1px solid;
318
  border-color: #d4d4d4;
319
+ -webkit-border-radius: 3px;
320
  border-radius: 3px;
321
+ -webkit-box-shadow: none;
322
  box-shadow: none;
323
  outline: none;
324
  }
359
  background-color: #fff;
360
  background-image: none;
361
  border: 1px solid #d4d4d4;
362
+ -webkit-border-radius: 3px;
363
  border-radius: 3px;
364
+ -webkit-box-shadow: none;
365
  box-shadow: none;
366
  }
367
 
374
  }
375
 
376
  .wcf-embed-checkout-form .wcf-custom-coupon-field {
377
+ -js-display: flex;
378
+ display: -webkit-box;
379
+ display: -webkit-flex;
380
+ display: -moz-box;
381
+ display: -ms-flexbox;
382
  display: flex;
383
  margin-bottom: 15px;
384
  margin-top: 25px;
405
  .wcf-embed-checkout-form textarea:focus,
406
  .wcf-embed-checkout-form .select2-container--open {
407
  border-color: #b3b3b3;
408
+ -webkit-box-shadow: none;
409
  box-shadow: none;
410
  outline: none;
411
  }
445
  padding: 16px 24px;
446
  font-size: 16px;
447
  line-height: 1.5;
448
+ -webkit-border-radius: 3px;
449
  border-radius: 3px;
450
  color: #fff;
451
  text-transform: uppercase;
486
  margin:20px 0 0;
487
  }
488
 
489
+ .wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,
490
+ .wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{
491
+ margin: 0 -7px;
492
+ -ms-flex-wrap: wrap;
493
+ flex-wrap: wrap;
494
+ -js-display: flex;
495
+ display: -webkit-box;
496
+ display: -moz-box;
497
+ display: -ms-flexbox;
498
+ display: flex;
499
+ display: -webkit-flex; /* Safari 6.1+, firefox, chrome */
500
+ flex-wrap: wrap;
501
+ -webkit-flex-wrap: wrap; /* Safari 6.1+, firefox, chrome*/
502
+
503
+ }
504
+
505
+ .wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper{
506
+ margin: 0px -7px;
507
+ }
508
+
509
  .wcf-embed-checkout-form-two-column .woocommerce-checkout .wcf-order-wrap{
510
  display: inline-block;
511
  float: none;
513
  border: none;
514
  background-color: inherit/*#F6F6F6*/;
515
  padding: 0 10px;
516
+ -webkit-border-radius: 3px;
517
  border-radius: 3px;
518
  }
519
 
532
  background-color: inherit;
533
  border:none;
534
  /*border-top: 1px solid;*/
535
+ -webkit-border-radius: 0px;
536
  border-radius: 0px;
537
  /*border-color: #dcdcdc;*/
538
  /*padding-top: 20px;*/
548
  border: none;
549
  }
550
 
551
+ /*.wcf-embed-checkout-form .woocommerce form .form-row-wide, .woocommerce-page form .form-row-wide{
552
  clear: both;
553
+ }*/
554
 
555
  .wcf-embed-checkout-form .woocommerce form .form-row{
556
  margin-bottom: 1.1em;
557
+ padding: 3px 7px;
558
  }
559
 
560
  .wcf-embed-checkout-form table.shop_table {
561
  border:none;
562
  border-bottom: 0;
563
  background-color: inherit;
564
+ -webkit-border-radius: 0;
565
  border-radius: 0;
566
  font-family: inherit;
567
  font-weight:inherit;
635
  vertical-align: top;
636
  }
637
 
638
+ .wcf-embed-checkout-form table.shop_table thead tr th:nth-child(1),
639
+ .wcf-embed-checkout-form table.shop_table tbody tr td:nth-child(1),
640
+ .wcf-embed-checkout-form table.shop_table tfoot tr td:nth-child(1){
641
+ width: 70%;
642
+ }
643
+ .wcf-embed-checkout-form table.shop_table thead tr th:nth-child(2),
644
+ .wcf-embed-checkout-form table.shop_table tbody tr td:nth-child(2),
645
+ .wcf-embed-checkout-form table.shop_table tfoot tr td:nth-child(2){
646
+ width: 30%;
647
+ }
648
+
649
  .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label,
650
  .wcf-embed-checkout-form .woocommerce-checkout .form-row label{
651
  font-size: 13px;
733
  padding: 30px 20px 20px;
734
  margin: 2em 0;
735
  text-align: right;
736
+ -webkit-border-radius: 5px;
737
  border-radius: 5px;
738
  }
739
 
796
  width: 100%;
797
  }
798
 
799
+ /*.wcf-embed-checkout-form .woocommerce form .form-row-first,
800
  .wcf-embed-checkout-form .woocommerce-page form .form-row-first{
801
+ margin-right: 4%;
802
+ }*/
803
 
804
  .wcf-embed-checkout-form .woocommerce-additional-fields > h3,
805
  .wcf-embed-checkout-form .woocommerce-billing-fields > h3,
assets/css/checkout-template-the-seven-rtl.css ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * *************************
3
+ * This css is loaded when when the The7 theme is enabled.
4
+ * Just to correct layout of the page.
5
+ * *************************
6
+ */
7
+
8
+ /* Basic */
9
+
10
+ body,
11
+ button,
12
+ input,
13
+ select,
14
+ optgroup,
15
+ textarea,
16
+ body.page,
17
+ .wf-container > *{
18
+ font-family: normal 1rem / 2 "sans-serif", Helvetica, Arial, Verdana, sans-serif ;
19
+ font-size: inherit;
20
+ }
21
+
22
+ .wcf-embed-checkout-form-one-column #customer_details{
23
+ width: 100%;
24
+ }
25
+ .wcf-embed-checkout-form-two-column #customer_details{
26
+ width: 55%;
27
+ }
28
+
29
+ input[type="text"],
30
+ input[type="search"],
31
+ input[type="tel"],
32
+ input[type="url"],
33
+ input[type="email"],
34
+ input[type="number"],
35
+ input[type="date"],
36
+ input[type="range"],
37
+ input[type="password"],
38
+ select,
39
+ .wpcf7-number{
40
+ height: auto;
41
+ }
42
+
43
+ #ship-to-different-address{
44
+ font: inherit;
45
+ }
46
+
47
+ #ship-to-different-address label, .create-account label.checkbox span{
48
+ font-size: inherit;
49
+ line-height: inherit;
50
+ }
51
+
52
+ .woocommerce-checkout-review-order .product-name,
53
+ .woocommerce-checkout-review-order .product-name a,
54
+ .order_details .product-name,
55
+ .order_details .product-name a{
56
+ font: inherit;
57
+ font-size: inherit;
58
+ color: inherit;
59
+ }
60
+ .woocommerce-checkout-review-order .product-quantity,
61
+ .woocommerce-checkout-review-order .product-total,
62
+ .woocommerce-checkout-review-order .cart-subtotal th,
63
+ .woocommerce-checkout-review-order .order-total th,
64
+ .woocommerce-checkout-review-order .shipping th,
65
+ .woocommerce-checkout-review-order .about_paypal,
66
+ .woocommerce-checkout-review-order .product-total .woocommerce-Price-amount,
67
+ .woocommerce-checkout-review-order tfoot th,
68
+ .order_details .product-quantity,
69
+ .order_details .product-total,
70
+ .order_details .cart-subtotal th,
71
+ .order_details .order-total th,
72
+ .order_details .shipping th,
73
+ .order_details .about_paypal,
74
+ .order_details .product-total .woocommerce-Price-amount,
75
+ .order_details tfoot th{
76
+ color: inherit;
77
+ }
78
+
79
+ #shipping_method label, .payment_methods label{
80
+ color: inherit;
81
+ font-size: inherit;
82
+ line-height: inherit;
83
+ }
84
+
85
+ .woocommerce-terms-and-conditions-text,
86
+ .woocommerce-terms-and-conditions-checkbox-text,
87
+ .woocommerce-privacy-policy-text{
88
+ font-size: inherit;
89
+ line-height: inherit;
90
+ }
91
+
92
+ div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content) > .woocommerce-message .woocommerce-message-text,
93
+ div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content) > .woocommerce-message .woocommerce-info-text,
94
+ div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content) > .woocommerce-message .woocommerce-error-text,
95
+ .woocommerce-error .woocommerce-message-text,
96
+ .woocommerce-error .woocommerce-info-text,
97
+ .woocommerce-error .woocommerce-error-text,
98
+ div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content) > .woocommerce-info .woocommerce-message-text,
99
+ div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content) > .woocommerce-info .woocommerce-info-text,
100
+ div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content) > .woocommerce-info .woocommerce-error-text{
101
+ font: inherit;
102
+ }
103
+
104
+ .checkout .woocommerce-NoticeGroup .woocommerce-error .woocommerce-error-text{
105
+ margin: 0px;
106
+ padding-right: 0px;
107
+ }
108
+
109
+ table.shop_table thead tr th,
110
+ table.shop_table thead tr td,
111
+ table.shop_table tbody tr th,
112
+ table.shop_table tbody tr td{
113
+ border: none;
114
+ font-weight: normal;
115
+ width: 50%;
116
+ }
117
+
118
+ @media screen and (max-width: 990px){
119
+ #customer_details{
120
+ width: 100%;
121
+ }
122
+ .mt20{
123
+ margin-top: 10px!important;
124
+ }
125
+ }
126
+
127
+ @media only screen and (max-width: 768px){
128
+ #customer_details{
129
+ width: 100%;
130
+ }
131
+ .mt20{
132
+ margin-top: 10px!important;
133
+ }
134
+ }
135
+
136
+ @media screen and (max-width: 600px){
137
+
138
+ #customer_details{
139
+ width: 100%;
140
+ }
141
+
142
+ table.shop_table tbody tr{
143
+ padding: 0px;
144
+ }
145
+ .shop_table tr {
146
+ border-top: inherit;
147
+ -js-display: flex;
148
+ display: -webkit-box;
149
+ display: -webkit-flex;
150
+ display: -moz-box;
151
+ display: -ms-flexbox;
152
+ display: flex;
153
+ -webkit-box-orient: vertical;
154
+ -webkit-box-direction: normal;
155
+ -webkit-flex-flow: inherit;
156
+ -moz-box-orient: vertical;
157
+ -moz-box-direction: normal;
158
+ -ms-flex-flow: inherit;
159
+ flex-flow: inherit;
160
+ }
161
+ .shop_table tr.cart_item td.product-name{
162
+ -webkit-box-align: baseline;
163
+ -webkit-align-items: baseline;
164
+ -moz-box-align: baseline;
165
+ -ms-flex-align: baseline;
166
+ align-items: baseline;
167
+ -webkit-box-orient: vertical;
168
+ -webkit-box-direction: normal;
169
+ -webkit-flex-flow: inherit;
170
+ -moz-box-orient: vertical;
171
+ -moz-box-direction: normal;
172
+ -ms-flex-flow: inherit;
173
+ flex-flow: inherit;
174
+ text-align: right;
175
+ }
176
+ .shop_table thead{
177
+ display: block;
178
+ }
179
+ }
assets/css/checkout-template-the-seven.css ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * *************************
3
+ * This css is loaded when when the The7 theme is enabled.
4
+ * Just to correct layout of the page.
5
+ * *************************
6
+ */
7
+
8
+ /* Basic */
9
+
10
+ body,
11
+ button,
12
+ input,
13
+ select,
14
+ optgroup,
15
+ textarea,
16
+ body.page,
17
+ .wf-container > *{
18
+ font-family: normal 1rem / 2 "sans-serif", Helvetica, Arial, Verdana, sans-serif ;
19
+ font-size: inherit;
20
+ }
21
+
22
+ .wcf-embed-checkout-form-one-column #customer_details{
23
+ width: 100%;
24
+ }
25
+ .wcf-embed-checkout-form-two-column #customer_details{
26
+ width: 55%;
27
+ }
28
+
29
+ input[type="text"],
30
+ input[type="search"],
31
+ input[type="tel"],
32
+ input[type="url"],
33
+ input[type="email"],
34
+ input[type="number"],
35
+ input[type="date"],
36
+ input[type="range"],
37
+ input[type="password"],
38
+ select,
39
+ .wpcf7-number{
40
+ height: auto;
41
+ }
42
+
43
+ #ship-to-different-address{
44
+ font: inherit;
45
+ }
46
+
47
+ #ship-to-different-address label, .create-account label.checkbox span{
48
+ font-size: inherit;
49
+ line-height: inherit;
50
+ }
51
+
52
+ .woocommerce-checkout-review-order .product-name,
53
+ .woocommerce-checkout-review-order .product-name a,
54
+ .order_details .product-name,
55
+ .order_details .product-name a{
56
+ font: inherit;
57
+ font-size: inherit;
58
+ color: inherit;
59
+ }
60
+ .woocommerce-checkout-review-order .product-quantity,
61
+ .woocommerce-checkout-review-order .product-total,
62
+ .woocommerce-checkout-review-order .cart-subtotal th,
63
+ .woocommerce-checkout-review-order .order-total th,
64
+ .woocommerce-checkout-review-order .shipping th,
65
+ .woocommerce-checkout-review-order .about_paypal,
66
+ .woocommerce-checkout-review-order .product-total .woocommerce-Price-amount,
67
+ .woocommerce-checkout-review-order tfoot th,
68
+ .order_details .product-quantity,
69
+ .order_details .product-total,
70
+ .order_details .cart-subtotal th,
71
+ .order_details .order-total th,
72
+ .order_details .shipping th,
73
+ .order_details .about_paypal,
74
+ .order_details .product-total .woocommerce-Price-amount,
75
+ .order_details tfoot th{
76
+ color: inherit;
77
+ }
78
+
79
+ #shipping_method label, .payment_methods label{
80
+ color: inherit;
81
+ font-size: inherit;
82
+ line-height: inherit;
83
+ }
84
+
85
+ .woocommerce-terms-and-conditions-text,
86
+ .woocommerce-terms-and-conditions-checkbox-text,
87
+ .woocommerce-privacy-policy-text{
88
+ font-size: inherit;
89
+ line-height: inherit;
90
+ }
91
+
92
+ div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content) > .woocommerce-message .woocommerce-message-text,
93
+ div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content) > .woocommerce-message .woocommerce-info-text,
94
+ div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content) > .woocommerce-message .woocommerce-error-text,
95
+ .woocommerce-error .woocommerce-message-text,
96
+ .woocommerce-error .woocommerce-info-text,
97
+ .woocommerce-error .woocommerce-error-text,
98
+ div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content) > .woocommerce-info .woocommerce-message-text,
99
+ div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content) > .woocommerce-info .woocommerce-info-text,
100
+ div:not(.wc-coupon-wrap):not(.wc-login-wrap):not(.woocommerce-MyAccount-content) > .woocommerce-info .woocommerce-error-text{
101
+ font: inherit;
102
+ }
103
+
104
+ .checkout .woocommerce-NoticeGroup .woocommerce-error .woocommerce-error-text{
105
+ margin: 0px;
106
+ padding-left: 0px;
107
+ }
108
+
109
+ table.shop_table thead tr th,
110
+ table.shop_table thead tr td,
111
+ table.shop_table tbody tr th,
112
+ table.shop_table tbody tr td{
113
+ border: none;
114
+ font-weight: normal;
115
+ width: 50%;
116
+ }
117
+
118
+ @media screen and (max-width: 990px){
119
+ #customer_details{
120
+ width: 100%;
121
+ }
122
+ .mt20{
123
+ margin-top: 10px!important;
124
+ }
125
+ }
126
+
127
+ @media only screen and (max-width: 768px){
128
+ #customer_details{
129
+ width: 100%;
130
+ }
131
+ .mt20{
132
+ margin-top: 10px!important;
133
+ }
134
+ }
135
+
136
+ @media screen and (max-width: 600px){
137
+
138
+ #customer_details{
139
+ width: 100%;
140
+ }
141
+
142
+ table.shop_table tbody tr{
143
+ padding: 0px;
144
+ }
145
+ .shop_table tr {
146
+ border-top: inherit;
147
+ -js-display: flex;
148
+ display: -webkit-box;
149
+ display: -webkit-flex;
150
+ display: -moz-box;
151
+ display: -ms-flexbox;
152
+ display: flex;
153
+ -webkit-box-orient: vertical;
154
+ -webkit-box-direction: normal;
155
+ -webkit-flex-flow: inherit;
156
+ -moz-box-orient: vertical;
157
+ -moz-box-direction: normal;
158
+ -ms-flex-flow: inherit;
159
+ flex-flow: inherit;
160
+ }
161
+ .shop_table tr.cart_item td.product-name{
162
+ -webkit-box-align: baseline;
163
+ -webkit-align-items: baseline;
164
+ -moz-box-align: baseline;
165
+ -ms-flex-align: baseline;
166
+ align-items: baseline;
167
+ -webkit-box-orient: vertical;
168
+ -webkit-box-direction: normal;
169
+ -webkit-flex-flow: inherit;
170
+ -moz-box-orient: vertical;
171
+ -moz-box-direction: normal;
172
+ -ms-flex-flow: inherit;
173
+ flex-flow: inherit;
174
+ text-align: left;
175
+ }
176
+ .shop_table thead{
177
+ display: block;
178
+ }
179
+ }
assets/css/checkout-template.css CHANGED
@@ -6,6 +6,8 @@
6
 
7
  .cartflows-container .wcf-embed-checkout-form,
8
  .cartflows-container .wcf-embed-checkout-form * {
 
 
9
  box-sizing: border-box;
10
  }
11
 
@@ -17,7 +19,8 @@
17
  .wcf-embed-checkout-form .woocommerce form .form-row-last,
18
  .wcf-embed-checkout-form .woocommerce-page form .form-row-first,
19
  .wcf-embed-checkout-form .woocommerce-page form .form-row-last{
20
- width: 48%;
 
21
  }
22
 
23
  .wcf-embed-checkout-form .woocommerce form .form-row-full,
@@ -26,13 +29,23 @@
26
  clear: both;
27
  }
28
 
 
 
 
 
 
 
 
 
29
  /* To test divi and all */
30
  .wcf-embed-checkout-form .woocommerce form .form-row-first, .woocommerce-page form .form-row-first{
31
  float: left;
 
32
  }
33
 
34
  .wcf-embed-checkout-form .woocommerce form .form-row-last, .woocommerce-page form .form-row-last{
35
  float: right;
 
36
  }
37
 
38
  .wcf-embed-checkout-form .woocommerce form .form-row .required{
@@ -49,7 +62,7 @@
49
  }
50
 
51
  .wcf-embed-checkout-form form .wcf-form-col-3{
52
- width: 33.33%;
53
  float: left;
54
  clear: unset;
55
  }
@@ -130,11 +143,13 @@
130
  * ************************
131
  */
132
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]{
 
133
  border-radius: 50%;
134
  margin-right: 4px;
135
  line-height: 10px;
136
  }
137
 
 
138
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
139
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before{
140
  content: "\f147";
@@ -142,6 +157,7 @@
142
  color: #F16334;
143
  }
144
 
 
145
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],
146
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"],
147
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]{
@@ -161,19 +177,24 @@
161
  width: 16px;
162
  min-width: 16px;
163
  -webkit-appearance: none;
 
164
  box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
 
165
  transition: .05s border-color ease-in-out;
166
  }
167
 
 
168
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,
169
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:focus,
170
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus{
171
  border-color: #F16334;
 
172
  box-shadow: 0 0 2px rgba(241, 99, 52,.8);
173
  }
174
 
175
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
176
  background-color: #F16334;
 
177
  border-radius: 50px;
178
  content: "\2022";
179
  font-size: 24px;
@@ -183,7 +204,7 @@
183
  text-indent: -9999px;
184
  width: 6px;
185
  }
186
-
187
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
188
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before,
189
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
@@ -209,6 +230,7 @@
209
  float: none;
210
  width: 100%;
211
  padding: 0px;
 
212
  border-radius: 0px;
213
  border: none;
214
  border-color: none;
@@ -229,6 +251,7 @@
229
 
230
  .wcf-embed-checkout-form .woocommerce-checkout #payment {
231
  background: unset;
 
232
  border-radius: 0;
233
  }
234
 
@@ -293,7 +316,9 @@
293
  background-image: none;
294
  border: 1px solid;
295
  border-color: #d4d4d4;
 
296
  border-radius: 3px;
 
297
  box-shadow: none;
298
  outline: none;
299
  }
@@ -334,7 +359,9 @@
334
  background-color: #fff;
335
  background-image: none;
336
  border: 1px solid #d4d4d4;
 
337
  border-radius: 3px;
 
338
  box-shadow: none;
339
  }
340
 
@@ -347,6 +374,11 @@
347
  }
348
 
349
  .wcf-embed-checkout-form .wcf-custom-coupon-field {
 
 
 
 
 
350
  display: flex;
351
  margin-bottom: 15px;
352
  margin-top: 25px;
@@ -373,6 +405,7 @@
373
  .wcf-embed-checkout-form textarea:focus,
374
  .wcf-embed-checkout-form .select2-container--open {
375
  border-color: #b3b3b3;
 
376
  box-shadow: none;
377
  outline: none;
378
  }
@@ -412,6 +445,7 @@
412
  padding: 16px 24px;
413
  font-size: 16px;
414
  line-height: 1.5;
 
415
  border-radius: 3px;
416
  color: #fff;
417
  text-transform: uppercase;
@@ -452,6 +486,26 @@
452
  margin:20px 0 0;
453
  }
454
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
  .wcf-embed-checkout-form-two-column .woocommerce-checkout .wcf-order-wrap{
456
  display: inline-block;
457
  float: none;
@@ -459,6 +513,7 @@
459
  border: none;
460
  background-color: inherit/*#F6F6F6*/;
461
  padding: 0 10px;
 
462
  border-radius: 3px;
463
  }
464
 
@@ -477,6 +532,7 @@
477
  background-color: inherit;
478
  border:none;
479
  /*border-top: 1px solid;*/
 
480
  border-radius: 0px;
481
  /*border-color: #dcdcdc;*/
482
  /*padding-top: 20px;*/
@@ -492,18 +548,20 @@
492
  border: none;
493
  }
494
 
495
- .wcf-embed-checkout-form .woocommerce form .form-row-wide, .woocommerce-page form .form-row-wide{
496
  clear: both;
497
- }
498
 
499
  .wcf-embed-checkout-form .woocommerce form .form-row{
500
  margin-bottom: 1.1em;
 
501
  }
502
 
503
  .wcf-embed-checkout-form table.shop_table {
504
  border:none;
505
  border-bottom: 0;
506
  background-color: inherit;
 
507
  border-radius: 0;
508
  font-family: inherit;
509
  font-weight:inherit;
@@ -577,6 +635,17 @@
577
  vertical-align: top;
578
  }
579
 
 
 
 
 
 
 
 
 
 
 
 
580
  .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label,
581
  .wcf-embed-checkout-form .woocommerce-checkout .form-row label{
582
  font-size: 13px;
@@ -664,6 +733,7 @@
664
  padding: 30px 20px 20px;
665
  margin: 2em 0;
666
  text-align: left;
 
667
  border-radius: 5px;
668
  }
669
 
@@ -726,10 +796,10 @@
726
  width: 100%;
727
  }
728
 
729
- .wcf-embed-checkout-form .woocommerce form .form-row-first,
730
  .wcf-embed-checkout-form .woocommerce-page form .form-row-first{
731
  margin-right: 4%;
732
- }
733
 
734
  .wcf-embed-checkout-form .woocommerce-additional-fields > h3,
735
  .wcf-embed-checkout-form .woocommerce-billing-fields > h3,
6
 
7
  .cartflows-container .wcf-embed-checkout-form,
8
  .cartflows-container .wcf-embed-checkout-form * {
9
+ -webkit-box-sizing: border-box;
10
+ -moz-box-sizing: border-box;
11
  box-sizing: border-box;
12
  }
13
 
19
  .wcf-embed-checkout-form .woocommerce form .form-row-last,
20
  .wcf-embed-checkout-form .woocommerce-page form .form-row-first,
21
  .wcf-embed-checkout-form .woocommerce-page form .form-row-last{
22
+ width: 50%;
23
+ display: block;
24
  }
25
 
26
  .wcf-embed-checkout-form .woocommerce form .form-row-full,
29
  clear: both;
30
  }
31
 
32
+ .wcf-embed-checkout-form form .form-row-wide{
33
+ width: 100%;
34
+ }
35
+
36
+ .wcf-embed-checkout-form form .wcf-column-33{
37
+ width: 33.33%;
38
+ }
39
+
40
  /* To test divi and all */
41
  .wcf-embed-checkout-form .woocommerce form .form-row-first, .woocommerce-page form .form-row-first{
42
  float: left;
43
+ clear: left;
44
  }
45
 
46
  .wcf-embed-checkout-form .woocommerce form .form-row-last, .woocommerce-page form .form-row-last{
47
  float: right;
48
+ clear: right;
49
  }
50
 
51
  .wcf-embed-checkout-form .woocommerce form .form-row .required{
62
  }
63
 
64
  .wcf-embed-checkout-form form .wcf-form-col-3{
65
+ width: 32%;
66
  float: left;
67
  clear: unset;
68
  }
143
  * ************************
144
  */
145
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]{
146
+ -webkit-border-radius: 50%;
147
  border-radius: 50%;
148
  margin-right: 4px;
149
  line-height: 10px;
150
  }
151
 
152
+ .wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type="checkbox"]:checked:before,
153
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
154
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before{
155
  content: "\f147";
157
  color: #F16334;
158
  }
159
 
160
+ .wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type="checkbox"],
161
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],
162
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"],
163
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]{
177
  width: 16px;
178
  min-width: 16px;
179
  -webkit-appearance: none;
180
+ -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
181
  box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
182
+ -webkit-transition: .05s border-color ease-in-out;
183
  transition: .05s border-color ease-in-out;
184
  }
185
 
186
+ .wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type="checkbox"]:focus,
187
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,
188
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:focus,
189
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus{
190
  border-color: #F16334;
191
+ -webkit-box-shadow: 0 0 2px rgba(241, 99, 52,.8);
192
  box-shadow: 0 0 2px rgba(241, 99, 52,.8);
193
  }
194
 
195
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
196
  background-color: #F16334;
197
+ -webkit-border-radius: 50px;
198
  border-radius: 50px;
199
  content: "\2022";
200
  font-size: 24px;
204
  text-indent: -9999px;
205
  width: 6px;
206
  }
207
+ .wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type="checkbox"]:checked:before,
208
  .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
209
  .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before,
210
  .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
230
  float: none;
231
  width: 100%;
232
  padding: 0px;
233
+ -webkit-border-radius: 0px;
234
  border-radius: 0px;
235
  border: none;
236
  border-color: none;
251
 
252
  .wcf-embed-checkout-form .woocommerce-checkout #payment {
253
  background: unset;
254
+ -webkit-border-radius: 0;
255
  border-radius: 0;
256
  }
257
 
316
  background-image: none;
317
  border: 1px solid;
318
  border-color: #d4d4d4;
319
+ -webkit-border-radius: 3px;
320
  border-radius: 3px;
321
+ -webkit-box-shadow: none;
322
  box-shadow: none;
323
  outline: none;
324
  }
359
  background-color: #fff;
360
  background-image: none;
361
  border: 1px solid #d4d4d4;
362
+ -webkit-border-radius: 3px;
363
  border-radius: 3px;
364
+ -webkit-box-shadow: none;
365
  box-shadow: none;
366
  }
367
 
374
  }
375
 
376
  .wcf-embed-checkout-form .wcf-custom-coupon-field {
377
+ -js-display: flex;
378
+ display: -webkit-box;
379
+ display: -webkit-flex;
380
+ display: -moz-box;
381
+ display: -ms-flexbox;
382
  display: flex;
383
  margin-bottom: 15px;
384
  margin-top: 25px;
405
  .wcf-embed-checkout-form textarea:focus,
406
  .wcf-embed-checkout-form .select2-container--open {
407
  border-color: #b3b3b3;
408
+ -webkit-box-shadow: none;
409
  box-shadow: none;
410
  outline: none;
411
  }
445
  padding: 16px 24px;
446
  font-size: 16px;
447
  line-height: 1.5;
448
+ -webkit-border-radius: 3px;
449
  border-radius: 3px;
450
  color: #fff;
451
  text-transform: uppercase;
486
  margin:20px 0 0;
487
  }
488
 
489
+ .wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,
490
+ .wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{
491
+ margin: 0 -7px;
492
+ -ms-flex-wrap: wrap;
493
+ flex-wrap: wrap;
494
+ -js-display: flex;
495
+ display: -webkit-box;
496
+ display: -moz-box;
497
+ display: -ms-flexbox;
498
+ display: flex;
499
+ display: -webkit-flex; /* Safari 6.1+, firefox, chrome */
500
+ flex-wrap: wrap;
501
+ -webkit-flex-wrap: wrap; /* Safari 6.1+, firefox, chrome*/
502
+
503
+ }
504
+
505
+ .wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper{
506
+ margin: 0px -7px;
507
+ }
508
+
509
  .wcf-embed-checkout-form-two-column .woocommerce-checkout .wcf-order-wrap{
510
  display: inline-block;
511
  float: none;
513
  border: none;
514
  background-color: inherit/*#F6F6F6*/;
515
  padding: 0 10px;
516
+ -webkit-border-radius: 3px;
517
  border-radius: 3px;
518
  }
519
 
532
  background-color: inherit;
533
  border:none;
534
  /*border-top: 1px solid;*/
535
+ -webkit-border-radius: 0px;
536
  border-radius: 0px;
537
  /*border-color: #dcdcdc;*/
538
  /*padding-top: 20px;*/
548
  border: none;
549
  }
550
 
551
+ /*.wcf-embed-checkout-form .woocommerce form .form-row-wide, .woocommerce-page form .form-row-wide{
552
  clear: both;
553
+ }*/
554
 
555
  .wcf-embed-checkout-form .woocommerce form .form-row{
556
  margin-bottom: 1.1em;
557
+ padding: 3px 7px;
558
  }
559
 
560
  .wcf-embed-checkout-form table.shop_table {
561
  border:none;
562
  border-bottom: 0;
563
  background-color: inherit;
564
+ -webkit-border-radius: 0;
565
  border-radius: 0;
566
  font-family: inherit;
567
  font-weight:inherit;
635
  vertical-align: top;
636
  }
637
 
638
+ .wcf-embed-checkout-form table.shop_table thead tr th:nth-child(1),
639
+ .wcf-embed-checkout-form table.shop_table tbody tr td:nth-child(1),
640
+ .wcf-embed-checkout-form table.shop_table tfoot tr td:nth-child(1){
641
+ width: 70%;
642
+ }
643
+ .wcf-embed-checkout-form table.shop_table thead tr th:nth-child(2),
644
+ .wcf-embed-checkout-form table.shop_table tbody tr td:nth-child(2),
645
+ .wcf-embed-checkout-form table.shop_table tfoot tr td:nth-child(2){
646
+ width: 30%;
647
+ }
648
+
649
  .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label,
650
  .wcf-embed-checkout-form .woocommerce-checkout .form-row label{
651
  font-size: 13px;
733
  padding: 30px 20px 20px;
734
  margin: 2em 0;
735
  text-align: left;
736
+ -webkit-border-radius: 5px;
737
  border-radius: 5px;
738
  }
739
 
796
  width: 100%;
797
  }
798
 
799
+ /*.wcf-embed-checkout-form .woocommerce form .form-row-first,
800
  .wcf-embed-checkout-form .woocommerce-page form .form-row-first{
801
  margin-right: 4%;
802
+ }*/
803
 
804
  .wcf-embed-checkout-form .woocommerce-additional-fields > h3,
805
  .wcf-embed-checkout-form .woocommerce-billing-fields > h3,
assets/css/frontend-rtl.css CHANGED
@@ -38,6 +38,8 @@ h1 {
38
  */
39
 
40
  hr {
 
 
41
  box-sizing: content-box; /* 1 */
42
  height: 0; /* 1 */
43
  overflow: visible; /* 2 */
@@ -72,6 +74,8 @@ a {
72
  abbr[title] {
73
  border-bottom: none; /* 1 */
74
  text-decoration: underline; /* 2 */
 
 
75
  text-decoration: underline dotted; /* 2 */
76
  }
77
 
@@ -225,6 +229,8 @@ fieldset {
225
  */
226
 
227
  legend {
 
 
228
  box-sizing: border-box; /* 1 */
229
  color: inherit; /* 2 */
230
  display: table; /* 1 */
@@ -256,6 +262,8 @@ textarea {
256
 
257
  [type="checkbox"],
258
  [type="radio"] {
 
 
259
  box-sizing: border-box; /* 1 */
260
  padding: 0; /* 2 */
261
  }
@@ -407,6 +415,8 @@ big {
407
  # Elements
408
  --------------------------------------------------------------*/
409
  html {
 
 
410
  box-sizing: border-box;
411
  }
412
 
@@ -414,6 +424,8 @@ html {
414
  *:before,
415
  *:after {
416
  /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
 
 
417
  box-sizing: inherit;
418
  }
419
 
@@ -481,6 +493,7 @@ input[type="reset"],
481
  input[type="submit"] {
482
  border: 1px solid;
483
  border-color: #ccc #ccc #bbb;
 
484
  border-radius: 3px;
485
  background: #e6e6e6;
486
  color: rgba(0, 0, 0, 0.8);
@@ -525,6 +538,7 @@ input[type="color"],
525
  textarea {
526
  color: #666;
527
  border: 1px solid #ccc;
 
528
  border-radius: 3px;
529
  padding: 3px;
530
  }
@@ -589,6 +603,7 @@ a:hover, a:active {
589
  .screen-reader-text {
590
  border: 0;
591
  clip: rect(1px, 1px, 1px, 1px);
 
592
  clip-path: inset(50%);
593
  height: 1px;
594
  margin: -1px;
@@ -601,9 +616,12 @@ a:hover, a:active {
601
 
602
  .screen-reader-text:focus {
603
  background-color: #f1f1f1;
 
604
  border-radius: 3px;
 
605
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
606
  clip: auto !important;
 
607
  clip-path: none;
608
  color: #21759b;
609
  display: block;
@@ -829,6 +847,7 @@ body.cartflows-default {
829
  .woocommerce-order .woocommerce-customer-details,
830
  .woocommerce-order .woocommerce-order-details {
831
  margin: 0 0 2em;
 
832
  border-radius: 3px;
833
  width: 100%;
834
  display: block;
@@ -863,6 +882,7 @@ body.cartflows-default {
863
  border:none;
864
  border-bottom: 0;
865
  background-color: inherit;
 
866
  border-radius: 0;
867
  font-family: inherit;
868
  font-weight:inherit;
@@ -923,6 +943,11 @@ body.cartflows-default {
923
  /**/
924
 
925
  .woocommerce-order .col2-set{
 
 
 
 
 
926
  display: flex;
927
  }
928
 
@@ -940,6 +965,7 @@ body.cartflows-default {
940
  .woocommerce-order .woocommerce-customer-details address {
941
  border-left-width: 1px;
942
  border-bottom-width: 1px;
 
943
  border-radius: 0;
944
  font-style: normal;
945
  }
38
  */
39
 
40
  hr {
41
+ -webkit-box-sizing: content-box;
42
+ -moz-box-sizing: content-box;
43
  box-sizing: content-box; /* 1 */
44
  height: 0; /* 1 */
45
  overflow: visible; /* 2 */
74
  abbr[title] {
75
  border-bottom: none; /* 1 */
76
  text-decoration: underline; /* 2 */
77
+ -webkit-text-decoration: underline dotted;
78
+ -moz-text-decoration: underline dotted;
79
  text-decoration: underline dotted; /* 2 */
80
  }
81
 
229
  */
230
 
231
  legend {
232
+ -webkit-box-sizing: border-box;
233
+ -moz-box-sizing: border-box;
234
  box-sizing: border-box; /* 1 */
235
  color: inherit; /* 2 */
236
  display: table; /* 1 */
262
 
263
  [type="checkbox"],
264
  [type="radio"] {
265
+ -webkit-box-sizing: border-box;
266
+ -moz-box-sizing: border-box;
267
  box-sizing: border-box; /* 1 */
268
  padding: 0; /* 2 */
269
  }
415
  # Elements
416
  --------------------------------------------------------------*/
417
  html {
418
+ -webkit-box-sizing: border-box;
419
+ -moz-box-sizing: border-box;
420
  box-sizing: border-box;
421
  }
422
 
424
  *:before,
425
  *:after {
426
  /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
427
+ -webkit-box-sizing: inherit;
428
+ -moz-box-sizing: inherit;
429
  box-sizing: inherit;
430
  }
431
 
493
  input[type="submit"] {
494
  border: 1px solid;
495
  border-color: #ccc #ccc #bbb;
496
+ -webkit-border-radius: 3px;
497
  border-radius: 3px;
498
  background: #e6e6e6;
499
  color: rgba(0, 0, 0, 0.8);
538
  textarea {
539
  color: #666;
540
  border: 1px solid #ccc;
541
+ -webkit-border-radius: 3px;
542
  border-radius: 3px;
543
  padding: 3px;
544
  }
603
  .screen-reader-text {
604
  border: 0;
605
  clip: rect(1px, 1px, 1px, 1px);
606
+ -webkit-clip-path: inset(50%);
607
  clip-path: inset(50%);
608
  height: 1px;
609
  margin: -1px;
616
 
617
  .screen-reader-text:focus {
618
  background-color: #f1f1f1;
619
+ -webkit-border-radius: 3px;
620
  border-radius: 3px;
621
+ -webkit-box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
622
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
623
  clip: auto !important;
624
+ -webkit-clip-path: none;
625
  clip-path: none;
626
  color: #21759b;
627
  display: block;
847
  .woocommerce-order .woocommerce-customer-details,
848
  .woocommerce-order .woocommerce-order-details {
849
  margin: 0 0 2em;
850
+ -webkit-border-radius: 3px;
851
  border-radius: 3px;
852
  width: 100%;
853
  display: block;
882
  border:none;
883
  border-bottom: 0;
884
  background-color: inherit;
885
+ -webkit-border-radius: 0;
886
  border-radius: 0;
887
  font-family: inherit;
888
  font-weight:inherit;
943
  /**/
944
 
945
  .woocommerce-order .col2-set{
946
+ -js-display: flex;
947
+ display: -webkit-box;
948
+ display: -webkit-flex;
949
+ display: -moz-box;
950
+ display: -ms-flexbox;
951
  display: flex;
952
  }
953
 
965
  .woocommerce-order .woocommerce-customer-details address {
966
  border-left-width: 1px;
967
  border-bottom-width: 1px;
968
+ -webkit-border-radius: 0;
969
  border-radius: 0;
970
  font-style: normal;
971
  }
assets/css/frontend.css CHANGED
@@ -38,6 +38,8 @@ h1 {
38
  */
39
 
40
  hr {
 
 
41
  box-sizing: content-box; /* 1 */
42
  height: 0; /* 1 */
43
  overflow: visible; /* 2 */
@@ -72,6 +74,8 @@ a {
72
  abbr[title] {
73
  border-bottom: none; /* 1 */
74
  text-decoration: underline; /* 2 */
 
 
75
  text-decoration: underline dotted; /* 2 */
76
  }
77
 
@@ -225,6 +229,8 @@ fieldset {
225
  */
226
 
227
  legend {
 
 
228
  box-sizing: border-box; /* 1 */
229
  color: inherit; /* 2 */
230
  display: table; /* 1 */
@@ -256,6 +262,8 @@ textarea {
256
 
257
  [type="checkbox"],
258
  [type="radio"] {
 
 
259
  box-sizing: border-box; /* 1 */
260
  padding: 0; /* 2 */
261
  }
@@ -407,6 +415,8 @@ big {
407
  # Elements
408
  --------------------------------------------------------------*/
409
  html {
 
 
410
  box-sizing: border-box;
411
  }
412
 
@@ -414,6 +424,8 @@ html {
414
  *:before,
415
  *:after {
416
  /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
 
 
417
  box-sizing: inherit;
418
  }
419
 
@@ -481,6 +493,7 @@ input[type="reset"],
481
  input[type="submit"] {
482
  border: 1px solid;
483
  border-color: #ccc #ccc #bbb;
 
484
  border-radius: 3px;
485
  background: #e6e6e6;
486
  color: rgba(0, 0, 0, 0.8);
@@ -525,6 +538,7 @@ input[type="color"],
525
  textarea {
526
  color: #666;
527
  border: 1px solid #ccc;
 
528
  border-radius: 3px;
529
  padding: 3px;
530
  }
@@ -589,6 +603,7 @@ a:hover, a:active {
589
  .screen-reader-text {
590
  border: 0;
591
  clip: rect(1px, 1px, 1px, 1px);
 
592
  clip-path: inset(50%);
593
  height: 1px;
594
  margin: -1px;
@@ -601,9 +616,12 @@ a:hover, a:active {
601
 
602
  .screen-reader-text:focus {
603
  background-color: #f1f1f1;
 
604
  border-radius: 3px;
 
605
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
606
  clip: auto !important;
 
607
  clip-path: none;
608
  color: #21759b;
609
  display: block;
@@ -829,6 +847,7 @@ body.cartflows-default {
829
  .woocommerce-order .woocommerce-customer-details,
830
  .woocommerce-order .woocommerce-order-details {
831
  margin: 0 0 2em;
 
832
  border-radius: 3px;
833
  width: 100%;
834
  display: block;
@@ -863,6 +882,7 @@ body.cartflows-default {
863
  border:none;
864
  border-bottom: 0;
865
  background-color: inherit;
 
866
  border-radius: 0;
867
  font-family: inherit;
868
  font-weight:inherit;
@@ -923,6 +943,11 @@ body.cartflows-default {
923
  /**/
924
 
925
  .woocommerce-order .col2-set{
 
 
 
 
 
926
  display: flex;
927
  }
928
 
@@ -940,6 +965,7 @@ body.cartflows-default {
940
  .woocommerce-order .woocommerce-customer-details address {
941
  border-right-width: 1px;
942
  border-bottom-width: 1px;
 
943
  border-radius: 0;
944
  font-style: normal;
945
  }
38
  */
39
 
40
  hr {
41
+ -webkit-box-sizing: content-box;
42
+ -moz-box-sizing: content-box;
43
  box-sizing: content-box; /* 1 */
44
  height: 0; /* 1 */
45
  overflow: visible; /* 2 */
74
  abbr[title] {
75
  border-bottom: none; /* 1 */
76
  text-decoration: underline; /* 2 */
77
+ -webkit-text-decoration: underline dotted;
78
+ -moz-text-decoration: underline dotted;
79
  text-decoration: underline dotted; /* 2 */
80
  }
81
 
229
  */
230
 
231
  legend {
232
+ -webkit-box-sizing: border-box;
233
+ -moz-box-sizing: border-box;
234
  box-sizing: border-box; /* 1 */
235
  color: inherit; /* 2 */
236
  display: table; /* 1 */
262
 
263
  [type="checkbox"],
264
  [type="radio"] {
265
+ -webkit-box-sizing: border-box;
266
+ -moz-box-sizing: border-box;
267
  box-sizing: border-box; /* 1 */
268
  padding: 0; /* 2 */
269
  }
415
  # Elements
416
  --------------------------------------------------------------*/
417
  html {
418
+ -webkit-box-sizing: border-box;
419
+ -moz-box-sizing: border-box;
420
  box-sizing: border-box;
421
  }
422
 
424
  *:before,
425
  *:after {
426
  /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
427
+ -webkit-box-sizing: inherit;
428
+ -moz-box-sizing: inherit;
429
  box-sizing: inherit;
430
  }
431
 
493
  input[type="submit"] {
494
  border: 1px solid;
495
  border-color: #ccc #ccc #bbb;
496
+ -webkit-border-radius: 3px;
497
  border-radius: 3px;
498
  background: #e6e6e6;
499
  color: rgba(0, 0, 0, 0.8);
538
  textarea {
539
  color: #666;
540
  border: 1px solid #ccc;
541
+ -webkit-border-radius: 3px;
542
  border-radius: 3px;
543
  padding: 3px;
544
  }
603
  .screen-reader-text {
604
  border: 0;
605
  clip: rect(1px, 1px, 1px, 1px);
606
+ -webkit-clip-path: inset(50%);
607
  clip-path: inset(50%);
608
  height: 1px;
609
  margin: -1px;
616
 
617
  .screen-reader-text:focus {
618
  background-color: #f1f1f1;
619
+ -webkit-border-radius: 3px;
620
  border-radius: 3px;
621
+ -webkit-box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
622
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
623
  clip: auto !important;
624
+ -webkit-clip-path: none;
625
  clip-path: none;
626
  color: #21759b;
627
  display: block;
847
  .woocommerce-order .woocommerce-customer-details,
848
  .woocommerce-order .woocommerce-order-details {
849
  margin: 0 0 2em;
850
+ -webkit-border-radius: 3px;
851
  border-radius: 3px;
852
  width: 100%;
853
  display: block;
882
  border:none;
883
  border-bottom: 0;
884
  background-color: inherit;
885
+ -webkit-border-radius: 0;
886
  border-radius: 0;
887
  font-family: inherit;
888
  font-weight:inherit;
943
  /**/
944
 
945
  .woocommerce-order .col2-set{
946
+ -js-display: flex;
947
+ display: -webkit-box;
948
+ display: -webkit-flex;
949
+ display: -moz-box;
950
+ display: -ms-flexbox;
951
  display: flex;
952
  }
953
 
965
  .woocommerce-order .woocommerce-customer-details address {
966
  border-right-width: 1px;
967
  border-bottom-width: 1px;
968
+ -webkit-border-radius: 0;
969
  border-radius: 0;
970
  font-style: normal;
971
  }
assets/css/import-rtl.css CHANGED
@@ -2,6 +2,7 @@
2
  border-right: none;
3
  background: transparent;
4
  border: none;
 
5
  box-shadow: none;
6
  padding-right: 0;
7
  }
@@ -58,12 +59,16 @@
58
  /* height: 100%; */
59
  vertical-align: middle;
60
  top: 50%;
 
 
61
  transform: translateY(-60%);
62
  left: 0%;
63
  right: 0%;
64
  z-index: 4;
65
  text-align: center;
 
66
  border-radius: 3px;
 
67
  transition: opacity .1s ease-in-out;
68
  }
69
 
@@ -74,6 +79,7 @@
74
  .preview:focus,
75
  .preview:hover {
76
  color: #fff;
 
77
  box-shadow: none;
78
  }
79
  .preview {
@@ -82,6 +88,8 @@
82
  opacity: 0;
83
  position: absolute;
84
  top: 50%;
 
 
85
  transform: translateY(-50%);
86
  left: 22%;
87
  right: 22%;
@@ -161,6 +169,8 @@
161
  }
162
 
163
  .wcf-remote-list * {
 
 
164
  box-sizing: border-box;
165
  }
166
 
@@ -180,6 +190,7 @@
180
  }
181
 
182
  #cartflows-steps-list .image-wrap {
 
183
  background-size: cover;
184
  overflow: hidden;
185
  }
@@ -307,6 +318,7 @@ body.cartflows-popup-is-open {
307
  height: 1024px !important;
308
  background: #111;
309
  padding: 40px 10px 70px;
 
310
  border-radius: 30px;
311
  }
312
  #TB_iframeContent.tablet.landscape {
@@ -317,6 +329,7 @@ body.cartflows-popup-is-open {
317
  height: 640px !important;
318
  background: #111;
319
  padding: 40px 10px 70px;
 
320
  border-radius: 30px;
321
  }
322
  #TB_iframeContent.mobile.landscape {
@@ -339,13 +352,27 @@ div#TB_window {
339
  color: #0a0c0d;
340
  text-align: right;
341
  bottom: 0;
 
342
  box-shadow: none;
 
 
 
 
343
  justify-content: space-between;
 
 
 
 
344
  align-items: center;
345
  padding: 1em 1.5em 1em 1em;
346
  }
347
  @media all and (min-width: 769px) {
348
  #TB_window #TB_title {
 
 
 
 
 
349
  display: flex;
350
  }
351
  }
@@ -363,6 +390,7 @@ div#TB_window {
363
  }
364
 
365
  #TB_window #TB_closeWindowButton:focus .tb-close-icon {
 
366
  box-shadow: none;
367
  color: #666;
368
  }
@@ -388,6 +416,7 @@ div#TB_window {
388
  }
389
  .responsive-view a:focus {
390
  outline: none;
 
391
  box-shadow: none;
392
  }
393
  #TB_window.tablet #TB_iframeContent,
@@ -413,10 +442,14 @@ div#TB_window {
413
  top: 50%;
414
  text-align: center;
415
  color: #555;
 
 
416
  transform: translate(50%, -40%);
417
  }
418
  .top .site-loading {
419
  top: 50%;
 
 
420
  transform: translate(50%, -50%);
421
  }
422
 
@@ -476,6 +509,7 @@ div#TB_window {
476
  .wcf-template-header .filter-links li a:hove,
477
  .wcf-template-header .filter-links li a:focus {
478
  outline: none;
 
479
  box-shadow: none;
480
  }
481
  .wcf-template-header .filter-links li .current {
@@ -486,6 +520,7 @@ div#TB_window {
486
 
487
  .wcf-flow-search-input {
488
  border: none;
 
489
  box-shadow: none;
490
  border-bottom: 1px solid #eee;
491
  line-height: 1.8;
@@ -509,6 +544,7 @@ div#TB_window {
509
 
510
  #wcf-start-from-scratch .inner {
511
  background: transparent;
 
512
  box-shadow: none;
513
  width: 94%;
514
  margin: 0 auto;
@@ -523,11 +559,13 @@ div#TB_window {
523
  }
524
 
525
  #wcf-scratch-steps-categories select{
 
526
  border-radius: 0;
527
  height: 29px;
528
  border: 1px solid;
529
  border-color: #9e9e9e;
530
  border-width: 1px;
 
531
  box-shadow: none;
532
  padding: 2px;
533
  line-height: 29px;
@@ -542,6 +580,7 @@ div#TB_window {
542
 
543
  .wcf-search-form .wcf-flow-search-input {
544
  border: none;
 
545
  box-shadow: none;
546
  border-bottom: 1px solid #eee;
547
  line-height: 1.8;
@@ -551,6 +590,7 @@ div#TB_window {
551
  font-size: 1em;
552
  }
553
  .wcf-search-form .wcf-flow-search-input:focus {
 
554
  box-shadow: none;
555
  border-color: #ccc;
556
  }
@@ -595,6 +635,7 @@ div#TB_window {
595
  top: 0;
596
  right: 0;
597
  background: rgba(0, 0, 0, 0.7);
 
598
  transition: opacity 500ms;
599
  visibility: hidden;
600
  opacity: 0;
@@ -603,6 +644,7 @@ div#TB_window {
603
  -moz-user-select: none;
604
  -ms-user-select: none;
605
  user-select: none;
 
606
  transition: none;
607
  }
608
 
@@ -616,9 +658,12 @@ div#TB_window {
616
  max-width: 1200px;
617
  background-color: #fff;
618
  position: absolute;
 
619
  border-radius: 3px;
620
  top: 40%;
621
  right: 50%;
 
 
622
  transform: translate(50%, -35%);
623
  width: 70%;
624
  min-height: 450px;
@@ -633,6 +678,7 @@ div#TB_window {
633
  float: right;
634
  margin: 15px;
635
  text-align: center;
 
636
  box-shadow: 0 0 5px 1px rgba(204, 204, 204, 0.3);
637
  }
638
 
@@ -655,6 +701,7 @@ div#TB_window {
655
 
656
  @media only screen and (min-width: 768px) {
657
  .wcf-templates-popup-content .inner{
 
658
  width: calc(25% - 30px);
659
  }
660
  }
@@ -714,9 +761,16 @@ html.wcf-popup-open{
714
  }
715
 
716
  .wcf-template-header {
 
717
  align-items: center;
718
  background: #fff;
 
719
  box-shadow: 0 0 8px rgba(0,0,0,.2);
 
 
 
 
 
720
  display: flex;
721
  -webkit-box-align: center;
722
  -webkit-align-items: center;
@@ -724,6 +778,7 @@ html.wcf-popup-open{
724
  -webkit-box-pack: justify;
725
  -webkit-justify-content: space-between;
726
  -ms-flex-pack: justify;
 
727
  justify-content: space-between;
728
  padding: 0 15px;
729
  min-height: 50px;
@@ -737,6 +792,7 @@ html.wcf-popup-open{
737
  font-weight: normal;
738
  font-style: normal;
739
  text-align: center;
 
740
  transition: color .1s ease-in 0;
741
  -webkit-font-smoothing: antialiased;
742
  -moz-osx-font-smoothing: grayscale;
@@ -790,6 +846,7 @@ html.wcf-popup-open{
790
  .wcf-tab.nav-tabs > li > a:focus,
791
  .wcf-tab.nav-tabs > li > a:focus{
792
  outline: none;
 
793
  box-shadow: none;
794
  }
795
 
@@ -841,6 +898,8 @@ html.wcf-popup-open{
841
  left: 0;
842
  max-width: 100%;
843
  max-height: 100%;
 
 
844
  transform: translate(50%, -50%);
845
  z-index: 99999;
846
  }
@@ -895,6 +954,7 @@ html.wcf-popup-open{
895
  #wcf-remote-filters a:focus,
896
  #wcf-remote-filters .filter-links li:focus {
897
  outline: none;
 
898
  box-shadow: none;
899
  }
900
  #wcf-remote-filters .filter-links li a {
@@ -922,6 +982,7 @@ html.wcf-popup-open{
922
  }
923
 
924
  .wcf-templates-popup-overlay a {
 
925
  transition: none;
926
  }
927
 
@@ -940,6 +1001,7 @@ html.wcf-popup-open{
940
 
941
  #wcf-remote-content .wcf-install-plugin::focus {
942
  border-color: none;
 
943
  box-shadow: none;
944
  }
945
 
@@ -947,6 +1009,7 @@ html.wcf-popup-open{
947
  background: none;
948
  padding: 0;
949
  font-size: 1rem;
 
950
  box-shadow: none;
951
  border: none;
952
  margin: 0 3px 0 0;
2
  border-right: none;
3
  background: transparent;
4
  border: none;
5
+ -webkit-box-shadow: none;
6
  box-shadow: none;
7
  padding-right: 0;
8
  }
59
  /* height: 100%; */
60
  vertical-align: middle;
61
  top: 50%;
62
+ -webkit-transform: translateY(-60%);
63
+ -ms-transform: translateY(-60%);
64
  transform: translateY(-60%);
65
  left: 0%;
66
  right: 0%;
67
  z-index: 4;
68
  text-align: center;
69
+ -webkit-border-radius: 3px;
70
  border-radius: 3px;
71
+ -webkit-transition: opacity .1s ease-in-out;
72
  transition: opacity .1s ease-in-out;
73
  }
74
 
79
  .preview:focus,
80
  .preview:hover {
81
  color: #fff;
82
+ -webkit-box-shadow: none;
83
  box-shadow: none;
84
  }
85
  .preview {
88
  opacity: 0;
89
  position: absolute;
90
  top: 50%;
91
+ -webkit-transform: translateY(-50%);
92
+ -ms-transform: translateY(-50%);
93
  transform: translateY(-50%);
94
  left: 22%;
95
  right: 22%;
169
  }
170
 
171
  .wcf-remote-list * {
172
+ -webkit-box-sizing: border-box;
173
+ -moz-box-sizing: border-box;
174
  box-sizing: border-box;
175
  }
176
 
190
  }
191
 
192
  #cartflows-steps-list .image-wrap {
193
+ -webkit-background-size: cover;
194
  background-size: cover;
195
  overflow: hidden;
196
  }
318
  height: 1024px !important;
319
  background: #111;
320
  padding: 40px 10px 70px;
321
+ -webkit-border-radius: 30px;
322
  border-radius: 30px;
323
  }
324
  #TB_iframeContent.tablet.landscape {
329
  height: 640px !important;
330
  background: #111;
331
  padding: 40px 10px 70px;
332
+ -webkit-border-radius: 30px;
333
  border-radius: 30px;
334
  }
335
  #TB_iframeContent.mobile.landscape {
352
  color: #0a0c0d;
353
  text-align: right;
354
  bottom: 0;
355
+ -webkit-box-shadow: none;
356
  box-shadow: none;
357
+ -webkit-box-pack: justify;
358
+ -webkit-justify-content: space-between;
359
+ -moz-box-pack: justify;
360
+ -ms-flex-pack: justify;
361
  justify-content: space-between;
362
+ -webkit-box-align: center;
363
+ -webkit-align-items: center;
364
+ -moz-box-align: center;
365
+ -ms-flex-align: center;
366
  align-items: center;
367
  padding: 1em 1.5em 1em 1em;
368
  }
369
  @media all and (min-width: 769px) {
370
  #TB_window #TB_title {
371
+ -js-display: flex;
372
+ display: -webkit-box;
373
+ display: -webkit-flex;
374
+ display: -moz-box;
375
+ display: -ms-flexbox;
376
  display: flex;
377
  }
378
  }
390
  }
391
 
392
  #TB_window #TB_closeWindowButton:focus .tb-close-icon {
393
+ -webkit-box-shadow: none;
394
  box-shadow: none;
395
  color: #666;
396
  }
416
  }
417
  .responsive-view a:focus {
418
  outline: none;
419
+ -webkit-box-shadow: none;
420
  box-shadow: none;
421
  }
422
  #TB_window.tablet #TB_iframeContent,
442
  top: 50%;
443
  text-align: center;
444
  color: #555;
445
+ -webkit-transform: translate(50%, -40%);
446
+ -ms-transform: translate(50%, -40%);
447
  transform: translate(50%, -40%);
448
  }
449
  .top .site-loading {
450
  top: 50%;
451
+ -webkit-transform: translate(50%, -50%);
452
+ -ms-transform: translate(50%, -50%);
453
  transform: translate(50%, -50%);
454
  }
455
 
509
  .wcf-template-header .filter-links li a:hove,
510
  .wcf-template-header .filter-links li a:focus {
511
  outline: none;
512
+ -webkit-box-shadow: none;
513
  box-shadow: none;
514
  }
515
  .wcf-template-header .filter-links li .current {
520
 
521
  .wcf-flow-search-input {
522
  border: none;
523
+ -webkit-box-shadow: none;
524
  box-shadow: none;
525
  border-bottom: 1px solid #eee;
526
  line-height: 1.8;
544
 
545
  #wcf-start-from-scratch .inner {
546
  background: transparent;
547
+ -webkit-box-shadow: none;
548
  box-shadow: none;
549
  width: 94%;
550
  margin: 0 auto;
559
  }
560
 
561
  #wcf-scratch-steps-categories select{
562
+ -webkit-border-radius: 0;
563
  border-radius: 0;
564
  height: 29px;
565
  border: 1px solid;
566
  border-color: #9e9e9e;
567
  border-width: 1px;
568
+ -webkit-box-shadow: none;
569
  box-shadow: none;
570
  padding: 2px;
571
  line-height: 29px;
580
 
581
  .wcf-search-form .wcf-flow-search-input {
582
  border: none;
583
+ -webkit-box-shadow: none;
584
  box-shadow: none;
585
  border-bottom: 1px solid #eee;
586
  line-height: 1.8;
590
  font-size: 1em;
591
  }
592
  .wcf-search-form .wcf-flow-search-input:focus {
593
+ -webkit-box-shadow: none;
594
  box-shadow: none;
595
  border-color: #ccc;
596
  }
635
  top: 0;
636
  right: 0;
637
  background: rgba(0, 0, 0, 0.7);
638
+ -webkit-transition: opacity 500ms;
639
  transition: opacity 500ms;
640
  visibility: hidden;
641
  opacity: 0;
644
  -moz-user-select: none;
645
  -ms-user-select: none;
646
  user-select: none;
647
+ -webkit-transition: none;
648
  transition: none;
649
  }
650
 
658
  max-width: 1200px;
659
  background-color: #fff;
660
  position: absolute;
661
+ -webkit-border-radius: 3px;
662
  border-radius: 3px;
663
  top: 40%;
664
  right: 50%;
665
+ -webkit-transform: translate(50%, -35%);
666
+ -ms-transform: translate(50%, -35%);
667
  transform: translate(50%, -35%);
668
  width: 70%;
669
  min-height: 450px;
678
  float: right;
679
  margin: 15px;
680
  text-align: center;
681
+ -webkit-box-shadow: 0 0 5px 1px rgba(204, 204, 204, 0.3);
682
  box-shadow: 0 0 5px 1px rgba(204, 204, 204, 0.3);
683
  }
684
 
701
 
702
  @media only screen and (min-width: 768px) {
703
  .wcf-templates-popup-content .inner{
704
+ width: -webkit-calc(25% - 30px);
705
  width: calc(25% - 30px);
706
  }
707
  }
761
  }
762
 
763
  .wcf-template-header {
764
+ -moz-box-align: center;
765
  align-items: center;
766
  background: #fff;
767
+ -webkit-box-shadow: 0 0 8px rgba(0,0,0,.2);
768
  box-shadow: 0 0 8px rgba(0,0,0,.2);
769
+ -js-display: flex;
770
+ display: -webkit-box;
771
+ display: -webkit-flex;
772
+ display: -moz-box;
773
+ display: -ms-flexbox;
774
  display: flex;
775
  -webkit-box-align: center;
776
  -webkit-align-items: center;
778
  -webkit-box-pack: justify;
779
  -webkit-justify-content: space-between;
780
  -ms-flex-pack: justify;
781
+ -moz-box-pack: justify;
782
  justify-content: space-between;
783
  padding: 0 15px;
784
  min-height: 50px;
792
  font-weight: normal;
793
  font-style: normal;
794
  text-align: center;
795
+ -webkit-transition: color .1s ease-in 0;
796
  transition: color .1s ease-in 0;
797
  -webkit-font-smoothing: antialiased;
798
  -moz-osx-font-smoothing: grayscale;
846
  .wcf-tab.nav-tabs > li > a:focus,
847
  .wcf-tab.nav-tabs > li > a:focus{
848
  outline: none;
849
+ -webkit-box-shadow: none;
850
  box-shadow: none;
851
  }
852
 
898
  left: 0;
899
  max-width: 100%;
900
  max-height: 100%;
901
+ -webkit-transform: translate(50%, -50%);
902
+ -ms-transform: translate(50%, -50%);
903
  transform: translate(50%, -50%);
904
  z-index: 99999;
905
  }
954
  #wcf-remote-filters a:focus,
955
  #wcf-remote-filters .filter-links li:focus {
956
  outline: none;
957
+ -webkit-box-shadow: none;
958
  box-shadow: none;
959
  }
960
  #wcf-remote-filters .filter-links li a {
982
  }
983
 
984
  .wcf-templates-popup-overlay a {
985
+ -webkit-transition: none;
986
  transition: none;
987
  }
988
 
1001
 
1002
  #wcf-remote-content .wcf-install-plugin::focus {
1003
  border-color: none;
1004
+ -webkit-box-shadow: none;
1005
  box-shadow: none;
1006
  }
1007
 
1009
  background: none;
1010
  padding: 0;
1011
  font-size: 1rem;
1012
+ -webkit-box-shadow: none;
1013
  box-shadow: none;
1014
  border: none;
1015
  margin: 0 3px 0 0;
assets/css/import.css CHANGED
@@ -2,6 +2,7 @@
2
  border-left: none;
3
  background: transparent;
4
  border: none;
 
5
  box-shadow: none;
6
  padding-left: 0;
7
  }
@@ -58,12 +59,16 @@
58
  /* height: 100%; */
59
  vertical-align: middle;
60
  top: 50%;
 
 
61
  transform: translateY(-60%);
62
  right: 0%;
63
  left: 0%;
64
  z-index: 4;
65
  text-align: center;
 
66
  border-radius: 3px;
 
67
  transition: opacity .1s ease-in-out;
68
  }
69
 
@@ -74,6 +79,7 @@
74
  .preview:focus,
75
  .preview:hover {
76
  color: #fff;
 
77
  box-shadow: none;
78
  }
79
  .preview {
@@ -82,6 +88,8 @@
82
  opacity: 0;
83
  position: absolute;
84
  top: 50%;
 
 
85
  transform: translateY(-50%);
86
  right: 22%;
87
  left: 22%;
@@ -161,6 +169,8 @@
161
  }
162
 
163
  .wcf-remote-list * {
 
 
164
  box-sizing: border-box;
165
  }
166
 
@@ -180,6 +190,7 @@
180
  }
181
 
182
  #cartflows-steps-list .image-wrap {
 
183
  background-size: cover;
184
  overflow: hidden;
185
  }
@@ -307,6 +318,7 @@ body.cartflows-popup-is-open {
307
  height: 1024px !important;
308
  background: #111;
309
  padding: 40px 10px 70px;
 
310
  border-radius: 30px;
311
  }
312
  #TB_iframeContent.tablet.landscape {
@@ -317,6 +329,7 @@ body.cartflows-popup-is-open {
317
  height: 640px !important;
318
  background: #111;
319
  padding: 40px 10px 70px;
 
320
  border-radius: 30px;
321
  }
322
  #TB_iframeContent.mobile.landscape {
@@ -339,13 +352,27 @@ div#TB_window {
339
  color: #0a0c0d;
340
  text-align: left;
341
  bottom: 0;
 
342
  box-shadow: none;
 
 
 
 
343
  justify-content: space-between;
 
 
 
 
344
  align-items: center;
345
  padding: 1em 1em 1em 1.5em;
346
  }
347
  @media all and (min-width: 769px) {
348
  #TB_window #TB_title {
 
 
 
 
 
349
  display: flex;
350
  }
351
  }
@@ -363,6 +390,7 @@ div#TB_window {
363
  }
364
 
365
  #TB_window #TB_closeWindowButton:focus .tb-close-icon {
 
366
  box-shadow: none;
367
  color: #666;
368
  }
@@ -388,6 +416,7 @@ div#TB_window {
388
  }
389
  .responsive-view a:focus {
390
  outline: none;
 
391
  box-shadow: none;
392
  }
393
  #TB_window.tablet #TB_iframeContent,
@@ -413,10 +442,14 @@ div#TB_window {
413
  top: 50%;
414
  text-align: center;
415
  color: #555;
 
 
416
  transform: translate(-50%, -40%);
417
  }
418
  .top .site-loading {
419
  top: 50%;
 
 
420
  transform: translate(-50%, -50%);
421
  }
422
 
@@ -476,6 +509,7 @@ div#TB_window {
476
  .wcf-template-header .filter-links li a:hove,
477
  .wcf-template-header .filter-links li a:focus {
478
  outline: none;
 
479
  box-shadow: none;
480
  }
481
  .wcf-template-header .filter-links li .current {
@@ -486,6 +520,7 @@ div#TB_window {
486
 
487
  .wcf-flow-search-input {
488
  border: none;
 
489
  box-shadow: none;
490
  border-bottom: 1px solid #eee;
491
  line-height: 1.8;
@@ -509,6 +544,7 @@ div#TB_window {
509
 
510
  #wcf-start-from-scratch .inner {
511
  background: transparent;
 
512
  box-shadow: none;
513
  width: 94%;
514
  margin: 0 auto;
@@ -523,11 +559,13 @@ div#TB_window {
523
  }
524
 
525
  #wcf-scratch-steps-categories select{
 
526
  border-radius: 0;
527
  height: 29px;
528
  border: 1px solid;
529
  border-color: #9e9e9e;
530
  border-width: 1px;
 
531
  box-shadow: none;
532
  padding: 2px;
533
  line-height: 29px;
@@ -542,6 +580,7 @@ div#TB_window {
542
 
543
  .wcf-search-form .wcf-flow-search-input {
544
  border: none;
 
545
  box-shadow: none;
546
  border-bottom: 1px solid #eee;
547
  line-height: 1.8;
@@ -551,6 +590,7 @@ div#TB_window {
551
  font-size: 1em;
552
  }
553
  .wcf-search-form .wcf-flow-search-input:focus {
 
554
  box-shadow: none;
555
  border-color: #ccc;
556
  }
@@ -595,6 +635,7 @@ div#TB_window {
595
  top: 0;
596
  left: 0;
597
  background: rgba(0, 0, 0, 0.7);
 
598
  transition: opacity 500ms;
599
  visibility: hidden;
600
  opacity: 0;
@@ -603,6 +644,7 @@ div#TB_window {
603
  -moz-user-select: none;
604
  -ms-user-select: none;
605
  user-select: none;
 
606
  transition: none;
607
  }
608
 
@@ -616,9 +658,12 @@ div#TB_window {
616
  max-width: 1200px;
617
  background-color: #fff;
618
  position: absolute;
 
619
  border-radius: 3px;
620
  top: 40%;
621
  left: 50%;
 
 
622
  transform: translate(-50%, -35%);
623
  width: 70%;
624
  min-height: 450px;
@@ -633,6 +678,7 @@ div#TB_window {
633
  float: left;
634
  margin: 15px;
635
  text-align: center;
 
636
  box-shadow: 0 0 5px 1px rgba(204, 204, 204, 0.3);
637
  }
638
 
@@ -655,6 +701,7 @@ div#TB_window {
655
 
656
  @media only screen and (min-width: 768px) {
657
  .wcf-templates-popup-content .inner{
 
658
  width: calc(25% - 30px);
659
  }
660
  }
@@ -714,9 +761,16 @@ html.wcf-popup-open{
714
  }
715
 
716
  .wcf-template-header {
 
717
  align-items: center;
718
  background: #fff;
 
719
  box-shadow: 0 0 8px rgba(0,0,0,.2);
 
 
 
 
 
720
  display: flex;
721
  -webkit-box-align: center;
722
  -webkit-align-items: center;
@@ -724,6 +778,7 @@ html.wcf-popup-open{
724
  -webkit-box-pack: justify;
725
  -webkit-justify-content: space-between;
726
  -ms-flex-pack: justify;
 
727
  justify-content: space-between;
728
  padding: 0 15px;
729
  min-height: 50px;
@@ -737,6 +792,7 @@ html.wcf-popup-open{
737
  font-weight: normal;
738
  font-style: normal;
739
  text-align: center;
 
740
  transition: color .1s ease-in 0;
741
  -webkit-font-smoothing: antialiased;
742
  -moz-osx-font-smoothing: grayscale;
@@ -790,6 +846,7 @@ html.wcf-popup-open{
790
  .wcf-tab.nav-tabs > li > a:focus,
791
  .wcf-tab.nav-tabs > li > a:focus{
792
  outline: none;
 
793
  box-shadow: none;
794
  }
795
 
@@ -841,6 +898,8 @@ html.wcf-popup-open{
841
  right: 0;
842
  max-width: 100%;
843
  max-height: 100%;
 
 
844
  transform: translate(-50%, -50%);
845
  z-index: 99999;
846
  }
@@ -895,6 +954,7 @@ html.wcf-popup-open{
895
  #wcf-remote-filters a:focus,
896
  #wcf-remote-filters .filter-links li:focus {
897
  outline: none;
 
898
  box-shadow: none;
899
  }
900
  #wcf-remote-filters .filter-links li a {
@@ -922,6 +982,7 @@ html.wcf-popup-open{
922
  }
923
 
924
  .wcf-templates-popup-overlay a {
 
925
  transition: none;
926
  }
927
 
@@ -940,6 +1001,7 @@ html.wcf-popup-open{
940
 
941
  #wcf-remote-content .wcf-install-plugin::focus {
942
  border-color: none;
 
943
  box-shadow: none;
944
  }
945
 
@@ -947,6 +1009,7 @@ html.wcf-popup-open{
947
  background: none;
948
  padding: 0;
949
  font-size: 1rem;
 
950
  box-shadow: none;
951
  border: none;
952
  margin: 0 0 0 3px;
2
  border-left: none;
3
  background: transparent;
4
  border: none;
5
+ -webkit-box-shadow: none;
6
  box-shadow: none;
7
  padding-left: 0;
8
  }
59
  /* height: 100%; */
60
  vertical-align: middle;
61
  top: 50%;
62
+ -webkit-transform: translateY(-60%);
63
+ -ms-transform: translateY(-60%);
64
  transform: translateY(-60%);
65
  right: 0%;
66
  left: 0%;
67
  z-index: 4;
68
  text-align: center;
69
+ -webkit-border-radius: 3px;
70
  border-radius: 3px;
71
+ -webkit-transition: opacity .1s ease-in-out;
72
  transition: opacity .1s ease-in-out;
73
  }
74
 
79
  .preview:focus,
80
  .preview:hover {
81
  color: #fff;
82
+ -webkit-box-shadow: none;
83
  box-shadow: none;
84
  }
85
  .preview {
88
  opacity: 0;
89
  position: absolute;
90
  top: 50%;
91
+ -webkit-transform: translateY(-50%);
92
+ -ms-transform: translateY(-50%);
93
  transform: translateY(-50%);
94
  right: 22%;
95
  left: 22%;
169
  }
170
 
171
  .wcf-remote-list * {
172
+ -webkit-box-sizing: border-box;
173
+ -moz-box-sizing: border-box;
174
  box-sizing: border-box;
175
  }
176
 
190
  }
191
 
192
  #cartflows-steps-list .image-wrap {
193
+ -webkit-background-size: cover;
194
  background-size: cover;
195
  overflow: hidden;
196
  }
318
  height: 1024px !important;
319
  background: #111;
320
  padding: 40px 10px 70px;
321
+ -webkit-border-radius: 30px;
322
  border-radius: 30px;
323
  }
324
  #TB_iframeContent.tablet.landscape {
329
  height: 640px !important;
330
  background: #111;
331
  padding: 40px 10px 70px;
332
+ -webkit-border-radius: 30px;
333
  border-radius: 30px;
334
  }
335
  #TB_iframeContent.mobile.landscape {
352
  color: #0a0c0d;
353
  text-align: left;
354
  bottom: 0;
355
+ -webkit-box-shadow: none;
356
  box-shadow: none;
357
+ -webkit-box-pack: justify;
358
+ -webkit-justify-content: space-between;
359
+ -moz-box-pack: justify;
360
+ -ms-flex-pack: justify;
361
  justify-content: space-between;
362
+ -webkit-box-align: center;
363
+ -webkit-align-items: center;
364
+ -moz-box-align: center;
365
+ -ms-flex-align: center;
366
  align-items: center;
367
  padding: 1em 1em 1em 1.5em;
368
  }
369
  @media all and (min-width: 769px) {
370
  #TB_window #TB_title {
371
+ -js-display: flex;
372
+ display: -webkit-box;
373
+ display: -webkit-flex;
374
+ display: -moz-box;
375
+ display: -ms-flexbox;
376
  display: flex;
377
  }
378
  }
390
  }
391
 
392
  #TB_window #TB_closeWindowButton:focus .tb-close-icon {
393
+ -webkit-box-shadow: none;
394
  box-shadow: none;
395
  color: #666;
396
  }
416
  }
417
  .responsive-view a:focus {
418
  outline: none;
419
+ -webkit-box-shadow: none;
420
  box-shadow: none;
421
  }
422
  #TB_window.tablet #TB_iframeContent,
442
  top: 50%;
443
  text-align: center;
444
  color: #555;
445
+ -webkit-transform: translate(-50%, -40%);
446
+ -ms-transform: translate(-50%, -40%);
447
  transform: translate(-50%, -40%);
448
  }
449
  .top .site-loading {
450
  top: 50%;
451
+ -webkit-transform: translate(-50%, -50%);
452
+ -ms-transform: translate(-50%, -50%);
453
  transform: translate(-50%, -50%);
454
  }
455
 
509
  .wcf-template-header .filter-links li a:hove,
510
  .wcf-template-header .filter-links li a:focus {
511
  outline: none;
512
+ -webkit-box-shadow: none;
513
  box-shadow: none;
514
  }
515
  .wcf-template-header .filter-links li .current {
520
 
521
  .wcf-flow-search-input {
522
  border: none;
523
+ -webkit-box-shadow: none;
524
  box-shadow: none;
525
  border-bottom: 1px solid #eee;
526
  line-height: 1.8;
544
 
545
  #wcf-start-from-scratch .inner {
546
  background: transparent;
547
+ -webkit-box-shadow: none;
548
  box-shadow: none;
549
  width: 94%;
550
  margin: 0 auto;
559
  }
560
 
561
  #wcf-scratch-steps-categories select{
562
+ -webkit-border-radius: 0;
563
  border-radius: 0;
564
  height: 29px;
565
  border: 1px solid;
566
  border-color: #9e9e9e;
567
  border-width: 1px;
568
+ -webkit-box-shadow: none;
569
  box-shadow: none;
570
  padding: 2px;
571
  line-height: 29px;
580
 
581
  .wcf-search-form .wcf-flow-search-input {
582
  border: none;
583
+ -webkit-box-shadow: none;
584
  box-shadow: none;
585
  border-bottom: 1px solid #eee;
586
  line-height: 1.8;
590
  font-size: 1em;
591
  }
592
  .wcf-search-form .wcf-flow-search-input:focus {
593
+ -webkit-box-shadow: none;
594
  box-shadow: none;
595
  border-color: #ccc;
596
  }
635
  top: 0;
636
  left: 0;
637
  background: rgba(0, 0, 0, 0.7);
638
+ -webkit-transition: opacity 500ms;
639
  transition: opacity 500ms;
640
  visibility: hidden;
641
  opacity: 0;
644
  -moz-user-select: none;
645
  -ms-user-select: none;
646
  user-select: none;
647
+ -webkit-transition: none;
648
  transition: none;
649
  }
650
 
658
  max-width: 1200px;
659
  background-color: #fff;
660
  position: absolute;
661
+ -webkit-border-radius: 3px;
662
  border-radius: 3px;
663
  top: 40%;
664
  left: 50%;
665
+ -webkit-transform: translate(-50%, -35%);
666
+ -ms-transform: translate(-50%, -35%);
667
  transform: translate(-50%, -35%);
668
  width: 70%;
669
  min-height: 450px;
678
  float: left;
679
  margin: 15px;
680
  text-align: center;
681
+ -webkit-box-shadow: 0 0 5px 1px rgba(204, 204, 204, 0.3);
682
  box-shadow: 0 0 5px 1px rgba(204, 204, 204, 0.3);
683
  }
684
 
701
 
702
  @media only screen and (min-width: 768px) {
703
  .wcf-templates-popup-content .inner{
704
+ width: -webkit-calc(25% - 30px);
705
  width: calc(25% - 30px);
706
  }
707
  }
761
  }
762
 
763
  .wcf-template-header {
764
+ -moz-box-align: center;
765
  align-items: center;
766
  background: #fff;
767
+ -webkit-box-shadow: 0 0 8px rgba(0,0,0,.2);
768
  box-shadow: 0 0 8px rgba(0,0,0,.2);
769
+ -js-display: flex;
770
+ display: -webkit-box;
771
+ display: -webkit-flex;
772
+ display: -moz-box;
773
+ display: -ms-flexbox;
774
  display: flex;
775
  -webkit-box-align: center;
776
  -webkit-align-items: center;
778
  -webkit-box-pack: justify;
779
  -webkit-justify-content: space-between;
780
  -ms-flex-pack: justify;
781
+ -moz-box-pack: justify;
782
  justify-content: space-between;
783
  padding: 0 15px;
784
  min-height: 50px;
792
  font-weight: normal;
793
  font-style: normal;
794
  text-align: center;
795
+ -webkit-transition: color .1s ease-in 0;
796
  transition: color .1s ease-in 0;
797
  -webkit-font-smoothing: antialiased;
798
  -moz-osx-font-smoothing: grayscale;
846
  .wcf-tab.nav-tabs > li > a:focus,
847
  .wcf-tab.nav-tabs > li > a:focus{
848
  outline: none;
849
+ -webkit-box-shadow: none;
850
  box-shadow: none;
851
  }
852
 
898
  right: 0;
899
  max-width: 100%;
900
  max-height: 100%;
901
+ -webkit-transform: translate(-50%, -50%);
902
+ -ms-transform: translate(-50%, -50%);
903
  transform: translate(-50%, -50%);
904
  z-index: 99999;
905
  }
954
  #wcf-remote-filters a:focus,
955
  #wcf-remote-filters .filter-links li:focus {
956
  outline: none;
957
+ -webkit-box-shadow: none;
958
  box-shadow: none;
959
  }
960
  #wcf-remote-filters .filter-links li a {
982
  }
983
 
984
  .wcf-templates-popup-overlay a {
985
+ -webkit-transition: none;
986
  transition: none;
987
  }
988
 
1001
 
1002
  #wcf-remote-content .wcf-install-plugin::focus {
1003
  border-color: none;
1004
+ -webkit-box-shadow: none;
1005
  box-shadow: none;
1006
  }
1007
 
1009
  background: none;
1010
  padding: 0;
1011
  font-size: 1rem;
1012
+ -webkit-box-shadow: none;
1013
  box-shadow: none;
1014
  border: none;
1015
  margin: 0 0 0 3px;
assets/js/checkout-template.js CHANGED
@@ -117,27 +117,35 @@
117
  var wrapper = $('.woocommerce-' + type + '-fields' );
118
 
119
  setTimeout(function() {
120
- var column_three = wrapper.find('.wcf-form-col-3');
121
  column_three.css( 'clear', '' );
122
  column_three.first().css( 'clear', 'left' );
 
 
 
 
 
 
 
 
123
  }, 100);
124
  }
125
 
126
- address_fields_management( 'billing' );
127
- address_fields_management( 'shipping' );
128
 
129
  var billing_country = $('.wcf-embed-checkout-form .woocommerce-checkout').find('#billing_country');
130
 
131
  billing_country.on( 'change', function(e) {
132
 
133
- address_fields_management( 'billing' );
134
  } );
135
 
136
  var shipping_country = $('.wcf-embed-checkout-form .woocommerce-checkout').find('#shipping_country');
137
 
138
  shipping_country.on( 'change', function(e) {
139
 
140
- address_fields_management( 'shipping' );
141
 
142
  } );
143
  }
@@ -155,15 +163,21 @@
155
 
156
  var wcf_persistent_data = function(){
157
 
 
 
 
 
158
  if ( false === wcf_check_is_local_storage() ) {
159
  return;
160
  }
161
 
 
 
162
  var wcf_form_data = {
163
  set : function (){
164
 
165
  var checkout_data = [];
166
- var checkout_form = $('form.woocommerce-checkout');
167
 
168
  localStorage.removeItem('cartflows_checkout_form');
169
 
@@ -190,7 +204,7 @@
190
 
191
  wcf_form_data.get();
192
 
193
- $("form.woocommerce-checkout input, form.woocommerce-checkout select").change( function() {
194
  wcf_form_data.set();
195
  });
196
  }
117
  var wrapper = $('.woocommerce-' + type + '-fields' );
118
 
119
  setTimeout(function() {
120
+ var column_three = wrapper.find('.wcf-column-33');
121
  column_three.css( 'clear', '' );
122
  column_three.first().css( 'clear', 'left' );
123
+ // column_three.first().css( 'margin-right', '10px' );
124
+ // column_three.last().css( 'margin-left', '10px' );
125
+ }, 100);
126
+
127
+ setTimeout(function() {
128
+ var column_fifty = wrapper.find('.wcf-column-50');
129
+ column_fifty.css( 'clear', '' );
130
+ column_fifty.last().css( 'clear', 'left' );
131
  }, 100);
132
  }
133
 
134
+ // address_fields_management( 'billing' );
135
+ // address_fields_management( 'shipping' );
136
 
137
  var billing_country = $('.wcf-embed-checkout-form .woocommerce-checkout').find('#billing_country');
138
 
139
  billing_country.on( 'change', function(e) {
140
 
141
+ // address_fields_management( 'billing' );
142
  } );
143
 
144
  var shipping_country = $('.wcf-embed-checkout-form .woocommerce-checkout').find('#shipping_country');
145
 
146
  shipping_country.on( 'change', function(e) {
147
 
148
+ // address_fields_management( 'shipping' );
149
 
150
  } );
151
  }
163
 
164
  var wcf_persistent_data = function(){
165
 
166
+ if( 'yes' != cartflows.allow_persistance ){
167
+ return;
168
+ }
169
+
170
  if ( false === wcf_check_is_local_storage() ) {
171
  return;
172
  }
173
 
174
+ var checkout_cust_form = 'form.woocommerce-checkout #customer_details';
175
+
176
  var wcf_form_data = {
177
  set : function (){
178
 
179
  var checkout_data = [];
180
+ var checkout_form = $('form.woocommerce-checkout #customer_details');
181
 
182
  localStorage.removeItem('cartflows_checkout_form');
183
 
204
 
205
  wcf_form_data.get();
206
 
207
+ $( checkout_cust_form + " input, " + checkout_cust_form + " select").change( function() {
208
  wcf_form_data.set();
209
  });
210
  }
cartflows.php CHANGED
@@ -1,24 +1,24 @@
1
- <?php
2
- /**
3
- * Plugin Name: CartFlows
4
- * Plugin URI: https://cartflows.com/
5
- * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
- * Version: 1.1.5
7
- * Author: CartFlows Inc
8
- * Author URI: https://cartflows.com/
9
- * Text Domain: cartflows
10
- * WC requires at least: 3.0
11
- * WC tested up to: 3.5.1
12
- *
13
- * @package CartFlows
14
- */
15
-
16
- /**
17
- * Set constants.
18
- */
19
- define( 'CARTFLOWS_FILE', __FILE__ );
20
-
21
- /**
22
- * Extensions
23
- */
24
- require_once 'classes/class-cartflows-loader.php';
1
+ <?php
2
+ /**
3
+ * Plugin Name: CartFlows
4
+ * Plugin URI: https://cartflows.com/
5
+ * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
+ * Version: 1.1.6
7
+ * Author: CartFlows Inc
8
+ * Author URI: https://cartflows.com/
9
+ * Text Domain: cartflows
10
+ * WC requires at least: 3.0
11
+ * WC tested up to: 3.5.1
12
+ *
13
+ * @package CartFlows
14
+ */
15
+
16
+ /**
17
+ * Set constants.
18
+ */
19
+ define( 'CARTFLOWS_FILE', __FILE__ );
20
+
21
+ /**
22
+ * Extensions
23
+ */
24
+ require_once 'classes/class-cartflows-loader.php';
changelog.txt CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  Version 1.1.5 - Wednesday, 23rd January 2019
2
  - Fix: Beaver Builder Pro version conflict while installing templates.
3
  - Fix: Elementor builder white screen while editing checkout page and cart is empty.
1
+ Version 1.1.6 - Thursday, 07th February 2019
2
+ - Improvement: Added compatibility for a future release of CartFlows Pro's checkout field editor.
3
+ - Fix: Permalink conflict with listing theme.
4
+ - Fix: Thrive architect template popup conflict.
5
+ - Fix: Coupon code not applied in case of multiple products selection option is selected.
6
+
7
  Version 1.1.5 - Wednesday, 23rd January 2019
8
  - Fix: Beaver Builder Pro version conflict while installing templates.
9
  - Fix: Elementor builder white screen while editing checkout page and cart is empty.
classes/class-cartflows-admin.php CHANGED
@@ -1,420 +1,437 @@
1
- <?php
2
- /**
3
- * CartFlows Admin.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Class Cartflows_Admin.
10
- */
11
- class Cartflows_Admin {
12
-
13
- /**
14
- * Calls on initialization
15
- *
16
- * @since 1.0.0
17
- */
18
- public static function init() {
19
-
20
- self::initialise_plugin();
21
- self::init_hooks();
22
- }
23
-
24
- /**
25
- * Init Hooks.
26
- *
27
- * @since 1.0.0
28
- * @return void
29
- */
30
- static public function init_hooks() {
31
-
32
- if ( ! is_admin() ) {
33
- return;
34
- }
35
-
36
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-admin-fields.php';
37
-
38
- // Add CARTFLOWS menu option to admin.
39
- add_action( 'network_admin_menu', __CLASS__ . '::menu' );
40
- add_action( 'admin_menu', __CLASS__ . '::menu' );
41
- add_action( 'admin_menu', __CLASS__ . '::submenu', 999 );
42
-
43
- add_action( 'cartflows_render_admin_content', __CLASS__ . '::render_content' );
44
-
45
- // Enqueue admin scripts.
46
- if ( isset( $_REQUEST['page'] ) && CARTFLOWS_SETTINGS == $_REQUEST['page'] ) {
47
-
48
- add_action( 'admin_enqueue_scripts', __CLASS__ . '::styles_scripts' );
49
-
50
- self::save_settings();
51
- }
52
-
53
- /* Global Addmin Script */
54
- add_action( 'admin_enqueue_scripts', __CLASS__ . '::global_admin_scripts', 20 );
55
-
56
- add_action( 'admin_footer', __CLASS__ . '::global_admin_data', 9555 );
57
- }
58
-
59
- /**
60
- * Initialises the Plugin Name.
61
- *
62
- * @since 1.0.0
63
- * @return void
64
- */
65
- static public function initialise_plugin() {
66
-
67
- $name = 'Cartflows';
68
- $short_name = 'Cflows';
69
-
70
- define( 'CARTFLOWS_PLUGIN_NAME', $name );
71
- define( 'CARTFLOWS_PLUGIN_SHORT_NAME', $short_name );
72
- }
73
-
74
- /**
75
- * Renders the admin settings menu.
76
- *
77
- * @since 1.0.0
78
- * @return void
79
- */
80
- static public function menu() {
81
-
82
- if ( ! current_user_can( 'manage_options' ) ) {
83
- return;
84
- }
85
-
86
- add_menu_page(
87
- 'CartFlows',
88
- 'CartFlows',
89
- 'manage_options',
90
- CARTFLOWS_SLUG,
91
- __CLASS__ . '::render',
92
- 'data:image/svg+xml;base64,' . base64_encode( file_get_contents( CARTFLOWS_DIR . 'assets/images/cartflows-icon.svg' ) ),
93
- 39.7
94
- );
95
-
96
- }
97
-
98
- /**
99
- * Add submenu to admin menu.
100
- *
101
- * @since 1.0.0
102
- */
103
- static function submenu() {
104
-
105
- $parent_slug = CARTFLOWS_SLUG;
106
- $page_title = __( 'Settings', 'cartflows' );
107
- $menu_title = __( 'Settings', 'cartflows' );
108
- $capability = 'manage_options';
109
- $menu_slug = 'cartflows_settings';
110
- $callback = __CLASS__ . '::render';
111
-
112
- add_submenu_page(
113
- $parent_slug,
114
- $page_title,
115
- $menu_title,
116
- $capability,
117
- $menu_slug,
118
- $callback
119
- );
120
- }
121
-
122
- /**
123
- * Renders the admin settings.
124
- *
125
- * @since 1.0.0
126
- * @return void
127
- */
128
- static public function render() {
129
- $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( $_GET['action'] ) : '';
130
- $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
131
- $action = str_replace( '_', '-', $action );
132
-
133
- // Enable header icon filter below.
134
- $header_wrapper_class = apply_filters( 'cartflows_header_wrapper_class', array( $action ) );
135
-
136
- include_once CARTFLOWS_DIR . 'includes/admin/cartflows-admin.php';
137
- }
138
-
139
- /**
140
- * Renders the admin settings content.
141
- *
142
- * @since 1.0.0
143
- * @return void
144
- */
145
- static public function render_content() {
146
-
147
- $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( $_GET['action'] ) : '';
148
- $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
149
- $action = str_replace( '_', '-', $action );
150
- $action = 'general';
151
-
152
- $header_wrapper_class = apply_filters( 'cartflows_header_wrapper_class', array( $action ) );
153
-
154
- include_once CARTFLOWS_DIR . 'includes/admin/cartflows-general.php';
155
- }
156
-
157
- /**
158
- * Save Global Setting options.
159
- *
160
- * @since 1.0.0
161
- */
162
- static public function save_common_settings() {
163
-
164
- if ( isset( $_POST['cartflows-common-settings-nonce'] ) && wp_verify_nonce( $_POST['cartflows-common-settings-nonce'], 'cartflows-common-settings' ) ) {
165
-
166
- $url = $_SERVER['REQUEST_URI'];
167
- $input_settings = array();
168
- $new_settings = array();
169
-
170
- if ( isset( $_POST['_cartflows_common'] ) ) {
171
-
172
- $input_settings = $_POST['_cartflows_common'];
173
-
174
- // Loop through the input and sanitize each of the values.
175
- foreach ( $input_settings as $key => $val ) {
176
-
177
- if ( is_array( $val ) ) {
178
- foreach ( $val as $k => $v ) {
179
- $new_settings[ $key ][ $k ] = ( isset( $val[ $k ] ) ) ? sanitize_text_field( $v ) : '';
180
- }
181
- } else {
182
- $new_settings[ $key ] = ( isset( $input_settings[ $key ] ) ) ? sanitize_text_field( $val ) : '';
183
- }
184
- }
185
- }
186
-
187
- Cartflows_Helper::update_admin_settings_option( '_cartflows_common', $new_settings, true );
188
-
189
- $query = array(
190
- 'message' => 'saved',
191
- );
192
-
193
- $redirect_to = add_query_arg( $query, $url );
194
-
195
- wp_redirect( $redirect_to );
196
- exit;
197
- } // End if statement.
198
- }
199
-
200
- /**
201
- * Check is cartflows admin.
202
- *
203
- * @since 1.0.0
204
- * @return boolean
205
- */
206
- static public function is_global_admin() {
207
-
208
- $current_screen = get_current_screen();
209
-
210
- if (
211
- is_object( $current_screen ) &&
212
- isset( $current_screen->post_type ) &&
213
- ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ||
214
- CARTFLOWS_STEP_POST_TYPE === $current_screen->post_type
215
- )
216
- ) {
217
- return true;
218
- }
219
- return false;
220
- }
221
-
222
- /**
223
- * Check is flow admin.
224
- *
225
- * @since 1.0.0
226
- * @return boolean
227
- */
228
- static public function is_flow_edit_admin() {
229
-
230
- $current_screen = get_current_screen();
231
-
232
- if (
233
- is_object( $current_screen ) &&
234
- isset( $current_screen->post_type ) &&
235
- ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ) &&
236
- isset( $current_screen->base ) &&
237
- ( 'post' === $current_screen->base )
238
- ) {
239
- return true;
240
- }
241
- return false;
242
- }
243
-
244
- /**
245
- * Global Admin Scripts.
246
- *
247
- * @since 1.0.0
248
- */
249
- static public function global_admin_scripts() {
250
-
251
- $localize = array(
252
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
253
- 'ajax_nonce' => wp_create_nonce( 'cartflows-nonce' ),
254
- );
255
-
256
- wp_localize_script( 'jquery', 'cartflows_admin', apply_filters( 'cartflows_admin_js_localize', $localize ) );
257
-
258
- if ( self::is_global_admin() ) {
259
-
260
- // Styles.
261
- wp_enqueue_style( 'cartflows-global-admin', CARTFLOWS_URL . 'admin/assets/css/global-admin.css', array(), CARTFLOWS_VER );
262
- wp_style_add_data( 'cartflows-global-admin', 'rtl', 'replace' );
263
-
264
- wp_enqueue_script(
265
- 'wcf-global-admin',
266
- CARTFLOWS_URL . 'admin/assets/js/global-admin.js',
267
- array( 'jquery' ),
268
- CARTFLOWS_VER,
269
- true
270
- );
271
-
272
- do_action( 'cartflows_global_admin_scripts' );
273
- }
274
- }
275
-
276
- /**
277
- * Global Admin Data.
278
- *
279
- * @since 1.0.0
280
- */
281
- static public function global_admin_data() {
282
-
283
- $current_screen = get_current_screen();
284
-
285
- if ( ! $current_screen ) {
286
- return;
287
- }
288
-
289
- if ( 'edit-' . CARTFLOWS_FLOW_POST_TYPE != $current_screen->id ) {
290
- return;
291
- }
292
-
293
- $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
294
- ?>
295
-
296
- <div id="wcf-remote-flow-importer" class="wcf-templates-popup-overlay">
297
- <div class="wcf-templates-popup-content">
298
- <div class="spinner"></div>
299
- <div class="wcf-templates-wrap wcf-templates-wrap-flows">
300
-
301
- <div id="wcf-remote-flow-actions" class="wcf-template-header">
302
- <div class="wcf-template-logo-wrap">
303
- <span class="wcf-cartflows-logo-img">
304
- <span class="cartflows-icon"></span>
305
- </span>
306
- <span class="wcf-cartflows-title"><?php _e( 'Flows Library', 'cartflows' ); ?></span>
307
- </div>
308
- <div class="wcf-tab-wrapper">
309
- <?php if ( 'other' !== $default_page_builder ) { ?>
310
- <div id="wcf-get-started-steps">
311
- <ul class="filter-links ">
312
- <li>
313
- <a href="#" class="current" data-slug="ready-templates" data-title="<?php _e( 'Ready Templates', 'cartflows' ); ?>"><?php _e( 'Ready Templates', 'cartflows' ); ?></a>
314
- </li>
315
- <li>
316
- <a href="#" data-slug="canvas" data-title="<?php _e( 'Create Your Own', 'cartflows' ); ?>"><?php _e( 'Create Your Own', 'cartflows' ); ?></a>
317
- </li>
318
- </ul>
319
- </div>
320
- <?php } ?>
321
- </div>
322
- <div class="wcf-popup-close-wrap">
323
- <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
324
- </div>
325
- </div>
326
- <!-- <div class="wcf-search-form">
327
- <label class="screen-reader-text" for="wp-filter-search-input"><?php _e( 'Search Sites', 'cartflows' ); ?> </label>
328
- <input placeholder="<?php _e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
329
- </div> -->
330
-
331
- <div id="wcf-remote-content">
332
- <?php if ( 'other' !== $default_page_builder ) { ?>
333
- <div id="wcf-ready-templates">
334
- <div id="wcf-remote-filters">
335
- <div id="wcf-page-builders"></div>
336
- <div id="wcf-categories"></div>
337
- </div>
338
- <div class="wcf-page-builder-notice"></div>
339
- <div id="wcf-remote-flow-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
340
- <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
341
- </div>
342
- <?php } ?>
343
- <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
344
- <div class="inner">
345
- <a href="#" class="button button-hero button-primary cartflows-flow-import-blank"><?php _e( 'Design Your Flow', 'cartflows' ); ?></a>
346
- <p class="wcf-learn-how"><a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank"><?php _e( 'Learn How', 'cartflows' ); ?> <i class="dashicons dashicons-external"></i></a></p>
347
- </div>
348
- </div>
349
- </div>
350
- </div>
351
- </div>
352
- </div>
353
-
354
- <?php
355
- }
356
-
357
- /**
358
- * Enqueues the needed CSS/JS for the builder's admin settings page.
359
- *
360
- * @since 1.0.0
361
- */
362
- static public function styles_scripts() {
363
-
364
- // Styles.
365
- wp_enqueue_style( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/css/admin-menu-settings.css', array(), CARTFLOWS_VER );
366
- wp_style_add_data( 'cartflows-admin-settings', 'rtl', 'replace' );
367
-
368
- // Script.
369
- wp_enqueue_script( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/js/admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), CARTFLOWS_VER );
370
-
371
- $localize = array(
372
- 'ajax_nonce' => wp_create_nonce( 'cartflows-widget-nonce' ),
373
- );
374
-
375
- wp_localize_script( 'cartflows-admin-settings', 'cartflows', apply_filters( 'cartflows_js_localize', $localize ) );
376
- }
377
-
378
- /**
379
- * Save All admin settings here
380
- */
381
- static public function save_settings() {
382
-
383
- // Only admins can save settings.
384
- if ( ! current_user_can( 'manage_options' ) ) {
385
- return;
386
- }
387
-
388
- self::save_common_settings();
389
-
390
- // Let extensions hook into saving.
391
- do_action( 'cartflows_admin_settings_save' );
392
- }
393
-
394
- /**
395
- * Get and return page URL
396
- *
397
- * @param string $menu_slug Menu name.
398
- * @since 1.0.0
399
- * @return string page url
400
- */
401
- static public function get_page_url( $menu_slug ) {
402
-
403
- $parent_page = self::$default_menu_position;
404
-
405
- if ( strpos( $parent_page, '?' ) !== false ) {
406
- $query_var = '&page=' . self::$plugin_slug;
407
- } else {
408
- $query_var = '?page=' . self::$plugin_slug;
409
- }
410
-
411
- $parent_page_url = admin_url( $parent_page . $query_var );
412
-
413
- $url = $parent_page_url . '&action=' . $menu_slug;
414
-
415
- return esc_url( $url );
416
- }
417
-
418
- }
419
-
420
- Cartflows_Admin::init();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CartFlows Admin.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Class Cartflows_Admin.
10
+ */
11
+ class Cartflows_Admin {
12
+
13
+ /**
14
+ * Calls on initialization
15
+ *
16
+ * @since 1.0.0
17
+ */
18
+ public static function init() {
19
+
20
+ self::initialise_plugin();
21
+ self::init_hooks();
22
+ }
23
+
24
+ /**
25
+ * Init Hooks.
26
+ *
27
+ * @since 1.0.0
28
+ * @return void
29
+ */
30
+ static public function init_hooks() {
31
+
32
+ if ( ! is_admin() ) {
33
+ return;
34
+ }
35
+
36
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-admin-fields.php';
37
+
38
+ // Add CARTFLOWS menu option to admin.
39
+ add_action( 'network_admin_menu', __CLASS__ . '::menu' );
40
+ add_action( 'admin_menu', __CLASS__ . '::menu' );
41
+ add_action( 'admin_menu', __CLASS__ . '::submenu', 999 );
42
+
43
+ add_action( 'cartflows_render_admin_content', __CLASS__ . '::render_content' );
44
+
45
+ // Enqueue admin scripts.
46
+ if ( isset( $_REQUEST['page'] ) && CARTFLOWS_SETTINGS == $_REQUEST['page'] ) {
47
+
48
+ add_action( 'admin_enqueue_scripts', __CLASS__ . '::styles_scripts' );
49
+
50
+ self::save_settings();
51
+ }
52
+
53
+ /* Global Addmin Script */
54
+ add_action( 'admin_enqueue_scripts', __CLASS__ . '::global_admin_scripts', 20 );
55
+
56
+ add_action( 'admin_footer', __CLASS__ . '::global_admin_data', 9555 );
57
+
58
+ /* Add lite version class to body */
59
+ add_action( 'admin_body_class', __CLASS__ . '::add_admin_body_class' );
60
+ }
61
+
62
+ /**
63
+ * Initialises the Plugin Name.
64
+ *
65
+ * @since 1.0.0
66
+ * @return void
67
+ */
68
+ static public function initialise_plugin() {
69
+
70
+ $name = 'Cartflows';
71
+ $short_name = 'Cflows';
72
+
73
+ define( 'CARTFLOWS_PLUGIN_NAME', $name );
74
+ define( 'CARTFLOWS_PLUGIN_SHORT_NAME', $short_name );
75
+ }
76
+
77
+ /**
78
+ * Renders the admin settings menu.
79
+ *
80
+ * @since 1.0.0
81
+ * @return void
82
+ */
83
+ static public function menu() {
84
+
85
+ if ( ! current_user_can( 'manage_options' ) ) {
86
+ return;
87
+ }
88
+
89
+ add_menu_page(
90
+ 'CartFlows',
91
+ 'CartFlows',
92
+ 'manage_options',
93
+ CARTFLOWS_SLUG,
94
+ __CLASS__ . '::render',
95
+ 'data:image/svg+xml;base64,' . base64_encode( file_get_contents( CARTFLOWS_DIR . 'assets/images/cartflows-icon.svg' ) ),
96
+ 39.7
97
+ );
98
+
99
+ }
100
+
101
+ /**
102
+ * Add submenu to admin menu.
103
+ *
104
+ * @since 1.0.0
105
+ */
106
+ static function submenu() {
107
+
108
+ $parent_slug = CARTFLOWS_SLUG;
109
+ $page_title = __( 'Settings', 'cartflows' );
110
+ $menu_title = __( 'Settings', 'cartflows' );
111
+ $capability = 'manage_options';
112
+ $menu_slug = 'cartflows_settings';
113
+ $callback = __CLASS__ . '::render';
114
+
115
+ add_submenu_page(
116
+ $parent_slug,
117
+ $page_title,
118
+ $menu_title,
119
+ $capability,
120
+ $menu_slug,
121
+ $callback
122
+ );
123
+ }
124
+
125
+ /**
126
+ * Renders the admin settings.
127
+ *
128
+ * @since 1.0.0
129
+ * @return void
130
+ */
131
+ static public function render() {
132
+ $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( $_GET['action'] ) : '';
133
+ $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
134
+ $action = str_replace( '_', '-', $action );
135
+
136
+ // Enable header icon filter below.
137
+ $header_wrapper_class = apply_filters( 'cartflows_header_wrapper_class', array( $action ) );
138
+
139
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-admin.php';
140
+ }
141
+
142
+ /**
143
+ * Renders the admin settings content.
144
+ *
145
+ * @since 1.0.0
146
+ * @return void
147
+ */
148
+ static public function render_content() {
149
+
150
+ $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( $_GET['action'] ) : '';
151
+ $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
152
+ $action = str_replace( '_', '-', $action );
153
+ $action = 'general';
154
+
155
+ $header_wrapper_class = apply_filters( 'cartflows_header_wrapper_class', array( $action ) );
156
+
157
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-general.php';
158
+ }
159
+
160
+ /**
161
+ * Save Global Setting options.
162
+ *
163
+ * @since 1.0.0
164
+ */
165
+ static public function save_common_settings() {
166
+
167
+ if ( isset( $_POST['cartflows-common-settings-nonce'] ) && wp_verify_nonce( $_POST['cartflows-common-settings-nonce'], 'cartflows-common-settings' ) ) {
168
+
169
+ $url = $_SERVER['REQUEST_URI'];
170
+ $input_settings = array();
171
+ $new_settings = array();
172
+
173
+ if ( isset( $_POST['_cartflows_common'] ) ) {
174
+
175
+ $input_settings = $_POST['_cartflows_common'];
176
+
177
+ // Loop through the input and sanitize each of the values.
178
+ foreach ( $input_settings as $key => $val ) {
179
+
180
+ if ( is_array( $val ) ) {
181
+ foreach ( $val as $k => $v ) {
182
+ $new_settings[ $key ][ $k ] = ( isset( $val[ $k ] ) ) ? sanitize_text_field( $v ) : '';
183
+ }
184
+ } else {
185
+ $new_settings[ $key ] = ( isset( $input_settings[ $key ] ) ) ? sanitize_text_field( $val ) : '';
186
+ }
187
+ }
188
+ }
189
+
190
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_common', $new_settings, true );
191
+
192
+ $query = array(
193
+ 'message' => 'saved',
194
+ );
195
+
196
+ $redirect_to = add_query_arg( $query, $url );
197
+
198
+ wp_redirect( $redirect_to );
199
+ exit;
200
+ } // End if statement.
201
+ }
202
+
203
+ /**
204
+ * Check is cartflows admin.
205
+ *
206
+ * @since 1.0.0
207
+ * @return boolean
208
+ */
209
+ static public function is_global_admin() {
210
+
211
+ $current_screen = get_current_screen();
212
+
213
+ if (
214
+ is_object( $current_screen ) &&
215
+ isset( $current_screen->post_type ) &&
216
+ ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ||
217
+ CARTFLOWS_STEP_POST_TYPE === $current_screen->post_type
218
+ )
219
+ ) {
220
+ return true;
221
+ }
222
+ return false;
223
+ }
224
+
225
+ /**
226
+ * Check is flow admin.
227
+ *
228
+ * @since 1.0.0
229
+ * @return boolean
230
+ */
231
+ static public function is_flow_edit_admin() {
232
+
233
+ $current_screen = get_current_screen();
234
+
235
+ if (
236
+ is_object( $current_screen ) &&
237
+ isset( $current_screen->post_type ) &&
238
+ ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ) &&
239
+ isset( $current_screen->base ) &&
240
+ ( 'post' === $current_screen->base )
241
+ ) {
242
+ return true;
243
+ }
244
+ return false;
245
+ }
246
+
247
+ /**
248
+ * Global Admin Scripts.
249
+ *
250
+ * @since 1.0.0
251
+ */
252
+ static public function global_admin_scripts() {
253
+
254
+ $localize = array(
255
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
256
+ 'ajax_nonce' => wp_create_nonce( 'cartflows-nonce' ),
257
+ );
258
+
259
+ wp_localize_script( 'jquery', 'cartflows_admin', apply_filters( 'cartflows_admin_js_localize', $localize ) );
260
+
261
+ if ( self::is_global_admin() ) {
262
+
263
+ // Styles.
264
+ wp_enqueue_style( 'cartflows-global-admin', CARTFLOWS_URL . 'admin/assets/css/global-admin.css', array(), CARTFLOWS_VER );
265
+ wp_style_add_data( 'cartflows-global-admin', 'rtl', 'replace' );
266
+
267
+ wp_enqueue_script(
268
+ 'wcf-global-admin',
269
+ CARTFLOWS_URL . 'admin/assets/js/global-admin.js',
270
+ array( 'jquery' ),
271
+ CARTFLOWS_VER,
272
+ true
273
+ );
274
+
275
+ do_action( 'cartflows_global_admin_scripts' );
276
+ }
277
+ }
278
+
279
+ /**
280
+ * Global Admin Data.
281
+ *
282
+ * @since 1.0.0
283
+ */
284
+ static public function global_admin_data() {
285
+
286
+ $current_screen = get_current_screen();
287
+
288
+ if ( ! $current_screen ) {
289
+ return;
290
+ }
291
+
292
+ if ( 'edit-' . CARTFLOWS_FLOW_POST_TYPE != $current_screen->id ) {
293
+ return;
294
+ }
295
+
296
+ $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
297
+ ?>
298
+
299
+ <div id="wcf-remote-flow-importer" class="wcf-templates-popup-overlay">
300
+ <div class="wcf-templates-popup-content">
301
+ <div class="spinner"></div>
302
+ <div class="wcf-templates-wrap wcf-templates-wrap-flows">
303
+
304
+ <div id="wcf-remote-flow-actions" class="wcf-template-header">
305
+ <div class="wcf-template-logo-wrap">
306
+ <span class="wcf-cartflows-logo-img">
307
+ <span class="cartflows-icon"></span>
308
+ </span>
309
+ <span class="wcf-cartflows-title"><?php _e( 'Flows Library', 'cartflows' ); ?></span>
310
+ </div>
311
+ <div class="wcf-tab-wrapper">
312
+ <?php if ( 'other' !== $default_page_builder ) { ?>
313
+ <div id="wcf-get-started-steps">
314
+ <ul class="filter-links ">
315
+ <li>
316
+ <a href="#" class="current" data-slug="ready-templates" data-title="<?php _e( 'Ready Templates', 'cartflows' ); ?>"><?php _e( 'Ready Templates', 'cartflows' ); ?></a>
317
+ </li>
318
+ <li>
319
+ <a href="#" data-slug="canvas" data-title="<?php _e( 'Create Your Own', 'cartflows' ); ?>"><?php _e( 'Create Your Own', 'cartflows' ); ?></a>
320
+ </li>
321
+ </ul>
322
+ </div>
323
+ <?php } ?>
324
+ </div>
325
+ <div class="wcf-popup-close-wrap">
326
+ <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
327
+ </div>
328
+ </div>
329
+ <!-- <div class="wcf-search-form">
330
+ <label class="screen-reader-text" for="wp-filter-search-input"><?php _e( 'Search Sites', 'cartflows' ); ?> </label>
331
+ <input placeholder="<?php _e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
332
+ </div> -->
333
+
334
+ <div id="wcf-remote-content">
335
+ <?php if ( 'other' !== $default_page_builder ) { ?>
336
+ <div id="wcf-ready-templates">
337
+ <div id="wcf-remote-filters">
338
+ <div id="wcf-page-builders"></div>
339
+ <div id="wcf-categories"></div>
340
+ </div>
341
+ <div class="wcf-page-builder-notice"></div>
342
+ <div id="wcf-remote-flow-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
343
+ <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
344
+ </div>
345
+ <?php } ?>
346
+ <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
347
+ <div class="inner">
348
+ <a href="#" class="button button-hero button-primary cartflows-flow-import-blank"><?php _e( 'Design Your Flow', 'cartflows' ); ?></a>
349
+ <p class="wcf-learn-how"><a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank"><?php _e( 'Learn How', 'cartflows' ); ?> <i class="dashicons dashicons-external"></i></a></p>
350
+ </div>
351
+ </div>
352
+ </div>
353
+ </div>
354
+ </div>
355
+ </div>
356
+
357
+ <?php
358
+ }
359
+
360
+ /**
361
+ * Enqueues the needed CSS/JS for the builder's admin settings page.
362
+ *
363
+ * @since 1.0.0
364
+ */
365
+ static public function styles_scripts() {
366
+
367
+ // Styles.
368
+ wp_enqueue_style( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/css/admin-menu-settings.css', array(), CARTFLOWS_VER );
369
+ wp_style_add_data( 'cartflows-admin-settings', 'rtl', 'replace' );
370
+
371
+ // Script.
372
+ wp_enqueue_script( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/js/admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), CARTFLOWS_VER );
373
+
374
+ $localize = array(
375
+ 'ajax_nonce' => wp_create_nonce( 'cartflows-widget-nonce' ),
376
+ );
377
+
378
+ wp_localize_script( 'cartflows-admin-settings', 'cartflows', apply_filters( 'cartflows_js_localize', $localize ) );
379
+ }
380
+
381
+ /**
382
+ * Save All admin settings here
383
+ */
384
+ static public function save_settings() {
385
+
386
+ // Only admins can save settings.
387
+ if ( ! current_user_can( 'manage_options' ) ) {
388
+ return;
389
+ }
390
+
391
+ self::save_common_settings();
392
+
393
+ // Let extensions hook into saving.
394
+ do_action( 'cartflows_admin_settings_save' );
395
+ }
396
+
397
+ /**
398
+ * Get and return page URL
399
+ *
400
+ * @param string $menu_slug Menu name.
401
+ * @since 1.0.0
402
+ * @return string page url
403
+ */
404
+ static public function get_page_url( $menu_slug ) {
405
+
406
+ $parent_page = self::$default_menu_position;
407
+
408
+ if ( strpos( $parent_page, '?' ) !== false ) {
409
+ $query_var = '&page=' . self::$plugin_slug;
410
+ } else {
411
+ $query_var = '?page=' . self::$plugin_slug;
412
+ }
413
+
414
+ $parent_page_url = admin_url( $parent_page . $query_var );
415
+
416
+ $url = $parent_page_url . '&action=' . $menu_slug;
417
+
418
+ return esc_url( $url );
419
+ }
420
+
421
+ /**
422
+ * Admin body classes.
423
+ *
424
+ * Body classes to be added to <body> tag in admin page
425
+ *
426
+ * @param String $classes body classes returned from the filter.
427
+ * @return String body classes to be added to <body> tag in admin page
428
+ */
429
+ static public function add_admin_body_class( $classes ) {
430
+
431
+ $classes .= ' cartflows-' . CARTFLOWS_VER;
432
+
433
+ return $classes;
434
+ }
435
+ }
436
+
437
+ Cartflows_Admin::init();
classes/class-cartflows-compatibility.php CHANGED
@@ -1,355 +1,374 @@
1
- <?php
2
- /**
3
- * Page builder compatibility
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- if ( ! class_exists( 'Cartflows_Compatibility' ) ) {
9
-
10
- /**
11
- * Class for page builder compatibility
12
- */
13
- class Cartflows_Compatibility {
14
-
15
- /**
16
- * Member Variable
17
- *
18
- * @var object instance
19
- */
20
- private static $instance;
21
-
22
- /**
23
- * Initiator
24
- */
25
- public static function get_instance() {
26
- if ( ! isset( self::$instance ) ) {
27
- self::$instance = new self;
28
- }
29
- return self::$instance;
30
- }
31
-
32
- /**
33
- * Constructor
34
- */
35
- public function __construct() {
36
-
37
- $this->load_files();
38
-
39
- // Override post meta.
40
- add_action( 'wp', array( $this, 'override_meta' ), 0 );
41
-
42
- add_action( 'wp_enqueue_scripts', array( $this, 'load_fontawesome' ), 10000 );
43
- }
44
-
45
- /**
46
- * Load page builder compatibility files
47
- */
48
- public function load_files() {
49
- if ( class_exists( '\Elementor\Plugin' ) ) {
50
- require_once CARTFLOWS_DIR . 'classes/class-cartflows-elementor-compatibility.php';
51
- }
52
-
53
- if ( $this->is_divi_enabled() ) {
54
- require_once CARTFLOWS_DIR . 'classes/class-cartflows-divi-compatibility.php';
55
- }
56
-
57
- if ( $this->is_bb_enabled() ) {
58
- require_once CARTFLOWS_DIR . 'classes/class-cartflows-bb-compatibility.php';
59
- }
60
-
61
- if ( class_exists( 'TCB_Post' ) ) {
62
- require_once CARTFLOWS_DIR . 'classes/class-cartflows-thrive-compatibility.php';
63
- }
64
- }
65
-
66
- /**
67
- * Check if it is beaver builder enabled.
68
- *
69
- * @since 1.1.4
70
- */
71
- public function is_bb_enabled() {
72
-
73
- if ( class_exists( 'FLBuilderModel' ) ) {
74
- return true;
75
- }
76
-
77
- return false;
78
- }
79
-
80
- /**
81
- * Check if elementor preview mode is on.
82
- */
83
- public function is_elementor_preview_mode() {
84
-
85
- if ( class_exists( '\Elementor\Plugin' ) ) {
86
-
87
- if ( \Elementor\Plugin::$instance->preview->is_preview_mode() ) {
88
- return true;
89
- }
90
- }
91
-
92
- return false;
93
- }
94
-
95
- /**
96
- * Get Current Theme.
97
- */
98
- public function get_current_theme() {
99
-
100
- $theme_name = '';
101
- $theme = wp_get_theme();
102
-
103
- if ( isset( $theme->parent_theme ) && '' != $theme->parent_theme || null != $theme->parent_theme ) {
104
- $theme_name = $theme->parent_theme;
105
- } else {
106
- $theme_name = $theme->name;
107
- }
108
-
109
- return $theme_name;
110
- }
111
-
112
- /**
113
- * Check if it is beaver builder preview mode
114
- */
115
- public function is_bb_preview_mode() {
116
-
117
- if ( class_exists( 'FLBuilderModel' ) ) {
118
- if ( FLBuilderModel::is_builder_active() ) {
119
- return true;
120
- } else {
121
- return false;
122
- }
123
- }
124
-
125
- return false;
126
- }
127
-
128
- /**
129
- * Check for page builder preview mode.
130
- */
131
- public function is_page_builder_preview() {
132
-
133
- if ( $this->is_elementor_preview_mode() || $this->is_bb_preview_mode() ) {
134
- return true;
135
- }
136
-
137
- return false;
138
- }
139
-
140
- /**
141
- * Check if divi builder enabled for post id.
142
- *
143
- * @param int $post_id post id.
144
- */
145
- public function is_divi_builder_enabled( $post_id ) {
146
-
147
- if ( function_exists( 'et_pb_is_pagebuilder_used' ) && et_pb_is_pagebuilder_used( $post_id ) ) {
148
- return true;
149
- }
150
-
151
- return false;
152
- }
153
-
154
- /**
155
- * Check if compatibility theme enabled.
156
- */
157
- function is_compatibility_theme_enabled() {
158
-
159
- $theme = wp_get_theme();
160
-
161
- $is_compatibility = false;
162
-
163
- if ( $this->is_divi_enabled( $theme ) || $this->is_flatsome_enabled( $theme ) ) {
164
-
165
- $is_compatibility = true;
166
- }
167
-
168
- return apply_filters( 'cartflows_is_compatibility_theme', $is_compatibility );
169
- }
170
-
171
- /**
172
- * Check if divi builder enabled for post id.
173
- *
174
- * @param object $theme theme data.
175
- * @return boolean
176
- */
177
- function is_divi_enabled( $theme = false ) {
178
-
179
- if ( ! $theme ) {
180
- $theme = wp_get_theme();
181
- }
182
-
183
- if ( 'Divi' == $theme->name || 'Divi' == $theme->parent_theme ) {
184
- return true;
185
- }
186
-
187
- return false;
188
- }
189
-
190
- /**
191
- * Check if Flatsome enabled for post id.
192
- *
193
- * @param object $theme theme data.
194
- * @return boolean
195
- */
196
- function is_flatsome_enabled( $theme = false ) {
197
-
198
- if ( ! $theme ) {
199
- $theme = wp_get_theme();
200
- }
201
-
202
- if ( 'Flatsome' == $theme->name || 'Flatsome' == $theme->parent_theme ) {
203
- return true;
204
- }
205
-
206
- return false;
207
- }
208
-
209
- /**
210
- * Check if OceanWp enabled for post id.
211
- *
212
- * @param object $theme theme data.
213
- * @return boolean
214
- */
215
- function is_oceanwp_enabled( $theme = false ) {
216
-
217
- if ( ! $theme ) {
218
- $theme = wp_get_theme();
219
- }
220
-
221
- if ( 'OceanWP' == $theme->name || 'OceanWP' == $theme->parent_theme ) {
222
- return true;
223
- }
224
-
225
- return false;
226
- }
227
-
228
- /**
229
- * Check for thrive architect edit page.
230
- *
231
- * @param int $post_id post id.
232
- */
233
- public function is_thrive_edit_page( $post_id ) {
234
-
235
- if ( true === $this->is_thrive_builder_page( $post_id ) ) {
236
- return true;
237
- } else {
238
- return false;
239
- }
240
- }
241
-
242
- /**
243
- * Check if the page being rendered is the main ID on the editor page.
244
- *
245
- * @since 1.0.0
246
- * @param String $post_id Post ID which is to be rendered.
247
- * @return boolean True if current if is being rendered is not being edited.
248
- */
249
- private function is_thrive_builder_page( $post_id ) {
250
- $tve = ( isset( $_GET['tve'] ) && 'true' == $_GET['tve'] ) ? true : false;
251
- $post = isset( $_GET['post'] ) ? sanitize_text_field( $_GET['post'] ) : false;
252
-
253
- return ( true == $tve && $post_id !== $post );
254
- }
255
-
256
- /**
257
- * Overwrite meta for page
258
- */
259
- public function override_meta() {
260
-
261
- // don't override meta for `elementor_library` post type.
262
- if ( 'elementor_library' == get_post_type() ) {
263
- return;
264
- }
265
-
266
- if ( ! is_singular() ) {
267
- return;
268
- }
269
-
270
- global $post;
271
- $post_id = $post->ID;
272
- $post_type = get_post_type();
273
-
274
- if ( 'cartflows_step' == $post_type && ( $this->is_elementor_preview_mode()
275
- || $this->is_bb_preview_mode() || $this->is_thrive_edit_page( $post_id )
276
- || $this->is_divi_builder_enabled( $post_id ) ) ) {
277
-
278
- if ( '' == $post->post_content ) {
279
-
280
- $this->overwrite_template( $post_id );
281
- }
282
- }
283
- }
284
-
285
- /**
286
- * Assign cartflow canvas template to page.
287
- *
288
- * @param int $post_id post ID.
289
- */
290
- public function overwrite_template( $post_id ) {
291
-
292
- $template = 'cartflows-canvas';
293
- $key = '_wp_page_template';
294
-
295
- $record_exists = get_post_meta( $post_id, $key, true );
296
-
297
- if ( 'cartflows-canvas' == $record_exists ) {
298
- return;
299
- }
300
-
301
- // As elementor doesn't allow update post meta using update_post_meta, run wpdb query to update post meta.
302
- if ( class_exists( '\Elementor\Plugin' ) ) {
303
-
304
- global $wpdb;
305
-
306
- if ( '' == $record_exists || ! $record_exists ) {
307
-
308
- $wpdb->insert(
309
- $wpdb->prefix . 'postmeta',
310
- array(
311
- 'post_id' => $post_id,
312
- 'meta_key' => $key,
313
- 'meta_value' => $template, // ... and so on
314
- )
315
- );
316
- } else {
317
-
318
- $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = %s WHERE meta_key = %s AND post_id = %s;", $template, $key, $post_id ) );
319
- }
320
- } else {
321
-
322
- update_post_meta( $post_id, $key, $template );
323
- }
324
- }
325
-
326
- /**
327
- * Load font awesome style from oceanwp on checkout page.
328
- */
329
- public function load_fontawesome() {
330
-
331
- $theme = get_template();
332
-
333
- if ( 'oceanwp' == strtolower( $theme ) && wcf()->utils->is_step_post_type() ) {
334
-
335
- $load_fa = apply_filters( 'cartflows_maybe_load_font_awesome', true );
336
-
337
- if ( $load_fa ) {
338
-
339
- wp_enqueue_style( 'font-awesome', OCEANWP_CSS_DIR_URI . 'third/font-awesome.min.css', false );
340
- }
341
-
342
- $custom_css = '
343
- #oceanwp-cart-sidebar-wrap,
344
- #owp-qv-wrap{
345
- display: none;
346
- }';
347
-
348
- wp_add_inline_style( 'wcf-frontend-global', $custom_css );
349
- }
350
- }
351
- }
352
- }
353
-
354
- Cartflows_Compatibility::get_instance();
355
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Page builder compatibility
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ if ( ! class_exists( 'Cartflows_Compatibility' ) ) {
9
+
10
+ /**
11
+ * Class for page builder compatibility
12
+ */
13
+ class Cartflows_Compatibility {
14
+
15
+ /**
16
+ * Member Variable
17
+ *
18
+ * @var object instance
19
+ */
20
+ private static $instance;
21
+
22
+ /**
23
+ * Initiator
24
+ */
25
+ public static function get_instance() {
26
+ if ( ! isset( self::$instance ) ) {
27
+ self::$instance = new self;
28
+ }
29
+ return self::$instance;
30
+ }
31
+
32
+ /**
33
+ * Constructor
34
+ */
35
+ public function __construct() {
36
+
37
+ $this->load_files();
38
+
39
+ // Override post meta.
40
+ add_action( 'wp', array( $this, 'override_meta' ), 0 );
41
+
42
+ add_action( 'wp_enqueue_scripts', array( $this, 'load_fontawesome' ), 10000 );
43
+ }
44
+
45
+ /**
46
+ * Load page builder compatibility files
47
+ */
48
+ public function load_files() {
49
+ if ( class_exists( '\Elementor\Plugin' ) ) {
50
+ require_once CARTFLOWS_DIR . 'classes/class-cartflows-elementor-compatibility.php';
51
+ }
52
+
53
+ if ( $this->is_divi_enabled() ) {
54
+ require_once CARTFLOWS_DIR . 'classes/class-cartflows-divi-compatibility.php';
55
+ }
56
+
57
+ if ( $this->is_bb_enabled() ) {
58
+ require_once CARTFLOWS_DIR . 'classes/class-cartflows-bb-compatibility.php';
59
+ }
60
+
61
+ if ( class_exists( 'TCB_Post' ) ) {
62
+ require_once CARTFLOWS_DIR . 'classes/class-cartflows-thrive-compatibility.php';
63
+ }
64
+ }
65
+
66
+ /**
67
+ * Check if it is beaver builder enabled.
68
+ *
69
+ * @since 1.1.4
70
+ */
71
+ public function is_bb_enabled() {
72
+
73
+ if ( class_exists( 'FLBuilderModel' ) ) {
74
+ return true;
75
+ }
76
+
77
+ return false;
78
+ }
79
+
80
+ /**
81
+ * Check if elementor preview mode is on.
82
+ */
83
+ public function is_elementor_preview_mode() {
84
+
85
+ if ( class_exists( '\Elementor\Plugin' ) ) {
86
+
87
+ if ( \Elementor\Plugin::$instance->preview->is_preview_mode() ) {
88
+ return true;
89
+ }
90
+ }
91
+
92
+ return false;
93
+ }
94
+
95
+ /**
96
+ * Get Current Theme.
97
+ */
98
+ public function get_current_theme() {
99
+
100
+ $theme_name = '';
101
+ $theme = wp_get_theme();
102
+
103
+ if ( isset( $theme->parent_theme ) && '' != $theme->parent_theme || null != $theme->parent_theme ) {
104
+ $theme_name = $theme->parent_theme;
105
+ } else {
106
+ $theme_name = $theme->name;
107
+ }
108
+
109
+ return $theme_name;
110
+ }
111
+
112
+ /**
113
+ * Check if it is beaver builder preview mode
114
+ */
115
+ public function is_bb_preview_mode() {
116
+
117
+ if ( class_exists( 'FLBuilderModel' ) ) {
118
+ if ( FLBuilderModel::is_builder_active() ) {
119
+ return true;
120
+ } else {
121
+ return false;
122
+ }
123
+ }
124
+
125
+ return false;
126
+ }
127
+
128
+ /**
129
+ * Check for page builder preview mode.
130
+ */
131
+ public function is_page_builder_preview() {
132
+
133
+ if ( $this->is_elementor_preview_mode() || $this->is_bb_preview_mode() ) {
134
+ return true;
135
+ }
136
+
137
+ return false;
138
+ }
139
+
140
+ /**
141
+ * Check if divi builder enabled for post id.
142
+ *
143
+ * @param int $post_id post id.
144
+ */
145
+ public function is_divi_builder_enabled( $post_id ) {
146
+
147
+ if ( function_exists( 'et_pb_is_pagebuilder_used' ) && et_pb_is_pagebuilder_used( $post_id ) ) {
148
+ return true;
149
+ }
150
+
151
+ return false;
152
+ }
153
+
154
+ /**
155
+ * Check if compatibility theme enabled.
156
+ */
157
+ function is_compatibility_theme_enabled() {
158
+
159
+ $theme = wp_get_theme();
160
+
161
+ $is_compatibility = false;
162
+
163
+ if ( $this->is_divi_enabled( $theme ) || $this->is_flatsome_enabled( $theme ) ) {
164
+
165
+ $is_compatibility = true;
166
+ }
167
+
168
+ return apply_filters( 'cartflows_is_compatibility_theme', $is_compatibility );
169
+ }
170
+
171
+ /**
172
+ * Check if divi builder enabled for post id.
173
+ *
174
+ * @param object $theme theme data.
175
+ * @return boolean
176
+ */
177
+ function is_divi_enabled( $theme = false ) {
178
+
179
+ if ( ! $theme ) {
180
+ $theme = wp_get_theme();
181
+ }
182
+
183
+ if ( 'Divi' == $theme->name || 'Divi' == $theme->parent_theme ) {
184
+ return true;
185
+ }
186
+
187
+ return false;
188
+ }
189
+
190
+ /**
191
+ * Check if Flatsome enabled for post id.
192
+ *
193
+ * @param object $theme theme data.
194
+ * @return boolean
195
+ */
196
+ function is_flatsome_enabled( $theme = false ) {
197
+
198
+ if ( ! $theme ) {
199
+ $theme = wp_get_theme();
200
+ }
201
+
202
+ if ( 'Flatsome' == $theme->name || 'Flatsome' == $theme->parent_theme ) {
203
+ return true;
204
+ }
205
+
206
+ return false;
207
+ }
208
+
209
+ /**
210
+ * Check if The7 enabled for post id.
211
+ *
212
+ * @param object $theme theme data.
213
+ * @return boolean
214
+ */
215
+ function is_the_seven_enabled( $theme = false ) {
216
+
217
+ if ( ! $theme ) {
218
+ $theme = wp_get_theme();
219
+ }
220
+
221
+ if ( 'The7' == $theme->name || 'The7' == $theme->parent_theme ) {
222
+ return true;
223
+ }
224
+
225
+ return false;
226
+ }
227
+
228
+ /**
229
+ * Check if OceanWp enabled for post id.
230
+ *
231
+ * @param object $theme theme data.
232
+ * @return boolean
233
+ */
234
+ function is_oceanwp_enabled( $theme = false ) {
235
+
236
+ if ( ! $theme ) {
237
+ $theme = wp_get_theme();
238
+ }
239
+
240
+ if ( 'OceanWP' == $theme->name || 'OceanWP' == $theme->parent_theme ) {
241
+ return true;
242
+ }
243
+
244
+ return false;
245
+ }
246
+
247
+ /**
248
+ * Check for thrive architect edit page.
249
+ *
250
+ * @param int $post_id post id.
251
+ */
252
+ public function is_thrive_edit_page( $post_id ) {
253
+
254
+ if ( true === $this->is_thrive_builder_page( $post_id ) ) {
255
+ return true;
256
+ } else {
257
+ return false;
258
+ }
259
+ }
260
+
261
+ /**
262
+ * Check if the page being rendered is the main ID on the editor page.
263
+ *
264
+ * @since 1.0.0
265
+ * @param String $post_id Post ID which is to be rendered.
266
+ * @return boolean True if current if is being rendered is not being edited.
267
+ */
268
+ private function is_thrive_builder_page( $post_id ) {
269
+ $tve = ( isset( $_GET['tve'] ) && 'true' == $_GET['tve'] ) ? true : false;
270
+ $post = isset( $_GET['post'] ) ? sanitize_text_field( $_GET['post'] ) : false;
271
+
272
+ return ( true == $tve && $post_id !== $post );
273
+ }
274
+
275
+ /**
276
+ * Overwrite meta for page
277
+ */
278
+ public function override_meta() {
279
+
280
+ // don't override meta for `elementor_library` post type.
281
+ if ( 'elementor_library' == get_post_type() ) {
282
+ return;
283
+ }
284
+
285
+ if ( ! is_singular() ) {
286
+ return;
287
+ }
288
+
289
+ global $post;
290
+ $post_id = $post->ID;
291
+ $post_type = get_post_type();
292
+
293
+ if ( 'cartflows_step' == $post_type && ( $this->is_elementor_preview_mode()
294
+ || $this->is_bb_preview_mode() || $this->is_thrive_edit_page( $post_id )
295
+ || $this->is_divi_builder_enabled( $post_id ) ) ) {
296
+
297
+ if ( '' == $post->post_content ) {
298
+
299
+ $this->overwrite_template( $post_id );
300
+ }
301
+ }
302
+ }
303
+
304
+ /**
305
+ * Assign cartflow canvas template to page.
306
+ *
307
+ * @param int $post_id post ID.
308
+ */
309
+ public function overwrite_template( $post_id ) {
310
+
311
+ $template = 'cartflows-canvas';
312
+ $key = '_wp_page_template';
313
+
314
+ $record_exists = get_post_meta( $post_id, $key, true );
315
+
316
+ if ( 'cartflows-canvas' == $record_exists ) {
317
+ return;
318
+ }
319
+
320
+ // As elementor doesn't allow update post meta using update_post_meta, run wpdb query to update post meta.
321
+ if ( class_exists( '\Elementor\Plugin' ) ) {
322
+
323
+ global $wpdb;
324
+
325
+ if ( '' == $record_exists || ! $record_exists ) {
326
+
327
+ $wpdb->insert(
328
+ $wpdb->prefix . 'postmeta',
329
+ array(
330
+ 'post_id' => $post_id,
331
+ 'meta_key' => $key,
332
+ 'meta_value' => $template, // ... and so on
333
+ )
334
+ );
335
+ } else {
336
+
337
+ $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = %s WHERE meta_key = %s AND post_id = %s;", $template, $key, $post_id ) );
338
+ }
339
+ } else {
340
+
341
+ update_post_meta( $post_id, $key, $template );
342
+ }
343
+ }
344
+
345
+ /**
346
+ * Load font awesome style from oceanwp on checkout page.
347
+ */
348
+ public function load_fontawesome() {
349
+
350
+ $theme = get_template();
351
+
352
+ if ( 'oceanwp' == strtolower( $theme ) && wcf()->utils->is_step_post_type() ) {
353
+
354
+ $load_fa = apply_filters( 'cartflows_maybe_load_font_awesome', true );
355
+
356
+ if ( $load_fa ) {
357
+
358
+ wp_enqueue_style( 'font-awesome', OCEANWP_CSS_DIR_URI . 'third/font-awesome.min.css', false );
359
+ }
360
+
361
+ $custom_css = '
362
+ #oceanwp-cart-sidebar-wrap,
363
+ #owp-qv-wrap{
364
+ display: none;
365
+ }';
366
+
367
+ wp_add_inline_style( 'wcf-frontend-global', $custom_css );
368
+ }
369
+ }
370
+ }
371
+ }
372
+
373
+ Cartflows_Compatibility::get_instance();
374
+
classes/class-cartflows-default-meta.php CHANGED
@@ -1,552 +1,838 @@
1
- <?php
2
- /**
3
- * Cartflow default options.
4
- *
5
- * @package Cartflows
6
- */
7
-
8
- /**
9
- * Initialization
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Default_Meta {
14
-
15
-
16
- /**
17
- * Member Variable
18
- *
19
- * @var instance
20
- */
21
- private static $instance;
22
-
23
- /**
24
- * Member Variable
25
- *
26
- * @var checkout_fields
27
- */
28
- private static $checkout_fields = null;
29
-
30
- /**
31
- * Member Variable
32
- *
33
- * @var checkout_fields
34
- */
35
- private static $thankyou_fields = null;
36
-
37
-
38
- /**
39
- * Member Variable
40
- *
41
- * @var flow_fields
42
- */
43
- private static $flow_fields = null;
44
-
45
- /**
46
- * Initiator
47
- */
48
- public static function get_instance() {
49
- if ( ! isset( self::$instance ) ) {
50
- self::$instance = new self;
51
- }
52
- return self::$instance;
53
- }
54
-
55
- /**
56
- * Constructor
57
- */
58
- public function __construct() {
59
-
60
- }
61
-
62
- /**
63
- * Checkout Default fields.
64
- *
65
- * @param int $post_id post id.
66
- * @return array
67
- */
68
- function get_checkout_fields( $post_id ) {
69
-
70
- if ( null === self::$checkout_fields ) {
71
-
72
- self::$checkout_fields = array(
73
- 'wcf-field-google-font-url' => array(
74
- 'default' => '',
75
- 'sanitize' => 'FILTER_DEFAULT',
76
- ),
77
- 'wcf-checkout-products' => array(
78
- 'default' => array(),
79
- 'sanitize' => 'FILTER_CARTFLOWS_CHECKOUT_PRODUCTS',
80
- ),
81
- 'wcf-checkout-layout' => array(
82
- 'default' => 'two-column',
83
- 'sanitize' => 'FILTER_DEFAULT',
84
- ),
85
- 'wcf-input-font-family' => array(
86
- 'default' => '',
87
- 'sanitize' => 'FILTER_DEFAULT',
88
- ),
89
- 'wcf-input-font-weight' => array(
90
- 'default' => '',
91
- 'sanitize' => 'FILTER_DEFAULT',
92
- ),
93
- 'wcf-heading-font-family' => array(
94
- 'default' => '',
95
- 'sanitize' => 'FILTER_DEFAULT',
96
- ),
97
- 'wcf-heading-font-weight' => array(
98
- 'default' => '',
99
- 'sanitize' => 'FILTER_DEFAULT',
100
- ),
101
- 'wcf-base-font-family' => array(
102
- 'default' => '',
103
- 'sanitize' => 'FILTER_DEFAULT',
104
- ),
105
- 'wcf-advance-options-fields' => array(
106
- 'default' => '',
107
- 'sanitize' => 'FILTER_DEFAULT',
108
- ),
109
- 'wcf-base-font-weight' => array(
110
- 'default' => '',
111
- 'sanitize' => 'FILTER_DEFAULT',
112
- ),
113
- 'wcf-button-font-family' => array(
114
- 'default' => '',
115
- 'sanitize' => 'FILTER_DEFAULT',
116
- ),
117
- 'wcf-button-font-weight' => array(
118
- 'default' => '',
119
- 'sanitize' => 'FILTER_DEFAULT',
120
- ),
121
- 'wcf-primary-color' => array(
122
- 'default' => '',
123
- 'sanitize' => 'FILTER_DEFAULT',
124
- ),
125
- 'wcf-heading-color' => array(
126
- 'default' => '',
127
- 'sanitize' => 'FILTER_DEFAULT',
128
- ),
129
- 'wcf-section-bg-color' => array(
130
- 'default' => '',
131
- 'sanitize' => 'FILTER_DEFAULT',
132
- ),
133
- 'wcf-hl-bg-color' => array(
134
- 'default' => '',
135
- 'sanitize' => 'FILTER_DEFAULT',
136
- ),
137
- 'wcf-field-tb-padding' => array(
138
- 'default' => '',
139
- 'sanitize' => 'FILTER_DEFAULT',
140
- ),
141
- 'wcf-field-lr-padding' => array(
142
- 'default' => '',
143
- 'sanitize' => 'FILTER_DEFAULT',
144
- ),
145
- 'wcf-fields-skins' => array(
146
- 'default' => '',
147
- 'sanitize' => 'FILTER_DEFAULT',
148
- ),
149
- 'wcf-input-field-size' => array(
150
- 'default' => '33px',
151
- 'sanitize' => 'FILTER_DEFAULT',
152
- ),
153
- 'wcf-field-color' => array(
154
- 'default' => '',
155
- 'sanitize' => 'FILTER_DEFAULT',
156
- ),
157
- 'wcf-field-bg-color' => array(
158
- 'default' => '',
159
- 'sanitize' => 'FILTER_DEFAULT',
160
- ),
161
- 'wcf-field-border-color' => array(
162
- 'default' => '',
163
- 'sanitize' => 'FILTER_DEFAULT',
164
- ),
165
- 'wcf-box-border-color' => array(
166
- 'default' => '',
167
- 'sanitize' => 'FILTER_DEFAULT',
168
- ),
169
- 'wcf-field-label-color' => array(
170
- 'default' => '',
171
- 'sanitize' => 'FILTER_DEFAULT',
172
- ),
173
- 'wcf-submit-tb-padding' => array(
174
- 'default' => '',
175
- 'sanitize' => 'FILTER_DEFAULT',
176
- ),
177
- 'wcf-submit-lr-padding' => array(
178
- 'default' => '',
179
- 'sanitize' => 'FILTER_DEFAULT',
180
- ),
181
- 'wcf-input-button-size' => array(
182
- 'default' => '33px',
183
- 'sanitize' => 'FILTER_DEFAULT',
184
- ),
185
- 'wcf-submit-color' => array(
186
- 'default' => '',
187
- 'sanitize' => 'FILTER_DEFAULT',
188
- ),
189
- 'wcf-submit-hover-color' => array(
190
- 'default' => '',
191
- 'sanitize' => 'FILTER_DEFAULT',
192
- ),
193
- 'wcf-submit-bg-color' => array(
194
- 'default' => '',
195
- 'sanitize' => 'FILTER_DEFAULT',
196
- ),
197
- 'wcf-submit-bg-hover-color' => array(
198
- 'default' => '',
199
- 'sanitize' => 'FILTER_DEFAULT',
200
- ),
201
- 'wcf-submit-border-color' => array(
202
- 'default' => '',
203
- 'sanitize' => 'FILTER_DEFAULT',
204
- ),
205
- 'wcf-submit-border-hover-color' => array(
206
- 'default' => '',
207
- 'sanitize' => 'FILTER_DEFAULT',
208
- ),
209
- 'wcf-active-tab' => array(
210
- 'default' => '',
211
- 'sanitize' => 'FILTER_DEFAULT',
212
- ),
213
- 'wcf-header-logo-image' => array(
214
- 'default' => '',
215
- 'sanitize' => 'FILTER_DEFAULT',
216
- ),
217
- 'wcf-header-logo-width' => array(
218
- 'default' => '',
219
- 'sanitize' => 'FILTER_DEFAULT',
220
- ),
221
- );
222
-
223
- self::$checkout_fields = apply_filters( 'cartflows_checkout_meta_options', self::$checkout_fields, $post_id );
224
- }
225
-
226
- return self::$checkout_fields;
227
- }
228
-
229
- /**
230
- * Save Checkout Meta fields.
231
- *
232
- * @param int $post_id post id.
233
- * @return void
234
- */
235
- function save_checkout_fields( $post_id ) {
236
-
237
- $post_meta = $this->get_checkout_fields( $post_id );
238
-
239
- $this->save_meta_fields( $post_id, $post_meta );
240
- }
241
-
242
- /**
243
- * Flow Default fields.
244
- *
245
- * @param int $post_id post id.
246
- * @return array
247
- */
248
- function get_flow_fields( $post_id ) {
249
-
250
- if ( null === self::$flow_fields ) {
251
-
252
- self::$flow_fields = array(
253
- 'wcf-steps' => array(
254
- 'default' => array(),
255
- 'sanitize' => 'FILTER_DEFAULT',
256
- ),
257
-
258
- 'wcf-testing' => array(
259
- 'default' => 'yes',
260
- 'sanitize' => 'FILTER_DEFAULT',
261
- ),
262
- );
263
- }
264
-
265
- return apply_filters( 'cartflows_flow_meta_options', self::$flow_fields );
266
- }
267
-
268
- /**
269
- * Save Flow Meta fields.
270
- *
271
- * @param int $post_id post id.
272
- * @return void
273
- */
274
- function save_flow_fields( $post_id ) {
275
-
276
- $post_meta = $this->get_flow_fields( $post_id );
277
-
278
- if ( isset( $post_meta['wcf-steps'] ) ) {
279
- unset( $post_meta['wcf-steps'] );
280
- }
281
-
282
- $this->save_meta_fields( $post_id, $post_meta );
283
- }
284
-
285
- /**
286
- * Save Meta fields - Common Function.
287
- *
288
- * @param int $post_id post id.
289
- * @param array $post_meta options to store.
290
- * @return void
291
- */
292
- function save_meta_fields( $post_id, $post_meta ) {
293
-
294
- if ( ! ( $post_id && is_array( $post_meta ) ) ) {
295
-
296
- return;
297
- }
298
-
299
- foreach ( $post_meta as $key => $data ) {
300
-
301
- $meta_value = false;
302
-
303
- // Sanitize values.
304
- $sanitize_filter = ( isset( $data['sanitize'] ) ) ? $data['sanitize'] : 'FILTER_DEFAULT';
305
-
306
- switch ( $sanitize_filter ) {
307
-
308
- case 'FILTER_SANITIZE_STRING':
309
- $meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_STRING );
310
- break;
311
-
312
- case 'FILTER_SANITIZE_URL':
313
- $meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_URL );
314
- break;
315
-
316
- case 'FILTER_SANITIZE_NUMBER_INT':
317
- $meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_NUMBER_INT );
318
- break;
319
-
320
- case 'FILTER_CARTFLOWS_ARRAY':
321
- if ( isset( $_POST[ $key ] ) && is_array( $_POST[ $key ] ) ) {
322
- $meta_value = array_map( 'sanitize_text_field', $_POST[ $key ] );
323
- }
324
- break;
325
-
326
- case 'FILTER_CARTFLOWS_CHECKOUT_PRODUCTS':
327
- if ( isset( $_POST[ $key ] ) && is_array( $_POST[ $key ] ) ) {
328
-
329
- $i = 0;
330
- $q = 0;
331
-
332
- foreach ( $_POST[ $key ] as $p_index => $p_data ) {
333
-
334
- foreach ( $p_data as $i_key => $i_value ) {
335
-
336
- if ( is_array( $i_value ) ) {
337
-
338
- foreach ( $i_value as $q_key => $q_value ) {
339
-
340
- $meta_value[ $i ][ $i_key ][ $q ] = array_map( 'sanitize_text_field', $q_value );
341
-
342
- $q++;
343
- }
344
- } else {
345
- $meta_value[ $i ][ $i_key ] = sanitize_text_field( $i_value );
346
- }
347
- }
348
-
349
- $i++;
350
- }
351
- }
352
- break;
353
-
354
- default:
355
- $meta_value = filter_input( INPUT_POST, $key, FILTER_DEFAULT );
356
- break;
357
- }
358
-
359
- if ( false !== $meta_value ) {
360
- update_post_meta( $post_id, $key, $meta_value );
361
- } else {
362
- delete_post_meta( $post_id, $key );
363
- }
364
- }
365
- }
366
-
367
- /**
368
- * Get checkout meta.
369
- *
370
- * @param int $post_id post id.
371
- * @param string $key options key.
372
- * @param mix $default options default value.
373
- * @return string
374
- */
375
- function get_flow_meta_value( $post_id, $key, $default = false ) {
376
-
377
- $value = $this->get_save_meta( $post_id, $key );
378
-
379
- if ( ! $value ) {
380
-
381
- if ( $default ) {
382
-
383
- $value = $default;
384
- } else {
385
-
386
- $fields = $this->get_flow_fields( $post_id );
387
-
388
- if ( isset( $fields[ $key ]['default'] ) ) {
389
-
390
- $value = $fields[ $key ]['default'];
391
- }
392
- }
393
- }
394
-
395
- return $value;
396
- }
397
-
398
- /**
399
- * Get checkout meta.
400
- *
401
- * @param int $post_id post id.
402
- * @param string $key options key.
403
- * @param mix $default options default value.
404
- * @return string
405
- */
406
- function get_checkout_meta_value( $post_id = 0, $key = '', $default = false ) {
407
-
408
- $value = $this->get_save_meta( $post_id, $key );
409
-
410
- if ( ! $value ) {
411
-
412
- if ( $default ) {
413
-
414
- $value = $default;
415
- } else {
416
-
417
- $fields = $this->get_checkout_fields( $post_id );
418
-
419
- if ( isset( $fields[ $key ]['default'] ) ) {
420
-
421
- $value = $fields[ $key ]['default'];
422
- }
423
- }
424
- }
425
-
426
- return $value;
427
- }
428
-
429
- /**
430
- * Get post meta.
431
- *
432
- * @param int $post_id post id.
433
- * @param string $key options key.
434
- * @return string
435
- */
436
- function get_save_meta( $post_id, $key ) {
437
-
438
- $value = get_post_meta( $post_id, $key, true );
439
-
440
- return $value;
441
- }
442
-
443
- /**
444
- * Thank You Default fields.
445
- *
446
- * @param int $post_id post id.
447
- * @return array
448
- */
449
- function get_thankyou_fields( $post_id ) {
450
-
451
- if ( null === self::$thankyou_fields ) {
452
-
453
- self::$thankyou_fields = array(
454
- 'wcf-field-google-font-url' => array(
455
- 'default' => '',
456
- 'sanitize' => 'FILTER_DEFAULT',
457
- ),
458
- 'wcf-active-tab' => array(
459
- 'default' => '',
460
- 'sanitize' => 'FILTER_DEFAULT',
461
- ),
462
- 'wcf-tq-text-color' => array(
463
- 'default' => '',
464
- 'sanitize' => 'FILTER_DEFAULT',
465
- ),
466
- 'wcf-tq-font-family' => array(
467
- 'default' => '',
468
- 'sanitize' => 'FILTER_DEFAULT',
469
- ),
470
- 'wcf-tq-heading-color' => array(
471
- 'default' => '',
472
- 'sanitize' => 'FILTER_DEFAULT',
473
- ),
474
- 'wcf-tq-heading-font-family' => array(
475
- 'default' => '',
476
- 'sanitize' => 'FILTER_DEFAULT',
477
- ),
478
- 'wcf-tq-heading-font-wt' => array(
479
- 'default' => '',
480
- 'sanitize' => 'FILTER_DEFAULT',
481
- ),
482
- 'wcf-tq-container-width' => array(
483
- 'default' => '',
484
- 'sanitize' => 'FILTER_DEFAULT',
485
- ),
486
- 'wcf-tq-section-bg-color' => array(
487
- 'default' => '',
488
- 'sanitize' => 'FILTER_DEFAULT',
489
- ),
490
- 'wcf-tq-advance-options-fields' => array(
491
- 'default' => '',
492
- 'sanitize' => 'FILTER_DEFAULT',
493
- ),
494
- 'wcf-show-overview-section' => array(
495
- 'default' => 'yes',
496
- 'sanitize' => 'FILTER_DEFAULT',
497
- ),
498
- 'wcf-show-details-section' => array(
499
- 'default' => 'yes',
500
- 'sanitize' => 'FILTER_DEFAULT',
501
- ),
502
- 'wcf-show-billing-section' => array(
503
- 'default' => 'yes',
504
- 'sanitize' => 'FILTER_DEFAULT',
505
- ),
506
- 'wcf-show-shipping-section' => array(
507
- 'default' => 'yes',
508
- 'sanitize' => 'FILTER_DEFAULT',
509
- ),
510
- );
511
-
512
- }
513
-
514
- return apply_filters( 'cartflows_thankyou_meta_options', self::$thankyou_fields, $post_id );
515
- }
516
-
517
- /**
518
- * Get Thank you section meta.
519
- *
520
- * @param int $post_id post id.
521
- * @param string $key options key.
522
- * @param mix $default options default value.
523
- * @return string
524
- */
525
- function get_thankyou_meta_value( $post_id, $key, $default = false ) {
526
-
527
- $value = $this->get_save_meta( $post_id, $key );
528
-
529
- if ( ! $value ) {
530
-
531
- if ( $default ) {
532
-
533
- $value = $default;
534
- } else {
535
-
536
- $fields = $this->get_thankyou_fields( $post_id );
537
-
538
- if ( isset( $fields[ $key ]['default'] ) ) {
539
-
540
- $value = $fields[ $key ]['default'];
541
- }
542
- }
543
- }
544
-
545
- return $value;
546
- }
547
- }
548
-
549
- /**
550
- * Kicking this off by calling 'get_instance()' method
551
- */
552
- Cartflows_Default_Meta::get_instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cartflow default options.
4
+ *
5
+ * @package Cartflows
6
+ */
7
+
8
+ /**
9
+ * Initialization
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Default_Meta {
14
+
15
+
16
+ /**
17
+ * Member Variable
18
+ *
19
+ * @var instance
20
+ */
21
+ private static $instance;
22
+
23
+ /**
24
+ * Member Variable
25
+ *
26
+ * @var checkout_fields
27
+ */
28
+ private static $checkout_fields = null;
29
+
30
+ /**
31
+ * Member Variable
32
+ *
33
+ * @var checkout_fields
34
+ */
35
+ private static $thankyou_fields = null;
36
+
37
+
38
+ /**
39
+ * Member Variable
40
+ *
41
+ * @var flow_fields
42
+ */
43
+ private static $flow_fields = null;
44
+
45
+ /**
46
+ * Initiator
47
+ */
48
+ public static function get_instance() {
49
+ if ( ! isset( self::$instance ) ) {
50
+ self::$instance = new self;
51
+ }
52
+ return self::$instance;
53
+ }
54
+
55
+ /**
56
+ * Constructor
57
+ */
58
+ public function __construct() {
59
+
60
+ }
61
+
62
+ /**
63
+ * Checkout Default fields.
64
+ *
65
+ * @param int $post_id post id.
66
+ * @return array
67
+ */
68
+ function get_checkout_fields( $post_id ) {
69
+
70
+ if ( null === self::$checkout_fields ) {
71
+
72
+ self::$checkout_fields = array(
73
+ 'wcf-field-google-font-url' => array(
74
+ 'default' => '',
75
+ 'sanitize' => 'FILTER_DEFAULT',
76
+ ),
77
+ 'wcf-checkout-products' => array(
78
+ 'default' => array(),
79
+ 'sanitize' => 'FILTER_CARTFLOWS_CHECKOUT_PRODUCTS',
80
+ ),
81
+ 'wcf-checkout-layout' => array(
82
+ 'default' => 'two-column',
83
+ 'sanitize' => 'FILTER_DEFAULT',
84
+ ),
85
+ 'wcf-input-font-family' => array(
86
+ 'default' => '',
87
+ 'sanitize' => 'FILTER_DEFAULT',
88
+ ),
89
+ 'wcf-input-font-weight' => array(
90
+ 'default' => '',
91
+ 'sanitize' => 'FILTER_DEFAULT',
92
+ ),
93
+ 'wcf-heading-font-family' => array(
94
+ 'default' => '',
95
+ 'sanitize' => 'FILTER_DEFAULT',
96
+ ),
97
+ 'wcf-heading-font-weight' => array(
98
+ 'default' => '',
99
+ 'sanitize' => 'FILTER_DEFAULT',
100
+ ),
101
+ 'wcf-base-font-family' => array(
102
+ 'default' => '',
103
+ 'sanitize' => 'FILTER_DEFAULT',
104
+ ),
105
+ 'wcf-advance-options-fields' => array(
106
+ 'default' => '',
107
+ 'sanitize' => 'FILTER_DEFAULT',
108
+ ),
109
+ 'wcf-base-font-weight' => array(
110
+ 'default' => '',
111
+ 'sanitize' => 'FILTER_DEFAULT',
112
+ ),
113
+ 'wcf-button-font-family' => array(
114
+ 'default' => '',
115
+ 'sanitize' => 'FILTER_DEFAULT',
116
+ ),
117
+ 'wcf-button-font-weight' => array(
118
+ 'default' => '',
119
+ 'sanitize' => 'FILTER_DEFAULT',
120
+ ),
121
+ 'wcf-primary-color' => array(
122
+ 'default' => '',
123
+ 'sanitize' => 'FILTER_DEFAULT',
124
+ ),
125
+ 'wcf-heading-color' => array(
126
+ 'default' => '',
127
+ 'sanitize' => 'FILTER_DEFAULT',
128
+ ),
129
+ 'wcf-section-bg-color' => array(
130
+ 'default' => '',
131
+ 'sanitize' => 'FILTER_DEFAULT',
132
+ ),
133
+ 'wcf-hl-bg-color' => array(
134
+ 'default' => '',
135
+ 'sanitize' => 'FILTER_DEFAULT',
136
+ ),
137
+ 'wcf-field-tb-padding' => array(
138
+ 'default' => '',
139
+ 'sanitize' => 'FILTER_DEFAULT',
140
+ ),
141
+ 'wcf-field-lr-padding' => array(
142
+ 'default' => '',
143
+ 'sanitize' => 'FILTER_DEFAULT',
144
+ ),
145
+ 'wcf-fields-skins' => array(
146
+ 'default' => '',
147
+ 'sanitize' => 'FILTER_DEFAULT',
148
+ ),
149
+ 'wcf-input-field-size' => array(
150
+ 'default' => '33px',
151
+ 'sanitize' => 'FILTER_DEFAULT',
152
+ ),
153
+ 'wcf-field-color' => array(
154
+ 'default' => '',
155
+ 'sanitize' => 'FILTER_DEFAULT',
156
+ ),
157
+ 'wcf-field-bg-color' => array(
158
+ 'default' => '',
159
+ 'sanitize' => 'FILTER_DEFAULT',
160
+ ),
161
+ 'wcf-field-border-color' => array(
162
+ 'default' => '',
163
+ 'sanitize' => 'FILTER_DEFAULT',
164
+ ),
165
+ 'wcf-box-border-color' => array(
166
+ 'default' => '',
167
+ 'sanitize' => 'FILTER_DEFAULT',
168
+ ),
169
+ 'wcf-field-label-color' => array(
170
+ 'default' => '',
171
+ 'sanitize' => 'FILTER_DEFAULT',
172
+ ),
173
+ 'wcf-submit-tb-padding' => array(
174
+ 'default' => '',
175
+ 'sanitize' => 'FILTER_DEFAULT',
176
+ ),
177
+ 'wcf-submit-lr-padding' => array(
178
+ 'default' => '',
179
+ 'sanitize' => 'FILTER_DEFAULT',
180
+ ),
181
+ 'wcf-input-button-size' => array(
182
+ 'default' => '33px',
183
+ 'sanitize' => 'FILTER_DEFAULT',
184
+ ),
185
+ 'wcf-submit-color' => array(
186
+ 'default' => '',
187
+ 'sanitize' => 'FILTER_DEFAULT',
188
+ ),
189
+ 'wcf-submit-hover-color' => array(
190
+ 'default' => '',
191
+ 'sanitize' => 'FILTER_DEFAULT',
192
+ ),
193
+ 'wcf-submit-bg-color' => array(
194
+ 'default' => '',
195
+ 'sanitize' => 'FILTER_DEFAULT',
196
+ ),
197
+ 'wcf-submit-bg-hover-color' => array(
198
+ 'default' => '',
199
+ 'sanitize' => 'FILTER_DEFAULT',
200
+ ),
201
+ 'wcf-submit-border-color' => array(
202
+ 'default' => '',
203
+ 'sanitize' => 'FILTER_DEFAULT',
204
+ ),
205
+ 'wcf-submit-border-hover-color' => array(
206
+ 'default' => '',
207
+ 'sanitize' => 'FILTER_DEFAULT',
208
+ ),
209
+ 'wcf-active-tab' => array(
210
+ 'default' => '',
211
+ 'sanitize' => 'FILTER_DEFAULT',
212
+ ),
213
+ 'wcf-header-logo-image' => array(
214
+ 'default' => '',
215
+ 'sanitize' => 'FILTER_DEFAULT',
216
+ ),
217
+ 'wcf-header-logo-width' => array(
218
+ 'default' => '',
219
+ 'sanitize' => 'FILTER_DEFAULT',
220
+ ),
221
+ );
222
+
223
+ self::$checkout_fields = apply_filters( 'cartflows_checkout_meta_options', self::$checkout_fields, $post_id );
224
+ }
225
+
226
+ return self::$checkout_fields;
227
+ }
228
+
229
+ /**
230
+ * Save Checkout Meta fields.
231
+ *
232
+ * @param int $post_id post id.
233
+ * @return void
234
+ */
235
+ function save_checkout_fields( $post_id ) {
236
+
237
+ $post_meta = $this->get_checkout_fields( $post_id );
238
+
239
+ $this->save_meta_fields( $post_id, $post_meta );
240
+ }
241
+
242
+ /**
243
+ * Flow Default fields.
244
+ *
245
+ * @param int $post_id post id.
246
+ * @return array
247
+ */
248
+ function get_flow_fields( $post_id ) {
249
+
250
+ if ( null === self::$flow_fields ) {
251
+
252
+ self::$flow_fields = array(
253
+ 'wcf-steps' => array(
254
+ 'default' => array(),
255
+ 'sanitize' => 'FILTER_DEFAULT',
256
+ ),
257
+
258
+ 'wcf-testing' => array(
259
+ 'default' => 'yes',
260
+ 'sanitize' => 'FILTER_DEFAULT',
261
+ ),
262
+ );
263
+ }
264
+
265
+ return apply_filters( 'cartflows_flow_meta_options', self::$flow_fields );
266
+ }
267
+
268
+ /**
269
+ * Save Flow Meta fields.
270
+ *
271
+ * @param int $post_id post id.
272
+ * @return void
273
+ */
274
+ function save_flow_fields( $post_id ) {
275
+
276
+ $post_meta = $this->get_flow_fields( $post_id );
277
+
278
+ if ( isset( $post_meta['wcf-steps'] ) ) {
279
+ unset( $post_meta['wcf-steps'] );
280
+ }
281
+
282
+ $this->save_meta_fields( $post_id, $post_meta );
283
+ }
284
+
285
+ /**
286
+ * Save Meta fields - Common Function.
287
+ *
288
+ * @param int $post_id post id.
289
+ * @param array $post_meta options to store.
290
+ * @return void
291
+ */
292
+ function save_meta_fields( $post_id, $post_meta ) {
293
+
294
+ if ( ! ( $post_id && is_array( $post_meta ) ) ) {
295
+
296
+ return;
297
+ }
298
+
299
+ foreach ( $post_meta as $key => $data ) {
300
+
301
+ $meta_value = false;
302
+
303
+ // Sanitize values.
304
+ $sanitize_filter = ( isset( $data['sanitize'] ) ) ? $data['sanitize'] : 'FILTER_DEFAULT';
305
+
306
+ switch ( $sanitize_filter ) {
307
+
308
+ case 'FILTER_SANITIZE_STRING':
309
+ $meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_STRING );
310
+ break;
311
+
312
+ case 'FILTER_SANITIZE_URL':
313
+ $meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_URL );
314
+ break;
315
+
316
+ case 'FILTER_SANITIZE_NUMBER_INT':
317
+ $meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_NUMBER_INT );
318
+ break;
319
+
320
+ case 'FILTER_CARTFLOWS_ARRAY':
321
+ if ( isset( $_POST[ $key ] ) && is_array( $_POST[ $key ] ) ) {
322
+ $meta_value = array_map( 'sanitize_text_field', $_POST[ $key ] );
323
+ }
324
+ break;
325
+
326
+ case 'FILTER_CARTFLOWS_CHECKOUT_PRODUCTS':
327
+ if ( isset( $_POST[ $key ] ) && is_array( $_POST[ $key ] ) ) {
328
+
329
+ $i = 0;
330
+ $q = 0;
331
+
332
+ foreach ( $_POST[ $key ] as $p_index => $p_data ) {
333
+
334
+ foreach ( $p_data as $i_key => $i_value ) {
335
+
336
+ if ( is_array( $i_value ) ) {
337
+
338
+ foreach ( $i_value as $q_key => $q_value ) {
339
+
340
+ $meta_value[ $i ][ $i_key ][ $q ] = array_map( 'sanitize_text_field', $q_value );
341
+
342
+ $q++;
343
+ }
344
+ } else {
345
+ $meta_value[ $i ][ $i_key ] = sanitize_text_field( $i_value );
346
+ }
347
+ }
348
+
349
+ $i++;
350
+ }
351
+ }
352
+ break;
353
+ case 'FILTER_CARTFLOWS_CHECKOUT_FIELDS':
354
+ $count = 10;
355
+ $ordered_fields = array();
356
+ $billing_fields = array();
357
+
358
+ if ( isset( $_POST[ $key ] ) && is_array( $_POST[ $key ] ) ) {
359
+ $key_count = count( $key );
360
+ $post_data = $_POST[ $key ];
361
+
362
+ if ( 'wcf_field_order_billing' == $key ) {
363
+
364
+ $billing_fields = Cartflows_Helper::get_checkout_fields( 'billing', $post_id );
365
+
366
+ foreach ( $post_data as $index => $value ) {
367
+
368
+ if ( isset( $billing_fields[ $value ] ) ) {
369
+ $ordered_fields[ $value ] = $billing_fields[ $value ];
370
+ $ordered_fields[ $value ]['priority'] = $count;
371
+ $count += 10;
372
+ }
373
+ }
374
+
375
+ $meta_value = $ordered_fields;
376
+ }
377
+
378
+ if ( 'wcf_field_order_shipping' == $key ) {
379
+
380
+ $shipping_fields = Cartflows_Helper::get_checkout_fields( 'shipping', $post_id );
381
+ foreach ( $post_data as $index => $value ) {
382
+
383
+ if ( isset( $shipping_fields[ $value ] ) ) {
384
+ $ordered_fields[ $value ] = $shipping_fields[ $value ];
385
+ $ordered_fields[ $value ]['priority'] = $count;
386
+ $count += 10;
387
+ }
388
+ }
389
+ $meta_value = $ordered_fields;
390
+ }
391
+
392
+ if ( 'wcf_label_text_field_billing' == $key ) {
393
+
394
+ $get_ordered_billing_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_billing' );
395
+
396
+ if ( isset( $get_ordered_billing_fields ) && ! empty( $get_ordered_billing_fields ) ) {
397
+ echo 'con 1';
398
+ $billing_fields = $get_ordered_billing_fields;
399
+ } else {
400
+ echo 'con 2';
401
+ $billing_fields = Cartflows_Helper::get_checkout_fields( 'billing', $post_id );
402
+ }
403
+
404
+ foreach ( $post_data as $index => $value ) {
405
+
406
+ if ( isset( $billing_fields[ $index ] ) ) {
407
+ $ordered_fields[ $index ] = $billing_fields[ $index ];
408
+ $ordered_fields[ $index ]['label'] = wp_kses_post( trim( stripslashes( $value ) ) );
409
+ }
410
+ }
411
+ $key = 'wcf_field_order_billing';
412
+ $meta_value = $ordered_fields;
413
+ }
414
+
415
+ if ( 'wcf_label_text_field_shipping' == $key ) {
416
+
417
+ $get_ordered_shipping_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_shipping' );
418
+
419
+ if ( isset( $get_ordered_shipping_fields ) && ! empty( $get_ordered_shipping_fields ) ) {
420
+ $shipping_fields = $get_ordered_shipping_fields;
421
+ } else {
422
+ $shipping_fields = Cartflows_Helper::get_checkout_fields( 'shipping', $post_id );
423
+ }
424
+
425
+ foreach ( $post_data as $index => $value ) {
426
+
427
+ if ( isset( $shipping_fields[ $index ] ) ) {
428
+ $ordered_fields[ $index ] = $shipping_fields[ $index ];
429
+ $ordered_fields[ $index ]['label'] = wp_kses_post( trim( stripslashes( $value ) ) );
430
+ }
431
+ }
432
+ $key = 'wcf_field_order_shipping';
433
+ $meta_value = $ordered_fields;
434
+ }
435
+
436
+ if ( 'wcf_label_placeholder_field_billing' == $key ) {
437
+ $get_ordered_billing_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_billing' );
438
+
439
+ if ( isset( $get_ordered_billing_fields ) && ! empty( $get_ordered_billing_fields ) ) {
440
+ $billing_fields = $get_ordered_billing_fields;
441
+ } else {
442
+ $billing_fields = Cartflows_Helper::get_checkout_fields( 'billing', $post_id );
443
+ }
444
+ foreach ( $post_data as $index => $value ) {
445
+
446
+ if ( isset( $billing_fields[ $index ] ) ) {
447
+ $ordered_fields[ $index ] = $billing_fields[ $index ];
448
+ $ordered_fields[ $index ]['placeholder'] = wc_clean( stripslashes( $value ) );
449
+ }
450
+ }
451
+
452
+ $key = 'wcf_field_order_billing';
453
+ $meta_value = $ordered_fields;
454
+ }
455
+
456
+ if ( 'wcf_label_placeholder_field_shipping' == $key ) {
457
+ $get_ordered_shipping_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_shipping' );
458
+
459
+ if ( isset( $get_ordered_shipping_fields ) && ! empty( $get_ordered_shipping_fields ) ) {
460
+ $shipping_fields = $get_ordered_shipping_fields;
461
+ } else {
462
+ $shipping_fields = Cartflows_Helper::get_checkout_fields( 'shipping', $post_id );
463
+ }
464
+
465
+ foreach ( $post_data as $index => $value ) {
466
+
467
+ if ( isset( $shipping_fields[ $index ] ) ) {
468
+ $ordered_fields[ $index ] = $shipping_fields[ $index ];
469
+ $ordered_fields[ $index ]['placeholder'] = wc_clean( stripslashes( $value ) );
470
+ }
471
+ }
472
+
473
+ $key = 'wcf_field_order_shipping';
474
+ $meta_value = $ordered_fields;
475
+
476
+ }
477
+
478
+ if ( 'wcf_label_default_field_billing' == $key ) {
479
+
480
+ $get_ordered_billing_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_billing' );
481
+
482
+ if ( isset( $get_ordered_billing_fields ) && ! empty( $get_ordered_billing_fields ) ) {
483
+ $billing_fields = $get_ordered_billing_fields;
484
+ } else {
485
+ $billing_fields = Cartflows_Helper::get_checkout_fields( 'billing', $post_id );
486
+ }
487
+
488
+ foreach ( $post_data as $index => $value ) {
489
+
490
+ if ( isset( $billing_fields[ $index ] ) ) {
491
+ $ordered_fields[ $index ] = $billing_fields[ $index ];
492
+ $ordered_fields[ $index ]['default'] = wp_kses_post( trim( stripslashes( $value ) ) );
493
+ }
494
+ }
495
+
496
+ $key = 'wcf_field_order_billing';
497
+ $meta_value = $ordered_fields;
498
+ }
499
+
500
+ if ( 'wcf_label_default_field_shipping' == $key ) {
501
+
502
+ $get_ordered_shipping_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_shipping' );
503
+
504
+ if ( isset( $get_ordered_shipping_fields ) && ! empty( $get_ordered_shipping_fields ) ) {
505
+ $shipping_fields = $get_ordered_shipping_fields;
506
+ } else {
507
+ $shipping_fields = Cartflows_Helper::get_checkout_fields( 'shipping', $post_id );
508
+ }
509
+
510
+ foreach ( $post_data as $index => $value ) {
511
+
512
+ if ( isset( $shipping_fields[ $index ] ) ) {
513
+ $ordered_fields[ $index ] = $shipping_fields[ $index ];
514
+ $ordered_fields[ $index ]['default'] = wp_kses_post( trim( stripslashes( $value ) ) );
515
+ }
516
+ }
517
+
518
+ $key = 'wcf_field_order_shipping';
519
+ $meta_value = $ordered_fields;
520
+ }
521
+
522
+ if ( 'wcf_is_required_field_billing' == $key ) {
523
+
524
+ $get_ordered_billing_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_billing' );
525
+
526
+ if ( isset( $get_ordered_billing_fields ) && ! empty( $get_ordered_billing_fields ) ) {
527
+ $billing_fields = $get_ordered_billing_fields;
528
+ } else {
529
+ $billing_fields = Cartflows_Helper::get_checkout_fields( 'billing', $post_id );
530
+ }
531
+
532
+ foreach ( $post_data as $index => $value ) {
533
+
534
+ if ( isset( $billing_fields[ $index ] ) ) {
535
+ $ordered_fields[ $index ] = $billing_fields[ $index ];
536
+ if ( 'yes' == $value ) {
537
+
538
+ $ordered_fields[ $index ]['required'] = true;
539
+ } else {
540
+ $ordered_fields[ $index ]['required'] = false;
541
+ }
542
+ }
543
+ }
544
+
545
+ $key = 'wcf_field_order_billing';
546
+ $meta_value = $ordered_fields;
547
+ }
548
+
549
+ if ( 'wcf_is_required_field_shipping' == $key ) {
550
+
551
+ $get_ordered_shipping_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_shipping' );
552
+
553
+ if ( isset( $get_ordered_shipping_fields ) && ! empty( $get_ordered_shipping_fields ) ) {
554
+ $shipping_fields = $get_ordered_shipping_fields;
555
+ } else {
556
+ $shipping_fields = Cartflows_Helper::get_checkout_fields( 'shipping', $post_id );
557
+ }
558
+
559
+ foreach ( $post_data as $index => $value ) {
560
+
561
+ if ( isset( $shipping_fields[ $index ] ) ) {
562
+ $ordered_fields[ $index ] = $shipping_fields[ $index ];
563
+
564
+ if ( 'yes' == $value ) {
565
+
566
+ $ordered_fields[ $index ]['required'] = true;
567
+ } else {
568
+ $ordered_fields[ $index ]['required'] = false;
569
+ }
570
+ }
571
+ }
572
+
573
+ $key = 'wcf_field_order_shipping';
574
+ $meta_value = $ordered_fields;
575
+ }
576
+
577
+ if ( 'wcf_select_option_field_billing' == $key ) {
578
+
579
+ $get_ordered_billing_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_billing' );
580
+
581
+ if ( isset( $get_ordered_billing_fields ) && ! empty( $get_ordered_billing_fields ) ) {
582
+ $billing_fields = $get_ordered_billing_fields;
583
+ } else {
584
+ $billing_fields = Cartflows_Helper::get_checkout_fields( 'billing', $post_id );
585
+ }
586
+
587
+ foreach ( $post_data as $index => $value ) {
588
+
589
+ $options = explode( ',', $value );
590
+
591
+ if ( isset( $billing_fields[ $index ] ) ) {
592
+ $ordered_fields[ $index ] = $billing_fields[ $index ];
593
+
594
+ $ordered_fields[ $index ]['options'] = array();
595
+
596
+ foreach ( $options as $key => $option ) {
597
+
598
+ $ordered_fields[ $index ]['options'][ $option ] = trim( stripslashes( $option ) );
599
+ }
600
+ }
601
+ }
602
+
603
+ $key = 'wcf_field_order_billing';
604
+ $meta_value = $ordered_fields;
605
+ }
606
+
607
+ if ( 'wcf_select_option_field_shipping' == $key ) {
608
+
609
+ $get_ordered_shipping_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_shipping' );
610
+
611
+ if ( isset( $get_ordered_shipping_fields ) && ! empty( $get_ordered_shipping_fields ) ) {
612
+ $shipping_fields = $get_ordered_shipping_fields;
613
+ } else {
614
+ $shipping_fields = Cartflows_Helper::get_checkout_fields( 'shipping', $post_id );
615
+ }
616
+
617
+ foreach ( $post_data as $index => $value ) {
618
+
619
+ $options = explode( ',', $value );
620
+
621
+ if ( isset( $shipping_fields[ $index ] ) ) {
622
+
623
+ $ordered_fields[ $index ] = $shipping_fields[ $index ];
624
+
625
+ $ordered_fields[ $index ]['options'] = array();
626
+
627
+ foreach ( $options as $key => $option ) {
628
+
629
+ $ordered_fields[ $index ]['options'][ $option ] = trim( stripslashes( $option ) );
630
+ }
631
+ }
632
+ }
633
+
634
+ $key = 'wcf_field_order_shipping';
635
+ $meta_value = $ordered_fields;
636
+ }
637
+ }
638
+ break;
639
+
640
+ default:
641
+ $meta_value = filter_input( INPUT_POST, $key, FILTER_DEFAULT );
642
+ break;
643
+ }
644
+
645
+ if ( false !== $meta_value ) {
646
+ update_post_meta( $post_id, $key, $meta_value );
647
+ } else {
648
+ delete_post_meta( $post_id, $key );
649
+ }
650
+ }
651
+ }
652
+
653
+ /**
654
+ * Get checkout meta.
655
+ *
656
+ * @param int $post_id post id.
657
+ * @param string $key options key.
658
+ * @param mix $default options default value.
659
+ * @return string
660
+ */
661
+ function get_flow_meta_value( $post_id, $key, $default = false ) {
662
+
663
+ $value = $this->get_save_meta( $post_id, $key );
664
+
665
+ if ( ! $value ) {
666
+
667
+ if ( $default ) {
668
+
669
+ $value = $default;
670
+ } else {
671
+
672
+ $fields = $this->get_flow_fields( $post_id );
673
+
674
+ if ( isset( $fields[ $key ]['default'] ) ) {
675
+
676
+ $value = $fields[ $key ]['default'];
677
+ }
678
+ }
679
+ }
680
+
681
+ return $value;
682
+ }
683
+
684
+ /**
685
+ * Get checkout meta.
686
+ *
687
+ * @param int $post_id post id.
688
+ * @param string $key options key.
689
+ * @param mix $default options default value.
690
+ * @return string
691
+ */
692
+ function get_checkout_meta_value( $post_id = 0, $key = '', $default = false ) {
693
+
694
+ $value = $this->get_save_meta( $post_id, $key );
695
+
696
+ if ( ! $value ) {
697
+
698
+ if ( $default ) {
699
+
700
+ $value = $default;
701
+ } else {
702
+
703
+ $fields = $this->get_checkout_fields( $post_id );
704
+
705
+ if ( isset( $fields[ $key ]['default'] ) ) {
706
+
707
+ $value = $fields[ $key ]['default'];
708
+ }
709
+ }
710
+ }
711
+
712
+ return $value;
713
+ }
714
+
715
+ /**
716
+ * Get post meta.
717
+ *
718
+ * @param int $post_id post id.
719
+ * @param string $key options key.
720
+ * @return string
721
+ */
722
+ function get_save_meta( $post_id, $key ) {
723
+
724
+ $value = get_post_meta( $post_id, $key, true );
725
+
726
+ return $value;
727
+ }
728
+
729
+ /**
730
+ * Thank You Default fields.
731
+ *
732
+ * @param int $post_id post id.
733
+ * @return array
734
+ */
735
+ function get_thankyou_fields( $post_id ) {
736
+
737
+ if ( null === self::$thankyou_fields ) {
738
+
739
+ self::$thankyou_fields = array(
740
+ 'wcf-field-google-font-url' => array(
741
+ 'default' => '',
742
+ 'sanitize' => 'FILTER_DEFAULT',
743
+ ),
744
+ 'wcf-active-tab' => array(
745
+ 'default' => '',
746
+ 'sanitize' => 'FILTER_DEFAULT',
747
+ ),
748
+ 'wcf-tq-text-color' => array(
749
+ 'default' => '',
750
+ 'sanitize' => 'FILTER_DEFAULT',
751
+ ),
752
+ 'wcf-tq-font-family' => array(
753
+ 'default' => '',
754
+ 'sanitize' => 'FILTER_DEFAULT',
755
+ ),
756
+ 'wcf-tq-heading-color' => array(
757
+ 'default' => '',
758
+ 'sanitize' => 'FILTER_DEFAULT',
759
+ ),
760
+ 'wcf-tq-heading-font-family' => array(
761
+ 'default' => '',
762
+ 'sanitize' => 'FILTER_DEFAULT',
763
+ ),
764
+ 'wcf-tq-heading-font-wt' => array(
765
+ 'default' => '',
766
+ 'sanitize' => 'FILTER_DEFAULT',
767
+ ),
768
+ 'wcf-tq-container-width' => array(
769
+ 'default' => '',
770
+ 'sanitize' => 'FILTER_DEFAULT',
771
+ ),
772
+ 'wcf-tq-section-bg-color' => array(
773
+ 'default' => '',
774
+ 'sanitize' => 'FILTER_DEFAULT',
775
+ ),
776
+ 'wcf-tq-advance-options-fields' => array(
777
+ 'default' => '',
778
+ 'sanitize' => 'FILTER_DEFAULT',
779
+ ),
780
+ 'wcf-show-overview-section' => array(
781
+ 'default' => 'yes',
782
+ 'sanitize' => 'FILTER_DEFAULT',
783
+ ),
784
+ 'wcf-show-details-section' => array(
785
+ 'default' => 'yes',
786
+ 'sanitize' => 'FILTER_DEFAULT',
787
+ ),
788
+ 'wcf-show-billing-section' => array(
789
+ 'default' => 'yes',
790
+ 'sanitize' => 'FILTER_DEFAULT',
791
+ ),
792
+ 'wcf-show-shipping-section' => array(
793
+ 'default' => 'yes',
794
+ 'sanitize' => 'FILTER_DEFAULT',
795
+ ),
796
+ );
797
+
798
+ }
799
+
800
+ return apply_filters( 'cartflows_thankyou_meta_options', self::$thankyou_fields, $post_id );
801
+ }
802
+
803
+ /**
804
+ * Get Thank you section meta.
805
+ *
806
+ * @param int $post_id post id.
807
+ * @param string $key options key.
808
+ * @param mix $default options default value.
809
+ * @return string
810
+ */
811
+ function get_thankyou_meta_value( $post_id, $key, $default = false ) {
812
+
813
+ $value = $this->get_save_meta( $post_id, $key );
814
+
815
+ if ( ! $value ) {
816
+
817
+ if ( $default ) {
818
+
819
+ $value = $default;
820
+ } else {
821
+
822
+ $fields = $this->get_thankyou_fields( $post_id );
823
+
824
+ if ( isset( $fields[ $key ]['default'] ) ) {
825
+
826
+ $value = $fields[ $key ]['default'];
827
+ }
828
+ }
829
+ }
830
+
831
+ return $value;
832
+ }
833
+ }
834
+
835
+ /**
836
+ * Kicking this off by calling 'get_instance()' method
837
+ */
838
+ Cartflows_Default_Meta::get_instance();
classes/class-cartflows-frontend.php CHANGED
@@ -1,330 +1,402 @@
1
- <?php
2
- /**
3
- * CartFlows Frontend.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Class Cartflows_Frontend.
10
- */
11
- class Cartflows_Frontend {
12
-
13
- /**
14
- * Member Variable
15
- *
16
- * @var instance
17
- */
18
- private static $instance;
19
-
20
- /**
21
- * Initiator
22
- */
23
- public static function get_instance() {
24
- if ( ! isset( self::$instance ) ) {
25
- self::$instance = new self;
26
- }
27
- return self::$instance;
28
- }
29
-
30
- /**
31
- * Constructor
32
- */
33
- public function __construct() {
34
-
35
- /* Set / Destroy Flow Sessions. Set data */
36
- add_action( 'wp', array( $this, 'init_actions' ), 1 );
37
-
38
- /* Enqueue global required scripts */
39
- add_action( 'wp', array( $this, 'wp_actions' ), 55 );
40
-
41
- /* Modify the checkout order received url to go thank you page in our flow */
42
- add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_to_thankyou_page' ), 10, 2 );
43
- }
44
-
45
- /**
46
- * Redirect to thank page if upsell not exists
47
- *
48
- * @param string $order_recieve_url url.
49
- * @param object $order order object.
50
- * @since 1.0.0
51
- */
52
- function redirect_to_thankyou_page( $order_recieve_url, $order ) {
53
-
54
- /* Only for thank you page */
55
- wcf()->logger->log( 'Start-' . __CLASS__ . '::' . __FUNCTION__ );
56
- wcf()->logger->log( 'Only for thank you page' );
57
-
58
- if ( wcf()->flow->is_thankyou_page_exists( $order ) ) {
59
-
60
- if ( _is_wcf_doing_checkout_ajax() ) {
61
-
62
- $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
63
-
64
- if ( ! $checkout_id ) {
65
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
66
- }
67
- } else {
68
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
69
- }
70
-
71
- wcf()->logger->log( 'Checkout ID : ' . $checkout_id );
72
-
73
- if ( $checkout_id ) {
74
-
75
- $thankyou_step_id = wcf()->flow->get_thankyou_page_id( $order );
76
-
77
- if ( $thankyou_step_id ) {
78
-
79
- $order_recieve_url = get_permalink( $thankyou_step_id );
80
-
81
- $order_recieve_url = add_query_arg(
82
- array(
83
- 'wcf-order' => $order->get_id(),
84
- 'wcf-key' => $order->get_order_key(),
85
- ),
86
- $order_recieve_url
87
- );
88
- }
89
- }
90
- }
91
-
92
- wcf()->logger->log( 'End-' . __CLASS__ . '::' . __FUNCTION__ );
93
-
94
- return $order_recieve_url;
95
- }
96
-
97
- /**
98
- * Cancel and redirect to checkout
99
- *
100
- * @param string $return_url url.
101
- * @since 1.0.0
102
- */
103
- function redirect_to_checkout_on_cancel( $return_url ) {
104
-
105
- if ( _is_wcf_doing_checkout_ajax() ) {
106
-
107
- $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
108
-
109
- if ( ! $checkout_id ) {
110
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
111
- }
112
- } else {
113
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
114
- }
115
-
116
- if ( $checkout_id ) {
117
-
118
- $return_url = add_query_arg(
119
- array(
120
- 'cancel_order' => 'true',
121
- '_wpnonce' => wp_create_nonce( 'woocommerce-cancel_order' ),
122
- ),
123
- get_permalink( $checkout_id )
124
- );
125
- }
126
-
127
- return $return_url;
128
- }
129
-
130
-
131
- /**
132
- * Remove theme styles.
133
- *
134
- * @since 1.0.0
135
- */
136
- function remove_theme_styles() {
137
-
138
- // get all styles data.
139
- global $wp_styles;
140
- global $wp_scripts;
141
-
142
- $get_stylesheet = get_stylesheet();
143
- $get_template = get_template();
144
-
145
- if ( Cartflows_Compatibility::get_instance()->is_compatibility_theme_enabled() ) {
146
- return;
147
- }
148
-
149
- $get_stylesheet = 'themes/' . get_stylesheet();
150
- $get_template = 'themes/' . get_template();
151
-
152
- // loop over all of the registered scripts..
153
- foreach ( $wp_styles->registered as $handle => $data ) {
154
-
155
- if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
156
-
157
- // remove it.
158
- wp_deregister_style( $handle );
159
- wp_dequeue_style( $handle );
160
- }
161
- }
162
-
163
- // loop over all of the registered scripts.
164
- foreach ( $wp_scripts->registered as $handle => $data ) {
165
-
166
- if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
167
-
168
- // remove it.
169
- wp_deregister_script( $handle );
170
- wp_dequeue_script( $handle );
171
- }
172
- }
173
- }
174
-
175
- /**
176
- * Update main order data in transient.
177
- *
178
- * @param array $woo_styles new styles array.
179
- * @since 1.0.0
180
- * @return array.
181
- */
182
- function woo_default_css( $woo_styles ) {
183
-
184
- $woo_styles = array(
185
- 'woocommerce-layout' => array(
186
- 'src' => plugins_url( 'assets/css/woocommerce-layout.css', WC_PLUGIN_FILE ),
187
- 'deps' => '',
188
- 'version' => WC_VERSION,
189
- 'media' => 'all',
190
- 'has_rtl' => true,
191
- ),
192
- 'woocommerce-smallscreen' => array(
193
- 'src' => plugins_url( 'assets/css/woocommerce-smallscreen.css', WC_PLUGIN_FILE ),
194
- 'deps' => 'woocommerce-layout',
195
- 'version' => WC_VERSION,
196
- 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', '768px' ) . ')',
197
- 'has_rtl' => true,
198
- ),
199
- 'woocommerce-general' => array(
200
- 'src' => plugins_url( 'assets/css/woocommerce.css', WC_PLUGIN_FILE ),
201
- 'deps' => '',
202
- 'version' => WC_VERSION,
203
- 'media' => 'all',
204
- 'has_rtl' => true,
205
- ),
206
- );
207
-
208
- return $woo_styles;
209
- }
210
-
211
- /**
212
- * Init Actions.
213
- *
214
- * @since 1.0.0
215
- */
216
- function init_actions() {
217
-
218
- $this->set_flow_session();
219
- }
220
-
221
- /**
222
- * Set flow session.
223
- *
224
- * @since 1.0.0
225
- */
226
- function set_flow_session() {
227
-
228
- if ( wcf()->utils->is_step_post_type() ) {
229
-
230
- add_action( 'wp_head', array( $this, 'noindex_flow' ) );
231
-
232
- wcf()->utils->do_not_cache();
233
-
234
- /* Set key to support pixel */
235
- if ( isset( $_GET['wcf-key'] ) ) {
236
- $_GET['key'] = $_GET['wcf-key'];
237
- $_REQUEST['key'] = $_GET['wcf-key'];
238
- }
239
-
240
- if ( isset( $_GET['wcf-order'] ) ) {
241
- $_GET['order'] = $_GET['wcf-order'];
242
- $_REQUEST['order'] = $_GET['wcf-order'];
243
- $_GET['order-received'] = $_GET['wcf-order'];
244
- $_REQUEST['order-received'] = $_GET['wcf-order'];
245
- }
246
- }
247
- }
248
-
249
- /**
250
- * Add noindex, nofollow.
251
- *
252
- * @since 1.0.0
253
- */
254
- function noindex_flow() {
255
-
256
- $common = Cartflows_Helper::get_common_settings();
257
-
258
- if ( 'enable' === $common['disallow_indexing'] ) {
259
- echo '<meta name="robots" content="noindex,nofollow">';
260
- }
261
- }
262
-
263
- /**
264
- * WP Actions.
265
- *
266
- * @since 1.0.0
267
- */
268
- function wp_actions() {
269
-
270
- if ( wcf()->utils->is_step_post_type() ) {
271
-
272
- /* CSS Compatibility for All theme */
273
- add_filter( 'woocommerce_enqueue_styles', array( $this, 'woo_default_css' ), 9999 );
274
-
275
- add_action( 'wp_enqueue_scripts', array( $this, 'remove_theme_styles' ), 9999 );
276
-
277
- add_action( 'wp_enqueue_scripts', array( $this, 'global_flow_scripts' ), 20 );
278
- }
279
-
280
- }
281
-
282
- /**
283
- * Global flow scripts.
284
- *
285
- * @since 1.0.0
286
- */
287
- function global_flow_scripts() {
288
-
289
- global $post;
290
-
291
- $flow = get_post_meta( $post->ID, 'wcf-flow-id', true );
292
- $current_step = $post->ID;
293
- $next_step_link = '';
294
- $compatibility = Cartflows_Compatibility::get_instance();
295
-
296
- if ( _is_wcf_landing_type() ) {
297
-
298
- $next_step_id = wcf()->utils->get_next_step_id( $flow, $current_step );
299
- $next_step_link = get_permalink( $next_step_id );
300
- }
301
-
302
- $localize = array(
303
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
304
- 'is_pb_preview' => $compatibility->is_page_builder_preview(),
305
- 'current_theme' => $compatibility->get_current_theme(),
306
- 'current_flow' => $flow,
307
- 'current_step' => $current_step,
308
- 'next_step' => $next_step_link,
309
- );
310
-
311
- wp_localize_script( 'jquery', 'cartflows', apply_filters( 'global_cartflows_js_localize', $localize ) );
312
-
313
- wp_enqueue_style( 'wcf-frontend-global', CARTFLOWS_URL . 'assets/css/frontend.css', array(), CARTFLOWS_VER );
314
- wp_style_add_data( 'wcf-frontend-global', 'rtl', 'replace' );
315
-
316
- wp_enqueue_script(
317
- 'wcf-frontend-global',
318
- CARTFLOWS_URL . 'assets/js/frontend.js',
319
- array( 'jquery' ),
320
- CARTFLOWS_VER,
321
- true
322
- );
323
- }
324
- }
325
-
326
- /**
327
- * Prepare if class 'Cartflows_Frontend' exist.
328
- * Kicking this off by calling 'get_instance()' method
329
- */
330
- Cartflows_Frontend::get_instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CartFlows Frontend.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Class Cartflows_Frontend.
10
+ */
11
+ class Cartflows_Frontend {
12
+
13
+ /**
14
+ * Member Variable
15
+ *
16
+ * @var instance
17
+ */
18
+ private static $instance;
19
+
20
+ /**
21
+ * Initiator
22
+ */
23
+ public static function get_instance() {
24
+ if ( ! isset( self::$instance ) ) {
25
+ self::$instance = new self;
26
+ }
27
+ return self::$instance;
28
+ }
29
+
30
+ /**
31
+ * Constructor
32
+ */
33
+ public function __construct() {
34
+
35
+ /* Set / Destroy Flow Sessions. Set data */
36
+ add_action( 'wp', array( $this, 'init_actions' ), 1 );
37
+
38
+ /* Enqueue global required scripts */
39
+ add_action( 'wp', array( $this, 'wp_actions' ), 55 );
40
+
41
+ /* Modify the checkout order received url to go thank you page in our flow */
42
+ add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_to_thankyou_page' ), 10, 2 );
43
+ }
44
+
45
+ /**
46
+ * Redirect to thank page if upsell not exists
47
+ *
48
+ * @param string $order_recieve_url url.
49
+ * @param object $order order object.
50
+ * @since 1.0.0
51
+ */
52
+ function redirect_to_thankyou_page( $order_recieve_url, $order ) {
53
+
54
+ /* Only for thank you page */
55
+ wcf()->logger->log( 'Start-' . __CLASS__ . '::' . __FUNCTION__ );
56
+ wcf()->logger->log( 'Only for thank you page' );
57
+
58
+ if ( wcf()->flow->is_thankyou_page_exists( $order ) ) {
59
+
60
+ if ( _is_wcf_doing_checkout_ajax() ) {
61
+
62
+ $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
63
+
64
+ if ( ! $checkout_id ) {
65
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
66
+ }
67
+ } else {
68
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
69
+ }
70
+
71
+ wcf()->logger->log( 'Checkout ID : ' . $checkout_id );
72
+
73
+ if ( $checkout_id ) {
74
+
75
+ $thankyou_step_id = wcf()->flow->get_thankyou_page_id( $order );
76
+
77
+ if ( $thankyou_step_id ) {
78
+
79
+ $order_recieve_url = get_permalink( $thankyou_step_id );
80
+
81
+ $order_recieve_url = add_query_arg(
82
+ array(
83
+ 'wcf-order' => $order->get_id(),
84
+ 'wcf-key' => $order->get_order_key(),
85
+ ),
86
+ $order_recieve_url
87
+ );
88
+ }
89
+ }
90
+ }
91
+
92
+ wcf()->logger->log( 'End-' . __CLASS__ . '::' . __FUNCTION__ );
93
+
94
+ return $order_recieve_url;
95
+ }
96
+
97
+ /**
98
+ * Cancel and redirect to checkout
99
+ *
100
+ * @param string $return_url url.
101
+ * @since 1.0.0
102
+ */
103
+ function redirect_to_checkout_on_cancel( $return_url ) {
104
+
105
+ if ( _is_wcf_doing_checkout_ajax() ) {
106
+
107
+ $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
108
+
109
+ if ( ! $checkout_id ) {
110
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
111
+ }
112
+ } else {
113
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
114
+ }
115
+
116
+ if ( $checkout_id ) {
117
+
118
+ $return_url = add_query_arg(
119
+ array(
120
+ 'cancel_order' => 'true',
121
+ '_wpnonce' => wp_create_nonce( 'woocommerce-cancel_order' ),
122
+ ),
123
+ get_permalink( $checkout_id )
124
+ );
125
+ }
126
+
127
+ return $return_url;
128
+ }
129
+
130
+
131
+ /**
132
+ * Remove theme styles.
133
+ *
134
+ * @since 1.0.0
135
+ */
136
+ function remove_theme_styles() {
137
+
138
+ if ( Cartflows_Compatibility::get_instance()->is_compatibility_theme_enabled() ) {
139
+ return;
140
+ }
141
+
142
+ // get all styles data.
143
+ global $wp_styles;
144
+ global $wp_scripts;
145
+
146
+ $get_stylesheet = 'themes/' . get_stylesheet() . '/';
147
+ $get_template = 'themes/' . get_template() . '/';
148
+
149
+ $remove_styles = apply_filters( 'cartflows_remove_theme_styles', true );
150
+
151
+ if ( $remove_styles ) {
152
+
153
+ // loop over all of the registered scripts..
154
+ foreach ( $wp_styles->registered as $handle => $data ) {
155
+
156
+ if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
157
+
158
+ // remove it.
159
+ wp_deregister_style( $handle );
160
+ wp_dequeue_style( $handle );
161
+ }
162
+ }
163
+ }
164
+
165
+ $remove_scripts = apply_filters( 'cartflows_remove_theme_scripts', true );
166
+
167
+ if ( $remove_scripts ) {
168
+
169
+ // loop over all of the registered scripts.
170
+ foreach ( $wp_scripts->registered as $handle => $data ) {
171
+
172
+ if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
173
+
174
+ // remove it.
175
+ wp_deregister_script( $handle );
176
+ wp_dequeue_script( $handle );
177
+ }
178
+ }
179
+ }
180
+
181
+ }
182
+
183
+ /**
184
+ * Update main order data in transient.
185
+ *
186
+ * @param array $woo_styles new styles array.
187
+ * @since 1.0.0
188
+ * @return array.
189
+ */
190
+ function woo_default_css( $woo_styles ) {
191
+
192
+ $woo_styles = array(
193
+ 'woocommerce-layout' => array(
194
+ 'src' => plugins_url( 'assets/css/woocommerce-layout.css', WC_PLUGIN_FILE ),
195
+ 'deps' => '',
196
+ 'version' => WC_VERSION,
197
+ 'media' => 'all',
198
+ 'has_rtl' => true,
199
+ ),
200
+ 'woocommerce-smallscreen' => array(
201
+ 'src' => plugins_url( 'assets/css/woocommerce-smallscreen.css', WC_PLUGIN_FILE ),
202
+ 'deps' => 'woocommerce-layout',
203
+ 'version' => WC_VERSION,
204
+ 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', '768px' ) . ')',
205
+ 'has_rtl' => true,
206
+ ),
207
+ 'woocommerce-general' => array(
208
+ 'src' => plugins_url( 'assets/css/woocommerce.css', WC_PLUGIN_FILE ),
209
+ 'deps' => '',
210
+ 'version' => WC_VERSION,
211
+ 'media' => 'all',
212
+ 'has_rtl' => true,
213
+ ),
214
+ );
215
+
216
+ return $woo_styles;
217
+ }
218
+
219
+ /**
220
+ * Init Actions.
221
+ *
222
+ * @since 1.0.0
223
+ */
224
+ function init_actions() {
225
+
226
+ $this->set_flow_session();
227
+ }
228
+
229
+ /**
230
+ * Set flow session.
231
+ *
232
+ * @since 1.0.0
233
+ */
234
+ function set_flow_session() {
235
+
236
+ if ( wcf()->utils->is_step_post_type() ) {
237
+
238
+ add_action( 'wp_head', array( $this, 'noindex_flow' ) );
239
+
240
+ wcf()->utils->do_not_cache();
241
+
242
+ /* Set key to support pixel */
243
+ if ( isset( $_GET['wcf-key'] ) ) {
244
+ $_GET['key'] = $_GET['wcf-key'];
245
+ $_REQUEST['key'] = $_GET['wcf-key'];
246
+ }
247
+
248
+ if ( isset( $_GET['wcf-order'] ) ) {
249
+ $_GET['order'] = $_GET['wcf-order'];
250
+ $_REQUEST['order'] = $_GET['wcf-order'];
251
+ $_GET['order-received'] = $_GET['wcf-order'];
252
+ $_REQUEST['order-received'] = $_GET['wcf-order'];
253
+ }
254
+ }
255
+ }
256
+
257
+ /**
258
+ * Add noindex, nofollow.
259
+ *
260
+ * @since 1.0.0
261
+ */
262
+ function noindex_flow() {
263
+
264
+ $common = Cartflows_Helper::get_common_settings();
265
+
266
+ if ( 'enable' === $common['disallow_indexing'] ) {
267
+ echo '<meta name="robots" content="noindex,nofollow">';
268
+ }
269
+ }
270
+
271
+ /**
272
+ * WP Actions.
273
+ *
274
+ * @since 1.0.0
275
+ */
276
+ function wp_actions() {
277
+
278
+ if ( wcf()->utils->is_step_post_type() ) {
279
+
280
+ /* CSS Compatibility for All theme */
281
+ add_filter( 'woocommerce_enqueue_styles', array( $this, 'woo_default_css' ), 9999 );
282
+
283
+ add_action( 'wp_enqueue_scripts', array( $this, 'remove_theme_styles' ), 9999 );
284
+ add_action( 'wp_enqueue_scripts', array( $this, 'global_flow_scripts' ), 20 );
285
+
286
+ /* Load woo templates from plugin */
287
+ add_filter( 'woocommerce_locate_template', array( $this, 'override_woo_template' ), 20, 3 );
288
+
289
+ /* Add version class to body in frontend. */
290
+ add_filter( 'body_class', array( $this, 'add_cartflows_lite_version_to_body' ) );
291
+
292
+ /* Remove the action applied by the Flatsome theme */
293
+ if ( Cartflows_Compatibility::get_instance()->is_flatsome_enabled() ) {
294
+ $this->remove_flatsome_action();
295
+ }
296
+ }
297
+ }
298
+
299
+ /**
300
+ * Global flow scripts.
301
+ *
302
+ * @since 1.0.0
303
+ */
304
+ function global_flow_scripts() {
305
+
306
+ global $post;
307
+
308
+ $flow = get_post_meta( $post->ID, 'wcf-flow-id', true );
309
+ $current_step = $post->ID;
310
+ $next_step_link = '';
311
+ $compatibility = Cartflows_Compatibility::get_instance();
312
+
313
+ if ( _is_wcf_landing_type() ) {
314
+
315
+ $next_step_id = wcf()->utils->get_next_step_id( $flow, $current_step );
316
+ $next_step_link = get_permalink( $next_step_id );
317
+ }
318
+
319
+ $localize = array(
320
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
321
+ 'is_pb_preview' => $compatibility->is_page_builder_preview(),
322
+ 'current_theme' => $compatibility->get_current_theme(),
323
+ 'current_flow' => $flow,
324
+ 'current_step' => $current_step,
325
+ 'next_step' => $next_step_link,
326
+ );
327
+
328
+ wp_localize_script( 'jquery', 'cartflows', apply_filters( 'global_cartflows_js_localize', $localize ) );
329
+
330
+ wp_enqueue_style( 'wcf-frontend-global', CARTFLOWS_URL . 'assets/css/frontend.css', array(), CARTFLOWS_VER );
331
+ wp_style_add_data( 'wcf-frontend-global', 'rtl', 'replace' );
332
+
333
+ wp_enqueue_script(
334
+ 'wcf-frontend-global',
335
+ CARTFLOWS_URL . 'assets/js/frontend.js',
336
+ array( 'jquery' ),
337
+ CARTFLOWS_VER,
338
+ true
339
+ );
340
+ }
341
+
342
+ /**
343
+ * Override woo templates.
344
+ *
345
+ * @param string $template new Template full path.
346
+ * @param string $template_name Template name.
347
+ * @param string $template_path Template Path.
348
+ * @since 1.1.5
349
+ * @return string.
350
+ */
351
+ function override_woo_template( $template, $template_name, $template_path ) {
352
+
353
+ global $woocommerce;
354
+
355
+ $_template = $template;
356
+
357
+ $plugin_path = CARTFLOWS_DIR . 'woocommerce/template/';
358
+
359
+ if ( file_exists( $plugin_path . $template_name ) ) {
360
+ $template = $plugin_path . $template_name;
361
+ }
362
+
363
+ if ( ! $template ) {
364
+ $template = $_template;
365
+ }
366
+
367
+ return $template;
368
+ }
369
+
370
+ /**
371
+ * Remove the action applied by the Flatsome theme.
372
+ *
373
+ * @since 1.1.5
374
+ * @return void.
375
+ */
376
+ function remove_flatsome_action() {
377
+
378
+ // Remove action where flatsome dequeued the woocommerce's default styles.
379
+ remove_action( 'wp_enqueue_scripts', 'flatsome_woocommerce_scripts_styles', 98 );
380
+ }
381
+
382
+ /**
383
+ * Add version class to body in frontend.
384
+ *
385
+ * @since 1.1.5
386
+ * @param array $classes classes.
387
+ * @return array $classes classes.
388
+ */
389
+ function add_cartflows_lite_version_to_body( $classes ) {
390
+
391
+ $classes[] = 'cartflows-' . CARTFLOWS_VER;
392
+
393
+ return $classes;
394
+
395
+ }
396
+ }
397
+
398
+ /**
399
+ * Prepare if class 'Cartflows_Frontend' exist.
400
+ * Kicking this off by calling 'get_instance()' method
401
+ */
402
+ Cartflows_Frontend::get_instance();
classes/class-cartflows-functions.php CHANGED
@@ -1,387 +1,388 @@
1
- <?php
2
- /**
3
- * CartFlows Functions.
4
- *
5
- * @package CARTFLOWS
6
- */
7
-
8
- if ( ! defined( 'ABSPATH' ) ) {
9
- exit; // Exit if accessed directly.
10
- }
11
-
12
- /**
13
- * Check if cartflows pro activated.
14
- *
15
- * @since 1.0.0
16
- */
17
- function _is_cartflows_pro() {
18
-
19
- if ( defined( 'CARTFLOWS_PRO_FILE' ) ) {
20
- return true;
21
- }
22
-
23
- return false;
24
-
25
- }
26
-
27
- /**
28
- * Returns step id.
29
- *
30
- * @since 1.0.0
31
- */
32
- function _get_wcf_post_id() {
33
-
34
- global $post;
35
-
36
- if ( isset( $post->ID ) ) {
37
- return $post->ID;
38
- }
39
-
40
- return 0;
41
- }
42
-
43
- /**
44
- * Returns step id.
45
- *
46
- * @since 1.0.0
47
- */
48
- function _get_wcf_step_id() {
49
-
50
- if ( wcf()->utils->is_step_post_type() ) {
51
-
52
- global $post;
53
-
54
- return $post->ID;
55
- }
56
-
57
- return false;
58
- }
59
-
60
- /**
61
- * Check if it is a landing page?
62
- *
63
- * @since 1.0.0
64
- */
65
- function _is_wcf_landing_type() {
66
-
67
- if ( wcf()->utils->is_step_post_type() ) {
68
-
69
- global $post;
70
-
71
- if ( 'landing' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
72
-
73
- return true;
74
- }
75
- }
76
-
77
- return false;
78
- }
79
-
80
- /**
81
- * Returns landing id.
82
- *
83
- * @since 1.0.0
84
- */
85
- function _get_wcf_landing_id() {
86
-
87
- if ( _is_wcf_landing_type() ) {
88
-
89
- global $post;
90
-
91
- return $post->ID;
92
- }
93
-
94
- return false;
95
- }
96
-
97
- /**
98
- * Is custom checkout?
99
- *
100
- * @param int $checkout_id checkout ID.
101
- * @since 1.0.0
102
- */
103
- function _is_wcf_meta_custom_checkout( $checkout_id ) {
104
-
105
- $is_custom = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-custom-checkout-fields' );
106
-
107
- if ( 'yes' === $is_custom ) {
108
-
109
- return true;
110
- }
111
-
112
- return false;
113
- }
114
-
115
- /**
116
- * Check if page is cartflow checkout.
117
- *
118
- * @since 1.0.0
119
- * @return bool
120
- */
121
- function _is_wcf_checkout_type() {
122
-
123
- if ( wcf()->utils->is_step_post_type() ) {
124
-
125
- global $post;
126
-
127
- if ( 'checkout' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
128
-
129
- return true;
130
- }
131
- }
132
-
133
- return false;
134
- }
135
-
136
- /**
137
- * Check if AJAX call is in progress.
138
- *
139
- * @since 1.0.0
140
- * @return bool
141
- */
142
- function _is_wcf_doing_checkout_ajax() {
143
-
144
- if ( wp_doing_ajax() ) {
145
-
146
- if ( isset( $_GET['wc-ajax'] ) &&
147
- 'checkout' === $_GET['wc-ajax'] &&
148
- isset( $_POST['_wcf_checkout_id'] )
149
- ) {
150
- return true;
151
- }
152
- }
153
-
154
- return false;
155
- }
156
-
157
-
158
- /**
159
- * Returns checkout ID.
160
- *
161
- * @since 1.0.0
162
- * @return int/bool
163
- */
164
- function _get_wcf_checkout_id() {
165
-
166
- if ( _is_wcf_checkout_type() ) {
167
-
168
- global $post;
169
-
170
- return $post->ID;
171
- }
172
-
173
- return false;
174
- }
175
-
176
- /**
177
- * Check if it is checkout shortcode.
178
- *
179
- * @since 1.0.0
180
- * @return bool
181
- */
182
- function _is_wcf_checkout_shortcode() {
183
-
184
- global $post;
185
-
186
- if ( ! empty( $post ) && has_shortcode( $post->post_content, 'cartflows_checkout' ) ) {
187
-
188
- return true;
189
- }
190
-
191
- return false;
192
- }
193
-
194
- /**
195
- * Check if it is checkout shortcode.
196
- *
197
- * @since 1.0.0
198
- * @param string $content shortcode content.
199
- * @return bool
200
- */
201
- function _get_wcf_checkout_id_from_shortcode( $content = '' ) {
202
-
203
- $checkout_id = 0;
204
-
205
- if ( ! empty( $content ) ) {
206
-
207
- $regex_pattern = get_shortcode_regex( array( 'cartflows_checkout' ) );
208
-
209
- preg_match( '/' . $regex_pattern . '/s', $content, $regex_matches );
210
-
211
- if ( ! empty( $regex_matches ) ) {
212
-
213
- if ( 'cartflows_checkout' == $regex_matches[2] ) {
214
-
215
- $attribure_str = str_replace( ' ', '&', trim( $regex_matches[3] ) );
216
- $attribure_str = str_replace( '"', '', $attribure_str );
217
-
218
- $attributes = wp_parse_args( $attribure_str );
219
-
220
- if ( isset( $attributes['id'] ) ) {
221
- $checkout_id = $attributes['id'];
222
- }
223
- }
224
- }
225
- }
226
-
227
- return $checkout_id;
228
- }
229
-
230
- /**
231
- * Check if post type is upsell.
232
- *
233
- * @since 1.0.0
234
- * @return bool
235
- */
236
- function _is_wcf_upsell_type() {
237
-
238
- if ( wcf()->utils->is_step_post_type() ) {
239
-
240
- global $post;
241
-
242
- if ( 'upsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
243
-
244
- return true;
245
- }
246
- }
247
-
248
- return false;
249
- }
250
-
251
- /**
252
- * Returns upsell ID.
253
- *
254
- * @since 1.0.0
255
- * @return int/bool
256
- */
257
- function _get_wcf_upsell_id() {
258
-
259
- if ( _is_wcf_upsell_type() ) {
260
-
261
- global $post;
262
-
263
- return $post->ID;
264
- }
265
-
266
- return false;
267
- }
268
-
269
- /**
270
- * Check if post is of type downsell.
271
- *
272
- * @since 1.0.0
273
- * @return int/bool
274
- */
275
- function _is_wcf_downsell_type() {
276
-
277
- if ( wcf()->utils->is_step_post_type() ) {
278
-
279
- global $post;
280
-
281
- if ( 'downsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
282
-
283
- return true;
284
- }
285
- }
286
-
287
- return false;
288
- }
289
-
290
- /**
291
- * Get downsell page ID.
292
- *
293
- * @since 1.0.0
294
- * @return int/bool
295
- */
296
- function _get_wcf_downsell_id() {
297
-
298
- if ( _is_wcf_downsell_type() ) {
299
-
300
- global $post;
301
-
302
- return $post->ID;
303
- }
304
-
305
- return false;
306
- }
307
-
308
- /**
309
- * Check if page is of thank you type.
310
- *
311
- * @since 1.0.0
312
- * @return int/bool
313
- */
314
- function _is_wcf_thankyou_type() {
315
-
316
- if ( wcf()->utils->is_step_post_type() ) {
317
-
318
- global $post;
319
-
320
- if ( 'thankyou' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
321
-
322
- return true;
323
- }
324
- }
325
-
326
- return false;
327
- }
328
-
329
- /**
330
- * Get thank you page ID.
331
- *
332
- * @since 1.0.0
333
- * @return int/bool
334
- */
335
- function _get_wcf_thankyou_id() {
336
-
337
- if ( _is_wcf_thankyou_type() ) {
338
-
339
- global $post;
340
-
341
- return $post->ID;
342
- }
343
-
344
- return false;
345
- }
346
-
347
-
348
- /**
349
- * Check if post type is upsell.
350
- *
351
- * @since 1.0.0
352
- * @return bool
353
- */
354
- function _is_wcf_base_offer_type() {
355
-
356
- if ( wcf()->utils->is_step_post_type() ) {
357
-
358
- global $post;
359
-
360
- $step_type = get_post_meta( $post->ID, 'wcf-step-type', true );
361
-
362
- if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
363
-
364
- return true;
365
- }
366
- }
367
-
368
- return false;
369
- }
370
-
371
- /**
372
- * Returns upsell ID.
373
- *
374
- * @since 1.0.0
375
- * @return int/bool
376
- */
377
- function _get_wcf_base_offer_id() {
378
-
379
- if ( _is_wcf_base_offer_type() ) {
380
-
381
- global $post;
382
-
383
- return $post->ID;
384
- }
385
-
386
- return false;
387
- }
 
1
+ <?php
2
+ /**
3
+ * CartFlows Functions.
4
+ *
5
+ * @package CARTFLOWS
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+
12
+ /**
13
+ * Check if cartflows pro activated.
14
+ *
15
+ * @since 1.0.0
16
+ */
17
+ function _is_cartflows_pro() {
18
+
19
+ if ( defined( 'CARTFLOWS_PRO_FILE' ) ) {
20
+ return true;
21
+ }
22
+
23
+ return false;
24
+
25
+ }
26
+
27
+ /**
28
+ * Returns step id.
29
+ *
30
+ * @since 1.0.0
31
+ */
32
+ function _get_wcf_post_id() {
33
+
34
+ global $post;
35
+
36
+ if ( isset( $post->ID ) ) {
37
+ return $post->ID;
38
+ }
39
+
40
+ return 0;
41
+ }
42
+
43
+ /**
44
+ * Returns step id.
45
+ *
46
+ * @since 1.0.0
47
+ */
48
+ function _get_wcf_step_id() {
49
+
50
+ if ( wcf()->utils->is_step_post_type() ) {
51
+
52
+ global $post;
53
+
54
+ return $post->ID;
55
+ }
56
+
57
+ return false;
58
+ }
59
+
60
+ /**
61
+ * Check if it is a landing page?
62
+ *
63
+ * @since 1.0.0
64
+ */
65
+ function _is_wcf_landing_type() {
66
+
67
+ if ( wcf()->utils->is_step_post_type() ) {
68
+
69
+ global $post;
70
+
71
+ if ( 'landing' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
72
+
73
+ return true;
74
+ }
75
+ }
76
+
77
+ return false;
78
+ }
79
+
80
+ /**
81
+ * Returns landing id.
82
+ *
83
+ * @since 1.0.0
84
+ */
85
+ function _get_wcf_landing_id() {
86
+
87
+ if ( _is_wcf_landing_type() ) {
88
+
89
+ global $post;
90
+
91
+ return $post->ID;
92
+ }
93
+
94
+ return false;
95
+ }
96
+
97
+ /**
98
+ * Is custom checkout?
99
+ *
100
+ * @param int $checkout_id checkout ID.
101
+ * @since 1.0.0
102
+ */
103
+ function _is_wcf_meta_custom_checkout( $checkout_id ) {
104
+
105
+ $is_custom = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-custom-checkout-fields' );
106
+
107
+ if ( 'yes' === $is_custom ) {
108
+
109
+ return true;
110
+ }
111
+
112
+ return false;
113
+ }
114
+
115
+ /**
116
+ * Check if page is cartflow checkout.
117
+ *
118
+ * @since 1.0.0
119
+ * @return bool
120
+ */
121
+ function _is_wcf_checkout_type() {
122
+
123
+ if ( wcf()->utils->is_step_post_type() ) {
124
+
125
+ global $post;
126
+
127
+ if ( 'checkout' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
128
+
129
+ return true;
130
+ }
131
+ }
132
+
133
+ return false;
134
+ }
135
+
136
+ /**
137
+ * Check if AJAX call is in progress.
138
+ *
139
+ * @since 1.0.0
140
+ * @return bool
141
+ */
142
+ function _is_wcf_doing_checkout_ajax() {
143
+
144
+ if ( wp_doing_ajax() ) {
145
+
146
+ if ( isset( $_GET['wc-ajax'] ) &&
147
+ 'checkout' === $_GET['wc-ajax'] &&
148
+ isset( $_POST['_wcf_checkout_id'] )
149
+ ) {
150
+ return true;
151
+ }
152
+ }
153
+
154
+ return false;
155
+ }
156
+
157
+
158
+ /**
159
+ * Returns checkout ID.
160
+ *
161
+ * @since 1.0.0
162
+ * @return int/bool
163
+ */
164
+ function _get_wcf_checkout_id() {
165
+
166
+ if ( _is_wcf_checkout_type() ) {
167
+
168
+ global $post;
169
+
170
+ return $post->ID;
171
+ }
172
+
173
+ return false;
174
+ }
175
+
176
+ /**
177
+ * Check if it is checkout shortcode.
178
+ *
179
+ * @since 1.0.0
180
+ * @return bool
181
+ */
182
+ function _is_wcf_checkout_shortcode() {
183
+
184
+ global $post;
185
+
186
+ if ( ! empty( $post ) && has_shortcode( $post->post_content, 'cartflows_checkout' ) ) {
187
+
188
+ return true;
189
+ }
190
+
191
+ return false;
192
+ }
193
+
194
+ /**
195
+ * Check if it is checkout shortcode.
196
+ *
197
+ * @since 1.0.0
198
+ * @param string $content shortcode content.
199
+ * @return bool
200
+ */
201
+ function _get_wcf_checkout_id_from_shortcode( $content = '' ) {
202
+
203
+ $checkout_id = 0;
204
+
205
+ if ( ! empty( $content ) ) {
206
+
207
+ $regex_pattern = get_shortcode_regex( array( 'cartflows_checkout' ) );
208
+
209
+ preg_match( '/' . $regex_pattern . '/s', $content, $regex_matches );
210
+
211
+ if ( ! empty( $regex_matches ) ) {
212
+
213
+ if ( 'cartflows_checkout' == $regex_matches[2] ) {
214
+
215
+ $attribure_str = str_replace( ' ', '&', trim( $regex_matches[3] ) );
216
+ $attribure_str = str_replace( '"', '', $attribure_str );
217
+
218
+ $attributes = wp_parse_args( $attribure_str );
219
+
220
+ if ( isset( $attributes['id'] ) ) {
221
+ $checkout_id = $attributes['id'];
222
+ }
223
+ }
224
+ }
225
+ }
226
+
227
+ return $checkout_id;
228
+ }
229
+
230
+ /**
231
+ * Check if post type is upsell.
232
+ *
233
+ * @since 1.0.0
234
+ * @return bool
235
+ */
236
+ function _is_wcf_upsell_type() {
237
+
238
+ if ( wcf()->utils->is_step_post_type() ) {
239
+
240
+ global $post;
241
+
242
+ if ( 'upsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
243
+
244
+ return true;
245
+ }
246
+ }
247
+
248
+ return false;
249
+ }
250
+
251
+ /**
252
+ * Returns upsell ID.
253
+ *
254
+ * @since 1.0.0
255
+ * @return int/bool
256
+ */
257
+ function _get_wcf_upsell_id() {
258
+
259
+ if ( _is_wcf_upsell_type() ) {
260
+
261
+ global $post;
262
+
263
+ return $post->ID;
264
+ }
265
+
266
+ return false;
267
+ }
268
+
269
+ /**
270
+ * Check if post is of type downsell.
271
+ *
272
+ * @since 1.0.0
273
+ * @return int/bool
274
+ */
275
+ function _is_wcf_downsell_type() {
276
+
277
+ if ( wcf()->utils->is_step_post_type() ) {
278
+
279
+ global $post;
280
+
281
+ if ( 'downsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
282
+
283
+ return true;
284
+ }
285
+ }
286
+
287
+ return false;
288
+ }
289
+
290
+ /**
291
+ * Get downsell page ID.
292
+ *
293
+ * @since 1.0.0
294
+ * @return int/bool
295
+ */
296
+ function _get_wcf_downsell_id() {
297
+
298
+ if ( _is_wcf_downsell_type() ) {
299
+
300
+ global $post;
301
+
302
+ return $post->ID;
303
+ }
304
+
305
+ return false;
306
+ }
307
+
308
+ /**
309
+ * Check if page is of thank you type.
310
+ *
311
+ * @since 1.0.0
312
+ * @return int/bool
313
+ */
314
+ function _is_wcf_thankyou_type() {
315
+
316
+ if ( wcf()->utils->is_step_post_type() ) {
317
+
318
+ global $post;
319
+
320
+ if ( 'thankyou' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
321
+
322
+ return true;
323
+ }
324
+ }
325
+
326
+ return false;
327
+ }
328
+
329
+ /**
330
+ * Get thank you page ID.
331
+ *
332
+ * @since 1.0.0
333
+ * @return int/bool
334
+ */
335
+ function _get_wcf_thankyou_id() {
336
+
337
+ if ( _is_wcf_thankyou_type() ) {
338
+
339
+ global $post;
340
+
341
+ return $post->ID;
342
+ }
343
+
344
+ return false;
345
+ }
346
+
347
+
348
+ /**
349
+ * Check if post type is upsell.
350
+ *
351
+ * @since 1.0.0
352
+ * @return bool
353
+ */
354
+ function _is_wcf_base_offer_type() {
355
+
356
+ if ( wcf()->utils->is_step_post_type() ) {
357
+
358
+ global $post;
359
+
360
+ $step_type = get_post_meta( $post->ID, 'wcf-step-type', true );
361
+
362
+ if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
363
+
364
+ return true;
365
+ }
366
+ }
367
+
368
+ return false;
369
+ }
370
+
371
+ /**
372
+ * Returns upsell ID.
373
+ *
374
+ * @since 1.0.0
375
+ * @return int/bool
376
+ */
377
+ function _get_wcf_base_offer_id() {
378
+
379
+ if ( _is_wcf_base_offer_type() ) {
380
+
381
+ global $post;
382
+
383
+ return $post->ID;
384
+ }
385
+
386
+ return false;
387
+ }
388
+
classes/class-cartflows-loader.php CHANGED
@@ -1,419 +1,419 @@
1
- <?php
2
- /**
3
- * CartFlows Loader.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- if ( ! class_exists( 'Cartflows_Loader' ) ) {
9
-
10
- /**
11
- * Class Cartflows_Loader.
12
- */
13
- final class Cartflows_Loader {
14
-
15
- /**
16
- * Member Variable
17
- *
18
- * @var instance
19
- */
20
- private static $instance = null;
21
-
22
- /**
23
- * Member Variable
24
- *
25
- * @var utils
26
- */
27
- public $utils = null;
28
-
29
- /**
30
- * Member Variable
31
- *
32
- * @var logger
33
- */
34
- public $logger = null;
35
-
36
- /**
37
- * Member Variable
38
- *
39
- * @var session
40
- */
41
- public $session = null;
42
-
43
-
44
- /**
45
- * Member Variable
46
- *
47
- * @var options
48
- */
49
- public $options = null;
50
-
51
- /**
52
- * Member Variable
53
- *
54
- * @var meta
55
- */
56
- public $meta = null;
57
-
58
- /**
59
- * Member Variable
60
- *
61
- * @var flow
62
- */
63
- public $flow = null;
64
-
65
- /**
66
- * Initiator
67
- */
68
- public static function get_instance() {
69
-
70
- if ( is_null( self::$instance ) ) {
71
-
72
- self::$instance = new self;
73
-
74
- /**
75
- * CartFlows loaded.
76
- *
77
- * Fires when Cartflows was fully loaded and instantiated.
78
- *
79
- * @since 1.0.0
80
- */
81
- do_action( 'cartflows_loaded' );
82
- }
83
-
84
- return self::$instance;
85
- }
86
-
87
- /**
88
- * Constructor
89
- */
90
- public function __construct() {
91
-
92
- $this->define_constants();
93
-
94
- // Activation hook.
95
- register_activation_hook( CARTFLOWS_FILE, array( $this, 'activation_reset' ) );
96
-
97
- // deActivation hook.
98
- register_deactivation_hook( CARTFLOWS_FILE, array( $this, 'deactivation_reset' ) );
99
-
100
- add_action( 'plugins_loaded', array( $this, 'load_plugin' ), 99 );
101
-
102
- add_action( 'plugins_loaded', array( $this, 'load_cf_textdomain' ) );
103
-
104
- // Update compatibility.
105
- require_once CARTFLOWS_DIR . 'classes/class-cartflows-update.php';
106
- }
107
-
108
- /**
109
- * Defines all constants
110
- *
111
- * @since 1.0.0
112
- */
113
- public function define_constants() {
114
-
115
- define( 'CARTFLOWS_BASE', plugin_basename( CARTFLOWS_FILE ) );
116
- define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
117
- define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
118
- define( 'CARTFLOWS_VER', '1.1.5' );
119
- define( 'CARTFLOWS_SLUG', 'cartflows' );
120
- define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
121
-
122
- define( 'CARTFLOWS_FLOW_POST_TYPE', 'cartflows_flow' );
123
- define( 'CARTFLOWS_STEP_POST_TYPE', 'cartflows_step' );
124
-
125
- if ( ! defined( 'CARTFLOWS_SERVER_URL' ) ) {
126
- define( 'CARTFLOWS_SERVER_URL', 'https://my.cartflows.com/' );
127
- }
128
- define( 'CARTFLOWS_DOMAIN_URL', 'https://cartflows.com/' );
129
- define( 'CARTFLOWS_TEMPLATES_URL', 'https://templates.cartflows.com/' );
130
- define( 'CARTFLOWS_TAXONOMY_STEP_TYPE', 'cartflows_step_type' );
131
- define( 'CARTFLOWS_TAXONOMY_STEP_FLOW', 'cartflows_step_flow' );
132
-
133
- if ( ! defined( 'CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER' ) ) {
134
- define( 'CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER', 'cartflows_step_page_builder' );
135
- }
136
- if ( ! defined( 'CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER' ) ) {
137
- define( 'CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER', 'cartflows_flow_page_builder' );
138
- }
139
- if ( ! defined( 'CARTFLOWS_TAXONOMY_FLOW_CATEGORY' ) ) {
140
- define( 'CARTFLOWS_TAXONOMY_FLOW_CATEGORY', 'cartflows_flow_category' );
141
- }
142
- }
143
-
144
- /**
145
- * Loads plugin files.
146
- *
147
- * @since 1.0.0
148
- *
149
- * @return void
150
- */
151
- function load_plugin() {
152
-
153
- if ( ! function_exists( 'WC' ) ) {
154
- add_action( 'admin_notices', array( $this, 'fails_to_load' ) );
155
- return;
156
- }
157
-
158
- $this->load_helper_files_components();
159
- $this->load_core_files();
160
- $this->load_core_components();
161
-
162
- /**
163
- * CartFlows Init.
164
- *
165
- * Fires when Cartflows is instantiated.
166
- *
167
- * @since 1.0.0
168
- */
169
- do_action( 'cartflows_init' );
170
- }
171
-
172
- /**
173
- * Load Helper Files and Components.
174
- *
175
- * @since 1.0.0
176
- *
177
- * @return void
178
- */
179
- function load_helper_files_components() {
180
-
181
- /* Public Utils */
182
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-utils.php';
183
-
184
- /* Public Session */
185
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-session.php';
186
-
187
- /* Public Global namespace functions */
188
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-functions.php';
189
-
190
- /* Admin Helper */
191
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-helper.php';
192
-
193
- /* Meta Default Values */
194
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-default-meta.php';
195
-
196
- $this->utils = Cartflows_Utils::get_instance();
197
- $this->session = Cartflows_Session::get_instance();
198
- $this->options = Cartflows_Default_Meta::get_instance();
199
-
200
- }
201
-
202
- /**
203
- * Load Core Files.
204
- *
205
- * @since 1.0.0
206
- *
207
- * @return void
208
- */
209
- function load_core_files() {
210
-
211
- /* Page builder compatibilty class */
212
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-compatibility.php';
213
-
214
- /* Admin Meta Fields*/
215
- include_once CARTFLOWS_DIR . 'classes/fields/typography/class-cartflows-font-families.php';
216
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-meta-fields.php';
217
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-meta.php';
218
-
219
- /* Cloning */
220
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-cloning.php';
221
-
222
- /* Admin Settings */
223
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-admin.php';
224
-
225
- /* Core Modules */
226
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-logger.php';
227
-
228
- /* Frontend Global */
229
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-frontend.php';
230
- require_once CARTFLOWS_DIR . 'classes/class-cartflows-flow-frontend.php';
231
-
232
- /* Modules */
233
- include_once CARTFLOWS_DIR . 'modules/flow/class-cartflows-flow.php';
234
- include_once CARTFLOWS_DIR . 'modules/landing/class-cartflows-landing.php';
235
- include_once CARTFLOWS_DIR . 'modules/checkout/class-cartflows-checkout.php';
236
- include_once CARTFLOWS_DIR . 'modules/thankyou/class-cartflows-thankyou.php';
237
-
238
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-api.php';
239
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer-core.php';
240
-
241
- include_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-batch-process.php';
242
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer.php';
243
- }
244
-
245
- /**
246
- * Load Core Components.
247
- *
248
- * @since 1.0.0
249
- *
250
- * @return void
251
- */
252
- function load_core_components() {
253
-
254
- $this->meta = Cartflows_Meta_Fields::get_instance();
255
- $this->logger = Cartflows_Logger::get_instance();
256
- $this->flow = Cartflows_Flow_Frontend::get_instance();
257
- }
258
-
259
- /**
260
- * Load CartFlows Pro Text Domain.
261
- * This will load the translation textdomain depending on the file priorities.
262
- * 1. Global Languages /wp-content/languages/cartflows/ folder
263
- * 2. Local dorectory /wp-content/plugins/cartflows/languages/ folder
264
- *
265
- * @since 1.0.3
266
- * @return void
267
- */
268
- public function load_cf_textdomain() {
269
-
270
- // Default languages directory for CartFlows Pro.
271
- $lang_dir = CARTFLOWS_DIR . 'languages/';
272
-
273
- /**
274
- * Filters the languages directory path to use for CartFlows Pro.
275
- *
276
- * @param string $lang_dir The languages directory path.
277
- */
278
- $lang_dir = apply_filters( 'cartflows_languages_directory', $lang_dir );
279
-
280
- // Traditional WordPress plugin locale filter.
281
- global $wp_version;
282
-
283
- $get_locale = get_locale();
284
-
285
- if ( $wp_version >= 4.7 ) {
286
- $get_locale = get_user_locale();
287
- }
288
-
289
- /**
290
- * Language Locale for CartFlows Pro
291
- *
292
- * @var $get_locale The locale to use.
293
- * Uses get_user_locale()` in WordPress 4.7 or greater,
294
- * otherwise uses `get_locale()`.
295
- */
296
- $locale = apply_filters( 'plugin_locale', $get_locale, 'cartflows' );
297
- $mofile = sprintf( '%1$s-%2$s.mo', 'cartflows', $locale );
298
-
299
- // Setup paths to current locale file.
300
- $mofile_local = $lang_dir . $mofile;
301
- $mofile_global = WP_LANG_DIR . '/plugins/' . $mofile;
302
-
303
- if ( file_exists( $mofile_global ) ) {
304
- // Look in global /wp-content/languages/cartflows/ folder.
305
- load_textdomain( 'cartflows', $mofile_global );
306
- } elseif ( file_exists( $mofile_local ) ) {
307
- // Look in local /wp-content/plugins/cartflows/languages/ folder.
308
- load_textdomain( 'cartflows', $mofile_local );
309
- } else {
310
- // Load the default language files.
311
- load_plugin_textdomain( 'cartflows', false, $lang_dir );
312
- }
313
- }
314
-
315
- /**
316
- * Fires admin notice when Elementor is not installed and activated.
317
- *
318
- * @since 1.0.0
319
- *
320
- * @return void
321
- */
322
- public function fails_to_load() {
323
-
324
- $screen = get_current_screen();
325
-
326
- if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
327
- return;
328
- }
329
-
330
- $class = 'notice notice-error';
331
- /* translators: %s: html tags */
332
- $message = sprintf( __( 'The %1$sCartFlows%2$s plugin requires %1$sWooCommerce%2$s plugin installed & activated.', 'cartflows' ), '<strong>', '</strong>' );
333
-
334
- $plugin = 'woocommerce/woocommerce.php';
335
-
336
- if ( _is_woo_installed() ) {
337
- if ( ! current_user_can( 'activate_plugins' ) ) {
338
- return;
339
- }
340
-
341
- $action_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin );
342
- $button_label = __( 'Activate WooCommerce', 'cartflows' );
343
-
344
- } else {
345
- if ( ! current_user_can( 'install_plugins' ) ) {
346
- return;
347
- }
348
-
349
- $action_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=woocommerce' ), 'install-plugin_woocommerce' );
350
- $button_label = __( 'Install WooCommerce', 'cartflows' );
351
- }
352
-
353
- $button = '<p><a href="' . $action_url . '" class="button-primary">' . $button_label . '</a></p><p></p>';
354
-
355
- printf( '<div class="%1$s"><p>%2$s</p>%3$s</div>', esc_attr( $class ), $message, $button );
356
- }
357
-
358
- /**
359
- * Activation Reset
360
- */
361
- function activation_reset() {
362
-
363
- include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-flow-post-type.php';
364
- include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-step-post-type.php';
365
-
366
- Cartflows_Flow_Post_Type::get_instance()->flow_post_type();
367
- Cartflows_Step_Post_Type::get_instance()->step_post_type();
368
- flush_rewrite_rules();
369
- }
370
-
371
- /**
372
- * Deactivation Reset
373
- */
374
- function deactivation_reset() {
375
- }
376
-
377
- /**
378
- * Logger Class Instance
379
- */
380
- function logger() {
381
- return Cartflows_Logger::get_instance();
382
- }
383
-
384
-
385
- }
386
-
387
- /**
388
- * Prepare if class 'Cartflows_Loader' exist.
389
- * Kicking this off by calling 'get_instance()' method
390
- */
391
- Cartflows_Loader::get_instance();
392
- }
393
-
394
- /**
395
- * Get global class.
396
- *
397
- * @return object
398
- */
399
- function wcf() {
400
- return Cartflows_Loader::get_instance();
401
- }
402
-
403
- if ( ! function_exists( '_is_woo_installed' ) ) {
404
-
405
- /**
406
- * Is woocommerce plugin installed.
407
- *
408
- * @since 1.0.0
409
- *
410
- * @access public
411
- */
412
- function _is_woo_installed() {
413
-
414
- $path = 'woocommerce/woocommerce.php';
415
- $plugins = get_plugins();
416
-
417
- return isset( $plugins[ $path ] );
418
- }
419
- }
1
+ <?php
2
+ /**
3
+ * CartFlows Loader.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ if ( ! class_exists( 'Cartflows_Loader' ) ) {
9
+
10
+ /**
11
+ * Class Cartflows_Loader.
12
+ */
13
+ final class Cartflows_Loader {
14
+
15
+ /**
16
+ * Member Variable
17
+ *
18
+ * @var instance
19
+ */
20
+ private static $instance = null;
21
+
22
+ /**
23
+ * Member Variable
24
+ *
25
+ * @var utils
26
+ */
27
+ public $utils = null;
28
+
29
+ /**
30
+ * Member Variable
31
+ *
32
+ * @var logger
33
+ */
34
+ public $logger = null;
35
+
36
+ /**
37
+ * Member Variable
38
+ *
39
+ * @var session
40
+ */
41
+ public $session = null;
42
+
43
+
44
+ /**
45
+ * Member Variable
46
+ *
47
+ * @var options
48
+ */
49
+ public $options = null;
50
+
51
+ /**
52
+ * Member Variable
53
+ *
54
+ * @var meta
55
+ */
56
+ public $meta = null;
57
+
58
+ /**
59
+ * Member Variable
60
+ *
61
+ * @var flow
62
+ */
63
+ public $flow = null;
64
+
65
+ /**
66
+ * Initiator
67
+ */
68
+ public static function get_instance() {
69
+
70
+ if ( is_null( self::$instance ) ) {
71
+
72
+ self::$instance = new self;
73
+
74
+ /**
75
+ * CartFlows loaded.
76
+ *
77
+ * Fires when Cartflows was fully loaded and instantiated.
78
+ *
79
+ * @since 1.0.0
80
+ */
81
+ do_action( 'cartflows_loaded' );
82
+ }
83
+
84
+ return self::$instance;
85
+ }
86
+
87
+ /**
88
+ * Constructor
89
+ */
90
+ public function __construct() {
91
+
92
+ $this->define_constants();
93
+
94
+ // Activation hook.
95
+ register_activation_hook( CARTFLOWS_FILE, array( $this, 'activation_reset' ) );
96
+
97
+ // deActivation hook.
98
+ register_deactivation_hook( CARTFLOWS_FILE, array( $this, 'deactivation_reset' ) );
99
+
100
+ add_action( 'plugins_loaded', array( $this, 'load_plugin' ), 99 );
101
+
102
+ add_action( 'plugins_loaded', array( $this, 'load_cf_textdomain' ) );
103
+
104
+ // Update compatibility.
105
+ require_once CARTFLOWS_DIR . 'classes/class-cartflows-update.php';
106
+ }
107
+
108
+ /**
109
+ * Defines all constants
110
+ *
111
+ * @since 1.0.0
112
+ */
113
+ public function define_constants() {
114
+
115
+ define( 'CARTFLOWS_BASE', plugin_basename( CARTFLOWS_FILE ) );
116
+ define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
117
+ define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
118
+ define( 'CARTFLOWS_VER', '1.1.6' );
119
+ define( 'CARTFLOWS_SLUG', 'cartflows' );
120
+ define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
121
+
122
+ define( 'CARTFLOWS_FLOW_POST_TYPE', 'cartflows_flow' );
123
+ define( 'CARTFLOWS_STEP_POST_TYPE', 'cartflows_step' );
124
+
125
+ if ( ! defined( 'CARTFLOWS_SERVER_URL' ) ) {
126
+ define( 'CARTFLOWS_SERVER_URL', 'https://my.cartflows.com/' );
127
+ }
128
+ define( 'CARTFLOWS_DOMAIN_URL', 'https://cartflows.com/' );
129
+ define( 'CARTFLOWS_TEMPLATES_URL', 'https://templates.cartflows.com/' );
130
+ define( 'CARTFLOWS_TAXONOMY_STEP_TYPE', 'cartflows_step_type' );
131
+ define( 'CARTFLOWS_TAXONOMY_STEP_FLOW', 'cartflows_step_flow' );
132
+
133
+ if ( ! defined( 'CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER' ) ) {
134
+ define( 'CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER', 'cartflows_step_page_builder' );
135
+ }
136
+ if ( ! defined( 'CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER' ) ) {
137
+ define( 'CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER', 'cartflows_flow_page_builder' );
138
+ }
139
+ if ( ! defined( 'CARTFLOWS_TAXONOMY_FLOW_CATEGORY' ) ) {
140
+ define( 'CARTFLOWS_TAXONOMY_FLOW_CATEGORY', 'cartflows_flow_category' );
141
+ }
142
+ }
143
+
144
+ /**
145
+ * Loads plugin files.
146
+ *
147
+ * @since 1.0.0
148
+ *
149
+ * @return void
150
+ */
151
+ function load_plugin() {
152
+
153
+ if ( ! function_exists( 'WC' ) ) {
154
+ add_action( 'admin_notices', array( $this, 'fails_to_load' ) );
155
+ return;
156
+ }
157
+
158
+ $this->load_helper_files_components();
159
+ $this->load_core_files();
160
+ $this->load_core_components();
161
+
162
+ /**
163
+ * CartFlows Init.
164
+ *
165
+ * Fires when Cartflows is instantiated.
166
+ *
167
+ * @since 1.0.0
168
+ */
169
+ do_action( 'cartflows_init' );
170
+ }
171
+
172
+ /**
173
+ * Load Helper Files and Components.
174
+ *
175
+ * @since 1.0.0
176
+ *
177
+ * @return void
178
+ */
179
+ function load_helper_files_components() {
180
+
181
+ /* Public Utils */
182
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-utils.php';
183
+
184
+ /* Public Session */
185
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-session.php';
186
+
187
+ /* Public Global namespace functions */
188
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-functions.php';
189
+
190
+ /* Admin Helper */
191
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-helper.php';
192
+
193
+ /* Meta Default Values */
194
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-default-meta.php';
195
+
196
+ $this->utils = Cartflows_Utils::get_instance();
197
+ $this->session = Cartflows_Session::get_instance();
198
+ $this->options = Cartflows_Default_Meta::get_instance();
199
+
200
+ }
201
+
202
+ /**
203
+ * Load Core Files.
204
+ *
205
+ * @since 1.0.0
206
+ *
207
+ * @return void
208
+ */
209
+ function load_core_files() {
210
+
211
+ /* Page builder compatibilty class */
212
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-compatibility.php';
213
+
214
+ /* Admin Meta Fields*/
215
+ include_once CARTFLOWS_DIR . 'classes/fields/typography/class-cartflows-font-families.php';
216
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-meta-fields.php';
217
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-meta.php';
218
+
219
+ /* Cloning */
220
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-cloning.php';
221
+
222
+ /* Admin Settings */
223
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-admin.php';
224
+
225
+ /* Core Modules */
226
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-logger.php';
227
+
228
+ /* Frontend Global */
229
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-frontend.php';
230
+ require_once CARTFLOWS_DIR . 'classes/class-cartflows-flow-frontend.php';
231
+
232
+ /* Modules */
233
+ include_once CARTFLOWS_DIR . 'modules/flow/class-cartflows-flow.php';
234
+ include_once CARTFLOWS_DIR . 'modules/landing/class-cartflows-landing.php';
235
+ include_once CARTFLOWS_DIR . 'modules/checkout/class-cartflows-checkout.php';
236
+ include_once CARTFLOWS_DIR . 'modules/thankyou/class-cartflows-thankyou.php';
237
+
238
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-api.php';
239
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer-core.php';
240
+
241
+ include_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-batch-process.php';
242
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer.php';
243
+ }
244
+
245
+ /**
246
+ * Load Core Components.
247
+ *
248
+ * @since 1.0.0
249
+ *
250
+ * @return void
251
+ */
252
+ function load_core_components() {
253
+
254
+ $this->meta = Cartflows_Meta_Fields::get_instance();
255
+ $this->logger = Cartflows_Logger::get_instance();
256
+ $this->flow = Cartflows_Flow_Frontend::get_instance();
257
+ }
258
+
259
+ /**
260
+ * Load CartFlows Pro Text Domain.
261
+ * This will load the translation textdomain depending on the file priorities.
262
+ * 1. Global Languages /wp-content/languages/cartflows/ folder
263
+ * 2. Local dorectory /wp-content/plugins/cartflows/languages/ folder
264
+ *
265
+ * @since 1.0.3
266
+ * @return void
267
+ */
268
+ public function load_cf_textdomain() {
269
+
270
+ // Default languages directory for CartFlows Pro.
271
+ $lang_dir = CARTFLOWS_DIR . 'languages/';
272
+
273
+ /**
274
+ * Filters the languages directory path to use for CartFlows Pro.
275
+ *
276
+ * @param string $lang_dir The languages directory path.
277
+ */
278
+ $lang_dir = apply_filters( 'cartflows_languages_directory', $lang_dir );
279
+
280
+ // Traditional WordPress plugin locale filter.
281
+ global $wp_version;
282
+
283
+ $get_locale = get_locale();
284
+
285
+ if ( $wp_version >= 4.7 ) {
286
+ $get_locale = get_user_locale();
287
+ }
288
+
289
+ /**
290
+ * Language Locale for CartFlows Pro
291
+ *
292
+ * @var $get_locale The locale to use.
293
+ * Uses get_user_locale()` in WordPress 4.7 or greater,
294
+ * otherwise uses `get_locale()`.
295
+ */
296
+ $locale = apply_filters( 'plugin_locale', $get_locale, 'cartflows' );
297
+ $mofile = sprintf( '%1$s-%2$s.mo', 'cartflows', $locale );
298
+
299
+ // Setup paths to current locale file.
300
+ $mofile_local = $lang_dir . $mofile;
301
+ $mofile_global = WP_LANG_DIR . '/plugins/' . $mofile;
302
+
303
+ if ( file_exists( $mofile_global ) ) {
304
+ // Look in global /wp-content/languages/cartflows/ folder.
305
+ load_textdomain( 'cartflows', $mofile_global );
306
+ } elseif ( file_exists( $mofile_local ) ) {
307
+ // Look in local /wp-content/plugins/cartflows/languages/ folder.
308
+ load_textdomain( 'cartflows', $mofile_local );
309
+ } else {
310
+ // Load the default language files.
311
+ load_plugin_textdomain( 'cartflows', false, $lang_dir );
312
+ }
313
+ }
314
+
315
+ /**
316
+ * Fires admin notice when Elementor is not installed and activated.
317
+ *
318
+ * @since 1.0.0
319
+ *
320
+ * @return void
321
+ */
322
+ public function fails_to_load() {
323
+
324
+ $screen = get_current_screen();
325
+
326
+ if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
327
+ return;
328
+ }
329
+
330
+ $class = 'notice notice-error';
331
+ /* translators: %s: html tags */
332
+ $message = sprintf( __( 'The %1$sCartFlows%2$s plugin requires %1$sWooCommerce%2$s plugin installed & activated.', 'cartflows' ), '<strong>', '</strong>' );
333
+
334
+ $plugin = 'woocommerce/woocommerce.php';
335
+
336
+ if ( _is_woo_installed() ) {
337
+ if ( ! current_user_can( 'activate_plugins' ) ) {
338
+ return;
339
+ }
340
+
341
+ $action_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin );
342
+ $button_label = __( 'Activate WooCommerce', 'cartflows' );
343
+
344
+ } else {
345
+ if ( ! current_user_can( 'install_plugins' ) ) {
346
+ return;
347
+ }
348
+
349
+ $action_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=woocommerce' ), 'install-plugin_woocommerce' );
350
+ $button_label = __( 'Install WooCommerce', 'cartflows' );
351
+ }
352
+
353
+ $button = '<p><a href="' . $action_url . '" class="button-primary">' . $button_label . '</a></p><p></p>';
354
+
355
+ printf( '<div class="%1$s"><p>%2$s</p>%3$s</div>', esc_attr( $class ), $message, $button );
356
+ }
357
+
358
+ /**
359
+ * Activation Reset
360
+ */
361
+ function activation_reset() {
362
+
363
+ include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-flow-post-type.php';
364
+ include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-step-post-type.php';
365
+
366
+ Cartflows_Flow_Post_Type::get_instance()->flow_post_type();
367
+ Cartflows_Step_Post_Type::get_instance()->step_post_type();
368
+ flush_rewrite_rules();
369
+ }
370
+
371
+ /**
372
+ * Deactivation Reset
373
+ */
374
+ function deactivation_reset() {
375
+ }
376
+
377
+ /**
378
+ * Logger Class Instance
379
+ */
380
+ function logger() {
381
+ return Cartflows_Logger::get_instance();
382
+ }
383
+
384
+
385
+ }
386
+
387
+ /**
388
+ * Prepare if class 'Cartflows_Loader' exist.
389
+ * Kicking this off by calling 'get_instance()' method
390
+ */
391
+ Cartflows_Loader::get_instance();
392
+ }
393
+
394
+ /**
395
+ * Get global class.
396
+ *
397
+ * @return object
398
+ */
399
+ function wcf() {
400
+ return Cartflows_Loader::get_instance();
401
+ }
402
+
403
+ if ( ! function_exists( '_is_woo_installed' ) ) {
404
+
405
+ /**
406
+ * Is woocommerce plugin installed.
407
+ *
408
+ * @since 1.0.0
409
+ *
410
+ * @access public
411
+ */
412
+ function _is_woo_installed() {
413
+
414
+ $path = 'woocommerce/woocommerce.php';
415
+ $plugins = get_plugins();
416
+
417
+ return isset( $plugins[ $path ] );
418
+ }
419
+ }
classes/class-cartflows-meta-fields.php CHANGED
@@ -1,989 +1,1482 @@
1
- <?php
2
- // @codingStandardsIgnoreStart
3
- /**
4
- * Meta Fields.
5
- *
6
- * @package CartFlows
7
- */
8
-
9
- /**
10
- * Class Cartflows_Meta_Fields.
11
- */
12
- class Cartflows_Meta_Fields {
13
-
14
- /**
15
- * Instance
16
- *
17
- * @var $instance
18
- */
19
- private static $instance;
20
-
21
- /**
22
- * Initiator
23
- */
24
- public static function get_instance() {
25
- if ( ! isset( self::$instance ) ) {
26
- self::$instance = new self;
27
- }
28
-
29
- return self::$instance;
30
- }
31
-
32
- /**
33
- * Constructor
34
- */
35
- public function __construct() {
36
-
37
- /* Add Scripts */
38
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_meta_scripts' ), 20 );
39
-
40
- add_action( 'wp_ajax_wcf_json_search_coupons', array( $this, 'json_search_coupons' ) );
41
-
42
- add_action( 'wp_ajax_wcf_add_checkout_custom_field', array( $this, 'add_checkout_custom_field' ) );
43
- add_action( 'wp_ajax_wcf_delete_checkout_custom_field', array( $this, 'delete_checkout_custom_field' ) );
44
-
45
- add_action( 'wp_ajax_wcf_json_search_pages', array( $this, 'json_search_pages' ) );
46
-
47
- add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
48
- }
49
-
50
- public function admin_meta_scripts() {
51
-
52
- global $pagenow;
53
- global $post;
54
-
55
- $screen = get_current_screen();
56
-
57
- if (
58
- ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) &&
59
- wcf()->utils->is_step_post_type( $screen->post_type )
60
- ) {
61
-
62
- wp_enqueue_style( 'woocommerce_admin_styles' );
63
-
64
- wp_enqueue_script( 'select2' );
65
- wp_enqueue_script( 'wc-enhanced-select' );
66
-
67
- wp_enqueue_script(
68
- 'wcf-admin-meta',
69
- CARTFLOWS_URL . 'admin/meta-assets/js/admin-edit.js',
70
- array( 'jquery', 'select2', 'wp-color-picker' ),
71
- CARTFLOWS_VER,
72
- true
73
- );
74
-
75
- wp_enqueue_style( 'wcf-admin-meta', CARTFLOWS_URL . 'admin/meta-assets/css/admin-edit.css', array( 'wp-color-picker' ), CARTFLOWS_VER );
76
- wp_style_add_data( 'wcf-admin-meta', 'rtl', 'replace' );
77
-
78
- $localize = array(
79
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
80
- 'google_fonts' => CartFlows_Font_Families::get_google_fonts(),
81
- 'system_fonts' => CartFlows_Font_Families::get_system_fonts(),
82
- 'font_weights' => array(
83
- '100' => __( 'Thin 100', 'cartflows' ),
84
- '200' => __( 'Extra-Light 200', 'cartflows' ),
85
- '300' => __( 'Light 300', 'cartflows' ),
86
- '400' => __( 'Normal 400', 'cartflows' ),
87
- '500' => __( 'Medium 500', 'cartflows' ),
88
- '600' => __( 'Semi-Bold 600', 'cartflows' ),
89
- '700' => __( 'Bold 700', 'cartflows' ),
90
- '800' => __( 'Extra-Bold 800', 'cartflows' ),
91
- '900' => __( 'Ultra-Bold 900', 'cartflows' ),
92
- )
93
- );
94
-
95
- wp_localize_script( 'jquery', 'wcf', apply_filters( 'wcf_js_localize', $localize ) );
96
-
97
- do_action( 'cartflows_admin_meta_scripts' );
98
- }
99
- }
100
-
101
- /**
102
- * Function to search coupons
103
- */
104
- public function json_search_coupons() {
105
-
106
- check_admin_referer( 'wcf-json-search-coupons', 'security' );
107
-
108
- global $wpdb;
109
-
110
- $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
111
-
112
- if ( empty( $term ) ) {
113
- die();
114
- }
115
-
116
- $posts = wp_cache_get( 'wcf_search_coupons', 'wcf_funnel_Cart' );
117
-
118
- if ( false === $posts ) {
119
- $posts = $wpdb->get_results( // phpcs:ignore
120
- $wpdb->prepare(
121
- "SELECT *
122
- FROM {$wpdb->prefix}posts
123
- WHERE post_type = %s
124
- AND post_title LIKE %s
125
- AND post_status = %s",
126
- 'shop_coupon',
127
- $wpdb->esc_like( $term ) . '%',
128
- 'publish'
129
- )
130
- );
131
- wp_cache_set( 'wcf_search_coupons', $posts, 'wcf_funnel_Cart' );
132
- }
133
-
134
- $coupons_found = array();
135
- $all_discount_types = wc_get_coupon_types();
136
-
137
- if ( $posts ) {
138
- foreach ( $posts as $post ) {
139
-
140
- $discount_type = get_post_meta( $post->ID, 'discount_type', true );
141
-
142
- if ( ! empty( $all_discount_types[ $discount_type ] ) ) {
143
- $coupons_found[ get_the_title( $post->ID ) ] = get_the_title( $post->ID ) . ' (Type: ' . $all_discount_types[ $discount_type ] . ')';
144
- }
145
- }
146
- }
147
-
148
- wp_send_json( $coupons_found );
149
- }
150
-
151
- /**
152
- * [add_checkout_custom_field description]
153
- *
154
- * @hook wcf_add_checkout_custom_field
155
- */
156
- public function add_checkout_custom_field() {
157
-
158
- check_ajax_referer( 'wcf-add-checkout-custom-field', 'security' );
159
-
160
- $post_id = intval( $_POST['post_id'] );
161
- $add_to = sanitize_text_field( wp_unslash( $_POST['add_to'] ) );
162
- $type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
163
- $options = sanitize_text_field( wp_unslash( $_POST['options'] ) );
164
- $label = sanitize_text_field( wp_unslash( $_POST['label'] ) );
165
- $name = sanitize_text_field( wp_unslash( $_POST['name'] ) );
166
-
167
- if ( '' !== $name ) {
168
-
169
- $fields = Cartflows_Helper::get_checkout_fields( $add_to, $post_id );
170
- $field_keys = array_keys($fields);
171
-
172
- $name = $add_to . '_' . sanitize_key( $name );
173
- if( in_array($name, $field_keys) ) {
174
- $name = $name . '_' . rand( 0000, 9999 );
175
- }
176
-
177
- $field_data = array(
178
- 'type' => $type,
179
- 'label' => $label,
180
- 'placeholder' => '',
181
- 'class' => array( 'form-row-wide' ),
182
- 'label_class' => array(),
183
- 'required' => true,
184
- 'custom' => true,
185
- );
186
-
187
- if ( 'select' === $type ) {
188
-
189
- $options = explode( ',', $options );
190
- $field_data['options'] = array();
191
-
192
- if ( is_array( $options ) && ! empty( $options ) ) {
193
-
194
- foreach ( $options as $key => $value ) {
195
-
196
- $field_data['options'][ $value ] = $value;
197
- }
198
- }
199
- }
200
-
201
- Cartflows_Helper::add_checkout_field( $add_to, $name, $field_data, $post_id );
202
-
203
- $key = sanitize_key( $name );
204
- $name = 'wcf-' . $key;
205
-
206
- $field_args = array(
207
- 'label' => $label,
208
- 'name' => $name,
209
- 'value' => 'yes',
210
- 'after' => 'Enable',
211
- );
212
-
213
- $field_args['after_html'] = '<span class="wcf-cpf-actions" data-type="billing" data-key="' . $key . '"> | ';
214
- $field_args['after_html'] .= '<a class="wcf-cpf-action-remove">' . __( 'Remove', 'cartflows' ) . '</a>';
215
- $field_args['after_html'] .= '</span>';
216
-
217
- $field_markup = wcf()->meta->get_checkbox_field( $field_args );
218
-
219
- if( 'billing' === $add_to ) {
220
- $add_to_class = 'wcf-cb-fields';
221
- } else if( 'shipping' === $add_to ) {
222
- $add_to_class = 'wcf-sb-fields';
223
- }
224
-
225
- $data = array(
226
- 'field_data' => $field_data,
227
- 'field_args' => $field_args,
228
- 'add_to_class' => $add_to_class,
229
- 'markup' => $field_markup,
230
- );
231
-
232
- wp_send_json( $data );
233
- }
234
-
235
- wp_send_json( false );
236
-
237
- }
238
-
239
- /**
240
- * [delete_checkout_custom_field description]
241
- *
242
- * @hook wcf_delete_checkout_custom_field
243
- * @return [type] [description]
244
- */
245
- public function delete_checkout_custom_field() {
246
-
247
- check_ajax_referer( 'wcf-delete-checkout-custom-field', 'security' );
248
-
249
- $post_id = intval( $_POST['post_id'] );
250
- $type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
251
- $key = sanitize_text_field( wp_unslash( $_POST['key'] ) );
252
-
253
- if ( '' !== $key ) {
254
-
255
- Cartflows_Helper::delete_checkout_field( $type, $key, $post_id );
256
-
257
- wp_send_json( true );
258
-
259
- }
260
-
261
- wp_send_json( false );
262
-
263
- }
264
-
265
- /**
266
- * Function to search coupons
267
- */
268
- public function json_search_pages() {
269
-
270
- check_ajax_referer( 'wcf-json-search-pages', 'security' );
271
-
272
- $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
273
-
274
- if ( empty( $term ) ) {
275
- die( 'not found' );
276
- }
277
-
278
- $search_string = $term;
279
- $data = array();
280
- $result = array();
281
-
282
- add_filter( 'posts_search', array( $this, 'search_only_titles' ), 10, 2 );
283
-
284
- $query = new WP_Query(
285
- array(
286
- 's' => $search_string,
287
- 'post_type' => 'page',
288
- 'posts_per_page' => - 1,
289
- )
290
- );
291
-
292
- if ( $query->have_posts() ) {
293
- while ( $query->have_posts() ) {
294
- $query->the_post();
295
- $title = get_the_title();
296
- $title .= ( 0 != $query->post->post_parent ) ? ' (' . get_the_title( $query->post->post_parent ) . ')' : '';
297
- $id = get_the_id();
298
- $data[] = array(
299
- 'id' => $id,
300
- 'text' => $title,
301
- );
302
- }
303
- }
304
-
305
- if ( is_array( $data ) && ! empty( $data ) ) {
306
- $result[] = array(
307
- 'text' => '',
308
- 'children' => $data,
309
- );
310
- }
311
-
312
- wp_reset_postdata();
313
-
314
- // return the result in json.
315
- wp_send_json( $result );
316
- }
317
-
318
- public function search_only_titles( $search, $wp_query ) {
319
- if ( ! empty( $search ) && ! empty( $wp_query->query_vars['search_terms'] ) ) {
320
- global $wpdb;
321
-
322
- $q = $wp_query->query_vars;
323
- $n = ! empty( $q['exact'] ) ? '' : '%';
324
-
325
- $search = array();
326
-
327
- foreach ( (array) $q['search_terms'] as $term ) {
328
- $search[] = $wpdb->prepare( "$wpdb->posts.post_title LIKE %s", $n . $wpdb->esc_like( $term ) . $n );
329
- }
330
-
331
- if ( ! is_user_logged_in() ) {
332
- $search[] = "$wpdb->posts.post_password = ''";
333
- }
334
-
335
- $search = ' AND ' . implode( ' AND ', $search );
336
- }
337
-
338
- return $search;
339
- }
340
-
341
- function get_field( $field_data, $field_content ) {
342
-
343
- $label = isset( $field_data['label'] ) ? $field_data['label'] : '';
344
- $help = isset( $field_data['help'] ) ? $field_data['help'] : '';
345
- $after_html = isset( $field_data['after_html'] ) ? $field_data['after_html'] : '';
346
-
347
- $name_class = 'field-' . $field_data['name'];
348
-
349
- $field_html = '<div class="wcf-field-row ' . $name_class . '">';
350
-
351
- if( ! empty( $label ) || ! empty( $help ) ) {
352
- $field_html .= '<div class="wcf-field-row-heading">';
353
- if( ! empty( $label ) ) {
354
- $field_html .= '<label>' . esc_html( $label ) . '</label>';
355
- }
356
- if ( ! empty( $help ) ) {
357
- $field_html .= '<i class="wcf-field-heading-help dashicons dashicons-editor-help">';
358
- // $field_html .= '<span class="wcf-tooltip" data-tooltip= "'. esc_attr( $help ) .'"></span>';
359
- $field_html .= '</i>';
360
- $field_html .= '<span class="wcf-tooltip-text">';
361
- $field_html .= $help;
362
- $field_html .= '</span>';
363
- }
364
- $field_html .= '</div>';
365
- }
366
-
367
- $field_html .= '<div class="wcf-field-row-content">';
368
- $field_html .= $field_content;
369
-
370
- if ( ! empty( $after_html ) ) {
371
- $field_html .= $after_html;
372
- }
373
-
374
- $field_html .= '</div>';
375
- $field_html .= '</div>';
376
-
377
- return $field_html;
378
- }
379
-
380
- function get_text_field( $field_data ) {
381
-
382
- $value = $field_data['value'];
383
-
384
- $attr = '';
385
-
386
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
387
-
388
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
389
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
390
- }
391
- }
392
-
393
- $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
394
-
395
- return $this->get_field( $field_data, $field_content );
396
- }
397
-
398
- function get_shortcode_field( $field_data ) {
399
-
400
- $attr = '';
401
-
402
- $attr_fields = array(
403
- 'readonly' => 'readonly',
404
- 'onfocus' => 'this.select()',
405
- 'onmouseup' => 'return false',
406
- );
407
-
408
- if ( $attr_fields && is_array( $attr_fields ) ) {
409
-
410
- foreach ( $attr_fields as $attr_key => $attr_value ) {
411
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
412
- }
413
- }
414
-
415
- $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . $field_data['content'] . '" ' . $attr . '>';
416
-
417
- return $this->get_field( $field_data, $field_content );
418
- }
419
-
420
- function get_display_field( $field_data ) {
421
-
422
- $field_content = $field_data['content'];
423
-
424
- return $this->get_field( $field_data, $field_content );
425
- }
426
-
427
- function get_hr_line_field( $field_data ) {
428
-
429
- $field_data = array(
430
- 'name' => 'wcf-hr-line',
431
- 'content' => '<hr>'
432
- );
433
-
434
- $field_content = $field_data['content'];
435
-
436
- return $this->get_field( $field_data, $field_content );
437
- }
438
-
439
- function get_number_field( $field_data ) {
440
-
441
- $value = $field_data['value'];
442
-
443
- $attr = '';
444
-
445
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
446
-
447
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
448
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
449
- }
450
- }
451
-
452
- $field_content = '<input type="number" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
453
-
454
- return $this->get_field( $field_data, $field_content );
455
- }
456
-
457
- function get_hidden_field( $field_data ) {
458
-
459
- $value = $field_data['value'];
460
-
461
- $attr = '';
462
-
463
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
464
-
465
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
466
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
467
- }
468
- }
469
-
470
- $field_content = '<input type="hidden" id="' . $field_data['name'] . '" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
471
-
472
- return $this->get_field( $field_data, $field_content );
473
- }
474
-
475
- function get_area_field( $field_data ) {
476
-
477
- $value = $field_data['value'];
478
-
479
- $field_content = '<textarea name="' . $field_data['name'] . '" rows="10" cols="50">';
480
- $field_content .= $value;
481
- $field_content .= '</textarea>';
482
-
483
- return $this->get_field( $field_data, $field_content );
484
- }
485
-
486
- function get_checkbox_field( $field_data ) {
487
-
488
- $value = $field_data['value'];
489
-
490
- $field_content = '';
491
- if ( isset( $field_data['before'] ) ) {
492
- $field_content .= '<span>' . $field_data['before'] . '</span>';
493
- }
494
- $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
495
- $field_content .= '<input type="checkbox" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . '>';
496
-
497
- if ( isset( $field_data['after'] ) ) {
498
- $field_content .= '<span>' . $field_data['after'] . '</span>';
499
- }
500
-
501
- return $this->get_field( $field_data, $field_content );
502
- }
503
-
504
- function get_radio_field( $field_data ) {
505
-
506
- $value = $field_data['value'];
507
- $field_content = '';
508
-
509
- if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
510
-
511
- foreach ( $field_data['options'] as $data_key => $data_value ) {
512
-
513
- $field_content .= '<div class="wcf-radio-option">';
514
- $field_content .= '<input type="radio" name="' . $field_data['name'] . '" value="' . $data_key . '" ' . checked( $data_key, $value, false ) . '>';
515
- $field_content .= $data_value;
516
- $field_content .= '</div>';
517
- }
518
- }
519
-
520
- return $this->get_field( $field_data, $field_content );
521
- }
522
-
523
- function get_font_family_field( $field_data ) {
524
-
525
- $value = $field_data['value'];
526
-
527
- $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
528
-
529
- $field_content = '<select class="wcf-field-font-family" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
530
-
531
- $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
532
-
533
- $field_content .= '<optgroup label="Other System Fonts">';
534
- foreach ( CartFlows_Font_Families::get_system_fonts() as $name => $variants ) {
535
- $field_content .= '<option value="' . esc_attr( $name ) . '" ' . selected( $name, $value, false ) . '>' . esc_attr( $name ) . '</option>';
536
- }
537
- $field_content .= '</optgroup>';
538
- $field_content .= '<optgroup label="Google">';
539
- foreach ( CartFlows_Font_Families::get_google_fonts() as $name => $single_font ) {
540
- $variants = wcf_get_prop( $single_font, '0' );
541
- $category = wcf_get_prop( $single_font, '1' );
542
- $font_value = '\'' . esc_attr( $name ) . '\', ' . esc_attr( $category );
543
- $field_content .= '<option value="' . esc_attr( $font_value ) . '" ' . selected( $font_value, $value, false ) . '>' . esc_attr( $name ) . '</option>';
544
- }
545
- $field_content .= '</optgroup>';
546
-
547
- $field_content .= '</select>';
548
-
549
- return $this->get_field( $field_data, $field_content );
550
- }
551
-
552
- function get_font_weight_field( $field_data ) {
553
-
554
- $value = $field_data['value'];
555
-
556
- $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
557
-
558
- $field_content = '<select data-selected="'.esc_attr( $value ).'" class="wcf-field-font-weight" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
559
-
560
- $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
561
-
562
- $field_content .= '</select>';
563
-
564
- return $this->get_field( $field_data, $field_content );
565
- }
566
-
567
- function get_select_field( $field_data ) {
568
-
569
- $value = $field_data['value'];
570
- $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
571
-
572
- $field_content = '<select name="' . $field_data['name'] . '">';
573
-
574
-
575
- if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
576
-
577
- foreach ( $field_data['options'] as $data_key => $data_value ) {
578
-
579
- $disabled = '';
580
-
581
- if ( array_key_exists( $data_key, $pro_options ) ) {
582
- $disabled = 'disabled ';
583
- $data_value = $pro_options[ $data_key ];
584
- }
585
-
586
- $field_content .= '<option value="' . $data_key . '" ' . selected( $value, $data_key, false ) . ' ' . $disabled .'>' . $data_value . '</option>';
587
- }
588
- }
589
-
590
- $field_content .= '</select>';
591
-
592
- if ( isset( $field_data['after'] ) ) {
593
- $field_content .= '<span>' . $field_data['after'] . '</span>';
594
- }
595
-
596
- return $this->get_field( $field_data, $field_content );
597
- }
598
-
599
- function get_color_picker_field( $field_data ) {
600
-
601
- $value = $field_data['value'];
602
-
603
- $field_content = '<input class="wcf-color-picker" type="text" name="' . $field_data['name'] . '" value="' . $value . '">';
604
-
605
- return $this->get_field( $field_data, $field_content );
606
- }
607
-
608
- function get_product_selection_field( $field_data ) {
609
-
610
- $value = $field_data['value'];
611
-
612
- $multiple = '';
613
-
614
- if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
615
- $multiple = ' multiple="multiple"';
616
- }
617
-
618
- $allow_clear = '';
619
-
620
- if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
621
- $allow_clear = ' data-allow_clear="allow_clear"';
622
- }
623
-
624
- $field_content = '<select
625
- name="' . $field_data['name'] . '[]"
626
- class="wcf-product-search" ' . $multiple . $allow_clear . '
627
- data-placeholder="' . __( 'Search for a product&hellip;', 'cartflows' ) . '"
628
- data-action="woocommerce_json_search_products_and_variations">';
629
-
630
- if ( is_array( $value ) && ! empty( $value ) ) {
631
-
632
- foreach ( $value as $data_key => $product_id ) {
633
-
634
- $product = wc_get_product( $product_id );
635
-
636
- // posts.
637
- if ( ! empty( $product ) ) {
638
- $post_title = $product->get_name() . ' (#' . $product_id . ')';
639
-
640
- $field_content .= '<option value="' . $product_id . '" selected="selected" >' . $post_title . '</option>';
641
- }
642
- }
643
- }
644
- $field_content .= '</select>';
645
-
646
- return $this->get_field( $field_data, $field_content );
647
- }
648
-
649
- function get_coupon_selection_field( $field_data ) {
650
-
651
- $value = $field_data['value'];
652
-
653
- $multiple = '';
654
-
655
- if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
656
- $multiple = ' multiple="multiple"';
657
- }
658
-
659
- $allow_clear = '';
660
-
661
- if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
662
- $allow_clear = ' data-allow_clear="allow_clear"';
663
- }
664
-
665
- $field_content = '<select
666
- name="' . $field_data['name'] . '[]"
667
- class="wc-coupon-search wcf-coupon-search" ' . $multiple . $allow_clear . '
668
- data-placeholder="' . __( 'Search for a coupon&hellip;', 'cartflows' ) . '"
669
- data-action="wcf_json_search_coupons">';
670
-
671
- if ( is_array( $value ) && ! empty( $value ) ) {
672
-
673
- $all_discount_types = wc_get_coupon_types();
674
-
675
- foreach ( $value as $coupon_title ) {
676
-
677
- $coupon = new WC_Coupon( $coupon_title );
678
-
679
- $discount_type = $coupon->get_discount_type();
680
-
681
- if ( isset( $discount_type ) && $discount_type ) {
682
- $discount_type = ' ( Type: ' . $all_discount_types[ $discount_type ] . ' )';
683
- }
684
-
685
- $field_content .= '<option value="' . $coupon_title . '" selected="selected">' . $coupon_title . $discount_type . '</option>';
686
- }
687
- }
688
-
689
- $field_content .= '</select>';
690
-
691
- return $this->get_field( $field_data, $field_content );
692
- }
693
-
694
- function get_page_selection_field( $field_data ) {
695
-
696
- $value = $field_data['value'];
697
-
698
- $multiple = '';
699
-
700
- if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
701
- $multiple = 'multiple="multiple"';
702
- }
703
-
704
- $field_content = '<select
705
- name="' . $field_data['name'] . '[]"
706
- class="wcf-search-pages" ' . $multiple . '"
707
- data-action="wcf_json_search_pages">';
708
-
709
- if ( is_array( $value ) && ! empty( $value ) ) {
710
-
711
- foreach ( $value as $data_key => $data_value ) {
712
-
713
- $field_content .= '<option value="' . $data_value . '">' . get_the_title( $data_value ) . '</option>';
714
- }
715
- }
716
-
717
- $field_content .= '</select>';
718
-
719
- return $this->get_field( $field_data, $field_content );
720
- }
721
-
722
- function get_section( $field_data ) {
723
- $field_html = '<div class="wcf-field-row wcf-field-section">';
724
- $field_html .= '<div class="wcf-field-section-heading" colspan="2">';
725
- $field_html .= '<label>' . esc_html( $field_data['label'] ) . '</label>';
726
-
727
- if ( isset( $field_data['help'] ) ) {
728
- $field_html .= '<i class="wcf-field-heading-help dashicons dashicons-editor-help" title="' . esc_attr( $field_data['help'] ) . '"></i>';
729
- }
730
- $field_html .= '</div>';
731
- $field_html .= '</div>';
732
- return $field_html;
733
- }
734
-
735
- function get_description_field( $field_data ) {
736
-
737
- $field_html = '<div class="wcf-field-row wcf-field-desc ' . $field_data['name'] . '">';
738
- $field_html .= '<div class="wcf-field-desc-content">';
739
- $field_html .= $field_data['content'];
740
- $field_html .= '</div>';
741
- $field_html .= '</div>';
742
-
743
- return $field_html;
744
- }
745
-
746
- function get_checkout_field_repeater( $field_data ) {
747
-
748
- $value = array();
749
-
750
- $value[0] = array(
751
- 'add_to' => '',
752
- 'type' => '',
753
- 'label' => '',
754
- 'name' => '',
755
- );
756
-
757
- $field_content = '';
758
-
759
- $field_content .= '<div class="wcf-field-row">';
760
- // $field_content .= '<div class="wcf-field-row-heading">';
761
- // $field_content .= '<label>' . esc_html( $field_data['label'] ) . '</label>';
762
- // $field_content .= '</div>';
763
- $field_content .= '<div class="wcf-field-row-content">';
764
- $field_content .= '<div class="wcf-cpf-wrap">';
765
-
766
- foreach ( $value as $p_key => $p_data ) {
767
- $field_content .= '<div class="wcf-cpf-row" data-key="' . $p_key . '">';
768
- $field_content .= '<div class="wcf-cpf-row-header">';
769
- $field_content .= '<span class="wcf-cpf-row-title">Add New Custom Field</span>';
770
- $field_content .= '</div>';
771
-
772
- $field_content .= '<div class="wcf-cpf-row-standard-fields">';
773
-
774
- /* Add To */
775
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-add_to">';
776
- $field_content .= '<span class="wcf-cpf-row-setting-label">Add to</span>';
777
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
778
- $field_content .= '<select name="wcf-checkout-custom-fields[' . $p_key . '][add_to]" class="wcf-cpf-add_to">';
779
- $field_content .= '<option value="billing">Billing</option>';
780
- $field_content .= '<option value="shipping">Shipping</option>';
781
- $field_content .= '</select>';
782
- $field_content .= '</span>';
783
- $field_content .= '</div>';
784
-
785
- /* Type */
786
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-type">';
787
- $field_content .= '<span class="wcf-cpf-row-setting-label">Type</span>';
788
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
789
- $field_content .= '<select name="wcf-checkout-custom-fields[' . $p_key . '][type]" class="wcf-cpf-type">';
790
- $field_content .= '<option value="text">Text</option>';
791
- $field_content .= '<option value="textarea">Textarea</option>';
792
- $field_content .= '<option value="select">Select</option>';
793
- $field_content .= '<option value="checkbox">Checkbox</option>';
794
- $field_content .= '</select>';
795
- $field_content .= '</span>';
796
- $field_content .= '</div>';
797
-
798
- /* Textarea */
799
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-options">';
800
- $field_content .= '<span class="wcf-cpf-row-setting-label">Options *</span>';
801
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
802
- $field_content .= '<textarea value="" name="wcf-checkout-custom-fields[' . $p_key . '][label]" class="wcf-cpf-options" placeholder="Enter your options separated by comma."></textarea>';
803
- $field_content .= '</span>';
804
- $field_content .= '</div>';
805
-
806
- /* Label */
807
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-label">';
808
- $field_content .= '<span class="wcf-cpf-row-setting-label">Label *</span>';
809
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
810
- $field_content .= '<input type="text" value="" name="wcf-checkout-custom-fields[' . $p_key . '][label]" class="wcf-cpf-label">';
811
- $field_content .= '</span>';
812
- $field_content .= '</div>';
813
-
814
- /* Name */
815
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-name">';
816
- $field_content .= '<span class="wcf-cpf-row-setting-label">Name *</span>';
817
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
818
- $field_content .= '<input type="text" value="" name="wcf-checkout-custom-fields[' . $p_key . '][name]" class="wcf-cpf-name">';
819
- $field_content .= '</span>';
820
- $field_content .= '</div>';
821
-
822
- $field_content .= '</div>';
823
- $field_content .= '</div>';
824
- }
825
-
826
- /* Add New Custom Field */
827
- $field_content .= '<div class="wcf-cpf-add-row">';
828
- $field_content .= '<div class="wcf-cpf-add-wrap">';
829
- $field_content .= '<button class="button button-secondary wcf-cpf-add" data-name="wcf-checkout-custom-fields">Add New Field</button>';
830
- $field_content .= '</div>';
831
- $field_content .= '</div>';
832
- /* End Add new custom field */
833
-
834
- $field_content .= '</div>';
835
- $field_content .= '</div>';
836
- $field_content .= '</div>';
837
-
838
- return $field_content;
839
- }
840
-
841
- function get_product_selection_repeater( $field_data ) {
842
-
843
- $value = $field_data['value'];
844
-
845
- if ( ! is_array( $value ) ) {
846
-
847
- $value[0] = array(
848
- 'product' => '',
849
- );
850
- } else {
851
-
852
- if ( ! isset( $value[0] ) ) {
853
-
854
- $value[0] = array(
855
- 'product' => '',
856
- );
857
- }
858
- }
859
-
860
- $field_html = '';
861
-
862
- $field_html .= '<script type="text/html" id="tmpl-wcf-product-repeater">';
863
- $field_html .= $this->generate_product_repeater_html( '{{id}}' );
864
- $field_html .= '</script>';
865
-
866
- $field_html .= '<div class="wcf-field-row">';
867
- $field_html .= '<div class="wcf-field-row-content">';
868
- $field_html .= '<div class="wcf-repeatables-wrap">';
869
-
870
- if ( is_array( $value ) ) {
871
-
872
- foreach ( $value as $p_key => $p_data ) {
873
-
874
- $selected_options = '';
875
-
876
- if ( isset( $p_data['product'] ) ) {
877
-
878
- $product = wc_get_product( $p_data['product'] );
879
-
880
- // posts.
881
- if ( ! empty( $product ) ) {
882
- $post_title = $product->get_name() . ' (#' . $p_data['product'] . ')';
883
-
884
- $selected_options = '<option value="' . $p_data['product'] . '" selected="selected" >' . $post_title . '</option>';
885
- }
886
- }
887
-
888
- $field_html .= $this->generate_product_repeater_html( $p_key, $selected_options );
889
- }
890
- }
891
-
892
- $field_html .= '<div class="wcf-add-repeatable-row">';
893
- $field_html .= '<div class="submit wcf-add-repeatable-wrap">';
894
- $field_html .= '<button class="button-primary wcf-add-repeatable" data-name="wcf-checkout-products">Add New Product</button>';
895
- $field_html .= '</div>';
896
- $field_html .= '</div>';
897
- $field_html .= '</div>';
898
- $field_html .= '</div>';
899
- $field_html .= '</div>';
900
-
901
- return $field_html;
902
- }
903
-
904
- function generate_product_repeater_html( $id, $options = '' ) {
905
-
906
- $field_html = '<div class="wcf-repeatable-row" data-key="' . $id . '">';
907
-
908
- $field_html .= '<div class="wcf-repeatable-row-standard-fields">';
909
-
910
- /* Product Name */
911
- $field_html .= '<div class="wcf-repeatable-fields wcf-sel-product">';
912
- $field_html .= '<span class="wcf-repeatable-row-setting-field">';
913
- $field_html .= '<select
914
- name="wcf-checkout-products[' . $id . '][product]"
915
- class="wcf-product-search"
916
- data-allow_clear="allow_clear"
917
- data-placeholder="' . __( 'Search for a product&hellip;', 'cartflows' ) . '"
918
- data-action="woocommerce_json_search_products_and_variations">';
919
- $field_html .= $options;
920
- $field_html .= '</select>';
921
- $field_html .= '</span>';
922
- $field_html .= '<span class="wcf-repeatable-row-actions">';
923
- $field_html .= '<a class="wcf-remove-row wcf-repeatable-remove button" data-type="product">';
924
- $field_html .= '<span class="dashicons dashicons-trash"></span>';
925
- $field_html .= '<span class="wcf-repeatable-remove-button">'. __( 'Remove', 'cartflows' ).'</span>';
926
- $field_html .= '</a>';
927
- $field_html .= '</span>';
928
- $field_html .= '</div>';
929
- $field_html .= '</div>';
930
- $field_html .= '</div>';
931
-
932
- return $field_html;
933
- }
934
-
935
- function get_image_field( $field_data ) {
936
-
937
- $value = $field_data['value'];
938
-
939
- $attr = '';
940
-
941
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
942
-
943
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
944
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
945
- }
946
- }
947
-
948
- $display_preview_box = ( isset( $value ) && '' != $value ) ? 'display:block;' : 'display:none';
949
-
950
- $field_content = '<div id="wcf-image-preview" style="'.$display_preview_box.'">';
951
- if( isset( $value ) ){
952
- $field_content .= '<img src="'. $value .'" class="saved-image" name="'. $field_data['name'] .'" width="150">';
953
- }
954
- $field_content .= '</div>';
955
- // $field_content .= '<input type="hidden" id="wcf-image-id" class="wcf-image-id" name="wcf-image-id[image-id]" value="">';
956
- $field_content .= '<input type="hidden" id="wcf-image-value" class="wcf-image" name="' . $field_data['name'] . '" value="'.$value.'">';
957
-
958
- $field_content .= '<button type="button" ' . $attr . ' class="wcf-select-image button-secondary">Select Image</button>';
959
-
960
- $display_remove_button = ( isset( $value ) && '' != $value ) ? 'display:inline-block; margin-left: 5px;' : 'display:none';
961
-
962
- $field_content .= '<button type="button" class="wcf-remove-image button-secondary" style="'.$display_remove_button.'">Remove Image</button>';
963
-
964
- return $this->get_field( $field_data, $field_content );
965
- }
966
-
967
- /**
968
- * Localize variables in admin
969
- *
970
- * @param array $vars variables.
971
- */
972
- function localize_vars( $vars ) {
973
-
974
- $ajax_actions = array(
975
- 'wcf_add_checkout_custom_field',
976
- 'wcf_delete_checkout_custom_field',
977
- 'wcf_json_search_pages',
978
- 'wcf_json_search_coupons'
979
- );
980
-
981
- foreach ( $ajax_actions as $action ) {
982
-
983
- $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
984
- }
985
-
986
- return $vars;
987
- }
988
- }
989
- // @codingStandardsIgnoreEnd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // @codingStandardsIgnoreStart
3
+ /**
4
+ * Meta Fields.
5
+ *
6
+ * @package CartFlows
7
+ */
8
+
9
+ /**
10
+ * Class Cartflows_Meta_Fields.
11
+ */
12
+ class Cartflows_Meta_Fields {
13
+
14
+ /**
15
+ * Instance
16
+ *
17
+ * @var $instance
18
+ */
19
+ private static $instance;
20
+
21
+ /**
22
+ * Initiator
23
+ */
24
+ public static function get_instance() {
25
+ if ( ! isset( self::$instance ) ) {
26
+ self::$instance = new self;
27
+ }
28
+
29
+ return self::$instance;
30
+ }
31
+
32
+ /**
33
+ * Constructor
34
+ */
35
+ public function __construct() {
36
+
37
+ /* Add Scripts */
38
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_meta_scripts' ), 20 );
39
+
40
+ add_action( 'wp_ajax_wcf_json_search_coupons', array( $this, 'json_search_coupons' ) );
41
+
42
+ add_action( 'wp_ajax_wcf_add_checkout_custom_field', array( $this, 'add_checkout_custom_field' ) );
43
+
44
+ add_action( 'wp_ajax_wcf_pro_add_checkout_custom_field', array( $this, 'add_pro_checkout_custom_field' ) );
45
+
46
+ add_action( 'wp_ajax_wcf_delete_checkout_custom_field', array( $this, 'delete_checkout_custom_field' ) );
47
+
48
+ add_action( 'wp_ajax_wcf_json_search_pages', array( $this, 'json_search_pages' ) );
49
+
50
+ add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
51
+ }
52
+
53
+ public function admin_meta_scripts() {
54
+
55
+ global $pagenow;
56
+ global $post;
57
+
58
+ $screen = get_current_screen();
59
+
60
+ if (
61
+ ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) &&
62
+ wcf()->utils->is_step_post_type( $screen->post_type )
63
+ ) {
64
+
65
+ wp_enqueue_style( 'woocommerce_admin_styles' );
66
+
67
+ wp_enqueue_script( 'select2' );
68
+ wp_enqueue_script( 'wc-enhanced-select' );
69
+
70
+ wp_enqueue_script(
71
+ 'wcf-admin-meta',
72
+ CARTFLOWS_URL . 'admin/meta-assets/js/admin-edit.js',
73
+ array( 'jquery', 'select2', 'wp-color-picker' ),
74
+ CARTFLOWS_VER,
75
+ true
76
+ );
77
+
78
+ wp_enqueue_style( 'wcf-admin-meta', CARTFLOWS_URL . 'admin/meta-assets/css/admin-edit.css', array( 'wp-color-picker' ), CARTFLOWS_VER );
79
+ wp_style_add_data( 'wcf-admin-meta', 'rtl', 'replace' );
80
+
81
+ $localize = array(
82
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
83
+ 'google_fonts' => CartFlows_Font_Families::get_google_fonts(),
84
+ 'system_fonts' => CartFlows_Font_Families::get_system_fonts(),
85
+ 'font_weights' => array(
86
+ '100' => __( 'Thin 100', 'cartflows' ),
87
+ '200' => __( 'Extra-Light 200', 'cartflows' ),
88
+ '300' => __( 'Light 300', 'cartflows' ),
89
+ '400' => __( 'Normal 400', 'cartflows' ),
90
+ '500' => __( 'Medium 500', 'cartflows' ),
91
+ '600' => __( 'Semi-Bold 600', 'cartflows' ),
92
+ '700' => __( 'Bold 700', 'cartflows' ),
93
+ '800' => __( 'Extra-Bold 800', 'cartflows' ),
94
+ '900' => __( 'Ultra-Bold 900', 'cartflows' ),
95
+ )
96
+ );
97
+
98
+ wp_localize_script( 'jquery', 'wcf', apply_filters( 'wcf_js_localize', $localize ) );
99
+
100
+ do_action( 'cartflows_admin_meta_scripts' );
101
+ }
102
+ }
103
+
104
+ /**
105
+ * Function to search coupons
106
+ */
107
+ public function json_search_coupons() {
108
+
109
+ check_admin_referer( 'wcf-json-search-coupons', 'security' );
110
+
111
+ global $wpdb;
112
+
113
+ $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
114
+
115
+ if ( empty( $term ) ) {
116
+ die();
117
+ }
118
+
119
+ $posts = wp_cache_get( 'wcf_search_coupons', 'wcf_funnel_Cart' );
120
+
121
+ if ( false === $posts ) {
122
+ $posts = $wpdb->get_results( // phpcs:ignore
123
+ $wpdb->prepare(
124
+ "SELECT *
125
+ FROM {$wpdb->prefix}posts
126
+ WHERE post_type = %s
127
+ AND post_title LIKE %s
128
+ AND post_status = %s",
129
+ 'shop_coupon',
130
+ $wpdb->esc_like( $term ) . '%',
131
+ 'publish'
132
+ )
133
+ );
134
+ wp_cache_set( 'wcf_search_coupons', $posts, 'wcf_funnel_Cart' );
135
+ }
136
+
137
+ $coupons_found = array();
138
+ $all_discount_types = wc_get_coupon_types();
139
+
140
+ if ( $posts ) {
141
+ foreach ( $posts as $post ) {
142
+
143
+ $discount_type = get_post_meta( $post->ID, 'discount_type', true );
144
+
145
+ if ( ! empty( $all_discount_types[ $discount_type ] ) ) {
146
+ $coupons_found[ get_the_title( $post->ID ) ] = get_the_title( $post->ID ) . ' (Type: ' . $all_discount_types[ $discount_type ] . ')';
147
+ }
148
+ }
149
+ }
150
+
151
+ wp_send_json( $coupons_found );
152
+ }
153
+
154
+ /**
155
+ * [add_checkout_custom_field description]
156
+ *
157
+ * @hook wcf_add_checkout_custom_field
158
+ */
159
+ public function add_checkout_custom_field() {
160
+
161
+ check_ajax_referer( 'wcf-add-checkout-custom-field', 'security' );
162
+
163
+ $post_id = intval( $_POST['post_id'] );
164
+ $add_to = sanitize_text_field( wp_unslash( $_POST['add_to'] ) );
165
+ $type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
166
+ $options = sanitize_text_field( wp_unslash( $_POST['options'] ) );
167
+ $label = sanitize_text_field( wp_unslash( $_POST['label'] ) );
168
+ $name = sanitize_text_field( wp_unslash( $_POST['name'] ) );
169
+
170
+ if ( '' !== $name ) {
171
+
172
+ $fields = Cartflows_Helper::get_checkout_fields( $add_to, $post_id );
173
+ $field_keys = array_keys($fields);
174
+
175
+ $name = $add_to . '_' . sanitize_key( $name );
176
+ if( in_array($name, $field_keys) ) {
177
+ $name = $name . '_' . rand( 0000, 9999 );
178
+ }
179
+
180
+ $field_data = array(
181
+ 'type' => $type,
182
+ 'label' => $label,
183
+ 'placeholder' => '',
184
+ 'class' => array( 'form-row-wide' ),
185
+ 'label_class' => array(),
186
+ 'required' => true,
187
+ 'custom' => true,
188
+ );
189
+
190
+ if ( 'select' === $type ) {
191
+
192
+ $options = explode( ',', $options );
193
+ $field_data['options'] = array();
194
+
195
+ if ( is_array( $options ) && ! empty( $options ) ) {
196
+
197
+ foreach ( $options as $key => $value ) {
198
+
199
+ $field_data['options'][ $value ] = $value;
200
+ }
201
+ }
202
+ }
203
+
204
+ Cartflows_Helper::add_checkout_field( $add_to, $name, $field_data, $post_id );
205
+
206
+ $key = sanitize_key( $name );
207
+ $name = 'wcf-' . $key;
208
+
209
+ $field_args = array(
210
+ 'label' => $label,
211
+ 'name' => $name,
212
+ 'value' => 'yes',
213
+ 'after' => 'Enable',
214
+ );
215
+
216
+ $field_args['after_html'] = '<span class="wcf-cpf-actions" data-type="billing" data-key="' . $key . '"> | ';
217
+ $field_args['after_html'] .= '<a class="wcf-cpf-action-remove">' . __( 'Remove', 'cartflows' ) . '</a>';
218
+ $field_args['after_html'] .= '</span>';
219
+
220
+ $field_markup = wcf()->meta->get_checkbox_field( $field_args );
221
+
222
+ if( 'billing' === $add_to ) {
223
+ $add_to_class = 'wcf-cb-fields';
224
+ } else if( 'shipping' === $add_to ) {
225
+ $add_to_class = 'wcf-sb-fields';
226
+ }
227
+
228
+ $data = array(
229
+ 'field_data' => $field_data,
230
+ 'field_args' => $field_args,
231
+ 'add_to_class' => $add_to_class,
232
+ 'markup' => $field_markup,
233
+ );
234
+
235
+ wp_send_json( $data );
236
+ }
237
+
238
+ wp_send_json( false );
239
+
240
+ }
241
+
242
+ /**
243
+ * [add_checkout_custom_field description]
244
+ *
245
+ * @hook wcf_add_checkout_custom_field
246
+ */
247
+ public function add_pro_checkout_custom_field() {
248
+
249
+ check_ajax_referer( 'wcf-pro-add-checkout-custom-field', 'security' );
250
+
251
+ $post_id = intval( $_POST['post_id'] );
252
+ $add_to = sanitize_text_field( wp_unslash( $_POST['add_to'] ) );
253
+ $type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
254
+ $options = sanitize_text_field( wp_unslash( $_POST['options'] ) );
255
+ $label = sanitize_text_field( wp_unslash( $_POST['label'] ) );
256
+ $name = sanitize_text_field( wp_unslash( str_replace(' ', '_', $_POST['label'] ) ) );
257
+ $placeholder = sanitize_text_field( wp_unslash( $_POST['placeholder'] ) );
258
+ $width = sanitize_text_field( wp_unslash( $_POST['width'] ) );
259
+ $default_value = sanitize_text_field( wp_unslash( $_POST['default'] ) );
260
+ $is_required = sanitize_text_field( wp_unslash( $_POST['required'] ) );
261
+
262
+ $field_markup = '';
263
+
264
+ if ( '' !== $name ) {
265
+
266
+ $fields = Cartflows_Helper::get_checkout_fields( $add_to, $post_id );
267
+ $field_keys = array_keys($fields);
268
+
269
+ $name = $add_to . '_' . sanitize_key( $name );
270
+ if( in_array($name, $field_keys) ) {
271
+ $name = $name . '_' . rand( 0000, 9999 );
272
+ }
273
+
274
+ $field_data = array(
275
+ 'type' => $type,
276
+ 'label' => $label,
277
+ 'placeholder' => $placeholder,
278
+ 'class' => array( 'form-row-wide' ),
279
+ 'label_class' => array(),
280
+ 'required' => $is_required,
281
+ 'custom' => true,
282
+ 'default' => $default_value,
283
+ 'options' => $options,
284
+ );
285
+
286
+ if ( 'select' === $type ) {
287
+
288
+ $options = explode( ',', $options );
289
+ $field_data['options'] = array();
290
+
291
+ if ( is_array( $options ) && ! empty( $options ) ) {
292
+
293
+ foreach ( $options as $key => $value ) {
294
+
295
+ $field_data['options'][ $value ] = $value;
296
+ }
297
+ }
298
+ }
299
+
300
+ $width_args = array(
301
+ 'wcf-field-width_'.$name => $width,
302
+ );
303
+
304
+ Cartflows_Helper::add_checkout_field( $add_to, $name, $field_data, $post_id );
305
+ Cartflows_Helper::save_meta_option( $post_id, $width_args );
306
+
307
+ $key = sanitize_key( $name );
308
+ $name = 'wcf-' . $key;
309
+
310
+ $field_args = array(
311
+ 'type' => $type,
312
+ 'label' => $label,
313
+ 'name' => $name,
314
+ 'value' => 'yes',
315
+ 'placeholder' => $placeholder,
316
+ 'width' => $width,
317
+ 'after' => 'Enable',
318
+ 'section' => $add_to,
319
+ 'default' => $default_value,
320
+ 'required' => $is_required,
321
+ 'options' => $options,
322
+ );
323
+
324
+ $field_args['after_html'] = '<span class="wcf-cpf-actions" data-type="billing" data-key="' . $key . '"> ';
325
+ $field_args['after_html'] .= '<a class="wcf-cpf-action-remove wp-ui-text-notification">'. __( 'Remove', 'cartflows' ).'</a>';
326
+ $field_args['after_html'] .= '</span>';
327
+
328
+ // $field_markup = wcf()->meta->get_checkbox_field( $field_args );
329
+
330
+ $field_markup .= "<li class='wcf-field-item-edit-inactive wcf-field-item ui-sortable-handle'>";
331
+ $field_markup .= $this->get_field_html_via_ajax($field_args);
332
+ $field_markup .= "</li>";
333
+
334
+ if( 'billing' === $add_to ) {
335
+ $add_to_class = 'billing-field-sortable';
336
+ $section = 'billing';
337
+ } else if( 'shipping' === $add_to ) {
338
+ $add_to_class = 'shipping-field-sortable';
339
+ $section = 'shipping';
340
+ }
341
+
342
+ $data = array(
343
+ 'field_data' => $field_data,
344
+ 'field_args' => $field_args,
345
+ 'add_to_class' => $add_to_class,
346
+ 'markup' => $field_markup,
347
+ 'section' => $section,
348
+ );
349
+
350
+ wp_send_json( $data );
351
+ }
352
+
353
+ wp_send_json( false );
354
+
355
+ }
356
+
357
+ /**
358
+ * Get field html.
359
+ *
360
+ * @param array $args field arguments.
361
+ * @return string
362
+ */
363
+ function get_field_html_via_ajax( $field_args ) {
364
+
365
+ $value = $field_args['value'];
366
+
367
+ $is_checkbox = false;
368
+ $is_require = false;
369
+ $is_select = false;
370
+
371
+ $display = 'none';
372
+
373
+ $field_content = '';
374
+
375
+ if ( isset( $field_args['before'] ) ) {
376
+ $field_content .= '<span>' . $field_args['before'] . '</span>';
377
+ }
378
+ $field_content .= '<input type="hidden" name="' . $field_args['name'] . '" value="no">';
379
+ $field_content .= '<input type="checkbox" name="' . $field_args['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . '>';
380
+
381
+ if ( isset( $field_args['after'] ) ) {
382
+ $field_content .= $field_args['after'];
383
+ }
384
+
385
+ $type = isset( $field_args['type'] ) ? $field_args['type'] : '';
386
+ $label = isset( $field_args['label'] ) ? $field_args['label'] : '';
387
+ $help = isset( $field_args['help'] ) ? $field_args['help'] : '';
388
+ $after_html = isset( $field_args['after_html'] ) ? $field_args['after_html'] : '';
389
+ $name = isset( $field_args['name'] ) ? $field_args['name'] : '';
390
+ $default = isset( $field_args['default']) ? $field_args['default'] : '';
391
+ $required = isset( $field_args['required']) ? $field_args['required'] : '';
392
+ $options = isset( $field_args['options']) ? $field_args['options'] : '';
393
+ $width = isset( $field_args['width']) ? $field_args['width'] : '';
394
+ $name_class = 'field-' . $field_args['name'];
395
+
396
+ if( isset( $options ) && !empty( $options ) ){
397
+ $options = implode(', ', $options );
398
+ }else{
399
+ $options = '';
400
+ }
401
+
402
+ if( 'yes' == $required ){
403
+ $is_require = true;
404
+ }
405
+
406
+ if( 'checkbox' == $type ){
407
+ $is_checkbox = true;
408
+ }
409
+
410
+ if( 'select' == $type ){
411
+ $is_select = true;
412
+ $display = 'block';
413
+ }
414
+
415
+ // echo "<pre>";
416
+ // var_dump($after_html);
417
+ // echo "</pre>";
418
+
419
+ // $field_markup = wcf()->meta->get_only_checkbox_field( $field_args );
420
+ ob_start();
421
+
422
+ ?>
423
+ <div class="wcf-field-item-bar">
424
+ <div class="wcf-field-item-handle ui-sortable-handle">
425
+ <label class="dashicons <?php if( 'no' == $value ){ echo 'dashicons-hidden'; } else{ echo 'dashicons-visibility';} ?> " for="<?php echo $field_args['name']; ?>"></label>
426
+ <span class="item-title">
427
+ <span class="wcf-field-item-title"><?php echo $label; if( $is_require ) { ?> <i>*</i> <?php } ?></span>
428
+ <span class="is-submenu" style="display: none;">sub item</span>
429
+ </span>
430
+ <span class="item-controls">
431
+ <span class="dashicons dashicons-menu"></span>
432
+ <span class="item-order hide-if-js">
433
+ <a href="#" class="item-move-up" aria-label="Move up">↑</a>
434
+ |
435
+ <a href="#" class="item-move-down" aria-label="Move down">↓</a>
436
+ </span>
437
+ <a class="item-edit" id="edit-64" href="javascript:void(0);" aria-label="My account. Menu item 1 of 5."><span class="screen-reader-text">Edit</span></a>
438
+ </span>
439
+ </div>
440
+ </div>
441
+ <div class="wcf-field-item-settings">
442
+ <div class="wcf-field-item-settings-row-width">
443
+ <?php
444
+ echo wcf()->meta->get_select_field(
445
+ array(
446
+ 'label' => __( 'Field Width', 'cartflows' ),
447
+ 'name' => 'wcf-field-width_' . str_replace( 'wcf-', '', $field_args['name'] ),
448
+ 'value' => $width,
449
+ 'options' => array(
450
+ '33' => __( '33%', 'cartflows' ),
451
+ '50' => __( '50%', 'cartflows' ),
452
+ '100' => __( '100%', 'cartflows' ),
453
+ ),
454
+ )
455
+ );
456
+ ?>
457
+ </div>
458
+
459
+ <div class="wcf-field-item-settings-label">
460
+ <?php
461
+ echo wcf()->meta->get_text_field(
462
+ array(
463
+ 'label' => __( 'Field Label', 'cartflows' ),
464
+ 'name' => 'wcf_label_text_field_' . $field_args['section'] . '[' . str_replace( 'wcf-', '', $field_args['name'] ) . ']',
465
+ 'value' => $label,
466
+ )
467
+ );
468
+
469
+ ?>
470
+ <input type="hidden" name="wcf_field_order_<?php echo $field_args['section']; ?>[]" value="<?php echo str_replace( 'wcf-', '', $field_args['name'] ); ?>">
471
+ </div>
472
+
473
+ <div class="wcf-field-item-select-options" style="display:<?php if( isset( $display ) ){ print $display; } ?>;" >
474
+ <?php
475
+ echo wcf()->meta->get_text_field(
476
+ array(
477
+ 'label' => __( 'Options', 'cartflows' ),
478
+ 'name' => 'wcf_select_option_field_' . $field_args['section'] . '[' . str_replace( 'wcf-', '', $field_args['name'] ) . ']',
479
+ 'value' => $options,
480
+ )
481
+ );
482
+
483
+ ?>
484
+ <input type="hidden" name="wcf_field_order_<?php echo $field_args['section']; ?>[]" value="<?php echo str_replace( 'wcf-', '', $field_args['name'] ); ?>">
485
+ </div>
486
+
487
+ <div class="wcf-field-item-settings-default">
488
+ <?php
489
+ if( true == $is_checkbox ){
490
+ echo wcf()->meta->get_select_field(
491
+ array(
492
+ 'label' => __( 'Default', 'cartflows' ),
493
+ 'name' => 'wcf_label_default_field_' . $field_args['section'] . '[' . str_replace( 'wcf-', '', $field_args['name'] ) . ']',
494
+ 'value' => $value,
495
+ 'options' => array(
496
+ '1' => __( 'Checked', 'cartflows' ),
497
+ '0' => __( 'Un-Checked', 'cartflows' ),
498
+ ),
499
+ )
500
+ );
501
+ }else{
502
+
503
+ echo wcf()->meta->get_text_field(
504
+ array(
505
+ 'label' => __( 'Default', 'cartflows' ),
506
+ 'name' => 'wcf_label_default_field_' . $field_args['section'] . '[' . str_replace( 'wcf-', '', $field_args['name'] ) . ']',
507
+ 'value' => $default,
508
+ )
509
+ );
510
+ }
511
+ ?>
512
+ </div>
513
+
514
+ <div class="wcf-field-item-settings-placeholder" <?php if( true == $is_checkbox ) {?> style="display: none;" <?php } ?> >
515
+ <?php
516
+ echo wcf()->meta->get_text_field(
517
+ array(
518
+ 'label' => __( 'Placeholder', 'cartflows' ),
519
+ 'name' => 'wcf_label_placeholder_field_' . $field_args['section'] . '[' . str_replace( 'wcf-', '', $field_args['name'] ) . ']',
520
+ 'value' => $label,
521
+ )
522
+ );
523
+ ?>
524
+ </div>
525
+
526
+ <div class="wcf-field-item-settings-required">
527
+ <?php
528
+ echo wcf()->meta->get_checkbox_field(
529
+ array(
530
+ 'label' => __( 'Required', 'cartflows' ),
531
+ 'name' => 'wcf_is_required_field_' . $field_args['section'] . '[' . str_replace( 'wcf-', '', $field_args['name'] ) . ']',
532
+ 'value' => $required,
533
+ )
534
+ );
535
+ ?>
536
+ </div>
537
+
538
+ <div class="wcf-field-item-settings-checkbox">
539
+ <?php
540
+ echo wcf()->meta->get_checkbox_field(
541
+ array(
542
+ 'label' => __( 'Enable this field', 'cartflows' ),
543
+ 'name' => $field_args['name'],
544
+ 'value' => $value,
545
+ )
546
+ );
547
+ ?>
548
+ </div>
549
+
550
+ <?php
551
+ if(isset( $field_args['after_html']) )
552
+ {
553
+ ?>
554
+ <div class="wcf-field-item-settings-row-delete-cf">
555
+ <?php echo $field_args['after_html']; ?>
556
+ </div>
557
+ <?php
558
+ }
559
+ ?>
560
+ <!--
561
+ <label for="<?php echo $field_args['name']; ?>">
562
+ <?php _e( 'Label', 'cartflows' ); ?><br>
563
+ <input type="text" value="<?php echo $field_args['label']; ?>">
564
+
565
+ <?php if( isset( $field_markup ) ) { echo $field_markup; }?>
566
+
567
+ <input type="hidden" name="wcf_field_order_<?php echo $field_args['section']; ?>[]" value="<?php echo str_replace('wcf-', '', $field_args['name'] ); ?>">
568
+ </label> -->
569
+ </div>
570
+
571
+ <?php
572
+
573
+ return ob_get_clean();
574
+ }
575
+
576
+ /**
577
+ * [delete_checkout_custom_field description]
578
+ *
579
+ * @hook wcf_delete_checkout_custom_field
580
+ * @return [type] [description]
581
+ */
582
+ public function delete_checkout_custom_field() {
583
+
584
+ check_ajax_referer( 'wcf-delete-checkout-custom-field', 'security' );
585
+
586
+ $post_id = intval( $_POST['post_id'] );
587
+ $type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
588
+ $key = sanitize_text_field( wp_unslash( $_POST['key'] ) );
589
+
590
+ if ( '' !== $key ) {
591
+
592
+ Cartflows_Helper::delete_checkout_field( $type, $key, $post_id );
593
+
594
+ wp_send_json( true );
595
+
596
+ }
597
+
598
+ wp_send_json( false );
599
+
600
+ }
601
+
602
+ /**
603
+ * Function to search coupons
604
+ */
605
+ public function json_search_pages() {
606
+
607
+ check_ajax_referer( 'wcf-json-search-pages', 'security' );
608
+
609
+ $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
610
+
611
+ if ( empty( $term ) ) {
612
+ die( 'not found' );
613
+ }
614
+
615
+ $search_string = $term;
616
+ $data = array();
617
+ $result = array();
618
+
619
+ add_filter( 'posts_search', array( $this, 'search_only_titles' ), 10, 2 );
620
+
621
+ $query = new WP_Query(
622
+ array(
623
+ 's' => $search_string,
624
+ 'post_type' => 'page',
625
+ 'posts_per_page' => - 1,
626
+ )
627
+ );
628
+
629
+ if ( $query->have_posts() ) {
630
+ while ( $query->have_posts() ) {
631
+ $query->the_post();
632
+ $title = get_the_title();
633
+ $title .= ( 0 != $query->post->post_parent ) ? ' (' . get_the_title( $query->post->post_parent ) . ')' : '';
634
+ $id = get_the_id();
635
+ $data[] = array(
636
+ 'id' => $id,
637
+ 'text' => $title,
638
+ );
639
+ }
640
+ }
641
+
642
+ if ( is_array( $data ) && ! empty( $data ) ) {
643
+ $result[] = array(
644
+ 'text' => '',
645
+ 'children' => $data,
646
+ );
647
+ }
648
+
649
+ wp_reset_postdata();
650
+
651
+ // return the result in json.
652
+ wp_send_json( $result );
653
+ }
654
+
655
+ public function search_only_titles( $search, $wp_query ) {
656
+ if ( ! empty( $search ) && ! empty( $wp_query->query_vars['search_terms'] ) ) {
657
+ global $wpdb;
658
+
659
+ $q = $wp_query->query_vars;
660
+ $n = ! empty( $q['exact'] ) ? '' : '%';
661
+
662
+ $search = array();
663
+
664
+ foreach ( (array) $q['search_terms'] as $term ) {
665
+ $search[] = $wpdb->prepare( "$wpdb->posts.post_title LIKE %s", $n . $wpdb->esc_like( $term ) . $n );
666
+ }
667
+
668
+ if ( ! is_user_logged_in() ) {
669
+ $search[] = "$wpdb->posts.post_password = ''";
670
+ }
671
+
672
+ $search = ' AND ' . implode( ' AND ', $search );
673
+ }
674
+
675
+ return $search;
676
+ }
677
+
678
+ function get_field( $field_data, $field_content ) {
679
+
680
+ $label = isset( $field_data['label'] ) ? $field_data['label'] : '';
681
+ $help = isset( $field_data['help'] ) ? $field_data['help'] : '';
682
+ $after_html = isset( $field_data['after_html'] ) ? $field_data['after_html'] : '';
683
+
684
+ $name_class = 'field-' . $field_data['name'];
685
+
686
+ $field_html = '<div class="wcf-field-row ' . $name_class . '">';
687
+
688
+ if( ! empty( $label ) || ! empty( $help ) ) {
689
+ $field_html .= '<div class="wcf-field-row-heading">';
690
+ if( ! empty( $label ) ) {
691
+ $field_html .= '<label>' . esc_html( $label ) . '</label>';
692
+ }
693
+ if ( ! empty( $help ) ) {
694
+ $field_html .= '<i class="wcf-field-heading-help dashicons dashicons-editor-help">';
695
+ // $field_html .= '<span class="wcf-tooltip" data-tooltip= "'. esc_attr( $help ) .'"></span>';
696
+ $field_html .= '</i>';
697
+ $field_html .= '<span class="wcf-tooltip-text">';
698
+ $field_html .= $help;
699
+ $field_html .= '</span>';
700
+ }
701
+ $field_html .= '</div>';
702
+ }
703
+
704
+ $field_html .= '<div class="wcf-field-row-content">';
705
+ $field_html .= $field_content;
706
+
707
+ if ( ! empty( $after_html ) ) {
708
+ $field_html .= $after_html;
709
+ }
710
+
711
+ $field_html .= '</div>';
712
+ $field_html .= '</div>';
713
+
714
+ return $field_html;
715
+ }
716
+
717
+ function get_text_field( $field_data ) {
718
+
719
+ $value = $field_data['value'];
720
+
721
+ $attr = '';
722
+
723
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
724
+
725
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
726
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
727
+ }
728
+ }
729
+
730
+ $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
731
+
732
+ return $this->get_field( $field_data, $field_content );
733
+ }
734
+
735
+ function get_shortcode_field( $field_data ) {
736
+
737
+ $attr = '';
738
+
739
+ $attr_fields = array(
740
+ 'readonly' => 'readonly',
741
+ 'onfocus' => 'this.select()',
742
+ 'onmouseup' => 'return false',
743
+ );
744
+
745
+ if ( $attr_fields && is_array( $attr_fields ) ) {
746
+
747
+ foreach ( $attr_fields as $attr_key => $attr_value ) {
748
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
749
+ }
750
+ }
751
+
752
+ $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . $field_data['content'] . '" ' . $attr . '>';
753
+
754
+ return $this->get_field( $field_data, $field_content );
755
+ }
756
+
757
+ function get_display_field( $field_data ) {
758
+
759
+ $field_content = $field_data['content'];
760
+
761
+ return $this->get_field( $field_data, $field_content );
762
+ }
763
+
764
+ function get_hr_line_field( $field_data ) {
765
+
766
+ $field_data = array(
767
+ 'name' => 'wcf-hr-line',
768
+ 'content' => '<hr>'
769
+ );
770
+
771
+ $field_content = $field_data['content'];
772
+
773
+ return $this->get_field( $field_data, $field_content );
774
+ }
775
+
776
+ function get_number_field( $field_data ) {
777
+
778
+ $value = $field_data['value'];
779
+
780
+ $attr = '';
781
+
782
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
783
+
784
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
785
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
786
+ }
787
+ }
788
+
789
+ $field_content = '<input type="number" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
790
+
791
+ return $this->get_field( $field_data, $field_content );
792
+ }
793
+
794
+ function get_hidden_field( $field_data ) {
795
+
796
+ $value = $field_data['value'];
797
+
798
+ $attr = '';
799
+
800
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
801
+
802
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
803
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
804
+ }
805
+ }
806
+
807
+ $field_content = '<input type="hidden" id="' . $field_data['name'] . '" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
808
+
809
+ return $this->get_field( $field_data, $field_content );
810
+ }
811
+
812
+ function get_area_field( $field_data ) {
813
+
814
+ $value = $field_data['value'];
815
+
816
+ $field_content = '<textarea name="' . $field_data['name'] . '" rows="10" cols="50">';
817
+ $field_content .= $value;
818
+ $field_content .= '</textarea>';
819
+
820
+ return $this->get_field( $field_data, $field_content );
821
+ }
822
+
823
+ function get_only_checkbox_field( $field_data ) {
824
+ // echo "<pre>";
825
+ // var_dump($field_data);
826
+ // echo "</pre>";
827
+
828
+ $value = $field_data['value'];
829
+
830
+
831
+ $field_content = '';
832
+ if ( isset( $field_data['before'] ) ) {
833
+ $field_content .= '<span>' . $field_data['before'] . '</span>';
834
+ }
835
+ $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
836
+ $field_content .= '<input type="checkbox" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . '>';
837
+
838
+ if ( isset( $field_data['after'] ) ) {
839
+ $field_content .= '<span>' . $field_data['after'] . '</span>';
840
+ }
841
+
842
+ if ( isset( $field_data['after_html'] ) ) {
843
+ $field_content .= '<span>' . $field_data['after_html'] . '</span>';
844
+ }
845
+
846
+ return $field_content;
847
+ }
848
+
849
+ function get_checkbox_field( $field_data ) {
850
+
851
+ $value = $field_data['value'];
852
+
853
+ $field_content = '';
854
+ if ( isset( $field_data['before'] ) ) {
855
+ $field_content .= '<span>' . $field_data['before'] . '</span>';
856
+ }
857
+ $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
858
+ $field_content .= '<input type="checkbox" id="'.$field_data['name'].'" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . '>';
859
+
860
+ if ( isset( $field_data['after'] ) ) {
861
+ $field_content .= '<span>' . $field_data['after'] . '</span>';
862
+ }
863
+
864
+ return $this->get_field( $field_data, $field_content );
865
+ }
866
+
867
+ function get_radio_field( $field_data ) {
868
+
869
+ $value = $field_data['value'];
870
+ $field_content = '';
871
+
872
+ if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
873
+
874
+ foreach ( $field_data['options'] as $data_key => $data_value ) {
875
+
876
+ $field_content .= '<div class="wcf-radio-option">';
877
+ $field_content .= '<input type="radio" name="' . $field_data['name'] . '" value="' . $data_key . '" ' . checked( $data_key, $value, false ) . '>';
878
+ $field_content .= $data_value;
879
+ $field_content .= '</div>';
880
+ }
881
+ }
882
+
883
+ return $this->get_field( $field_data, $field_content );
884
+ }
885
+
886
+ function get_font_family_field( $field_data ) {
887
+
888
+ $value = $field_data['value'];
889
+
890
+ $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
891
+
892
+ $field_content = '<select class="wcf-field-font-family" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
893
+
894
+ $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
895
+
896
+ $field_content .= '<optgroup label="Other System Fonts">';
897
+ foreach ( CartFlows_Font_Families::get_system_fonts() as $name => $variants ) {
898
+ $field_content .= '<option value="' . esc_attr( $name ) . '" ' . selected( $name, $value, false ) . '>' . esc_attr( $name ) . '</option>';
899
+ }
900
+ $field_content .= '</optgroup>';
901
+ $field_content .= '<optgroup label="Google">';
902
+ foreach ( CartFlows_Font_Families::get_google_fonts() as $name => $single_font ) {
903
+ $variants = wcf_get_prop( $single_font, '0' );
904
+ $category = wcf_get_prop( $single_font, '1' );
905
+ $font_value = '\'' . esc_attr( $name ) . '\', ' . esc_attr( $category );
906
+ $field_content .= '<option value="' . esc_attr( $font_value ) . '" ' . selected( $font_value, $value, false ) . '>' . esc_attr( $name ) . '</option>';
907
+ }
908
+ $field_content .= '</optgroup>';
909
+
910
+ $field_content .= '</select>';
911
+
912
+ return $this->get_field( $field_data, $field_content );
913
+ }
914
+
915
+ function get_font_weight_field( $field_data ) {
916
+
917
+ $value = $field_data['value'];
918
+
919
+ $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
920
+
921
+ $field_content = '<select data-selected="'.esc_attr( $value ).'" class="wcf-field-font-weight" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
922
+
923
+ $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
924
+
925
+ $field_content .= '</select>';
926
+
927
+ return $this->get_field( $field_data, $field_content );
928
+ }
929
+
930
+ function get_select_field( $field_data ) {
931
+
932
+ $value = $field_data['value'];
933
+ $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
934
+
935
+ $field_content = '<select name="' . $field_data['name'] . '">';
936
+
937
+
938
+ if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
939
+
940
+ foreach ( $field_data['options'] as $data_key => $data_value ) {
941
+
942
+ $disabled = '';
943
+
944
+ if ( array_key_exists( $data_key, $pro_options ) ) {
945
+ $disabled = 'disabled ';
946
+ $data_value = $pro_options[ $data_key ];
947
+ }
948
+
949
+ $field_content .= '<option value="' . $data_key . '" ' . selected( $value, $data_key, false ) . ' ' . $disabled .'>' . $data_value . '</option>';
950
+ }
951
+ }
952
+
953
+ $field_content .= '</select>';
954
+
955
+ if ( isset( $field_data['after'] ) ) {
956
+ $field_content .= '<span>' . $field_data['after'] . '</span>';
957
+ }
958
+
959
+ return $this->get_field( $field_data, $field_content );
960
+ }
961
+
962
+ function get_color_picker_field( $field_data ) {
963
+
964
+ $value = $field_data['value'];
965
+
966
+ $field_content = '<input class="wcf-color-picker" type="text" name="' . $field_data['name'] . '" value="' . $value . '">';
967
+
968
+ return $this->get_field( $field_data, $field_content );
969
+ }
970
+
971
+ function get_product_selection_field( $field_data ) {
972
+
973
+ $value = $field_data['value'];
974
+
975
+ $multiple = '';
976
+
977
+ if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
978
+ $multiple = ' multiple="multiple"';
979
+ }
980
+
981
+ $allow_clear = '';
982
+
983
+ if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
984
+ $allow_clear = ' data-allow_clear="allow_clear"';
985
+ }
986
+
987
+ $field_content = '<select
988
+ name="' . $field_data['name'] . '[]"
989
+ class="wcf-product-search" ' . $multiple . $allow_clear . '
990
+ data-placeholder="' . __( 'Search for a product&hellip;', 'cartflows' ) . '"
991
+ data-action="woocommerce_json_search_products_and_variations">';
992
+
993
+ if ( is_array( $value ) && ! empty( $value ) ) {
994
+
995
+ foreach ( $value as $data_key => $product_id ) {
996
+
997
+ $product = wc_get_product( $product_id );
998
+
999
+ // posts.
1000
+ if ( ! empty( $product ) ) {
1001
+ $post_title = $product->get_name() . ' (#' . $product_id . ')';
1002
+
1003
+ $field_content .= '<option value="' . $product_id . '" selected="selected" >' . $post_title . '</option>';
1004
+ }
1005
+ }
1006
+ }
1007
+ $field_content .= '</select>';
1008
+
1009
+ return $this->get_field( $field_data, $field_content );
1010
+ }
1011
+
1012
+ function get_coupon_selection_field( $field_data ) {
1013
+
1014
+ $value = $field_data['value'];
1015
+
1016
+ $multiple = '';
1017
+
1018
+ if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
1019
+ $multiple = ' multiple="multiple"';
1020
+ }
1021
+
1022
+ $allow_clear = '';
1023
+
1024
+ if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
1025
+ $allow_clear = ' data-allow_clear="allow_clear"';
1026
+ }
1027
+
1028
+ $field_content = '<select
1029
+ name="' . $field_data['name'] . '[]"
1030
+ class="wc-coupon-search wcf-coupon-search" ' . $multiple . $allow_clear . '
1031
+ data-placeholder="' . __( 'Search for a coupon&hellip;', 'cartflows' ) . '"
1032
+ data-action="wcf_json_search_coupons">';
1033
+
1034
+ if ( is_array( $value ) && ! empty( $value ) ) {
1035
+
1036
+ $all_discount_types = wc_get_coupon_types();
1037
+
1038
+ foreach ( $value as $coupon_title ) {
1039
+
1040
+ $coupon = new WC_Coupon( $coupon_title );
1041
+
1042
+ $discount_type = $coupon->get_discount_type();
1043
+
1044
+ if ( isset( $discount_type ) && $discount_type ) {
1045
+ $discount_type = ' ( Type: ' . $all_discount_types[ $discount_type ] . ' )';
1046
+ }
1047
+
1048
+ $field_content .= '<option value="' . $coupon_title . '" selected="selected">' . $coupon_title . $discount_type . '</option>';
1049
+ }
1050
+ }
1051
+
1052
+ $field_content .= '</select>';
1053
+
1054
+ return $this->get_field( $field_data, $field_content );
1055
+ }
1056
+
1057
+ function get_page_selection_field( $field_data ) {
1058
+
1059
+ $value = $field_data['value'];
1060
+
1061
+ $multiple = '';
1062
+
1063
+ if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
1064
+ $multiple = 'multiple="multiple"';
1065
+ }
1066
+
1067
+ $field_content = '<select
1068
+ name="' . $field_data['name'] . '[]"
1069
+ class="wcf-search-pages" ' . $multiple . '"
1070
+ data-action="wcf_json_search_pages">';
1071
+
1072
+ if ( is_array( $value ) && ! empty( $value ) ) {
1073
+
1074
+ foreach ( $value as $data_key => $data_value ) {
1075
+
1076
+ $field_content .= '<option value="' . $data_value . '">' . get_the_title( $data_value ) . '</option>';
1077
+ }
1078
+ }
1079
+
1080
+ $field_content .= '</select>';
1081
+
1082
+ return $this->get_field( $field_data, $field_content );
1083
+ }
1084
+
1085
+ function get_section( $field_data ) {
1086
+ $field_html = '<div class="wcf-field-row wcf-field-section">';
1087
+ $field_html .= '<div class="wcf-field-section-heading" colspan="2">';
1088
+ $field_html .= '<label>' . esc_html( $field_data['label'] ) . '</label>';
1089
+
1090
+ if ( isset( $field_data['help'] ) ) {
1091
+ $field_html .= '<i class="wcf-field-heading-help dashicons dashicons-editor-help" title="' . esc_attr( $field_data['help'] ) . '"></i>';
1092
+ }
1093
+ $field_html .= '</div>';
1094
+ $field_html .= '</div>';
1095
+ return $field_html;
1096
+ }
1097
+
1098
+ function get_description_field( $field_data ) {
1099
+
1100
+ $field_html = '<div class="wcf-field-row wcf-field-desc ' . $field_data['name'] . '">';
1101
+ $field_html .= '<div class="wcf-field-desc-content">';
1102
+ $field_html .= $field_data['content'];
1103
+ $field_html .= '</div>';
1104
+ $field_html .= '</div>';
1105
+
1106
+ return $field_html;
1107
+ }
1108
+
1109
+ function get_checkout_field_repeater( $field_data ) {
1110
+
1111
+ $value = array();
1112
+
1113
+ $value[0] = array(
1114
+ 'add_to' => '',
1115
+ 'type' => '',
1116
+ 'label' => '',
1117
+ 'name' => '',
1118
+ );
1119
+
1120
+ $field_content = '';
1121
+
1122
+ $field_content .= '<div class="wcf-field-row">';
1123
+ // $field_content .= '<div class="wcf-field-row-heading">';
1124
+ // $field_content .= '<label>' . esc_html( $field_data['label'] ) . '</label>';
1125
+ // $field_content .= '</div>';
1126
+ $field_content .= '<div class="wcf-field-row-content">';
1127
+ $field_content .= '<div class="wcf-cpf-wrap">';
1128
+
1129
+ foreach ( $value as $p_key => $p_data ) {
1130
+ $field_content .= '<div class="wcf-cpf-row" data-key="' . $p_key . '">';
1131
+ $field_content .= '<div class="wcf-cpf-row-header">';
1132
+ $field_content .= '<span class="wcf-cpf-row-title">Add New Custom Field</span>';
1133
+ $field_content .= '</div>';
1134
+
1135
+ $field_content .= '<div class="wcf-cpf-row-standard-fields">';
1136
+
1137
+ /* Add To */
1138
+ $field_content .= '<div class="wcf-cpf-fields wcf-cpf-add_to">';
1139
+ $field_content .= '<span class="wcf-cpf-row-setting-label">Add to</span>';
1140
+ $field_content .= '<span class="wcf-cpf-row-setting-field">';
1141
+ $field_content .= '<select name="wcf-checkout-custom-fields[' . $p_key . '][add_to]" class="wcf-cpf-add_to">';
1142
+ $field_content .= '<option value="billing">Billing</option>';
1143
+ $field_content .= '<option value="shipping">Shipping</option>';
1144
+ $field_content .= '</select>';
1145
+ $field_content .= '</span>';
1146
+ $field_content .= '</div>';
1147
+
1148
+ /* Type */
1149
+ $field_content .= '<div class="wcf-cpf-fields wcf-cpf-type">';
1150
+ $field_content .= '<span class="wcf-cpf-row-setting-label">Type</span>';
1151
+ $field_content .= '<span class="wcf-cpf-row-setting-field">';
1152
+ $field_content .= '<select name="wcf-checkout-custom-fields[' . $p_key . '][type]" class="wcf-cpf-type">';
1153
+ $field_content .= '<option value="text">Text</option>';
1154
+ $field_content .= '<option value="textarea">Textarea</option>';
1155
+ $field_content .= '<option value="select">Select</option>';
1156
+ $field_content .= '<option value="checkbox">Checkbox</option>';
1157
+ $field_content .= '</select>';
1158
+ $field_content .= '</span>';
1159
+ $field_content .= '</div>';
1160
+
1161
+ /* Textarea */
1162
+ $field_content .= '<div class="wcf-cpf-fields wcf-cpf-options">';
1163
+ $field_content .= '<span class="wcf-cpf-row-setting-label">Options *</span>';
1164
+ $field_content .= '<span class="wcf-cpf-row-setting-field">';
1165
+ $field_content .= '<textarea value="" name="wcf-checkout-custom-fields[' . $p_key . '][label]" class="wcf-cpf-options" placeholder="Enter your options separated by comma."></textarea>';
1166
+ $field_content .= '</span>';
1167
+ $field_content .= '</div>';
1168
+
1169
+ /* Label */
1170
+ $field_content .= '<div class="wcf-cpf-fields wcf-cpf-label">';
1171
+ $field_content .= '<span class="wcf-cpf-row-setting-label">Label *</span>';
1172
+ $field_content .= '<span class="wcf-cpf-row-setting-field">';
1173
+ $field_content .= '<input type="text" value="" name="wcf-checkout-custom-fields[' . $p_key . '][label]" class="wcf-cpf-label">';
1174
+ $field_content .= '</span>';
1175
+ $field_content .= '</div>';
1176
+
1177
+ /* Name */
1178
+ $field_content .= '<div class="wcf-cpf-fields wcf-cpf-name">';
1179
+ $field_content .= '<span class="wcf-cpf-row-setting-label">Name *</span>';
1180
+ $field_content .= '<span class="wcf-cpf-row-setting-field">';
1181
+ $field_content .= '<input type="text" value="" name="wcf-checkout-custom-fields[' . $p_key . '][name]" class="wcf-cpf-name">';
1182
+ $field_content .= '</span>';
1183
+ $field_content .= '</div>';
1184
+
1185
+ $field_content .= '</div>';
1186
+ $field_content .= '</div>';
1187
+ }
1188
+
1189
+ /* Add New Custom Field */
1190
+ $field_content .= '<div class="wcf-cpf-add-row">';
1191
+ $field_content .= '<div class="wcf-cpf-add-wrap">';
1192
+ $field_content .= '<button class="button button-secondary wcf-cpf-add" data-name="wcf-checkout-custom-fields">Add New Field</button>';
1193
+ $field_content .= '</div>';
1194
+ $field_content .= '</div>';
1195
+ /* End Add new custom field */
1196
+
1197
+ $field_content .= '</div>';
1198
+ $field_content .= '</div>';
1199
+ $field_content .= '</div>';
1200
+
1201
+ return $field_content;
1202
+ }
1203
+
1204
+ function get_pro_checkout_field_repeater( $field_data ) {
1205
+
1206
+ $value = array();
1207
+
1208
+ $value[0] = array(
1209
+ 'add_to' => '',
1210
+ 'type' => '',
1211
+ 'label' => '',
1212
+ 'name' => '',
1213
+ );
1214
+
1215
+ $field_content = '';
1216
+
1217
+ $field_content .= '<div class="wcf-field-row">';
1218
+ // $field_content .= '<div class="wcf-field-row-heading">';
1219
+ // $field_content .= '<label>' . esc_html( $field_data['label'] ) . '</label>';
1220
+ // $field_content .= '</div>';
1221
+ $field_content .= '<div class="wcf-field-row-content">';
1222
+ $field_content .= '<div class="wcf-cpf-wrap">';
1223
+
1224
+ foreach ( $value as $p_key => $p_data ) {
1225
+ $field_content .= '<div class="wcf-cpf-row" data-key="' . $p_key . '">';
1226
+ $field_content .= '<div class="wcf-cpf-row-header">';
1227
+ $field_content .= '<span class="wcf-cpf-row-title">Add New Custom Field</span>';
1228
+ $field_content .= '</div>';
1229
+
1230
+ $field_content .= '<div class="wcf-cpf-row-standard-fields">';
1231
+
1232
+ /* Add To */
1233
+ $field_content .= '<div class="wcf-cpf-fields wcf-cpf-add_to">';
1234
+ $field_content .= '<span class="wcf-cpf-row-setting-label">Add to</span>';
1235
+ $field_content .= '<span class="wcf-cpf-row-setting-field">';
1236
+ $field_content .= '<select name="wcf-checkout-custom-fields[' . $p_key . '][add_to]" class="wcf-cpf-add_to">';
1237
+ $field_content .= '<option value="billing">Billing</option>';
1238
+ $field_content .= '<option value="shipping">Shipping</option>';
1239
+ $field_content .= '</select>';
1240
+ $field_content .= '</span>';
1241
+ $field_content .= '</div>';
1242
+
1243
+ /* Type */
1244
+ $field_content .= '<div class="wcf-cpf-fields wcf-cpf-type">';
1245
+ $field_content .= '<span class="wcf-cpf-row-setting-label">Type</span>';
1246
+ $field_content .= '<span class="wcf-cpf-row-setting-field">';
1247
+ $field_content .= '<select name="wcf-checkout-custom-fields[' . $p_key . '][type]" class="wcf-cpf-type">';
1248
+ $field_content .= '<option value="text">Text</option>';
1249
+ $field_content .= '<option value="textarea">Textarea</option>';
1250
+ $field_content .= '<option value="select">Select</option>';
1251
+ $field_content .= '<option value="checkbox">Checkbox</option>';
1252
+ $field_content .= '<option value="hidden">Hidden</option>';
1253
+ $field_content .= '</select>';
1254
+ $field_content .= '</span>';
1255
+ $field_content .= '</div>';
1256
+
1257
+ /* Label */
1258
+ $field_content .= '<div class="wcf-cpf-fields wcf-cpf-label">';
1259
+ $field_content .= '<span class="wcf-cpf-row-setting-label">Label <i>*</i></span>';
1260
+ $field_content .= '<span class="wcf-cpf-row-setting-field">';
1261
+ $field_content .= '<input type="text" value="" name="wcf-checkout-custom-fields[' . $p_key . '][label]" class="wcf-cpf-label">';
1262
+ $field_content .= '<span id="wcf-cpf-label-error-msg"></span>';
1263
+ $field_content .= '</span>';
1264
+ $field_content .= '</div>';
1265
+
1266
+ /* Default */
1267
+ $field_content .= '<div class="wcf-cpf-fields wcf-cpf-default">';
1268
+ $field_content .= '<span class="wcf-cpf-row-setting-label">Default</span>';
1269
+ $field_content .= '<span class="wcf-cpf-row-setting-field">';
1270
+ $field_content .= '<input type="text" value="" name="wcf-checkout-custom-fields[' . $p_key . '][default]" class="wcf-cpf-default">';
1271
+ $field_content .= '<span id="wcf-cpf-default-error-msg"></span>';
1272
+ $field_content .= '</span>';
1273
+ $field_content .= '</div>';
1274
+
1275
+ /* Placeholder */
1276
+ $field_content .= '<div class="wcf-cpf-fields wcf-cpf-placeholder">';
1277
+ $field_content .= '<span class="wcf-cpf-row-setting-label">Placeholder</span>';
1278
+ $field_content .= '<span class="wcf-cpf-row-setting-field">';
1279
+ $field_content .= '<input type="text" value="" name="wcf-checkout-custom-fields[' . $p_key . '][placeholder]" class="wcf-cpf-placeholder">';
1280
+ $field_content .= '<span id="wcf-cpf-placeholder-error-msg"></span>';
1281
+ $field_content .= '</span>';
1282
+ $field_content .= '</div>';
1283
+
1284
+ /* Options */
1285
+ $field_content .= '<div class="wcf-cpf-fields wcf-cpf-options">';
1286
+ $field_content .= '<span class="wcf-cpf-row-setting-label">Options <i>*</i></span>';
1287
+ $field_content .= '<span class="wcf-cpf-row-setting-field">';
1288
+ $field_content .= '<textarea value="" name="wcf-checkout-custom-fields[' . $p_key . '][label]" class="wcf-cpf-options" placeholder="Enter your options separated by comma."></textarea>';
1289
+ $field_content .= '</span>';
1290
+ $field_content .= '</div>';
1291
+
1292
+ /* Width */
1293
+ $field_content .= '<div class="wcf-cpf-fields wcf-cpf-width">';
1294
+ $field_content .= '<span class="wcf-cpf-row-setting-label">Width</span>';
1295
+ $field_content .= '<span class="wcf-cpf-row-setting-field">';
1296
+ $field_content .= '<select name="wcf-checkout-custom-fields[' . $p_key . '][width]" class="wcf-cpf-width">';
1297
+ $field_content .= '<option value="33">33%</option>';
1298
+ $field_content .= '<option value="50">50%</option>';
1299
+ $field_content .= '<option value="100" selected>100%</option>';
1300
+ $field_content .= '</select>';
1301
+ $field_content .= '</span>';
1302
+ $field_content .= '</div>';
1303
+
1304
+ /* Required */
1305
+ $field_content .= '<div class="wcf-cpf-fields wcf-cpf-required">';
1306
+ $field_content .= '<span class="wcf-cpf-row-setting-label">Required</span>';
1307
+ $field_content .= '<span class="wcf-cpf-row-setting-field">';
1308
+ $field_content .= '<input type="hidden" value="no" name="wcf-checkout-custom-fields[' . $p_key . '][required]" class="wcf-cpf-required">';
1309
+ $field_content .= '<input type="checkbox" value="yes" name="wcf-checkout-custom-fields[' . $p_key . '][required]" class="wcf-cpf-required">';
1310
+ $field_content .= '<span id="wcf-cpf-required-error-msg"></span>';
1311
+ $field_content .= '</span>';
1312
+ $field_content .= '</div>';
1313
+
1314
+ $field_content .= '</div>';
1315
+ $field_content .= '</div>';
1316
+ }
1317
+
1318
+ /* Add New Custom Field */
1319
+ $field_content .= '<div class="wcf-cpf-add-row">';
1320
+ $field_content .= '<div class="wcf-cpf-add-wrap">';
1321
+ $field_content .= '<button class="button button-secondary wcf-pro-cpf-add" data-name="wcf-checkout-custom-fields">Add New Field</button>';
1322
+ $field_content .= '</div>';
1323
+ $field_content .= '</div>';
1324
+ /* End Add new custom field */
1325
+
1326
+ $field_content .= '</div>';
1327
+ $field_content .= '</div>';
1328
+ $field_content .= '</div>';
1329
+
1330
+ return $field_content;
1331
+ }
1332
+
1333
+ function get_product_selection_repeater( $field_data ) {
1334
+
1335
+ $value = $field_data['value'];
1336
+
1337
+ if ( ! is_array( $value ) ) {
1338
+
1339
+ $value[0] = array(
1340
+ 'product' => '',
1341
+ );
1342
+ } else {
1343
+
1344
+ if ( ! isset( $value[0] ) ) {
1345
+
1346
+ $value[0] = array(
1347
+ 'product' => '',
1348
+ );
1349
+ }
1350
+ }
1351
+
1352
+ $field_html = '';
1353
+
1354
+ $field_html .= '<script type="text/html" id="tmpl-wcf-product-repeater">';
1355
+ $field_html .= $this->generate_product_repeater_html( '{{id}}' );
1356
+ $field_html .= '</script>';
1357
+
1358
+ $field_html .= '<div class="wcf-field-row">';
1359
+ $field_html .= '<div class="wcf-field-row-content">';
1360
+ $field_html .= '<div class="wcf-repeatables-wrap">';
1361
+
1362
+ if ( is_array( $value ) ) {
1363
+
1364
+ foreach ( $value as $p_key => $p_data ) {
1365
+
1366
+ $selected_options = '';
1367
+
1368
+ if ( isset( $p_data['product'] ) ) {
1369
+
1370
+ $product = wc_get_product( $p_data['product'] );
1371
+
1372
+ // posts.
1373
+ if ( ! empty( $product ) ) {
1374
+ $post_title = $product->get_name() . ' (#' . $p_data['product'] . ')';
1375
+
1376
+ $selected_options = '<option value="' . $p_data['product'] . '" selected="selected" >' . $post_title . '</option>';
1377
+ }
1378
+ }
1379
+
1380
+ $field_html .= $this->generate_product_repeater_html( $p_key, $selected_options );
1381
+ }
1382
+ }
1383
+
1384
+ $field_html .= '<div class="wcf-add-repeatable-row">';
1385
+ $field_html .= '<div class="submit wcf-add-repeatable-wrap">';
1386
+ $field_html .= '<button class="button-primary wcf-add-repeatable" data-name="wcf-checkout-products">Add New Product</button>';
1387
+ $field_html .= '</div>';
1388
+ $field_html .= '</div>';
1389
+ $field_html .= '</div>';
1390
+ $field_html .= '</div>';
1391
+ $field_html .= '</div>';
1392
+
1393
+ return $field_html;
1394
+ }
1395
+
1396
+ function generate_product_repeater_html( $id, $options = '' ) {
1397
+
1398
+ $field_html = '<div class="wcf-repeatable-row" data-key="' . $id . '">';
1399
+
1400
+ $field_html .= '<div class="wcf-repeatable-row-standard-fields">';
1401
+
1402
+ /* Product Name */
1403
+ $field_html .= '<div class="wcf-repeatable-fields wcf-sel-product">';
1404
+ $field_html .= '<span class="wcf-repeatable-row-setting-field">';
1405
+ $field_html .= '<select
1406
+ name="wcf-checkout-products[' . $id . '][product]"
1407
+ class="wcf-product-search"
1408
+ data-allow_clear="allow_clear"
1409
+ data-placeholder="' . __( 'Search for a product&hellip;', 'cartflows' ) . '"
1410
+ data-action="woocommerce_json_search_products_and_variations">';
1411
+ $field_html .= $options;
1412
+ $field_html .= '</select>';
1413
+ $field_html .= '</span>';
1414
+ $field_html .= '<span class="wcf-repeatable-row-actions">';
1415
+ $field_html .= '<a class="wcf-remove-row wcf-repeatable-remove button" data-type="product">';
1416
+ $field_html .= '<span class="dashicons dashicons-trash"></span>';
1417
+ $field_html .= '<span class="wcf-repeatable-remove-button">'. __( 'Remove', 'cartflows' ).'</span>';
1418
+ $field_html .= '</a>';
1419
+ $field_html .= '</span>';
1420
+ $field_html .= '</div>';
1421
+ $field_html .= '</div>';
1422
+ $field_html .= '</div>';
1423
+
1424
+ return $field_html;
1425
+ }
1426
+
1427
+ function get_image_field( $field_data ) {
1428
+
1429
+ $value = $field_data['value'];
1430
+
1431
+ $attr = '';
1432
+
1433
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
1434
+
1435
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
1436
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
1437
+ }
1438
+ }
1439
+
1440
+ $display_preview_box = ( isset( $value ) && '' != $value ) ? 'display:block;' : 'display:none';
1441
+
1442
+ $field_content = '<div id="wcf-image-preview" style="'.$display_preview_box.'">';
1443
+ if( isset( $value ) ){
1444
+ $field_content .= '<img src="'. $value .'" class="saved-image" name="'. $field_data['name'] .'" width="150">';
1445
+ }
1446
+ $field_content .= '</div>';
1447
+ // $field_content .= '<input type="hidden" id="wcf-image-id" class="wcf-image-id" name="wcf-image-id[image-id]" value="">';
1448
+ $field_content .= '<input type="hidden" id="wcf-image-value" class="wcf-image" name="' . $field_data['name'] . '" value="'.$value.'">';
1449
+
1450
+ $field_content .= '<button type="button" ' . $attr . ' class="wcf-select-image button-secondary">Select Image</button>';
1451
+
1452
+ $display_remove_button = ( isset( $value ) && '' != $value ) ? 'display:inline-block; margin-left: 5px;' : 'display:none';
1453
+
1454
+ $field_content .= '<button type="button" class="wcf-remove-image button-secondary" style="'.$display_remove_button.'">Remove Image</button>';
1455
+
1456
+ return $this->get_field( $field_data, $field_content );
1457
+ }
1458
+
1459
+ /**
1460
+ * Localize variables in admin
1461
+ *
1462
+ * @param array $vars variables.
1463
+ */
1464
+ function localize_vars( $vars ) {
1465
+
1466
+ $ajax_actions = array(
1467
+ 'wcf_add_checkout_custom_field',
1468
+ 'wcf_pro_add_checkout_custom_field',
1469
+ 'wcf_delete_checkout_custom_field',
1470
+ 'wcf_json_search_pages',
1471
+ 'wcf_json_search_coupons'
1472
+ );
1473
+
1474
+ foreach ( $ajax_actions as $action ) {
1475
+
1476
+ $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
1477
+ }
1478
+
1479
+ return $vars;
1480
+ }
1481
+ }
1482
+ // @codingStandardsIgnoreEnd
classes/class-cartflows-thrive-compatibility.php CHANGED
@@ -1,63 +1,77 @@
1
- <?php
2
- /**
3
- * Thrive Visual Editor Compatibility
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Class for Thrive Visual Editor Compatibility
10
- */
11
- class Cartflows_Thrive_Compatibility {
12
-
13
- /**
14
- * Member Variable
15
- *
16
- * @var instance
17
- */
18
- private static $instance;
19
-
20
- /**
21
- * Initiator
22
- */
23
- public static function get_instance() {
24
- if ( ! isset( self::$instance ) ) {
25
- self::$instance = new self;
26
- }
27
- return self::$instance;
28
- }
29
-
30
- /**
31
- * Constructor
32
- */
33
- public function __construct() {
34
-
35
- // Add CartFlows post type in the thrive page editor.
36
- add_filter( 'tve_landing_page_post_types', array( $this, 'send_post_type_to_thrive' ) );
37
-
38
- add_filter( 'tcb_can_use_landing_pages', array( $this, 'send_post_type_to_thrive' ) );
39
-
40
- add_filter( 'tcb_has_templates_tab', array( $this, 'send_post_type_to_thrive' ) );
41
- }
42
-
43
- /**
44
- * Return step post type for Thrive Architect.
45
- *
46
- * @since 1.0.0
47
- * @param array $post_type_pt the current step post type.
48
- * @return array $post_type_pt current step post type.
49
- */
50
- function send_post_type_to_thrive( $post_type_pt ) {
51
-
52
- $post_type_pt = array();
53
-
54
- $post_type_pt[] = CARTFLOWS_STEP_POST_TYPE;
55
-
56
- return $post_type_pt;
57
- }
58
- }
59
-
60
- /**
61
- * Kicking this off by calling 'get_instance()' method
62
- */
63
- Cartflows_Thrive_Compatibility::get_instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Thrive Visual Editor Compatibility
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Class for Thrive Visual Editor Compatibility
10
+ */
11
+ class Cartflows_Thrive_Compatibility {
12
+
13
+ /**
14
+ * Member Variable
15
+ *
16
+ * @var instance
17
+ */
18
+ private static $instance;
19
+
20
+ /**
21
+ * Initiator
22
+ */
23
+ public static function get_instance() {
24
+ if ( ! isset( self::$instance ) ) {
25
+ self::$instance = new self;
26
+ }
27
+ return self::$instance;
28
+ }
29
+
30
+ /**
31
+ * Constructor
32
+ */
33
+ public function __construct() {
34
+
35
+ // Add CartFlows post type in the thrive page editor.
36
+ add_filter( 'tve_post_type_can_use_landing_page', array( $this, 'send_post_type_to_thrive' ) );
37
+
38
+ // add_filter( 'tve_landing_page_post_types', array( $this, 'send_post_type_to_thrive' ) );.
39
+ add_filter( 'tcb_can_use_landing_pages', array( $this, 'display_change_template_option' ) );
40
+
41
+ add_filter( 'tcb_has_templates_tab', array( $this, 'display_change_template_option' ) );
42
+ }
43
+
44
+ /**
45
+ * Return step post type for Thrive Architect.
46
+ *
47
+ * @since 1.0.0
48
+ * @param array $post_type_pt the current step post type.
49
+ * @return array $post_type_pt current step post type.
50
+ */
51
+ function send_post_type_to_thrive( $post_type_pt ) {
52
+
53
+ $post_type_pt[] = CARTFLOWS_STEP_POST_TYPE;
54
+
55
+ return $post_type_pt;
56
+ }
57
+
58
+ /**
59
+ * Return true/false to show change template option.
60
+ *
61
+ * @since 1.0.0
62
+ * @param array $bool true/false.
63
+ * @return array $bool true/false.
64
+ */
65
+ function display_change_template_option( $bool ) {
66
+
67
+ if ( wcf()->utils->is_step_post_type() ) {
68
+ $bool = true;
69
+ }
70
+ return $bool;
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Kicking this off by calling 'get_instance()' method
76
+ */
77
+ Cartflows_Thrive_Compatibility::get_instance();
languages/cartflows.pot CHANGED
@@ -1,1157 +1,1347 @@
1
- # Copyright (C) 2019 CartFlows Inc
2
- # This file is distributed under the same license as the CartFlows package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: CartFlows 1.1.5\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
- "POT-Creation-Date: 2019-01-23 11:14:41+00:00\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=utf-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
- "Language: en\n"
15
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
- "X-Poedit-Country: United States\n"
17
- "X-Poedit-SourceCharset: UTF-8\n"
18
- "X-Poedit-KeywordsList: "
19
- "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
20
- "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
21
- "X-Poedit-Basepath: ../\n"
22
- "X-Poedit-SearchPath-0: .\n"
23
- "X-Poedit-Bookmarks: \n"
24
- "X-Textdomain-Support: yes\n"
25
- "X-Generator: grunt-wp-i18n1.0.2\n"
26
-
27
- #: classes/batch-process/class-cartflows-importer-elementor.php:44
28
- msgid "Invalid content."
29
- msgstr ""
30
-
31
- #: classes/batch-process/class-cartflows-importer-elementor.php:52
32
- msgid "Invalid content. Expected an array."
33
- msgstr ""
34
-
35
- #: classes/batch-process/helpers/class-wp-background-process.php:435
36
- msgid "Every %d Minutes"
37
- msgstr ""
38
-
39
- #: classes/class-cartflows-admin-fields.php:162
40
- msgid "Select"
41
- msgstr ""
42
-
43
- #: classes/class-cartflows-admin-fields.php:165
44
- msgid "No Checkout Steps"
45
- msgstr ""
46
-
47
- #: classes/class-cartflows-admin-fields.php:191
48
- #. translators: %s: link
49
- msgid ""
50
- "Be sure not to add any product in above selected Global Checkout step. "
51
- "Please read information about how to set up Global Checkout %1$shere%2$s."
52
- msgstr ""
53
-
54
- #: classes/class-cartflows-admin.php:106 classes/class-cartflows-admin.php:107
55
- #: includes/admin/cartflows-general-bck.php:34
56
- msgid "Settings"
57
- msgstr ""
58
-
59
- #: classes/class-cartflows-admin.php:306
60
- msgid "Flows Library"
61
- msgstr ""
62
-
63
- #: classes/class-cartflows-admin.php:313
64
- #: modules/flow/view/meta-flow-steps.php:145
65
- msgid "Ready Templates"
66
- msgstr ""
67
-
68
- #: classes/class-cartflows-admin.php:316
69
- #: modules/flow/view/meta-flow-steps.php:148
70
- msgid "Create Your Own"
71
- msgstr ""
72
-
73
- #: classes/class-cartflows-admin.php:327
74
- #: modules/flow/view/meta-flow-steps.php:160
75
- msgid "Search Sites"
76
- msgstr ""
77
-
78
- #: classes/class-cartflows-admin.php:328
79
- #: modules/flow/view/meta-flow-steps.php:161
80
- msgid "Search Flow..."
81
- msgstr ""
82
-
83
- #: classes/class-cartflows-admin.php:345
84
- msgid "Design Your Flow"
85
- msgstr ""
86
-
87
- #: classes/class-cartflows-admin.php:346
88
- #: modules/flow/view/meta-flow-steps.php:192
89
- msgid "Learn How"
90
- msgstr ""
91
-
92
- #: classes/class-cartflows-api.php:363
93
- msgid "Request successfully processed!"
94
- msgstr ""
95
-
96
- #: classes/class-cartflows-cloning.php:414
97
- msgid "Clone this flow"
98
- msgstr ""
99
-
100
- #: classes/class-cartflows-cloning.php:414
101
- msgid "Clone"
102
- msgstr ""
103
-
104
- #: classes/class-cartflows-flow-frontend.php:52
105
- msgid ""
106
- "Test mode is active — which displays random products for previewing. It can "
107
- "be deactivated from the flow settings in the admin dashboard."
108
- msgstr ""
109
-
110
- #: classes/class-cartflows-importer.php:80
111
- msgid "Export this flow"
112
- msgstr ""
113
-
114
- #: classes/class-cartflows-importer.php:80 includes/exporter.php:18
115
- msgid "Export"
116
- msgstr ""
117
-
118
- #: classes/class-cartflows-importer.php:91
119
- msgid "Flow Export"
120
- msgstr ""
121
-
122
- #: classes/class-cartflows-importer.php:92
123
- msgid "Flow Import"
124
- msgstr ""
125
-
126
- #: classes/class-cartflows-importer.php:103
127
- msgid "No post to export has been supplied!"
128
- msgstr ""
129
-
130
- #: classes/class-cartflows-importer.php:274
131
- msgid "Please upload a valid .json file"
132
- msgstr ""
133
-
134
- #: classes/class-cartflows-importer.php:280
135
- msgid "Please upload a file to import"
136
- msgstr ""
137
-
138
- #: classes/class-cartflows-importer.php:350
139
- msgid "Successfully imported flows."
140
- msgstr ""
141
-
142
- #: classes/class-cartflows-importer.php:382
143
- msgid "Loading Steps"
144
- msgstr ""
145
-
146
- #: classes/class-cartflows-importer.php:384
147
- msgid "Getting steps from the cloud. Please wait for the moment."
148
- msgstr ""
149
-
150
- #: classes/class-cartflows-importer.php:395
151
- msgid "Searching Template.."
152
- msgstr ""
153
-
154
- #: classes/class-cartflows-importer.php:397
155
- msgid "Getting templates from the cloud. Please wait for the moment."
156
- msgstr ""
157
-
158
- #: classes/class-cartflows-importer.php:406
159
- msgid "Importing.."
160
- msgstr ""
161
-
162
- #: classes/class-cartflows-importer.php:415
163
- #: classes/class-cartflows-importer.php:455
164
- msgid "Imported"
165
- msgstr ""
166
-
167
- #: classes/class-cartflows-importer.php:416
168
- #: classes/class-cartflows-importer.php:456
169
- msgid "Thanks for patience"
170
- msgstr ""
171
-
172
- #: classes/class-cartflows-importer.php:425
173
- #: classes/class-cartflows-importer.php:437
174
- msgid "Coming Soon!"
175
- msgstr ""
176
-
177
- #: classes/class-cartflows-importer.php:456
178
- msgid "Redirecting to the Elementor edit window."
179
- msgstr ""
180
-
181
- #: classes/class-cartflows-importer.php:503
182
- #: classes/class-cartflows-importer.php:587
183
- msgid "Pro"
184
- msgstr ""
185
-
186
- #: classes/class-cartflows-importer.php:526
187
- #: classes/class-cartflows-importer.php:613
188
- msgid "Activate License"
189
- msgstr ""
190
-
191
- #: classes/class-cartflows-importer.php:528
192
- #: classes/class-cartflows-importer.php:615
193
- msgid "Get Pro"
194
- msgstr ""
195
-
196
- #: classes/class-cartflows-importer.php:553
197
- msgid "Create"
198
- msgstr ""
199
-
200
- #: classes/class-cartflows-importer.php:632
201
- msgid "Under Maintenance.."
202
- msgstr ""
203
-
204
- #: classes/class-cartflows-importer.php:633
205
- msgid ""
206
- "If you are seeing this message, most likely our servers are under routine "
207
- "maintenance and we will be back shortly."
208
- msgstr ""
209
-
210
- #: classes/class-cartflows-importer.php:634
211
- msgid ""
212
- "In rare case, it is possible your website is having trouble connecting with "
213
- "ours. If you need help, please feel free to get in touch with us from our "
214
- "website.."
215
- msgstr ""
216
-
217
- #: classes/class-cartflows-importer.php:665
218
- msgid "All"
219
- msgstr ""
220
-
221
- #: classes/class-cartflows-importer.php:668
222
- msgid "Select Step Type"
223
- msgstr ""
224
-
225
- #: classes/class-cartflows-importer.php:745
226
- msgid "Import from Cloud"
227
- msgstr ""
228
-
229
- #: classes/class-cartflows-importer.php:1031
230
- #: modules/flow/classes/class-cartflows-flow-meta.php:224
231
- msgid "Landing Page"
232
- msgstr ""
233
-
234
- #: classes/class-cartflows-importer.php:1032
235
- #: modules/flow/classes/class-cartflows-flow-meta.php:225
236
- msgid "Checkout Page"
237
- msgstr ""
238
-
239
- #: classes/class-cartflows-importer.php:1033
240
- #: modules/flow/classes/class-cartflows-flow-meta.php:226
241
- msgid "Thank You Page"
242
- msgstr ""
243
-
244
- #: classes/class-cartflows-importer.php:1138
245
- #. translators: %s: template ID
246
- msgid "Invalid template id %1$s or post id %2$s."
247
- msgstr ""
248
-
249
- #: classes/class-cartflows-importer.php:1180
250
- #. translators: %s: flow ID
251
- msgid "Invalid flow id %1$s OR step type %2$s."
252
- msgstr ""
253
-
254
- #: classes/class-cartflows-importer.php:1301
255
- msgid ""
256
- "Elementor is not activated. Please activate plugin Elementor Page Builder "
257
- "to import the step."
258
- msgstr ""
259
-
260
- #: classes/class-cartflows-importer.php:1419
261
- msgid "Plugin Successfully Activated"
262
- msgstr ""
263
-
264
- #: classes/class-cartflows-loader.php:332
265
- #. translators: %s: html tags
266
- msgid ""
267
- "The %1$sCartFlows%2$s plugin requires %1$sWooCommerce%2$s plugin installed "
268
- "& activated."
269
- msgstr ""
270
-
271
- #: classes/class-cartflows-loader.php:342
272
- msgid "Activate WooCommerce"
273
- msgstr ""
274
-
275
- #: classes/class-cartflows-loader.php:350
276
- msgid "Install WooCommerce"
277
- msgstr ""
278
-
279
- #: classes/class-cartflows-meta-fields.php:83
280
- msgid "Thin 100"
281
- msgstr ""
282
-
283
- #: classes/class-cartflows-meta-fields.php:84
284
- msgid "Extra-Light 200"
285
- msgstr ""
286
-
287
- #: classes/class-cartflows-meta-fields.php:85
288
- msgid "Light 300"
289
- msgstr ""
290
-
291
- #: classes/class-cartflows-meta-fields.php:86
292
- msgid "Normal 400"
293
- msgstr ""
294
-
295
- #: classes/class-cartflows-meta-fields.php:87
296
- msgid "Medium 500"
297
- msgstr ""
298
-
299
- #: classes/class-cartflows-meta-fields.php:88
300
- msgid "Semi-Bold 600"
301
- msgstr ""
302
-
303
- #: classes/class-cartflows-meta-fields.php:89
304
- msgid "Bold 700"
305
- msgstr ""
306
-
307
- #: classes/class-cartflows-meta-fields.php:90
308
- msgid "Extra-Bold 800"
309
- msgstr ""
310
-
311
- #: classes/class-cartflows-meta-fields.php:91
312
- msgid "Ultra-Bold 900"
313
- msgstr ""
314
-
315
- #: classes/class-cartflows-meta-fields.php:214
316
- #: classes/class-cartflows-meta-fields.php:925
317
- msgid "Remove"
318
- msgstr ""
319
-
320
- #: classes/class-cartflows-meta-fields.php:627
321
- #: classes/class-cartflows-meta-fields.php:917
322
- msgid "Search for a product&hellip;"
323
- msgstr ""
324
-
325
- #: classes/class-cartflows-meta-fields.php:668
326
- msgid "Search for a coupon&hellip;"
327
- msgstr ""
328
-
329
- #: classes/class-cartflows-meta.php:34
330
- msgid "Update"
331
- msgstr ""
332
-
333
- #: classes/class-cartflows-meta.php:42
334
- #: modules/flow/classes/class-cartflows-flow-meta.php:84
335
- msgid "Back to edit Flow"
336
- msgstr ""
337
-
338
- #: classes/class-cartflows-wizard.php:45
339
- msgid "Thanks for installing and using CartFlows!"
340
- msgstr ""
341
-
342
- #: classes/class-cartflows-wizard.php:46
343
- msgid ""
344
- "It is easy to use the CartFlows. Please use the setup wizard to quick start "
345
- "setup."
346
- msgstr ""
347
-
348
- #: classes/class-cartflows-wizard.php:71
349
- #: includes/admin/cartflows-general-bck.php:24
350
- msgid "Welcome"
351
- msgstr ""
352
-
353
- #: classes/class-cartflows-wizard.php:76 classes/class-cartflows-wizard.php:259
354
- msgid "Page Builder"
355
- msgstr ""
356
-
357
- #: classes/class-cartflows-wizard.php:81
358
- msgid "Ready!"
359
- msgstr ""
360
-
361
- #: classes/class-cartflows-wizard.php:150
362
- msgid "CartFlows Setup"
363
- msgstr ""
364
-
365
- #: classes/class-cartflows-wizard.php:176
366
- msgid "Exit Setup Wizard"
367
- msgstr ""
368
-
369
- #: classes/class-cartflows-wizard.php:225
370
- msgid "Thank you for choosing CartFlows!"
371
- msgstr ""
372
-
373
- #: classes/class-cartflows-wizard.php:232
374
- msgid "Lets Go »"
375
- msgstr ""
376
-
377
- #: classes/class-cartflows-wizard.php:260
378
- msgid "Select a page builder which you want to use for creating your new flows."
379
- msgstr ""
380
-
381
- #: classes/class-cartflows-wizard.php:265
382
- msgid "Select Page Builder"
383
- msgstr ""
384
-
385
- #: classes/class-cartflows-wizard.php:266
386
- msgid "Add locations for where this Schema should appear."
387
- msgstr ""
388
-
389
- #: classes/class-cartflows-wizard.php:273
390
- #: includes/admin/cartflows-general.php:71
391
- msgid "Elementor"
392
- msgstr ""
393
-
394
- #: classes/class-cartflows-wizard.php:294
395
- msgid "The above plugin will be installed and activated for you!"
396
- msgstr ""
397
-
398
- #: classes/class-cartflows-wizard.php:297
399
- msgid "« Previous"
400
- msgstr ""
401
-
402
- #: classes/class-cartflows-wizard.php:300
403
- #: classes/class-cartflows-wizard.php:301
404
- msgid "Next »"
405
- msgstr ""
406
-
407
- #: classes/class-cartflows-wizard.php:393
408
- msgid "Congratulations!"
409
- msgstr ""
410
-
411
- #: classes/class-cartflows-wizard.php:400
412
- msgid ""
413
- "You've successfully completed the setup before you begin setting now you "
414
- "can use it."
415
- msgstr ""
416
-
417
- #: classes/class-cartflows-wizard.php:414
418
- msgid "Create a flow"
419
- msgstr ""
420
-
421
- #: includes/admin/cartflows-admin.php:19
422
- #: includes/admin/cartflows-general.php:30
423
- msgid "Modernizing WordPress eCommerce!"
424
- msgstr ""
425
-
426
- #: includes/admin/cartflows-admin.php:29
427
- msgid "Settings saved successfully."
428
- msgstr ""
429
-
430
- #: includes/admin/cartflows-general-bck.php:10
431
- msgid "Selec"
432
- msgstr ""
433
-
434
- #: includes/admin/cartflows-general-bck.php:22
435
- msgid "General"
436
- msgstr ""
437
-
438
- #: includes/admin/cartflows-general.php:15
439
- #: includes/admin/cartflows-general.php:38
440
- msgid "General Settings"
441
- msgstr ""
442
-
443
- #: includes/admin/cartflows-general.php:22
444
- msgid "Getting Started"
445
- msgstr ""
446
-
447
- #: includes/admin/cartflows-general.php:50
448
- msgid "Disallow search engines from indexing flows"
449
- msgstr ""
450
-
451
- #: includes/admin/cartflows-general.php:58
452
- #: modules/flow/view/meta-flow-steps.php:87
453
- msgid "Global Checkout"
454
- msgstr ""
455
-
456
- #: includes/admin/cartflows-general.php:67
457
- msgid "Show Templates designed with"
458
- msgstr ""
459
-
460
- #: includes/admin/cartflows-general.php:68
461
- msgid ""
462
- "CartFlows offers flow templates that can be imported in one click. These "
463
- "templates are available in few different page builders. Please choose your "
464
- "preferred page builder from the list so you will only see templates that "
465
- "are made using that page builder.."
466
- msgstr ""
467
-
468
- #: includes/admin/cartflows-general.php:72
469
- msgid "Beaver Builder"
470
- msgstr ""
471
-
472
- #: includes/admin/cartflows-general.php:73
473
- msgid "Other"
474
- msgstr ""
475
-
476
- #: includes/admin/cartflows-general.php:82
477
- msgid "Save Changes"
478
- msgstr ""
479
-
480
- #: includes/admin/cartflows-general.php:93
481
- msgid "Knowledge Base"
482
- msgstr ""
483
-
484
- #: includes/admin/cartflows-general.php:97
485
- msgid "Not sure how something works? Take a peek at the knowledge base and learn."
486
- msgstr ""
487
-
488
- #: includes/admin/cartflows-general.php:100
489
- msgid "Visit Knowledge Base »"
490
- msgstr ""
491
-
492
- #: includes/admin/cartflows-general.php:108
493
- msgid "Community"
494
- msgstr ""
495
-
496
- #: includes/admin/cartflows-general.php:112
497
- msgid ""
498
- "Join the community of super helpful CartFlows users. Say hello, ask "
499
- "questions, give feedback and help each other!"
500
- msgstr ""
501
-
502
- #: includes/admin/cartflows-general.php:115
503
- msgid "Join Our Facebook Group »"
504
- msgstr ""
505
-
506
- #: includes/admin/cartflows-general.php:123
507
- msgid "Five Star Support"
508
- msgstr ""
509
-
510
- #: includes/admin/cartflows-general.php:127
511
- msgid "Got a question? Get in touch with CartFlows developers. We're happy to help!"
512
- msgstr ""
513
-
514
- #: includes/admin/cartflows-general.php:130
515
- msgid "Submit a Ticket »"
516
- msgstr ""
517
-
518
- #: includes/exporter.php:12
519
- msgid "Export Flows to a JSON file"
520
- msgstr ""
521
-
522
- #: includes/exporter.php:13
523
- msgid ""
524
- "This tool allows you to generate and download a JSON file containing a list "
525
- "of all flows."
526
- msgstr ""
527
-
528
- #: includes/importer.php:12
529
- msgid "Import Flows to a JSON file"
530
- msgstr ""
531
-
532
- #: includes/importer.php:13
533
- msgid "This tool allows you to import the flows from the JSON file."
534
- msgstr ""
535
-
536
- #: includes/importer.php:21
537
- msgid "Import"
538
- msgstr ""
539
-
540
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:145
541
- #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:62
542
- msgid ""
543
- "WooCommerce functions not exists. If you are in iframe, please reload the "
544
- "iframe"
545
- msgstr ""
546
-
547
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:161
548
- msgid "Checkout ID not found"
549
- msgstr ""
550
-
551
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:327
552
- msgid "Variations Not set"
553
- msgstr ""
554
-
555
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:336
556
- msgid "This product can't be purcahsed"
557
- msgstr ""
558
-
559
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:920
560
- msgid "Coupon Code"
561
- msgstr ""
562
-
563
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:929
564
- msgid "Apply"
565
- msgstr ""
566
-
567
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:68
568
- msgid "Checkout Layout"
569
- msgstr ""
570
-
571
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:153
572
- #: modules/landing/classes/class-cartflows-landing-meta.php:126
573
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:130
574
- msgid "Shortcodes"
575
- msgstr ""
576
-
577
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:160
578
- msgid "Select Product"
579
- msgstr ""
580
-
581
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:166
582
- msgid "Order Bump"
583
- msgstr ""
584
-
585
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:172
586
- msgid "Checkout Design"
587
- msgstr ""
588
-
589
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:178
590
- msgid "Checkout Fields"
591
- msgstr ""
592
-
593
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:184
594
- msgid "Logo ( Optional )"
595
- msgstr ""
596
-
597
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:239
598
- msgid "Add this shortcode to your checkout page"
599
- msgstr ""
600
-
601
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:291
602
- #. translators: %s: link
603
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature"
604
- msgstr ""
605
-
606
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:319
607
- #. translators: %s: link
608
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature"
609
- msgstr ""
610
-
611
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:347
612
- msgid "One Column (Available in CartFlows Pro) "
613
- msgstr ""
614
-
615
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:353
616
- msgid "Checkout Skin"
617
- msgstr ""
618
-
619
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:357
620
- msgid "One Column"
621
- msgstr ""
622
-
623
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:358
624
- msgid "Two Column"
625
- msgstr ""
626
-
627
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:367
628
- msgid "Primary Color"
629
- msgstr ""
630
-
631
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:376
632
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:411
633
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:457
634
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:549
635
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:197
636
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:220
637
- msgid "Font Family"
638
- msgstr ""
639
-
640
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:384
641
- msgid "Advance Options"
642
- msgstr ""
643
-
644
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:396
645
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:205
646
- msgid "Heading"
647
- msgstr ""
648
-
649
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:402
650
- msgid "Heading Color"
651
- msgstr ""
652
-
653
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:420
654
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:466
655
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:558
656
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:229
657
- msgid "Font Weight"
658
- msgstr ""
659
-
660
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:428
661
- msgid "Input Fields"
662
- msgstr ""
663
-
664
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:436
665
- msgid "Floating Labels (Available in CartFlows Pro)"
666
- msgstr ""
667
-
668
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:442
669
- msgid "Style"
670
- msgstr ""
671
-
672
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:446
673
- msgid "Default"
674
- msgstr ""
675
-
676
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:447
677
- msgid "Floating Labels"
678
- msgstr ""
679
-
680
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:474
681
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:566
682
- msgid "Size"
683
- msgstr ""
684
-
685
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:478
686
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:570
687
- msgid "Extra Small"
688
- msgstr ""
689
-
690
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:479
691
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:571
692
- msgid "Small"
693
- msgstr ""
694
-
695
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:480
696
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:572
697
- msgid "Medium"
698
- msgstr ""
699
-
700
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:481
701
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:573
702
- msgid "Large"
703
- msgstr ""
704
-
705
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:482
706
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:574
707
- msgid "Extra Large"
708
- msgstr ""
709
-
710
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:483
711
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:575
712
- msgid "Custom"
713
- msgstr ""
714
-
715
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:490
716
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:582
717
- msgid "Top Bottom Spacing"
718
- msgstr ""
719
-
720
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:498
721
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:590
722
- msgid "Left Right Spacing"
723
- msgstr ""
724
-
725
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:506
726
- msgid "Text / Placeholder Color"
727
- msgstr ""
728
-
729
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:514
730
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:614
731
- msgid "Background Color"
732
- msgstr ""
733
-
734
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:522
735
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:630
736
- msgid "Border Color"
737
- msgstr ""
738
-
739
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:529
740
- msgid "Label Color"
741
- msgstr ""
742
-
743
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:542
744
- msgid "Buttons"
745
- msgstr ""
746
-
747
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:598
748
- msgid "Text Color"
749
- msgstr ""
750
-
751
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:606
752
- msgid "Text Hover Color"
753
- msgstr ""
754
-
755
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:622
756
- msgid "Background Hover Color"
757
- msgstr ""
758
-
759
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:638
760
- msgid "Border Hover Color"
761
- msgstr ""
762
-
763
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:651
764
- msgid "Sections"
765
- msgstr ""
766
-
767
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:657
768
- msgid "Highlight Area Background Color"
769
- msgstr ""
770
-
771
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:696
772
- msgid "Header Logo"
773
- msgstr ""
774
-
775
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:704
776
- msgid "Logo Width (In px)"
777
- msgstr ""
778
-
779
- #: modules/checkout/templates/embed/checkout-template-simple.php:25
780
- #: modules/checkout/templates/wcf-template.php:36
781
- msgid "Your cart is currently empty."
782
- msgstr ""
783
-
784
- #: modules/checkout/templates/wcf-template.php:46
785
- msgid "Copyright &copy;"
786
- msgstr ""
787
-
788
- #: modules/checkout/templates/wcf-template.php:50
789
- msgid "All Rights Reserved"
790
- msgstr ""
791
-
792
- #: modules/flow/classes/class-cartflows-flow-meta.php:199
793
- #. translators: %s flow id
794
- msgid "Steps not created for flow - %s"
795
- msgstr ""
796
-
797
- #: modules/flow/classes/class-cartflows-flow-meta.php:213
798
- #. translators: %s flow id
799
- msgid "Steps already exists. Flow - %s"
800
- msgstr ""
801
-
802
- #: modules/flow/classes/class-cartflows-flow-meta.php:262
803
- #. translators: %s flow id
804
- msgid "Steps created for flow - %s"
805
- msgstr ""
806
-
807
- #: modules/flow/classes/class-cartflows-flow-meta.php:333
808
- #. translators: %s flow id
809
- msgid "Step not deleted for flow - %s"
810
- msgstr ""
811
-
812
- #: modules/flow/classes/class-cartflows-flow-meta.php:364
813
- #. translators: %s flow id
814
- msgid "Step deleted for flow - %s"
815
- msgstr ""
816
-
817
- #: modules/flow/classes/class-cartflows-flow-meta.php:387
818
- #. translators: %s flow id
819
- msgid "Steps not sorted for flow - %s"
820
- msgstr ""
821
-
822
- #: modules/flow/classes/class-cartflows-flow-meta.php:410
823
- #. translators: %s flow id
824
- msgid "Steps sorted for flow - %s"
825
- msgstr ""
826
-
827
- #: modules/flow/classes/class-cartflows-flow-meta.php:521
828
- msgid "Flow Settings"
829
- msgstr ""
830
-
831
- #: modules/flow/classes/class-cartflows-flow-meta.php:606
832
- msgid "Enable Test Mode"
833
- msgstr ""
834
-
835
- #: modules/flow/classes/class-cartflows-flow-meta.php:613
836
- msgid ""
837
- "Test mode adds random products in your flow, so you can preview it easily "
838
- "while testing."
839
- msgstr ""
840
-
841
- #: modules/flow/classes/class-cartflows-flow-post-type.php:57
842
- msgid "Search Flows"
843
- msgstr ""
844
-
845
- #: modules/flow/classes/class-cartflows-flow-post-type.php:58
846
- msgid "All Flows"
847
- msgstr ""
848
-
849
- #: modules/flow/classes/class-cartflows-flow-post-type.php:59
850
- msgid "Edit Flow"
851
- msgstr ""
852
-
853
- #: modules/flow/classes/class-cartflows-flow-post-type.php:60
854
- msgid "View Flow"
855
- msgstr ""
856
-
857
- #: modules/flow/classes/class-cartflows-flow-post-type.php:61
858
- #: modules/flow/classes/class-cartflows-flow-post-type.php:63
859
- #: modules/flow/classes/class-cartflows-step-post-type.php:144
860
- #: modules/flow/classes/class-cartflows-step-post-type.php:146
861
- msgid "Add New"
862
- msgstr ""
863
-
864
- #: modules/flow/classes/class-cartflows-flow-post-type.php:62
865
- msgid "Update Flow"
866
- msgstr ""
867
-
868
- #: modules/flow/classes/class-cartflows-flow-post-type.php:64
869
- msgid "New Flow Name"
870
- msgstr ""
871
-
872
- #: modules/flow/classes/class-cartflows-flow-post-type.php:123
873
- msgid "View"
874
- msgstr ""
875
-
876
- #: modules/flow/classes/class-cartflows-flow-post-type.php:230
877
- msgid "Flows"
878
- msgstr ""
879
-
880
- #: modules/flow/classes/class-cartflows-flow-post-type.php:252
881
- #: modules/flow/classes/class-cartflows-flow-post-type.php:258
882
- #: modules/flow/classes/class-cartflows-step-post-type.php:377
883
- #: modules/flow/classes/class-cartflows-step-post-type.php:383
884
- #. translators: %s: singular custom post type name
885
- msgid "%s updated."
886
- msgstr ""
887
-
888
- #: modules/flow/classes/class-cartflows-flow-post-type.php:254
889
- #: modules/flow/classes/class-cartflows-step-post-type.php:379
890
- #. translators: %s: singular custom post type name
891
- msgid "Custom %s updated."
892
- msgstr ""
893
-
894
- #: modules/flow/classes/class-cartflows-flow-post-type.php:256
895
- #: modules/flow/classes/class-cartflows-step-post-type.php:381
896
- #. translators: %s: singular custom post type name
897
- msgid "Custom %s deleted."
898
- msgstr ""
899
-
900
- #: modules/flow/classes/class-cartflows-flow-post-type.php:260
901
- #: modules/flow/classes/class-cartflows-step-post-type.php:385
902
- #. translators: %1$s: singular custom post type name ,%2$s: date and time of
903
- #. the revision
904
- msgid "%1$s restored to revision from %2$s"
905
- msgstr ""
906
-
907
- #: modules/flow/classes/class-cartflows-flow-post-type.php:262
908
- #: modules/flow/classes/class-cartflows-step-post-type.php:387
909
- #. translators: %s: singular custom post type name
910
- msgid "%s published."
911
- msgstr ""
912
-
913
- #: modules/flow/classes/class-cartflows-flow-post-type.php:264
914
- #: modules/flow/classes/class-cartflows-step-post-type.php:389
915
- #. translators: %s: singular custom post type name
916
- msgid "%s saved."
917
- msgstr ""
918
-
919
- #: modules/flow/classes/class-cartflows-flow-post-type.php:266
920
- #: modules/flow/classes/class-cartflows-step-post-type.php:391
921
- #. translators: %s: singular custom post type name
922
- msgid "%s submitted."
923
- msgstr ""
924
-
925
- #: modules/flow/classes/class-cartflows-flow-post-type.php:268
926
- #: modules/flow/classes/class-cartflows-step-post-type.php:393
927
- #. translators: %s: singular custom post type name
928
- msgid "%s scheduled for."
929
- msgstr ""
930
-
931
- #: modules/flow/classes/class-cartflows-flow-post-type.php:270
932
- #: modules/flow/classes/class-cartflows-step-post-type.php:395
933
- #. translators: %s: singular custom post type name
934
- msgid "%s draft updated."
935
- msgstr ""
936
-
937
- #: modules/flow/classes/class-cartflows-flow-shortcodes.php:148
938
- #: modules/widgets/class-cartflows-next-step.php:79
939
- msgid "Next Step"
940
- msgstr ""
941
-
942
- #: modules/flow/classes/class-cartflows-step-post-type.php:140
943
- msgid "Search Steps"
944
- msgstr ""
945
-
946
- #: modules/flow/classes/class-cartflows-step-post-type.php:141
947
- msgid "All Steps"
948
- msgstr ""
949
-
950
- #: modules/flow/classes/class-cartflows-step-post-type.php:142
951
- #: modules/flow/view/meta-flow-steps.php:99
952
- msgid "Edit Step"
953
- msgstr ""
954
-
955
- #: modules/flow/classes/class-cartflows-step-post-type.php:143
956
- #: modules/flow/view/meta-flow-steps.php:95
957
- msgid "View Step"
958
- msgstr ""
959
-
960
- #: modules/flow/classes/class-cartflows-step-post-type.php:145
961
- msgid "Update Step"
962
- msgstr ""
963
-
964
- #: modules/flow/classes/class-cartflows-step-post-type.php:147
965
- msgid "New Step Name"
966
- msgstr ""
967
-
968
- #: modules/flow/classes/class-cartflows-step-post-type.php:170
969
- msgid "Step Type"
970
- msgstr ""
971
-
972
- #: modules/flow/classes/class-cartflows-step-post-type.php:179
973
- msgid "Step Flow"
974
- msgstr ""
975
-
976
- #: modules/flow/classes/class-cartflows-step-post-type.php:196
977
- #: modules/flow/view/meta-flow-steps.php:11
978
- msgid "Landing"
979
- msgstr ""
980
-
981
- #: modules/flow/classes/class-cartflows-step-post-type.php:202
982
- #: modules/flow/view/meta-flow-steps.php:12
983
- msgid "Checkout"
984
- msgstr ""
985
-
986
- #: modules/flow/classes/class-cartflows-step-post-type.php:208
987
- #: modules/flow/view/meta-flow-steps.php:13
988
- msgid "Thank You"
989
- msgstr ""
990
-
991
- #: modules/flow/classes/class-cartflows-step-post-type.php:214
992
- #: modules/flow/view/meta-flow-steps.php:14
993
- msgid "Upsell"
994
- msgstr ""
995
-
996
- #: modules/flow/classes/class-cartflows-step-post-type.php:220
997
- #: modules/flow/view/meta-flow-steps.php:15
998
- msgid "Downsell"
999
- msgstr ""
1000
-
1001
- #: modules/flow/view/meta-flow-steps.php:79
1002
- msgid "No Product Assigned"
1003
- msgstr ""
1004
-
1005
- #: modules/flow/view/meta-flow-steps.php:83
1006
- msgid "Global Checkout - Remove selected checkout product"
1007
- msgstr ""
1008
-
1009
- #: modules/flow/view/meta-flow-steps.php:103
1010
- msgid "Clone Step"
1011
- msgstr ""
1012
-
1013
- #: modules/flow/view/meta-flow-steps.php:107
1014
- msgid "Delete Step"
1015
- msgstr ""
1016
-
1017
- #: modules/flow/view/meta-flow-steps.php:122
1018
- msgid "Add New Step"
1019
- msgstr ""
1020
-
1021
- #: modules/flow/view/meta-flow-steps.php:138
1022
- msgid "Steps Library"
1023
- msgstr ""
1024
-
1025
- #: modules/flow/view/meta-flow-steps.php:188
1026
- msgid "Create Step"
1027
- msgstr ""
1028
-
1029
- #: modules/flow/view/meta-flow-steps.php:190
1030
- msgid "You need a Cartflows Pro version to import Upsell / Downsell"
1031
- msgstr ""
1032
-
1033
- #: modules/landing/classes/class-cartflows-landing-meta.php:66
1034
- msgid "Landing Page Settings"
1035
- msgstr ""
1036
-
1037
- #: modules/landing/classes/class-cartflows-landing-meta.php:159
1038
- msgid "Next Step Link"
1039
- msgstr ""
1040
-
1041
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:65
1042
- msgid "Thank You Page Settings"
1043
- msgstr ""
1044
-
1045
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:136
1046
- msgid "Thank You Design"
1047
- msgstr ""
1048
-
1049
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:142
1050
- msgid "Thank You Fields"
1051
- msgstr ""
1052
-
1053
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:170
1054
- msgid "Order Details"
1055
- msgstr ""
1056
-
1057
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:182
1058
- msgid "Text"
1059
- msgstr ""
1060
-
1061
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:188
1062
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:211
1063
- msgid "Color"
1064
- msgstr ""
1065
-
1066
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:237
1067
- msgid "Advanced Options"
1068
- msgstr ""
1069
-
1070
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:247
1071
- msgid "Container Width (In px)"
1072
- msgstr ""
1073
-
1074
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:255
1075
- msgid "Section Background Color"
1076
- msgstr ""
1077
-
1078
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:269
1079
- msgid "Enable Order Overview "
1080
- msgstr ""
1081
-
1082
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:277
1083
- msgid "Enable Order Details "
1084
- msgstr ""
1085
-
1086
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:285
1087
- msgid "Enable Billing Details "
1088
- msgstr ""
1089
-
1090
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:293
1091
- msgid "Enable Shipping Details "
1092
- msgstr ""
1093
-
1094
- #: modules/widgets/class-cartflows-next-step.php:25
1095
- msgid "CartFlows Next Step"
1096
- msgstr ""
1097
-
1098
- #: modules/widgets/class-cartflows-next-step.php:27
1099
- msgid "Next Step Widgets"
1100
- msgstr ""
1101
-
1102
- #: modules/widgets/class-cartflows-next-step.php:107
1103
- msgid "New title"
1104
- msgstr ""
1105
-
1106
- #: modules/widgets/class-cartflows-next-step.php:124
1107
- msgid "Title:"
1108
- msgstr ""
1109
-
1110
- #: modules/widgets/class-cartflows-next-step.php:128
1111
- msgid "Flow ID:"
1112
- msgstr ""
1113
-
1114
- #: modules/widgets/class-cartflows-next-step.php:132
1115
- msgid "Step ID:"
1116
- msgstr ""
1117
-
1118
- #. Plugin Name of the plugin/theme
1119
- msgid "CartFlows"
1120
- msgstr ""
1121
-
1122
- #. Author URI of the plugin/theme
1123
- msgid "https://cartflows.com/"
1124
- msgstr ""
1125
-
1126
- #. Description of the plugin/theme
1127
- msgid "Create beautiful checkout pages & sales flows for WooCommerce."
1128
- msgstr ""
1129
-
1130
- #. Author of the plugin/theme
1131
- msgid "CartFlows Inc"
1132
- msgstr ""
1133
-
1134
- #: modules/flow/classes/class-cartflows-flow-post-type.php:55
1135
- msgctxt "flow general name"
1136
- msgid "Flows"
1137
- msgstr ""
1138
-
1139
- #: modules/flow/classes/class-cartflows-flow-post-type.php:56
1140
- msgctxt "flow singular name"
1141
- msgid "Flow"
1142
- msgstr ""
1143
-
1144
- #: modules/flow/classes/class-cartflows-step-post-type.php:138
1145
- msgctxt "flow step general name"
1146
- msgid "Steps"
1147
- msgstr ""
1148
-
1149
- #: modules/flow/classes/class-cartflows-step-post-type.php:139
1150
- msgctxt "flow step singular name"
1151
- msgid "Step"
1152
- msgstr ""
1153
-
1154
- #: modules/flow/classes/class-cartflows-step-post-type.php:258
1155
- msgctxt "cartflows"
1156
- msgid "Template for Page Builders"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1157
  msgstr ""
1
+ # Copyright (C) 2019 CartFlows Inc
2
+ # This file is distributed under the same license as the CartFlows package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: CartFlows 1.1.6\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
+ "POT-Creation-Date: 2019-02-07 11:56:37+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+ "Language: en\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+ "X-Poedit-Country: United States\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-KeywordsList: "
19
+ "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
20
+ "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
21
+ "X-Poedit-Basepath: ../\n"
22
+ "X-Poedit-SearchPath-0: .\n"
23
+ "X-Poedit-Bookmarks: \n"
24
+ "X-Textdomain-Support: yes\n"
25
+ "X-Generator: grunt-wp-i18n1.0.2\n"
26
+
27
+ #: classes/batch-process/class-cartflows-importer-elementor.php:44
28
+ msgid "Invalid content."
29
+ msgstr ""
30
+
31
+ #: classes/batch-process/class-cartflows-importer-elementor.php:52
32
+ msgid "Invalid content. Expected an array."
33
+ msgstr ""
34
+
35
+ #: classes/batch-process/helpers/class-wp-background-process.php:435
36
+ msgid "Every %d Minutes"
37
+ msgstr ""
38
+
39
+ #: classes/class-cartflows-admin-fields.php:162
40
+ msgid "Select"
41
+ msgstr ""
42
+
43
+ #: classes/class-cartflows-admin-fields.php:165
44
+ msgid "No Checkout Steps"
45
+ msgstr ""
46
+
47
+ #: classes/class-cartflows-admin-fields.php:191
48
+ #. translators: %s: link
49
+ msgid ""
50
+ "Be sure not to add any product in above selected Global Checkout step. "
51
+ "Please read information about how to set up Global Checkout %1$shere%2$s."
52
+ msgstr ""
53
+
54
+ #: classes/class-cartflows-admin.php:109 classes/class-cartflows-admin.php:110
55
+ #: includes/admin/cartflows-general-bck.php:34
56
+ msgid "Settings"
57
+ msgstr ""
58
+
59
+ #: classes/class-cartflows-admin.php:309
60
+ msgid "Flows Library"
61
+ msgstr ""
62
+
63
+ #: classes/class-cartflows-admin.php:316
64
+ #: modules/flow/view/meta-flow-steps.php:145
65
+ msgid "Ready Templates"
66
+ msgstr ""
67
+
68
+ #: classes/class-cartflows-admin.php:319
69
+ #: modules/flow/view/meta-flow-steps.php:148
70
+ msgid "Create Your Own"
71
+ msgstr ""
72
+
73
+ #: classes/class-cartflows-admin.php:330
74
+ #: modules/flow/view/meta-flow-steps.php:160
75
+ msgid "Search Sites"
76
+ msgstr ""
77
+
78
+ #: classes/class-cartflows-admin.php:331
79
+ #: modules/flow/view/meta-flow-steps.php:161
80
+ msgid "Search Flow..."
81
+ msgstr ""
82
+
83
+ #: classes/class-cartflows-admin.php:348
84
+ msgid "Design Your Flow"
85
+ msgstr ""
86
+
87
+ #: classes/class-cartflows-admin.php:349
88
+ #: modules/flow/view/meta-flow-steps.php:192
89
+ msgid "Learn How"
90
+ msgstr ""
91
+
92
+ #: classes/class-cartflows-api.php:363
93
+ msgid "Request successfully processed!"
94
+ msgstr ""
95
+
96
+ #: classes/class-cartflows-cloning.php:414
97
+ msgid "Clone this flow"
98
+ msgstr ""
99
+
100
+ #: classes/class-cartflows-cloning.php:414
101
+ msgid "Clone"
102
+ msgstr ""
103
+
104
+ #: classes/class-cartflows-flow-frontend.php:52
105
+ msgid ""
106
+ "Test mode is active — which displays random products for previewing. It can "
107
+ "be deactivated from the flow settings in the admin dashboard."
108
+ msgstr ""
109
+
110
+ #: classes/class-cartflows-importer.php:80
111
+ msgid "Export this flow"
112
+ msgstr ""
113
+
114
+ #: classes/class-cartflows-importer.php:80 includes/exporter.php:18
115
+ msgid "Export"
116
+ msgstr ""
117
+
118
+ #: classes/class-cartflows-importer.php:91
119
+ msgid "Flow Export"
120
+ msgstr ""
121
+
122
+ #: classes/class-cartflows-importer.php:92
123
+ msgid "Flow Import"
124
+ msgstr ""
125
+
126
+ #: classes/class-cartflows-importer.php:103
127
+ msgid "No post to export has been supplied!"
128
+ msgstr ""
129
+
130
+ #: classes/class-cartflows-importer.php:274
131
+ msgid "Please upload a valid .json file"
132
+ msgstr ""
133
+
134
+ #: classes/class-cartflows-importer.php:280
135
+ msgid "Please upload a file to import"
136
+ msgstr ""
137
+
138
+ #: classes/class-cartflows-importer.php:350
139
+ msgid "Successfully imported flows."
140
+ msgstr ""
141
+
142
+ #: classes/class-cartflows-importer.php:382
143
+ msgid "Loading Steps"
144
+ msgstr ""
145
+
146
+ #: classes/class-cartflows-importer.php:384
147
+ msgid "Getting steps from the cloud. Please wait for the moment."
148
+ msgstr ""
149
+
150
+ #: classes/class-cartflows-importer.php:395
151
+ msgid "Searching Template.."
152
+ msgstr ""
153
+
154
+ #: classes/class-cartflows-importer.php:397
155
+ msgid "Getting templates from the cloud. Please wait for the moment."
156
+ msgstr ""
157
+
158
+ #: classes/class-cartflows-importer.php:406
159
+ msgid "Importing.."
160
+ msgstr ""
161
+
162
+ #: classes/class-cartflows-importer.php:415
163
+ #: classes/class-cartflows-importer.php:455
164
+ msgid "Imported"
165
+ msgstr ""
166
+
167
+ #: classes/class-cartflows-importer.php:416
168
+ #: classes/class-cartflows-importer.php:456
169
+ msgid "Thanks for patience"
170
+ msgstr ""
171
+
172
+ #: classes/class-cartflows-importer.php:425
173
+ #: classes/class-cartflows-importer.php:437
174
+ msgid "Coming Soon!"
175
+ msgstr ""
176
+
177
+ #: classes/class-cartflows-importer.php:456
178
+ msgid "Redirecting to the Elementor edit window."
179
+ msgstr ""
180
+
181
+ #: classes/class-cartflows-importer.php:503
182
+ #: classes/class-cartflows-importer.php:587
183
+ msgid "Pro"
184
+ msgstr ""
185
+
186
+ #: classes/class-cartflows-importer.php:526
187
+ #: classes/class-cartflows-importer.php:613
188
+ msgid "Activate License"
189
+ msgstr ""
190
+
191
+ #: classes/class-cartflows-importer.php:528
192
+ #: classes/class-cartflows-importer.php:615
193
+ msgid "Get Pro"
194
+ msgstr ""
195
+
196
+ #: classes/class-cartflows-importer.php:553
197
+ msgid "Create"
198
+ msgstr ""
199
+
200
+ #: classes/class-cartflows-importer.php:632
201
+ msgid "Under Maintenance.."
202
+ msgstr ""
203
+
204
+ #: classes/class-cartflows-importer.php:633
205
+ msgid ""
206
+ "If you are seeing this message, most likely our servers are under routine "
207
+ "maintenance and we will be back shortly."
208
+ msgstr ""
209
+
210
+ #: classes/class-cartflows-importer.php:634
211
+ msgid ""
212
+ "In rare case, it is possible your website is having trouble connecting with "
213
+ "ours. If you need help, please feel free to get in touch with us from our "
214
+ "website.."
215
+ msgstr ""
216
+
217
+ #: classes/class-cartflows-importer.php:665
218
+ msgid "All"
219
+ msgstr ""
220
+
221
+ #: classes/class-cartflows-importer.php:668
222
+ msgid "Select Step Type"
223
+ msgstr ""
224
+
225
+ #: classes/class-cartflows-importer.php:745
226
+ msgid "Import from Cloud"
227
+ msgstr ""
228
+
229
+ #: classes/class-cartflows-importer.php:1031
230
+ #: modules/flow/classes/class-cartflows-flow-meta.php:224
231
+ msgid "Landing Page"
232
+ msgstr ""
233
+
234
+ #: classes/class-cartflows-importer.php:1032
235
+ #: modules/flow/classes/class-cartflows-flow-meta.php:225
236
+ msgid "Checkout Page"
237
+ msgstr ""
238
+
239
+ #: classes/class-cartflows-importer.php:1033
240
+ #: modules/flow/classes/class-cartflows-flow-meta.php:226
241
+ msgid "Thank You Page"
242
+ msgstr ""
243
+
244
+ #: classes/class-cartflows-importer.php:1138
245
+ #. translators: %s: template ID
246
+ msgid "Invalid template id %1$s or post id %2$s."
247
+ msgstr ""
248
+
249
+ #: classes/class-cartflows-importer.php:1180
250
+ #. translators: %s: flow ID
251
+ msgid "Invalid flow id %1$s OR step type %2$s."
252
+ msgstr ""
253
+
254
+ #: classes/class-cartflows-importer.php:1301
255
+ msgid ""
256
+ "Elementor is not activated. Please activate plugin Elementor Page Builder "
257
+ "to import the step."
258
+ msgstr ""
259
+
260
+ #: classes/class-cartflows-importer.php:1419
261
+ msgid "Plugin Successfully Activated"
262
+ msgstr ""
263
+
264
+ #: classes/class-cartflows-loader.php:332
265
+ #. translators: %s: html tags
266
+ msgid ""
267
+ "The %1$sCartFlows%2$s plugin requires %1$sWooCommerce%2$s plugin installed "
268
+ "& activated."
269
+ msgstr ""
270
+
271
+ #: classes/class-cartflows-loader.php:342
272
+ msgid "Activate WooCommerce"
273
+ msgstr ""
274
+
275
+ #: classes/class-cartflows-loader.php:350
276
+ msgid "Install WooCommerce"
277
+ msgstr ""
278
+
279
+ #: classes/class-cartflows-meta-fields.php:86
280
+ msgid "Thin 100"
281
+ msgstr ""
282
+
283
+ #: classes/class-cartflows-meta-fields.php:87
284
+ msgid "Extra-Light 200"
285
+ msgstr ""
286
+
287
+ #: classes/class-cartflows-meta-fields.php:88
288
+ msgid "Light 300"
289
+ msgstr ""
290
+
291
+ #: classes/class-cartflows-meta-fields.php:89
292
+ msgid "Normal 400"
293
+ msgstr ""
294
+
295
+ #: classes/class-cartflows-meta-fields.php:90
296
+ msgid "Medium 500"
297
+ msgstr ""
298
+
299
+ #: classes/class-cartflows-meta-fields.php:91
300
+ msgid "Semi-Bold 600"
301
+ msgstr ""
302
+
303
+ #: classes/class-cartflows-meta-fields.php:92
304
+ msgid "Bold 700"
305
+ msgstr ""
306
+
307
+ #: classes/class-cartflows-meta-fields.php:93
308
+ msgid "Extra-Bold 800"
309
+ msgstr ""
310
+
311
+ #: classes/class-cartflows-meta-fields.php:94
312
+ msgid "Ultra-Bold 900"
313
+ msgstr ""
314
+
315
+ #: classes/class-cartflows-meta-fields.php:217
316
+ #: classes/class-cartflows-meta-fields.php:325
317
+ #: classes/class-cartflows-meta-fields.php:1417
318
+ msgid "Remove"
319
+ msgstr ""
320
+
321
+ #: classes/class-cartflows-meta-fields.php:446
322
+ msgid "Field Width"
323
+ msgstr ""
324
+
325
+ #: classes/class-cartflows-meta-fields.php:450
326
+ msgid "33%"
327
+ msgstr ""
328
+
329
+ #: classes/class-cartflows-meta-fields.php:451
330
+ msgid "50%"
331
+ msgstr ""
332
+
333
+ #: classes/class-cartflows-meta-fields.php:452
334
+ msgid "100%"
335
+ msgstr ""
336
+
337
+ #: classes/class-cartflows-meta-fields.php:463
338
+ msgid "Field Label"
339
+ msgstr ""
340
+
341
+ #: classes/class-cartflows-meta-fields.php:477
342
+ msgid "Options"
343
+ msgstr ""
344
+
345
+ #: classes/class-cartflows-meta-fields.php:492
346
+ #: classes/class-cartflows-meta-fields.php:505
347
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:446
348
+ msgid "Default"
349
+ msgstr ""
350
+
351
+ #: classes/class-cartflows-meta-fields.php:496
352
+ msgid "Checked"
353
+ msgstr ""
354
+
355
+ #: classes/class-cartflows-meta-fields.php:497
356
+ msgid "Un-Checked"
357
+ msgstr ""
358
+
359
+ #: classes/class-cartflows-meta-fields.php:518
360
+ msgid "Placeholder"
361
+ msgstr ""
362
+
363
+ #: classes/class-cartflows-meta-fields.php:530
364
+ msgid "Required"
365
+ msgstr ""
366
+
367
+ #: classes/class-cartflows-meta-fields.php:542
368
+ msgid "Enable this field"
369
+ msgstr ""
370
+
371
+ #: classes/class-cartflows-meta-fields.php:562
372
+ msgid "Label"
373
+ msgstr ""
374
+
375
+ #: classes/class-cartflows-meta-fields.php:990
376
+ #: classes/class-cartflows-meta-fields.php:1409
377
+ msgid "Search for a product&hellip;"
378
+ msgstr ""
379
+
380
+ #: classes/class-cartflows-meta-fields.php:1031
381
+ msgid "Search for a coupon&hellip;"
382
+ msgstr ""
383
+
384
+ #: classes/class-cartflows-meta.php:34
385
+ msgid "Update"
386
+ msgstr ""
387
+
388
+ #: classes/class-cartflows-meta.php:42
389
+ #: modules/flow/classes/class-cartflows-flow-meta.php:84
390
+ msgid "Back to edit Flow"
391
+ msgstr ""
392
+
393
+ #: classes/class-cartflows-wizard.php:45
394
+ msgid "Thanks for installing and using CartFlows!"
395
+ msgstr ""
396
+
397
+ #: classes/class-cartflows-wizard.php:46
398
+ msgid ""
399
+ "It is easy to use the CartFlows. Please use the setup wizard to quick start "
400
+ "setup."
401
+ msgstr ""
402
+
403
+ #: classes/class-cartflows-wizard.php:71
404
+ #: includes/admin/cartflows-general-bck.php:24
405
+ msgid "Welcome"
406
+ msgstr ""
407
+
408
+ #: classes/class-cartflows-wizard.php:76 classes/class-cartflows-wizard.php:259
409
+ msgid "Page Builder"
410
+ msgstr ""
411
+
412
+ #: classes/class-cartflows-wizard.php:81
413
+ msgid "Ready!"
414
+ msgstr ""
415
+
416
+ #: classes/class-cartflows-wizard.php:150
417
+ msgid "CartFlows Setup"
418
+ msgstr ""
419
+
420
+ #: classes/class-cartflows-wizard.php:176
421
+ msgid "Exit Setup Wizard"
422
+ msgstr ""
423
+
424
+ #: classes/class-cartflows-wizard.php:225
425
+ msgid "Thank you for choosing CartFlows!"
426
+ msgstr ""
427
+
428
+ #: classes/class-cartflows-wizard.php:232
429
+ msgid "Lets Go »"
430
+ msgstr ""
431
+
432
+ #: classes/class-cartflows-wizard.php:260
433
+ msgid "Select a page builder which you want to use for creating your new flows."
434
+ msgstr ""
435
+
436
+ #: classes/class-cartflows-wizard.php:265
437
+ msgid "Select Page Builder"
438
+ msgstr ""
439
+
440
+ #: classes/class-cartflows-wizard.php:266
441
+ msgid "Add locations for where this Schema should appear."
442
+ msgstr ""
443
+
444
+ #: classes/class-cartflows-wizard.php:273
445
+ #: includes/admin/cartflows-general.php:71
446
+ msgid "Elementor"
447
+ msgstr ""
448
+
449
+ #: classes/class-cartflows-wizard.php:294
450
+ msgid "The above plugin will be installed and activated for you!"
451
+ msgstr ""
452
+
453
+ #: classes/class-cartflows-wizard.php:297
454
+ msgid "« Previous"
455
+ msgstr ""
456
+
457
+ #: classes/class-cartflows-wizard.php:300
458
+ #: classes/class-cartflows-wizard.php:301
459
+ msgid "Next »"
460
+ msgstr ""
461
+
462
+ #: classes/class-cartflows-wizard.php:393
463
+ msgid "Congratulations!"
464
+ msgstr ""
465
+
466
+ #: classes/class-cartflows-wizard.php:400
467
+ msgid ""
468
+ "You've successfully completed the setup before you begin setting now you "
469
+ "can use it."
470
+ msgstr ""
471
+
472
+ #: classes/class-cartflows-wizard.php:414
473
+ msgid "Create a flow"
474
+ msgstr ""
475
+
476
+ #: includes/admin/cartflows-admin.php:19
477
+ #: includes/admin/cartflows-general.php:30
478
+ msgid "Modernizing WordPress eCommerce!"
479
+ msgstr ""
480
+
481
+ #: includes/admin/cartflows-admin.php:29
482
+ msgid "Settings saved successfully."
483
+ msgstr ""
484
+
485
+ #: includes/admin/cartflows-general-bck.php:10
486
+ msgid "Selec"
487
+ msgstr ""
488
+
489
+ #: includes/admin/cartflows-general-bck.php:22
490
+ msgid "General"
491
+ msgstr ""
492
+
493
+ #: includes/admin/cartflows-general.php:15
494
+ #: includes/admin/cartflows-general.php:38
495
+ msgid "General Settings"
496
+ msgstr ""
497
+
498
+ #: includes/admin/cartflows-general.php:22
499
+ msgid "Getting Started"
500
+ msgstr ""
501
+
502
+ #: includes/admin/cartflows-general.php:50
503
+ msgid "Disallow search engines from indexing flows"
504
+ msgstr ""
505
+
506
+ #: includes/admin/cartflows-general.php:58
507
+ #: modules/flow/view/meta-flow-steps.php:87
508
+ msgid "Global Checkout"
509
+ msgstr ""
510
+
511
+ #: includes/admin/cartflows-general.php:67
512
+ msgid "Show Templates designed with"
513
+ msgstr ""
514
+
515
+ #: includes/admin/cartflows-general.php:68
516
+ msgid ""
517
+ "CartFlows offers flow templates that can be imported in one click. These "
518
+ "templates are available in few different page builders. Please choose your "
519
+ "preferred page builder from the list so you will only see templates that "
520
+ "are made using that page builder.."
521
+ msgstr ""
522
+
523
+ #: includes/admin/cartflows-general.php:72
524
+ msgid "Beaver Builder"
525
+ msgstr ""
526
+
527
+ #: includes/admin/cartflows-general.php:73
528
+ msgid "Other"
529
+ msgstr ""
530
+
531
+ #: includes/admin/cartflows-general.php:82
532
+ msgid "Save Changes"
533
+ msgstr ""
534
+
535
+ #: includes/admin/cartflows-general.php:93
536
+ msgid "Knowledge Base"
537
+ msgstr ""
538
+
539
+ #: includes/admin/cartflows-general.php:97
540
+ msgid "Not sure how something works? Take a peek at the knowledge base and learn."
541
+ msgstr ""
542
+
543
+ #: includes/admin/cartflows-general.php:100
544
+ msgid "Visit Knowledge Base »"
545
+ msgstr ""
546
+
547
+ #: includes/admin/cartflows-general.php:108
548
+ msgid "Community"
549
+ msgstr ""
550
+
551
+ #: includes/admin/cartflows-general.php:112
552
+ msgid ""
553
+ "Join the community of super helpful CartFlows users. Say hello, ask "
554
+ "questions, give feedback and help each other!"
555
+ msgstr ""
556
+
557
+ #: includes/admin/cartflows-general.php:115
558
+ msgid "Join Our Facebook Group »"
559
+ msgstr ""
560
+
561
+ #: includes/admin/cartflows-general.php:123
562
+ msgid "Five Star Support"
563
+ msgstr ""
564
+
565
+ #: includes/admin/cartflows-general.php:127
566
+ msgid "Got a question? Get in touch with CartFlows developers. We're happy to help!"
567
+ msgstr ""
568
+
569
+ #: includes/admin/cartflows-general.php:130
570
+ msgid "Submit a Ticket »"
571
+ msgstr ""
572
+
573
+ #: includes/exporter.php:12
574
+ msgid "Export Flows to a JSON file"
575
+ msgstr ""
576
+
577
+ #: includes/exporter.php:13
578
+ msgid ""
579
+ "This tool allows you to generate and download a JSON file containing a list "
580
+ "of all flows."
581
+ msgstr ""
582
+
583
+ #: includes/importer.php:12
584
+ msgid "Import Flows to a JSON file"
585
+ msgstr ""
586
+
587
+ #: includes/importer.php:13
588
+ msgid "This tool allows you to import the flows from the JSON file."
589
+ msgstr ""
590
+
591
+ #: includes/importer.php:21
592
+ msgid "Import"
593
+ msgstr ""
594
+
595
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:157
596
+ #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:62
597
+ msgid ""
598
+ "WooCommerce functions not exists. If you are in iframe, please reload the "
599
+ "iframe"
600
+ msgstr ""
601
+
602
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:173
603
+ msgid "Checkout ID not found"
604
+ msgstr ""
605
+
606
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:339
607
+ msgid "Variations Not set"
608
+ msgstr ""
609
+
610
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:348
611
+ msgid "This product can't be purcahsed"
612
+ msgstr ""
613
+
614
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:964
615
+ msgid "Coupon Code"
616
+ msgstr ""
617
+
618
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:973
619
+ msgid "Apply"
620
+ msgstr ""
621
+
622
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:68
623
+ msgid "Checkout Layout"
624
+ msgstr ""
625
+
626
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:153
627
+ #: modules/landing/classes/class-cartflows-landing-meta.php:126
628
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:130
629
+ msgid "Shortcodes"
630
+ msgstr ""
631
+
632
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:160
633
+ msgid "Select Product"
634
+ msgstr ""
635
+
636
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:166
637
+ msgid "Order Bump"
638
+ msgstr ""
639
+
640
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:172
641
+ msgid "Checkout Design"
642
+ msgstr ""
643
+
644
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:178
645
+ msgid "Checkout Fields"
646
+ msgstr ""
647
+
648
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:184
649
+ msgid "Logo ( Optional )"
650
+ msgstr ""
651
+
652
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:239
653
+ msgid "Add this shortcode to your checkout page"
654
+ msgstr ""
655
+
656
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:291
657
+ #. translators: %s: link
658
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature"
659
+ msgstr ""
660
+
661
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:319
662
+ #. translators: %s: link
663
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature"
664
+ msgstr ""
665
+
666
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:347
667
+ msgid "One Column (Available in CartFlows Pro) "
668
+ msgstr ""
669
+
670
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:353
671
+ msgid "Checkout Skin"
672
+ msgstr ""
673
+
674
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:357
675
+ msgid "One Column"
676
+ msgstr ""
677
+
678
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:358
679
+ msgid "Two Column"
680
+ msgstr ""
681
+
682
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:367
683
+ msgid "Primary Color"
684
+ msgstr ""
685
+
686
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:376
687
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:411
688
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:457
689
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:549
690
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:197
691
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:220
692
+ msgid "Font Family"
693
+ msgstr ""
694
+
695
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:384
696
+ msgid "Advance Options"
697
+ msgstr ""
698
+
699
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:396
700
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:205
701
+ msgid "Heading"
702
+ msgstr ""
703
+
704
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:402
705
+ msgid "Heading Color"
706
+ msgstr ""
707
+
708
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:420
709
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:466
710
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:558
711
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:229
712
+ msgid "Font Weight"
713
+ msgstr ""
714
+
715
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:428
716
+ msgid "Input Fields"
717
+ msgstr ""
718
+
719
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:436
720
+ msgid "Floating Labels (Available in CartFlows Pro)"
721
+ msgstr ""
722
+
723
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:442
724
+ msgid "Style"
725
+ msgstr ""
726
+
727
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:447
728
+ msgid "Floating Labels"
729
+ msgstr ""
730
+
731
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:474
732
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:566
733
+ msgid "Size"
734
+ msgstr ""
735
+
736
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:478
737
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:570
738
+ msgid "Extra Small"
739
+ msgstr ""
740
+
741
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:479
742
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:571
743
+ msgid "Small"
744
+ msgstr ""
745
+
746
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:480
747
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:572
748
+ msgid "Medium"
749
+ msgstr ""
750
+
751
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:481
752
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:573
753
+ msgid "Large"
754
+ msgstr ""
755
+
756
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:482
757
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:574
758
+ msgid "Extra Large"
759
+ msgstr ""
760
+
761
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:483
762
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:575
763
+ msgid "Custom"
764
+ msgstr ""
765
+
766
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:490
767
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:582
768
+ msgid "Top Bottom Spacing"
769
+ msgstr ""
770
+
771
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:498
772
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:590
773
+ msgid "Left Right Spacing"
774
+ msgstr ""
775
+
776
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:506
777
+ msgid "Text / Placeholder Color"
778
+ msgstr ""
779
+
780
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:514
781
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:614
782
+ msgid "Background Color"
783
+ msgstr ""
784
+
785
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:522
786
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:630
787
+ msgid "Border Color"
788
+ msgstr ""
789
+
790
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:529
791
+ msgid "Label Color"
792
+ msgstr ""
793
+
794
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:542
795
+ msgid "Buttons"
796
+ msgstr ""
797
+
798
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:598
799
+ msgid "Text Color"
800
+ msgstr ""
801
+
802
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:606
803
+ msgid "Text Hover Color"
804
+ msgstr ""
805
+
806
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:622
807
+ msgid "Background Hover Color"
808
+ msgstr ""
809
+
810
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:638
811
+ msgid "Border Hover Color"
812
+ msgstr ""
813
+
814
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:651
815
+ msgid "Sections"
816
+ msgstr ""
817
+
818
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:657
819
+ msgid "Highlight Area Background Color"
820
+ msgstr ""
821
+
822
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:696
823
+ msgid "Header Logo"
824
+ msgstr ""
825
+
826
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:704
827
+ msgid "Logo Width (In px)"
828
+ msgstr ""
829
+
830
+ #: modules/checkout/templates/embed/checkout-template-simple.php:25
831
+ #: modules/checkout/templates/wcf-template.php:36
832
+ msgid "Your cart is currently empty."
833
+ msgstr ""
834
+
835
+ #: modules/checkout/templates/wcf-template.php:46
836
+ msgid "Copyright &copy;"
837
+ msgstr ""
838
+
839
+ #: modules/checkout/templates/wcf-template.php:50
840
+ msgid "All Rights Reserved"
841
+ msgstr ""
842
+
843
+ #: modules/flow/classes/class-cartflows-flow-meta.php:199
844
+ #. translators: %s flow id
845
+ msgid "Steps not created for flow - %s"
846
+ msgstr ""
847
+
848
+ #: modules/flow/classes/class-cartflows-flow-meta.php:213
849
+ #. translators: %s flow id
850
+ msgid "Steps already exists. Flow - %s"
851
+ msgstr ""
852
+
853
+ #: modules/flow/classes/class-cartflows-flow-meta.php:262
854
+ #. translators: %s flow id
855
+ msgid "Steps created for flow - %s"
856
+ msgstr ""
857
+
858
+ #: modules/flow/classes/class-cartflows-flow-meta.php:333
859
+ #. translators: %s flow id
860
+ msgid "Step not deleted for flow - %s"
861
+ msgstr ""
862
+
863
+ #: modules/flow/classes/class-cartflows-flow-meta.php:364
864
+ #. translators: %s flow id
865
+ msgid "Step deleted for flow - %s"
866
+ msgstr ""
867
+
868
+ #: modules/flow/classes/class-cartflows-flow-meta.php:387
869
+ #. translators: %s flow id
870
+ msgid "Steps not sorted for flow - %s"
871
+ msgstr ""
872
+
873
+ #: modules/flow/classes/class-cartflows-flow-meta.php:410
874
+ #. translators: %s flow id
875
+ msgid "Steps sorted for flow - %s"
876
+ msgstr ""
877
+
878
+ #: modules/flow/classes/class-cartflows-flow-meta.php:521
879
+ msgid "Flow Settings"
880
+ msgstr ""
881
+
882
+ #: modules/flow/classes/class-cartflows-flow-meta.php:606
883
+ msgid "Enable Test Mode"
884
+ msgstr ""
885
+
886
+ #: modules/flow/classes/class-cartflows-flow-meta.php:613
887
+ msgid ""
888
+ "Test mode adds random products in your flow, so you can preview it easily "
889
+ "while testing."
890
+ msgstr ""
891
+
892
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:57
893
+ msgid "Search Flows"
894
+ msgstr ""
895
+
896
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:58
897
+ msgid "All Flows"
898
+ msgstr ""
899
+
900
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:59
901
+ msgid "Edit Flow"
902
+ msgstr ""
903
+
904
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:60
905
+ msgid "View Flow"
906
+ msgstr ""
907
+
908
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:61
909
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:63
910
+ #: modules/flow/classes/class-cartflows-step-post-type.php:144
911
+ #: modules/flow/classes/class-cartflows-step-post-type.php:146
912
+ msgid "Add New"
913
+ msgstr ""
914
+
915
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:62
916
+ msgid "Update Flow"
917
+ msgstr ""
918
+
919
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:64
920
+ msgid "New Flow Name"
921
+ msgstr ""
922
+
923
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:123
924
+ msgid "View"
925
+ msgstr ""
926
+
927
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:230
928
+ msgid "Flows"
929
+ msgstr ""
930
+
931
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:252
932
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:258
933
+ #: modules/flow/classes/class-cartflows-step-post-type.php:392
934
+ #: modules/flow/classes/class-cartflows-step-post-type.php:398
935
+ #. translators: %s: singular custom post type name
936
+ msgid "%s updated."
937
+ msgstr ""
938
+
939
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:254
940
+ #: modules/flow/classes/class-cartflows-step-post-type.php:394
941
+ #. translators: %s: singular custom post type name
942
+ msgid "Custom %s updated."
943
+ msgstr ""
944
+
945
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:256
946
+ #: modules/flow/classes/class-cartflows-step-post-type.php:396
947
+ #. translators: %s: singular custom post type name
948
+ msgid "Custom %s deleted."
949
+ msgstr ""
950
+
951
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:260
952
+ #: modules/flow/classes/class-cartflows-step-post-type.php:400
953
+ #. translators: %1$s: singular custom post type name ,%2$s: date and time of
954
+ #. the revision
955
+ msgid "%1$s restored to revision from %2$s"
956
+ msgstr ""
957
+
958
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:262
959
+ #: modules/flow/classes/class-cartflows-step-post-type.php:402
960
+ #. translators: %s: singular custom post type name
961
+ msgid "%s published."
962
+ msgstr ""
963
+
964
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:264
965
+ #: modules/flow/classes/class-cartflows-step-post-type.php:404
966
+ #. translators: %s: singular custom post type name
967
+ msgid "%s saved."
968
+ msgstr ""
969
+
970
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:266
971
+ #: modules/flow/classes/class-cartflows-step-post-type.php:406
972
+ #. translators: %s: singular custom post type name
973
+ msgid "%s submitted."
974
+ msgstr ""
975
+
976
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:268
977
+ #: modules/flow/classes/class-cartflows-step-post-type.php:408
978
+ #. translators: %s: singular custom post type name
979
+ msgid "%s scheduled for."
980
+ msgstr ""
981
+
982
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:270
983
+ #: modules/flow/classes/class-cartflows-step-post-type.php:410
984
+ #. translators: %s: singular custom post type name
985
+ msgid "%s draft updated."
986
+ msgstr ""
987
+
988
+ #: modules/flow/classes/class-cartflows-flow-shortcodes.php:148
989
+ #: modules/widgets/class-cartflows-next-step.php:79
990
+ msgid "Next Step"
991
+ msgstr ""
992
+
993
+ #: modules/flow/classes/class-cartflows-step-post-type.php:140
994
+ msgid "Search Steps"
995
+ msgstr ""
996
+
997
+ #: modules/flow/classes/class-cartflows-step-post-type.php:141
998
+ msgid "All Steps"
999
+ msgstr ""
1000
+
1001
+ #: modules/flow/classes/class-cartflows-step-post-type.php:142
1002
+ #: modules/flow/view/meta-flow-steps.php:99
1003
+ msgid "Edit Step"
1004
+ msgstr ""
1005
+
1006
+ #: modules/flow/classes/class-cartflows-step-post-type.php:143
1007
+ #: modules/flow/view/meta-flow-steps.php:95
1008
+ msgid "View Step"
1009
+ msgstr ""
1010
+
1011
+ #: modules/flow/classes/class-cartflows-step-post-type.php:145
1012
+ msgid "Update Step"
1013
+ msgstr ""
1014
+
1015
+ #: modules/flow/classes/class-cartflows-step-post-type.php:147
1016
+ msgid "New Step Name"
1017
+ msgstr ""
1018
+
1019
+ #: modules/flow/classes/class-cartflows-step-post-type.php:170
1020
+ msgid "Step Type"
1021
+ msgstr ""
1022
+
1023
+ #: modules/flow/classes/class-cartflows-step-post-type.php:179
1024
+ msgid "Step Flow"
1025
+ msgstr ""
1026
+
1027
+ #: modules/flow/classes/class-cartflows-step-post-type.php:196
1028
+ #: modules/flow/view/meta-flow-steps.php:11
1029
+ msgid "Landing"
1030
+ msgstr ""
1031
+
1032
+ #: modules/flow/classes/class-cartflows-step-post-type.php:202
1033
+ #: modules/flow/view/meta-flow-steps.php:12
1034
+ msgid "Checkout"
1035
+ msgstr ""
1036
+
1037
+ #: modules/flow/classes/class-cartflows-step-post-type.php:208
1038
+ #: modules/flow/view/meta-flow-steps.php:13
1039
+ msgid "Thank You"
1040
+ msgstr ""
1041
+
1042
+ #: modules/flow/classes/class-cartflows-step-post-type.php:214
1043
+ #: modules/flow/view/meta-flow-steps.php:14
1044
+ msgid "Upsell"
1045
+ msgstr ""
1046
+
1047
+ #: modules/flow/classes/class-cartflows-step-post-type.php:220
1048
+ #: modules/flow/view/meta-flow-steps.php:15
1049
+ msgid "Downsell"
1050
+ msgstr ""
1051
+
1052
+ #: modules/flow/view/meta-flow-steps.php:79
1053
+ msgid "No Product Assigned"
1054
+ msgstr ""
1055
+
1056
+ #: modules/flow/view/meta-flow-steps.php:83
1057
+ msgid "Global Checkout - Remove selected checkout product"
1058
+ msgstr ""
1059
+
1060
+ #: modules/flow/view/meta-flow-steps.php:103
1061
+ msgid "Clone Step"
1062
+ msgstr ""
1063
+
1064
+ #: modules/flow/view/meta-flow-steps.php:107
1065
+ msgid "Delete Step"
1066
+ msgstr ""
1067
+
1068
+ #: modules/flow/view/meta-flow-steps.php:122
1069
+ msgid "Add New Step"
1070
+ msgstr ""
1071
+
1072
+ #: modules/flow/view/meta-flow-steps.php:138
1073
+ msgid "Steps Library"
1074
+ msgstr ""
1075
+
1076
+ #: modules/flow/view/meta-flow-steps.php:188
1077
+ msgid "Create Step"
1078
+ msgstr ""
1079
+
1080
+ #: modules/flow/view/meta-flow-steps.php:190
1081
+ msgid "You need a Cartflows Pro version to import Upsell / Downsell"
1082
+ msgstr ""
1083
+
1084
+ #: modules/landing/classes/class-cartflows-landing-meta.php:66
1085
+ msgid "Landing Page Settings"
1086
+ msgstr ""
1087
+
1088
+ #: modules/landing/classes/class-cartflows-landing-meta.php:159
1089
+ msgid "Next Step Link"
1090
+ msgstr ""
1091
+
1092
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:65
1093
+ msgid "Thank You Page Settings"
1094
+ msgstr ""
1095
+
1096
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:136
1097
+ msgid "Thank You Design"
1098
+ msgstr ""
1099
+
1100
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:142
1101
+ msgid "Thank You Fields"
1102
+ msgstr ""
1103
+
1104
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:170
1105
+ msgid "Order Details"
1106
+ msgstr ""
1107
+
1108
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:182
1109
+ msgid "Text"
1110
+ msgstr ""
1111
+
1112
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:188
1113
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:211
1114
+ msgid "Color"
1115
+ msgstr ""
1116
+
1117
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:237
1118
+ msgid "Advanced Options"
1119
+ msgstr ""
1120
+
1121
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:247
1122
+ msgid "Container Width (In px)"
1123
+ msgstr ""
1124
+
1125
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:255
1126
+ msgid "Section Background Color"
1127
+ msgstr ""
1128
+
1129
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:269
1130
+ msgid "Enable Order Overview "
1131
+ msgstr ""
1132
+
1133
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:277
1134
+ msgid "Enable Order Details "
1135
+ msgstr ""
1136
+
1137
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:285
1138
+ msgid "Enable Billing Details "
1139
+ msgstr ""
1140
+
1141
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:293
1142
+ msgid "Enable Shipping Details "
1143
+ msgstr ""
1144
+
1145
+ #: modules/widgets/class-cartflows-next-step.php:25
1146
+ msgid "CartFlows Next Step"
1147
+ msgstr ""
1148
+
1149
+ #: modules/widgets/class-cartflows-next-step.php:27
1150
+ msgid "Next Step Widgets"
1151
+ msgstr ""
1152
+
1153
+ #: modules/widgets/class-cartflows-next-step.php:107
1154
+ msgid "New title"
1155
+ msgstr ""
1156
+
1157
+ #: modules/widgets/class-cartflows-next-step.php:124
1158
+ msgid "Title:"
1159
+ msgstr ""
1160
+
1161
+ #: modules/widgets/class-cartflows-next-step.php:128
1162
+ msgid "Flow ID:"
1163
+ msgstr ""
1164
+
1165
+ #: modules/widgets/class-cartflows-next-step.php:132
1166
+ msgid "Step ID:"
1167
+ msgstr ""
1168
+
1169
+ #: woocommerce/template/cart/cart-shipping.php:51
1170
+ #. Translators: $s shipping destination.
1171
+ msgid "Estimate for %s."
1172
+ msgstr ""
1173
+
1174
+ #: woocommerce/template/cart/cart-shipping.php:52
1175
+ msgid "Change address"
1176
+ msgstr ""
1177
+
1178
+ #: woocommerce/template/cart/cart-shipping.php:54
1179
+ msgid "This is only an estimate. Prices will be updated during checkout."
1180
+ msgstr ""
1181
+
1182
+ #: woocommerce/template/cart/cart-shipping.php:61
1183
+ msgid "Enter your address to view shipping options."
1184
+ msgstr ""
1185
+
1186
+ #: woocommerce/template/cart/cart-shipping.php:63
1187
+ msgid ""
1188
+ "There are no shipping methods available. Please ensure that your address "
1189
+ "has been entered correctly, or contact us if you need any help."
1190
+ msgstr ""
1191
+
1192
+ #: woocommerce/template/cart/cart-shipping.php:66
1193
+ #. Translators: $s shipping destination.
1194
+ msgid "No shipping options were found for %s."
1195
+ msgstr ""
1196
+
1197
+ #: woocommerce/template/cart/cart-shipping.php:67
1198
+ msgid "Enter a different address"
1199
+ msgstr ""
1200
+
1201
+ #: woocommerce/template/checkout/form-billing.php:27
1202
+ msgid "Billing &amp; Shipping"
1203
+ msgstr ""
1204
+
1205
+ #: woocommerce/template/checkout/form-billing.php:31
1206
+ msgid "Billing details"
1207
+ msgstr ""
1208
+
1209
+ #: woocommerce/template/checkout/form-billing.php:59
1210
+ msgid "Create an account?"
1211
+ msgstr ""
1212
+
1213
+ #: woocommerce/template/checkout/form-checkout.php:26
1214
+ msgid "You must be logged in to checkout."
1215
+ msgstr ""
1216
+
1217
+ #: woocommerce/template/checkout/form-checkout.php:52
1218
+ msgid "Your order"
1219
+ msgstr ""
1220
+
1221
+ #: woocommerce/template/checkout/form-coupon.php:26
1222
+ msgid "Have a coupon?"
1223
+ msgstr ""
1224
+
1225
+ #: woocommerce/template/checkout/form-coupon.php:26
1226
+ msgid "Click here to enter your code"
1227
+ msgstr ""
1228
+
1229
+ #: woocommerce/template/checkout/form-coupon.php:31
1230
+ msgid "If you have a coupon code, please apply it below."
1231
+ msgstr ""
1232
+
1233
+ #: woocommerce/template/checkout/form-coupon.php:34
1234
+ msgid "Coupon code"
1235
+ msgstr ""
1236
+
1237
+ #: woocommerce/template/checkout/form-coupon.php:38
1238
+ msgid "Apply coupon"
1239
+ msgstr ""
1240
+
1241
+ #: woocommerce/template/checkout/form-login.php:26
1242
+ msgid "Returning customer?"
1243
+ msgstr ""
1244
+
1245
+ #: woocommerce/template/checkout/form-login.php:26
1246
+ msgid "Click here to login"
1247
+ msgstr ""
1248
+
1249
+ #: woocommerce/template/checkout/form-login.php:32
1250
+ msgid ""
1251
+ "If you have shopped with us before, please enter your details below. If you "
1252
+ "are a new customer, please proceed to the Billing &amp; Shipping section."
1253
+ msgstr ""
1254
+
1255
+ #: woocommerce/template/checkout/review-order.php:26
1256
+ msgid "Product"
1257
+ msgstr ""
1258
+
1259
+ #: woocommerce/template/checkout/review-order.php:27
1260
+ #: woocommerce/template/checkout/review-order.php:106
1261
+ msgid "Total"
1262
+ msgstr ""
1263
+
1264
+ #: woocommerce/template/checkout/review-order.php:59
1265
+ msgid "Subtotal"
1266
+ msgstr ""
1267
+
1268
+ #: woocommerce/template/checkout/thankyou.php:30
1269
+ msgid ""
1270
+ "Unfortunately your order cannot be processed as the originating "
1271
+ "bank/merchant has declined your transaction. Please attempt your purchase "
1272
+ "again."
1273
+ msgstr ""
1274
+
1275
+ #: woocommerce/template/checkout/thankyou.php:33
1276
+ msgid "Pay"
1277
+ msgstr ""
1278
+
1279
+ #: woocommerce/template/checkout/thankyou.php:35
1280
+ msgid "My account"
1281
+ msgstr ""
1282
+
1283
+ #: woocommerce/template/checkout/thankyou.php:41
1284
+ #: woocommerce/template/checkout/thankyou.php:83
1285
+ msgid "Thank you. Your order has been received."
1286
+ msgstr ""
1287
+
1288
+ #: woocommerce/template/checkout/thankyou.php:46
1289
+ msgid "Order number:"
1290
+ msgstr ""
1291
+
1292
+ #: woocommerce/template/checkout/thankyou.php:51
1293
+ msgid "Date:"
1294
+ msgstr ""
1295
+
1296
+ #: woocommerce/template/checkout/thankyou.php:57
1297
+ msgid "Email:"
1298
+ msgstr ""
1299
+
1300
+ #: woocommerce/template/checkout/thankyou.php:63
1301
+ msgid "Total:"
1302
+ msgstr ""
1303
+
1304
+ #: woocommerce/template/checkout/thankyou.php:69
1305
+ msgid "Payment method:"
1306
+ msgstr ""
1307
+
1308
+ #. Plugin Name of the plugin/theme
1309
+ msgid "CartFlows"
1310
+ msgstr ""
1311
+
1312
+ #. Author URI of the plugin/theme
1313
+ msgid "https://cartflows.com/"
1314
+ msgstr ""
1315
+
1316
+ #. Description of the plugin/theme
1317
+ msgid "Create beautiful checkout pages & sales flows for WooCommerce."
1318
+ msgstr ""
1319
+
1320
+ #. Author of the plugin/theme
1321
+ msgid "CartFlows Inc"
1322
+ msgstr ""
1323
+
1324
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:55
1325
+ msgctxt "flow general name"
1326
+ msgid "Flows"
1327
+ msgstr ""
1328
+
1329
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:56
1330
+ msgctxt "flow singular name"
1331
+ msgid "Flow"
1332
+ msgstr ""
1333
+
1334
+ #: modules/flow/classes/class-cartflows-step-post-type.php:138
1335
+ msgctxt "flow step general name"
1336
+ msgid "Steps"
1337
+ msgstr ""
1338
+
1339
+ #: modules/flow/classes/class-cartflows-step-post-type.php:139
1340
+ msgctxt "flow step singular name"
1341
+ msgid "Step"
1342
+ msgstr ""
1343
+
1344
+ #: modules/flow/classes/class-cartflows-step-post-type.php:258
1345
+ msgctxt "cartflows"
1346
+ msgid "Template for Page Builders"
1347
  msgstr ""
modules/checkout/classes/class-cartflows-checkout-markup.php CHANGED
@@ -1,1033 +1,1109 @@
1
- <?php
2
- /**
3
- * Checkout markup.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Checkout Markup
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Checkout_Markup {
14
-
15
- /**
16
- * Member Variable
17
- *
18
- * @var object instance
19
- */
20
- private static $instance;
21
-
22
- /**
23
- * Initiator
24
- */
25
- public static function get_instance() {
26
- if ( ! isset( self::$instance ) ) {
27
- self::$instance = new self;
28
- }
29
- return self::$instance;
30
- }
31
-
32
- /**
33
- * Constructor
34
- */
35
- public function __construct() {
36
-
37
- /* Set is checkout flag */
38
- add_filter( 'woocommerce_is_checkout', array( $this, 'woo_checkout_flag' ), 9999 );
39
-
40
- add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'save_checkout_fields' ), 10, 2 );
41
-
42
- /* Show notice if cart is empty */
43
- add_action( 'cartflows_checkout_cart_empty', array( $this, 'display_woo_notices' ) );
44
-
45
- /* Checkout Shortcode */
46
- add_shortcode( 'cartflows_checkout', array( $this, 'checkout_shortcode_markup' ) );
47
-
48
- /* Preconfigured cart data */
49
- add_action( 'wp', array( $this, 'preconfigured_cart_data' ), 1 );
50
-
51
- /* Embed Checkout */
52
- add_action( 'wp', array( $this, 'shortcode_load_data' ), 999 );
53
-
54
- /* Ajax Endpoint */
55
- add_filter( 'woocommerce_ajax_get_endpoint', array( $this, 'get_ajax_endpoint' ) );
56
-
57
- add_filter( 'cartflows_add_before_main_section', array( $this, 'enable_logo_in_header' ) );
58
-
59
- add_filter( 'cartflows_primary_container_bottom', array( $this, 'show_cartflows_copyright_message' ) );
60
-
61
- add_filter( 'woocommerce_login_redirect', array( $this, 'after_login_redirect' ), 10, 2 );
62
-
63
- add_action( 'wp_ajax_cf_woo_apply_coupon', array( $this, 'apply_coupon' ) );
64
- add_action( 'wp_ajax_nopriv_cf_woo_apply_coupon', array( $this, 'apply_coupon' ) );
65
-
66
- add_filter( 'global_cartflows_js_localize', array( $this, 'add_localize_vars' ) );
67
-
68
- /* Global Checkout */
69
- add_action( 'template_redirect', array( $this, 'global_checkout_template_redirect' ), 1 );
70
- }
71
-
72
- /**
73
- * Display all WooCommerce notices.
74
- *
75
- * @since 1.1.5
76
- */
77
- function display_woo_notices() {
78
-
79
- if ( null != WC()->session && function_exists( 'woocommerce_output_all_notices' ) ) {
80
- woocommerce_output_all_notices();
81
- }
82
- }
83
-
84
-
85
- /**
86
- * Redirect from default to the global checkout page
87
- *
88
- * @since 1.0.0
89
- */
90
- function global_checkout_template_redirect() {
91
-
92
- if ( ! is_checkout() ) {
93
- return;
94
- }
95
-
96
- if ( _is_wcf_checkout_type() || _is_wcf_checkout_shortcode() ) {
97
- return;
98
- }
99
-
100
- // redirect only from any non HC checkout pages.
101
- $order_pay_endpoint = get_option( 'woocommerce_checkout_order_pay_endpoint', 'order-pay' );
102
- $order_received_endpoint = get_option( 'woocommerce_checkout_order_received_endpoint', 'order-received' );
103
-
104
- $common = Cartflows_Helper::get_common_settings();
105
-
106
- $global_checkout = $common['global_checkout'];
107
-
108
- if (
109
- // ignore on order-pay.
110
- false === mb_strpos( $_SERVER['REQUEST_URI'], '/' . $order_pay_endpoint . '/' ) &&
111
- // ignore on TY page.
112
- false === mb_strpos( $_SERVER['REQUEST_URI'], '/' . $order_received_endpoint . '/' )
113
- ) {
114
-
115
- if ( '' !== $global_checkout ) {
116
-
117
- $link = get_permalink( $global_checkout );
118
-
119
- if ( ! empty( $link ) ) {
120
-
121
- wp_redirect( $link );
122
- die();
123
- }
124
- }
125
- }
126
- }
127
-
128
- /**
129
- * Check for checkout flag
130
- *
131
- * @param bool $is_checkout is checkout.
132
- *
133
- * @return bool
134
- */
135
- function woo_checkout_flag( $is_checkout ) {
136
-
137
- if ( ! is_admin() ) {
138
-
139
- if ( _is_wcf_checkout_type() || _is_wcf_checkout_shortcode() ) {
140
-
141
- $is_checkout = true;
142
- }
143
- }
144
-
145
- return $is_checkout;
146
- }
147
-
148
- /**
149
- * Render checkout shortcode markup.
150
- *
151
- * @param array $atts attributes.
152
- * @return string
153
- */
154
- function checkout_shortcode_markup( $atts ) {
155
-
156
- if ( ! function_exists( 'wc_print_notices' ) ) {
157
- return '<p class="woocommerce-notice">' . __( 'WooCommerce functions not exists. If you are in iframe, please reload the iframe', 'cartflows' ) . '</p>';
158
- }
159
-
160
- $atts = shortcode_atts(
161
- array(
162
- 'id' => 0,
163
- ),
164
- $atts
165
- );
166
-
167
- $checkout_id = intval( $atts['id'] );
168
-
169
- if ( empty( $checkout_id ) ) {
170
-
171
- if ( ! _is_wcf_checkout_type() ) {
172
-
173
- return '<h4>' . __( 'Checkout ID not found', 'cartflows' ) . '</h4>';
174
- }
175
-
176
- global $post;
177
-
178
- $checkout_id = intval( $post->ID );
179
- }
180
-
181
- $output = '';
182
-
183
- ob_start();
184
-
185
- do_action( 'cartflows_checkout_form_before', $checkout_id );
186
-
187
- $checkout_layout = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-layout' );
188
-
189
- $template_default = CARTFLOWS_CHECKOUT_DIR . 'templates/embed/checkout-template-simple.php';
190
-
191
- $template_layout = apply_filters( 'cartflows_checkout_layout_template', $checkout_layout );
192
-
193
- if ( file_exists( $template_layout ) ) {
194
- include $template_layout;
195
- } else {
196
- include $template_default;
197
- }
198
-
199
- $output .= ob_get_clean();
200
-
201
- return $output;
202
- }
203
-
204
- /**
205
- * Configure Cart Data.
206
- *
207
- * @since 1.0.0
208
- *
209
- * @return void
210
- */
211
- function preconfigured_cart_data() {
212
-
213
- if ( is_admin() ) {
214
- return;
215
- }
216
-
217
- global $post;
218
-
219
- if ( _is_wcf_checkout_type() || _is_wcf_checkout_shortcode() ) {
220
-
221
- if ( wp_doing_ajax() ) {
222
-
223
- return;
224
- } else {
225
-
226
- if ( _is_wcf_checkout_type() ) {
227
- $checkout_id = $post->ID;
228
- } else {
229
- $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
230
- }
231
-
232
- do_action( 'cartflows_checkout_before_configure_cart', $checkout_id );
233
-
234
- $flow_id = wcf()->utils->get_flow_id_from_step_id( $checkout_id );
235
-
236
- if ( wcf()->flow->is_flow_testmode( $flow_id ) ) {
237
- $products = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-products', 'dummy' );
238
- } else {
239
- $products = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-products' );
240
- }
241
-
242
- if ( ! is_array( $products ) ) {
243
-
244
- if ( 'dummy' === $products ) {
245
-
246
- $args = array(
247
- 'posts_per_page' => 1,
248
- 'orderby' => 'rand',
249
- 'post_type' => 'product',
250
- 'meta_query' => array(
251
- // Exclude out of stock products.
252
- array(
253
- 'key' => '_stock_status',
254
- 'value' => 'outofstock',
255
- 'compare' => 'NOT IN',
256
- ),
257
- ),
258
- 'tax_query' => array(
259
- array(
260
- 'taxonomy' => 'product_type',
261
- 'field' => 'slug',
262
- 'terms' => 'simple',
263
- ),
264
- ),
265
- );
266
-
267
- $random_product = get_posts( $args );
268
-
269
- if ( isset( $random_product[0]->ID ) ) {
270
- $products = array(
271
- array(
272
- 'product' => $random_product[0]->ID,
273
- ),
274
- );
275
- } else {
276
- return;
277
- }
278
- } else {
279
- return;
280
- }
281
- }
282
-
283
- if ( is_array( $products ) && count( $products ) < 1 ) {
284
-
285
- return;
286
- }
287
- /* Empty the current cart */
288
- WC()->cart->empty_cart();
289
-
290
- /* Set customer session if not set */
291
- if ( ! is_user_logged_in() && WC()->cart->is_empty() ) {
292
- WC()->session->set_customer_session_cookie( true );
293
- }
294
-
295
- $cart_product_count = 0;
296
-
297
- foreach ( $products as $index => $data ) {
298
-
299
- if ( ! isset( $data['product'] ) ) {
300
- return;
301
- }
302
-
303
- if ( apply_filters( 'cartflows_skip_other_products', false, $cart_product_count ) ) {
304
- return;
305
- }
306
-
307
- $product_id = $data['product'];
308
- $_product = wc_get_product( $product_id );
309
-
310
- if ( ! empty( $_product ) ) {
311
-
312
- $quantity = 1;
313
-
314
- if ( ! $_product->is_type( 'grouped' ) && ! $_product->is_type( 'external' ) ) {
315
-
316
- if ( $_product->is_type( 'variable' ) ) {
317
-
318
- $default_attributes = $_product->get_default_attributes();
319
-
320
- if ( ! empty( $default_attributes ) ) {
321
-
322
- foreach ( $_product->get_children() as $variation_id ) {
323
-
324
- $single_variation = new WC_Product_Variation( $variation_id );
325
-
326
- if ( $default_attributes == $single_variation->get_attributes() ) {
327
- WC()->cart->add_to_cart( $variation_id, $quantity );
328
- $cart_product_count++;
329
- }
330
- }
331
- } else {
332
-
333
- $product_childrens = $_product->get_children();
334
-
335
- if ( isset( $product_childrens[0] ) ) {
336
- WC()->cart->add_to_cart( $product_childrens[0], $quantity );
337
- $cart_product_count++;
338
- } else {
339
- echo '<p>' . __( 'Variations Not set', 'cartflows' ) . '</p>';
340
- }
341
- }
342
- } else {
343
- WC()->cart->add_to_cart( $product_id, $quantity );
344
- $cart_product_count++;
345
- }
346
- } else {
347
-
348
- echo '<p>' . __( 'This product can\'t be purcahsed', 'cartflows' ) . '</p>';
349
- // WC()->cart->add_to_cart( $product_id, $quantity );.
350
- }
351
- }
352
- }
353
-
354
- do_action( 'cartflows_checkout_aftet_configure_cart', $checkout_id );
355
- do_action( 'cartflows_checkout_after_configure_cart', $checkout_id );
356
- }
357
- }
358
- }
359
-
360
- /**
361
- * Load shortcode data.
362
- *
363
- * @return void
364
- */
365
- function shortcode_load_data() {
366
-
367
- if ( _is_wcf_checkout_type() || _is_wcf_checkout_shortcode() ) {
368
-
369
- add_action( 'wp_enqueue_scripts', array( $this, 'shortcode_scripts' ), 21 );
370
-
371
- /* Show notices if cart has errors */
372
- add_action( 'woocommerce_cart_has_errors', 'woocommerce_output_all_notices' );
373
-
374
- add_action( 'woocommerce_checkout_after_customer_details', array( $this, 'order_wrap_div_start' ), 99 );
375
-
376
- add_action( 'woocommerce_checkout_after_order_review', array( $this, 'order_wrap_div_end' ), 99 );
377
-
378
- // Outputting the hidden field in checkout page.
379
- add_action( 'woocommerce_after_order_notes', array( $this, 'checkout_shortcode_post_id' ), 99 );
380
- add_action( 'woocommerce_login_form_end', array( $this, 'checkout_shortcode_post_id' ), 99 );
381
-
382
- remove_all_actions( 'woocommerce_checkout_billing' );
383
- remove_all_actions( 'woocommerce_checkout_shipping' );
384
-
385
- // Hook in actions once.
386
- add_action( 'woocommerce_checkout_billing', array( WC()->checkout, 'checkout_form_billing' ) );
387
- add_action( 'woocommerce_checkout_shipping', array( WC()->checkout, 'checkout_form_shipping' ) );
388
-
389
- remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form' );
390
-
391
- add_action( 'woocommerce_checkout_order_review', array( $this, 'display_custom_coupon_field' ) );
392
-
393
- add_filter( 'woocommerce_checkout_fields', array( $this, 'add_three_column_layout_fields' ) );
394
-
395
- global $post;
396
-
397
- if ( _is_wcf_checkout_type() ) {
398
- $checkout_id = $post->ID;
399
- } else {
400
- $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
401
- }
402
-
403
- do_action( 'cartflows_checkout_before_shortcode', $checkout_id );
404
- }
405
- }
406
-
407
- /**
408
- * Render checkout ID hidden field.
409
- *
410
- * @param array $checkout checkout session data.
411
- * @return void
412
- */
413
- function checkout_shortcode_post_id( $checkout ) {
414
-
415
- global $post;
416
-
417
- if ( _is_wcf_checkout_type() ) {
418
- $checkout_id = $post->ID;
419
- } else {
420
- $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
421
- }
422
-
423
- $flow_id = get_post_meta( $checkout_id, 'wcf-flow-id', true );
424
-
425
- echo '<input type="hidden" class="input-hidden _wcf_flow_id" name="_wcf_flow_id" value="' . intval( $flow_id ) . '">';
426
- echo '<input type="hidden" class="input-hidden _wcf_checkout_id" name="_wcf_checkout_id" value="' . intval( $checkout_id ) . '">';
427
- }
428
-
429
- /**
430
- * Load shortcode scripts.
431
- *
432
- * @return void
433
- */
434
- function shortcode_scripts() {
435
-
436
- wp_enqueue_style( 'wcf-checkout-template', CARTFLOWS_URL . 'assets/css/checkout-template.css', '', CARTFLOWS_VER );
437
- wp_style_add_data( 'wcf-checkout-template', 'rtl', 'replace' );
438
-
439
- if ( Cartflows_Compatibility::get_instance()->is_divi_enabled() ) {
440
- wp_enqueue_style( 'wcf-checkout-template-divi', CARTFLOWS_URL . 'assets/css/checkout-template-divi.css', '', CARTFLOWS_VER );
441
- wp_style_add_data( 'wcf-checkout-template-divi', 'rtl', 'replace' );
442
- }
443
-
444
- wp_enqueue_script(
445
- 'wcf-checkout-template',
446
- CARTFLOWS_URL . 'assets/js/checkout-template.js',
447
- array( 'jquery' ),
448
- CARTFLOWS_VER,
449
- true
450
- );
451
-
452
- do_action( 'cartflows_checkout_scripts' );
453
-
454
- $style = $this->generate_style();
455
-
456
- wp_add_inline_style( 'wcf-checkout-template', $style );
457
-
458
- }
459
-
460
-
461
- /**
462
- * Generate styles.
463
- *
464
- * @return string
465
- */
466
- function generate_style() {
467
-
468
- global $post;
469
-
470
- if ( _is_wcf_checkout_type() ) {
471
- $checkout_id = $post->ID;
472
- } else {
473
- $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
474
- }
475
-
476
- CartFlows_Font_Families::render_fonts( $checkout_id );
477
-
478
- $primary_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-primary-color' );
479
-
480
- $base_font_family = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-base-font-family' );
481
-
482
- $header_logo_width = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-header-logo-width' );
483
-
484
- /*$base_font_weight = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-base-font-weight' );*/
485
- $r = '';
486
- $g = '';
487
- $b = '';
488
-
489
- $field_tb_padding = '';
490
- $field_lr_padding = '';
491
-
492
- $field_heading_color = '';
493
- $field_color = '';
494
- $field_bg_color = '';
495
- $field_border_color = '';
496
- $field_label_color = '';
497
- $submit_tb_padding = '';
498
- $submit_lr_padding = '';
499
- $hl_bg_color = '';
500
- $field_input_size = '';
501
- $box_border_color = '';
502
- $section_bg_color = '';
503
- $submit_button_height = '';
504
- $submit_color = '';
505
- $submit_bg_color = $primary_color;
506
- $submit_border_color = $primary_color;
507
-
508
- $submit_hover_color = '';
509
- $submit_bg_hover_color = $primary_color;
510
- $submit_border_hover_color = $primary_color;
511
-
512
- $section_heading_color = '';
513
-
514
- $is_advance_option = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-advance-options-fields' );
515
-
516
- $button_font_family = '';
517
- $button_font_weight = '';
518
- $input_font_family = '';
519
- $input_font_weight = '';
520
- $heading_font_family = '';
521
- $heading_font_weight = '';
522
- $base_font_family = $base_font_family;
523
- /*$base_font_weight = $base_font_weight;*/
524
-
525
- if ( 'yes' == $is_advance_option ) {
526
-
527
- /**
528
- * Get Font Family and Font Weight weight values
529
- */
530
- $section_bg_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-section-bg-color' );
531
-
532
- $heading_font_family = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-heading-font-family' );
533
- $heading_font_weight = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-heading-font-weight' );
534
- $section_heading_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-heading-color' );
535
- $button_font_family = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-button-font-family' );
536
- $button_font_weight = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-button-font-weight' );
537
- $input_font_family = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-input-font-family' );
538
- $input_font_weight = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-input-font-weight' );
539
- $field_tb_padding = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-tb-padding' );
540
- $field_lr_padding = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-lr-padding' );
541
- $field_input_size = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-input-field-size' );
542
-
543
- $field_heading_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-heading-color' );
544
-
545
- $field_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-color' );
546
-
547
- $field_bg_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-bg-color' );
548
-
549
- $field_border_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-border-color' );
550
-
551
- $field_label_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-label-color' );
552
-
553
- $submit_tb_padding = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-tb-padding' );
554
-
555
- $submit_lr_padding = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-lr-padding' );
556
-
557
- $submit_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-color' );
558
-
559
- $submit_bg_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-bg-color', $primary_color );
560
-
561
- $submit_border_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-border-color', $primary_color );
562
-
563
- $submit_border_hover_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-border-hover-color', $primary_color );
564
-
565
- $submit_hover_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-hover-color' );
566
-
567
- $submit_bg_hover_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-bg-hover-color', $primary_color );
568
-
569
- $hl_bg_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-hl-bg-color' );
570
-
571
- $box_border_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-box-border-color' );
572
-
573
- $submit_button_height = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-input-button-size' );
574
-
575
- /**
576
- * Get font values
577
- */
578
-
579
- if ( 'custom' == $submit_button_height ) {
580
- $submit_button_height = '38px';
581
- }
582
-
583
- if ( 'custom' == $field_input_size ) {
584
- $field_input_size = '38px';
585
- }
586
- }
587
- if ( isset( $primary_color ) ) {
588
-
589
- list($r, $g, $b) = sscanf( $primary_color, '#%02x%02x%02x' );
590
- }
591
- $output = "
592
- .wcf-embed-checkout-form .wcf-checkout-header-image img{
593
- width: {$header_logo_width}px;
594
- }
595
- .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
596
- .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type='checkbox']:checked:before{
597
- color: {$primary_color};
598
- }
599
- .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
600
- background-color: {$primary_color};
601
- }
602
- .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,
603
- .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type='checkbox']:focus,
604
- .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:focus,
605
- .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:not(:checked):focus{
606
- border-color: {$primary_color};
607
- box-shadow: 0 0 2px rgba( " . $r . ',' . $g . ',' . $b . ", .8);
608
- }
609
- .wcf-embed-checkout-form .woocommerce-checkout label{
610
- color: {$field_label_color};
611
- }
612
- .wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box{
613
- background-color: {$hl_bg_color};
614
- font-family: {$input_font_family};
615
- font-weight: {$input_font_weight};
616
- }
617
-
618
- .wcf-embed-checkout-form #add_payment_method #payment div.payment_box::before,
619
- .wcf-embed-checkout-form .woocommerce-cart #payment div.payment_box::before,
620
- .wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box::before
621
- {
622
- border-color: {$hl_bg_color};
623
- border-right-color: transparent;
624
- border-left-color: transparent;
625
- border-top-color: transparent;
626
- position: absolute;
627
- }
628
-
629
- .wcf-embed-checkout-form .woocommerce #payment [type='radio']:checked + label,
630
- .wcf-embed-checkout-form .woocommerce #payment [type='radio']:not(:checked) + label{
631
- font-family: {$input_font_family};
632
- font-weight: {$input_font_weight};
633
- }
634
-
635
- .wcf-embed-checkout-form #order_review .wcf-custom-coupon-field input[type='text'],
636
- .wcf-embed-checkout-form .woocommerce form .form-row input.input-text,
637
- .wcf-embed-checkout-form .woocommerce form .form-row textarea,
638
- .wcf-embed-checkout-form .select2-container--default .select2-selection--single {
639
- color: {$field_color};
640
- background: {$field_bg_color};
641
- border-color: {$field_border_color};
642
- padding-top: {$field_tb_padding}px;
643
- padding-bottom: {$field_tb_padding}px;
644
- padding-left: {$field_lr_padding}px;
645
- padding-right: {$field_lr_padding}px;
646
- min-height: {$field_input_size};
647
- font-family: {$input_font_family};
648
- font-weight: {$input_font_weight};
649
- }
650
-
651
- .wcf-embed-checkout-form .woocommerce .col2-set .col-1,
652
- .wcf-embed-checkout-form .woocommerce .col2-set .col-2,
653
- .wcf-embed-checkout-form .woocommerce-checkout .shop_table,
654
- .wcf-embed-checkout-form .woocommerce-checkout #order_review_heading,
655
- .wcf-embed-checkout-form .woocommerce-checkout #payment,
656
- .wcf-embed-checkout-form .woocommerce form.checkout_coupon
657
- {
658
- background-color: {$section_bg_color};
659
- border-color: {$box_border_color};
660
- font-family: {$input_font_family};
661
- font-weight: {$input_font_weight};
662
- }
663
-
664
- .woocommerce table.shop_table th{
665
- color: {$field_label_color};
666
- }
667
- .wcf-embed-checkout-form .woocommerce .woocommerce-info,
668
- .wcf-embed-checkout-form .woocommerce-message{
669
- border-top-color: {$primary_color};
670
- background-color: {$hl_bg_color};
671
- }
672
- .wcf-embed-checkout-form .woocommerce a{
673
- color: {$primary_color};
674
- }
675
- .wcf-embed-checkout-form .select2-container--default .select2-selection--single .select2-selection__rendered {
676
- color: {$field_color};
677
- }
678
- .wcf-embed-checkout-form ::-webkit-input-placeholder { /* Chrome/Opera/Safari */
679
- color: {$field_color};
680
- }
681
- .wcf-embed-checkout-form ::-moz-placeholder { /* Firefox 19+ */
682
- color: {$field_color};
683
- }
684
- .wcf-embed-checkout-form :-ms-input-placeholder { /* IE 10+ */
685
- color: {$field_color};
686
- }
687
- .wcf-embed-checkout-form :-moz-placeholder { /* Firefox 18- */
688
- color: {$field_color};
689
- }
690
- .wcf-embed-checkout-form .woocommerce form p.form-row label {
691
- color: {$field_label_color};
692
- font-family: {$input_font_family};
693
- font-weight: {$input_font_weight};
694
- }
695
- .wcf-embed-checkout-form .woocommerce #order_review button {
696
- color: {$submit_color};
697
- background: {$submit_bg_color};
698
- padding-top: {$submit_tb_padding}px;
699
- padding-bottom: {$submit_tb_padding}px;
700
- padding-left: {$submit_lr_padding}px;
701
- padding-right: {$submit_lr_padding}px;
702
- border-color: {$submit_border_color};
703
- min-height: {$submit_button_height};
704
- font-family: {$button_font_family};
705
- font-weight: {$button_font_weight};
706
- }
707
- .wcf-embed-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
708
- .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button{
709
- background: {$submit_bg_color};
710
- border: 1px {$submit_border_color} solid;
711
- color: {$submit_color};
712
- min-height: {$submit_button_height};
713
- font-family: {$button_font_family};
714
- font-weight: {$button_font_weight};
715
- }
716
- .wcf-embed-checkout-form .woocommerce-checkout form.login .button:hover,
717
- .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button:hover,
718
- .wcf-embed-checkout-form .woocommerce #payment #place_order:hover,
719
- .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small:hover{
720
- color: {$submit_hover_color};
721
- background-color: {$submit_bg_hover_color};
722
- border-color: {$submit_border_hover_color};
723
- }
724
- .wcf-embed-checkout-form .woocommerce h3,
725
- .wcf-embed-checkout-form .woocommerce h3 span,
726
- .wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{
727
- color: {$section_heading_color};
728
- font-family: {$heading_font_family};
729
- font-weight: {$heading_font_weight};
730
- }
731
- .wcf-embed-checkout-form .woocommerce-info::before,
732
- .wcf-embed-checkout-form .woocommerce-message::before{
733
- color: {$primary_color};
734
- }
735
- .wcf-embed-checkout-form{
736
- font-family: {$base_font_family};
737
- }";
738
-
739
- return $output;
740
- }
741
-
742
- /**
743
- * Get ajax end points.
744
- *
745
- * @param string $endpoint_url end point URL.
746
- * @return string
747
- */
748
- function get_ajax_endpoint( $endpoint_url ) {
749
-
750
- global $post;
751
-
752
- if ( ! empty( $post ) && ! empty( $_SERVER['REQUEST_URI'] ) ) {
753
-
754
- if ( _is_wcf_checkout_type() || _is_wcf_checkout_shortcode() ) {
755
-
756
- if ( mb_strpos( $endpoint_url, 'checkout' ) === false ) {
757
-
758
- $query_args = array(
759
- 'wc-ajax' => '%%endpoint%%',
760
- );
761
-
762
- $uri = explode( '?', $_SERVER['REQUEST_URI'], 2 );
763
- $uri = $uri[0];
764
-
765
- $endpoint_url = esc_url( add_query_arg( $query_args, $uri ) );
766
- }
767
- }
768
- }
769
-
770
- return $endpoint_url;
771
- }
772
-
773
-
774
- /**
775
- * Save checkout fields.
776
- *
777
- * @param int $order_id order id.
778
- * @param array $posted posted data.
779
- * @return void
780
- */
781
- function save_checkout_fields( $order_id, $posted ) {
782
-
783
- if ( isset( $_POST['_wcf_checkout_id'] ) ) {
784
-
785
- $checkout_id = wc_clean( $_POST['_wcf_checkout_id'] );
786
-
787
- update_post_meta( $order_id, '_wcf_checkout_id', $checkout_id );
788
-
789
- /*
790
- Custom Field To Do
791
- $custom_fields = get_post_meta( $checkout_id, 'wcf-custom-checkout-fields', true );
792
-
793
- if ( 'yes' === $custom_fields ) {
794
-
795
- $billing_fields = get_post_meta( $checkout_id, 'wcf_fields_billing', true );
796
-
797
- foreach ( $billing_fields as $field => $data ) {
798
-
799
- if ( isset( $data['custom'] ) && $data['custom'] ) {
800
-
801
- if ( isset( $_POST[ $field ] ) ) {
802
- update_post_meta( $order_id, $field, wc_clean( $_POST[ $field ] ) );
803
- }
804
- }
805
- }
806
-
807
- $shipping_fields = get_post_meta( $checkout_id, 'wcf_fields_shipping', true );
808
-
809
- foreach ( $shipping_fields as $field => $data ) {
810
-
811
- if ( isset( $data['custom'] ) && $data['custom'] ) {
812
-
813
- if ( isset( $_POST[ $field ] ) ) {
814
- update_post_meta( $order_id, $field, wc_clean( $_POST[ $field ] ) );
815
- }
816
- }
817
- }
818
- }
819
- */
820
- if ( isset( $_POST['_wcf_flow_id'] ) ) {
821
-
822
- $checkout_id = wc_clean( $_POST['_wcf_flow_id'] );
823
-
824
- update_post_meta( $order_id, '_wcf_flow_id', $checkout_id );
825
- }
826
- }
827
-
828
- }
829
-
830
- /**
831
- * Enable Logo In Header Of Checkout Page
832
- *
833
- * @return void
834
- */
835
- function enable_logo_in_header() {
836
- global $post;
837
-
838
- if ( _is_wcf_checkout_type() ) {
839
- $checkout_id = $post->ID;
840
- } else {
841
- $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
842
- }
843
-
844
- $header_logo_image = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-header-logo-image' );
845
- $add_image_markup = '';
846
-
847
- if ( isset( $header_logo_image ) && ! empty( $header_logo_image ) ) {
848
- $add_image_markup = '<div class="wcf-checkout-header-image">';
849
- $add_image_markup .= '<img src="' . $header_logo_image . '" />';
850
- $add_image_markup .= '</div>';
851
- }
852
-
853
- echo $add_image_markup;
854
- }
855
-
856
- /**
857
- * Add text to the bootom of the checkout page.
858
- *
859
- * @return void
860
- */
861
- function show_cartflows_copyright_message() {
862
- $output_string = '';
863
-
864
- $output_string .= '<div class="wcf-footer-primary">';
865
- $output_string .= '<div class="wcf-footer-content">';
866
- $output_string .= '<p class="wcf-footer-message">';
867
- $output_string .= 'Checkout powered by CartFlows';
868
- $output_string .= '</p>';
869
- $output_string .= '</div>';
870
- $output_string .= '</div>';
871
-
872
- echo $output_string;
873
- }
874
-
875
- /**
876
- * Redirect users to our checkout if hidden param
877
- *
878
- * @param string $redirect redirect url.
879
- * @param object $user user.
880
- * @return string
881
- */
882
- function after_login_redirect( $redirect, $user ) {
883
-
884
- if ( isset( $_POST['_wcf_checkout_id'] ) ) {
885
-
886
- $checkout_id = intval( $_POST['_wcf_checkout_id'] );
887
-
888
- $redirect = get_permalink( $checkout_id );
889
- }
890
-
891
- return $redirect;
892
- }
893
-
894
- /**
895
- * Display coupon code field after review order fields.
896
- */
897
- function display_custom_coupon_field() {
898
-
899
- $coupon_enabled = apply_filters( 'woocommerce_coupons_enabled', true );
900
-
901
- if ( ! $coupon_enabled ) {
902
- return;
903
- }
904
-
905
- ob_start();
906
-
907
- ?>
908
- <div class="wcf-custom-coupon-field">
909
- <div class="wcf-coupon-col-1">
910
- <span>
911
- <input type="text" name="coupon_code" class="input-text cf-coupon-code-input" placeholder="<?php echo $this->coupon_field_placeholder(); ?>" id="coupon_code" value="">
912
- </span>
913
- </div>
914
- <div class="wcf-coupon-col-2">
915
- <span>
916
- <button type="button" class="button cf-submit-coupon wcf-btn-small" name="apply_coupon" value="Apply"><?php echo $this->coupon_button_text(); ?></button>
917
- </span>
918
- </div>
919
- </div>
920
-
921
- <?php
922
-
923
- echo ob_get_clean();
924
- }
925
-
926
- /**
927
- * Apply filter to change the placeholder text of coupon field.
928
- *
929
- * @return string
930
- */
931
- function coupon_field_placeholder() {
932
- return apply_filters( 'cartflows_coupon_field_placeholder', __( 'Coupon Code', 'cartflows' ) );
933
- }
934
-
935
- /**
936
- * Apply filter to change the button text of coupon field.
937
- *
938
- * @return string
939
- */
940
- function coupon_button_text() {
941
- return apply_filters( 'cartflows_coupon_button_text', __( 'Apply', 'cartflows' ) );
942
- }
943
-
944
- /**
945
- * Apply coupon on submit of custom coupon form.
946
- */
947
- function apply_coupon() {
948
-
949
- check_ajax_referer( 'cf-apply-coupon', 'security' );
950
-
951
- $result = WC()->cart->add_discount( sanitize_text_field( wp_unslash( $_POST['coupon_code'] ) ) );
952
-
953
- echo json_encode( $result );
954
- die();
955
- }
956
-
957
- /**
958
- * Added ajax nonce to localize variable.
959
- *
960
- * @param array $vars localize variables.
961
- */
962
- function add_localize_vars( $vars ) {
963
-
964
- $vars['cf_validate_coupon_nonce'] = wp_create_nonce( 'cf-apply-coupon' );
965
-
966
- return $vars;
967
- }
968
-
969
- /**
970
- * Add custom class to the fields to change the UI to three column.
971
- *
972
- * @param array $fields fields.
973
- */
974
- function add_three_column_layout_fields( $fields ) {
975
-
976
- if ( empty( $fields['billing']['billing_address_2'] ) ) {
977
-
978
- if ( isset( $fields['billing']['billing_address_1'] ) && is_array( $fields['billing']['billing_address_1'] ) ) {
979
- $fields['billing']['billing_address_1']['class'][] = 'form-row-full';
980
- }
981
- }
982
-
983
- if ( empty( $fields['shipping']['shipping_address_2'] ) ) {
984
-
985
- if ( isset( $fields['shipping']['shipping_address_1'] ) && is_array( $fields['shipping']['shipping_address_1'] ) ) {
986
- $fields['shipping']['shipping_address_1']['class'][] = 'form-row-full';
987
- }
988
- }
989
-
990
- if ( isset( $fields['billing']['billing_city'] ) &&
991
- isset( $fields['billing']['billing_state'] ) && isset( $fields['billing']['billing_postcode'] ) ) {
992
-
993
- $fields['billing']['billing_city']['class'] = array( 'wcf-form-col-3' );
994
- $fields['billing']['billing_state']['class'] = array( 'wcf-form-col-3' );
995
- $fields['billing']['billing_postcode']['class'] = array( 'wcf-form-col-3' );
996
- }
997
-
998
- if ( isset( $fields['shipping']['shipping_city'] ) &&
999
- isset( $fields['shipping']['shipping_state'] ) && isset( $fields['shipping']['shipping_postcode'] ) ) {
1000
-
1001
- $fields['shipping']['shipping_city']['class'] = array( 'wcf-form-col-3' );
1002
- $fields['shipping']['shipping_state']['class'] = array( 'wcf-form-col-3' );
1003
- $fields['shipping']['shipping_postcode']['class'] = array( 'wcf-form-col-3' );
1004
- }
1005
-
1006
- return $fields;
1007
- }
1008
-
1009
- /**
1010
- * Add opening dev
1011
- *
1012
- * @since 1.0.0
1013
- */
1014
- function order_wrap_div_start() {
1015
-
1016
- echo "<div class='wcf-order-wrap'> ";
1017
- }
1018
-
1019
- /**
1020
- * Add closing dev
1021
- *
1022
- * @since 1.0.0
1023
- */
1024
- function order_wrap_div_end() {
1025
-
1026
- echo '</div> ';
1027
- }
1028
- }
1029
-
1030
- /**
1031
- * Kicking this off by calling 'get_instance()' method
1032
- */
1033
- Cartflows_Checkout_Markup::get_instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Checkout markup.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Checkout Markup
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Checkout_Markup {
14
+
15
+ /**
16
+ * Member Variable
17
+ *
18
+ * @var object instance
19
+ */
20
+ private static $instance;
21
+
22
+ /**
23
+ * Initiator
24
+ */
25
+ public static function get_instance() {
26
+ if ( ! isset( self::$instance ) ) {
27
+ self::$instance = new self;
28
+ }
29
+ return self::$instance;
30
+ }
31
+
32
+ /**
33
+ * Constructor
34
+ */
35
+ public function __construct() {
36
+
37
+ /* Set is checkout flag */
38
+ add_filter( 'woocommerce_is_checkout', array( $this, 'woo_checkout_flag' ), 9999 );
39
+
40
+ add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'save_checkout_fields' ), 10, 2 );
41
+
42
+ /* Show notice if cart is empty */
43
+ add_action( 'cartflows_checkout_cart_empty', array( $this, 'display_woo_notices' ) );
44
+
45
+ /* Checkout Shortcode */
46
+ add_shortcode( 'cartflows_checkout', array( $this, 'checkout_shortcode_markup' ) );
47
+
48
+ /* Preconfigured cart data */
49
+ add_action( 'wp', array( $this, 'preconfigured_cart_data' ), 1 );
50
+
51
+ /* Embed Checkout */
52
+ add_action( 'wp', array( $this, 'shortcode_load_data' ), 999 );
53
+
54
+ /* Ajax Endpoint */
55
+ add_filter( 'woocommerce_ajax_get_endpoint', array( $this, 'get_ajax_endpoint' ) );
56
+
57
+ add_filter( 'cartflows_add_before_main_section', array( $this, 'enable_logo_in_header' ) );
58
+
59
+ add_filter( 'cartflows_primary_container_bottom', array( $this, 'show_cartflows_copyright_message' ) );
60
+
61
+ add_filter( 'woocommerce_login_redirect', array( $this, 'after_login_redirect' ), 10, 2 );
62
+
63
+ add_action( 'wp_ajax_cf_woo_apply_coupon', array( $this, 'apply_coupon' ) );
64
+ add_action( 'wp_ajax_nopriv_cf_woo_apply_coupon', array( $this, 'apply_coupon' ) );
65
+
66
+ add_filter( 'global_cartflows_js_localize', array( $this, 'add_localize_vars' ) );
67
+
68
+ /* Global Checkout */
69
+ add_action( 'template_redirect', array( $this, 'global_checkout_template_redirect' ), 1 );
70
+ }
71
+
72
+ /**
73
+ * Display all WooCommerce notices.
74
+ *
75
+ * @since 1.1.5
76
+ */
77
+ function display_woo_notices() {
78
+
79
+ if ( null != WC()->session && function_exists( 'woocommerce_output_all_notices' ) ) {
80
+ woocommerce_output_all_notices();
81
+ }
82
+ }
83
+
84
+
85
+ /**
86
+ * Redirect from default to the global checkout page
87
+ *
88
+ * @since 1.0.0
89
+ */
90
+ function global_checkout_template_redirect() {
91
+
92
+ if ( ! is_checkout() ) {
93
+ return;
94
+ }
95
+
96
+ if ( _is_wcf_checkout_type() || _is_wcf_checkout_shortcode() ) {
97
+ return;
98
+ }
99
+
100
+ // redirect only from any non HC checkout pages.
101
+ $order_pay_endpoint = get_option( 'woocommerce_checkout_pay_endpoint', 'order-pay' );
102
+ $order_received_endpoint = get_option( 'woocommerce_checkout_order_received_endpoint', 'order-received' );
103
+
104
+ $common = Cartflows_Helper::get_common_settings();
105
+
106
+ $global_checkout = $common['global_checkout'];
107
+
108
+ if (
109
+ // ignore on order-pay.
110
+ false === mb_strpos( $_SERVER['REQUEST_URI'], '/' . $order_pay_endpoint . '/' ) &&
111
+ // ignore on TY page.
112
+ false === mb_strpos( $_SERVER['REQUEST_URI'], '/' . $order_received_endpoint . '/' )
113
+ ) {
114
+
115
+ if ( '' !== $global_checkout ) {
116
+
117
+ $link = get_permalink( $global_checkout );
118
+
119
+ if ( ! empty( $link ) ) {
120
+
121
+ wp_redirect( $link );
122
+ die();
123
+ }
124
+ }
125
+ }
126
+ }
127
+
128
+ /**
129
+ * Check for checkout flag
130
+ *
131
+ * @param bool $is_checkout is checkout.
132
+ *
133
+ * @return bool
134
+ */
135
+ function woo_checkout_flag( $is_checkout ) {
136
+
137
+ if ( ! is_admin() ) {
138
+
139
+ if ( _is_wcf_checkout_type() || _is_wcf_checkout_shortcode() ) {
140
+
141
+ $is_checkout = true;
142
+ }
143
+ }
144
+
145
+ return $is_checkout;
146
+ }
147
+
148
+ /**
149
+ * Render checkout shortcode markup.
150
+ *
151
+ * @param array $atts attributes.
152
+ * @return string
153
+ */
154
+ function checkout_shortcode_markup( $atts ) {
155
+
156
+ if ( ! function_exists( 'wc_print_notices' ) ) {
157
+ return '<p class="woocommerce-notice">' . __( 'WooCommerce functions not exists. If you are in iframe, please reload the iframe', 'cartflows' ) . '</p>';
158
+ }
159
+
160
+ $atts = shortcode_atts(
161
+ array(
162
+ 'id' => 0,
163
+ ),
164
+ $atts
165
+ );
166
+
167
+ $checkout_id = intval( $atts['id'] );
168
+
169
+ if ( empty( $checkout_id ) ) {
170
+
171
+ if ( ! _is_wcf_checkout_type() ) {
172
+
173
+ return '<h4>' . __( 'Checkout ID not found', 'cartflows' ) . '</h4>';
174
+ }
175
+
176
+ global $post;
177
+
178
+ $checkout_id = intval( $post->ID );
179
+ }
180
+
181
+ $output = '';
182
+
183
+ ob_start();
184
+
185
+ do_action( 'cartflows_checkout_form_before', $checkout_id );
186
+
187
+ $checkout_layout = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-layout' );
188
+
189
+ $template_default = CARTFLOWS_CHECKOUT_DIR . 'templates/embed/checkout-template-simple.php';
190
+
191
+ $template_layout = apply_filters( 'cartflows_checkout_layout_template', $checkout_layout );
192
+
193
+ if ( file_exists( $template_layout ) ) {
194
+ include $template_layout;
195
+ } else {
196
+ include $template_default;
197
+ }
198
+
199
+ $output .= ob_get_clean();
200
+
201
+ return $output;
202
+ }
203
+
204
+ /**
205
+ * Configure Cart Data.
206
+ *
207
+ * @since 1.0.0
208
+ *
209
+ * @return void
210
+ */
211
+ function preconfigured_cart_data() {
212
+
213
+ if ( is_admin() ) {
214
+ return;
215
+ }
216
+
217
+ global $post;
218
+
219
+ if ( _is_wcf_checkout_type() || _is_wcf_checkout_shortcode() ) {
220
+
221
+ if ( wp_doing_ajax() ) {
222
+
223
+ return;
224
+ } else {
225
+
226
+ if ( _is_wcf_checkout_type() ) {
227
+ $checkout_id = $post->ID;
228
+ } else {
229
+ $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
230
+ }
231
+
232
+ do_action( 'cartflows_checkout_before_configure_cart', $checkout_id );
233
+
234
+ $flow_id = wcf()->utils->get_flow_id_from_step_id( $checkout_id );
235
+
236
+ if ( wcf()->flow->is_flow_testmode( $flow_id ) ) {
237
+ $products = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-products', 'dummy' );
238
+ } else {
239
+ $products = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-products' );
240
+ }
241
+
242
+ if ( ! is_array( $products ) ) {
243
+
244
+ if ( 'dummy' === $products ) {
245
+
246
+ $args = array(
247
+ 'posts_per_page' => 1,
248
+ 'orderby' => 'rand',
249
+ 'post_type' => 'product',
250
+ 'meta_query' => array(
251
+ // Exclude out of stock products.
252
+ array(
253
+ 'key' => '_stock_status',
254
+ 'value' => 'outofstock',
255
+ 'compare' => 'NOT IN',
256
+ ),
257
+ ),
258
+ 'tax_query' => array(
259
+ array(
260
+ 'taxonomy' => 'product_type',
261
+ 'field' => 'slug',
262
+ 'terms' => 'simple',
263
+ ),
264
+ ),
265
+ );
266
+
267
+ $random_product = get_posts( $args );
268
+
269
+ if ( isset( $random_product[0]->ID ) ) {
270
+ $products = array(
271
+ array(
272
+ 'product' => $random_product[0]->ID,
273
+ ),
274
+ );
275
+ } else {
276
+ return;
277
+ }
278
+ } else {
279
+ return;
280
+ }
281
+ }
282
+
283
+ if ( is_array( $products ) && count( $products ) < 1 ) {
284
+
285
+ return;
286
+ }
287
+ /* Empty the current cart */
288
+ WC()->cart->empty_cart();
289
+
290
+ /* Set customer session if not set */
291
+ if ( ! is_user_logged_in() && WC()->cart->is_empty() ) {
292
+ WC()->session->set_customer_session_cookie( true );
293
+ }
294
+
295
+ $cart_product_count = 0;
296
+
297
+ foreach ( $products as $index => $data ) {
298
+
299
+ if ( ! isset( $data['product'] ) ) {
300
+ return;
301
+ }
302
+
303
+ if ( apply_filters( 'cartflows_skip_other_products', false, $cart_product_count ) ) {
304
+ break;
305
+ }
306
+
307
+ $product_id = $data['product'];
308
+ $_product = wc_get_product( $product_id );
309
+
310
+ if ( ! empty( $_product ) ) {
311
+
312
+ $quantity = 1;
313
+
314
+ if ( ! $_product->is_type( 'grouped' ) && ! $_product->is_type( 'external' ) ) {
315
+
316
+ if ( $_product->is_type( 'variable' ) ) {
317
+
318
+ $default_attributes = $_product->get_default_attributes();
319
+
320
+ if ( ! empty( $default_attributes ) ) {
321
+
322
+ foreach ( $_product->get_children() as $variation_id ) {
323
+
324
+ $single_variation = new WC_Product_Variation( $variation_id );
325
+
326
+ if ( $default_attributes == $single_variation->get_attributes() ) {
327
+ WC()->cart->add_to_cart( $variation_id, $quantity );
328
+ $cart_product_count++;
329
+ }
330
+ }
331
+ } else {
332
+
333
+ $product_childrens = $_product->get_children();
334
+
335
+ if ( isset( $product_childrens[0] ) ) {
336
+ WC()->cart->add_to_cart( $product_childrens[0], $quantity );
337
+ $cart_product_count++;
338
+ } else {
339
+ echo '<p>' . __( 'Variations Not set', 'cartflows' ) . '</p>';
340
+ }
341
+ }
342
+ } else {
343
+ WC()->cart->add_to_cart( $product_id, $quantity );
344
+ $cart_product_count++;
345
+ }
346
+ } else {
347
+
348
+ echo '<p>' . __( 'This product can\'t be purcahsed', 'cartflows' ) . '</p>';
349
+ // WC()->cart->add_to_cart( $product_id, $quantity );.
350
+ }
351
+ }
352
+ }
353
+
354
+ do_action( 'cartflows_checkout_aftet_configure_cart', $checkout_id );
355
+ do_action( 'cartflows_checkout_after_configure_cart', $checkout_id );
356
+ }
357
+ }
358
+ }
359
+
360
+ /**
361
+ * Load shortcode data.
362
+ *
363
+ * @return void
364
+ */
365
+ function shortcode_load_data() {
366
+
367
+ if ( _is_wcf_checkout_type() || _is_wcf_checkout_shortcode() ) {
368
+
369
+ add_action( 'wp_enqueue_scripts', array( $this, 'shortcode_scripts' ), 21 );
370
+
371
+ add_action( 'wp_enqueue_scripts', array( $this, 'compatibility_scripts' ), 101 );
372
+
373
+ /* Show notices if cart has errors */
374
+ add_action( 'woocommerce_cart_has_errors', 'woocommerce_output_all_notices' );
375
+
376
+ add_action( 'woocommerce_checkout_after_customer_details', array( $this, 'order_wrap_div_start' ), 99 );
377
+
378
+ add_action( 'woocommerce_checkout_after_order_review', array( $this, 'order_wrap_div_end' ), 99 );
379
+
380
+ // Outputting the hidden field in checkout page.
381
+ add_action( 'woocommerce_after_order_notes', array( $this, 'checkout_shortcode_post_id' ), 99 );
382
+ add_action( 'woocommerce_login_form_end', array( $this, 'checkout_shortcode_post_id' ), 99 );
383
+
384
+ remove_all_actions( 'woocommerce_checkout_billing' );
385
+ remove_all_actions( 'woocommerce_checkout_shipping' );
386
+
387
+ // Hook in actions once.
388
+ add_action( 'woocommerce_checkout_billing', array( WC()->checkout, 'checkout_form_billing' ) );
389
+ add_action( 'woocommerce_checkout_shipping', array( WC()->checkout, 'checkout_form_shipping' ) );
390
+
391
+ remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form' );
392
+
393
+ add_action( 'woocommerce_checkout_order_review', array( $this, 'display_custom_coupon_field' ) );
394
+
395
+ add_filter( 'woocommerce_checkout_fields', array( $this, 'add_three_column_layout_fields' ) );
396
+
397
+ global $post;
398
+
399
+ if ( _is_wcf_checkout_type() ) {
400
+ $checkout_id = $post->ID;
401
+ } else {
402
+ $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
403
+ }
404
+
405
+ do_action( 'cartflows_checkout_before_shortcode', $checkout_id );
406
+ }
407
+ }
408
+
409
+ /**
410
+ * Render checkout ID hidden field.
411
+ *
412
+ * @param array $checkout checkout session data.
413
+ * @return void
414
+ */
415
+ function checkout_shortcode_post_id( $checkout ) {
416
+
417
+ global $post;
418
+
419
+ if ( _is_wcf_checkout_type() ) {
420
+ $checkout_id = $post->ID;
421
+ } else {
422
+ $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
423
+ }
424
+
425
+ $flow_id = get_post_meta( $checkout_id, 'wcf-flow-id', true );
426
+
427
+ echo '<input type="hidden" class="input-hidden _wcf_flow_id" name="_wcf_flow_id" value="' . intval( $flow_id ) . '">';
428
+ echo '<input type="hidden" class="input-hidden _wcf_checkout_id" name="_wcf_checkout_id" value="' . intval( $checkout_id ) . '">';
429
+ }
430
+
431
+ /**
432
+ * Load shortcode scripts.
433
+ *
434
+ * @return void
435
+ */
436
+ function shortcode_scripts() {
437
+
438
+ wp_enqueue_style( 'wcf-checkout-template', CARTFLOWS_URL . 'assets/css/checkout-template.css', '', CARTFLOWS_VER );
439
+ wp_style_add_data( 'wcf-checkout-template', 'rtl', 'replace' );
440
+
441
+ wp_enqueue_script(
442
+ 'wcf-checkout-template',
443
+ CARTFLOWS_URL . 'assets/js/checkout-template.js',
444
+ array( 'jquery' ),
445
+ CARTFLOWS_VER,
446
+ true
447
+ );
448
+
449
+ do_action( 'cartflows_checkout_scripts' );
450
+
451
+ $style = $this->generate_style();
452
+
453
+ wp_add_inline_style( 'wcf-checkout-template', $style );
454
+
455
+ }
456
+
457
+ /**
458
+ * Load compatibility scripts.
459
+ *
460
+ * @return void
461
+ */
462
+ function compatibility_scripts() {
463
+
464
+ global $post;
465
+
466
+ if ( _is_wcf_checkout_type() ) {
467
+ $checkout_id = $post->ID;
468
+ } else {
469
+ $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
470
+ }
471
+
472
+ // Add DIVI Compatibility css if DIVI theme is enabled.
473
+ if ( Cartflows_Compatibility::get_instance()->is_divi_enabled() ||
474
+ Cartflows_Compatibility::get_instance()->is_divi_builder_enabled( $checkout_id )
475
+ ) {
476
+ wp_enqueue_style( 'wcf-checkout-template-divi', CARTFLOWS_URL . 'assets/css/checkout-template-divi.css', '', CARTFLOWS_VER );
477
+ wp_style_add_data( 'wcf-checkout-template-divi', 'rtl', 'replace' );
478
+ }
479
+
480
+ // Add Flatsome Compatibility css if Flatsome theme is enabled.
481
+ if ( Cartflows_Compatibility::get_instance()->is_flatsome_enabled() ) {
482
+ wp_enqueue_style( 'wcf-checkout-template-flatsome', CARTFLOWS_URL . 'assets/css/checkout-template-flatsome.css', '', CARTFLOWS_VER );
483
+ wp_style_add_data( 'wcf-checkout-template-flatsome', 'rtl', 'replace' );
484
+ }
485
+
486
+ // Add The7 Compatibility css if The7 theme is enabled.
487
+ if ( Cartflows_Compatibility::get_instance()->is_the_seven_enabled() ) {
488
+ wp_enqueue_style( 'wcf-checkout-template-the-seven', CARTFLOWS_URL . 'assets/css/checkout-template-the-seven.css', '', CARTFLOWS_VER );
489
+ wp_style_add_data( 'wcf-checkout-template-the-seven', 'rtl', 'replace' );
490
+ }
491
+ }
492
+
493
+ /**
494
+ * Generate styles.
495
+ *
496
+ * @return string
497
+ */
498
+ function generate_style() {
499
+
500
+ global $post;
501
+
502
+ if ( _is_wcf_checkout_type() ) {
503
+ $checkout_id = $post->ID;
504
+ } else {
505
+ $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
506
+ }
507
+
508
+ CartFlows_Font_Families::render_fonts( $checkout_id );
509
+
510
+ $primary_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-primary-color' );
511
+
512
+ $base_font_family = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-base-font-family' );
513
+
514
+ $header_logo_width = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-header-logo-width' );
515
+
516
+ /*$base_font_weight = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-base-font-weight' );*/
517
+ $r = '';
518
+ $g = '';
519
+ $b = '';
520
+
521
+ $field_tb_padding = '';
522
+ $field_lr_padding = '';
523
+
524
+ $field_heading_color = '';
525
+ $field_color = '';
526
+ $field_bg_color = '';
527
+ $field_border_color = '';
528
+ $field_label_color = '';
529
+ $submit_tb_padding = '';
530
+ $submit_lr_padding = '';
531
+ $hl_bg_color = '';
532
+ $field_input_size = '';
533
+ $box_border_color = '';
534
+ $section_bg_color = '';
535
+ $submit_button_height = '';
536
+ $submit_color = '';
537
+ $submit_bg_color = $primary_color;
538
+ $submit_border_color = $primary_color;
539
+
540
+ $submit_hover_color = '';
541
+ $submit_bg_hover_color = $primary_color;
542
+ $submit_border_hover_color = $primary_color;
543
+
544
+ $section_heading_color = '';
545
+
546
+ $is_advance_option = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-advance-options-fields' );
547
+
548
+ $button_font_family = '';
549
+ $button_font_weight = '';
550
+ $input_font_family = '';
551
+ $input_font_weight = '';
552
+ $heading_font_family = '';
553
+ $heading_font_weight = '';
554
+ $base_font_family = $base_font_family;
555
+ /*$base_font_weight = $base_font_weight;*/
556
+
557
+ if ( 'yes' == $is_advance_option ) {
558
+
559
+ /**
560
+ * Get Font Family and Font Weight weight values
561
+ */
562
+ $section_bg_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-section-bg-color' );
563
+
564
+ $heading_font_family = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-heading-font-family' );
565
+ $heading_font_weight = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-heading-font-weight' );
566
+ $section_heading_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-heading-color' );
567
+ $button_font_family = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-button-font-family' );
568
+ $button_font_weight = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-button-font-weight' );
569
+ $input_font_family = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-input-font-family' );
570
+ $input_font_weight = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-input-font-weight' );
571
+ $field_tb_padding = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-tb-padding' );
572
+ $field_lr_padding = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-lr-padding' );
573
+ $field_input_size = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-input-field-size' );
574
+
575
+ $field_heading_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-heading-color' );
576
+
577
+ $field_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-color' );
578
+
579
+ $field_bg_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-bg-color' );
580
+
581
+ $field_border_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-border-color' );
582
+
583
+ $field_label_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-field-label-color' );
584
+
585
+ $submit_tb_padding = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-tb-padding' );
586
+
587
+ $submit_lr_padding = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-lr-padding' );
588
+
589
+ $submit_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-color' );
590
+
591
+ $submit_bg_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-bg-color', $primary_color );
592
+
593
+ $submit_border_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-border-color', $primary_color );
594
+
595
+ $submit_border_hover_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-border-hover-color', $primary_color );
596
+
597
+ $submit_hover_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-hover-color' );
598
+
599
+ $submit_bg_hover_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-submit-bg-hover-color', $primary_color );
600
+
601
+ $hl_bg_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-hl-bg-color' );
602
+
603
+ $box_border_color = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-box-border-color' );
604
+
605
+ $submit_button_height = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-input-button-size' );
606
+
607
+ /**
608
+ * Get font values
609
+ */
610
+
611
+ if ( 'custom' == $submit_button_height ) {
612
+ $submit_button_height = '38px';
613
+ }
614
+
615
+ if ( 'custom' == $field_input_size ) {
616
+ $field_input_size = '38px';
617
+ }
618
+ }
619
+ if ( isset( $primary_color ) ) {
620
+
621
+ list($r, $g, $b) = sscanf( $primary_color, '#%02x%02x%02x' );
622
+ }
623
+ $output = "
624
+ .wcf-embed-checkout-form .wcf-checkout-header-image img{
625
+ width: {$header_logo_width}px;
626
+ }
627
+ .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
628
+ .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type='checkbox']:checked:before{
629
+ color: {$primary_color};
630
+ }
631
+ .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{
632
+ background-color: {$primary_color};
633
+ }
634
+ .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,
635
+ .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type='checkbox']:focus,
636
+ .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:focus,
637
+ .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:not(:checked):focus{
638
+ border-color: {$primary_color};
639
+ box-shadow: 0 0 2px rgba( " . $r . ',' . $g . ',' . $b . ", .8);
640
+ }
641
+ .wcf-embed-checkout-form .woocommerce-checkout label{
642
+ color: {$field_label_color};
643
+ }
644
+ .wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box{
645
+ background-color: {$hl_bg_color};
646
+ font-family: {$input_font_family};
647
+ font-weight: {$input_font_weight};
648
+ }
649
+
650
+ .wcf-embed-checkout-form #add_payment_method #payment div.payment_box::before,
651
+ .wcf-embed-checkout-form .woocommerce-cart #payment div.payment_box::before,
652
+ .wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box::before
653
+ {
654
+ border-color: {$hl_bg_color};
655
+ border-right-color: transparent;
656
+ border-left-color: transparent;
657
+ border-top-color: transparent;
658
+ position: absolute;
659
+ }
660
+
661
+ .wcf-embed-checkout-form .woocommerce #payment [type='radio']:checked + label,
662
+ .wcf-embed-checkout-form .woocommerce #payment [type='radio']:not(:checked) + label{
663
+ font-family: {$input_font_family};
664
+ font-weight: {$input_font_weight};
665
+ }
666
+
667
+ .wcf-embed-checkout-form #order_review .wcf-custom-coupon-field input[type='text'],
668
+ .wcf-embed-checkout-form .woocommerce form .form-row input.input-text,
669
+ .wcf-embed-checkout-form .woocommerce form .form-row textarea,
670
+ .wcf-embed-checkout-form .select2-container--default .select2-selection--single {
671
+ color: {$field_color};
672
+ background: {$field_bg_color};
673
+ border-color: {$field_border_color};
674
+ padding-top: {$field_tb_padding}px;
675
+ padding-bottom: {$field_tb_padding}px;
676
+ padding-left: {$field_lr_padding}px;
677
+ padding-right: {$field_lr_padding}px;
678
+ min-height: {$field_input_size};
679
+ font-family: {$input_font_family};
680
+ font-weight: {$input_font_weight};
681
+ }
682
+
683
+ .wcf-embed-checkout-form .woocommerce .col2-set .col-1,
684
+ .wcf-embed-checkout-form .woocommerce .col2-set .col-2,
685
+ .wcf-embed-checkout-form .woocommerce-checkout .shop_table,
686
+ .wcf-embed-checkout-form .woocommerce-checkout #order_review_heading,
687
+ .wcf-embed-checkout-form .woocommerce-checkout #payment,
688
+ .wcf-embed-checkout-form .woocommerce form.checkout_coupon
689
+ {
690
+ background-color: {$section_bg_color};
691
+ border-color: {$box_border_color};
692
+ font-family: {$input_font_family};
693
+ font-weight: {$input_font_weight};
694
+ }
695
+
696
+ .woocommerce table.shop_table th{
697
+ color: {$field_label_color};
698
+ }
699
+ /*.wcf-embed-checkout-form .woocommerce .woocommerce-info,
700
+ .wcf-embed-checkout-form .woocommerce-message{
701
+ border-top-color: {$primary_color};
702
+ background-color: {$hl_bg_color};
703
+ }*/
704
+ .wcf-embed-checkout-form .woocommerce a{
705
+ color: {$primary_color};
706
+ }
707
+ .wcf-embed-checkout-form .select2-container--default .select2-selection--single .select2-selection__rendered {
708
+ color: {$field_color};
709
+ }
710
+ .wcf-embed-checkout-form ::-webkit-input-placeholder { /* Chrome/Opera/Safari */
711
+ color: {$field_color};
712
+ }
713
+ .wcf-embed-checkout-form ::-moz-placeholder { /* Firefox 19+ */
714
+ color: {$field_color};
715
+ }
716
+ .wcf-embed-checkout-form :-ms-input-placeholder { /* IE 10+ */
717
+ color: {$field_color};
718
+ }
719
+ .wcf-embed-checkout-form :-moz-placeholder { /* Firefox 18- */
720
+ color: {$field_color};
721
+ }
722
+ .wcf-embed-checkout-form .woocommerce form p.form-row label {
723
+ color: {$field_label_color};
724
+ font-family: {$input_font_family};
725
+ font-weight: {$input_font_weight};
726
+ }
727
+ .wcf-embed-checkout-form .woocommerce #order_review button {
728
+ color: {$submit_color};
729
+ background: {$submit_bg_color};
730
+ padding-top: {$submit_tb_padding}px;
731
+ padding-bottom: {$submit_tb_padding}px;
732
+ padding-left: {$submit_lr_padding}px;
733
+ padding-right: {$submit_lr_padding}px;
734
+ border-color: {$submit_border_color};
735
+ min-height: {$submit_button_height};
736
+ font-family: {$button_font_family};
737
+ font-weight: {$button_font_weight};
738
+ }
739
+ .wcf-embed-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
740
+ .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button{
741
+ background: {$submit_bg_color};
742
+ border: 1px {$submit_border_color} solid;
743
+ color: {$submit_color};
744
+ min-height: {$submit_button_height};
745
+ font-family: {$button_font_family};
746
+ font-weight: {$button_font_weight};
747
+ }
748
+ .wcf-embed-checkout-form .woocommerce-checkout form.login .button:hover,
749
+ .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button:hover,
750
+ .wcf-embed-checkout-form .woocommerce #payment #place_order:hover,
751
+ .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small:hover{
752
+ color: {$submit_hover_color};
753
+ background-color: {$submit_bg_hover_color};
754
+ border-color: {$submit_border_hover_color};
755
+ }
756
+ .wcf-embed-checkout-form .woocommerce h3,
757
+ .wcf-embed-checkout-form .woocommerce h3 span,
758
+ .wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{
759
+ color: {$section_heading_color};
760
+ font-family: {$heading_font_family};
761
+ font-weight: {$heading_font_weight};
762
+ }
763
+ .wcf-embed-checkout-form .woocommerce-info::before,
764
+ .wcf-embed-checkout-form .woocommerce-message::before{
765
+ color: {$primary_color};
766
+ }
767
+ .wcf-embed-checkout-form{
768
+ font-family: {$base_font_family};
769
+ }";
770
+
771
+ return $output;
772
+ }
773
+
774
+ /**
775
+ * Get ajax end points.
776
+ *
777
+ * @param string $endpoint_url end point URL.
778
+ * @return string
779
+ */
780
+ function get_ajax_endpoint( $endpoint_url ) {
781
+
782
+ global $post;
783
+
784
+ if ( ! empty( $post ) && ! empty( $_SERVER['REQUEST_URI'] ) ) {
785
+
786
+ if ( _is_wcf_checkout_type() || _is_wcf_checkout_shortcode() ) {
787
+
788
+ if ( mb_strpos( $endpoint_url, 'checkout' ) === false ) {
789
+
790
+ $query_args = array(
791
+ 'wc-ajax' => '%%endpoint%%',
792
+ );
793
+
794
+ $uri = explode( '?', $_SERVER['REQUEST_URI'], 2 );
795
+ $uri = $uri[0];
796
+
797
+ $endpoint_url = esc_url( add_query_arg( $query_args, $uri ) );
798
+ }
799
+ }
800
+ }
801
+
802
+ return $endpoint_url;
803
+ }
804
+
805
+
806
+ /**
807
+ * Save checkout fields.
808
+ *
809
+ * @param int $order_id order id.
810
+ * @param array $posted posted data.
811
+ * @return void
812
+ */
813
+ function save_checkout_fields( $order_id, $posted ) {
814
+
815
+ if ( isset( $_POST['_wcf_checkout_id'] ) ) {
816
+
817
+ $checkout_id = wc_clean( $_POST['_wcf_checkout_id'] );
818
+
819
+ update_post_meta( $order_id, '_wcf_checkout_id', $checkout_id );
820
+
821
+ /*
822
+ Custom Field To Do
823
+ $custom_fields = get_post_meta( $checkout_id, 'wcf-custom-checkout-fields', true );
824
+
825
+ if ( 'yes' === $custom_fields ) {
826
+
827
+ $billing_fields = get_post_meta( $checkout_id, 'wcf_fields_billing', true );
828
+
829
+ foreach ( $billing_fields as $field => $data ) {
830
+
831
+ if ( isset( $data['custom'] ) && $data['custom'] ) {
832
+
833
+ if ( isset( $_POST[ $field ] ) ) {
834
+ update_post_meta( $order_id, $field, wc_clean( $_POST[ $field ] ) );
835
+ }
836
+ }
837
+ }
838
+
839
+ $shipping_fields = get_post_meta( $checkout_id, 'wcf_fields_shipping', true );
840
+
841
+ foreach ( $shipping_fields as $field => $data ) {
842
+
843
+ if ( isset( $data['custom'] ) && $data['custom'] ) {
844
+
845
+ if ( isset( $_POST[ $field ] ) ) {
846
+ update_post_meta( $order_id, $field, wc_clean( $_POST[ $field ] ) );
847
+ }
848
+ }
849
+ }
850
+ }
851
+ */
852
+ if ( isset( $_POST['_wcf_flow_id'] ) ) {
853
+
854
+ $checkout_id = wc_clean( $_POST['_wcf_flow_id'] );
855
+
856
+ update_post_meta( $order_id, '_wcf_flow_id', $checkout_id );
857
+ }
858
+ }
859
+
860
+ }
861
+
862
+ /**
863
+ * Enable Logo In Header Of Checkout Page
864
+ *
865
+ * @return void
866
+ */
867
+ function enable_logo_in_header() {
868
+ global $post;
869
+
870
+ if ( _is_wcf_checkout_type() ) {
871
+ $checkout_id = $post->ID;
872
+ } else {
873
+ $checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
874
+ }
875
+
876
+ $header_logo_image = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-header-logo-image' );
877
+ $add_image_markup = '';
878
+
879
+ if ( isset( $header_logo_image ) && ! empty( $header_logo_image ) ) {
880
+ $add_image_markup = '<div class="wcf-checkout-header-image">';
881
+ $add_image_markup .= '<img src="' . $header_logo_image . '" />';
882
+ $add_image_markup .= '</div>';
883
+ }
884
+
885
+ echo $add_image_markup;
886
+ }
887
+
888
+ /**
889
+ * Add text to the bootom of the checkout page.
890
+ *
891
+ * @return void
892
+ */
893
+ function show_cartflows_copyright_message() {
894
+ $output_string = '';
895
+
896
+ $output_string .= '<div class="wcf-footer-primary">';
897
+ $output_string .= '<div class="wcf-footer-content">';
898
+ $output_string .= '<p class="wcf-footer-message">';
899
+ $output_string .= 'Checkout powered by CartFlows';
900
+ $output_string .= '</p>';
901
+ $output_string .= '</div>';
902
+ $output_string .= '</div>';
903
+
904
+ echo $output_string;
905
+ }
906
+
907
+ /**
908
+ * Redirect users to our checkout if hidden param
909
+ *
910
+ * @param string $redirect redirect url.
911
+ * @param object $user user.
912
+ * @return string
913
+ */
914
+ function after_login_redirect( $redirect, $user ) {
915
+
916
+ if ( isset( $_POST['_wcf_checkout_id'] ) ) {
917
+
918
+ $checkout_id = intval( $_POST['_wcf_checkout_id'] );
919
+
920
+ $redirect = get_permalink( $checkout_id );
921
+ }
922
+
923
+ return $redirect;
924
+ }
925
+
926
+ /**
927
+ * Display coupon code field after review order fields.
928
+ */
929
+ function display_custom_coupon_field() {
930
+
931
+ $coupon_enabled = apply_filters( 'woocommerce_coupons_enabled', true );
932
+
933
+ if ( ! $coupon_enabled ) {
934
+ return;
935
+ }
936
+
937
+ ob_start();
938
+
939
+ ?>
940
+ <div class="wcf-custom-coupon-field">
941
+ <div class="wcf-coupon-col-1">
942
+ <span>
943
+ <input type="text" name="coupon_code" class="input-text cf-coupon-code-input" placeholder="<?php echo $this->coupon_field_placeholder(); ?>" id="coupon_code" value="">
944
+ </span>
945
+ </div>
946
+ <div class="wcf-coupon-col-2">
947
+ <span>
948
+ <button type="button" class="button cf-submit-coupon wcf-btn-small" name="apply_coupon" value="Apply"><?php echo $this->coupon_button_text(); ?></button>
949
+ </span>
950
+ </div>
951
+ </div>
952
+
953
+ <?php
954
+
955
+ echo ob_get_clean();
956
+ }
957
+
958
+ /**
959
+ * Apply filter to change the placeholder text of coupon field.
960
+ *
961
+ * @return string
962
+ */
963
+ function coupon_field_placeholder() {
964
+ return apply_filters( 'cartflows_coupon_field_placeholder', __( 'Coupon Code', 'cartflows' ) );
965
+ }
966
+
967
+ /**
968
+ * Apply filter to change the button text of coupon field.
969
+ *
970
+ * @return string
971
+ */
972
+ function coupon_button_text() {
973
+ return apply_filters( 'cartflows_coupon_button_text', __( 'Apply', 'cartflows' ) );
974
+ }
975
+
976
+ /**
977
+ * Apply coupon on submit of custom coupon form.
978
+ */
979
+ function apply_coupon() {
980
+
981
+ check_ajax_referer( 'cf-apply-coupon', 'security' );
982
+
983
+ $result = WC()->cart->add_discount( sanitize_text_field( wp_unslash( $_POST['coupon_code'] ) ) );
984
+
985
+ echo json_encode( $result );
986
+ die();
987
+ }
988
+
989
+ /**
990
+ * Added ajax nonce to localize variable.
991
+ *
992
+ * @param array $vars localize variables.
993
+ */
994
+ function add_localize_vars( $vars ) {
995
+
996
+ $vars['cf_validate_coupon_nonce'] = wp_create_nonce( 'cf-apply-coupon' );
997
+
998
+ $vars['allow_persistance'] = apply_filters( 'cartflows_allow_persistace', 'yes' );
999
+
1000
+ return $vars;
1001
+ }
1002
+
1003
+ /**
1004
+ * Add custom class to the fields to change the UI to three column.
1005
+ *
1006
+ * @param array $fields fields.
1007
+ */
1008
+ function add_three_column_layout_fields( $fields ) {
1009
+
1010
+ if ( empty( $fields['billing']['billing_address_2'] ) ) {
1011
+
1012
+ if ( isset( $fields['billing']['billing_address_1'] ) && is_array( $fields['billing']['billing_address_1'] ) ) {
1013
+ $fields['billing']['billing_address_1']['class'][] = 'form-row-full';
1014
+ }
1015
+ }
1016
+
1017
+ if ( ! empty( $fields['billing']['billing_company'] ) ) {
1018
+
1019
+ if ( isset( $fields['billing']['billing_company'] ) && is_array( $fields['billing']['billing_company'] ) ) {
1020
+ $fields['billing']['billing_company']['class'][] = 'form-row-full';
1021
+ }
1022
+ }
1023
+
1024
+ if ( ! empty( $fields['shipping']['shipping_company'] ) ) {
1025
+
1026
+ if ( isset( $fields['shipping']['shipping_company'] ) && is_array( $fields['shipping']['shipping_company'] ) ) {
1027
+ $fields['shipping']['shipping_company']['class'][] = 'form-row-full';
1028
+ }
1029
+ }
1030
+
1031
+ if ( ! empty( $fields['billing']['billing_country'] ) ) {
1032
+
1033
+ if ( isset( $fields['billing']['billing_country'] ) && is_array( $fields['billing']['billing_country'] ) ) {
1034
+ $fields['billing']['billing_country']['class'][] = 'form-row-full';
1035
+ }
1036
+ }
1037
+
1038
+ if ( ! empty( $fields['shipping']['shipping_country'] ) ) {
1039
+
1040
+ if ( isset( $fields['shipping']['shipping_country'] ) && is_array( $fields['shipping']['shipping_country'] ) ) {
1041
+ $fields['shipping']['shipping_country']['class'][] = 'form-row-full';
1042
+ }
1043
+ }
1044
+
1045
+ if ( ! empty( $fields['billing']['billing_phone'] ) ) {
1046
+
1047
+ if ( isset( $fields['billing']['billing_phone'] ) && is_array( $fields['billing']['billing_phone'] ) ) {
1048
+ $fields['billing']['billing_phone']['class'][] = 'form-row-full';
1049
+ }
1050
+ }
1051
+
1052
+ if ( ! empty( $fields['billing']['billing_email'] ) ) {
1053
+
1054
+ if ( isset( $fields['billing']['billing_email'] ) && is_array( $fields['billing']['billing_email'] ) ) {
1055
+ $fields['billing']['billing_email']['class'][] = 'form-row-full';
1056
+ }
1057
+ }
1058
+
1059
+ if ( empty( $fields['shipping']['shipping_address_2'] ) ) {
1060
+
1061
+ if ( isset( $fields['shipping']['shipping_address_1'] ) && is_array( $fields['shipping']['shipping_address_1'] ) ) {
1062
+ $fields['shipping']['shipping_address_1']['class'][] = 'form-row-full';
1063
+ }
1064
+ }
1065
+
1066
+ if ( isset( $fields['billing']['billing_city'] ) &&
1067
+ isset( $fields['billing']['billing_state'] ) && isset( $fields['billing']['billing_postcode'] ) ) {
1068
+
1069
+ $fields['billing']['billing_city']['class'][] = 'wcf-column-33';
1070
+ $fields['billing']['billing_state']['class'][] = 'wcf-column-33';
1071
+ $fields['billing']['billing_postcode']['class'][] = 'wcf-column-33';
1072
+ }
1073
+
1074
+ if ( isset( $fields['shipping']['shipping_city'] ) &&
1075
+ isset( $fields['shipping']['shipping_state'] ) && isset( $fields['shipping']['shipping_postcode'] ) ) {
1076
+
1077
+ $fields['shipping']['shipping_city']['class'][] = 'wcf-column-33';
1078
+ $fields['shipping']['shipping_state']['class'][] = 'wcf-column-33';
1079
+ $fields['shipping']['shipping_postcode']['class'][] = 'wcf-column-33';
1080
+ }
1081
+
1082
+ return $fields;
1083
+ }
1084
+
1085
+ /**
1086
+ * Add opening dev
1087
+ *
1088
+ * @since 1.0.0
1089
+ */
1090
+ function order_wrap_div_start() {
1091
+
1092
+ echo "<div class='wcf-order-wrap'> ";
1093
+ }
1094
+
1095
+ /**
1096
+ * Add closing dev
1097
+ *
1098
+ * @since 1.0.0
1099
+ */
1100
+ function order_wrap_div_end() {
1101
+
1102
+ echo '</div> ';
1103
+ }
1104
+ }
1105
+
1106
+ /**
1107
+ * Kicking this off by calling 'get_instance()' method
1108
+ */
1109
+ Cartflows_Checkout_Markup::get_instance();
modules/flow/classes/class-cartflows-step-post-type.php CHANGED
@@ -1,450 +1,465 @@
1
- <?php
2
- /**
3
- * Step post type.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Initialization
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Step_Post_Type {
14
-
15
-
16
- /**
17
- * Member Variable
18
- *
19
- * @var instance
20
- */
21
- private static $instance;
22
-
23
- /**
24
- * Member Variable
25
- *
26
- * @var body_classes
27
- */
28
- private $body_classes = array();
29
-
30
- /**
31
- * Initiator
32
- */
33
- public static function get_instance() {
34
- if ( ! isset( self::$instance ) ) {
35
- self::$instance = new self;
36
- }
37
- return self::$instance;
38
- }
39
-
40
- /**
41
- * Constructor
42
- */
43
- public function __construct() {
44
-
45
- add_action( 'init', array( $this, 'step_post_type' ) );
46
- add_action( 'init', array( $this, 'add_wp_templates_support' ) );
47
- add_filter( 'post_updated_messages', array( $this, 'post_update_messages' ) );
48
- add_filter( 'post_type_link', array( $this, 'post_type_permalinks' ), 10, 3 );
49
- add_filter( 'wp_unique_post_slug', array( $this, 'prevent_slug_duplicates' ), 10, 6 );
50
- add_action( 'pre_get_posts', array( $this, 'add_cpt_post_names_to_main_query' ) );
51
-
52
- add_filter( 'template_include', array( $this, 'load_page_template' ), 99 );
53
- }
54
-
55
-
56
- /**
57
- * Trys to load page.php for a header, footer or part theme layout.
58
- *
59
- * @since 1.0.0
60
- * @param string $template The current template to be loaded.
61
- * @return string
62
- */
63
- function load_page_template( $template ) {
64
-
65
- global $post;
66
-
67
- if ( 'string' == gettype( $template ) && is_object( $post ) && CARTFLOWS_STEP_POST_TYPE === $post->post_type ) {
68
-
69
- /**
70
- * Remove Next/Prev Navigation
71
- * add_filter('next_post_link', '__return_empty_string');
72
- * add_filter('previous_post_link', '__return_empty_string');
73
- *
74
- * $page = locate_template( array( 'page.php' ) );
75
- *
76
- * if ( ! empty( $page ) ) {
77
- * return $page;
78
- * }
79
- */
80
-
81
- $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
82
-
83
- $page_template = apply_filters( 'cartflows_page_template', $page_template );
84
-
85
- $file = '';
86
-
87
- switch ( $page_template ) {
88
-
89
- case 'cartflows-default':
90
- $file = CARTFLOWS_FLOW_DIR . 'templates/template-default.php';
91
- $this->body_classes[] = $page_template;
92
- break;
93
- case 'cartflows-canvas':
94
- $file = CARTFLOWS_FLOW_DIR . 'templates/template-canvas.php';
95
- $this->body_classes[] = $page_template;
96
- break;
97
- default:
98
- $file = CARTFLOWS_FLOW_DIR . 'templates/template-default.php';
99
- $this->body_classes[] = 'cartflows-default';
100
- break;
101
- }
102
-
103
- // Just to be safe, we check if the file exist first.
104
- if ( file_exists( $file ) ) {
105
-
106
- /* Add Body Class */
107
- add_filter( 'body_class', [ $this, 'body_class' ] );
108
-
109
- return $file;
110
- } else {
111
- echo $file;
112
- }
113
- }
114
-
115
- return $template;
116
- }
117
-
118
- /**
119
- * Body classes.
120
- *
121
- * @since 1.0.0
122
- * @param array $classes Body classes.
123
- * @return array
124
- */
125
- function body_class( $classes = [] ) {
126
-
127
- $classes = array_merge( $classes, $this->body_classes );
128
-
129
- return $classes;
130
- }
131
-
132
- /**
133
- * Create custom post type
134
- */
135
- function step_post_type() {
136
-
137
- $labels = array(
138
- 'name' => esc_html_x( 'Steps', 'flow step general name', 'cartflows' ),
139
- 'singular_name' => esc_html_x( 'Step', 'flow step singular name', 'cartflows' ),
140
- 'search_items' => esc_html__( 'Search Steps', 'cartflows' ),
141
- 'all_items' => esc_html__( 'All Steps', 'cartflows' ),
142
- 'edit_item' => esc_html__( 'Edit Step', 'cartflows' ),
143
- 'view_item' => esc_html__( 'View Step', 'cartflows' ),
144
- 'add_new' => esc_html__( 'Add New', 'cartflows' ),
145
- 'update_item' => esc_html__( 'Update Step', 'cartflows' ),
146
- 'add_new_item' => esc_html__( 'Add New', 'cartflows' ),
147
- 'new_item_name' => esc_html__( 'New Step Name', 'cartflows' ),
148
- );
149
-
150
- $args = array(
151
- 'labels' => $labels,
152
- 'public' => true,
153
- 'query_var' => true,
154
- 'can_export' => true,
155
- 'exclude_from_search' => true,
156
- 'show_ui' => true,
157
- 'show_in_menu' => false,
158
- 'show_in_admin_bar' => true,
159
- 'supports' => array( 'title', 'editor', 'elementor' ),
160
- 'capability_type' => 'post',
161
- 'capabilities' => array(
162
- 'create_posts' => 'do_not_allow', // Prior to Wordpress 4.5, this was false.
163
- ),
164
- 'map_meta_cap' => true,
165
- );
166
-
167
- register_post_type( CARTFLOWS_STEP_POST_TYPE, $args );
168
-
169
- $args = array(
170
- 'label' => __( 'Step Type', 'cartflows' ),
171
- 'public' => false,
172
- 'rewrite' => false,
173
- 'hierarchical' => false,
174
- );
175
-
176
- register_taxonomy( CARTFLOWS_TAXONOMY_STEP_TYPE, CARTFLOWS_STEP_POST_TYPE, $args );
177
-
178
- $args = array(
179
- 'label' => __( 'Step Flow', 'cartflows' ),
180
- 'public' => false,
181
- 'rewrite' => false,
182
- 'hierarchical' => false,
183
- );
184
-
185
- register_taxonomy( CARTFLOWS_TAXONOMY_STEP_FLOW, CARTFLOWS_STEP_POST_TYPE, $args );
186
-
187
- /**
188
- * Register 'Elementor' & 'Beaver Builder' site types.
189
- *
190
- * @see self::add_terms();
191
- */
192
- $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
193
-
194
- $terms = array(
195
- array(
196
- 'name' => __( 'Landing', 'cartflows' ),
197
- 'args' => array(
198
- 'slug' => 'landing',
199
- ),
200
- ),
201
- array(
202
- 'name' => __( 'Checkout', 'cartflows' ),
203
- 'args' => array(
204
- 'slug' => 'checkout',
205
- ),
206
- ),
207
- array(
208
- 'name' => __( 'Thank You', 'cartflows' ),
209
- 'args' => array(
210
- 'slug' => 'thankyou',
211
- ),
212
- ),
213
- array(
214
- 'name' => __( 'Upsell', 'cartflows' ),
215
- 'args' => array(
216
- 'slug' => 'upsell',
217
- ),
218
- ),
219
- array(
220
- 'name' => __( 'Downsell', 'cartflows' ),
221
- 'args' => array(
222
- 'slug' => 'downsell',
223
- ),
224
- ),
225
- );
226
-
227
- $this->add_terms( $taxonomy, $terms );
228
- }
229
-
230
- /**
231
- * Add WordPress templates.
232
- *
233
- * Adds Cartflows templates to steps
234
- *
235
- * @since 1.0.0
236
- * @access public
237
- */
238
- function add_wp_templates_support() {
239
- add_filter( 'theme_' . CARTFLOWS_STEP_POST_TYPE . '_templates', array( $this, 'add_page_templates' ), 99, 4 );
240
- }
241
-
242
- /**
243
- * Add page templates.
244
- *
245
- * @since 1.0.0
246
- * @access public
247
- *
248
- * @param array $page_templates Array of page templates.
249
- *
250
- * @param object $wp_theme wp theme.
251
- * @param object $post post.
252
- *
253
- * @return array Page templates.
254
- */
255
- function add_page_templates( $page_templates, $wp_theme, $post ) {
256
-
257
- $page_templates = array(
258
- 'cartflows-canvas' => _x( 'Template for Page Builders', 'cartflows' ),
259
- );
260
-
261
- return $page_templates;
262
- }
263
-
264
- /**
265
- * Have WordPress match postname to any of our public post types.
266
- * All of our public post types can have /post-name/ as the slug, so they need to be unique across all posts.
267
- * By default, WordPress only accounts for posts and pages where the slug is /post-name/.
268
- *
269
- * @param string $query query statement.
270
- */
271
- function add_cpt_post_names_to_main_query( $query ) {
272
-
273
- // Bail if this is not the main query.
274
- if ( ! $query->is_main_query() ) {
275
- return;
276
- }
277
- // Bail if this query doesn't match our very specific rewrite rule.
278
- if ( ! isset( $query->query['page'] ) || 2 !== count( $query->query ) ) {
279
- return;
280
- }
281
- // Bail if we're not querying based on the post name.
282
- if ( empty( $query->query['name'] ) ) {
283
- return;
284
- }
285
- // Add CPT to the list of post types WP will include when it queries based on the post name.
286
- $query->set( 'post_type', array( 'post', 'page', CARTFLOWS_STEP_POST_TYPE ) );
287
- }
288
-
289
- /**
290
- * Modify permalink
291
- *
292
- * @param string $post_link post link.
293
- * @param array $post post data.
294
- * @param string $leavename leave name.
295
- * @return string
296
- */
297
- function post_type_permalinks( $post_link, $post, $leavename ) {
298
-
299
- // If elementor page preview, return post link as it is.
300
- if ( isset( $_REQUEST['elementor-preview'] ) ) {
301
- return $post_link;
302
- }
303
-
304
- $structure = get_option( 'permalink_structure' );
305
-
306
- if ( '/%postname%/' === $structure ) {
307
-
308
- if ( isset( $post->post_type ) && CARTFLOWS_STEP_POST_TYPE == $post->post_type ) {
309
-
310
- $post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
311
- }
312
- }
313
-
314
- return $post_link;
315
- }
316
-
317
- /**
318
- * Prevent slug duplicated
319
- *
320
- * @param string $slug post slug.
321
- * @param int $post_ID post id.
322
- * @param string $post_status post status.
323
- * @param string $post_type post type.
324
- * @param int $post_parent post parent id.
325
- * @param string $original_slug original slug.
326
- * @return string
327
- */
328
- function prevent_slug_duplicates( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) {
329
-
330
- $check_post_types = array(
331
- 'post',
332
- 'page',
333
- CARTFLOWS_STEP_POST_TYPE,
334
- );
335
-
336
- if ( ! in_array( $post_type, $check_post_types ) ) {
337
- return $slug;
338
- }
339
-
340
- if ( CARTFLOWS_STEP_POST_TYPE == $post_type ) {
341
- // Saving a post, check for duplicates in POST or PAGE post types.
342
- $post_match = get_page_by_path( $slug, 'OBJECT', 'post' );
343
- $page_match = get_page_by_path( $slug, 'OBJECT', 'page' );
344
-
345
- if ( $post_match || $page_match ) {
346
- $slug .= '-2';
347
- }
348
- } else {
349
-
350
- // Saving a POST or PAGE, check for duplicates in CARTFLOWS_STEP_POST_TYPE post type.
351
- $custom_post_type_match = get_page_by_path( $slug, 'OBJECT', CARTFLOWS_STEP_POST_TYPE );
352
-
353
- if ( $custom_post_type_match ) {
354
- $slug .= '-2';
355
- }
356
- }
357
-
358
- return $slug;
359
- }
360
-
361
- /**
362
- * Add Update messages for any custom post type
363
- *
364
- * @param array $messages Array of default messages.
365
- */
366
- function post_update_messages( $messages ) {
367
-
368
- $custom_post_type = get_post_type( get_the_ID() );
369
-
370
- if ( CARTFLOWS_STEP_POST_TYPE == $custom_post_type ) {
371
-
372
- $obj = get_post_type_object( $custom_post_type );
373
- $singular_name = $obj->labels->singular_name;
374
- $messages[ $custom_post_type ] = array(
375
- 0 => '', // Unused. Messages start at index 1.
376
- /* translators: %s: singular custom post type name */
377
- 1 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
378
- /* translators: %s: singular custom post type name */
379
- 2 => sprintf( __( 'Custom %s updated.', 'cartflows' ), $singular_name ),
380
- /* translators: %s: singular custom post type name */
381
- 3 => sprintf( __( 'Custom %s deleted.', 'cartflows' ), $singular_name ),
382
- /* translators: %s: singular custom post type name */
383
- 4 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
384
- /* translators: %1$s: singular custom post type name ,%2$s: date and time of the revision */
385
- 5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s', 'cartflows' ), $singular_name, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
386
- /* translators: %s: singular custom post type name */
387
- 6 => sprintf( __( '%s published.', 'cartflows' ), $singular_name ),
388
- /* translators: %s: singular custom post type name */
389
- 7 => sprintf( __( '%s saved.', 'cartflows' ), $singular_name ),
390
- /* translators: %s: singular custom post type name */
391
- 8 => sprintf( __( '%s submitted.', 'cartflows' ), $singular_name ),
392
- /* translators: %s: singular custom post type name */
393
- 9 => sprintf( __( '%s scheduled for.', 'cartflows' ), $singular_name ),
394
- /* translators: %s: singular custom post type name */
395
- 10 => sprintf( __( '%s draft updated.', 'cartflows' ), $singular_name ),
396
- );
397
- }
398
-
399
- return $messages;
400
- }
401
-
402
- /**
403
- * Add Terms for Taxonomy.
404
- *
405
- * => Example.
406
- *
407
- * $taxonomy = '{taxonomy}';
408
- * $terms = array(
409
- * array(
410
- * 'name' => 'Free',
411
- * ),
412
- * array(
413
- * 'name' => 'Premium',
414
- * ),
415
- * );
416
- *
417
- * self::add_terms( $taxonomy, $terms );
418
- *
419
- * @since 1.0.0
420
- * @param string $taxonomy Taxonomy Name.
421
- * @param array $terms Terms list.
422
- * @return void
423
- */
424
- function add_terms( $taxonomy = '', $terms = array() ) {
425
-
426
- foreach ( $terms as $key => $term ) {
427
-
428
- $term_exist = term_exists( $term['name'], $taxonomy );
429
-
430
- if ( empty( $term_exist ) ) {
431
-
432
- /**
433
- * Add additional args if passed from request.
434
- *
435
- * @see https://codex.wordpress.org/Function_Reference/wp_insert_term
436
- */
437
- if ( array_key_exists( 'args', $term ) ) {
438
- wp_insert_term( $term['name'], $taxonomy, $term['args'] );
439
- } else {
440
- wp_insert_term( $term['name'], $taxonomy );
441
- }
442
- }
443
- }
444
- }
445
- }
446
-
447
- /**
448
- * Kicking this off by calling 'get_instance()' method
449
- */
450
- Cartflows_Step_Post_Type::get_instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Step post type.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Initialization
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Step_Post_Type {
14
+
15
+
16
+ /**
17
+ * Member Variable
18
+ *
19
+ * @var instance
20
+ */
21
+ private static $instance;
22
+
23
+ /**
24
+ * Member Variable
25
+ *
26
+ * @var body_classes
27
+ */
28
+ private $body_classes = array();
29
+
30
+ /**
31
+ * Initiator
32
+ */
33
+ public static function get_instance() {
34
+ if ( ! isset( self::$instance ) ) {
35
+ self::$instance = new self;
36
+ }
37
+ return self::$instance;
38
+ }
39
+
40
+ /**
41
+ * Constructor
42
+ */
43
+ public function __construct() {
44
+
45
+ add_action( 'init', array( $this, 'step_post_type' ) );
46
+ add_action( 'init', array( $this, 'add_wp_templates_support' ) );
47
+ add_filter( 'post_updated_messages', array( $this, 'post_update_messages' ) );
48
+ add_filter( 'post_type_link', array( $this, 'post_type_permalinks' ), 10, 3 );
49
+ add_filter( 'wp_unique_post_slug', array( $this, 'prevent_slug_duplicates' ), 10, 6 );
50
+ add_action( 'pre_get_posts', array( $this, 'add_cpt_post_names_to_main_query' ), 20 );
51
+
52
+ add_filter( 'template_include', array( $this, 'load_page_template' ), 99 );
53
+ }
54
+
55
+
56
+ /**
57
+ * Trys to load page.php for a header, footer or part theme layout.
58
+ *
59
+ * @since 1.0.0
60
+ * @param string $template The current template to be loaded.
61
+ * @return string
62
+ */
63
+ function load_page_template( $template ) {
64
+
65
+ global $post;
66
+
67
+ if ( 'string' == gettype( $template ) && is_object( $post ) && CARTFLOWS_STEP_POST_TYPE === $post->post_type ) {
68
+
69
+ /**
70
+ * Remove Next/Prev Navigation
71
+ * add_filter('next_post_link', '__return_empty_string');
72
+ * add_filter('previous_post_link', '__return_empty_string');
73
+ *
74
+ * $page = locate_template( array( 'page.php' ) );
75
+ *
76
+ * if ( ! empty( $page ) ) {
77
+ * return $page;
78
+ * }
79
+ */
80
+
81
+ $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
82
+
83
+ $page_template = apply_filters( 'cartflows_page_template', $page_template );
84
+
85
+ $file = '';
86
+
87
+ switch ( $page_template ) {
88
+
89
+ case 'cartflows-default':
90
+ $file = CARTFLOWS_FLOW_DIR . 'templates/template-default.php';
91
+ $this->body_classes[] = $page_template;
92
+ break;
93
+ case 'cartflows-canvas':
94
+ $file = CARTFLOWS_FLOW_DIR . 'templates/template-canvas.php';
95
+ $this->body_classes[] = $page_template;
96
+ break;
97
+ default:
98
+ $file = CARTFLOWS_FLOW_DIR . 'templates/template-default.php';
99
+ $this->body_classes[] = 'cartflows-default';
100
+ break;
101
+ }
102
+
103
+ // Just to be safe, we check if the file exist first.
104
+ if ( file_exists( $file ) ) {
105
+
106
+ /* Add Body Class */
107
+ add_filter( 'body_class', [ $this, 'body_class' ] );
108
+
109
+ return $file;
110
+ } else {
111
+ echo $file;
112
+ }
113
+ }
114
+
115
+ return $template;
116
+ }
117
+
118
+ /**
119
+ * Body classes.
120
+ *
121
+ * @since 1.0.0
122
+ * @param array $classes Body classes.
123
+ * @return array
124
+ */
125
+ function body_class( $classes = [] ) {
126
+
127
+ $classes = array_merge( $classes, $this->body_classes );
128
+
129
+ return $classes;
130
+ }
131
+
132
+ /**
133
+ * Create custom post type
134
+ */
135
+ function step_post_type() {
136
+
137
+ $labels = array(
138
+ 'name' => esc_html_x( 'Steps', 'flow step general name', 'cartflows' ),
139
+ 'singular_name' => esc_html_x( 'Step', 'flow step singular name', 'cartflows' ),
140
+ 'search_items' => esc_html__( 'Search Steps', 'cartflows' ),
141
+ 'all_items' => esc_html__( 'All Steps', 'cartflows' ),
142
+ 'edit_item' => esc_html__( 'Edit Step', 'cartflows' ),
143
+ 'view_item' => esc_html__( 'View Step', 'cartflows' ),
144
+ 'add_new' => esc_html__( 'Add New', 'cartflows' ),
145
+ 'update_item' => esc_html__( 'Update Step', 'cartflows' ),
146
+ 'add_new_item' => esc_html__( 'Add New', 'cartflows' ),
147
+ 'new_item_name' => esc_html__( 'New Step Name', 'cartflows' ),
148
+ );
149
+
150
+ $args = array(
151
+ 'labels' => $labels,
152
+ 'public' => true,
153
+ 'query_var' => true,
154
+ 'can_export' => true,
155
+ 'exclude_from_search' => true,
156
+ 'show_ui' => true,
157
+ 'show_in_menu' => false,
158
+ 'show_in_admin_bar' => true,
159
+ 'supports' => array( 'title', 'editor', 'elementor' ),
160
+ 'capability_type' => 'post',
161
+ 'capabilities' => array(
162
+ 'create_posts' => 'do_not_allow', // Prior to Wordpress 4.5, this was false.
163
+ ),
164
+ 'map_meta_cap' => true,
165
+ );
166
+
167
+ register_post_type( CARTFLOWS_STEP_POST_TYPE, $args );
168
+
169
+ $args = array(
170
+ 'label' => __( 'Step Type', 'cartflows' ),
171
+ 'public' => false,
172
+ 'rewrite' => false,
173
+ 'hierarchical' => false,
174
+ );
175
+
176
+ register_taxonomy( CARTFLOWS_TAXONOMY_STEP_TYPE, CARTFLOWS_STEP_POST_TYPE, $args );
177
+
178
+ $args = array(
179
+ 'label' => __( 'Step Flow', 'cartflows' ),
180
+ 'public' => false,
181
+ 'rewrite' => false,
182
+ 'hierarchical' => false,
183
+ );
184
+
185
+ register_taxonomy( CARTFLOWS_TAXONOMY_STEP_FLOW, CARTFLOWS_STEP_POST_TYPE, $args );
186
+
187
+ /**
188
+ * Register 'Elementor' & 'Beaver Builder' site types.
189
+ *
190
+ * @see self::add_terms();
191
+ */
192
+ $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
193
+
194
+ $terms = array(
195
+ array(
196
+ 'name' => __( 'Landing', 'cartflows' ),
197
+ 'args' => array(
198
+ 'slug' => 'landing',
199
+ ),
200
+ ),
201
+ array(
202
+ 'name' => __( 'Checkout', 'cartflows' ),
203
+ 'args' => array(
204
+ 'slug' => 'checkout',
205
+ ),
206
+ ),
207
+ array(
208
+ 'name' => __( 'Thank You', 'cartflows' ),
209
+ 'args' => array(
210
+ 'slug' => 'thankyou',
211
+ ),
212
+ ),
213
+ array(
214
+ 'name' => __( 'Upsell', 'cartflows' ),
215
+ 'args' => array(
216
+ 'slug' => 'upsell',
217
+ ),
218
+ ),
219
+ array(
220
+ 'name' => __( 'Downsell', 'cartflows' ),
221
+ 'args' => array(
222
+ 'slug' => 'downsell',
223
+ ),
224
+ ),
225
+ );
226
+
227
+ $this->add_terms( $taxonomy, $terms );
228
+ }
229
+
230
+ /**
231
+ * Add WordPress templates.
232
+ *
233
+ * Adds Cartflows templates to steps
234
+ *
235
+ * @since 1.0.0
236
+ * @access public
237
+ */
238
+ function add_wp_templates_support() {
239
+ add_filter( 'theme_' . CARTFLOWS_STEP_POST_TYPE . '_templates', array( $this, 'add_page_templates' ), 99, 4 );
240
+ }
241
+
242
+ /**
243
+ * Add page templates.
244
+ *
245
+ * @since 1.0.0
246
+ * @access public
247
+ *
248
+ * @param array $page_templates Array of page templates.
249
+ *
250
+ * @param object $wp_theme wp theme.
251
+ * @param object $post post.
252
+ *
253
+ * @return array Page templates.
254
+ */
255
+ function add_page_templates( $page_templates, $wp_theme, $post ) {
256
+
257
+ $page_templates = array(
258
+ 'cartflows-canvas' => _x( 'Template for Page Builders', 'cartflows' ),
259
+ );
260
+
261
+ return $page_templates;
262
+ }
263
+
264
+ /**
265
+ * Have WordPress match postname to any of our public post types.
266
+ * All of our public post types can have /post-name/ as the slug, so they need to be unique across all posts.
267
+ * By default, WordPress only accounts for posts and pages where the slug is /post-name/.
268
+ *
269
+ * @param string $query query statement.
270
+ */
271
+ function add_cpt_post_names_to_main_query( $query ) {
272
+
273
+ // Bail if this is not the main query.
274
+ if ( ! $query->is_main_query() ) {
275
+ return;
276
+ }
277
+
278
+ // Bail if this query doesn't match our very specific rewrite rule.
279
+ if ( ! isset( $query->query['page'] ) || 2 !== count( $query->query ) ) {
280
+ return;
281
+ }
282
+
283
+ // Bail if we're not querying based on the post name.
284
+ if ( empty( $query->query['name'] ) ) {
285
+ return;
286
+ }
287
+
288
+ // Add cartflows step post type to existing post type array.
289
+ if ( isset( $query->query_vars['post_type'] ) && is_array( $query->query_vars['post_type'] ) ) {
290
+
291
+ $post_types = $query->query_vars['post_type'];
292
+
293
+ $post_types[] = CARTFLOWS_STEP_POST_TYPE;
294
+
295
+ $query->set( 'post_type', $post_types );
296
+
297
+ } else {
298
+
299
+ // Add CPT to the list of post types WP will include when it queries based on the post name.
300
+ $query->set( 'post_type', array( 'post', 'page', CARTFLOWS_STEP_POST_TYPE ) );
301
+ }
302
+ }
303
+
304
+ /**
305
+ * Modify permalink
306
+ *
307
+ * @param string $post_link post link.
308
+ * @param array $post post data.
309
+ * @param string $leavename leave name.
310
+ * @return string
311
+ */
312
+ function post_type_permalinks( $post_link, $post, $leavename ) {
313
+
314
+ // If elementor page preview, return post link as it is.
315
+ if ( isset( $_REQUEST['elementor-preview'] ) ) {
316
+ return $post_link;
317
+ }
318
+
319
+ $structure = get_option( 'permalink_structure' );
320
+
321
+ if ( '/%postname%/' === $structure ) {
322
+
323
+ if ( isset( $post->post_type ) && CARTFLOWS_STEP_POST_TYPE == $post->post_type ) {
324
+
325
+ $post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
326
+ }
327
+ }
328
+
329
+ return $post_link;
330
+ }
331
+
332
+ /**
333
+ * Prevent slug duplicated
334
+ *
335
+ * @param string $slug post slug.
336
+ * @param int $post_ID post id.
337
+ * @param string $post_status post status.
338
+ * @param string $post_type post type.
339
+ * @param int $post_parent post parent id.
340
+ * @param string $original_slug original slug.
341
+ * @return string
342
+ */
343
+ function prevent_slug_duplicates( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) {
344
+
345
+ $check_post_types = array(
346
+ 'post',
347
+ 'page',
348
+ CARTFLOWS_STEP_POST_TYPE,
349
+ );
350
+
351
+ if ( ! in_array( $post_type, $check_post_types ) ) {
352
+ return $slug;
353
+ }
354
+
355
+ if ( CARTFLOWS_STEP_POST_TYPE == $post_type ) {
356
+ // Saving a post, check for duplicates in POST or PAGE post types.
357
+ $post_match = get_page_by_path( $slug, 'OBJECT', 'post' );
358
+ $page_match = get_page_by_path( $slug, 'OBJECT', 'page' );
359
+
360
+ if ( $post_match || $page_match ) {
361
+ $slug .= '-2';
362
+ }
363
+ } else {
364
+
365
+ // Saving a POST or PAGE, check for duplicates in CARTFLOWS_STEP_POST_TYPE post type.
366
+ $custom_post_type_match = get_page_by_path( $slug, 'OBJECT', CARTFLOWS_STEP_POST_TYPE );
367
+
368
+ if ( $custom_post_type_match ) {
369
+ $slug .= '-2';
370
+ }
371
+ }
372
+
373
+ return $slug;
374
+ }
375
+
376
+ /**
377
+ * Add Update messages for any custom post type
378
+ *
379
+ * @param array $messages Array of default messages.
380
+ */
381
+ function post_update_messages( $messages ) {
382
+
383
+ $custom_post_type = get_post_type( get_the_ID() );
384
+
385
+ if ( CARTFLOWS_STEP_POST_TYPE == $custom_post_type ) {
386
+
387
+ $obj = get_post_type_object( $custom_post_type );
388
+ $singular_name = $obj->labels->singular_name;
389
+ $messages[ $custom_post_type ] = array(
390
+ 0 => '', // Unused. Messages start at index 1.
391
+ /* translators: %s: singular custom post type name */
392
+ 1 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
393
+ /* translators: %s: singular custom post type name */
394
+ 2 => sprintf( __( 'Custom %s updated.', 'cartflows' ), $singular_name ),
395
+ /* translators: %s: singular custom post type name */
396
+ 3 => sprintf( __( 'Custom %s deleted.', 'cartflows' ), $singular_name ),
397
+ /* translators: %s: singular custom post type name */
398
+ 4 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
399
+ /* translators: %1$s: singular custom post type name ,%2$s: date and time of the revision */
400
+ 5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s', 'cartflows' ), $singular_name, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
401
+ /* translators: %s: singular custom post type name */
402
+ 6 => sprintf( __( '%s published.', 'cartflows' ), $singular_name ),
403
+ /* translators: %s: singular custom post type name */
404
+ 7 => sprintf( __( '%s saved.', 'cartflows' ), $singular_name ),
405
+ /* translators: %s: singular custom post type name */
406
+ 8 => sprintf( __( '%s submitted.', 'cartflows' ), $singular_name ),
407
+ /* translators: %s: singular custom post type name */
408
+ 9 => sprintf( __( '%s scheduled for.', 'cartflows' ), $singular_name ),
409
+ /* translators: %s: singular custom post type name */
410
+ 10 => sprintf( __( '%s draft updated.', 'cartflows' ), $singular_name ),
411
+ );
412
+ }
413
+
414
+ return $messages;
415
+ }
416
+
417
+ /**
418
+ * Add Terms for Taxonomy.
419
+ *
420
+ * => Example.
421
+ *
422
+ * $taxonomy = '{taxonomy}';
423
+ * $terms = array(
424
+ * array(
425
+ * 'name' => 'Free',
426
+ * ),
427
+ * array(
428
+ * 'name' => 'Premium',
429
+ * ),
430
+ * );
431
+ *
432
+ * self::add_terms( $taxonomy, $terms );
433
+ *
434
+ * @since 1.0.0
435
+ * @param string $taxonomy Taxonomy Name.
436
+ * @param array $terms Terms list.
437
+ * @return void
438
+ */
439
+ function add_terms( $taxonomy = '', $terms = array() ) {
440
+
441
+ foreach ( $terms as $key => $term ) {
442
+
443
+ $term_exist = term_exists( $term['name'], $taxonomy );
444
+
445
+ if ( empty( $term_exist ) ) {
446
+
447
+ /**
448
+ * Add additional args if passed from request.
449
+ *
450
+ * @see https://codex.wordpress.org/Function_Reference/wp_insert_term
451
+ */
452
+ if ( array_key_exists( 'args', $term ) ) {
453
+ wp_insert_term( $term['name'], $taxonomy, $term['args'] );
454
+ } else {
455
+ wp_insert_term( $term['name'], $taxonomy );
456
+ }
457
+ }
458
+ }
459
+ }
460
+ }
461
+
462
+ /**
463
+ * Kicking this off by calling 'get_instance()' method
464
+ */
465
+ Cartflows_Step_Post_Type::get_instance();
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: woocommerce, cart
5
  Requires at least: 4.4
6
  Requires PHP: 5.6
7
  Tested up to: 5.0.2
8
- Stable tag: 1.1.5
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -93,6 +93,13 @@ Say goodby to using the same ridgid checkout page that everyone else is using. C
93
  2. Activate the plugin through the 'Plugins' menu in WordPress
94
 
95
  == Changelog ==
 
 
 
 
 
 
 
96
  = Version 1.1.5 - Wednesday, 23rd January 2019 =
97
  * Fix: Beaver Builder Pro version conflict while installing templates.
98
  * Fix: Elementor builder white screen while editing checkout page and cart is empty.
5
  Requires at least: 4.4
6
  Requires PHP: 5.6
7
  Tested up to: 5.0.2
8
+ Stable tag: 1.1.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
93
  2. Activate the plugin through the 'Plugins' menu in WordPress
94
 
95
  == Changelog ==
96
+
97
+ = Version 1.1.6 - Thursday, 07th February 2019 =
98
+ * Improvement: Added compatibility for a future release of CartFlows Pro's checkout field editor.
99
+ * Fix: Permalink conflict with listing theme.
100
+ * Fix: Thrive architect template popup conflict.
101
+ * Fix: Coupon code not applied in case of multiple products selection option is selected.
102
+
103
  = Version 1.1.5 - Wednesday, 23rd January 2019 =
104
  * Fix: Beaver Builder Pro version conflict while installing templates.
105
  * Fix: Elementor builder white screen while editing checkout page and cart is empty.
woocommerce/template/cart/cart-shipping.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shipping Methods Display
4
+ *
5
+ * In 2.1 we show methods per package. This allows for multiple methods per order if so desired.
6
+ *
7
+ * This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-shipping.php.
8
+ *
9
+ * HOWEVER, on occasion WooCommerce will need to update template files and you
10
+ * (the theme developer) will need to copy the new files to your theme to
11
+ * maintain compatibility. We try to do this as little as possible, but it does
12
+ * happen. When this occurs the version of the template file will be bumped and
13
+ * the readme will list any important changes.
14
+ *
15
+ * @see https://docs.woocommerce.com/document/template-structure/
16
+ * @package WooCommerce/Templates
17
+ * @version 3.5.0
18
+ */
19
+
20
+ defined( 'ABSPATH' ) || exit;
21
+
22
+ $formatted_destination = isset( $formatted_destination ) ? $formatted_destination : WC()->countries->get_formatted_address( $package['destination'], ', ' );
23
+ $has_calculated_shipping = ! empty( $has_calculated_shipping );
24
+ $show_shipping_calculator = ! empty( $show_shipping_calculator );
25
+ $calculator_text = '';
26
+ ?>
27
+ <tr class="woocommerce-shipping-totals shipping">
28
+ <th><?php echo wp_kses_post( $package_name ); ?></th>
29
+ <td data-title="<?php echo esc_attr( $package_name ); ?>">
30
+ <?php if ( $available_methods ) : ?>
31
+ <ul id="shipping_method" class="woocommerce-shipping-methods">
32
+ <?php foreach ( $available_methods as $method ) : ?>
33
+ <li>
34
+ <?php
35
+ if ( 1 < count( $available_methods ) ) {
36
+ printf( '<input type="radio" name="shipping_method[%1$d]" data-index="%1$d" id="shipping_method_%1$d_%2$s" value="%3$s" class="shipping_method" %4$s />', $index, esc_attr( sanitize_title( $method->id ) ), esc_attr( $method->id ), checked( $method->id, $chosen_method, false ) ); // WPCS: XSS ok.
37
+ } else {
38
+ printf( '<input type="hidden" name="shipping_method[%1$d]" data-index="%1$d" id="shipping_method_%1$d_%2$s" value="%3$s" class="shipping_method" />', $index, esc_attr( sanitize_title( $method->id ) ), esc_attr( $method->id ) ); // WPCS: XSS ok.
39
+ }
40
+ printf( '<label for="shipping_method_%1$s_%2$s">%3$s</label>', $index, esc_attr( sanitize_title( $method->id ) ), wc_cart_totals_shipping_method_label( $method ) ); // WPCS: XSS ok.
41
+ do_action( 'woocommerce_after_shipping_rate', $method, $index );
42
+ ?>
43
+ </li>
44
+ <?php endforeach; ?>
45
+ </ul>
46
+ <?php if ( is_cart() ) : ?>
47
+ <p class="woocommerce-shipping-destination">
48
+ <?php
49
+ if ( $formatted_destination ) {
50
+ // Translators: $s shipping destination.
51
+ printf( esc_html__( 'Estimate for %s.', 'woocommerce' ) . ' ', '<strong>' . esc_html( $formatted_destination ) . '</strong>' );
52
+ $calculator_text = __( 'Change address', 'woocommerce' );
53
+ } else {
54
+ echo esc_html__( 'This is only an estimate. Prices will be updated during checkout.', 'woocommerce' );
55
+ }
56
+ ?>
57
+ </p>
58
+ <?php endif; ?>
59
+ <?php
60
+ elseif ( ! $has_calculated_shipping || ! $formatted_destination ) :
61
+ esc_html_e( 'Enter your address to view shipping options.', 'woocommerce' );
62
+ elseif ( ! is_cart() ) :
63
+ echo wp_kses_post( apply_filters( 'woocommerce_no_shipping_available_html', __( 'There are no shipping methods available. Please ensure that your address has been entered correctly, or contact us if you need any help.', 'woocommerce' ) ) );
64
+ else :
65
+ // Translators: $s shipping destination.
66
+ echo wp_kses_post( apply_filters( 'woocommerce_cart_no_shipping_available_html', sprintf( esc_html__( 'No shipping options were found for %s.', 'woocommerce' ) . ' ', '<strong>' . esc_html( $formatted_destination ) . '</strong>' ) ) );
67
+ $calculator_text = __( 'Enter a different address', 'woocommerce' );
68
+ endif;
69
+ ?>
70
+
71
+ <?php if ( $show_package_details ) : ?>
72
+ <?php echo '<p class="woocommerce-shipping-contents"><small>' . esc_html( $package_details ) . '</small></p>'; ?>
73
+ <?php endif; ?>
74
+
75
+ <?php if ( $show_shipping_calculator ) : ?>
76
+ <?php woocommerce_shipping_calculator( $calculator_text ); ?>
77
+ <?php endif; ?>
78
+ </td>
79
+ </tr>
woocommerce/template/checkout/form-billing.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Checkout billing information form
4
+ *
5
+ * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-billing.php.
6
+ *
7
+ * HOWEVER, on occasion WooCommerce will need to update template files and you
8
+ * (the theme developer) will need to copy the new files to your theme to
9
+ * maintain compatibility. We try to do this as little as possible, but it does
10
+ * happen. When this occurs the version of the template file will be bumped and
11
+ * the readme will list any important changes.
12
+ *
13
+ * @see https://docs.woocommerce.com/document/template-structure/
14
+ * @author WooThemes
15
+ * @package WooCommerce/Templates
16
+ * @version 3.0.9
17
+ */
18
+
19
+ if ( ! defined( 'ABSPATH' ) ) {
20
+ exit; // Exit if accessed directly.
21
+ }
22
+
23
+ ?>
24
+ <div class="woocommerce-billing-fields">
25
+ <?php if ( wc_ship_to_billing_address_only() && WC()->cart->needs_shipping() ) : ?>
26
+
27
+ <h3><?php _e( 'Billing &amp; Shipping', 'woocommerce' ); ?></h3>
28
+
29
+ <?php else : ?>
30
+
31
+ <h3><?php _e( 'Billing details', 'woocommerce' ); ?></h3>
32
+
33
+ <?php endif; ?>
34
+
35
+ <?php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); ?>
36
+
37
+ <div class="woocommerce-billing-fields__field-wrapper">
38
+ <?php
39
+ $fields = $checkout->get_checkout_fields( 'billing' );
40
+
41
+ foreach ( $fields as $key => $field ) {
42
+ if ( isset( $field['country_field'], $fields[ $field['country_field'] ] ) ) {
43
+ $field['country'] = $checkout->get_value( $field['country_field'] );
44
+ }
45
+ woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
46
+ }
47
+ ?>
48
+ </div>
49
+
50
+ <?php do_action( 'woocommerce_after_checkout_billing_form', $checkout ); ?>
51
+ </div>
52
+
53
+ <?php if ( ! is_user_logged_in() && $checkout->is_registration_enabled() ) : ?>
54
+ <div class="woocommerce-account-fields">
55
+ <?php if ( ! $checkout->is_registration_required() ) : ?>
56
+
57
+ <p class="form-row form-row-wide create-account">
58
+ <label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
59
+ <input class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" id="createaccount" <?php checked( ( true === $checkout->get_value( 'createaccount' ) || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true ); ?> type="checkbox" name="createaccount" value="1" /> <span><?php _e( 'Create an account?', 'woocommerce' ); ?></span>
60
+ </label>
61
+ </p>
62
+
63
+ <?php endif; ?>
64
+
65
+ <?php do_action( 'woocommerce_before_checkout_registration_form', $checkout ); ?>
66
+
67
+ <?php if ( $checkout->get_checkout_fields( 'account' ) ) : ?>
68
+
69
+ <div class="create-account">
70
+ <?php foreach ( $checkout->get_checkout_fields( 'account' ) as $key => $field ) : ?>
71
+ <?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>
72
+ <?php endforeach; ?>
73
+ <div class="clear"></div>
74
+ </div>
75
+
76
+ <?php endif; ?>
77
+
78
+ <?php do_action( 'woocommerce_after_checkout_registration_form', $checkout ); ?>
79
+ </div>
80
+ <?php endif; ?>
woocommerce/template/checkout/form-checkout.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Checkout Form
4
+ *
5
+ * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php.
6
+ *
7
+ * HOWEVER, on occasion WooCommerce will need to update template files and you
8
+ * (the theme developer) will need to copy the new files to your theme to
9
+ * maintain compatibility. We try to do this as little as possible, but it does
10
+ * happen. When this occurs the version of the template file will be bumped and
11
+ * the readme will list any important changes.
12
+ *
13
+ * @see https://docs.woocommerce.com/document/template-structure/
14
+ * @package WooCommerce/Templates
15
+ * @version 3.5.0
16
+ */
17
+
18
+ if ( ! defined( 'ABSPATH' ) ) {
19
+ exit;
20
+ }
21
+
22
+ do_action( 'woocommerce_before_checkout_form', $checkout );
23
+
24
+ // If checkout registration is disabled and not logged in, the user cannot checkout.
25
+ if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) {
26
+ echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) ) );
27
+ return;
28
+ }
29
+
30
+ ?>
31
+
32
+ <form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data">
33
+
34
+ <?php if ( $checkout->get_checkout_fields() ) : ?>
35
+
36
+ <?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>
37
+
38
+ <div class="col2-set" id="customer_details">
39
+ <div class="col-1">
40
+ <?php do_action( 'woocommerce_checkout_billing' ); ?>
41
+ </div>
42
+
43
+ <div class="col-2">
44
+ <?php do_action( 'woocommerce_checkout_shipping' ); ?>
45
+ </div>
46
+ </div>
47
+
48
+ <?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
49
+
50
+ <?php endif; ?>
51
+
52
+ <h3 id="order_review_heading"><?php esc_html_e( 'Your order', 'woocommerce' ); ?></h3>
53
+
54
+ <?php do_action( 'woocommerce_checkout_before_order_review' ); ?>
55
+
56
+ <div id="order_review" class="woocommerce-checkout-review-order">
57
+ <?php do_action( 'woocommerce_checkout_order_review' ); ?>
58
+ </div>
59
+
60
+ <?php do_action( 'woocommerce_checkout_after_order_review' ); ?>
61
+
62
+ </form>
63
+
64
+ <?php do_action( 'woocommerce_after_checkout_form', $checkout ); ?>
woocommerce/template/checkout/form-coupon.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Checkout coupon form
4
+ *
5
+ * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-coupon.php.
6
+ *
7
+ * HOWEVER, on occasion WooCommerce will need to update template files and you
8
+ * (the theme developer) will need to copy the new files to your theme to
9
+ * maintain compatibility. We try to do this as little as possible, but it does
10
+ * happen. When this occurs the version of the template file will be bumped and
11
+ * the readme will list any important changes.
12
+ *
13
+ * @see https://docs.woocommerce.com/document/template-structure/
14
+ * @package WooCommerce/Templates
15
+ * @version 3.4.4
16
+ */
17
+
18
+ defined( 'ABSPATH' ) || exit;
19
+
20
+ if ( ! wc_coupons_enabled() ) { // @codingStandardsIgnoreLine.
21
+ return;
22
+ }
23
+
24
+ ?>
25
+ <div class="woocommerce-form-coupon-toggle">
26
+ <?php wc_print_notice( apply_filters( 'woocommerce_checkout_coupon_message', __( 'Have a coupon?', 'woocommerce' ) . ' <a href="#" class="showcoupon">' . __( 'Click here to enter your code', 'woocommerce' ) . '</a>' ), 'notice' ); ?>
27
+ </div>
28
+
29
+ <form class="checkout_coupon woocommerce-form-coupon" method="post" style="display:none">
30
+
31
+ <p><?php esc_html_e( 'If you have a coupon code, please apply it below.', 'woocommerce' ); ?></p>
32
+
33
+ <p class="form-row form-row-first">
34
+ <input type="text" name="coupon_code" class="input-text" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" id="coupon_code" value="" />
35
+ </p>
36
+
37
+ <p class="form-row form-row-last">
38
+ <button type="submit" class="button" name="apply_coupon" value="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>"><?php esc_html_e( 'Apply coupon', 'woocommerce' ); ?></button>
39
+ </p>
40
+
41
+ <div class="clear"></div>
42
+ </form>
woocommerce/template/checkout/form-login.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Checkout login form
4
+ *
5
+ * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-login.php.
6
+ *
7
+ * HOWEVER, on occasion WooCommerce will need to update template files and you
8
+ * (the theme developer) will need to copy the new files to your theme to
9
+ * maintain compatibility. We try to do this as little as possible, but it does
10
+ * happen. When this occurs the version of the template file will be bumped and
11
+ * the readme will list any important changes.
12
+ *
13
+ * @see https://docs.woocommerce.com/document/template-structure/
14
+ * @package WooCommerce/Templates
15
+ * @version 3.4.0
16
+ */
17
+
18
+ defined( 'ABSPATH' ) || exit;
19
+
20
+ if ( is_user_logged_in() || 'no' === get_option( 'woocommerce_enable_checkout_login_reminder' ) ) {
21
+ return;
22
+ }
23
+
24
+ ?>
25
+ <div class="woocommerce-form-login-toggle">
26
+ <?php wc_print_notice( apply_filters( 'woocommerce_checkout_login_message', __( 'Returning customer?', 'woocommerce' ) ) . ' <a href="#" class="showlogin">' . __( 'Click here to login', 'woocommerce' ) . '</a>', 'notice' ); ?>
27
+ </div>
28
+ <?php
29
+
30
+ woocommerce_login_form(
31
+ array(
32
+ 'message' => __( 'If you have shopped with us before, please enter your details below. If you are a new customer, please proceed to the Billing &amp; Shipping section.', 'woocommerce' ),
33
+ 'redirect' => wc_get_page_permalink( 'checkout' ),
34
+ 'hidden' => true,
35
+ )
36
+ );
woocommerce/template/checkout/review-order.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Review order table
4
+ *
5
+ * This template can be overridden by copying it to yourtheme/woocommerce/checkout/review-order.php.
6
+ *
7
+ * HOWEVER, on occasion WooCommerce will need to update template files and you
8
+ * (the theme developer) will need to copy the new files to your theme to
9
+ * maintain compatibility. We try to do this as little as possible, but it does
10
+ * happen. When this occurs the version of the template file will be bumped and
11
+ * the readme will list any important changes.
12
+ *
13
+ * @see https://docs.woocommerce.com/document/template-structure/
14
+ * @author WooThemes
15
+ * @package WooCommerce/Templates
16
+ * @version 3.3.0
17
+ */
18
+
19
+ if ( ! defined( 'ABSPATH' ) ) {
20
+ exit;
21
+ }
22
+ ?>
23
+ <table class="shop_table woocommerce-checkout-review-order-table">
24
+ <thead>
25
+ <tr>
26
+ <th class="product-name"><?php _e( 'Product', 'woocommerce' ); ?></th>
27
+ <th class="product-total"><?php _e( 'Total', 'woocommerce' ); ?></th>
28
+ </tr>
29
+ </thead>
30
+ <tbody>
31
+ <?php
32
+ do_action( 'woocommerce_review_order_before_cart_contents' );
33
+
34
+ foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
35
+ $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
36
+
37
+ if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_checkout_cart_item_visible', true, $cart_item, $cart_item_key ) ) {
38
+ ?>
39
+ <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item', $cart_item, $cart_item_key ) ); ?>">
40
+ <td class="product-name">
41
+ <?php echo apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ) . '&nbsp;'; ?>
42
+ <?php echo apply_filters( 'woocommerce_checkout_cart_item_quantity', ' <strong class="product-quantity">' . sprintf( '&times; %s', $cart_item['quantity'] ) . '</strong>', $cart_item, $cart_item_key ); ?>
43
+ <?php echo wc_get_formatted_cart_item_data( $cart_item ); ?>
44
+ </td>
45
+ <td class="product-total">
46
+ <?php echo apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key ); ?>
47
+ </td>
48
+ </tr>
49
+ <?php
50
+ }
51
+ }
52
+
53
+ do_action( 'woocommerce_review_order_after_cart_contents' );
54
+ ?>
55
+ </tbody>
56
+ <tfoot>
57
+
58
+ <tr class="cart-subtotal">
59
+ <th><?php _e( 'Subtotal', 'woocommerce' ); ?></th>
60
+ <td><?php wc_cart_totals_subtotal_html(); ?></td>
61
+ </tr>
62
+
63
+ <?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?>
64
+ <tr class="cart-discount coupon-<?php echo esc_attr( sanitize_title( $code ) ); ?>">
65
+ <th><?php wc_cart_totals_coupon_label( $coupon ); ?></th>
66
+ <td><?php wc_cart_totals_coupon_html( $coupon ); ?></td>
67
+ </tr>
68
+ <?php endforeach; ?>
69
+
70
+ <?php if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?>
71
+
72
+ <?php do_action( 'woocommerce_review_order_before_shipping' ); ?>
73
+
74
+ <?php wc_cart_totals_shipping_html(); ?>
75
+
76
+ <?php do_action( 'woocommerce_review_order_after_shipping' ); ?>
77
+
78
+ <?php endif; ?>
79
+
80
+ <?php foreach ( WC()->cart->get_fees() as $fee ) : ?>
81
+ <tr class="fee">
82
+ <th><?php echo esc_html( $fee->name ); ?></th>
83
+ <td><?php wc_cart_totals_fee_html( $fee ); ?></td>
84
+ </tr>
85
+ <?php endforeach; ?>
86
+
87
+ <?php if ( wc_tax_enabled() && ! WC()->cart->display_prices_including_tax() ) : ?>
88
+ <?php if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) : ?>
89
+ <?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : ?>
90
+ <tr class="tax-rate tax-rate-<?php echo sanitize_title( $code ); ?>">
91
+ <th><?php echo esc_html( $tax->label ); ?></th>
92
+ <td><?php echo wp_kses_post( $tax->formatted_amount ); ?></td>
93
+ </tr>
94
+ <?php endforeach; ?>
95
+ <?php else : ?>
96
+ <tr class="tax-total">
97
+ <th><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></th>
98
+ <td><?php wc_cart_totals_taxes_total_html(); ?></td>
99
+ </tr>
100
+ <?php endif; ?>
101
+ <?php endif; ?>
102
+
103
+ <?php do_action( 'woocommerce_review_order_before_order_total' ); ?>
104
+
105
+ <tr class="order-total">
106
+ <th><?php _e( 'Total', 'woocommerce' ); ?></th>
107
+ <td><?php wc_cart_totals_order_total_html(); ?></td>
108
+ </tr>
109
+
110
+ <?php do_action( 'woocommerce_review_order_after_order_total' ); ?>
111
+
112
+ </tfoot>
113
+ </table>
woocommerce/template/checkout/thankyou.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Thankyou page
4
+ *
5
+ * This template can be overridden by copying it to yourtheme/woocommerce/checkout/thankyou.php.
6
+ *
7
+ * HOWEVER, on occasion WooCommerce will need to update template files and you
8
+ * (the theme developer) will need to copy the new files to your theme to
9
+ * maintain compatibility. We try to do this as little as possible, but it does
10
+ * happen. When this occurs the version of the template file will be bumped and
11
+ * the readme will list any important changes.
12
+ *
13
+ * @see https://docs.woocommerce.com/document/template-structure/
14
+ * @author WooThemes
15
+ * @package WooCommerce/Templates
16
+ * @version 3.2.0
17
+ */
18
+
19
+ if ( ! defined( 'ABSPATH' ) ) {
20
+ exit;
21
+ }
22
+ ?>
23
+
24
+ <div class="woocommerce-order">
25
+
26
+ <?php if ( $order ) : ?>
27
+
28
+ <?php if ( $order->has_status( 'failed' ) ) : ?>
29
+
30
+ <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed"><?php _e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce' ); ?></p>
31
+
32
+ <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions">
33
+ <a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e( 'Pay', 'woocommerce' ); ?></a>
34
+ <?php if ( is_user_logged_in() ) : ?>
35
+ <a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php _e( 'My account', 'woocommerce' ); ?></a>
36
+ <?php endif; ?>
37
+ </p>
38
+
39
+ <?php else : ?>
40
+
41
+ <p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you. Your order has been received.', 'woocommerce' ), $order ); ?></p>
42
+
43
+ <ul class="woocommerce-order-overview woocommerce-thankyou-order-details order_details">
44
+
45
+ <li class="woocommerce-order-overview__order order">
46
+ <?php _e( 'Order number:', 'woocommerce' ); ?>
47
+ <strong><?php echo $order->get_order_number(); ?></strong>
48
+ </li>
49
+
50
+ <li class="woocommerce-order-overview__date date">
51
+ <?php _e( 'Date:', 'woocommerce' ); ?>
52
+ <strong><?php echo wc_format_datetime( $order->get_date_created() ); ?></strong>
53
+ </li>
54
+
55
+ <?php if ( is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?>
56
+ <li class="woocommerce-order-overview__email email">
57
+ <?php _e( 'Email:', 'woocommerce' ); ?>
58
+ <strong><?php echo $order->get_billing_email(); ?></strong>
59
+ </li>
60
+ <?php endif; ?>
61
+
62
+ <li class="woocommerce-order-overview__total total">
63
+ <?php _e( 'Total:', 'woocommerce' ); ?>
64
+ <strong><?php echo $order->get_formatted_order_total(); ?></strong>
65
+ </li>
66
+
67
+ <?php if ( $order->get_payment_method_title() ) : ?>
68
+ <li class="woocommerce-order-overview__payment-method method">
69
+ <?php _e( 'Payment method:', 'woocommerce' ); ?>
70
+ <strong><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></strong>
71
+ </li>
72
+ <?php endif; ?>
73
+
74
+ </ul>
75
+
76
+ <?php endif; ?>
77
+
78
+ <?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?>
79
+ <?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?>
80
+
81
+ <?php else : ?>
82
+
83
+ <p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you. Your order has been received.', 'woocommerce' ), null ); ?></p>
84
+
85
+ <?php endif; ?>
86
+
87
+ </div>
woocommerce/template/notices/error.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Show error messages
4
+ *
5
+ * This template can be overridden by copying it to yourtheme/woocommerce/notices/error.php.
6
+ *
7
+ * HOWEVER, on occasion WooCommerce will need to update template files and you
8
+ * (the theme developer) will need to copy the new files to your theme to
9
+ * maintain compatibility. We try to do this as little as possible, but it does
10
+ * happen. When this occurs the version of the template file will be bumped and
11
+ * the readme will list any important changes.
12
+ *
13
+ * @see https://docs.woocommerce.com/document/template-structure/
14
+ * @package WooCommerce/Templates
15
+ * @version 3.5.0
16
+ */
17
+
18
+ if ( ! defined( 'ABSPATH' ) ) {
19
+ exit;
20
+ }
21
+
22
+ if ( ! $messages ) {
23
+ return;
24
+ }
25
+
26
+ ?>
27
+ <ul class="woocommerce-error" role="alert">
28
+ <?php foreach ( $messages as $message ) : ?>
29
+ <li>
30
+ <?php
31
+ echo wc_kses_notice( $message );
32
+ ?>
33
+ </li>
34
+ <?php endforeach; ?>
35
+ </ul>
woocommerce/template/notices/notice.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Show messages
4
+ *
5
+ * This template can be overridden by copying it to yourtheme/woocommerce/notices/notice.php.
6
+ *
7
+ * HOWEVER, on occasion WooCommerce will need to update template files and you
8
+ * (the theme developer) will need to copy the new files to your theme to
9
+ * maintain compatibility. We try to do this as little as possible, but it does
10
+ * happen. When this occurs the version of the template file will be bumped and
11
+ * the readme will list any important changes.
12
+ *
13
+ * @see https://docs.woocommerce.com/document/template-structure/
14
+ * @package WooCommerce/Templates
15
+ * @version 3.5.0
16
+ */
17
+
18
+ if ( ! defined( 'ABSPATH' ) ) {
19
+ exit; // Exit if accessed directly.
20
+ }
21
+
22
+ if ( ! $messages ) {
23
+ return;
24
+ }
25
+
26
+ ?>
27
+
28
+ <?php foreach ( $messages as $message ) : ?>
29
+ <div class="woocommerce-info">
30
+ <?php
31
+ echo wc_kses_notice( $message );
32
+ ?>
33
+ </div>
34
+ <?php endforeach; ?>
woocommerce/template/notices/success.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Show messages
4
+ *
5
+ * This template can be overridden by copying it to yourtheme/woocommerce/notices/success.php.
6
+ *
7
+ * HOWEVER, on occasion WooCommerce will need to update template files and you
8
+ * (the theme developer) will need to copy the new files to your theme to
9
+ * maintain compatibility. We try to do this as little as possible, but it does
10
+ * happen. When this occurs the version of the template file will be bumped and
11
+ * the readme will list any important changes.
12
+ *
13
+ * @see https://docs.woocommerce.com/document/template-structure/
14
+ * @package WooCommerce/Templates
15
+ * @version 3.5.0
16
+ */
17
+
18
+ if ( ! defined( 'ABSPATH' ) ) {
19
+ exit;
20
+ }
21
+
22
+ if ( ! $messages ) {
23
+ return;
24
+ }
25
+
26
+ ?>
27
+
28
+ <?php foreach ( $messages as $message ) : ?>
29
+ <div class="woocommerce-message" role="alert">
30
+ <?php
31
+ echo wc_kses_notice( $message );
32
+ ?>
33
+ </div>
34
+ <?php endforeach; ?>