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

Version Description

Download this release

Release Info

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

Code changes from version 1.3.5 to 1.4.1

Files changed (57) hide show
  1. admin/assets/css/global-admin-rtl.css +1 -0
  2. admin/assets/css/global-admin.css +1 -0
  3. admin/assets/js/global-admin.js +158 -19
  4. admin/meta-assets/js/admin-edit.js +1 -191
  5. assets/css/checkout-template-divi-rtl.css +2 -53
  6. assets/css/checkout-template-divi.css +2 -53
  7. assets/css/checkout-template-rtl.css +3 -6
  8. assets/css/checkout-template.css +3 -6
  9. assets/css/import-rtl.css +3 -2
  10. assets/css/import.css +3 -2
  11. assets/css/optin-template-rtl.css +757 -0
  12. assets/css/optin-template.css +757 -0
  13. assets/js/import.js +11 -6
  14. assets/js/optin-template.js +125 -0
  15. assets/min-css/checkout-template-divi-rtl.min.css +1 -1
  16. assets/min-css/checkout-template-divi.min.css +1 -1
  17. assets/min-css/checkout-template-rtl.min.css +1 -1
  18. assets/min-css/checkout-template.min.css +1 -1
  19. assets/min-css/import-rtl.min.css +1 -1
  20. assets/min-css/import.min.css +1 -1
  21. assets/min-css/optin-template-rtl.min.css +1 -0
  22. assets/min-css/optin-template.min.css +1 -0
  23. assets/min-js/import.min.js +1 -1
  24. assets/min-js/optin-template.min.js +1 -0
  25. cartflows.php +2 -2
  26. changelog.txt +8 -0
  27. classes/class-cartflows-admin.php +620 -620
  28. classes/class-cartflows-compatibility.php +410 -410
  29. classes/class-cartflows-default-meta.php +209 -264
  30. classes/class-cartflows-elementor-compatibility.php +34 -0
  31. classes/class-cartflows-flow-frontend.php +41 -0
  32. classes/class-cartflows-frontend.php +634 -540
  33. classes/class-cartflows-functions.php +76 -0
  34. classes/class-cartflows-importer.php +1694 -1687
  35. classes/class-cartflows-learndash-compatibility.php +140 -140
  36. classes/class-cartflows-loader.php +4 -22
  37. classes/class-cartflows-meta-fields.php +816 -1491
  38. classes/class-cartflows-metabox.php +97 -97
  39. classes/class-cartflows-utils.php +455 -425
  40. classes/class-cartflows-wizard.php +679 -679
  41. includes/admin/cartflows-admin.php +35 -35
  42. includes/admin/cartflows-general.php +370 -370
  43. languages/cartflows.pot +324 -204
  44. modules/checkout/classes/class-cartflows-checkout-markup.php +1 -1
  45. modules/checkout/classes/class-cartflows-checkout-meta.php +63 -29
  46. modules/flow/classes/class-cartflows-flow-post-type.php +383 -383
  47. modules/flow/classes/class-cartflows-permalink.php +159 -159
  48. modules/flow/classes/class-cartflows-step-post-type.php +475 -468
  49. modules/flow/view/meta-flow-steps.php +210 -209
  50. modules/landing/classes/class-cartflows-landing-markup.php +139 -139
  51. modules/optin/class-cartflows-optin.php +47 -0
  52. modules/optin/classes/class-cartflows-optin-markup.php +802 -0
  53. modules/optin/classes/class-cartflows-optin-meta.php +672 -0
  54. modules/optin/templates/optin-template-simple.php +33 -0
  55. modules/thankyou/classes/class-cartflows-thankyou-markup.php +18 -6
  56. modules/thankyou/classes/class-cartflows-thankyou-meta.php +8 -0
  57. readme.txt +10 -2
admin/assets/css/global-admin-rtl.css CHANGED
@@ -572,6 +572,7 @@ input[type="text"].error:focus{
572
  #wcf-checkout-settings .inside,
573
  #wcf-offer-settings .inside,
574
  #wcf-upsell-settings .inside,
 
575
  #wcf-thankyou-settings .inside{
576
  margin:0px;
577
  padding: 0px;
572
  #wcf-checkout-settings .inside,
573
  #wcf-offer-settings .inside,
574
  #wcf-upsell-settings .inside,
575
+ #wcf-optin-settings .inside,
576
  #wcf-thankyou-settings .inside{
577
  margin:0px;
578
  padding: 0px;
admin/assets/css/global-admin.css CHANGED
@@ -572,6 +572,7 @@ input[type="text"].error:focus{
572
  #wcf-checkout-settings .inside,
573
  #wcf-offer-settings .inside,
574
  #wcf-upsell-settings .inside,
 
575
  #wcf-thankyou-settings .inside{
576
  margin:0px;
577
  padding: 0px;
572
  #wcf-checkout-settings .inside,
573
  #wcf-offer-settings .inside,
574
  #wcf-upsell-settings .inside,
575
+ #wcf-optin-settings .inside,
576
  #wcf-thankyou-settings .inside{
577
  margin:0px;
578
  padding: 0px;
admin/assets/js/global-admin.js CHANGED
@@ -6,9 +6,56 @@
6
  * @since 1.0.0
7
  */
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  /* Show Hide Custom Options for input types */
11
- var wcf_show_field_custom_options = function() {
12
  var default_value = $('.field-wcf-input-field-size select').val();
13
 
14
  if( 'custom' == default_value ){
@@ -40,23 +87,68 @@
40
  }
41
 
42
  /* Show Hide Custom Options for Buttons */
43
- var wcf_show_button_custom_options = function() {
44
- var default_value = $('.field-wcf-input-button-size select').val();
 
 
 
 
 
 
 
45
 
46
  if( 'custom' == default_value ){
47
- $('.field-wcf-submit-tb-padding').show();
48
- $('.field-wcf-submit-lr-padding').show();
49
  }else{
50
- $('.field-wcf-submit-tb-padding .wcf-field-row-content input[type="number"]').val('');
51
- $('.field-wcf-submit-lr-padding .wcf-field-row-content input[type="number"]').val('');
52
-
53
- $('.field-wcf-submit-tb-padding').hide();
54
- $('.field-wcf-submit-lr-padding').hide();
55
  }
56
 
57
 
58
 
59
- $('.field-wcf-input-button-size select').on('change', function(e) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  e.preventDefault();
62
 
@@ -64,16 +156,18 @@
64
  selected_value = $this.val();
65
 
66
  if(selected_value == 'custom' ){
67
- $('.field-wcf-submit-tb-padding').show();
68
- $('.field-wcf-submit-lr-padding').show();
 
69
  }else{
70
- $('.field-wcf-submit-tb-padding').hide();
71
- $('.field-wcf-submit-lr-padding').hide();
 
72
  }
73
  });
74
  }
75
 
76
- function wcf_prevent_toggle_for_shortcode() {
77
  // Prevent inputs in meta box headings opening/closing contents.
78
  $( '#wcf-checkout-settings' ).find( '.hndle' ).unbind( 'click.postboxes' );
79
 
@@ -152,18 +246,63 @@
152
  });
153
  }
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  $( document ).ready(function() {
 
 
 
156
  //alert("Before Stattement");
157
  $( '#field-wcf-shortcode' ).appendTo( '#wcf-checkout-settings .hndle span' );
158
  $( '#field-wcf-shortcode' ).css( "display", "inline" );
159
  //alert("After Stattement");
160
 
161
- wcf_show_field_custom_options();
 
 
 
162
 
163
- wcf_show_button_custom_options();
164
 
165
- wcf_prevent_toggle_for_shortcode();
 
 
166
 
 
167
  add_tool_tip_msg();
168
 
169
  highlight_the_metabox();
6
  * @since 1.0.0
7
  */
8
 
9
+ /* Toogle fields logic for all fields */
10
+ var wcf_toggle_fields_general_logic = function() {
11
+
12
+ var fields = $('[toggle]');
13
+
14
+ if ( fields.length < 1 ) {
15
+ return;
16
+ }
17
+
18
+ fields.each(function( i ) {
19
+ console.log( $(this) );
20
+ });
21
+
22
+ // if( 'custom' == default_value ){
23
+ // $('.field-wcf-field-tb-padding').show();
24
+ // $('.field-wcf-field-lr-padding').show();
25
+ // }else{
26
+ // $('.field-wcf-field-tb-padding .wcf-field-row-content input[type="number"]').val('');
27
+ // $('.field-wcf-field-lr-padding .wcf-field-row-content input[type="number"]').val('');
28
+
29
+ // $('.field-wcf-field-tb-padding').hide();
30
+ // $('.field-wcf-field-lr-padding').hide();
31
+ // }
32
+
33
+ $('.wcf-field-row input[type=checkbox]').on('change', function(e) {
34
+
35
+ e.preventDefault();
36
+
37
+ var $this = $(this),
38
+ toggle_data = $this.attr('toggle');
39
+
40
+ console.log( toggle_data );
41
+ console.log( $(this).is(':checked') );
42
+
43
+ // if(selected_value == 'custom' ){
44
+ // $('.field-wcf-field-tb-padding').show();
45
+ // $('.field-wcf-field-lr-padding').show();
46
+ // }else{
47
+ // $('.field-wcf-field-tb-padding').hide();
48
+ // $('.field-wcf-field-lr-padding').hide();
49
+ // }
50
+ });
51
+
52
+ var hide_show_fields = function() {
53
+ // body...
54
+ }
55
+ }
56
 
57
  /* Show Hide Custom Options for input types */
58
+ var wcf_checkout_show_field_custom_options = function() {
59
  var default_value = $('.field-wcf-input-field-size select').val();
60
 
61
  if( 'custom' == default_value ){
87
  }
88
 
89
  /* Show Hide Custom Options for Buttons */
90
+ var wcf_checkout_show_button_custom_options = function() {
91
+
92
+ var wrapper = $('.wcf-checkout-table');
93
+
94
+ if ( wrapper.length < 1 ) {
95
+ return;
96
+ }
97
+
98
+ var default_value = wrapper.find('.field-wcf-input-button-size select').val();
99
 
100
  if( 'custom' == default_value ){
101
+ wrapper.find('.field-wcf-submit-tb-padding').show();
102
+ wrapper.find('.field-wcf-submit-lr-padding').show();
103
  }else{
104
+ wrapper.find('.field-wcf-submit-tb-padding').hide();
105
+ wrapper.find('.field-wcf-submit-lr-padding').hide();
 
 
 
106
  }
107
 
108
 
109
 
110
+ wrapper.find('.field-wcf-input-button-size select').on('change', function(e) {
111
+
112
+ e.preventDefault();
113
+
114
+ var $this = $(this),
115
+ selected_value = $this.val();
116
+
117
+ if(selected_value == 'custom' ){
118
+ wrapper.find('.field-wcf-submit-tb-padding').show();
119
+ wrapper.find('.field-wcf-submit-lr-padding').show();
120
+ }else{
121
+ wrapper.find('.field-wcf-submit-tb-padding').hide();
122
+ wrapper.find('.field-wcf-submit-lr-padding').hide();
123
+ }
124
+ });
125
+ }
126
+
127
+ /* Show Hide Custom Options for Buttons */
128
+ var wcf_optin_submit_button_custom_options = function() {
129
+
130
+ var wrapper = $('.wcf-optin-table');
131
+
132
+ if ( wrapper.length < 1 ) {
133
+ return;
134
+ }
135
+
136
+ var default_value = wrapper.find('.field-wcf-submit-button-size select').val();
137
+
138
+ if( 'custom' == default_value ){
139
+ wrapper.find('.field-wcf-submit-tb-padding').show();
140
+ wrapper.find('.field-wcf-submit-lr-padding').show();
141
+ wrapper.find('.field-wcf-submit-button-position').show();
142
+ }else{
143
+ wrapper.find('.field-wcf-submit-tb-padding .wcf-field-row-content input[type="number"]').val('');
144
+ wrapper.find('.field-wcf-submit-lr-padding .wcf-field-row-content input[type="number"]').val('');
145
+
146
+ wrapper.find('.field-wcf-submit-tb-padding').hide();
147
+ wrapper.find('.field-wcf-submit-lr-padding').hide();
148
+ wrapper.find('.field-wcf-submit-button-position').hide();
149
+ }
150
+
151
+ wrapper.find('.field-wcf-submit-button-size select').on('change', function(e) {
152
 
153
  e.preventDefault();
154
 
156
  selected_value = $this.val();
157
 
158
  if(selected_value == 'custom' ){
159
+ wrapper.find('.field-wcf-submit-tb-padding').show();
160
+ wrapper.find('.field-wcf-submit-lr-padding').show();
161
+ wrapper.find('.field-wcf-submit-button-position').show();
162
  }else{
163
+ wrapper.find('.field-wcf-submit-tb-padding').hide();
164
+ wrapper.find('.field-wcf-submit-lr-padding').hide();
165
+ wrapper.find('.field-wcf-submit-button-position').hide();
166
  }
167
  });
168
  }
169
 
170
+ var wcf_checkout_prevent_toggle_for_shortcode = function() {
171
  // Prevent inputs in meta box headings opening/closing contents.
172
  $( '#wcf-checkout-settings' ).find( '.hndle' ).unbind( 'click.postboxes' );
173
 
246
  });
247
  }
248
 
249
+ /* Optin - hide/show login */
250
+ function wcf_optin_hide_show_init(){
251
+
252
+ var wrapper = $('.wcf-optin-table');
253
+
254
+ if ( wrapper.length < 1 ) {
255
+ return;
256
+ }
257
+
258
+ var field = $('input[type=checkbox]#wcf-optin-pass-fields');
259
+ var toggle_fields = [ '.field-wcf-optin-pass-specific-fields', '.wcf-optin-pass-fields-doc' ];
260
+
261
+ if ( field.is(":checked") ) {
262
+ $.each( toggle_fields, function(i, val) {
263
+ wrapper.find( val ).show();
264
+ })
265
+ } else {
266
+ $.each( toggle_fields, function(i, val) {
267
+ wrapper.find( val ).hide();
268
+ });
269
+ }
270
+
271
+ field.on('change', function(e) {
272
+
273
+ if ( field.is(":checked") ) {
274
+ $.each( toggle_fields, function(i, val) {
275
+ wrapper.find( val ).show();
276
+ })
277
+ } else {
278
+ $.each( toggle_fields, function(i, val) {
279
+ wrapper.find( val ).hide();
280
+ });
281
+ }
282
+ });
283
+ }
284
+
285
  $( document ).ready(function() {
286
+
287
+ //wcf_toggle_fields_general_logic();
288
+
289
  //alert("Before Stattement");
290
  $( '#field-wcf-shortcode' ).appendTo( '#wcf-checkout-settings .hndle span' );
291
  $( '#field-wcf-shortcode' ).css( "display", "inline" );
292
  //alert("After Stattement");
293
 
294
+ /* Checkout */
295
+ wcf_checkout_show_field_custom_options();
296
+
297
+ wcf_checkout_show_button_custom_options();
298
 
299
+ wcf_checkout_prevent_toggle_for_shortcode();
300
 
301
+ /* Optin */
302
+ wcf_optin_submit_button_custom_options();
303
+ wcf_optin_hide_show_init();
304
 
305
+ /* Other */
306
  add_tool_tip_msg();
307
 
308
  highlight_the_metabox();
admin/meta-assets/js/admin-edit.js CHANGED
@@ -16,11 +16,6 @@
16
  */
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 );
25
  $( document ).on('change', '.wcf-field-font-weight', CartFlowsAdminEdit._set_font_weight_val );
26
  },
@@ -161,192 +156,7 @@
161
  event.preventDefault();
162
 
163
  CartFlowsAdminEdit._set_font_weigths();
164
- },
165
-
166
- _remove_custom_field: function(e) {
167
-
168
- e.preventDefault();
169
-
170
- var $this = $(this),
171
- wrap = $this.closest('.wcf-cpf-actions'),
172
- post_id = $('#post_ID').val(),
173
- type = wrap.data('type'),
174
- key = wrap.data('key'),
175
- row = $this.parents('.wcf-field-item-edit-active');
176
-
177
- if( row.length < 1 ){
178
- row = $this.parents('.wcf-field-row');
179
- }
180
-
181
- var delete_status = confirm( "This action will delete this field. Are you sure?" );
182
- if (true == delete_status) {
183
- $this.addClass('wp-ui-text-notification').text('Removing..');
184
-
185
- $.ajax({
186
- url: wcf.ajax_url,
187
- data: {
188
- action: "wcf_delete_checkout_custom_field",
189
- post_id: post_id,
190
- type : type,
191
- key : key,
192
- security: cartflows_admin.wcf_delete_checkout_custom_field_nonce
193
- },
194
- dataType: 'json',
195
- type: 'POST',
196
- success: function ( data ) {
197
- row.slideUp(400, 'swing', function() {
198
- row.remove();
199
- });
200
- }
201
- });
202
- }
203
- },
204
-
205
- _add_custom_field: function(e) {
206
-
207
- e.preventDefault();
208
-
209
- var $this = $(this),
210
- wrap = $this.closest('.wcf-cpf-wrap'),
211
- post_id = $('#post_ID').val(),
212
- add_to = wrap.find( '.wcf-cpf-fields.wcf-cpf-add_to select' ).val() || '',
213
- type = wrap.find( '.wcf-cpf-fields.wcf-cpf-type select' ).val() || '',
214
- options = wrap.find( '.wcf-cpf-fields.wcf-cpf-options textarea' ).val() || '',
215
- label = wrap.find( '.wcf-cpf-fields.wcf-cpf-label input' ).val() || '',
216
- name = wrap.find( '.wcf-cpf-fields.wcf-cpf-name input' ).val() || '';
217
-
218
- if( '' === label ) {
219
- wrap.find( '.wcf-cpf-fields.wcf-cpf-label input' ).focus();
220
- return;
221
- }
222
-
223
- if( '' === name ) {
224
- wrap.find( '.wcf-cpf-fields.wcf-cpf-name input' ).focus();
225
- return;
226
- }
227
-
228
- $this.addClass('updating-message').text('Adding Field..');
229
-
230
- $.ajax({
231
- url: wcf.ajax_url,
232
- data: {
233
- action : "wcf_add_checkout_custom_field",
234
- post_id : post_id,
235
- add_to : add_to,
236
- type : type,
237
- options : options,
238
- label : label,
239
- name : name,
240
- security: cartflows_admin.wcf_add_checkout_custom_field_nonce
241
- },
242
- dataType: 'json',
243
- type: 'POST',
244
- success: function ( data ) {
245
-
246
- if( $('.' + data.add_to_class ).length ) {
247
- $('.' + data.add_to_class ).append( data.markup );
248
-
249
- var new_row = $('.wcf-field-row.field-'+data.field_args.name );
250
-
251
- $this.removeClass('updating-message').text('Added Field!');
252
- setTimeout(function() {
253
- $this.text('Add New Field');
254
- }, 1500);
255
-
256
-
257
- if( $('.wcf-field-row.field-'+data.field_args.name ).length ) {
258
- $('html, body').animate({
259
- scrollTop: $('.wcf-field-row.field-'+data.field_args.name ).offset().top
260
- }, 800);
261
- }
262
- }
263
- }
264
- });
265
-
266
- },
267
-
268
- _add_pro_custom_field: function(e) {
269
-
270
- e.preventDefault();
271
-
272
- var $this = $(this),
273
- wrap = $this.closest('.wcf-cpf-wrap'),
274
- post_id = $('#post_ID').val(),
275
- add_to = wrap.find( '.wcf-cpf-fields.wcf-cpf-add_to select' ).val() || '',
276
- type = wrap.find( '.wcf-cpf-fields.wcf-cpf-type select' ).val() || '',
277
- options = wrap.find( '.wcf-cpf-fields.wcf-cpf-options textarea' ).val() || '',
278
- label = wrap.find( '.wcf-cpf-fields.wcf-cpf-label input' ).val() || '',
279
- width = wrap.find( '.wcf-cpf-fields.wcf-cpf-width select' ).val() || '',
280
- placeholder = '',
281
- is_required = wrap.find( '.wcf-cpf-fields.wcf-cpf-required input[type="checkbox"]:checked' ).val() || '';
282
- default_value = '';
283
- // name = wrap.find( '.wcf-cpf-fields.wcf-cpf-name input' ).val() || '';
284
-
285
- if( 'checkbox' == type ){
286
- default_value = wrap.find( '.wcf-cpf-fields.wcf-cpf-default select' ).val() || '';
287
- }else{
288
- default_value = wrap.find( '.wcf-cpf-fields.wcf-cpf-default input' ).val() || '';
289
- }
290
-
291
- if( 'select' != type ){
292
- placeholder = wrap.find( '.wcf-cpf-fields.wcf-cpf-placeholder input' ).val() || '';
293
- }
294
-
295
- if( '' === label ) {
296
- wrap.find( '.wcf-cpf-fields.wcf-cpf-label input' ).focus();
297
- wrap.find( '.wcf-cpf-fields.wcf-cpf-label input' ).addClass('error');
298
- wrap.find( '.wcf-cpf-fields.wcf-cpf-label #wcf-cpf-label-error-msg' ).text( ' This field is required' ).css( 'color', 'red' );
299
- return;
300
- }
301
-
302
- // if( '' === name ) {
303
- // wrap.find( '.wcf-cpf-fields.wcf-cpf-name input' ).focus();
304
- // return;
305
- // }
306
-
307
- $this.addClass('updating-message').text('Adding Field..');
308
-
309
- $.ajax({
310
- url: wcf.ajax_url,
311
- data: {
312
- action : "wcf_pro_add_checkout_custom_field",
313
- post_id : post_id,
314
- add_to : add_to,
315
- type : type,
316
- options : options,
317
- label : label,
318
- // name : name,
319
- placeholder : placeholder,
320
- width : width,
321
- default:default_value,
322
- required: is_required,
323
- security: cartflows_admin.wcf_pro_add_checkout_custom_field_nonce
324
- },
325
- dataType: 'json',
326
- type: 'POST',
327
- success: function ( data ) {
328
- console.log(data);
329
- if( $('.' + data.add_to_class ).length ) {
330
- $('.' + data.add_to_class ).append( data.markup );
331
-
332
- var new_row = $('.wcf-field-row.field-'+data.field_args.name );
333
-
334
- $this.removeClass('updating-message').text('Added Field!');
335
- setTimeout(function() {
336
- $this.text('Add New Field');
337
- }, 1500);
338
-
339
-
340
- if( $('.wcf-field-row.field-'+data.field_args.name ).length ) {
341
- $('html, body').animate({
342
- scrollTop: $('.wcf-field-row.field-'+data.field_args.name ).offset().top
343
- }, 800);
344
- }
345
- }
346
- }
347
- });
348
-
349
- },
350
  };
351
 
352
  /**
16
  */
17
  _bind: function()
18
  {
 
 
 
 
 
19
  $( document ).on('change', '.wcf-field-font-family', CartFlowsAdminEdit._set_font_weight_select_options );
20
  $( document ).on('change', '.wcf-field-font-weight', CartFlowsAdminEdit._set_font_weight_val );
21
  },
156
  event.preventDefault();
157
 
158
  CartFlowsAdminEdit._set_font_weigths();
159
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  };
161
 
162
  /**
assets/css/checkout-template-divi-rtl.css CHANGED
@@ -51,7 +51,7 @@
51
  letter-spacing: 0.3px;
52
  font-family: inherit;
53
  font-weight: inherit;
54
- text-transform: capitalize;
55
  margin-bottom: 8px;
56
  }
57
 
@@ -171,7 +171,7 @@
171
  font-family: inherit;
172
  font-weight: 600;
173
  font-size: 20px;
174
- text-transform: capitalize;
175
  margin: 0 0 25px 0;
176
  }
177
 
@@ -265,57 +265,6 @@
265
  width: 100%;
266
  }
267
 
268
- /**
269
- * *************************************
270
- * Two Step Divi Compatibility css Start
271
- * *************************************
272
- */
273
-
274
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set,
275
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set,
276
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-product-option-wrap{
277
- display: block;
278
- width: 100%;
279
- float: none;
280
- padding-left: 0;
281
- padding: 0px;
282
- -webkit-border-radius: 0px;
283
- border-radius: 0px;
284
- margin-top:10px;
285
- margin-bottom: 20px;
286
- }
287
-
288
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,
289
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper,
290
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper,
291
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,
292
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper,
293
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper{
294
- margin: 0px;
295
- }
296
-
297
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-additional-fields > h3,
298
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-billing-fields > h3,
299
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step #order_review_heading,
300
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout #order_review_heading{
301
- display: none !important;
302
- }
303
-
304
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout #order_review{
305
- float: none;
306
- width: 100%;
307
- }
308
-
309
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce a{
310
- color: #fff;
311
- }
312
-
313
- /**
314
- * *************************************
315
- * Two Step Divi Compatibility css End
316
- * *************************************
317
- */
318
-
319
 
320
  /**
321
  * **************************************
51
  letter-spacing: 0.3px;
52
  font-family: inherit;
53
  font-weight: inherit;
54
+ /*text-transform: capitalize;*/
55
  margin-bottom: 8px;
56
  }
57
 
171
  font-family: inherit;
172
  font-weight: 600;
173
  font-size: 20px;
174
+ /*text-transform: capitalize;*/
175
  margin: 0 0 25px 0;
176
  }
177
 
265
  width: 100%;
266
  }
267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
 
269
  /**
270
  * **************************************
assets/css/checkout-template-divi.css CHANGED
@@ -51,7 +51,7 @@
51
  letter-spacing: 0.3px;
52
  font-family: inherit;
53
  font-weight: inherit;
54
- text-transform: capitalize;
55
  margin-bottom: 8px;
56
  }
57
 
@@ -171,7 +171,7 @@
171
  font-family: inherit;
172
  font-weight: 600;
173
  font-size: 20px;
174
- text-transform: capitalize;
175
  margin: 0 0 25px 0;
176
  }
177
 
@@ -265,57 +265,6 @@
265
  width: 100%;
266
  }
267
 
268
- /**
269
- * *************************************
270
- * Two Step Divi Compatibility css Start
271
- * *************************************
272
- */
273
-
274
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set,
275
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set,
276
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-product-option-wrap{
277
- display: block;
278
- width: 100%;
279
- float: none;
280
- padding-right: 0;
281
- padding: 0px;
282
- -webkit-border-radius: 0px;
283
- border-radius: 0px;
284
- margin-top:10px;
285
- margin-bottom: 20px;
286
- }
287
-
288
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,
289
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper,
290
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper,
291
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,
292
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper,
293
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper{
294
- margin: 0px;
295
- }
296
-
297
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-additional-fields > h3,
298
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-billing-fields > h3,
299
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step #order_review_heading,
300
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout #order_review_heading{
301
- display: none !important;
302
- }
303
-
304
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout #order_review{
305
- float: none;
306
- width: 100%;
307
- }
308
-
309
- .et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce a{
310
- color: #fff;
311
- }
312
-
313
- /**
314
- * *************************************
315
- * Two Step Divi Compatibility css End
316
- * *************************************
317
- */
318
-
319
 
320
  /**
321
  * **************************************
51
  letter-spacing: 0.3px;
52
  font-family: inherit;
53
  font-weight: inherit;
54
+ /*text-transform: capitalize;*/
55
  margin-bottom: 8px;
56
  }
57
 
171
  font-family: inherit;
172
  font-weight: 600;
173
  font-size: 20px;
174
+ /*text-transform: capitalize;*/
175
  margin: 0 0 25px 0;
176
  }
177
 
265
  width: 100%;
266
  }
267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
 
269
  /**
270
  * **************************************
assets/css/checkout-template-rtl.css CHANGED
@@ -320,7 +320,7 @@
320
  font-family: inherit;
321
  font-weight: 600;
322
  font-size: 20px;
323
- text-transform: capitalize;
324
  margin:0 0 25px 0;
325
  padding: 0px;
326
  width: 100%;
@@ -542,7 +542,6 @@
542
  padding: 18px;
543
  margin-bottom: 10px;
544
  width: 100%;
545
- text-transform: uppercase;
546
  }
547
 
548
  .wcf-embed-checkout-form .woocommerce #order_review button {
@@ -560,7 +559,6 @@
560
  -webkit-border-radius: 3px;
561
  border-radius: 3px;
562
  color: #fff;
563
- text-transform: uppercase;
564
  }
565
 
566
  .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small {
@@ -788,7 +786,7 @@
788
  letter-spacing: 0.3px;
789
  font-family: inherit;
790
  font-weight:inherit;
791
- text-transform: capitalize;
792
  margin-bottom: 8px;
793
  }
794
 
@@ -799,7 +797,7 @@
799
 
800
  .wcf-embed-checkout-form .woocommerce .woocommerce-terms-and-conditions-wrapper .woocommerce-terms-and-conditions-checkbox-text{
801
  line-height: 20px;
802
- text-transform: initial;
803
  }
804
 
805
  .wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p{
@@ -926,7 +924,6 @@
926
 
927
  .wcf-bump-order-field-wrap .wcf-bump-order-label{
928
  font-size: 16px;
929
- text-transform: capitalize;
930
  }
931
 
932
  /* Added for pro support */
320
  font-family: inherit;
321
  font-weight: 600;
322
  font-size: 20px;
323
+ /*text-transform: capitalize;*/
324
  margin:0 0 25px 0;
325
  padding: 0px;
326
  width: 100%;
542
  padding: 18px;
543
  margin-bottom: 10px;
544
  width: 100%;
 
545
  }
546
 
547
  .wcf-embed-checkout-form .woocommerce #order_review button {
559
  -webkit-border-radius: 3px;
560
  border-radius: 3px;
561
  color: #fff;
 
562
  }
563
 
564
  .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small {
786
  letter-spacing: 0.3px;
787
  font-family: inherit;
788
  font-weight:inherit;
789
+ /*text-transform: capitalize;*/
790
  margin-bottom: 8px;
791
  }
792
 
797
 
798
  .wcf-embed-checkout-form .woocommerce .woocommerce-terms-and-conditions-wrapper .woocommerce-terms-and-conditions-checkbox-text{
799
  line-height: 20px;
800
+ text-transform: none;
801
  }
802
 
803
  .wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p{
924
 
925
  .wcf-bump-order-field-wrap .wcf-bump-order-label{
926
  font-size: 16px;
 
927
  }
928
 
929
  /* Added for pro support */
assets/css/checkout-template.css CHANGED
@@ -320,7 +320,7 @@
320
  font-family: inherit;
321
  font-weight: 600;
322
  font-size: 20px;
323
- text-transform: capitalize;
324
  margin:0 0 25px 0;
325
  padding: 0px;
326
  width: 100%;
@@ -542,7 +542,6 @@
542
  padding: 18px;
543
  margin-bottom: 10px;
544
  width: 100%;
545
- text-transform: uppercase;
546
  }
547
 
548
  .wcf-embed-checkout-form .woocommerce #order_review button {
@@ -560,7 +559,6 @@
560
  -webkit-border-radius: 3px;
561
  border-radius: 3px;
562
  color: #fff;
563
- text-transform: uppercase;
564
  }
565
 
566
  .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small {
@@ -788,7 +786,7 @@
788
  letter-spacing: 0.3px;
789
  font-family: inherit;
790
  font-weight:inherit;
791
- text-transform: capitalize;
792
  margin-bottom: 8px;
793
  }
794
 
@@ -799,7 +797,7 @@
799
 
800
  .wcf-embed-checkout-form .woocommerce .woocommerce-terms-and-conditions-wrapper .woocommerce-terms-and-conditions-checkbox-text{
801
  line-height: 20px;
802
- text-transform: initial;
803
  }
804
 
805
  .wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p{
@@ -926,7 +924,6 @@
926
 
927
  .wcf-bump-order-field-wrap .wcf-bump-order-label{
928
  font-size: 16px;
929
- text-transform: capitalize;
930
  }
931
 
932
  /* Added for pro support */
320
  font-family: inherit;
321
  font-weight: 600;
322
  font-size: 20px;
323
+ /*text-transform: capitalize;*/
324
  margin:0 0 25px 0;
325
  padding: 0px;
326
  width: 100%;
542
  padding: 18px;
543
  margin-bottom: 10px;
544
  width: 100%;
 
545
  }
546
 
547
  .wcf-embed-checkout-form .woocommerce #order_review button {
559
  -webkit-border-radius: 3px;
560
  border-radius: 3px;
561
  color: #fff;
 
562
  }
563
 
564
  .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small {
786
  letter-spacing: 0.3px;
787
  font-family: inherit;
788
  font-weight:inherit;
789
+ /*text-transform: capitalize;*/
790
  margin-bottom: 8px;
791
  }
792
 
797
 
798
  .wcf-embed-checkout-form .woocommerce .woocommerce-terms-and-conditions-wrapper .woocommerce-terms-and-conditions-checkbox-text{
799
  line-height: 20px;
800
+ text-transform: none;
801
  }
802
 
803
  .wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p{
924
 
925
  .wcf-bump-order-field-wrap .wcf-bump-order-label{
926
  font-size: 16px;
 
927
  }
928
 
929
  /* Added for pro support */
assets/css/import-rtl.css CHANGED
@@ -576,8 +576,9 @@ div#TB_window {
576
  border-width: 1px;
577
  -webkit-box-shadow: none;
578
  box-shadow: none;
579
- padding: 2px;
580
- line-height: 29px;
 
581
  }
582
 
583
  #wcf-start-from-scratch .description {
576
  border-width: 1px;
577
  -webkit-box-shadow: none;
578
  box-shadow: none;
579
+ padding: 2px 6px 2px 2px;
580
+ line-height: 25px;
581
+ width: 155px;
582
  }
583
 
584
  #wcf-start-from-scratch .description {
assets/css/import.css CHANGED
@@ -576,8 +576,9 @@ div#TB_window {
576
  border-width: 1px;
577
  -webkit-box-shadow: none;
578
  box-shadow: none;
579
- padding: 2px;
580
- line-height: 29px;
 
581
  }
582
 
583
  #wcf-start-from-scratch .description {
576
  border-width: 1px;
577
  -webkit-box-shadow: none;
578
  box-shadow: none;
579
+ padding: 2px 2px 2px 6px;
580
+ line-height: 25px;
581
+ width: 155px;
582
  }
583
 
584
  #wcf-start-from-scratch .description {
assets/css/optin-template-rtl.css ADDED
@@ -0,0 +1,757 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * **************
3
+ * Login & Coupon Field Layout
4
+ * **************
5
+ */
6
+ /* Editor CSS */
7
+ .elementor-editor-active .wcf-optin-form .woocommerce #order_review #payment #place_order {
8
+ pointer-events: none !important;
9
+ }
10
+
11
+ .cartflows-container .wcf-optin-form,
12
+ .cartflows-container .wcf-optin-form * {
13
+ -webkit-box-sizing: border-box;
14
+ -moz-box-sizing: border-box;
15
+ box-sizing: border-box;
16
+ }
17
+
18
+ .wcf-optin-form .wc-backward {
19
+ display: none !important;
20
+ }
21
+
22
+ .wcf-optin-form .woocommerce form .form-row-first,
23
+ .wcf-optin-form .woocommerce form .form-row-last{
24
+ width: 50%;
25
+ display: block;
26
+ }
27
+
28
+ .wcf-optin-form .woocommerce form .form-row-full{
29
+ width: 100%;
30
+ clear: both;
31
+ }
32
+
33
+ .wcf-optin-form form .form-row-wide{
34
+ width: 100%;
35
+ }
36
+
37
+ /* To test divi and all */
38
+ .wcf-optin-form .woocommerce form .form-row-first,
39
+ .woocommerce-page form .form-row-first{
40
+ float: right;
41
+ clear: right;
42
+ }
43
+
44
+ .wcf-optin-form .woocommerce form .form-row-last, .woocommerce-page form .form-row-last{
45
+ float: left;
46
+ clear: left;
47
+ }
48
+
49
+ .wcf-optin-form .woocommerce form .form-row .required{
50
+ color: red;
51
+ font-weight: 700;
52
+ border: 0!important;
53
+ text-decoration: none;
54
+ }
55
+
56
+ /* To test divi and all */
57
+ .wcf-optin-form form .form-row-first.form-row-one{
58
+ clear: both;
59
+ }
60
+
61
+ .wcf-optin-form .woocommerce form.woocommerce-form-login{
62
+ display: none;
63
+ }
64
+
65
+ /**
66
+ * **************
67
+ * Common Classes
68
+ * **************
69
+ */
70
+
71
+ .wcf-optin-form .woocommerce .blockUI.blockOverlay {
72
+ font-size: 15px;
73
+ }
74
+
75
+ .wcf-optin-form .woocommerce form .form-row.woocommerce-invalid .select2-container,
76
+ .wcf-optin-form .woocommerce form .form-row.woocommerce-invalid input.input-text,
77
+ .wcf-optin-form .woocommerce form .form-row.woocommerce-invalid select{
78
+ border-width: 1px;
79
+ border-color: #e2401c;
80
+ }
81
+
82
+ .wcf-optin-form .woocommerce form .form-row.woocommerce-validated .select2-container,
83
+ .wcf-optin-form .woocommerce form .form-row.woocommerce-validated input.input-text,
84
+ .wcf-optin-form .woocommerce form .form-row.woocommerce-validated select{
85
+ border-width: 1px;
86
+ }
87
+
88
+ .wcf-optin-form .select2-container--default.field-required .select2-selection--single,
89
+ .wcf-optin-form .woocommerce form .form-row input.input-text.field-required,
90
+ .wcf-optin-form .woocommerce form .form-row textarea.input-text.field-required,
91
+ .wcf-optin-form .woocommerce #order_review .input-text.field-required{
92
+ border-color: #e2401c;
93
+ }
94
+
95
+ .wcf-optin-form .woocommerce form .form-row input.field-validated{
96
+ border-right-width: 2px;
97
+ border-right-color: #69bf29;
98
+ }
99
+
100
+ /**
101
+ * ************
102
+ * Main Layout
103
+ * ************
104
+ */
105
+
106
+ /**
107
+ * ************************
108
+ * Radio Button & Checkbox
109
+ * ************************
110
+ */
111
+
112
+ .wcf-optin-form .woocommerce #payment [type='radio']:checked + label,
113
+ .wcf-optin-form .woocommerce #payment [type='radio']:not(:checked) + label{
114
+ padding: 0px;
115
+ }
116
+
117
+ .wcf-optin-form .woocommerce #payment input[type=radio]{
118
+ -webkit-border-radius: 50%;
119
+ border-radius: 50%;
120
+ margin-left: 4px;
121
+ line-height: 10px;
122
+ }
123
+
124
+ .wcf-optin-form .woocommerce .woocommerce-billing-fields [type="checkbox"]:checked:before,
125
+ .wcf-optin-form .woocommerce #payment input[type=checkbox]:checked:before,
126
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before,
127
+ .wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]:checked:before{
128
+ content: "\e600";
129
+ margin: 0;
130
+ color: #F16334;
131
+ }
132
+
133
+ .wcf-optin-form .woocommerce .woocommerce-billing-fields [type="checkbox"],
134
+ .wcf-optin-form .woocommerce #payment input[type=checkbox],
135
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type="checkbox"],
136
+ .wcf-optin-form .woocommerce #payment input[type=radio],
137
+ .wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]{
138
+ border: 1px solid #b4b9be;
139
+ background: #fff;
140
+ color: #555;
141
+ clear: none;
142
+ cursor: pointer;
143
+ display: inline-block;
144
+ line-height: 0;
145
+ height: 16px;
146
+ margin: -4px 0 0 4px;
147
+ outline: 0;
148
+ padding: 0!important;
149
+ text-align: center;
150
+ vertical-align: middle;
151
+ width: 16px;
152
+ min-width: 16px;
153
+ -webkit-appearance: none;
154
+ -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
155
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
156
+ -webkit-transition: .05s border-color ease-in-out;
157
+ transition: .05s border-color ease-in-out;
158
+ }
159
+
160
+ .wcf-optin-form .woocommerce .woocommerce-billing-fields [type="checkbox"]:focus,
161
+ .wcf-optin-form .woocommerce #payment input[type=checkbox]:focus,
162
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:focus,
163
+ .wcf-optin-form .woocommerce #payment input[type=radio]:focus,
164
+ .wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]:focus{
165
+ border-color: #F16334;
166
+ -webkit-box-shadow: 0 0 2px rgba(241, 99, 52,.8);
167
+ box-shadow: 0 0 2px rgba(241, 99, 52,.8);
168
+ }
169
+
170
+ .wcf-optin-form .woocommerce #payment input[type=radio]:checked:before{
171
+ background-color: #F16334;
172
+ -webkit-border-radius: 50px;
173
+ border-radius: 50px;
174
+ content: "\2022";
175
+ font-size: 24px;
176
+ height: 6px;
177
+ line-height: 16px;
178
+ margin: 4px;
179
+ text-indent: -9999px;
180
+ width: 6px;
181
+ }
182
+ .wcf-optin-form .woocommerce .woocommerce-billing-fields [type="checkbox"]:checked:before,
183
+ .wcf-optin-form .woocommerce #payment input[type=checkbox]:checked:before,
184
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before,
185
+ .wcf-optin-form .woocommerce #payment input[type=radio]:checked:before,
186
+ .wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]:before{
187
+ display: inline-block;
188
+ float: right;
189
+ font: normal 15px/1 cartflows-icon;
190
+ speak: none;
191
+ vertical-align: middle;
192
+ width: 6px;
193
+ -webkit-font-smoothing: antialiased;
194
+ -moz-osx-font-smoothing: grayscale;
195
+ }
196
+
197
+ .wcf-optin-form .woocommerce-checkout #payment ul.payment_methods li input[type=checkbox]{
198
+ min-width: 16px;
199
+ }
200
+
201
+ .wcf-optin-form .woocommerce .col2-set .col-1,
202
+ .wcf-optin-form .woocommerce .col2-set .col-2,
203
+ .wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-1,
204
+ .wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-2 {
205
+ float: none;
206
+ width: 100%;
207
+ max-width: 100%;
208
+ padding: 0px;
209
+ -webkit-border-radius: 0px;
210
+ border-radius: 0px;
211
+ border: none;
212
+ border-color: none;
213
+ margin-bottom: 0px;
214
+ }
215
+
216
+ .wcf-optin-form .woocommerce-additional-fields > h3,
217
+ .wcf-optin-form .woocommerce-billing-fields > h3,
218
+ .wcf-optin-form #order_review_heading,
219
+ .wcf-optin-form .woocommerce #ship-to-different-address {
220
+ display: none;
221
+ }
222
+
223
+ .wcf-optin-form .woocommerce-checkout #payment {
224
+ background: unset;
225
+ -webkit-border-radius: 0;
226
+ border-radius: 0;
227
+ }
228
+
229
+ .wcf-optin-form .woocommerce-checkout #payment .form-row {
230
+ margin: 0;
231
+ padding: 0;
232
+ }
233
+
234
+ .wcf-optin-form .woocommerce-checkout #payment .form-row label.checkbox{
235
+ display: block;
236
+ margin-bottom: 1.1em;
237
+ }
238
+
239
+ .wcf-optin-form .woocommerce-checkout #payment .payment_method_paypal .about_paypal{
240
+ float: none;
241
+ margin-right: 10px;
242
+ }
243
+
244
+ .wcf-optin-form .woocommerce-checkout #payment div.payment_box .form-row{
245
+ margin: 0 0 0.5em;
246
+ }
247
+
248
+ .wcf-optin-form .woocommerce-checkout #payment fieldset .form-row
249
+ .wcf-optin-form .woocommerce-checkout #payment fieldset p{
250
+ margin-bottom: 10px;
251
+ }
252
+
253
+ .wcf-optin-form .woocommerce-checkout #payment div.payment_box{
254
+ background-color: #eaeaea;
255
+ font-family: inherit;
256
+ font-weight:inherit;
257
+ margin-bottom: 0.5em;
258
+ }
259
+
260
+ .wcf-optin-form #add_payment_method #payment div.payment_box::before,
261
+ .wcf-optin-form .woocommerce-cart #payment div.payment_box::before,
262
+ .wcf-optin-form .woocommerce-checkout #payment div.payment_box::before{
263
+ content: '';
264
+ display: block;
265
+ border: 1em solid;
266
+ border-left-color: transparent;
267
+ border-right-color: transparent;
268
+ border-top-color: transparent;
269
+ border-bottom-color: #eaeaea;
270
+ position: absolute;
271
+ top: -.75em;
272
+ right: 0;
273
+ margin: -1em 2em 0 0;
274
+ }
275
+
276
+ /* Fields */
277
+ .wcf-optin-form .select2-container--default .select2-selection--single {
278
+ display: block;
279
+ width: 100%;
280
+ min-height: 34px;
281
+ height: auto;
282
+ padding: 11px 12px;
283
+ font-size: 14px;
284
+ line-height: 1.42857143 !important;
285
+ color: #555;
286
+ background-color: #fff;
287
+ background-image: none;
288
+ border: 1px solid;
289
+ border-color: #d4d4d4;
290
+ -webkit-border-radius: 3px;
291
+ border-radius: 3px;
292
+ -webkit-box-shadow: none;
293
+ box-shadow: none;
294
+ outline: none;
295
+ }
296
+
297
+ .wcf-optin-form .select2-container--default .select2-selection--single .select2-selection__rendered {
298
+ color: #666;
299
+ line-height: 26px;
300
+ min-height: 26px;
301
+ overflow: visible;
302
+ padding-right: 0;
303
+ }
304
+
305
+ .wcf-optin-form .select2-results__option[aria-selected], .select2-results__option[data-selected]{
306
+ font-size: 14px;
307
+ }
308
+
309
+ .wcf-optin-form .select2-container--default .select2-selection--single .select2-selection__arrow {
310
+ height: 100%;
311
+ }
312
+
313
+ .select2-dropdown{
314
+ border: 1px solid #d4d4d4;
315
+ }
316
+
317
+ .wcf-optin-form .woocommerce form .form-row input.input-text,
318
+ .wcf-optin-form .woocommerce form .form-row textarea,
319
+ .wcf-optin-form .woocommerce form .form-row select,
320
+ .wcf-optin-form .woocommerce #order_review .input-text{
321
+ display: block;
322
+ width: 100%;
323
+ min-height: 34px;
324
+ padding: 11px 12px;
325
+ font-family: inherit;
326
+ font-weight:inherit;
327
+ font-size: 14px;
328
+ line-height: 1.42857143 !important;
329
+ color: #555;
330
+ background-color: #fff;
331
+ background-image: none;
332
+ border: 1px solid;
333
+ border-color: #d4d4d4;
334
+ -webkit-border-radius: 3px;
335
+ border-radius: 3px;
336
+ -webkit-box-shadow: none;
337
+ box-shadow: none;
338
+ height: auto;
339
+ }
340
+
341
+ .wcf-optin-form #order_review{
342
+ padding: 0;
343
+ width: 100%;
344
+ }
345
+
346
+
347
+ .wcf-optin-form input[type="text"]:focus,
348
+ .wcf-optin-form input[type="email"]:focus,
349
+ .wcf-optin-form input[type="password"]:focus,
350
+ .wcf-optin-form input[type="tel"]:focus,
351
+ .wcf-optin-form textarea:focus,
352
+ .wcf-optin-form .select2-container--open {
353
+ border-color: #b3b3b3;
354
+ -webkit-box-shadow: none;
355
+ box-shadow: none;
356
+ outline: none;
357
+ }
358
+
359
+ .wcf-optin-form button:focus {
360
+ outline: none;
361
+ outline-color: none;
362
+ outline-style: none;
363
+ outline-width: none;
364
+ }
365
+
366
+ .wcf-optin-form .woocommerce form.woocommerce-form-login .form-row button,
367
+ .wcf-optin-form form.checkout_coupon .button {
368
+ display: block;
369
+ clear: both;
370
+ border: none;
371
+ font-size: 15px;
372
+ font-family: inherit;
373
+ font-weight: inherit;
374
+ background-color: #F16334;
375
+ line-height: 9px;
376
+ padding: 18px;
377
+ margin-bottom: 10px;
378
+ width: 100%;
379
+ }
380
+
381
+
382
+ .wcf-optin-form .woocommerce #order_review #payment button {
383
+ float: none;
384
+ margin: 0 auto;
385
+ display: block;
386
+ }
387
+
388
+ .wcf-optin-form .woocommerce #order_review button {
389
+ border: 1px solid;
390
+ border-color: #F16334;
391
+ background-color: #F16334;
392
+ font-family: inherit;
393
+ font-weight:inherit;
394
+ font-size: 18px;
395
+ letter-spacing: 0.5px;
396
+ width: 100%;
397
+ padding: 16px 24px;
398
+ font-size: 16px;
399
+ line-height: 1.5;
400
+ -webkit-border-radius: 3px;
401
+ border-radius: 3px;
402
+ color: #fff;
403
+ }
404
+
405
+ .wcf-optin-form .woocommerce #order_review button.wcf-btn-small {
406
+ padding: 8px 6px;
407
+ background-color: #c8c8c8;
408
+ border: 1px #c8c8c8 solid;
409
+ }
410
+
411
+ .wcf-optin-form .woocommerce #order_review button.wcf-btn-small:hover{
412
+ border-color: #F16334;
413
+ background-color: #F16334;
414
+ }
415
+ .wcf-optin-form .woocommerce #payment #place_order:hover {
416
+ background-color: #F16334;
417
+ border-color: #F16334;
418
+ color: #fff;
419
+ }
420
+
421
+ /**
422
+ * ***********************
423
+ * New checkout style
424
+ * ***********************
425
+ */
426
+
427
+ .wcf-optin-form .woocommerce-form-coupon-toggle,
428
+ .wcf-optin-form .woocommerce-additional-fields,
429
+ .wcf-optin-form table.shop_table.woocommerce-checkout-review-order-table {
430
+ display: none !important;
431
+ }
432
+
433
+ .wcf-optin-form .woocommerce-checkout{
434
+ display: inline-block;
435
+ text-align: inherit;
436
+ width: 100%;
437
+ }
438
+
439
+ .wcf-optin-form .woocommerce-checkout .wcf-col2-set{
440
+ display: block;
441
+ width: 100%;
442
+ float: none;
443
+ margin: 10px 0 0 0;
444
+ padding: 0px;
445
+ }
446
+
447
+ .wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,
448
+ .wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{
449
+ margin: 0 -7px;
450
+ -ms-flex-wrap: wrap;
451
+ flex-wrap: wrap;
452
+ -js-display: flex;
453
+ display: -webkit-box;
454
+ display: -moz-box;
455
+ display: -ms-flexbox;
456
+ display: flex;
457
+ display: -webkit-flex; /* Safari 6.1+, firefox, chrome */
458
+ flex-wrap: wrap;
459
+ -webkit-flex-wrap: wrap; /* Safari 6.1+, firefox, chrome*/
460
+ }
461
+
462
+ .wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper{
463
+ margin: 0px -7px;
464
+ }
465
+
466
+ .wcf-optin-form .woocommerce form .form-row{
467
+ display: block;
468
+ margin-bottom: 1.1em;
469
+ padding: 3px 7px;
470
+ position: relative;
471
+ }
472
+
473
+ .wcf-optin-form .woocommerce form .woocommerce-account-fields {
474
+ display: none;
475
+ }
476
+
477
+ .wcf-optin-form .woocommerce form .woocommerce-account-fields .form-row{
478
+ padding: 0px;
479
+ }
480
+
481
+ .wcf-optin-form .woocommerce form.woocommerce-form-login .form-row label,
482
+ .wcf-optin-form .woocommerce-checkout .form-row label{
483
+ font-size: 13px;
484
+ line-height: 1em;
485
+ letter-spacing: 0.3px;
486
+ font-family: inherit;
487
+ font-weight:inherit;
488
+ margin-bottom: 8px;
489
+ }
490
+
491
+ .wcf-optin-form .woocommerce .woocommerce-billing-fields label,
492
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields label{
493
+ display: inherit;
494
+ }
495
+
496
+ .wcf-optin-form .woocommerce .woocommerce-terms-and-conditions-wrapper {
497
+ display: none;
498
+ }
499
+
500
+ .wcf-optin-form .woocommerce a{
501
+ color: #F16334;
502
+ background-color: transparent;
503
+ text-decoration: none;
504
+ }
505
+
506
+ .wcf-optin-form .woocommerce .woocommerce-info,
507
+ .wcf-optin-form .woocommerce .woocommerce-error,
508
+ .wcf-optin-form .woocommerce .woocommerce-message,
509
+ .wcf-optin-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message,
510
+ .wcf-optin-form .woocommerce .woocommerce-NoticeGroup .woocommerce-message{
511
+ padding: 1em 2.0em 0.4em 2em;
512
+ border-top:none;
513
+ background-color: inherit;
514
+ font-size: 14px;
515
+ font-weight: 500;
516
+ text-align: right;
517
+ margin:0px;
518
+ }
519
+
520
+ .wcf-optin-form .woocommerce-info::before,
521
+ .wcf-optin-form .woocommerce-message::before{
522
+ right: 0.1em;
523
+ color: #F16334;
524
+ }
525
+
526
+ .wcf-optin-form .woocommerce .woocommerce-error,
527
+ .wcf-optin-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error,
528
+ .wcf-optin-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error{
529
+ background-color: #fff6f6;
530
+ border: dashed 1px #a00;
531
+ padding: 25px 25px 20px;
532
+ color: #a00;
533
+ margin: 1rem 0 1rem;
534
+ font-size: 14px;
535
+ width: 100%;
536
+
537
+ }
538
+
539
+ .wcf-optin-form .woocommerce .woocommerce-error::before {
540
+ content: '';
541
+ }
542
+
543
+ .wcf-optin-form .woocommerce-checkout #payment ul.payment_methods li:not(.woocommerce-notice)::before{
544
+ display: inline;
545
+ }
546
+
547
+ .wcf-optin-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{
548
+ margin:1em 0 1em;
549
+ }
550
+
551
+ .wcf-optin-form .woocommerce .woocommerce-error li{
552
+ list-style: disc inside !important;
553
+ margin: 0 0 8px;
554
+ }
555
+
556
+ .wcf-optin-form .woocommerce .woocommerce-error li strong{
557
+ font-weight: 400;
558
+ }
559
+
560
+ .wcf-optin-form .woocommerce form.checkout_coupon{
561
+ border: 1px solid #d3ced2;
562
+ padding: 30px 20px 20px;
563
+ margin: 2em 0;
564
+ text-align: right;
565
+ -webkit-border-radius: 5px;
566
+ border-radius: 5px;
567
+ }
568
+
569
+ .wcf-optin-form .woocommerce .checkout_coupon p{
570
+ font-size: 14px;
571
+ }
572
+
573
+ .wcf-optin-form .woocommerce .checkout_coupon p{
574
+ font-family: inherit;
575
+ font-weight: 500;
576
+ margin-top: 0;
577
+ margin-bottom: 10px;
578
+ }
579
+
580
+ /**
581
+ * **********************
582
+ * One Column Layout
583
+ * **********************
584
+ */
585
+
586
+ .wcf-optin-form-one-column{
587
+ background: inherit;
588
+ width: 100%;
589
+ margin:0 auto;
590
+ }
591
+
592
+ .wcf-optin-form-one-column .woocommerce .col2-set .col-1,
593
+ .wcf-optin-form-one-column .woocommerce .col2-set .col-2,
594
+ .wcf-optin-form-one-column .woocommerce-checkout .shop_table,
595
+ .wcf-optin-form-one-column .woocommerce-checkout .wcf-qty-options,
596
+ .wcf-optin-form-one-column .woocommerce-checkout #order_review_heading,
597
+ .wcf-optin-form-one-column .woocommerce-checkout #your_products_heading,
598
+ .wcf-optin-form-one-column .woocommerce-checkout #payment,
599
+ .wcf-optin-form-one-column .woocommerce form.checkout_coupon,
600
+ .wcf-optin-form-one-column .woocommerce .wcf-order-wrap{
601
+ width: 100%;
602
+ }
603
+
604
+ .wcf-optin-form-one-column input[type="text"],
605
+ .wcf-optin-form-one-column input[type="email"],
606
+ .wcf-optin-form-one-column input[type="password"],
607
+ .wcf-optin-form-one-column input[type="tel"],
608
+ .wcf-optin-form-one-column textarea,
609
+ .wcf-optin-form-one-column select {
610
+ display: block;
611
+ width: 100%;
612
+ min-height: 40px;
613
+ padding: 11px 12px;
614
+ font-family: inherit;
615
+ font-weight:inherit;
616
+ font-size: 14px;
617
+ line-height: 1.42857143;
618
+ color: #555;
619
+ background-color: #fff;
620
+ background-image: none;
621
+ border: 1px solid #d4d4d4;
622
+ -webkit-border-radius: 3px;
623
+ border-radius: 3px;
624
+ -webkit-box-shadow: none;
625
+ box-shadow: none;
626
+ }
627
+
628
+ .wcf-optin-form-one-column .woocommerce-checkout #order_review_heading,
629
+ .wcf-optin-form-one-column .woocommerce-checkout #your_products_heading{
630
+ margin:20px 0 0;
631
+ }
632
+
633
+ .wcf-optin-form-one-column .woocommerce-checkout #order_review{
634
+ width: 100%;
635
+ }
636
+
637
+ @media only screen and (max-width: 768px) {
638
+
639
+ .wcf-optin-form form.checkout_coupon .button{
640
+ font-size: 12px;
641
+ }
642
+
643
+ /* Added for pro support */
644
+ .wcf-optin-form .woocommerce .col2-set .col-1,
645
+ .wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-1,
646
+ .wcf-optin-form .woocommerce .wcf-order-wrap {
647
+ padding: 15px 0;
648
+ }
649
+
650
+ .wcf-optin-form .woocommerce .col2-set .col-2,
651
+ .wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-2 {
652
+ padding: 0;
653
+ }
654
+
655
+ .wcf-optin-form .woocommerce form .form-row-first,
656
+ .wcf-optin-form .woocommerce form .form-row-last {
657
+ width: 100%;
658
+ }
659
+
660
+ .wcf-optin-form .woocommerce-additional-fields > h3,
661
+ .wcf-optin-form .woocommerce-billing-fields > h3,
662
+ .wcf-optin-form #order_review_heading,
663
+ .wcf-optin-form .woocommerce #ship-to-different-address{
664
+ font-size: 1.0em;
665
+ }
666
+ }
667
+
668
+
669
+ /**
670
+ * **********************
671
+ * Divi Css Overrite
672
+ * **********************
673
+ */
674
+
675
+ #et-info-email:before,
676
+ #et-info-phone:before,
677
+ #et_search_icon:before,
678
+ .comment-reply-link:after,
679
+ .et-cart-info span:before,
680
+ .et-pb-arrow-next:before,
681
+ .et-pb-arrow-prev:before,
682
+ .et-social-icon a:before,
683
+ .et_audio_container .mejs-playpause-button button:before,
684
+ .et_audio_container .mejs-volume-button button:before,
685
+ .et_overlay:before,
686
+ .et_password_protected_form .et_submit_button:after,
687
+ .et_pb_button:after,
688
+ .et_pb_contact_reset:after,
689
+ .et_pb_contact_submit:after,
690
+ .et_pb_font_icon:before,
691
+ .et_pb_newsletter_button:after,
692
+ .et_pb_pricing_table_button:after,
693
+ .et_pb_promo_button:after,
694
+ .et_pb_social_icon a.icon:before,
695
+ .et_pb_testimonial:before,
696
+ .et_pb_toggle_title:before,
697
+ .form-submit .et_pb_button:after,
698
+ .mobile_menu_bar:before,
699
+ .woocommerce #content input.button.alt:after,
700
+ .woocommerce #content input.button:after,
701
+ .woocommerce #respond input#submit.alt:after,
702
+ .woocommerce #respond input#submit:after,
703
+ .woocommerce a.button.alt:after,
704
+ .woocommerce button.button.alt:after,
705
+ .woocommerce button.button:after,
706
+ .woocommerce button.single_add_to_cart_button.button:after,
707
+ .woocommerce input.button.alt:after,
708
+ .woocommerce input.button:after,
709
+ .woocommerce-page #content input.button.alt:after,
710
+ .woocommerce-page #content input.button:after,
711
+ .woocommerce-page #respond input#submit.alt:after,
712
+ .woocommerce-page #respond input#submit:after,
713
+ .woocommerce-page a.button.alt:after,
714
+ .woocommerce-page a.button:after,
715
+ .woocommerce-page button.button.alt:after,
716
+ .woocommerce-page button.button:after,
717
+ .woocommerce-page input.button.alt:after,
718
+ .woocommerce-page input.button:after,
719
+ a.et_pb_more_button:after{
720
+ text-shadow: 0 0;
721
+ font-family: none;
722
+ font-weight: 400;
723
+ font-style: normal;
724
+ font-variant: normal;
725
+ -webkit-font-smoothing: antialiased;
726
+ -moz-osx-font-smoothing: grayscale;
727
+ line-height: 1;
728
+ text-transform: none;
729
+ speak: none;
730
+ }
731
+
732
+ .comment-reply-link:hover:after,
733
+ .woocommerce #content input.button.alt:hover:after,
734
+ .woocommerce #content input.button:hover:after,
735
+ .woocommerce #respond input#submit.alt:hover:after,
736
+ .woocommerce #respond input#submit:hover:after,
737
+ .woocommerce a.button.alt:hover:after,
738
+ .woocommerce a.button:hover:after,
739
+ .woocommerce button.button.alt:hover:after,
740
+ .woocommerce button.button:hover:after,
741
+ .woocommerce input.button.alt:hover:after,
742
+ .woocommerce input.button:hover:after {
743
+ opacity: 0;
744
+ }
745
+
746
+
747
+ /**
748
+ * **************************
749
+ * Thrive Compatibility css
750
+ * **************************
751
+ */
752
+
753
+ .thrv_wrapper .wcf-optin-form div{
754
+ -webkit-box-sizing: border-box;
755
+ -moz-box-sizing: border-box;
756
+ box-sizing: border-box;
757
+ }
assets/css/optin-template.css ADDED
@@ -0,0 +1,757 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * **************
3
+ * Login & Coupon Field Layout
4
+ * **************
5
+ */
6
+ /* Editor CSS */
7
+ .elementor-editor-active .wcf-optin-form .woocommerce #order_review #payment #place_order {
8
+ pointer-events: none !important;
9
+ }
10
+
11
+ .cartflows-container .wcf-optin-form,
12
+ .cartflows-container .wcf-optin-form * {
13
+ -webkit-box-sizing: border-box;
14
+ -moz-box-sizing: border-box;
15
+ box-sizing: border-box;
16
+ }
17
+
18
+ .wcf-optin-form .wc-backward {
19
+ display: none !important;
20
+ }
21
+
22
+ .wcf-optin-form .woocommerce form .form-row-first,
23
+ .wcf-optin-form .woocommerce form .form-row-last{
24
+ width: 50%;
25
+ display: block;
26
+ }
27
+
28
+ .wcf-optin-form .woocommerce form .form-row-full{
29
+ width: 100%;
30
+ clear: both;
31
+ }
32
+
33
+ .wcf-optin-form form .form-row-wide{
34
+ width: 100%;
35
+ }
36
+
37
+ /* To test divi and all */
38
+ .wcf-optin-form .woocommerce form .form-row-first,
39
+ .woocommerce-page form .form-row-first{
40
+ float: left;
41
+ clear: left;
42
+ }
43
+
44
+ .wcf-optin-form .woocommerce form .form-row-last, .woocommerce-page form .form-row-last{
45
+ float: right;
46
+ clear: right;
47
+ }
48
+
49
+ .wcf-optin-form .woocommerce form .form-row .required{
50
+ color: red;
51
+ font-weight: 700;
52
+ border: 0!important;
53
+ text-decoration: none;
54
+ }
55
+
56
+ /* To test divi and all */
57
+ .wcf-optin-form form .form-row-first.form-row-one{
58
+ clear: both;
59
+ }
60
+
61
+ .wcf-optin-form .woocommerce form.woocommerce-form-login{
62
+ display: none;
63
+ }
64
+
65
+ /**
66
+ * **************
67
+ * Common Classes
68
+ * **************
69
+ */
70
+
71
+ .wcf-optin-form .woocommerce .blockUI.blockOverlay {
72
+ font-size: 15px;
73
+ }
74
+
75
+ .wcf-optin-form .woocommerce form .form-row.woocommerce-invalid .select2-container,
76
+ .wcf-optin-form .woocommerce form .form-row.woocommerce-invalid input.input-text,
77
+ .wcf-optin-form .woocommerce form .form-row.woocommerce-invalid select{
78
+ border-width: 1px;
79
+ border-color: #e2401c;
80
+ }
81
+
82
+ .wcf-optin-form .woocommerce form .form-row.woocommerce-validated .select2-container,
83
+ .wcf-optin-form .woocommerce form .form-row.woocommerce-validated input.input-text,
84
+ .wcf-optin-form .woocommerce form .form-row.woocommerce-validated select{
85
+ border-width: 1px;
86
+ }
87
+
88
+ .wcf-optin-form .select2-container--default.field-required .select2-selection--single,
89
+ .wcf-optin-form .woocommerce form .form-row input.input-text.field-required,
90
+ .wcf-optin-form .woocommerce form .form-row textarea.input-text.field-required,
91
+ .wcf-optin-form .woocommerce #order_review .input-text.field-required{
92
+ border-color: #e2401c;
93
+ }
94
+
95
+ .wcf-optin-form .woocommerce form .form-row input.field-validated{
96
+ border-left-width: 2px;
97
+ border-left-color: #69bf29;
98
+ }
99
+
100
+ /**
101
+ * ************
102
+ * Main Layout
103
+ * ************
104
+ */
105
+
106
+ /**
107
+ * ************************
108
+ * Radio Button & Checkbox
109
+ * ************************
110
+ */
111
+
112
+ .wcf-optin-form .woocommerce #payment [type='radio']:checked + label,
113
+ .wcf-optin-form .woocommerce #payment [type='radio']:not(:checked) + label{
114
+ padding: 0px;
115
+ }
116
+
117
+ .wcf-optin-form .woocommerce #payment input[type=radio]{
118
+ -webkit-border-radius: 50%;
119
+ border-radius: 50%;
120
+ margin-right: 4px;
121
+ line-height: 10px;
122
+ }
123
+
124
+ .wcf-optin-form .woocommerce .woocommerce-billing-fields [type="checkbox"]:checked:before,
125
+ .wcf-optin-form .woocommerce #payment input[type=checkbox]:checked:before,
126
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before,
127
+ .wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]:checked:before{
128
+ content: "\e600";
129
+ margin: 0;
130
+ color: #F16334;
131
+ }
132
+
133
+ .wcf-optin-form .woocommerce .woocommerce-billing-fields [type="checkbox"],
134
+ .wcf-optin-form .woocommerce #payment input[type=checkbox],
135
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type="checkbox"],
136
+ .wcf-optin-form .woocommerce #payment input[type=radio],
137
+ .wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]{
138
+ border: 1px solid #b4b9be;
139
+ background: #fff;
140
+ color: #555;
141
+ clear: none;
142
+ cursor: pointer;
143
+ display: inline-block;
144
+ line-height: 0;
145
+ height: 16px;
146
+ margin: -4px 4px 0 0;
147
+ outline: 0;
148
+ padding: 0!important;
149
+ text-align: center;
150
+ vertical-align: middle;
151
+ width: 16px;
152
+ min-width: 16px;
153
+ -webkit-appearance: none;
154
+ -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
155
+ box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
156
+ -webkit-transition: .05s border-color ease-in-out;
157
+ transition: .05s border-color ease-in-out;
158
+ }
159
+
160
+ .wcf-optin-form .woocommerce .woocommerce-billing-fields [type="checkbox"]:focus,
161
+ .wcf-optin-form .woocommerce #payment input[type=checkbox]:focus,
162
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:focus,
163
+ .wcf-optin-form .woocommerce #payment input[type=radio]:focus,
164
+ .wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]:focus{
165
+ border-color: #F16334;
166
+ -webkit-box-shadow: 0 0 2px rgba(241, 99, 52,.8);
167
+ box-shadow: 0 0 2px rgba(241, 99, 52,.8);
168
+ }
169
+
170
+ .wcf-optin-form .woocommerce #payment input[type=radio]:checked:before{
171
+ background-color: #F16334;
172
+ -webkit-border-radius: 50px;
173
+ border-radius: 50px;
174
+ content: "\2022";
175
+ font-size: 24px;
176
+ height: 6px;
177
+ line-height: 16px;
178
+ margin: 4px;
179
+ text-indent: -9999px;
180
+ width: 6px;
181
+ }
182
+ .wcf-optin-form .woocommerce .woocommerce-billing-fields [type="checkbox"]:checked:before,
183
+ .wcf-optin-form .woocommerce #payment input[type=checkbox]:checked:before,
184
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before,
185
+ .wcf-optin-form .woocommerce #payment input[type=radio]:checked:before,
186
+ .wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]:before{
187
+ display: inline-block;
188
+ float: left;
189
+ font: normal 15px/1 cartflows-icon;
190
+ speak: none;
191
+ vertical-align: middle;
192
+ width: 6px;
193
+ -webkit-font-smoothing: antialiased;
194
+ -moz-osx-font-smoothing: grayscale;
195
+ }
196
+
197
+ .wcf-optin-form .woocommerce-checkout #payment ul.payment_methods li input[type=checkbox]{
198
+ min-width: 16px;
199
+ }
200
+
201
+ .wcf-optin-form .woocommerce .col2-set .col-1,
202
+ .wcf-optin-form .woocommerce .col2-set .col-2,
203
+ .wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-1,
204
+ .wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-2 {
205
+ float: none;
206
+ width: 100%;
207
+ max-width: 100%;
208
+ padding: 0px;
209
+ -webkit-border-radius: 0px;
210
+ border-radius: 0px;
211
+ border: none;
212
+ border-color: none;
213
+ margin-bottom: 0px;
214
+ }
215
+
216
+ .wcf-optin-form .woocommerce-additional-fields > h3,
217
+ .wcf-optin-form .woocommerce-billing-fields > h3,
218
+ .wcf-optin-form #order_review_heading,
219
+ .wcf-optin-form .woocommerce #ship-to-different-address {
220
+ display: none;
221
+ }
222
+
223
+ .wcf-optin-form .woocommerce-checkout #payment {
224
+ background: unset;
225
+ -webkit-border-radius: 0;
226
+ border-radius: 0;
227
+ }
228
+
229
+ .wcf-optin-form .woocommerce-checkout #payment .form-row {
230
+ margin: 0;
231
+ padding: 0;
232
+ }
233
+
234
+ .wcf-optin-form .woocommerce-checkout #payment .form-row label.checkbox{
235
+ display: block;
236
+ margin-bottom: 1.1em;
237
+ }
238
+
239
+ .wcf-optin-form .woocommerce-checkout #payment .payment_method_paypal .about_paypal{
240
+ float: none;
241
+ margin-left: 10px;
242
+ }
243
+
244
+ .wcf-optin-form .woocommerce-checkout #payment div.payment_box .form-row{
245
+ margin: 0 0 0.5em;
246
+ }
247
+
248
+ .wcf-optin-form .woocommerce-checkout #payment fieldset .form-row
249
+ .wcf-optin-form .woocommerce-checkout #payment fieldset p{
250
+ margin-bottom: 10px;
251
+ }
252
+
253
+ .wcf-optin-form .woocommerce-checkout #payment div.payment_box{
254
+ background-color: #eaeaea;
255
+ font-family: inherit;
256
+ font-weight:inherit;
257
+ margin-bottom: 0.5em;
258
+ }
259
+
260
+ .wcf-optin-form #add_payment_method #payment div.payment_box::before,
261
+ .wcf-optin-form .woocommerce-cart #payment div.payment_box::before,
262
+ .wcf-optin-form .woocommerce-checkout #payment div.payment_box::before{
263
+ content: '';
264
+ display: block;
265
+ border: 1em solid;
266
+ border-right-color: transparent;
267
+ border-left-color: transparent;
268
+ border-top-color: transparent;
269
+ border-bottom-color: #eaeaea;
270
+ position: absolute;
271
+ top: -.75em;
272
+ left: 0;
273
+ margin: -1em 0 0 2em;
274
+ }
275
+
276
+ /* Fields */
277
+ .wcf-optin-form .select2-container--default .select2-selection--single {
278
+ display: block;
279
+ width: 100%;
280
+ min-height: 34px;
281
+ height: auto;
282
+ padding: 11px 12px;
283
+ font-size: 14px;
284
+ line-height: 1.42857143 !important;
285
+ color: #555;
286
+ background-color: #fff;
287
+ background-image: none;
288
+ border: 1px solid;
289
+ border-color: #d4d4d4;
290
+ -webkit-border-radius: 3px;
291
+ border-radius: 3px;
292
+ -webkit-box-shadow: none;
293
+ box-shadow: none;
294
+ outline: none;
295
+ }
296
+
297
+ .wcf-optin-form .select2-container--default .select2-selection--single .select2-selection__rendered {
298
+ color: #666;
299
+ line-height: 26px;
300
+ min-height: 26px;
301
+ overflow: visible;
302
+ padding-left: 0;
303
+ }
304
+
305
+ .wcf-optin-form .select2-results__option[aria-selected], .select2-results__option[data-selected]{
306
+ font-size: 14px;
307
+ }
308
+
309
+ .wcf-optin-form .select2-container--default .select2-selection--single .select2-selection__arrow {
310
+ height: 100%;
311
+ }
312
+
313
+ .select2-dropdown{
314
+ border: 1px solid #d4d4d4;
315
+ }
316
+
317
+ .wcf-optin-form .woocommerce form .form-row input.input-text,
318
+ .wcf-optin-form .woocommerce form .form-row textarea,
319
+ .wcf-optin-form .woocommerce form .form-row select,
320
+ .wcf-optin-form .woocommerce #order_review .input-text{
321
+ display: block;
322
+ width: 100%;
323
+ min-height: 34px;
324
+ padding: 11px 12px;
325
+ font-family: inherit;
326
+ font-weight:inherit;
327
+ font-size: 14px;
328
+ line-height: 1.42857143 !important;
329
+ color: #555;
330
+ background-color: #fff;
331
+ background-image: none;
332
+ border: 1px solid;
333
+ border-color: #d4d4d4;
334
+ -webkit-border-radius: 3px;
335
+ border-radius: 3px;
336
+ -webkit-box-shadow: none;
337
+ box-shadow: none;
338
+ height: auto;
339
+ }
340
+
341
+ .wcf-optin-form #order_review{
342
+ padding: 0;
343
+ width: 100%;
344
+ }
345
+
346
+
347
+ .wcf-optin-form input[type="text"]:focus,
348
+ .wcf-optin-form input[type="email"]:focus,
349
+ .wcf-optin-form input[type="password"]:focus,
350
+ .wcf-optin-form input[type="tel"]:focus,
351
+ .wcf-optin-form textarea:focus,
352
+ .wcf-optin-form .select2-container--open {
353
+ border-color: #b3b3b3;
354
+ -webkit-box-shadow: none;
355
+ box-shadow: none;
356
+ outline: none;
357
+ }
358
+
359
+ .wcf-optin-form button:focus {
360
+ outline: none;
361
+ outline-color: none;
362
+ outline-style: none;
363
+ outline-width: none;
364
+ }
365
+
366
+ .wcf-optin-form .woocommerce form.woocommerce-form-login .form-row button,
367
+ .wcf-optin-form form.checkout_coupon .button {
368
+ display: block;
369
+ clear: both;
370
+ border: none;
371
+ font-size: 15px;
372
+ font-family: inherit;
373
+ font-weight: inherit;
374
+ background-color: #F16334;
375
+ line-height: 9px;
376
+ padding: 18px;
377
+ margin-bottom: 10px;
378
+ width: 100%;
379
+ }
380
+
381
+
382
+ .wcf-optin-form .woocommerce #order_review #payment button {
383
+ float: none;
384
+ margin: 0 auto;
385
+ display: block;
386
+ }
387
+
388
+ .wcf-optin-form .woocommerce #order_review button {
389
+ border: 1px solid;
390
+ border-color: #F16334;
391
+ background-color: #F16334;
392
+ font-family: inherit;
393
+ font-weight:inherit;
394
+ font-size: 18px;
395
+ letter-spacing: 0.5px;
396
+ width: 100%;
397
+ padding: 16px 24px;
398
+ font-size: 16px;
399
+ line-height: 1.5;
400
+ -webkit-border-radius: 3px;
401
+ border-radius: 3px;
402
+ color: #fff;
403
+ }
404
+
405
+ .wcf-optin-form .woocommerce #order_review button.wcf-btn-small {
406
+ padding: 8px 6px;
407
+ background-color: #c8c8c8;
408
+ border: 1px #c8c8c8 solid;
409
+ }
410
+
411
+ .wcf-optin-form .woocommerce #order_review button.wcf-btn-small:hover{
412
+ border-color: #F16334;
413
+ background-color: #F16334;
414
+ }
415
+ .wcf-optin-form .woocommerce #payment #place_order:hover {
416
+ background-color: #F16334;
417
+ border-color: #F16334;
418
+ color: #fff;
419
+ }
420
+
421
+ /**
422
+ * ***********************
423
+ * New checkout style
424
+ * ***********************
425
+ */
426
+
427
+ .wcf-optin-form .woocommerce-form-coupon-toggle,
428
+ .wcf-optin-form .woocommerce-additional-fields,
429
+ .wcf-optin-form table.shop_table.woocommerce-checkout-review-order-table {
430
+ display: none !important;
431
+ }
432
+
433
+ .wcf-optin-form .woocommerce-checkout{
434
+ display: inline-block;
435
+ text-align: inherit;
436
+ width: 100%;
437
+ }
438
+
439
+ .wcf-optin-form .woocommerce-checkout .wcf-col2-set{
440
+ display: block;
441
+ width: 100%;
442
+ float: none;
443
+ margin: 10px 0 0 0;
444
+ padding: 0px;
445
+ }
446
+
447
+ .wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,
448
+ .wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{
449
+ margin: 0 -7px;
450
+ -ms-flex-wrap: wrap;
451
+ flex-wrap: wrap;
452
+ -js-display: flex;
453
+ display: -webkit-box;
454
+ display: -moz-box;
455
+ display: -ms-flexbox;
456
+ display: flex;
457
+ display: -webkit-flex; /* Safari 6.1+, firefox, chrome */
458
+ flex-wrap: wrap;
459
+ -webkit-flex-wrap: wrap; /* Safari 6.1+, firefox, chrome*/
460
+ }
461
+
462
+ .wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper{
463
+ margin: 0px -7px;
464
+ }
465
+
466
+ .wcf-optin-form .woocommerce form .form-row{
467
+ display: block;
468
+ margin-bottom: 1.1em;
469
+ padding: 3px 7px;
470
+ position: relative;
471
+ }
472
+
473
+ .wcf-optin-form .woocommerce form .woocommerce-account-fields {
474
+ display: none;
475
+ }
476
+
477
+ .wcf-optin-form .woocommerce form .woocommerce-account-fields .form-row{
478
+ padding: 0px;
479
+ }
480
+
481
+ .wcf-optin-form .woocommerce form.woocommerce-form-login .form-row label,
482
+ .wcf-optin-form .woocommerce-checkout .form-row label{
483
+ font-size: 13px;
484
+ line-height: 1em;
485
+ letter-spacing: 0.3px;
486
+ font-family: inherit;
487
+ font-weight:inherit;
488
+ margin-bottom: 8px;
489
+ }
490
+
491
+ .wcf-optin-form .woocommerce .woocommerce-billing-fields label,
492
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields label{
493
+ display: inherit;
494
+ }
495
+
496
+ .wcf-optin-form .woocommerce .woocommerce-terms-and-conditions-wrapper {
497
+ display: none;
498
+ }
499
+
500
+ .wcf-optin-form .woocommerce a{
501
+ color: #F16334;
502
+ background-color: transparent;
503
+ text-decoration: none;
504
+ }
505
+
506
+ .wcf-optin-form .woocommerce .woocommerce-info,
507
+ .wcf-optin-form .woocommerce .woocommerce-error,
508
+ .wcf-optin-form .woocommerce .woocommerce-message,
509
+ .wcf-optin-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message,
510
+ .wcf-optin-form .woocommerce .woocommerce-NoticeGroup .woocommerce-message{
511
+ padding: 1em 2em 0.4em 2.0em;
512
+ border-top:none;
513
+ background-color: inherit;
514
+ font-size: 14px;
515
+ font-weight: 500;
516
+ text-align: left;
517
+ margin:0px;
518
+ }
519
+
520
+ .wcf-optin-form .woocommerce-info::before,
521
+ .wcf-optin-form .woocommerce-message::before{
522
+ left: 0.1em;
523
+ color: #F16334;
524
+ }
525
+
526
+ .wcf-optin-form .woocommerce .woocommerce-error,
527
+ .wcf-optin-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error,
528
+ .wcf-optin-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error{
529
+ background-color: #fff6f6;
530
+ border: dashed 1px #a00;
531
+ padding: 25px 25px 20px;
532
+ color: #a00;
533
+ margin: 1rem 0 1rem;
534
+ font-size: 14px;
535
+ width: 100%;
536
+
537
+ }
538
+
539
+ .wcf-optin-form .woocommerce .woocommerce-error::before {
540
+ content: '';
541
+ }
542
+
543
+ .wcf-optin-form .woocommerce-checkout #payment ul.payment_methods li:not(.woocommerce-notice)::before{
544
+ display: inline;
545
+ }
546
+
547
+ .wcf-optin-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{
548
+ margin:1em 0 1em;
549
+ }
550
+
551
+ .wcf-optin-form .woocommerce .woocommerce-error li{
552
+ list-style: disc inside !important;
553
+ margin: 0 0 8px;
554
+ }
555
+
556
+ .wcf-optin-form .woocommerce .woocommerce-error li strong{
557
+ font-weight: 400;
558
+ }
559
+
560
+ .wcf-optin-form .woocommerce form.checkout_coupon{
561
+ border: 1px solid #d3ced2;
562
+ padding: 30px 20px 20px;
563
+ margin: 2em 0;
564
+ text-align: left;
565
+ -webkit-border-radius: 5px;
566
+ border-radius: 5px;
567
+ }
568
+
569
+ .wcf-optin-form .woocommerce .checkout_coupon p{
570
+ font-size: 14px;
571
+ }
572
+
573
+ .wcf-optin-form .woocommerce .checkout_coupon p{
574
+ font-family: inherit;
575
+ font-weight: 500;
576
+ margin-top: 0;
577
+ margin-bottom: 10px;
578
+ }
579
+
580
+ /**
581
+ * **********************
582
+ * One Column Layout
583
+ * **********************
584
+ */
585
+
586
+ .wcf-optin-form-one-column{
587
+ background: inherit;
588
+ width: 100%;
589
+ margin:0 auto;
590
+ }
591
+
592
+ .wcf-optin-form-one-column .woocommerce .col2-set .col-1,
593
+ .wcf-optin-form-one-column .woocommerce .col2-set .col-2,
594
+ .wcf-optin-form-one-column .woocommerce-checkout .shop_table,
595
+ .wcf-optin-form-one-column .woocommerce-checkout .wcf-qty-options,
596
+ .wcf-optin-form-one-column .woocommerce-checkout #order_review_heading,
597
+ .wcf-optin-form-one-column .woocommerce-checkout #your_products_heading,
598
+ .wcf-optin-form-one-column .woocommerce-checkout #payment,
599
+ .wcf-optin-form-one-column .woocommerce form.checkout_coupon,
600
+ .wcf-optin-form-one-column .woocommerce .wcf-order-wrap{
601
+ width: 100%;
602
+ }
603
+
604
+ .wcf-optin-form-one-column input[type="text"],
605
+ .wcf-optin-form-one-column input[type="email"],
606
+ .wcf-optin-form-one-column input[type="password"],
607
+ .wcf-optin-form-one-column input[type="tel"],
608
+ .wcf-optin-form-one-column textarea,
609
+ .wcf-optin-form-one-column select {
610
+ display: block;
611
+ width: 100%;
612
+ min-height: 40px;
613
+ padding: 11px 12px;
614
+ font-family: inherit;
615
+ font-weight:inherit;
616
+ font-size: 14px;
617
+ line-height: 1.42857143;
618
+ color: #555;
619
+ background-color: #fff;
620
+ background-image: none;
621
+ border: 1px solid #d4d4d4;
622
+ -webkit-border-radius: 3px;
623
+ border-radius: 3px;
624
+ -webkit-box-shadow: none;
625
+ box-shadow: none;
626
+ }
627
+
628
+ .wcf-optin-form-one-column .woocommerce-checkout #order_review_heading,
629
+ .wcf-optin-form-one-column .woocommerce-checkout #your_products_heading{
630
+ margin:20px 0 0;
631
+ }
632
+
633
+ .wcf-optin-form-one-column .woocommerce-checkout #order_review{
634
+ width: 100%;
635
+ }
636
+
637
+ @media only screen and (max-width: 768px) {
638
+
639
+ .wcf-optin-form form.checkout_coupon .button{
640
+ font-size: 12px;
641
+ }
642
+
643
+ /* Added for pro support */
644
+ .wcf-optin-form .woocommerce .col2-set .col-1,
645
+ .wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-1,
646
+ .wcf-optin-form .woocommerce .wcf-order-wrap {
647
+ padding: 15px 0;
648
+ }
649
+
650
+ .wcf-optin-form .woocommerce .col2-set .col-2,
651
+ .wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-2 {
652
+ padding: 0;
653
+ }
654
+
655
+ .wcf-optin-form .woocommerce form .form-row-first,
656
+ .wcf-optin-form .woocommerce form .form-row-last {
657
+ width: 100%;
658
+ }
659
+
660
+ .wcf-optin-form .woocommerce-additional-fields > h3,
661
+ .wcf-optin-form .woocommerce-billing-fields > h3,
662
+ .wcf-optin-form #order_review_heading,
663
+ .wcf-optin-form .woocommerce #ship-to-different-address{
664
+ font-size: 1.0em;
665
+ }
666
+ }
667
+
668
+
669
+ /**
670
+ * **********************
671
+ * Divi Css Overrite
672
+ * **********************
673
+ */
674
+
675
+ #et-info-email:before,
676
+ #et-info-phone:before,
677
+ #et_search_icon:before,
678
+ .comment-reply-link:after,
679
+ .et-cart-info span:before,
680
+ .et-pb-arrow-next:before,
681
+ .et-pb-arrow-prev:before,
682
+ .et-social-icon a:before,
683
+ .et_audio_container .mejs-playpause-button button:before,
684
+ .et_audio_container .mejs-volume-button button:before,
685
+ .et_overlay:before,
686
+ .et_password_protected_form .et_submit_button:after,
687
+ .et_pb_button:after,
688
+ .et_pb_contact_reset:after,
689
+ .et_pb_contact_submit:after,
690
+ .et_pb_font_icon:before,
691
+ .et_pb_newsletter_button:after,
692
+ .et_pb_pricing_table_button:after,
693
+ .et_pb_promo_button:after,
694
+ .et_pb_social_icon a.icon:before,
695
+ .et_pb_testimonial:before,
696
+ .et_pb_toggle_title:before,
697
+ .form-submit .et_pb_button:after,
698
+ .mobile_menu_bar:before,
699
+ .woocommerce #content input.button.alt:after,
700
+ .woocommerce #content input.button:after,
701
+ .woocommerce #respond input#submit.alt:after,
702
+ .woocommerce #respond input#submit:after,
703
+ .woocommerce a.button.alt:after,
704
+ .woocommerce button.button.alt:after,
705
+ .woocommerce button.button:after,
706
+ .woocommerce button.single_add_to_cart_button.button:after,
707
+ .woocommerce input.button.alt:after,
708
+ .woocommerce input.button:after,
709
+ .woocommerce-page #content input.button.alt:after,
710
+ .woocommerce-page #content input.button:after,
711
+ .woocommerce-page #respond input#submit.alt:after,
712
+ .woocommerce-page #respond input#submit:after,
713
+ .woocommerce-page a.button.alt:after,
714
+ .woocommerce-page a.button:after,
715
+ .woocommerce-page button.button.alt:after,
716
+ .woocommerce-page button.button:after,
717
+ .woocommerce-page input.button.alt:after,
718
+ .woocommerce-page input.button:after,
719
+ a.et_pb_more_button:after{
720
+ text-shadow: 0 0;
721
+ font-family: none;
722
+ font-weight: 400;
723
+ font-style: normal;
724
+ font-variant: normal;
725
+ -webkit-font-smoothing: antialiased;
726
+ -moz-osx-font-smoothing: grayscale;
727
+ line-height: 1;
728
+ text-transform: none;
729
+ speak: none;
730
+ }
731
+
732
+ .comment-reply-link:hover:after,
733
+ .woocommerce #content input.button.alt:hover:after,
734
+ .woocommerce #content input.button:hover:after,
735
+ .woocommerce #respond input#submit.alt:hover:after,
736
+ .woocommerce #respond input#submit:hover:after,
737
+ .woocommerce a.button.alt:hover:after,
738
+ .woocommerce a.button:hover:after,
739
+ .woocommerce button.button.alt:hover:after,
740
+ .woocommerce button.button:hover:after,
741
+ .woocommerce input.button.alt:hover:after,
742
+ .woocommerce input.button:hover:after {
743
+ opacity: 0;
744
+ }
745
+
746
+
747
+ /**
748
+ * **************************
749
+ * Thrive Compatibility css
750
+ * **************************
751
+ */
752
+
753
+ .thrv_wrapper .wcf-optin-form div{
754
+ -webkit-box-sizing: border-box;
755
+ -moz-box-sizing: border-box;
756
+ box-sizing: border-box;
757
+ }
assets/js/import.js CHANGED
@@ -95,14 +95,15 @@ var CartFlowsAjaxQueue = (function() {
95
  remaining_steps : 0,
96
  remaining_install_plugins : 0,
97
  remaining_active_plugins : 0,
98
- woo_required_steps: [ 'checkout', 'upsell', 'downsell', 'thankyou' ],
99
- step_order: [ 'landing', 'checkout', 'upsell', 'downsell', 'thankyou' ],
100
  new_step_names: {
101
  'landing': 'Landing',
102
  'checkout': 'Checkout (Woo)',
103
  'upsell': 'Upsell (Woo)',
104
  'downsell': 'Downsell (Woo)',
105
  'thankyou': 'Thank You (Woo)',
 
106
  },
107
 
108
  /**
@@ -787,6 +788,10 @@ var CartFlowsAjaxQueue = (function() {
787
  array.sort(function (a, b) {
788
  var A = a[key], B = b[key];
789
 
 
 
 
 
790
  if (order.indexOf(A) > order.indexOf(B)) {
791
  return 1;
792
  } else {
@@ -842,10 +847,10 @@ var CartFlowsAjaxQueue = (function() {
842
 
843
  CartFlowsAPI._api_request( api_post, function( data ) {
844
 
845
- data.items = CartFlowsImport.mapOrder( data.items, CartFlowsImport.step_order, 'slug' )
846
  var step_type_response_data = data;
847
  var step_types_count = data.items_count;
848
-
849
  // Send other request for JS caching.
850
  if( data.items ) {
851
  for ( key in data.items ) {
@@ -884,8 +889,8 @@ var CartFlowsAjaxQueue = (function() {
884
  var template = wp.template('cartflows-term-filters');
885
  $('#wcf-categories').html(template( step_type_response_data ));
886
  $('#wcf-scratch-steps-categories').html(template_dropdown( step_type_response_data ));
887
- $('#wcf-categories, #wcf-scratch-steps-categories').find('option:first').addClass('current');
888
- $('#wcf-categories').find('li:first a').addClass('current');
889
 
890
  $('.wcf-page-builder-notice').remove();
891
  $('#wcf-remote-content').find( '.spinner' ).remove();
95
  remaining_steps : 0,
96
  remaining_install_plugins : 0,
97
  remaining_active_plugins : 0,
98
+ woo_required_steps: [ 'checkout', 'upsell', 'downsell', 'thankyou', 'optin' ],
99
+ step_order: [ 'landing', 'checkout', 'upsell', 'downsell', 'thankyou', 'optin' ],
100
  new_step_names: {
101
  'landing': 'Landing',
102
  'checkout': 'Checkout (Woo)',
103
  'upsell': 'Upsell (Woo)',
104
  'downsell': 'Downsell (Woo)',
105
  'thankyou': 'Thank You (Woo)',
106
+ 'optin' : 'Optin (Woo)'
107
  },
108
 
109
  /**
788
  array.sort(function (a, b) {
789
  var A = a[key], B = b[key];
790
 
791
+ if ( order.indexOf(A) === -1 ) {
792
+ return 0;
793
+ }
794
+
795
  if (order.indexOf(A) > order.indexOf(B)) {
796
  return 1;
797
  } else {
847
 
848
  CartFlowsAPI._api_request( api_post, function( data ) {
849
 
850
+ data.items = CartFlowsImport.mapOrder( data.items, CartFlowsImport.step_order, 'slug' );
851
  var step_type_response_data = data;
852
  var step_types_count = data.items_count;
853
+
854
  // Send other request for JS caching.
855
  if( data.items ) {
856
  for ( key in data.items ) {
889
  var template = wp.template('cartflows-term-filters');
890
  $('#wcf-categories').html(template( step_type_response_data ));
891
  $('#wcf-scratch-steps-categories').html(template_dropdown( step_type_response_data ));
892
+ $('#wcf-scratch-steps-categories').find('option:first').addClass('current');
893
+ $('#wcf-categories').find('li a[data-slug=landing]').addClass('current');
894
 
895
  $('.wcf-page-builder-notice').remove();
896
  $('#wcf-remote-content').find( '.spinner' ).remove();
assets/js/optin-template.js ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+
3
+ /**
4
+ * Checkout Custom Field Validations
5
+ * This will collect all the present fields in the woocommerce form and adds an class if the field
6
+ * is blank
7
+ */
8
+ var wcf_custom_field_validation = function(){
9
+
10
+ var custom_field_add_class = function (field_value, field_row, field_wrap, field_type){
11
+
12
+ if ( field_value == '' || 'select' == field_type && field_value == ' ') {
13
+ if( field_row.hasClass('validate-required') ){
14
+
15
+ field_wrap.addClass('field-required');
16
+ }
17
+ } else {
18
+ field_wrap.removeClass('field-required');
19
+ }
20
+
21
+ }
22
+
23
+ var fields_wrapper = $('form.woocommerce-checkout #customer_details'),
24
+ $all_fields = fields_wrapper.find('input, textarea'),
25
+ $selects = fields_wrapper.find('select');
26
+
27
+ $all_fields.blur(function(){
28
+ var $this = $(this),
29
+ field_type = $this.attr('type'),
30
+ field_row = $this.closest('p.form-row'),
31
+ field_value = $this.val();
32
+
33
+ custom_field_add_class(field_value, field_row, $this, field_type);
34
+
35
+ });
36
+
37
+
38
+ $selects.blur(function(){
39
+ var $this = $(this),
40
+ field_row = $this.closest('p.form-row'),
41
+ field_type = 'select',
42
+ field_wrap = field_row.find('.select2-container--default'),
43
+ field_value = field_row.find('select').val();
44
+
45
+ custom_field_add_class(field_value, field_row, field_wrap, field_type);
46
+
47
+ });
48
+
49
+ }
50
+
51
+ var wcf_check_is_local_storage = function(){
52
+ var test = 'test';
53
+ try {
54
+ localStorage.setItem(test, test);
55
+ localStorage.removeItem(test);
56
+ return true;
57
+ } catch(e) {
58
+ return false;
59
+ }
60
+ }
61
+
62
+ var wcf_persistent_data = function(){
63
+
64
+ if( 'yes' != cartflows.allow_persistance ){
65
+ return;
66
+ }
67
+
68
+ if ( false === wcf_check_is_local_storage() ) {
69
+ return;
70
+ }
71
+
72
+ var checkout_cust_form = 'form.woocommerce-checkout #customer_details';
73
+
74
+ var wcf_form_data = {
75
+ set : function (){
76
+
77
+ var checkout_data = [];
78
+ var checkout_form = $('form.woocommerce-checkout #customer_details');
79
+
80
+ localStorage.removeItem('cartflows_checkout_form');
81
+
82
+ checkout_form.find('input[type=text], select, input[type=email], input[type=tel]').each(function(){
83
+ checkout_data.push({ name: this.name, value: this.value});
84
+ });
85
+
86
+ cartflows_checkout_form = JSON.stringify(checkout_data);
87
+ localStorage.setItem('cartflows_checkout_form', cartflows_checkout_form);
88
+ },
89
+ get : function (){
90
+
91
+
92
+ if( localStorage.getItem('cartflows_checkout_form') != null ){
93
+
94
+ checkout_data = JSON.parse( localStorage.getItem('cartflows_checkout_form') );
95
+
96
+ for (var i = 0; i < checkout_data.length; i++) {
97
+ if($('form.woocommerce-checkout [name='+checkout_data[i].name+']').hasClass('select2-hidden-accessible'))
98
+ {
99
+ $('form.woocommerce-checkout [name='+checkout_data[i].name+']').selectWoo("val", [checkout_data[i].value]);
100
+ }else{
101
+ $('form.woocommerce-checkout [name='+checkout_data[i].name+']').val(checkout_data[i].value);
102
+ }
103
+
104
+ }
105
+ }
106
+ }
107
+ }
108
+
109
+ wcf_form_data.get();
110
+
111
+ $( checkout_cust_form + " input, " + checkout_cust_form + " select").change( function() {
112
+ wcf_form_data.set();
113
+ });
114
+ }
115
+
116
+
117
+
118
+ $(document).ready(function($) {
119
+
120
+ wcf_persistent_data();
121
+
122
+ wcf_custom_field_validation();
123
+ });
124
+
125
+ })(jQuery);
assets/min-css/checkout-template-divi-rtl.min.css CHANGED
@@ -1 +1 @@
1
- .et_pb_module #wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,.et_pb_module #wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c!important}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .col2-set,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:inline-block;width:55%;float:right;padding-left:40px;margin:50px 0 0}.et_pb_module #wcf-embed-checkout-form .select2-container--default .select2-selection--single,.et_pb_module #wcf-embed-checkout-form .woocommerce #order_review .input-text,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row input.input-text,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row select,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row textarea{display:block;width:100%;min-height:34px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid #d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none}.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row{margin-bottom:1.1em;padding:3px 3px 0 3px}.et_pb_module #wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .form-row label{font-size:13px;line-height:1em;letter-spacing:.3px;font-family:inherit;font-weight:inherit;text-transform:capitalize;margin-bottom:8px}.cartflows-canvas #page-container{padding-top:0!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-message,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-info,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{color:inherit!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-error,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error{background-color:#fff6f6!important;border:dashed 1px #a00!important;padding:25px 25px 20px!important;color:#a00!important;margin:1rem 0 1rem!important;font-size:14px!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error li,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-error li,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error li{font-weight:400!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-error li strong{font-weight:400}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{content:"\e600";margin:0;color:#f16334}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio],.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]{border:1px solid #b4b9be;background:#fff;color:#555;clear:none;cursor:pointer;display:inline-block;line-height:0;height:16px;margin:-4px 0 0 4px;outline:0;padding:0!important;text-align:center;vertical-align:middle;width:16px;min-width:16px;-webkit-appearance:none;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-webkit-transition:.05s border-color ease-in-out;transition:.05s border-color ease-in-out}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:focus{border-color:#f16334;-webkit-box-shadow:0 0 2px rgba(241,99,52,.8);box-shadow:0 0 2px rgba(241,99,52,.8)}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{background-color:#f16334;-webkit-border-radius:50px;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:16px;margin:4px;text-indent:-9999px;width:6px}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{display:inline-block;float:right;font:normal 15px/1 cartflows-icon;speak:none;vertical-align:middle;width:6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.et_pb_module #wcf-embed-checkout-form #order_review_heading,.et_pb_module #wcf-embed-checkout-form .woocommerce #ship-to-different-address,.et_pb_module #wcf-embed-checkout-form .woocommerce-additional-fields>h3,.et_pb_module #wcf-embed-checkout-form .woocommerce-billing-fields>h3{font-family:inherit;font-weight:600;font-size:20px;text-transform:capitalize;margin:0 0 25px 0}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{display:inline-block!important;font-family:inherit;font-weight:600;width:45%;margin:50px 0 0;padding:0 10px 20px;border:none;border-bottom:none}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods{padding:1em 0;margin:0}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #add_payment_method #payment ul.payment_methods li,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods li{line-height:2;text-align:right;margin:0;list-style:none;font-weight:inherit}.et_pb_module #wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p{font-family:inherit;font-weight:inherit;color:#444;margin-top:0;margin-bottom:1.5em}.et_pb_module #wcf-embed-checkout-form .woocommerce .shop_table #shipping_method li{list-style:none}.et_pb_module #wcf-embed-checkout-form .woocommerce a{color:#f16334;text-decoration:none}.et_pb_module #wcf-embed-checkout-form .wcf-custom-coupon-field{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;margin-bottom:25px;margin-top:25px;border-top:1px solid #dcdcdc;padding-top:25px}.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error,.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message{color:inherit!important;border:none!important;background-color:transparent!important;padding:0 2em 1.2em 2em!important;font-size:14px!important;margin:0!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error::before,.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message::before{display:block!important}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-one-column .woocommerce .col2-set,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-one-column .woocommerce .wcf-col2-set{display:block;margin-top:10px;padding-left:0;width:100%}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-one-column .woocommerce-checkout #order_review_heading{display:block!important;margin:20px 0 0;width:100%}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-product-option-wrap{display:block;width:100%;float:none;padding-left:0;padding:0;-webkit-border-radius:0;border-radius:0;margin-top:10px;margin-bottom:20px}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{margin:0}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step #order_review_heading,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-additional-fields>h3,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-billing-fields>h3,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout #order_review_heading{display:none!important}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout #order_review{float:none;width:100%}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce a{color:#fff}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-wrap{display:block;float:none;margin:1em auto 1em;overflow:hidden}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1{background:#f1f1f1;border-style:none;border-width:2px;border-color:red;-webkit-border-radius:3px;border-radius:3px;display:inline-block}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2{border:2px red dashed;-webkit-border-radius:3px;border-radius:3px}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-bump-order-field-wrap{border-style:none;border-width:2px;border-color:red;padding:20px 25px;margin:0;font-size:1.1em;display:block;background:#ddd}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-content-container{padding:25px 0}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-bump-order-offer{padding:0 25px 10px;font-size:1.2em}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-bump-order-desc{padding:0 25px}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2 .wcf-bump-order-offer{padding:20px 25px;font-size:1.1em;font-weight:600}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2 .wcf-bump-order-desc{padding:0 25px 20px}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2 .wcf-bump-order-field-wrap{border-top:2px red dashed;padding:15px 25px;margin:0;font-size:1.1em;display:block}.et_pb_module #wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,.et_pb_module #wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c}@media only screen and (max-width:768px){.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .col2-set,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:block;float:none;padding-left:0;width:100%}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{display:block!important;float:none;width:100%}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #order_review{display:block;float:none;width:100%}}@media (max-width:767px){.et_pb_module #wcf-embed-checkout-form .woocommerce .form-row{width:100%!important}}
1
+ .et_pb_module #wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,.et_pb_module #wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c!important}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .col2-set,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:inline-block;width:55%;float:right;padding-left:40px;margin:50px 0 0}.et_pb_module #wcf-embed-checkout-form .select2-container--default .select2-selection--single,.et_pb_module #wcf-embed-checkout-form .woocommerce #order_review .input-text,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row input.input-text,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row select,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row textarea{display:block;width:100%;min-height:34px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid #d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none}.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row{margin-bottom:1.1em;padding:3px 3px 0 3px}.et_pb_module #wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .form-row label{font-size:13px;line-height:1em;letter-spacing:.3px;font-family:inherit;font-weight:inherit;margin-bottom:8px}.cartflows-canvas #page-container{padding-top:0!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-message,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-info,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{color:inherit!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-error,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error{background-color:#fff6f6!important;border:dashed 1px #a00!important;padding:25px 25px 20px!important;color:#a00!important;margin:1rem 0 1rem!important;font-size:14px!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error li,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-error li,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error li{font-weight:400!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-error li strong{font-weight:400}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{content:"\e600";margin:0;color:#f16334}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio],.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]{border:1px solid #b4b9be;background:#fff;color:#555;clear:none;cursor:pointer;display:inline-block;line-height:0;height:16px;margin:-4px 0 0 4px;outline:0;padding:0!important;text-align:center;vertical-align:middle;width:16px;min-width:16px;-webkit-appearance:none;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-webkit-transition:.05s border-color ease-in-out;transition:.05s border-color ease-in-out}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:focus{border-color:#f16334;-webkit-box-shadow:0 0 2px rgba(241,99,52,.8);box-shadow:0 0 2px rgba(241,99,52,.8)}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{background-color:#f16334;-webkit-border-radius:50px;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:16px;margin:4px;text-indent:-9999px;width:6px}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{display:inline-block;float:right;font:normal 15px/1 cartflows-icon;speak:none;vertical-align:middle;width:6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.et_pb_module #wcf-embed-checkout-form #order_review_heading,.et_pb_module #wcf-embed-checkout-form .woocommerce #ship-to-different-address,.et_pb_module #wcf-embed-checkout-form .woocommerce-additional-fields>h3,.et_pb_module #wcf-embed-checkout-form .woocommerce-billing-fields>h3{font-family:inherit;font-weight:600;font-size:20px;margin:0 0 25px 0}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{display:inline-block!important;font-family:inherit;font-weight:600;width:45%;margin:50px 0 0;padding:0 10px 20px;border:none;border-bottom:none}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods{padding:1em 0;margin:0}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #add_payment_method #payment ul.payment_methods li,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods li{line-height:2;text-align:right;margin:0;list-style:none;font-weight:inherit}.et_pb_module #wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p{font-family:inherit;font-weight:inherit;color:#444;margin-top:0;margin-bottom:1.5em}.et_pb_module #wcf-embed-checkout-form .woocommerce .shop_table #shipping_method li{list-style:none}.et_pb_module #wcf-embed-checkout-form .woocommerce a{color:#f16334;text-decoration:none}.et_pb_module #wcf-embed-checkout-form .wcf-custom-coupon-field{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;margin-bottom:25px;margin-top:25px;border-top:1px solid #dcdcdc;padding-top:25px}.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error,.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message{color:inherit!important;border:none!important;background-color:transparent!important;padding:0 2em 1.2em 2em!important;font-size:14px!important;margin:0!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error::before,.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message::before{display:block!important}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-one-column .woocommerce .col2-set,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-one-column .woocommerce .wcf-col2-set{display:block;margin-top:10px;padding-left:0;width:100%}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-one-column .woocommerce-checkout #order_review_heading{display:block!important;margin:20px 0 0;width:100%}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-wrap{display:block;float:none;margin:1em auto 1em;overflow:hidden}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1{background:#f1f1f1;border-style:none;border-width:2px;border-color:red;-webkit-border-radius:3px;border-radius:3px;display:inline-block}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2{border:2px red dashed;-webkit-border-radius:3px;border-radius:3px}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-bump-order-field-wrap{border-style:none;border-width:2px;border-color:red;padding:20px 25px;margin:0;font-size:1.1em;display:block;background:#ddd}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-content-container{padding:25px 0}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-bump-order-offer{padding:0 25px 10px;font-size:1.2em}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-bump-order-desc{padding:0 25px}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2 .wcf-bump-order-offer{padding:20px 25px;font-size:1.1em;font-weight:600}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2 .wcf-bump-order-desc{padding:0 25px 20px}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2 .wcf-bump-order-field-wrap{border-top:2px red dashed;padding:15px 25px;margin:0;font-size:1.1em;display:block}.et_pb_module #wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,.et_pb_module #wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c}@media only screen and (max-width:768px){.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .col2-set,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:block;float:none;padding-left:0;width:100%}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{display:block!important;float:none;width:100%}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #order_review{display:block;float:none;width:100%}}@media (max-width:767px){.et_pb_module #wcf-embed-checkout-form .woocommerce .form-row{width:100%!important}}
assets/min-css/checkout-template-divi.min.css CHANGED
@@ -1 +1 @@
1
- .et_pb_module #wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,.et_pb_module #wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c!important}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .col2-set,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:inline-block;width:55%;float:left;padding-right:40px;margin:50px 0 0}.et_pb_module #wcf-embed-checkout-form .select2-container--default .select2-selection--single,.et_pb_module #wcf-embed-checkout-form .woocommerce #order_review .input-text,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row input.input-text,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row select,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row textarea{display:block;width:100%;min-height:34px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid #d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none}.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row{margin-bottom:1.1em;padding:3px 3px 0 3px}.et_pb_module #wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .form-row label{font-size:13px;line-height:1em;letter-spacing:.3px;font-family:inherit;font-weight:inherit;text-transform:capitalize;margin-bottom:8px}.cartflows-canvas #page-container{padding-top:0!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-message,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-info,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{color:inherit!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-error,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error{background-color:#fff6f6!important;border:dashed 1px #a00!important;padding:25px 25px 20px!important;color:#a00!important;margin:1rem 0 1rem!important;font-size:14px!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error li,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-error li,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error li{font-weight:400!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-error li strong{font-weight:400}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{content:"\e600";margin:0;color:#f16334}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio],.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]{border:1px solid #b4b9be;background:#fff;color:#555;clear:none;cursor:pointer;display:inline-block;line-height:0;height:16px;margin:-4px 4px 0 0;outline:0;padding:0!important;text-align:center;vertical-align:middle;width:16px;min-width:16px;-webkit-appearance:none;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-webkit-transition:.05s border-color ease-in-out;transition:.05s border-color ease-in-out}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:focus{border-color:#f16334;-webkit-box-shadow:0 0 2px rgba(241,99,52,.8);box-shadow:0 0 2px rgba(241,99,52,.8)}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{background-color:#f16334;-webkit-border-radius:50px;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:16px;margin:4px;text-indent:-9999px;width:6px}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{display:inline-block;float:left;font:normal 15px/1 cartflows-icon;speak:none;vertical-align:middle;width:6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.et_pb_module #wcf-embed-checkout-form #order_review_heading,.et_pb_module #wcf-embed-checkout-form .woocommerce #ship-to-different-address,.et_pb_module #wcf-embed-checkout-form .woocommerce-additional-fields>h3,.et_pb_module #wcf-embed-checkout-form .woocommerce-billing-fields>h3{font-family:inherit;font-weight:600;font-size:20px;text-transform:capitalize;margin:0 0 25px 0}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{display:inline-block!important;font-family:inherit;font-weight:600;width:45%;margin:50px 0 0;padding:0 10px 20px;border:none;border-bottom:none}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods{padding:1em 0;margin:0}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #add_payment_method #payment ul.payment_methods li,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods li{line-height:2;text-align:left;margin:0;list-style:none;font-weight:inherit}.et_pb_module #wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p{font-family:inherit;font-weight:inherit;color:#444;margin-top:0;margin-bottom:1.5em}.et_pb_module #wcf-embed-checkout-form .woocommerce .shop_table #shipping_method li{list-style:none}.et_pb_module #wcf-embed-checkout-form .woocommerce a{color:#f16334;text-decoration:none}.et_pb_module #wcf-embed-checkout-form .wcf-custom-coupon-field{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;margin-bottom:25px;margin-top:25px;border-top:1px solid #dcdcdc;padding-top:25px}.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error,.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message{color:inherit!important;border:none!important;background-color:transparent!important;padding:0 2em 1.2em 2em!important;font-size:14px!important;margin:0!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error::before,.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message::before{display:block!important}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-one-column .woocommerce .col2-set,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-one-column .woocommerce .wcf-col2-set{display:block;margin-top:10px;padding-right:0;width:100%}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-one-column .woocommerce-checkout #order_review_heading{display:block!important;margin:20px 0 0;width:100%}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-product-option-wrap{display:block;width:100%;float:none;padding-right:0;padding:0;-webkit-border-radius:0;border-radius:0;margin-top:10px;margin-bottom:20px}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{margin:0}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step #order_review_heading,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-additional-fields>h3,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-billing-fields>h3,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout #order_review_heading{display:none!important}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce-checkout #order_review{float:none;width:100%}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-two-step .woocommerce a{color:#fff}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-wrap{display:block;float:none;margin:1em auto 1em;overflow:hidden}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1{background:#f1f1f1;border-style:none;border-width:2px;border-color:red;-webkit-border-radius:3px;border-radius:3px;display:inline-block}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2{border:2px red dashed;-webkit-border-radius:3px;border-radius:3px}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-bump-order-field-wrap{border-style:none;border-width:2px;border-color:red;padding:20px 25px;margin:0;font-size:1.1em;display:block;background:#ddd}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-content-container{padding:25px 0}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-bump-order-offer{padding:0 25px 10px;font-size:1.2em}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-bump-order-desc{padding:0 25px}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2 .wcf-bump-order-offer{padding:20px 25px;font-size:1.1em;font-weight:600}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2 .wcf-bump-order-desc{padding:0 25px 20px}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2 .wcf-bump-order-field-wrap{border-top:2px red dashed;padding:15px 25px;margin:0;font-size:1.1em;display:block}.et_pb_module #wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,.et_pb_module #wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c}@media only screen and (max-width:768px){.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .col2-set,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:block;float:none;padding-right:0;width:100%}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{display:block!important;float:none;width:100%}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #order_review{display:block;float:none;width:100%}}@media (max-width:767px){.et_pb_module #wcf-embed-checkout-form .woocommerce .form-row{width:100%!important}}
1
+ .et_pb_module #wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,.et_pb_module #wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c!important}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .col2-set,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:inline-block;width:55%;float:left;padding-right:40px;margin:50px 0 0}.et_pb_module #wcf-embed-checkout-form .select2-container--default .select2-selection--single,.et_pb_module #wcf-embed-checkout-form .woocommerce #order_review .input-text,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row input.input-text,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row select,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row textarea{display:block;width:100%;min-height:34px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid #d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none}.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row{margin-bottom:1.1em;padding:3px 3px 0 3px}.et_pb_module #wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .form-row label{font-size:13px;line-height:1em;letter-spacing:.3px;font-family:inherit;font-weight:inherit;margin-bottom:8px}.cartflows-canvas #page-container{padding-top:0!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-message,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-info,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{color:inherit!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-error,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error{background-color:#fff6f6!important;border:dashed 1px #a00!important;padding:25px 25px 20px!important;color:#a00!important;margin:1rem 0 1rem!important;font-size:14px!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error li,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-error li,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error li{font-weight:400!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-error li strong{font-weight:400}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{content:"\e600";margin:0;color:#f16334}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio],.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]{border:1px solid #b4b9be;background:#fff;color:#555;clear:none;cursor:pointer;display:inline-block;line-height:0;height:16px;margin:-4px 4px 0 0;outline:0;padding:0!important;text-align:center;vertical-align:middle;width:16px;min-width:16px;-webkit-appearance:none;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-webkit-transition:.05s border-color ease-in-out;transition:.05s border-color ease-in-out}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:focus{border-color:#f16334;-webkit-box-shadow:0 0 2px rgba(241,99,52,.8);box-shadow:0 0 2px rgba(241,99,52,.8)}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{background-color:#f16334;-webkit-border-radius:50px;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:16px;margin:4px;text-indent:-9999px;width:6px}.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.et_pb_module #wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before,.et_pb_module #wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{display:inline-block;float:left;font:normal 15px/1 cartflows-icon;speak:none;vertical-align:middle;width:6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.et_pb_module #wcf-embed-checkout-form #order_review_heading,.et_pb_module #wcf-embed-checkout-form .woocommerce #ship-to-different-address,.et_pb_module #wcf-embed-checkout-form .woocommerce-additional-fields>h3,.et_pb_module #wcf-embed-checkout-form .woocommerce-billing-fields>h3{font-family:inherit;font-weight:600;font-size:20px;margin:0 0 25px 0}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{display:inline-block!important;font-family:inherit;font-weight:600;width:45%;margin:50px 0 0;padding:0 10px 20px;border:none;border-bottom:none}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods{padding:1em 0;margin:0}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #add_payment_method #payment ul.payment_methods li,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods li{line-height:2;text-align:left;margin:0;list-style:none;font-weight:inherit}.et_pb_module #wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p{font-family:inherit;font-weight:inherit;color:#444;margin-top:0;margin-bottom:1.5em}.et_pb_module #wcf-embed-checkout-form .woocommerce .shop_table #shipping_method li{list-style:none}.et_pb_module #wcf-embed-checkout-form .woocommerce a{color:#f16334;text-decoration:none}.et_pb_module #wcf-embed-checkout-form .wcf-custom-coupon-field{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;margin-bottom:25px;margin-top:25px;border-top:1px solid #dcdcdc;padding-top:25px}.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error,.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message{color:inherit!important;border:none!important;background-color:transparent!important;padding:0 2em 1.2em 2em!important;font-size:14px!important;margin:0!important}.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error::before,.et_pb_module #wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message::before{display:block!important}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-one-column .woocommerce .col2-set,.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-one-column .woocommerce .wcf-col2-set{display:block;margin-top:10px;padding-right:0;width:100%}.et_pb_module #wcf-embed-checkout-form.wcf-embed-checkout-form-one-column .woocommerce-checkout #order_review_heading{display:block!important;margin:20px 0 0;width:100%}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-wrap{display:block;float:none;margin:1em auto 1em;overflow:hidden}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1{background:#f1f1f1;border-style:none;border-width:2px;border-color:red;-webkit-border-radius:3px;border-radius:3px;display:inline-block}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2{border:2px red dashed;-webkit-border-radius:3px;border-radius:3px}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-bump-order-field-wrap{border-style:none;border-width:2px;border-color:red;padding:20px 25px;margin:0;font-size:1.1em;display:block;background:#ddd}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-content-container{padding:25px 0}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-bump-order-offer{padding:0 25px 10px;font-size:1.2em}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-1 .wcf-bump-order-desc{padding:0 25px}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2 .wcf-bump-order-offer{padding:20px 25px;font-size:1.1em;font-weight:600}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2 .wcf-bump-order-desc{padding:0 25px 20px}.et_pb_module #wcf-embed-checkout-form .wcf-bump-order-style-2 .wcf-bump-order-field-wrap{border-top:2px red dashed;padding:15px 25px;margin:0;font-size:1.1em;display:block}.et_pb_module #wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,.et_pb_module #wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,.et_pb_module #wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c}@media only screen and (max-width:768px){.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .col2-set,.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:block;float:none;padding-right:0;width:100%}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{display:block!important;float:none;width:100%}.et_pb_module #wcf-embed-checkout-form .woocommerce-checkout #order_review{display:block;float:none;width:100%}}@media (max-width:767px){.et_pb_module #wcf-embed-checkout-form .woocommerce .form-row{width:100%!important}}
assets/min-css/checkout-template-rtl.min.css CHANGED
@@ -1 +1 @@
1
- .cartflows-container .wcf-embed-checkout-form,.cartflows-container .wcf-embed-checkout-form *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wcf-embed-checkout-form .wc-backward{display:none!important}.wcf-embed-checkout-form .woocommerce form .form-row-first,.wcf-embed-checkout-form .woocommerce form .form-row-last,.wcf-embed-checkout-form .woocommerce-page form .form-row-first,.wcf-embed-checkout-form .woocommerce-page form .form-row-last{width:50%;display:block}.wcf-embed-checkout-form .woocommerce form .form-row-full,.wcf-embed-checkout-form .woocommerce-page form .form-row-full{width:100%;clear:both}.wcf-embed-checkout-form form .form-row-wide{width:100%}.wcf-embed-checkout-form form .wcf-column-33{width:33.33%}.wcf-embed-checkout-form .woocommerce form .form-row-first,.woocommerce-page form .form-row-first{float:right;clear:right}.wcf-embed-checkout-form .woocommerce form .form-row-last,.woocommerce-page form .form-row-last{float:left;clear:left}.wcf-embed-checkout-form .woocommerce form .form-row .required{color:red;font-weight:700;border:0!important;text-decoration:none}.wcf-embed-checkout-form .woocommerce .woocommerce-checkout .product-name .remove{font-family:cartflows-icon;display:inline-block;font-size:10px;border:1px #4d5763 solid;-webkit-border-radius:50%;border-radius:50%;padding:1px;color:#4d5763!important;line-height:1;margin-left:5px;text-align:center;font-weight:100;width:14px;height:14px;background-color:#fff}.wcf-embed-checkout-form .woocommerce .woocommerce-checkout .product-name .remove:hover{color:#f1653c!important;border:1px #f1653c solid;background-color:#fff}.wcf-embed-checkout-form form .form-row-first.form-row-one{clear:both}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login{display:none}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row{margin-bottom:15px}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .clear{clear:none}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label{margin:0;line-height:1em;padding-top:0;position:relative;top:0}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .login-form-actions{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;margin-bottom:0}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .lost_password,.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .remember_me{-webkit-box-flex:1;-webkit-flex:1;-moz-box-flex:1;-ms-flex:1;flex:1;font-family:inherit;font-size:13px}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row .remember_me label{margin-bottom:0;vertical-align:text-top}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row .remember_me input,.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row .remember_me span{vertical-align:middle}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .lost_password{text-align:left;margin-top:0;margin-bottom:0}.wcf-embed-checkout-form .woocommerce .blockUI.blockOverlay{font-size:15px}.wcf-embed-checkout-form .woocommerce form .form-row.mt20{margin-top:20px}.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid .select2-container,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid input.input-text,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid select{border-width:1px;border-color:#e2401c}.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-validated .select2-container,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-validated input.input-text,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-validated select{border-width:1px}.wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,.wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required,.wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,.wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c}.wcf-embed-checkout-form .woocommerce form .form-row input.field-validated{border-right-width:2px;border-right-color:#69bf29}.wcf-embed-checkout-form .wcf-checkout-header-image{text-align:center}.wcf-embed-checkout-form .woocommerce #payment [type=radio]:checked+label,.wcf-embed-checkout-form .woocommerce #payment [type=radio]:not(:checked)+label{padding:0}.wcf-embed-checkout-form .woocommerce #payment input[type=radio]{-webkit-border-radius:50%;border-radius:50%;margin-left:4px;line-height:10px}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{content:"\e600";margin:0;color:#f16334}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],.wcf-embed-checkout-form .woocommerce #payment input[type=radio],.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox],.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox],.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]{border:1px solid #b4b9be;background:#fff;color:#555;clear:none;cursor:pointer;display:inline-block;line-height:0;height:16px;margin:-4px 0 0 4px;outline:0;padding:0!important;text-align:center;vertical-align:middle;width:16px;min-width:16px;-webkit-appearance:none;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-webkit-transition:.05s border-color ease-in-out;transition:.05s border-color ease-in-out}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,.wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus,.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox]:focus,.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox]:focus,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:focus{border-color:#f16334;-webkit-box-shadow:0 0 2px rgba(241,99,52,.8);box-shadow:0 0 2px rgba(241,99,52,.8)}.wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{background-color:#f16334;-webkit-border-radius:50px;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:16px;margin:4px;text-indent:-9999px;width:6px}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox]:before,.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{display:inline-block;float:right;font:normal 15px/1 cartflows-icon;speak:none;vertical-align:middle;width:6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods li input[type=checkbox]{min-width:16px}.wcf-embed-checkout-form .woocommerce .col2-set .col-1,.wcf-embed-checkout-form .woocommerce .col2-set .col-2,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-2,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-1,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-2,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-2{float:none;width:100%;max-width:100%;padding:0;-webkit-border-radius:0;border-radius:0;border:none;border-color:none;margin-bottom:0}.wcf-embed-checkout-form #order_review_heading,.wcf-embed-checkout-form .woocommerce #ship-to-different-address,.wcf-embed-checkout-form .woocommerce-additional-fields>h3,.wcf-embed-checkout-form .woocommerce-billing-fields>h3{font-family:inherit;font-weight:600;font-size:20px;text-transform:capitalize;margin:0 0 25px 0;padding:0;width:100%}.wcf-embed-checkout-form .woocommerce-checkout #payment{background:unset;-webkit-border-radius:0;border-radius:0}.wcf-embed-checkout-form .woocommerce-checkout #payment .form-row{margin:0;padding:0}.wcf-embed-checkout-form .woocommerce-checkout #payment .form-row label.checkbox{display:block;margin-bottom:1.1em}.wcf-embed-checkout-form .woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:none;margin-right:10px}.wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box .form-row{margin:0 0 .5em}.wcf-embed-checkout-form .woocommerce-checkout #payment fieldset .form-row .wcf-embed-checkout-form .woocommerce-checkout #payment fieldset p{margin-bottom:10px}.wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box{background-color:#eaeaea;font-family:inherit;font-weight:inherit;margin-bottom:.5em}.wcf-embed-checkout-form #add_payment_method #payment div.payment_box::before,.wcf-embed-checkout-form .woocommerce-cart #payment div.payment_box::before,.wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box::before{content:'';display:block;border:1em solid;border-left-color:transparent;border-right-color:transparent;border-top-color:transparent;border-bottom-color:#eaeaea;position:absolute;top:-.75em;right:0;margin:-1em 2em 0 0}.wcf-embed-checkout-form .select2-container--default .select2-selection--single{display:block;width:100%;min-height:34px;height:auto;padding:11px 12px;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;outline:0}.wcf-embed-checkout-form .select2-container--default .select2-selection--single .select2-selection__rendered{color:#666;line-height:19px;min-height:19px;overflow:visible;padding-right:0}.select2-results__option[data-selected],.wcf-embed-checkout-form .select2-results__option[aria-selected]{font-size:14px}.wcf-embed-checkout-form .select2-container--default .select2-selection--single .select2-selection__arrow{height:100%}.select2-dropdown{border:1px solid #d4d4d4}.wcf-embed-checkout-form .woocommerce #order_review .input-text,.wcf-embed-checkout-form .woocommerce form .form-row input.input-text,.wcf-embed-checkout-form .woocommerce form .form-row select,.wcf-embed-checkout-form .woocommerce form .form-row textarea{display:block;width:100%;min-height:34px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;height:auto}.wcf-embed-checkout-form #order_review{padding:3px;width:100%}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error,.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message{padding:0 2em 1.2em 2em;background-color:transparent;border:none;margin:0;width:100%}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error li{list-style:none!important;margin:0}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error::before,.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message::before{top:0;right:0}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error::before{content:'\e016'}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error li{margin:0 8px 0 0}.wcf-embed-checkout-form .woocommerce #order_review .wcf-custom-coupon-field input[type=text]{font-weight:400}.wcf-embed-checkout-form .wcf-custom-coupon-field{clear:right;-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;margin-bottom:15px;margin-top:25px;border-top:1px solid #dcdcdc;border-bottom:1px solid #dcdcdc;padding-top:25px;padding-bottom:25px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.wcf-embed-checkout-form #order_review .wcf-coupon-col-1{width:70%;display:inline-block;padding-left:20px}.wcf-embed-checkout-form #order_review .wcf-coupon-col-2{width:30%}.wcf-embed-checkout-form .select2-container--open,.wcf-embed-checkout-form input[type=email]:focus,.wcf-embed-checkout-form input[type=password]:focus,.wcf-embed-checkout-form input[type=tel]:focus,.wcf-embed-checkout-form input[type=text]:focus,.wcf-embed-checkout-form textarea:focus{border-color:#b3b3b3;-webkit-box-shadow:none;box-shadow:none;outline:0}.wcf-embed-checkout-form button:focus{outline:0;outline-color:none;outline-style:none;outline-width:none}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button,.wcf-embed-checkout-form form.checkout_coupon .button{display:block;clear:both;border:none;font-size:15px;font-family:inherit;font-weight:inherit;background-color:#f16334;line-height:9px;padding:18px;margin-bottom:10px;width:100%;text-transform:uppercase}.wcf-embed-checkout-form .woocommerce #order_review button{border:1px solid;border-color:#f16334;background-color:#f16334;font-family:inherit;font-weight:inherit;font-size:18px;letter-spacing:.5px;width:100%;padding:16px 24px;font-size:16px;line-height:1.5;-webkit-border-radius:3px;border-radius:3px;color:#fff;text-transform:uppercase}.wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small{padding:8px 6px;background-color:#c8c8c8;border:1px #c8c8c8 solid}.wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small:hover{border-color:#f16334;background-color:#f16334}.wcf-embed-checkout-form .woocommerce #payment #place_order:hover{background-color:#f16334;border-color:#f16334;color:#fff}.wcf-embed-checkout-form .woocommerce-checkout{display:inline-block;text-align:inherit;width:100%}.wcf-embed-checkout-form .woocommerce-checkout .col2-set,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:inline-block;width:55%;float:right;padding-left:40px;margin:20px 0 0}.wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{margin:0 -7px;-ms-flex-wrap:wrap;flex-wrap:wrap;-js-display:flex;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flex;display:-webkit-flex;flex-wrap:wrap;-webkit-flex-wrap:wrap}.wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper{margin:0 -7px}.wcf-embed-checkout-form-two-column .woocommerce-checkout .wcf-order-wrap{display:inline-block;float:none;width:45%;border:none;background-color:inherit;padding:0 10px;-webkit-border-radius:3px;border-radius:3px}.wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{display:inline-block;font-family:inherit;font-weight:600;width:100%;margin:20px 0 0;padding:3px 3px 20px;border:none;border-bottom:none}.wcf-embed-checkout-form .woocommerce-checkout #payment{background-color:inherit;border:none;-webkit-border-radius:0;border-radius:0}.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods{padding:1em 0}.wcf-embed-checkout-form #add_payment_method #payment ul.payment_methods,.wcf-embed-checkout-form .woocommerce-cart #payment ul.payment_methods,.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods{border:none}.wcf-embed-checkout-form #payment ul.payment_methods li,.wcf-embed-checkout-form #payment ul.payment_methods li:hover{background-color:transparent}.wcf-embed-checkout-form .woocommerce form .form-row{display:block;margin-bottom:1.1em;padding:3px 7px;position:relative}.wcf-embed-checkout-form .woocommerce form .woocommerce-account-fields .form-row{padding:0}.wcf-embed-checkout-form table.shop_table{border:none;border-bottom:0;background-color:inherit;-webkit-border-radius:0;border-radius:0;font-family:inherit;font-weight:inherit;font-size:.95em;margin:0!important;border-collapse:collapse;text-align:right}.wcf-embed-checkout-form table.shop_table td strong.product-quantity{font-weight:400}.wcf-embed-checkout-form table.shop_table #shipping_method{margin:0;padding:0;list-style:none}.wcf-embed-checkout-form table.shop_table #shipping_method .amount{font-weight:400}.wcf-embed-checkout-form table.shop_table th{border:none;font-weight:400;padding:9px 0;line-height:1.2em}.wcf-embed-checkout-form table.shop_table tfoot tr:last-child .woocommerce-Price-amount{font-size:1em}.wcf-embed-checkout-form table.shop_table td,.wcf-embed-checkout-form table.shop_table td dl dd,.wcf-embed-checkout-form table.shop_table td dl dt,.wcf-embed-checkout-form table.shop_table th{background-color:transparent;border:none;padding:.6em 0;line-height:1.4em}.wcf-embed-checkout-form table.shop_table td dl dd p{margin-top:0}.wcf-embed-checkout-form table.shop_table tbody th,.wcf-embed-checkout-form table.shop_table tfoot td,.wcf-embed-checkout-form table.shop_table tfoot th{border:none;display:table-cell;font-weight:400;width:50%}.wcf-embed-checkout-form table.shop_table thead{background-color:transparent}.wcf-embed-checkout-form table.shop_table tbody{border-top:1px dashed #ccc;border-bottom:1px dashed #ccc}.wcf-embed-checkout-form table.shop_table th.product-name,.wcf-embed-checkout-form table.shop_table th.product-total{font-weight:600}.wcf-embed-checkout-form table.shop_table tfoot tr.order-total:not(.recurring-total) td,.wcf-embed-checkout-form table.shop_table tfoot tr.order-total:not(.recurring-total) th{font-weight:600;border-top:1px dashed #ccc}.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-totals th{padding-top:1.8em;font-weight:600}.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-total td,.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-total th,.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-totals th{vertical-align:top}.wcf-embed-checkout-form table.shop_table tbody tr td:nth-child(1),.wcf-embed-checkout-form table.shop_table tfoot tr td:nth-child(1),.wcf-embed-checkout-form table.shop_table thead tr th:nth-child(1){width:70%}.wcf-embed-checkout-form table.shop_table tbody tr td:nth-child(2),.wcf-embed-checkout-form table.shop_table tfoot tr td:nth-child(2),.wcf-embed-checkout-form table.shop_table thead tr th:nth-child(2){width:30%}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label,.wcf-embed-checkout-form .woocommerce-checkout .form-row label{font-size:13px;line-height:1em;letter-spacing:.3px;font-family:inherit;font-weight:inherit;text-transform:capitalize;margin-bottom:8px}.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields label,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields label{display:inherit}.wcf-embed-checkout-form .woocommerce .woocommerce-terms-and-conditions-wrapper .woocommerce-terms-and-conditions-checkbox-text{line-height:20px;text-transform:initial}.wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p{font-family:inherit;font-weight:inherit;font-size:11px;color:#777;margin-top:0;text-align:justify}.wcf-embed-checkout-form #payment .wc_payment_methods .payment_box p{margin:0}.wcf-embed-checkout-form .woocommerce a{color:#f16334;background-color:transparent;text-decoration:none}.wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-message,.wcf-embed-checkout-form .woocommerce .woocommerce-error,.wcf-embed-checkout-form .woocommerce .woocommerce-info,.wcf-embed-checkout-form .woocommerce .woocommerce-message,.wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{padding:1em 2em .4em 2em;border-top:none;background-color:inherit;font-size:14px;font-weight:500;text-align:right;margin:0}.wcf-embed-checkout-form .woocommerce-info::before,.wcf-embed-checkout-form .woocommerce-message::before{right:.1em;color:#f16334}.wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error,.wcf-embed-checkout-form .woocommerce .woocommerce-error,.wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error{background-color:#fff6f6;border:dashed 1px #a00;padding:25px 25px 20px;color:#a00;margin:1rem 0 1rem;font-size:14px;width:100%}.wcf-embed-checkout-form .woocommerce .woocommerce-error::before{content:''}.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods li:not(.woocommerce-notice)::before{display:inline}.wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{margin:1em 0 1em}.wcf-embed-checkout-form .woocommerce .woocommerce-error li{list-style:disc inside!important;margin:0 0 8px}.wcf-embed-checkout-form .woocommerce .woocommerce-error li strong{font-weight:400}.wcf-embed-checkout-form .woocommerce form.checkout_coupon{border:1px solid #d3ced2;padding:30px 20px 20px;margin:2em 0;text-align:right;-webkit-border-radius:5px;border-radius:5px}.wcf-embed-checkout-form .woocommerce .checkout_coupon p{font-size:14px}.wcf-embed-checkout-form .woocommerce .checkout_coupon p{font-family:inherit;font-weight:500;margin-top:0;margin-bottom:10px}@media only screen and (max-width:768px){.wcf-embed-checkout-form form .wcf-column-33{width:100%}.wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{width:100%}.wcf-embed-checkout-form .woocommerce-checkout #order_review{width:100%}.wcf-embed-checkout-form .woocommerce-checkout .wcf-order-wrap{width:100%}.wcf-embed-checkout-form .woocommerce-checkout{display:block}.wcf-embed-checkout-form .woocommerce-checkout .col2-set,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:block;width:100%;padding-left:0;margin:20px 0 0}.wcf-embed-checkout-form form.checkout_coupon .button{font-size:12px}.wcf-bump-order-field-wrap .wcf-bump-order-label{font-size:16px;text-transform:capitalize}.wcf-embed-checkout-form .woocommerce .col2-set .col-1,.wcf-embed-checkout-form .woocommerce .col2-set .col-2,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-2,.wcf-embed-checkout-form .woocommerce .wcf-order-wrap,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-1,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-2,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-2,.wcf-embed-checkout-form .woocommerce-page .wcf-order-wrap{padding:15px 18px}.wcf-embed-checkout-form .woocommerce form .form-row-first,.wcf-embed-checkout-form .woocommerce form .form-row-last,.wcf-embed-checkout-form .woocommerce-page form .form-row-first,.wcf-embed-checkout-form .woocommerce-page form .form-row-last{width:100%}.wcf-embed-checkout-form #order_review_heading,.wcf-embed-checkout-form .woocommerce #ship-to-different-address,.wcf-embed-checkout-form .woocommerce-additional-fields>h3,.wcf-embed-checkout-form .woocommerce-billing-fields>h3{font-size:1em}}#et-info-email:before,#et-info-phone:before,#et_search_icon:before,.comment-reply-link:after,.et-cart-info span:before,.et-pb-arrow-next:before,.et-pb-arrow-prev:before,.et-social-icon a:before,.et_audio_container .mejs-playpause-button button:before,.et_audio_container .mejs-volume-button button:before,.et_overlay:before,.et_password_protected_form .et_submit_button:after,.et_pb_button:after,.et_pb_contact_reset:after,.et_pb_contact_submit:after,.et_pb_font_icon:before,.et_pb_newsletter_button:after,.et_pb_pricing_table_button:after,.et_pb_promo_button:after,.et_pb_social_icon a.icon:before,.et_pb_testimonial:before,.et_pb_toggle_title:before,.form-submit .et_pb_button:after,.mobile_menu_bar:before,.woocommerce #content input.button.alt:after,.woocommerce #content input.button:after,.woocommerce #respond input#submit.alt:after,.woocommerce #respond input#submit:after,.woocommerce a.button.alt:after,.woocommerce button.button.alt:after,.woocommerce button.button:after,.woocommerce button.single_add_to_cart_button.button:after,.woocommerce input.button.alt:after,.woocommerce input.button:after,.woocommerce-page #content input.button.alt:after,.woocommerce-page #content input.button:after,.woocommerce-page #respond input#submit.alt:after,.woocommerce-page #respond input#submit:after,.woocommerce-page a.button.alt:after,.woocommerce-page a.button:after,.woocommerce-page button.button.alt:after,.woocommerce-page button.button:after,.woocommerce-page input.button.alt:after,.woocommerce-page input.button:after,a.et_pb_more_button:after{text-shadow:0 0;font-family:none;font-weight:400;font-style:normal;font-variant:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:1;text-transform:none;speak:none}.comment-reply-link:hover:after,.woocommerce #content input.button.alt:hover:after,.woocommerce #content input.button:hover:after,.woocommerce #respond input#submit.alt:hover:after,.woocommerce #respond input#submit:hover:after,.woocommerce a.button.alt:hover:after,.woocommerce a.button:hover:after,.woocommerce button.button.alt:hover:after,.woocommerce button.button:hover:after,.woocommerce input.button.alt:hover:after,.woocommerce input.button:hover:after,.woocommerce-page #content input.button.alt:hover:after,.woocommerce-page #content input.button:hover:after,.woocommerce-page #respond input#submit.alt:hover:after,.woocommerce-page #respond input#submit:hover:after,.woocommerce-page a.button.alt:hover:after,.woocommerce-page a.button:hover:after,.woocommerce-page button.button.alt:hover:after,.woocommerce-page button.button:hover:after,.woocommerce-page input.button.alt:hover:after,.woocommerce-page input.button:hover:after{opacity:0}.thrv_wrapper .wcf-embed-checkout-form div{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
1
+ .cartflows-container .wcf-embed-checkout-form,.cartflows-container .wcf-embed-checkout-form *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wcf-embed-checkout-form .wc-backward{display:none!important}.wcf-embed-checkout-form .woocommerce form .form-row-first,.wcf-embed-checkout-form .woocommerce form .form-row-last,.wcf-embed-checkout-form .woocommerce-page form .form-row-first,.wcf-embed-checkout-form .woocommerce-page form .form-row-last{width:50%;display:block}.wcf-embed-checkout-form .woocommerce form .form-row-full,.wcf-embed-checkout-form .woocommerce-page form .form-row-full{width:100%;clear:both}.wcf-embed-checkout-form form .form-row-wide{width:100%}.wcf-embed-checkout-form form .wcf-column-33{width:33.33%}.wcf-embed-checkout-form .woocommerce form .form-row-first,.woocommerce-page form .form-row-first{float:right;clear:right}.wcf-embed-checkout-form .woocommerce form .form-row-last,.woocommerce-page form .form-row-last{float:left;clear:left}.wcf-embed-checkout-form .woocommerce form .form-row .required{color:red;font-weight:700;border:0!important;text-decoration:none}.wcf-embed-checkout-form .woocommerce .woocommerce-checkout .product-name .remove{font-family:cartflows-icon;display:inline-block;font-size:10px;border:1px #4d5763 solid;-webkit-border-radius:50%;border-radius:50%;padding:1px;color:#4d5763!important;line-height:1;margin-left:5px;text-align:center;font-weight:100;width:14px;height:14px;background-color:#fff}.wcf-embed-checkout-form .woocommerce .woocommerce-checkout .product-name .remove:hover{color:#f1653c!important;border:1px #f1653c solid;background-color:#fff}.wcf-embed-checkout-form form .form-row-first.form-row-one{clear:both}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login{display:none}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row{margin-bottom:15px}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .clear{clear:none}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label{margin:0;line-height:1em;padding-top:0;position:relative;top:0}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .login-form-actions{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;margin-bottom:0}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .lost_password,.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .remember_me{-webkit-box-flex:1;-webkit-flex:1;-moz-box-flex:1;-ms-flex:1;flex:1;font-family:inherit;font-size:13px}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row .remember_me label{margin-bottom:0;vertical-align:text-top}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row .remember_me input,.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row .remember_me span{vertical-align:middle}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .lost_password{text-align:left;margin-top:0;margin-bottom:0}.wcf-embed-checkout-form .woocommerce .blockUI.blockOverlay{font-size:15px}.wcf-embed-checkout-form .woocommerce form .form-row.mt20{margin-top:20px}.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid .select2-container,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid input.input-text,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid select{border-width:1px;border-color:#e2401c}.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-validated .select2-container,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-validated input.input-text,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-validated select{border-width:1px}.wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,.wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required,.wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,.wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c}.wcf-embed-checkout-form .woocommerce form .form-row input.field-validated{border-right-width:2px;border-right-color:#69bf29}.wcf-embed-checkout-form .wcf-checkout-header-image{text-align:center}.wcf-embed-checkout-form .woocommerce #payment [type=radio]:checked+label,.wcf-embed-checkout-form .woocommerce #payment [type=radio]:not(:checked)+label{padding:0}.wcf-embed-checkout-form .woocommerce #payment input[type=radio]{-webkit-border-radius:50%;border-radius:50%;margin-left:4px;line-height:10px}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{content:"\e600";margin:0;color:#f16334}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],.wcf-embed-checkout-form .woocommerce #payment input[type=radio],.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox],.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox],.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]{border:1px solid #b4b9be;background:#fff;color:#555;clear:none;cursor:pointer;display:inline-block;line-height:0;height:16px;margin:-4px 0 0 4px;outline:0;padding:0!important;text-align:center;vertical-align:middle;width:16px;min-width:16px;-webkit-appearance:none;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-webkit-transition:.05s border-color ease-in-out;transition:.05s border-color ease-in-out}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,.wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus,.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox]:focus,.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox]:focus,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:focus{border-color:#f16334;-webkit-box-shadow:0 0 2px rgba(241,99,52,.8);box-shadow:0 0 2px rgba(241,99,52,.8)}.wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{background-color:#f16334;-webkit-border-radius:50px;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:16px;margin:4px;text-indent:-9999px;width:6px}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox]:before,.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{display:inline-block;float:right;font:normal 15px/1 cartflows-icon;speak:none;vertical-align:middle;width:6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods li input[type=checkbox]{min-width:16px}.wcf-embed-checkout-form .woocommerce .col2-set .col-1,.wcf-embed-checkout-form .woocommerce .col2-set .col-2,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-2,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-1,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-2,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-2{float:none;width:100%;max-width:100%;padding:0;-webkit-border-radius:0;border-radius:0;border:none;border-color:none;margin-bottom:0}.wcf-embed-checkout-form #order_review_heading,.wcf-embed-checkout-form .woocommerce #ship-to-different-address,.wcf-embed-checkout-form .woocommerce-additional-fields>h3,.wcf-embed-checkout-form .woocommerce-billing-fields>h3{font-family:inherit;font-weight:600;font-size:20px;margin:0 0 25px 0;padding:0;width:100%}.wcf-embed-checkout-form .woocommerce-checkout #payment{background:unset;-webkit-border-radius:0;border-radius:0}.wcf-embed-checkout-form .woocommerce-checkout #payment .form-row{margin:0;padding:0}.wcf-embed-checkout-form .woocommerce-checkout #payment .form-row label.checkbox{display:block;margin-bottom:1.1em}.wcf-embed-checkout-form .woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:none;margin-right:10px}.wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box .form-row{margin:0 0 .5em}.wcf-embed-checkout-form .woocommerce-checkout #payment fieldset .form-row .wcf-embed-checkout-form .woocommerce-checkout #payment fieldset p{margin-bottom:10px}.wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box{background-color:#eaeaea;font-family:inherit;font-weight:inherit;margin-bottom:.5em}.wcf-embed-checkout-form #add_payment_method #payment div.payment_box::before,.wcf-embed-checkout-form .woocommerce-cart #payment div.payment_box::before,.wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box::before{content:'';display:block;border:1em solid;border-left-color:transparent;border-right-color:transparent;border-top-color:transparent;border-bottom-color:#eaeaea;position:absolute;top:-.75em;right:0;margin:-1em 2em 0 0}.wcf-embed-checkout-form .select2-container--default .select2-selection--single{display:block;width:100%;min-height:34px;height:auto;padding:11px 12px;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;outline:0}.wcf-embed-checkout-form .select2-container--default .select2-selection--single .select2-selection__rendered{color:#666;line-height:19px;min-height:19px;overflow:visible;padding-right:0}.select2-results__option[data-selected],.wcf-embed-checkout-form .select2-results__option[aria-selected]{font-size:14px}.wcf-embed-checkout-form .select2-container--default .select2-selection--single .select2-selection__arrow{height:100%}.select2-dropdown{border:1px solid #d4d4d4}.wcf-embed-checkout-form .woocommerce #order_review .input-text,.wcf-embed-checkout-form .woocommerce form .form-row input.input-text,.wcf-embed-checkout-form .woocommerce form .form-row select,.wcf-embed-checkout-form .woocommerce form .form-row textarea{display:block;width:100%;min-height:34px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;height:auto}.wcf-embed-checkout-form #order_review{padding:3px;width:100%}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error,.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message{padding:0 2em 1.2em 2em;background-color:transparent;border:none;margin:0;width:100%}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error li{list-style:none!important;margin:0}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error::before,.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message::before{top:0;right:0}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error::before{content:'\e016'}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error li{margin:0 8px 0 0}.wcf-embed-checkout-form .woocommerce #order_review .wcf-custom-coupon-field input[type=text]{font-weight:400}.wcf-embed-checkout-form .wcf-custom-coupon-field{clear:right;-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;margin-bottom:15px;margin-top:25px;border-top:1px solid #dcdcdc;border-bottom:1px solid #dcdcdc;padding-top:25px;padding-bottom:25px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.wcf-embed-checkout-form #order_review .wcf-coupon-col-1{width:70%;display:inline-block;padding-left:20px}.wcf-embed-checkout-form #order_review .wcf-coupon-col-2{width:30%}.wcf-embed-checkout-form .select2-container--open,.wcf-embed-checkout-form input[type=email]:focus,.wcf-embed-checkout-form input[type=password]:focus,.wcf-embed-checkout-form input[type=tel]:focus,.wcf-embed-checkout-form input[type=text]:focus,.wcf-embed-checkout-form textarea:focus{border-color:#b3b3b3;-webkit-box-shadow:none;box-shadow:none;outline:0}.wcf-embed-checkout-form button:focus{outline:0;outline-color:none;outline-style:none;outline-width:none}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button,.wcf-embed-checkout-form form.checkout_coupon .button{display:block;clear:both;border:none;font-size:15px;font-family:inherit;font-weight:inherit;background-color:#f16334;line-height:9px;padding:18px;margin-bottom:10px;width:100%}.wcf-embed-checkout-form .woocommerce #order_review button{border:1px solid;border-color:#f16334;background-color:#f16334;font-family:inherit;font-weight:inherit;font-size:18px;letter-spacing:.5px;width:100%;padding:16px 24px;font-size:16px;line-height:1.5;-webkit-border-radius:3px;border-radius:3px;color:#fff}.wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small{padding:8px 6px;background-color:#c8c8c8;border:1px #c8c8c8 solid}.wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small:hover{border-color:#f16334;background-color:#f16334}.wcf-embed-checkout-form .woocommerce #payment #place_order:hover{background-color:#f16334;border-color:#f16334;color:#fff}.wcf-embed-checkout-form .woocommerce-checkout{display:inline-block;text-align:inherit;width:100%}.wcf-embed-checkout-form .woocommerce-checkout .col2-set,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:inline-block;width:55%;float:right;padding-left:40px;margin:20px 0 0}.wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{margin:0 -7px;-ms-flex-wrap:wrap;flex-wrap:wrap;-js-display:flex;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flex;display:-webkit-flex;flex-wrap:wrap;-webkit-flex-wrap:wrap}.wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper{margin:0 -7px}.wcf-embed-checkout-form-two-column .woocommerce-checkout .wcf-order-wrap{display:inline-block;float:none;width:45%;border:none;background-color:inherit;padding:0 10px;-webkit-border-radius:3px;border-radius:3px}.wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{display:inline-block;font-family:inherit;font-weight:600;width:100%;margin:20px 0 0;padding:3px 3px 20px;border:none;border-bottom:none}.wcf-embed-checkout-form .woocommerce-checkout #payment{background-color:inherit;border:none;-webkit-border-radius:0;border-radius:0}.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods{padding:1em 0}.wcf-embed-checkout-form #add_payment_method #payment ul.payment_methods,.wcf-embed-checkout-form .woocommerce-cart #payment ul.payment_methods,.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods{border:none}.wcf-embed-checkout-form #payment ul.payment_methods li,.wcf-embed-checkout-form #payment ul.payment_methods li:hover{background-color:transparent}.wcf-embed-checkout-form .woocommerce form .form-row{display:block;margin-bottom:1.1em;padding:3px 7px;position:relative}.wcf-embed-checkout-form .woocommerce form .woocommerce-account-fields .form-row{padding:0}.wcf-embed-checkout-form table.shop_table{border:none;border-bottom:0;background-color:inherit;-webkit-border-radius:0;border-radius:0;font-family:inherit;font-weight:inherit;font-size:.95em;margin:0!important;border-collapse:collapse;text-align:right}.wcf-embed-checkout-form table.shop_table td strong.product-quantity{font-weight:400}.wcf-embed-checkout-form table.shop_table #shipping_method{margin:0;padding:0;list-style:none}.wcf-embed-checkout-form table.shop_table #shipping_method .amount{font-weight:400}.wcf-embed-checkout-form table.shop_table th{border:none;font-weight:400;padding:9px 0;line-height:1.2em}.wcf-embed-checkout-form table.shop_table tfoot tr:last-child .woocommerce-Price-amount{font-size:1em}.wcf-embed-checkout-form table.shop_table td,.wcf-embed-checkout-form table.shop_table td dl dd,.wcf-embed-checkout-form table.shop_table td dl dt,.wcf-embed-checkout-form table.shop_table th{background-color:transparent;border:none;padding:.6em 0;line-height:1.4em}.wcf-embed-checkout-form table.shop_table td dl dd p{margin-top:0}.wcf-embed-checkout-form table.shop_table tbody th,.wcf-embed-checkout-form table.shop_table tfoot td,.wcf-embed-checkout-form table.shop_table tfoot th{border:none;display:table-cell;font-weight:400;width:50%}.wcf-embed-checkout-form table.shop_table thead{background-color:transparent}.wcf-embed-checkout-form table.shop_table tbody{border-top:1px dashed #ccc;border-bottom:1px dashed #ccc}.wcf-embed-checkout-form table.shop_table th.product-name,.wcf-embed-checkout-form table.shop_table th.product-total{font-weight:600}.wcf-embed-checkout-form table.shop_table tfoot tr.order-total:not(.recurring-total) td,.wcf-embed-checkout-form table.shop_table tfoot tr.order-total:not(.recurring-total) th{font-weight:600;border-top:1px dashed #ccc}.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-totals th{padding-top:1.8em;font-weight:600}.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-total td,.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-total th,.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-totals th{vertical-align:top}.wcf-embed-checkout-form table.shop_table tbody tr td:nth-child(1),.wcf-embed-checkout-form table.shop_table tfoot tr td:nth-child(1),.wcf-embed-checkout-form table.shop_table thead tr th:nth-child(1){width:70%}.wcf-embed-checkout-form table.shop_table tbody tr td:nth-child(2),.wcf-embed-checkout-form table.shop_table tfoot tr td:nth-child(2),.wcf-embed-checkout-form table.shop_table thead tr th:nth-child(2){width:30%}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label,.wcf-embed-checkout-form .woocommerce-checkout .form-row label{font-size:13px;line-height:1em;letter-spacing:.3px;font-family:inherit;font-weight:inherit;margin-bottom:8px}.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields label,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields label{display:inherit}.wcf-embed-checkout-form .woocommerce .woocommerce-terms-and-conditions-wrapper .woocommerce-terms-and-conditions-checkbox-text{line-height:20px;text-transform:none}.wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p{font-family:inherit;font-weight:inherit;font-size:11px;color:#777;margin-top:0;text-align:justify}.wcf-embed-checkout-form #payment .wc_payment_methods .payment_box p{margin:0}.wcf-embed-checkout-form .woocommerce a{color:#f16334;background-color:transparent;text-decoration:none}.wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-message,.wcf-embed-checkout-form .woocommerce .woocommerce-error,.wcf-embed-checkout-form .woocommerce .woocommerce-info,.wcf-embed-checkout-form .woocommerce .woocommerce-message,.wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{padding:1em 2em .4em 2em;border-top:none;background-color:inherit;font-size:14px;font-weight:500;text-align:right;margin:0}.wcf-embed-checkout-form .woocommerce-info::before,.wcf-embed-checkout-form .woocommerce-message::before{right:.1em;color:#f16334}.wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error,.wcf-embed-checkout-form .woocommerce .woocommerce-error,.wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error{background-color:#fff6f6;border:dashed 1px #a00;padding:25px 25px 20px;color:#a00;margin:1rem 0 1rem;font-size:14px;width:100%}.wcf-embed-checkout-form .woocommerce .woocommerce-error::before{content:''}.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods li:not(.woocommerce-notice)::before{display:inline}.wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{margin:1em 0 1em}.wcf-embed-checkout-form .woocommerce .woocommerce-error li{list-style:disc inside!important;margin:0 0 8px}.wcf-embed-checkout-form .woocommerce .woocommerce-error li strong{font-weight:400}.wcf-embed-checkout-form .woocommerce form.checkout_coupon{border:1px solid #d3ced2;padding:30px 20px 20px;margin:2em 0;text-align:right;-webkit-border-radius:5px;border-radius:5px}.wcf-embed-checkout-form .woocommerce .checkout_coupon p{font-size:14px}.wcf-embed-checkout-form .woocommerce .checkout_coupon p{font-family:inherit;font-weight:500;margin-top:0;margin-bottom:10px}@media only screen and (max-width:768px){.wcf-embed-checkout-form form .wcf-column-33{width:100%}.wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{width:100%}.wcf-embed-checkout-form .woocommerce-checkout #order_review{width:100%}.wcf-embed-checkout-form .woocommerce-checkout .wcf-order-wrap{width:100%}.wcf-embed-checkout-form .woocommerce-checkout{display:block}.wcf-embed-checkout-form .woocommerce-checkout .col2-set,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:block;width:100%;padding-left:0;margin:20px 0 0}.wcf-embed-checkout-form form.checkout_coupon .button{font-size:12px}.wcf-bump-order-field-wrap .wcf-bump-order-label{font-size:16px}.wcf-embed-checkout-form .woocommerce .col2-set .col-1,.wcf-embed-checkout-form .woocommerce .col2-set .col-2,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-2,.wcf-embed-checkout-form .woocommerce .wcf-order-wrap,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-1,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-2,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-2,.wcf-embed-checkout-form .woocommerce-page .wcf-order-wrap{padding:15px 18px}.wcf-embed-checkout-form .woocommerce form .form-row-first,.wcf-embed-checkout-form .woocommerce form .form-row-last,.wcf-embed-checkout-form .woocommerce-page form .form-row-first,.wcf-embed-checkout-form .woocommerce-page form .form-row-last{width:100%}.wcf-embed-checkout-form #order_review_heading,.wcf-embed-checkout-form .woocommerce #ship-to-different-address,.wcf-embed-checkout-form .woocommerce-additional-fields>h3,.wcf-embed-checkout-form .woocommerce-billing-fields>h3{font-size:1em}}#et-info-email:before,#et-info-phone:before,#et_search_icon:before,.comment-reply-link:after,.et-cart-info span:before,.et-pb-arrow-next:before,.et-pb-arrow-prev:before,.et-social-icon a:before,.et_audio_container .mejs-playpause-button button:before,.et_audio_container .mejs-volume-button button:before,.et_overlay:before,.et_password_protected_form .et_submit_button:after,.et_pb_button:after,.et_pb_contact_reset:after,.et_pb_contact_submit:after,.et_pb_font_icon:before,.et_pb_newsletter_button:after,.et_pb_pricing_table_button:after,.et_pb_promo_button:after,.et_pb_social_icon a.icon:before,.et_pb_testimonial:before,.et_pb_toggle_title:before,.form-submit .et_pb_button:after,.mobile_menu_bar:before,.woocommerce #content input.button.alt:after,.woocommerce #content input.button:after,.woocommerce #respond input#submit.alt:after,.woocommerce #respond input#submit:after,.woocommerce a.button.alt:after,.woocommerce button.button.alt:after,.woocommerce button.button:after,.woocommerce button.single_add_to_cart_button.button:after,.woocommerce input.button.alt:after,.woocommerce input.button:after,.woocommerce-page #content input.button.alt:after,.woocommerce-page #content input.button:after,.woocommerce-page #respond input#submit.alt:after,.woocommerce-page #respond input#submit:after,.woocommerce-page a.button.alt:after,.woocommerce-page a.button:after,.woocommerce-page button.button.alt:after,.woocommerce-page button.button:after,.woocommerce-page input.button.alt:after,.woocommerce-page input.button:after,a.et_pb_more_button:after{text-shadow:0 0;font-family:none;font-weight:400;font-style:normal;font-variant:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:1;text-transform:none;speak:none}.comment-reply-link:hover:after,.woocommerce #content input.button.alt:hover:after,.woocommerce #content input.button:hover:after,.woocommerce #respond input#submit.alt:hover:after,.woocommerce #respond input#submit:hover:after,.woocommerce a.button.alt:hover:after,.woocommerce a.button:hover:after,.woocommerce button.button.alt:hover:after,.woocommerce button.button:hover:after,.woocommerce input.button.alt:hover:after,.woocommerce input.button:hover:after,.woocommerce-page #content input.button.alt:hover:after,.woocommerce-page #content input.button:hover:after,.woocommerce-page #respond input#submit.alt:hover:after,.woocommerce-page #respond input#submit:hover:after,.woocommerce-page a.button.alt:hover:after,.woocommerce-page a.button:hover:after,.woocommerce-page button.button.alt:hover:after,.woocommerce-page button.button:hover:after,.woocommerce-page input.button.alt:hover:after,.woocommerce-page input.button:hover:after{opacity:0}.thrv_wrapper .wcf-embed-checkout-form div{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
assets/min-css/checkout-template.min.css CHANGED
@@ -1 +1 @@
1
- .cartflows-container .wcf-embed-checkout-form,.cartflows-container .wcf-embed-checkout-form *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wcf-embed-checkout-form .wc-backward{display:none!important}.wcf-embed-checkout-form .woocommerce form .form-row-first,.wcf-embed-checkout-form .woocommerce form .form-row-last,.wcf-embed-checkout-form .woocommerce-page form .form-row-first,.wcf-embed-checkout-form .woocommerce-page form .form-row-last{width:50%;display:block}.wcf-embed-checkout-form .woocommerce form .form-row-full,.wcf-embed-checkout-form .woocommerce-page form .form-row-full{width:100%;clear:both}.wcf-embed-checkout-form form .form-row-wide{width:100%}.wcf-embed-checkout-form form .wcf-column-33{width:33.33%}.wcf-embed-checkout-form .woocommerce form .form-row-first,.woocommerce-page form .form-row-first{float:left;clear:left}.wcf-embed-checkout-form .woocommerce form .form-row-last,.woocommerce-page form .form-row-last{float:right;clear:right}.wcf-embed-checkout-form .woocommerce form .form-row .required{color:red;font-weight:700;border:0!important;text-decoration:none}.wcf-embed-checkout-form .woocommerce .woocommerce-checkout .product-name .remove{font-family:cartflows-icon;display:inline-block;font-size:10px;border:1px #4d5763 solid;-webkit-border-radius:50%;border-radius:50%;padding:1px;color:#4d5763!important;line-height:1;margin-right:5px;text-align:center;font-weight:100;width:14px;height:14px;background-color:#fff}.wcf-embed-checkout-form .woocommerce .woocommerce-checkout .product-name .remove:hover{color:#f1653c!important;border:1px #f1653c solid;background-color:#fff}.wcf-embed-checkout-form form .form-row-first.form-row-one{clear:both}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login{display:none}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row{margin-bottom:15px}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .clear{clear:none}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label{margin:0;line-height:1em;padding-top:0;position:relative;top:0}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .login-form-actions{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;margin-bottom:0}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .lost_password,.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .remember_me{-webkit-box-flex:1;-webkit-flex:1;-moz-box-flex:1;-ms-flex:1;flex:1;font-family:inherit;font-size:13px}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row .remember_me label{margin-bottom:0;vertical-align:text-top}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row .remember_me input,.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row .remember_me span{vertical-align:middle}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .lost_password{text-align:right;margin-top:0;margin-bottom:0}.wcf-embed-checkout-form .woocommerce .blockUI.blockOverlay{font-size:15px}.wcf-embed-checkout-form .woocommerce form .form-row.mt20{margin-top:20px}.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid .select2-container,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid input.input-text,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid select{border-width:1px;border-color:#e2401c}.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-validated .select2-container,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-validated input.input-text,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-validated select{border-width:1px}.wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,.wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required,.wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,.wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c}.wcf-embed-checkout-form .woocommerce form .form-row input.field-validated{border-left-width:2px;border-left-color:#69bf29}.wcf-embed-checkout-form .wcf-checkout-header-image{text-align:center}.wcf-embed-checkout-form .woocommerce #payment [type=radio]:checked+label,.wcf-embed-checkout-form .woocommerce #payment [type=radio]:not(:checked)+label{padding:0}.wcf-embed-checkout-form .woocommerce #payment input[type=radio]{-webkit-border-radius:50%;border-radius:50%;margin-right:4px;line-height:10px}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{content:"\e600";margin:0;color:#f16334}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],.wcf-embed-checkout-form .woocommerce #payment input[type=radio],.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox],.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox],.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]{border:1px solid #b4b9be;background:#fff;color:#555;clear:none;cursor:pointer;display:inline-block;line-height:0;height:16px;margin:-4px 4px 0 0;outline:0;padding:0!important;text-align:center;vertical-align:middle;width:16px;min-width:16px;-webkit-appearance:none;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-webkit-transition:.05s border-color ease-in-out;transition:.05s border-color ease-in-out}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,.wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus,.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox]:focus,.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox]:focus,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:focus{border-color:#f16334;-webkit-box-shadow:0 0 2px rgba(241,99,52,.8);box-shadow:0 0 2px rgba(241,99,52,.8)}.wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{background-color:#f16334;-webkit-border-radius:50px;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:16px;margin:4px;text-indent:-9999px;width:6px}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox]:before,.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{display:inline-block;float:left;font:normal 15px/1 cartflows-icon;speak:none;vertical-align:middle;width:6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods li input[type=checkbox]{min-width:16px}.wcf-embed-checkout-form .woocommerce .col2-set .col-1,.wcf-embed-checkout-form .woocommerce .col2-set .col-2,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-2,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-1,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-2,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-2{float:none;width:100%;max-width:100%;padding:0;-webkit-border-radius:0;border-radius:0;border:none;border-color:none;margin-bottom:0}.wcf-embed-checkout-form #order_review_heading,.wcf-embed-checkout-form .woocommerce #ship-to-different-address,.wcf-embed-checkout-form .woocommerce-additional-fields>h3,.wcf-embed-checkout-form .woocommerce-billing-fields>h3{font-family:inherit;font-weight:600;font-size:20px;text-transform:capitalize;margin:0 0 25px 0;padding:0;width:100%}.wcf-embed-checkout-form .woocommerce-checkout #payment{background:unset;-webkit-border-radius:0;border-radius:0}.wcf-embed-checkout-form .woocommerce-checkout #payment .form-row{margin:0;padding:0}.wcf-embed-checkout-form .woocommerce-checkout #payment .form-row label.checkbox{display:block;margin-bottom:1.1em}.wcf-embed-checkout-form .woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:none;margin-left:10px}.wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box .form-row{margin:0 0 .5em}.wcf-embed-checkout-form .woocommerce-checkout #payment fieldset .form-row .wcf-embed-checkout-form .woocommerce-checkout #payment fieldset p{margin-bottom:10px}.wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box{background-color:#eaeaea;font-family:inherit;font-weight:inherit;margin-bottom:.5em}.wcf-embed-checkout-form #add_payment_method #payment div.payment_box::before,.wcf-embed-checkout-form .woocommerce-cart #payment div.payment_box::before,.wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box::before{content:'';display:block;border:1em solid;border-right-color:transparent;border-left-color:transparent;border-top-color:transparent;border-bottom-color:#eaeaea;position:absolute;top:-.75em;left:0;margin:-1em 0 0 2em}.wcf-embed-checkout-form .select2-container--default .select2-selection--single{display:block;width:100%;min-height:34px;height:auto;padding:11px 12px;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;outline:0}.wcf-embed-checkout-form .select2-container--default .select2-selection--single .select2-selection__rendered{color:#666;line-height:19px;min-height:19px;overflow:visible;padding-left:0}.select2-results__option[data-selected],.wcf-embed-checkout-form .select2-results__option[aria-selected]{font-size:14px}.wcf-embed-checkout-form .select2-container--default .select2-selection--single .select2-selection__arrow{height:100%}.select2-dropdown{border:1px solid #d4d4d4}.wcf-embed-checkout-form .woocommerce #order_review .input-text,.wcf-embed-checkout-form .woocommerce form .form-row input.input-text,.wcf-embed-checkout-form .woocommerce form .form-row select,.wcf-embed-checkout-form .woocommerce form .form-row textarea{display:block;width:100%;min-height:34px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;height:auto}.wcf-embed-checkout-form #order_review{padding:3px;width:100%}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error,.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message{padding:0 2em 1.2em 2em;background-color:transparent;border:none;margin:0;width:100%}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error li{list-style:none!important;margin:0}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error::before,.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message::before{top:0;left:0}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error::before{content:'\e016'}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error li{margin:0 0 0 8px}.wcf-embed-checkout-form .woocommerce #order_review .wcf-custom-coupon-field input[type=text]{font-weight:400}.wcf-embed-checkout-form .wcf-custom-coupon-field{clear:left;-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;margin-bottom:15px;margin-top:25px;border-top:1px solid #dcdcdc;border-bottom:1px solid #dcdcdc;padding-top:25px;padding-bottom:25px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.wcf-embed-checkout-form #order_review .wcf-coupon-col-1{width:70%;display:inline-block;padding-right:20px}.wcf-embed-checkout-form #order_review .wcf-coupon-col-2{width:30%}.wcf-embed-checkout-form .select2-container--open,.wcf-embed-checkout-form input[type=email]:focus,.wcf-embed-checkout-form input[type=password]:focus,.wcf-embed-checkout-form input[type=tel]:focus,.wcf-embed-checkout-form input[type=text]:focus,.wcf-embed-checkout-form textarea:focus{border-color:#b3b3b3;-webkit-box-shadow:none;box-shadow:none;outline:0}.wcf-embed-checkout-form button:focus{outline:0;outline-color:none;outline-style:none;outline-width:none}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button,.wcf-embed-checkout-form form.checkout_coupon .button{display:block;clear:both;border:none;font-size:15px;font-family:inherit;font-weight:inherit;background-color:#f16334;line-height:9px;padding:18px;margin-bottom:10px;width:100%;text-transform:uppercase}.wcf-embed-checkout-form .woocommerce #order_review button{border:1px solid;border-color:#f16334;background-color:#f16334;font-family:inherit;font-weight:inherit;font-size:18px;letter-spacing:.5px;width:100%;padding:16px 24px;font-size:16px;line-height:1.5;-webkit-border-radius:3px;border-radius:3px;color:#fff;text-transform:uppercase}.wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small{padding:8px 6px;background-color:#c8c8c8;border:1px #c8c8c8 solid}.wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small:hover{border-color:#f16334;background-color:#f16334}.wcf-embed-checkout-form .woocommerce #payment #place_order:hover{background-color:#f16334;border-color:#f16334;color:#fff}.wcf-embed-checkout-form .woocommerce-checkout{display:inline-block;text-align:inherit;width:100%}.wcf-embed-checkout-form .woocommerce-checkout .col2-set,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:inline-block;width:55%;float:left;padding-right:40px;margin:20px 0 0}.wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{margin:0 -7px;-ms-flex-wrap:wrap;flex-wrap:wrap;-js-display:flex;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flex;display:-webkit-flex;flex-wrap:wrap;-webkit-flex-wrap:wrap}.wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper{margin:0 -7px}.wcf-embed-checkout-form-two-column .woocommerce-checkout .wcf-order-wrap{display:inline-block;float:none;width:45%;border:none;background-color:inherit;padding:0 10px;-webkit-border-radius:3px;border-radius:3px}.wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{display:inline-block;font-family:inherit;font-weight:600;width:100%;margin:20px 0 0;padding:3px 3px 20px;border:none;border-bottom:none}.wcf-embed-checkout-form .woocommerce-checkout #payment{background-color:inherit;border:none;-webkit-border-radius:0;border-radius:0}.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods{padding:1em 0}.wcf-embed-checkout-form #add_payment_method #payment ul.payment_methods,.wcf-embed-checkout-form .woocommerce-cart #payment ul.payment_methods,.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods{border:none}.wcf-embed-checkout-form #payment ul.payment_methods li,.wcf-embed-checkout-form #payment ul.payment_methods li:hover{background-color:transparent}.wcf-embed-checkout-form .woocommerce form .form-row{display:block;margin-bottom:1.1em;padding:3px 7px;position:relative}.wcf-embed-checkout-form .woocommerce form .woocommerce-account-fields .form-row{padding:0}.wcf-embed-checkout-form table.shop_table{border:none;border-bottom:0;background-color:inherit;-webkit-border-radius:0;border-radius:0;font-family:inherit;font-weight:inherit;font-size:.95em;margin:0!important;border-collapse:collapse;text-align:left}.wcf-embed-checkout-form table.shop_table td strong.product-quantity{font-weight:400}.wcf-embed-checkout-form table.shop_table #shipping_method{margin:0;padding:0;list-style:none}.wcf-embed-checkout-form table.shop_table #shipping_method .amount{font-weight:400}.wcf-embed-checkout-form table.shop_table th{border:none;font-weight:400;padding:9px 0;line-height:1.2em}.wcf-embed-checkout-form table.shop_table tfoot tr:last-child .woocommerce-Price-amount{font-size:1em}.wcf-embed-checkout-form table.shop_table td,.wcf-embed-checkout-form table.shop_table td dl dd,.wcf-embed-checkout-form table.shop_table td dl dt,.wcf-embed-checkout-form table.shop_table th{background-color:transparent;border:none;padding:.6em 0;line-height:1.4em}.wcf-embed-checkout-form table.shop_table td dl dd p{margin-top:0}.wcf-embed-checkout-form table.shop_table tbody th,.wcf-embed-checkout-form table.shop_table tfoot td,.wcf-embed-checkout-form table.shop_table tfoot th{border:none;display:table-cell;font-weight:400;width:50%}.wcf-embed-checkout-form table.shop_table thead{background-color:transparent}.wcf-embed-checkout-form table.shop_table tbody{border-top:1px dashed #ccc;border-bottom:1px dashed #ccc}.wcf-embed-checkout-form table.shop_table th.product-name,.wcf-embed-checkout-form table.shop_table th.product-total{font-weight:600}.wcf-embed-checkout-form table.shop_table tfoot tr.order-total:not(.recurring-total) td,.wcf-embed-checkout-form table.shop_table tfoot tr.order-total:not(.recurring-total) th{font-weight:600;border-top:1px dashed #ccc}.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-totals th{padding-top:1.8em;font-weight:600}.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-total td,.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-total th,.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-totals th{vertical-align:top}.wcf-embed-checkout-form table.shop_table tbody tr td:nth-child(1),.wcf-embed-checkout-form table.shop_table tfoot tr td:nth-child(1),.wcf-embed-checkout-form table.shop_table thead tr th:nth-child(1){width:70%}.wcf-embed-checkout-form table.shop_table tbody tr td:nth-child(2),.wcf-embed-checkout-form table.shop_table tfoot tr td:nth-child(2),.wcf-embed-checkout-form table.shop_table thead tr th:nth-child(2){width:30%}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label,.wcf-embed-checkout-form .woocommerce-checkout .form-row label{font-size:13px;line-height:1em;letter-spacing:.3px;font-family:inherit;font-weight:inherit;text-transform:capitalize;margin-bottom:8px}.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields label,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields label{display:inherit}.wcf-embed-checkout-form .woocommerce .woocommerce-terms-and-conditions-wrapper .woocommerce-terms-and-conditions-checkbox-text{line-height:20px;text-transform:initial}.wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p{font-family:inherit;font-weight:inherit;font-size:11px;color:#777;margin-top:0;text-align:justify}.wcf-embed-checkout-form #payment .wc_payment_methods .payment_box p{margin:0}.wcf-embed-checkout-form .woocommerce a{color:#f16334;background-color:transparent;text-decoration:none}.wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-message,.wcf-embed-checkout-form .woocommerce .woocommerce-error,.wcf-embed-checkout-form .woocommerce .woocommerce-info,.wcf-embed-checkout-form .woocommerce .woocommerce-message,.wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{padding:1em 2em .4em 2em;border-top:none;background-color:inherit;font-size:14px;font-weight:500;text-align:left;margin:0}.wcf-embed-checkout-form .woocommerce-info::before,.wcf-embed-checkout-form .woocommerce-message::before{left:.1em;color:#f16334}.wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error,.wcf-embed-checkout-form .woocommerce .woocommerce-error,.wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error{background-color:#fff6f6;border:dashed 1px #a00;padding:25px 25px 20px;color:#a00;margin:1rem 0 1rem;font-size:14px;width:100%}.wcf-embed-checkout-form .woocommerce .woocommerce-error::before{content:''}.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods li:not(.woocommerce-notice)::before{display:inline}.wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{margin:1em 0 1em}.wcf-embed-checkout-form .woocommerce .woocommerce-error li{list-style:disc inside!important;margin:0 0 8px}.wcf-embed-checkout-form .woocommerce .woocommerce-error li strong{font-weight:400}.wcf-embed-checkout-form .woocommerce form.checkout_coupon{border:1px solid #d3ced2;padding:30px 20px 20px;margin:2em 0;text-align:left;-webkit-border-radius:5px;border-radius:5px}.wcf-embed-checkout-form .woocommerce .checkout_coupon p{font-size:14px}.wcf-embed-checkout-form .woocommerce .checkout_coupon p{font-family:inherit;font-weight:500;margin-top:0;margin-bottom:10px}@media only screen and (max-width:768px){.wcf-embed-checkout-form form .wcf-column-33{width:100%}.wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{width:100%}.wcf-embed-checkout-form .woocommerce-checkout #order_review{width:100%}.wcf-embed-checkout-form .woocommerce-checkout .wcf-order-wrap{width:100%}.wcf-embed-checkout-form .woocommerce-checkout{display:block}.wcf-embed-checkout-form .woocommerce-checkout .col2-set,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:block;width:100%;padding-right:0;margin:20px 0 0}.wcf-embed-checkout-form form.checkout_coupon .button{font-size:12px}.wcf-bump-order-field-wrap .wcf-bump-order-label{font-size:16px;text-transform:capitalize}.wcf-embed-checkout-form .woocommerce .col2-set .col-1,.wcf-embed-checkout-form .woocommerce .col2-set .col-2,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-2,.wcf-embed-checkout-form .woocommerce .wcf-order-wrap,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-1,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-2,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-2,.wcf-embed-checkout-form .woocommerce-page .wcf-order-wrap{padding:15px 18px}.wcf-embed-checkout-form .woocommerce form .form-row-first,.wcf-embed-checkout-form .woocommerce form .form-row-last,.wcf-embed-checkout-form .woocommerce-page form .form-row-first,.wcf-embed-checkout-form .woocommerce-page form .form-row-last{width:100%}.wcf-embed-checkout-form #order_review_heading,.wcf-embed-checkout-form .woocommerce #ship-to-different-address,.wcf-embed-checkout-form .woocommerce-additional-fields>h3,.wcf-embed-checkout-form .woocommerce-billing-fields>h3{font-size:1em}}#et-info-email:before,#et-info-phone:before,#et_search_icon:before,.comment-reply-link:after,.et-cart-info span:before,.et-pb-arrow-next:before,.et-pb-arrow-prev:before,.et-social-icon a:before,.et_audio_container .mejs-playpause-button button:before,.et_audio_container .mejs-volume-button button:before,.et_overlay:before,.et_password_protected_form .et_submit_button:after,.et_pb_button:after,.et_pb_contact_reset:after,.et_pb_contact_submit:after,.et_pb_font_icon:before,.et_pb_newsletter_button:after,.et_pb_pricing_table_button:after,.et_pb_promo_button:after,.et_pb_social_icon a.icon:before,.et_pb_testimonial:before,.et_pb_toggle_title:before,.form-submit .et_pb_button:after,.mobile_menu_bar:before,.woocommerce #content input.button.alt:after,.woocommerce #content input.button:after,.woocommerce #respond input#submit.alt:after,.woocommerce #respond input#submit:after,.woocommerce a.button.alt:after,.woocommerce button.button.alt:after,.woocommerce button.button:after,.woocommerce button.single_add_to_cart_button.button:after,.woocommerce input.button.alt:after,.woocommerce input.button:after,.woocommerce-page #content input.button.alt:after,.woocommerce-page #content input.button:after,.woocommerce-page #respond input#submit.alt:after,.woocommerce-page #respond input#submit:after,.woocommerce-page a.button.alt:after,.woocommerce-page a.button:after,.woocommerce-page button.button.alt:after,.woocommerce-page button.button:after,.woocommerce-page input.button.alt:after,.woocommerce-page input.button:after,a.et_pb_more_button:after{text-shadow:0 0;font-family:none;font-weight:400;font-style:normal;font-variant:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:1;text-transform:none;speak:none}.comment-reply-link:hover:after,.woocommerce #content input.button.alt:hover:after,.woocommerce #content input.button:hover:after,.woocommerce #respond input#submit.alt:hover:after,.woocommerce #respond input#submit:hover:after,.woocommerce a.button.alt:hover:after,.woocommerce a.button:hover:after,.woocommerce button.button.alt:hover:after,.woocommerce button.button:hover:after,.woocommerce input.button.alt:hover:after,.woocommerce input.button:hover:after,.woocommerce-page #content input.button.alt:hover:after,.woocommerce-page #content input.button:hover:after,.woocommerce-page #respond input#submit.alt:hover:after,.woocommerce-page #respond input#submit:hover:after,.woocommerce-page a.button.alt:hover:after,.woocommerce-page a.button:hover:after,.woocommerce-page button.button.alt:hover:after,.woocommerce-page button.button:hover:after,.woocommerce-page input.button.alt:hover:after,.woocommerce-page input.button:hover:after{opacity:0}.thrv_wrapper .wcf-embed-checkout-form div{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
1
+ .cartflows-container .wcf-embed-checkout-form,.cartflows-container .wcf-embed-checkout-form *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wcf-embed-checkout-form .wc-backward{display:none!important}.wcf-embed-checkout-form .woocommerce form .form-row-first,.wcf-embed-checkout-form .woocommerce form .form-row-last,.wcf-embed-checkout-form .woocommerce-page form .form-row-first,.wcf-embed-checkout-form .woocommerce-page form .form-row-last{width:50%;display:block}.wcf-embed-checkout-form .woocommerce form .form-row-full,.wcf-embed-checkout-form .woocommerce-page form .form-row-full{width:100%;clear:both}.wcf-embed-checkout-form form .form-row-wide{width:100%}.wcf-embed-checkout-form form .wcf-column-33{width:33.33%}.wcf-embed-checkout-form .woocommerce form .form-row-first,.woocommerce-page form .form-row-first{float:left;clear:left}.wcf-embed-checkout-form .woocommerce form .form-row-last,.woocommerce-page form .form-row-last{float:right;clear:right}.wcf-embed-checkout-form .woocommerce form .form-row .required{color:red;font-weight:700;border:0!important;text-decoration:none}.wcf-embed-checkout-form .woocommerce .woocommerce-checkout .product-name .remove{font-family:cartflows-icon;display:inline-block;font-size:10px;border:1px #4d5763 solid;-webkit-border-radius:50%;border-radius:50%;padding:1px;color:#4d5763!important;line-height:1;margin-right:5px;text-align:center;font-weight:100;width:14px;height:14px;background-color:#fff}.wcf-embed-checkout-form .woocommerce .woocommerce-checkout .product-name .remove:hover{color:#f1653c!important;border:1px #f1653c solid;background-color:#fff}.wcf-embed-checkout-form form .form-row-first.form-row-one{clear:both}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login{display:none}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row{margin-bottom:15px}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .clear{clear:none}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label{margin:0;line-height:1em;padding-top:0;position:relative;top:0}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .login-form-actions{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;margin-bottom:0}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .lost_password,.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .remember_me{-webkit-box-flex:1;-webkit-flex:1;-moz-box-flex:1;-ms-flex:1;flex:1;font-family:inherit;font-size:13px}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row .remember_me label{margin-bottom:0;vertical-align:text-top}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row .remember_me input,.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row .remember_me span{vertical-align:middle}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .lost_password{text-align:right;margin-top:0;margin-bottom:0}.wcf-embed-checkout-form .woocommerce .blockUI.blockOverlay{font-size:15px}.wcf-embed-checkout-form .woocommerce form .form-row.mt20{margin-top:20px}.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid .select2-container,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid input.input-text,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid select{border-width:1px;border-color:#e2401c}.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-validated .select2-container,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-validated input.input-text,.wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-validated select{border-width:1px}.wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,.wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required,.wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,.wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c}.wcf-embed-checkout-form .woocommerce form .form-row input.field-validated{border-left-width:2px;border-left-color:#69bf29}.wcf-embed-checkout-form .wcf-checkout-header-image{text-align:center}.wcf-embed-checkout-form .woocommerce #payment [type=radio]:checked+label,.wcf-embed-checkout-form .woocommerce #payment [type=radio]:not(:checked)+label{padding:0}.wcf-embed-checkout-form .woocommerce #payment input[type=radio]{-webkit-border-radius:50%;border-radius:50%;margin-right:4px;line-height:10px}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{content:"\e600";margin:0;color:#f16334}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox],.wcf-embed-checkout-form .woocommerce #payment input[type=radio],.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox],.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox],.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]{border:1px solid #b4b9be;background:#fff;color:#555;clear:none;cursor:pointer;display:inline-block;line-height:0;height:16px;margin:-4px 4px 0 0;outline:0;padding:0!important;text-align:center;vertical-align:middle;width:16px;min-width:16px;-webkit-appearance:none;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-webkit-transition:.05s border-color ease-in-out;transition:.05s border-color ease-in-out}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,.wcf-embed-checkout-form .woocommerce #payment input[type=radio]:focus,.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox]:focus,.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox]:focus,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:focus{border-color:#f16334;-webkit-box-shadow:0 0 2px rgba(241,99,52,.8);box-shadow:0 0 2px rgba(241,99,52,.8)}.wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before{background-color:#f16334;-webkit-border-radius:50px;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:16px;margin:4px;text-indent:-9999px;width:6px}.wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-account-fields input[type=checkbox]:before,.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields [type=checkbox]:checked:before,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{display:inline-block;float:left;font:normal 15px/1 cartflows-icon;speak:none;vertical-align:middle;width:6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods li input[type=checkbox]{min-width:16px}.wcf-embed-checkout-form .woocommerce .col2-set .col-1,.wcf-embed-checkout-form .woocommerce .col2-set .col-2,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-2,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-1,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-2,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-2{float:none;width:100%;max-width:100%;padding:0;-webkit-border-radius:0;border-radius:0;border:none;border-color:none;margin-bottom:0}.wcf-embed-checkout-form #order_review_heading,.wcf-embed-checkout-form .woocommerce #ship-to-different-address,.wcf-embed-checkout-form .woocommerce-additional-fields>h3,.wcf-embed-checkout-form .woocommerce-billing-fields>h3{font-family:inherit;font-weight:600;font-size:20px;margin:0 0 25px 0;padding:0;width:100%}.wcf-embed-checkout-form .woocommerce-checkout #payment{background:unset;-webkit-border-radius:0;border-radius:0}.wcf-embed-checkout-form .woocommerce-checkout #payment .form-row{margin:0;padding:0}.wcf-embed-checkout-form .woocommerce-checkout #payment .form-row label.checkbox{display:block;margin-bottom:1.1em}.wcf-embed-checkout-form .woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:none;margin-left:10px}.wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box .form-row{margin:0 0 .5em}.wcf-embed-checkout-form .woocommerce-checkout #payment fieldset .form-row .wcf-embed-checkout-form .woocommerce-checkout #payment fieldset p{margin-bottom:10px}.wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box{background-color:#eaeaea;font-family:inherit;font-weight:inherit;margin-bottom:.5em}.wcf-embed-checkout-form #add_payment_method #payment div.payment_box::before,.wcf-embed-checkout-form .woocommerce-cart #payment div.payment_box::before,.wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box::before{content:'';display:block;border:1em solid;border-right-color:transparent;border-left-color:transparent;border-top-color:transparent;border-bottom-color:#eaeaea;position:absolute;top:-.75em;left:0;margin:-1em 0 0 2em}.wcf-embed-checkout-form .select2-container--default .select2-selection--single{display:block;width:100%;min-height:34px;height:auto;padding:11px 12px;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;outline:0}.wcf-embed-checkout-form .select2-container--default .select2-selection--single .select2-selection__rendered{color:#666;line-height:19px;min-height:19px;overflow:visible;padding-left:0}.select2-results__option[data-selected],.wcf-embed-checkout-form .select2-results__option[aria-selected]{font-size:14px}.wcf-embed-checkout-form .select2-container--default .select2-selection--single .select2-selection__arrow{height:100%}.select2-dropdown{border:1px solid #d4d4d4}.wcf-embed-checkout-form .woocommerce #order_review .input-text,.wcf-embed-checkout-form .woocommerce form .form-row input.input-text,.wcf-embed-checkout-form .woocommerce form .form-row select,.wcf-embed-checkout-form .woocommerce form .form-row textarea{display:block;width:100%;min-height:34px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;height:auto}.wcf-embed-checkout-form #order_review{padding:3px;width:100%}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error,.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message{padding:0 2em 1.2em 2em;background-color:transparent;border:none;margin:0;width:100%}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error li{list-style:none!important;margin:0}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error::before,.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-message::before{top:0;left:0}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error::before{content:'\e016'}.wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error li{margin:0 0 0 8px}.wcf-embed-checkout-form .woocommerce #order_review .wcf-custom-coupon-field input[type=text]{font-weight:400}.wcf-embed-checkout-form .wcf-custom-coupon-field{clear:left;-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;margin-bottom:15px;margin-top:25px;border-top:1px solid #dcdcdc;border-bottom:1px solid #dcdcdc;padding-top:25px;padding-bottom:25px;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.wcf-embed-checkout-form #order_review .wcf-coupon-col-1{width:70%;display:inline-block;padding-right:20px}.wcf-embed-checkout-form #order_review .wcf-coupon-col-2{width:30%}.wcf-embed-checkout-form .select2-container--open,.wcf-embed-checkout-form input[type=email]:focus,.wcf-embed-checkout-form input[type=password]:focus,.wcf-embed-checkout-form input[type=tel]:focus,.wcf-embed-checkout-form input[type=text]:focus,.wcf-embed-checkout-form textarea:focus{border-color:#b3b3b3;-webkit-box-shadow:none;box-shadow:none;outline:0}.wcf-embed-checkout-form button:focus{outline:0;outline-color:none;outline-style:none;outline-width:none}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button,.wcf-embed-checkout-form form.checkout_coupon .button{display:block;clear:both;border:none;font-size:15px;font-family:inherit;font-weight:inherit;background-color:#f16334;line-height:9px;padding:18px;margin-bottom:10px;width:100%}.wcf-embed-checkout-form .woocommerce #order_review button{border:1px solid;border-color:#f16334;background-color:#f16334;font-family:inherit;font-weight:inherit;font-size:18px;letter-spacing:.5px;width:100%;padding:16px 24px;font-size:16px;line-height:1.5;-webkit-border-radius:3px;border-radius:3px;color:#fff}.wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small{padding:8px 6px;background-color:#c8c8c8;border:1px #c8c8c8 solid}.wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small:hover{border-color:#f16334;background-color:#f16334}.wcf-embed-checkout-form .woocommerce #payment #place_order:hover{background-color:#f16334;border-color:#f16334;color:#fff}.wcf-embed-checkout-form .woocommerce-checkout{display:inline-block;text-align:inherit;width:100%}.wcf-embed-checkout-form .woocommerce-checkout .col2-set,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:inline-block;width:55%;float:left;padding-right:40px;margin:20px 0 0}.wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{margin:0 -7px;-ms-flex-wrap:wrap;flex-wrap:wrap;-js-display:flex;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flex;display:-webkit-flex;flex-wrap:wrap;-webkit-flex-wrap:wrap}.wcf-embed-checkout-form .woocommerce-checkout .col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper{margin:0 -7px}.wcf-embed-checkout-form-two-column .woocommerce-checkout .wcf-order-wrap{display:inline-block;float:none;width:45%;border:none;background-color:inherit;padding:0 10px;-webkit-border-radius:3px;border-radius:3px}.wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{display:inline-block;font-family:inherit;font-weight:600;width:100%;margin:20px 0 0;padding:3px 3px 20px;border:none;border-bottom:none}.wcf-embed-checkout-form .woocommerce-checkout #payment{background-color:inherit;border:none;-webkit-border-radius:0;border-radius:0}.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods{padding:1em 0}.wcf-embed-checkout-form #add_payment_method #payment ul.payment_methods,.wcf-embed-checkout-form .woocommerce-cart #payment ul.payment_methods,.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods{border:none}.wcf-embed-checkout-form #payment ul.payment_methods li,.wcf-embed-checkout-form #payment ul.payment_methods li:hover{background-color:transparent}.wcf-embed-checkout-form .woocommerce form .form-row{display:block;margin-bottom:1.1em;padding:3px 7px;position:relative}.wcf-embed-checkout-form .woocommerce form .woocommerce-account-fields .form-row{padding:0}.wcf-embed-checkout-form table.shop_table{border:none;border-bottom:0;background-color:inherit;-webkit-border-radius:0;border-radius:0;font-family:inherit;font-weight:inherit;font-size:.95em;margin:0!important;border-collapse:collapse;text-align:left}.wcf-embed-checkout-form table.shop_table td strong.product-quantity{font-weight:400}.wcf-embed-checkout-form table.shop_table #shipping_method{margin:0;padding:0;list-style:none}.wcf-embed-checkout-form table.shop_table #shipping_method .amount{font-weight:400}.wcf-embed-checkout-form table.shop_table th{border:none;font-weight:400;padding:9px 0;line-height:1.2em}.wcf-embed-checkout-form table.shop_table tfoot tr:last-child .woocommerce-Price-amount{font-size:1em}.wcf-embed-checkout-form table.shop_table td,.wcf-embed-checkout-form table.shop_table td dl dd,.wcf-embed-checkout-form table.shop_table td dl dt,.wcf-embed-checkout-form table.shop_table th{background-color:transparent;border:none;padding:.6em 0;line-height:1.4em}.wcf-embed-checkout-form table.shop_table td dl dd p{margin-top:0}.wcf-embed-checkout-form table.shop_table tbody th,.wcf-embed-checkout-form table.shop_table tfoot td,.wcf-embed-checkout-form table.shop_table tfoot th{border:none;display:table-cell;font-weight:400;width:50%}.wcf-embed-checkout-form table.shop_table thead{background-color:transparent}.wcf-embed-checkout-form table.shop_table tbody{border-top:1px dashed #ccc;border-bottom:1px dashed #ccc}.wcf-embed-checkout-form table.shop_table th.product-name,.wcf-embed-checkout-form table.shop_table th.product-total{font-weight:600}.wcf-embed-checkout-form table.shop_table tfoot tr.order-total:not(.recurring-total) td,.wcf-embed-checkout-form table.shop_table tfoot tr.order-total:not(.recurring-total) th{font-weight:600;border-top:1px dashed #ccc}.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-totals th{padding-top:1.8em;font-weight:600}.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-total td,.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-total th,.wcf-embed-checkout-form table.shop_table tfoot tr.recurring-totals th{vertical-align:top}.wcf-embed-checkout-form table.shop_table tbody tr td:nth-child(1),.wcf-embed-checkout-form table.shop_table tfoot tr td:nth-child(1),.wcf-embed-checkout-form table.shop_table thead tr th:nth-child(1){width:70%}.wcf-embed-checkout-form table.shop_table tbody tr td:nth-child(2),.wcf-embed-checkout-form table.shop_table tfoot tr td:nth-child(2),.wcf-embed-checkout-form table.shop_table thead tr th:nth-child(2){width:30%}.wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row label,.wcf-embed-checkout-form .woocommerce-checkout .form-row label{font-size:13px;line-height:1em;letter-spacing:.3px;font-family:inherit;font-weight:inherit;margin-bottom:8px}.wcf-embed-checkout-form .woocommerce .woocommerce-billing-fields label,.wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields label{display:inherit}.wcf-embed-checkout-form .woocommerce .woocommerce-terms-and-conditions-wrapper .woocommerce-terms-and-conditions-checkbox-text{line-height:20px;text-transform:none}.wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p{font-family:inherit;font-weight:inherit;font-size:11px;color:#777;margin-top:0;text-align:justify}.wcf-embed-checkout-form #payment .wc_payment_methods .payment_box p{margin:0}.wcf-embed-checkout-form .woocommerce a{color:#f16334;background-color:transparent;text-decoration:none}.wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-message,.wcf-embed-checkout-form .woocommerce .woocommerce-error,.wcf-embed-checkout-form .woocommerce .woocommerce-info,.wcf-embed-checkout-form .woocommerce .woocommerce-message,.wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{padding:1em 2em .4em 2em;border-top:none;background-color:inherit;font-size:14px;font-weight:500;text-align:left;margin:0}.wcf-embed-checkout-form .woocommerce-info::before,.wcf-embed-checkout-form .woocommerce-message::before{left:.1em;color:#f16334}.wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error,.wcf-embed-checkout-form .woocommerce .woocommerce-error,.wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error{background-color:#fff6f6;border:dashed 1px #a00;padding:25px 25px 20px;color:#a00;margin:1rem 0 1rem;font-size:14px;width:100%}.wcf-embed-checkout-form .woocommerce .woocommerce-error::before{content:''}.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods li:not(.woocommerce-notice)::before{display:inline}.wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{margin:1em 0 1em}.wcf-embed-checkout-form .woocommerce .woocommerce-error li{list-style:disc inside!important;margin:0 0 8px}.wcf-embed-checkout-form .woocommerce .woocommerce-error li strong{font-weight:400}.wcf-embed-checkout-form .woocommerce form.checkout_coupon{border:1px solid #d3ced2;padding:30px 20px 20px;margin:2em 0;text-align:left;-webkit-border-radius:5px;border-radius:5px}.wcf-embed-checkout-form .woocommerce .checkout_coupon p{font-size:14px}.wcf-embed-checkout-form .woocommerce .checkout_coupon p{font-family:inherit;font-weight:500;margin-top:0;margin-bottom:10px}@media only screen and (max-width:768px){.wcf-embed-checkout-form form .wcf-column-33{width:100%}.wcf-embed-checkout-form .woocommerce-checkout #order_review_heading{width:100%}.wcf-embed-checkout-form .woocommerce-checkout #order_review{width:100%}.wcf-embed-checkout-form .woocommerce-checkout .wcf-order-wrap{width:100%}.wcf-embed-checkout-form .woocommerce-checkout{display:block}.wcf-embed-checkout-form .woocommerce-checkout .col2-set,.wcf-embed-checkout-form .woocommerce-checkout .wcf-col2-set{display:block;width:100%;padding-right:0;margin:20px 0 0}.wcf-embed-checkout-form form.checkout_coupon .button{font-size:12px}.wcf-bump-order-field-wrap .wcf-bump-order-label{font-size:16px}.wcf-embed-checkout-form .woocommerce .col2-set .col-1,.wcf-embed-checkout-form .woocommerce .col2-set .col-2,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce .wcf-col2-set .wcf-col-2,.wcf-embed-checkout-form .woocommerce .wcf-order-wrap,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-1,.wcf-embed-checkout-form .woocommerce-page .col2-set .col-2,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-1,.wcf-embed-checkout-form .woocommerce-page .wcf-col2-set .wcf-col-2,.wcf-embed-checkout-form .woocommerce-page .wcf-order-wrap{padding:15px 18px}.wcf-embed-checkout-form .woocommerce form .form-row-first,.wcf-embed-checkout-form .woocommerce form .form-row-last,.wcf-embed-checkout-form .woocommerce-page form .form-row-first,.wcf-embed-checkout-form .woocommerce-page form .form-row-last{width:100%}.wcf-embed-checkout-form #order_review_heading,.wcf-embed-checkout-form .woocommerce #ship-to-different-address,.wcf-embed-checkout-form .woocommerce-additional-fields>h3,.wcf-embed-checkout-form .woocommerce-billing-fields>h3{font-size:1em}}#et-info-email:before,#et-info-phone:before,#et_search_icon:before,.comment-reply-link:after,.et-cart-info span:before,.et-pb-arrow-next:before,.et-pb-arrow-prev:before,.et-social-icon a:before,.et_audio_container .mejs-playpause-button button:before,.et_audio_container .mejs-volume-button button:before,.et_overlay:before,.et_password_protected_form .et_submit_button:after,.et_pb_button:after,.et_pb_contact_reset:after,.et_pb_contact_submit:after,.et_pb_font_icon:before,.et_pb_newsletter_button:after,.et_pb_pricing_table_button:after,.et_pb_promo_button:after,.et_pb_social_icon a.icon:before,.et_pb_testimonial:before,.et_pb_toggle_title:before,.form-submit .et_pb_button:after,.mobile_menu_bar:before,.woocommerce #content input.button.alt:after,.woocommerce #content input.button:after,.woocommerce #respond input#submit.alt:after,.woocommerce #respond input#submit:after,.woocommerce a.button.alt:after,.woocommerce button.button.alt:after,.woocommerce button.button:after,.woocommerce button.single_add_to_cart_button.button:after,.woocommerce input.button.alt:after,.woocommerce input.button:after,.woocommerce-page #content input.button.alt:after,.woocommerce-page #content input.button:after,.woocommerce-page #respond input#submit.alt:after,.woocommerce-page #respond input#submit:after,.woocommerce-page a.button.alt:after,.woocommerce-page a.button:after,.woocommerce-page button.button.alt:after,.woocommerce-page button.button:after,.woocommerce-page input.button.alt:after,.woocommerce-page input.button:after,a.et_pb_more_button:after{text-shadow:0 0;font-family:none;font-weight:400;font-style:normal;font-variant:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:1;text-transform:none;speak:none}.comment-reply-link:hover:after,.woocommerce #content input.button.alt:hover:after,.woocommerce #content input.button:hover:after,.woocommerce #respond input#submit.alt:hover:after,.woocommerce #respond input#submit:hover:after,.woocommerce a.button.alt:hover:after,.woocommerce a.button:hover:after,.woocommerce button.button.alt:hover:after,.woocommerce button.button:hover:after,.woocommerce input.button.alt:hover:after,.woocommerce input.button:hover:after,.woocommerce-page #content input.button.alt:hover:after,.woocommerce-page #content input.button:hover:after,.woocommerce-page #respond input#submit.alt:hover:after,.woocommerce-page #respond input#submit:hover:after,.woocommerce-page a.button.alt:hover:after,.woocommerce-page a.button:hover:after,.woocommerce-page button.button.alt:hover:after,.woocommerce-page button.button:hover:after,.woocommerce-page input.button.alt:hover:after,.woocommerce-page input.button:hover:after{opacity:0}.thrv_wrapper .wcf-embed-checkout-form div{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
assets/min-css/import-rtl.min.css CHANGED
@@ -1 +1 @@
1
- .no-elementor-notice{border-right:none;background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;padding-right:0}.no-elementor-notice span{color:#f16334;font-size:18px;vertical-align:middle}.site-preview{background:#c5c5c5;display:block;overflow:hidden;position:relative;-webkit-backface-visibility:hidden}.template.importing .site-preview:after,.template:hover .site-preview:after{opacity:.3}.template.importing .site-preview,.template:hover .site-preview{background:#fff;cursor:pointer}.template .site-preview:after{content:"";background:#fff;opacity:0;top:0;content:"";display:block;top:0;position:absolute;padding-top:66.66666%;-webkit-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;right:0;left:0;bottom:0}.template .notice{padding:.6em;background:rgba(0,0,0,.8);color:#fff;font-weight:400;border:none;font-size:13px;text-decoration:none;position:absolute;width:100%;vertical-align:middle;bottom:0;margin:0;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);left:0;right:0;z-index:4;text-align:center;-webkit-border-radius:3px;border-radius:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;-webkit-font-smoothing:antialiased}.template .notice a{color:#f16334}.template .notice p{padding:0;margin:0}#wcf_create_notice{display:none}.preview:focus,.preview:hover{color:#fff;-webkit-box-shadow:none;box-shadow:none}.preview{text-decoration:none;opacity:0;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);left:22%;right:22%;z-index:4;background:#23282d;background:rgba(0,0,0,.7);color:#fff;font-size:13px;text-shadow:0 1px 0 rgba(0,0,0,.6);-webkit-font-smoothing:antialiased;font-weight:600;padding:10px 12px;text-align:center;-webkit-border-radius:3px;border-radius:3px;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out}.template-id-container{font-size:15px;font-weight:600;margin:0;padding:10px;-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:#fff;background:rgba(255,255,255,.65);position:relative}.template-actions{opacity:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;position:absolute;bottom:0;left:0;top:0;padding:5px 5px 0 5px;background:rgba(244,244,244,.7);border-right:1px solid rgba(0,0,0,.05)}.template.importing .preview,.template.importing .template-actions,.template:hover .preview,.template:hover .template-actions,.wcf-step-content .template-actions{opacity:1}.wcf-remote-list .template{position:relative;overflow:hidden}.wcf-remote-list h3{margin-bottom:1em;margin-top:0;font-size:15px;font-weight:600;margin:0;padding:0;text-align:right}.wcf-remote-list img{max-width:100%;vertical-align:middle}.wcf-remote-list *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cartflows-steps-list img{width:100%}#cartflows-steps-list .title{font-weight:700;color:#474747;line-height:2;background:#f7f7f7;padding:.5em 1em}#cartflows-steps-list .image-wrap{-webkit-background-size:cover;background-size:cover;overflow:hidden}#cartflows-steps .close{display:inline-block;padding:2em;cursor:pointer}.template-message-block{text-align:center;margin:0 auto;padding:4em 0}.templator #TB_ajaxContent{width:100%!important}.template-message-block .description{font-style:normal}.template-message-block .spinner{float:none;margin:0}.cartflows-steps-popup{position:fixed;right:0;left:0;top:0;bottom:0;z-index:99999;background:#fff;overflow-y:scroll}.cartflows-steps-popup .notice{max-width:700px;margin:0 auto}.cartflows-load-steps-library .dashicons{height:auto;width:auto;line-height:normal;margin:0 0 0 5px;vertical-align:initial;font-size:100%}.cartflows-load-steps .dashicons{vertical-align:text-bottom}#TB_window{width:100%!important;margin:0 auto!important;text-align:center!important;position:fixed!important;top:0!important;right:0!important;left:0!important;bottom:0!important}#TB_iframeContent{width:100%!important;height:100%!important}@media only screen and (min-device-width :320px) and (max-device-width :1024px){#TB_iframeContent-wrapper{position:fixed;left:0;bottom:50px;right:0;top:0;overflow-y:scroll;-webkit-overflow-scrolling:touch}}#TB_window #TB_ajaxWindowTitle{font-size:1.2rem;display:inline-block;width:auto;padding:0}#TB_window #TB_closeWindowButton{position:relative}.tb-close-icon:before{vertical-align:middle}#TB_window{text-align:center}#TB_iframeContent.tablet{width:768px!important;height:1024px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.tablet.landscape{width:1024px!important}#TB_iframeContent.mobile{width:360px!important;height:640px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.mobile.landscape{width:360px!important}#TB_closeAjaxWindow{float:left}#TB_window.thickbox-loading{margin:0!important}div#TB_window{background-color:#fff}#TB_window #TB_title{color:#0a0c0d;text-align:right;bottom:0;-webkit-box-shadow:none;box-shadow:none;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;padding:1em 1.5em 1em 1em}@media all and (min-width:769px){#TB_window #TB_title{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}}#TB_window.mobile,#TB_window.tablet{overflow-y:scroll}.top #TB_iframeContent-wrapper{bottom:0;top:80px}#TB_window.top #TB_title{top:0}#TB_window #TB_closeWindowButton:focus .tb-close-icon{-webkit-box-shadow:none;box-shadow:none;color:#666}@media all and (max-width:768px){#TB_closeAjaxWindow{padding-left:0}#TB_window #TB_closeWindowButton,#TB_window .tb-close-icon{width:80px}}.responsive-view .dashicons{color:#ddd}.responsive-view .active{color:#111}.responsive-view a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#TB_window.mobile #TB_iframeContent,#TB_window.tablet #TB_iframeContent{margin-bottom:50px;margin-top:50px}.responsive-view a{color:#666;cursor:pointer;display:inline-block;padding:1em;vertical-align:middle;text-decoration:none}#TB_closeAjaxWindow .tb-close-icon{position:relative}.site-loading{display:none;position:absolute;right:50%;top:50%;text-align:center;color:#555;-webkit-transform:translate(50%,-40%);-ms-transform:translate(50%,-40%);transform:translate(50%,-40%)}.top .site-loading{top:50%;-webkit-transform:translate(50%,-50%);-ms-transform:translate(50%,-50%);transform:translate(50%,-50%)}.site-loading h3{font-size:33px;font-weight:600;margin:0 0 .8em 0}.site-loading p{margin:0}.cartflows-thickbox-loading .site-loading{display:block}.cartflows-thickbox-loading #TB_iframeContent,.cartflows-thickbox-loading #TB_iframeContent-wrapper{display:none}.wcf-remote-list:after,.wcf-remote-list:before{content:"";display:table}.wcf-remote-list::after{content:"";display:table;clear:both}.wcf-template-header .filter-count{line-height:normal}#wcf-page-builders{display:none}#wcf-remote-flow-filters>div,#wcf-remote-step-filters>div{display:inline-block}.wcf-template-header .filter-links{margin:0;padding:0}.wcf-template-header li:focus{outline:0}.wcf-template-header .filter-links li{margin:0;display:inline-block}.wcf-template-header .filter-links li a:focus,.wcf-template-header .filter-links li a:hove{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-template-header .filter-links li .current{color:#000;border-bottom:2px solid #f16334;font-weight:600}.wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8}.wcf-search-form{margin-left:2em;padding-left:0;text-align:left;margin-top:1em;margin-bottom:1em;position:relative}.wcf-template-notice{display:none}#wcf-start-from-scratch{text-align:center}#wcf-start-from-scratch .inner{background:0 0;-webkit-box-shadow:none;box-shadow:none;width:94%;margin:0 auto;float:none;position:absolute;top:40%}#wcf-scratch-steps-categories{display:inline-block}#wcf-scratch-steps-categories select{-webkit-border-radius:0;border-radius:0;height:29px;border:1px solid;border-color:#9e9e9e;border-width:1px;-webkit-box-shadow:none;box-shadow:none;padding:2px;line-height:29px}#wcf-start-from-scratch .description{margin-bottom:2em}#wcf-remote-step-importer .wcf-search-form{display:none}.wcf-search-form .wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8;background:0 0;border-bottom:1px solid #ccc;font-size:1em}.wcf-search-form .wcf-flow-search-input:focus{-webkit-box-shadow:none;box-shadow:none;border-color:#ccc}.cartflows-preview-flow-steps li{display:inline-block;margin:0 1em;position:relative}.cartflows-flow-import-blank.updating-message:before{vertical-align:text-bottom}#wpwrap .cartflows-step-loading h2,#wpwrap .template-message-block h2{font-size:1.5em;margin:0 0 .5em 0;padding:8px 12px;line-height:1.4}#wpwrap .cartflows-step-loading p,#wpwrap .template-message-block p{font-size:1.2em}#wpwrap .cartflows-step-loading .spinner{vertical-align:initial}.wcf-flow-type{position:absolute;left:0;top:0;padding:3px 10px;color:#fff}.wcf-flow-type.pro{background:#f06262}.wcf-templates-popup-overlay{position:fixed;height:100%;width:100%;top:0;right:0;background:rgba(0,0,0,.7);-webkit-transition:opacity .5s;transition:opacity .5s;visibility:hidden;opacity:0;z-index:9999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:none;transition:none}.wcf-templates-popup-overlay.open{visibility:visible;opacity:1;z-index:9999}.wcf-templates-popup-content{max-width:1200px;background-color:#fff;position:absolute;-webkit-border-radius:3px;border-radius:3px;top:40%;right:50%;-webkit-transform:translate(50%,-35%);-ms-transform:translate(50%,-35%);transform:translate(50%,-35%);width:70%;min-height:450px;overflow:hidden}.wcf-templates-popup-content .inner{background:#fff;position:relative;padding:8px 8px 0 8px;display:block;float:right;margin:15px;text-align:center;-webkit-box-shadow:0 0 5px 1px rgba(204,204,204,.3);box-shadow:0 0 5px 1px rgba(204,204,204,.3)}@media only screen and (max-width:480px){.wcf-templates-popup-content{width:90%}.wcf-template-header{display:block!important;padding:15px 15px 0 15px!important}.wcf-popup-close-wrap{position:absolute;top:10px;left:5px}}@media only screen and (min-width:768px){.wcf-templates-popup-content .inner{width:-webkit-calc(25% - 30px);width:calc(25% - 30px)}}html.wcf-popup-open{overflow:hidden}.wcf-button-wrap{margin-top:0;position:absolute;top:10px;right:110px}.wcf-steps-loading #wcf-remote-step-list{display:none!important}#wcf-remote-content{background-color:#f5f5f5;overflow-y:auto;min-height:450px;max-height:450px;padding:20px 20px 20px 20px;clear:both}#wcf-remote-content #wcf-start-from-scratch h1{font-size:23px;font-weight:400;margin:0 0 1em 0;padding:9px 0 4px;line-height:29px}.wcf-template-list-wrap .template-name{margin:0;text-align:right;font-size:13px}.wcf-template-list-wrap img{width:100%;vertical-align:middle}.wcf-templates-popup-content .template{margin:0;position:relative;overflow:hidden}.wcf-tab.nav-tabs{overflow:hidden;margin:0}.wcf-template-header{-moz-box-align:center;align-items:center;background:#fff;-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);box-shadow:0 0 8px rgba(0,0,0,.2);-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;-moz-box-pack:justify;justify-content:space-between;padding:0 15px;min-height:50px}.wcf-search-form:after{content:"\f179";display:inline-block;font-family:dashicons;text-decoration:inherit;font-weight:400;font-style:normal;text-align:center;-webkit-transition:color .1s ease-in 0;transition:color .1s ease-in 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;left:.5em;top:.5em;color:#81868a}.wcf-template-logo-wrap{font-size:16px;font-weight:600;text-align:center}.wcf-template-logo-wrap .wcf-cartflows-logo-img{vertical-align:middle}.wcf-tab.nav-tabs:before{display:table;content:""}.wcf-tab.nav-tabs:after{clear:both}.wcf-tab.nav-tabs>li{display:inline-block;padding:15px 0;margin:0;font-weight:400}.wcf-tab.nav-tabs>li.active{border-bottom:3px solid #f16334;font-weight:600}.wcf-template-header .filter-links li>a{border-color:transparent;margin:0}.wcf-tab.nav-tabs>li:active,.wcf-tab.nav-tabs>li:focus,.wcf-tab.nav-tabs>li>a:focus,.wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li:focus .wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-tab.nav-tabs>li>a,.wcf-template-header .filter-links>li>a,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{padding:15px;color:#555;text-decoration:none}.wcf-nav-section-content{display:none}.wcf-nav-section-content.active{display:block;overflow:hidden}.wcf-popup-close-wrap{width:35px;text-align:center;border-right:1px #eee solid}.wcf-popup-close-wrap .close-icon{cursor:pointer}.wcf-popup-close-wrap .wcf-cartflow-icons{pointer-events:none;font-size:20px;height:20px;width:20px;line-height:20px;opacity:.7}.wcf-popup-close-wrap .close-icon:hover .wcf-cartflow-icons{opacity:1}.wcf-templates-popup-content .spinner{position:absolute;top:50%;right:50%;bottom:0;left:0;max-width:100%;max-height:100%;-webkit-transform:translate(50%,-50%);-ms-transform:translate(50%,-50%);transform:translate(50%,-50%);z-index:99999}.wcf-templates-popup-content .wcf-template-header .wcf-tab-wrapper{margin:0 auto}#wcf-upcoming-page-builders .description{font-size:1rem;margin:4em 0 0 0;text-align:center}.flow-type-filter-links{display:none}#wcf-remote-filters{padding:0 15px}#wcf-remote-filters a{text-decoration:none}#wcf-remote-filters .filter-links li:focus,#wcf-remote-filters a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-filters .filter-links li a{border-bottom:none}#wcf-remote-filters .filter-links li:first-child a{margin-right:0}#wcf-remote-filters .filter-links li:last-child a{margin-left:0}#wcf-remote-filters .filter-links li .current,#wcf-remote-filters .filter-links li a:focus,#wcf-remote-filters .filter-links li a:hover{color:#f16334}.wrap .wcf-page-builder-notice .notice{margin:5px 15px}#wcf-api-notice-block{text-align:center;margin-top:5em}.wcf-templates-popup-overlay a{-webkit-transition:none;transition:none}.wcf-notice-wrap .notice{display:inline-block}.wcf-learn-how i{font-size:1rem;vertical-align:middle}.wcf-learn-how a{text-decoration:none}#wcf-remote-content .wcf-install-plugin::focus{border-color:none;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-content .wcf-install-plugin.updating-message{background:0 0;padding:0;font-size:1rem;-webkit-box-shadow:none;box-shadow:none;border:none;margin:0 3px 0 0}.wcf-page-builder-message{margin:5em auto 0 auto;width:700px}.wcf-page-builder-message p{font-size:1rem}.wcf-page-builder-message i{font-size:1rem;vertical-align:middle}.wcf-page-builder-message a{text-decoration:none;margin:1.5em 0 0 0}.cartflows-ie .postbox{padding:1em}.cartflows-ie{padding-top:2em;padding-left:2em}.admin_page_flow_exporter .notice,.admin_page_flow_importer .notice{margin:1em 0 0 0}.cartflows-website-unreachable{padding:1em 2em}.wcf-notice-wrap{margin-top:20px;font-size:15px;color:red}.wcf-activate-wc{text-decoration:none}.wcf-activate-wc.button{border:none;-webkit-box-shadow:none;box-shadow:none}.wcf-hidden{display:none}
1
+ .no-elementor-notice{border-right:none;background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;padding-right:0}.no-elementor-notice span{color:#f16334;font-size:18px;vertical-align:middle}.site-preview{background:#c5c5c5;display:block;overflow:hidden;position:relative;-webkit-backface-visibility:hidden}.template.importing .site-preview:after,.template:hover .site-preview:after{opacity:.3}.template.importing .site-preview,.template:hover .site-preview{background:#fff;cursor:pointer}.template .site-preview:after{content:"";background:#fff;opacity:0;top:0;content:"";display:block;top:0;position:absolute;padding-top:66.66666%;-webkit-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;right:0;left:0;bottom:0}.template .notice{padding:.6em;background:rgba(0,0,0,.8);color:#fff;font-weight:400;border:none;font-size:13px;text-decoration:none;position:absolute;width:100%;vertical-align:middle;bottom:0;margin:0;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);left:0;right:0;z-index:4;text-align:center;-webkit-border-radius:3px;border-radius:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;-webkit-font-smoothing:antialiased}.template .notice a{color:#f16334}.template .notice p{padding:0;margin:0}#wcf_create_notice{display:none}.preview:focus,.preview:hover{color:#fff;-webkit-box-shadow:none;box-shadow:none}.preview{text-decoration:none;opacity:0;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);left:22%;right:22%;z-index:4;background:#23282d;background:rgba(0,0,0,.7);color:#fff;font-size:13px;text-shadow:0 1px 0 rgba(0,0,0,.6);-webkit-font-smoothing:antialiased;font-weight:600;padding:10px 12px;text-align:center;-webkit-border-radius:3px;border-radius:3px;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out}.template-id-container{font-size:15px;font-weight:600;margin:0;padding:10px;-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:#fff;background:rgba(255,255,255,.65);position:relative}.template-actions{opacity:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;position:absolute;bottom:0;left:0;top:0;padding:5px 5px 0 5px;background:rgba(244,244,244,.7);border-right:1px solid rgba(0,0,0,.05)}.template.importing .preview,.template.importing .template-actions,.template:hover .preview,.template:hover .template-actions,.wcf-step-content .template-actions{opacity:1}.wcf-remote-list .template{position:relative;overflow:hidden}.wcf-remote-list h3{margin-bottom:1em;margin-top:0;font-size:15px;font-weight:600;margin:0;padding:0;text-align:right}.wcf-remote-list img{max-width:100%;vertical-align:middle}.wcf-remote-list *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cartflows-steps-list img{width:100%}#cartflows-steps-list .title{font-weight:700;color:#474747;line-height:2;background:#f7f7f7;padding:.5em 1em}#cartflows-steps-list .image-wrap{-webkit-background-size:cover;background-size:cover;overflow:hidden}#cartflows-steps .close{display:inline-block;padding:2em;cursor:pointer}.template-message-block{text-align:center;margin:0 auto;padding:4em 0}.templator #TB_ajaxContent{width:100%!important}.template-message-block .description{font-style:normal}.template-message-block .spinner{float:none;margin:0}.cartflows-steps-popup{position:fixed;right:0;left:0;top:0;bottom:0;z-index:99999;background:#fff;overflow-y:scroll}.cartflows-steps-popup .notice{max-width:700px;margin:0 auto}.cartflows-load-steps-library .dashicons{height:auto;width:auto;line-height:normal;margin:0 0 0 5px;vertical-align:initial;font-size:100%}.cartflows-load-steps .dashicons{vertical-align:text-bottom}#TB_window{width:100%!important;margin:0 auto!important;text-align:center!important;position:fixed!important;top:0!important;right:0!important;left:0!important;bottom:0!important}#TB_iframeContent{width:100%!important;height:100%!important}@media only screen and (min-device-width :320px) and (max-device-width :1024px){#TB_iframeContent-wrapper{position:fixed;left:0;bottom:50px;right:0;top:0;overflow-y:scroll;-webkit-overflow-scrolling:touch}}#TB_window #TB_ajaxWindowTitle{font-size:1.2rem;display:inline-block;width:auto;padding:0}#TB_window #TB_closeWindowButton{position:relative}.tb-close-icon:before{vertical-align:middle}#TB_window{text-align:center}#TB_iframeContent.tablet{width:768px!important;height:1024px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.tablet.landscape{width:1024px!important}#TB_iframeContent.mobile{width:360px!important;height:640px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.mobile.landscape{width:360px!important}#TB_closeAjaxWindow{float:left}#TB_window.thickbox-loading{margin:0!important}div#TB_window{background-color:#fff}#TB_window #TB_title{color:#0a0c0d;text-align:right;bottom:0;-webkit-box-shadow:none;box-shadow:none;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;padding:1em 1.5em 1em 1em}@media all and (min-width:769px){#TB_window #TB_title{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}}#TB_window.mobile,#TB_window.tablet{overflow-y:scroll}.top #TB_iframeContent-wrapper{bottom:0;top:80px}#TB_window.top #TB_title{top:0}#TB_window #TB_closeWindowButton:focus .tb-close-icon{-webkit-box-shadow:none;box-shadow:none;color:#666}@media all and (max-width:768px){#TB_closeAjaxWindow{padding-left:0}#TB_window #TB_closeWindowButton,#TB_window .tb-close-icon{width:80px}}.responsive-view .dashicons{color:#ddd}.responsive-view .active{color:#111}.responsive-view a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#TB_window.mobile #TB_iframeContent,#TB_window.tablet #TB_iframeContent{margin-bottom:50px;margin-top:50px}.responsive-view a{color:#666;cursor:pointer;display:inline-block;padding:1em;vertical-align:middle;text-decoration:none}#TB_closeAjaxWindow .tb-close-icon{position:relative}.site-loading{display:none;position:absolute;right:50%;top:50%;text-align:center;color:#555;-webkit-transform:translate(50%,-40%);-ms-transform:translate(50%,-40%);transform:translate(50%,-40%)}.top .site-loading{top:50%;-webkit-transform:translate(50%,-50%);-ms-transform:translate(50%,-50%);transform:translate(50%,-50%)}.site-loading h3{font-size:33px;font-weight:600;margin:0 0 .8em 0}.site-loading p{margin:0}.cartflows-thickbox-loading .site-loading{display:block}.cartflows-thickbox-loading #TB_iframeContent,.cartflows-thickbox-loading #TB_iframeContent-wrapper{display:none}.wcf-remote-list:after,.wcf-remote-list:before{content:"";display:table}.wcf-remote-list::after{content:"";display:table;clear:both}.wcf-template-header .filter-count{line-height:normal}#wcf-page-builders{display:none}#wcf-remote-flow-filters>div,#wcf-remote-step-filters>div{display:inline-block}.wcf-template-header .filter-links{margin:0;padding:0}.wcf-template-header li:focus{outline:0}.wcf-template-header .filter-links li{margin:0;display:inline-block}.wcf-template-header .filter-links li a:focus,.wcf-template-header .filter-links li a:hove{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-template-header .filter-links li .current{color:#000;border-bottom:2px solid #f16334;font-weight:600}.wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8}.wcf-search-form{margin-left:2em;padding-left:0;text-align:left;margin-top:1em;margin-bottom:1em;position:relative}.wcf-template-notice{display:none}#wcf-start-from-scratch{text-align:center}#wcf-start-from-scratch .inner{background:0 0;-webkit-box-shadow:none;box-shadow:none;width:94%;margin:0 auto;float:none;position:absolute;top:40%}#wcf-scratch-steps-categories{display:inline-block}#wcf-scratch-steps-categories select{-webkit-border-radius:0;border-radius:0;height:29px;border:1px solid;border-color:#9e9e9e;border-width:1px;-webkit-box-shadow:none;box-shadow:none;padding:2px 6px 2px 2px;line-height:25px;width:155px}#wcf-start-from-scratch .description{margin-bottom:2em}#wcf-remote-step-importer .wcf-search-form{display:none}.wcf-search-form .wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8;background:0 0;border-bottom:1px solid #ccc;font-size:1em}.wcf-search-form .wcf-flow-search-input:focus{-webkit-box-shadow:none;box-shadow:none;border-color:#ccc}.cartflows-preview-flow-steps li{display:inline-block;margin:0 1em;position:relative}.cartflows-flow-import-blank.updating-message:before{vertical-align:text-bottom}#wpwrap .cartflows-step-loading h2,#wpwrap .template-message-block h2{font-size:1.5em;margin:0 0 .5em 0;padding:8px 12px;line-height:1.4}#wpwrap .cartflows-step-loading p,#wpwrap .template-message-block p{font-size:1.2em}#wpwrap .cartflows-step-loading .spinner{vertical-align:initial}.wcf-flow-type{position:absolute;left:0;top:0;padding:3px 10px;color:#fff}.wcf-flow-type.pro{background:#f06262}.wcf-templates-popup-overlay{position:fixed;height:100%;width:100%;top:0;right:0;background:rgba(0,0,0,.7);-webkit-transition:opacity .5s;transition:opacity .5s;visibility:hidden;opacity:0;z-index:9999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:none;transition:none}.wcf-templates-popup-overlay.open{visibility:visible;opacity:1;z-index:9999}.wcf-templates-popup-content{max-width:1200px;background-color:#fff;position:absolute;-webkit-border-radius:3px;border-radius:3px;top:40%;right:50%;-webkit-transform:translate(50%,-35%);-ms-transform:translate(50%,-35%);transform:translate(50%,-35%);width:70%;min-height:450px;overflow:hidden}.wcf-templates-popup-content .inner{background:#fff;position:relative;padding:8px 8px 0 8px;display:block;float:right;margin:15px;text-align:center;-webkit-box-shadow:0 0 5px 1px rgba(204,204,204,.3);box-shadow:0 0 5px 1px rgba(204,204,204,.3)}@media only screen and (max-width:480px){.wcf-templates-popup-content{width:90%}.wcf-template-header{display:block!important;padding:15px 15px 0 15px!important}.wcf-popup-close-wrap{position:absolute;top:10px;left:5px}}@media only screen and (min-width:768px){.wcf-templates-popup-content .inner{width:-webkit-calc(25% - 30px);width:calc(25% - 30px)}}html.wcf-popup-open{overflow:hidden}.wcf-button-wrap{margin-top:0;position:absolute;top:10px;right:110px}.wcf-steps-loading #wcf-remote-step-list{display:none!important}#wcf-remote-content{background-color:#f5f5f5;overflow-y:auto;min-height:450px;max-height:450px;padding:20px 20px 20px 20px;clear:both}#wcf-remote-content #wcf-start-from-scratch h1{font-size:23px;font-weight:400;margin:0 0 1em 0;padding:9px 0 4px;line-height:29px}.wcf-template-list-wrap .template-name{margin:0;text-align:right;font-size:13px}.wcf-template-list-wrap img{width:100%;vertical-align:middle}.wcf-templates-popup-content .template{margin:0;position:relative;overflow:hidden}.wcf-tab.nav-tabs{overflow:hidden;margin:0}.wcf-template-header{-moz-box-align:center;align-items:center;background:#fff;-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);box-shadow:0 0 8px rgba(0,0,0,.2);-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;-moz-box-pack:justify;justify-content:space-between;padding:0 15px;min-height:50px}.wcf-search-form:after{content:"\f179";display:inline-block;font-family:dashicons;text-decoration:inherit;font-weight:400;font-style:normal;text-align:center;-webkit-transition:color .1s ease-in 0;transition:color .1s ease-in 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;left:.5em;top:.5em;color:#81868a}.wcf-template-logo-wrap{font-size:16px;font-weight:600;text-align:center}.wcf-template-logo-wrap .wcf-cartflows-logo-img{vertical-align:middle}.wcf-tab.nav-tabs:before{display:table;content:""}.wcf-tab.nav-tabs:after{clear:both}.wcf-tab.nav-tabs>li{display:inline-block;padding:15px 0;margin:0;font-weight:400}.wcf-tab.nav-tabs>li.active{border-bottom:3px solid #f16334;font-weight:600}.wcf-template-header .filter-links li>a{border-color:transparent;margin:0}.wcf-tab.nav-tabs>li:active,.wcf-tab.nav-tabs>li:focus,.wcf-tab.nav-tabs>li>a:focus,.wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li:focus .wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-tab.nav-tabs>li>a,.wcf-template-header .filter-links>li>a,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{padding:15px;color:#555;text-decoration:none}.wcf-nav-section-content{display:none}.wcf-nav-section-content.active{display:block;overflow:hidden}.wcf-popup-close-wrap{width:35px;text-align:center;border-right:1px #eee solid}.wcf-popup-close-wrap .close-icon{cursor:pointer}.wcf-popup-close-wrap .wcf-cartflow-icons{pointer-events:none;font-size:20px;height:20px;width:20px;line-height:20px;opacity:.7}.wcf-popup-close-wrap .close-icon:hover .wcf-cartflow-icons{opacity:1}.wcf-templates-popup-content .spinner{position:absolute;top:50%;right:50%;bottom:0;left:0;max-width:100%;max-height:100%;-webkit-transform:translate(50%,-50%);-ms-transform:translate(50%,-50%);transform:translate(50%,-50%);z-index:99999}.wcf-templates-popup-content .wcf-template-header .wcf-tab-wrapper{margin:0 auto}#wcf-upcoming-page-builders .description{font-size:1rem;margin:4em 0 0 0;text-align:center}.flow-type-filter-links{display:none}#wcf-remote-filters{padding:0 15px}#wcf-remote-filters a{text-decoration:none}#wcf-remote-filters .filter-links li:focus,#wcf-remote-filters a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-filters .filter-links li a{border-bottom:none}#wcf-remote-filters .filter-links li:first-child a{margin-right:0}#wcf-remote-filters .filter-links li:last-child a{margin-left:0}#wcf-remote-filters .filter-links li .current,#wcf-remote-filters .filter-links li a:focus,#wcf-remote-filters .filter-links li a:hover{color:#f16334}.wrap .wcf-page-builder-notice .notice{margin:5px 15px}#wcf-api-notice-block{text-align:center;margin-top:5em}.wcf-templates-popup-overlay a{-webkit-transition:none;transition:none}.wcf-notice-wrap .notice{display:inline-block}.wcf-learn-how i{font-size:1rem;vertical-align:middle}.wcf-learn-how a{text-decoration:none}#wcf-remote-content .wcf-install-plugin::focus{border-color:none;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-content .wcf-install-plugin.updating-message{background:0 0;padding:0;font-size:1rem;-webkit-box-shadow:none;box-shadow:none;border:none;margin:0 3px 0 0}.wcf-page-builder-message{margin:5em auto 0 auto;width:700px}.wcf-page-builder-message p{font-size:1rem}.wcf-page-builder-message i{font-size:1rem;vertical-align:middle}.wcf-page-builder-message a{text-decoration:none;margin:1.5em 0 0 0}.cartflows-ie .postbox{padding:1em}.cartflows-ie{padding-top:2em;padding-left:2em}.admin_page_flow_exporter .notice,.admin_page_flow_importer .notice{margin:1em 0 0 0}.cartflows-website-unreachable{padding:1em 2em}.wcf-notice-wrap{margin-top:20px;font-size:15px;color:red}.wcf-activate-wc{text-decoration:none}.wcf-activate-wc.button{border:none;-webkit-box-shadow:none;box-shadow:none}.wcf-hidden{display:none}
assets/min-css/import.min.css CHANGED
@@ -1 +1 @@
1
- .no-elementor-notice{border-left:none;background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;padding-left:0}.no-elementor-notice span{color:#f16334;font-size:18px;vertical-align:middle}.site-preview{background:#c5c5c5;display:block;overflow:hidden;position:relative;-webkit-backface-visibility:hidden}.template.importing .site-preview:after,.template:hover .site-preview:after{opacity:.3}.template.importing .site-preview,.template:hover .site-preview{background:#fff;cursor:pointer}.template .site-preview:after{content:"";background:#fff;opacity:0;top:0;content:"";display:block;top:0;position:absolute;padding-top:66.66666%;-webkit-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;left:0;right:0;bottom:0}.template .notice{padding:.6em;background:rgba(0,0,0,.8);color:#fff;font-weight:400;border:none;font-size:13px;text-decoration:none;position:absolute;width:100%;vertical-align:middle;bottom:0;margin:0;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);right:0;left:0;z-index:4;text-align:center;-webkit-border-radius:3px;border-radius:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;-webkit-font-smoothing:antialiased}.template .notice a{color:#f16334}.template .notice p{padding:0;margin:0}#wcf_create_notice{display:none}.preview:focus,.preview:hover{color:#fff;-webkit-box-shadow:none;box-shadow:none}.preview{text-decoration:none;opacity:0;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);right:22%;left:22%;z-index:4;background:#23282d;background:rgba(0,0,0,.7);color:#fff;font-size:13px;text-shadow:0 1px 0 rgba(0,0,0,.6);-webkit-font-smoothing:antialiased;font-weight:600;padding:10px 12px;text-align:center;-webkit-border-radius:3px;border-radius:3px;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out}.template-id-container{font-size:15px;font-weight:600;margin:0;padding:10px;-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:#fff;background:rgba(255,255,255,.65);position:relative}.template-actions{opacity:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;position:absolute;bottom:0;right:0;top:0;padding:5px 5px 0 5px;background:rgba(244,244,244,.7);border-left:1px solid rgba(0,0,0,.05)}.template.importing .preview,.template.importing .template-actions,.template:hover .preview,.template:hover .template-actions,.wcf-step-content .template-actions{opacity:1}.wcf-remote-list .template{position:relative;overflow:hidden}.wcf-remote-list h3{margin-bottom:1em;margin-top:0;font-size:15px;font-weight:600;margin:0;padding:0;text-align:left}.wcf-remote-list img{max-width:100%;vertical-align:middle}.wcf-remote-list *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cartflows-steps-list img{width:100%}#cartflows-steps-list .title{font-weight:700;color:#474747;line-height:2;background:#f7f7f7;padding:.5em 1em}#cartflows-steps-list .image-wrap{-webkit-background-size:cover;background-size:cover;overflow:hidden}#cartflows-steps .close{display:inline-block;padding:2em;cursor:pointer}.template-message-block{text-align:center;margin:0 auto;padding:4em 0}.templator #TB_ajaxContent{width:100%!important}.template-message-block .description{font-style:normal}.template-message-block .spinner{float:none;margin:0}.cartflows-steps-popup{position:fixed;left:0;right:0;top:0;bottom:0;z-index:99999;background:#fff;overflow-y:scroll}.cartflows-steps-popup .notice{max-width:700px;margin:0 auto}.cartflows-load-steps-library .dashicons{height:auto;width:auto;line-height:normal;margin:0 5px 0 0;vertical-align:initial;font-size:100%}.cartflows-load-steps .dashicons{vertical-align:text-bottom}#TB_window{width:100%!important;margin:0 auto!important;text-align:center!important;position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important}#TB_iframeContent{width:100%!important;height:100%!important}@media only screen and (min-device-width :320px) and (max-device-width :1024px){#TB_iframeContent-wrapper{position:fixed;right:0;bottom:50px;left:0;top:0;overflow-y:scroll;-webkit-overflow-scrolling:touch}}#TB_window #TB_ajaxWindowTitle{font-size:1.2rem;display:inline-block;width:auto;padding:0}#TB_window #TB_closeWindowButton{position:relative}.tb-close-icon:before{vertical-align:middle}#TB_window{text-align:center}#TB_iframeContent.tablet{width:768px!important;height:1024px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.tablet.landscape{width:1024px!important}#TB_iframeContent.mobile{width:360px!important;height:640px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.mobile.landscape{width:360px!important}#TB_closeAjaxWindow{float:right}#TB_window.thickbox-loading{margin:0!important}div#TB_window{background-color:#fff}#TB_window #TB_title{color:#0a0c0d;text-align:left;bottom:0;-webkit-box-shadow:none;box-shadow:none;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;padding:1em 1em 1em 1.5em}@media all and (min-width:769px){#TB_window #TB_title{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}}#TB_window.mobile,#TB_window.tablet{overflow-y:scroll}.top #TB_iframeContent-wrapper{bottom:0;top:80px}#TB_window.top #TB_title{top:0}#TB_window #TB_closeWindowButton:focus .tb-close-icon{-webkit-box-shadow:none;box-shadow:none;color:#666}@media all and (max-width:768px){#TB_closeAjaxWindow{padding-right:0}#TB_window #TB_closeWindowButton,#TB_window .tb-close-icon{width:80px}}.responsive-view .dashicons{color:#ddd}.responsive-view .active{color:#111}.responsive-view a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#TB_window.mobile #TB_iframeContent,#TB_window.tablet #TB_iframeContent{margin-bottom:50px;margin-top:50px}.responsive-view a{color:#666;cursor:pointer;display:inline-block;padding:1em;vertical-align:middle;text-decoration:none}#TB_closeAjaxWindow .tb-close-icon{position:relative}.site-loading{display:none;position:absolute;left:50%;top:50%;text-align:center;color:#555;-webkit-transform:translate(-50%,-40%);-ms-transform:translate(-50%,-40%);transform:translate(-50%,-40%)}.top .site-loading{top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.site-loading h3{font-size:33px;font-weight:600;margin:0 0 .8em 0}.site-loading p{margin:0}.cartflows-thickbox-loading .site-loading{display:block}.cartflows-thickbox-loading #TB_iframeContent,.cartflows-thickbox-loading #TB_iframeContent-wrapper{display:none}.wcf-remote-list:after,.wcf-remote-list:before{content:"";display:table}.wcf-remote-list::after{content:"";display:table;clear:both}.wcf-template-header .filter-count{line-height:normal}#wcf-page-builders{display:none}#wcf-remote-flow-filters>div,#wcf-remote-step-filters>div{display:inline-block}.wcf-template-header .filter-links{margin:0;padding:0}.wcf-template-header li:focus{outline:0}.wcf-template-header .filter-links li{margin:0;display:inline-block}.wcf-template-header .filter-links li a:focus,.wcf-template-header .filter-links li a:hove{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-template-header .filter-links li .current{color:#000;border-bottom:2px solid #f16334;font-weight:600}.wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8}.wcf-search-form{margin-right:2em;padding-right:0;text-align:right;margin-top:1em;margin-bottom:1em;position:relative}.wcf-template-notice{display:none}#wcf-start-from-scratch{text-align:center}#wcf-start-from-scratch .inner{background:0 0;-webkit-box-shadow:none;box-shadow:none;width:94%;margin:0 auto;float:none;position:absolute;top:40%}#wcf-scratch-steps-categories{display:inline-block}#wcf-scratch-steps-categories select{-webkit-border-radius:0;border-radius:0;height:29px;border:1px solid;border-color:#9e9e9e;border-width:1px;-webkit-box-shadow:none;box-shadow:none;padding:2px;line-height:29px}#wcf-start-from-scratch .description{margin-bottom:2em}#wcf-remote-step-importer .wcf-search-form{display:none}.wcf-search-form .wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8;background:0 0;border-bottom:1px solid #ccc;font-size:1em}.wcf-search-form .wcf-flow-search-input:focus{-webkit-box-shadow:none;box-shadow:none;border-color:#ccc}.cartflows-preview-flow-steps li{display:inline-block;margin:0 1em;position:relative}.cartflows-flow-import-blank.updating-message:before{vertical-align:text-bottom}#wpwrap .cartflows-step-loading h2,#wpwrap .template-message-block h2{font-size:1.5em;margin:0 0 .5em 0;padding:8px 12px;line-height:1.4}#wpwrap .cartflows-step-loading p,#wpwrap .template-message-block p{font-size:1.2em}#wpwrap .cartflows-step-loading .spinner{vertical-align:initial}.wcf-flow-type{position:absolute;right:0;top:0;padding:3px 10px;color:#fff}.wcf-flow-type.pro{background:#f06262}.wcf-templates-popup-overlay{position:fixed;height:100%;width:100%;top:0;left:0;background:rgba(0,0,0,.7);-webkit-transition:opacity .5s;transition:opacity .5s;visibility:hidden;opacity:0;z-index:9999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:none;transition:none}.wcf-templates-popup-overlay.open{visibility:visible;opacity:1;z-index:9999}.wcf-templates-popup-content{max-width:1200px;background-color:#fff;position:absolute;-webkit-border-radius:3px;border-radius:3px;top:40%;left:50%;-webkit-transform:translate(-50%,-35%);-ms-transform:translate(-50%,-35%);transform:translate(-50%,-35%);width:70%;min-height:450px;overflow:hidden}.wcf-templates-popup-content .inner{background:#fff;position:relative;padding:8px 8px 0 8px;display:block;float:left;margin:15px;text-align:center;-webkit-box-shadow:0 0 5px 1px rgba(204,204,204,.3);box-shadow:0 0 5px 1px rgba(204,204,204,.3)}@media only screen and (max-width:480px){.wcf-templates-popup-content{width:90%}.wcf-template-header{display:block!important;padding:15px 15px 0 15px!important}.wcf-popup-close-wrap{position:absolute;top:10px;right:5px}}@media only screen and (min-width:768px){.wcf-templates-popup-content .inner{width:-webkit-calc(25% - 30px);width:calc(25% - 30px)}}html.wcf-popup-open{overflow:hidden}.wcf-button-wrap{margin-top:0;position:absolute;top:10px;left:110px}.wcf-steps-loading #wcf-remote-step-list{display:none!important}#wcf-remote-content{background-color:#f5f5f5;overflow-y:auto;min-height:450px;max-height:450px;padding:20px 20px 20px 20px;clear:both}#wcf-remote-content #wcf-start-from-scratch h1{font-size:23px;font-weight:400;margin:0 0 1em 0;padding:9px 0 4px;line-height:29px}.wcf-template-list-wrap .template-name{margin:0;text-align:left;font-size:13px}.wcf-template-list-wrap img{width:100%;vertical-align:middle}.wcf-templates-popup-content .template{margin:0;position:relative;overflow:hidden}.wcf-tab.nav-tabs{overflow:hidden;margin:0}.wcf-template-header{-moz-box-align:center;align-items:center;background:#fff;-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);box-shadow:0 0 8px rgba(0,0,0,.2);-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;-moz-box-pack:justify;justify-content:space-between;padding:0 15px;min-height:50px}.wcf-search-form:after{content:"\f179";display:inline-block;font-family:dashicons;text-decoration:inherit;font-weight:400;font-style:normal;text-align:center;-webkit-transition:color .1s ease-in 0;transition:color .1s ease-in 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;right:.5em;top:.5em;color:#81868a}.wcf-template-logo-wrap{font-size:16px;font-weight:600;text-align:center}.wcf-template-logo-wrap .wcf-cartflows-logo-img{vertical-align:middle}.wcf-tab.nav-tabs:before{display:table;content:""}.wcf-tab.nav-tabs:after{clear:both}.wcf-tab.nav-tabs>li{display:inline-block;padding:15px 0;margin:0;font-weight:400}.wcf-tab.nav-tabs>li.active{border-bottom:3px solid #f16334;font-weight:600}.wcf-template-header .filter-links li>a{border-color:transparent;margin:0}.wcf-tab.nav-tabs>li:active,.wcf-tab.nav-tabs>li:focus,.wcf-tab.nav-tabs>li>a:focus,.wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li:focus .wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-tab.nav-tabs>li>a,.wcf-template-header .filter-links>li>a,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{padding:15px;color:#555;text-decoration:none}.wcf-nav-section-content{display:none}.wcf-nav-section-content.active{display:block;overflow:hidden}.wcf-popup-close-wrap{width:35px;text-align:center;border-left:1px #eee solid}.wcf-popup-close-wrap .close-icon{cursor:pointer}.wcf-popup-close-wrap .wcf-cartflow-icons{pointer-events:none;font-size:20px;height:20px;width:20px;line-height:20px;opacity:.7}.wcf-popup-close-wrap .close-icon:hover .wcf-cartflow-icons{opacity:1}.wcf-templates-popup-content .spinner{position:absolute;top:50%;left:50%;bottom:0;right:0;max-width:100%;max-height:100%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:99999}.wcf-templates-popup-content .wcf-template-header .wcf-tab-wrapper{margin:0 auto}#wcf-upcoming-page-builders .description{font-size:1rem;margin:4em 0 0 0;text-align:center}.flow-type-filter-links{display:none}#wcf-remote-filters{padding:0 15px}#wcf-remote-filters a{text-decoration:none}#wcf-remote-filters .filter-links li:focus,#wcf-remote-filters a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-filters .filter-links li a{border-bottom:none}#wcf-remote-filters .filter-links li:first-child a{margin-left:0}#wcf-remote-filters .filter-links li:last-child a{margin-right:0}#wcf-remote-filters .filter-links li .current,#wcf-remote-filters .filter-links li a:focus,#wcf-remote-filters .filter-links li a:hover{color:#f16334}.wrap .wcf-page-builder-notice .notice{margin:5px 15px}#wcf-api-notice-block{text-align:center;margin-top:5em}.wcf-templates-popup-overlay a{-webkit-transition:none;transition:none}.wcf-notice-wrap .notice{display:inline-block}.wcf-learn-how i{font-size:1rem;vertical-align:middle}.wcf-learn-how a{text-decoration:none}#wcf-remote-content .wcf-install-plugin::focus{border-color:none;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-content .wcf-install-plugin.updating-message{background:0 0;padding:0;font-size:1rem;-webkit-box-shadow:none;box-shadow:none;border:none;margin:0 0 0 3px}.wcf-page-builder-message{margin:5em auto 0 auto;width:700px}.wcf-page-builder-message p{font-size:1rem}.wcf-page-builder-message i{font-size:1rem;vertical-align:middle}.wcf-page-builder-message a{text-decoration:none;margin:1.5em 0 0 0}.cartflows-ie .postbox{padding:1em}.cartflows-ie{padding-top:2em;padding-right:2em}.admin_page_flow_exporter .notice,.admin_page_flow_importer .notice{margin:1em 0 0 0}.cartflows-website-unreachable{padding:1em 2em}.wcf-notice-wrap{margin-top:20px;font-size:15px;color:red}.wcf-activate-wc{text-decoration:none}.wcf-activate-wc.button{border:none;-webkit-box-shadow:none;box-shadow:none}.wcf-hidden{display:none}
1
+ .no-elementor-notice{border-left:none;background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;padding-left:0}.no-elementor-notice span{color:#f16334;font-size:18px;vertical-align:middle}.site-preview{background:#c5c5c5;display:block;overflow:hidden;position:relative;-webkit-backface-visibility:hidden}.template.importing .site-preview:after,.template:hover .site-preview:after{opacity:.3}.template.importing .site-preview,.template:hover .site-preview{background:#fff;cursor:pointer}.template .site-preview:after{content:"";background:#fff;opacity:0;top:0;content:"";display:block;top:0;position:absolute;padding-top:66.66666%;-webkit-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;left:0;right:0;bottom:0}.template .notice{padding:.6em;background:rgba(0,0,0,.8);color:#fff;font-weight:400;border:none;font-size:13px;text-decoration:none;position:absolute;width:100%;vertical-align:middle;bottom:0;margin:0;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);right:0;left:0;z-index:4;text-align:center;-webkit-border-radius:3px;border-radius:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;-webkit-font-smoothing:antialiased}.template .notice a{color:#f16334}.template .notice p{padding:0;margin:0}#wcf_create_notice{display:none}.preview:focus,.preview:hover{color:#fff;-webkit-box-shadow:none;box-shadow:none}.preview{text-decoration:none;opacity:0;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);right:22%;left:22%;z-index:4;background:#23282d;background:rgba(0,0,0,.7);color:#fff;font-size:13px;text-shadow:0 1px 0 rgba(0,0,0,.6);-webkit-font-smoothing:antialiased;font-weight:600;padding:10px 12px;text-align:center;-webkit-border-radius:3px;border-radius:3px;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out}.template-id-container{font-size:15px;font-weight:600;margin:0;padding:10px;-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:#fff;background:rgba(255,255,255,.65);position:relative}.template-actions{opacity:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;position:absolute;bottom:0;right:0;top:0;padding:5px 5px 0 5px;background:rgba(244,244,244,.7);border-left:1px solid rgba(0,0,0,.05)}.template.importing .preview,.template.importing .template-actions,.template:hover .preview,.template:hover .template-actions,.wcf-step-content .template-actions{opacity:1}.wcf-remote-list .template{position:relative;overflow:hidden}.wcf-remote-list h3{margin-bottom:1em;margin-top:0;font-size:15px;font-weight:600;margin:0;padding:0;text-align:left}.wcf-remote-list img{max-width:100%;vertical-align:middle}.wcf-remote-list *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cartflows-steps-list img{width:100%}#cartflows-steps-list .title{font-weight:700;color:#474747;line-height:2;background:#f7f7f7;padding:.5em 1em}#cartflows-steps-list .image-wrap{-webkit-background-size:cover;background-size:cover;overflow:hidden}#cartflows-steps .close{display:inline-block;padding:2em;cursor:pointer}.template-message-block{text-align:center;margin:0 auto;padding:4em 0}.templator #TB_ajaxContent{width:100%!important}.template-message-block .description{font-style:normal}.template-message-block .spinner{float:none;margin:0}.cartflows-steps-popup{position:fixed;left:0;right:0;top:0;bottom:0;z-index:99999;background:#fff;overflow-y:scroll}.cartflows-steps-popup .notice{max-width:700px;margin:0 auto}.cartflows-load-steps-library .dashicons{height:auto;width:auto;line-height:normal;margin:0 5px 0 0;vertical-align:initial;font-size:100%}.cartflows-load-steps .dashicons{vertical-align:text-bottom}#TB_window{width:100%!important;margin:0 auto!important;text-align:center!important;position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important}#TB_iframeContent{width:100%!important;height:100%!important}@media only screen and (min-device-width :320px) and (max-device-width :1024px){#TB_iframeContent-wrapper{position:fixed;right:0;bottom:50px;left:0;top:0;overflow-y:scroll;-webkit-overflow-scrolling:touch}}#TB_window #TB_ajaxWindowTitle{font-size:1.2rem;display:inline-block;width:auto;padding:0}#TB_window #TB_closeWindowButton{position:relative}.tb-close-icon:before{vertical-align:middle}#TB_window{text-align:center}#TB_iframeContent.tablet{width:768px!important;height:1024px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.tablet.landscape{width:1024px!important}#TB_iframeContent.mobile{width:360px!important;height:640px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.mobile.landscape{width:360px!important}#TB_closeAjaxWindow{float:right}#TB_window.thickbox-loading{margin:0!important}div#TB_window{background-color:#fff}#TB_window #TB_title{color:#0a0c0d;text-align:left;bottom:0;-webkit-box-shadow:none;box-shadow:none;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;padding:1em 1em 1em 1.5em}@media all and (min-width:769px){#TB_window #TB_title{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}}#TB_window.mobile,#TB_window.tablet{overflow-y:scroll}.top #TB_iframeContent-wrapper{bottom:0;top:80px}#TB_window.top #TB_title{top:0}#TB_window #TB_closeWindowButton:focus .tb-close-icon{-webkit-box-shadow:none;box-shadow:none;color:#666}@media all and (max-width:768px){#TB_closeAjaxWindow{padding-right:0}#TB_window #TB_closeWindowButton,#TB_window .tb-close-icon{width:80px}}.responsive-view .dashicons{color:#ddd}.responsive-view .active{color:#111}.responsive-view a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#TB_window.mobile #TB_iframeContent,#TB_window.tablet #TB_iframeContent{margin-bottom:50px;margin-top:50px}.responsive-view a{color:#666;cursor:pointer;display:inline-block;padding:1em;vertical-align:middle;text-decoration:none}#TB_closeAjaxWindow .tb-close-icon{position:relative}.site-loading{display:none;position:absolute;left:50%;top:50%;text-align:center;color:#555;-webkit-transform:translate(-50%,-40%);-ms-transform:translate(-50%,-40%);transform:translate(-50%,-40%)}.top .site-loading{top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.site-loading h3{font-size:33px;font-weight:600;margin:0 0 .8em 0}.site-loading p{margin:0}.cartflows-thickbox-loading .site-loading{display:block}.cartflows-thickbox-loading #TB_iframeContent,.cartflows-thickbox-loading #TB_iframeContent-wrapper{display:none}.wcf-remote-list:after,.wcf-remote-list:before{content:"";display:table}.wcf-remote-list::after{content:"";display:table;clear:both}.wcf-template-header .filter-count{line-height:normal}#wcf-page-builders{display:none}#wcf-remote-flow-filters>div,#wcf-remote-step-filters>div{display:inline-block}.wcf-template-header .filter-links{margin:0;padding:0}.wcf-template-header li:focus{outline:0}.wcf-template-header .filter-links li{margin:0;display:inline-block}.wcf-template-header .filter-links li a:focus,.wcf-template-header .filter-links li a:hove{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-template-header .filter-links li .current{color:#000;border-bottom:2px solid #f16334;font-weight:600}.wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8}.wcf-search-form{margin-right:2em;padding-right:0;text-align:right;margin-top:1em;margin-bottom:1em;position:relative}.wcf-template-notice{display:none}#wcf-start-from-scratch{text-align:center}#wcf-start-from-scratch .inner{background:0 0;-webkit-box-shadow:none;box-shadow:none;width:94%;margin:0 auto;float:none;position:absolute;top:40%}#wcf-scratch-steps-categories{display:inline-block}#wcf-scratch-steps-categories select{-webkit-border-radius:0;border-radius:0;height:29px;border:1px solid;border-color:#9e9e9e;border-width:1px;-webkit-box-shadow:none;box-shadow:none;padding:2px 2px 2px 6px;line-height:25px;width:155px}#wcf-start-from-scratch .description{margin-bottom:2em}#wcf-remote-step-importer .wcf-search-form{display:none}.wcf-search-form .wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8;background:0 0;border-bottom:1px solid #ccc;font-size:1em}.wcf-search-form .wcf-flow-search-input:focus{-webkit-box-shadow:none;box-shadow:none;border-color:#ccc}.cartflows-preview-flow-steps li{display:inline-block;margin:0 1em;position:relative}.cartflows-flow-import-blank.updating-message:before{vertical-align:text-bottom}#wpwrap .cartflows-step-loading h2,#wpwrap .template-message-block h2{font-size:1.5em;margin:0 0 .5em 0;padding:8px 12px;line-height:1.4}#wpwrap .cartflows-step-loading p,#wpwrap .template-message-block p{font-size:1.2em}#wpwrap .cartflows-step-loading .spinner{vertical-align:initial}.wcf-flow-type{position:absolute;right:0;top:0;padding:3px 10px;color:#fff}.wcf-flow-type.pro{background:#f06262}.wcf-templates-popup-overlay{position:fixed;height:100%;width:100%;top:0;left:0;background:rgba(0,0,0,.7);-webkit-transition:opacity .5s;transition:opacity .5s;visibility:hidden;opacity:0;z-index:9999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:none;transition:none}.wcf-templates-popup-overlay.open{visibility:visible;opacity:1;z-index:9999}.wcf-templates-popup-content{max-width:1200px;background-color:#fff;position:absolute;-webkit-border-radius:3px;border-radius:3px;top:40%;left:50%;-webkit-transform:translate(-50%,-35%);-ms-transform:translate(-50%,-35%);transform:translate(-50%,-35%);width:70%;min-height:450px;overflow:hidden}.wcf-templates-popup-content .inner{background:#fff;position:relative;padding:8px 8px 0 8px;display:block;float:left;margin:15px;text-align:center;-webkit-box-shadow:0 0 5px 1px rgba(204,204,204,.3);box-shadow:0 0 5px 1px rgba(204,204,204,.3)}@media only screen and (max-width:480px){.wcf-templates-popup-content{width:90%}.wcf-template-header{display:block!important;padding:15px 15px 0 15px!important}.wcf-popup-close-wrap{position:absolute;top:10px;right:5px}}@media only screen and (min-width:768px){.wcf-templates-popup-content .inner{width:-webkit-calc(25% - 30px);width:calc(25% - 30px)}}html.wcf-popup-open{overflow:hidden}.wcf-button-wrap{margin-top:0;position:absolute;top:10px;left:110px}.wcf-steps-loading #wcf-remote-step-list{display:none!important}#wcf-remote-content{background-color:#f5f5f5;overflow-y:auto;min-height:450px;max-height:450px;padding:20px 20px 20px 20px;clear:both}#wcf-remote-content #wcf-start-from-scratch h1{font-size:23px;font-weight:400;margin:0 0 1em 0;padding:9px 0 4px;line-height:29px}.wcf-template-list-wrap .template-name{margin:0;text-align:left;font-size:13px}.wcf-template-list-wrap img{width:100%;vertical-align:middle}.wcf-templates-popup-content .template{margin:0;position:relative;overflow:hidden}.wcf-tab.nav-tabs{overflow:hidden;margin:0}.wcf-template-header{-moz-box-align:center;align-items:center;background:#fff;-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);box-shadow:0 0 8px rgba(0,0,0,.2);-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;-moz-box-pack:justify;justify-content:space-between;padding:0 15px;min-height:50px}.wcf-search-form:after{content:"\f179";display:inline-block;font-family:dashicons;text-decoration:inherit;font-weight:400;font-style:normal;text-align:center;-webkit-transition:color .1s ease-in 0;transition:color .1s ease-in 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;right:.5em;top:.5em;color:#81868a}.wcf-template-logo-wrap{font-size:16px;font-weight:600;text-align:center}.wcf-template-logo-wrap .wcf-cartflows-logo-img{vertical-align:middle}.wcf-tab.nav-tabs:before{display:table;content:""}.wcf-tab.nav-tabs:after{clear:both}.wcf-tab.nav-tabs>li{display:inline-block;padding:15px 0;margin:0;font-weight:400}.wcf-tab.nav-tabs>li.active{border-bottom:3px solid #f16334;font-weight:600}.wcf-template-header .filter-links li>a{border-color:transparent;margin:0}.wcf-tab.nav-tabs>li:active,.wcf-tab.nav-tabs>li:focus,.wcf-tab.nav-tabs>li>a:focus,.wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li:focus .wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-tab.nav-tabs>li>a,.wcf-template-header .filter-links>li>a,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{padding:15px;color:#555;text-decoration:none}.wcf-nav-section-content{display:none}.wcf-nav-section-content.active{display:block;overflow:hidden}.wcf-popup-close-wrap{width:35px;text-align:center;border-left:1px #eee solid}.wcf-popup-close-wrap .close-icon{cursor:pointer}.wcf-popup-close-wrap .wcf-cartflow-icons{pointer-events:none;font-size:20px;height:20px;width:20px;line-height:20px;opacity:.7}.wcf-popup-close-wrap .close-icon:hover .wcf-cartflow-icons{opacity:1}.wcf-templates-popup-content .spinner{position:absolute;top:50%;left:50%;bottom:0;right:0;max-width:100%;max-height:100%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:99999}.wcf-templates-popup-content .wcf-template-header .wcf-tab-wrapper{margin:0 auto}#wcf-upcoming-page-builders .description{font-size:1rem;margin:4em 0 0 0;text-align:center}.flow-type-filter-links{display:none}#wcf-remote-filters{padding:0 15px}#wcf-remote-filters a{text-decoration:none}#wcf-remote-filters .filter-links li:focus,#wcf-remote-filters a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-filters .filter-links li a{border-bottom:none}#wcf-remote-filters .filter-links li:first-child a{margin-left:0}#wcf-remote-filters .filter-links li:last-child a{margin-right:0}#wcf-remote-filters .filter-links li .current,#wcf-remote-filters .filter-links li a:focus,#wcf-remote-filters .filter-links li a:hover{color:#f16334}.wrap .wcf-page-builder-notice .notice{margin:5px 15px}#wcf-api-notice-block{text-align:center;margin-top:5em}.wcf-templates-popup-overlay a{-webkit-transition:none;transition:none}.wcf-notice-wrap .notice{display:inline-block}.wcf-learn-how i{font-size:1rem;vertical-align:middle}.wcf-learn-how a{text-decoration:none}#wcf-remote-content .wcf-install-plugin::focus{border-color:none;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-content .wcf-install-plugin.updating-message{background:0 0;padding:0;font-size:1rem;-webkit-box-shadow:none;box-shadow:none;border:none;margin:0 0 0 3px}.wcf-page-builder-message{margin:5em auto 0 auto;width:700px}.wcf-page-builder-message p{font-size:1rem}.wcf-page-builder-message i{font-size:1rem;vertical-align:middle}.wcf-page-builder-message a{text-decoration:none;margin:1.5em 0 0 0}.cartflows-ie .postbox{padding:1em}.cartflows-ie{padding-top:2em;padding-right:2em}.admin_page_flow_exporter .notice,.admin_page_flow_importer .notice{margin:1em 0 0 0}.cartflows-website-unreachable{padding:1em 2em}.wcf-notice-wrap{margin-top:20px;font-size:15px;color:red}.wcf-activate-wc{text-decoration:none}.wcf-activate-wc.button{border:none;-webkit-box-shadow:none;box-shadow:none}.wcf-hidden{display:none}
assets/min-css/optin-template-rtl.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .elementor-editor-active .wcf-optin-form .woocommerce #order_review #payment #place_order{pointer-events:none!important}.cartflows-container .wcf-optin-form,.cartflows-container .wcf-optin-form *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wcf-optin-form .wc-backward{display:none!important}.wcf-optin-form .woocommerce form .form-row-first,.wcf-optin-form .woocommerce form .form-row-last{width:50%;display:block}.wcf-optin-form .woocommerce form .form-row-full{width:100%;clear:both}.wcf-optin-form form .form-row-wide{width:100%}.wcf-optin-form .woocommerce form .form-row-first,.woocommerce-page form .form-row-first{float:right;clear:right}.wcf-optin-form .woocommerce form .form-row-last,.woocommerce-page form .form-row-last{float:left;clear:left}.wcf-optin-form .woocommerce form .form-row .required{color:red;font-weight:700;border:0!important;text-decoration:none}.wcf-optin-form form .form-row-first.form-row-one{clear:both}.wcf-optin-form .woocommerce form.woocommerce-form-login{display:none}.wcf-optin-form .woocommerce .blockUI.blockOverlay{font-size:15px}.wcf-optin-form .woocommerce form .form-row.woocommerce-invalid .select2-container,.wcf-optin-form .woocommerce form .form-row.woocommerce-invalid input.input-text,.wcf-optin-form .woocommerce form .form-row.woocommerce-invalid select{border-width:1px;border-color:#e2401c}.wcf-optin-form .woocommerce form .form-row.woocommerce-validated .select2-container,.wcf-optin-form .woocommerce form .form-row.woocommerce-validated input.input-text,.wcf-optin-form .woocommerce form .form-row.woocommerce-validated select{border-width:1px}.wcf-optin-form .select2-container--default.field-required .select2-selection--single,.wcf-optin-form .woocommerce #order_review .input-text.field-required,.wcf-optin-form .woocommerce form .form-row input.input-text.field-required,.wcf-optin-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c}.wcf-optin-form .woocommerce form .form-row input.field-validated{border-right-width:2px;border-right-color:#69bf29}.wcf-optin-form .woocommerce #payment [type=radio]:checked+label,.wcf-optin-form .woocommerce #payment [type=radio]:not(:checked)+label{padding:0}.wcf-optin-form .woocommerce #payment input[type=radio]{-webkit-border-radius:50%;border-radius:50%;margin-left:4px;line-height:10px}.wcf-optin-form .woocommerce #payment input[type=checkbox]:checked:before,.wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]:checked:before,.wcf-optin-form .woocommerce .woocommerce-billing-fields [type=checkbox]:checked:before,.wcf-optin-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{content:"\e600";margin:0;color:#f16334}.wcf-optin-form .woocommerce #payment input[type=checkbox],.wcf-optin-form .woocommerce #payment input[type=radio],.wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox],.wcf-optin-form .woocommerce .woocommerce-billing-fields [type=checkbox],.wcf-optin-form .woocommerce .woocommerce-shipping-fields [type=checkbox]{border:1px solid #b4b9be;background:#fff;color:#555;clear:none;cursor:pointer;display:inline-block;line-height:0;height:16px;margin:-4px 0 0 4px;outline:0;padding:0!important;text-align:center;vertical-align:middle;width:16px;min-width:16px;-webkit-appearance:none;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-webkit-transition:.05s border-color ease-in-out;transition:.05s border-color ease-in-out}.wcf-optin-form .woocommerce #payment input[type=checkbox]:focus,.wcf-optin-form .woocommerce #payment input[type=radio]:focus,.wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]:focus,.wcf-optin-form .woocommerce .woocommerce-billing-fields [type=checkbox]:focus,.wcf-optin-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:focus{border-color:#f16334;-webkit-box-shadow:0 0 2px rgba(241,99,52,.8);box-shadow:0 0 2px rgba(241,99,52,.8)}.wcf-optin-form .woocommerce #payment input[type=radio]:checked:before{background-color:#f16334;-webkit-border-radius:50px;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:16px;margin:4px;text-indent:-9999px;width:6px}.wcf-optin-form .woocommerce #payment input[type=checkbox]:checked:before,.wcf-optin-form .woocommerce #payment input[type=radio]:checked:before,.wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]:before,.wcf-optin-form .woocommerce .woocommerce-billing-fields [type=checkbox]:checked:before,.wcf-optin-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{display:inline-block;float:right;font:normal 15px/1 cartflows-icon;speak:none;vertical-align:middle;width:6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wcf-optin-form .woocommerce-checkout #payment ul.payment_methods li input[type=checkbox]{min-width:16px}.wcf-optin-form .woocommerce .col2-set .col-1,.wcf-optin-form .woocommerce .col2-set .col-2,.wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-1,.wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-2{float:none;width:100%;max-width:100%;padding:0;-webkit-border-radius:0;border-radius:0;border:none;border-color:none;margin-bottom:0}.wcf-optin-form #order_review_heading,.wcf-optin-form .woocommerce #ship-to-different-address,.wcf-optin-form .woocommerce-additional-fields>h3,.wcf-optin-form .woocommerce-billing-fields>h3{display:none}.wcf-optin-form .woocommerce-checkout #payment{background:unset;-webkit-border-radius:0;border-radius:0}.wcf-optin-form .woocommerce-checkout #payment .form-row{margin:0;padding:0}.wcf-optin-form .woocommerce-checkout #payment .form-row label.checkbox{display:block;margin-bottom:1.1em}.wcf-optin-form .woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:none;margin-right:10px}.wcf-optin-form .woocommerce-checkout #payment div.payment_box .form-row{margin:0 0 .5em}.wcf-optin-form .woocommerce-checkout #payment fieldset .form-row .wcf-optin-form .woocommerce-checkout #payment fieldset p{margin-bottom:10px}.wcf-optin-form .woocommerce-checkout #payment div.payment_box{background-color:#eaeaea;font-family:inherit;font-weight:inherit;margin-bottom:.5em}.wcf-optin-form #add_payment_method #payment div.payment_box::before,.wcf-optin-form .woocommerce-cart #payment div.payment_box::before,.wcf-optin-form .woocommerce-checkout #payment div.payment_box::before{content:'';display:block;border:1em solid;border-left-color:transparent;border-right-color:transparent;border-top-color:transparent;border-bottom-color:#eaeaea;position:absolute;top:-.75em;right:0;margin:-1em 2em 0 0}.wcf-optin-form .select2-container--default .select2-selection--single{display:block;width:100%;min-height:34px;height:auto;padding:11px 12px;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;outline:0}.wcf-optin-form .select2-container--default .select2-selection--single .select2-selection__rendered{color:#666;line-height:26px;min-height:26px;overflow:visible;padding-right:0}.select2-results__option[data-selected],.wcf-optin-form .select2-results__option[aria-selected]{font-size:14px}.wcf-optin-form .select2-container--default .select2-selection--single .select2-selection__arrow{height:100%}.select2-dropdown{border:1px solid #d4d4d4}.wcf-optin-form .woocommerce #order_review .input-text,.wcf-optin-form .woocommerce form .form-row input.input-text,.wcf-optin-form .woocommerce form .form-row select,.wcf-optin-form .woocommerce form .form-row textarea{display:block;width:100%;min-height:34px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;height:auto}.wcf-optin-form #order_review{padding:0;width:100%}.wcf-optin-form .select2-container--open,.wcf-optin-form input[type=email]:focus,.wcf-optin-form input[type=password]:focus,.wcf-optin-form input[type=tel]:focus,.wcf-optin-form input[type=text]:focus,.wcf-optin-form textarea:focus{border-color:#b3b3b3;-webkit-box-shadow:none;box-shadow:none;outline:0}.wcf-optin-form button:focus{outline:0;outline-color:none;outline-style:none;outline-width:none}.wcf-optin-form .woocommerce form.woocommerce-form-login .form-row button,.wcf-optin-form form.checkout_coupon .button{display:block;clear:both;border:none;font-size:15px;font-family:inherit;font-weight:inherit;background-color:#f16334;line-height:9px;padding:18px;margin-bottom:10px;width:100%}.wcf-optin-form .woocommerce #order_review #payment button{float:none;margin:0 auto;display:block}.wcf-optin-form .woocommerce #order_review button{border:1px solid;border-color:#f16334;background-color:#f16334;font-family:inherit;font-weight:inherit;font-size:18px;letter-spacing:.5px;width:100%;padding:16px 24px;font-size:16px;line-height:1.5;-webkit-border-radius:3px;border-radius:3px;color:#fff}.wcf-optin-form .woocommerce #order_review button.wcf-btn-small{padding:8px 6px;background-color:#c8c8c8;border:1px #c8c8c8 solid}.wcf-optin-form .woocommerce #order_review button.wcf-btn-small:hover{border-color:#f16334;background-color:#f16334}.wcf-optin-form .woocommerce #payment #place_order:hover{background-color:#f16334;border-color:#f16334;color:#fff}.wcf-optin-form .woocommerce-additional-fields,.wcf-optin-form .woocommerce-form-coupon-toggle,.wcf-optin-form table.shop_table.woocommerce-checkout-review-order-table{display:none!important}.wcf-optin-form .woocommerce-checkout{display:inline-block;text-align:inherit;width:100%}.wcf-optin-form .woocommerce-checkout .wcf-col2-set{display:block;width:100%;float:none;margin:10px 0 0 0;padding:0}.wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{margin:0 -7px;-ms-flex-wrap:wrap;flex-wrap:wrap;-js-display:flex;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flex;display:-webkit-flex;flex-wrap:wrap;-webkit-flex-wrap:wrap}.wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper{margin:0 -7px}.wcf-optin-form .woocommerce form .form-row{display:block;margin-bottom:1.1em;padding:3px 7px;position:relative}.wcf-optin-form .woocommerce form .woocommerce-account-fields{display:none}.wcf-optin-form .woocommerce form .woocommerce-account-fields .form-row{padding:0}.wcf-optin-form .woocommerce form.woocommerce-form-login .form-row label,.wcf-optin-form .woocommerce-checkout .form-row label{font-size:13px;line-height:1em;letter-spacing:.3px;font-family:inherit;font-weight:inherit;margin-bottom:8px}.wcf-optin-form .woocommerce .woocommerce-billing-fields label,.wcf-optin-form .woocommerce .woocommerce-shipping-fields label{display:inherit}.wcf-optin-form .woocommerce .woocommerce-terms-and-conditions-wrapper{display:none}.wcf-optin-form .woocommerce a{color:#f16334;background-color:transparent;text-decoration:none}.wcf-optin-form .woocommerce .woocommerce-NoticeGroup .woocommerce-message,.wcf-optin-form .woocommerce .woocommerce-error,.wcf-optin-form .woocommerce .woocommerce-info,.wcf-optin-form .woocommerce .woocommerce-message,.wcf-optin-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{padding:1em 2em .4em 2em;border-top:none;background-color:inherit;font-size:14px;font-weight:500;text-align:right;margin:0}.wcf-optin-form .woocommerce-info::before,.wcf-optin-form .woocommerce-message::before{right:.1em;color:#f16334}.wcf-optin-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error,.wcf-optin-form .woocommerce .woocommerce-error,.wcf-optin-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error{background-color:#fff6f6;border:dashed 1px #a00;padding:25px 25px 20px;color:#a00;margin:1rem 0 1rem;font-size:14px;width:100%}.wcf-optin-form .woocommerce .woocommerce-error::before{content:''}.wcf-optin-form .woocommerce-checkout #payment ul.payment_methods li:not(.woocommerce-notice)::before{display:inline}.wcf-optin-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{margin:1em 0 1em}.wcf-optin-form .woocommerce .woocommerce-error li{list-style:disc inside!important;margin:0 0 8px}.wcf-optin-form .woocommerce .woocommerce-error li strong{font-weight:400}.wcf-optin-form .woocommerce form.checkout_coupon{border:1px solid #d3ced2;padding:30px 20px 20px;margin:2em 0;text-align:right;-webkit-border-radius:5px;border-radius:5px}.wcf-optin-form .woocommerce .checkout_coupon p{font-size:14px}.wcf-optin-form .woocommerce .checkout_coupon p{font-family:inherit;font-weight:500;margin-top:0;margin-bottom:10px}.wcf-optin-form-one-column{background:inherit;width:100%;margin:0 auto}.wcf-optin-form-one-column .woocommerce .col2-set .col-1,.wcf-optin-form-one-column .woocommerce .col2-set .col-2,.wcf-optin-form-one-column .woocommerce .wcf-order-wrap,.wcf-optin-form-one-column .woocommerce form.checkout_coupon,.wcf-optin-form-one-column .woocommerce-checkout #order_review_heading,.wcf-optin-form-one-column .woocommerce-checkout #payment,.wcf-optin-form-one-column .woocommerce-checkout #your_products_heading,.wcf-optin-form-one-column .woocommerce-checkout .shop_table,.wcf-optin-form-one-column .woocommerce-checkout .wcf-qty-options{width:100%}.wcf-optin-form-one-column input[type=email],.wcf-optin-form-one-column input[type=password],.wcf-optin-form-one-column input[type=tel],.wcf-optin-form-one-column input[type=text],.wcf-optin-form-one-column select,.wcf-optin-form-one-column textarea{display:block;width:100%;min-height:40px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none}.wcf-optin-form-one-column .woocommerce-checkout #order_review_heading,.wcf-optin-form-one-column .woocommerce-checkout #your_products_heading{margin:20px 0 0}.wcf-optin-form-one-column .woocommerce-checkout #order_review{width:100%}@media only screen and (max-width:768px){.wcf-optin-form form.checkout_coupon .button{font-size:12px}.wcf-optin-form .woocommerce .col2-set .col-1,.wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-1,.wcf-optin-form .woocommerce .wcf-order-wrap{padding:15px 0}.wcf-optin-form .woocommerce .col2-set .col-2,.wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-2{padding:0}.wcf-optin-form .woocommerce form .form-row-first,.wcf-optin-form .woocommerce form .form-row-last{width:100%}.wcf-optin-form #order_review_heading,.wcf-optin-form .woocommerce #ship-to-different-address,.wcf-optin-form .woocommerce-additional-fields>h3,.wcf-optin-form .woocommerce-billing-fields>h3{font-size:1em}}#et-info-email:before,#et-info-phone:before,#et_search_icon:before,.comment-reply-link:after,.et-cart-info span:before,.et-pb-arrow-next:before,.et-pb-arrow-prev:before,.et-social-icon a:before,.et_audio_container .mejs-playpause-button button:before,.et_audio_container .mejs-volume-button button:before,.et_overlay:before,.et_password_protected_form .et_submit_button:after,.et_pb_button:after,.et_pb_contact_reset:after,.et_pb_contact_submit:after,.et_pb_font_icon:before,.et_pb_newsletter_button:after,.et_pb_pricing_table_button:after,.et_pb_promo_button:after,.et_pb_social_icon a.icon:before,.et_pb_testimonial:before,.et_pb_toggle_title:before,.form-submit .et_pb_button:after,.mobile_menu_bar:before,.woocommerce #content input.button.alt:after,.woocommerce #content input.button:after,.woocommerce #respond input#submit.alt:after,.woocommerce #respond input#submit:after,.woocommerce a.button.alt:after,.woocommerce button.button.alt:after,.woocommerce button.button:after,.woocommerce button.single_add_to_cart_button.button:after,.woocommerce input.button.alt:after,.woocommerce input.button:after,.woocommerce-page #content input.button.alt:after,.woocommerce-page #content input.button:after,.woocommerce-page #respond input#submit.alt:after,.woocommerce-page #respond input#submit:after,.woocommerce-page a.button.alt:after,.woocommerce-page a.button:after,.woocommerce-page button.button.alt:after,.woocommerce-page button.button:after,.woocommerce-page input.button.alt:after,.woocommerce-page input.button:after,a.et_pb_more_button:after{text-shadow:0 0;font-family:none;font-weight:400;font-style:normal;font-variant:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:1;text-transform:none;speak:none}.comment-reply-link:hover:after,.woocommerce #content input.button.alt:hover:after,.woocommerce #content input.button:hover:after,.woocommerce #respond input#submit.alt:hover:after,.woocommerce #respond input#submit:hover:after,.woocommerce a.button.alt:hover:after,.woocommerce a.button:hover:after,.woocommerce button.button.alt:hover:after,.woocommerce button.button:hover:after,.woocommerce input.button.alt:hover:after,.woocommerce input.button:hover:after{opacity:0}.thrv_wrapper .wcf-optin-form div{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
assets/min-css/optin-template.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .elementor-editor-active .wcf-optin-form .woocommerce #order_review #payment #place_order{pointer-events:none!important}.cartflows-container .wcf-optin-form,.cartflows-container .wcf-optin-form *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wcf-optin-form .wc-backward{display:none!important}.wcf-optin-form .woocommerce form .form-row-first,.wcf-optin-form .woocommerce form .form-row-last{width:50%;display:block}.wcf-optin-form .woocommerce form .form-row-full{width:100%;clear:both}.wcf-optin-form form .form-row-wide{width:100%}.wcf-optin-form .woocommerce form .form-row-first,.woocommerce-page form .form-row-first{float:left;clear:left}.wcf-optin-form .woocommerce form .form-row-last,.woocommerce-page form .form-row-last{float:right;clear:right}.wcf-optin-form .woocommerce form .form-row .required{color:red;font-weight:700;border:0!important;text-decoration:none}.wcf-optin-form form .form-row-first.form-row-one{clear:both}.wcf-optin-form .woocommerce form.woocommerce-form-login{display:none}.wcf-optin-form .woocommerce .blockUI.blockOverlay{font-size:15px}.wcf-optin-form .woocommerce form .form-row.woocommerce-invalid .select2-container,.wcf-optin-form .woocommerce form .form-row.woocommerce-invalid input.input-text,.wcf-optin-form .woocommerce form .form-row.woocommerce-invalid select{border-width:1px;border-color:#e2401c}.wcf-optin-form .woocommerce form .form-row.woocommerce-validated .select2-container,.wcf-optin-form .woocommerce form .form-row.woocommerce-validated input.input-text,.wcf-optin-form .woocommerce form .form-row.woocommerce-validated select{border-width:1px}.wcf-optin-form .select2-container--default.field-required .select2-selection--single,.wcf-optin-form .woocommerce #order_review .input-text.field-required,.wcf-optin-form .woocommerce form .form-row input.input-text.field-required,.wcf-optin-form .woocommerce form .form-row textarea.input-text.field-required{border-color:#e2401c}.wcf-optin-form .woocommerce form .form-row input.field-validated{border-left-width:2px;border-left-color:#69bf29}.wcf-optin-form .woocommerce #payment [type=radio]:checked+label,.wcf-optin-form .woocommerce #payment [type=radio]:not(:checked)+label{padding:0}.wcf-optin-form .woocommerce #payment input[type=radio]{-webkit-border-radius:50%;border-radius:50%;margin-right:4px;line-height:10px}.wcf-optin-form .woocommerce #payment input[type=checkbox]:checked:before,.wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]:checked:before,.wcf-optin-form .woocommerce .woocommerce-billing-fields [type=checkbox]:checked:before,.wcf-optin-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{content:"\e600";margin:0;color:#f16334}.wcf-optin-form .woocommerce #payment input[type=checkbox],.wcf-optin-form .woocommerce #payment input[type=radio],.wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox],.wcf-optin-form .woocommerce .woocommerce-billing-fields [type=checkbox],.wcf-optin-form .woocommerce .woocommerce-shipping-fields [type=checkbox]{border:1px solid #b4b9be;background:#fff;color:#555;clear:none;cursor:pointer;display:inline-block;line-height:0;height:16px;margin:-4px 4px 0 0;outline:0;padding:0!important;text-align:center;vertical-align:middle;width:16px;min-width:16px;-webkit-appearance:none;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-webkit-transition:.05s border-color ease-in-out;transition:.05s border-color ease-in-out}.wcf-optin-form .woocommerce #payment input[type=checkbox]:focus,.wcf-optin-form .woocommerce #payment input[type=radio]:focus,.wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]:focus,.wcf-optin-form .woocommerce .woocommerce-billing-fields [type=checkbox]:focus,.wcf-optin-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:focus{border-color:#f16334;-webkit-box-shadow:0 0 2px rgba(241,99,52,.8);box-shadow:0 0 2px rgba(241,99,52,.8)}.wcf-optin-form .woocommerce #payment input[type=radio]:checked:before{background-color:#f16334;-webkit-border-radius:50px;border-radius:50px;content:"\2022";font-size:24px;height:6px;line-height:16px;margin:4px;text-indent:-9999px;width:6px}.wcf-optin-form .woocommerce #payment input[type=checkbox]:checked:before,.wcf-optin-form .woocommerce #payment input[type=radio]:checked:before,.wcf-optin-form .woocommerce .woocommerce-account-fields input[type=checkbox]:before,.wcf-optin-form .woocommerce .woocommerce-billing-fields [type=checkbox]:checked:before,.wcf-optin-form .woocommerce .woocommerce-shipping-fields [type=checkbox]:checked:before{display:inline-block;float:left;font:normal 15px/1 cartflows-icon;speak:none;vertical-align:middle;width:6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wcf-optin-form .woocommerce-checkout #payment ul.payment_methods li input[type=checkbox]{min-width:16px}.wcf-optin-form .woocommerce .col2-set .col-1,.wcf-optin-form .woocommerce .col2-set .col-2,.wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-1,.wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-2{float:none;width:100%;max-width:100%;padding:0;-webkit-border-radius:0;border-radius:0;border:none;border-color:none;margin-bottom:0}.wcf-optin-form #order_review_heading,.wcf-optin-form .woocommerce #ship-to-different-address,.wcf-optin-form .woocommerce-additional-fields>h3,.wcf-optin-form .woocommerce-billing-fields>h3{display:none}.wcf-optin-form .woocommerce-checkout #payment{background:unset;-webkit-border-radius:0;border-radius:0}.wcf-optin-form .woocommerce-checkout #payment .form-row{margin:0;padding:0}.wcf-optin-form .woocommerce-checkout #payment .form-row label.checkbox{display:block;margin-bottom:1.1em}.wcf-optin-form .woocommerce-checkout #payment .payment_method_paypal .about_paypal{float:none;margin-left:10px}.wcf-optin-form .woocommerce-checkout #payment div.payment_box .form-row{margin:0 0 .5em}.wcf-optin-form .woocommerce-checkout #payment fieldset .form-row .wcf-optin-form .woocommerce-checkout #payment fieldset p{margin-bottom:10px}.wcf-optin-form .woocommerce-checkout #payment div.payment_box{background-color:#eaeaea;font-family:inherit;font-weight:inherit;margin-bottom:.5em}.wcf-optin-form #add_payment_method #payment div.payment_box::before,.wcf-optin-form .woocommerce-cart #payment div.payment_box::before,.wcf-optin-form .woocommerce-checkout #payment div.payment_box::before{content:'';display:block;border:1em solid;border-right-color:transparent;border-left-color:transparent;border-top-color:transparent;border-bottom-color:#eaeaea;position:absolute;top:-.75em;left:0;margin:-1em 0 0 2em}.wcf-optin-form .select2-container--default .select2-selection--single{display:block;width:100%;min-height:34px;height:auto;padding:11px 12px;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;outline:0}.wcf-optin-form .select2-container--default .select2-selection--single .select2-selection__rendered{color:#666;line-height:26px;min-height:26px;overflow:visible;padding-left:0}.select2-results__option[data-selected],.wcf-optin-form .select2-results__option[aria-selected]{font-size:14px}.wcf-optin-form .select2-container--default .select2-selection--single .select2-selection__arrow{height:100%}.select2-dropdown{border:1px solid #d4d4d4}.wcf-optin-form .woocommerce #order_review .input-text,.wcf-optin-form .woocommerce form .form-row input.input-text,.wcf-optin-form .woocommerce form .form-row select,.wcf-optin-form .woocommerce form .form-row textarea{display:block;width:100%;min-height:34px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;height:auto}.wcf-optin-form #order_review{padding:0;width:100%}.wcf-optin-form .select2-container--open,.wcf-optin-form input[type=email]:focus,.wcf-optin-form input[type=password]:focus,.wcf-optin-form input[type=tel]:focus,.wcf-optin-form input[type=text]:focus,.wcf-optin-form textarea:focus{border-color:#b3b3b3;-webkit-box-shadow:none;box-shadow:none;outline:0}.wcf-optin-form button:focus{outline:0;outline-color:none;outline-style:none;outline-width:none}.wcf-optin-form .woocommerce form.woocommerce-form-login .form-row button,.wcf-optin-form form.checkout_coupon .button{display:block;clear:both;border:none;font-size:15px;font-family:inherit;font-weight:inherit;background-color:#f16334;line-height:9px;padding:18px;margin-bottom:10px;width:100%}.wcf-optin-form .woocommerce #order_review #payment button{float:none;margin:0 auto;display:block}.wcf-optin-form .woocommerce #order_review button{border:1px solid;border-color:#f16334;background-color:#f16334;font-family:inherit;font-weight:inherit;font-size:18px;letter-spacing:.5px;width:100%;padding:16px 24px;font-size:16px;line-height:1.5;-webkit-border-radius:3px;border-radius:3px;color:#fff}.wcf-optin-form .woocommerce #order_review button.wcf-btn-small{padding:8px 6px;background-color:#c8c8c8;border:1px #c8c8c8 solid}.wcf-optin-form .woocommerce #order_review button.wcf-btn-small:hover{border-color:#f16334;background-color:#f16334}.wcf-optin-form .woocommerce #payment #place_order:hover{background-color:#f16334;border-color:#f16334;color:#fff}.wcf-optin-form .woocommerce-additional-fields,.wcf-optin-form .woocommerce-form-coupon-toggle,.wcf-optin-form table.shop_table.woocommerce-checkout-review-order-table{display:none!important}.wcf-optin-form .woocommerce-checkout{display:inline-block;text-align:inherit;width:100%}.wcf-optin-form .woocommerce-checkout .wcf-col2-set{display:block;width:100%;float:none;margin:10px 0 0 0;padding:0}.wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{margin:0 -7px;-ms-flex-wrap:wrap;flex-wrap:wrap;-js-display:flex;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flex;display:-webkit-flex;flex-wrap:wrap;-webkit-flex-wrap:wrap}.wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper{margin:0 -7px}.wcf-optin-form .woocommerce form .form-row{display:block;margin-bottom:1.1em;padding:3px 7px;position:relative}.wcf-optin-form .woocommerce form .woocommerce-account-fields{display:none}.wcf-optin-form .woocommerce form .woocommerce-account-fields .form-row{padding:0}.wcf-optin-form .woocommerce form.woocommerce-form-login .form-row label,.wcf-optin-form .woocommerce-checkout .form-row label{font-size:13px;line-height:1em;letter-spacing:.3px;font-family:inherit;font-weight:inherit;margin-bottom:8px}.wcf-optin-form .woocommerce .woocommerce-billing-fields label,.wcf-optin-form .woocommerce .woocommerce-shipping-fields label{display:inherit}.wcf-optin-form .woocommerce .woocommerce-terms-and-conditions-wrapper{display:none}.wcf-optin-form .woocommerce a{color:#f16334;background-color:transparent;text-decoration:none}.wcf-optin-form .woocommerce .woocommerce-NoticeGroup .woocommerce-message,.wcf-optin-form .woocommerce .woocommerce-error,.wcf-optin-form .woocommerce .woocommerce-info,.wcf-optin-form .woocommerce .woocommerce-message,.wcf-optin-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{padding:1em 2em .4em 2em;border-top:none;background-color:inherit;font-size:14px;font-weight:500;text-align:left;margin:0}.wcf-optin-form .woocommerce-info::before,.wcf-optin-form .woocommerce-message::before{left:.1em;color:#f16334}.wcf-optin-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error,.wcf-optin-form .woocommerce .woocommerce-error,.wcf-optin-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error{background-color:#fff6f6;border:dashed 1px #a00;padding:25px 25px 20px;color:#a00;margin:1rem 0 1rem;font-size:14px;width:100%}.wcf-optin-form .woocommerce .woocommerce-error::before{content:''}.wcf-optin-form .woocommerce-checkout #payment ul.payment_methods li:not(.woocommerce-notice)::before{display:inline}.wcf-optin-form .woocommerce .woocommerce-notices-wrapper .woocommerce-message{margin:1em 0 1em}.wcf-optin-form .woocommerce .woocommerce-error li{list-style:disc inside!important;margin:0 0 8px}.wcf-optin-form .woocommerce .woocommerce-error li strong{font-weight:400}.wcf-optin-form .woocommerce form.checkout_coupon{border:1px solid #d3ced2;padding:30px 20px 20px;margin:2em 0;text-align:left;-webkit-border-radius:5px;border-radius:5px}.wcf-optin-form .woocommerce .checkout_coupon p{font-size:14px}.wcf-optin-form .woocommerce .checkout_coupon p{font-family:inherit;font-weight:500;margin-top:0;margin-bottom:10px}.wcf-optin-form-one-column{background:inherit;width:100%;margin:0 auto}.wcf-optin-form-one-column .woocommerce .col2-set .col-1,.wcf-optin-form-one-column .woocommerce .col2-set .col-2,.wcf-optin-form-one-column .woocommerce .wcf-order-wrap,.wcf-optin-form-one-column .woocommerce form.checkout_coupon,.wcf-optin-form-one-column .woocommerce-checkout #order_review_heading,.wcf-optin-form-one-column .woocommerce-checkout #payment,.wcf-optin-form-one-column .woocommerce-checkout #your_products_heading,.wcf-optin-form-one-column .woocommerce-checkout .shop_table,.wcf-optin-form-one-column .woocommerce-checkout .wcf-qty-options{width:100%}.wcf-optin-form-one-column input[type=email],.wcf-optin-form-one-column input[type=password],.wcf-optin-form-one-column input[type=tel],.wcf-optin-form-one-column input[type=text],.wcf-optin-form-one-column select,.wcf-optin-form-one-column textarea{display:block;width:100%;min-height:40px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none}.wcf-optin-form-one-column .woocommerce-checkout #order_review_heading,.wcf-optin-form-one-column .woocommerce-checkout #your_products_heading{margin:20px 0 0}.wcf-optin-form-one-column .woocommerce-checkout #order_review{width:100%}@media only screen and (max-width:768px){.wcf-optin-form form.checkout_coupon .button{font-size:12px}.wcf-optin-form .woocommerce .col2-set .col-1,.wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-1,.wcf-optin-form .woocommerce .wcf-order-wrap{padding:15px 0}.wcf-optin-form .woocommerce .col2-set .col-2,.wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-2{padding:0}.wcf-optin-form .woocommerce form .form-row-first,.wcf-optin-form .woocommerce form .form-row-last{width:100%}.wcf-optin-form #order_review_heading,.wcf-optin-form .woocommerce #ship-to-different-address,.wcf-optin-form .woocommerce-additional-fields>h3,.wcf-optin-form .woocommerce-billing-fields>h3{font-size:1em}}#et-info-email:before,#et-info-phone:before,#et_search_icon:before,.comment-reply-link:after,.et-cart-info span:before,.et-pb-arrow-next:before,.et-pb-arrow-prev:before,.et-social-icon a:before,.et_audio_container .mejs-playpause-button button:before,.et_audio_container .mejs-volume-button button:before,.et_overlay:before,.et_password_protected_form .et_submit_button:after,.et_pb_button:after,.et_pb_contact_reset:after,.et_pb_contact_submit:after,.et_pb_font_icon:before,.et_pb_newsletter_button:after,.et_pb_pricing_table_button:after,.et_pb_promo_button:after,.et_pb_social_icon a.icon:before,.et_pb_testimonial:before,.et_pb_toggle_title:before,.form-submit .et_pb_button:after,.mobile_menu_bar:before,.woocommerce #content input.button.alt:after,.woocommerce #content input.button:after,.woocommerce #respond input#submit.alt:after,.woocommerce #respond input#submit:after,.woocommerce a.button.alt:after,.woocommerce button.button.alt:after,.woocommerce button.button:after,.woocommerce button.single_add_to_cart_button.button:after,.woocommerce input.button.alt:after,.woocommerce input.button:after,.woocommerce-page #content input.button.alt:after,.woocommerce-page #content input.button:after,.woocommerce-page #respond input#submit.alt:after,.woocommerce-page #respond input#submit:after,.woocommerce-page a.button.alt:after,.woocommerce-page a.button:after,.woocommerce-page button.button.alt:after,.woocommerce-page button.button:after,.woocommerce-page input.button.alt:after,.woocommerce-page input.button:after,a.et_pb_more_button:after{text-shadow:0 0;font-family:none;font-weight:400;font-style:normal;font-variant:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:1;text-transform:none;speak:none}.comment-reply-link:hover:after,.woocommerce #content input.button.alt:hover:after,.woocommerce #content input.button:hover:after,.woocommerce #respond input#submit.alt:hover:after,.woocommerce #respond input#submit:hover:after,.woocommerce a.button.alt:hover:after,.woocommerce a.button:hover:after,.woocommerce button.button.alt:hover:after,.woocommerce button.button:hover:after,.woocommerce input.button.alt:hover:after,.woocommerce input.button:hover:after{opacity:0}.thrv_wrapper .wcf-optin-form div{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
assets/min-js/import.min.js CHANGED
@@ -1 +1 @@
1
- var CartFlowsAjaxQueue=function(){var s=[];return{add:function(t){s.push(t)},remove:function(t){-1<jQuery.inArray(t,s)&&s.splice($.inArray(t,s),1)},run:function(){var t,e=this;s.length?(t=s[0].complete,s[0].complete=function(){"function"==typeof t&&t(),s.shift(),e.run.apply(e,[])},jQuery.ajax(s[0])):e.tid=setTimeout(function(){e.run.apply(e,[])},1e3)},stop:function(){s=[],clearTimeout(this.tid)}}}();!function(c){CartFlowsImport={doc:c(document),wrap:c(".wcf-flow-steps-data-wrap"),inner:c(".wcf-flow-steps-data-wrap-importer"),post_id:c("#post_ID").val(),_ref:null,_api_step_type:{},_api_params:{},all_steps:0,remaining_steps:0,remaining_install_plugins:0,remaining_active_plugins:0,woo_required_steps:["checkout","upsell","downsell","thankyou"],step_order:["landing","checkout","upsell","downsell","thankyou"],new_step_names:{landing:"Landing",checkout:"Checkout (Woo)",upsell:"Upsell (Woo)",downsell:"Downsell (Woo)",thankyou:"Thank You (Woo)"},init:function(){if(this._bind(),"other"!==CartFlowsImportVars.default_page_builder&&(c(".post-type-cartflows_flow").hasClass("edit-php")&&this._process_cache_remote_flows(),c(".post-type-cartflows_flow").hasClass("post-php")&&this._process_cache_remote_steps()),c(".post-type-cartflows_flow").hasClass("edit-php")&&null!==this._getParamFromURL("add-new-flow")&&this._render_remote_flows(),c(".post-type-cartflows_flow").hasClass("post-php")&&null!==this._getParamFromURL("add-new-step")&&this._render_remote_steps(),this._getParamFromURL("highlight-step-id")){var t=c('.wcf-step-wrap[data-id="'+this._getParamFromURL("highlight-step-id")+'"]');t.length&&c("html, body").animate({scrollTop:t.offset().top},1500)}if(c(".post-type-cartflows_flow").hasClass("edit-php")){var e=c(".edit-php.post-type-cartflows_flow").find(".page-title-action:first");e.after('<a href="'+CartFlowsImportVars.export_url+'" class="page-title-action">Export</a>'),e.after('<a href="'+CartFlowsImportVars.import_url+'" class="page-title-action">Import</a>')}},_getParamFromURL:function(t,e){e=e||window.location.href,t=t.replace(/[\[\]]/g,"\\$&");var s=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return s?s[2]?decodeURIComponent(s[2].replace(/\+/g," ")):"":null},_bind:function(){var t=CartFlowsImport;t.doc.on("click",".wcf-install-plugin",t._install_plugin),t.doc.on("cartflows-api-request-fail",t._api_request_failed),t.doc.on("click","#wcf-get-started-steps a, .wcf-create-from-scratch-link",t._toggle_ready_templates),t.doc.on("click",".cartflows-flow-import-blank",t._create_default_flow),t.doc.on("click","#wcf-remote-flow-importer .wcf-page-builder-links a",t._filterFlowPageBuilderClick),t.doc.on("click","#wcf-remote-step-importer #wcf-categories .step-type-filter-links a",t._filterBlankStepCategoryClick),t.doc.on("change","#wcf-remote-step-importer #wcf-scratch-steps-categories .step-type-filter-links",t._filterBlankStepCategoryChange),t.doc.on("click","#wcf-get-started-steps",t._filterBlankStepCategoryChange),t.doc.on("click","#wcf-remote-step-importer .wcf-page-builder-links a",t._filterStepPageBuilderClick),t.doc.on("click",".cartflows-step-import-blank:not(.get-pro)",t._create_blank_step),t.doc.on("click","#wcf-remote-step-importer .cartflows-step-import",t._process_import_step),t.doc.on("click","#wcf-remote-flow-importer .cartflows-step-import",t._process_import_flow),t.doc.on("click",".cartflows-preview-flow-step",t._preview_individual),t.doc.on("add_template_to_page-fail",t._add_template_to_page_fail),c("body").on("thickbox:iframe:loaded",t._previewLoaded),c(document).on("keyup input","#wcf-remote-step-importer .wcf-flow-search-input",t._remote_step_search),c(document).on("click",".actions a",t._previewResponsive),c(document).on("click",".page-title-action:first",t._render_remote_flows),c(document).on("click",".wcf-trigger-popup",t._render_remote_steps),c(document).on("click",".wcf-templates-popup-overlay",t._close_template_popup),c(document).on("click",".wcf-popup-close-wrap .close-icon",t._close_template_popup),c(document).on("wp-plugin-install-success",t._installSuccess),c(document).on("click",".wcf-activate-wc",t._installWc)},_install_plugin:function(t){t.preventDefault();var e=c(this);if(!e.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process"),c("#wcf-remote-step-importer").addClass("request-process"),e.addClass("updating-message button");var s=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(s,function(t,e){"install"===e.status&&CartFlowsImport.remaining_install_plugins++,"activate"===e.status&&CartFlowsImport.remaining_active_plugins++}),CartFlowsImport.remaining_install_plugins?CartFlowsImport._install_all_plugins():CartFlowsImport.remaining_active_plugins?CartFlowsImport._activate_all_plugins():c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps()}},_install_all_plugins:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(t,function(t,e){"install"===e.status&&wp.updates.queue.push({action:"install-plugin",data:{slug:e.slug}})}),wp.updates.queueChecker()},_activate_all_plugins:function(){if(CartFlowsImport.remaining_active_plugins||CartFlowsImport.remaining_install_plugins){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;CartFlowsAjaxQueue.stop(),CartFlowsAjaxQueue.run(),c.each(t,function(t,e){"activate"===e.status&&CartFlowsAjaxQueue.add({url:CartFlowsImportVars.ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:e.init,security:CartFlowsImportVars.cartflows_activate_plugin_nonce},success:function(t){CartFlowsImport.remaining_active_plugins--,CartFlowsImport.remaining_active_plugins||CartFlowsImport.remaining_install_plugins||(c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps())}})})}else c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps()},_installSuccess:function(t,s){t.preventDefault(),"no"===CartFlowsImportVars.is_wc_activated&&CartFlowsImport._activateWc();var e=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(e,function(t,e){"install"===e.status&&s.slug===e.slug&&c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:e.init,security:CartFlowsImportVars.cartflows_activate_plugin_nonce}}).done(function(t,e,s){CartFlowsImport.remaining_install_plugins--,CartFlowsImport.remaining_install_plugins||CartFlowsImport._activate_all_plugins()})})},_api_request_failed:function(t,e,s,a){"error"==a&&(c("#wcf-remote-content-failed").length||c("#wcf-ready-templates").html(wp.template("cartflows-website-unreachable")))},_toggle_ready_templates:function(t){t.preventDefault();var e=c(this).data("slug")||"";c("#wcf-get-started-steps").find("a").removeClass("current"),c("#wcf-get-started-steps").find('a[data-slug="'+e+'"]').addClass("current"),"canvas"==e?(c("#wcf-ready-templates").hide(),c("#wcf-start-from-scratch").show()):(c("#wcf-ready-templates").show(),c("#wcf-start-from-scratch").hide()),!c(".wcf-page-builder-notice").length&&c("#wcf-remote-step-importer").length&&CartFlowsImport._showSteps()},_switch_step_tab:function(t){t.preventDefault();var e=c(".wcf-tab > li.active > a").attr("href");c(".wcf-tab > li.active").removeClass("active"),c(this).parents("li").addClass("active"),c(e).removeClass("active"),c(e).addClass("hide");var s=c(this).attr("href");c(s).removeClass("hide"),c(s).addClass("active")},_remote_step_search:function(t){t.preventDefault(),c(".step-type-filter-links").find("option").removeClass("current"),c(".step-type-filter-links").find("option:first-child").addClass("current"),window.clearTimeout(CartFlowsImport._ref),CartFlowsImport._ref=window.setTimeout(function(){CartFlowsImport._ref=null,CartFlowsImport._showSteps()},500)},_previewResponsive:function(t){t.preventDefault();var e=c(this).find(".dashicons"),s=e.attr("data-view")||"";c("#TB_window").removeClass("desktop tablet mobile"),c("#TB_window").addClass(s),c(".actions .dashicons").removeClass("active"),e.addClass("active"),c("#TB_iframeContent").removeClass(),c("#TB_iframeContent").addClass(s)},_filterStepPageBuilderClick:function(t){t.preventDefault(),c(this).parents("ul").find("a").removeClass("current"),c(this).addClass("current");var e=c(".step-type-filter-links .current").data("slug")||"";"upsell"===e||"downsell"===e?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),c(".wcf-page-builder-notice").html(""),c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps()},_filterBlankStepCategoryClick:function(t){t.preventDefault(),c(".wcf-page-builder-notice").html("");var e=c(this).data("group")||"";e&&(c("#wcf-scratch-steps-categories .step-type-filter-links").val(e),c("#wcf-scratch-steps-categories .step-type-filter-links option").removeClass("current"),c('#wcf-scratch-steps-categories .step-type-filter-links option[data-group="'+e+'"]').addClass("current")),c(".step-type-filter-links").find("a").removeClass("current"),c(this).addClass("current"),$step_type=c(this).data("slug"),"upsell"===$step_type||"downsell"===$step_type?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),""!=CartFlowsImportVars._is_pro_active||"upsell"!=$step_type&&"downsell"!=$step_type?(c(".cartflows-step-import-blank").text("Create Step"),c(".cartflows-step-import-blank").removeClass("get-pro"),c(".cartflows-step-import-blank").removeAttr("target")):(c(".cartflows-step-import-blank").text("Get Pro"),c(".cartflows-step-import-blank").attr("href",CartFlowsImportVars.domain_url),c(".cartflows-step-import-blank").attr("target","_blank"),c(".cartflows-step-import-blank").addClass("get-pro")),c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps()},_filterBlankStepCategoryChange:function(t){t.preventDefault(),c(".wcf-notice-wrap").remove(),c(".cartflows-step-import-blank").css("pointer-events","auto").removeClass("disabled");var e=c(".step-type-filter-links").find("option:selected").val()||"";if(e&&(c(".step-type-filter-links").val(e),c(".step-type-filter-links").find("a").removeClass("current"),c(".step-type-filter-links").find('a[data-group="'+e+'"]').addClass("current")),c(".step-type-filter-links").find("option").removeClass("current"),c(".step-type-filter-links").find("option:selected").addClass("current"),$step_type=c(".step-type-filter-links").find("option:selected").data("slug"),!("no"!==CartFlowsImportVars.is_wc_installed&&"no"!==CartFlowsImportVars.is_wc_activated||"upsell"!==$step_type&&"downsell"!==$step_type&&"checkout"!==$step_type&&"thankyou"!==$step_type))return c(".cartflows-step-import-blank").after("<p class='wcf-notice-wrap' style='text-align: center'>You need WooCommerce plugin installed and actived to use this product flow. <br/><br/> <a href='#' class='wcf-activate-wc button-secondary'> Click here to install and activate WooCommerce </a> </p>"),void c(".cartflows-step-import-blank").addClass("disabled").css("pointer-events","none");"upsell"===$step_type||"downsell"===$step_type?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),""!=CartFlowsImportVars._is_pro_active||"upsell"!=$step_type&&"downsell"!=$step_type?(c(".cartflows-step-import-blank").text("Create Step"),c(".cartflows-step-import-blank").removeClass("get-pro"),c(".cartflows-step-import-blank").removeAttr("target")):(c(".cartflows-step-import-blank").text("Get Pro"),c(".cartflows-step-import-blank").attr("href",CartFlowsImportVars.domain_url),c(".cartflows-step-import-blank").attr("target","_blank"),c(".cartflows-step-import-blank").addClass("get-pro")),!c(".wcf-page-builder-notice").length&&c("#wcf-remote-step-importer").length&&(c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps())},_showSteps:function(){var t={licence_args:CartFlowsImportVars.licence_args,per_page:15,_fields:CartFlowsImportVars.step_fields.toString()},e=c("#wcf-categories .step-type-filter-links").find(".current").data("group")||"",a=c("#wcf-categories .step-type-filter-links").find(".current").data("slug");""!==e&&"all"!==e&&(t[CartFlowsImportVars.step_type]=e);e=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("group")||"",a=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("slug")||"";var r=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("title")||"Page Builder";""!==e&&"all"!==e&&(t[CartFlowsImportVars.step_page_builder]=e);var s={remote_slug:CartFlowsImportVars.step,slug:CartFlowsImportVars.step+"?"+decodeURIComponent(c.param(t))};CartFlowsAPI._api_request(s,function(s){s.current_step_type=a,"yes"!==CartFlowsImportVars.is_wc_activated&&c.each(s.items,function(t,e){s.items[t].woo_required=!1,0<=c.inArray(e.step_type.slug,CartFlowsImport.woo_required_steps)&&(s.items[t].woo_required=!0)});var t=wp.template("cartflows-steps-list");parseInt(s.items_count)?c("#wcf-remote-step-list").html(t(s)):(c("#wcf-remote-step-list").html(wp.template("cartflows-no-steps")),c(".cartflows-no-steps").find(".description").html("We are working on ready templates designed with "+r+'.<br/>Meanwhile you can <a href="#" data-slug="canvas" class="wcf-create-from-scratch-link">create your own designs</a> easily.')),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-step-importer").removeClass("request-process")})},_apiAddParam_per_page:function(){CartFlowsImport._api_params.per_page=15},_apiAddParam_licence_args:function(){CartFlowsImport._api_params.licence_args=CartFlowsImportVars.licence_args},_apiAddParam_search:function(){var t=c(".wcf-flow-search-input").val()||"";""!==t&&(CartFlowsImport._api_params.search=t)},_close_popup:function(){c("#cartflows-steps").fadeOut(),c("body").removeClass("cartflows-popup-is-open")},_post_auto_save:function(){var t=c("#title"),e=c("#title-prompt-text"),s=CartFlowsImport;t.val()||(t.val("CartFlows #"+s.post_id),e.length&&e.remove()),wp.autosave&&wp.autosave.server.triggerSave()},_process_cache_remote_flows:function(){if("gutenberg"==CartFlowsImportVars.default_page_builder)CartFlowsImport._cache_remote_flows();else{var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins,s=!0;c.each(t,function(t,e){s&&("install"!==e.status&&"activate"!==e.status||(s=!1))}),!1===s?(c(".wcf-page-builder-notice").html(wp.template("cartflows-page-builder-notice")),c("#wcf-remote-flow-list").find(".spinner").remove()):CartFlowsImport._cache_remote_flows()}},_cache_remote_flows:function(){CartFlowsImport;var t={search:CartFlowsImportVars.default_page_builder,licence_args:CartFlowsImportVars.licence_args,hide_empty:!1,_fields:CartFlowsImportVars.flow_page_builder_fields.toString()},e={remote_slug:CartFlowsImportVars.flow_page_builder,slug:CartFlowsImportVars.flow_page_builder+"?"+decodeURIComponent(c.param(t)),wrapper_class:"wcf-page-builder-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-page-builders").html(e(t)),c("#wcf-page-builders").find("li:first a").addClass("current");var s={licence_args:CartFlowsImportVars.licence_args,hide_empty:!0,_fields:CartFlowsImportVars.flow_type_fields.toString()},a={remote_slug:CartFlowsImportVars.flow_type,slug:CartFlowsImportVars.flow_type+"?"+decodeURIComponent(c.param(s)),wrapper_class:"flow-type-filter-links filter-links",show_all:!1};CartFlowsAPI._api_request(a,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-categories").html(e(t)),c("#wcf-categories").find("li:first a").addClass("current"),CartFlowsImport._showFlows()})})},_render_remote_flows:function(t){t&&t.preventDefault(),c("#wcf-remote-flow-importer").addClass("open"),c("html").addClass("wcf-popup-open")},_process_cache_remote_steps:function(){if("gutenberg"==CartFlowsImportVars.default_page_builder)CartFlowsImport._cache_remote_steps();else{var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins,s=!0;c.each(t,function(t,e){s&&("install"!==e.status&&"activate"!==e.status||(s=!1))}),!1===s?(c(".wcf-page-builder-notice").html(wp.template("cartflows-page-builder-notice")),c("#wcf-remote-step-list").find(".spinner").remove()):CartFlowsImport._cache_remote_steps()}},mapOrder:function(t,r,o){return t.sort(function(t,e){var s=t[o],a=e[o];return r.indexOf(s)>r.indexOf(a)?1:-1}),t},_cache_remote_steps:function(){CartFlowsImport;c("html").addClass("wcf-steps-loading");var t={search:CartFlowsImportVars.default_page_builder,licence_args:CartFlowsImportVars.licence_args,hide_empty:!1,_fields:CartFlowsImportVars.step_page_builder_fields.toString()},e={remote_slug:CartFlowsImportVars.step_page_builder,slug:CartFlowsImportVars.step_page_builder+"?"+decodeURIComponent(c.param(t)),wrapper_class:"wcf-page-builder-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-page-builders").html(e(t)),c("#wcf-page-builders").find("li:first a").addClass("current")});t={licence_args:CartFlowsImportVars.licence_args,_fields:CartFlowsImportVars.step_type_fields.toString()},e={remote_slug:CartFlowsImportVars.step_type,slug:CartFlowsImportVars.step_type+"?"+decodeURIComponent(c.param(t)),wrapper_class:"step-type-filter-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){t.items=CartFlowsImport.mapOrder(t.items,CartFlowsImport.step_order,"slug");var a=t,r=t.items_count;if(t.items)for(key in t.items){t.items[key].name=CartFlowsImport.new_step_names[t.items[key].slug];var e={licence_args:CartFlowsImportVars.licence_args,per_page:15,_fields:CartFlowsImportVars.step_fields.toString()};e[CartFlowsImportVars.step_type]=t.items[key].id;var s={remote_slug:CartFlowsImportVars.step,slug:CartFlowsImportVars.step+"?"+decodeURIComponent(c.param(e))};CartFlowsAPI._api_request(s,function(t){var e=wp.template("cartflows-steps-list");if(parseInt(t.items_count)?c("#wcf-remote-step-list").html(e(t)):c("#wcf-remote-step-list").html(wp.template("cartflows-no-steps")),0==--r){var s=wp.template("cartflows-term-filters-dropdown");e=wp.template("cartflows-term-filters");c("#wcf-categories").html(e(a)),c("#wcf-scratch-steps-categories").html(s(a)),c("#wcf-categories, #wcf-scratch-steps-categories").find("option:first").addClass("current"),c("#wcf-categories").find("li:first a").addClass("current"),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-content").find(".spinner").remove(),CartFlowsImport._showSteps(),c("html").removeClass("wcf-steps-loading")}})}})},_render_remote_steps:function(t){t&&t.preventDefault(),c("#wcf-remote-step-importer").addClass("open"),c("html").addClass("wcf-popup-open")},_categorize_data:function(t){var a=[];return c.each(t,function(t,e){var s=e.step_type.slug;void 0===a[s]&&(a[s]=[]),a[s].push(e)}),a},_close_template_popup:function(t){(c(t.target).hasClass("wcf-templates-popup-overlay")||c(t.target).hasClass("close-icon"))&&(c(".wcf-templates-popup-overlay").hasClass("request-process")||(c("html").removeClass("wcf-popup-open"),c(".wcf-templates-popup-overlay").removeClass("open")))},_ajax:function(t,a,r){var o=CartFlowsImport;c.ajax({url:ajaxurl,type:"POST",data:t}).done(function(t,e,s){a&&"function"==typeof a&&a({request:t,status:e,XHR:s}),o.doc.trigger(r+"-done",[t,e,s])}).fail(function(t,e){o.doc.trigger(r+"-fail",[t,e])}).always(function(){o.doc.trigger(r+"-always")})},_load_templates:function(t,a){var r=CartFlowsImport;c("body").hasClass("processing")||(c("body").addClass("processing"),c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_load_steps",security:cartflows_admin.cf_load_steps_nonce,args:t}}).done(function(t,e,s){r.doc.trigger(a,[t]),c("body").removeClass("processing")}).fail(function(t,e){}).always(function(){}))},_empty:function(t){if("number"==typeof t||"boolean"==typeof t)return!1;if(null==t)return!0;if(void 0!==t.length)return 0==t.length;var e=0;for(var s in t)t.hasOwnProperty(s)&&e++;return 0==e},_preview_individual:function(){var t=c(this).data("id")||"",e=c(this).data("href")||"";c(".cartflows-preview-flow-step").removeClass("active"),c('.cartflows-preview-flow-step[data-id="'+t+'"]').addClass("active"),c("#TB_window").addClass("cartflows-thickbox-loading"),c("#TB_iframeContent").removeAttr("onload"),c("#TB_iframeContent").removeAttr("src"),c("#TB_iframeContent").attr("src",e),c("#TB_iframeContent").attr("onload","CartFlowsImport.showIframe()")},showIframe:function(){c("#TB_load").remove(),c("#TB_window").css({visibility:"visible"}),c("#TB_window").removeClass("cartflows-thickbox-loading")},_previewLoaded:function(t){t.preventDefault(),c("#TB_window").removeClass("cartflows-thickbox-loading")},_filterFlowPageBuilderClick:function(t){t.preventDefault(),c(this).parents("ul").find("a").removeClass("current"),c(this).addClass("current"),c(".wcf-page-builder-notice").html(""),c("#wcf-remote-flow-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showFlows()},_showFlows:function(){var t={licence_args:CartFlowsImportVars.licence_args,_fields:CartFlowsImportVars.flow_fields.toString()},e=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("group")||"";c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("slug"),c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("title");""!==e&&"all"!==e&&(t[CartFlowsImportVars.flow_page_builder]=e);var s={remote_slug:CartFlowsImportVars.flow,slug:CartFlowsImportVars.flow+"?"+decodeURIComponent(c.param(t))};CartFlowsAPI._api_request(s,function(a){"yes"!==CartFlowsImportVars.is_wc_activated&&c.each(a.items,function(s,t){a.items[s].woo_required=!1,c.each(t.flow_steps,function(t,e){0<=c.inArray(e.type,CartFlowsImport.woo_required_steps)&&(a.items[s].woo_required=!0)})});var t=wp.template("cartflows-flows-list");parseInt(a.items_count)?c("#wcf-remote-flow-list").html(t(a)):c("#wcf-remote-flow-list").html(wp.template("cartflows-no-flows")),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-flow-importer").removeClass("request-process")})},_create_default_flow:function(t){t.preventDefault();var e=CartFlowsImport,s=c(this);if(!s.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process"),s.addClass("updating-message").text("Creating Flow.."),s.parents(".template").addClass("importing");var a={action:"cartflows_default_flow",security:cartflows_admin.cf_default_flow_nonce};e._ajax(a,function(t){if(t.request.success){var e=t.request.data;setTimeout(function(){s.removeClass("updating-message").text("Flow Created! Redirecting.."),window.location=CartFlowsImportVars.admin_url+"post.php?post="+e+"&action=edit"},3e3)}})}},_activate_plugin:function(t){var e=CartFlowsImport,s={action:"cartflows_activate_plugin",plugin_init:t,security:CartFlowsImportVars.cartflows_activate_plugin_nonce};e._ajax(s,function(t){})},_process_import_flow:function(t){t.preventDefault();var a=c(this);if(!a.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process");var e=CartFlowsImport;a.text("Creating Flow.."),a.addClass("updating-message"),a.parents(".template").addClass("importing");var s=a.data("flow-steps")||"",r=""!==s?JSON.parse("["+s+"]"):[],o={action:"cartflows_create_flow",security:cartflows_admin.cf_create_flow_nonce};e._ajax(o,function(t){if(t.request.success){var s=t.request.data;r&&(CartFlowsAjaxQueue.stop(),CartFlowsAjaxQueue.run(),CartFlowsImport.all_steps=r.length,a.addClass("updating-message").text("Importing Step 1 of "+CartFlowsImport.all_steps),c.each(r,function(t,e){CartFlowsAjaxQueue.add({url:CartFlowsImportVars.ajaxurl,type:"POST",data:{action:"cartflows_import_flow_step",flow_id:s,template_id:e,security:cartflows_admin.cf_import_flow_step_nonce},success:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(a.addClass("updating-message").text("Imported Step "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){a.removeClass("updating-message").text("All Imported! Redirecting.."),window.location=CartFlowsImportVars.admin_url+"post.php?post="+s+"&action=edit"},3e3)):a.addClass("updating-message").text("Importing Step "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)},error:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,template=a.parents(".template.importing"),template.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.statusText),CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(a.addClass("updating-message").text("Failed "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){a.removeClass("updating-message button-primary").addClass("disabled")},3e3)):a.addClass("updating-message").text("Failed "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)},fail:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(a.addClass("updating-message").text("Imported "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){a.removeClass("updating-message").text("All Step Imported! Reloading.."),location.reload()},3e3)):a.addClass("updating-message").text("Importing "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)}})}))}})}},_handle_error:function(t){c(".cartflows-step-import.updating-message").addClass("updating-message").text(t.errorMessage)},_create_blank_step:function(t){t.preventDefault();var s=c(this),e=CartFlowsImport,a=c("#post_ID").val(),r=c("#wcf-scratch-steps-categories .step-type-filter-links .current").data("slug")||"",o=c("#wcf-scratch-steps-categories .step-type-filter-links .current").data("title")||"",l=r,i=c('.wcf-step-wrap[data-term-slug="'+r+'"]').length||1,p=o+" "+(parseInt(i)+1);if(all_step_type=["landing","checkout","thankyou"],c("#wcf-start-from-scratch .wcf-notice-wrap ").remove(),""!==l){if(CartFlowsImportVars._is_pro_active||"upsell"!==l&&"downsell"!==l){if(s.parents(".template").addClass("importing"),!CartFlowsImportVars._is_pro_active)if("-1"!=jQuery.inArray(l,all_step_type))if(0<c('.wcf-step-wrap[data-term-slug="'+l+'"]').length){s.parents(".template.importing");return s.removeClass("importing updating-message").text("Import Failed!"),void c("#wcf-start-from-scratch .inner").append('<div class="wcf-notice-wrap"><div class="notice notice-warning"><p>Upgrade to Pro for adding more than one '+l.charAt(0).toUpperCase()+l.slice(1)+" step.</p></div></div>")}if(c("#wcf-remote-step-importer").addClass("request-process"),c(".cartflows-step-import").addClass("disabled"),s.addClass("importing updating-message").text("Creating.."),c("body").hasClass("post-type-cartflows_flow")){var n={action:"cartflows_step_create_blank",flow_id:a,step_type:l,step_title:p,security:cartflows_admin.cf_step_create_blank_nonce};e._ajax(n,function(t){CartFlowsImport;var e=s.parents(".template.importing");t.request.success?(s.text("Created. Reloading.."),setTimeout(function(){window.location.href=window.location.href+"&highlight-step-id="+t.request.data},3e3)):(s.removeClass("importing updating-message").text("Creating Failed!"),c("#wcf-remote-step-importer").removeClass("request-process"),e.find(".cartflows-step-preview").append("<div class='preview'></div>"),e.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.request.data))})}}}else c("#wcf-start-from-scratch .inner").append('<div class="wcf-notice-wrap"><div class="notice notice-info"><p>Please select the step type.</p></div></div>')},_process_import_step:function(t){t.preventDefault();var s=c(this),e=s.data("slug")||"",a=c('.wcf-step-wrap[data-term-slug="'+e+'"]').length||1;if((step_title=s.data("title")||"",step_custom_title=step_title+" "+(parseInt(a)+1),o=CartFlowsImport,all_step_slug=["landing","checkout","thankyou"],!CartFlowsImportVars._is_pro_active)&&("-1"!=jQuery.inArray(e,all_step_slug)&&0<c('.wcf-step-wrap[data-term-slug="'+e+'"]').length)){var r=s.parents(".template");return s.removeClass("importing updating-message").text("Import Failed!"),r.find(".preview").hide(),r.find("#wcf_create_notice").show().find("a").addClass("notice notice-warning ").text("Upgrade to Pro for adding more than one "+e.charAt(0).toUpperCase()+e.slice(1)+" step"),void c("#wcf-remote-step-importer").removeClass("request-process")}if(!s.hasClass("updating-message")){c("#wcf-remote-step-importer").addClass("request-process");var o=CartFlowsImport;s.addClass("updating-message"),s.parents(".template").addClass("importing");var l=s.data("template-id")||"",i=c("#post_ID").val(),p=e;o=CartFlowsImport;if(c(".cartflows-step-import-blank").addClass("disabled"),c(".cartflows-step-import").addClass("disabled"),s.addClass("importing updating-message").text("Importing.."),c("body").hasClass("post-type-cartflows_flow")){var n={action:"cartflows_step_import",flow_id:i,template_id:l,step_title:step_custom_title,step_type:p,security:cartflows_admin.cf_step_import_nonce};o._ajax(n,function(t){CartFlowsImport;var e=s.parents(".template.importing");t.request.success?(s.text("Imported. Reloading.."),setTimeout(function(){window.location.href=window.location.href+"&highlight-step-id="+t.request.data},3e3)):(c(".wcf-templates-popup-overlay").removeClass("request-process"),s.removeClass("importing updating-message").text("Import Failed!"),e.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.request.data))},"add_template_to_page")}}},_add_template_to_page_fail:function(t,e,s){t.preventDefault();CartFlowsImport;var a=c(".wcf-flow-steps-data-wrap-importer .template.importing");a.find(".cartflows-step-import").removeClass("importing updating-message").text("Import Failed!"),a.find(".preview").addClass("notice notice-warning").removeClass("preview").text(e.responseText)},_activateWc:function(t){c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:"woocommerce/woocommerce.php",security:CartFlowsImportVars.cartflows_activate_plugin_nonce}}).done(function(t,e,s){c(".wcf-notice-wrap").addClass("wcf-hidden"),c(".cartflows-template-selector").removeAttr("disabled"),CartFlowsImport.wc_installed=!0,CartFlowsImportVars.is_wc_installed="yes",CartFlowsImportVars.is_wc_activated="yes",location.reload(!0),window.location.search+="&add-new-flow"})},_installWc:function(t){c(this).addClass("updating-message button"),c(this).text(cartflows_admin.wc_activating_message),0==cartflows_admin.wc_status.installed?(wp.updates.shouldRequestFilesystemCredentials&&!wp.updates.ajaxLocked&&(wp.updates.requestFilesystemCredentials(t),$document.on("credential-modal-cancel",function(){c(".install-now.updating-message").removeClass("updating-message").text(wp.updates.l10n.installNow),wp.a11y.speak(wp.updates.l10n.updateCancel,"polite")})),wp.updates.installPlugin({slug:"woocommerce"})):CartFlowsImport._activateWc()}},c(function(){CartFlowsImport.init()})}(jQuery);
1
+ var CartFlowsAjaxQueue=function(){var a=[];return{add:function(t){a.push(t)},remove:function(t){-1<jQuery.inArray(t,a)&&a.splice($.inArray(t,a),1)},run:function(){var t,e=this;a.length?(t=a[0].complete,a[0].complete=function(){"function"==typeof t&&t(),a.shift(),e.run.apply(e,[])},jQuery.ajax(a[0])):e.tid=setTimeout(function(){e.run.apply(e,[])},1e3)},stop:function(){a=[],clearTimeout(this.tid)}}}();!function(c){CartFlowsImport={doc:c(document),wrap:c(".wcf-flow-steps-data-wrap"),inner:c(".wcf-flow-steps-data-wrap-importer"),post_id:c("#post_ID").val(),_ref:null,_api_step_type:{},_api_params:{},all_steps:0,remaining_steps:0,remaining_install_plugins:0,remaining_active_plugins:0,woo_required_steps:["checkout","upsell","downsell","thankyou","optin"],step_order:["landing","checkout","upsell","downsell","thankyou","optin"],new_step_names:{landing:"Landing",checkout:"Checkout (Woo)",upsell:"Upsell (Woo)",downsell:"Downsell (Woo)",thankyou:"Thank You (Woo)",optin:"Optin (Woo)"},init:function(){if(this._bind(),"other"!==CartFlowsImportVars.default_page_builder&&(c(".post-type-cartflows_flow").hasClass("edit-php")&&this._process_cache_remote_flows(),c(".post-type-cartflows_flow").hasClass("post-php")&&this._process_cache_remote_steps()),c(".post-type-cartflows_flow").hasClass("edit-php")&&null!==this._getParamFromURL("add-new-flow")&&this._render_remote_flows(),c(".post-type-cartflows_flow").hasClass("post-php")&&null!==this._getParamFromURL("add-new-step")&&this._render_remote_steps(),this._getParamFromURL("highlight-step-id")){var t=c('.wcf-step-wrap[data-id="'+this._getParamFromURL("highlight-step-id")+'"]');t.length&&c("html, body").animate({scrollTop:t.offset().top},1500)}if(c(".post-type-cartflows_flow").hasClass("edit-php")){var e=c(".edit-php.post-type-cartflows_flow").find(".page-title-action:first");e.after('<a href="'+CartFlowsImportVars.export_url+'" class="page-title-action">Export</a>'),e.after('<a href="'+CartFlowsImportVars.import_url+'" class="page-title-action">Import</a>')}},_getParamFromURL:function(t,e){e=e||window.location.href,t=t.replace(/[\[\]]/g,"\\$&");var a=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null},_bind:function(){var t=CartFlowsImport;t.doc.on("click",".wcf-install-plugin",t._install_plugin),t.doc.on("cartflows-api-request-fail",t._api_request_failed),t.doc.on("click","#wcf-get-started-steps a, .wcf-create-from-scratch-link",t._toggle_ready_templates),t.doc.on("click",".cartflows-flow-import-blank",t._create_default_flow),t.doc.on("click","#wcf-remote-flow-importer .wcf-page-builder-links a",t._filterFlowPageBuilderClick),t.doc.on("click","#wcf-remote-step-importer #wcf-categories .step-type-filter-links a",t._filterBlankStepCategoryClick),t.doc.on("change","#wcf-remote-step-importer #wcf-scratch-steps-categories .step-type-filter-links",t._filterBlankStepCategoryChange),t.doc.on("click","#wcf-get-started-steps",t._filterBlankStepCategoryChange),t.doc.on("click","#wcf-remote-step-importer .wcf-page-builder-links a",t._filterStepPageBuilderClick),t.doc.on("click",".cartflows-step-import-blank:not(.get-pro)",t._create_blank_step),t.doc.on("click","#wcf-remote-step-importer .cartflows-step-import",t._process_import_step),t.doc.on("click","#wcf-remote-flow-importer .cartflows-step-import",t._process_import_flow),t.doc.on("click",".cartflows-preview-flow-step",t._preview_individual),t.doc.on("add_template_to_page-fail",t._add_template_to_page_fail),c("body").on("thickbox:iframe:loaded",t._previewLoaded),c(document).on("keyup input","#wcf-remote-step-importer .wcf-flow-search-input",t._remote_step_search),c(document).on("click",".actions a",t._previewResponsive),c(document).on("click",".page-title-action:first",t._render_remote_flows),c(document).on("click",".wcf-trigger-popup",t._render_remote_steps),c(document).on("click",".wcf-templates-popup-overlay",t._close_template_popup),c(document).on("click",".wcf-popup-close-wrap .close-icon",t._close_template_popup),c(document).on("wp-plugin-install-success",t._installSuccess),c(document).on("click",".wcf-activate-wc",t._installWc)},_install_plugin:function(t){t.preventDefault();var e=c(this);if(!e.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process"),c("#wcf-remote-step-importer").addClass("request-process"),e.addClass("updating-message button");var a=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(a,function(t,e){"install"===e.status&&CartFlowsImport.remaining_install_plugins++,"activate"===e.status&&CartFlowsImport.remaining_active_plugins++}),CartFlowsImport.remaining_install_plugins?CartFlowsImport._install_all_plugins():CartFlowsImport.remaining_active_plugins?CartFlowsImport._activate_all_plugins():c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps()}},_install_all_plugins:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(t,function(t,e){"install"===e.status&&wp.updates.queue.push({action:"install-plugin",data:{slug:e.slug}})}),wp.updates.queueChecker()},_activate_all_plugins:function(){if(CartFlowsImport.remaining_active_plugins||CartFlowsImport.remaining_install_plugins){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;CartFlowsAjaxQueue.stop(),CartFlowsAjaxQueue.run(),c.each(t,function(t,e){"activate"===e.status&&CartFlowsAjaxQueue.add({url:CartFlowsImportVars.ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:e.init,security:CartFlowsImportVars.cartflows_activate_plugin_nonce},success:function(t){CartFlowsImport.remaining_active_plugins--,CartFlowsImport.remaining_active_plugins||CartFlowsImport.remaining_install_plugins||(c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps())}})})}else c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps()},_installSuccess:function(t,a){t.preventDefault(),"no"===CartFlowsImportVars.is_wc_activated&&CartFlowsImport._activateWc();var e=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(e,function(t,e){"install"===e.status&&a.slug===e.slug&&c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:e.init,security:CartFlowsImportVars.cartflows_activate_plugin_nonce}}).done(function(t,e,a){CartFlowsImport.remaining_install_plugins--,CartFlowsImport.remaining_install_plugins||CartFlowsImport._activate_all_plugins()})})},_api_request_failed:function(t,e,a,s){"error"==s&&(c("#wcf-remote-content-failed").length||c("#wcf-ready-templates").html(wp.template("cartflows-website-unreachable")))},_toggle_ready_templates:function(t){t.preventDefault();var e=c(this).data("slug")||"";c("#wcf-get-started-steps").find("a").removeClass("current"),c("#wcf-get-started-steps").find('a[data-slug="'+e+'"]').addClass("current"),"canvas"==e?(c("#wcf-ready-templates").hide(),c("#wcf-start-from-scratch").show()):(c("#wcf-ready-templates").show(),c("#wcf-start-from-scratch").hide()),!c(".wcf-page-builder-notice").length&&c("#wcf-remote-step-importer").length&&CartFlowsImport._showSteps()},_switch_step_tab:function(t){t.preventDefault();var e=c(".wcf-tab > li.active > a").attr("href");c(".wcf-tab > li.active").removeClass("active"),c(this).parents("li").addClass("active"),c(e).removeClass("active"),c(e).addClass("hide");var a=c(this).attr("href");c(a).removeClass("hide"),c(a).addClass("active")},_remote_step_search:function(t){t.preventDefault(),c(".step-type-filter-links").find("option").removeClass("current"),c(".step-type-filter-links").find("option:first-child").addClass("current"),window.clearTimeout(CartFlowsImport._ref),CartFlowsImport._ref=window.setTimeout(function(){CartFlowsImport._ref=null,CartFlowsImport._showSteps()},500)},_previewResponsive:function(t){t.preventDefault();var e=c(this).find(".dashicons"),a=e.attr("data-view")||"";c("#TB_window").removeClass("desktop tablet mobile"),c("#TB_window").addClass(a),c(".actions .dashicons").removeClass("active"),e.addClass("active"),c("#TB_iframeContent").removeClass(),c("#TB_iframeContent").addClass(a)},_filterStepPageBuilderClick:function(t){t.preventDefault(),c(this).parents("ul").find("a").removeClass("current"),c(this).addClass("current");var e=c(".step-type-filter-links .current").data("slug")||"";"upsell"===e||"downsell"===e?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),c(".wcf-page-builder-notice").html(""),c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps()},_filterBlankStepCategoryClick:function(t){t.preventDefault(),c(".wcf-page-builder-notice").html("");var e=c(this).data("group")||"";e&&(c("#wcf-scratch-steps-categories .step-type-filter-links").val(e),c("#wcf-scratch-steps-categories .step-type-filter-links option").removeClass("current"),c('#wcf-scratch-steps-categories .step-type-filter-links option[data-group="'+e+'"]').addClass("current")),c(".step-type-filter-links").find("a").removeClass("current"),c(this).addClass("current"),$step_type=c(this).data("slug"),"upsell"===$step_type||"downsell"===$step_type?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),""!=CartFlowsImportVars._is_pro_active||"upsell"!=$step_type&&"downsell"!=$step_type?(c(".cartflows-step-import-blank").text("Create Step"),c(".cartflows-step-import-blank").removeClass("get-pro"),c(".cartflows-step-import-blank").removeAttr("target")):(c(".cartflows-step-import-blank").text("Get Pro"),c(".cartflows-step-import-blank").attr("href",CartFlowsImportVars.domain_url),c(".cartflows-step-import-blank").attr("target","_blank"),c(".cartflows-step-import-blank").addClass("get-pro")),c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps()},_filterBlankStepCategoryChange:function(t){t.preventDefault(),c(".wcf-notice-wrap").remove(),c(".cartflows-step-import-blank").css("pointer-events","auto").removeClass("disabled");var e=c(".step-type-filter-links").find("option:selected").val()||"";if(e&&(c(".step-type-filter-links").val(e),c(".step-type-filter-links").find("a").removeClass("current"),c(".step-type-filter-links").find('a[data-group="'+e+'"]').addClass("current")),c(".step-type-filter-links").find("option").removeClass("current"),c(".step-type-filter-links").find("option:selected").addClass("current"),$step_type=c(".step-type-filter-links").find("option:selected").data("slug"),!("no"!==CartFlowsImportVars.is_wc_installed&&"no"!==CartFlowsImportVars.is_wc_activated||"upsell"!==$step_type&&"downsell"!==$step_type&&"checkout"!==$step_type&&"thankyou"!==$step_type))return c(".cartflows-step-import-blank").after("<p class='wcf-notice-wrap' style='text-align: center'>You need WooCommerce plugin installed and actived to use this product flow. <br/><br/> <a href='#' class='wcf-activate-wc button-secondary'> Click here to install and activate WooCommerce </a> </p>"),void c(".cartflows-step-import-blank").addClass("disabled").css("pointer-events","none");"upsell"===$step_type||"downsell"===$step_type?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),""!=CartFlowsImportVars._is_pro_active||"upsell"!=$step_type&&"downsell"!=$step_type?(c(".cartflows-step-import-blank").text("Create Step"),c(".cartflows-step-import-blank").removeClass("get-pro"),c(".cartflows-step-import-blank").removeAttr("target")):(c(".cartflows-step-import-blank").text("Get Pro"),c(".cartflows-step-import-blank").attr("href",CartFlowsImportVars.domain_url),c(".cartflows-step-import-blank").attr("target","_blank"),c(".cartflows-step-import-blank").addClass("get-pro")),!c(".wcf-page-builder-notice").length&&c("#wcf-remote-step-importer").length&&(c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps())},_showSteps:function(){var t={licence_args:CartFlowsImportVars.licence_args,per_page:15,_fields:CartFlowsImportVars.step_fields.toString()},e=c("#wcf-categories .step-type-filter-links").find(".current").data("group")||"",s=c("#wcf-categories .step-type-filter-links").find(".current").data("slug");""!==e&&"all"!==e&&(t[CartFlowsImportVars.step_type]=e);e=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("group")||"",s=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("slug")||"";var r=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("title")||"Page Builder";""!==e&&"all"!==e&&(t[CartFlowsImportVars.step_page_builder]=e);var a={remote_slug:CartFlowsImportVars.step,slug:CartFlowsImportVars.step+"?"+decodeURIComponent(c.param(t))};CartFlowsAPI._api_request(a,function(a){a.current_step_type=s,"yes"!==CartFlowsImportVars.is_wc_activated&&c.each(a.items,function(t,e){a.items[t].woo_required=!1,0<=c.inArray(e.step_type.slug,CartFlowsImport.woo_required_steps)&&(a.items[t].woo_required=!0)});var t=wp.template("cartflows-steps-list");parseInt(a.items_count)?c("#wcf-remote-step-list").html(t(a)):(c("#wcf-remote-step-list").html(wp.template("cartflows-no-steps")),c(".cartflows-no-steps").find(".description").html("We are working on ready templates designed with "+r+'.<br/>Meanwhile you can <a href="#" data-slug="canvas" class="wcf-create-from-scratch-link">create your own designs</a> easily.')),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-step-importer").removeClass("request-process")})},_apiAddParam_per_page:function(){CartFlowsImport._api_params.per_page=15},_apiAddParam_licence_args:function(){CartFlowsImport._api_params.licence_args=CartFlowsImportVars.licence_args},_apiAddParam_search:function(){var t=c(".wcf-flow-search-input").val()||"";""!==t&&(CartFlowsImport._api_params.search=t)},_close_popup:function(){c("#cartflows-steps").fadeOut(),c("body").removeClass("cartflows-popup-is-open")},_post_auto_save:function(){var t=c("#title"),e=c("#title-prompt-text"),a=CartFlowsImport;t.val()||(t.val("CartFlows #"+a.post_id),e.length&&e.remove()),wp.autosave&&wp.autosave.server.triggerSave()},_process_cache_remote_flows:function(){if("gutenberg"==CartFlowsImportVars.default_page_builder)CartFlowsImport._cache_remote_flows();else{var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins,a=!0;c.each(t,function(t,e){a&&("install"!==e.status&&"activate"!==e.status||(a=!1))}),!1===a?(c(".wcf-page-builder-notice").html(wp.template("cartflows-page-builder-notice")),c("#wcf-remote-flow-list").find(".spinner").remove()):CartFlowsImport._cache_remote_flows()}},_cache_remote_flows:function(){CartFlowsImport;var t={search:CartFlowsImportVars.default_page_builder,licence_args:CartFlowsImportVars.licence_args,hide_empty:!1,_fields:CartFlowsImportVars.flow_page_builder_fields.toString()},e={remote_slug:CartFlowsImportVars.flow_page_builder,slug:CartFlowsImportVars.flow_page_builder+"?"+decodeURIComponent(c.param(t)),wrapper_class:"wcf-page-builder-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-page-builders").html(e(t)),c("#wcf-page-builders").find("li:first a").addClass("current");var a={licence_args:CartFlowsImportVars.licence_args,hide_empty:!0,_fields:CartFlowsImportVars.flow_type_fields.toString()},s={remote_slug:CartFlowsImportVars.flow_type,slug:CartFlowsImportVars.flow_type+"?"+decodeURIComponent(c.param(a)),wrapper_class:"flow-type-filter-links filter-links",show_all:!1};CartFlowsAPI._api_request(s,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-categories").html(e(t)),c("#wcf-categories").find("li:first a").addClass("current"),CartFlowsImport._showFlows()})})},_render_remote_flows:function(t){t&&t.preventDefault(),c("#wcf-remote-flow-importer").addClass("open"),c("html").addClass("wcf-popup-open")},_process_cache_remote_steps:function(){if("gutenberg"==CartFlowsImportVars.default_page_builder)CartFlowsImport._cache_remote_steps();else{var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins,a=!0;c.each(t,function(t,e){a&&("install"!==e.status&&"activate"!==e.status||(a=!1))}),!1===a?(c(".wcf-page-builder-notice").html(wp.template("cartflows-page-builder-notice")),c("#wcf-remote-step-list").find(".spinner").remove()):CartFlowsImport._cache_remote_steps()}},mapOrder:function(t,r,o){return t.sort(function(t,e){var a=t[o],s=e[o];return-1===r.indexOf(a)?0:r.indexOf(a)>r.indexOf(s)?1:-1}),t},_cache_remote_steps:function(){CartFlowsImport;c("html").addClass("wcf-steps-loading");var t={search:CartFlowsImportVars.default_page_builder,licence_args:CartFlowsImportVars.licence_args,hide_empty:!1,_fields:CartFlowsImportVars.step_page_builder_fields.toString()},e={remote_slug:CartFlowsImportVars.step_page_builder,slug:CartFlowsImportVars.step_page_builder+"?"+decodeURIComponent(c.param(t)),wrapper_class:"wcf-page-builder-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-page-builders").html(e(t)),c("#wcf-page-builders").find("li:first a").addClass("current")});t={licence_args:CartFlowsImportVars.licence_args,_fields:CartFlowsImportVars.step_type_fields.toString()},e={remote_slug:CartFlowsImportVars.step_type,slug:CartFlowsImportVars.step_type+"?"+decodeURIComponent(c.param(t)),wrapper_class:"step-type-filter-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){t.items=CartFlowsImport.mapOrder(t.items,CartFlowsImport.step_order,"slug");var s=t,r=t.items_count;if(t.items)for(key in t.items){t.items[key].name=CartFlowsImport.new_step_names[t.items[key].slug];var e={licence_args:CartFlowsImportVars.licence_args,per_page:15,_fields:CartFlowsImportVars.step_fields.toString()};e[CartFlowsImportVars.step_type]=t.items[key].id;var a={remote_slug:CartFlowsImportVars.step,slug:CartFlowsImportVars.step+"?"+decodeURIComponent(c.param(e))};CartFlowsAPI._api_request(a,function(t){var e=wp.template("cartflows-steps-list");if(parseInt(t.items_count)?c("#wcf-remote-step-list").html(e(t)):c("#wcf-remote-step-list").html(wp.template("cartflows-no-steps")),0==--r){var a=wp.template("cartflows-term-filters-dropdown");e=wp.template("cartflows-term-filters");c("#wcf-categories").html(e(s)),c("#wcf-scratch-steps-categories").html(a(s)),c("#wcf-scratch-steps-categories").find("option:first").addClass("current"),c("#wcf-categories").find("li a[data-slug=landing]").addClass("current"),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-content").find(".spinner").remove(),CartFlowsImport._showSteps(),c("html").removeClass("wcf-steps-loading")}})}})},_render_remote_steps:function(t){t&&t.preventDefault(),c("#wcf-remote-step-importer").addClass("open"),c("html").addClass("wcf-popup-open")},_categorize_data:function(t){var s=[];return c.each(t,function(t,e){var a=e.step_type.slug;void 0===s[a]&&(s[a]=[]),s[a].push(e)}),s},_close_template_popup:function(t){(c(t.target).hasClass("wcf-templates-popup-overlay")||c(t.target).hasClass("close-icon"))&&(c(".wcf-templates-popup-overlay").hasClass("request-process")||(c("html").removeClass("wcf-popup-open"),c(".wcf-templates-popup-overlay").removeClass("open")))},_ajax:function(t,s,r){var o=CartFlowsImport;c.ajax({url:ajaxurl,type:"POST",data:t}).done(function(t,e,a){s&&"function"==typeof s&&s({request:t,status:e,XHR:a}),o.doc.trigger(r+"-done",[t,e,a])}).fail(function(t,e){o.doc.trigger(r+"-fail",[t,e])}).always(function(){o.doc.trigger(r+"-always")})},_load_templates:function(t,s){var r=CartFlowsImport;c("body").hasClass("processing")||(c("body").addClass("processing"),c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_load_steps",security:cartflows_admin.cf_load_steps_nonce,args:t}}).done(function(t,e,a){r.doc.trigger(s,[t]),c("body").removeClass("processing")}).fail(function(t,e){}).always(function(){}))},_empty:function(t){if("number"==typeof t||"boolean"==typeof t)return!1;if(null==t)return!0;if(void 0!==t.length)return 0==t.length;var e=0;for(var a in t)t.hasOwnProperty(a)&&e++;return 0==e},_preview_individual:function(){var t=c(this).data("id")||"",e=c(this).data("href")||"";c(".cartflows-preview-flow-step").removeClass("active"),c('.cartflows-preview-flow-step[data-id="'+t+'"]').addClass("active"),c("#TB_window").addClass("cartflows-thickbox-loading"),c("#TB_iframeContent").removeAttr("onload"),c("#TB_iframeContent").removeAttr("src"),c("#TB_iframeContent").attr("src",e),c("#TB_iframeContent").attr("onload","CartFlowsImport.showIframe()")},showIframe:function(){c("#TB_load").remove(),c("#TB_window").css({visibility:"visible"}),c("#TB_window").removeClass("cartflows-thickbox-loading")},_previewLoaded:function(t){t.preventDefault(),c("#TB_window").removeClass("cartflows-thickbox-loading")},_filterFlowPageBuilderClick:function(t){t.preventDefault(),c(this).parents("ul").find("a").removeClass("current"),c(this).addClass("current"),c(".wcf-page-builder-notice").html(""),c("#wcf-remote-flow-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showFlows()},_showFlows:function(){var t={licence_args:CartFlowsImportVars.licence_args,_fields:CartFlowsImportVars.flow_fields.toString()},e=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("group")||"";c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("slug"),c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("title");""!==e&&"all"!==e&&(t[CartFlowsImportVars.flow_page_builder]=e);var a={remote_slug:CartFlowsImportVars.flow,slug:CartFlowsImportVars.flow+"?"+decodeURIComponent(c.param(t))};CartFlowsAPI._api_request(a,function(s){"yes"!==CartFlowsImportVars.is_wc_activated&&c.each(s.items,function(a,t){s.items[a].woo_required=!1,c.each(t.flow_steps,function(t,e){0<=c.inArray(e.type,CartFlowsImport.woo_required_steps)&&(s.items[a].woo_required=!0)})});var t=wp.template("cartflows-flows-list");parseInt(s.items_count)?c("#wcf-remote-flow-list").html(t(s)):c("#wcf-remote-flow-list").html(wp.template("cartflows-no-flows")),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-flow-importer").removeClass("request-process")})},_create_default_flow:function(t){t.preventDefault();var e=CartFlowsImport,a=c(this);if(!a.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process"),a.addClass("updating-message").text("Creating Flow.."),a.parents(".template").addClass("importing");var s={action:"cartflows_default_flow",security:cartflows_admin.cf_default_flow_nonce};e._ajax(s,function(t){if(t.request.success){var e=t.request.data;setTimeout(function(){a.removeClass("updating-message").text("Flow Created! Redirecting.."),window.location=CartFlowsImportVars.admin_url+"post.php?post="+e+"&action=edit"},3e3)}})}},_activate_plugin:function(t){var e=CartFlowsImport,a={action:"cartflows_activate_plugin",plugin_init:t,security:CartFlowsImportVars.cartflows_activate_plugin_nonce};e._ajax(a,function(t){})},_process_import_flow:function(t){t.preventDefault();var s=c(this);if(!s.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process");var e=CartFlowsImport;s.text("Creating Flow.."),s.addClass("updating-message"),s.parents(".template").addClass("importing");var a=s.data("flow-steps")||"",r=""!==a?JSON.parse("["+a+"]"):[],o={action:"cartflows_create_flow",security:cartflows_admin.cf_create_flow_nonce};e._ajax(o,function(t){if(t.request.success){var a=t.request.data;r&&(CartFlowsAjaxQueue.stop(),CartFlowsAjaxQueue.run(),CartFlowsImport.all_steps=r.length,s.addClass("updating-message").text("Importing Step 1 of "+CartFlowsImport.all_steps),c.each(r,function(t,e){CartFlowsAjaxQueue.add({url:CartFlowsImportVars.ajaxurl,type:"POST",data:{action:"cartflows_import_flow_step",flow_id:a,template_id:e,security:cartflows_admin.cf_import_flow_step_nonce},success:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Imported Step "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message").text("All Imported! Redirecting.."),window.location=CartFlowsImportVars.admin_url+"post.php?post="+a+"&action=edit"},3e3)):s.addClass("updating-message").text("Importing Step "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)},error:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,template=s.parents(".template.importing"),template.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.statusText),CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Failed "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message button-primary").addClass("disabled")},3e3)):s.addClass("updating-message").text("Failed "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)},fail:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Imported "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message").text("All Step Imported! Reloading.."),location.reload()},3e3)):s.addClass("updating-message").text("Importing "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)}})}))}})}},_handle_error:function(t){c(".cartflows-step-import.updating-message").addClass("updating-message").text(t.errorMessage)},_create_blank_step:function(t){t.preventDefault();var a=c(this),e=CartFlowsImport,s=c("#post_ID").val(),r=c("#wcf-scratch-steps-categories .step-type-filter-links .current").data("slug")||"",o=c("#wcf-scratch-steps-categories .step-type-filter-links .current").data("title")||"",l=r,i=c('.wcf-step-wrap[data-term-slug="'+r+'"]').length||1,p=o+" "+(parseInt(i)+1);if(all_step_type=["landing","checkout","thankyou"],c("#wcf-start-from-scratch .wcf-notice-wrap ").remove(),""!==l){if(CartFlowsImportVars._is_pro_active||"upsell"!==l&&"downsell"!==l){if(a.parents(".template").addClass("importing"),!CartFlowsImportVars._is_pro_active)if("-1"!=jQuery.inArray(l,all_step_type))if(0<c('.wcf-step-wrap[data-term-slug="'+l+'"]').length){a.parents(".template.importing");return a.removeClass("importing updating-message").text("Import Failed!"),void c("#wcf-start-from-scratch .inner").append('<div class="wcf-notice-wrap"><div class="notice notice-warning"><p>Upgrade to Pro for adding more than one '+l.charAt(0).toUpperCase()+l.slice(1)+" step.</p></div></div>")}if(c("#wcf-remote-step-importer").addClass("request-process"),c(".cartflows-step-import").addClass("disabled"),a.addClass("importing updating-message").text("Creating.."),c("body").hasClass("post-type-cartflows_flow")){var n={action:"cartflows_step_create_blank",flow_id:s,step_type:l,step_title:p,security:cartflows_admin.cf_step_create_blank_nonce};e._ajax(n,function(t){CartFlowsImport;var e=a.parents(".template.importing");t.request.success?(a.text("Created. Reloading.."),setTimeout(function(){window.location.href=window.location.href+"&highlight-step-id="+t.request.data},3e3)):(a.removeClass("importing updating-message").text("Creating Failed!"),c("#wcf-remote-step-importer").removeClass("request-process"),e.find(".cartflows-step-preview").append("<div class='preview'></div>"),e.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.request.data))})}}}else c("#wcf-start-from-scratch .inner").append('<div class="wcf-notice-wrap"><div class="notice notice-info"><p>Please select the step type.</p></div></div>')},_process_import_step:function(t){t.preventDefault();var a=c(this),e=a.data("slug")||"",s=c('.wcf-step-wrap[data-term-slug="'+e+'"]').length||1;if((step_title=a.data("title")||"",step_custom_title=step_title+" "+(parseInt(s)+1),o=CartFlowsImport,all_step_slug=["landing","checkout","thankyou"],!CartFlowsImportVars._is_pro_active)&&("-1"!=jQuery.inArray(e,all_step_slug)&&0<c('.wcf-step-wrap[data-term-slug="'+e+'"]').length)){var r=a.parents(".template");return a.removeClass("importing updating-message").text("Import Failed!"),r.find(".preview").hide(),r.find("#wcf_create_notice").show().find("a").addClass("notice notice-warning ").text("Upgrade to Pro for adding more than one "+e.charAt(0).toUpperCase()+e.slice(1)+" step"),void c("#wcf-remote-step-importer").removeClass("request-process")}if(!a.hasClass("updating-message")){c("#wcf-remote-step-importer").addClass("request-process");var o=CartFlowsImport;a.addClass("updating-message"),a.parents(".template").addClass("importing");var l=a.data("template-id")||"",i=c("#post_ID").val(),p=e;o=CartFlowsImport;if(c(".cartflows-step-import-blank").addClass("disabled"),c(".cartflows-step-import").addClass("disabled"),a.addClass("importing updating-message").text("Importing.."),c("body").hasClass("post-type-cartflows_flow")){var n={action:"cartflows_step_import",flow_id:i,template_id:l,step_title:step_custom_title,step_type:p,security:cartflows_admin.cf_step_import_nonce};o._ajax(n,function(t){CartFlowsImport;var e=a.parents(".template.importing");t.request.success?(a.text("Imported. Reloading.."),setTimeout(function(){window.location.href=window.location.href+"&highlight-step-id="+t.request.data},3e3)):(c(".wcf-templates-popup-overlay").removeClass("request-process"),a.removeClass("importing updating-message").text("Import Failed!"),e.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.request.data))},"add_template_to_page")}}},_add_template_to_page_fail:function(t,e,a){t.preventDefault();CartFlowsImport;var s=c(".wcf-flow-steps-data-wrap-importer .template.importing");s.find(".cartflows-step-import").removeClass("importing updating-message").text("Import Failed!"),s.find(".preview").addClass("notice notice-warning").removeClass("preview").text(e.responseText)},_activateWc:function(t){c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:"woocommerce/woocommerce.php",security:CartFlowsImportVars.cartflows_activate_plugin_nonce}}).done(function(t,e,a){c(".wcf-notice-wrap").addClass("wcf-hidden"),c(".cartflows-template-selector").removeAttr("disabled"),CartFlowsImport.wc_installed=!0,CartFlowsImportVars.is_wc_installed="yes",CartFlowsImportVars.is_wc_activated="yes",location.reload(!0),window.location.search+="&add-new-flow"})},_installWc:function(t){c(this).addClass("updating-message button"),c(this).text(cartflows_admin.wc_activating_message),0==cartflows_admin.wc_status.installed?(wp.updates.shouldRequestFilesystemCredentials&&!wp.updates.ajaxLocked&&(wp.updates.requestFilesystemCredentials(t),$document.on("credential-modal-cancel",function(){c(".install-now.updating-message").removeClass("updating-message").text(wp.updates.l10n.installNow),wp.a11y.speak(wp.updates.l10n.updateCancel,"polite")})),wp.updates.installPlugin({slug:"woocommerce"})):CartFlowsImport._activateWc()}},c(function(){CartFlowsImport.init()})}(jQuery);
assets/min-js/optin-template.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(r){function t(){function a(e,t,c,o){""==e||"select"==o&&" "==e?t.hasClass("validate-required")&&c.addClass("field-required"):c.removeClass("field-required")}var e=r("form.woocommerce-checkout #customer_details"),t=e.find("input, textarea"),c=e.find("select");t.blur(function(){var e=r(this),t=e.attr("type"),c=e.closest("p.form-row"),o=e.val();a(o,c,e,t)}),c.blur(function(){var e=r(this).closest("p.form-row"),t=e.find(".select2-container--default"),c=e.find("select").val();a(c,e,t,"select")})}function c(){if("yes"==cartflows.allow_persistance&&!1!==function(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}()){var e="form.woocommerce-checkout #customer_details",t=function(){var e=[],t=r("form.woocommerce-checkout #customer_details");localStorage.removeItem("cartflows_checkout_form"),t.find("input[type=text], select, input[type=email], input[type=tel]").each(function(){e.push({name:this.name,value:this.value})}),cartflows_checkout_form=JSON.stringify(e),localStorage.setItem("cartflows_checkout_form",cartflows_checkout_form)};(function(){if(null!=localStorage.getItem("cartflows_checkout_form")){checkout_data=JSON.parse(localStorage.getItem("cartflows_checkout_form"));for(var e=0;e<checkout_data.length;e++)r("form.woocommerce-checkout [name="+checkout_data[e].name+"]").hasClass("select2-hidden-accessible")?r("form.woocommerce-checkout [name="+checkout_data[e].name+"]").selectWoo("val",[checkout_data[e].value]):r("form.woocommerce-checkout [name="+checkout_data[e].name+"]").val(checkout_data[e].value)}})(),r(e+" input, "+e+" select").change(function(){t()})}}r(document).ready(function(e){c(),t()})}(jQuery);
cartflows.php CHANGED
@@ -3,12 +3,12 @@
3
  * Plugin Name: CartFlows
4
  * Plugin URI: https://cartflows.com/
5
  * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
- * Version: 1.3.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.7.0
12
  *
13
  * @package CartFlows
14
  */
3
  * Plugin Name: CartFlows
4
  * Plugin URI: https://cartflows.com/
5
  * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
+ * Version: 1.4.1
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.9.1
12
  *
13
  * @package CartFlows
14
  */
changelog.txt CHANGED
@@ -1,3 +1,11 @@
 
 
 
 
 
 
 
 
1
  Version 1.3.5 - Tuesday, 28th January 2020
2
  - New: Option added for thank you page redirection.
3
  - Fix: Pro version's two-step CSS conflict with the DIVI, the second tab was not displaying.
1
+ Version 1.4.1 - Thursday, 13th February 2020
2
+ - Fix: Optin step was redirecting to the global checkout.
3
+
4
+ Version 1.4.0 - Tuesday, 11th February 2020
5
+ - New: Introduced a new optin step type for lead generation.
6
+ - Improvement: Added compatibility for a future release of CartFlows Pro.
7
+ - Fix: Fatal Error while editing the page in elementor preview mode if the WooCommerce is not installed.
8
+
9
  Version 1.3.5 - Tuesday, 28th January 2020
10
  - New: Option added for thank you page redirection.
11
  - Fix: Pro version's two-step CSS conflict with the DIVI, the second tab was not displaying.
classes/class-cartflows-admin.php CHANGED
@@ -1,620 +1,620 @@
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
- public static 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
- /*
39
- Add CARTFLOWS menu option to admin.
40
- add_action( 'network_admin_menu', __CLASS__ . '::menu' );
41
- */
42
- add_action( 'admin_menu', __CLASS__ . '::menu' );
43
- add_action( 'admin_menu', __CLASS__ . '::submenu', 999 );
44
-
45
- add_action( 'cartflows_render_admin_content', __CLASS__ . '::render_content' );
46
-
47
- add_action( 'admin_init', __CLASS__ . '::settings_admin_scripts' );
48
-
49
- /* Global Addmin Script */
50
- add_action( 'admin_enqueue_scripts', __CLASS__ . '::global_admin_scripts', 20 );
51
-
52
- add_action( 'admin_footer', __CLASS__ . '::global_admin_data', 9555 );
53
-
54
- /* Add lite version class to body */
55
- add_action( 'admin_body_class', __CLASS__ . '::add_admin_body_class' );
56
-
57
- add_filter( 'plugin_action_links_' . CARTFLOWS_BASE, __CLASS__ . '::add_action_links' );
58
-
59
- add_action( 'admin_init', __CLASS__ . '::cartflows_after_save_permalinks' );
60
-
61
- }
62
-
63
- /**
64
- * After save of permalinks.
65
- */
66
- public static function cartflows_after_save_permalinks() {
67
-
68
- $has_saved_permalinks = get_option( 'cartflows_permalink_saved' );
69
- if ( $has_saved_permalinks ) {
70
- flush_rewrite_rules();
71
- delete_option( 'cartflows_permalink_saved' );
72
- }
73
- }
74
-
75
-
76
- /**
77
- * Initialize after Cartflows pro get loaded.
78
- */
79
- public static function settings_admin_scripts() {
80
- // Enqueue admin scripts.
81
- if ( isset( $_REQUEST['page'] ) && CARTFLOWS_SETTINGS === $_REQUEST['page'] ) { //phpcs:ignore
82
- add_action( 'admin_enqueue_scripts', __CLASS__ . '::styles_scripts' );
83
-
84
- self::save_settings();
85
- }
86
- }
87
- /**
88
- * Show action on plugin page.
89
- *
90
- * @param array $links links.
91
- * @return array
92
- */
93
- public static function add_action_links( $links ) {
94
- $mylinks = array(
95
- '<a href="' . admin_url( 'admin.php?page=' . CARTFLOWS_SETTINGS ) . '">Settings</a>',
96
- '<a target="_blank" href="' . esc_url( 'https://cartflows.com/docs' ) . '">Docs</a>',
97
- );
98
-
99
- if ( ! _is_cartflows_pro() ) {
100
- array_push( $mylinks, '<a style="color: #39b54a; font-weight: bold;" target="_blank" href="' . esc_url( 'https://cartflows.com/pricing/' ) . '"> Go Pro </a>' );
101
- }
102
-
103
- return array_merge( $links, $mylinks );
104
- }
105
-
106
- /**
107
- * Initialises the Plugin Name.
108
- *
109
- * @since 1.0.0
110
- * @return void
111
- */
112
- public static function initialise_plugin() {
113
-
114
- $name = 'Cartflows';
115
- $short_name = 'Cflows';
116
-
117
- define( 'CARTFLOWS_PLUGIN_NAME', $name );
118
- define( 'CARTFLOWS_PLUGIN_SHORT_NAME', $short_name );
119
- }
120
-
121
- /**
122
- * Renders the admin settings menu.
123
- *
124
- * @since 1.0.0
125
- * @return void
126
- */
127
- public static function menu() {
128
-
129
- if ( ! current_user_can( 'manage_options' ) ) {
130
- return;
131
- }
132
-
133
- add_menu_page(
134
- 'CartFlows',
135
- 'CartFlows',
136
- 'manage_options',
137
- CARTFLOWS_SLUG,
138
- __CLASS__ . '::render',
139
- 'data:image/svg+xml;base64,' . base64_encode( file_get_contents( CARTFLOWS_DIR . 'assets/images/cartflows-icon.svg' ) ),//phpcs:ignore
140
- 39.7
141
- );
142
-
143
- }
144
-
145
- /**
146
- * Add submenu to admin menu.
147
- *
148
- * @since 1.0.0
149
- */
150
- public static function submenu() {
151
-
152
- $parent_slug = CARTFLOWS_SLUG;
153
- $page_title = __( 'Settings', 'cartflows' );
154
- $menu_title = __( 'Settings', 'cartflows' );
155
- $capability = 'manage_options';
156
- $menu_slug = 'cartflows_settings';
157
- $callback = __CLASS__ . '::render';
158
-
159
- add_submenu_page(
160
- $parent_slug,
161
- $page_title,
162
- $menu_title,
163
- $capability,
164
- $menu_slug,
165
- $callback
166
- );
167
- }
168
-
169
- /**
170
- * Renders the admin settings.
171
- *
172
- * @since 1.0.0
173
- * @return void
174
- */
175
- public static function render() {
176
- $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
177
- $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
178
- $action = str_replace( '_', '-', $action );
179
-
180
- // Enable header icon filter below.
181
- $header_wrapper_class = apply_filters( 'cartflows_header_wrapper_class', array( $action ) );
182
-
183
- include_once CARTFLOWS_DIR . 'includes/admin/cartflows-admin.php';
184
- }
185
-
186
- /**
187
- * Renders the admin settings content.
188
- *
189
- * @since 1.0.0
190
- * @return void
191
- */
192
- public static function render_content() {
193
-
194
- $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
195
- $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
196
- $action = str_replace( '_', '-', $action );
197
- $action = 'general';
198
-
199
- $header_wrapper_class = apply_filters( 'cartflows_header_wrapper_class', array( $action ) );
200
-
201
- include_once CARTFLOWS_DIR . 'includes/admin/cartflows-general.php';
202
- }
203
-
204
- /**
205
- * Save Global Setting options.
206
- *
207
- * @since 1.0.0
208
- */
209
- public static function save_common_settings() {
210
-
211
- if ( isset( $_POST['cartflows-common-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-common-settings-nonce'] ) ), 'cartflows-common-settings' ) ) {
212
-
213
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
214
- $new_settings = array();
215
-
216
- if ( isset( $_POST['_cartflows_common'] ) ) {
217
- // Loop through the input and sanitize each of the values.
218
- $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_common'] ) ); //phpcs:ignore
219
- }
220
-
221
- Cartflows_Helper::update_admin_settings_option( '_cartflows_common', $new_settings, false );
222
-
223
- $query = array(
224
- 'message' => 'saved',
225
- );
226
-
227
- $redirect_to = add_query_arg( $query, $url );
228
-
229
- wp_safe_redirect( $redirect_to );
230
- exit;
231
- } // End if statement.
232
- }
233
-
234
- /**
235
- * Save Debug Setting options.
236
- *
237
- * @since 1.1.14
238
- */
239
- public static function save_debug_settings() {
240
-
241
- if ( isset( $_POST['cartflows-debug-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-debug-settings-nonce'] ) ), 'cartflows-debug-settings' ) ) {
242
-
243
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
244
- $new_settings = array();
245
-
246
- if ( isset( $_POST['_cartflows_debug_data'] ) ) {
247
- $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_debug_data'] ) ); //phpcs:ignore
248
- }
249
-
250
- Cartflows_Helper::update_admin_settings_option( '_cartflows_debug_data', $new_settings, false );
251
-
252
- $query = array(
253
- 'message' => 'saved',
254
- );
255
-
256
- $redirect_to = add_query_arg( $query, $url );
257
-
258
- wp_safe_redirect( $redirect_to );
259
- exit;
260
-
261
- }
262
- }
263
-
264
-
265
- /**
266
- * Save permalink Setting options.
267
- *
268
- * @since 1.1.14
269
- */
270
- public static function save_permalink_settings() {
271
-
272
- if ( isset( $_POST['cartflows-permalink-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-permalink-settings-nonce'] ) ), 'cartflows-permalink-settings' ) ) {
273
-
274
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
275
- $new_settings = array();
276
-
277
- if ( isset( $_POST['reset'] ) ) {
278
- $_POST['_cartflows_permalink'] = array(
279
- 'permalink' => CARTFLOWS_STEP_POST_TYPE,
280
- 'permalink_flow_base' => CARTFLOWS_FLOW_POST_TYPE,
281
- 'permalink_structure' => '',
282
- );
283
-
284
- }
285
-
286
- if ( isset( $_POST['_cartflows_permalink'] ) ) {
287
- $cartflows_permalink_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_permalink'] ) ); //phpcs:ignore
288
-
289
- if ( empty( $cartflows_permalink_settings['permalink'] ) ) {
290
- $new_settings['permalink'] = CARTFLOWS_STEP_POST_TYPE;
291
- } else {
292
- $new_settings['permalink'] = $cartflows_permalink_settings['permalink'];
293
- }
294
-
295
- if ( empty( $cartflows_permalink_settings['permalink_flow_base'] ) ) {
296
- $new_settings['permalink_flow_base'] = CARTFLOWS_FLOW_POST_TYPE;
297
- } else {
298
- $new_settings['permalink_flow_base'] = $cartflows_permalink_settings['permalink_flow_base'];
299
- }
300
-
301
- $new_settings['permalink_structure'] = $cartflows_permalink_settings['permalink_structure'];
302
-
303
- }
304
-
305
- Cartflows_Helper::update_admin_settings_option( '_cartflows_permalink', $new_settings, false );
306
-
307
- $query = array(
308
- 'message' => 'saved',
309
- );
310
-
311
- $redirect_to = add_query_arg( $query, $url );
312
-
313
- update_option( 'cartflows_permalink_saved', true );
314
-
315
- wp_safe_redirect( $redirect_to );
316
- exit;
317
-
318
- }
319
- }
320
-
321
- /**
322
- * Loop through the input and sanitize each of the values.
323
- *
324
- * @param array $input_settings input settings.
325
- * @return array
326
- */
327
- public static function sanitize_form_inputs( $input_settings = array() ) {
328
- $new_settings = array();
329
- foreach ( $input_settings as $key => $val ) {
330
-
331
- if ( is_array( $val ) ) {
332
- foreach ( $val as $k => $v ) {
333
- $new_settings[ $key ][ $k ] = ( isset( $val[ $k ] ) ) ? sanitize_text_field( $v ) : '';
334
- }
335
- } else {
336
- $new_settings[ $key ] = ( isset( $input_settings[ $key ] ) ) ? sanitize_text_field( $val ) : '';
337
- }
338
- }
339
- return $new_settings;
340
- }
341
-
342
- /**
343
- * Check is cartflows admin.
344
- *
345
- * @since 1.0.0
346
- * @return boolean
347
- */
348
- public static function is_global_admin() {
349
-
350
- $current_screen = get_current_screen();
351
-
352
- if (
353
- is_object( $current_screen ) &&
354
- isset( $current_screen->post_type ) &&
355
- ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ||
356
- CARTFLOWS_STEP_POST_TYPE === $current_screen->post_type
357
- )
358
- ) {
359
- return true;
360
- }
361
- return false;
362
- }
363
-
364
- /**
365
- * Check is flow admin.
366
- *
367
- * @since 1.0.0
368
- * @return boolean
369
- */
370
- public static function is_flow_edit_admin() {
371
-
372
- $current_screen = get_current_screen();
373
-
374
- if (
375
- is_object( $current_screen ) &&
376
- isset( $current_screen->post_type ) &&
377
- ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ) &&
378
- isset( $current_screen->base ) &&
379
- ( 'post' === $current_screen->base )
380
- ) {
381
- return true;
382
- }
383
- return false;
384
- }
385
-
386
- /**
387
- * Global Admin Scripts.
388
- *
389
- * @since 1.0.0
390
- */
391
- public static function global_admin_scripts() {
392
-
393
- $installed_plugins = get_plugins();
394
- $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? true : false;
395
- $edit_test_mode = filter_input( INPUT_GET, 'edit_test_mode', FILTER_SANITIZE_STRING );
396
- $edit_test_mode = 'yes' === $edit_test_mode ? true : false;
397
-
398
- $localize = array(
399
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
400
- 'ajax_nonce' => wp_create_nonce( 'cartflows-nonce' ),
401
- 'wc_status' => array(
402
- 'installed' => $is_wc_installed,
403
- 'active' => wcf()->is_woo_active,
404
- ),
405
- 'wc_activating_message' => __( 'Installing and activating..', 'cartflows' ),
406
- 'wc_install_error' => __( 'There was an error with the installation of plugin.', 'cartflows' ),
407
- 'wcf_edit_test_mode' => $edit_test_mode,
408
- );
409
-
410
- wp_localize_script( 'jquery', 'cartflows_admin', apply_filters( 'cartflows_admin_js_localize', $localize ) );
411
-
412
- if ( self::is_global_admin() ) {
413
-
414
- // Styles.
415
- wp_enqueue_style( 'cartflows-global-admin', CARTFLOWS_URL . 'admin/assets/css/global-admin.css', array(), CARTFLOWS_VER );
416
- wp_style_add_data( 'cartflows-global-admin', 'rtl', 'replace' );
417
-
418
- wp_enqueue_script(
419
- 'wcf-global-admin',
420
- CARTFLOWS_URL . 'admin/assets/js/global-admin.js',
421
- array( 'jquery' ),
422
- CARTFLOWS_VER,
423
- true
424
- );
425
-
426
- do_action( 'cartflows_global_admin_scripts' );
427
- }
428
- }
429
-
430
- /**
431
- * Global Admin Data.
432
- *
433
- * @since 1.0.0
434
- */
435
- public static function global_admin_data() {
436
-
437
- $current_screen = get_current_screen();
438
-
439
- if ( ! $current_screen ) {
440
- return;
441
- }
442
-
443
- if ( 'edit-' . CARTFLOWS_FLOW_POST_TYPE != $current_screen->id ) {
444
- return;
445
- }
446
-
447
- $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
448
- ?>
449
-
450
- <div id="wcf-remote-flow-importer" class="wcf-templates-popup-overlay">
451
- <div class="wcf-templates-popup-content">
452
- <div class="spinner"></div>
453
- <div class="wcf-templates-wrap wcf-templates-wrap-flows">
454
-
455
- <div id="wcf-remote-flow-actions" class="wcf-template-header">
456
- <div class="wcf-template-logo-wrap">
457
- <span class="wcf-cartflows-logo-img">
458
- <span class="cartflows-logo-icon"></span>
459
- </span>
460
- <span class="wcf-cartflows-title"><?php esc_html_e( 'Flows Library', 'cartflows' ); ?></span>
461
- </div>
462
- <div class="wcf-tab-wrapper">
463
- <?php if ( 'other' !== $default_page_builder ) { ?>
464
- <div id="wcf-get-started-steps">
465
- <ul class="filter-links ">
466
- <li>
467
- <a href="#" class="current" data-slug="ready-templates" data-title="<?php esc_html_e( 'Ready Templates', 'cartflows' ); ?>"><?php esc_html_e( 'Ready Templates', 'cartflows' ); ?></a>
468
- </li>
469
- <li>
470
- <a href="#" data-slug="canvas" data-title="<?php esc_html_e( 'Create Your Own', 'cartflows' ); ?>"><?php esc_html_e( 'Create Your Own', 'cartflows' ); ?></a>
471
- </li>
472
- </ul>
473
- </div>
474
- <?php } ?>
475
- </div>
476
- <div class="wcf-popup-close-wrap">
477
- <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
478
- </div>
479
- </div>
480
- <!-- <div class="wcf-search-form">
481
- <label class="screen-reader-text" for="wp-filter-search-input"><?php esc_html_e( 'Search Sites', 'cartflows' ); ?> </label>
482
- <input placeholder="<?php esc_html_e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
483
- </div> -->
484
-
485
- <div id="wcf-remote-content">
486
- <?php if ( 'other' !== $default_page_builder ) { ?>
487
- <div id="wcf-ready-templates">
488
- <div id="wcf-remote-filters">
489
- <div id="wcf-page-builders"></div>
490
- <div id="wcf-categories"></div>
491
- </div>
492
- <div class="wcf-page-builder-notice"></div>
493
- <div id="wcf-remote-flow-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
494
- <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
495
- </div>
496
- <?php } ?>
497
- <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
498
- <div class="inner">
499
- <a href="#" class="button button-hero button-primary cartflows-flow-import-blank"><?php esc_html_e( 'Design Your Flow', 'cartflows' ); ?></a>
500
- <p class="wcf-learn-how"><a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank"><?php esc_html_e( 'Learn How', 'cartflows' ); ?> <i class="dashicons dashicons-external"></i></a></p>
501
- </div>
502
- </div>
503
- </div>
504
- </div>
505
- </div>
506
- </div>
507
-
508
- <?php
509
- }
510
-
511
- /**
512
- * Enqueues the needed CSS/JS for the builder's admin settings page.
513
- *
514
- * @since 1.0.0
515
- */
516
- public static function styles_scripts() {
517
-
518
- // Styles.
519
- wp_enqueue_style( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/css/admin-menu-settings.css', array(), CARTFLOWS_VER );
520
- wp_style_add_data( 'cartflows-admin-settings', 'rtl', 'replace' );
521
-
522
- // Script.
523
- wp_enqueue_script( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/js/admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), CARTFLOWS_VER, false );
524
-
525
- $localize = array(
526
- 'ajax_nonce' => wp_create_nonce( 'cartflows-widget-nonce' ),
527
- );
528
-
529
- wp_localize_script( 'cartflows-admin-settings', 'cartflows', apply_filters( 'cartflows_js_localize', $localize ) );
530
-
531
- do_action( 'cartflows_admin_settings_after_enqueue_scripts' );
532
- }
533
-
534
- /**
535
- * Save All admin settings here
536
- */
537
- public static function save_settings() {
538
-
539
- // Only admins can save settings.
540
- if ( ! current_user_can( 'manage_options' ) ) {
541
- return;
542
- }
543
-
544
- self::save_common_settings();
545
- self::save_debug_settings();
546
- self::save_permalink_settings();
547
- self::save_facebook_settings();
548
-
549
- // Let extensions hook into saving.
550
- do_action( 'cartflows_admin_settings_save' );
551
- }
552
-
553
- /**
554
- * Get and return page URL
555
- *
556
- * @param string $menu_slug Menu name.
557
- * @since 1.0.0
558
- * @return string page url
559
- */
560
- public static function get_page_url( $menu_slug ) {
561
-
562
- $parent_page = self::$default_menu_position;
563
-
564
- if ( strpos( $parent_page, '?' ) !== false ) {
565
- $query_var = '&page=' . self::$plugin_slug;
566
- } else {
567
- $query_var = '?page=' . self::$plugin_slug;
568
- }
569
-
570
- $parent_page_url = admin_url( $parent_page . $query_var );
571
-
572
- $url = $parent_page_url . '&action=' . $menu_slug;
573
-
574
- return esc_url( $url );
575
- }
576
-
577
- /**
578
- * Admin body classes.
579
- *
580
- * Body classes to be added to <body> tag in admin page
581
- *
582
- * @param String $classes body classes returned from the filter.
583
- * @return String body classes to be added to <body> tag in admin page
584
- */
585
- public static function add_admin_body_class( $classes ) {
586
-
587
- $classes .= ' cartflows-' . CARTFLOWS_VER;
588
-
589
- return $classes;
590
- }
591
-
592
- /**
593
- * Save Global Setting options.
594
- *
595
- * @since 1.0.0
596
- */
597
- public static function save_facebook_settings() {
598
-
599
- if ( isset( $_POST['cartflows-facebook-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-facebook-settings-nonce'] ) ), 'cartflows-facebook-settings' ) ) {
600
-
601
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
602
- $new_settings = array();
603
-
604
- if ( isset( $_POST['_cartflows_facebook'] ) ) {
605
- $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_facebook'] ) ); //phpcs:ignore
606
- }
607
-
608
- Cartflows_Helper::update_admin_settings_option( '_cartflows_facebook', $new_settings, false );
609
- $query = array(
610
- 'message' => 'saved',
611
- );
612
- $redirect_to = add_query_arg( $query, $url );
613
- wp_safe_redirect( $redirect_to );
614
- exit;
615
- }
616
- }
617
-
618
- }
619
-
620
- 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
+ public static 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
+ /*
39
+ Add CARTFLOWS menu option to admin.
40
+ add_action( 'network_admin_menu', __CLASS__ . '::menu' );
41
+ */
42
+ add_action( 'admin_menu', __CLASS__ . '::menu' );
43
+ add_action( 'admin_menu', __CLASS__ . '::submenu', 999 );
44
+
45
+ add_action( 'cartflows_render_admin_content', __CLASS__ . '::render_content' );
46
+
47
+ add_action( 'admin_init', __CLASS__ . '::settings_admin_scripts' );
48
+
49
+ /* Global Addmin Script */
50
+ add_action( 'admin_enqueue_scripts', __CLASS__ . '::global_admin_scripts', 20 );
51
+
52
+ add_action( 'admin_footer', __CLASS__ . '::global_admin_data', 9555 );
53
+
54
+ /* Add lite version class to body */
55
+ add_action( 'admin_body_class', __CLASS__ . '::add_admin_body_class' );
56
+
57
+ add_filter( 'plugin_action_links_' . CARTFLOWS_BASE, __CLASS__ . '::add_action_links' );
58
+
59
+ add_action( 'admin_init', __CLASS__ . '::cartflows_after_save_permalinks' );
60
+
61
+ }
62
+
63
+ /**
64
+ * After save of permalinks.
65
+ */
66
+ public static function cartflows_after_save_permalinks() {
67
+
68
+ $has_saved_permalinks = get_option( 'cartflows_permalink_saved' );
69
+ if ( $has_saved_permalinks ) {
70
+ flush_rewrite_rules();
71
+ delete_option( 'cartflows_permalink_saved' );
72
+ }
73
+ }
74
+
75
+
76
+ /**
77
+ * Initialize after Cartflows pro get loaded.
78
+ */
79
+ public static function settings_admin_scripts() {
80
+ // Enqueue admin scripts.
81
+ if ( isset( $_REQUEST['page'] ) && CARTFLOWS_SETTINGS === $_REQUEST['page'] ) { //phpcs:ignore
82
+ add_action( 'admin_enqueue_scripts', __CLASS__ . '::styles_scripts' );
83
+
84
+ self::save_settings();
85
+ }
86
+ }
87
+ /**
88
+ * Show action on plugin page.
89
+ *
90
+ * @param array $links links.
91
+ * @return array
92
+ */
93
+ public static function add_action_links( $links ) {
94
+ $mylinks = array(
95
+ '<a href="' . admin_url( 'admin.php?page=' . CARTFLOWS_SETTINGS ) . '">Settings</a>',
96
+ '<a target="_blank" href="' . esc_url( 'https://cartflows.com/docs' ) . '">Docs</a>',
97
+ );
98
+
99
+ if ( ! _is_cartflows_pro() ) {
100
+ array_push( $mylinks, '<a style="color: #39b54a; font-weight: bold;" target="_blank" href="' . esc_url( 'https://cartflows.com/pricing/' ) . '"> Go Pro </a>' );
101
+ }
102
+
103
+ return array_merge( $links, $mylinks );
104
+ }
105
+
106
+ /**
107
+ * Initialises the Plugin Name.
108
+ *
109
+ * @since 1.0.0
110
+ * @return void
111
+ */
112
+ public static function initialise_plugin() {
113
+
114
+ $name = 'Cartflows';
115
+ $short_name = 'Cflows';
116
+
117
+ define( 'CARTFLOWS_PLUGIN_NAME', $name );
118
+ define( 'CARTFLOWS_PLUGIN_SHORT_NAME', $short_name );
119
+ }
120
+
121
+ /**
122
+ * Renders the admin settings menu.
123
+ *
124
+ * @since 1.0.0
125
+ * @return void
126
+ */
127
+ public static function menu() {
128
+
129
+ if ( ! current_user_can( 'manage_options' ) ) {
130
+ return;
131
+ }
132
+
133
+ add_menu_page(
134
+ 'CartFlows',
135
+ 'CartFlows',
136
+ 'manage_options',
137
+ CARTFLOWS_SLUG,
138
+ __CLASS__ . '::render',
139
+ 'data:image/svg+xml;base64,' . base64_encode( file_get_contents( CARTFLOWS_DIR . 'assets/images/cartflows-icon.svg' ) ),//phpcs:ignore
140
+ 39.7
141
+ );
142
+
143
+ }
144
+
145
+ /**
146
+ * Add submenu to admin menu.
147
+ *
148
+ * @since 1.0.0
149
+ */
150
+ public static function submenu() {
151
+
152
+ $parent_slug = CARTFLOWS_SLUG;
153
+ $page_title = __( 'Settings', 'cartflows' );
154
+ $menu_title = __( 'Settings', 'cartflows' );
155
+ $capability = 'manage_options';
156
+ $menu_slug = 'cartflows_settings';
157
+ $callback = __CLASS__ . '::render';
158
+
159
+ add_submenu_page(
160
+ $parent_slug,
161
+ $page_title,
162
+ $menu_title,
163
+ $capability,
164
+ $menu_slug,
165
+ $callback
166
+ );
167
+ }
168
+
169
+ /**
170
+ * Renders the admin settings.
171
+ *
172
+ * @since 1.0.0
173
+ * @return void
174
+ */
175
+ public static function render() {
176
+ $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
177
+ $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
178
+ $action = str_replace( '_', '-', $action );
179
+
180
+ // Enable header icon filter below.
181
+ $header_wrapper_class = apply_filters( 'cartflows_header_wrapper_class', array( $action ) );
182
+
183
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-admin.php';
184
+ }
185
+
186
+ /**
187
+ * Renders the admin settings content.
188
+ *
189
+ * @since 1.0.0
190
+ * @return void
191
+ */
192
+ public static function render_content() {
193
+
194
+ $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
195
+ $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
196
+ $action = str_replace( '_', '-', $action );
197
+ $action = 'general';
198
+
199
+ $header_wrapper_class = apply_filters( 'cartflows_header_wrapper_class', array( $action ) );
200
+
201
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-general.php';
202
+ }
203
+
204
+ /**
205
+ * Save Global Setting options.
206
+ *
207
+ * @since 1.0.0
208
+ */
209
+ public static function save_common_settings() {
210
+
211
+ if ( isset( $_POST['cartflows-common-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-common-settings-nonce'] ) ), 'cartflows-common-settings' ) ) {
212
+
213
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
214
+ $new_settings = array();
215
+
216
+ if ( isset( $_POST['_cartflows_common'] ) ) {
217
+ // Loop through the input and sanitize each of the values.
218
+ $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_common'] ) ); //phpcs:ignore
219
+ }
220
+
221
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_common', $new_settings, false );
222
+
223
+ $query = array(
224
+ 'message' => 'saved',
225
+ );
226
+
227
+ $redirect_to = add_query_arg( $query, $url );
228
+
229
+ wp_safe_redirect( $redirect_to );
230
+ exit;
231
+ } // End if statement.
232
+ }
233
+
234
+ /**
235
+ * Save Debug Setting options.
236
+ *
237
+ * @since 1.1.14
238
+ */
239
+ public static function save_debug_settings() {
240
+
241
+ if ( isset( $_POST['cartflows-debug-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-debug-settings-nonce'] ) ), 'cartflows-debug-settings' ) ) {
242
+
243
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
244
+ $new_settings = array();
245
+
246
+ if ( isset( $_POST['_cartflows_debug_data'] ) ) {
247
+ $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_debug_data'] ) ); //phpcs:ignore
248
+ }
249
+
250
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_debug_data', $new_settings, false );
251
+
252
+ $query = array(
253
+ 'message' => 'saved',
254
+ );
255
+
256
+ $redirect_to = add_query_arg( $query, $url );
257
+
258
+ wp_safe_redirect( $redirect_to );
259
+ exit;
260
+
261
+ }
262
+ }
263
+
264
+
265
+ /**
266
+ * Save permalink Setting options.
267
+ *
268
+ * @since 1.1.14
269
+ */
270
+ public static function save_permalink_settings() {
271
+
272
+ if ( isset( $_POST['cartflows-permalink-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-permalink-settings-nonce'] ) ), 'cartflows-permalink-settings' ) ) {
273
+
274
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
275
+ $new_settings = array();
276
+
277
+ if ( isset( $_POST['reset'] ) ) {
278
+ $_POST['_cartflows_permalink'] = array(
279
+ 'permalink' => CARTFLOWS_STEP_POST_TYPE,
280
+ 'permalink_flow_base' => CARTFLOWS_FLOW_POST_TYPE,
281
+ 'permalink_structure' => '',
282
+ );
283
+
284
+ }
285
+
286
+ if ( isset( $_POST['_cartflows_permalink'] ) ) {
287
+ $cartflows_permalink_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_permalink'] ) ); //phpcs:ignore
288
+
289
+ if ( empty( $cartflows_permalink_settings['permalink'] ) ) {
290
+ $new_settings['permalink'] = CARTFLOWS_STEP_POST_TYPE;
291
+ } else {
292
+ $new_settings['permalink'] = $cartflows_permalink_settings['permalink'];
293
+ }
294
+
295
+ if ( empty( $cartflows_permalink_settings['permalink_flow_base'] ) ) {
296
+ $new_settings['permalink_flow_base'] = CARTFLOWS_FLOW_POST_TYPE;
297
+ } else {
298
+ $new_settings['permalink_flow_base'] = $cartflows_permalink_settings['permalink_flow_base'];
299
+ }
300
+
301
+ $new_settings['permalink_structure'] = $cartflows_permalink_settings['permalink_structure'];
302
+
303
+ }
304
+
305
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_permalink', $new_settings, false );
306
+
307
+ $query = array(
308
+ 'message' => 'saved',
309
+ );
310
+
311
+ $redirect_to = add_query_arg( $query, $url );
312
+
313
+ update_option( 'cartflows_permalink_saved', true );
314
+
315
+ wp_safe_redirect( $redirect_to );
316
+ exit;
317
+
318
+ }
319
+ }
320
+
321
+ /**
322
+ * Loop through the input and sanitize each of the values.
323
+ *
324
+ * @param array $input_settings input settings.
325
+ * @return array
326
+ */
327
+ public static function sanitize_form_inputs( $input_settings = array() ) {
328
+ $new_settings = array();
329
+ foreach ( $input_settings as $key => $val ) {
330
+
331
+ if ( is_array( $val ) ) {
332
+ foreach ( $val as $k => $v ) {
333
+ $new_settings[ $key ][ $k ] = ( isset( $val[ $k ] ) ) ? sanitize_text_field( $v ) : '';
334
+ }
335
+ } else {
336
+ $new_settings[ $key ] = ( isset( $input_settings[ $key ] ) ) ? sanitize_text_field( $val ) : '';
337
+ }
338
+ }
339
+ return $new_settings;
340
+ }
341
+
342
+ /**
343
+ * Check is cartflows admin.
344
+ *
345
+ * @since 1.0.0
346
+ * @return boolean
347
+ */
348
+ public static function is_global_admin() {
349
+
350
+ $current_screen = get_current_screen();
351
+
352
+ if (
353
+ is_object( $current_screen ) &&
354
+ isset( $current_screen->post_type ) &&
355
+ ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ||
356
+ CARTFLOWS_STEP_POST_TYPE === $current_screen->post_type
357
+ )
358
+ ) {
359
+ return true;
360
+ }
361
+ return false;
362
+ }
363
+
364
+ /**
365
+ * Check is flow admin.
366
+ *
367
+ * @since 1.0.0
368
+ * @return boolean
369
+ */
370
+ public static function is_flow_edit_admin() {
371
+
372
+ $current_screen = get_current_screen();
373
+
374
+ if (
375
+ is_object( $current_screen ) &&
376
+ isset( $current_screen->post_type ) &&
377
+ ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ) &&
378
+ isset( $current_screen->base ) &&
379
+ ( 'post' === $current_screen->base )
380
+ ) {
381
+ return true;
382
+ }
383
+ return false;
384
+ }
385
+
386
+ /**
387
+ * Global Admin Scripts.
388
+ *
389
+ * @since 1.0.0
390
+ */
391
+ public static function global_admin_scripts() {
392
+
393
+ $installed_plugins = get_plugins();
394
+ $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? true : false;
395
+ $edit_test_mode = filter_input( INPUT_GET, 'edit_test_mode', FILTER_SANITIZE_STRING );
396
+ $edit_test_mode = 'yes' === $edit_test_mode ? true : false;
397
+
398
+ $localize = array(
399
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
400
+ 'ajax_nonce' => wp_create_nonce( 'cartflows-nonce' ),
401
+ 'wc_status' => array(
402
+ 'installed' => $is_wc_installed,
403
+ 'active' => wcf()->is_woo_active,
404
+ ),
405
+ 'wc_activating_message' => __( 'Installing and activating..', 'cartflows' ),
406
+ 'wc_install_error' => __( 'There was an error with the installation of plugin.', 'cartflows' ),
407
+ 'wcf_edit_test_mode' => $edit_test_mode,
408
+ );
409
+
410
+ wp_localize_script( 'jquery', 'cartflows_admin', apply_filters( 'cartflows_admin_js_localize', $localize ) );
411
+
412
+ if ( self::is_global_admin() ) {
413
+
414
+ // Styles.
415
+ wp_enqueue_style( 'cartflows-global-admin', CARTFLOWS_URL . 'admin/assets/css/global-admin.css', array(), CARTFLOWS_VER );
416
+ wp_style_add_data( 'cartflows-global-admin', 'rtl', 'replace' );
417
+
418
+ wp_enqueue_script(
419
+ 'wcf-global-admin',
420
+ CARTFLOWS_URL . 'admin/assets/js/global-admin.js',
421
+ array( 'jquery' ),
422
+ CARTFLOWS_VER,
423
+ true
424
+ );
425
+
426
+ do_action( 'cartflows_global_admin_scripts' );
427
+ }
428
+ }
429
+
430
+ /**
431
+ * Global Admin Data.
432
+ *
433
+ * @since 1.0.0
434
+ */
435
+ public static function global_admin_data() {
436
+
437
+ $current_screen = get_current_screen();
438
+
439
+ if ( ! $current_screen ) {
440
+ return;
441
+ }
442
+
443
+ if ( 'edit-' . CARTFLOWS_FLOW_POST_TYPE != $current_screen->id ) {
444
+ return;
445
+ }
446
+
447
+ $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
448
+ ?>
449
+
450
+ <div id="wcf-remote-flow-importer" class="wcf-templates-popup-overlay">
451
+ <div class="wcf-templates-popup-content">
452
+ <div class="spinner"></div>
453
+ <div class="wcf-templates-wrap wcf-templates-wrap-flows">
454
+
455
+ <div id="wcf-remote-flow-actions" class="wcf-template-header">
456
+ <div class="wcf-template-logo-wrap">
457
+ <span class="wcf-cartflows-logo-img">
458
+ <span class="cartflows-logo-icon"></span>
459
+ </span>
460
+ <span class="wcf-cartflows-title"><?php esc_html_e( 'Flows Library', 'cartflows' ); ?></span>
461
+ </div>
462
+ <div class="wcf-tab-wrapper">
463
+ <?php if ( 'other' !== $default_page_builder ) { ?>
464
+ <div id="wcf-get-started-steps">
465
+ <ul class="filter-links ">
466
+ <li>
467
+ <a href="#" class="current" data-slug="ready-templates" data-title="<?php esc_html_e( 'Ready Templates', 'cartflows' ); ?>"><?php esc_html_e( 'Ready Templates', 'cartflows' ); ?></a>
468
+ </li>
469
+ <li>
470
+ <a href="#" data-slug="canvas" data-title="<?php esc_html_e( 'Create Your Own', 'cartflows' ); ?>"><?php esc_html_e( 'Create Your Own', 'cartflows' ); ?></a>
471
+ </li>
472
+ </ul>
473
+ </div>
474
+ <?php } ?>
475
+ </div>
476
+ <div class="wcf-popup-close-wrap">
477
+ <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
478
+ </div>
479
+ </div>
480
+ <!-- <div class="wcf-search-form">
481
+ <label class="screen-reader-text" for="wp-filter-search-input"><?php esc_html_e( 'Search Sites', 'cartflows' ); ?> </label>
482
+ <input placeholder="<?php esc_html_e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
483
+ </div> -->
484
+
485
+ <div id="wcf-remote-content">
486
+ <?php if ( 'other' !== $default_page_builder ) { ?>
487
+ <div id="wcf-ready-templates">
488
+ <div id="wcf-remote-filters">
489
+ <div id="wcf-page-builders"></div>
490
+ <div id="wcf-categories"></div>
491
+ </div>
492
+ <div class="wcf-page-builder-notice"></div>
493
+ <div id="wcf-remote-flow-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
494
+ <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
495
+ </div>
496
+ <?php } ?>
497
+ <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
498
+ <div class="inner">
499
+ <a href="#" class="button button-hero button-primary cartflows-flow-import-blank"><?php esc_html_e( 'Design Your Flow', 'cartflows' ); ?></a>
500
+ <p class="wcf-learn-how"><a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank"><?php esc_html_e( 'Learn How', 'cartflows' ); ?> <i class="dashicons dashicons-external"></i></a></p>
501
+ </div>
502
+ </div>
503
+ </div>
504
+ </div>
505
+ </div>
506
+ </div>
507
+
508
+ <?php
509
+ }
510
+
511
+ /**
512
+ * Enqueues the needed CSS/JS for the builder's admin settings page.
513
+ *
514
+ * @since 1.0.0
515
+ */
516
+ public static function styles_scripts() {
517
+
518
+ // Styles.
519
+ wp_enqueue_style( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/css/admin-menu-settings.css', array(), CARTFLOWS_VER );
520
+ wp_style_add_data( 'cartflows-admin-settings', 'rtl', 'replace' );
521
+
522
+ // Script.
523
+ wp_enqueue_script( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/js/admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), CARTFLOWS_VER, false );
524
+
525
+ $localize = array(
526
+ 'ajax_nonce' => wp_create_nonce( 'cartflows-widget-nonce' ),
527
+ );
528
+
529
+ wp_localize_script( 'cartflows-admin-settings', 'cartflows', apply_filters( 'cartflows_js_localize', $localize ) );
530
+
531
+ do_action( 'cartflows_admin_settings_after_enqueue_scripts' );
532
+ }
533
+
534
+ /**
535
+ * Save All admin settings here
536
+ */
537
+ public static function save_settings() {
538
+
539
+ // Only admins can save settings.
540
+ if ( ! current_user_can( 'manage_options' ) ) {
541
+ return;
542
+ }
543
+
544
+ self::save_common_settings();
545
+ self::save_debug_settings();
546
+ self::save_permalink_settings();
547
+ self::save_facebook_settings();
548
+
549
+ // Let extensions hook into saving.
550
+ do_action( 'cartflows_admin_settings_save' );
551
+ }
552
+
553
+ /**
554
+ * Get and return page URL
555
+ *
556
+ * @param string $menu_slug Menu name.
557
+ * @since 1.0.0
558
+ * @return string page url
559
+ */
560
+ public static function get_page_url( $menu_slug ) {
561
+
562
+ $parent_page = self::$default_menu_position;
563
+
564
+ if ( strpos( $parent_page, '?' ) !== false ) {
565
+ $query_var = '&page=' . self::$plugin_slug;
566
+ } else {
567
+ $query_var = '?page=' . self::$plugin_slug;
568
+ }
569
+
570
+ $parent_page_url = admin_url( $parent_page . $query_var );
571
+
572
+ $url = $parent_page_url . '&action=' . $menu_slug;
573
+
574
+ return esc_url( $url );
575
+ }
576
+
577
+ /**
578
+ * Admin body classes.
579
+ *
580
+ * Body classes to be added to <body> tag in admin page
581
+ *
582
+ * @param String $classes body classes returned from the filter.
583
+ * @return String body classes to be added to <body> tag in admin page
584
+ */
585
+ public static function add_admin_body_class( $classes ) {
586
+
587
+ $classes .= ' cartflows-' . CARTFLOWS_VER;
588
+
589
+ return $classes;
590
+ }
591
+
592
+ /**
593
+ * Save Global Setting options.
594
+ *
595
+ * @since 1.0.0
596
+ */
597
+ public static function save_facebook_settings() {
598
+
599
+ if ( isset( $_POST['cartflows-facebook-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-facebook-settings-nonce'] ) ), 'cartflows-facebook-settings' ) ) {
600
+
601
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
602
+ $new_settings = array();
603
+
604
+ if ( isset( $_POST['_cartflows_facebook'] ) ) {
605
+ $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_facebook'] ) ); //phpcs:ignore
606
+ }
607
+
608
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_facebook', $new_settings, false );
609
+ $query = array(
610
+ 'message' => 'saved',
611
+ );
612
+ $redirect_to = add_query_arg( $query, $url );
613
+ wp_safe_redirect( $redirect_to );
614
+ exit;
615
+ }
616
+ }
617
+
618
+ }
619
+
620
+ Cartflows_Admin::init();
classes/class-cartflows-compatibility.php CHANGED
@@ -1,410 +1,410 @@
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
- if ( defined( 'LEARNDASH_VERSION' ) ) {
66
- require_once CARTFLOWS_DIR . 'classes/class-cartflows-learndash-compatibility.php';
67
- }
68
- }
69
-
70
- /**
71
- * Check if it is beaver builder enabled.
72
- *
73
- * @since 1.1.4
74
- */
75
- public function is_bb_enabled() {
76
-
77
- if ( class_exists( 'FLBuilderModel' ) ) {
78
- return true;
79
- }
80
-
81
- return false;
82
- }
83
-
84
- /**
85
- * Check if elementor preview mode is on.
86
- */
87
- public function is_elementor_preview_mode() {
88
-
89
- if ( class_exists( '\Elementor\Plugin' ) ) {
90
-
91
- if ( \Elementor\Plugin::$instance->preview->is_preview_mode() ) {
92
- return true;
93
- }
94
- }
95
-
96
- return false;
97
- }
98
-
99
- /**
100
- * Get Current Theme.
101
- */
102
- public function get_current_theme() {
103
-
104
- $theme_name = '';
105
- $theme = wp_get_theme();
106
-
107
- if ( isset( $theme->parent_theme ) && '' != $theme->parent_theme || null != $theme->parent_theme ) {
108
- $theme_name = $theme->parent_theme;
109
- } else {
110
- $theme_name = $theme->name;
111
- }
112
-
113
- return $theme_name;
114
- }
115
-
116
- /**
117
- * Check if it is beaver builder preview mode
118
- */
119
- public function is_bb_preview_mode() {
120
-
121
- if ( class_exists( 'FLBuilderModel' ) ) {
122
- if ( FLBuilderModel::is_builder_active() ) {
123
- return true;
124
- } else {
125
- return false;
126
- }
127
- }
128
-
129
- return false;
130
- }
131
-
132
- /**
133
- * Check for page builder preview mode.
134
- */
135
- public function is_page_builder_preview() {
136
-
137
- if ( $this->is_elementor_preview_mode() || $this->is_bb_preview_mode() || $this->is_divi_builder_preview() ) {
138
- return true;
139
- }
140
-
141
- return false;
142
- }
143
-
144
- /**
145
- * Check if divi builder enabled for post id.
146
- */
147
- public function is_divi_builder_preview() {
148
-
149
- if ( isset( $_GET['et_fb'] ) && '1' === $_GET['et_fb'] ) { //phpcs:ignore
150
- return true;
151
- }
152
-
153
- return false;
154
- }
155
-
156
- /**
157
- * Check if divi builder enabled for post id.
158
- *
159
- * @param int $post_id post id.
160
- */
161
- public function is_divi_builder_enabled( $post_id ) {
162
-
163
- if ( function_exists( 'et_pb_is_pagebuilder_used' ) && et_pb_is_pagebuilder_used( $post_id ) ) {
164
- return true;
165
- }
166
-
167
- return false;
168
- }
169
-
170
- /**
171
- * Check if compatibility theme enabled.
172
- */
173
- public function is_compatibility_theme_enabled() {
174
-
175
- $theme = wp_get_theme();
176
-
177
- $is_compatibility = false;
178
-
179
- if ( $this->is_divi_enabled( $theme ) || $this->is_flatsome_enabled( $theme ) ) {
180
-
181
- $is_compatibility = true;
182
- }
183
-
184
- return apply_filters( 'cartflows_is_compatibility_theme', $is_compatibility );
185
- }
186
-
187
- /**
188
- * Check if divi builder enabled for post id.
189
- *
190
- * @param object $theme theme data.
191
- * @return boolean
192
- */
193
- public function is_divi_enabled( $theme = false ) {
194
-
195
- if ( ! $theme ) {
196
- $theme = wp_get_theme();
197
- }
198
-
199
- if ( 'Divi' == $theme->name || 'Divi' == $theme->parent_theme || 'Extra' == $theme->name || 'Extra' == $theme->parent_theme ) {
200
- return true;
201
- }
202
-
203
- return false;
204
- }
205
-
206
- /**
207
- * Check if Divi theme is install status.
208
- *
209
- * @return boolean
210
- */
211
- public function is_divi_theme_installed() {
212
- foreach ( (array) wp_get_themes() as $theme_dir => $theme ) {
213
- if ( 'Divi' == $theme->name || 'Divi' == $theme->parent_theme || 'Extra' == $theme->name || 'Extra' == $theme->parent_theme ) {
214
- return true;
215
- }
216
- }
217
- return false;
218
- }
219
-
220
- /**
221
- * Check if Flatsome enabled for post id.
222
- *
223
- * @param object $theme theme data.
224
- * @return boolean
225
- */
226
- public function is_flatsome_enabled( $theme = false ) {
227
-
228
- if ( ! $theme ) {
229
- $theme = wp_get_theme();
230
- }
231
-
232
- if ( 'Flatsome' == $theme->name || 'Flatsome' == $theme->parent_theme ) {
233
- return true;
234
- }
235
-
236
- return false;
237
- }
238
-
239
- /**
240
- * Check if The7 enabled for post id.
241
- *
242
- * @param object $theme theme data.
243
- * @return boolean
244
- */
245
- public function is_the_seven_enabled( $theme = false ) {
246
-
247
- if ( ! $theme ) {
248
- $theme = wp_get_theme();
249
- }
250
-
251
- if ( 'The7' == $theme->name || 'The7' == $theme->parent_theme ) {
252
- return true;
253
- }
254
-
255
- return false;
256
- }
257
-
258
- /**
259
- * Check if OceanWp enabled for post id.
260
- *
261
- * @param object $theme theme data.
262
- * @return boolean
263
- */
264
- public function is_oceanwp_enabled( $theme = false ) {
265
-
266
- if ( ! $theme ) {
267
- $theme = wp_get_theme();
268
- }
269
-
270
- if ( 'OceanWP' == $theme->name || 'OceanWP' == $theme->parent_theme ) {
271
- return true;
272
- }
273
-
274
- return false;
275
- }
276
-
277
- /**
278
- * Check for thrive architect edit page.
279
- *
280
- * @param int $post_id post id.
281
- */
282
- public function is_thrive_edit_page( $post_id ) {
283
-
284
- if ( true === $this->is_thrive_builder_page( $post_id ) ) {
285
- return true;
286
- } else {
287
- return false;
288
- }
289
- }
290
-
291
- /**
292
- * Check if the page being rendered is the main ID on the editor page.
293
- *
294
- * @since 1.0.0
295
- * @param String $post_id Post ID which is to be rendered.
296
- * @return boolean True if current if is being rendered is not being edited.
297
- */
298
- private function is_thrive_builder_page( $post_id ) {
299
- $tve = ( isset( $_GET['tve'] ) && 'true' == $_GET['tve'] ) ? true : false; //phpcs:ignore
300
- $post = isset( $_GET['post'] ) ? intval( wp_unslash( $_GET['post'] ) ) : false; //phpcs:ignore
301
-
302
- return ( true == $tve && $post_id !== $post );
303
- }
304
-
305
- /**
306
- * Overwrite meta for page
307
- */
308
- public function override_meta() {
309
-
310
- // don't override meta for `elementor_library` post type.
311
- if ( 'elementor_library' == get_post_type() ) {
312
- return;
313
- }
314
-
315
- if ( ! is_singular() ) {
316
- return;
317
- }
318
-
319
- global $post;
320
- $post_id = $post->ID;
321
- $post_type = get_post_type();
322
-
323
- if ( 'cartflows_step' == $post_type && ( $this->is_elementor_preview_mode()
324
- || $this->is_bb_preview_mode() || $this->is_thrive_edit_page( $post_id )
325
- || $this->is_divi_builder_enabled( $post_id ) ) ) {
326
-
327
- if ( '' == $post->post_content ) {
328
-
329
- $this->overwrite_template( $post_id );
330
- }
331
- }
332
- }
333
-
334
- /**
335
- * Assign cartflow canvas template to page.
336
- *
337
- * @param int $post_id post ID.
338
- */
339
- public function overwrite_template( $post_id ) {
340
-
341
- $template = 'cartflows-canvas';
342
- $key = '_wp_page_template';
343
-
344
- $record_exists = get_post_meta( $post_id, $key, true );
345
-
346
- if ( 'cartflows-canvas' == $record_exists ) {
347
- return;
348
- }
349
-
350
- // As elementor doesn't allow update post meta using update_post_meta, run wpdb query to update post meta.
351
- if ( class_exists( '\Elementor\Plugin' ) ) {
352
-
353
- global $wpdb;
354
-
355
- if ( '' == $record_exists || ! $record_exists ) {
356
-
357
- $wpdb->insert(
358
- $wpdb->prefix . 'postmeta',
359
- array(
360
- 'post_id' => $post_id,
361
- 'meta_key' => $key,//phpcs:ignore
362
- 'meta_value' => $template, //phpcs:ignore
363
- )
364
- );// db call ok;.
365
-
366
- // alternative query to above query.
367
- // $table = $wpdb->prefix . 'postmeta';
368
- // $wpdb->query($wpdb->prepare( "INSERT INTO { $table } ( `post_id`, `meta_key`, 'meta_value' )
369
- // VALUES ( '$post_id', '$key', '$template' )" ) );// db call ok; no-cache ok.
370
-
371
- } else {
372
-
373
- $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = %s WHERE meta_key = %s AND post_id = %s;", $template, $key, $post_id ) ); // db call ok; no-cache ok.
374
- }
375
- } else {
376
-
377
- update_post_meta( $post_id, $key, $template );
378
- }
379
- }
380
-
381
- /**
382
- * Load font awesome style from oceanwp on checkout page.
383
- */
384
- public function load_fontawesome() {
385
-
386
- $theme = get_template();
387
-
388
- if ( 'oceanwp' == strtolower( $theme ) && wcf()->utils->is_step_post_type() ) {
389
-
390
- $load_fa = apply_filters( 'cartflows_maybe_load_font_awesome', true );
391
-
392
- if ( $load_fa ) {
393
-
394
- wp_enqueue_style( 'font-awesome', OCEANWP_CSS_DIR_URI . 'third/font-awesome.min.css', false );//phpcs:ignore
395
- }
396
-
397
- $custom_css = '
398
- #oceanwp-cart-sidebar-wrap,
399
- #owp-qv-wrap{
400
- display: none;
401
- }';
402
-
403
- wp_add_inline_style( 'wcf-frontend-global', $custom_css );
404
- }
405
- }
406
- }
407
- }
408
-
409
- Cartflows_Compatibility::get_instance();
410
-
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
+ if ( defined( 'LEARNDASH_VERSION' ) ) {
66
+ require_once CARTFLOWS_DIR . 'classes/class-cartflows-learndash-compatibility.php';
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Check if it is beaver builder enabled.
72
+ *
73
+ * @since 1.1.4
74
+ */
75
+ public function is_bb_enabled() {
76
+
77
+ if ( class_exists( 'FLBuilderModel' ) ) {
78
+ return true;
79
+ }
80
+
81
+ return false;
82
+ }
83
+
84
+ /**
85
+ * Check if elementor preview mode is on.
86
+ */
87
+ public function is_elementor_preview_mode() {
88
+
89
+ if ( class_exists( '\Elementor\Plugin' ) ) {
90
+
91
+ if ( \Elementor\Plugin::$instance->preview->is_preview_mode() ) {
92
+ return true;
93
+ }
94
+ }
95
+
96
+ return false;
97
+ }
98
+
99
+ /**
100
+ * Get Current Theme.
101
+ */
102
+ public function get_current_theme() {
103
+
104
+ $theme_name = '';
105
+ $theme = wp_get_theme();
106
+
107
+ if ( isset( $theme->parent_theme ) && '' != $theme->parent_theme || null != $theme->parent_theme ) {
108
+ $theme_name = $theme->parent_theme;
109
+ } else {
110
+ $theme_name = $theme->name;
111
+ }
112
+
113
+ return $theme_name;
114
+ }
115
+
116
+ /**
117
+ * Check if it is beaver builder preview mode
118
+ */
119
+ public function is_bb_preview_mode() {
120
+
121
+ if ( class_exists( 'FLBuilderModel' ) ) {
122
+ if ( FLBuilderModel::is_builder_active() ) {
123
+ return true;
124
+ } else {
125
+ return false;
126
+ }
127
+ }
128
+
129
+ return false;
130
+ }
131
+
132
+ /**
133
+ * Check for page builder preview mode.
134
+ */
135
+ public function is_page_builder_preview() {
136
+
137
+ if ( $this->is_elementor_preview_mode() || $this->is_bb_preview_mode() || $this->is_divi_builder_preview() ) {
138
+ return true;
139
+ }
140
+
141
+ return false;
142
+ }
143
+
144
+ /**
145
+ * Check if divi builder enabled for post id.
146
+ */
147
+ public function is_divi_builder_preview() {
148
+
149
+ if ( isset( $_GET['et_fb'] ) && '1' === $_GET['et_fb'] ) { //phpcs:ignore
150
+ return true;
151
+ }
152
+
153
+ return false;
154
+ }
155
+
156
+ /**
157
+ * Check if divi builder enabled for post id.
158
+ *
159
+ * @param int $post_id post id.
160
+ */
161
+ public function is_divi_builder_enabled( $post_id ) {
162
+
163
+ if ( function_exists( 'et_pb_is_pagebuilder_used' ) && et_pb_is_pagebuilder_used( $post_id ) ) {
164
+ return true;
165
+ }
166
+
167
+ return false;
168
+ }
169
+
170
+ /**
171
+ * Check if compatibility theme enabled.
172
+ */
173
+ public function is_compatibility_theme_enabled() {
174
+
175
+ $theme = wp_get_theme();
176
+
177
+ $is_compatibility = false;
178
+
179
+ if ( $this->is_divi_enabled( $theme ) || $this->is_flatsome_enabled( $theme ) ) {
180
+
181
+ $is_compatibility = true;
182
+ }
183
+
184
+ return apply_filters( 'cartflows_is_compatibility_theme', $is_compatibility );
185
+ }
186
+
187
+ /**
188
+ * Check if divi builder enabled for post id.
189
+ *
190
+ * @param object $theme theme data.
191
+ * @return boolean
192
+ */
193
+ public function is_divi_enabled( $theme = false ) {
194
+
195
+ if ( ! $theme ) {
196
+ $theme = wp_get_theme();
197
+ }
198
+
199
+ if ( 'Divi' == $theme->name || 'Divi' == $theme->parent_theme || 'Extra' == $theme->name || 'Extra' == $theme->parent_theme ) {
200
+ return true;
201
+ }
202
+
203
+ return false;
204
+ }
205
+
206
+ /**
207
+ * Check if Divi theme is install status.
208
+ *
209
+ * @return boolean
210
+ */
211
+ public function is_divi_theme_installed() {
212
+ foreach ( (array) wp_get_themes() as $theme_dir => $theme ) {
213
+ if ( 'Divi' == $theme->name || 'Divi' == $theme->parent_theme || 'Extra' == $theme->name || 'Extra' == $theme->parent_theme ) {
214
+ return true;
215
+ }
216
+ }
217
+ return false;
218
+ }
219
+
220
+ /**
221
+ * Check if Flatsome enabled for post id.
222
+ *
223
+ * @param object $theme theme data.
224
+ * @return boolean
225
+ */
226
+ public function is_flatsome_enabled( $theme = false ) {
227
+
228
+ if ( ! $theme ) {
229
+ $theme = wp_get_theme();
230
+ }
231
+
232
+ if ( 'Flatsome' == $theme->name || 'Flatsome' == $theme->parent_theme ) {
233
+ return true;
234
+ }
235
+
236
+ return false;
237
+ }
238
+
239
+ /**
240
+ * Check if The7 enabled for post id.
241
+ *
242
+ * @param object $theme theme data.
243
+ * @return boolean
244
+ */
245
+ public function is_the_seven_enabled( $theme = false ) {
246
+
247
+ if ( ! $theme ) {
248
+ $theme = wp_get_theme();
249
+ }
250
+
251
+ if ( 'The7' == $theme->name || 'The7' == $theme->parent_theme ) {
252
+ return true;
253
+ }
254
+
255
+ return false;
256
+ }
257
+
258
+ /**
259
+ * Check if OceanWp enabled for post id.
260
+ *
261
+ * @param object $theme theme data.
262
+ * @return boolean
263
+ */
264
+ public function is_oceanwp_enabled( $theme = false ) {
265
+
266
+ if ( ! $theme ) {
267
+ $theme = wp_get_theme();
268
+ }
269
+
270
+ if ( 'OceanWP' == $theme->name || 'OceanWP' == $theme->parent_theme ) {
271
+ return true;
272
+ }
273
+
274
+ return false;
275
+ }
276
+
277
+ /**
278
+ * Check for thrive architect edit page.
279
+ *
280
+ * @param int $post_id post id.
281
+ */
282
+ public function is_thrive_edit_page( $post_id ) {
283
+
284
+ if ( true === $this->is_thrive_builder_page( $post_id ) ) {
285
+ return true;
286
+ } else {
287
+ return false;
288
+ }
289
+ }
290
+
291
+ /**
292
+ * Check if the page being rendered is the main ID on the editor page.
293
+ *
294
+ * @since 1.0.0
295
+ * @param String $post_id Post ID which is to be rendered.
296
+ * @return boolean True if current if is being rendered is not being edited.
297
+ */
298
+ private function is_thrive_builder_page( $post_id ) {
299
+ $tve = ( isset( $_GET['tve'] ) && 'true' == $_GET['tve'] ) ? true : false; //phpcs:ignore
300
+ $post = isset( $_GET['post'] ) ? intval( wp_unslash( $_GET['post'] ) ) : false; //phpcs:ignore
301
+
302
+ return ( true == $tve && $post_id !== $post );
303
+ }
304
+
305
+ /**
306
+ * Overwrite meta for page
307
+ */
308
+ public function override_meta() {
309
+
310
+ // don't override meta for `elementor_library` post type.
311
+ if ( 'elementor_library' == get_post_type() ) {
312
+ return;
313
+ }
314
+
315
+ if ( ! is_singular() ) {
316
+ return;
317
+ }
318
+
319
+ global $post;
320
+ $post_id = $post->ID;
321
+ $post_type = get_post_type();
322
+
323
+ if ( 'cartflows_step' == $post_type && ( $this->is_elementor_preview_mode()
324
+ || $this->is_bb_preview_mode() || $this->is_thrive_edit_page( $post_id )
325
+ || $this->is_divi_builder_enabled( $post_id ) ) ) {
326
+
327
+ if ( '' == $post->post_content ) {
328
+
329
+ $this->overwrite_template( $post_id );
330
+ }
331
+ }
332
+ }
333
+
334
+ /**
335
+ * Assign cartflow canvas template to page.
336
+ *
337
+ * @param int $post_id post ID.
338
+ */
339
+ public function overwrite_template( $post_id ) {
340
+
341
+ $template = 'cartflows-canvas';
342
+ $key = '_wp_page_template';
343
+
344
+ $record_exists = get_post_meta( $post_id, $key, true );
345
+
346
+ if ( 'cartflows-canvas' == $record_exists ) {
347
+ return;
348
+ }
349
+
350
+ // As elementor doesn't allow update post meta using update_post_meta, run wpdb query to update post meta.
351
+ if ( class_exists( '\Elementor\Plugin' ) ) {
352
+
353
+ global $wpdb;
354
+
355
+ if ( '' == $record_exists || ! $record_exists ) {
356
+
357
+ $wpdb->insert(
358
+ $wpdb->prefix . 'postmeta',
359
+ array(
360
+ 'post_id' => $post_id,
361
+ 'meta_key' => $key,//phpcs:ignore
362
+ 'meta_value' => $template, //phpcs:ignore
363
+ )
364
+ );// db call ok;.
365
+
366
+ // alternative query to above query.
367
+ // $table = $wpdb->prefix . 'postmeta';
368
+ // $wpdb->query($wpdb->prepare( "INSERT INTO { $table } ( `post_id`, `meta_key`, 'meta_value' )
369
+ // VALUES ( '$post_id', '$key', '$template' )" ) );// db call ok; no-cache ok.
370
+
371
+ } else {
372
+
373
+ $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = %s WHERE meta_key = %s AND post_id = %s;", $template, $key, $post_id ) ); // db call ok; no-cache ok.
374
+ }
375
+ } else {
376
+
377
+ update_post_meta( $post_id, $key, $template );
378
+ }
379
+ }
380
+
381
+ /**
382
+ * Load font awesome style from oceanwp on checkout page.
383
+ */
384
+ public function load_fontawesome() {
385
+
386
+ $theme = get_template();
387
+
388
+ if ( 'oceanwp' == strtolower( $theme ) && wcf()->utils->is_step_post_type() ) {
389
+
390
+ $load_fa = apply_filters( 'cartflows_maybe_load_font_awesome', true );
391
+
392
+ if ( $load_fa ) {
393
+
394
+ wp_enqueue_style( 'font-awesome', OCEANWP_CSS_DIR_URI . 'third/font-awesome.min.css', false );//phpcs:ignore
395
+ }
396
+
397
+ $custom_css = '
398
+ #oceanwp-cart-sidebar-wrap,
399
+ #owp-qv-wrap{
400
+ display: none;
401
+ }';
402
+
403
+ wp_add_inline_style( 'wcf-frontend-global', $custom_css );
404
+ }
405
+ }
406
+ }
407
+ }
408
+
409
+ Cartflows_Compatibility::get_instance();
410
+
classes/class-cartflows-default-meta.php CHANGED
@@ -42,13 +42,20 @@ class Cartflows_Default_Meta {
42
  */
43
  private static $flow_fields = null;
44
 
45
- /**
46
- * Member Variable
47
- *
48
- * @var landing_fields
49
- */
50
  private static $landing_fields = null;
51
 
 
 
 
 
 
 
 
52
  /**
53
  * Initiator
54
  */
@@ -384,264 +391,6 @@ class Cartflows_Default_Meta {
384
  }
385
  }
386
  break;
387
- case 'FILTER_CARTFLOWS_CHECKOUT_FIELDS':
388
- $count = 10;
389
- $ordered_fields = array();
390
- $billing_fields = array();
391
-
392
- if ( isset( $_POST[ $key ] ) && is_array( $_POST[ $key ] ) ) { //phpcs:ignore
393
- $post_data = wp_unslash( $_POST[ $key ] ); //phpcs:ignore
394
-
395
- if ( 'wcf_field_order_billing' == $key ) {
396
- $billing_fields = Cartflows_Helper::get_checkout_fields( 'billing', $post_id );
397
-
398
- foreach ( $post_data as $index => $value ) {
399
- if ( isset( $billing_fields[ $value ] ) ) {
400
- $ordered_fields[ $value ] = $billing_fields[ $value ];
401
- $ordered_fields[ $value ]['priority'] = $count;
402
- $count += 10;
403
- }
404
- }
405
-
406
- $meta_value = $ordered_fields;
407
- }
408
-
409
- if ( 'wcf_field_order_shipping' == $key ) {
410
- $shipping_fields = Cartflows_Helper::get_checkout_fields( 'shipping', $post_id );
411
- foreach ( $post_data as $index => $value ) {
412
- if ( isset( $shipping_fields[ $value ] ) ) {
413
- $ordered_fields[ $value ] = $shipping_fields[ $value ];
414
- $ordered_fields[ $value ]['priority'] = $count;
415
- $count += 10;
416
- }
417
- }
418
- $meta_value = $ordered_fields;
419
- }
420
-
421
- if ( 'wcf_label_text_field_billing' == $key ) {
422
- $get_ordered_billing_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_billing' );
423
-
424
- if ( isset( $get_ordered_billing_fields ) && ! empty( $get_ordered_billing_fields ) ) {
425
- echo 'con 1';
426
- $billing_fields = $get_ordered_billing_fields;
427
- } else {
428
- echo 'con 2';
429
- $billing_fields = Cartflows_Helper::get_checkout_fields( 'billing', $post_id );
430
- }
431
-
432
- foreach ( $post_data as $index => $value ) {
433
- if ( isset( $billing_fields[ $index ] ) ) {
434
- $ordered_fields[ $index ] = $billing_fields[ $index ];
435
- $ordered_fields[ $index ]['label'] = wp_kses_post( trim( stripslashes( $value ) ) );
436
- }
437
- }
438
- $key = 'wcf_field_order_billing';
439
- $meta_value = $ordered_fields;
440
- }
441
-
442
- if ( 'wcf_label_text_field_shipping' == $key ) {
443
- $get_ordered_shipping_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_shipping' );
444
-
445
- if ( isset( $get_ordered_shipping_fields ) && ! empty( $get_ordered_shipping_fields ) ) {
446
- $shipping_fields = $get_ordered_shipping_fields;
447
- } else {
448
- $shipping_fields = Cartflows_Helper::get_checkout_fields( 'shipping', $post_id );
449
- }
450
-
451
- foreach ( $post_data as $index => $value ) {
452
- if ( isset( $shipping_fields[ $index ] ) ) {
453
- $ordered_fields[ $index ] = $shipping_fields[ $index ];
454
- $ordered_fields[ $index ]['label'] = wp_kses_post( trim( stripslashes( $value ) ) );
455
- }
456
- }
457
- $key = 'wcf_field_order_shipping';
458
- $meta_value = $ordered_fields;
459
- }
460
-
461
- if ( 'wcf_label_placeholder_field_billing' == $key ) {
462
- $get_ordered_billing_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_billing' );
463
-
464
- if ( isset( $get_ordered_billing_fields ) && ! empty( $get_ordered_billing_fields ) ) {
465
- $billing_fields = $get_ordered_billing_fields;
466
- } else {
467
- $billing_fields = Cartflows_Helper::get_checkout_fields( 'billing', $post_id );
468
- }
469
- foreach ( $post_data as $index => $value ) {
470
- if ( isset( $billing_fields[ $index ] ) ) {
471
- $ordered_fields[ $index ] = $billing_fields[ $index ];
472
- $ordered_fields[ $index ]['placeholder'] = wc_clean( stripslashes( $value ) );
473
- }
474
- }
475
-
476
- $key = 'wcf_field_order_billing';
477
- $meta_value = $ordered_fields;
478
- }
479
-
480
- if ( 'wcf_label_placeholder_field_shipping' == $key ) {
481
- $get_ordered_shipping_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_shipping' );
482
-
483
- if ( isset( $get_ordered_shipping_fields ) && ! empty( $get_ordered_shipping_fields ) ) {
484
- $shipping_fields = $get_ordered_shipping_fields;
485
- } else {
486
- $shipping_fields = Cartflows_Helper::get_checkout_fields( 'shipping', $post_id );
487
- }
488
-
489
- foreach ( $post_data as $index => $value ) {
490
- if ( isset( $shipping_fields[ $index ] ) ) {
491
- $ordered_fields[ $index ] = $shipping_fields[ $index ];
492
- $ordered_fields[ $index ]['placeholder'] = wc_clean( stripslashes( $value ) );
493
- }
494
- }
495
-
496
- $key = 'wcf_field_order_shipping';
497
- $meta_value = $ordered_fields;
498
- }
499
-
500
- if ( 'wcf_label_default_field_billing' == $key ) {
501
- $get_ordered_billing_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_billing' );
502
-
503
- if ( isset( $get_ordered_billing_fields ) && ! empty( $get_ordered_billing_fields ) ) {
504
- $billing_fields = $get_ordered_billing_fields;
505
- } else {
506
- $billing_fields = Cartflows_Helper::get_checkout_fields( 'billing', $post_id );
507
- }
508
-
509
- foreach ( $post_data as $index => $value ) {
510
- if ( isset( $billing_fields[ $index ] ) ) {
511
- $ordered_fields[ $index ] = $billing_fields[ $index ];
512
- $ordered_fields[ $index ]['default'] = wp_kses_post( trim( stripslashes( $value ) ) );
513
- }
514
- }
515
-
516
- $key = 'wcf_field_order_billing';
517
- $meta_value = $ordered_fields;
518
- }
519
-
520
- if ( 'wcf_label_default_field_shipping' == $key ) {
521
- $get_ordered_shipping_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_shipping' );
522
-
523
- if ( isset( $get_ordered_shipping_fields ) && ! empty( $get_ordered_shipping_fields ) ) {
524
- $shipping_fields = $get_ordered_shipping_fields;
525
- } else {
526
- $shipping_fields = Cartflows_Helper::get_checkout_fields( 'shipping', $post_id );
527
- }
528
-
529
- foreach ( $post_data as $index => $value ) {
530
- if ( isset( $shipping_fields[ $index ] ) ) {
531
- $ordered_fields[ $index ] = $shipping_fields[ $index ];
532
- $ordered_fields[ $index ]['default'] = wp_kses_post( trim( stripslashes( $value ) ) );
533
- }
534
- }
535
-
536
- $key = 'wcf_field_order_shipping';
537
- $meta_value = $ordered_fields;
538
- }
539
-
540
- if ( 'wcf_is_required_field_billing' == $key ) {
541
- $get_ordered_billing_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_billing' );
542
-
543
- if ( isset( $get_ordered_billing_fields ) && ! empty( $get_ordered_billing_fields ) ) {
544
- $billing_fields = $get_ordered_billing_fields;
545
- } else {
546
- $billing_fields = Cartflows_Helper::get_checkout_fields( 'billing', $post_id );
547
- }
548
-
549
- foreach ( $post_data as $index => $value ) {
550
- if ( isset( $billing_fields[ $index ] ) ) {
551
- $ordered_fields[ $index ] = $billing_fields[ $index ];
552
- if ( 'yes' == $value ) {
553
- $ordered_fields[ $index ]['required'] = true;
554
- } else {
555
- $ordered_fields[ $index ]['required'] = false;
556
- }
557
- }
558
- }
559
-
560
- $key = 'wcf_field_order_billing';
561
- $meta_value = $ordered_fields;
562
- }
563
-
564
- if ( 'wcf_is_required_field_shipping' == $key ) {
565
- $get_ordered_shipping_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_shipping' );
566
-
567
- if ( isset( $get_ordered_shipping_fields ) && ! empty( $get_ordered_shipping_fields ) ) {
568
- $shipping_fields = $get_ordered_shipping_fields;
569
- } else {
570
- $shipping_fields = Cartflows_Helper::get_checkout_fields( 'shipping', $post_id );
571
- }
572
-
573
- foreach ( $post_data as $index => $value ) {
574
- if ( isset( $shipping_fields[ $index ] ) ) {
575
- $ordered_fields[ $index ] = $shipping_fields[ $index ];
576
-
577
- if ( 'yes' == $value ) {
578
- $ordered_fields[ $index ]['required'] = true;
579
- } else {
580
- $ordered_fields[ $index ]['required'] = false;
581
- }
582
- }
583
- }
584
-
585
- $key = 'wcf_field_order_shipping';
586
- $meta_value = $ordered_fields;
587
- }
588
-
589
- if ( 'wcf_select_option_field_billing' == $key ) {
590
- $get_ordered_billing_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_billing' );
591
-
592
- if ( isset( $get_ordered_billing_fields ) && ! empty( $get_ordered_billing_fields ) ) {
593
- $billing_fields = $get_ordered_billing_fields;
594
- } else {
595
- $billing_fields = Cartflows_Helper::get_checkout_fields( 'billing', $post_id );
596
- }
597
-
598
- foreach ( $post_data as $index => $value ) {
599
- $options = explode( ',', $value );
600
-
601
- if ( isset( $billing_fields[ $index ] ) ) {
602
- $ordered_fields[ $index ] = $billing_fields[ $index ];
603
-
604
- $ordered_fields[ $index ]['options'] = array();
605
-
606
- foreach ( $options as $key => $option ) {
607
- $ordered_fields[ $index ]['options'][ $option ] = trim( stripslashes( $option ) );
608
- }
609
- }
610
- }
611
-
612
- $key = 'wcf_field_order_billing';
613
- $meta_value = $ordered_fields;
614
- }
615
-
616
- if ( 'wcf_select_option_field_shipping' == $key ) {
617
- $get_ordered_shipping_fields = wcf()->options->get_checkout_meta_value( $post_id, 'wcf_field_order_shipping' );
618
-
619
- if ( isset( $get_ordered_shipping_fields ) && ! empty( $get_ordered_shipping_fields ) ) {
620
- $shipping_fields = $get_ordered_shipping_fields;
621
- } else {
622
- $shipping_fields = Cartflows_Helper::get_checkout_fields( 'shipping', $post_id );
623
- }
624
-
625
- foreach ( $post_data as $index => $value ) {
626
- $options = explode( ',', $value );
627
-
628
- if ( isset( $shipping_fields[ $index ] ) ) {
629
- $ordered_fields[ $index ] = $shipping_fields[ $index ];
630
-
631
- $ordered_fields[ $index ]['options'] = array();
632
-
633
- foreach ( $options as $key => $option ) {
634
- $ordered_fields[ $index ]['options'][ $option ] = trim( stripslashes( $option ) );
635
- }
636
- }
637
- }
638
-
639
- $key = 'wcf_field_order_shipping';
640
- $meta_value = $ordered_fields;
641
- }
642
- }
643
- break;
644
-
645
  default:
646
  if ( 'FILTER_DEFAULT' === $sanitize_filter ) {
647
  $meta_value = filter_input( INPUT_POST, $key, FILTER_DEFAULT );
@@ -754,6 +503,10 @@ class Cartflows_Default_Meta {
754
  'default' => '',
755
  'sanitize' => 'FILTER_DEFAULT',
756
  ),
 
 
 
 
757
  'wcf-tq-heading-color' => array(
758
  'default' => '',
759
  'sanitize' => 'FILTER_DEFAULT',
@@ -866,7 +619,7 @@ class Cartflows_Default_Meta {
866
  }
867
 
868
  /**
869
- * Thank You Default fields.
870
  *
871
  * @param int $post_id post id.
872
  * @return array
@@ -883,6 +636,198 @@ class Cartflows_Default_Meta {
883
  }
884
  return apply_filters( 'cartflows_landing_meta_options', self::$landing_fields, $post_id );
885
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
886
  }
887
 
888
  /**
42
  */
43
  private static $flow_fields = null;
44
 
45
+ /**
46
+ * Member Variable
47
+ *
48
+ * @var landing_fields
49
+ */
50
  private static $landing_fields = null;
51
 
52
+ /**
53
+ * Member Variable
54
+ *
55
+ * @var optin_fields
56
+ */
57
+ private static $optin_fields = null;
58
+
59
  /**
60
  * Initiator
61
  */
391
  }
392
  }
393
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
394
  default:
395
  if ( 'FILTER_DEFAULT' === $sanitize_filter ) {
396
  $meta_value = filter_input( INPUT_POST, $key, FILTER_DEFAULT );
503
  'default' => '',
504
  'sanitize' => 'FILTER_DEFAULT',
505
  ),
506
+ 'wcf-tq-font-size' => array(
507
+ 'default' => '',
508
+ 'sanitize' => 'FILTER_DEFAULT',
509
+ ),
510
  'wcf-tq-heading-color' => array(
511
  'default' => '',
512
  'sanitize' => 'FILTER_DEFAULT',
619
  }
620
 
621
  /**
622
+ * Landing Default fields.
623
  *
624
  * @param int $post_id post id.
625
  * @return array
636
  }
637
  return apply_filters( 'cartflows_landing_meta_options', self::$landing_fields, $post_id );
638
  }
639
+
640
+ /**
641
+ * Optin Default fields.
642
+ *
643
+ * @param int $post_id post id.
644
+ * @return array
645
+ */
646
+ public function get_optin_fields( $post_id ) {
647
+
648
+ if ( null === self::$optin_fields ) {
649
+ self::$optin_fields = array(
650
+
651
+ 'wcf-optin-product' => array(
652
+ 'default' => array(),
653
+ 'sanitize' => 'FILTER_CARTFLOWS_ARRAY',
654
+ ),
655
+
656
+ /* Style */
657
+ 'wcf-field-google-font-url' => array(
658
+ 'default' => '',
659
+ 'sanitize' => 'FILTER_DEFAULT',
660
+ ),
661
+ 'wcf-primary-color' => array(
662
+ 'default' => '',
663
+ 'sanitize' => 'FILTER_DEFAULT',
664
+ ),
665
+ 'wcf-base-font-family' => array(
666
+ 'default' => '',
667
+ 'sanitize' => 'FILTER_DEFAULT',
668
+ ),
669
+ 'wcf-input-fields-skins' => array(
670
+ 'default' => '',
671
+ 'sanitize' => 'FILTER_DEFAULT',
672
+ ),
673
+ 'wcf-input-font-family' => array(
674
+ 'default' => '',
675
+ 'sanitize' => 'FILTER_DEFAULT',
676
+ ),
677
+ 'wcf-input-font-weight' => array(
678
+ 'default' => '',
679
+ 'sanitize' => 'FILTER_DEFAULT',
680
+ ),
681
+ 'wcf-input-field-size' => array(
682
+ 'default' => '33px',
683
+ 'sanitize' => 'FILTER_DEFAULT',
684
+ ),
685
+ 'wcf-field-tb-padding' => array(
686
+ 'default' => '',
687
+ 'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
688
+ ),
689
+ 'wcf-field-lr-padding' => array(
690
+ 'default' => '',
691
+ 'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
692
+ ),
693
+ 'wcf-field-color' => array(
694
+ 'default' => '',
695
+ 'sanitize' => 'FILTER_DEFAULT',
696
+ ),
697
+ 'wcf-field-bg-color' => array(
698
+ 'default' => '',
699
+ 'sanitize' => 'FILTER_DEFAULT',
700
+ ),
701
+ 'wcf-field-border-color' => array(
702
+ 'default' => '',
703
+ 'sanitize' => 'FILTER_DEFAULT',
704
+ ),
705
+ 'wcf-field-label-color' => array(
706
+ 'default' => '',
707
+ 'sanitize' => 'FILTER_DEFAULT',
708
+ ),
709
+ 'wcf-submit-button-text' => array(
710
+ 'default' => __( 'Submit', 'cartflows' ),
711
+ 'sanitize' => 'FILTER_DEFAULT',
712
+ ),
713
+ 'wcf-submit-font-size' => array(
714
+ 'default' => '',
715
+ 'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
716
+ ),
717
+ 'wcf-button-font-family' => array(
718
+ 'default' => '',
719
+ 'sanitize' => 'FILTER_DEFAULT',
720
+ ),
721
+ 'wcf-button-font-weight' => array(
722
+ 'default' => '',
723
+ 'sanitize' => 'FILTER_DEFAULT',
724
+ ),
725
+ 'wcf-submit-button-size' => array(
726
+ 'default' => '33px',
727
+ 'sanitize' => 'FILTER_DEFAULT',
728
+ ),
729
+ 'wcf-submit-tb-padding' => array(
730
+ 'default' => '',
731
+ 'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
732
+ ),
733
+ 'wcf-submit-lr-padding' => array(
734
+ 'default' => '',
735
+ 'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
736
+ ),
737
+ 'wcf-submit-button-position' => array(
738
+ 'default' => 'center',
739
+ 'sanitize' => 'FILTER_DEFAULT',
740
+ ),
741
+ 'wcf-submit-color' => array(
742
+ 'default' => '',
743
+ 'sanitize' => 'FILTER_DEFAULT',
744
+ ),
745
+ 'wcf-submit-hover-color' => array(
746
+ 'default' => '',
747
+ 'sanitize' => 'FILTER_DEFAULT',
748
+ ),
749
+ 'wcf-submit-bg-color' => array(
750
+ 'default' => '',
751
+ 'sanitize' => 'FILTER_DEFAULT',
752
+ ),
753
+ 'wcf-submit-bg-hover-color' => array(
754
+ 'default' => '',
755
+ 'sanitize' => 'FILTER_DEFAULT',
756
+ ),
757
+ 'wcf-submit-border-color' => array(
758
+ 'default' => '',
759
+ 'sanitize' => 'FILTER_DEFAULT',
760
+ ),
761
+ 'wcf-submit-border-hover-color' => array(
762
+ 'default' => '',
763
+ 'sanitize' => 'FILTER_DEFAULT',
764
+ ),
765
+
766
+ /* Settings */
767
+ 'wcf-optin-pass-fields' => array(
768
+ 'default' => '',
769
+ 'sanitize' => 'FILTER_DEFAULT',
770
+ ),
771
+ 'wcf-optin-pass-specific-fields' => array(
772
+ 'default' => 'first_name',
773
+ 'sanitize' => 'FILTER_DEFAULT',
774
+ ),
775
+
776
+ /* Script */
777
+ 'wcf-custom-script' => array(
778
+ 'default' => '',
779
+ 'sanitize' => 'FILTER_DEFAULT',
780
+ ),
781
+
782
+ /* Hidden */
783
+ 'wcf-active-tab' => array(
784
+ 'default' => '',
785
+ 'sanitize' => 'FILTER_DEFAULT',
786
+ ),
787
+ );
788
+ }
789
+ return apply_filters( 'cartflows_optin_meta_options', self::$optin_fields, $post_id );
790
+ }
791
+
792
+ /**
793
+ * Save Optin Meta fields.
794
+ *
795
+ * @param int $post_id post id.
796
+ * @return void
797
+ */
798
+ public function save_optin_fields( $post_id ) {
799
+
800
+ $post_meta = $this->get_optin_fields( $post_id );
801
+
802
+ $this->save_meta_fields( $post_id, $post_meta );
803
+ }
804
+
805
+ /**
806
+ * Get optin meta.
807
+ *
808
+ * @param int $post_id post id.
809
+ * @param string $key options key.
810
+ * @param mix $default options default value.
811
+ * @return string
812
+ */
813
+ public function get_optin_meta_value( $post_id = 0, $key = '', $default = false ) {
814
+
815
+ $value = $this->get_save_meta( $post_id, $key );
816
+
817
+ if ( ! $value ) {
818
+ if ( false !== $default ) {
819
+ $value = $default;
820
+ } else {
821
+ $fields = $this->get_optin_fields( $post_id );
822
+
823
+ if ( isset( $fields[ $key ]['default'] ) ) {
824
+ $value = $fields[ $key ]['default'];
825
+ }
826
+ }
827
+ }
828
+
829
+ return $value;
830
+ }
831
  }
832
 
833
  /**
classes/class-cartflows-elementor-compatibility.php CHANGED
@@ -38,6 +38,17 @@ class Cartflows_Elementor_Compatibility {
38
  public function __construct() {
39
 
40
  add_filter( 'cartflows_page_template', array( $this, 'get_page_template' ) );
 
 
 
 
 
 
 
 
 
 
 
41
  }
42
 
43
  /**
@@ -58,6 +69,29 @@ class Cartflows_Elementor_Compatibility {
58
 
59
  return $template;
60
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
 
63
  /**
38
  public function __construct() {
39
 
40
  add_filter( 'cartflows_page_template', array( $this, 'get_page_template' ) );
41
+
42
+ if ( wcf()->is_woo_active ) {
43
+
44
+ // On Editor - Register WooCommerce frontend hooks before the Editor init.
45
+ // Priority = 5, in order to allow plugins remove/add their wc hooks on init.
46
+ if ( ! empty( $_REQUEST['action'] ) && 'elementor' === $_REQUEST['action'] && is_admin() ) { //phpcs:ignore
47
+ add_action( 'init', array( $this, 'register_wc_hooks' ), 5 );
48
+ }
49
+
50
+ add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'maybe_init_cart' ) );
51
+ }
52
  }
53
 
54
  /**
69
 
70
  return $template;
71
  }
72
+
73
+ /**
74
+ * Rgister wc hookes for elementor preview mode
75
+ */
76
+ public function register_wc_hooks() {
77
+ wc()->frontend_includes();
78
+ }
79
+
80
+ /**
81
+ * Init cart in elementor preview mode
82
+ */
83
+ public function maybe_init_cart() {
84
+
85
+ $has_cart = is_a( WC()->cart, 'WC_Cart' );
86
+
87
+ if ( ! $has_cart ) {
88
+ $session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' );
89
+ WC()->session = new $session_class();
90
+ WC()->session->init();
91
+ WC()->cart = new \WC_Cart();
92
+ WC()->customer = new \WC_Customer( get_current_user_id(), true );
93
+ }
94
+ }
95
  }
96
 
97
  /**
classes/class-cartflows-flow-frontend.php CHANGED
@@ -198,6 +198,47 @@ class Cartflows_Flow_Frontend {
198
 
199
  return $thankyou_step_id;
200
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  }
202
 
203
  /**
198
 
199
  return $thankyou_step_id;
200
  }
201
+
202
+ /**
203
+ * Check thank you page exists.
204
+ *
205
+ * @since 1.0.0
206
+ * @param array $order order data.
207
+ *
208
+ * @return bool
209
+ */
210
+ public function get_next_step_id( $order ) {
211
+
212
+ $next_step_id = false;
213
+
214
+ $flow_id = wcf()->utils->get_flow_id_from_order( $order->get_id() );
215
+
216
+ if ( $flow_id ) {
217
+
218
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
219
+ $step_id = wcf()->utils->get_optin_id_from_order( $order->get_id() );
220
+
221
+ if ( is_array( $flow_steps ) ) {
222
+
223
+ foreach ( $flow_steps as $index => $data ) {
224
+
225
+ if ( intval( $data['id'] ) === $step_id ) {
226
+
227
+ $next_step_index = $index + 1;
228
+
229
+ if ( isset( $flow_steps[ $next_step_index ] ) ) {
230
+
231
+ $next_step_id = intval( $flow_steps[ $next_step_index ]['id'] );
232
+ }
233
+
234
+ break;
235
+ }
236
+ }
237
+ }
238
+ }
239
+
240
+ return $next_step_id;
241
+ }
242
  }
243
 
244
  /**
classes/class-cartflows-frontend.php CHANGED
@@ -1,540 +1,634 @@
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
- add_action( 'init', array( $this, 'debug_data_setting_actions' ) );
39
- /* Enqueue global required scripts */
40
- add_action( 'wp', array( $this, 'wp_actions' ), 55 );
41
-
42
- /* Modify the checkout order received url to go thank you page in our flow */
43
- add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_to_thankyou_page' ), 10, 2 );
44
-
45
- }
46
-
47
- /**
48
- * Redirect to thank page if upsell not exists
49
- *
50
- * @param string $order_recieve_url url.
51
- * @param object $order order object.
52
- * @since 1.0.0
53
- */
54
- public function redirect_to_thankyou_page( $order_recieve_url, $order ) {
55
-
56
- /* Only for thank you page */
57
- wcf()->logger->log( 'Start-' . __CLASS__ . '::' . __FUNCTION__ );
58
- wcf()->logger->log( 'Only for thank you page' );
59
-
60
- if ( wcf()->flow->is_thankyou_page_exists( $order ) ) {
61
-
62
- if ( _is_wcf_doing_checkout_ajax() ) {
63
-
64
- $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
65
-
66
- if ( ! $checkout_id ) {
67
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
68
- }
69
- } else {
70
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
71
- }
72
-
73
- wcf()->logger->log( 'Checkout ID : ' . $checkout_id );
74
-
75
- if ( $checkout_id ) {
76
-
77
- $thankyou_step_id = wcf()->flow->get_thankyou_page_id( $order );
78
-
79
- if ( $thankyou_step_id ) {
80
-
81
- $order_recieve_url = get_permalink( $thankyou_step_id );
82
-
83
- $order_recieve_url = add_query_arg(
84
- array(
85
- 'wcf-key' => $order->get_order_key(),
86
- 'wcf-order' => $order->get_id(),
87
- ),
88
- $order_recieve_url
89
- );
90
- }
91
- }
92
- }
93
-
94
- wcf()->logger->log( 'End-' . __CLASS__ . '::' . __FUNCTION__ );
95
-
96
- Cartflows_Helper::send_fb_response_if_enabled( $order->get_id() );
97
-
98
- return $order_recieve_url;
99
- }
100
-
101
- /**
102
- * Cancel and redirect to checkout
103
- *
104
- * @param string $return_url url.
105
- * @since 1.0.0
106
- */
107
- public function redirect_to_checkout_on_cancel( $return_url ) {
108
-
109
- if ( _is_wcf_doing_checkout_ajax() ) {
110
-
111
- $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
112
-
113
- if ( ! $checkout_id ) {
114
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
115
- }
116
- } else {
117
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
118
- }
119
-
120
- if ( $checkout_id ) {
121
-
122
- $return_url = add_query_arg(
123
- array(
124
- 'cancel_order' => 'true',
125
- '_wpnonce' => wp_create_nonce( 'woocommerce-cancel_order' ),
126
- ),
127
- get_permalink( $checkout_id )
128
- );
129
- }
130
-
131
- return $return_url;
132
- }
133
-
134
-
135
- /**
136
- * Remove theme styles.
137
- *
138
- * @since 1.0.0
139
- */
140
- public function remove_theme_styles() {
141
-
142
- if ( Cartflows_Compatibility::get_instance()->is_compatibility_theme_enabled() ) {
143
- return;
144
- }
145
-
146
- $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
147
-
148
- $page_template = apply_filters( 'cartflows_page_template', $page_template );
149
-
150
- if ( 'default' === $page_template ) {
151
- return;
152
- }
153
-
154
- // get all styles data.
155
- global $wp_styles;
156
- global $wp_scripts;
157
-
158
- $get_stylesheet = 'themes/' . get_stylesheet() . '/';
159
- $get_template = 'themes/' . get_template() . '/';
160
-
161
- $remove_styles = apply_filters( 'cartflows_remove_theme_styles', true );
162
-
163
- if ( $remove_styles ) {
164
-
165
- // loop over all of the registered scripts..
166
- foreach ( $wp_styles->registered as $handle => $data ) {
167
-
168
- if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
169
-
170
- // remove it.
171
- wp_deregister_style( $handle );
172
- wp_dequeue_style( $handle );
173
- }
174
- }
175
- }
176
-
177
- $remove_scripts = apply_filters( 'cartflows_remove_theme_scripts', true );
178
-
179
- if ( $remove_scripts ) {
180
-
181
- // loop over all of the registered scripts.
182
- foreach ( $wp_scripts->registered as $handle => $data ) {
183
-
184
- if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
185
-
186
- // remove it.
187
- wp_deregister_script( $handle );
188
- wp_dequeue_script( $handle );
189
- }
190
- }
191
- }
192
-
193
- }
194
-
195
- /**
196
- * Update main order data in transient.
197
- *
198
- * @param array $woo_styles new styles array.
199
- * @since 1.0.0
200
- * @return array.
201
- */
202
- public function woo_default_css( $woo_styles ) {
203
-
204
- $woo_styles = array(
205
- 'woocommerce-layout' => array(
206
- 'src' => plugins_url( 'assets/css/woocommerce-layout.css', WC_PLUGIN_FILE ),
207
- 'deps' => '',
208
- 'version' => WC_VERSION,
209
- 'media' => 'all',
210
- 'has_rtl' => true,
211
- ),
212
- 'woocommerce-smallscreen' => array(
213
- 'src' => plugins_url( 'assets/css/woocommerce-smallscreen.css', WC_PLUGIN_FILE ),
214
- 'deps' => 'woocommerce-layout',
215
- 'version' => WC_VERSION,
216
- 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', '768px' ) . ')',
217
- 'has_rtl' => true,
218
- ),
219
- 'woocommerce-general' => array(
220
- 'src' => plugins_url( 'assets/css/woocommerce.css', WC_PLUGIN_FILE ),
221
- 'deps' => '',
222
- 'version' => WC_VERSION,
223
- 'media' => 'all',
224
- 'has_rtl' => true,
225
- ),
226
- );
227
-
228
- return $woo_styles;
229
- }
230
-
231
- /**
232
- * Init Actions.
233
- *
234
- * @since 1.0.0
235
- */
236
- public function init_actions() {
237
-
238
- $this->set_flow_session();
239
- }
240
-
241
- /**
242
- * Set flow session.
243
- *
244
- * @since 1.0.0
245
- */
246
- public function set_flow_session() {
247
-
248
- if ( wcf()->utils->is_step_post_type() ) {
249
- global $wp;
250
- add_action( 'wp_head', array( $this, 'noindex_flow' ) );
251
-
252
- wcf()->utils->do_not_cache();
253
-
254
- /* Set key to support pixel */
255
- if ( isset( $_GET['wcf-key'] ) ) { //phpcs:ignore
256
-
257
- $wcf_key = sanitize_text_field( wp_unslash( $_GET['wcf-key'] ) ); //phpcs:ignore
258
-
259
- $_GET['key'] = $wcf_key;
260
- $_REQUEST['key'] = $wcf_key;
261
- }
262
-
263
- if ( isset( $_GET['wcf-order'] ) ) { //phpcs:ignore
264
-
265
- $wcf_order = intval( wp_unslash( $_GET['wcf-order'] ) ); //phpcs:ignore
266
-
267
- $_GET['order'] = $wcf_order;
268
- $_REQUEST['order'] = $wcf_order;
269
- $_GET['order-received'] = $wcf_order;
270
- $_REQUEST['order-received'] = $wcf_order;
271
-
272
- if ( _is_wcf_thankyou_type() ) {
273
- $wp->set_query_var( 'order-received', $wcf_order );
274
- }
275
- }
276
- }
277
- }
278
-
279
- /**
280
- * Add noindex, nofollow.
281
- *
282
- * @since 1.0.0
283
- */
284
- public function noindex_flow() {
285
-
286
- $common = Cartflows_Helper::get_common_settings();
287
-
288
- if ( 'enable' === $common['disallow_indexing'] ) {
289
- echo '<meta name="robots" content="noindex,nofollow">';
290
- }
291
- }
292
-
293
- /**
294
- * WP Actions.
295
- *
296
- * @since 1.0.0
297
- */
298
- public function wp_actions() {
299
-
300
- if ( wcf()->utils->is_step_post_type() ) {
301
-
302
- if ( ! wcf()->is_woo_active && wcf()->utils->check_is_woo_required_page() ) {
303
- wp_die( ' This page requires WooCommerce plugin installed and activated!', 'WooCommerce Required' );
304
- }
305
-
306
- /* CSS Compatibility for All theme */
307
- add_filter( 'woocommerce_enqueue_styles', array( $this, 'woo_default_css' ), 9999 );
308
-
309
- add_action( 'wp_enqueue_scripts', array( $this, 'remove_theme_styles' ), 9999 );
310
- add_action( 'wp_enqueue_scripts', array( $this, 'global_flow_scripts' ), 20 );
311
-
312
- /* Load woo templates from plugin */
313
- add_filter( 'woocommerce_locate_template', array( $this, 'override_woo_template' ), 20, 3 );
314
-
315
- /* Add version class to body in frontend. */
316
- add_filter( 'body_class', array( $this, 'add_cartflows_lite_version_to_body' ) );
317
-
318
- /* Custom Script Option */
319
- add_action( 'wp_head', array( $this, 'custom_script_option' ) );
320
-
321
- /* Remove the action applied by the Flatsome theme */
322
- if ( Cartflows_Compatibility::get_instance()->is_flatsome_enabled() ) {
323
- $this->remove_flatsome_action();
324
- }
325
-
326
- add_action( 'wp_head', array( $this, 'facebook_pixel_init' ) );
327
- }
328
- }
329
-
330
- /**
331
- * Function for facebook pixel.
332
- */
333
- public function facebook_pixel_init() {
334
-
335
- $facebook_settings = Cartflows_Helper::get_facebook_settings();
336
- if ( 'enable' === $facebook_settings['facebook_pixel_tracking'] ) {
337
-
338
- $facebook_id = $facebook_settings['facebook_pixel_id'];
339
- echo '<!-- Facebook Pixel Script By CartFlows -->';
340
- echo "<script type='text/javascript'>
341
- !function(f,b,e,v,n,t,s)
342
- {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
343
- n.callMethod.apply(n,arguments):n.queue.push(arguments)};
344
- if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
345
- n.queue=[];t=b.createElement(e);t.async=!0;
346
- t.src=v;s=b.getElementsByTagName(e)[0];
347
- s.parentNode.insertBefore(t,s)}(window, document,'script',
348
- 'https://connect.facebook.net/en_US/fbevents.js');
349
- </script>
350
- <noscript><img height='1' width='1' style='display:none' src='https://www.facebook.com/tr?id=<?php echo $facebook_id; ?>&ev=PageView&noscript=1'/></noscript>";
351
- echo '<!-- End Facebook Pixel Script By CartFlows -->';
352
- }
353
-
354
- }
355
-
356
- /**
357
- * Debug Data Setting Actions.
358
- *
359
- * @since 1.1.14
360
- */
361
- public function debug_data_setting_actions() {
362
-
363
- add_filter( 'cartflows_load_min_assets', array( $this, 'allow_load_minify' ) );
364
- }
365
-
366
- /**
367
- * Get/Set the allow minify option.
368
- *
369
- * @since 1.1.14
370
- */
371
- public function allow_load_minify() {
372
- $debug_data = Cartflows_Helper::get_debug_settings();
373
- $allow_minified = $debug_data['allow_minified_files'];
374
- $allow_minify = false;
375
-
376
- if ( 'enable' === $allow_minified ) {
377
- $allow_minify = true;
378
- }
379
-
380
- return $allow_minify;
381
- }
382
-
383
- /**
384
- * Global flow scripts.
385
- *
386
- * @since 1.0.0
387
- */
388
- public function global_flow_scripts() {
389
-
390
- global $post;
391
-
392
- $flow = get_post_meta( $post->ID, 'wcf-flow-id', true );
393
- $current_step = $post->ID;
394
- $next_step_link = '';
395
- $compatibility = Cartflows_Compatibility::get_instance();
396
-
397
- if ( _is_wcf_landing_type() ) {
398
-
399
- $next_step_id = wcf()->utils->get_next_step_id( $flow, $current_step );
400
- $next_step_link = get_permalink( $next_step_id );
401
- }
402
-
403
- $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
404
-
405
- $fb_active = get_option( '_cartflows_facebook' );
406
- $params = array();
407
- $is_thankyou_page = _is_wcf_thankyou_type();
408
-
409
- if ( 'enable' === $fb_active['facebook_pixel_tracking'] ) {
410
-
411
- $params = Cartflows_Helper::prepare_cart_data_fb_response();
412
- }
413
-
414
- $localize = array(
415
- 'ajax_url' => admin_url( 'admin-ajax.php', 'relative' ),
416
- 'is_pb_preview' => $compatibility->is_page_builder_preview(),
417
- 'current_theme' => $compatibility->get_current_theme(),
418
- 'current_flow' => $flow,
419
- 'current_step' => $current_step,
420
- 'next_step' => $next_step_link,
421
- 'page_template' => $page_template,
422
- 'is_checkout_page' => _is_wcf_checkout_type(),
423
- 'is_thankyou_page' => $is_thankyou_page,
424
- 'params' => $params,
425
- 'fb_active' => $fb_active,
426
- );
427
-
428
- wp_localize_script( 'jquery', 'cartflows', apply_filters( 'global_cartflows_js_localize', $localize ) );
429
-
430
- if ( 'default' !== $page_template ) {
431
-
432
- wp_enqueue_style( 'wcf-normalize-frontend-global', wcf()->utils->get_css_url( 'cartflows-normalize' ), array(), CARTFLOWS_VER );
433
- }
434
-
435
- wp_enqueue_style( 'wcf-frontend-global', wcf()->utils->get_css_url( 'frontend' ), array(), CARTFLOWS_VER );
436
-
437
- wp_enqueue_script(
438
- 'wcf-frontend-global',
439
- wcf()->utils->get_js_url( 'frontend' ),
440
- array( 'jquery', 'jquery-cookie' ),
441
- CARTFLOWS_VER,
442
- false
443
- );
444
- }
445
-
446
- /**
447
- * Custom Script in head.
448
- *
449
- * @since 1.0.0
450
- */
451
- public function custom_script_option() {
452
-
453
- /* Add custom script to header in frontend. */
454
- $script = $this->get_custom_script();
455
- if ( '' !== $script ) {
456
- if ( false === strpos( $script, '<script' ) ) {
457
- $script = '<script>' . $script . '</script>';
458
- }
459
- echo '<!-- Custom CartFlows Script -->';
460
- echo $script;
461
- echo '<!-- End Custom CartFlows Script -->';
462
- }
463
- }
464
-
465
- /**
466
- * Override woo templates.
467
- *
468
- * @param string $template new Template full path.
469
- * @param string $template_name Template name.
470
- * @param string $template_path Template Path.
471
- * @since 1.1.5
472
- * @return string.
473
- */
474
- public function override_woo_template( $template, $template_name, $template_path ) {
475
-
476
- global $woocommerce;
477
-
478
- $_template = $template;
479
-
480
- $plugin_path = CARTFLOWS_DIR . 'woocommerce/template/';
481
-
482
- if ( file_exists( $plugin_path . $template_name ) ) {
483
- $template = $plugin_path . $template_name;
484
- }
485
-
486
- if ( ! $template ) {
487
- $template = $_template;
488
- }
489
-
490
- return $template;
491
- }
492
-
493
- /**
494
- * Remove the action applied by the Flatsome theme.
495
- *
496
- * @since 1.1.5
497
- * @return void.
498
- */
499
- public function remove_flatsome_action() {
500
-
501
- // Remove action where flatsome dequeued the woocommerce's default styles.
502
- remove_action( 'wp_enqueue_scripts', 'flatsome_woocommerce_scripts_styles', 98 );
503
- }
504
-
505
- /**
506
- * Add version class to body in frontend.
507
- *
508
- * @since 1.1.5
509
- * @param array $classes classes.
510
- * @return array $classes classes.
511
- */
512
- public function add_cartflows_lite_version_to_body( $classes ) {
513
-
514
- $classes[] = 'cartflows-' . CARTFLOWS_VER;
515
-
516
- return $classes;
517
-
518
- }
519
-
520
- /**
521
- * Get custom script data.
522
- *
523
- * @since 1.0.0
524
- */
525
- public function get_custom_script() {
526
-
527
- global $post;
528
-
529
- $script = get_post_meta( $post->ID, 'wcf-custom-script', true );
530
-
531
- return $script;
532
- }
533
-
534
- }
535
-
536
- /**
537
- * Prepare if class 'Cartflows_Frontend' exist.
538
- * Kicking this off by calling 'get_instance()' method
539
- */
540
- 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
+ add_action( 'init', array( $this, 'debug_data_setting_actions' ) );
39
+ add_action( 'init', array( $this, 'setup_optin_checkout_filter' ) );
40
+ /* Enqueue global required scripts */
41
+ add_action( 'wp', array( $this, 'wp_actions' ), 55 );
42
+
43
+ /* Modify the checkout order received url to go thank you page in our flow */
44
+ add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_to_thankyou_page' ), 10, 2 );
45
+
46
+ }
47
+
48
+ /**
49
+ * Redirect to thank page if upsell not exists
50
+ *
51
+ * @param string $order_recieve_url url.
52
+ * @param object $order order object.
53
+ * @since 1.0.0
54
+ */
55
+ public function redirect_to_thankyou_page( $order_recieve_url, $order ) {
56
+
57
+ /* Only for thank you page */
58
+ wcf()->logger->log( 'Start-' . __CLASS__ . '::' . __FUNCTION__ );
59
+ wcf()->logger->log( 'Only for thank you page' );
60
+
61
+ if ( wcf()->flow->is_thankyou_page_exists( $order ) ) {
62
+
63
+ if ( _is_wcf_doing_checkout_ajax() ) {
64
+
65
+ $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
66
+
67
+ if ( ! $checkout_id ) {
68
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
69
+ }
70
+ } else {
71
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
72
+ }
73
+
74
+ wcf()->logger->log( 'Checkout ID : ' . $checkout_id );
75
+
76
+ if ( $checkout_id ) {
77
+
78
+ $thankyou_step_id = wcf()->flow->get_thankyou_page_id( $order );
79
+
80
+ if ( $thankyou_step_id ) {
81
+
82
+ $order_recieve_url = get_permalink( $thankyou_step_id );
83
+
84
+ $order_recieve_url = add_query_arg(
85
+ array(
86
+ 'wcf-key' => $order->get_order_key(),
87
+ 'wcf-order' => $order->get_id(),
88
+ ),
89
+ $order_recieve_url
90
+ );
91
+ }
92
+ }
93
+ }
94
+
95
+ wcf()->logger->log( 'End-' . __CLASS__ . '::' . __FUNCTION__ );
96
+
97
+ Cartflows_Helper::send_fb_response_if_enabled( $order->get_id() );
98
+
99
+ return $order_recieve_url;
100
+ }
101
+
102
+ /**
103
+ * Cancel and redirect to checkout
104
+ *
105
+ * @param string $return_url url.
106
+ * @since 1.0.0
107
+ */
108
+ public function redirect_to_checkout_on_cancel( $return_url ) {
109
+
110
+ if ( _is_wcf_doing_checkout_ajax() ) {
111
+
112
+ $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
113
+
114
+ if ( ! $checkout_id ) {
115
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
116
+ }
117
+ } else {
118
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
119
+ }
120
+
121
+ if ( $checkout_id ) {
122
+
123
+ $return_url = add_query_arg(
124
+ array(
125
+ 'cancel_order' => 'true',
126
+ '_wpnonce' => wp_create_nonce( 'woocommerce-cancel_order' ),
127
+ ),
128
+ get_permalink( $checkout_id )
129
+ );
130
+ }
131
+
132
+ return $return_url;
133
+ }
134
+
135
+
136
+ /**
137
+ * Remove theme styles.
138
+ *
139
+ * @since 1.0.0
140
+ */
141
+ public function remove_theme_styles() {
142
+
143
+ if ( Cartflows_Compatibility::get_instance()->is_compatibility_theme_enabled() ) {
144
+ return;
145
+ }
146
+
147
+ $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
148
+
149
+ $page_template = apply_filters( 'cartflows_page_template', $page_template );
150
+
151
+ if ( 'default' === $page_template ) {
152
+ return;
153
+ }
154
+
155
+ // get all styles data.
156
+ global $wp_styles;
157
+ global $wp_scripts;
158
+
159
+ $get_stylesheet = 'themes/' . get_stylesheet() . '/';
160
+ $get_template = 'themes/' . get_template() . '/';
161
+
162
+ $remove_styles = apply_filters( 'cartflows_remove_theme_styles', true );
163
+
164
+ if ( $remove_styles ) {
165
+
166
+ // loop over all of the registered scripts..
167
+ foreach ( $wp_styles->registered as $handle => $data ) {
168
+
169
+ if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
170
+
171
+ // remove it.
172
+ wp_deregister_style( $handle );
173
+ wp_dequeue_style( $handle );
174
+ }
175
+ }
176
+ }
177
+
178
+ $remove_scripts = apply_filters( 'cartflows_remove_theme_scripts', true );
179
+
180
+ if ( $remove_scripts ) {
181
+
182
+ // loop over all of the registered scripts.
183
+ foreach ( $wp_scripts->registered as $handle => $data ) {
184
+
185
+ if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
186
+
187
+ // remove it.
188
+ wp_deregister_script( $handle );
189
+ wp_dequeue_script( $handle );
190
+ }
191
+ }
192
+ }
193
+
194
+ }
195
+
196
+ /**
197
+ * Update main order data in transient.
198
+ *
199
+ * @param array $woo_styles new styles array.
200
+ * @since 1.0.0
201
+ * @return array.
202
+ */
203
+ public function woo_default_css( $woo_styles ) {
204
+
205
+ $woo_styles = array(
206
+ 'woocommerce-layout' => array(
207
+ 'src' => plugins_url( 'assets/css/woocommerce-layout.css', WC_PLUGIN_FILE ),
208
+ 'deps' => '',
209
+ 'version' => WC_VERSION,
210
+ 'media' => 'all',
211
+ 'has_rtl' => true,
212
+ ),
213
+ 'woocommerce-smallscreen' => array(
214
+ 'src' => plugins_url( 'assets/css/woocommerce-smallscreen.css', WC_PLUGIN_FILE ),
215
+ 'deps' => 'woocommerce-layout',
216
+ 'version' => WC_VERSION,
217
+ 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', '768px' ) . ')',
218
+ 'has_rtl' => true,
219
+ ),
220
+ 'woocommerce-general' => array(
221
+ 'src' => plugins_url( 'assets/css/woocommerce.css', WC_PLUGIN_FILE ),
222
+ 'deps' => '',
223
+ 'version' => WC_VERSION,
224
+ 'media' => 'all',
225
+ 'has_rtl' => true,
226
+ ),
227
+ );
228
+
229
+ return $woo_styles;
230
+ }
231
+
232
+ /**
233
+ * Init Actions.
234
+ *
235
+ * @since 1.0.0
236
+ */
237
+ public function init_actions() {
238
+
239
+ $this->set_flow_session();
240
+ }
241
+
242
+ /**
243
+ * Set flow session.
244
+ *
245
+ * @since 1.0.0
246
+ */
247
+ public function set_flow_session() {
248
+
249
+ if ( wcf()->utils->is_step_post_type() ) {
250
+ global $wp;
251
+ add_action( 'wp_head', array( $this, 'noindex_flow' ) );
252
+
253
+ wcf()->utils->do_not_cache();
254
+
255
+ if ( _is_wcf_thankyou_type() ) {
256
+ /* Set key to support pixel */
257
+ if ( isset( $_GET['wcf-key'] ) ) { //phpcs:ignore
258
+
259
+ $wcf_key = sanitize_text_field( wp_unslash( $_GET['wcf-key'] ) ); //phpcs:ignore
260
+
261
+ $_GET['key'] = $wcf_key;
262
+ $_REQUEST['key'] = $wcf_key;
263
+ }
264
+
265
+ if ( isset( $_GET['wcf-order'] ) ) { //phpcs:ignore
266
+
267
+ $wcf_order = intval( wp_unslash( $_GET['wcf-order'] ) ); //phpcs:ignore
268
+
269
+ $_GET['order'] = $wcf_order;
270
+ $_REQUEST['order'] = $wcf_order;
271
+ $_GET['order-received'] = $wcf_order;
272
+ $_REQUEST['order-received'] = $wcf_order;
273
+
274
+ $wp->set_query_var( 'order-received', $wcf_order );
275
+ }
276
+ }
277
+ }
278
+ }
279
+
280
+ /**
281
+ * Add noindex, nofollow.
282
+ *
283
+ * @since 1.0.0
284
+ */
285
+ public function noindex_flow() {
286
+
287
+ $common = Cartflows_Helper::get_common_settings();
288
+
289
+ if ( 'enable' === $common['disallow_indexing'] ) {
290
+ echo '<meta name="robots" content="noindex,nofollow">';
291
+ }
292
+ }
293
+
294
+ /**
295
+ * WP Actions.
296
+ *
297
+ * @since 1.0.0
298
+ */
299
+ public function wp_actions() {
300
+
301
+ if ( wcf()->utils->is_step_post_type() ) {
302
+
303
+ if ( ! wcf()->is_woo_active && wcf()->utils->check_is_woo_required_page() ) {
304
+ wp_die( ' This page requires WooCommerce plugin installed and activated!', 'WooCommerce Required' );
305
+ }
306
+
307
+ /* CSS Compatibility for All theme */
308
+ add_filter( 'woocommerce_enqueue_styles', array( $this, 'woo_default_css' ), 9999 );
309
+
310
+ add_action( 'wp_enqueue_scripts', array( $this, 'remove_theme_styles' ), 9999 );
311
+ add_action( 'wp_enqueue_scripts', array( $this, 'global_flow_scripts' ), 20 );
312
+
313
+ /* Load woo templates from plugin */
314
+ add_filter( 'woocommerce_locate_template', array( $this, 'override_woo_template' ), 20, 3 );
315
+
316
+ /* Add version class to body in frontend. */
317
+ add_filter( 'body_class', array( $this, 'add_cartflows_lite_version_to_body' ) );
318
+
319
+ /* Custom Script Option */
320
+ add_action( 'wp_head', array( $this, 'custom_script_option' ) );
321
+
322
+ /* Remove the action applied by the Flatsome theme */
323
+ if ( Cartflows_Compatibility::get_instance()->is_flatsome_enabled() ) {
324
+ $this->remove_flatsome_action();
325
+ }
326
+
327
+ add_action( 'wp_head', array( $this, 'facebook_pixel_init' ) );
328
+ }
329
+ }
330
+
331
+ /**
332
+ * Function for facebook pixel.
333
+ */
334
+ public function facebook_pixel_init() {
335
+
336
+ $facebook_settings = Cartflows_Helper::get_facebook_settings();
337
+ if ( 'enable' === $facebook_settings['facebook_pixel_tracking'] ) {
338
+
339
+ $facebook_id = $facebook_settings['facebook_pixel_id'];
340
+ echo '<!-- Facebook Pixel Script By CartFlows -->';
341
+ echo "<script type='text/javascript'>
342
+ !function(f,b,e,v,n,t,s)
343
+ {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
344
+ n.callMethod.apply(n,arguments):n.queue.push(arguments)};
345
+ if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
346
+ n.queue=[];t=b.createElement(e);t.async=!0;
347
+ t.src=v;s=b.getElementsByTagName(e)[0];
348
+ s.parentNode.insertBefore(t,s)}(window, document,'script',
349
+ 'https://connect.facebook.net/en_US/fbevents.js');
350
+ </script>
351
+ <noscript><img height='1' width='1' style='display:none' src='https://www.facebook.com/tr?id=<?php echo $facebook_id; ?>&ev=PageView&noscript=1'/></noscript>";
352
+ echo '<!-- End Facebook Pixel Script By CartFlows -->';
353
+ }
354
+
355
+ }
356
+
357
+ /**
358
+ * Debug Data Setting Actions.
359
+ *
360
+ * @since 1.1.14
361
+ */
362
+ public function debug_data_setting_actions() {
363
+
364
+ add_filter( 'cartflows_load_min_assets', array( $this, 'allow_load_minify' ) );
365
+ }
366
+
367
+ /**
368
+ * Get/Set the allow minify option.
369
+ *
370
+ * @since 1.1.14
371
+ */
372
+ public function allow_load_minify() {
373
+ $debug_data = Cartflows_Helper::get_debug_settings();
374
+ $allow_minified = $debug_data['allow_minified_files'];
375
+ $allow_minify = false;
376
+
377
+ if ( 'enable' === $allow_minified ) {
378
+ $allow_minify = true;
379
+ }
380
+
381
+ return $allow_minify;
382
+ }
383
+
384
+ /**
385
+ * Global flow scripts.
386
+ *
387
+ * @since 1.0.0
388
+ */
389
+ public function global_flow_scripts() {
390
+
391
+ global $post;
392
+
393
+ $flow = get_post_meta( $post->ID, 'wcf-flow-id', true );
394
+ $current_step = $post->ID;
395
+ $next_step_link = '';
396
+ $compatibility = Cartflows_Compatibility::get_instance();
397
+
398
+ if ( _is_wcf_landing_type() ) {
399
+
400
+ $next_step_id = wcf()->utils->get_next_step_id( $flow, $current_step );
401
+ $next_step_link = get_permalink( $next_step_id );
402
+ }
403
+
404
+ $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
405
+
406
+ $fb_active = get_option( '_cartflows_facebook' );
407
+ $params = array();
408
+ $is_thankyou_page = _is_wcf_thankyou_type();
409
+
410
+ if ( 'enable' === $fb_active['facebook_pixel_tracking'] ) {
411
+
412
+ $params = Cartflows_Helper::prepare_cart_data_fb_response();
413
+ }
414
+
415
+ $localize = array(
416
+ 'ajax_url' => admin_url( 'admin-ajax.php', 'relative' ),
417
+ 'is_pb_preview' => $compatibility->is_page_builder_preview(),
418
+ 'current_theme' => $compatibility->get_current_theme(),
419
+ 'current_flow' => $flow,
420
+ 'current_step' => $current_step,
421
+ 'next_step' => $next_step_link,
422
+ 'page_template' => $page_template,
423
+ 'is_checkout_page' => _is_wcf_checkout_type(),
424
+ 'is_thankyou_page' => $is_thankyou_page,
425
+ 'params' => $params,
426
+ 'fb_active' => $fb_active,
427
+ );
428
+
429
+ wp_localize_script( 'jquery', 'cartflows', apply_filters( 'global_cartflows_js_localize', $localize ) );
430
+
431
+ if ( 'default' !== $page_template ) {
432
+
433
+ wp_enqueue_style( 'wcf-normalize-frontend-global', wcf()->utils->get_css_url( 'cartflows-normalize' ), array(), CARTFLOWS_VER );
434
+ }
435
+
436
+ wp_enqueue_style( 'wcf-frontend-global', wcf()->utils->get_css_url( 'frontend' ), array(), CARTFLOWS_VER );
437
+
438
+ wp_enqueue_script(
439
+ 'wcf-frontend-global',
440
+ wcf()->utils->get_js_url( 'frontend' ),
441
+ array( 'jquery', 'jquery-cookie' ),
442
+ CARTFLOWS_VER,
443
+ false
444
+ );
445
+ }
446
+
447
+ /**
448
+ * Custom Script in head.
449
+ *
450
+ * @since 1.0.0
451
+ */
452
+ public function custom_script_option() {
453
+
454
+ /* Add custom script to header in frontend. */
455
+ $script = $this->get_custom_script();
456
+ if ( '' !== $script ) {
457
+ if ( false === strpos( $script, '<script' ) ) {
458
+ $script = '<script>' . $script . '</script>';
459
+ }
460
+ echo '<!-- Custom CartFlows Script -->';
461
+ echo $script;
462
+ echo '<!-- End Custom CartFlows Script -->';
463
+ }
464
+ }
465
+
466
+ /**
467
+ * Override woo templates.
468
+ *
469
+ * @param string $template new Template full path.
470
+ * @param string $template_name Template name.
471
+ * @param string $template_path Template Path.
472
+ * @since 1.1.5
473
+ * @return string.
474
+ */
475
+ public function override_woo_template( $template, $template_name, $template_path ) {
476
+
477
+ global $woocommerce;
478
+
479
+ $_template = $template;
480
+
481
+ $plugin_path = CARTFLOWS_DIR . 'woocommerce/template/';
482
+
483
+ if ( file_exists( $plugin_path . $template_name ) ) {
484
+ $template = $plugin_path . $template_name;
485
+ }
486
+
487
+ if ( ! $template ) {
488
+ $template = $_template;
489
+ }
490
+
491
+ return $template;
492
+ }
493
+
494
+ /**
495
+ * Remove the action applied by the Flatsome theme.
496
+ *
497
+ * @since 1.1.5
498
+ * @return void.
499
+ */
500
+ public function remove_flatsome_action() {
501
+
502
+ // Remove action where flatsome dequeued the woocommerce's default styles.
503
+ remove_action( 'wp_enqueue_scripts', 'flatsome_woocommerce_scripts_styles', 98 );
504
+ }
505
+
506
+ /**
507
+ * Add version class to body in frontend.
508
+ *
509
+ * @since 1.1.5
510
+ * @param array $classes classes.
511
+ * @return array $classes classes.
512
+ */
513
+ public function add_cartflows_lite_version_to_body( $classes ) {
514
+
515
+ $classes[] = 'cartflows-' . CARTFLOWS_VER;
516
+
517
+ return $classes;
518
+
519
+ }
520
+
521
+ /**
522
+ * Get custom script data.
523
+ *
524
+ * @since 1.0.0
525
+ */
526
+ public function get_custom_script() {
527
+
528
+ global $post;
529
+
530
+ $script = get_post_meta( $post->ID, 'wcf-custom-script', true );
531
+
532
+ return $script;
533
+ }
534
+
535
+
536
+ /**
537
+ * Set appropriate filter sctions.
538
+ *
539
+ * @since 1.1.14
540
+ */
541
+ public function setup_optin_checkout_filter() {
542
+
543
+ if ( _is_wcf_doing_optin_ajax() ) {
544
+ /* Modify the optin order received url to go next step */
545
+ remove_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_to_thankyou_page' ), 10, 2 );
546
+ add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_optin_to_next_step' ), 10, 2 );
547
+ }
548
+ }
549
+
550
+ /**
551
+ * Redirect to thank page if upsell not exists
552
+ *
553
+ * @param string $order_recieve_url url.
554
+ * @param object $order order object.
555
+ * @since 1.0.0
556
+ */
557
+ public function redirect_optin_to_next_step( $order_recieve_url, $order ) {
558
+
559
+ /* Only for optin page */
560
+ wcf()->logger->log( 'Start-' . __CLASS__ . '::' . __FUNCTION__ );
561
+ wcf()->logger->log( 'Only for optin page' );
562
+
563
+ if ( _is_wcf_doing_optin_ajax() ) {
564
+
565
+ $optin_id = wcf()->utils->get_optin_id_from_post_data();
566
+
567
+ if ( ! $optin_id ) {
568
+ $optin_id = wcf()->utils->get_optin_id_from_order( $order->get_id() );
569
+ }
570
+ } else {
571
+ $optin_id = wcf()->utils->get_optin_id_from_order( $order->get_id() );
572
+ }
573
+
574
+ wcf()->logger->log( 'Optin ID : ' . $optin_id );
575
+
576
+ if ( $optin_id ) {
577
+
578
+ $next_step_id = wcf()->flow->get_next_step_id( $order );
579
+
580
+ if ( $next_step_id ) {
581
+
582
+ $order_recieve_url = get_permalink( $next_step_id );
583
+ $query_param = array(
584
+ 'wcf-key' => $order->get_order_key(),
585
+ 'wcf-order' => $order->get_id(),
586
+ );
587
+
588
+ if ( 'yes' === wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-pass-fields' ) ) {
589
+
590
+ $fields_string = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-pass-specific-fields' );
591
+
592
+ $fields = array_map( 'trim', explode( ',', $fields_string ) );
593
+
594
+ if ( is_array( $fields ) ) {
595
+
596
+ $order_id = $order->get_id();
597
+
598
+ foreach ( $fields as $in => $key ) {
599
+ switch ( $key ) {
600
+ case 'first_name':
601
+ $query_param[ $key ] = $order->get_billing_first_name();
602
+ break;
603
+ case 'last_name':
604
+ $query_param[ $key ] = $order->get_billing_last_name();
605
+ break;
606
+ case 'email':
607
+ $query_param[ $key ] = $order->get_billing_email();
608
+ break;
609
+ default:
610
+ $query_param[ $key ] = get_post_meta( $order_id, '_billing_' . $key, true );
611
+ break;
612
+ }
613
+ }
614
+ }
615
+ }
616
+
617
+ $order_recieve_url = add_query_arg(
618
+ $query_param,
619
+ $order_recieve_url
620
+ );
621
+ }
622
+ }
623
+
624
+ wcf()->logger->log( 'End-' . __CLASS__ . '::' . __FUNCTION__ );
625
+
626
+ return $order_recieve_url;
627
+ }
628
+ }
629
+
630
+ /**
631
+ * Prepare if class 'Cartflows_Frontend' exist.
632
+ * Kicking this off by calling 'get_instance()' method
633
+ */
634
+ Cartflows_Frontend::get_instance();
classes/class-cartflows-functions.php CHANGED
@@ -185,6 +185,26 @@ function _is_wcf_doing_checkout_ajax() {
185
  return false;
186
  }
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
 
189
  /**
190
  * Returns checkout ID.
@@ -417,6 +437,44 @@ function _get_wcf_base_offer_id() {
417
  return false;
418
  }
419
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
 
421
  /**
422
  * Define a constant if it is not already defined.
@@ -445,3 +503,21 @@ if ( ! function_exists( 'wp_body_open' ) ) {
445
  do_action( 'wp_body_open' );
446
  }
447
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  return false;
186
  }
187
 
188
+ /**
189
+ * Check if optin AJAX call is in progress.
190
+ *
191
+ * @since 1.0.0
192
+ * @return bool
193
+ */
194
+ function _is_wcf_doing_optin_ajax() {
195
+
196
+ if ( wp_doing_ajax() ) {
197
+
198
+ if ( isset( $_GET['wc-ajax'] ) && //phpcs:ignore
199
+ 'checkout' === $_GET['wc-ajax'] && //phpcs:ignore
200
+ isset( $_POST['_wcf_optin_id'] ) //phpcs:ignore
201
+ ) {
202
+ return true;
203
+ }
204
+ }
205
+
206
+ return false;
207
+ }
208
 
209
  /**
210
  * Returns checkout ID.
437
  return false;
438
  }
439
 
440
+ /**
441
+ * Check if page is of optin type.
442
+ *
443
+ * @since 1.0.0
444
+ * @return int/bool
445
+ */
446
+ function _is_wcf_optin_type() {
447
+
448
+ if ( wcf()->utils->is_step_post_type() ) {
449
+
450
+ global $post;
451
+
452
+ if ( 'optin' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
453
+
454
+ return true;
455
+ }
456
+ }
457
+
458
+ return false;
459
+ }
460
+
461
+ /**
462
+ * Get optin page ID.
463
+ *
464
+ * @since 1.0.0
465
+ * @return int/bool
466
+ */
467
+ function _get_wcf_optin_id() {
468
+
469
+ if ( _is_wcf_optin_type() ) {
470
+
471
+ global $post;
472
+
473
+ return $post->ID;
474
+ }
475
+
476
+ return false;
477
+ }
478
 
479
  /**
480
  * Define a constant if it is not already defined.
503
  do_action( 'wp_body_open' );
504
  }
505
  }
506
+
507
+ /**
508
+ * Check if type is optin by id.
509
+ *
510
+ * @param int $post_id post id.
511
+ *
512
+ * @return int/bool
513
+ * @since 1.0.0
514
+ */
515
+ function _wcf_check_is_optin_by_id( $post_id ) {
516
+
517
+ if ( 'optin' === get_post_meta( $post_id, 'wcf-step-type', true ) ) {
518
+
519
+ return true;
520
+ }
521
+
522
+ return false;
523
+ }
classes/class-cartflows-importer.php CHANGED
@@ -1,1687 +1,1694 @@
1
- <?php
2
- /**
3
- * CartFlows Admin
4
- *
5
- * @package CartFlows
6
- * @since 1.0.0
7
- */
8
-
9
- if ( ! class_exists( 'CartFlows_Importer' ) ) :
10
-
11
- /**
12
- * CartFlows Import
13
- *
14
- * @since 1.0.0
15
- */
16
- class CartFlows_Importer {
17
-
18
- /**
19
- * Instance
20
- *
21
- * @since 1.0.0
22
- * @access private
23
- * @var object Class object.
24
- */
25
- private static $instance;
26
-
27
- /**
28
- * Initiator
29
- *
30
- * @since 1.0.0
31
- * @return object initialized object of class.
32
- */
33
- public static function get_instance() {
34
- if ( ! isset( self::$instance ) ) {
35
- self::$instance = new self();
36
- }
37
-
38
- return self::$instance;
39
- }
40
-
41
- /**
42
- * Constructor
43
- *
44
- * @since 1.0.0
45
- */
46
- public function __construct() {
47
- add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
48
- add_action( 'wp_ajax_cartflows_load_steps', array( $this, 'load_templates' ) );
49
- add_action( 'wp_ajax_cartflows_step_import', array( $this, 'import_step' ) );
50
- add_action( 'wp_ajax_cartflows_create_flow', array( $this, 'create_flow' ) );
51
- add_action( 'wp_ajax_cartflows_default_flow', array( $this, 'create_default_flow' ) );
52
- add_action( 'wp_ajax_cartflows_step_create_blank', array( $this, 'step_create_blank' ) );
53
- add_action( 'wp_ajax_cartflows_import_flow_step', array( $this, 'import_flow' ) );
54
- add_action( 'admin_footer', array( $this, 'js_templates' ) );
55
- add_action( 'cartflows_import_complete', array( $this, 'clear_cache' ) );
56
-
57
- add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
58
-
59
- add_action( 'wp_ajax_cartflows_activate_plugin', array( $this, 'activate_plugin' ) );
60
-
61
- add_action( 'admin_menu', array( $this, 'add_to_menus' ) );
62
- add_action( 'admin_init', array( $this, 'export_json' ) );
63
- add_action( 'admin_init', array( $this, 'import_json' ) );
64
- add_filter( 'post_row_actions', array( $this, 'export_link' ), 10, 2 );
65
- add_action( 'admin_action_cartflows_export_flow', array( $this, 'export_flow' ) );
66
- }
67
-
68
- /**
69
- * Add the export link to action list for flows row actions
70
- *
71
- * @since 1.1.4
72
- *
73
- * @param array $actions Actions array.
74
- * @param object $post Post object.
75
- *
76
- * @return array
77
- */
78
- public function export_link( $actions, $post ) {
79
- if ( current_user_can( 'edit_posts' ) && isset( $post ) && CARTFLOWS_FLOW_POST_TYPE === $post->post_type ) {
80
- $actions['export'] = '<a href="' . wp_nonce_url( 'admin.php?action=cartflows_export_flow&post=' . $post->ID, basename( __FILE__ ), 'flow_export_nonce' ) . '" title="' . __( 'Export this flow', 'cartflows' ) . '" rel="permalink">' . __( 'Export', 'cartflows' ) . '</a>';
81
- }
82
- return $actions;
83
- }
84
-
85
- /**
86
- * Add menus
87
- *
88
- * @since 1.1.4
89
- */
90
- public function add_to_menus() {
91
- add_submenu_page( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE, __( 'Flow Export', 'cartflows' ), __( 'Flow Export', 'cartflows' ), 'export', 'flow_exporter', array( $this, 'exporter_markup' ) );
92
- add_submenu_page( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE, __( 'Flow Import', 'cartflows' ), __( 'Flow Import', 'cartflows' ), 'import', 'flow_importer', array( $this, 'importer_markup' ) );
93
- }
94
-
95
- /**
96
- * Export flow with steps and its meta
97
- *
98
- * @since 1.1.4
99
- */
100
- public function export_flow() {
101
-
102
- if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && 'cartflows_export_flow' == $_REQUEST['action'] ) ) ) {
103
- wp_die( esc_html__( 'No post to export has been supplied!', 'cartflows' ) );
104
- }
105
-
106
- if ( ! isset( $_GET['flow_export_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['flow_export_nonce'] ) ), basename( __FILE__ ) ) ) {
107
- return;
108
- }
109
-
110
- // Get the original post id.
111
- $flow_id = ( isset( $_GET['post'] ) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );
112
-
113
- $flows = array();
114
- $flows[] = $this->get_flow_export_data( $flow_id );
115
- $flows = apply_filters( 'cartflows_export_data', $flows );
116
-
117
- nocache_headers();
118
- header( 'Content-Type: application/json; charset=utf-8' );
119
- header( 'Content-Disposition: attachment; filename=cartflows-flow-' . $flow_id . '-' . gmdate( 'm-d-Y' ) . '.json' );
120
- header( 'Expires: 0' );
121
-
122
- echo wp_json_encode( $flows );
123
- exit;
124
- }
125
-
126
- /**
127
- * Export flow markup
128
- *
129
- * @since 1.1.4
130
- */
131
- public function exporter_markup() {
132
- include_once CARTFLOWS_DIR . 'includes/exporter.php';
133
- }
134
-
135
- /**
136
- * Import flow markup
137
- *
138
- * @since 1.1.4
139
- */
140
- public function importer_markup() {
141
- include_once CARTFLOWS_DIR . 'includes/importer.php';
142
- }
143
-
144
- /**
145
- * Export flow
146
- *
147
- * @since 1.1.4
148
- */
149
- public function export_json() {
150
- if ( empty( $_POST['cartflows-action'] ) || 'export' != $_POST['cartflows-action'] ) {
151
- return;
152
- }
153
-
154
- if ( isset( $_POST['cartflows-action-nonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-action-nonce'] ) ), 'cartflows-action-nonce' ) ) {
155
- return;
156
- }
157
-
158
- if ( ! current_user_can( 'manage_options' ) ) {
159
- return;
160
- }
161
-
162
- $flows = $this->get_all_flow_export_data();
163
- $flows = apply_filters( 'cartflows_export_data', $flows );
164
-
165
- nocache_headers();
166
- header( 'Content-Type: application/json; charset=utf-8' );
167
- header( 'Content-Disposition: attachment; filename=cartflows-flow-export-' . gmdate( 'm-d-Y' ) . '.json' );
168
- header( 'Expires: 0' );
169
-
170
- echo wp_json_encode( $flows );
171
- exit;
172
- }
173
-
174
- /**
175
- * Get flow export data
176
- *
177
- * @since 1.1.4
178
- *
179
- * @param integer $flow_id Flow ID.
180
- * @return array
181
- */
182
- public function get_flow_export_data( $flow_id ) {
183
-
184
- $export_all = apply_filters( 'cartflows_export_all', false );
185
-
186
- $valid_step_meta_keys = array(
187
- '_wp_page_template',
188
- '_thumbnail_id',
189
- 'classic-editor-remember',
190
- );
191
-
192
- $new_steps = array();
193
- $steps = get_post_meta( $flow_id, 'wcf-steps', true );
194
- if ( $steps ) {
195
- foreach ( $steps as $key => $step ) {
196
-
197
- // Add step post meta.
198
- $new_all_meta = array();
199
- $all_meta = get_post_meta( $step['id'] );
200
- if ( is_array( $all_meta ) ) {
201
-
202
- if ( $export_all ) {
203
- foreach ( $all_meta as $meta_key => $value ) {
204
- $new_all_meta[ $meta_key ] = maybe_unserialize( $value[0] );
205
- }
206
- } else {
207
-
208
- foreach ( $all_meta as $meta_key => $value ) {
209
- if ( substr( $meta_key, 0, strlen( 'wcf' ) ) === 'wcf' ) {
210
- $new_all_meta[ $meta_key ] = maybe_unserialize( $value[0] );
211
- } elseif ( in_array( $meta_key, $valid_step_meta_keys, true ) ) {
212
- $new_all_meta[ $meta_key ] = maybe_unserialize( $value[0] );
213
- }
214
- }
215
- }
216
- }
217
-
218
- // Add single step.
219
- $step_data_arr = array(
220
- 'title' => get_the_title( $step['id'] ),
221
- 'type' => $step['type'],
222
- 'meta' => $new_all_meta,
223
- 'post_content' => '',
224
- );
225
-
226
- if ( $export_all ) {
227
-
228
- $step_post_obj = get_post( $step['id'] );
229
-
230
- $step_data_arr['post_content'] = $step_post_obj->post_content;
231
- }
232
-
233
- $new_steps[] = $step_data_arr;
234
- }
235
- }
236
-
237
- // Add single flow.
238
- return array(
239
- 'title' => get_the_title( $flow_id ),
240
- 'steps' => $new_steps,
241
- );
242
- }
243
-
244
- /**
245
- * Get all flow export data
246
- *
247
- * @since 1.1.4
248
- */
249
- public function get_all_flow_export_data() {
250
-
251
- $query_args = array(
252
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
253
-
254
- // Query performance optimization.
255
- 'fields' => 'ids',
256
- 'no_found_rows' => true,
257
- 'posts_per_page' => -1,
258
- );
259
-
260
- $query = new WP_Query( $query_args );
261
- $flows = array();
262
- if ( $query->posts ) {
263
- foreach ( $query->posts as $key => $post_id ) {
264
- $flows[] = $this->get_flow_export_data( $post_id );
265
- }
266
- }
267
-
268
- return $flows;
269
- }
270
-
271
- /**
272
- * Import our exported file
273
- *
274
- * @since 1.1.4
275
- */
276
- public function import_json() {
277
- if ( empty( $_POST['cartflows-action'] ) || 'import' != $_POST['cartflows-action'] ) {
278
- return;
279
- }
280
-
281
- if ( isset( $_POST['cartflows-action-nonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-action-nonce'] ) ), 'cartflows-action-nonce' ) ) {
282
- return;
283
- }
284
-
285
- if ( ! current_user_can( 'manage_options' ) ) {
286
- return;
287
- }
288
-
289
- $filename = $_FILES['file']['name']; //phpcs:ignore
290
- $file_info = explode( '.', $filename );
291
- $extension = end( $file_info );
292
-
293
- if ( 'json' != $extension ) {
294
- wp_die( esc_html__( 'Please upload a valid .json file', 'cartflows' ) );
295
- }
296
-
297
- $file = $_FILES['file']['tmp_name']; //phpcs:ignore
298
-
299
- if ( empty( $file ) ) {
300
- wp_die( esc_html__( 'Please upload a file to import', 'cartflows' ) );
301
- }
302
-
303
- // Retrieve the settings from the file and convert the JSON object to an array.
304
- $flows = json_decode( file_get_contents( $file ), true );//phpcs:ignore
305
-
306
- $this->import_from_json_data( $flows );
307
-
308
- add_action( 'admin_notices', array( $this, 'imported_successfully' ) );
309
- }
310
-
311
- /**
312
- * Import flow from the JSON data
313
- *
314
- * @since x.x.x
315
- * @param array $flows JSON array.
316
- * @return void
317
- */
318
- public function import_from_json_data( $flows ) {
319
- if ( $flows ) {
320
-
321
- foreach ( $flows as $key => $flow ) {
322
-
323
- $flow_title = $flow['title'];
324
- if ( post_exists( $flow['title'] ) ) {
325
- $flow_title = $flow['title'] . ' Copy';
326
- }
327
-
328
- // Create post object.
329
- $new_flow_args = apply_filters(
330
- 'cartflows_flow_importer_args',
331
- array(
332
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
333
- 'post_title' => $flow_title,
334
- 'post_status' => 'draft',
335
- )
336
- );
337
-
338
- // Insert the post into the database.
339
- $flow_id = wp_insert_post( $new_flow_args );
340
-
341
- /**
342
- * Fire after flow import
343
- *
344
- * @since x.x.x
345
- * @param int $flow_id Flow ID.
346
- * @param array $new_flow_args Flow post args.
347
- * @param array $flows Flow JSON data.
348
- */
349
- do_action( 'cartflows_flow_imported', $flow_id, $new_flow_args, $flows );
350
-
351
- if ( $flow['steps'] ) {
352
- foreach ( $flow['steps'] as $key => $step ) {
353
-
354
- $new_step_args = apply_filters(
355
- 'cartflows_step_importer_args',
356
- array(
357
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
358
- 'post_title' => $step['title'],
359
- 'post_status' => 'publish',
360
- 'meta_input' => $step['meta'],
361
- 'post_content' => isset( $step['post_content'] ) ? $step['post_content'] : '',
362
- )
363
- );
364
-
365
- $new_step_id = wp_insert_post( $new_step_args );
366
-
367
- /**
368
- * Fire after step import
369
- *
370
- * @since x.x.x
371
- * @param int $new_step_id step ID.
372
- * @param int $flow_id flow ID.
373
- * @param array $new_step_args Step post args.
374
- * @param array $flow_steps Flow steps.
375
- * @param array $flows All flows JSON data.
376
- */
377
- do_action( 'cartflows_step_imported', $new_step_id, $flow_id, $new_step_args, $flow['steps'], $flows );
378
-
379
- // Insert post meta.
380
- update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
381
-
382
- $step_taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
383
- $current_term = term_exists( $step['type'], $step_taxonomy );
384
-
385
- // // Set type object.
386
- $data = get_term( $current_term['term_id'], $step_taxonomy );
387
- $step_slug = $data->slug;
388
- wp_set_object_terms( $new_step_id, $data->slug, $step_taxonomy );
389
-
390
- // Set type.
391
- update_post_meta( $new_step_id, 'wcf-step-type', $data->slug );
392
-
393
- // Set flow.
394
- wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
395
-
396
- self::get_instance()->set_step_to_flow( $flow_id, $new_step_id, $step['title'], $step_slug );
397
-
398
- if ( isset( $step['post_content'] ) && ! empty( $step['post_content'] ) ) {
399
-
400
- // Download and replace images.
401
- $content = $this->get_content( $step['post_content'] );
402
-
403
- // Update post content.
404
- wp_update_post(
405
- array(
406
- 'ID' => $new_step_id,
407
- 'post_content' => $content,
408
- )
409
- );
410
- }
411
- }
412
- }
413
- }
414
- }
415
- }
416
-
417
- /**
418
- * Download and Replace hotlink images
419
- *
420
- * @since x.x.x
421
- *
422
- * @param string $content Mixed post content.
423
- * @return array Hotlink image array.
424
- */
425
- public function get_content( $content = '' ) {
426
-
427
- $all_links = wp_extract_urls( $content );
428
- $image_links = array();
429
- $image_map = array();
430
-
431
- // Not have any link.
432
- if ( empty( $all_links ) ) {
433
- return $content;
434
- }
435
-
436
- foreach ( $all_links as $key => $link ) {
437
- if ( preg_match( '/\.(jpg|jpeg|png|gif)/i', $link ) ) {
438
- $image_links[] = $link;
439
- }
440
- }
441
-
442
- // Not have any image link.
443
- if ( empty( $image_links ) ) {
444
- return $content;
445
- }
446
-
447
- foreach ( $image_links as $key => $image_url ) {
448
-
449
- // Download remote image.
450
- $image = array(
451
- 'url' => $image_url,
452
- 'id' => wp_rand( 000, 999 ),
453
- );
454
- $downloaded_image = CartFlows_Import_Image::get_instance()->import( $image );
455
-
456
- // Old and New image mapping links.
457
- $image_map[ $image_url ] = $downloaded_image['url'];
458
- }
459
-
460
- // Replace old image links with new image links.
461
- foreach ( $image_map as $old_url => $new_url ) {
462
- $content = str_replace( $old_url, $new_url, $content );
463
- }
464
-
465
- return $content;
466
-
467
- }
468
-
469
- /**
470
- * Imported notice
471
- *
472
- * @since 1.1.4
473
- */
474
- public function imported_successfully() {
475
- ?>
476
- <div class="notice notice-success">
477
- <p><?php esc_html_e( 'Successfully imported flows.', 'cartflows' ); ?></p>
478
- </div>
479
- <?php
480
- }
481
-
482
- /**
483
- * Clear Cache.
484
- *
485
- * @since 1.0.0
486
- */
487
- public function clear_cache() {
488
- // Clear 'Elementor' file cache.
489
- if ( class_exists( '\Elementor\Plugin' ) ) {
490
- Elementor\Plugin::$instance->files_manager->clear_cache();
491
- }
492
- }
493
-
494
- /**
495
- * JS Templates
496
- *
497
- * @since 1.0.0
498
- *
499
- * @return void
500
- */
501
- public function js_templates() {
502
-
503
- // Loading Templates.
504
- ?>
505
- <script type="text/template" id="tmpl-cartflows-step-loading">
506
- <div class="template-message-block cartflows-step-loading">
507
- <h2>
508
- <span class="spinner"></span>
509
- <?php esc_html_e( 'Loading Steps', 'cartflows' ); ?>
510
- </h2>
511
- <p class="description"><?php esc_html_e( 'Getting steps from the cloud. Please wait for the moment.', 'cartflows' ); ?></p>
512
- </div>
513
- </script>
514
-
515
- <?php
516
- // Search Templates.
517
- ?>
518
- <script type="text/template" id="tmpl-cartflows-searching-templates">
519
- <div class="template-message-block cartflows-searching-templates">
520
- <h2>
521
- <span class="spinner"></span>
522
- <?php esc_html_e( 'Searching Template..', 'cartflows' ); ?>
523
- </h2>
524
- <p class="description"><?php esc_html_e( 'Getting templates from the cloud. Please wait for the moment.', 'cartflows' ); ?></p>
525
- </div>
526
- </script>
527
-
528
- <?php
529
- // CartFlows Importing Template.
530
- ?>
531
- <script type="text/template" id="tmpl-cartflows-step-importing">
532
- <div class="template-message-block cartflows-step-importing">
533
- <h2><span class="spinner"></span> <?php esc_html_e( 'Importing..', 'cartflows' ); ?></h2>
534
- </div>
535
- </script>
536
-
537
- <?php
538
- // CartFlows Imported.
539
- ?>
540
- <script type="text/template" id="tmpl-cartflows-step-imported">
541
- <div class="template-message-block cartflows-step-imported">
542
- <h2><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Imported', 'cartflows' ); ?></h2>
543
- <p class="description"><?php esc_html_e( 'Thanks for patience', 'cartflows' ); ?> <span class="dashicons dashicons-smiley"></span></p></div>
544
- </script>
545
-
546
- <?php
547
- // No templates.
548
- ?>
549
- <script type="text/template" id="tmpl-cartflows-no-steps">
550
- <div class="cartflows-no-steps">
551
- <div class="template-message-block">
552
- <h2><?php esc_html_e( 'Coming Soon!', 'cartflows' ); ?></h2>
553
- <p class="description"></p>
554
- </div>
555
- </div>
556
- </script>
557
-
558
- <?php
559
- // No templates.
560
- ?>
561
- <script type="text/template" id="tmpl-cartflows-no-flows">
562
- <div class="cartflows-no-flows">
563
- <div class="template-message-block">
564
- <h2><?php esc_html_e( 'Coming Soon!', 'cartflows' ); ?></h2>
565
- <p class="description"></p>
566
- </div>
567
- </div>
568
- </script>
569
-
570
- <?php
571
- // Error handling.
572
- ?>
573
- <script type="text/template" id="tmpl-templator-error">
574
- <div class="notice notice-error"><p>{{ data }}</p></div>
575
- </script>
576
-
577
- <?php
578
- // Redirect to Elementor.
579
- ?>
580
- <script type="text/template" id="tmpl-templator-redirect-to-elementor">
581
- <div class="template-message-block templator-redirect-to-elementor">
582
- <h2><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Imported', 'cartflows' ); ?></h2>
583
- <p class="description"><?php esc_html_e( 'Thanks for patience', 'cartflows' ); ?> <span class="dashicons dashicons-smiley"></span><br/><br/><?php esc_html_e( 'Redirecting to the Elementor edit window.', 'cartflows' ); ?> </p></div>
584
- </script>
585
-
586
- <?php
587
- /**
588
- * Responsive Buttons
589
- */
590
- ?>
591
- <script type="text/template" id="tmpl-cartflows-responsive-view">
592
- <span class="responsive-view">
593
- <span class="actions">
594
- <a class="desktop" href="#"><span data-view="desktop " class="active dashicons dashicons-desktop"></span></a>
595
- <a class="tablet" href="#"><span data-view="tablet" class="dashicons dashicons-tablet"></span></a>
596
- <a class="mobile" href="#"><span data-view="mobile" class="dashicons dashicons-smartphone"></span></a>
597
- </span>
598
- </span>
599
- </script>
600
-
601
- <?php
602
- // Templates data.
603
- ?>
604
- <script type="text/template" id="tmpl-cartflows-flows-list">
605
-
606
- <# console.log( data.items.length ) #>
607
- <# console.log( data.items ) #>
608
- <# if ( data.items.length ) { #>
609
- <# for ( key in data.items ) { #>
610
- <#
611
- var flow_steps = [];
612
- if( data.items[ key ].flow_steps ) {
613
- flow_steps = data.items[ key ].flow_steps.map(function(value,index) {
614
- return value['id'];
615
- });
616
- }
617
- #>
618
- <div class="inner">
619
- <div class="template">
620
- <span class="thumbnail site-preview cartflows-preview-flow-steps" data-flow-steps="{{ JSON.stringify( data.items[ key ].flow_steps ) }}" data-title="{{ data.items[ key ].title.rendered }}">
621
- <div class="template-screenshot">
622
- <# if( data.items[ key ].featured_image_url ) { #>
623
- <img src="{{ data.items[ key ].featured_image_url }}" />
624
- <# } else { #>
625
- <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/400x400.jpg" />
626
- <# } #>
627
- </div>
628
- <# if( data.items[ key ].flow_type && 'pro' === data.items[ key ].flow_type.slug ) { #>
629
- <span class="wcf-flow-type pro"><?php esc_html_e( 'Pro', 'cartflows' ); ?></span>
630
- <# } #>
631
- <# if( data.items[ key ].woo_required ) { #>
632
- <div class="notice notice-info" style="width: auto;">
633
- <p class="wcf-learn-how">
634
- Install/Activate WooCommerce to use this template.
635
- <a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank">
636
- <strong><?php esc_html_e( 'Learn How', 'cartflows' ); ?></strong>
637
- <i class="dashicons dashicons-external"></i>
638
- </a>
639
- </p>
640
- </div>
641
- <# } else { #>
642
- <a href="<?php echo CARTFLOWS_TEMPLATES_URL . 'preview/?'; ?>flow={{ data.items[ key ].id }}&title={{{ data.items[ key ].title.rendered }}}" class="preview" target="_blank">Preview <i class="dashicons dashicons-external"></i></a>
643
- <# } #>
644
-
645
- </span>
646
- <div class="template-id-container">
647
- <h3 class="template-name"> {{{ data.items[ key ].title.rendered }}} </h3>
648
- <div class="template-actions">
649
-
650
- <#
651
- if( data.items[ key ].page_builder.slug ) {
652
- required_plugin_group = data.items[ key ].page_builder.slug;
653
- } else {
654
- required_plugin_group = '';
655
- }
656
-
657
- if( data.items[ key ].page_builder.slug && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug] && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug].button_title ) {
658
- import_btn_title = CartFlowsImportVars.required_plugins[ data.items[ key ].page_builder.slug ].button_title;
659
- } else {
660
- import_btn_title = 'Import';
661
- } #>
662
-
663
- <# if( data.items[ key ].licence_status && 'valid' === data.items[ key ].licence_status ) { #>
664
- <# if( ! data.items[ key ].woo_required ) { #>
665
- <a data-flow-steps="{{ flow_steps }}" data-required-plugin-group="{{required_plugin_group}}" href="#" class="button button-primary cartflows-step-import" data-template-id="{{ data.items[ key ].id }}">{{ import_btn_title }}</a>
666
- <# } else { #>
667
- <a href='#' class='wcf-activate-wc button-primary'>Install & activate Woo</a>
668
- <# } #>
669
- <# } else if( CartFlowsImportVars._is_pro_active ) { #>
670
- <a target="_blank" href="<?php echo esc_url( admin_url( 'plugins.php?cartflows-license-popup' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate License', 'cartflows' ); ?></a>
671
- <# } else { #>
672
- <a target="_blank" href="<?php echo esc_url( CARTFLOWS_DOMAIN_URL ); ?>" class="button button-primary"><?php esc_html_e( 'Get Pro', 'cartflows' ); ?></a>
673
- <# } #>
674
- </div>
675
- </div>
676
- </div>
677
- </div>
678
- <# } #>
679
- <# } #>
680
- </script>
681
-
682
- <?php
683
- // Empty Step.
684
- ?>
685
- <script type="text/template" id="tmpl-cartflows-create-blank-step">
686
- <div class="inner">
687
- <div class="template">
688
- <span class="thumbnail site-preview cartflows-flow-preview">
689
- <div class="template-screenshot">
690
- <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/start-scratch.jpg" />
691
- </div>
692
- <div id="wcf_create_notice" class=""><a href="https://cartflows.com/" target="_blank"></a></div>
693
- </span>
694
- <div class="template-id-container">
695
- <h3 class="template-name"> Blank </h3>
696
- <div class="template-actions">
697
- <a href="#" class="button button-primary cartflows-step-import-blank"><?php esc_html_e( 'Create', 'cartflows' ); ?></a>
698
- </div>
699
- </div>
700
- </div>
701
- </div>
702
- </script>
703
-
704
- <?php
705
- // Templates data.
706
- ?>
707
- <script type="text/template" id="tmpl-cartflows-steps-list">
708
- <# if ( data.items.length ) { #>
709
- <# for ( key in data.items ) { #>
710
- <#
711
- var flow_steps = [];
712
- if( data.items[ key ].flow_steps ) {
713
- flow_steps = data.items[ key ].flow_steps.map(function(value,index) {
714
- return value['id'];
715
- });
716
- }
717
- #>
718
- <div class="inner">
719
- <div class="template">
720
- <span class="thumbnail site-preview cartflows-preview-flow-steps" data-flow-steps="{{ JSON.stringify( data.items[ key ].flow_steps ) }}" data-title="{{ data.items[ key ].title.rendered }}">
721
- <div class="template-screenshot">
722
- <# if( data.items[ key ].featured_image_url ) { #>
723
- <img src="{{ data.items[ key ].featured_image_url }}" />
724
- <# } else { #>
725
- <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/400x400.jpg" />
726
- <# } #>
727
- </div>
728
- <div id="wcf_create_notice" class=""><a href="https://cartflows.com/" target="_blank"></a></div>
729
-
730
- <# if( data.items[ key ].woo_required ) { #>
731
- <div class="notice notice-info" style="width: auto;">
732
- <p class="wcf-learn-how">
733
- Install/Activate WooCommerce to use this template.
734
- <a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank">
735
- <strong><?php esc_html_e( 'Learn How', 'cartflows' ); ?></strong>
736
- <i class="dashicons dashicons-external"></i>
737
- </a>
738
- </p>
739
- </div>
740
- <# } else { #>
741
- <a href="<?php echo CARTFLOWS_TEMPLATES_URL . 'preview/?'; ?>step={{ data.items[ key ].id }}&title={{{ data.items[ key ].title.rendered }}}" class="preview" target="_blank">Preview <i class="dashicons dashicons-external"></i></a>
742
- <# } #>
743
-
744
- <# if( data.items[ key ].flow_type && 'pro' === data.items[ key ].flow_type.slug ) { #>
745
- <span class="wcf-flow-type pro"><?php esc_html_e( 'Pro', 'cartflows' ); ?></span>
746
- <# } #>
747
- </span>
748
- <div class="template-id-container">
749
- <h3 class="template-name"> {{{ data.items[ key ].title.rendered }}} </h3>
750
- <div class="template-actions">
751
-
752
- <#
753
-
754
- var step_slug = data.items[ key ].step_type.slug || '';
755
- var step_title = data.items[ key ].step_type.name || '';
756
- var import_btn_title = 'Import';
757
-
758
- var required_plugin_group = '';
759
- if( data.items[ key ].page_builder ) {
760
- required_plugin_group = data.items[ key ].page_builder.slug;
761
-
762
- if( data.items[ key ].page_builder.slug && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug] && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug].button_title ) {
763
- import_btn_title = CartFlowsImportVars.required_plugins[ data.items[ key ].page_builder.slug ].button_title;
764
- }
765
- }
766
- #>
767
-
768
- <# if( data.items[ key ].licence_status && 'valid' === data.items[ key ].licence_status ) { #>
769
-
770
- <# if( ! data.items[ key ].woo_required ) { #>
771
- <a data-slug="{{step_slug}}" data-title="{{step_title}}" data-flow-steps="{{ flow_steps }}" data-required-plugin-group="{{required_plugin_group}}" href="#" class="button button-primary cartflows-step-import" data-template-id="{{ data.items[ key ].id }}">{{ import_btn_title }}</a>
772
- <# } else { #>
773
- <a href='#' class='wcf-activate-wc button-primary'>Install & activate Woo</a>
774
- <# } #>
775
-
776
- <# } else if( CartFlowsImportVars._is_pro_active ) { #>
777
- <a target="_blank" href="<?php echo esc_url( admin_url( 'plugins.php?cartflows-license-popup' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate License', 'cartflows' ); ?></a>
778
- <# } else { #>
779
- <a target="_blank" href="<?php echo esc_url( CARTFLOWS_DOMAIN_URL ); ?>" class="button button-primary"><?php esc_html_e( 'Get Pro', 'cartflows' ); ?></a>
780
- <# } #>
781
- </div>
782
- </div>
783
- </div>
784
- </div>
785
- <# } #>
786
- <# } #>
787
- </script>
788
-
789
- <?php
790
- /**
791
- * TMPL - Website Unreachable
792
- */
793
- ?>
794
- <script type="text/template" id="tmpl-cartflows-website-unreachable">
795
- <div class="postbox cartflows-website-unreachable">
796
- <h2><?php esc_html_e( 'Under Maintenance..', 'cartflows' ); ?></h2>
797
- <p><?php esc_html_e( 'If you are seeing this message, most likely our servers are under routine maintenance and we will be back shortly.', 'cartflows' ); ?></p>
798
- <p><?php esc_html_e( 'In rare case, it is possible your website is having trouble connecting with ours. If you need help, please feel free to get in touch with us from our website..', 'cartflows' ); ?></p>
799
- </div>
800
- </script>
801
-
802
- <?php
803
- /**
804
- * TMPL - Filters
805
- */
806
- ?>
807
- <script type="text/template" id="tmpl-cartflows-page-builder-notice">
808
- <?php
809
- $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
810
- $page_builder = Cartflows_Helper::get_required_plugins_for_page_builder( Cartflows_Helper::get_common_setting( 'default_page_builder' ) );
811
- $title = $page_builder['title'];
812
-
813
- $plugin_string = '<a href="#" data-slug="' . esc_html( $default_page_builder ) . '" class="wcf-install-plugin">Please click here and activate ' . esc_html( $title ) . '</a>';
814
- $theme_status = '';
815
- if ( 'divi' === $default_page_builder ) {
816
-
817
- $theme_status = $page_builder['theme-status'];
818
- $plugin_status = $page_builder['plugin-status'];
819
-
820
- if ( 'deactivate' === $theme_status || 'install' === $plugin_status ) {
821
- $plugin_string = 'Please activate ' . esc_html( $title );
822
- } elseif ( ( 'deactivate' === $theme_status || 'not-installed' === $theme_status ) && 'install' === $plugin_status ) {
823
- $plugin_string = 'Please install and activate ' . esc_html( $title );
824
- }
825
- }
826
- ?>
827
- <div class="wcf-page-builder-message">
828
- <p><?php /* translators: %s: Plugin string */ printf( __( '%1$s to see CartFlows templates. If you prefer another page builder tool, you can <a href="%2$s" target="blank">select it here</a>.', 'cartflows' ), $plugin_string, admin_url( 'admin.php?page=' . CARTFLOWS_SETTINGS . '&action=common-settings#form-field-wcf_default_page_builder' ) ); ?></p>
829
- <p>If your preferred page builder is not available, feel free to <a href="#" data-slug="canvas" class="wcf-create-from-scratch-link">create your own</a> pages using page builder of your choice as CartFlows works with all major page builders.</p>
830
- <p>We plan to add design templates made with more page builder shortly!</p>
831
- </div>
832
- </script>
833
-
834
- <?php
835
- /**
836
- * TMPL - Filters
837
- */
838
- ?>
839
- <script type="text/template" id="tmpl-cartflows-term-filters-dropdown">
840
- <# if ( data ) { #>
841
- <select class="{{ data.args.wrapper_class }} {{ data.args.class }}">
842
- <# if ( data.args.show_all ) { #>
843
- <option value="all"> <?php esc_html_e( 'All', 'cartflows' ); ?> </option>
844
- <# } #>
845
- <# if ( CartFlowsImportVars.step_type === data.args.remote_slug ) { #>
846
- <option value=""> <?php esc_html_e( 'Select Step Type', 'cartflows' ); ?> </option>
847
- <# } #>
848
- <# for ( key in data.items ) { #>
849
- <option value='{{ data.items[ key ].id }}' data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</option>
850
- <# } #>
851
- </select>
852
- <# } #>
853
- </script>
854
-
855
- <script type="text/template" id="tmpl-cartflows-term-filters">
856
-
857
- <# if ( data ) { #>
858
-
859
- <?php /* <# if ( CartFlowsImportVars.flow_page_builder === data.args.remote_slug || CartFlowsImportVars.step_page_builder === data.args.remote_slug ) { #> */ ?>
860
- <ul class="{{ data.args.wrapper_class }} {{ data.args.class }}">
861
-
862
- <# if ( data.args.show_all ) { #>
863
- <li>
864
- <a href="#" data-group="all"> All </a>
865
- </li>
866
- <# } #>
867
-
868
- <# for ( key in data.items ) { #>
869
- <li>
870
- <a href="#" data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</a>
871
- </li>
872
- <# } #>
873
-
874
- </ul>
875
-
876
- <?php
877
-
878
- /**
879
- <# } else { #>
880
- <select class="{{ data.args.wrapper_class }} {{ data.args.class }}">
881
-
882
- <# if ( data.args.show_all ) { #>
883
- <option value="all"> <?php _e( 'All', 'cartflows' ); ?> </option>
884
- <# } #>
885
-
886
- <# if ( CartFlowsImportVars.step_type === data.args.remote_slug ) { #>
887
- <option value=""> <?php _e( 'Select Step Type', 'cartflows' ); ?> </option>
888
- <# } #>
889
-
890
- <# for ( key in data.items ) { #>
891
- <option value='{{ data.items[ key ].id }}' data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</option>
892
- <# } #>
893
-
894
- </select>
895
- */
896
- ?>
897
-
898
- <?php /* <# } #> */ ?>
899
-
900
- <# } #>
901
- </script>
902
-
903
- <?php
904
- // Step Type.
905
- ?>
906
- <script type="text/template" id="tmpl-cartflows-step-types">
907
- <ul class="wcf-tab nav-tabs">
908
- <# if( data.items_count ) { #>
909
- <# for( key in data.items ) { #>
910
- <# console.log( data.items[ key ].id ) #>
911
- <li data-slug="{{data.items[ key ].slug}}" data-title="{{ data.items[ key ].name }}">
912
- <a href="#{{{ data.items[ key ].slug }}}">{{{ data.items[ key ].name }}}</a>
913
- </li>
914
- <# } #>
915
- <# } #>
916
- </ul>
917
- </script>
918
-
919
- <?php
920
- // Add to library button.
921
- ?>
922
- <script type="text/template" id="tmpl-templator-add-to-library">
923
- <a class="templator-add-to-library page-title-action cartflows-load-steps-library"><i class="dashicons dashicons-cloud"></i><?php esc_attr_e( 'Import from Cloud', 'cartflows' ); ?></a>
924
- </script>
925
- <?php
926
- }
927
-
928
- /**
929
- * Enqueue scripts
930
- *
931
- * @since 1.0.0
932
- *
933
- * @hook admin_enqueue_scripts
934
- * @param string $hook Current page hook.
935
- */
936
- public function scripts( $hook = '' ) {
937
-
938
- if ( ! self::is_supported_post( get_current_screen()->post_type ) ) {
939
- return;
940
- }
941
-
942
- wp_enqueue_script( 'cartflows-rest-api', CARTFLOWS_URL . 'assets/js/rest-api.js', array( 'jquery' ), CARTFLOWS_VER, true );
943
- wp_enqueue_style( 'cartflows-import', CARTFLOWS_URL . 'assets/css/import.css', null, CARTFLOWS_VER, 'all' );
944
- wp_style_add_data( 'cartflows-import', 'rtl', 'replace' );
945
- wp_enqueue_script( 'cartflows-import', CARTFLOWS_URL . 'assets/js/import.js', array( 'jquery', 'wp-util', 'cartflows-rest-api', 'updates' ), CARTFLOWS_VER, true );
946
-
947
- $installed_plugins = get_plugins();
948
- $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? 'yes' : 'no';
949
- $is_wc_activated = wcf()->is_woo_active ? 'yes' : 'no';
950
-
951
- $localize_vars = array(
952
- '_is_pro_active' => _is_cartflows_pro(),
953
- 'is_wc_installed' => $is_wc_installed,
954
- 'is_wc_activated' => $is_wc_activated,
955
-
956
- // Flow and its rest fields.
957
- 'flow' => CARTFLOWS_FLOW_POST_TYPE,
958
- 'flow_fields' => array(
959
- 'id',
960
- 'title',
961
- 'flow_type',
962
- 'page_builder',
963
- 'flow_steps',
964
- 'licence_status',
965
- 'featured_image_url',
966
- 'featured_media', // @required for field `featured_image_url`.
967
- ),
968
-
969
- // Flow type and rest fields.
970
- 'flow_type' => CARTFLOWS_TAXONOMY_FLOW_CATEGORY,
971
- 'flow_type_fields' => array(
972
- 'id',
973
- 'name',
974
- 'slug',
975
- ),
976
-
977
- // Flow page builder and rest fields.
978
- 'flow_page_builder' => CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER,
979
- 'flow_page_builder_fields' => array(
980
- 'id',
981
- 'name',
982
- 'slug',
983
- ),
984
-
985
- // Step page builder and rest fields.
986
- 'step_page_builder' => CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER,
987
- 'step_page_builder_fields' => array(
988
- 'id',
989
- 'name',
990
- 'slug',
991
- ),
992
-
993
- // Step and its rest fields.
994
- 'step' => CARTFLOWS_STEP_POST_TYPE,
995
- 'step_fields' => array(
996
- 'title',
997
- 'featured_image_url',
998
- 'featured_media', // @required for field `featured_image_url`.
999
- 'id',
1000
- 'flow_type',
1001
- 'step_type',
1002
- 'page_builder',
1003
- 'licence_status',
1004
- ),
1005
-
1006
- // Step type and its rest fields.
1007
- 'step_type' => CARTFLOWS_TAXONOMY_STEP_TYPE,
1008
- 'step_type_fields' => array(
1009
- 'id',
1010
- 'name',
1011
- 'slug',
1012
- ),
1013
-
1014
- 'domain_url' => CARTFLOWS_DOMAIN_URL,
1015
- 'server_url' => CARTFLOWS_TEMPLATES_URL,
1016
- 'server_rest_url' => CARTFLOWS_TEMPLATES_URL . 'wp-json/wp/v2/',
1017
- 'site_url' => site_url(),
1018
- 'import_url' => admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&page=flow_importer' ),
1019
- 'export_url' => admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&page=flow_exporter' ),
1020
- 'admin_url' => admin_url(),
1021
- 'licence_args' => CartFlows_API::get_instance()->get_licence_args(),
1022
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
1023
- 'debug' => ( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || isset( $_GET['debug'] ) ) ? true : false, //phpcs:ignore
1024
-
1025
- 'required_plugins' => Cartflows_Helper::get_plugins_groupby_page_builders(),
1026
-
1027
- 'default_page_builder' => Cartflows_Helper::get_common_setting( 'default_page_builder' ),
1028
- );
1029
-
1030
- $localize_vars['cartflows_activate_plugin_nonce'] = wp_create_nonce( 'cartflows_activate_plugin' );
1031
-
1032
- // var_dump(Cartflows_Helper::get_common_setting( 'default_page_builder' ));
1033
- // wp_die( );
1034
- // Add thickbox.
1035
- add_thickbox();
1036
-
1037
- wp_localize_script( 'cartflows-import', 'CartFlowsImportVars', $localize_vars );
1038
- wp_localize_script( 'cartflows-rest-api', 'CartFlowsImportVars', $localize_vars );
1039
- }
1040
-
1041
- /**
1042
- * Load Template
1043
- *
1044
- * @since 1.0.0
1045
- *
1046
- * @hook cartflows_load_steps
1047
- * @return void
1048
- */
1049
- public function load_templates() {
1050
-
1051
- check_ajax_referer( 'cf-load-steps', 'security' );
1052
-
1053
- $args = ( isset( $_POST['args'] ) ) ? array_map( 'sanitize_text_field', $_POST['args'] ) : array(); //phpcs:ignore
1054
- $templates = CartFlows_API::get_instance()->get_templates( $args );
1055
-
1056
- if ( $templates['templates_count'] ) {
1057
- wp_send_json_success( $templates );
1058
- } else {
1059
- wp_send_json_error( $templates );
1060
- }
1061
- wp_die();
1062
- }
1063
-
1064
- /**
1065
- * Import.
1066
- *
1067
- * @since 1.0.0
1068
- *
1069
- * @hook wp_ajax_cartflows_import_flow_step
1070
- * @return void
1071
- */
1072
- public function import_flow() {
1073
-
1074
- check_ajax_referer( 'cf-import-flow-step', 'security' );
1075
-
1076
- $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1077
- $template_id = isset( $_POST['template_id'] ) ? intval( $_POST['template_id'] ) : '';
1078
-
1079
- wcf()->logger->import_log( '------------------------------------' );
1080
- wcf()->logger->import_log( 'STARTED! Importing FLOW' );
1081
- wcf()->logger->import_log( '------------------------------------' );
1082
- wcf()->logger->import_log( '(✓) Creating new step from remote step [' . $template_id . '] for FLOW ' . get_the_title( $flow_id ) . ' [' . $flow_id . ']' );
1083
-
1084
- $response = CartFlows_API::get_instance()->get_template( $template_id );
1085
-
1086
- $post_content = isset( $response['data']['content']->rendered ) ? $response['data']['content']->rendered : '';
1087
- if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1088
- if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1089
- $post_content = $response['data']['divi_content'];
1090
- }
1091
- }
1092
-
1093
- if ( false === $response['success'] ) {
1094
- wcf()->logger->import_log( '(✕) Failed to fetch remote data.' );
1095
- wp_send_json_error( $response );
1096
- }
1097
-
1098
- wcf()->logger->import_log( '(✓) Successfully getting remote step response ' . wp_json_encode( $response ) );
1099
-
1100
- $new_step_id = wp_insert_post(
1101
- array(
1102
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1103
- 'post_title' => $response['title'],
1104
- 'post_content' => $post_content,
1105
- 'post_status' => 'publish',
1106
- )
1107
- );
1108
-
1109
- if ( is_wp_error( $new_step_id ) ) {
1110
- wcf()->logger->import_log( '(✕) Failed to create new step for flow ' . $flow_id );
1111
- wp_send_json_error( $new_step_id );
1112
- }
1113
-
1114
- if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1115
- if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1116
- update_post_meta( $new_step_id, 'divi_content', $response['data']['divi_content'] );
1117
- }
1118
- }
1119
-
1120
- /* Imported Step */
1121
- update_post_meta( $new_step_id, 'cartflows_imported_step', 'yes' );
1122
-
1123
- wcf()->logger->import_log( '(✓) Created new step ' . '"' . $response['title'] . '" id ' . $new_step_id );//phpcs:ignore
1124
- // insert post meta.
1125
- update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
1126
- wcf()->logger->import_log( '(✓) Added flow ID ' . $flow_id . ' in post meta key wcf-flow-id.' );
1127
-
1128
- /**
1129
- * Import & Set type.
1130
- */
1131
- $term = isset( $response['data']['step_type'] ) ? $response['data']['step_type'] : '';
1132
-
1133
- $term_slug = '';
1134
- if ( $term ) {
1135
-
1136
- $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
1137
- $term_exist = term_exists( $term->slug, $taxonomy );
1138
-
1139
- if ( empty( $term_exist ) ) {
1140
- $terms = array(
1141
- array(
1142
- 'name' => $term->name,
1143
- 'slug' => $term->slug,
1144
- ),
1145
- );
1146
-
1147
- Cartflows_Step_Post_Type::get_instance()->add_terms( $taxonomy, $terms );
1148
- wcf()->logger->import_log( '(✓) Created new term name ' . $term->name . ' | term slug ' . $term->slug );
1149
- }
1150
-
1151
- $current_term = term_exists( $term->slug, $taxonomy );
1152
-
1153
- // Set type object.
1154
- $data = get_term( $current_term['term_id'], $taxonomy );
1155
- $term_slug = $data->slug;
1156
- $term_name = $data->name;
1157
- wp_set_object_terms( $new_step_id, $term_slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
1158
- wcf()->logger->import_log( '(✓) Assigned existing term ' . $term_name . ' to the template ' . $new_step_id );
1159
-
1160
- // Set type.
1161
- update_post_meta( $new_step_id, 'wcf-step-type', $term_slug );
1162
- wcf()->logger->import_log( '(✓) Updated term ' . $term_name . ' to the post meta wcf-step-type.' );
1163
- }
1164
-
1165
- // Set flow.
1166
- wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1167
- wcf()->logger->import_log( '(✓) Assigned flow step flow-' . $flow_id );
1168
-
1169
- /**
1170
- * Update steps for the current flow.
1171
- */
1172
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
1173
-
1174
- if ( ! is_array( $flow_steps ) ) {
1175
- $flow_steps = array();
1176
- }
1177
-
1178
- $flow_steps[] = array(
1179
- 'id' => $new_step_id,
1180
- 'title' => $response['title'],
1181
- 'type' => $term_slug,
1182
- );
1183
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1184
- wcf()->logger->import_log( '(✓) Updated flow steps post meta key \'wcf-steps\' ' . wp_json_encode( $flow_steps ) );
1185
-
1186
- // Import Post Meta.
1187
- self::import_post_meta( $new_step_id, $response );
1188
-
1189
- wcf()->logger->import_log( '(✓) Importing step "' . get_the_title( $new_step_id ) . '" [' . $new_step_id . '] for FLOW "' . get_the_title( $flow_id ) . '" [' . $flow_id . ']' );
1190
- wcf()->logger->import_log( '------------------------------------' );
1191
- wcf()->logger->import_log( 'COMPLETE! Importing FLOW' );
1192
- wcf()->logger->import_log( '------------------------------------' );
1193
-
1194
- do_action( 'cartflows_import_complete' );
1195
- wcf()->logger->import_log( '(✓) BATCH STARTED for step ' . $new_step_id . ' for Blog name \'' . get_bloginfo( 'name' ) . '\' (' . get_current_blog_id() . ')' );
1196
-
1197
- // Batch Process.
1198
- do_action( 'cartflows_after_template_import', $new_step_id, $response );
1199
-
1200
- /**
1201
- * End
1202
- */
1203
- wp_send_json_success( $new_step_id );
1204
- }
1205
-
1206
- /**
1207
- * Import Step.
1208
- *
1209
- * @since 1.0.0
1210
- * @hook wp_ajax_cartflows_step_import
1211
- *
1212
- * @return void
1213
- */
1214
- public function create_default_flow() {
1215
-
1216
- check_ajax_referer( 'cf-default-flow', 'security' );
1217
-
1218
- // Create post object.
1219
- $new_flow_post = array(
1220
- 'post_content' => '',
1221
- 'post_status' => 'publish',
1222
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
1223
- );
1224
-
1225
- // Insert the post into the database.
1226
- $flow_id = wp_insert_post( $new_flow_post );
1227
-
1228
- if ( is_wp_error( $flow_id ) ) {
1229
- wp_send_json_error( $flow_id->get_error_message() );
1230
- }
1231
-
1232
- $flow_steps = array();
1233
-
1234
- if ( wcf()->is_woo_active ) {
1235
- $steps_data = array(
1236
- 'sales' => array(
1237
- 'title' => __( 'Sales Landing', 'cartflows' ),
1238
- 'type' => 'landing',
1239
- ),
1240
- 'order-form' => array(
1241
- 'title' => __( 'Checkout (Woo)', 'cartflows' ),
1242
- 'type' => 'checkout',
1243
- ),
1244
- 'order-confirmation' => array(
1245
- 'title' => __( 'Thank You (Woo)', 'cartflows' ),
1246
- 'type' => 'thankyou',
1247
- ),
1248
- );
1249
-
1250
- } else {
1251
- $steps_data = array(
1252
- 'landing' => array(
1253
- 'title' => __( 'Landing', 'cartflows' ),
1254
- 'type' => 'landing',
1255
- ),
1256
- 'thankyou' => array(
1257
- 'title' => __( 'Thank You', 'cartflows' ),
1258
- 'type' => 'landing',
1259
- ),
1260
- );
1261
- }
1262
-
1263
- foreach ( $steps_data as $slug => $data ) {
1264
-
1265
- $post_content = '';
1266
- $step_type = trim( $data['type'] );
1267
-
1268
- $step_id = wp_insert_post(
1269
- array(
1270
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1271
- 'post_title' => $data['title'],
1272
- 'post_content' => $post_content,
1273
- 'post_status' => 'publish',
1274
- )
1275
- );
1276
-
1277
- if ( is_wp_error( $step_id ) ) {
1278
- wp_send_json_error( $step_id->get_error_message() );
1279
- }
1280
-
1281
- if ( $step_id ) {
1282
-
1283
- $flow_steps[] = array(
1284
- 'id' => $step_id,
1285
- 'title' => $data['title'],
1286
- 'type' => $step_type,
1287
- );
1288
-
1289
- // insert post meta.
1290
- update_post_meta( $step_id, 'wcf-flow-id', $flow_id );
1291
- update_post_meta( $step_id, 'wcf-step-type', $step_type );
1292
-
1293
- wp_set_object_terms( $step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
1294
- wp_set_object_terms( $step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1295
-
1296
- update_post_meta( $step_id, '_wp_page_template', 'cartflows-default' );
1297
- }
1298
- }
1299
-
1300
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1301
-
1302
- wp_send_json_success( $flow_id );
1303
- }
1304
-
1305
- /**
1306
- * Create Flow
1307
- *
1308
- * @return void
1309
- */
1310
- public function create_flow() {
1311
-
1312
- check_ajax_referer( 'cf-create-flow', 'security' );
1313
-
1314
- // Create post object.
1315
- $new_flow_post = array(
1316
- 'post_content' => '',
1317
- 'post_status' => 'publish',
1318
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
1319
- );
1320
-
1321
- // Insert the post into the database.
1322
- $flow_id = wp_insert_post( $new_flow_post );
1323
-
1324
- if ( is_wp_error( $flow_id ) ) {
1325
- wp_send_json_error( $flow_id->get_error_message() );
1326
- }
1327
-
1328
- /* Imported Flow */
1329
- update_post_meta( $flow_id, 'cartflows_imported_flow', 'yes' );
1330
-
1331
- wp_send_json_success( $flow_id );
1332
- }
1333
-
1334
- /**
1335
- * Create Step
1336
- *
1337
- * @return void
1338
- */
1339
- public function import_step() {
1340
-
1341
- check_ajax_referer( 'cf-step-import', 'security' );
1342
-
1343
- $template_id = isset( $_POST['template_id'] ) ? intval( $_POST['template_id'] ) : '';
1344
- $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1345
- $step_title = isset( $_POST['step_title'] ) ? sanitize_text_field( wp_unslash( $_POST['step_title'] ) ) : '';
1346
- $step_type = isset( $_POST['step_type'] ) ? sanitize_title( wp_unslash( $_POST['step_type'] ) ) : '';
1347
- $step_custom_title = isset( $_POST['step_custom_title'] ) ? sanitize_title( wp_unslash( $_POST['step_custom_title'] ) ) : $step_title;
1348
-
1349
- $cartflow_meta = Cartflows_Flow_Meta::get_instance();
1350
-
1351
- $post_id = $cartflow_meta->create_step( $flow_id, $step_type, $step_custom_title );
1352
-
1353
- wcf()->logger->import_log( '------------------------------------' );
1354
- wcf()->logger->import_log( 'STARTED! Importing STEP' );
1355
- wcf()->logger->import_log( '------------------------------------' );
1356
-
1357
- if ( empty( $template_id ) || empty( $post_id ) ) {
1358
- /* translators: %s: template ID */
1359
- $data = sprintf( __( 'Invalid template id %1$s or post id %2$s.', 'cartflows' ), $template_id, $post_id );
1360
- wcf()->logger->import_log( $data );
1361
- wp_send_json_error( $data );
1362
- }
1363
-
1364
- wcf()->logger->import_log( 'Remote Step ' . $template_id . ' for local flow "' . get_the_title( $post_id ) . '" [' . $post_id . ']' );
1365
-
1366
- $response = CartFlows_API::get_instance()->get_template( $template_id );
1367
-
1368
- if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1369
- if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1370
- update_post_meta( $post_id, 'divi_content', $response['data']['divi_content'] );
1371
-
1372
- wp_update_post(
1373
- array(
1374
- 'ID' => $post_id,
1375
- 'post_content' => $response['data']['divi_content'],
1376
- )
1377
- );
1378
- }
1379
- }
1380
-
1381
- /* Imported Step */
1382
- update_post_meta( $post_id, 'cartflows_imported_step', 'yes' );
1383
-
1384
- // Import Post Meta.
1385
- self::import_post_meta( $post_id, $response );
1386
-
1387
- do_action( 'cartflows_import_complete' );
1388
-
1389
- // Batch Process.
1390
- do_action( 'cartflows_after_template_import', $post_id, $response );
1391
-
1392
- wcf()->logger->import_log( '------------------------------------' );
1393
- wcf()->logger->import_log( 'COMPLETE! Importing Step' );
1394
- wcf()->logger->import_log( '------------------------------------' );
1395
-
1396
- wp_send_json_success( $post_id );
1397
- }
1398
-
1399
- /**
1400
- * Import Step.
1401
- *
1402
- * @since 1.0.0
1403
- * @hook wp_ajax_cartflows_step_create_blank
1404
- *
1405
- * @return void
1406
- */
1407
- public function step_create_blank() {
1408
-
1409
- check_ajax_referer( 'cf-step-create-blank', 'security' );
1410
-
1411
- $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1412
- $step_type = isset( $_POST['step_type'] ) ? sanitize_text_field( wp_unslash( $_POST['step_type'] ) ) : '';
1413
- $step_title = isset( $_POST['step_title'] ) ? sanitize_text_field( wp_unslash( $_POST['step_title'] ) ) : '';
1414
-
1415
- if ( empty( $flow_id ) || empty( $step_type ) ) {
1416
- /* translators: %s: flow ID */
1417
- $data = sprintf( __( 'Invalid flow id %1$s OR step type %2$s.', 'cartflows' ), $flow_id, $step_type );
1418
- wcf()->logger->import_log( $data );
1419
- wp_send_json_error( $data );
1420
- }
1421
-
1422
- wcf()->logger->import_log( '------------------------------------' );
1423
- wcf()->logger->import_log( 'STARTED! Creating Blank STEP for Flow ' . $flow_id );
1424
-
1425
- $step_type_title = str_replace( '-', ' ', $step_type );
1426
- $step_type_slug = strtolower( str_replace( '-', ' ', $step_type ) );
1427
-
1428
- $new_step_id = wp_insert_post(
1429
- array(
1430
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1431
- 'post_title' => $step_title,
1432
- 'post_content' => '',
1433
- 'post_status' => 'publish',
1434
- )
1435
- );
1436
-
1437
- // insert post meta.
1438
- update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
1439
-
1440
- $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
1441
- $term_exist = term_exists( $step_type_slug, $taxonomy );
1442
-
1443
- if ( empty( $term_exist ) ) {
1444
- $terms = array(
1445
- array(
1446
- 'name' => $step_type_title,
1447
- 'slug' => $step_type_slug,
1448
- ),
1449
- );
1450
-
1451
- Cartflows_Step_Post_Type::get_instance()->add_terms( $taxonomy, $terms );
1452
- wcf()->logger->import_log( '(✓) Created new term name ' . $step_type_title . ' | term slug ' . $step_type_slug );
1453
- }
1454
-
1455
- $current_term = term_exists( $step_type_slug, $taxonomy );
1456
-
1457
- // Set type object.
1458
- $data = get_term( $current_term['term_id'], $taxonomy );
1459
- $step_slug = $data->slug;
1460
- wp_set_object_terms( $new_step_id, $data->slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
1461
- wcf()->logger->import_log( '(✓) Assigned existing term ' . $step_type_title . ' to the template ' . $new_step_id );
1462
-
1463
- // Set Default page Layout.
1464
- update_post_meta( $new_step_id, '_wp_page_template', 'cartflows-default' );
1465
-
1466
- // Set type.
1467
- update_post_meta( $new_step_id, 'wcf-step-type', $data->slug );
1468
- wcf()->logger->import_log( '(✓) Updated term ' . $data->name . ' to the post meta wcf-step-type.' );
1469
-
1470
- // Set flow.
1471
- wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1472
- wcf()->logger->import_log( '(✓) Assigned flow step flow-' . $flow_id );
1473
-
1474
- self::get_instance()->set_step_to_flow( $flow_id, $new_step_id, $step_type_title, $step_slug );
1475
-
1476
- wcf()->logger->import_log( 'COMPLETE! Creating Blank STEP for Flow ' . $flow_id );
1477
- wcf()->logger->import_log( '------------------------------------' );
1478
-
1479
- wp_send_json_success( $new_step_id );
1480
- }
1481
-
1482
- /**
1483
- * Import Post Meta
1484
- *
1485
- * @since 1.0.0
1486
- *
1487
- * @param integer $post_id Post ID.
1488
- * @param array $response Post meta.
1489
- * @return void
1490
- */
1491
- public static function import_post_meta( $post_id, $response ) {
1492
-
1493
- $metadata = (array) $response['post_meta'];
1494
-
1495
- foreach ( $metadata as $meta_key => $meta_value ) {
1496
- $meta_value = isset( $meta_value[0] ) ? $meta_value[0] : '';
1497
-
1498
- if ( $meta_value ) {
1499
-
1500
- if ( is_serialized( $meta_value, true ) ) {
1501
- $raw_data = maybe_unserialize( stripslashes( $meta_value ) );
1502
- } elseif ( is_array( $meta_value ) ) {
1503
- $raw_data = json_decode( stripslashes( $meta_value ), true );
1504
- } else {
1505
- $raw_data = $meta_value;
1506
- }
1507
-
1508
- if ( '_elementor_data' === $meta_key ) {
1509
- if ( is_array( $raw_data ) ) {
1510
- $raw_data = wp_slash( wp_json_encode( $raw_data ) );
1511
- } else {
1512
- $raw_data = wp_slash( $raw_data );
1513
- }
1514
- }
1515
- if ( '_elementor_data' !== $meta_key && '_elementor_draft' !== $meta_key && '_fl_builder_data' !== $meta_key && '_fl_builder_draft' !== $meta_key ) {
1516
- if ( is_array( $raw_data ) ) {
1517
- wcf()->logger->import_log( '(✓) Added post meta ' . $meta_key . ' | ' . wp_json_encode( $raw_data ) );
1518
- } else {
1519
- if ( ! is_object( $raw_data ) ) {
1520
- wcf()->logger->import_log( '(✓) Added post meta ' . $meta_key . ' | ' . $raw_data );
1521
- }
1522
- }
1523
- }
1524
-
1525
- update_post_meta( $post_id, $meta_key, $raw_data );
1526
- }
1527
- }
1528
- }
1529
-
1530
- /**
1531
- * Import Template for Elementor
1532
- *
1533
- * @since 1.0.0
1534
- *
1535
- * @param integer $post_id Post ID.
1536
- * @param array $response Post meta.
1537
- * @param array $page_build_data Page build data.
1538
- * @return void
1539
- */
1540
- public static function import_template_elementor( $post_id, $response, $page_build_data ) {
1541
- if ( ! is_plugin_active( 'elementor/elementor.php' ) ) {
1542
- $data = __( 'Elementor is not activated. Please activate plugin Elementor Page Builder to import the step.', 'cartflows' );
1543
- wcf()->logger->import_log( $data );
1544
- wp_send_json_error( $data );
1545
- }
1546
-
1547
- require_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-importer-elementor.php';
1548
-
1549
- wcf()->logger->import_log( '# Started "importing page builder data" for step ' . $post_id );
1550
-
1551
- $obj = new \Elementor\TemplateLibrary\CartFlows_Importer_Elementor();
1552
- $obj->import_single_template( $post_id );
1553
-
1554
- wcf()->logger->import_log( '# Complete "importing page builder data" for step ' . $post_id );
1555
- }
1556
-
1557
- /**
1558
- * Supported post types
1559
- *
1560
- * @since 1.0.0
1561
- *
1562
- * @return array Supported post types.
1563
- */
1564
- public static function supported_post_types() {
1565
- return apply_filters(
1566
- 'cartflows_supported_post_types',
1567
- array(
1568
- CARTFLOWS_FLOW_POST_TYPE,
1569
- )
1570
- );
1571
- }
1572
-
1573
- /**
1574
- * Check supported post type
1575
- *
1576
- * @since 1.0.0
1577
- *
1578
- * @param string $post_type Post type.
1579
- * @return boolean Supported post type status.
1580
- */
1581
- public static function is_supported_post( $post_type = '' ) {
1582
-
1583
- if ( in_array( $post_type, self::supported_post_types(), true ) ) {
1584
- return true;
1585
- }
1586
-
1587
- return false;
1588
- }
1589
-
1590
- /**
1591
- * Set steps to the flow
1592
- *
1593
- * @param integer $flow_id Flow ID.
1594
- * @param integer $new_step_id New step ID.
1595
- * @param string $step_title Flow Type.
1596
- * @param string $step_slug Flow Type.
1597
- */
1598
- public function set_step_to_flow( $flow_id, $new_step_id, $step_title, $step_slug ) {
1599
- // Update steps for the current flow.
1600
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
1601
-
1602
- if ( ! is_array( $flow_steps ) ) {
1603
- $flow_steps = array();
1604
- }
1605
-
1606
- $flow_steps[] = array(
1607
- 'id' => $new_step_id,
1608
- 'title' => $step_title,
1609
- 'type' => $step_slug,
1610
- );
1611
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1612
- wcf()->logger->import_log( '(✓) Updated flow steps post meta key \'wcf-steps\' ' . wp_json_encode( $flow_steps ) );
1613
- }
1614
-
1615
- /**
1616
- * Localize variables in admin
1617
- *
1618
- * @param array $vars variables.
1619
- */
1620
- public function localize_vars( $vars ) {
1621
-
1622
- $ajax_actions = array(
1623
- 'cf_step_import',
1624
- 'cf_load_steps',
1625
- 'cf_create_flow',
1626
- 'cf_default_flow',
1627
- 'cf_step_create_blank',
1628
- 'cf_import_flow_step',
1629
- );
1630
-
1631
- foreach ( $ajax_actions as $action ) {
1632
-
1633
- $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
1634
- }
1635
-
1636
- return $vars;
1637
- }
1638
-
1639
- /**
1640
- * Ajax action to activate plugin
1641
- */
1642
- public function activate_plugin() {
1643
-
1644
- if ( ! check_ajax_referer( 'cartflows_activate_plugin', 'security', false ) ) {
1645
- wp_send_json_error( esc_html__( 'Action failed. Invalid Security Nonce.', 'cartflows' ) );
1646
- }
1647
-
1648
- if ( ! current_user_can( 'activate_plugins' ) ) {
1649
- wp_send_json_error(
1650
- array(
1651
- 'success' => false,
1652
- 'message' => __( 'User have not plugin install permissions.', 'cartflows' ),
1653
- )
1654
- );
1655
- }
1656
-
1657
- $plugin_init = isset( $_POST['plugin_init'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin_init'] ) ) : '';
1658
-
1659
- $activate = activate_plugin( $plugin_init, '', false, true );
1660
-
1661
- if ( is_wp_error( $activate ) ) {
1662
- wp_send_json_error(
1663
- array(
1664
- 'success' => false,
1665
- 'message' => $activate->get_error_message(),
1666
- 'init' => $plugin_init,
1667
- )
1668
- );
1669
- }
1670
-
1671
- wp_send_json_success(
1672
- array(
1673
- 'success' => true,
1674
- 'message' => __( 'Plugin Successfully Activated', 'cartflows' ),
1675
- 'init' => $plugin_init,
1676
- )
1677
- );
1678
- }
1679
-
1680
- }
1681
-
1682
- /**
1683
- * Initialize class object with 'get_instance()' method
1684
- */
1685
- CartFlows_Importer::get_instance();
1686
-
1687
- endif;
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CartFlows Admin
4
+ *
5
+ * @package CartFlows
6
+ * @since 1.0.0
7
+ */
8
+
9
+ if ( ! class_exists( 'CartFlows_Importer' ) ) :
10
+
11
+ /**
12
+ * CartFlows Import
13
+ *
14
+ * @since 1.0.0
15
+ */
16
+ class CartFlows_Importer {
17
+
18
+ /**
19
+ * Instance
20
+ *
21
+ * @since 1.0.0
22
+ * @access private
23
+ * @var object Class object.
24
+ */
25
+ private static $instance;
26
+
27
+ /**
28
+ * Initiator
29
+ *
30
+ * @since 1.0.0
31
+ * @return object initialized object of class.
32
+ */
33
+ public static function get_instance() {
34
+ if ( ! isset( self::$instance ) ) {
35
+ self::$instance = new self();
36
+ }
37
+
38
+ return self::$instance;
39
+ }
40
+
41
+ /**
42
+ * Constructor
43
+ *
44
+ * @since 1.0.0
45
+ */
46
+ public function __construct() {
47
+ add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
48
+ add_action( 'wp_ajax_cartflows_load_steps', array( $this, 'load_templates' ) );
49
+ add_action( 'wp_ajax_cartflows_step_import', array( $this, 'import_step' ) );
50
+ add_action( 'wp_ajax_cartflows_create_flow', array( $this, 'create_flow' ) );
51
+ add_action( 'wp_ajax_cartflows_default_flow', array( $this, 'create_default_flow' ) );
52
+ add_action( 'wp_ajax_cartflows_step_create_blank', array( $this, 'step_create_blank' ) );
53
+ add_action( 'wp_ajax_cartflows_import_flow_step', array( $this, 'import_flow' ) );
54
+ add_action( 'admin_footer', array( $this, 'js_templates' ) );
55
+ add_action( 'cartflows_import_complete', array( $this, 'clear_cache' ) );
56
+
57
+ add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
58
+
59
+ add_action( 'wp_ajax_cartflows_activate_plugin', array( $this, 'activate_plugin' ) );
60
+
61
+ add_action( 'admin_menu', array( $this, 'add_to_menus' ) );
62
+ add_action( 'admin_init', array( $this, 'export_json' ) );
63
+ add_action( 'admin_init', array( $this, 'import_json' ) );
64
+ add_filter( 'post_row_actions', array( $this, 'export_link' ), 10, 2 );
65
+ add_action( 'admin_action_cartflows_export_flow', array( $this, 'export_flow' ) );
66
+ }
67
+
68
+ /**
69
+ * Add the export link to action list for flows row actions
70
+ *
71
+ * @since 1.1.4
72
+ *
73
+ * @param array $actions Actions array.
74
+ * @param object $post Post object.
75
+ *
76
+ * @return array
77
+ */
78
+ public function export_link( $actions, $post ) {
79
+ if ( current_user_can( 'edit_posts' ) && isset( $post ) && CARTFLOWS_FLOW_POST_TYPE === $post->post_type ) {
80
+ $actions['export'] = '<a href="' . wp_nonce_url( 'admin.php?action=cartflows_export_flow&post=' . $post->ID, basename( __FILE__ ), 'flow_export_nonce' ) . '" title="' . __( 'Export this flow', 'cartflows' ) . '" rel="permalink">' . __( 'Export', 'cartflows' ) . '</a>';
81
+ }
82
+ return $actions;
83
+ }
84
+
85
+ /**
86
+ * Add menus
87
+ *
88
+ * @since 1.1.4
89
+ */
90
+ public function add_to_menus() {
91
+ add_submenu_page( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE, __( 'Flow Export', 'cartflows' ), __( 'Flow Export', 'cartflows' ), 'export', 'flow_exporter', array( $this, 'exporter_markup' ) );
92
+ add_submenu_page( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE, __( 'Flow Import', 'cartflows' ), __( 'Flow Import', 'cartflows' ), 'import', 'flow_importer', array( $this, 'importer_markup' ) );
93
+ }
94
+
95
+ /**
96
+ * Export flow with steps and its meta
97
+ *
98
+ * @since 1.1.4
99
+ */
100
+ public function export_flow() {
101
+
102
+ if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && 'cartflows_export_flow' == $_REQUEST['action'] ) ) ) {
103
+ wp_die( esc_html__( 'No post to export has been supplied!', 'cartflows' ) );
104
+ }
105
+
106
+ if ( ! isset( $_GET['flow_export_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['flow_export_nonce'] ) ), basename( __FILE__ ) ) ) {
107
+ return;
108
+ }
109
+
110
+ // Get the original post id.
111
+ $flow_id = ( isset( $_GET['post'] ) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );
112
+
113
+ $flows = array();
114
+ $flows[] = $this->get_flow_export_data( $flow_id );
115
+ $flows = apply_filters( 'cartflows_export_data', $flows );
116
+
117
+ nocache_headers();
118
+ header( 'Content-Type: application/json; charset=utf-8' );
119
+ header( 'Content-Disposition: attachment; filename=cartflows-flow-' . $flow_id . '-' . gmdate( 'm-d-Y' ) . '.json' );
120
+ header( 'Expires: 0' );
121
+
122
+ echo wp_json_encode( $flows );
123
+ exit;
124
+ }
125
+
126
+ /**
127
+ * Export flow markup
128
+ *
129
+ * @since 1.1.4
130
+ */
131
+ public function exporter_markup() {
132
+ include_once CARTFLOWS_DIR . 'includes/exporter.php';
133
+ }
134
+
135
+ /**
136
+ * Import flow markup
137
+ *
138
+ * @since 1.1.4
139
+ */
140
+ public function importer_markup() {
141
+ include_once CARTFLOWS_DIR . 'includes/importer.php';
142
+ }
143
+
144
+ /**
145
+ * Export flow
146
+ *
147
+ * @since 1.1.4
148
+ */
149
+ public function export_json() {
150
+ if ( empty( $_POST['cartflows-action'] ) || 'export' != $_POST['cartflows-action'] ) {
151
+ return;
152
+ }
153
+
154
+ if ( isset( $_POST['cartflows-action-nonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-action-nonce'] ) ), 'cartflows-action-nonce' ) ) {
155
+ return;
156
+ }
157
+
158
+ if ( ! current_user_can( 'manage_options' ) ) {
159
+ return;
160
+ }
161
+
162
+ $flows = $this->get_all_flow_export_data();
163
+ $flows = apply_filters( 'cartflows_export_data', $flows );
164
+
165
+ nocache_headers();
166
+ header( 'Content-Type: application/json; charset=utf-8' );
167
+ header( 'Content-Disposition: attachment; filename=cartflows-flow-export-' . gmdate( 'm-d-Y' ) . '.json' );
168
+ header( 'Expires: 0' );
169
+
170
+ echo wp_json_encode( $flows );
171
+ exit;
172
+ }
173
+
174
+ /**
175
+ * Get flow export data
176
+ *
177
+ * @since 1.1.4
178
+ *
179
+ * @param integer $flow_id Flow ID.
180
+ * @return array
181
+ */
182
+ public function get_flow_export_data( $flow_id ) {
183
+
184
+ $export_all = apply_filters( 'cartflows_export_all', false );
185
+
186
+ $valid_step_meta_keys = array(
187
+ '_wp_page_template',
188
+ '_thumbnail_id',
189
+ 'classic-editor-remember',
190
+ );
191
+
192
+ $new_steps = array();
193
+ $steps = get_post_meta( $flow_id, 'wcf-steps', true );
194
+ if ( $steps ) {
195
+ foreach ( $steps as $key => $step ) {
196
+
197
+ // Add step post meta.
198
+ $new_all_meta = array();
199
+ $all_meta = get_post_meta( $step['id'] );
200
+ if ( is_array( $all_meta ) ) {
201
+
202
+ if ( $export_all ) {
203
+ foreach ( $all_meta as $meta_key => $value ) {
204
+ $new_all_meta[ $meta_key ] = maybe_unserialize( $value[0] );
205
+ }
206
+ } else {
207
+
208
+ foreach ( $all_meta as $meta_key => $value ) {
209
+ if ( substr( $meta_key, 0, strlen( 'wcf' ) ) === 'wcf' ) {
210
+ $new_all_meta[ $meta_key ] = maybe_unserialize( $value[0] );
211
+ } elseif ( in_array( $meta_key, $valid_step_meta_keys, true ) ) {
212
+ $new_all_meta[ $meta_key ] = maybe_unserialize( $value[0] );
213
+ }
214
+ }
215
+ }
216
+ }
217
+
218
+ // Add single step.
219
+ $step_data_arr = array(
220
+ 'title' => get_the_title( $step['id'] ),
221
+ 'type' => $step['type'],
222
+ 'meta' => $new_all_meta,
223
+ 'post_content' => '',
224
+ );
225
+
226
+ if ( $export_all ) {
227
+
228
+ $step_post_obj = get_post( $step['id'] );
229
+
230
+ $step_data_arr['post_content'] = $step_post_obj->post_content;
231
+ }
232
+
233
+ $new_steps[] = $step_data_arr;
234
+ }
235
+ }
236
+
237
+ // Add single flow.
238
+ return array(
239
+ 'title' => get_the_title( $flow_id ),
240
+ 'steps' => $new_steps,
241
+ );
242
+ }
243
+
244
+ /**
245
+ * Get all flow export data
246
+ *
247
+ * @since 1.1.4
248
+ */
249
+ public function get_all_flow_export_data() {
250
+
251
+ $query_args = array(
252
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
253
+
254
+ // Query performance optimization.
255
+ 'fields' => 'ids',
256
+ 'no_found_rows' => true,
257
+ 'posts_per_page' => -1,
258
+ );
259
+
260
+ $query = new WP_Query( $query_args );
261
+ $flows = array();
262
+ if ( $query->posts ) {
263
+ foreach ( $query->posts as $key => $post_id ) {
264
+ $flows[] = $this->get_flow_export_data( $post_id );
265
+ }
266
+ }
267
+
268
+ return $flows;
269
+ }
270
+
271
+ /**
272
+ * Import our exported file
273
+ *
274
+ * @since 1.1.4
275
+ */
276
+ public function import_json() {
277
+ if ( empty( $_POST['cartflows-action'] ) || 'import' != $_POST['cartflows-action'] ) {
278
+ return;
279
+ }
280
+
281
+ if ( isset( $_POST['cartflows-action-nonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-action-nonce'] ) ), 'cartflows-action-nonce' ) ) {
282
+ return;
283
+ }
284
+
285
+ if ( ! current_user_can( 'manage_options' ) ) {
286
+ return;
287
+ }
288
+
289
+ $filename = $_FILES['file']['name']; //phpcs:ignore
290
+ $file_info = explode( '.', $filename );
291
+ $extension = end( $file_info );
292
+
293
+ if ( 'json' != $extension ) {
294
+ wp_die( esc_html__( 'Please upload a valid .json file', 'cartflows' ) );
295
+ }
296
+
297
+ $file = $_FILES['file']['tmp_name']; //phpcs:ignore
298
+
299
+ if ( empty( $file ) ) {
300
+ wp_die( esc_html__( 'Please upload a file to import', 'cartflows' ) );
301
+ }
302
+
303
+ // Retrieve the settings from the file and convert the JSON object to an array.
304
+ $flows = json_decode( file_get_contents( $file ), true );//phpcs:ignore
305
+
306
+ $this->import_from_json_data( $flows );
307
+
308
+ add_action( 'admin_notices', array( $this, 'imported_successfully' ) );
309
+ }
310
+
311
+ /**
312
+ * Import flow from the JSON data
313
+ *
314
+ * @since x.x.x
315
+ * @param array $flows JSON array.
316
+ * @return void
317
+ */
318
+ public function import_from_json_data( $flows ) {
319
+ if ( $flows ) {
320
+
321
+ foreach ( $flows as $key => $flow ) {
322
+
323
+ $flow_title = $flow['title'];
324
+ if ( post_exists( $flow['title'] ) ) {
325
+ $flow_title = $flow['title'] . ' Copy';
326
+ }
327
+
328
+ // Create post object.
329
+ $new_flow_args = apply_filters(
330
+ 'cartflows_flow_importer_args',
331
+ array(
332
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
333
+ 'post_title' => $flow_title,
334
+ 'post_status' => 'draft',
335
+ )
336
+ );
337
+
338
+ // Insert the post into the database.
339
+ $flow_id = wp_insert_post( $new_flow_args );
340
+
341
+ /**
342
+ * Fire after flow import
343
+ *
344
+ * @since x.x.x
345
+ * @param int $flow_id Flow ID.
346
+ * @param array $new_flow_args Flow post args.
347
+ * @param array $flows Flow JSON data.
348
+ */
349
+ do_action( 'cartflows_flow_imported', $flow_id, $new_flow_args, $flows );
350
+
351
+ if ( $flow['steps'] ) {
352
+ foreach ( $flow['steps'] as $key => $step ) {
353
+
354
+ $new_step_args = apply_filters(
355
+ 'cartflows_step_importer_args',
356
+ array(
357
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
358
+ 'post_title' => $step['title'],
359
+ 'post_status' => 'publish',
360
+ 'meta_input' => $step['meta'],
361
+ 'post_content' => isset( $step['post_content'] ) ? $step['post_content'] : '',
362
+ )
363
+ );
364
+
365
+ $new_step_id = wp_insert_post( $new_step_args );
366
+
367
+ /**
368
+ * Fire after step import
369
+ *
370
+ * @since x.x.x
371
+ * @param int $new_step_id step ID.
372
+ * @param int $flow_id flow ID.
373
+ * @param array $new_step_args Step post args.
374
+ * @param array $flow_steps Flow steps.
375
+ * @param array $flows All flows JSON data.
376
+ */
377
+ do_action( 'cartflows_step_imported', $new_step_id, $flow_id, $new_step_args, $flow['steps'], $flows );
378
+
379
+ // Insert post meta.
380
+ update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
381
+
382
+ $step_taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
383
+ $current_term = term_exists( $step['type'], $step_taxonomy );
384
+
385
+ // // Set type object.
386
+ $data = get_term( $current_term['term_id'], $step_taxonomy );
387
+ $step_slug = $data->slug;
388
+ wp_set_object_terms( $new_step_id, $data->slug, $step_taxonomy );
389
+
390
+ // Set type.
391
+ update_post_meta( $new_step_id, 'wcf-step-type', $data->slug );
392
+
393
+ // Set flow.
394
+ wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
395
+
396
+ self::get_instance()->set_step_to_flow( $flow_id, $new_step_id, $step['title'], $step_slug );
397
+
398
+ if ( isset( $step['post_content'] ) && ! empty( $step['post_content'] ) ) {
399
+
400
+ // Download and replace images.
401
+ $content = $this->get_content( $step['post_content'] );
402
+
403
+ // Update post content.
404
+ wp_update_post(
405
+ array(
406
+ 'ID' => $new_step_id,
407
+ 'post_content' => $content,
408
+ )
409
+ );
410
+ }
411
+ }
412
+ }
413
+ }
414
+ }
415
+ }
416
+
417
+ /**
418
+ * Download and Replace hotlink images
419
+ *
420
+ * @since x.x.x
421
+ *
422
+ * @param string $content Mixed post content.
423
+ * @return array Hotlink image array.
424
+ */
425
+ public function get_content( $content = '' ) {
426
+
427
+ $all_links = wp_extract_urls( $content );
428
+ $image_links = array();
429
+ $image_map = array();
430
+
431
+ // Not have any link.
432
+ if ( empty( $all_links ) ) {
433
+ return $content;
434
+ }
435
+
436
+ foreach ( $all_links as $key => $link ) {
437
+ if ( preg_match( '/\.(jpg|jpeg|png|gif)/i', $link ) ) {
438
+ $image_links[] = $link;
439
+ }
440
+ }
441
+
442
+ // Not have any image link.
443
+ if ( empty( $image_links ) ) {
444
+ return $content;
445
+ }
446
+
447
+ foreach ( $image_links as $key => $image_url ) {
448
+
449
+ // Download remote image.
450
+ $image = array(
451
+ 'url' => $image_url,
452
+ 'id' => wp_rand( 000, 999 ),
453
+ );
454
+ $downloaded_image = CartFlows_Import_Image::get_instance()->import( $image );
455
+
456
+ // Old and New image mapping links.
457
+ $image_map[ $image_url ] = $downloaded_image['url'];
458
+ }
459
+
460
+ // Replace old image links with new image links.
461
+ foreach ( $image_map as $old_url => $new_url ) {
462
+ $content = str_replace( $old_url, $new_url, $content );
463
+ }
464
+
465
+ return $content;
466
+
467
+ }
468
+
469
+ /**
470
+ * Imported notice
471
+ *
472
+ * @since 1.1.4
473
+ */
474
+ public function imported_successfully() {
475
+ ?>
476
+ <div class="notice notice-success">
477
+ <p><?php esc_html_e( 'Successfully imported flows.', 'cartflows' ); ?></p>
478
+ </div>
479
+ <?php
480
+ }
481
+
482
+ /**
483
+ * Clear Cache.
484
+ *
485
+ * @since 1.0.0
486
+ */
487
+ public function clear_cache() {
488
+ // Clear 'Elementor' file cache.
489
+ if ( class_exists( '\Elementor\Plugin' ) ) {
490
+ Elementor\Plugin::$instance->files_manager->clear_cache();
491
+ }
492
+ }
493
+
494
+ /**
495
+ * JS Templates
496
+ *
497
+ * @since 1.0.0
498
+ *
499
+ * @return void
500
+ */
501
+ public function js_templates() {
502
+
503
+ // Loading Templates.
504
+ ?>
505
+ <script type="text/template" id="tmpl-cartflows-step-loading">
506
+ <div class="template-message-block cartflows-step-loading">
507
+ <h2>
508
+ <span class="spinner"></span>
509
+ <?php esc_html_e( 'Loading Steps', 'cartflows' ); ?>
510
+ </h2>
511
+ <p class="description"><?php esc_html_e( 'Getting steps from the cloud. Please wait for the moment.', 'cartflows' ); ?></p>
512
+ </div>
513
+ </script>
514
+
515
+ <?php
516
+ // Search Templates.
517
+ ?>
518
+ <script type="text/template" id="tmpl-cartflows-searching-templates">
519
+ <div class="template-message-block cartflows-searching-templates">
520
+ <h2>
521
+ <span class="spinner"></span>
522
+ <?php esc_html_e( 'Searching Template..', 'cartflows' ); ?>
523
+ </h2>
524
+ <p class="description"><?php esc_html_e( 'Getting templates from the cloud. Please wait for the moment.', 'cartflows' ); ?></p>
525
+ </div>
526
+ </script>
527
+
528
+ <?php
529
+ // CartFlows Importing Template.
530
+ ?>
531
+ <script type="text/template" id="tmpl-cartflows-step-importing">
532
+ <div class="template-message-block cartflows-step-importing">
533
+ <h2><span class="spinner"></span> <?php esc_html_e( 'Importing..', 'cartflows' ); ?></h2>
534
+ </div>
535
+ </script>
536
+
537
+ <?php
538
+ // CartFlows Imported.
539
+ ?>
540
+ <script type="text/template" id="tmpl-cartflows-step-imported">
541
+ <div class="template-message-block cartflows-step-imported">
542
+ <h2><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Imported', 'cartflows' ); ?></h2>
543
+ <p class="description"><?php esc_html_e( 'Thanks for patience', 'cartflows' ); ?> <span class="dashicons dashicons-smiley"></span></p></div>
544
+ </script>
545
+
546
+ <?php
547
+ // No templates.
548
+ ?>
549
+ <script type="text/template" id="tmpl-cartflows-no-steps">
550
+ <div class="cartflows-no-steps">
551
+ <div class="template-message-block">
552
+ <h2><?php esc_html_e( 'Coming Soon!', 'cartflows' ); ?></h2>
553
+ <p class="description"></p>
554
+ </div>
555
+ </div>
556
+ </script>
557
+
558
+ <?php
559
+ // No templates.
560
+ ?>
561
+ <script type="text/template" id="tmpl-cartflows-no-flows">
562
+ <div class="cartflows-no-flows">
563
+ <div class="template-message-block">
564
+ <h2><?php esc_html_e( 'Coming Soon!', 'cartflows' ); ?></h2>
565
+ <p class="description"></p>
566
+ </div>
567
+ </div>
568
+ </script>
569
+
570
+ <?php
571
+ // Error handling.
572
+ ?>
573
+ <script type="text/template" id="tmpl-templator-error">
574
+ <div class="notice notice-error"><p>{{ data }}</p></div>
575
+ </script>
576
+
577
+ <?php
578
+ // Redirect to Elementor.
579
+ ?>
580
+ <script type="text/template" id="tmpl-templator-redirect-to-elementor">
581
+ <div class="template-message-block templator-redirect-to-elementor">
582
+ <h2><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Imported', 'cartflows' ); ?></h2>
583
+ <p class="description"><?php esc_html_e( 'Thanks for patience', 'cartflows' ); ?> <span class="dashicons dashicons-smiley"></span><br/><br/><?php esc_html_e( 'Redirecting to the Elementor edit window.', 'cartflows' ); ?> </p></div>
584
+ </script>
585
+
586
+ <?php
587
+ /**
588
+ * Responsive Buttons
589
+ */
590
+ ?>
591
+ <script type="text/template" id="tmpl-cartflows-responsive-view">
592
+ <span class="responsive-view">
593
+ <span class="actions">
594
+ <a class="desktop" href="#"><span data-view="desktop " class="active dashicons dashicons-desktop"></span></a>
595
+ <a class="tablet" href="#"><span data-view="tablet" class="dashicons dashicons-tablet"></span></a>
596
+ <a class="mobile" href="#"><span data-view="mobile" class="dashicons dashicons-smartphone"></span></a>
597
+ </span>
598
+ </span>
599
+ </script>
600
+
601
+ <?php
602
+ // Templates data.
603
+ ?>
604
+ <script type="text/template" id="tmpl-cartflows-flows-list">
605
+
606
+ <# console.log( data.items.length ) #>
607
+ <# console.log( data.items ) #>
608
+ <# if ( data.items.length ) { #>
609
+ <# for ( key in data.items ) { #>
610
+ <#
611
+ var flow_steps = [];
612
+ if( data.items[ key ].flow_steps ) {
613
+ flow_steps = data.items[ key ].flow_steps.map(function(value,index) {
614
+ return value['id'];
615
+ });
616
+ }
617
+ #>
618
+ <div class="inner">
619
+ <div class="template">
620
+ <span class="thumbnail site-preview cartflows-preview-flow-steps" data-flow-steps="{{ JSON.stringify( data.items[ key ].flow_steps ) }}" data-title="{{ data.items[ key ].title.rendered }}">
621
+ <div class="template-screenshot">
622
+ <# if( data.items[ key ].featured_image_url ) { #>
623
+ <img src="{{ data.items[ key ].featured_image_url }}" />
624
+ <# } else { #>
625
+ <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/400x400.jpg" />
626
+ <# } #>
627
+ </div>
628
+ <# if( data.items[ key ].flow_type && 'pro' === data.items[ key ].flow_type.slug ) { #>
629
+ <span class="wcf-flow-type pro"><?php esc_html_e( 'Pro', 'cartflows' ); ?></span>
630
+ <# } #>
631
+ <# if( data.items[ key ].woo_required ) { #>
632
+ <div class="notice notice-info" style="width: auto;">
633
+ <p class="wcf-learn-how">
634
+ Install/Activate WooCommerce to use this template.
635
+ <a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank">
636
+ <strong><?php esc_html_e( 'Learn How', 'cartflows' ); ?></strong>
637
+ <i class="dashicons dashicons-external"></i>
638
+ </a>
639
+ </p>
640
+ </div>
641
+ <# } else { #>
642
+ <a href="<?php echo CARTFLOWS_TEMPLATES_URL . 'preview/?'; ?>flow={{ data.items[ key ].id }}&title={{{ data.items[ key ].title.rendered }}}" class="preview" target="_blank">Preview <i class="dashicons dashicons-external"></i></a>
643
+ <# } #>
644
+
645
+ </span>
646
+ <div class="template-id-container">
647
+ <h3 class="template-name"> {{{ data.items[ key ].title.rendered }}} </h3>
648
+ <div class="template-actions">
649
+
650
+ <#
651
+ if( data.items[ key ].page_builder.slug ) {
652
+ required_plugin_group = data.items[ key ].page_builder.slug;
653
+ } else {
654
+ required_plugin_group = '';
655
+ }
656
+
657
+ if( data.items[ key ].page_builder.slug && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug] && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug].button_title ) {
658
+ import_btn_title = CartFlowsImportVars.required_plugins[ data.items[ key ].page_builder.slug ].button_title;
659
+ } else {
660
+ import_btn_title = 'Import';
661
+ } #>
662
+
663
+ <# if( data.items[ key ].licence_status && 'valid' === data.items[ key ].licence_status ) { #>
664
+ <# if( ! data.items[ key ].woo_required ) { #>
665
+ <a data-flow-steps="{{ flow_steps }}" data-required-plugin-group="{{required_plugin_group}}" href="#" class="button button-primary cartflows-step-import" data-template-id="{{ data.items[ key ].id }}">{{ import_btn_title }}</a>
666
+ <# } else { #>
667
+ <a href='#' class='wcf-activate-wc button-primary'>Install & activate Woo</a>
668
+ <# } #>
669
+ <# } else if( CartFlowsImportVars._is_pro_active ) { #>
670
+ <a target="_blank" href="<?php echo esc_url( admin_url( 'plugins.php?cartflows-license-popup' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate License', 'cartflows' ); ?></a>
671
+ <# } else { #>
672
+ <a target="_blank" href="<?php echo esc_url( CARTFLOWS_DOMAIN_URL ); ?>" class="button button-primary"><?php esc_html_e( 'Get Pro', 'cartflows' ); ?></a>
673
+ <# } #>
674
+ </div>
675
+ </div>
676
+ </div>
677
+ </div>
678
+ <# } #>
679
+ <# } #>
680
+ </script>
681
+
682
+ <?php
683
+ // Empty Step.
684
+ ?>
685
+ <script type="text/template" id="tmpl-cartflows-create-blank-step">
686
+ <div class="inner">
687
+ <div class="template">
688
+ <span class="thumbnail site-preview cartflows-flow-preview">
689
+ <div class="template-screenshot">
690
+ <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/start-scratch.jpg" />
691
+ </div>
692
+ <div id="wcf_create_notice" class=""><a href="https://cartflows.com/" target="_blank"></a></div>
693
+ </span>
694
+ <div class="template-id-container">
695
+ <h3 class="template-name"> Blank </h3>
696
+ <div class="template-actions">
697
+ <a href="#" class="button button-primary cartflows-step-import-blank"><?php esc_html_e( 'Create', 'cartflows' ); ?></a>
698
+ </div>
699
+ </div>
700
+ </div>
701
+ </div>
702
+ </script>
703
+
704
+ <?php
705
+ // Templates data.
706
+ ?>
707
+ <script type="text/template" id="tmpl-cartflows-steps-list">
708
+ <# if ( data.items.length ) { #>
709
+ <# for ( key in data.items ) { #>
710
+ <#
711
+ var flow_steps = [];
712
+ if( data.items[ key ].flow_steps ) {
713
+ flow_steps = data.items[ key ].flow_steps.map(function(value,index) {
714
+ return value['id'];
715
+ });
716
+ }
717
+ #>
718
+ <div class="inner">
719
+ <div class="template">
720
+ <span class="thumbnail site-preview cartflows-preview-flow-steps" data-flow-steps="{{ JSON.stringify( data.items[ key ].flow_steps ) }}" data-title="{{ data.items[ key ].title.rendered }}">
721
+ <div class="template-screenshot">
722
+ <# if( data.items[ key ].featured_image_url ) { #>
723
+ <img src="{{ data.items[ key ].featured_image_url }}" />
724
+ <# } else { #>
725
+ <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/400x400.jpg" />
726
+ <# } #>
727
+ </div>
728
+ <div id="wcf_create_notice" class=""><a href="https://cartflows.com/" target="_blank"></a></div>
729
+
730
+ <# if( data.items[ key ].woo_required ) { #>
731
+ <div class="notice notice-info" style="width: auto;">
732
+ <p class="wcf-learn-how">
733
+ Install/Activate WooCommerce to use this template.
734
+ <a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank">
735
+ <strong><?php esc_html_e( 'Learn How', 'cartflows' ); ?></strong>
736
+ <i class="dashicons dashicons-external"></i>
737
+ </a>
738
+ </p>
739
+ </div>
740
+ <# } else { #>
741
+ <a href="<?php echo CARTFLOWS_TEMPLATES_URL . 'preview/?'; ?>step={{ data.items[ key ].id }}&title={{{ data.items[ key ].title.rendered }}}" class="preview" target="_blank">Preview <i class="dashicons dashicons-external"></i></a>
742
+ <# } #>
743
+
744
+ <# if( data.items[ key ].flow_type && 'pro' === data.items[ key ].flow_type.slug ) { #>
745
+ <span class="wcf-flow-type pro"><?php esc_html_e( 'Pro', 'cartflows' ); ?></span>
746
+ <# } #>
747
+ </span>
748
+ <div class="template-id-container">
749
+ <h3 class="template-name"> {{{ data.items[ key ].title.rendered }}} </h3>
750
+ <div class="template-actions">
751
+
752
+ <#
753
+
754
+ var step_slug = data.items[ key ].step_type.slug || '';
755
+ var step_title = data.items[ key ].step_type.name || '';
756
+ var import_btn_title = 'Import';
757
+
758
+ var required_plugin_group = '';
759
+ if( data.items[ key ].page_builder ) {
760
+ required_plugin_group = data.items[ key ].page_builder.slug;
761
+
762
+ if( data.items[ key ].page_builder.slug && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug] && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug].button_title ) {
763
+ import_btn_title = CartFlowsImportVars.required_plugins[ data.items[ key ].page_builder.slug ].button_title;
764
+ }
765
+ }
766
+ #>
767
+
768
+ <# if( data.items[ key ].licence_status && 'valid' === data.items[ key ].licence_status ) { #>
769
+
770
+ <# if( ! data.items[ key ].woo_required ) { #>
771
+ <a data-slug="{{step_slug}}" data-title="{{step_title}}" data-flow-steps="{{ flow_steps }}" data-required-plugin-group="{{required_plugin_group}}" href="#" class="button button-primary cartflows-step-import" data-template-id="{{ data.items[ key ].id }}">{{ import_btn_title }}</a>
772
+ <# } else { #>
773
+ <a href='#' class='wcf-activate-wc button-primary'>Install & activate Woo</a>
774
+ <# } #>
775
+
776
+ <# } else if( CartFlowsImportVars._is_pro_active ) { #>
777
+ <a target="_blank" href="<?php echo esc_url( admin_url( 'plugins.php?cartflows-license-popup' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate License', 'cartflows' ); ?></a>
778
+ <# } else { #>
779
+ <a target="_blank" href="<?php echo esc_url( CARTFLOWS_DOMAIN_URL ); ?>" class="button button-primary"><?php esc_html_e( 'Get Pro', 'cartflows' ); ?></a>
780
+ <# } #>
781
+ </div>
782
+ </div>
783
+ </div>
784
+ </div>
785
+ <# } #>
786
+ <# } #>
787
+ </script>
788
+
789
+ <?php
790
+ /**
791
+ * TMPL - Website Unreachable
792
+ */
793
+ ?>
794
+ <script type="text/template" id="tmpl-cartflows-website-unreachable">
795
+ <div class="postbox cartflows-website-unreachable">
796
+ <h2><?php esc_html_e( 'Under Maintenance..', 'cartflows' ); ?></h2>
797
+ <p><?php esc_html_e( 'If you are seeing this message, most likely our servers are under routine maintenance and we will be back shortly.', 'cartflows' ); ?></p>
798
+ <p><?php esc_html_e( 'In rare case, it is possible your website is having trouble connecting with ours. If you need help, please feel free to get in touch with us from our website..', 'cartflows' ); ?></p>
799
+ </div>
800
+ </script>
801
+
802
+ <?php
803
+ /**
804
+ * TMPL - Filters
805
+ */
806
+ ?>
807
+ <script type="text/template" id="tmpl-cartflows-page-builder-notice">
808
+ <?php
809
+ $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
810
+ $page_builder = Cartflows_Helper::get_required_plugins_for_page_builder( Cartflows_Helper::get_common_setting( 'default_page_builder' ) );
811
+ $title = $page_builder['title'];
812
+
813
+ $plugin_string = '<a href="#" data-slug="' . esc_html( $default_page_builder ) . '" class="wcf-install-plugin">Please click here and activate ' . esc_html( $title ) . '</a>';
814
+ $theme_status = '';
815
+ if ( 'divi' === $default_page_builder ) {
816
+
817
+ $theme_status = $page_builder['theme-status'];
818
+ $plugin_status = $page_builder['plugin-status'];
819
+
820
+ if ( 'deactivate' === $theme_status || 'install' === $plugin_status ) {
821
+ $plugin_string = 'Please activate ' . esc_html( $title );
822
+ } elseif ( ( 'deactivate' === $theme_status || 'not-installed' === $theme_status ) && 'install' === $plugin_status ) {
823
+ $plugin_string = 'Please install and activate ' . esc_html( $title );
824
+ }
825
+ }
826
+ ?>
827
+ <div class="wcf-page-builder-message">
828
+ <p><?php /* translators: %s: Plugin string */ printf( __( '%1$s to see CartFlows templates. If you prefer another page builder tool, you can <a href="%2$s" target="blank">select it here</a>.', 'cartflows' ), $plugin_string, admin_url( 'admin.php?page=' . CARTFLOWS_SETTINGS . '&action=common-settings#form-field-wcf_default_page_builder' ) ); ?></p>
829
+ <p>If your preferred page builder is not available, feel free to <a href="#" data-slug="canvas" class="wcf-create-from-scratch-link">create your own</a> pages using page builder of your choice as CartFlows works with all major page builders.</p>
830
+ <p>We plan to add design templates made with more page builder shortly!</p>
831
+ </div>
832
+ </script>
833
+
834
+ <?php
835
+ /**
836
+ * TMPL - Filters
837
+ */
838
+ ?>
839
+ <script type="text/template" id="tmpl-cartflows-term-filters-dropdown">
840
+ <# if ( data ) { #>
841
+ <select class="{{ data.args.wrapper_class }} {{ data.args.class }}">
842
+ <# if ( data.args.show_all ) { #>
843
+ <option value="all"> <?php esc_html_e( 'All', 'cartflows' ); ?> </option>
844
+ <# } #>
845
+ <# if ( CartFlowsImportVars.step_type === data.args.remote_slug ) { #>
846
+ <option value=""> <?php esc_html_e( 'Select Step Type', 'cartflows' ); ?> </option>
847
+ <# } #>
848
+ <# var step_slug_data = []; #>
849
+ <# for ( key in data.items ) { #>
850
+ <option value='{{ data.items[ key ].id }}' data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</option>
851
+
852
+ <# step_slug_data.push( data.items[ key ].slug ); #>
853
+
854
+ <# } #>
855
+ <# if( step_slug_data.indexOf("optin") === -1){ #>
856
+ <option value='0' data-group='0' class="Optin (Woo)" data-slug="optin" data-title="Optin (Woo)">Optin (Woo)</option>
857
+ <# } #>
858
+ </select>
859
+ <# } #>
860
+ </script>
861
+
862
+ <script type="text/template" id="tmpl-cartflows-term-filters">
863
+
864
+ <# if ( data ) { #>
865
+
866
+ <?php /* <# if ( CartFlowsImportVars.flow_page_builder === data.args.remote_slug || CartFlowsImportVars.step_page_builder === data.args.remote_slug ) { #> */ ?>
867
+ <ul class="{{ data.args.wrapper_class }} {{ data.args.class }}">
868
+
869
+ <# if ( data.args.show_all ) { #>
870
+ <li>
871
+ <a href="#" data-group="all"> All </a>
872
+ </li>
873
+ <# } #>
874
+
875
+ <# for ( key in data.items ) { #>
876
+ <li>
877
+ <a href="#" data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</a>
878
+ </li>
879
+ <# } #>
880
+
881
+ </ul>
882
+
883
+ <?php
884
+
885
+ /**
886
+ <# } else { #>
887
+ <select class="{{ data.args.wrapper_class }} {{ data.args.class }}">
888
+
889
+ <# if ( data.args.show_all ) { #>
890
+ <option value="all"> <?php _e( 'All', 'cartflows' ); ?> </option>
891
+ <# } #>
892
+
893
+ <# if ( CartFlowsImportVars.step_type === data.args.remote_slug ) { #>
894
+ <option value=""> <?php _e( 'Select Step Type', 'cartflows' ); ?> </option>
895
+ <# } #>
896
+
897
+ <# for ( key in data.items ) { #>
898
+ <option value='{{ data.items[ key ].id }}' data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</option>
899
+ <# } #>
900
+
901
+ </select>
902
+ */
903
+ ?>
904
+
905
+ <?php /* <# } #> */ ?>
906
+
907
+ <# } #>
908
+ </script>
909
+
910
+ <?php
911
+ // Step Type.
912
+ ?>
913
+ <script type="text/template" id="tmpl-cartflows-step-types">
914
+ <ul class="wcf-tab nav-tabs">
915
+ <# if( data.items_count ) { #>
916
+ <# for( key in data.items ) { #>
917
+ <# console.log( data.items[ key ].id ) #>
918
+ <li data-slug="{{data.items[ key ].slug}}" data-title="{{ data.items[ key ].name }}">
919
+ <a href="#{{{ data.items[ key ].slug }}}">{{{ data.items[ key ].name }}}</a>
920
+ </li>
921
+ <# } #>
922
+ <# } #>
923
+ </ul>
924
+ </script>
925
+
926
+ <?php
927
+ // Add to library button.
928
+ ?>
929
+ <script type="text/template" id="tmpl-templator-add-to-library">
930
+ <a class="templator-add-to-library page-title-action cartflows-load-steps-library"><i class="dashicons dashicons-cloud"></i><?php esc_attr_e( 'Import from Cloud', 'cartflows' ); ?></a>
931
+ </script>
932
+ <?php
933
+ }
934
+
935
+ /**
936
+ * Enqueue scripts
937
+ *
938
+ * @since 1.0.0
939
+ *
940
+ * @hook admin_enqueue_scripts
941
+ * @param string $hook Current page hook.
942
+ */
943
+ public function scripts( $hook = '' ) {
944
+
945
+ if ( ! self::is_supported_post( get_current_screen()->post_type ) ) {
946
+ return;
947
+ }
948
+
949
+ wp_enqueue_script( 'cartflows-rest-api', CARTFLOWS_URL . 'assets/js/rest-api.js', array( 'jquery' ), CARTFLOWS_VER, true );
950
+ wp_enqueue_style( 'cartflows-import', CARTFLOWS_URL . 'assets/css/import.css', null, CARTFLOWS_VER, 'all' );
951
+ wp_style_add_data( 'cartflows-import', 'rtl', 'replace' );
952
+ wp_enqueue_script( 'cartflows-import', CARTFLOWS_URL . 'assets/js/import.js', array( 'jquery', 'wp-util', 'cartflows-rest-api', 'updates' ), CARTFLOWS_VER, true );
953
+
954
+ $installed_plugins = get_plugins();
955
+ $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? 'yes' : 'no';
956
+ $is_wc_activated = wcf()->is_woo_active ? 'yes' : 'no';
957
+
958
+ $localize_vars = array(
959
+ '_is_pro_active' => _is_cartflows_pro(),
960
+ 'is_wc_installed' => $is_wc_installed,
961
+ 'is_wc_activated' => $is_wc_activated,
962
+
963
+ // Flow and its rest fields.
964
+ 'flow' => CARTFLOWS_FLOW_POST_TYPE,
965
+ 'flow_fields' => array(
966
+ 'id',
967
+ 'title',
968
+ 'flow_type',
969
+ 'page_builder',
970
+ 'flow_steps',
971
+ 'licence_status',
972
+ 'featured_image_url',
973
+ 'featured_media', // @required for field `featured_image_url`.
974
+ ),
975
+
976
+ // Flow type and rest fields.
977
+ 'flow_type' => CARTFLOWS_TAXONOMY_FLOW_CATEGORY,
978
+ 'flow_type_fields' => array(
979
+ 'id',
980
+ 'name',
981
+ 'slug',
982
+ ),
983
+
984
+ // Flow page builder and rest fields.
985
+ 'flow_page_builder' => CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER,
986
+ 'flow_page_builder_fields' => array(
987
+ 'id',
988
+ 'name',
989
+ 'slug',
990
+ ),
991
+
992
+ // Step page builder and rest fields.
993
+ 'step_page_builder' => CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER,
994
+ 'step_page_builder_fields' => array(
995
+ 'id',
996
+ 'name',
997
+ 'slug',
998
+ ),
999
+
1000
+ // Step and its rest fields.
1001
+ 'step' => CARTFLOWS_STEP_POST_TYPE,
1002
+ 'step_fields' => array(
1003
+ 'title',
1004
+ 'featured_image_url',
1005
+ 'featured_media', // @required for field `featured_image_url`.
1006
+ 'id',
1007
+ 'flow_type',
1008
+ 'step_type',
1009
+ 'page_builder',
1010
+ 'licence_status',
1011
+ ),
1012
+
1013
+ // Step type and its rest fields.
1014
+ 'step_type' => CARTFLOWS_TAXONOMY_STEP_TYPE,
1015
+ 'step_type_fields' => array(
1016
+ 'id',
1017
+ 'name',
1018
+ 'slug',
1019
+ ),
1020
+
1021
+ 'domain_url' => CARTFLOWS_DOMAIN_URL,
1022
+ 'server_url' => CARTFLOWS_TEMPLATES_URL,
1023
+ 'server_rest_url' => CARTFLOWS_TEMPLATES_URL . 'wp-json/wp/v2/',
1024
+ 'site_url' => site_url(),
1025
+ 'import_url' => admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&page=flow_importer' ),
1026
+ 'export_url' => admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&page=flow_exporter' ),
1027
+ 'admin_url' => admin_url(),
1028
+ 'licence_args' => CartFlows_API::get_instance()->get_licence_args(),
1029
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
1030
+ 'debug' => ( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || isset( $_GET['debug'] ) ) ? true : false, //phpcs:ignore
1031
+
1032
+ 'required_plugins' => Cartflows_Helper::get_plugins_groupby_page_builders(),
1033
+
1034
+ 'default_page_builder' => Cartflows_Helper::get_common_setting( 'default_page_builder' ),
1035
+ );
1036
+
1037
+ $localize_vars['cartflows_activate_plugin_nonce'] = wp_create_nonce( 'cartflows_activate_plugin' );
1038
+
1039
+ // var_dump(Cartflows_Helper::get_common_setting( 'default_page_builder' ));
1040
+ // wp_die( );
1041
+ // Add thickbox.
1042
+ add_thickbox();
1043
+
1044
+ wp_localize_script( 'cartflows-import', 'CartFlowsImportVars', $localize_vars );
1045
+ wp_localize_script( 'cartflows-rest-api', 'CartFlowsImportVars', $localize_vars );
1046
+ }
1047
+
1048
+ /**
1049
+ * Load Template
1050
+ *
1051
+ * @since 1.0.0
1052
+ *
1053
+ * @hook cartflows_load_steps
1054
+ * @return void
1055
+ */
1056
+ public function load_templates() {
1057
+
1058
+ check_ajax_referer( 'cf-load-steps', 'security' );
1059
+
1060
+ $args = ( isset( $_POST['args'] ) ) ? array_map( 'sanitize_text_field', $_POST['args'] ) : array(); //phpcs:ignore
1061
+ $templates = CartFlows_API::get_instance()->get_templates( $args );
1062
+
1063
+ if ( $templates['templates_count'] ) {
1064
+ wp_send_json_success( $templates );
1065
+ } else {
1066
+ wp_send_json_error( $templates );
1067
+ }
1068
+ wp_die();
1069
+ }
1070
+
1071
+ /**
1072
+ * Import.
1073
+ *
1074
+ * @since 1.0.0
1075
+ *
1076
+ * @hook wp_ajax_cartflows_import_flow_step
1077
+ * @return void
1078
+ */
1079
+ public function import_flow() {
1080
+
1081
+ check_ajax_referer( 'cf-import-flow-step', 'security' );
1082
+
1083
+ $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1084
+ $template_id = isset( $_POST['template_id'] ) ? intval( $_POST['template_id'] ) : '';
1085
+
1086
+ wcf()->logger->import_log( '------------------------------------' );
1087
+ wcf()->logger->import_log( 'STARTED! Importing FLOW' );
1088
+ wcf()->logger->import_log( '------------------------------------' );
1089
+ wcf()->logger->import_log( '(✓) Creating new step from remote step [' . $template_id . '] for FLOW ' . get_the_title( $flow_id ) . ' [' . $flow_id . ']' );
1090
+
1091
+ $response = CartFlows_API::get_instance()->get_template( $template_id );
1092
+
1093
+ $post_content = isset( $response['data']['content']->rendered ) ? $response['data']['content']->rendered : '';
1094
+ if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1095
+ if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1096
+ $post_content = $response['data']['divi_content'];
1097
+ }
1098
+ }
1099
+
1100
+ if ( false === $response['success'] ) {
1101
+ wcf()->logger->import_log( '(✕) Failed to fetch remote data.' );
1102
+ wp_send_json_error( $response );
1103
+ }
1104
+
1105
+ wcf()->logger->import_log( '(✓) Successfully getting remote step response ' . wp_json_encode( $response ) );
1106
+
1107
+ $new_step_id = wp_insert_post(
1108
+ array(
1109
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1110
+ 'post_title' => $response['title'],
1111
+ 'post_content' => $post_content,
1112
+ 'post_status' => 'publish',
1113
+ )
1114
+ );
1115
+
1116
+ if ( is_wp_error( $new_step_id ) ) {
1117
+ wcf()->logger->import_log( '(✕) Failed to create new step for flow ' . $flow_id );
1118
+ wp_send_json_error( $new_step_id );
1119
+ }
1120
+
1121
+ if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1122
+ if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1123
+ update_post_meta( $new_step_id, 'divi_content', $response['data']['divi_content'] );
1124
+ }
1125
+ }
1126
+
1127
+ /* Imported Step */
1128
+ update_post_meta( $new_step_id, 'cartflows_imported_step', 'yes' );
1129
+
1130
+ wcf()->logger->import_log( '(✓) Created new step ' . '"' . $response['title'] . '" id ' . $new_step_id );//phpcs:ignore
1131
+ // insert post meta.
1132
+ update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
1133
+ wcf()->logger->import_log( '(✓) Added flow ID ' . $flow_id . ' in post meta key wcf-flow-id.' );
1134
+
1135
+ /**
1136
+ * Import & Set type.
1137
+ */
1138
+ $term = isset( $response['data']['step_type'] ) ? $response['data']['step_type'] : '';
1139
+
1140
+ $term_slug = '';
1141
+ if ( $term ) {
1142
+
1143
+ $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
1144
+ $term_exist = term_exists( $term->slug, $taxonomy );
1145
+
1146
+ if ( empty( $term_exist ) ) {
1147
+ $terms = array(
1148
+ array(
1149
+ 'name' => $term->name,
1150
+ 'slug' => $term->slug,
1151
+ ),
1152
+ );
1153
+
1154
+ Cartflows_Step_Post_Type::get_instance()->add_terms( $taxonomy, $terms );
1155
+ wcf()->logger->import_log( '(✓) Created new term name ' . $term->name . ' | term slug ' . $term->slug );
1156
+ }
1157
+
1158
+ $current_term = term_exists( $term->slug, $taxonomy );
1159
+
1160
+ // Set type object.
1161
+ $data = get_term( $current_term['term_id'], $taxonomy );
1162
+ $term_slug = $data->slug;
1163
+ $term_name = $data->name;
1164
+ wp_set_object_terms( $new_step_id, $term_slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
1165
+ wcf()->logger->import_log( '(✓) Assigned existing term ' . $term_name . ' to the template ' . $new_step_id );
1166
+
1167
+ // Set type.
1168
+ update_post_meta( $new_step_id, 'wcf-step-type', $term_slug );
1169
+ wcf()->logger->import_log( '(✓) Updated term ' . $term_name . ' to the post meta wcf-step-type.' );
1170
+ }
1171
+
1172
+ // Set flow.
1173
+ wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1174
+ wcf()->logger->import_log( '(✓) Assigned flow step flow-' . $flow_id );
1175
+
1176
+ /**
1177
+ * Update steps for the current flow.
1178
+ */
1179
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
1180
+
1181
+ if ( ! is_array( $flow_steps ) ) {
1182
+ $flow_steps = array();
1183
+ }
1184
+
1185
+ $flow_steps[] = array(
1186
+ 'id' => $new_step_id,
1187
+ 'title' => $response['title'],
1188
+ 'type' => $term_slug,
1189
+ );
1190
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1191
+ wcf()->logger->import_log( '(✓) Updated flow steps post meta key \'wcf-steps\' ' . wp_json_encode( $flow_steps ) );
1192
+
1193
+ // Import Post Meta.
1194
+ self::import_post_meta( $new_step_id, $response );
1195
+
1196
+ wcf()->logger->import_log( '(✓) Importing step "' . get_the_title( $new_step_id ) . '" [' . $new_step_id . '] for FLOW "' . get_the_title( $flow_id ) . '" [' . $flow_id . ']' );
1197
+ wcf()->logger->import_log( '------------------------------------' );
1198
+ wcf()->logger->import_log( 'COMPLETE! Importing FLOW' );
1199
+ wcf()->logger->import_log( '------------------------------------' );
1200
+
1201
+ do_action( 'cartflows_import_complete' );
1202
+ wcf()->logger->import_log( '(✓) BATCH STARTED for step ' . $new_step_id . ' for Blog name \'' . get_bloginfo( 'name' ) . '\' (' . get_current_blog_id() . ')' );
1203
+
1204
+ // Batch Process.
1205
+ do_action( 'cartflows_after_template_import', $new_step_id, $response );
1206
+
1207
+ /**
1208
+ * End
1209
+ */
1210
+ wp_send_json_success( $new_step_id );
1211
+ }
1212
+
1213
+ /**
1214
+ * Import Step.
1215
+ *
1216
+ * @since 1.0.0
1217
+ * @hook wp_ajax_cartflows_step_import
1218
+ *
1219
+ * @return void
1220
+ */
1221
+ public function create_default_flow() {
1222
+
1223
+ check_ajax_referer( 'cf-default-flow', 'security' );
1224
+
1225
+ // Create post object.
1226
+ $new_flow_post = array(
1227
+ 'post_content' => '',
1228
+ 'post_status' => 'publish',
1229
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
1230
+ );
1231
+
1232
+ // Insert the post into the database.
1233
+ $flow_id = wp_insert_post( $new_flow_post );
1234
+
1235
+ if ( is_wp_error( $flow_id ) ) {
1236
+ wp_send_json_error( $flow_id->get_error_message() );
1237
+ }
1238
+
1239
+ $flow_steps = array();
1240
+
1241
+ if ( wcf()->is_woo_active ) {
1242
+ $steps_data = array(
1243
+ 'sales' => array(
1244
+ 'title' => __( 'Sales Landing', 'cartflows' ),
1245
+ 'type' => 'landing',
1246
+ ),
1247
+ 'order-form' => array(
1248
+ 'title' => __( 'Checkout (Woo)', 'cartflows' ),
1249
+ 'type' => 'checkout',
1250
+ ),
1251
+ 'order-confirmation' => array(
1252
+ 'title' => __( 'Thank You (Woo)', 'cartflows' ),
1253
+ 'type' => 'thankyou',
1254
+ ),
1255
+ );
1256
+
1257
+ } else {
1258
+ $steps_data = array(
1259
+ 'landing' => array(
1260
+ 'title' => __( 'Landing', 'cartflows' ),
1261
+ 'type' => 'landing',
1262
+ ),
1263
+ 'thankyou' => array(
1264
+ 'title' => __( 'Thank You', 'cartflows' ),
1265
+ 'type' => 'landing',
1266
+ ),
1267
+ );
1268
+ }
1269
+
1270
+ foreach ( $steps_data as $slug => $data ) {
1271
+
1272
+ $post_content = '';
1273
+ $step_type = trim( $data['type'] );
1274
+
1275
+ $step_id = wp_insert_post(
1276
+ array(
1277
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1278
+ 'post_title' => $data['title'],
1279
+ 'post_content' => $post_content,
1280
+ 'post_status' => 'publish',
1281
+ )
1282
+ );
1283
+
1284
+ if ( is_wp_error( $step_id ) ) {
1285
+ wp_send_json_error( $step_id->get_error_message() );
1286
+ }
1287
+
1288
+ if ( $step_id ) {
1289
+
1290
+ $flow_steps[] = array(
1291
+ 'id' => $step_id,
1292
+ 'title' => $data['title'],
1293
+ 'type' => $step_type,
1294
+ );
1295
+
1296
+ // insert post meta.
1297
+ update_post_meta( $step_id, 'wcf-flow-id', $flow_id );
1298
+ update_post_meta( $step_id, 'wcf-step-type', $step_type );
1299
+
1300
+ wp_set_object_terms( $step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
1301
+ wp_set_object_terms( $step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1302
+
1303
+ update_post_meta( $step_id, '_wp_page_template', 'cartflows-default' );
1304
+ }
1305
+ }
1306
+
1307
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1308
+
1309
+ wp_send_json_success( $flow_id );
1310
+ }
1311
+
1312
+ /**
1313
+ * Create Flow
1314
+ *
1315
+ * @return void
1316
+ */
1317
+ public function create_flow() {
1318
+
1319
+ check_ajax_referer( 'cf-create-flow', 'security' );
1320
+
1321
+ // Create post object.
1322
+ $new_flow_post = array(
1323
+ 'post_content' => '',
1324
+ 'post_status' => 'publish',
1325
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
1326
+ );
1327
+
1328
+ // Insert the post into the database.
1329
+ $flow_id = wp_insert_post( $new_flow_post );
1330
+
1331
+ if ( is_wp_error( $flow_id ) ) {
1332
+ wp_send_json_error( $flow_id->get_error_message() );
1333
+ }
1334
+
1335
+ /* Imported Flow */
1336
+ update_post_meta( $flow_id, 'cartflows_imported_flow', 'yes' );
1337
+
1338
+ wp_send_json_success( $flow_id );
1339
+ }
1340
+
1341
+ /**
1342
+ * Create Step
1343
+ *
1344
+ * @return void
1345
+ */
1346
+ public function import_step() {
1347
+
1348
+ check_ajax_referer( 'cf-step-import', 'security' );
1349
+
1350
+ $template_id = isset( $_POST['template_id'] ) ? intval( $_POST['template_id'] ) : '';
1351
+ $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1352
+ $step_title = isset( $_POST['step_title'] ) ? sanitize_text_field( wp_unslash( $_POST['step_title'] ) ) : '';
1353
+ $step_type = isset( $_POST['step_type'] ) ? sanitize_title( wp_unslash( $_POST['step_type'] ) ) : '';
1354
+ $step_custom_title = isset( $_POST['step_custom_title'] ) ? sanitize_title( wp_unslash( $_POST['step_custom_title'] ) ) : $step_title;
1355
+
1356
+ $cartflow_meta = Cartflows_Flow_Meta::get_instance();
1357
+
1358
+ $post_id = $cartflow_meta->create_step( $flow_id, $step_type, $step_custom_title );
1359
+
1360
+ wcf()->logger->import_log( '------------------------------------' );
1361
+ wcf()->logger->import_log( 'STARTED! Importing STEP' );
1362
+ wcf()->logger->import_log( '------------------------------------' );
1363
+
1364
+ if ( empty( $template_id ) || empty( $post_id ) ) {
1365
+ /* translators: %s: template ID */
1366
+ $data = sprintf( __( 'Invalid template id %1$s or post id %2$s.', 'cartflows' ), $template_id, $post_id );
1367
+ wcf()->logger->import_log( $data );
1368
+ wp_send_json_error( $data );
1369
+ }
1370
+
1371
+ wcf()->logger->import_log( 'Remote Step ' . $template_id . ' for local flow "' . get_the_title( $post_id ) . '" [' . $post_id . ']' );
1372
+
1373
+ $response = CartFlows_API::get_instance()->get_template( $template_id );
1374
+
1375
+ if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1376
+ if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1377
+ update_post_meta( $post_id, 'divi_content', $response['data']['divi_content'] );
1378
+
1379
+ wp_update_post(
1380
+ array(
1381
+ 'ID' => $post_id,
1382
+ 'post_content' => $response['data']['divi_content'],
1383
+ )
1384
+ );
1385
+ }
1386
+ }
1387
+
1388
+ /* Imported Step */
1389
+ update_post_meta( $post_id, 'cartflows_imported_step', 'yes' );
1390
+
1391
+ // Import Post Meta.
1392
+ self::import_post_meta( $post_id, $response );
1393
+
1394
+ do_action( 'cartflows_import_complete' );
1395
+
1396
+ // Batch Process.
1397
+ do_action( 'cartflows_after_template_import', $post_id, $response );
1398
+
1399
+ wcf()->logger->import_log( '------------------------------------' );
1400
+ wcf()->logger->import_log( 'COMPLETE! Importing Step' );
1401
+ wcf()->logger->import_log( '------------------------------------' );
1402
+
1403
+ wp_send_json_success( $post_id );
1404
+ }
1405
+
1406
+ /**
1407
+ * Import Step.
1408
+ *
1409
+ * @since 1.0.0
1410
+ * @hook wp_ajax_cartflows_step_create_blank
1411
+ *
1412
+ * @return void
1413
+ */
1414
+ public function step_create_blank() {
1415
+
1416
+ check_ajax_referer( 'cf-step-create-blank', 'security' );
1417
+
1418
+ $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1419
+ $step_type = isset( $_POST['step_type'] ) ? sanitize_text_field( wp_unslash( $_POST['step_type'] ) ) : '';
1420
+ $step_title = isset( $_POST['step_title'] ) ? sanitize_text_field( wp_unslash( $_POST['step_title'] ) ) : '';
1421
+
1422
+ if ( empty( $flow_id ) || empty( $step_type ) ) {
1423
+ /* translators: %s: flow ID */
1424
+ $data = sprintf( __( 'Invalid flow id %1$s OR step type %2$s.', 'cartflows' ), $flow_id, $step_type );
1425
+ wcf()->logger->import_log( $data );
1426
+ wp_send_json_error( $data );
1427
+ }
1428
+
1429
+ wcf()->logger->import_log( '------------------------------------' );
1430
+ wcf()->logger->import_log( 'STARTED! Creating Blank STEP for Flow ' . $flow_id );
1431
+
1432
+ $step_type_title = str_replace( '-', ' ', $step_type );
1433
+ $step_type_slug = strtolower( str_replace( '-', ' ', $step_type ) );
1434
+
1435
+ $new_step_id = wp_insert_post(
1436
+ array(
1437
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1438
+ 'post_title' => $step_title,
1439
+ 'post_content' => '',
1440
+ 'post_status' => 'publish',
1441
+ )
1442
+ );
1443
+
1444
+ // insert post meta.
1445
+ update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
1446
+
1447
+ $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
1448
+ $term_exist = term_exists( $step_type_slug, $taxonomy );
1449
+
1450
+ if ( empty( $term_exist ) ) {
1451
+ $terms = array(
1452
+ array(
1453
+ 'name' => $step_type_title,
1454
+ 'slug' => $step_type_slug,
1455
+ ),
1456
+ );
1457
+
1458
+ Cartflows_Step_Post_Type::get_instance()->add_terms( $taxonomy, $terms );
1459
+ wcf()->logger->import_log( '(✓) Created new term name ' . $step_type_title . ' | term slug ' . $step_type_slug );
1460
+ }
1461
+
1462
+ $current_term = term_exists( $step_type_slug, $taxonomy );
1463
+
1464
+ // Set type object.
1465
+ $data = get_term( $current_term['term_id'], $taxonomy );
1466
+ $step_slug = $data->slug;
1467
+ wp_set_object_terms( $new_step_id, $data->slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
1468
+ wcf()->logger->import_log( '(✓) Assigned existing term ' . $step_type_title . ' to the template ' . $new_step_id );
1469
+
1470
+ // Set Default page Layout.
1471
+ update_post_meta( $new_step_id, '_wp_page_template', 'cartflows-default' );
1472
+
1473
+ // Set type.
1474
+ update_post_meta( $new_step_id, 'wcf-step-type', $data->slug );
1475
+ wcf()->logger->import_log( '(✓) Updated term ' . $data->name . ' to the post meta wcf-step-type.' );
1476
+
1477
+ // Set flow.
1478
+ wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1479
+ wcf()->logger->import_log( '(✓) Assigned flow step flow-' . $flow_id );
1480
+
1481
+ self::get_instance()->set_step_to_flow( $flow_id, $new_step_id, $step_type_title, $step_slug );
1482
+
1483
+ wcf()->logger->import_log( 'COMPLETE! Creating Blank STEP for Flow ' . $flow_id );
1484
+ wcf()->logger->import_log( '------------------------------------' );
1485
+
1486
+ wp_send_json_success( $new_step_id );
1487
+ }
1488
+
1489
+ /**
1490
+ * Import Post Meta
1491
+ *
1492
+ * @since 1.0.0
1493
+ *
1494
+ * @param integer $post_id Post ID.
1495
+ * @param array $response Post meta.
1496
+ * @return void
1497
+ */
1498
+ public static function import_post_meta( $post_id, $response ) {
1499
+
1500
+ $metadata = (array) $response['post_meta'];
1501
+
1502
+ foreach ( $metadata as $meta_key => $meta_value ) {
1503
+ $meta_value = isset( $meta_value[0] ) ? $meta_value[0] : '';
1504
+
1505
+ if ( $meta_value ) {
1506
+
1507
+ if ( is_serialized( $meta_value, true ) ) {
1508
+ $raw_data = maybe_unserialize( stripslashes( $meta_value ) );
1509
+ } elseif ( is_array( $meta_value ) ) {
1510
+ $raw_data = json_decode( stripslashes( $meta_value ), true );
1511
+ } else {
1512
+ $raw_data = $meta_value;
1513
+ }
1514
+
1515
+ if ( '_elementor_data' === $meta_key ) {
1516
+ if ( is_array( $raw_data ) ) {
1517
+ $raw_data = wp_slash( wp_json_encode( $raw_data ) );
1518
+ } else {
1519
+ $raw_data = wp_slash( $raw_data );
1520
+ }
1521
+ }
1522
+ if ( '_elementor_data' !== $meta_key && '_elementor_draft' !== $meta_key && '_fl_builder_data' !== $meta_key && '_fl_builder_draft' !== $meta_key ) {
1523
+ if ( is_array( $raw_data ) ) {
1524
+ wcf()->logger->import_log( '(✓) Added post meta ' . $meta_key . ' | ' . wp_json_encode( $raw_data ) );
1525
+ } else {
1526
+ if ( ! is_object( $raw_data ) ) {
1527
+ wcf()->logger->import_log( '(✓) Added post meta ' . $meta_key . ' | ' . $raw_data );
1528
+ }
1529
+ }
1530
+ }
1531
+
1532
+ update_post_meta( $post_id, $meta_key, $raw_data );
1533
+ }
1534
+ }
1535
+ }
1536
+
1537
+ /**
1538
+ * Import Template for Elementor
1539
+ *
1540
+ * @since 1.0.0
1541
+ *
1542
+ * @param integer $post_id Post ID.
1543
+ * @param array $response Post meta.
1544
+ * @param array $page_build_data Page build data.
1545
+ * @return void
1546
+ */
1547
+ public static function import_template_elementor( $post_id, $response, $page_build_data ) {
1548
+ if ( ! is_plugin_active( 'elementor/elementor.php' ) ) {
1549
+ $data = __( 'Elementor is not activated. Please activate plugin Elementor Page Builder to import the step.', 'cartflows' );
1550
+ wcf()->logger->import_log( $data );
1551
+ wp_send_json_error( $data );
1552
+ }
1553
+
1554
+ require_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-importer-elementor.php';
1555
+
1556
+ wcf()->logger->import_log( '# Started "importing page builder data" for step ' . $post_id );
1557
+
1558
+ $obj = new \Elementor\TemplateLibrary\CartFlows_Importer_Elementor();
1559
+ $obj->import_single_template( $post_id );
1560
+
1561
+ wcf()->logger->import_log( '# Complete "importing page builder data" for step ' . $post_id );
1562
+ }
1563
+
1564
+ /**
1565
+ * Supported post types
1566
+ *
1567
+ * @since 1.0.0
1568
+ *
1569
+ * @return array Supported post types.
1570
+ */
1571
+ public static function supported_post_types() {
1572
+ return apply_filters(
1573
+ 'cartflows_supported_post_types',
1574
+ array(
1575
+ CARTFLOWS_FLOW_POST_TYPE,
1576
+ )
1577
+ );
1578
+ }
1579
+
1580
+ /**
1581
+ * Check supported post type
1582
+ *
1583
+ * @since 1.0.0
1584
+ *
1585
+ * @param string $post_type Post type.
1586
+ * @return boolean Supported post type status.
1587
+ */
1588
+ public static function is_supported_post( $post_type = '' ) {
1589
+
1590
+ if ( in_array( $post_type, self::supported_post_types(), true ) ) {
1591
+ return true;
1592
+ }
1593
+
1594
+ return false;
1595
+ }
1596
+
1597
+ /**
1598
+ * Set steps to the flow
1599
+ *
1600
+ * @param integer $flow_id Flow ID.
1601
+ * @param integer $new_step_id New step ID.
1602
+ * @param string $step_title Flow Type.
1603
+ * @param string $step_slug Flow Type.
1604
+ */
1605
+ public function set_step_to_flow( $flow_id, $new_step_id, $step_title, $step_slug ) {
1606
+ // Update steps for the current flow.
1607
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
1608
+
1609
+ if ( ! is_array( $flow_steps ) ) {
1610
+ $flow_steps = array();
1611
+ }
1612
+
1613
+ $flow_steps[] = array(
1614
+ 'id' => $new_step_id,
1615
+ 'title' => $step_title,
1616
+ 'type' => $step_slug,
1617
+ );
1618
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1619
+ wcf()->logger->import_log( '(✓) Updated flow steps post meta key \'wcf-steps\' ' . wp_json_encode( $flow_steps ) );
1620
+ }
1621
+
1622
+ /**
1623
+ * Localize variables in admin
1624
+ *
1625
+ * @param array $vars variables.
1626
+ */
1627
+ public function localize_vars( $vars ) {
1628
+
1629
+ $ajax_actions = array(
1630
+ 'cf_step_import',
1631
+ 'cf_load_steps',
1632
+ 'cf_create_flow',
1633
+ 'cf_default_flow',
1634
+ 'cf_step_create_blank',
1635
+ 'cf_import_flow_step',
1636
+ );
1637
+
1638
+ foreach ( $ajax_actions as $action ) {
1639
+
1640
+ $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
1641
+ }
1642
+
1643
+ return $vars;
1644
+ }
1645
+
1646
+ /**
1647
+ * Ajax action to activate plugin
1648
+ */
1649
+ public function activate_plugin() {
1650
+
1651
+ if ( ! check_ajax_referer( 'cartflows_activate_plugin', 'security', false ) ) {
1652
+ wp_send_json_error( esc_html__( 'Action failed. Invalid Security Nonce.', 'cartflows' ) );
1653
+ }
1654
+
1655
+ if ( ! current_user_can( 'activate_plugins' ) ) {
1656
+ wp_send_json_error(
1657
+ array(
1658
+ 'success' => false,
1659
+ 'message' => __( 'User have not plugin install permissions.', 'cartflows' ),
1660
+ )
1661
+ );
1662
+ }
1663
+
1664
+ $plugin_init = isset( $_POST['plugin_init'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin_init'] ) ) : '';
1665
+
1666
+ $activate = activate_plugin( $plugin_init, '', false, true );
1667
+
1668
+ if ( is_wp_error( $activate ) ) {
1669
+ wp_send_json_error(
1670
+ array(
1671
+ 'success' => false,
1672
+ 'message' => $activate->get_error_message(),
1673
+ 'init' => $plugin_init,
1674
+ )
1675
+ );
1676
+ }
1677
+
1678
+ wp_send_json_success(
1679
+ array(
1680
+ 'success' => true,
1681
+ 'message' => __( 'Plugin Successfully Activated', 'cartflows' ),
1682
+ 'init' => $plugin_init,
1683
+ )
1684
+ );
1685
+ }
1686
+
1687
+ }
1688
+
1689
+ /**
1690
+ * Initialize class object with 'get_instance()' method
1691
+ */
1692
+ CartFlows_Importer::get_instance();
1693
+
1694
+ endif;
classes/class-cartflows-learndash-compatibility.php CHANGED
@@ -1,140 +1,140 @@
1
- <?php
2
- /**
3
- * LearnDash compatibility
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Class for LearnDash compatibility
10
- */
11
- class Cartflows_Learndash_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
- add_filter( 'learndash_post_args', array( $this, 'cartflows_course_setting_fields' ) );
35
- add_action( 'template_redirect', array( $this, 'cartflows_override_course_template' ) );
36
-
37
- }
38
-
39
- /**
40
- * Override course cartflows template.
41
- *
42
- * @return bool
43
- */
44
- public function cartflows_override_course_template() {
45
-
46
- // Don't run any code in admin area.
47
- if ( is_admin() ) {
48
- return false;
49
- }
50
-
51
- // Don't override the template if the post type is not `course`.
52
- if ( ! is_singular( 'sfwd-courses' ) ) {
53
- return false;
54
- }
55
-
56
- $course_id = learndash_get_course_id();
57
- $user_id = get_current_user_id();
58
- if ( is_user_logged_in() && sfwd_lms_has_access( $course_id, $user_id ) ) {
59
- return false;
60
- }
61
-
62
- if ( defined( LEARNDASH_VERSION ) && version_compare( LEARNDASH_VERSION, '2.6.4', '>' ) ) {
63
-
64
- $template = learndash_get_course_meta_setting( get_the_id(), 'wcf_course_template' );
65
- } else {
66
-
67
- $template = get_course_meta_setting( get_the_id(), 'wcf_course_template' );
68
- }
69
-
70
- if ( 'none' !== $template && $template ) {
71
- $link = get_permalink( $template );
72
- wp_safe_redirect( $link );
73
- }
74
- }
75
-
76
- /**
77
- * Add settings inside learndash settings.
78
- *
79
- * @param array $fields fields.
80
- * @return mixed
81
- */
82
- public function cartflows_course_setting_fields( $fields ) {
83
- global $post;
84
-
85
- $all_posts = array(
86
- 'none' => __( 'None', 'cartflows' ),
87
- );
88
-
89
- $landing_steps = get_posts(
90
- array(
91
- 'posts_per_page' => -1,
92
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
93
- 'post_status' => 'publish',
94
- 'orderby' => 'ID',
95
- 'order' => 'DESC',
96
- 'meta_query' => array( //phpcs:ignore
97
- array(
98
- 'key' => 'wcf-step-type',
99
- 'value' => array( 'landing', 'checkout' ),
100
- 'compare' => 'IN',
101
- ),
102
- ),
103
- )
104
- );
105
-
106
- foreach ( $landing_steps as $landing_step ) {
107
- $all_posts[ $landing_step->ID ] = get_the_title( $landing_step->ID ) . ' ( #' . $landing_step->ID . ')';
108
- }
109
-
110
- $selected = get_post_meta( get_the_ID(), 'wcf_course_template', true );
111
- $description = sprintf(
112
- /* translators: 1: anchor start, 2: anchor close */
113
- __( 'Non-enrolled students will redirect to the selected CartFlows template. If you have not created any Flow already, add new Flow from %1$shere%2$s.', 'cartflows' ),
114
- '<a href="' . esc_url( admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&add-new-flow' ) ) . '">',
115
- '</a>'
116
- );
117
-
118
- $fields['sfwd-courses']['fields']['wcf_course_template'] = array(
119
- 'name' => __( 'Select CartFlows Template for this Course', 'cartflows' ),
120
- 'type' => 'select',
121
- 'initial_options' => $all_posts,
122
- 'default' => 'none',
123
- 'help_text' => $description,
124
- 'show_in_rest' => true,
125
- 'rest_args' => array(
126
- 'schema' => array(
127
- 'type' => 'string',
128
- ),
129
- ),
130
- );
131
-
132
- return $fields;
133
- }
134
-
135
- }
136
-
137
- /**
138
- * Kicking this off by calling 'get_instance()' method
139
- */
140
- Cartflows_Learndash_Compatibility::get_instance();
1
+ <?php
2
+ /**
3
+ * LearnDash compatibility
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Class for LearnDash compatibility
10
+ */
11
+ class Cartflows_Learndash_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
+ add_filter( 'learndash_post_args', array( $this, 'cartflows_course_setting_fields' ) );
35
+ add_action( 'template_redirect', array( $this, 'cartflows_override_course_template' ) );
36
+
37
+ }
38
+
39
+ /**
40
+ * Override course cartflows template.
41
+ *
42
+ * @return bool
43
+ */
44
+ public function cartflows_override_course_template() {
45
+
46
+ // Don't run any code in admin area.
47
+ if ( is_admin() ) {
48
+ return false;
49
+ }
50
+
51
+ // Don't override the template if the post type is not `course`.
52
+ if ( ! is_singular( 'sfwd-courses' ) ) {
53
+ return false;
54
+ }
55
+
56
+ $course_id = learndash_get_course_id();
57
+ $user_id = get_current_user_id();
58
+ if ( is_user_logged_in() && sfwd_lms_has_access( $course_id, $user_id ) ) {
59
+ return false;
60
+ }
61
+
62
+ if ( defined( LEARNDASH_VERSION ) && version_compare( LEARNDASH_VERSION, '2.6.4', '>' ) ) {
63
+
64
+ $template = learndash_get_course_meta_setting( get_the_id(), 'wcf_course_template' );
65
+ } else {
66
+
67
+ $template = get_course_meta_setting( get_the_id(), 'wcf_course_template' );
68
+ }
69
+
70
+ if ( 'none' !== $template && $template ) {
71
+ $link = get_permalink( $template );
72
+ wp_safe_redirect( $link );
73
+ }
74
+ }
75
+
76
+ /**
77
+ * Add settings inside learndash settings.
78
+ *
79
+ * @param array $fields fields.
80
+ * @return mixed
81
+ */
82
+ public function cartflows_course_setting_fields( $fields ) {
83
+ global $post;
84
+
85
+ $all_posts = array(
86
+ 'none' => __( 'None', 'cartflows' ),
87
+ );
88
+
89
+ $landing_steps = get_posts(
90
+ array(
91
+ 'posts_per_page' => -1,
92
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
93
+ 'post_status' => 'publish',
94
+ 'orderby' => 'ID',
95
+ 'order' => 'DESC',
96
+ 'meta_query' => array( //phpcs:ignore
97
+ array(
98
+ 'key' => 'wcf-step-type',
99
+ 'value' => array( 'landing', 'checkout' ),
100
+ 'compare' => 'IN',
101
+ ),
102
+ ),
103
+ )
104
+ );
105
+
106
+ foreach ( $landing_steps as $landing_step ) {
107
+ $all_posts[ $landing_step->ID ] = get_the_title( $landing_step->ID ) . ' ( #' . $landing_step->ID . ')';
108
+ }
109
+
110
+ $selected = get_post_meta( get_the_ID(), 'wcf_course_template', true );
111
+ $description = sprintf(
112
+ /* translators: 1: anchor start, 2: anchor close */
113
+ __( 'Non-enrolled students will redirect to the selected CartFlows template. If you have not created any Flow already, add new Flow from %1$shere%2$s.', 'cartflows' ),
114
+ '<a href="' . esc_url( admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&add-new-flow' ) ) . '">',
115
+ '</a>'
116
+ );
117
+
118
+ $fields['sfwd-courses']['fields']['wcf_course_template'] = array(
119
+ 'name' => __( 'Select CartFlows Template for this Course', 'cartflows' ),
120
+ 'type' => 'select',
121
+ 'initial_options' => $all_posts,
122
+ 'default' => 'none',
123
+ 'help_text' => $description,
124
+ 'show_in_rest' => true,
125
+ 'rest_args' => array(
126
+ 'schema' => array(
127
+ 'type' => 'string',
128
+ ),
129
+ ),
130
+ );
131
+
132
+ return $fields;
133
+ }
134
+
135
+ }
136
+
137
+ /**
138
+ * Kicking this off by calling 'get_instance()' method
139
+ */
140
+ Cartflows_Learndash_Compatibility::get_instance();
classes/class-cartflows-loader.php CHANGED
@@ -118,7 +118,7 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
118
  define( 'CARTFLOWS_BASE', plugin_basename( CARTFLOWS_FILE ) );
119
  define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
120
  define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
121
- define( 'CARTFLOWS_VER', '1.3.5' );
122
  define( 'CARTFLOWS_SLUG', 'cartflows' );
123
  define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
124
 
@@ -194,11 +194,9 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
194
  return;
195
  }
196
 
197
- if ( version_compare( CARTFLOWS_PRO_VER, '1.2.0', '<' ) ) {
198
  add_action( 'admin_notices', array( $this, 'required_cartflows_pro_notice' ) );
199
  }
200
-
201
- $this->licence_setup();
202
  }
203
 
204
  /**
@@ -210,7 +208,7 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
210
  */
211
  public function required_cartflows_pro_notice() {
212
 
213
- $required_pro_version = '1.2.0';
214
 
215
  $class = 'notice notice-warning';
216
  /* translators: %s: html tags */
@@ -219,23 +217,6 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
219
  printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
220
  }
221
 
222
- /**
223
- * Licence Setup Fallback.
224
- *
225
- * @since 1.1.16
226
- *
227
- * @return void
228
- */
229
- public function licence_setup() {
230
-
231
- if ( version_compare( CARTFLOWS_PRO_VER, '1.1.13', '<' ) ) {
232
-
233
- if ( method_exists( 'Cartflows_Pro_Loader', 'licence_setup' ) ) {
234
- wcf_pro()->licence_setup();
235
- }
236
- }
237
- }
238
-
239
  /**
240
  * Load Helper Files and Components.
241
  *
@@ -325,6 +306,7 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
325
  if ( $this->is_woo_active ) {
326
  include_once CARTFLOWS_DIR . 'modules/checkout/class-cartflows-checkout.php';
327
  include_once CARTFLOWS_DIR . 'modules/thankyou/class-cartflows-thankyou.php';
 
328
  }
329
 
330
  include_once CARTFLOWS_DIR . 'classes/class-cartflows-api.php';
118
  define( 'CARTFLOWS_BASE', plugin_basename( CARTFLOWS_FILE ) );
119
  define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
120
  define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
121
+ define( 'CARTFLOWS_VER', '1.4.1' );
122
  define( 'CARTFLOWS_SLUG', 'cartflows' );
123
  define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
124
 
194
  return;
195
  }
196
 
197
+ if ( version_compare( CARTFLOWS_PRO_VER, '1.4.0', '<' ) ) {
198
  add_action( 'admin_notices', array( $this, 'required_cartflows_pro_notice' ) );
199
  }
 
 
200
  }
201
 
202
  /**
208
  */
209
  public function required_cartflows_pro_notice() {
210
 
211
+ $required_pro_version = '1.4.0';
212
 
213
  $class = 'notice notice-warning';
214
  /* translators: %s: html tags */
217
  printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
218
  }
219
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  /**
221
  * Load Helper Files and Components.
222
  *
306
  if ( $this->is_woo_active ) {
307
  include_once CARTFLOWS_DIR . 'modules/checkout/class-cartflows-checkout.php';
308
  include_once CARTFLOWS_DIR . 'modules/thankyou/class-cartflows-thankyou.php';
309
+ include_once CARTFLOWS_DIR . 'modules/optin/class-cartflows-optin.php';
310
  }
311
 
312
  include_once CARTFLOWS_DIR . 'classes/class-cartflows-api.php';
classes/class-cartflows-meta-fields.php CHANGED
@@ -1,1491 +1,816 @@
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', '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
- $attr = '';
817
-
818
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
819
-
820
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
821
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
822
- }
823
- }
824
-
825
- $field_content = '<textarea name="' . $field_data['name'] . '" rows="10" cols="50" ' . $attr . '>';
826
- $field_content .= $value;
827
- $field_content .= '</textarea>';
828
-
829
- return $this->get_field( $field_data, $field_content );
830
- }
831
-
832
- function get_only_checkbox_field( $field_data ) {
833
- // echo "<pre>";
834
- // var_dump($field_data);
835
- // echo "</pre>";
836
-
837
- $value = $field_data['value'];
838
-
839
-
840
- $field_content = '';
841
- if ( isset( $field_data['before'] ) ) {
842
- $field_content .= '<span>' . $field_data['before'] . '</span>';
843
- }
844
- $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
845
- $field_content .= '<input type="checkbox" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . '>';
846
-
847
- if ( isset( $field_data['after'] ) ) {
848
- $field_content .= '<span>' . $field_data['after'] . '</span>';
849
- }
850
-
851
- if ( isset( $field_data['after_html'] ) ) {
852
- $field_content .= '<span>' . $field_data['after_html'] . '</span>';
853
- }
854
-
855
- return $field_content;
856
- }
857
-
858
- function get_checkbox_field( $field_data ) {
859
-
860
- $value = $field_data['value'];
861
-
862
- $field_content = '';
863
- if ( isset( $field_data['before'] ) ) {
864
- $field_content .= '<span>' . $field_data['before'] . '</span>';
865
- }
866
- $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
867
- $field_content .= '<input type="checkbox" id="'.$field_data['name'].'" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . '>';
868
-
869
- if ( isset( $field_data['after'] ) ) {
870
- $field_content .= '<span>' . $field_data['after'] . '</span>';
871
- }
872
-
873
- return $this->get_field( $field_data, $field_content );
874
- }
875
-
876
- function get_radio_field( $field_data ) {
877
-
878
- $value = $field_data['value'];
879
- $field_content = '';
880
-
881
- if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
882
-
883
- foreach ( $field_data['options'] as $data_key => $data_value ) {
884
-
885
- $field_content .= '<div class="wcf-radio-option">';
886
- $field_content .= '<input type="radio" name="' . $field_data['name'] . '" value="' . $data_key . '" ' . checked( $data_key, $value, false ) . '>';
887
- $field_content .= $data_value;
888
- $field_content .= '</div>';
889
- }
890
- }
891
-
892
- return $this->get_field( $field_data, $field_content );
893
- }
894
-
895
- function get_font_family_field( $field_data ) {
896
-
897
- $value = $field_data['value'];
898
-
899
- $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
900
-
901
- $field_content = '<select class="wcf-field-font-family" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
902
-
903
- $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
904
-
905
- $field_content .= '<optgroup label="Other System Fonts">';
906
- foreach ( CartFlows_Font_Families::get_system_fonts() as $name => $variants ) {
907
- $field_content .= '<option value="' . esc_attr( $name ) . '" ' . selected( $name, $value, false ) . '>' . esc_attr( $name ) . '</option>';
908
- }
909
- $field_content .= '</optgroup>';
910
- $field_content .= '<optgroup label="Google">';
911
- foreach ( CartFlows_Font_Families::get_google_fonts() as $name => $single_font ) {
912
- $variants = wcf_get_prop( $single_font, '0' );
913
- $category = wcf_get_prop( $single_font, '1' );
914
- $font_value = '\'' . esc_attr( $name ) . '\', ' . esc_attr( $category );
915
- $field_content .= '<option value="' . esc_attr( $font_value ) . '" ' . selected( $font_value, $value, false ) . '>' . esc_attr( $name ) . '</option>';
916
- }
917
- $field_content .= '</optgroup>';
918
-
919
- $field_content .= '</select>';
920
-
921
- return $this->get_field( $field_data, $field_content );
922
- }
923
-
924
- function get_font_weight_field( $field_data ) {
925
-
926
- $value = $field_data['value'];
927
-
928
- $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
929
-
930
- $field_content = '<select data-selected="'.esc_attr( $value ).'" class="wcf-field-font-weight" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
931
-
932
- $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
933
-
934
- $field_content .= '</select>';
935
-
936
- return $this->get_field( $field_data, $field_content );
937
- }
938
-
939
- function get_select_field( $field_data ) {
940
-
941
- $value = $field_data['value'];
942
- $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
943
-
944
- $field_content = '<select name="' . $field_data['name'] . '">';
945
-
946
-
947
- if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
948
-
949
- foreach ( $field_data['options'] as $data_key => $data_value ) {
950
-
951
- $disabled = '';
952
-
953
- if ( array_key_exists( $data_key, $pro_options ) ) {
954
- $disabled = 'disabled ';
955
- $data_value = $pro_options[ $data_key ];
956
- }
957
-
958
- $field_content .= '<option value="' . $data_key . '" ' . selected( $value, $data_key, false ) . ' ' . $disabled .'>' . $data_value . '</option>';
959
- }
960
- }
961
-
962
- $field_content .= '</select>';
963
-
964
- if ( isset( $field_data['after'] ) ) {
965
- $field_content .= '<span>' . $field_data['after'] . '</span>';
966
- }
967
-
968
- return $this->get_field( $field_data, $field_content );
969
- }
970
-
971
- function get_color_picker_field( $field_data ) {
972
-
973
- $value = $field_data['value'];
974
-
975
- $field_content = '<input class="wcf-color-picker" type="text" name="' . $field_data['name'] . '" value="' . $value . '">';
976
-
977
- return $this->get_field( $field_data, $field_content );
978
- }
979
-
980
- function get_product_selection_field( $field_data ) {
981
-
982
- $value = $field_data['value'];
983
-
984
- $multiple = '';
985
-
986
- if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
987
- $multiple = ' multiple="multiple"';
988
- }
989
-
990
- $allow_clear = '';
991
-
992
- if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
993
- $allow_clear = ' data-allow_clear="allow_clear"';
994
- }
995
-
996
- $field_content = '<select
997
- name="' . $field_data['name'] . '[]"
998
- class="wcf-product-search" ' . $multiple . $allow_clear . '
999
- data-placeholder="' . __( 'Search for a product&hellip;', 'cartflows' ) . '"
1000
- data-action="woocommerce_json_search_products_and_variations">';
1001
-
1002
- if ( is_array( $value ) && ! empty( $value ) ) {
1003
-
1004
- foreach ( $value as $data_key => $product_id ) {
1005
-
1006
- $product = wc_get_product( $product_id );
1007
-
1008
- // posts.
1009
- if ( ! empty( $product ) ) {
1010
- $post_title = $product->get_name() . ' (#' . $product_id . ')';
1011
-
1012
- $field_content .= '<option value="' . $product_id . '" selected="selected" >' . $post_title . '</option>';
1013
- }
1014
- }
1015
- }
1016
- $field_content .= '</select>';
1017
-
1018
- return $this->get_field( $field_data, $field_content );
1019
- }
1020
-
1021
- function get_coupon_selection_field( $field_data ) {
1022
-
1023
- $value = $field_data['value'];
1024
-
1025
- $multiple = '';
1026
-
1027
- if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
1028
- $multiple = ' multiple="multiple"';
1029
- }
1030
-
1031
- $allow_clear = '';
1032
-
1033
- if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
1034
- $allow_clear = ' data-allow_clear="allow_clear"';
1035
- }
1036
-
1037
- $field_content = '<select
1038
- name="' . $field_data['name'] . '[]"
1039
- class="wc-coupon-search wcf-coupon-search" ' . $multiple . $allow_clear . '
1040
- data-placeholder="' . __( 'Search for a coupon&hellip;', 'cartflows' ) . '"
1041
- data-action="wcf_json_search_coupons">';
1042
-
1043
- if ( is_array( $value ) && ! empty( $value ) ) {
1044
-
1045
- $all_discount_types = wc_get_coupon_types();
1046
-
1047
- foreach ( $value as $coupon_title ) {
1048
-
1049
- $coupon = new WC_Coupon( $coupon_title );
1050
-
1051
- $discount_type = $coupon->get_discount_type();
1052
-
1053
- if ( isset( $discount_type ) && $discount_type ) {
1054
- $discount_type = ' ( Type: ' . $all_discount_types[ $discount_type ] . ' )';
1055
- }
1056
-
1057
- $field_content .= '<option value="' . $coupon_title . '" selected="selected">' . $coupon_title . $discount_type . '</option>';
1058
- }
1059
- }
1060
-
1061
- $field_content .= '</select>';
1062
-
1063
- return $this->get_field( $field_data, $field_content );
1064
- }
1065
-
1066
- function get_page_selection_field( $field_data ) {
1067
-
1068
- $value = $field_data['value'];
1069
-
1070
- $multiple = '';
1071
-
1072
- if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
1073
- $multiple = 'multiple="multiple"';
1074
- }
1075
-
1076
- $field_content = '<select
1077
- name="' . $field_data['name'] . '[]"
1078
- class="wcf-search-pages" ' . $multiple . '"
1079
- data-action="wcf_json_search_pages">';
1080
-
1081
- if ( is_array( $value ) && ! empty( $value ) ) {
1082
-
1083
- foreach ( $value as $data_key => $data_value ) {
1084
-
1085
- $field_content .= '<option value="' . $data_value . '">' . get_the_title( $data_value ) . '</option>';
1086
- }
1087
- }
1088
-
1089
- $field_content .= '</select>';
1090
-
1091
- return $this->get_field( $field_data, $field_content );
1092
- }
1093
-
1094
- function get_section( $field_data ) {
1095
- $field_html = '<div class="wcf-field-row wcf-field-section">';
1096
- $field_html .= '<div class="wcf-field-section-heading" colspan="2">';
1097
- $field_html .= '<label>' . esc_html( $field_data['label'] ) . '</label>';
1098
-
1099
- if ( isset( $field_data['help'] ) ) {
1100
- $field_html .= '<i class="wcf-field-heading-help dashicons dashicons-editor-help" title="' . esc_attr( $field_data['help'] ) . '"></i>';
1101
- }
1102
- $field_html .= '</div>';
1103
- $field_html .= '</div>';
1104
- return $field_html;
1105
- }
1106
-
1107
- function get_description_field( $field_data ) {
1108
-
1109
- $field_html = '<div class="wcf-field-row wcf-field-desc ' . $field_data['name'] . '">';
1110
- $field_html .= '<div class="wcf-field-desc-content">';
1111
- $field_html .= $field_data['content'];
1112
- $field_html .= '</div>';
1113
- $field_html .= '</div>';
1114
-
1115
- return $field_html;
1116
- }
1117
-
1118
- function get_checkout_field_repeater( $field_data ) {
1119
-
1120
- $value = array();
1121
-
1122
- $value[0] = array(
1123
- 'add_to' => '',
1124
- 'type' => '',
1125
- 'label' => '',
1126
- 'name' => '',
1127
- );
1128
-
1129
- $field_content = '';
1130
-
1131
- $field_content .= '<div class="wcf-field-row">';
1132
- // $field_content .= '<div class="wcf-field-row-heading">';
1133
- // $field_content .= '<label>' . esc_html( $field_data['label'] ) . '</label>';
1134
- // $field_content .= '</div>';
1135
- $field_content .= '<div class="wcf-field-row-content">';
1136
- $field_content .= '<div class="wcf-cpf-wrap">';
1137
-
1138
- foreach ( $value as $p_key => $p_data ) {
1139
- $field_content .= '<div class="wcf-cpf-row" data-key="' . $p_key . '">';
1140
- $field_content .= '<div class="wcf-cpf-row-header">';
1141
- $field_content .= '<span class="wcf-cpf-row-title">Add New Custom Field</span>';
1142
- $field_content .= '</div>';
1143
-
1144
- $field_content .= '<div class="wcf-cpf-row-standard-fields">';
1145
-
1146
- /* Add To */
1147
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-add_to">';
1148
- $field_content .= '<span class="wcf-cpf-row-setting-label">Add to</span>';
1149
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
1150
- $field_content .= '<select name="wcf-checkout-custom-fields[' . $p_key . '][add_to]" class="wcf-cpf-add_to">';
1151
- $field_content .= '<option value="billing">Billing</option>';
1152
- $field_content .= '<option value="shipping">Shipping</option>';
1153
- $field_content .= '</select>';
1154
- $field_content .= '</span>';
1155
- $field_content .= '</div>';
1156
-
1157
- /* Type */
1158
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-type">';
1159
- $field_content .= '<span class="wcf-cpf-row-setting-label">Type</span>';
1160
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
1161
- $field_content .= '<select name="wcf-checkout-custom-fields[' . $p_key . '][type]" class="wcf-cpf-type">';
1162
- $field_content .= '<option value="text">Text</option>';
1163
- $field_content .= '<option value="textarea">Textarea</option>';
1164
- $field_content .= '<option value="select">Select</option>';
1165
- $field_content .= '<option value="checkbox">Checkbox</option>';
1166
- $field_content .= '</select>';
1167
- $field_content .= '</span>';
1168
- $field_content .= '</div>';
1169
-
1170
- /* Textarea */
1171
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-options">';
1172
- $field_content .= '<span class="wcf-cpf-row-setting-label">Options *</span>';
1173
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
1174
- $field_content .= '<textarea value="" name="wcf-checkout-custom-fields[' . $p_key . '][label]" class="wcf-cpf-options" placeholder="Enter your options separated by comma."></textarea>';
1175
- $field_content .= '</span>';
1176
- $field_content .= '</div>';
1177
-
1178
- /* Label */
1179
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-label">';
1180
- $field_content .= '<span class="wcf-cpf-row-setting-label">Label *</span>';
1181
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
1182
- $field_content .= '<input type="text" value="" name="wcf-checkout-custom-fields[' . $p_key . '][label]" class="wcf-cpf-label">';
1183
- $field_content .= '</span>';
1184
- $field_content .= '</div>';
1185
-
1186
- /* Name */
1187
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-name">';
1188
- $field_content .= '<span class="wcf-cpf-row-setting-label">Name *</span>';
1189
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
1190
- $field_content .= '<input type="text" value="" name="wcf-checkout-custom-fields[' . $p_key . '][name]" class="wcf-cpf-name">';
1191
- $field_content .= '</span>';
1192
- $field_content .= '</div>';
1193
-
1194
- $field_content .= '</div>';
1195
- $field_content .= '</div>';
1196
- }
1197
-
1198
- /* Add New Custom Field */
1199
- $field_content .= '<div class="wcf-cpf-add-row">';
1200
- $field_content .= '<div class="wcf-cpf-add-wrap">';
1201
- $field_content .= '<button class="button button-secondary wcf-cpf-add" data-name="wcf-checkout-custom-fields">Add New Field</button>';
1202
- $field_content .= '</div>';
1203
- $field_content .= '</div>';
1204
- /* End Add new custom field */
1205
-
1206
- $field_content .= '</div>';
1207
- $field_content .= '</div>';
1208
- $field_content .= '</div>';
1209
-
1210
- return $field_content;
1211
- }
1212
-
1213
- function get_pro_checkout_field_repeater( $field_data ) {
1214
-
1215
- $value = array();
1216
-
1217
- $value[0] = array(
1218
- 'add_to' => '',
1219
- 'type' => '',
1220
- 'label' => '',
1221
- 'name' => '',
1222
- );
1223
-
1224
- $field_content = '';
1225
-
1226
- $field_content .= '<div class="wcf-field-row">';
1227
- // $field_content .= '<div class="wcf-field-row-heading">';
1228
- // $field_content .= '<label>' . esc_html( $field_data['label'] ) . '</label>';
1229
- // $field_content .= '</div>';
1230
- $field_content .= '<div class="wcf-field-row-content">';
1231
- $field_content .= '<div class="wcf-cpf-wrap">';
1232
-
1233
- foreach ( $value as $p_key => $p_data ) {
1234
- $field_content .= '<div class="wcf-cpf-row" data-key="' . $p_key . '">';
1235
- $field_content .= '<div class="wcf-cpf-row-header">';
1236
- $field_content .= '<span class="wcf-cpf-row-title">Add New Custom Field</span>';
1237
- $field_content .= '</div>';
1238
-
1239
- $field_content .= '<div class="wcf-cpf-row-standard-fields">';
1240
-
1241
- /* Add To */
1242
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-add_to">';
1243
- $field_content .= '<span class="wcf-cpf-row-setting-label">Add to</span>';
1244
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
1245
- $field_content .= '<select name="wcf-checkout-custom-fields[' . $p_key . '][add_to]" class="wcf-cpf-add_to">';
1246
- $field_content .= '<option value="billing">Billing</option>';
1247
- $field_content .= '<option value="shipping">Shipping</option>';
1248
- $field_content .= '</select>';
1249
- $field_content .= '</span>';
1250
- $field_content .= '</div>';
1251
-
1252
- /* Type */
1253
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-type">';
1254
- $field_content .= '<span class="wcf-cpf-row-setting-label">Type</span>';
1255
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
1256
- $field_content .= '<select name="wcf-checkout-custom-fields[' . $p_key . '][type]" class="wcf-cpf-type">';
1257
- $field_content .= '<option value="text">Text</option>';
1258
- $field_content .= '<option value="textarea">Textarea</option>';
1259
- $field_content .= '<option value="select">Select</option>';
1260
- $field_content .= '<option value="checkbox">Checkbox</option>';
1261
- $field_content .= '<option value="hidden">Hidden</option>';
1262
- $field_content .= '</select>';
1263
- $field_content .= '</span>';
1264
- $field_content .= '</div>';
1265
-
1266
- /* Label */
1267
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-label">';
1268
- $field_content .= '<span class="wcf-cpf-row-setting-label">Label <i>*</i></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 . '][label]" class="wcf-cpf-label">';
1271
- $field_content .= '<span id="wcf-cpf-label-error-msg"></span>';
1272
- $field_content .= '</span>';
1273
- $field_content .= '</div>';
1274
-
1275
- /* Default */
1276
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-default">';
1277
- $field_content .= '<span class="wcf-cpf-row-setting-label">Default</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 . '][default]" class="wcf-cpf-default">';
1280
- $field_content .= '<span id="wcf-cpf-default-error-msg"></span>';
1281
- $field_content .= '</span>';
1282
- $field_content .= '</div>';
1283
-
1284
- /* Placeholder */
1285
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-placeholder">';
1286
- $field_content .= '<span class="wcf-cpf-row-setting-label">Placeholder</span>';
1287
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
1288
- $field_content .= '<input type="text" value="" name="wcf-checkout-custom-fields[' . $p_key . '][placeholder]" class="wcf-cpf-placeholder">';
1289
- $field_content .= '<span id="wcf-cpf-placeholder-error-msg"></span>';
1290
- $field_content .= '</span>';
1291
- $field_content .= '</div>';
1292
-
1293
- /* Options */
1294
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-options">';
1295
- $field_content .= '<span class="wcf-cpf-row-setting-label">Options <i>*</i></span>';
1296
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
1297
- $field_content .= '<textarea value="" name="wcf-checkout-custom-fields[' . $p_key . '][label]" class="wcf-cpf-options" placeholder="Enter your options separated by comma."></textarea>';
1298
- $field_content .= '</span>';
1299
- $field_content .= '</div>';
1300
-
1301
- /* Width */
1302
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-width">';
1303
- $field_content .= '<span class="wcf-cpf-row-setting-label">Width</span>';
1304
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
1305
- $field_content .= '<select name="wcf-checkout-custom-fields[' . $p_key . '][width]" class="wcf-cpf-width">';
1306
- $field_content .= '<option value="33">33%</option>';
1307
- $field_content .= '<option value="50">50%</option>';
1308
- $field_content .= '<option value="100" selected>100%</option>';
1309
- $field_content .= '</select>';
1310
- $field_content .= '</span>';
1311
- $field_content .= '</div>';
1312
-
1313
- /* Required */
1314
- $field_content .= '<div class="wcf-cpf-fields wcf-cpf-required">';
1315
- $field_content .= '<span class="wcf-cpf-row-setting-label">Required</span>';
1316
- $field_content .= '<span class="wcf-cpf-row-setting-field">';
1317
- $field_content .= '<input type="hidden" value="no" name="wcf-checkout-custom-fields[' . $p_key . '][required]" class="wcf-cpf-required">';
1318
- $field_content .= '<input type="checkbox" value="yes" name="wcf-checkout-custom-fields[' . $p_key . '][required]" class="wcf-cpf-required">';
1319
- $field_content .= '<span id="wcf-cpf-required-error-msg"></span>';
1320
- $field_content .= '</span>';
1321
- $field_content .= '</div>';
1322
-
1323
- $field_content .= '</div>';
1324
- $field_content .= '</div>';
1325
- }
1326
-
1327
- /* Add New Custom Field */
1328
- $field_content .= '<div class="wcf-cpf-add-row">';
1329
- $field_content .= '<div class="wcf-cpf-add-wrap">';
1330
- $field_content .= '<button class="button button-secondary wcf-pro-cpf-add" data-name="wcf-checkout-custom-fields">Add New Field</button>';
1331
- $field_content .= '</div>';
1332
- $field_content .= '</div>';
1333
- /* End Add new custom field */
1334
-
1335
- $field_content .= '</div>';
1336
- $field_content .= '</div>';
1337
- $field_content .= '</div>';
1338
-
1339
- return $field_content;
1340
- }
1341
-
1342
- function get_product_selection_repeater( $field_data ) {
1343
-
1344
- $value = $field_data['value'];
1345
-
1346
- if ( ! is_array( $value ) ) {
1347
-
1348
- $value[0] = array(
1349
- 'product' => '',
1350
- );
1351
- } else {
1352
-
1353
- if ( ! isset( $value[0] ) ) {
1354
-
1355
- $value[0] = array(
1356
- 'product' => '',
1357
- );
1358
- }
1359
- }
1360
-
1361
- $field_html = '';
1362
-
1363
- $field_html .= '<script type="text/html" id="tmpl-wcf-product-repeater">';
1364
- $field_html .= $this->generate_product_repeater_html( '{{id}}' );
1365
- $field_html .= '</script>';
1366
-
1367
- $field_html .= '<div class="wcf-field-row">';
1368
- $field_html .= '<div class="wcf-field-row-content">';
1369
- $field_html .= '<div class="wcf-repeatables-wrap">';
1370
-
1371
- if ( is_array( $value ) ) {
1372
-
1373
- foreach ( $value as $p_key => $p_data ) {
1374
-
1375
- $selected_options = '';
1376
-
1377
- if ( isset( $p_data['product'] ) ) {
1378
-
1379
- $product = wc_get_product( $p_data['product'] );
1380
-
1381
- // posts.
1382
- if ( ! empty( $product ) ) {
1383
- $post_title = $product->get_name() . ' (#' . $p_data['product'] . ')';
1384
-
1385
- $selected_options = '<option value="' . $p_data['product'] . '" selected="selected" >' . $post_title . '</option>';
1386
- }
1387
- }
1388
-
1389
- $field_html .= $this->generate_product_repeater_html( $p_key, $selected_options );
1390
- }
1391
- }
1392
-
1393
- $field_html .= '<div class="wcf-add-repeatable-row">';
1394
- $field_html .= '<div class="submit wcf-add-repeatable-wrap">';
1395
- $field_html .= '<button class="button-primary wcf-add-repeatable" data-name="wcf-checkout-products">Add New Product</button>';
1396
- $field_html .= '</div>';
1397
- $field_html .= '</div>';
1398
- $field_html .= '</div>';
1399
- $field_html .= '</div>';
1400
- $field_html .= '</div>';
1401
-
1402
- return $field_html;
1403
- }
1404
-
1405
- function generate_product_repeater_html( $id, $options = '' ) {
1406
-
1407
- $field_html = '<div class="wcf-repeatable-row" data-key="' . $id . '">';
1408
-
1409
- $field_html .= '<div class="wcf-repeatable-row-standard-fields">';
1410
-
1411
- /* Product Name */
1412
- $field_html .= '<div class="wcf-repeatable-fields wcf-sel-product">';
1413
- $field_html .= '<span class="wcf-repeatable-row-setting-field">';
1414
- $field_html .= '<select
1415
- name="wcf-checkout-products[' . $id . '][product]"
1416
- class="wcf-product-search"
1417
- data-allow_clear="allow_clear"
1418
- data-placeholder="' . __( 'Search for a product&hellip;', 'cartflows' ) . '"
1419
- data-action="woocommerce_json_search_products_and_variations">';
1420
- $field_html .= $options;
1421
- $field_html .= '</select>';
1422
- $field_html .= '</span>';
1423
- $field_html .= '<span class="wcf-repeatable-row-actions">';
1424
- $field_html .= '<a class="wcf-remove-row wcf-repeatable-remove button" data-type="product">';
1425
- $field_html .= '<span class="dashicons dashicons-trash"></span>';
1426
- $field_html .= '<span class="wcf-repeatable-remove-button">'. __( 'Remove', 'cartflows' ).'</span>';
1427
- $field_html .= '</a>';
1428
- $field_html .= '</span>';
1429
- $field_html .= '</div>';
1430
- $field_html .= '</div>';
1431
- $field_html .= '</div>';
1432
-
1433
- return $field_html;
1434
- }
1435
-
1436
- function get_image_field( $field_data ) {
1437
-
1438
- $value = $field_data['value'];
1439
-
1440
- $attr = '';
1441
-
1442
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
1443
-
1444
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
1445
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
1446
- }
1447
- }
1448
-
1449
- $display_preview_box = ( isset( $value ) && '' != $value ) ? 'display:block;' : 'display:none';
1450
-
1451
- $field_content = '<div id="wcf-image-preview" style="'.$display_preview_box.'">';
1452
- if( isset( $value ) ){
1453
- $field_content .= '<img src="'. $value .'" class="saved-image" name="'. $field_data['name'] .'" width="150">';
1454
- }
1455
- $field_content .= '</div>';
1456
- // $field_content .= '<input type="hidden" id="wcf-image-id" class="wcf-image-id" name="wcf-image-id[image-id]" value="">';
1457
- $field_content .= '<input type="hidden" id="wcf-image-value" class="wcf-image" name="' . $field_data['name'] . '" value="'.$value.'">';
1458
-
1459
- $field_content .= '<button type="button" ' . $attr . ' class="wcf-select-image button-secondary">Select Image</button>';
1460
-
1461
- $display_remove_button = ( isset( $value ) && '' != $value ) ? 'display:inline-block; margin-left: 5px;' : 'display:none';
1462
-
1463
- $field_content .= '<button type="button" class="wcf-remove-image button-secondary" style="'.$display_remove_button.'">Remove Image</button>';
1464
-
1465
- return $this->get_field( $field_data, $field_content );
1466
- }
1467
-
1468
- /**
1469
- * Localize variables in admin
1470
- *
1471
- * @param array $vars variables.
1472
- */
1473
- function localize_vars( $vars ) {
1474
-
1475
- $ajax_actions = array(
1476
- 'wcf_add_checkout_custom_field',
1477
- 'wcf_pro_add_checkout_custom_field',
1478
- 'wcf_delete_checkout_custom_field',
1479
- 'wcf_json_search_pages',
1480
- 'wcf_json_search_coupons'
1481
- );
1482
-
1483
- foreach ( $ajax_actions as $action ) {
1484
-
1485
- $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
1486
- }
1487
-
1488
- return $vars;
1489
- }
1490
- }
1491
- // @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_json_search_pages', array( $this, 'json_search_pages' ) );
43
+
44
+ add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
45
+ }
46
+
47
+ public function admin_meta_scripts() {
48
+
49
+ global $pagenow;
50
+ global $post;
51
+
52
+ $screen = get_current_screen();
53
+
54
+ if (
55
+ ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) &&
56
+ wcf()->utils->is_step_post_type( $screen->post_type )
57
+ ) {
58
+
59
+ wp_enqueue_style( 'woocommerce_admin_styles' );
60
+
61
+ wp_enqueue_script( 'select2' );
62
+ wp_enqueue_script( 'wc-enhanced-select' );
63
+
64
+ wp_enqueue_script(
65
+ 'wcf-admin-meta',
66
+ CARTFLOWS_URL . 'admin/meta-assets/js/admin-edit.js',
67
+ array( 'jquery', 'wp-color-picker' ),
68
+ CARTFLOWS_VER,
69
+ true
70
+ );
71
+
72
+ wp_enqueue_style( 'wcf-admin-meta', CARTFLOWS_URL . 'admin/meta-assets/css/admin-edit.css', array( 'wp-color-picker' ), CARTFLOWS_VER );
73
+ wp_style_add_data( 'wcf-admin-meta', 'rtl', 'replace' );
74
+
75
+ $localize = array(
76
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
77
+ 'google_fonts' => CartFlows_Font_Families::get_google_fonts(),
78
+ 'system_fonts' => CartFlows_Font_Families::get_system_fonts(),
79
+ 'font_weights' => array(
80
+ '100' => __( 'Thin 100', 'cartflows' ),
81
+ '200' => __( 'Extra-Light 200', 'cartflows' ),
82
+ '300' => __( 'Light 300', 'cartflows' ),
83
+ '400' => __( 'Normal 400', 'cartflows' ),
84
+ '500' => __( 'Medium 500', 'cartflows' ),
85
+ '600' => __( 'Semi-Bold 600', 'cartflows' ),
86
+ '700' => __( 'Bold 700', 'cartflows' ),
87
+ '800' => __( 'Extra-Bold 800', 'cartflows' ),
88
+ '900' => __( 'Ultra-Bold 900', 'cartflows' ),
89
+ )
90
+ );
91
+
92
+ wp_localize_script( 'jquery', 'wcf', apply_filters( 'wcf_js_localize', $localize ) );
93
+
94
+ do_action( 'cartflows_admin_meta_scripts' );
95
+ }
96
+ }
97
+
98
+ /**
99
+ * Function to search coupons
100
+ */
101
+ public function json_search_coupons() {
102
+
103
+ check_admin_referer( 'wcf-json-search-coupons', 'security' );
104
+
105
+ global $wpdb;
106
+
107
+ $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
108
+
109
+ if ( empty( $term ) ) {
110
+ die();
111
+ }
112
+
113
+ $posts = wp_cache_get( 'wcf_search_coupons', 'wcf_funnel_Cart' );
114
+
115
+ if ( false === $posts ) {
116
+ $posts = $wpdb->get_results( // phpcs:ignore
117
+ $wpdb->prepare(
118
+ "SELECT *
119
+ FROM {$wpdb->prefix}posts
120
+ WHERE post_type = %s
121
+ AND post_title LIKE %s
122
+ AND post_status = %s",
123
+ 'shop_coupon',
124
+ $wpdb->esc_like( $term ) . '%',
125
+ 'publish'
126
+ )
127
+ );
128
+ wp_cache_set( 'wcf_search_coupons', $posts, 'wcf_funnel_Cart' );
129
+ }
130
+
131
+ $coupons_found = array();
132
+ $all_discount_types = wc_get_coupon_types();
133
+
134
+ if ( $posts ) {
135
+ foreach ( $posts as $post ) {
136
+
137
+ $discount_type = get_post_meta( $post->ID, 'discount_type', true );
138
+
139
+ if ( ! empty( $all_discount_types[ $discount_type ] ) ) {
140
+ $coupons_found[ get_the_title( $post->ID ) ] = get_the_title( $post->ID ) . ' (Type: ' . $all_discount_types[ $discount_type ] . ')';
141
+ }
142
+ }
143
+ }
144
+
145
+ wp_send_json( $coupons_found );
146
+ }
147
+
148
+ /**
149
+ * Function to search coupons
150
+ */
151
+ public function json_search_pages() {
152
+
153
+ check_ajax_referer( 'wcf-json-search-pages', 'security' );
154
+
155
+ $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
156
+
157
+ if ( empty( $term ) ) {
158
+ die( 'not found' );
159
+ }
160
+
161
+ $search_string = $term;
162
+ $data = array();
163
+ $result = array();
164
+
165
+ add_filter( 'posts_search', array( $this, 'search_only_titles' ), 10, 2 );
166
+
167
+ $query = new WP_Query(
168
+ array(
169
+ 's' => $search_string,
170
+ 'post_type' => 'page',
171
+ 'posts_per_page' => - 1,
172
+ )
173
+ );
174
+
175
+ if ( $query->have_posts() ) {
176
+ while ( $query->have_posts() ) {
177
+ $query->the_post();
178
+ $title = get_the_title();
179
+ $title .= ( 0 != $query->post->post_parent ) ? ' (' . get_the_title( $query->post->post_parent ) . ')' : '';
180
+ $id = get_the_id();
181
+ $data[] = array(
182
+ 'id' => $id,
183
+ 'text' => $title,
184
+ );
185
+ }
186
+ }
187
+
188
+ if ( is_array( $data ) && ! empty( $data ) ) {
189
+ $result[] = array(
190
+ 'text' => '',
191
+ 'children' => $data,
192
+ );
193
+ }
194
+
195
+ wp_reset_postdata();
196
+
197
+ // return the result in json.
198
+ wp_send_json( $result );
199
+ }
200
+
201
+ public function search_only_titles( $search, $wp_query ) {
202
+ if ( ! empty( $search ) && ! empty( $wp_query->query_vars['search_terms'] ) ) {
203
+ global $wpdb;
204
+
205
+ $q = $wp_query->query_vars;
206
+ $n = ! empty( $q['exact'] ) ? '' : '%';
207
+
208
+ $search = array();
209
+
210
+ foreach ( (array) $q['search_terms'] as $term ) {
211
+ $search[] = $wpdb->prepare( "$wpdb->posts.post_title LIKE %s", $n . $wpdb->esc_like( $term ) . $n );
212
+ }
213
+
214
+ if ( ! is_user_logged_in() ) {
215
+ $search[] = "$wpdb->posts.post_password = ''";
216
+ }
217
+
218
+ $search = ' AND ' . implode( ' AND ', $search );
219
+ }
220
+
221
+ return $search;
222
+ }
223
+
224
+ function get_field( $field_data, $field_content ) {
225
+
226
+ $label = isset( $field_data['label'] ) ? $field_data['label'] : '';
227
+ $help = isset( $field_data['help'] ) ? $field_data['help'] : '';
228
+ $after_html = isset( $field_data['after_html'] ) ? $field_data['after_html'] : '';
229
+
230
+ $name_class = 'field-' . $field_data['name'];
231
+
232
+ $field_html = '<div class="wcf-field-row ' . $name_class . '">';
233
+
234
+ if( ! empty( $label ) || ! empty( $help ) ) {
235
+ $field_html .= '<div class="wcf-field-row-heading">';
236
+ if( ! empty( $label ) ) {
237
+ $field_html .= '<label>' . esc_html( $label ) . '</label>';
238
+ }
239
+ if ( ! empty( $help ) ) {
240
+ $field_html .= '<i class="wcf-field-heading-help dashicons dashicons-editor-help">';
241
+ // $field_html .= '<span class="wcf-tooltip" data-tooltip= "'. esc_attr( $help ) .'"></span>';
242
+ $field_html .= '</i>';
243
+ $field_html .= '<span class="wcf-tooltip-text">';
244
+ $field_html .= $help;
245
+ $field_html .= '</span>';
246
+ }
247
+ $field_html .= '</div>';
248
+ }
249
+
250
+ $field_html .= '<div class="wcf-field-row-content">';
251
+ $field_html .= $field_content;
252
+
253
+ if ( ! empty( $after_html ) ) {
254
+ $field_html .= $after_html;
255
+ }
256
+
257
+ $field_html .= '</div>';
258
+ $field_html .= '</div>';
259
+
260
+ return $field_html;
261
+ }
262
+
263
+ function get_text_field( $field_data ) {
264
+
265
+ $value = $field_data['value'];
266
+
267
+ $attr = '';
268
+
269
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
270
+
271
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
272
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
273
+ }
274
+ }
275
+
276
+ $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
277
+
278
+ return $this->get_field( $field_data, $field_content );
279
+ }
280
+
281
+ function get_shortcode_field( $field_data ) {
282
+
283
+ $attr = '';
284
+
285
+ $attr_fields = array(
286
+ 'readonly' => 'readonly',
287
+ 'onfocus' => 'this.select()',
288
+ 'onmouseup' => 'return false',
289
+ );
290
+
291
+ if ( $attr_fields && is_array( $attr_fields ) ) {
292
+
293
+ foreach ( $attr_fields as $attr_key => $attr_value ) {
294
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
295
+ }
296
+ }
297
+
298
+ $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . $field_data['content'] . '" ' . $attr . '>';
299
+
300
+ return $this->get_field( $field_data, $field_content );
301
+ }
302
+
303
+ function get_display_field( $field_data ) {
304
+
305
+ $field_content = $field_data['content'];
306
+
307
+ return $this->get_field( $field_data, $field_content );
308
+ }
309
+
310
+ function get_hr_line_field( $field_data ) {
311
+
312
+ $field_data = array(
313
+ 'name' => 'wcf-hr-line',
314
+ 'content' => '<hr>'
315
+ );
316
+
317
+ $field_content = $field_data['content'];
318
+
319
+ return $this->get_field( $field_data, $field_content );
320
+ }
321
+
322
+ function get_number_field( $field_data ) {
323
+
324
+ $value = $field_data['value'];
325
+
326
+ $attr = '';
327
+
328
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
329
+
330
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
331
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
332
+ }
333
+ }
334
+
335
+ $field_content = '<input type="number" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
336
+
337
+ return $this->get_field( $field_data, $field_content );
338
+ }
339
+
340
+ function get_hidden_field( $field_data ) {
341
+
342
+ $value = $field_data['value'];
343
+
344
+ $attr = '';
345
+
346
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
347
+
348
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
349
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
350
+ }
351
+ }
352
+
353
+ $field_content = '<input type="hidden" id="' . $field_data['name'] . '" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
354
+
355
+ return $this->get_field( $field_data, $field_content );
356
+ }
357
+
358
+ function get_area_field( $field_data ) {
359
+
360
+ $value = $field_data['value'];
361
+
362
+ $attr = '';
363
+
364
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
365
+
366
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
367
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
368
+ }
369
+ }
370
+
371
+ $field_content = '<textarea name="' . $field_data['name'] . '" rows="10" cols="50" ' . $attr . '>';
372
+ $field_content .= $value;
373
+ $field_content .= '</textarea>';
374
+
375
+ return $this->get_field( $field_data, $field_content );
376
+ }
377
+
378
+ function get_only_checkbox_field( $field_data ) {
379
+ // echo "<pre>";
380
+ // var_dump($field_data);
381
+ // echo "</pre>";
382
+
383
+ $value = $field_data['value'];
384
+
385
+
386
+ $field_content = '';
387
+ if ( isset( $field_data['before'] ) ) {
388
+ $field_content .= '<span>' . $field_data['before'] . '</span>';
389
+ }
390
+ $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
391
+ $field_content .= '<input type="checkbox" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . '>';
392
+
393
+ if ( isset( $field_data['after'] ) ) {
394
+ $field_content .= '<span>' . $field_data['after'] . '</span>';
395
+ }
396
+
397
+ if ( isset( $field_data['after_html'] ) ) {
398
+ $field_content .= '<span>' . $field_data['after_html'] . '</span>';
399
+ }
400
+
401
+ return $field_content;
402
+ }
403
+
404
+ function get_checkbox_field( $field_data ) {
405
+
406
+ $value = $field_data['value'];
407
+
408
+ $field_content = '';
409
+ if ( isset( $field_data['before'] ) ) {
410
+ $field_content .= '<span>' . $field_data['before'] . '</span>';
411
+ }
412
+
413
+ $toggle_data = '';
414
+ if ( isset( $field_data['toggle'] ) ) {
415
+ $toggle_data .= 'toggle="' . htmlspecialchars( wp_json_encode( $field_data['toggle'] ) ) . '"';
416
+ }
417
+
418
+ $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
419
+ $field_content .= '<input type="checkbox" id="'.$field_data['name'].'" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . ' ' . $toggle_data . '>';
420
+
421
+ if ( isset( $field_data['after'] ) ) {
422
+ $field_content .= '<span>' . $field_data['after'] . '</span>';
423
+ }
424
+
425
+ return $this->get_field( $field_data, $field_content );
426
+ }
427
+
428
+ function get_radio_field( $field_data ) {
429
+
430
+ $value = $field_data['value'];
431
+ $field_content = '';
432
+
433
+ if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
434
+
435
+ foreach ( $field_data['options'] as $data_key => $data_value ) {
436
+
437
+ $field_content .= '<div class="wcf-radio-option">';
438
+ $field_content .= '<input type="radio" name="' . $field_data['name'] . '" value="' . $data_key . '" ' . checked( $data_key, $value, false ) . '>';
439
+ $field_content .= $data_value;
440
+ $field_content .= '</div>';
441
+ }
442
+ }
443
+
444
+ return $this->get_field( $field_data, $field_content );
445
+ }
446
+
447
+ function get_font_family_field( $field_data ) {
448
+
449
+ $value = $field_data['value'];
450
+
451
+ $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
452
+
453
+ $field_content = '<select class="wcf-field-font-family" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
454
+
455
+ $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
456
+
457
+ $field_content .= '<optgroup label="Other System Fonts">';
458
+ foreach ( CartFlows_Font_Families::get_system_fonts() as $name => $variants ) {
459
+ $field_content .= '<option value="' . esc_attr( $name ) . '" ' . selected( $name, $value, false ) . '>' . esc_attr( $name ) . '</option>';
460
+ }
461
+ $field_content .= '</optgroup>';
462
+ $field_content .= '<optgroup label="Google">';
463
+ foreach ( CartFlows_Font_Families::get_google_fonts() as $name => $single_font ) {
464
+ $variants = wcf_get_prop( $single_font, '0' );
465
+ $category = wcf_get_prop( $single_font, '1' );
466
+ $font_value = '\'' . esc_attr( $name ) . '\', ' . esc_attr( $category );
467
+ $field_content .= '<option value="' . esc_attr( $font_value ) . '" ' . selected( $font_value, $value, false ) . '>' . esc_attr( $name ) . '</option>';
468
+ }
469
+ $field_content .= '</optgroup>';
470
+
471
+ $field_content .= '</select>';
472
+
473
+ return $this->get_field( $field_data, $field_content );
474
+ }
475
+
476
+ function get_font_weight_field( $field_data ) {
477
+
478
+ $value = $field_data['value'];
479
+
480
+ $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
481
+
482
+ $field_content = '<select data-selected="'.esc_attr( $value ).'" class="wcf-field-font-weight" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
483
+
484
+ $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
485
+
486
+ $field_content .= '</select>';
487
+
488
+ return $this->get_field( $field_data, $field_content );
489
+ }
490
+
491
+ function get_select_field( $field_data ) {
492
+
493
+ $value = $field_data['value'];
494
+ $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
495
+
496
+ $field_content = '<select name="' . $field_data['name'] . '">';
497
+
498
+
499
+ if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
500
+
501
+ foreach ( $field_data['options'] as $data_key => $data_value ) {
502
+
503
+ $disabled = '';
504
+
505
+ if ( array_key_exists( $data_key, $pro_options ) ) {
506
+ $disabled = 'disabled ';
507
+ $data_value = $pro_options[ $data_key ];
508
+ }
509
+
510
+ $field_content .= '<option value="' . $data_key . '" ' . selected( $value, $data_key, false ) . ' ' . $disabled .'>' . $data_value . '</option>';
511
+ }
512
+ }
513
+
514
+ $field_content .= '</select>';
515
+
516
+ if ( isset( $field_data['after'] ) ) {
517
+ $field_content .= '<span>' . $field_data['after'] . '</span>';
518
+ }
519
+
520
+ return $this->get_field( $field_data, $field_content );
521
+ }
522
+
523
+ function get_color_picker_field( $field_data ) {
524
+
525
+ $value = $field_data['value'];
526
+
527
+ $field_content = '<input class="wcf-color-picker" type="text" name="' . $field_data['name'] . '" value="' . $value . '">';
528
+
529
+ return $this->get_field( $field_data, $field_content );
530
+ }
531
+
532
+ function get_product_selection_field( $field_data ) {
533
+
534
+ $value = $field_data['value'];
535
+
536
+ $multiple = '';
537
+
538
+ if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
539
+ $multiple = ' multiple="multiple"';
540
+ }
541
+
542
+ $allow_clear = '';
543
+
544
+ if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
545
+ $allow_clear = ' data-allow_clear="allow_clear"';
546
+ }
547
+
548
+ $field_content = '<select
549
+ name="' . $field_data['name'] . '[]"
550
+ class="wcf-product-search" ' . $multiple . $allow_clear . '
551
+ data-placeholder="' . __( 'Search for a product&hellip;', 'cartflows' ) . '"
552
+ data-action="woocommerce_json_search_products_and_variations">';
553
+
554
+ if ( is_array( $value ) && ! empty( $value ) ) {
555
+
556
+ foreach ( $value as $data_key => $product_id ) {
557
+
558
+ $product = wc_get_product( $product_id );
559
+
560
+ // posts.
561
+ if ( ! empty( $product ) ) {
562
+ $post_title = $product->get_name() . ' (#' . $product_id . ')';
563
+
564
+ $field_content .= '<option value="' . $product_id . '" selected="selected" >' . $post_title . '</option>';
565
+ }
566
+ }
567
+ }
568
+ $field_content .= '</select>';
569
+
570
+ return $this->get_field( $field_data, $field_content );
571
+ }
572
+
573
+ function get_coupon_selection_field( $field_data ) {
574
+
575
+ $value = $field_data['value'];
576
+
577
+ $multiple = '';
578
+
579
+ if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
580
+ $multiple = ' multiple="multiple"';
581
+ }
582
+
583
+ $allow_clear = '';
584
+
585
+ if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
586
+ $allow_clear = ' data-allow_clear="allow_clear"';
587
+ }
588
+
589
+ $field_content = '<select
590
+ name="' . $field_data['name'] . '[]"
591
+ class="wc-coupon-search wcf-coupon-search" ' . $multiple . $allow_clear . '
592
+ data-placeholder="' . __( 'Search for a coupon&hellip;', 'cartflows' ) . '"
593
+ data-action="wcf_json_search_coupons">';
594
+
595
+ if ( is_array( $value ) && ! empty( $value ) ) {
596
+
597
+ $all_discount_types = wc_get_coupon_types();
598
+
599
+ foreach ( $value as $coupon_title ) {
600
+
601
+ $coupon = new WC_Coupon( $coupon_title );
602
+
603
+ $discount_type = $coupon->get_discount_type();
604
+
605
+ if ( isset( $discount_type ) && $discount_type ) {
606
+ $discount_type = ' ( Type: ' . $all_discount_types[ $discount_type ] . ' )';
607
+ }
608
+
609
+ $field_content .= '<option value="' . $coupon_title . '" selected="selected">' . $coupon_title . $discount_type . '</option>';
610
+ }
611
+ }
612
+
613
+ $field_content .= '</select>';
614
+
615
+ return $this->get_field( $field_data, $field_content );
616
+ }
617
+
618
+ function get_page_selection_field( $field_data ) {
619
+
620
+ $value = $field_data['value'];
621
+
622
+ $multiple = '';
623
+
624
+ if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
625
+ $multiple = 'multiple="multiple"';
626
+ }
627
+
628
+ $field_content = '<select
629
+ name="' . $field_data['name'] . '[]"
630
+ class="wcf-search-pages" ' . $multiple . '"
631
+ data-action="wcf_json_search_pages">';
632
+
633
+ if ( is_array( $value ) && ! empty( $value ) ) {
634
+
635
+ foreach ( $value as $data_key => $data_value ) {
636
+
637
+ $field_content .= '<option value="' . $data_value . '">' . get_the_title( $data_value ) . '</option>';
638
+ }
639
+ }
640
+
641
+ $field_content .= '</select>';
642
+
643
+ return $this->get_field( $field_data, $field_content );
644
+ }
645
+
646
+ function get_section( $field_data ) {
647
+ $field_html = '<div class="wcf-field-row wcf-field-section">';
648
+ $field_html .= '<div class="wcf-field-section-heading" colspan="2">';
649
+ $field_html .= '<label>' . esc_html( $field_data['label'] ) . '</label>';
650
+
651
+ if ( isset( $field_data['help'] ) ) {
652
+ $field_html .= '<i class="wcf-field-heading-help dashicons dashicons-editor-help" title="' . esc_attr( $field_data['help'] ) . '"></i>';
653
+ }
654
+ $field_html .= '</div>';
655
+ $field_html .= '</div>';
656
+ return $field_html;
657
+ }
658
+
659
+ function get_description_field( $field_data ) {
660
+
661
+ $field_html = '<div class="wcf-field-row wcf-field-desc ' . $field_data['name'] . '">';
662
+ $field_html .= '<div class="wcf-field-desc-content">';
663
+ $field_html .= $field_data['content'];
664
+ $field_html .= '</div>';
665
+ $field_html .= '</div>';
666
+
667
+ return $field_html;
668
+ }
669
+
670
+ function get_product_selection_repeater( $field_data ) {
671
+
672
+ $value = $field_data['value'];
673
+
674
+ if ( ! is_array( $value ) ) {
675
+
676
+ $value[0] = array(
677
+ 'product' => '',
678
+ );
679
+ } else {
680
+
681
+ if ( ! isset( $value[0] ) ) {
682
+
683
+ $value[0] = array(
684
+ 'product' => '',
685
+ );
686
+ }
687
+ }
688
+
689
+ $field_html = '';
690
+
691
+ $field_html .= '<script type="text/html" id="tmpl-wcf-product-repeater">';
692
+ $field_html .= $this->generate_product_repeater_html( '{{id}}' );
693
+ $field_html .= '</script>';
694
+
695
+ $field_html .= '<div class="wcf-field-row">';
696
+ $field_html .= '<div class="wcf-field-row-content">';
697
+ $field_html .= '<div class="wcf-repeatables-wrap">';
698
+
699
+ if ( is_array( $value ) ) {
700
+
701
+ foreach ( $value as $p_key => $p_data ) {
702
+
703
+ $selected_options = '';
704
+
705
+ if ( isset( $p_data['product'] ) ) {
706
+
707
+ $product = wc_get_product( $p_data['product'] );
708
+
709
+ // posts.
710
+ if ( ! empty( $product ) ) {
711
+ $post_title = $product->get_name() . ' (#' . $p_data['product'] . ')';
712
+
713
+ $selected_options = '<option value="' . $p_data['product'] . '" selected="selected" >' . $post_title . '</option>';
714
+ }
715
+ }
716
+
717
+ $field_html .= $this->generate_product_repeater_html( $p_key, $selected_options );
718
+ }
719
+ }
720
+
721
+ $field_html .= '<div class="wcf-add-repeatable-row">';
722
+ $field_html .= '<div class="submit wcf-add-repeatable-wrap">';
723
+ $field_html .= '<button class="button-primary wcf-add-repeatable" data-name="wcf-checkout-products">Add New Product</button>';
724
+ $field_html .= '</div>';
725
+ $field_html .= '</div>';
726
+ $field_html .= '</div>';
727
+ $field_html .= '</div>';
728
+ $field_html .= '</div>';
729
+
730
+ return $field_html;
731
+ }
732
+
733
+ function generate_product_repeater_html( $id, $options = '' ) {
734
+
735
+ $field_html = '<div class="wcf-repeatable-row" data-key="' . $id . '">';
736
+
737
+ $field_html .= '<div class="wcf-repeatable-row-standard-fields">';
738
+
739
+ /* Product Name */
740
+ $field_html .= '<div class="wcf-repeatable-fields wcf-sel-product">';
741
+ $field_html .= '<span class="wcf-repeatable-row-setting-field">';
742
+ $field_html .= '<select
743
+ name="wcf-checkout-products[' . $id . '][product]"
744
+ class="wcf-product-search"
745
+ data-allow_clear="allow_clear"
746
+ data-placeholder="' . __( 'Search for a product&hellip;', 'cartflows' ) . '"
747
+ data-action="woocommerce_json_search_products_and_variations">';
748
+ $field_html .= $options;
749
+ $field_html .= '</select>';
750
+ $field_html .= '</span>';
751
+ $field_html .= '<span class="wcf-repeatable-row-actions">';
752
+ $field_html .= '<a class="wcf-remove-row wcf-repeatable-remove button" data-type="product">';
753
+ $field_html .= '<span class="dashicons dashicons-trash"></span>';
754
+ $field_html .= '<span class="wcf-repeatable-remove-button">'. __( 'Remove', 'cartflows' ).'</span>';
755
+ $field_html .= '</a>';
756
+ $field_html .= '</span>';
757
+ $field_html .= '</div>';
758
+ $field_html .= '</div>';
759
+ $field_html .= '</div>';
760
+
761
+ return $field_html;
762
+ }
763
+
764
+ function get_image_field( $field_data ) {
765
+
766
+ $value = $field_data['value'];
767
+
768
+ $attr = '';
769
+
770
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
771
+
772
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
773
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
774
+ }
775
+ }
776
+
777
+ $display_preview_box = ( isset( $value ) && '' != $value ) ? 'display:block;' : 'display:none';
778
+
779
+ $field_content = '<div id="wcf-image-preview" style="'.$display_preview_box.'">';
780
+ if( isset( $value ) ){
781
+ $field_content .= '<img src="'. $value .'" class="saved-image" name="'. $field_data['name'] .'" width="150">';
782
+ }
783
+ $field_content .= '</div>';
784
+ // $field_content .= '<input type="hidden" id="wcf-image-id" class="wcf-image-id" name="wcf-image-id[image-id]" value="">';
785
+ $field_content .= '<input type="hidden" id="wcf-image-value" class="wcf-image" name="' . $field_data['name'] . '" value="'.$value.'">';
786
+
787
+ $field_content .= '<button type="button" ' . $attr . ' class="wcf-select-image button-secondary">Select Image</button>';
788
+
789
+ $display_remove_button = ( isset( $value ) && '' != $value ) ? 'display:inline-block; margin-left: 5px;' : 'display:none';
790
+
791
+ $field_content .= '<button type="button" class="wcf-remove-image button-secondary" style="'.$display_remove_button.'">Remove Image</button>';
792
+
793
+ return $this->get_field( $field_data, $field_content );
794
+ }
795
+
796
+ /**
797
+ * Localize variables in admin
798
+ *
799
+ * @param array $vars variables.
800
+ */
801
+ function localize_vars( $vars ) {
802
+
803
+ $ajax_actions = array(
804
+ 'wcf_json_search_pages',
805
+ 'wcf_json_search_coupons'
806
+ );
807
+
808
+ foreach ( $ajax_actions as $action ) {
809
+
810
+ $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
811
+ }
812
+
813
+ return $vars;
814
+ }
815
+ }
816
+ // @codingStandardsIgnoreEnd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/class-cartflows-metabox.php CHANGED
@@ -1,97 +1,97 @@
1
- <?php
2
- /**
3
- * Update Compatibility
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- if ( ! class_exists( 'Cartflows_Metabox' ) ) :
9
-
10
- /**
11
- * CartFlows Update initial setup
12
- *
13
- * @since 1.0.0
14
- */
15
- class Cartflows_Metabox {
16
-
17
- /**
18
- * Class instance.
19
- *
20
- * @access private
21
- * @var $instance Class instance.
22
- */
23
- private static $instance;
24
-
25
- /**
26
- * Initiator
27
- */
28
- public static function get_instance() {
29
- if ( ! isset( self::$instance ) ) {
30
- self::$instance = new self();
31
- }
32
- return self::$instance;
33
- }
34
-
35
- /**
36
- * Constructor
37
- */
38
- public function __construct() {
39
- add_action( 'admin_init', array( $this, 'add_wcf_order_metabox' ) );
40
- }
41
-
42
- /**
43
- *
44
- * Add Analytics Metabox
45
- *
46
- * @return void
47
- */
48
- public function add_wcf_order_metabox() {
49
-
50
- if ( ! isset( $_GET['cartflows_debug'] ) ) { //phpcs:ignore
51
- return;
52
- }
53
-
54
- $debug = filter_input( INPUT_GET, 'cartflows_debug', FILTER_SANITIZE_STRING );
55
-
56
- if ( $debug ) {
57
- add_meta_box(
58
- 'wcf-order-details',
59
- __( 'Flow Details', 'cartflows' ),
60
- array( $this, 'flow_metabox_markup' ),
61
- 'shop_order',
62
- 'side',
63
- 'low'
64
- );
65
- }
66
-
67
- }
68
-
69
-
70
- /**
71
- * Flow metabox markup.
72
- */
73
- public function flow_metabox_markup() {
74
- global $post;
75
- $flow_id = wcf()->utils->get_flow_id_from_order( $post->ID );
76
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $post->ID );
77
-
78
- $html_data = "
79
- <div>
80
- <p> This is for debugging only. </p>
81
- <p> <strong>Flow ID:</strong>: <a href='" . admin_url( 'post.php?post=' . $flow_id . '&action=edit' ) . "'> " . $flow_id . " </a> </p>
82
- <p> <strong>Checkout ID:</strong> <a href='" . admin_url( 'post.php?post=' . $checkout_id . '&action=edit' ) . "'> " . $checkout_id . ' </a></p>
83
- </div>
84
- ';
85
-
86
- echo $html_data;
87
- }
88
-
89
-
90
- }
91
-
92
- /**
93
- * Kicking this off by calling 'get_instance()' method
94
- */
95
- Cartflows_Metabox::get_instance();
96
-
97
- endif;
1
+ <?php
2
+ /**
3
+ * Update Compatibility
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ if ( ! class_exists( 'Cartflows_Metabox' ) ) :
9
+
10
+ /**
11
+ * CartFlows Update initial setup
12
+ *
13
+ * @since 1.0.0
14
+ */
15
+ class Cartflows_Metabox {
16
+
17
+ /**
18
+ * Class instance.
19
+ *
20
+ * @access private
21
+ * @var $instance Class instance.
22
+ */
23
+ private static $instance;
24
+
25
+ /**
26
+ * Initiator
27
+ */
28
+ public static function get_instance() {
29
+ if ( ! isset( self::$instance ) ) {
30
+ self::$instance = new self();
31
+ }
32
+ return self::$instance;
33
+ }
34
+
35
+ /**
36
+ * Constructor
37
+ */
38
+ public function __construct() {
39
+ add_action( 'admin_init', array( $this, 'add_wcf_order_metabox' ) );
40
+ }
41
+
42
+ /**
43
+ *
44
+ * Add Analytics Metabox
45
+ *
46
+ * @return void
47
+ */
48
+ public function add_wcf_order_metabox() {
49
+
50
+ if ( ! isset( $_GET['cartflows_debug'] ) ) { //phpcs:ignore
51
+ return;
52
+ }
53
+
54
+ $debug = filter_input( INPUT_GET, 'cartflows_debug', FILTER_SANITIZE_STRING );
55
+
56
+ if ( $debug ) {
57
+ add_meta_box(
58
+ 'wcf-order-details',
59
+ __( 'Flow Details', 'cartflows' ),
60
+ array( $this, 'flow_metabox_markup' ),
61
+ 'shop_order',
62
+ 'side',
63
+ 'low'
64
+ );
65
+ }
66
+
67
+ }
68
+
69
+
70
+ /**
71
+ * Flow metabox markup.
72
+ */
73
+ public function flow_metabox_markup() {
74
+ global $post;
75
+ $flow_id = wcf()->utils->get_flow_id_from_order( $post->ID );
76
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $post->ID );
77
+
78
+ $html_data = "
79
+ <div>
80
+ <p> This is for debugging only. </p>
81
+ <p> <strong>Flow ID:</strong>: <a href='" . admin_url( 'post.php?post=' . $flow_id . '&action=edit' ) . "'> " . $flow_id . " </a> </p>
82
+ <p> <strong>Checkout ID:</strong> <a href='" . admin_url( 'post.php?post=' . $checkout_id . '&action=edit' ) . "'> " . $checkout_id . ' </a></p>
83
+ </div>
84
+ ';
85
+
86
+ echo $html_data;
87
+ }
88
+
89
+
90
+ }
91
+
92
+ /**
93
+ * Kicking this off by calling 'get_instance()' method
94
+ */
95
+ Cartflows_Metabox::get_instance();
96
+
97
+ endif;
classes/class-cartflows-utils.php CHANGED
@@ -1,425 +1,455 @@
1
- <?php
2
- /**
3
- * Utils.
4
- *
5
- * @package CARTFLOWS
6
- */
7
-
8
- if ( ! defined( 'ABSPATH' ) ) {
9
- exit; // Exit if accessed directly.
10
- }
11
-
12
- /**
13
- * Class Cartflows_Utils.
14
- */
15
- class Cartflows_Utils {
16
-
17
- /**
18
- * Member Variable
19
- *
20
- * @var instance
21
- */
22
- private static $instance;
23
-
24
- /**
25
- * Initiator
26
- */
27
- public static function get_instance() {
28
- if ( ! isset( self::$instance ) ) {
29
- self::$instance = new self();
30
- }
31
- return self::$instance;
32
- }
33
-
34
- /**
35
- * Constructor
36
- */
37
- public function __construct() {
38
- }
39
-
40
- /**
41
- * Get current post type
42
- *
43
- * @param string $post_type post type.
44
- * @return string
45
- */
46
- public function current_post_type( $post_type = '' ) {
47
-
48
- if ( '' === $post_type ) {
49
- $post_type = get_post_type();
50
- }
51
-
52
- return $post_type;
53
- }
54
-
55
- /**
56
- * Check if post type is of step.
57
- *
58
- * @param string $post_type post type.
59
- * @return bool
60
- */
61
- public function is_step_post_type( $post_type = '' ) {
62
-
63
- if ( $this->get_step_post_type() === $this->current_post_type( $post_type ) ) {
64
-
65
- return true;
66
- }
67
-
68
- return false;
69
- }
70
-
71
- /**
72
- * Check if post type is of flow.
73
- *
74
- * @param string $post_type post type.
75
- * @return bool
76
- */
77
- public function is_flow_post_type( $post_type = '' ) {
78
-
79
- if ( $this->get_flow_post_type() === $this->current_post_type( $post_type ) ) {
80
-
81
- return true;
82
- }
83
-
84
- return false;
85
- }
86
-
87
- /**
88
- * Get post type of step.
89
- *
90
- * @return string
91
- */
92
- public function get_step_post_type() {
93
-
94
- return CARTFLOWS_STEP_POST_TYPE;
95
- }
96
-
97
- /**
98
- * Get post type of flow.
99
- *
100
- * @return string
101
- */
102
- public function get_flow_post_type() {
103
-
104
- return CARTFLOWS_FLOW_POST_TYPE;
105
- }
106
-
107
- /**
108
- * Get flow id
109
- *
110
- * @return int
111
- */
112
- public function get_flow_id() {
113
-
114
- global $post;
115
-
116
- return get_post_meta( $post->ID, 'wcf-flow-id', true );
117
- }
118
-
119
- /**
120
- * Get flow id by step
121
- *
122
- * @param int $step_id step ID.
123
- * @return int
124
- */
125
- public function get_flow_id_from_step_id( $step_id ) {
126
-
127
- return get_post_meta( $step_id, 'wcf-flow-id', true );
128
- }
129
-
130
- /**
131
- * Get flow steps by id
132
- *
133
- * @param int $flow_id flow ID.
134
- * @return int
135
- */
136
- public function get_flow_steps( $flow_id ) {
137
-
138
- $steps = get_post_meta( $flow_id, 'wcf-steps', true );
139
-
140
- if ( is_array( $steps ) && ! empty( $steps ) ) {
141
- return $steps;
142
- }
143
-
144
- return false;
145
- }
146
-
147
- /**
148
- * Get template type of step
149
- *
150
- * @param int $step_id step ID.
151
- * @return int
152
- */
153
- public function get_step_type( $step_id ) {
154
-
155
- return get_post_meta( $step_id, 'wcf-step-type', true );
156
- }
157
-
158
- /**
159
- * Get next id for step
160
- *
161
- * @param int $flow_id flow ID.
162
- * @param int $step_id step ID.
163
- * @return bool
164
- */
165
- public function get_next_step_id( $flow_id, $step_id ) {
166
-
167
- $steps = $this->get_flow_steps( $flow_id );
168
- $step_id = intval( $step_id );
169
-
170
- if ( ! $steps ) {
171
- return false;
172
- }
173
-
174
- foreach ( $steps as $i => $step ) {
175
-
176
- if ( intval( $step['id'] ) === $step_id ) {
177
-
178
- $next_i = $i + 1;
179
-
180
- if ( isset( $steps[ $next_i ] ) ) {
181
-
182
- $navigation = $steps[ $next_i ];
183
-
184
- return intval( $navigation['id'] );
185
- }
186
-
187
- break;
188
- }
189
- }
190
-
191
- return false;
192
- }
193
-
194
- /**
195
- * Get next id for step
196
- *
197
- * @param int $order_id order ID.
198
- * @return int
199
- */
200
- public function get_flow_id_from_order( $order_id ) {
201
-
202
- $flow_id = get_post_meta( $order_id, '_wcf_flow_id', true );
203
-
204
- return intval( $flow_id );
205
- }
206
-
207
- /**
208
- * Get checkout id for order
209
- *
210
- * @param int $order_id order ID.
211
- * @return int
212
- */
213
- public function get_checkout_id_from_order( $order_id ) {
214
-
215
- $checkout_id = get_post_meta( $order_id, '_wcf_checkout_id', true );
216
-
217
- return intval( $checkout_id );
218
- }
219
-
220
- /**
221
- * We are using this function mostly in ajax on checkout page
222
- *
223
- * @return bool
224
- */
225
- public function get_checkout_id_from_post_data() {
226
-
227
- if ( isset( $_POST['_wcf_checkout_id'] ) ) { //phpcs:ignore
228
-
229
- $checkout_id = filter_var( wp_unslash( $_POST['_wcf_checkout_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
230
-
231
- return intval( $checkout_id );
232
- }
233
-
234
- return false;
235
- }
236
-
237
- /**
238
- * We are using this function mostly in ajax on checkout page
239
- *
240
- * @return bool
241
- */
242
- public function get_flow_id_from_post_data() {
243
-
244
- if ( isset( $_POST['_wcf_flow_id'] ) ) { //phpcs:ignore
245
-
246
- $flow_id = filter_var( wp_unslash( $_POST['_wcf_flow_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
247
-
248
- return intval( $flow_id );
249
- }
250
-
251
- return false;
252
- }
253
-
254
- /**
255
- * Check for thank you page
256
- *
257
- * @param int $step_id step ID.
258
- * @return bool
259
- */
260
- public function check_is_thankyou_page( $step_id ) {
261
-
262
- $step_type = $this->get_step_type( $step_id );
263
-
264
- if ( 'thankyou' === $step_type ) {
265
-
266
- return true;
267
- }
268
-
269
- return false;
270
- }
271
-
272
- /**
273
- * Check for offer page
274
- *
275
- * @param int $step_id step ID.
276
- * @return bool
277
- */
278
- public function check_is_offer_page( $step_id ) {
279
-
280
- $step_type = $this->get_step_type( $step_id );
281
-
282
- if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
283
-
284
- return true;
285
- }
286
-
287
- return false;
288
- }
289
-
290
- /**
291
- * Check if loaded page requires woo.
292
- *
293
- * @return bool
294
- */
295
- public function check_is_woo_required_page() {
296
-
297
- global $post;
298
- $step_id = $post->ID;
299
- $woo_not_required_type = array( 'landing' );
300
- $step_type = $this->get_step_type( $step_id );
301
- return ( ! in_array( $step_type, $woo_not_required_type, true ) );
302
- }
303
-
304
- /**
305
- * Define constant for cache
306
- *
307
- * @return void
308
- */
309
- public function do_not_cache() {
310
-
311
- wcf_maybe_define_constant( 'DONOTCACHEPAGE', true );
312
- wcf_maybe_define_constant( 'DONOTCACHEOBJECT', true );
313
- wcf_maybe_define_constant( 'DONOTCACHEDB', true );
314
-
315
- nocache_headers();
316
- }
317
-
318
- /**
319
- * Get linking url
320
- *
321
- * @param array $args query args.
322
- * @return string
323
- */
324
- public function get_linking_url( $args = array() ) {
325
-
326
- $url = get_home_url();
327
-
328
- $url = add_query_arg( $args, $url );
329
-
330
- return $url;
331
- }
332
-
333
- /**
334
- * Get assets urls
335
- *
336
- * @return array
337
- * @since 1.1.6
338
- */
339
- public function get_assets_path() {
340
-
341
- $rtl = '';
342
-
343
- if ( is_rtl() ) {
344
- $rtl = '-rtl';
345
- }
346
-
347
- $file_prefix = '';
348
- $dir_name = '';
349
-
350
- $is_min = apply_filters( 'cartflows_load_min_assets', false );
351
-
352
- if ( $is_min ) {
353
- $file_prefix = '.min';
354
- $dir_name = 'min-';
355
- }
356
-
357
- $js_gen_path = CARTFLOWS_URL . 'assets/' . $dir_name . 'js/';
358
- $css_gen_path = CARTFLOWS_URL . 'assets/' . $dir_name . 'css/';
359
-
360
- return array(
361
- 'css' => $css_gen_path,
362
- 'js' => $js_gen_path,
363
- 'file_prefix' => $file_prefix,
364
- 'rtl' => $rtl,
365
- );
366
- }
367
-
368
- /**
369
- * Get assets css url
370
- *
371
- * @param string $file file name.
372
- * @return string
373
- * @since 1.1.6
374
- */
375
- public function get_css_url( $file ) {
376
-
377
- $assets_vars = wcf()->assets_vars;
378
-
379
- $url = $assets_vars['css'] . $file . $assets_vars['rtl'] . $assets_vars['file_prefix'] . '.css';
380
-
381
- return $url;
382
- }
383
-
384
- /**
385
- * Get assets js url
386
- *
387
- * @param string $file file name.
388
- * @return string
389
- * @since 1.1.6
390
- */
391
- public function get_js_url( $file ) {
392
-
393
- $assets_vars = wcf()->assets_vars;
394
-
395
- $url = $assets_vars['js'] . $file . $assets_vars['file_prefix'] . '.js';
396
-
397
- return $url;
398
- }
399
- }
400
-
401
- /**
402
- * Get a specific property of an array without needing to check if that property exists.
403
- *
404
- * Provide a default value if you want to return a specific value if the property is not set.
405
- *
406
- * @param array $array Array from which the property's value should be retrieved.
407
- * @param string $prop Name of the property to be retrieved.
408
- * @param string $default Optional. Value that should be returned if the property is not set or empty. Defaults to null.
409
- *
410
- * @return null|string|mixed The value
411
- */
412
- function wcf_get_prop( $array, $prop, $default = null ) {
413
-
414
- if ( ! is_array( $array ) && ! ( is_object( $array ) && $array instanceof ArrayAccess ) ) {
415
- return $default;
416
- }
417
-
418
- if ( isset( $array[ $prop ] ) ) {
419
- $value = $array[ $prop ];
420
- } else {
421
- $value = '';
422
- }
423
-
424
- return empty( $value ) && null !== $default ? $default : $value;
425
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Utils.
4
+ *
5
+ * @package CARTFLOWS
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+
12
+ /**
13
+ * Class Cartflows_Utils.
14
+ */
15
+ class Cartflows_Utils {
16
+
17
+ /**
18
+ * Member Variable
19
+ *
20
+ * @var instance
21
+ */
22
+ private static $instance;
23
+
24
+ /**
25
+ * Initiator
26
+ */
27
+ public static function get_instance() {
28
+ if ( ! isset( self::$instance ) ) {
29
+ self::$instance = new self();
30
+ }
31
+ return self::$instance;
32
+ }
33
+
34
+ /**
35
+ * Constructor
36
+ */
37
+ public function __construct() {
38
+ }
39
+
40
+ /**
41
+ * Get current post type
42
+ *
43
+ * @param string $post_type post type.
44
+ * @return string
45
+ */
46
+ public function current_post_type( $post_type = '' ) {
47
+
48
+ if ( '' === $post_type ) {
49
+ $post_type = get_post_type();
50
+ }
51
+
52
+ return $post_type;
53
+ }
54
+
55
+ /**
56
+ * Check if post type is of step.
57
+ *
58
+ * @param string $post_type post type.
59
+ * @return bool
60
+ */
61
+ public function is_step_post_type( $post_type = '' ) {
62
+
63
+ if ( $this->get_step_post_type() === $this->current_post_type( $post_type ) ) {
64
+
65
+ return true;
66
+ }
67
+
68
+ return false;
69
+ }
70
+
71
+ /**
72
+ * Check if post type is of flow.
73
+ *
74
+ * @param string $post_type post type.
75
+ * @return bool
76
+ */
77
+ public function is_flow_post_type( $post_type = '' ) {
78
+
79
+ if ( $this->get_flow_post_type() === $this->current_post_type( $post_type ) ) {
80
+
81
+ return true;
82
+ }
83
+
84
+ return false;
85
+ }
86
+
87
+ /**
88
+ * Get post type of step.
89
+ *
90
+ * @return string
91
+ */
92
+ public function get_step_post_type() {
93
+
94
+ return CARTFLOWS_STEP_POST_TYPE;
95
+ }
96
+
97
+ /**
98
+ * Get post type of flow.
99
+ *
100
+ * @return string
101
+ */
102
+ public function get_flow_post_type() {
103
+
104
+ return CARTFLOWS_FLOW_POST_TYPE;
105
+ }
106
+
107
+ /**
108
+ * Get flow id
109
+ *
110
+ * @return int
111
+ */
112
+ public function get_flow_id() {
113
+
114
+ global $post;
115
+
116
+ return get_post_meta( $post->ID, 'wcf-flow-id', true );
117
+ }
118
+
119
+ /**
120
+ * Get flow id by step
121
+ *
122
+ * @param int $step_id step ID.
123
+ * @return int
124
+ */
125
+ public function get_flow_id_from_step_id( $step_id ) {
126
+
127
+ return get_post_meta( $step_id, 'wcf-flow-id', true );
128
+ }
129
+
130
+ /**
131
+ * Get flow steps by id
132
+ *
133
+ * @param int $flow_id flow ID.
134
+ * @return int
135
+ */
136
+ public function get_flow_steps( $flow_id ) {
137
+
138
+ $steps = get_post_meta( $flow_id, 'wcf-steps', true );
139
+
140
+ if ( is_array( $steps ) && ! empty( $steps ) ) {
141
+ return $steps;
142
+ }
143
+
144
+ return false;
145
+ }
146
+
147
+ /**
148
+ * Get template type of step
149
+ *
150
+ * @param int $step_id step ID.
151
+ * @return int
152
+ */
153
+ public function get_step_type( $step_id ) {
154
+
155
+ return get_post_meta( $step_id, 'wcf-step-type', true );
156
+ }
157
+
158
+ /**
159
+ * Get next id for step
160
+ *
161
+ * @param int $flow_id flow ID.
162
+ * @param int $step_id step ID.
163
+ * @return bool
164
+ */
165
+ public function get_next_step_id( $flow_id, $step_id ) {
166
+
167
+ $steps = $this->get_flow_steps( $flow_id );
168
+ $step_id = intval( $step_id );
169
+
170
+ if ( ! $steps ) {
171
+ return false;
172
+ }
173
+
174
+ foreach ( $steps as $i => $step ) {
175
+
176
+ if ( intval( $step['id'] ) === $step_id ) {
177
+
178
+ $next_i = $i + 1;
179
+
180
+ if ( isset( $steps[ $next_i ] ) ) {
181
+
182
+ $navigation = $steps[ $next_i ];
183
+
184
+ return intval( $navigation['id'] );
185
+ }
186
+
187
+ break;
188
+ }
189
+ }
190
+
191
+ return false;
192
+ }
193
+
194
+ /**
195
+ * Get next id for step
196
+ *
197
+ * @param int $order_id order ID.
198
+ * @return int
199
+ */
200
+ public function get_flow_id_from_order( $order_id ) {
201
+
202
+ $flow_id = get_post_meta( $order_id, '_wcf_flow_id', true );
203
+
204
+ return intval( $flow_id );
205
+ }
206
+
207
+ /**
208
+ * Get checkout id for order
209
+ *
210
+ * @param int $order_id order ID.
211
+ * @return int
212
+ */
213
+ public function get_checkout_id_from_order( $order_id ) {
214
+
215
+ $checkout_id = get_post_meta( $order_id, '_wcf_checkout_id', true );
216
+
217
+ return intval( $checkout_id );
218
+ }
219
+
220
+ /**
221
+ * We are using this function mostly in ajax on checkout page
222
+ *
223
+ * @return bool
224
+ */
225
+ public function get_checkout_id_from_post_data() {
226
+
227
+ if ( isset( $_POST['_wcf_checkout_id'] ) ) { //phpcs:ignore
228
+
229
+ $checkout_id = filter_var( wp_unslash( $_POST['_wcf_checkout_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
230
+
231
+ return intval( $checkout_id );
232
+ }
233
+
234
+ return false;
235
+ }
236
+
237
+ /**
238
+ * We are using this function mostly in ajax on checkout page
239
+ *
240
+ * @return bool
241
+ */
242
+ public function get_flow_id_from_post_data() {
243
+
244
+ if ( isset( $_POST['_wcf_flow_id'] ) ) { //phpcs:ignore
245
+
246
+ $flow_id = filter_var( wp_unslash( $_POST['_wcf_flow_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
247
+
248
+ return intval( $flow_id );
249
+ }
250
+
251
+ return false;
252
+ }
253
+
254
+ /**
255
+ * Get optin id for order
256
+ *
257
+ * @param int $order_id order ID.
258
+ * @return int
259
+ */
260
+ public function get_optin_id_from_order( $order_id ) {
261
+
262
+ $optin_id = get_post_meta( $order_id, '_wcf_optin_id', true );
263
+
264
+ return intval( $optin_id );
265
+ }
266
+
267
+ /**
268
+ * We are using this function mostly in ajax on checkout page
269
+ *
270
+ * @return bool
271
+ */
272
+ public function get_optin_id_from_post_data() {
273
+
274
+ if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
275
+
276
+ $optin_id = filter_var( wp_unslash( $_POST['_wcf_optin_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
277
+
278
+ return intval( $optin_id );
279
+ }
280
+
281
+ return false;
282
+ }
283
+
284
+ /**
285
+ * Check for thank you page
286
+ *
287
+ * @param int $step_id step ID.
288
+ * @return bool
289
+ */
290
+ public function check_is_thankyou_page( $step_id ) {
291
+
292
+ $step_type = $this->get_step_type( $step_id );
293
+
294
+ if ( 'thankyou' === $step_type ) {
295
+
296
+ return true;
297
+ }
298
+
299
+ return false;
300
+ }
301
+
302
+ /**
303
+ * Check for offer page
304
+ *
305
+ * @param int $step_id step ID.
306
+ * @return bool
307
+ */
308
+ public function check_is_offer_page( $step_id ) {
309
+
310
+ $step_type = $this->get_step_type( $step_id );
311
+
312
+ if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
313
+
314
+ return true;
315
+ }
316
+
317
+ return false;
318
+ }
319
+
320
+ /**
321
+ * Check if loaded page requires woo.
322
+ *
323
+ * @return bool
324
+ */
325
+ public function check_is_woo_required_page() {
326
+
327
+ global $post;
328
+ $step_id = $post->ID;
329
+ $woo_not_required_type = array( 'landing' );
330
+ $step_type = $this->get_step_type( $step_id );
331
+ return ( ! in_array( $step_type, $woo_not_required_type, true ) );
332
+ }
333
+
334
+ /**
335
+ * Define constant for cache
336
+ *
337
+ * @return void
338
+ */
339
+ public function do_not_cache() {
340
+
341
+ wcf_maybe_define_constant( 'DONOTCACHEPAGE', true );
342
+ wcf_maybe_define_constant( 'DONOTCACHEOBJECT', true );
343
+ wcf_maybe_define_constant( 'DONOTCACHEDB', true );
344
+
345
+ nocache_headers();
346
+ }
347
+
348
+ /**
349
+ * Get linking url
350
+ *
351
+ * @param array $args query args.
352
+ * @return string
353
+ */
354
+ public function get_linking_url( $args = array() ) {
355
+
356
+ $url = get_home_url();
357
+
358
+ $url = add_query_arg( $args, $url );
359
+
360
+ return $url;
361
+ }
362
+
363
+ /**
364
+ * Get assets urls
365
+ *
366
+ * @return array
367
+ * @since 1.1.6
368
+ */
369
+ public function get_assets_path() {
370
+
371
+ $rtl = '';
372
+
373
+ if ( is_rtl() ) {
374
+ $rtl = '-rtl';
375
+ }
376
+
377
+ $file_prefix = '';
378
+ $dir_name = '';
379
+
380
+ $is_min = apply_filters( 'cartflows_load_min_assets', false );
381
+
382
+ if ( $is_min ) {
383
+ $file_prefix = '.min';
384
+ $dir_name = 'min-';
385
+ }
386
+
387
+ $js_gen_path = CARTFLOWS_URL . 'assets/' . $dir_name . 'js/';
388
+ $css_gen_path = CARTFLOWS_URL . 'assets/' . $dir_name . 'css/';
389
+
390
+ return array(
391
+ 'css' => $css_gen_path,
392
+ 'js' => $js_gen_path,
393
+ 'file_prefix' => $file_prefix,
394
+ 'rtl' => $rtl,
395
+ );
396
+ }
397
+
398
+ /**
399
+ * Get assets css url
400
+ *
401
+ * @param string $file file name.
402
+ * @return string
403
+ * @since 1.1.6
404
+ */
405
+ public function get_css_url( $file ) {
406
+
407
+ $assets_vars = wcf()->assets_vars;
408
+
409
+ $url = $assets_vars['css'] . $file . $assets_vars['rtl'] . $assets_vars['file_prefix'] . '.css';
410
+
411
+ return $url;
412
+ }
413
+
414
+ /**
415
+ * Get assets js url
416
+ *
417
+ * @param string $file file name.
418
+ * @return string
419
+ * @since 1.1.6
420
+ */
421
+ public function get_js_url( $file ) {
422
+
423
+ $assets_vars = wcf()->assets_vars;
424
+
425
+ $url = $assets_vars['js'] . $file . $assets_vars['file_prefix'] . '.js';
426
+
427
+ return $url;
428
+ }
429
+ }
430
+
431
+ /**
432
+ * Get a specific property of an array without needing to check if that property exists.
433
+ *
434
+ * Provide a default value if you want to return a specific value if the property is not set.
435
+ *
436
+ * @param array $array Array from which the property's value should be retrieved.
437
+ * @param string $prop Name of the property to be retrieved.
438
+ * @param string $default Optional. Value that should be returned if the property is not set or empty. Defaults to null.
439
+ *
440
+ * @return null|string|mixed The value
441
+ */
442
+ function wcf_get_prop( $array, $prop, $default = null ) {
443
+
444
+ if ( ! is_array( $array ) && ! ( is_object( $array ) && $array instanceof ArrayAccess ) ) {
445
+ return $default;
446
+ }
447
+
448
+ if ( isset( $array[ $prop ] ) ) {
449
+ $value = $array[ $prop ];
450
+ } else {
451
+ $value = '';
452
+ }
453
+
454
+ return empty( $value ) && null !== $default ? $default : $value;
455
+ }
classes/class-cartflows-wizard.php CHANGED
@@ -1,679 +1,679 @@
1
- <?php
2
- /**
3
- * CartFlows- Onboarding Wizard
4
- *
5
- * @package cartflows
6
- */
7
-
8
- if ( ! defined( 'ABSPATH' ) ) {
9
- exit;
10
- }
11
-
12
- if ( ! class_exists( 'CartFlows_Wizard' ) ) :
13
-
14
- /**
15
- * CartFlows_Wizard class.
16
- */
17
- class CartFlows_Wizard {
18
-
19
- /**
20
- * Hook in tabs.
21
- */
22
- public function __construct() {
23
-
24
- if ( apply_filters( 'cartflows_enable_setup_wizard', true ) && current_user_can( 'manage_options' ) ) {
25
- add_action( 'admin_menu', array( $this, 'admin_menus' ) );
26
- add_action( 'admin_init', array( $this, 'setup_wizard' ) );
27
- add_action( 'admin_notices', array( $this, 'show_setup_wizard' ) );
28
- add_action( 'wp_ajax_page_builder_step_save', array( $this, 'page_builder_step_save' ) );
29
- add_action( 'wp_ajax_page_builder_save_option', array( $this, 'save_page_builder_option' ) );
30
- add_action( 'admin_head', array( $this, 'add_mautic_form_script' ) );
31
- add_action( 'woocommerce_installed', array( $this, 'disable_woo_setup_redirect' ) );
32
-
33
- add_action( 'wp_ajax_wcf_activate_wc_plugins', array( $this, 'activate_wc_plugins' ) );
34
-
35
- add_action( 'admin_init', array( $this, 'hide_notices' ) );
36
-
37
- }
38
- }
39
-
40
-
41
- /**
42
- * Hide a notice if the GET variable is set.
43
- */
44
- public function hide_notices() {
45
-
46
- if ( ! isset( $_GET['wcf-hide-notice'] ) ) {
47
- return;
48
- }
49
-
50
- $wcf_hide_notice = filter_input( INPUT_GET, 'wcf-hide-notice', FILTER_SANITIZE_STRING );
51
- $_wcf_notice_nonce = filter_input( INPUT_GET, '_wcf_notice_nonce', FILTER_SANITIZE_STRING );
52
-
53
- if ( $wcf_hide_notice && $_wcf_notice_nonce && wp_verify_nonce( sanitize_text_field( wp_unslash( $_wcf_notice_nonce ) ), 'wcf_hide_notices_nonce' ) ) {
54
- update_option( 'wcf_setup_skipped', true );
55
- }
56
- }
57
-
58
- /**
59
- * Disable the woo redirect for new setup.
60
- */
61
- public function disable_woo_setup_redirect() {
62
-
63
- if ( empty( $_GET['page'] ) || 'cartflow-setup' !== $_GET['page'] ) { //phpcs:ignore
64
- return;
65
- }
66
-
67
- delete_transient( '_wc_activation_redirect' );
68
- }
69
-
70
- /**
71
- * Show action links on the plugin screen.
72
- *
73
- * @since 1.0.0
74
- * @return void
75
- */
76
- public function show_setup_wizard() {
77
-
78
- $status = get_option( 'wcf_setup_complete', false );
79
- $skip_setup = get_option( 'wcf_setup_skipped', false );
80
-
81
- if ( false === $status && ! $skip_setup ) { ?>
82
- <div class="notice notice-info">
83
- <p><b><?php esc_html_e( 'Thanks for installing and using CartFlows!', 'cartflows' ); ?></b></p>
84
- <p><?php esc_html_e( 'It is easy to use the CartFlows. Please use the setup wizard to quick start setup.', 'cartflows' ); ?></p>
85
- <p>
86
- <a href="<?php echo esc_url( admin_url( 'index.php?page=cartflow-setup' ) ); ?>" class="button button-primary"> <?php esc_html_e( 'Start Wizard', 'cartflows' ); ?></a>
87
- <a class="button-secondary" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wcf-hide-notice', 'install' ), 'wcf_hide_notices_nonce', '_wcf_notice_nonce' ) ); ?>"><?php esc_html_e( 'Skip Setup', 'cartflows' ); ?></a>
88
- </p>
89
- </div>
90
- <?php
91
- }
92
- }
93
-
94
- /**
95
- * Add admin menus/screens.
96
- */
97
- public function admin_menus() {
98
-
99
- if ( empty( $_GET['page'] ) || 'cartflow-setup' !== $_GET['page'] ) { //phpcs:ignore
100
- return;
101
- }
102
-
103
- add_dashboard_page( '', '', 'manage_options', 'cartflow-setup', '' );
104
- }
105
-
106
- /**
107
- * Show the setup wizard.
108
- */
109
- public function setup_wizard() {
110
-
111
- if ( empty( $_GET['page'] ) || 'cartflow-setup' !== $_GET['page'] ) { //phpcs:ignore
112
- return;
113
- }
114
-
115
- $this->steps = array(
116
- 'basic-config' => array(
117
- 'name' => __( 'Welcome', 'cartflows' ),
118
- 'view' => array( $this, 'welcome_step' ),
119
- 'handler' => array( $this, 'welcome_step_save' ),
120
- ),
121
- 'page-builder' => array(
122
- 'name' => __( 'Page Builder', 'cartflows' ),
123
- 'view' => array( $this, 'page_builder_step' ),
124
- ),
125
- 'checkout' => array(
126
- 'name' => __( 'Checkout', 'cartflows' ),
127
- 'view' => array( $this, 'checkout_step' ),
128
- ),
129
- 'training' => array(
130
- 'name' => __( 'Training', 'cartflows' ),
131
- 'view' => array( $this, 'training_step' ),
132
- ),
133
- 'setup-ready' => array(
134
- 'name' => __( 'Ready!', 'cartflows' ),
135
- 'view' => array( $this, 'ready_step' ),
136
- 'handler' => '',
137
- ),
138
- );
139
-
140
- $this->step = isset( $_GET['step'] ) ? sanitize_text_field( $_GET['step'] ) : current( array_keys( $this->steps ) ); //phpcs:ignore
141
-
142
- wp_enqueue_style( 'cartflows-setup', CARTFLOWS_URL . 'admin/assets/css/setup-wizard.css', array( 'dashicons' ), CARTFLOWS_VER );
143
- wp_style_add_data( 'cartflows-setup', 'rtl', 'replace' );
144
-
145
- wp_enqueue_script( 'cartflows-setup', CARTFLOWS_URL . 'admin/assets/js/setup-wizard.js', array( 'jquery', 'wp-util', 'updates' ), CARTFLOWS_VER, false );
146
-
147
- wp_localize_script( 'cartflows-setup', 'cartflows_setup_vars', self::localize_vars() );
148
-
149
- wp_enqueue_media();
150
-
151
- if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) { //phpcs:ignore
152
- call_user_func( $this->steps[ $this->step ]['handler'] );
153
- }
154
-
155
- ob_start();
156
- $this->setup_wizard_header();
157
- $this->setup_wizard_steps();
158
- $this->setup_wizard_content();
159
- $this->setup_wizard_footer();
160
- exit;
161
- }
162
-
163
- /**
164
- * Get current step slug
165
- */
166
- public function get_current_step_slug() {
167
- $keys = array_keys( $this->steps );
168
- return $keys[ array_search( $this->step, array_keys( $this->steps ), true ) ];
169
- }
170
-
171
- /**
172
- * Get previous step link
173
- */
174
- public function get_prev_step_link() {
175
- $keys = array_keys( $this->steps );
176
- return add_query_arg( 'step', $keys[ array_search( $this->step, array_keys( $this->steps ), true ) - 1 ] );
177
- }
178
-
179
- /**
180
- * Get next step link
181
- */
182
- public function get_next_step_link() {
183
- $keys = array_keys( $this->steps );
184
- return add_query_arg( 'step', $keys[ array_search( $this->step, array_keys( $this->steps ), true ) + 1 ] );
185
- }
186
-
187
- /**
188
- * Get next step link
189
- */
190
- public function get_next_step_plain_link() {
191
- $keys = array_keys( $this->steps );
192
- $step_index = array_search( $this->step, $keys, true );
193
- $step_index = ( count( $keys ) == $step_index + 1 ) ? $step_index : $step_index + 1;
194
- $step = $keys[ $step_index ];
195
- return admin_url( 'index.php?page=cartflow-setup&step=' . $step );
196
- }
197
-
198
- /**
199
- * Setup Wizard Header.
200
- */
201
- public function setup_wizard_header() {
202
- ?>
203
- <!DOCTYPE html>
204
- <html>
205
- <head>
206
- <meta name="viewport" content="width=device-width" />
207
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
208
- <title><?php esc_html_e( 'CartFlows Setup', 'cartflows' ); ?></title>
209
-
210
- <script type="text/javascript">
211
- addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
212
- var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>';
213
- var pagenow = '';
214
- </script>
215
- <?php wp_print_scripts( array( 'cartflows-setup' ) ); ?>
216
- <?php do_action( 'admin_print_styles' ); ?>
217
- <?php do_action( 'admin_head' ); ?>
218
- </head>
219
- <body class="cartflows-setup wp-core-ui cartflows-step-<?php echo esc_attr( $this->get_current_step_slug() ); ?>">
220
- <div id="cartflows-logo">
221
- <img height="40" class="wcf-logo" src="<?php echo CARTFLOWS_URL . 'assets/images/cartflows-logo.svg'; ?>" />
222
- </div>
223
- <?php
224
- }
225
-
226
- /**
227
- * Setup Wizard Footer.
228
- */
229
- public function setup_wizard_footer() {
230
-
231
- $admin_url = admin_url( 'admin.php?page=cartflows_settings' );
232
- ?>
233
- <div class="close-button-wrapper">
234
- <a href="<?php echo esc_url( $admin_url ); ?>" class="wizard-close-link" ><?php esc_html_e( 'Exit Setup Wizard', 'cartflows' ); ?></a>
235
- </div>
236
- </body>
237
- </html>
238
- <?php
239
- }
240
-
241
- /**
242
- * Output the steps.
243
- */
244
- public function setup_wizard_steps() {
245
-
246
- $ouput_steps = $this->steps;
247
- ?>
248
- <ol class="cartflows-setup-steps">
249
- <?php
250
- foreach ( $ouput_steps as $step_key => $step ) :
251
- $classes = '';
252
- $activated = false;
253
- if ( $step_key === $this->step ) {
254
- $classes = 'active';
255
- $activated = true;
256
- } elseif ( array_search( $this->step, array_keys( $this->steps ), true ) > array_search( $step_key, array_keys( $this->steps ), true ) ) {
257
- $classes = 'done';
258
- $activated = true;
259
- }
260
- ?>
261
- <li class="<?php echo esc_attr( $classes ); ?>">
262
- <span><?php echo esc_html( $step['name'] ); ?></span>
263
- </li>
264
- <?php endforeach; ?>
265
- </ol>
266
- <?php
267
- }
268
-
269
- /**
270
- * Output the content for the current step.
271
- */
272
- public function setup_wizard_content() {
273
- ?>
274
- <input type="hidden" class="wcf-redirect-link" data-redirect-link="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>" >
275
- <?php
276
-
277
- echo '<div class="cartflows-setup-content">';
278
- call_user_func( $this->steps[ $this->step ]['view'] );
279
- echo '</div>';
280
- }
281
-
282
- /**
283
- * Introduction step.
284
- */
285
- public function welcome_step() {
286
- ?>
287
- <h1><?php esc_html_e( 'Welcome to CartFlows!', 'cartflows' ); ?></h1>
288
- <p><?php esc_html_e( 'Thank you for choosing CartFlows to get more leads, increase conversions, & maximize profits. This short setup wizard will guide you though configuring CartFlows and creating your first funnel.', 'cartflows' ); ?></p>
289
- <form method="post">
290
- <div class="cartflows-setup-actions step">
291
- <div class="button-prev-wrap">
292
- </div>
293
- <div class="button-next-wrap">
294
- <input type="submit" class="uct-activate button-primary button button-large " value="<?php esc_html_e( 'Lets Go »', 'cartflows' ); ?>" name="save_step" />
295
- </div>
296
- <?php wp_nonce_field( 'cartflow-setup' ); ?>
297
- </div>
298
- </form>
299
- <?php
300
- }
301
-
302
- /**
303
- * Save Locale Settings.
304
- */
305
- public function welcome_step_save() {
306
- check_admin_referer( 'cartflow-setup' );
307
-
308
- // Update site title & tagline.
309
- $redirect_url = $this->get_next_step_link();
310
-
311
- wp_safe_redirect( esc_url_raw( $redirect_url ) );
312
- exit;
313
- }
314
-
315
- /**
316
- * Locale settings
317
- */
318
- public function page_builder_step() {
319
- ?>
320
-
321
- <h1><?php esc_html_e( 'Page Builder Setup', 'cartflows' ); ?></h1>
322
- <p class="description"><?php esc_html_e( 'Please select a page builder you would like to use with CartFlows.', 'cartflows' ); ?></p>
323
- <form method="post">
324
- <table class="cartflows-table widefat">
325
- <tr class="cartflows-row">
326
- <td class="cartflows-row-heading">
327
- <label><?php esc_html_e( 'Select Page Builder', 'cartflows' ); ?></label>
328
- </td>
329
- <td class="cartflows-row-content">
330
- <?php
331
- $installed_plugins = get_plugins();
332
- $plugins = array(
333
- array(
334
- 'title' => __( 'Elementor', 'cartflows' ),
335
- 'value' => 'elementor',
336
- 'data' => array(
337
- 'slug' => 'elementor',
338
- 'init' => 'elementor/elementor.php',
339
- 'active' => is_plugin_active( 'elementor/elementor.php' ) ? 'yes' : 'no',
340
- 'install' => isset( $installed_plugins['elementor/elementor.php'] ) ? 'yes' : 'no',
341
- ),
342
- ),
343
- array(
344
- 'title' => __( 'Beaver Builder Plugin (Lite Version)', 'cartflows' ),
345
- 'value' => 'beaver-builder',
346
- 'data' => array(
347
- 'slug' => 'beaver-builder-lite-version',
348
- 'init' => 'beaver-builder-lite-version/fl-builder.php',
349
- 'active' => is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) ? 'yes' : 'no',
350
- 'install' => isset( $installed_plugins['beaver-builder-lite-version/fl-builder.php'] ) ? 'yes' : 'no',
351
- ),
352
- ),
353
- array(
354
- 'title' => __( 'Divi', 'cartflows' ),
355
- 'value' => 'divi',
356
- 'data' => array(
357
- 'slug' => 'divi',
358
- 'init' => 'divi',
359
- 'active' => 'yes',
360
- 'install' => 'NA',
361
- ),
362
- ),
363
- array(
364
- 'title' => __( 'Other', 'cartflows' ),
365
- 'value' => 'other',
366
- 'data' => array(
367
- 'slug' => 'other',
368
- 'init' => false,
369
- 'active' => 'yes',
370
- 'install' => 'NA',
371
- ),
372
- ),
373
- );
374
- ?>
375
- <input type="hidden" name="save-pb-input" id="save-pb-option" value="1" />
376
- <select name="page-builder" class="page-builder-list" data-redirect-link="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>">
377
- <?php
378
- foreach ( $plugins as $key => $plugin ) {
379
- echo '<option value="' . esc_attr( $plugin['value'] ) . '" data-install="' . esc_attr( $plugin['data']['install'] ) . '" data-active="' . esc_attr( $plugin['data']['active'] ) . '" data-slug="' . esc_attr( $plugin['data']['slug'] ) . '" data-init="' . esc_attr( $plugin['data']['init'] ) . '">' . esc_html( $plugin['title'] ) . '</option>';
380
- }
381
- ?>
382
- </select>
383
- </td>
384
- </tr>
385
- </table>
386
- <p><?php esc_html_e( 'While CartFlows Should work with most page builders, we offer templates for the above page builders.', 'cartflows' ); ?></p>
387
- <div class="cartflows-setup-actions step">
388
- <div class="button-prev-wrap">
389
- <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>" class="button-primary button button-large button-prev" ><?php esc_html_e( '« Previous', 'cartflows' ); ?></a>
390
- </div>
391
- <div class="button-next-wrap">
392
- <a href="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>" class="button button-large button-next" ><?php esc_html_e( 'Skip this step', 'cartflows' ); ?></a>
393
- <a href="#" class="button button-primary wcf-install-plugins"><?php esc_html_e( 'Next »', 'cartflows' ); ?></a>
394
- </div>
395
- <?php wp_nonce_field( 'cartflow-setup' ); ?>
396
- </div>
397
- </form>
398
- <?php
399
- }
400
-
401
- /**
402
- * Render checkout step.
403
- */
404
- public function checkout_step() {
405
-
406
- $installed_plugins = get_plugins();
407
- $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? 'yes' : 'no';
408
- $is_wcf_ca_installed = isset( $installed_plugins['woo-cart-abandonment-recovery/woo-cart-abandonment-recovery.php'] ) ? 'yes' : 'no';
409
- $is_active = class_exists( 'WooCommerce' ) ? 'yes' : 'no';
410
- $is_wcf_ca_active = class_exists( 'CARTFLOWS_CA_Loader' ) ? 'yes' : 'no';
411
- ?>
412
- <h1><?php esc_html_e( 'Choose a checkout', 'cartflows' ); ?></h1>
413
- <div class="cartflows-setup-message">
414
- <p>
415
- <?php esc_html_e( 'While CartFlows is designed to use WooCommerce sell digital and physical products, not all funnels need a checkout system.', 'cartflows' ); ?>
416
- </p>
417
- <h4 class="cartflows-setup-message-title"><?php esc_html_e( 'Would you like to install WooCommerce to sell digital and physical products in your funnels?', 'cartflows' ); ?></h4>
418
- <span><input data-wcf-ca-active="<?php echo esc_attr( $is_wcf_ca_active ); ?>" data-wcf-ca-install="<?php echo esc_attr( $is_wcf_ca_installed ); ?>" data-woo-active="<?php echo esc_attr( $is_active ); ?>" data-woo-install="<?php echo esc_attr( $is_wc_installed ); ?>" type="hidden" class="wcf-install-wc-input" name="installl-woocommerce" value="" checked></span>
419
- </div>
420
-
421
- <div class="cartflows-setup-extra-notice">
422
-
423
- <span>
424
- <?php esc_html_e( 'The following plugin will be installed and activated for you:', 'cartflows' ); ?>
425
- <a target="_blank" href="https://wordpress.org/plugins/woo-cart-abandonment-recovery/"> <?php esc_html_e( 'WooCommerce', 'cartflows' ); ?></a>,
426
- <a target="_blank" href="https://wordpress.org/plugins/woo-cart-abandonment-recovery/"> <?php esc_html_e( 'WooCommerce Cart Abandonment Recovery', 'cartflows' ); ?></a>
427
-
428
- </span>
429
-
430
- </div>
431
-
432
- <div class="cartflows-setup-actions step">
433
- <div class="button-prev-wrap">
434
- <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>" class="button-primary button button-large button-prev" ><?php esc_html_e( '« Previous', 'cartflows' ); ?></a>
435
- </div>
436
- <div class="button-next-wrap">
437
- <a href="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>" class="button button-large button-next"><?php esc_html_e( 'No thanks', 'cartflows' ); ?></a>
438
- <a class="wcf-install-wc button-primary button button-large" name="save_step" > <?php esc_html_e( 'Yes', 'cartflows' ); ?> </a>
439
- </div>
440
- </div>
441
-
442
- <?php
443
- }
444
-
445
- /**
446
- * Save Locale Settings.
447
- */
448
- public function activate_wc_plugins() {
449
-
450
- check_ajax_referer( 'wcf-wc-plugins-activate', 'security' );
451
-
452
- $plugin_slug_arr = array(
453
- 'woocommerce/woocommerce.php' => true,
454
- 'woo-cart-abandonment-recovery/woo-cart-abandonment-recovery.php' => false,
455
- );
456
-
457
- $activate = array(
458
- 'woocommerce/woocommerce.php' => false,
459
- 'woo-cart-abandonment-recovery/woo-cart-abandonment-recovery.php' => false,
460
- );
461
-
462
- foreach ( $plugin_slug_arr as $slug => $do_silently ) {
463
-
464
- $activate[ $slug ] = activate_plugin( $slug, '', false, $do_silently );
465
- }
466
-
467
- foreach ( $activate as $slug => $data ) {
468
-
469
- if ( is_wp_error( $data ) ) {
470
- wp_send_json_error(
471
- array(
472
- 'success' => false,
473
- 'message' => $data->get_error_message(),
474
- )
475
- );
476
- }
477
- }
478
-
479
- wp_send_json_success();
480
- }
481
-
482
- /**
483
- * Save Locale Settings.
484
- */
485
- public function page_builder_step_save() {
486
-
487
- check_ajax_referer( 'wcf-page-builder-step-save', 'security' );
488
-
489
- $plugin_init = isset( $_POST['plugin_init'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin_init'] ) ) : '';
490
- $save_option = ( isset( $_POST['save_builder_option'] ) && 'true' == $_POST['save_builder_option'] ) ? true : false;
491
- $plugin_slug = filter_input( INPUT_POST, 'page_builder', FILTER_SANITIZE_STRING );
492
-
493
- $do_sliently = true;
494
- if ( 'woo-cart-abandonment-recovery' === $plugin_slug ) {
495
- $do_sliently = false;
496
- }
497
-
498
- $activate = activate_plugin( $plugin_init, '', false, $do_sliently );
499
-
500
- if ( $save_option ) {
501
- $this->save_page_builder_option();
502
- }
503
-
504
- if ( is_wp_error( $activate ) ) {
505
- wp_send_json_error(
506
- array(
507
- 'success' => false,
508
- 'message' => $activate->get_error_message(),
509
- )
510
- );
511
- }
512
-
513
- wp_send_json_success(
514
- array( 'plugin' => $plugin_slug )
515
- );
516
- }
517
-
518
- /**
519
- * Save selected page builder in options database.
520
- */
521
- public function save_page_builder_option() {
522
-
523
- $page_builder = isset( $_POST['page_builder'] ) ? sanitize_text_field( wp_unslash( $_POST['page_builder'] ) ) : ''; //phpcs:ignore
524
-
525
- $wcf_settings = get_option( '_cartflows_common', array() );
526
-
527
- if ( false !== strpos( $page_builder, 'beaver-builder' ) ) {
528
- $page_builder = 'beaver-builder';
529
- }
530
-
531
- $wcf_settings['default_page_builder'] = $page_builder;
532
-
533
- update_option( '_cartflows_common', $wcf_settings );
534
-
535
- wp_send_json_success(
536
- array( 'plugin' => $page_builder )
537
- );
538
-
539
- }
540
-
541
- /**
542
- * Final step.
543
- */
544
- public function ready_step() {
545
-
546
- // Set setup wizard status to complete.
547
- update_option( 'wcf_setup_complete', true );
548
- ?>
549
- <h1><?php esc_html_e( 'Congratulations, You Did It!', 'cartflows' ); ?></h1>
550
-
551
- <div class="cartflows-setup-next-steps">
552
- <div class="cartflows-setup-next-steps-last">
553
-
554
- <p class="success">
555
- <?php
556
- esc_html_e( 'CartFlows is ready to use on your website. You\'ve successfully completed the setup process and all that is left for you to do is create your first flow.', 'cartflows' )
557
- ?>
558
- </p>
559
-
560
-
561
- <ul class="wcf-wizard-next-steps">
562
- <li class="wcf-wizard-next-step-item">
563
- <div class="wcf-wizard-next-step-description">
564
- <p class="next-step-heading">Next step</p>
565
- <h3 class="next-step-description">Create First Flow</h3>
566
- <p class="next-step-extra-info">You're ready to add flows to your website.</p>
567
- </div>
568
- <div class="wcf-wizard-next-step-action">
569
- <p class="wc-setup-actions step">
570
- <a href="<?php echo esc_url( admin_url( 'edit.php?post_type=cartflows_flow&add-new-flow' ) ); ?>" type="button" class="button button-primary button-hero" ><?php esc_html_e( 'Create a flow', 'cartflows' ); ?></a>
571
- </p>
572
- </div>
573
- </li>
574
- </ul>
575
-
576
- </div>
577
- </div>
578
- <?php
579
- }
580
-
581
- /**
582
- * Training course step.
583
- */
584
- public function training_step() {
585
- $current_user = wp_get_current_user();
586
- ?>
587
- <h1><?php esc_html_e( 'Exclusive CartFlows Training Course Offer', 'cartflows' ); ?></h1>
588
-
589
- <div id="mauticform_wrapper_cartflowsonboarding" class="mauticform_wrapper">
590
- <form autocomplete="false" role="form" method="post" action="https://go.cartflows.com/form/submit?formId=2" id="mauticform_cartflowsonboarding" data-mautic-form="cartflowsonboarding" enctype="multipart/form-data">
591
- <div class="mauticform-error" id="mauticform_cartflowsonboarding_error"></div>
592
- <div class="mauticform-message" id="mauticform_cartflowsonboarding_message"></div>
593
- <div class="mauticform-innerform">
594
- <div class="mauticform-page-wrapper mauticform-page-1" data-mautic-form-page="1">
595
- <div id="mauticform_cartflowsonboarding_enter_your_email" class="mauticform-row mauticform-email mauticform-field-1">
596
- <div class="cartflows-setup-message">
597
- <p>
598
- <?php esc_html_e( 'We want you to get off to a great start using CartFlows, so we would like to give access to our exclusive training course.', 'cartflows' ); ?>
599
- <?php esc_html_e( 'Get access to this couse, for free, by entering your email below.', 'cartflows' ); ?>
600
- </p>
601
- <input id="mauticform_input_cartflowsonboarding_enter_your_email" name="mauticform[enter_your_email]" placeholder="<?php esc_html_e( 'Enter Email address', 'cartflows' ); ?>" value="<?php echo $current_user->user_email; ?>" class="mauticform-input" type="email">
602
- </div>
603
- <span class="mauticform-errormsg" style="display: none;"></span>
604
- </div>
605
- </div>
606
- </div>
607
-
608
- <input type="hidden" name="mauticform[formId]" id="mauticform_cartflowsonboarding_id" value="2">
609
- <input type="hidden" name="mauticform[return]" id="mauticform_cartflowsonboarding_return" value="">
610
- <input type="hidden" name="mauticform[formName]" id="mauticform_cartflowsonboarding_name" value="cartflowsonboarding">
611
- <div class="cartflows-setup-actions step">
612
- <div class="button-prev-wrap">
613
- <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>" class="button-primary button button-large button-prev" ><?php esc_html_e( '« Previous', 'cartflows' ); ?></a>
614
- </div>
615
- <div class="button-next-wrap">
616
- <a href="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>" class="button button-large button-next"><?php esc_html_e( 'No thanks', 'cartflows' ); ?></a>
617
- <button type="submit" name="mauticform[submit]" id="mauticform_input_cartflowsonboarding_submit" value="<?php esc_html_e( 'Allow', 'cartflows' ); ?>" class="mautic-form-submit btn btn-default button-primary button button-large button-next" name="save_step"><?php esc_html_e( 'Allow', 'cartflows' ); ?></button>
618
- </div>
619
- </div>
620
- </form>
621
- </div>
622
- <?php
623
- }
624
-
625
- /**
626
- * Localize variables in admin
627
- */
628
- public function localize_vars() {
629
-
630
- $vars = array();
631
-
632
- $ajax_actions = array(
633
- 'wcf_page_builder_step_save',
634
- 'wcf_wc_plugins_activate',
635
- );
636
-
637
- foreach ( $ajax_actions as $action ) {
638
-
639
- $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
640
- }
641
-
642
- return $vars;
643
- }
644
-
645
- /**
646
- * Add JS script for mautic form
647
- */
648
- public function add_mautic_form_script() {
649
-
650
- if ( ! isset( $_REQUEST['page'] ) || ( isset( $_REQUEST['page'] ) && 'cartflow-setup' !== $_REQUEST['page'] ) ) { //phpcs:ignore
651
- return;
652
- }
653
- ?>
654
-
655
- <script type="text/javascript">
656
- /** This section is only needed once per page if manually copying **/
657
- if (typeof MauticSDKLoaded == 'undefined') {
658
- var MauticSDKLoaded = true;
659
- var head = document.getElementsByTagName('head')[0];
660
- var script = document.createElement('script');
661
- script.type = 'text/javascript';
662
- script.src = 'https://go.cartflows.com/media/js/mautic-form.js';
663
- script.onload = function() {
664
- MauticSDK.onLoad();
665
- };
666
- head.appendChild(script);
667
- var MauticDomain = 'https://go.cartflows.com';
668
- var MauticLang = {
669
- 'submittingMessage': "Please wait..."
670
- };
671
- }
672
- </script>
673
- <?php
674
- }
675
- }
676
-
677
- new CartFlows_Wizard();
678
-
679
- endif;
1
+ <?php
2
+ /**
3
+ * CartFlows- Onboarding Wizard
4
+ *
5
+ * @package cartflows
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ if ( ! class_exists( 'CartFlows_Wizard' ) ) :
13
+
14
+ /**
15
+ * CartFlows_Wizard class.
16
+ */
17
+ class CartFlows_Wizard {
18
+
19
+ /**
20
+ * Hook in tabs.
21
+ */
22
+ public function __construct() {
23
+
24
+ if ( apply_filters( 'cartflows_enable_setup_wizard', true ) && current_user_can( 'manage_options' ) ) {
25
+ add_action( 'admin_menu', array( $this, 'admin_menus' ) );
26
+ add_action( 'admin_init', array( $this, 'setup_wizard' ) );
27
+ add_action( 'admin_notices', array( $this, 'show_setup_wizard' ) );
28
+ add_action( 'wp_ajax_page_builder_step_save', array( $this, 'page_builder_step_save' ) );
29
+ add_action( 'wp_ajax_page_builder_save_option', array( $this, 'save_page_builder_option' ) );
30
+ add_action( 'admin_head', array( $this, 'add_mautic_form_script' ) );
31
+ add_action( 'woocommerce_installed', array( $this, 'disable_woo_setup_redirect' ) );
32
+
33
+ add_action( 'wp_ajax_wcf_activate_wc_plugins', array( $this, 'activate_wc_plugins' ) );
34
+
35
+ add_action( 'admin_init', array( $this, 'hide_notices' ) );
36
+
37
+ }
38
+ }
39
+
40
+
41
+ /**
42
+ * Hide a notice if the GET variable is set.
43
+ */
44
+ public function hide_notices() {
45
+
46
+ if ( ! isset( $_GET['wcf-hide-notice'] ) ) {
47
+ return;
48
+ }
49
+
50
+ $wcf_hide_notice = filter_input( INPUT_GET, 'wcf-hide-notice', FILTER_SANITIZE_STRING );
51
+ $_wcf_notice_nonce = filter_input( INPUT_GET, '_wcf_notice_nonce', FILTER_SANITIZE_STRING );
52
+
53
+ if ( $wcf_hide_notice && $_wcf_notice_nonce && wp_verify_nonce( sanitize_text_field( wp_unslash( $_wcf_notice_nonce ) ), 'wcf_hide_notices_nonce' ) ) {
54
+ update_option( 'wcf_setup_skipped', true );
55
+ }
56
+ }
57
+
58
+ /**
59
+ * Disable the woo redirect for new setup.
60
+ */
61
+ public function disable_woo_setup_redirect() {
62
+
63
+ if ( empty( $_GET['page'] ) || 'cartflow-setup' !== $_GET['page'] ) { //phpcs:ignore
64
+ return;
65
+ }
66
+
67
+ delete_transient( '_wc_activation_redirect' );
68
+ }
69
+
70
+ /**
71
+ * Show action links on the plugin screen.
72
+ *
73
+ * @since 1.0.0
74
+ * @return void
75
+ */
76
+ public function show_setup_wizard() {
77
+
78
+ $status = get_option( 'wcf_setup_complete', false );
79
+ $skip_setup = get_option( 'wcf_setup_skipped', false );
80
+
81
+ if ( false === $status && ! $skip_setup ) { ?>
82
+ <div class="notice notice-info">
83
+ <p><b><?php esc_html_e( 'Thanks for installing and using CartFlows!', 'cartflows' ); ?></b></p>
84
+ <p><?php esc_html_e( 'It is easy to use the CartFlows. Please use the setup wizard to quick start setup.', 'cartflows' ); ?></p>
85
+ <p>
86
+ <a href="<?php echo esc_url( admin_url( 'index.php?page=cartflow-setup' ) ); ?>" class="button button-primary"> <?php esc_html_e( 'Start Wizard', 'cartflows' ); ?></a>
87
+ <a class="button-secondary" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wcf-hide-notice', 'install' ), 'wcf_hide_notices_nonce', '_wcf_notice_nonce' ) ); ?>"><?php esc_html_e( 'Skip Setup', 'cartflows' ); ?></a>
88
+ </p>
89
+ </div>
90
+ <?php
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Add admin menus/screens.
96
+ */
97
+ public function admin_menus() {
98
+
99
+ if ( empty( $_GET['page'] ) || 'cartflow-setup' !== $_GET['page'] ) { //phpcs:ignore
100
+ return;
101
+ }
102
+
103
+ add_dashboard_page( '', '', 'manage_options', 'cartflow-setup', '' );
104
+ }
105
+
106
+ /**
107
+ * Show the setup wizard.
108
+ */
109
+ public function setup_wizard() {
110
+
111
+ if ( empty( $_GET['page'] ) || 'cartflow-setup' !== $_GET['page'] ) { //phpcs:ignore
112
+ return;
113
+ }
114
+
115
+ $this->steps = array(
116
+ 'basic-config' => array(
117
+ 'name' => __( 'Welcome', 'cartflows' ),
118
+ 'view' => array( $this, 'welcome_step' ),
119
+ 'handler' => array( $this, 'welcome_step_save' ),
120
+ ),
121
+ 'page-builder' => array(
122
+ 'name' => __( 'Page Builder', 'cartflows' ),
123
+ 'view' => array( $this, 'page_builder_step' ),
124
+ ),
125
+ 'checkout' => array(
126
+ 'name' => __( 'Checkout', 'cartflows' ),
127
+ 'view' => array( $this, 'checkout_step' ),
128
+ ),
129
+ 'training' => array(
130
+ 'name' => __( 'Training', 'cartflows' ),
131
+ 'view' => array( $this, 'training_step' ),
132
+ ),
133
+ 'setup-ready' => array(
134
+ 'name' => __( 'Ready!', 'cartflows' ),
135
+ 'view' => array( $this, 'ready_step' ),
136
+ 'handler' => '',
137
+ ),
138
+ );
139
+
140
+ $this->step = isset( $_GET['step'] ) ? sanitize_text_field( $_GET['step'] ) : current( array_keys( $this->steps ) ); //phpcs:ignore
141
+
142
+ wp_enqueue_style( 'cartflows-setup', CARTFLOWS_URL . 'admin/assets/css/setup-wizard.css', array( 'dashicons' ), CARTFLOWS_VER );
143
+ wp_style_add_data( 'cartflows-setup', 'rtl', 'replace' );
144
+
145
+ wp_enqueue_script( 'cartflows-setup', CARTFLOWS_URL . 'admin/assets/js/setup-wizard.js', array( 'jquery', 'wp-util', 'updates' ), CARTFLOWS_VER, false );
146
+
147
+ wp_localize_script( 'cartflows-setup', 'cartflows_setup_vars', self::localize_vars() );
148
+
149
+ wp_enqueue_media();
150
+
151
+ if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) { //phpcs:ignore
152
+ call_user_func( $this->steps[ $this->step ]['handler'] );
153
+ }
154
+
155
+ ob_start();
156
+ $this->setup_wizard_header();
157
+ $this->setup_wizard_steps();
158
+ $this->setup_wizard_content();
159
+ $this->setup_wizard_footer();
160
+ exit;
161
+ }
162
+
163
+ /**
164
+ * Get current step slug
165
+ */
166
+ public function get_current_step_slug() {
167
+ $keys = array_keys( $this->steps );
168
+ return $keys[ array_search( $this->step, array_keys( $this->steps ), true ) ];
169
+ }
170
+
171
+ /**
172
+ * Get previous step link
173
+ */
174
+ public function get_prev_step_link() {
175
+ $keys = array_keys( $this->steps );
176
+ return add_query_arg( 'step', $keys[ array_search( $this->step, array_keys( $this->steps ), true ) - 1 ] );
177
+ }
178
+
179
+ /**
180
+ * Get next step link
181
+ */
182
+ public function get_next_step_link() {
183
+ $keys = array_keys( $this->steps );
184
+ return add_query_arg( 'step', $keys[ array_search( $this->step, array_keys( $this->steps ), true ) + 1 ] );
185
+ }
186
+
187
+ /**
188
+ * Get next step link
189
+ */
190
+ public function get_next_step_plain_link() {
191
+ $keys = array_keys( $this->steps );
192
+ $step_index = array_search( $this->step, $keys, true );
193
+ $step_index = ( count( $keys ) == $step_index + 1 ) ? $step_index : $step_index + 1;
194
+ $step = $keys[ $step_index ];
195
+ return admin_url( 'index.php?page=cartflow-setup&step=' . $step );
196
+ }
197
+
198
+ /**
199
+ * Setup Wizard Header.
200
+ */
201
+ public function setup_wizard_header() {
202
+ ?>
203
+ <!DOCTYPE html>
204
+ <html>
205
+ <head>
206
+ <meta name="viewport" content="width=device-width" />
207
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
208
+ <title><?php esc_html_e( 'CartFlows Setup', 'cartflows' ); ?></title>
209
+
210
+ <script type="text/javascript">
211
+ addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
212
+ var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>';
213
+ var pagenow = '';
214
+ </script>
215
+ <?php wp_print_scripts( array( 'cartflows-setup' ) ); ?>
216
+ <?php do_action( 'admin_print_styles' ); ?>
217
+ <?php do_action( 'admin_head' ); ?>
218
+ </head>
219
+ <body class="cartflows-setup wp-core-ui cartflows-step-<?php echo esc_attr( $this->get_current_step_slug() ); ?>">
220
+ <div id="cartflows-logo">
221
+ <img height="40" class="wcf-logo" src="<?php echo CARTFLOWS_URL . 'assets/images/cartflows-logo.svg'; ?>" />
222
+ </div>
223
+ <?php
224
+ }
225
+
226
+ /**
227
+ * Setup Wizard Footer.
228
+ */
229
+ public function setup_wizard_footer() {
230
+
231
+ $admin_url = admin_url( 'admin.php?page=cartflows_settings' );
232
+ ?>
233
+ <div class="close-button-wrapper">
234
+ <a href="<?php echo esc_url( $admin_url ); ?>" class="wizard-close-link" ><?php esc_html_e( 'Exit Setup Wizard', 'cartflows' ); ?></a>
235
+ </div>
236
+ </body>
237
+ </html>
238
+ <?php
239
+ }
240
+
241
+ /**
242
+ * Output the steps.
243
+ */
244
+ public function setup_wizard_steps() {
245
+
246
+ $ouput_steps = $this->steps;
247
+ ?>
248
+ <ol class="cartflows-setup-steps">
249
+ <?php
250
+ foreach ( $ouput_steps as $step_key => $step ) :
251
+ $classes = '';
252
+ $activated = false;
253
+ if ( $step_key === $this->step ) {
254
+ $classes = 'active';
255
+ $activated = true;
256
+ } elseif ( array_search( $this->step, array_keys( $this->steps ), true ) > array_search( $step_key, array_keys( $this->steps ), true ) ) {
257
+ $classes = 'done';
258
+ $activated = true;
259
+ }
260
+ ?>
261
+ <li class="<?php echo esc_attr( $classes ); ?>">
262
+ <span><?php echo esc_html( $step['name'] ); ?></span>
263
+ </li>
264
+ <?php endforeach; ?>
265
+ </ol>
266
+ <?php
267
+ }
268
+
269
+ /**
270
+ * Output the content for the current step.
271
+ */
272
+ public function setup_wizard_content() {
273
+ ?>
274
+ <input type="hidden" class="wcf-redirect-link" data-redirect-link="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>" >
275
+ <?php
276
+
277
+ echo '<div class="cartflows-setup-content">';
278
+ call_user_func( $this->steps[ $this->step ]['view'] );
279
+ echo '</div>';
280
+ }
281
+
282
+ /**
283
+ * Introduction step.
284
+ */
285
+ public function welcome_step() {
286
+ ?>
287
+ <h1><?php esc_html_e( 'Welcome to CartFlows!', 'cartflows' ); ?></h1>
288
+ <p><?php esc_html_e( 'Thank you for choosing CartFlows to get more leads, increase conversions, & maximize profits. This short setup wizard will guide you though configuring CartFlows and creating your first funnel.', 'cartflows' ); ?></p>
289
+ <form method="post">
290
+ <div class="cartflows-setup-actions step">
291
+ <div class="button-prev-wrap">
292
+ </div>
293
+ <div class="button-next-wrap">
294
+ <input type="submit" class="uct-activate button-primary button button-large " value="<?php esc_html_e( 'Lets Go »', 'cartflows' ); ?>" name="save_step" />
295
+ </div>
296
+ <?php wp_nonce_field( 'cartflow-setup' ); ?>
297
+ </div>
298
+ </form>
299
+ <?php
300
+ }
301
+
302
+ /**
303
+ * Save Locale Settings.
304
+ */
305
+ public function welcome_step_save() {
306
+ check_admin_referer( 'cartflow-setup' );
307
+
308
+ // Update site title & tagline.
309
+ $redirect_url = $this->get_next_step_link();
310
+
311
+ wp_safe_redirect( esc_url_raw( $redirect_url ) );
312
+ exit;
313
+ }
314
+
315
+ /**
316
+ * Locale settings
317
+ */
318
+ public function page_builder_step() {
319
+ ?>
320
+
321
+ <h1><?php esc_html_e( 'Page Builder Setup', 'cartflows' ); ?></h1>
322
+ <p class="description"><?php esc_html_e( 'Please select a page builder you would like to use with CartFlows.', 'cartflows' ); ?></p>
323
+ <form method="post">
324
+ <table class="cartflows-table widefat">
325
+ <tr class="cartflows-row">
326
+ <td class="cartflows-row-heading">
327
+ <label><?php esc_html_e( 'Select Page Builder', 'cartflows' ); ?></label>
328
+ </td>
329
+ <td class="cartflows-row-content">
330
+ <?php
331
+ $installed_plugins = get_plugins();
332
+ $plugins = array(
333
+ array(
334
+ 'title' => __( 'Elementor', 'cartflows' ),
335
+ 'value' => 'elementor',
336
+ 'data' => array(
337
+ 'slug' => 'elementor',
338
+ 'init' => 'elementor/elementor.php',
339
+ 'active' => is_plugin_active( 'elementor/elementor.php' ) ? 'yes' : 'no',
340
+ 'install' => isset( $installed_plugins['elementor/elementor.php'] ) ? 'yes' : 'no',
341
+ ),
342
+ ),
343
+ array(
344
+ 'title' => __( 'Beaver Builder Plugin (Lite Version)', 'cartflows' ),
345
+ 'value' => 'beaver-builder',
346
+ 'data' => array(
347
+ 'slug' => 'beaver-builder-lite-version',
348
+ 'init' => 'beaver-builder-lite-version/fl-builder.php',
349
+ 'active' => is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) ? 'yes' : 'no',
350
+ 'install' => isset( $installed_plugins['beaver-builder-lite-version/fl-builder.php'] ) ? 'yes' : 'no',
351
+ ),
352
+ ),
353
+ array(
354
+ 'title' => __( 'Divi', 'cartflows' ),
355
+ 'value' => 'divi',
356
+ 'data' => array(
357
+ 'slug' => 'divi',
358
+ 'init' => 'divi',
359
+ 'active' => 'yes',
360
+ 'install' => 'NA',
361
+ ),
362
+ ),
363
+ array(
364
+ 'title' => __( 'Other', 'cartflows' ),
365
+ 'value' => 'other',
366
+ 'data' => array(
367
+ 'slug' => 'other',
368
+ 'init' => false,
369
+ 'active' => 'yes',
370
+ 'install' => 'NA',
371
+ ),
372
+ ),
373
+ );
374
+ ?>
375
+ <input type="hidden" name="save-pb-input" id="save-pb-option" value="1" />
376
+ <select name="page-builder" class="page-builder-list" data-redirect-link="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>">
377
+ <?php
378
+ foreach ( $plugins as $key => $plugin ) {
379
+ echo '<option value="' . esc_attr( $plugin['value'] ) . '" data-install="' . esc_attr( $plugin['data']['install'] ) . '" data-active="' . esc_attr( $plugin['data']['active'] ) . '" data-slug="' . esc_attr( $plugin['data']['slug'] ) . '" data-init="' . esc_attr( $plugin['data']['init'] ) . '">' . esc_html( $plugin['title'] ) . '</option>';
380
+ }
381
+ ?>
382
+ </select>
383
+ </td>
384
+ </tr>
385
+ </table>
386
+ <p><?php esc_html_e( 'While CartFlows Should work with most page builders, we offer templates for the above page builders.', 'cartflows' ); ?></p>
387
+ <div class="cartflows-setup-actions step">
388
+ <div class="button-prev-wrap">
389
+ <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>" class="button-primary button button-large button-prev" ><?php esc_html_e( '« Previous', 'cartflows' ); ?></a>
390
+ </div>
391
+ <div class="button-next-wrap">
392
+ <a href="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>" class="button button-large button-next" ><?php esc_html_e( 'Skip this step', 'cartflows' ); ?></a>
393
+ <a href="#" class="button button-primary wcf-install-plugins"><?php esc_html_e( 'Next »', 'cartflows' ); ?></a>
394
+ </div>
395
+ <?php wp_nonce_field( 'cartflow-setup' ); ?>
396
+ </div>
397
+ </form>
398
+ <?php
399
+ }
400
+
401
+ /**
402
+ * Render checkout step.
403
+ */
404
+ public function checkout_step() {
405
+
406
+ $installed_plugins = get_plugins();
407
+ $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? 'yes' : 'no';
408
+ $is_wcf_ca_installed = isset( $installed_plugins['woo-cart-abandonment-recovery/woo-cart-abandonment-recovery.php'] ) ? 'yes' : 'no';
409
+ $is_active = class_exists( 'WooCommerce' ) ? 'yes' : 'no';
410
+ $is_wcf_ca_active = class_exists( 'CARTFLOWS_CA_Loader' ) ? 'yes' : 'no';
411
+ ?>
412
+ <h1><?php esc_html_e( 'Choose a checkout', 'cartflows' ); ?></h1>
413
+ <div class="cartflows-setup-message">
414
+ <p>
415
+ <?php esc_html_e( 'While CartFlows is designed to use WooCommerce sell digital and physical products, not all funnels need a checkout system.', 'cartflows' ); ?>
416
+ </p>
417
+ <h4 class="cartflows-setup-message-title"><?php esc_html_e( 'Would you like to install WooCommerce to sell digital and physical products in your funnels?', 'cartflows' ); ?></h4>
418
+ <span><input data-wcf-ca-active="<?php echo esc_attr( $is_wcf_ca_active ); ?>" data-wcf-ca-install="<?php echo esc_attr( $is_wcf_ca_installed ); ?>" data-woo-active="<?php echo esc_attr( $is_active ); ?>" data-woo-install="<?php echo esc_attr( $is_wc_installed ); ?>" type="hidden" class="wcf-install-wc-input" name="installl-woocommerce" value="" checked></span>
419
+ </div>
420
+
421
+ <div class="cartflows-setup-extra-notice">
422
+
423
+ <span>
424
+ <?php esc_html_e( 'The following plugin will be installed and activated for you:', 'cartflows' ); ?>
425
+ <a target="_blank" href="https://wordpress.org/plugins/woo-cart-abandonment-recovery/"> <?php esc_html_e( 'WooCommerce', 'cartflows' ); ?></a>,
426
+ <a target="_blank" href="https://wordpress.org/plugins/woo-cart-abandonment-recovery/"> <?php esc_html_e( 'WooCommerce Cart Abandonment Recovery', 'cartflows' ); ?></a>
427
+
428
+ </span>
429
+
430
+ </div>
431
+
432
+ <div class="cartflows-setup-actions step">
433
+ <div class="button-prev-wrap">
434
+ <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>" class="button-primary button button-large button-prev" ><?php esc_html_e( '« Previous', 'cartflows' ); ?></a>
435
+ </div>
436
+ <div class="button-next-wrap">
437
+ <a href="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>" class="button button-large button-next"><?php esc_html_e( 'No thanks', 'cartflows' ); ?></a>
438
+ <a class="wcf-install-wc button-primary button button-large" name="save_step" > <?php esc_html_e( 'Yes', 'cartflows' ); ?> </a>
439
+ </div>
440
+ </div>
441
+
442
+ <?php
443
+ }
444
+
445
+ /**
446
+ * Save Locale Settings.
447
+ */
448
+ public function activate_wc_plugins() {
449
+
450
+ check_ajax_referer( 'wcf-wc-plugins-activate', 'security' );
451
+
452
+ $plugin_slug_arr = array(
453
+ 'woocommerce/woocommerce.php' => true,
454
+ 'woo-cart-abandonment-recovery/woo-cart-abandonment-recovery.php' => false,
455
+ );
456
+
457
+ $activate = array(
458
+ 'woocommerce/woocommerce.php' => false,
459
+ 'woo-cart-abandonment-recovery/woo-cart-abandonment-recovery.php' => false,
460
+ );
461
+
462
+ foreach ( $plugin_slug_arr as $slug => $do_silently ) {
463
+
464
+ $activate[ $slug ] = activate_plugin( $slug, '', false, $do_silently );
465
+ }
466
+
467
+ foreach ( $activate as $slug => $data ) {
468
+
469
+ if ( is_wp_error( $data ) ) {
470
+ wp_send_json_error(
471
+ array(
472
+ 'success' => false,
473
+ 'message' => $data->get_error_message(),
474
+ )
475
+ );
476
+ }
477
+ }
478
+
479
+ wp_send_json_success();
480
+ }
481
+
482
+ /**
483
+ * Save Locale Settings.
484
+ */
485
+ public function page_builder_step_save() {
486
+
487
+ check_ajax_referer( 'wcf-page-builder-step-save', 'security' );
488
+
489
+ $plugin_init = isset( $_POST['plugin_init'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin_init'] ) ) : '';
490
+ $save_option = ( isset( $_POST['save_builder_option'] ) && 'true' == $_POST['save_builder_option'] ) ? true : false;
491
+ $plugin_slug = filter_input( INPUT_POST, 'page_builder', FILTER_SANITIZE_STRING );
492
+
493
+ $do_sliently = true;
494
+ if ( 'woo-cart-abandonment-recovery' === $plugin_slug ) {
495
+ $do_sliently = false;
496
+ }
497
+
498
+ $activate = activate_plugin( $plugin_init, '', false, $do_sliently );
499
+
500
+ if ( $save_option ) {
501
+ $this->save_page_builder_option();
502
+ }
503
+
504
+ if ( is_wp_error( $activate ) ) {
505
+ wp_send_json_error(
506
+ array(
507
+ 'success' => false,
508
+ 'message' => $activate->get_error_message(),
509
+ )
510
+ );
511
+ }
512
+
513
+ wp_send_json_success(
514
+ array( 'plugin' => $plugin_slug )
515
+ );
516
+ }
517
+
518
+ /**
519
+ * Save selected page builder in options database.
520
+ */
521
+ public function save_page_builder_option() {
522
+
523
+ $page_builder = isset( $_POST['page_builder'] ) ? sanitize_text_field( wp_unslash( $_POST['page_builder'] ) ) : ''; //phpcs:ignore
524
+
525
+ $wcf_settings = get_option( '_cartflows_common', array() );
526
+
527
+ if ( false !== strpos( $page_builder, 'beaver-builder' ) ) {
528
+ $page_builder = 'beaver-builder';
529
+ }
530
+
531
+ $wcf_settings['default_page_builder'] = $page_builder;
532
+
533
+ update_option( '_cartflows_common', $wcf_settings );
534
+
535
+ wp_send_json_success(
536
+ array( 'plugin' => $page_builder )
537
+ );
538
+
539
+ }
540
+
541
+ /**
542
+ * Final step.
543
+ */
544
+ public function ready_step() {
545
+
546
+ // Set setup wizard status to complete.
547
+ update_option( 'wcf_setup_complete', true );
548
+ ?>
549
+ <h1><?php esc_html_e( 'Congratulations, You Did It!', 'cartflows' ); ?></h1>
550
+
551
+ <div class="cartflows-setup-next-steps">
552
+ <div class="cartflows-setup-next-steps-last">
553
+
554
+ <p class="success">
555
+ <?php
556
+ esc_html_e( 'CartFlows is ready to use on your website. You\'ve successfully completed the setup process and all that is left for you to do is create your first flow.', 'cartflows' )
557
+ ?>
558
+ </p>
559
+
560
+
561
+ <ul class="wcf-wizard-next-steps">
562
+ <li class="wcf-wizard-next-step-item">
563
+ <div class="wcf-wizard-next-step-description">
564
+ <p class="next-step-heading">Next step</p>
565
+ <h3 class="next-step-description">Create First Flow</h3>
566
+ <p class="next-step-extra-info">You're ready to add flows to your website.</p>
567
+ </div>
568
+ <div class="wcf-wizard-next-step-action">
569
+ <p class="wc-setup-actions step">
570
+ <a href="<?php echo esc_url( admin_url( 'edit.php?post_type=cartflows_flow&add-new-flow' ) ); ?>" type="button" class="button button-primary button-hero" ><?php esc_html_e( 'Create a flow', 'cartflows' ); ?></a>
571
+ </p>
572
+ </div>
573
+ </li>
574
+ </ul>
575
+
576
+ </div>
577
+ </div>
578
+ <?php
579
+ }
580
+
581
+ /**
582
+ * Training course step.
583
+ */
584
+ public function training_step() {
585
+ $current_user = wp_get_current_user();
586
+ ?>
587
+ <h1><?php esc_html_e( 'Exclusive CartFlows Training Course Offer', 'cartflows' ); ?></h1>
588
+
589
+ <div id="mauticform_wrapper_cartflowsonboarding" class="mauticform_wrapper">
590
+ <form autocomplete="false" role="form" method="post" action="https://go.cartflows.com/form/submit?formId=2" id="mauticform_cartflowsonboarding" data-mautic-form="cartflowsonboarding" enctype="multipart/form-data">
591
+ <div class="mauticform-error" id="mauticform_cartflowsonboarding_error"></div>
592
+ <div class="mauticform-message" id="mauticform_cartflowsonboarding_message"></div>
593
+ <div class="mauticform-innerform">
594
+ <div class="mauticform-page-wrapper mauticform-page-1" data-mautic-form-page="1">
595
+ <div id="mauticform_cartflowsonboarding_enter_your_email" class="mauticform-row mauticform-email mauticform-field-1">
596
+ <div class="cartflows-setup-message">
597
+ <p>
598
+ <?php esc_html_e( 'We want you to get off to a great start using CartFlows, so we would like to give access to our exclusive training course.', 'cartflows' ); ?>
599
+ <?php esc_html_e( 'Get access to this couse, for free, by entering your email below.', 'cartflows' ); ?>
600
+ </p>
601
+ <input id="mauticform_input_cartflowsonboarding_enter_your_email" name="mauticform[enter_your_email]" placeholder="<?php esc_html_e( 'Enter Email address', 'cartflows' ); ?>" value="<?php echo $current_user->user_email; ?>" class="mauticform-input" type="email">
602
+ </div>
603
+ <span class="mauticform-errormsg" style="display: none;"></span>
604
+ </div>
605
+ </div>
606
+ </div>
607
+
608
+ <input type="hidden" name="mauticform[formId]" id="mauticform_cartflowsonboarding_id" value="2">
609
+ <input type="hidden" name="mauticform[return]" id="mauticform_cartflowsonboarding_return" value="">
610
+ <input type="hidden" name="mauticform[formName]" id="mauticform_cartflowsonboarding_name" value="cartflowsonboarding">
611
+ <div class="cartflows-setup-actions step">
612
+ <div class="button-prev-wrap">
613
+ <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>" class="button-primary button button-large button-prev" ><?php esc_html_e( '« Previous', 'cartflows' ); ?></a>
614
+ </div>
615
+ <div class="button-next-wrap">
616
+ <a href="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>" class="button button-large button-next"><?php esc_html_e( 'No thanks', 'cartflows' ); ?></a>
617
+ <button type="submit" name="mauticform[submit]" id="mauticform_input_cartflowsonboarding_submit" value="<?php esc_html_e( 'Allow', 'cartflows' ); ?>" class="mautic-form-submit btn btn-default button-primary button button-large button-next" name="save_step"><?php esc_html_e( 'Allow', 'cartflows' ); ?></button>
618
+ </div>
619
+ </div>
620
+ </form>
621
+ </div>
622
+ <?php
623
+ }
624
+
625
+ /**
626
+ * Localize variables in admin
627
+ */
628
+ public function localize_vars() {
629
+
630
+ $vars = array();
631
+
632
+ $ajax_actions = array(
633
+ 'wcf_page_builder_step_save',
634
+ 'wcf_wc_plugins_activate',
635
+ );
636
+
637
+ foreach ( $ajax_actions as $action ) {
638
+
639
+ $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
640
+ }
641
+
642
+ return $vars;
643
+ }
644
+
645
+ /**
646
+ * Add JS script for mautic form
647
+ */
648
+ public function add_mautic_form_script() {
649
+
650
+ if ( ! isset( $_REQUEST['page'] ) || ( isset( $_REQUEST['page'] ) && 'cartflow-setup' !== $_REQUEST['page'] ) ) { //phpcs:ignore
651
+ return;
652
+ }
653
+ ?>
654
+
655
+ <script type="text/javascript">
656
+ /** This section is only needed once per page if manually copying **/
657
+ if (typeof MauticSDKLoaded == 'undefined') {
658
+ var MauticSDKLoaded = true;
659
+ var head = document.getElementsByTagName('head')[0];
660
+ var script = document.createElement('script');
661
+ script.type = 'text/javascript';
662
+ script.src = 'https://go.cartflows.com/media/js/mautic-form.js';
663
+ script.onload = function() {
664
+ MauticSDK.onLoad();
665
+ };
666
+ head.appendChild(script);
667
+ var MauticDomain = 'https://go.cartflows.com';
668
+ var MauticLang = {
669
+ 'submittingMessage': "Please wait..."
670
+ };
671
+ }
672
+ </script>
673
+ <?php
674
+ }
675
+ }
676
+
677
+ new CartFlows_Wizard();
678
+
679
+ endif;
includes/admin/cartflows-admin.php CHANGED
@@ -1,35 +1,35 @@
1
- <?php
2
- /**
3
- * CARTFLOWS Admin HTML.
4
- *
5
- * @package CARTFLOWS
6
- */
7
-
8
- ?>
9
- <div class="wcf-menu-page-wrapper">
10
- <div id="wcf-menu-page">
11
- <div class="wcf-menu-page-header <?php echo esc_attr( implode( ' ', $header_wrapper_class ) ); ?>">
12
- <div class="wcf-container wcf-flex">
13
- <div class="wcf-title">
14
- <span class="screen-reader-text"><?php echo esc_attr( CARTFLOWS_PLUGIN_NAME ); ?></span>
15
- <img class="wcf-logo" src="<?php echo esc_attr( CARTFLOWS_URL ) . 'assets/images/cartflows-logo.svg'; ?>" />
16
- </div>
17
- <div class="wcf-top-links">
18
- <?php
19
- esc_attr_e( 'Modernizing WordPress eCommerce!', 'cartflows' );
20
- ?>
21
- </div>
22
- </div>
23
- </div>
24
-
25
- <?php
26
- // Settings update message.
27
- if ( isset( $_REQUEST['message'] ) && ( 'saved' === $_REQUEST['message'] ) ) { //phpcs:ignore
28
- ?>
29
- <div id="message" class="notice notice-success is-dismissive wcf-notice"><p> <?php esc_html_e( 'Settings saved successfully.', 'cartflows' ); ?> </p></div>
30
- <?php
31
- }
32
- ?>
33
- <?php do_action( 'cartflows_render_admin_content' ); ?>
34
- </div>
35
- </div>
1
+ <?php
2
+ /**
3
+ * CARTFLOWS Admin HTML.
4
+ *
5
+ * @package CARTFLOWS
6
+ */
7
+
8
+ ?>
9
+ <div class="wcf-menu-page-wrapper">
10
+ <div id="wcf-menu-page">
11
+ <div class="wcf-menu-page-header <?php echo esc_attr( implode( ' ', $header_wrapper_class ) ); ?>">
12
+ <div class="wcf-container wcf-flex">
13
+ <div class="wcf-title">
14
+ <span class="screen-reader-text"><?php echo esc_attr( CARTFLOWS_PLUGIN_NAME ); ?></span>
15
+ <img class="wcf-logo" src="<?php echo esc_attr( CARTFLOWS_URL ) . 'assets/images/cartflows-logo.svg'; ?>" />
16
+ </div>
17
+ <div class="wcf-top-links">
18
+ <?php
19
+ esc_attr_e( 'Modernizing WordPress eCommerce!', 'cartflows' );
20
+ ?>
21
+ </div>
22
+ </div>
23
+ </div>
24
+
25
+ <?php
26
+ // Settings update message.
27
+ if ( isset( $_REQUEST['message'] ) && ( 'saved' === $_REQUEST['message'] ) ) { //phpcs:ignore
28
+ ?>
29
+ <div id="message" class="notice notice-success is-dismissive wcf-notice"><p> <?php esc_html_e( 'Settings saved successfully.', 'cartflows' ); ?> </p></div>
30
+ <?php
31
+ }
32
+ ?>
33
+ <?php do_action( 'cartflows_render_admin_content' ); ?>
34
+ </div>
35
+ </div>
includes/admin/cartflows-general.php CHANGED
@@ -1,370 +1,370 @@
1
- <?php
2
- /**
3
- * General settings
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- $settings = Cartflows_Helper::get_common_settings();
9
-
10
- $debug_data = Cartflows_Helper::get_debug_settings();
11
-
12
- $permalink_settings = Cartflows_Helper::get_permalink_settings();
13
-
14
- $facebook_settings = Cartflows_Helper::get_facebook_settings();
15
-
16
- $debug_on = ( isset( $_GET['debug'] ) ) ? sanitize_text_field( wp_unslash( $_GET['debug'] ) ) : 'false'; //phpcs:ignore
17
-
18
- $error_log = filter_input( INPUT_GET, 'cartflows-error-log', FILTER_VALIDATE_BOOLEAN );
19
- ?>
20
-
21
-
22
- <?php if ( $error_log ) : ?>
23
- <div class="wrap wcf-addon-wrap wcf-clear wcf-container">
24
- <?php Cartflows_Logger::status_logs_file(); ?>
25
- </div>
26
- <?php else : ?>
27
- <div class="wrap wcf-addon-wrap wcf-clear wcf-container">
28
- <input type="hidden" name="action" value="wcf_save_common_settings">
29
- <h1 class="screen-reader-text"><?php esc_html_e( 'General Settings', 'cartflows' ); ?></h1>
30
-
31
- <div id="poststuff">
32
- <div id="post-body" class="columns-2">
33
- <div id="post-body-content">
34
- <div class="postbox introduction">
35
- <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
36
- <span><?php esc_html_e( 'Getting Started', 'cartflows' ); ?></span>
37
- </h2>
38
- <div class="inside">
39
- <div class="iframe-wrap">
40
- <iframe width="560" height="315" src="https://www.youtube.com/embed/SlE0moPKjMY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
41
- </div>
42
- <p>
43
- <?php
44
- esc_attr_e( 'Modernizing WordPress eCommerce!', 'cartflows' );
45
- ?>
46
- </p>
47
- </div>
48
- </div>
49
-
50
- <div class="general-settings-form postbox">
51
- <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
52
- <span><?php esc_html_e( 'General Settings', 'cartflows' ); ?></span>
53
- </h2>
54
- <div class="inside">
55
- <form method="post" class="wrap wcf-clear" action="" >
56
- <div class="form-wrap">
57
- <?php
58
-
59
- do_action( 'cartflows_before_settings_fields', $settings );
60
-
61
- echo Cartflows_Admin_Fields::checkobox_field(
62
- array(
63
- 'id' => 'wcf_disallow_indexing',
64
- 'name' => '_cartflows_common[disallow_indexing]',
65
- 'title' => __( 'Disallow search engines from indexing flows', 'cartflows' ),
66
- 'value' => $settings['disallow_indexing'],
67
- )
68
- );
69
-
70
- if ( wcf()->is_woo_active ) {
71
- echo Cartflows_Admin_Fields::flow_checkout_selection_field(
72
- array(
73
- 'id' => 'wcf_global_checkout',
74
- 'name' => '_cartflows_common[global_checkout]',
75
- 'title' => __( 'Global Checkout', 'cartflows' ),
76
- 'value' => $settings['global_checkout'],
77
- )
78
- );
79
- }
80
- echo Cartflows_Admin_Fields::select_field(
81
- array(
82
- 'id' => 'wcf_default_page_builder',
83
- 'name' => '_cartflows_common[default_page_builder]',
84
- 'title' => __( 'Show Templates designed with', 'cartflows' ),
85
- 'description' => __( 'CartFlows offers flow templates that can be imported in one click. These templates are available in few different page builders. Please choose your preferred page builder from the list so you will only see templates that are made using that page builder..', 'cartflows' ),
86
- 'value' => $settings['default_page_builder'],
87
- 'options' => array(
88
- 'elementor' => __( 'Elementor', 'cartflows' ),
89
- 'beaver-builder' => __( 'Beaver Builder', 'cartflows' ),
90
- 'divi' => __( 'Divi', 'cartflows' ),
91
- 'other' => __( 'Other', 'cartflows' ),
92
- ),
93
- )
94
- );
95
-
96
- do_action( 'cartflows_after_settings_fields', $settings );
97
-
98
- ?>
99
- </div>
100
- <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
101
- <?php wp_nonce_field( 'cartflows-common-settings', 'cartflows-common-settings-nonce' ); ?>
102
- </form>
103
- </div>
104
- </div>
105
-
106
- <div class="general-settingss-form postbox">
107
- <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
108
- <span><?php esc_html_e( 'Permalink Settings', 'cartflows' ); ?></span>
109
- </h2>
110
- <div class="inside">
111
- <form method="post" class="wrap wcf-clear" action="" >
112
- <div class="form-wrap wcf_permalink_settings">
113
- <?php
114
-
115
- echo Cartflows_Admin_Fields::radio_field(
116
- array(
117
- 'id' => 'permalink_structure',
118
- 'name' => '_cartflows_permalink[permalink_structure]',
119
- 'value' => $permalink_settings['permalink_structure'],
120
- 'options' => array(
121
- '' =>
122
- array(
123
- 'label' => __( 'Default', 'cartflows' ),
124
- 'description' => 'Default WordPress Permalink',
125
- ),
126
-
127
- '/' . CARTFLOWS_FLOW_POST_TYPE . '/%flowname%/' . CARTFLOWS_STEP_POST_TYPE =>
128
- array(
129
- 'label' => __( 'Flow and Step Slug', 'cartflows' ),
130
- 'description' => '/<code>' . CARTFLOWS_FLOW_POST_TYPE . '</code>/%flowname%/<code>' . CARTFLOWS_STEP_POST_TYPE . '</code>/%stepname%/',
131
- ),
132
-
133
- '/' . CARTFLOWS_FLOW_POST_TYPE . '/%flowname%' =>
134
- array(
135
- 'label' => __( 'Flow Slug', 'cartflows' ),
136
- 'description' => '/<code>' . CARTFLOWS_FLOW_POST_TYPE . '</code>/%flowname%/%stepname%/',
137
- ),
138
-
139
- '/%flowname%/' . CARTFLOWS_STEP_POST_TYPE =>
140
- array(
141
- 'label' => __( 'Step Slug', 'cartflows' ),
142
- 'description' => '/%flowname%/<code>' . CARTFLOWS_STEP_POST_TYPE . '</code>/%stepname%/',
143
- ),
144
- ),
145
- )
146
- );
147
- ?>
148
- <hr/>
149
- <?php
150
-
151
- echo Cartflows_Admin_Fields::title_field(
152
- array(
153
- 'title' => __( 'Post Type Permalink Base', 'cartflows' ),
154
- )
155
- );
156
-
157
- echo Cartflows_Admin_Fields::text_field(
158
- array(
159
- 'id' => 'wcf_permalink_step_base',
160
- 'name' => '_cartflows_permalink[permalink]',
161
- 'title' => __( 'Step Base', 'cartflows' ),
162
- 'value' => $permalink_settings['permalink'],
163
- 'placeholder' => CARTFLOWS_STEP_POST_TYPE,
164
- )
165
- );
166
-
167
- echo Cartflows_Admin_Fields::text_field(
168
- array(
169
- 'id' => 'wcf_permalink_flow_base',
170
- 'name' => '_cartflows_permalink[permalink_flow_base]',
171
- 'title' => __( 'Flow Base', 'cartflows' ),
172
- 'value' => $permalink_settings['permalink_flow_base'],
173
- 'placeholder' => CARTFLOWS_FLOW_POST_TYPE,
174
- )
175
- );
176
-
177
- ?>
178
-
179
-
180
- </div>
181
- <p>
182
- <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
183
- <?php submit_button( __( 'Set Default', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'reset', false ); ?>
184
- <?php wp_nonce_field( 'cartflows-permalink-settings', 'cartflows-permalink-settings-nonce' ); ?>
185
- </p>
186
-
187
-
188
- </form>
189
- </div>
190
- </div>
191
-
192
-
193
- <div class="general-settingss-form postbox">
194
- <h2 class="wcf-facebook-hndle wcf-normal-cusror ui-sortable-handle hndle">
195
-
196
- <span><?php esc_html_e( 'Facebook Pixel Settings', 'cartflows' ); ?></span>
197
- </h2>
198
-
199
- <form method="post" class="wrap wcf-clear" action="">
200
- <div class="form-wrap">
201
- <input type="hidden" name="action" value="wcf_save_facebook_pixel_settings">
202
- <div id="post-body">
203
-
204
- <div class="inside">
205
- <div class="form-wrap">
206
- <?php
207
- echo Cartflows_Admin_Fields::checkobox_field(
208
- array(
209
- 'id' => 'wcf_facebook_pixel_tracking',
210
- 'name' => '_cartflows_facebook[facebook_pixel_tracking]',
211
- 'title' => __( 'Enable Facebook Pixel Tracking', 'cartflows' ),
212
- 'value' => $facebook_settings['facebook_pixel_tracking'],
213
- )
214
- );
215
-
216
- echo "<div class='wcf-fb-pixel-wrapper'>";
217
-
218
- echo Cartflows_Admin_Fields::text_field(
219
- array(
220
- 'id' => 'wcf_facebook_pixel_id',
221
- 'name' => '_cartflows_facebook[facebook_pixel_id]',
222
- 'title' => __( 'Enter Facebook pixel ID', 'cartflows' ),
223
- 'value' => $facebook_settings['facebook_pixel_id'],
224
- )
225
- );
226
-
227
-
228
- echo Cartflows_Admin_Fields::title_field(
229
- array(
230
- 'title' => __( 'Enable Events:', 'cartflows' ),
231
- )
232
- );
233
-
234
-
235
- echo Cartflows_Admin_Fields::checkobox_field(
236
- array(
237
- 'id' => 'wcf_facebook_pixel_initiate_checkout',
238
- 'name' => '_cartflows_facebook[facebook_pixel_initiate_checkout]',
239
- 'title' => __( 'Initiate Checkout', 'cartflows' ),
240
- 'value' => $facebook_settings['facebook_pixel_initiate_checkout'],
241
- )
242
- );
243
-
244
- echo Cartflows_Admin_Fields::checkobox_field(
245
- array(
246
- 'id' => 'wcf_facebook_pixel_add_payment_info',
247
- 'name' => '_cartflows_facebook[facebook_pixel_add_payment_info]',
248
- 'title' => __( 'Add Payment Info', 'cartflows' ),
249
- 'value' => $facebook_settings['facebook_pixel_add_payment_info'],
250
- )
251
- );
252
-
253
- echo Cartflows_Admin_Fields::checkobox_field(
254
- array(
255
- 'id' => 'wcf_facebook_pixel_purchase_complete',
256
- 'name' => '_cartflows_facebook[facebook_pixel_purchase_complete]',
257
- 'title' => __( 'Purchase Complete', 'cartflows' ),
258
- 'value' => $facebook_settings['facebook_pixel_purchase_complete'],
259
- )
260
- );
261
-
262
- echo '</div>';
263
-
264
- ?>
265
- </div>
266
-
267
- <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-facebook-setting-save-btn button-primary button', 'submit', false ); ?>
268
- <?php wp_nonce_field( 'cartflows-facebook-settings', 'cartflows-facebook-settings-nonce' ); ?>
269
- </div>
270
-
271
- </div>
272
- </div>
273
- </form>
274
-
275
-
276
- </div>
277
- </div>
278
- <div class="postbox-container" id="postbox-container-1">
279
- <div id="side-sortables">
280
-
281
- <div class="postbox">
282
- <h2 class="hndle">
283
- <span class="dashicons dashicons-book"></span>
284
- <span><?php esc_html_e( 'Knowledge Base', 'cartflows' ); ?></span>
285
- </h2>
286
- <div class="inside">
287
- <p>
288
- <?php esc_html_e( 'Not sure how something works? Take a peek at the knowledge base and learn.', 'cartflows' ); ?>
289
- </p>
290
- <p>
291
- <a href="<?php echo esc_url( 'https://cartflows.com/docs' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Visit Knowledge Base »', 'cartflows' ); ?></a>
292
- </p>
293
- </div>
294
- </div>
295
-
296
- <div class="postbox">
297
- <h2 class="hndle">
298
- <span class="dashicons dashicons-groups"></span>
299
- <span><?php esc_html_e( 'Community', 'cartflows' ); ?></span>
300
- </h2>
301
- <div class="inside">
302
- <p>
303
- <?php esc_html_e( 'Join the community of super helpful CartFlows users. Say hello, ask questions, give feedback and help each other!', 'cartflows' ); ?>
304
- </p>
305
- <p>
306
- <a href="<?php echo esc_url( 'https://www.facebook.com/groups/cartflows/' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Join Our Facebook Group »', 'cartflows' ); ?></a>
307
- </p>
308
- </div>
309
- </div>
310
-
311
- <div class="postbox">
312
- <h2 class="hndle">
313
- <span class="dashicons dashicons-sos"></span>
314
- <span><?php esc_html_e( 'Five Star Support', 'cartflows' ); ?></span>
315
- </h2>
316
- <div class="inside">
317
- <p>
318
- <?php esc_html_e( 'Got a question? Get in touch with CartFlows developers. We\'re happy to help!', 'cartflows' ); ?>
319
- </p>
320
- <p>
321
- <a href="<?php echo esc_url( 'https://cartflows.com/contact' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Submit a Ticket »', 'cartflows' ); ?></a>
322
- </p>
323
- </div>
324
- </div>
325
- <?php
326
- if ( 'true' == $debug_on ) {
327
- ?>
328
- <div class="postbox">
329
- <h2 class="hndle">
330
- <span class="dashicons dashicons-editor-code"></span>
331
- <span><?php esc_html_e( 'Load Minified CSS', 'cartflows' ); ?></span>
332
- </h2>
333
- <div class="inside">
334
- <form method="post" class="wrap wcf-clear" action="">
335
- <p>
336
- <?php esc_html_e( 'Load the Minified CSS from here. Just Enable it by checking the below given checkbox.', 'cartflows' ); ?>
337
- </p>
338
- <?php
339
- echo Cartflows_Admin_Fields::checkobox_field(
340
- array(
341
- 'id' => 'allow_minified_files',
342
- 'name' => '_cartflows_debug_data[allow_minified_files]',
343
- 'title' => __( 'Load minified CSS & JS Files', 'cartflows' ),
344
- 'value' => $debug_data['allow_minified_files'],
345
- )
346
- );
347
- ?>
348
- <?php submit_button( __( 'Save', 'cartflows' ), 'button-primary button', 'submit', false ); ?>
349
- <?php wp_nonce_field( 'cartflows-debug-settings', 'cartflows-debug-settings-nonce' ); ?>
350
- </form>
351
- </div>
352
- </div>
353
- <?php
354
- }
355
- ?>
356
- </div>
357
- </div>
358
- </div>
359
- <!-- /post-body -->
360
- <br class="clear">
361
- </div>
362
- </div>
363
- <?php endif; ?>
364
-
365
- <?php
366
- /**
367
- * Loads Zapier settings admin view.
368
- */
369
- do_action( 'cartflows_after_general_settings' );
370
- ?>
1
+ <?php
2
+ /**
3
+ * General settings
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ $settings = Cartflows_Helper::get_common_settings();
9
+
10
+ $debug_data = Cartflows_Helper::get_debug_settings();
11
+
12
+ $permalink_settings = Cartflows_Helper::get_permalink_settings();
13
+
14
+ $facebook_settings = Cartflows_Helper::get_facebook_settings();
15
+
16
+ $debug_on = ( isset( $_GET['debug'] ) ) ? sanitize_text_field( wp_unslash( $_GET['debug'] ) ) : 'false'; //phpcs:ignore
17
+
18
+ $error_log = filter_input( INPUT_GET, 'cartflows-error-log', FILTER_VALIDATE_BOOLEAN );
19
+ ?>
20
+
21
+
22
+ <?php if ( $error_log ) : ?>
23
+ <div class="wrap wcf-addon-wrap wcf-clear wcf-container">
24
+ <?php Cartflows_Logger::status_logs_file(); ?>
25
+ </div>
26
+ <?php else : ?>
27
+ <div class="wrap wcf-addon-wrap wcf-clear wcf-container">
28
+ <input type="hidden" name="action" value="wcf_save_common_settings">
29
+ <h1 class="screen-reader-text"><?php esc_html_e( 'General Settings', 'cartflows' ); ?></h1>
30
+
31
+ <div id="poststuff">
32
+ <div id="post-body" class="columns-2">
33
+ <div id="post-body-content">
34
+ <div class="postbox introduction">
35
+ <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
36
+ <span><?php esc_html_e( 'Getting Started', 'cartflows' ); ?></span>
37
+ </h2>
38
+ <div class="inside">
39
+ <div class="iframe-wrap">
40
+ <iframe width="560" height="315" src="https://www.youtube.com/embed/SlE0moPKjMY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
41
+ </div>
42
+ <p>
43
+ <?php
44
+ esc_attr_e( 'Modernizing WordPress eCommerce!', 'cartflows' );
45
+ ?>
46
+ </p>
47
+ </div>
48
+ </div>
49
+
50
+ <div class="general-settings-form postbox">
51
+ <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
52
+ <span><?php esc_html_e( 'General Settings', 'cartflows' ); ?></span>
53
+ </h2>
54
+ <div class="inside">
55
+ <form method="post" class="wrap wcf-clear" action="" >
56
+ <div class="form-wrap">
57
+ <?php
58
+
59
+ do_action( 'cartflows_before_settings_fields', $settings );
60
+
61
+ echo Cartflows_Admin_Fields::checkobox_field(
62
+ array(
63
+ 'id' => 'wcf_disallow_indexing',
64
+ 'name' => '_cartflows_common[disallow_indexing]',
65
+ 'title' => __( 'Disallow search engines from indexing flows', 'cartflows' ),
66
+ 'value' => $settings['disallow_indexing'],
67
+ )
68
+ );
69
+
70
+ if ( wcf()->is_woo_active ) {
71
+ echo Cartflows_Admin_Fields::flow_checkout_selection_field(
72
+ array(
73
+ 'id' => 'wcf_global_checkout',
74
+ 'name' => '_cartflows_common[global_checkout]',
75
+ 'title' => __( 'Global Checkout', 'cartflows' ),
76
+ 'value' => $settings['global_checkout'],
77
+ )
78
+ );
79
+ }
80
+ echo Cartflows_Admin_Fields::select_field(
81
+ array(
82
+ 'id' => 'wcf_default_page_builder',
83
+ 'name' => '_cartflows_common[default_page_builder]',
84
+ 'title' => __( 'Show Templates designed with', 'cartflows' ),
85
+ 'description' => __( 'CartFlows offers flow templates that can be imported in one click. These templates are available in few different page builders. Please choose your preferred page builder from the list so you will only see templates that are made using that page builder..', 'cartflows' ),
86
+ 'value' => $settings['default_page_builder'],
87
+ 'options' => array(
88
+ 'elementor' => __( 'Elementor', 'cartflows' ),
89
+ 'beaver-builder' => __( 'Beaver Builder', 'cartflows' ),
90
+ 'divi' => __( 'Divi', 'cartflows' ),
91
+ 'other' => __( 'Other', 'cartflows' ),
92
+ ),
93
+ )
94
+ );
95
+
96
+ do_action( 'cartflows_after_settings_fields', $settings );
97
+
98
+ ?>
99
+ </div>
100
+ <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
101
+ <?php wp_nonce_field( 'cartflows-common-settings', 'cartflows-common-settings-nonce' ); ?>
102
+ </form>
103
+ </div>
104
+ </div>
105
+
106
+ <div class="general-settingss-form postbox">
107
+ <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
108
+ <span><?php esc_html_e( 'Permalink Settings', 'cartflows' ); ?></span>
109
+ </h2>
110
+ <div class="inside">
111
+ <form method="post" class="wrap wcf-clear" action="" >
112
+ <div class="form-wrap wcf_permalink_settings">
113
+ <?php
114
+
115
+ echo Cartflows_Admin_Fields::radio_field(
116
+ array(
117
+ 'id' => 'permalink_structure',
118
+ 'name' => '_cartflows_permalink[permalink_structure]',
119
+ 'value' => $permalink_settings['permalink_structure'],
120
+ 'options' => array(
121
+ '' =>
122
+ array(
123
+ 'label' => __( 'Default', 'cartflows' ),
124
+ 'description' => 'Default WordPress Permalink',
125
+ ),
126
+
127
+ '/' . CARTFLOWS_FLOW_POST_TYPE . '/%flowname%/' . CARTFLOWS_STEP_POST_TYPE =>
128
+ array(
129
+ 'label' => __( 'Flow and Step Slug', 'cartflows' ),
130
+ 'description' => '/<code>' . CARTFLOWS_FLOW_POST_TYPE . '</code>/%flowname%/<code>' . CARTFLOWS_STEP_POST_TYPE . '</code>/%stepname%/',
131
+ ),
132
+
133
+ '/' . CARTFLOWS_FLOW_POST_TYPE . '/%flowname%' =>
134
+ array(
135
+ 'label' => __( 'Flow Slug', 'cartflows' ),
136
+ 'description' => '/<code>' . CARTFLOWS_FLOW_POST_TYPE . '</code>/%flowname%/%stepname%/',
137
+ ),
138
+
139
+ '/%flowname%/' . CARTFLOWS_STEP_POST_TYPE =>
140
+ array(
141
+ 'label' => __( 'Step Slug', 'cartflows' ),
142
+ 'description' => '/%flowname%/<code>' . CARTFLOWS_STEP_POST_TYPE . '</code>/%stepname%/',
143
+ ),
144
+ ),
145
+ )
146
+ );
147
+ ?>
148
+ <hr/>
149
+ <?php
150
+
151
+ echo Cartflows_Admin_Fields::title_field(
152
+ array(
153
+ 'title' => __( 'Post Type Permalink Base', 'cartflows' ),
154
+ )
155
+ );
156
+
157
+ echo Cartflows_Admin_Fields::text_field(
158
+ array(
159
+ 'id' => 'wcf_permalink_step_base',
160
+ 'name' => '_cartflows_permalink[permalink]',
161
+ 'title' => __( 'Step Base', 'cartflows' ),
162
+ 'value' => $permalink_settings['permalink'],
163
+ 'placeholder' => CARTFLOWS_STEP_POST_TYPE,
164
+ )
165
+ );
166
+
167
+ echo Cartflows_Admin_Fields::text_field(
168
+ array(
169
+ 'id' => 'wcf_permalink_flow_base',
170
+ 'name' => '_cartflows_permalink[permalink_flow_base]',
171
+ 'title' => __( 'Flow Base', 'cartflows' ),
172
+ 'value' => $permalink_settings['permalink_flow_base'],
173
+ 'placeholder' => CARTFLOWS_FLOW_POST_TYPE,
174
+ )
175
+ );
176
+
177
+ ?>
178
+
179
+
180
+ </div>
181
+ <p>
182
+ <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
183
+ <?php submit_button( __( 'Set Default', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'reset', false ); ?>
184
+ <?php wp_nonce_field( 'cartflows-permalink-settings', 'cartflows-permalink-settings-nonce' ); ?>
185
+ </p>
186
+
187
+
188
+ </form>
189
+ </div>
190
+ </div>
191
+
192
+
193
+ <div class="general-settingss-form postbox">
194
+ <h2 class="wcf-facebook-hndle wcf-normal-cusror ui-sortable-handle hndle">
195
+
196
+ <span><?php esc_html_e( 'Facebook Pixel Settings', 'cartflows' ); ?></span>
197
+ </h2>
198
+
199
+ <form method="post" class="wrap wcf-clear" action="">
200
+ <div class="form-wrap">
201
+ <input type="hidden" name="action" value="wcf_save_facebook_pixel_settings">
202
+ <div id="post-body">
203
+
204
+ <div class="inside">
205
+ <div class="form-wrap">
206
+ <?php
207
+ echo Cartflows_Admin_Fields::checkobox_field(
208
+ array(
209
+ 'id' => 'wcf_facebook_pixel_tracking',
210
+ 'name' => '_cartflows_facebook[facebook_pixel_tracking]',
211
+ 'title' => __( 'Enable Facebook Pixel Tracking', 'cartflows' ),
212
+ 'value' => $facebook_settings['facebook_pixel_tracking'],
213
+ )
214
+ );
215
+
216
+ echo "<div class='wcf-fb-pixel-wrapper'>";
217
+
218
+ echo Cartflows_Admin_Fields::text_field(
219
+ array(
220
+ 'id' => 'wcf_facebook_pixel_id',
221
+ 'name' => '_cartflows_facebook[facebook_pixel_id]',
222
+ 'title' => __( 'Enter Facebook pixel ID', 'cartflows' ),
223
+ 'value' => $facebook_settings['facebook_pixel_id'],
224
+ )
225
+ );
226
+
227
+
228
+ echo Cartflows_Admin_Fields::title_field(
229
+ array(
230
+ 'title' => __( 'Enable Events:', 'cartflows' ),
231
+ )
232
+ );
233
+
234
+
235
+ echo Cartflows_Admin_Fields::checkobox_field(
236
+ array(
237
+ 'id' => 'wcf_facebook_pixel_initiate_checkout',
238
+ 'name' => '_cartflows_facebook[facebook_pixel_initiate_checkout]',
239
+ 'title' => __( 'Initiate Checkout', 'cartflows' ),
240
+ 'value' => $facebook_settings['facebook_pixel_initiate_checkout'],
241
+ )
242
+ );
243
+
244
+ echo Cartflows_Admin_Fields::checkobox_field(
245
+ array(
246
+ 'id' => 'wcf_facebook_pixel_add_payment_info',
247
+ 'name' => '_cartflows_facebook[facebook_pixel_add_payment_info]',
248
+ 'title' => __( 'Add Payment Info', 'cartflows' ),
249
+ 'value' => $facebook_settings['facebook_pixel_add_payment_info'],
250
+ )
251
+ );
252
+
253
+ echo Cartflows_Admin_Fields::checkobox_field(
254
+ array(
255
+ 'id' => 'wcf_facebook_pixel_purchase_complete',
256
+ 'name' => '_cartflows_facebook[facebook_pixel_purchase_complete]',
257
+ 'title' => __( 'Purchase Complete', 'cartflows' ),
258
+ 'value' => $facebook_settings['facebook_pixel_purchase_complete'],
259
+ )
260
+ );
261
+
262
+ echo '</div>';
263
+
264
+ ?>
265
+ </div>
266
+
267
+ <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-facebook-setting-save-btn button-primary button', 'submit', false ); ?>
268
+ <?php wp_nonce_field( 'cartflows-facebook-settings', 'cartflows-facebook-settings-nonce' ); ?>
269
+ </div>
270
+
271
+ </div>
272
+ </div>
273
+ </form>
274
+
275
+
276
+ </div>
277
+ </div>
278
+ <div class="postbox-container" id="postbox-container-1">
279
+ <div id="side-sortables">
280
+
281
+ <div class="postbox">
282
+ <h2 class="hndle">
283
+ <span class="dashicons dashicons-book"></span>
284
+ <span><?php esc_html_e( 'Knowledge Base', 'cartflows' ); ?></span>
285
+ </h2>
286
+ <div class="inside">
287
+ <p>
288
+ <?php esc_html_e( 'Not sure how something works? Take a peek at the knowledge base and learn.', 'cartflows' ); ?>
289
+ </p>
290
+ <p>
291
+ <a href="<?php echo esc_url( 'https://cartflows.com/docs' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Visit Knowledge Base »', 'cartflows' ); ?></a>
292
+ </p>
293
+ </div>
294
+ </div>
295
+
296
+ <div class="postbox">
297
+ <h2 class="hndle">
298
+ <span class="dashicons dashicons-groups"></span>
299
+ <span><?php esc_html_e( 'Community', 'cartflows' ); ?></span>
300
+ </h2>
301
+ <div class="inside">
302
+ <p>
303
+ <?php esc_html_e( 'Join the community of super helpful CartFlows users. Say hello, ask questions, give feedback and help each other!', 'cartflows' ); ?>
304
+ </p>
305
+ <p>
306
+ <a href="<?php echo esc_url( 'https://www.facebook.com/groups/cartflows/' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Join Our Facebook Group »', 'cartflows' ); ?></a>
307
+ </p>
308
+ </div>
309
+ </div>
310
+
311
+ <div class="postbox">
312
+ <h2 class="hndle">
313
+ <span class="dashicons dashicons-sos"></span>
314
+ <span><?php esc_html_e( 'Five Star Support', 'cartflows' ); ?></span>
315
+ </h2>
316
+ <div class="inside">
317
+ <p>
318
+ <?php esc_html_e( 'Got a question? Get in touch with CartFlows developers. We\'re happy to help!', 'cartflows' ); ?>
319
+ </p>
320
+ <p>
321
+ <a href="<?php echo esc_url( 'https://cartflows.com/contact' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Submit a Ticket »', 'cartflows' ); ?></a>
322
+ </p>
323
+ </div>
324
+ </div>
325
+ <?php
326
+ if ( 'true' == $debug_on ) {
327
+ ?>
328
+ <div class="postbox">
329
+ <h2 class="hndle">
330
+ <span class="dashicons dashicons-editor-code"></span>
331
+ <span><?php esc_html_e( 'Load Minified CSS', 'cartflows' ); ?></span>
332
+ </h2>
333
+ <div class="inside">
334
+ <form method="post" class="wrap wcf-clear" action="">
335
+ <p>
336
+ <?php esc_html_e( 'Load the Minified CSS from here. Just Enable it by checking the below given checkbox.', 'cartflows' ); ?>
337
+ </p>
338
+ <?php
339
+ echo Cartflows_Admin_Fields::checkobox_field(
340
+ array(
341
+ 'id' => 'allow_minified_files',
342
+ 'name' => '_cartflows_debug_data[allow_minified_files]',
343
+ 'title' => __( 'Load minified CSS & JS Files', 'cartflows' ),
344
+ 'value' => $debug_data['allow_minified_files'],
345
+ )
346
+ );
347
+ ?>
348
+ <?php submit_button( __( 'Save', 'cartflows' ), 'button-primary button', 'submit', false ); ?>
349
+ <?php wp_nonce_field( 'cartflows-debug-settings', 'cartflows-debug-settings-nonce' ); ?>
350
+ </form>
351
+ </div>
352
+ </div>
353
+ <?php
354
+ }
355
+ ?>
356
+ </div>
357
+ </div>
358
+ </div>
359
+ <!-- /post-body -->
360
+ <br class="clear">
361
+ </div>
362
+ </div>
363
+ <?php endif; ?>
364
+
365
+ <?php
366
+ /**
367
+ * Loads Zapier settings admin view.
368
+ */
369
+ do_action( 'cartflows_after_general_settings' );
370
+ ?>
languages/cartflows.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the CartFlows package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: CartFlows 1.3.5\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
- "POT-Creation-Date: 2020-01-28 07:43:33+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -53,6 +53,7 @@ msgstr ""
53
 
54
  #: classes/class-cartflows-admin.php:153 classes/class-cartflows-admin.php:154
55
  #: includes/admin/cartflows-general-bck.php:34
 
56
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:148
57
  msgid "Settings"
58
  msgstr ""
@@ -70,22 +71,22 @@ msgid "Flows Library"
70
  msgstr ""
71
 
72
  #: classes/class-cartflows-admin.php:467
73
- #: modules/flow/view/meta-flow-steps.php:155
74
  msgid "Ready Templates"
75
  msgstr ""
76
 
77
  #: classes/class-cartflows-admin.php:470
78
- #: modules/flow/view/meta-flow-steps.php:158
79
  msgid "Create Your Own"
80
  msgstr ""
81
 
82
  #: classes/class-cartflows-admin.php:481
83
- #: modules/flow/view/meta-flow-steps.php:170
84
  msgid "Search Sites"
85
  msgstr ""
86
 
87
  #: classes/class-cartflows-admin.php:482
88
- #: modules/flow/view/meta-flow-steps.php:171
89
  msgid "Search Flow..."
90
  msgstr ""
91
 
@@ -96,7 +97,7 @@ msgstr ""
96
  #: classes/class-cartflows-admin.php:500
97
  #: classes/class-cartflows-importer.php:636
98
  #: classes/class-cartflows-importer.php:735
99
- #: modules/flow/view/meta-flow-steps.php:201
100
  msgid "Learn How"
101
  msgstr ""
102
 
@@ -109,10 +110,15 @@ msgid "Clone this flow"
109
  msgstr ""
110
 
111
  #: classes/class-cartflows-cloning.php:423
112
- #: modules/flow/view/meta-flow-steps.php:114
113
  msgid "Clone"
114
  msgstr ""
115
 
 
 
 
 
 
116
  #: classes/class-cartflows-flow-frontend.php:53
117
  msgid ""
118
  "Test mode is active — which displays random products for previewing. It can "
@@ -246,61 +252,61 @@ msgstr ""
246
  msgid "Select Step Type"
247
  msgstr ""
248
 
249
- #: classes/class-cartflows-importer.php:923
250
  msgid "Import from Cloud"
251
  msgstr ""
252
 
253
- #: classes/class-cartflows-importer.php:1237
254
  msgid "Sales Landing"
255
  msgstr ""
256
 
257
- #: classes/class-cartflows-importer.php:1241
258
- #: modules/flow/classes/class-cartflows-step-post-type.php:244
259
  #: modules/flow/view/meta-flow-steps.php:12
260
  msgid "Checkout (Woo)"
261
  msgstr ""
262
 
263
- #: classes/class-cartflows-importer.php:1245
264
- #: modules/flow/classes/class-cartflows-step-post-type.php:251
265
  #: modules/flow/view/meta-flow-steps.php:13
266
  msgid "Thank You (Woo)"
267
  msgstr ""
268
 
269
- #: classes/class-cartflows-importer.php:1253
270
  #: modules/flow/classes/class-cartflows-step-post-type.php:237
271
  #: modules/flow/view/meta-flow-steps.php:11
272
  msgid "Landing"
273
  msgstr ""
274
 
275
- #: classes/class-cartflows-importer.php:1257
276
  msgid "Thank You"
277
  msgstr ""
278
 
279
- #: classes/class-cartflows-importer.php:1359
280
  #. translators: %s: template ID
281
  msgid "Invalid template id %1$s or post id %2$s."
282
  msgstr ""
283
 
284
- #: classes/class-cartflows-importer.php:1417
285
  #. translators: %s: flow ID
286
  msgid "Invalid flow id %1$s OR step type %2$s."
287
  msgstr ""
288
 
289
- #: classes/class-cartflows-importer.php:1542
290
  msgid ""
291
  "Elementor is not activated. Please activate plugin Elementor Page Builder "
292
  "to import the step."
293
  msgstr ""
294
 
295
- #: classes/class-cartflows-importer.php:1645
296
  msgid "Action failed. Invalid Security Nonce."
297
  msgstr ""
298
 
299
- #: classes/class-cartflows-importer.php:1652
300
  msgid "User have not plugin install permissions."
301
  msgstr ""
302
 
303
- #: classes/class-cartflows-importer.php:1674
304
  msgid "Plugin Successfully Activated"
305
  msgstr ""
306
 
@@ -319,25 +325,25 @@ msgstr ""
319
  msgid "Select CartFlows Template for this Course"
320
  msgstr ""
321
 
322
- #: classes/class-cartflows-loader.php:217
323
  #. translators: %s: html tags
324
  msgid ""
325
  "You are using an older version of %1$sCartFlows Pro%2$s. Please update "
326
  "%1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher."
327
  msgstr ""
328
 
329
- #: classes/class-cartflows-loader.php:470
330
  #. translators: %s: html tags
331
  msgid ""
332
  "This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & "
333
  "activated."
334
  msgstr ""
335
 
336
- #: classes/class-cartflows-loader.php:480
337
  msgid "Activate WooCommerce"
338
  msgstr ""
339
 
340
- #: classes/class-cartflows-loader.php:488
341
  msgid "Install WooCommerce"
342
  msgstr ""
343
 
@@ -345,112 +351,55 @@ msgstr ""
345
  msgid "Action failed. Please refresh the page and retry."
346
  msgstr ""
347
 
348
- #: classes/class-cartflows-meta-fields.php:86
349
  msgid "Thin 100"
350
  msgstr ""
351
 
352
- #: classes/class-cartflows-meta-fields.php:87
353
  msgid "Extra-Light 200"
354
  msgstr ""
355
 
356
- #: classes/class-cartflows-meta-fields.php:88
357
  msgid "Light 300"
358
  msgstr ""
359
 
360
- #: classes/class-cartflows-meta-fields.php:89
361
  msgid "Normal 400"
362
  msgstr ""
363
 
364
- #: classes/class-cartflows-meta-fields.php:90
365
  msgid "Medium 500"
366
  msgstr ""
367
 
368
- #: classes/class-cartflows-meta-fields.php:91
369
  msgid "Semi-Bold 600"
370
  msgstr ""
371
 
372
- #: classes/class-cartflows-meta-fields.php:92
373
  msgid "Bold 700"
374
  msgstr ""
375
 
376
- #: classes/class-cartflows-meta-fields.php:93
377
  msgid "Extra-Bold 800"
378
  msgstr ""
379
 
380
- #: classes/class-cartflows-meta-fields.php:94
381
  msgid "Ultra-Bold 900"
382
  msgstr ""
383
 
384
- #: classes/class-cartflows-meta-fields.php:217
385
- #: classes/class-cartflows-meta-fields.php:325
386
- #: classes/class-cartflows-meta-fields.php:1426
387
- msgid "Remove"
388
- msgstr ""
389
-
390
- #: classes/class-cartflows-meta-fields.php:446
391
- msgid "Field Width"
392
- msgstr ""
393
-
394
- #: classes/class-cartflows-meta-fields.php:450
395
- msgid "33%"
396
- msgstr ""
397
-
398
- #: classes/class-cartflows-meta-fields.php:451
399
- msgid "50%"
400
- msgstr ""
401
-
402
- #: classes/class-cartflows-meta-fields.php:452
403
- msgid "100%"
404
- msgstr ""
405
-
406
- #: classes/class-cartflows-meta-fields.php:463
407
- msgid "Field Label"
408
- msgstr ""
409
-
410
- #: classes/class-cartflows-meta-fields.php:477
411
- msgid "Options"
412
- msgstr ""
413
-
414
- #: classes/class-cartflows-meta-fields.php:492
415
- #: classes/class-cartflows-meta-fields.php:505
416
- #: includes/admin/cartflows-general.php:123
417
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:569
418
- msgid "Default"
419
- msgstr ""
420
-
421
- #: classes/class-cartflows-meta-fields.php:496
422
- msgid "Checked"
423
- msgstr ""
424
-
425
- #: classes/class-cartflows-meta-fields.php:497
426
- msgid "Un-Checked"
427
- msgstr ""
428
-
429
- #: classes/class-cartflows-meta-fields.php:518
430
- msgid "Placeholder"
431
- msgstr ""
432
-
433
- #: classes/class-cartflows-meta-fields.php:530
434
- msgid "Required"
435
- msgstr ""
436
-
437
- #: classes/class-cartflows-meta-fields.php:542
438
- msgid "Enable this field"
439
- msgstr ""
440
-
441
- #: classes/class-cartflows-meta-fields.php:562
442
- msgid "Label"
443
- msgstr ""
444
-
445
- #: classes/class-cartflows-meta-fields.php:999
446
- #: classes/class-cartflows-meta-fields.php:1418
447
  msgid "Search for a product&hellip;"
448
  msgstr ""
449
 
450
- #: classes/class-cartflows-meta-fields.php:1040
451
  msgid "Search for a coupon&hellip;"
452
  msgstr ""
453
 
 
 
 
 
454
  #: classes/class-cartflows-meta.php:34
455
  msgid "Update"
456
  msgstr ""
@@ -463,6 +412,7 @@ msgstr ""
463
  #: classes/class-cartflows-meta.php:63
464
  #: modules/checkout/classes/class-cartflows-checkout-meta.php:192
465
  #: modules/landing/classes/class-cartflows-landing-meta.php:136
 
466
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:154
467
  msgid "Custom Script"
468
  msgstr ""
@@ -694,7 +644,7 @@ msgstr ""
694
 
695
  #: includes/admin/cartflows-error-log.php:41
696
  #: modules/flow/classes/class-cartflows-flow-post-type.php:225
697
- #: modules/flow/view/meta-flow-steps.php:103
698
  msgid "View"
699
  msgstr ""
700
 
@@ -728,7 +678,7 @@ msgid "Disallow search engines from indexing flows"
728
  msgstr ""
729
 
730
  #: includes/admin/cartflows-general.php:75
731
- #: modules/flow/view/meta-flow-steps.php:92
732
  msgid "Global Checkout"
733
  msgstr ""
734
 
@@ -758,6 +708,12 @@ msgstr ""
758
  msgid "Permalink Settings"
759
  msgstr ""
760
 
 
 
 
 
 
 
761
  #: includes/admin/cartflows-general.php:129
762
  msgid "Flow and Step Slug"
763
  msgstr ""
@@ -893,6 +849,7 @@ msgid "Import"
893
  msgstr ""
894
 
895
  #: modules/checkout/classes/class-cartflows-checkout-markup.php:254
 
896
  #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:88
897
  msgid ""
898
  "WooCommerce functions do not exist. If you are in an IFrame, please reload "
@@ -900,6 +857,7 @@ msgid ""
900
  msgstr ""
901
 
902
  #: modules/checkout/classes/class-cartflows-checkout-markup.php:255
 
903
  #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:89
904
  msgid "Click Here to Reload"
905
  msgstr ""
@@ -911,6 +869,7 @@ msgstr ""
911
  #: modules/checkout/classes/class-cartflows-checkout-markup.php:336
912
  #: modules/checkout/templates/embed/checkout-template-simple.php:25
913
  #: modules/checkout/templates/wcf-template.php:36
 
914
  msgid "Your cart is currently empty."
915
  msgstr ""
916
 
@@ -960,11 +919,13 @@ msgstr ""
960
 
961
  #: modules/checkout/classes/class-cartflows-checkout-meta.php:150
962
  #: modules/landing/classes/class-cartflows-landing-meta.php:130
 
963
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:130
964
  msgid "Shortcodes"
965
  msgstr ""
966
 
967
  #: modules/checkout/classes/class-cartflows-checkout-meta.php:156
 
968
  msgid "Select Product"
969
  msgstr ""
970
 
@@ -1013,206 +974,257 @@ msgstr ""
1013
  msgid "Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature"
1014
  msgstr ""
1015
 
1016
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:366
 
 
 
 
 
 
 
 
 
 
 
 
1017
  #. translators: %s: link
1018
  msgid "Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature."
1019
  msgstr ""
1020
 
1021
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:393
 
1022
  #. translators: %s: link
1023
  msgid "Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature."
1024
  msgstr ""
1025
 
1026
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:416
1027
  msgid "Place Order Button Text"
1028
  msgstr ""
1029
 
1030
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:420
1031
  msgid "Place order"
1032
  msgstr ""
1033
 
1034
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:422
1035
  msgid "It will change the Place Order Button text on checkout page."
1036
  msgstr ""
1037
 
1038
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:432
1039
  msgid "Enable cart editing on checkout"
1040
  msgstr ""
1041
 
1042
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:440
1043
  #. translators: %s: link
1044
  msgid "Users will able to remove products from the checkout page."
1045
  msgstr ""
1046
 
1047
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:468
1048
  msgid "One Column (Available in CartFlows Pro) "
1049
  msgstr ""
1050
 
1051
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:469
1052
  msgid "Two Step (Available in CartFlows Pro) "
1053
  msgstr ""
1054
 
1055
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:475
1056
  msgid "Checkout Skin"
1057
  msgstr ""
1058
 
1059
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:479
1060
  msgid "One Column"
1061
  msgstr ""
1062
 
1063
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:480
1064
  msgid "Two Column"
1065
  msgstr ""
1066
 
1067
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:481
1068
  msgid "Two Step"
1069
  msgstr ""
1070
 
1071
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:490
 
1072
  msgid "Primary Color"
1073
  msgstr ""
1074
 
1075
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:499
1076
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:534
1077
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:580
1078
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:672
 
 
 
1079
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:209
1080
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:232
1081
  msgid "Font Family"
1082
  msgstr ""
1083
 
1084
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:507
1085
  msgid "Advance Options"
1086
  msgstr ""
1087
 
1088
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:519
1089
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:217
1090
  msgid "Heading"
1091
  msgstr ""
1092
 
1093
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:525
1094
  msgid "Heading Color"
1095
  msgstr ""
1096
 
1097
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:543
1098
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:589
1099
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:681
1100
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:241
 
 
1101
  msgid "Font Weight"
1102
  msgstr ""
1103
 
1104
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:551
 
1105
  msgid "Input Fields"
1106
  msgstr ""
1107
 
1108
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:559
 
1109
  msgid "Floating Labels (Available in CartFlows Pro)"
1110
  msgstr ""
1111
 
1112
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:565
 
1113
  msgid "Style"
1114
  msgstr ""
1115
 
1116
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:570
 
1117
  msgid "Floating Labels"
1118
  msgstr ""
1119
 
1120
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:597
1121
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:689
 
 
1122
  msgid "Size"
1123
  msgstr ""
1124
 
1125
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:601
1126
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:693
 
 
1127
  msgid "Extra Small"
1128
  msgstr ""
1129
 
1130
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:602
1131
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:694
 
 
1132
  msgid "Small"
1133
  msgstr ""
1134
 
1135
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:603
1136
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:695
 
 
1137
  msgid "Medium"
1138
  msgstr ""
1139
 
1140
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:604
1141
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:696
 
 
1142
  msgid "Large"
1143
  msgstr ""
1144
 
1145
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:605
1146
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:697
 
 
1147
  msgid "Extra Large"
1148
  msgstr ""
1149
 
1150
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:606
1151
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:698
 
 
1152
  msgid "Custom"
1153
  msgstr ""
1154
 
1155
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:613
1156
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:705
 
 
1157
  msgid "Top Bottom Spacing"
1158
  msgstr ""
1159
 
1160
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:621
1161
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:713
 
 
1162
  msgid "Left Right Spacing"
1163
  msgstr ""
1164
 
1165
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:629
 
1166
  msgid "Text / Placeholder Color"
1167
  msgstr ""
1168
 
1169
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:637
1170
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:737
 
 
1171
  msgid "Background Color"
1172
  msgstr ""
1173
 
1174
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:645
1175
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:753
 
 
1176
  msgid "Border Color"
1177
  msgstr ""
1178
 
1179
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:652
 
1180
  msgid "Label Color"
1181
  msgstr ""
1182
 
1183
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:665
1184
  msgid "Buttons"
1185
  msgstr ""
1186
 
1187
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:721
 
1188
  msgid "Text Color"
1189
  msgstr ""
1190
 
1191
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:729
 
1192
  msgid "Text Hover Color"
1193
  msgstr ""
1194
 
1195
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:745
 
1196
  msgid "Background Hover Color"
1197
  msgstr ""
1198
 
1199
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:761
 
1200
  msgid "Border Hover Color"
1201
  msgstr ""
1202
 
1203
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:774
1204
  msgid "Sections"
1205
  msgstr ""
1206
 
1207
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:780
1208
  msgid "Highlight Area Background Color"
1209
  msgstr ""
1210
 
1211
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:819
1212
  msgid "Header Logo"
1213
  msgstr ""
1214
 
1215
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:827
1216
  msgid "Logo Width (In px)"
1217
  msgstr ""
1218
 
@@ -1295,7 +1307,7 @@ msgid ""
1295
  msgstr ""
1296
 
1297
  #: modules/flow/classes/class-cartflows-flow-meta.php:769
1298
- #: modules/flow/view/meta-flow-steps.php:132
1299
  msgid "Add New Step"
1300
  msgstr ""
1301
 
@@ -1352,57 +1364,57 @@ msgstr ""
1352
 
1353
  #: modules/flow/classes/class-cartflows-flow-post-type.php:354
1354
  #: modules/flow/classes/class-cartflows-flow-post-type.php:360
1355
- #: modules/flow/classes/class-cartflows-step-post-type.php:390
1356
- #: modules/flow/classes/class-cartflows-step-post-type.php:396
1357
  #. translators: %s: singular custom post type name
1358
  msgid "%s updated."
1359
  msgstr ""
1360
 
1361
  #: modules/flow/classes/class-cartflows-flow-post-type.php:356
1362
- #: modules/flow/classes/class-cartflows-step-post-type.php:392
1363
  #. translators: %s: singular custom post type name
1364
  msgid "Custom %s updated."
1365
  msgstr ""
1366
 
1367
  #: modules/flow/classes/class-cartflows-flow-post-type.php:358
1368
- #: modules/flow/classes/class-cartflows-step-post-type.php:394
1369
  #. translators: %s: singular custom post type name
1370
  msgid "Custom %s deleted."
1371
  msgstr ""
1372
 
1373
  #: modules/flow/classes/class-cartflows-flow-post-type.php:362
1374
- #: modules/flow/classes/class-cartflows-step-post-type.php:398
1375
  #. translators: %1$s: singular custom post type name ,%2$s: date and time of
1376
  #. the revision
1377
  msgid "%1$s restored to revision from %2$s"
1378
  msgstr ""
1379
 
1380
  #: modules/flow/classes/class-cartflows-flow-post-type.php:364
1381
- #: modules/flow/classes/class-cartflows-step-post-type.php:400
1382
  #. translators: %s: singular custom post type name
1383
  msgid "%s published."
1384
  msgstr ""
1385
 
1386
  #: modules/flow/classes/class-cartflows-flow-post-type.php:366
1387
- #: modules/flow/classes/class-cartflows-step-post-type.php:402
1388
  #. translators: %s: singular custom post type name
1389
  msgid "%s saved."
1390
  msgstr ""
1391
 
1392
  #: modules/flow/classes/class-cartflows-flow-post-type.php:368
1393
- #: modules/flow/classes/class-cartflows-step-post-type.php:404
1394
  #. translators: %s: singular custom post type name
1395
  msgid "%s submitted."
1396
  msgstr ""
1397
 
1398
  #: modules/flow/classes/class-cartflows-flow-post-type.php:370
1399
- #: modules/flow/classes/class-cartflows-step-post-type.php:406
1400
  #. translators: %s: singular custom post type name
1401
  msgid "%s scheduled for."
1402
  msgstr ""
1403
 
1404
  #: modules/flow/classes/class-cartflows-flow-post-type.php:372
1405
- #: modules/flow/classes/class-cartflows-step-post-type.php:408
1406
  #. translators: %s: singular custom post type name
1407
  msgid "%s draft updated."
1408
  msgstr ""
@@ -1421,12 +1433,12 @@ msgid "All Steps"
1421
  msgstr ""
1422
 
1423
  #: modules/flow/classes/class-cartflows-step-post-type.php:164
1424
- #: modules/flow/view/meta-flow-steps.php:105
1425
  msgid "Edit Step"
1426
  msgstr ""
1427
 
1428
  #: modules/flow/classes/class-cartflows-step-post-type.php:165
1429
- #: modules/flow/view/meta-flow-steps.php:101
1430
  msgid "View Step"
1431
  msgstr ""
1432
 
@@ -1446,49 +1458,54 @@ msgstr ""
1446
  msgid "Step Flow"
1447
  msgstr ""
1448
 
1449
- #: modules/flow/classes/class-cartflows-step-post-type.php:258
 
 
 
 
 
1450
  #: modules/flow/view/meta-flow-steps.php:14
1451
  msgid "Upsell (Woo)"
1452
  msgstr ""
1453
 
1454
- #: modules/flow/classes/class-cartflows-step-post-type.php:265
1455
  #: modules/flow/view/meta-flow-steps.php:15
1456
  msgid "Downsell (Woo)"
1457
  msgstr ""
1458
 
1459
- #: modules/flow/view/meta-flow-steps.php:84
1460
  msgid "No Product Assigned"
1461
  msgstr ""
1462
 
1463
- #: modules/flow/view/meta-flow-steps.php:88
1464
  msgid "Global Checkout - Remove selected checkout product"
1465
  msgstr ""
1466
 
1467
- #: modules/flow/view/meta-flow-steps.php:107
1468
  msgid "Edit"
1469
  msgstr ""
1470
 
1471
- #: modules/flow/view/meta-flow-steps.php:112
1472
  msgid "Clone Step"
1473
  msgstr ""
1474
 
1475
- #: modules/flow/view/meta-flow-steps.php:117
1476
  msgid "Delete Step"
1477
  msgstr ""
1478
 
1479
- #: modules/flow/view/meta-flow-steps.php:119
1480
  msgid "Delete"
1481
  msgstr ""
1482
 
1483
- #: modules/flow/view/meta-flow-steps.php:148
1484
  msgid "Steps Library"
1485
  msgstr ""
1486
 
1487
- #: modules/flow/view/meta-flow-steps.php:197
1488
  msgid "Create Step"
1489
  msgstr ""
1490
 
1491
- #: modules/flow/view/meta-flow-steps.php:199
1492
  msgid "You need a Cartflows Pro version to import Upsell / Downsell"
1493
  msgstr ""
1494
 
@@ -1500,14 +1517,117 @@ msgstr ""
1500
  msgid "Next Step Link"
1501
  msgstr ""
1502
 
1503
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:65
1504
- msgid "Thank You Page Settings"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1505
  msgstr ""
1506
 
 
1507
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:136
1508
  msgid "Design"
1509
  msgstr ""
1510
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1511
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:142
1512
  msgid "Edit Fields"
1513
  msgstr ""
@@ -1521,47 +1641,47 @@ msgid "Text"
1521
  msgstr ""
1522
 
1523
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:200
1524
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:223
1525
  msgid "Color"
1526
  msgstr ""
1527
 
1528
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:249
1529
  msgid "Advanced Options"
1530
  msgstr ""
1531
 
1532
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:259
1533
  msgid "Container Width (In px)"
1534
  msgstr ""
1535
 
1536
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:267
1537
  msgid "Section Background Color"
1538
  msgstr ""
1539
 
1540
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:281
1541
  msgid "Enable Order Overview "
1542
  msgstr ""
1543
 
1544
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:289
1545
  msgid "Enable Order Details "
1546
  msgstr ""
1547
 
1548
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:297
1549
  msgid "Enable Billing Details "
1550
  msgstr ""
1551
 
1552
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:305
1553
  msgid "Enable Shipping Details "
1554
  msgstr ""
1555
 
1556
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:321
1557
  msgid "Redirect After Purchase"
1558
  msgstr ""
1559
 
1560
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:330
1561
  msgid "Redirect Link"
1562
  msgstr ""
1563
 
1564
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:334
1565
  msgid "https://"
1566
  msgstr ""
1567
 
@@ -1816,12 +1936,12 @@ msgctxt "flow step singular name"
1816
  msgid "Step"
1817
  msgstr ""
1818
 
1819
- #: modules/flow/classes/class-cartflows-step-post-type.php:306
1820
  msgctxt "cartflows"
1821
  msgid "CartFlows — Boxed"
1822
  msgstr ""
1823
 
1824
- #: modules/flow/classes/class-cartflows-step-post-type.php:307
1825
  msgctxt "cartflows"
1826
  msgid "Template for Page Builders"
1827
  msgstr ""
2
  # This file is distributed under the same license as the CartFlows package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: CartFlows 1.4.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
+ "POT-Creation-Date: 2020-02-13 09:35:14+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
53
 
54
  #: classes/class-cartflows-admin.php:153 classes/class-cartflows-admin.php:154
55
  #: includes/admin/cartflows-general-bck.php:34
56
+ #: modules/optin/classes/class-cartflows-optin-meta.php:150
57
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:148
58
  msgid "Settings"
59
  msgstr ""
71
  msgstr ""
72
 
73
  #: classes/class-cartflows-admin.php:467
74
+ #: modules/flow/view/meta-flow-steps.php:156
75
  msgid "Ready Templates"
76
  msgstr ""
77
 
78
  #: classes/class-cartflows-admin.php:470
79
+ #: modules/flow/view/meta-flow-steps.php:159
80
  msgid "Create Your Own"
81
  msgstr ""
82
 
83
  #: classes/class-cartflows-admin.php:481
84
+ #: modules/flow/view/meta-flow-steps.php:171
85
  msgid "Search Sites"
86
  msgstr ""
87
 
88
  #: classes/class-cartflows-admin.php:482
89
+ #: modules/flow/view/meta-flow-steps.php:172
90
  msgid "Search Flow..."
91
  msgstr ""
92
 
97
  #: classes/class-cartflows-admin.php:500
98
  #: classes/class-cartflows-importer.php:636
99
  #: classes/class-cartflows-importer.php:735
100
+ #: modules/flow/view/meta-flow-steps.php:202
101
  msgid "Learn How"
102
  msgstr ""
103
 
110
  msgstr ""
111
 
112
  #: classes/class-cartflows-cloning.php:423
113
+ #: modules/flow/view/meta-flow-steps.php:115
114
  msgid "Clone"
115
  msgstr ""
116
 
117
+ #: classes/class-cartflows-default-meta.php:710
118
+ #: modules/optin/classes/class-cartflows-optin-meta.php:487
119
+ msgid "Submit"
120
+ msgstr ""
121
+
122
  #: classes/class-cartflows-flow-frontend.php:53
123
  msgid ""
124
  "Test mode is active — which displays random products for previewing. It can "
252
  msgid "Select Step Type"
253
  msgstr ""
254
 
255
+ #: classes/class-cartflows-importer.php:930
256
  msgid "Import from Cloud"
257
  msgstr ""
258
 
259
+ #: classes/class-cartflows-importer.php:1244
260
  msgid "Sales Landing"
261
  msgstr ""
262
 
263
+ #: classes/class-cartflows-importer.php:1248
264
+ #: modules/flow/classes/class-cartflows-step-post-type.php:251
265
  #: modules/flow/view/meta-flow-steps.php:12
266
  msgid "Checkout (Woo)"
267
  msgstr ""
268
 
269
+ #: classes/class-cartflows-importer.php:1252
270
+ #: modules/flow/classes/class-cartflows-step-post-type.php:258
271
  #: modules/flow/view/meta-flow-steps.php:13
272
  msgid "Thank You (Woo)"
273
  msgstr ""
274
 
275
+ #: classes/class-cartflows-importer.php:1260
276
  #: modules/flow/classes/class-cartflows-step-post-type.php:237
277
  #: modules/flow/view/meta-flow-steps.php:11
278
  msgid "Landing"
279
  msgstr ""
280
 
281
+ #: classes/class-cartflows-importer.php:1264
282
  msgid "Thank You"
283
  msgstr ""
284
 
285
+ #: classes/class-cartflows-importer.php:1366
286
  #. translators: %s: template ID
287
  msgid "Invalid template id %1$s or post id %2$s."
288
  msgstr ""
289
 
290
+ #: classes/class-cartflows-importer.php:1424
291
  #. translators: %s: flow ID
292
  msgid "Invalid flow id %1$s OR step type %2$s."
293
  msgstr ""
294
 
295
+ #: classes/class-cartflows-importer.php:1549
296
  msgid ""
297
  "Elementor is not activated. Please activate plugin Elementor Page Builder "
298
  "to import the step."
299
  msgstr ""
300
 
301
+ #: classes/class-cartflows-importer.php:1652
302
  msgid "Action failed. Invalid Security Nonce."
303
  msgstr ""
304
 
305
+ #: classes/class-cartflows-importer.php:1659
306
  msgid "User have not plugin install permissions."
307
  msgstr ""
308
 
309
+ #: classes/class-cartflows-importer.php:1681
310
  msgid "Plugin Successfully Activated"
311
  msgstr ""
312
 
325
  msgid "Select CartFlows Template for this Course"
326
  msgstr ""
327
 
328
+ #: classes/class-cartflows-loader.php:215
329
  #. translators: %s: html tags
330
  msgid ""
331
  "You are using an older version of %1$sCartFlows Pro%2$s. Please update "
332
  "%1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher."
333
  msgstr ""
334
 
335
+ #: classes/class-cartflows-loader.php:452
336
  #. translators: %s: html tags
337
  msgid ""
338
  "This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & "
339
  "activated."
340
  msgstr ""
341
 
342
+ #: classes/class-cartflows-loader.php:462
343
  msgid "Activate WooCommerce"
344
  msgstr ""
345
 
346
+ #: classes/class-cartflows-loader.php:470
347
  msgid "Install WooCommerce"
348
  msgstr ""
349
 
351
  msgid "Action failed. Please refresh the page and retry."
352
  msgstr ""
353
 
354
+ #: classes/class-cartflows-meta-fields.php:80
355
  msgid "Thin 100"
356
  msgstr ""
357
 
358
+ #: classes/class-cartflows-meta-fields.php:81
359
  msgid "Extra-Light 200"
360
  msgstr ""
361
 
362
+ #: classes/class-cartflows-meta-fields.php:82
363
  msgid "Light 300"
364
  msgstr ""
365
 
366
+ #: classes/class-cartflows-meta-fields.php:83
367
  msgid "Normal 400"
368
  msgstr ""
369
 
370
+ #: classes/class-cartflows-meta-fields.php:84
371
  msgid "Medium 500"
372
  msgstr ""
373
 
374
+ #: classes/class-cartflows-meta-fields.php:85
375
  msgid "Semi-Bold 600"
376
  msgstr ""
377
 
378
+ #: classes/class-cartflows-meta-fields.php:86
379
  msgid "Bold 700"
380
  msgstr ""
381
 
382
+ #: classes/class-cartflows-meta-fields.php:87
383
  msgid "Extra-Bold 800"
384
  msgstr ""
385
 
386
+ #: classes/class-cartflows-meta-fields.php:88
387
  msgid "Ultra-Bold 900"
388
  msgstr ""
389
 
390
+ #: classes/class-cartflows-meta-fields.php:551
391
+ #: classes/class-cartflows-meta-fields.php:746
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  msgid "Search for a product&hellip;"
393
  msgstr ""
394
 
395
+ #: classes/class-cartflows-meta-fields.php:592
396
  msgid "Search for a coupon&hellip;"
397
  msgstr ""
398
 
399
+ #: classes/class-cartflows-meta-fields.php:754
400
+ msgid "Remove"
401
+ msgstr ""
402
+
403
  #: classes/class-cartflows-meta.php:34
404
  msgid "Update"
405
  msgstr ""
412
  #: classes/class-cartflows-meta.php:63
413
  #: modules/checkout/classes/class-cartflows-checkout-meta.php:192
414
  #: modules/landing/classes/class-cartflows-landing-meta.php:136
415
+ #: modules/optin/classes/class-cartflows-optin-meta.php:156
416
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:154
417
  msgid "Custom Script"
418
  msgstr ""
644
 
645
  #: includes/admin/cartflows-error-log.php:41
646
  #: modules/flow/classes/class-cartflows-flow-post-type.php:225
647
+ #: modules/flow/view/meta-flow-steps.php:104
648
  msgid "View"
649
  msgstr ""
650
 
678
  msgstr ""
679
 
680
  #: includes/admin/cartflows-general.php:75
681
+ #: modules/flow/view/meta-flow-steps.php:93
682
  msgid "Global Checkout"
683
  msgstr ""
684
 
708
  msgid "Permalink Settings"
709
  msgstr ""
710
 
711
+ #: includes/admin/cartflows-general.php:123
712
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:603
713
+ #: modules/optin/classes/class-cartflows-optin-meta.php:380
714
+ msgid "Default"
715
+ msgstr ""
716
+
717
  #: includes/admin/cartflows-general.php:129
718
  msgid "Flow and Step Slug"
719
  msgstr ""
849
  msgstr ""
850
 
851
  #: modules/checkout/classes/class-cartflows-checkout-markup.php:254
852
+ #: modules/optin/classes/class-cartflows-optin-markup.php:146
853
  #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:88
854
  msgid ""
855
  "WooCommerce functions do not exist. If you are in an IFrame, please reload "
857
  msgstr ""
858
 
859
  #: modules/checkout/classes/class-cartflows-checkout-markup.php:255
860
+ #: modules/optin/classes/class-cartflows-optin-markup.php:147
861
  #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:89
862
  msgid "Click Here to Reload"
863
  msgstr ""
869
  #: modules/checkout/classes/class-cartflows-checkout-markup.php:336
870
  #: modules/checkout/templates/embed/checkout-template-simple.php:25
871
  #: modules/checkout/templates/wcf-template.php:36
872
+ #: modules/optin/templates/optin-template-simple.php:25
873
  msgid "Your cart is currently empty."
874
  msgstr ""
875
 
919
 
920
  #: modules/checkout/classes/class-cartflows-checkout-meta.php:150
921
  #: modules/landing/classes/class-cartflows-landing-meta.php:130
922
+ #: modules/optin/classes/class-cartflows-optin-meta.php:126
923
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:130
924
  msgid "Shortcodes"
925
  msgstr ""
926
 
927
  #: modules/checkout/classes/class-cartflows-checkout-meta.php:156
928
+ #: modules/optin/classes/class-cartflows-optin-meta.php:132
929
  msgid "Select Product"
930
  msgstr ""
931
 
974
  msgid "Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature"
975
  msgstr ""
976
 
977
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:365
978
+ #. translators: %s: link
979
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for animate browser tab feature"
980
+ msgstr ""
981
+
982
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:375
983
+ #. translators: %s: link
984
+ msgid ""
985
+ "Update to %1$sCartFlows Pro%2$s to %3$s or above for animate browser tab "
986
+ "feature"
987
+ msgstr ""
988
+
989
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:398
990
  #. translators: %s: link
991
  msgid "Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature."
992
  msgstr ""
993
 
994
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:425
995
+ #: modules/optin/classes/class-cartflows-optin-meta.php:267
996
  #. translators: %s: link
997
  msgid "Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature."
998
  msgstr ""
999
 
1000
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:448
1001
  msgid "Place Order Button Text"
1002
  msgstr ""
1003
 
1004
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:452
1005
  msgid "Place order"
1006
  msgstr ""
1007
 
1008
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:454
1009
  msgid "It will change the Place Order Button text on checkout page."
1010
  msgstr ""
1011
 
1012
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:464
1013
  msgid "Enable cart editing on checkout"
1014
  msgstr ""
1015
 
1016
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:472
1017
  #. translators: %s: link
1018
  msgid "Users will able to remove products from the checkout page."
1019
  msgstr ""
1020
 
1021
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:502
1022
  msgid "One Column (Available in CartFlows Pro) "
1023
  msgstr ""
1024
 
1025
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:503
1026
  msgid "Two Step (Available in CartFlows Pro) "
1027
  msgstr ""
1028
 
1029
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:509
1030
  msgid "Checkout Skin"
1031
  msgstr ""
1032
 
1033
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:513
1034
  msgid "One Column"
1035
  msgstr ""
1036
 
1037
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:514
1038
  msgid "Two Column"
1039
  msgstr ""
1040
 
1041
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:515
1042
  msgid "Two Step"
1043
  msgstr ""
1044
 
1045
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:524
1046
+ #: modules/optin/classes/class-cartflows-optin-meta.php:343
1047
  msgid "Primary Color"
1048
  msgstr ""
1049
 
1050
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:533
1051
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:568
1052
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:614
1053
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:706
1054
+ #: modules/optin/classes/class-cartflows-optin-meta.php:352
1055
+ #: modules/optin/classes/class-cartflows-optin-meta.php:391
1056
+ #: modules/optin/classes/class-cartflows-optin-meta.php:503
1057
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:209
1058
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:240
1059
  msgid "Font Family"
1060
  msgstr ""
1061
 
1062
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:541
1063
  msgid "Advance Options"
1064
  msgstr ""
1065
 
1066
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:553
1067
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:225
1068
  msgid "Heading"
1069
  msgstr ""
1070
 
1071
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:559
1072
  msgid "Heading Color"
1073
  msgstr ""
1074
 
1075
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:577
1076
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:623
1077
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:715
1078
+ #: modules/optin/classes/class-cartflows-optin-meta.php:400
1079
+ #: modules/optin/classes/class-cartflows-optin-meta.php:512
1080
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:249
1081
  msgid "Font Weight"
1082
  msgstr ""
1083
 
1084
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:585
1085
+ #: modules/optin/classes/class-cartflows-optin-meta.php:363
1086
  msgid "Input Fields"
1087
  msgstr ""
1088
 
1089
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:593
1090
+ #: modules/optin/classes/class-cartflows-optin-meta.php:370
1091
  msgid "Floating Labels (Available in CartFlows Pro)"
1092
  msgstr ""
1093
 
1094
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:599
1095
+ #: modules/optin/classes/class-cartflows-optin-meta.php:376
1096
  msgid "Style"
1097
  msgstr ""
1098
 
1099
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:604
1100
+ #: modules/optin/classes/class-cartflows-optin-meta.php:381
1101
  msgid "Floating Labels"
1102
  msgstr ""
1103
 
1104
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:631
1105
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:723
1106
+ #: modules/optin/classes/class-cartflows-optin-meta.php:408
1107
+ #: modules/optin/classes/class-cartflows-optin-meta.php:520
1108
  msgid "Size"
1109
  msgstr ""
1110
 
1111
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:635
1112
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:727
1113
+ #: modules/optin/classes/class-cartflows-optin-meta.php:412
1114
+ #: modules/optin/classes/class-cartflows-optin-meta.php:524
1115
  msgid "Extra Small"
1116
  msgstr ""
1117
 
1118
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:636
1119
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:728
1120
+ #: modules/optin/classes/class-cartflows-optin-meta.php:413
1121
+ #: modules/optin/classes/class-cartflows-optin-meta.php:525
1122
  msgid "Small"
1123
  msgstr ""
1124
 
1125
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:637
1126
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:729
1127
+ #: modules/optin/classes/class-cartflows-optin-meta.php:414
1128
+ #: modules/optin/classes/class-cartflows-optin-meta.php:526
1129
  msgid "Medium"
1130
  msgstr ""
1131
 
1132
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:638
1133
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:730
1134
+ #: modules/optin/classes/class-cartflows-optin-meta.php:415
1135
+ #: modules/optin/classes/class-cartflows-optin-meta.php:527
1136
  msgid "Large"
1137
  msgstr ""
1138
 
1139
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:639
1140
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:731
1141
+ #: modules/optin/classes/class-cartflows-optin-meta.php:416
1142
+ #: modules/optin/classes/class-cartflows-optin-meta.php:528
1143
  msgid "Extra Large"
1144
  msgstr ""
1145
 
1146
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:640
1147
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:732
1148
+ #: modules/optin/classes/class-cartflows-optin-meta.php:417
1149
+ #: modules/optin/classes/class-cartflows-optin-meta.php:529
1150
  msgid "Custom"
1151
  msgstr ""
1152
 
1153
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:647
1154
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:739
1155
+ #: modules/optin/classes/class-cartflows-optin-meta.php:424
1156
+ #: modules/optin/classes/class-cartflows-optin-meta.php:536
1157
  msgid "Top Bottom Spacing"
1158
  msgstr ""
1159
 
1160
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:655
1161
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:747
1162
+ #: modules/optin/classes/class-cartflows-optin-meta.php:432
1163
+ #: modules/optin/classes/class-cartflows-optin-meta.php:544
1164
  msgid "Left Right Spacing"
1165
  msgstr ""
1166
 
1167
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:663
1168
+ #: modules/optin/classes/class-cartflows-optin-meta.php:448
1169
  msgid "Text / Placeholder Color"
1170
  msgstr ""
1171
 
1172
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:671
1173
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:771
1174
+ #: modules/optin/classes/class-cartflows-optin-meta.php:456
1175
+ #: modules/optin/classes/class-cartflows-optin-meta.php:581
1176
  msgid "Background Color"
1177
  msgstr ""
1178
 
1179
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:679
1180
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:787
1181
+ #: modules/optin/classes/class-cartflows-optin-meta.php:464
1182
+ #: modules/optin/classes/class-cartflows-optin-meta.php:597
1183
  msgid "Border Color"
1184
  msgstr ""
1185
 
1186
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:686
1187
+ #: modules/optin/classes/class-cartflows-optin-meta.php:440
1188
  msgid "Label Color"
1189
  msgstr ""
1190
 
1191
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:699
1192
  msgid "Buttons"
1193
  msgstr ""
1194
 
1195
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:755
1196
+ #: modules/optin/classes/class-cartflows-optin-meta.php:565
1197
  msgid "Text Color"
1198
  msgstr ""
1199
 
1200
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:763
1201
+ #: modules/optin/classes/class-cartflows-optin-meta.php:573
1202
  msgid "Text Hover Color"
1203
  msgstr ""
1204
 
1205
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:779
1206
+ #: modules/optin/classes/class-cartflows-optin-meta.php:589
1207
  msgid "Background Hover Color"
1208
  msgstr ""
1209
 
1210
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:795
1211
+ #: modules/optin/classes/class-cartflows-optin-meta.php:605
1212
  msgid "Border Hover Color"
1213
  msgstr ""
1214
 
1215
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:808
1216
  msgid "Sections"
1217
  msgstr ""
1218
 
1219
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:814
1220
  msgid "Highlight Area Background Color"
1221
  msgstr ""
1222
 
1223
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:853
1224
  msgid "Header Logo"
1225
  msgstr ""
1226
 
1227
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:861
1228
  msgid "Logo Width (In px)"
1229
  msgstr ""
1230
 
1307
  msgstr ""
1308
 
1309
  #: modules/flow/classes/class-cartflows-flow-meta.php:769
1310
+ #: modules/flow/view/meta-flow-steps.php:133
1311
  msgid "Add New Step"
1312
  msgstr ""
1313
 
1364
 
1365
  #: modules/flow/classes/class-cartflows-flow-post-type.php:354
1366
  #: modules/flow/classes/class-cartflows-flow-post-type.php:360
1367
+ #: modules/flow/classes/class-cartflows-step-post-type.php:397
1368
+ #: modules/flow/classes/class-cartflows-step-post-type.php:403
1369
  #. translators: %s: singular custom post type name
1370
  msgid "%s updated."
1371
  msgstr ""
1372
 
1373
  #: modules/flow/classes/class-cartflows-flow-post-type.php:356
1374
+ #: modules/flow/classes/class-cartflows-step-post-type.php:399
1375
  #. translators: %s: singular custom post type name
1376
  msgid "Custom %s updated."
1377
  msgstr ""
1378
 
1379
  #: modules/flow/classes/class-cartflows-flow-post-type.php:358
1380
+ #: modules/flow/classes/class-cartflows-step-post-type.php:401
1381
  #. translators: %s: singular custom post type name
1382
  msgid "Custom %s deleted."
1383
  msgstr ""
1384
 
1385
  #: modules/flow/classes/class-cartflows-flow-post-type.php:362
1386
+ #: modules/flow/classes/class-cartflows-step-post-type.php:405
1387
  #. translators: %1$s: singular custom post type name ,%2$s: date and time of
1388
  #. the revision
1389
  msgid "%1$s restored to revision from %2$s"
1390
  msgstr ""
1391
 
1392
  #: modules/flow/classes/class-cartflows-flow-post-type.php:364
1393
+ #: modules/flow/classes/class-cartflows-step-post-type.php:407
1394
  #. translators: %s: singular custom post type name
1395
  msgid "%s published."
1396
  msgstr ""
1397
 
1398
  #: modules/flow/classes/class-cartflows-flow-post-type.php:366
1399
+ #: modules/flow/classes/class-cartflows-step-post-type.php:409
1400
  #. translators: %s: singular custom post type name
1401
  msgid "%s saved."
1402
  msgstr ""
1403
 
1404
  #: modules/flow/classes/class-cartflows-flow-post-type.php:368
1405
+ #: modules/flow/classes/class-cartflows-step-post-type.php:411
1406
  #. translators: %s: singular custom post type name
1407
  msgid "%s submitted."
1408
  msgstr ""
1409
 
1410
  #: modules/flow/classes/class-cartflows-flow-post-type.php:370
1411
+ #: modules/flow/classes/class-cartflows-step-post-type.php:413
1412
  #. translators: %s: singular custom post type name
1413
  msgid "%s scheduled for."
1414
  msgstr ""
1415
 
1416
  #: modules/flow/classes/class-cartflows-flow-post-type.php:372
1417
+ #: modules/flow/classes/class-cartflows-step-post-type.php:415
1418
  #. translators: %s: singular custom post type name
1419
  msgid "%s draft updated."
1420
  msgstr ""
1433
  msgstr ""
1434
 
1435
  #: modules/flow/classes/class-cartflows-step-post-type.php:164
1436
+ #: modules/flow/view/meta-flow-steps.php:106
1437
  msgid "Edit Step"
1438
  msgstr ""
1439
 
1440
  #: modules/flow/classes/class-cartflows-step-post-type.php:165
1441
+ #: modules/flow/view/meta-flow-steps.php:102
1442
  msgid "View Step"
1443
  msgstr ""
1444
 
1458
  msgid "Step Flow"
1459
  msgstr ""
1460
 
1461
+ #: modules/flow/classes/class-cartflows-step-post-type.php:244
1462
+ #: modules/flow/view/meta-flow-steps.php:16
1463
+ msgid "Optin (Woo)"
1464
+ msgstr ""
1465
+
1466
+ #: modules/flow/classes/class-cartflows-step-post-type.php:265
1467
  #: modules/flow/view/meta-flow-steps.php:14
1468
  msgid "Upsell (Woo)"
1469
  msgstr ""
1470
 
1471
+ #: modules/flow/classes/class-cartflows-step-post-type.php:272
1472
  #: modules/flow/view/meta-flow-steps.php:15
1473
  msgid "Downsell (Woo)"
1474
  msgstr ""
1475
 
1476
+ #: modules/flow/view/meta-flow-steps.php:85
1477
  msgid "No Product Assigned"
1478
  msgstr ""
1479
 
1480
+ #: modules/flow/view/meta-flow-steps.php:89
1481
  msgid "Global Checkout - Remove selected checkout product"
1482
  msgstr ""
1483
 
1484
+ #: modules/flow/view/meta-flow-steps.php:108
1485
  msgid "Edit"
1486
  msgstr ""
1487
 
1488
+ #: modules/flow/view/meta-flow-steps.php:113
1489
  msgid "Clone Step"
1490
  msgstr ""
1491
 
1492
+ #: modules/flow/view/meta-flow-steps.php:118
1493
  msgid "Delete Step"
1494
  msgstr ""
1495
 
1496
+ #: modules/flow/view/meta-flow-steps.php:120
1497
  msgid "Delete"
1498
  msgstr ""
1499
 
1500
+ #: modules/flow/view/meta-flow-steps.php:149
1501
  msgid "Steps Library"
1502
  msgstr ""
1503
 
1504
+ #: modules/flow/view/meta-flow-steps.php:198
1505
  msgid "Create Step"
1506
  msgstr ""
1507
 
1508
+ #: modules/flow/view/meta-flow-steps.php:200
1509
  msgid "You need a Cartflows Pro version to import Upsell / Downsell"
1510
  msgstr ""
1511
 
1517
  msgid "Next Step Link"
1518
  msgstr ""
1519
 
1520
+ #: modules/optin/classes/class-cartflows-optin-markup.php:165
1521
+ msgid "Please place shortcode on Optin step-type only."
1522
+ msgstr ""
1523
+
1524
+ #: modules/optin/classes/class-cartflows-optin-markup.php:225
1525
+ msgid ""
1526
+ "No product is selected. Please select a Simple, Virtual and Free product "
1527
+ "from the meta settings."
1528
+ msgstr ""
1529
+
1530
+ #: modules/optin/classes/class-cartflows-optin-markup.php:242
1531
+ msgid "Please update the selected product's price to zero (0)."
1532
+ msgstr ""
1533
+
1534
+ #: modules/optin/classes/class-cartflows-optin-markup.php:251
1535
+ #: modules/optin/classes/class-cartflows-optin-markup.php:255
1536
+ msgid "Please select a Simple, Virtual and Free product."
1537
+ msgstr ""
1538
+
1539
+ #: modules/optin/classes/class-cartflows-optin-meta.php:65
1540
+ msgid "Optin Settings"
1541
  msgstr ""
1542
 
1543
+ #: modules/optin/classes/class-cartflows-optin-meta.php:138
1544
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:136
1545
  msgid "Design"
1546
  msgstr ""
1547
 
1548
+ #: modules/optin/classes/class-cartflows-optin-meta.php:144
1549
+ msgid "Form Fields"
1550
+ msgstr ""
1551
+
1552
+ #: modules/optin/classes/class-cartflows-optin-meta.php:213
1553
+ msgid "Add this shortcode to your optin page"
1554
+ msgstr ""
1555
+
1556
+ #: modules/optin/classes/class-cartflows-optin-meta.php:238
1557
+ msgid "Select Free Product"
1558
+ msgstr ""
1559
+
1560
+ #: modules/optin/classes/class-cartflows-optin-meta.php:239
1561
+ msgid "Select Free and Virtual product only."
1562
+ msgstr ""
1563
+
1564
+ #: modules/optin/classes/class-cartflows-optin-meta.php:290
1565
+ msgid "Pass Fields as URL Parameters"
1566
+ msgstr ""
1567
+
1568
+ #: modules/optin/classes/class-cartflows-optin-meta.php:293
1569
+ msgid "Enable"
1570
+ msgstr ""
1571
+
1572
+ #: modules/optin/classes/class-cartflows-optin-meta.php:294
1573
+ msgid ""
1574
+ "You can pass specific fields from the form to next step as URL query "
1575
+ "parameters."
1576
+ msgstr ""
1577
+
1578
+ #: modules/optin/classes/class-cartflows-optin-meta.php:305
1579
+ msgid "Enter form field"
1580
+ msgstr ""
1581
+
1582
+ #: modules/optin/classes/class-cartflows-optin-meta.php:308
1583
+ #: modules/optin/classes/class-cartflows-optin-meta.php:318
1584
+ msgid "Enter comma seprated field name. E.g. first_name, last_name"
1585
+ msgstr ""
1586
+
1587
+ #: modules/optin/classes/class-cartflows-optin-meta.php:310
1588
+ msgid "Fields to pass, separated by commas"
1589
+ msgstr ""
1590
+
1591
+ #: modules/optin/classes/class-cartflows-optin-meta.php:320
1592
+ #. translators: %s: link
1593
+ msgid ""
1594
+ "You can pass field value as a URL parameter to the next step. %1$sClick "
1595
+ "here%2$s for more information."
1596
+ msgstr ""
1597
+
1598
+ #: modules/optin/classes/class-cartflows-optin-meta.php:477
1599
+ msgid "Submit Button"
1600
+ msgstr ""
1601
+
1602
+ #: modules/optin/classes/class-cartflows-optin-meta.php:483
1603
+ msgid "Button Text"
1604
+ msgstr ""
1605
+
1606
+ #: modules/optin/classes/class-cartflows-optin-meta.php:494
1607
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:217
1608
+ msgid "Font Size"
1609
+ msgstr ""
1610
+
1611
+ #: modules/optin/classes/class-cartflows-optin-meta.php:552
1612
+ msgid "Position"
1613
+ msgstr ""
1614
+
1615
+ #: modules/optin/classes/class-cartflows-optin-meta.php:556
1616
+ msgid "Left"
1617
+ msgstr ""
1618
+
1619
+ #: modules/optin/classes/class-cartflows-optin-meta.php:557
1620
+ msgid "Center"
1621
+ msgstr ""
1622
+
1623
+ #: modules/optin/classes/class-cartflows-optin-meta.php:558
1624
+ msgid "Right"
1625
+ msgstr ""
1626
+
1627
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:65
1628
+ msgid "Thank You Page Settings"
1629
+ msgstr ""
1630
+
1631
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:142
1632
  msgid "Edit Fields"
1633
  msgstr ""
1641
  msgstr ""
1642
 
1643
  #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:200
1644
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:231
1645
  msgid "Color"
1646
  msgstr ""
1647
 
1648
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:257
1649
  msgid "Advanced Options"
1650
  msgstr ""
1651
 
1652
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:267
1653
  msgid "Container Width (In px)"
1654
  msgstr ""
1655
 
1656
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:275
1657
  msgid "Section Background Color"
1658
  msgstr ""
1659
 
1660
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:289
1661
  msgid "Enable Order Overview "
1662
  msgstr ""
1663
 
1664
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:297
1665
  msgid "Enable Order Details "
1666
  msgstr ""
1667
 
1668
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:305
1669
  msgid "Enable Billing Details "
1670
  msgstr ""
1671
 
1672
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:313
1673
  msgid "Enable Shipping Details "
1674
  msgstr ""
1675
 
1676
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:329
1677
  msgid "Redirect After Purchase"
1678
  msgstr ""
1679
 
1680
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:338
1681
  msgid "Redirect Link"
1682
  msgstr ""
1683
 
1684
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:342
1685
  msgid "https://"
1686
  msgstr ""
1687
 
1936
  msgid "Step"
1937
  msgstr ""
1938
 
1939
+ #: modules/flow/classes/class-cartflows-step-post-type.php:313
1940
  msgctxt "cartflows"
1941
  msgid "CartFlows — Boxed"
1942
  msgstr ""
1943
 
1944
+ #: modules/flow/classes/class-cartflows-step-post-type.php:314
1945
  msgctxt "cartflows"
1946
  msgid "Template for Page Builders"
1947
  msgstr ""
modules/checkout/classes/class-cartflows-checkout-markup.php CHANGED
@@ -182,7 +182,7 @@ class Cartflows_Checkout_Markup {
182
  return;
183
  }
184
 
185
- if ( _is_wcf_checkout_type() || _is_wcf_thankyou_type() ) {
186
  return;
187
  }
188
 
182
  return;
183
  }
184
 
185
+ if ( wcf()->utils->is_step_post_type() ) {
186
  return;
187
  }
188
 
modules/checkout/classes/class-cartflows-checkout-meta.php CHANGED
@@ -347,6 +347,38 @@ class Cartflows_Checkout_Meta extends Cartflows_Meta {
347
  }
348
 
349
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
350
 
351
  /**
352
  * Product bump tab
@@ -411,35 +443,37 @@ class Cartflows_Checkout_Meta extends Cartflows_Meta {
411
  <div class="wcf-custom-settings-fields">
412
  <?php
413
 
414
- echo wcf()->meta->get_text_field(
415
- array(
416
- 'label' => __( 'Place Order Button Text', 'cartflows' ),
417
- 'name' => 'wcf-checkout-place-order-button-text',
418
- 'value' => $options['wcf-checkout-place-order-button-text'],
419
- 'attr' => array(
420
- 'placeholder' => __( 'Place order', 'cartflows' ),
421
- ),
422
- 'help' => __( 'It will change the Place Order Button text on checkout page.', 'cartflows' ),
423
- )
424
- );
425
-
426
- echo wcf()->meta->get_hr_line_field( array() );
427
-
428
- echo wcf()->meta->get_checkbox_field(
429
- array(
430
- 'name' => 'wcf-remove-product-field',
431
- 'value' => $options['wcf-remove-product-field'],
432
- 'after' => esc_html__( 'Enable cart editing on checkout', 'cartflows' ),
433
- )
434
- );
435
-
436
- echo wcf()->meta->get_description_field(
437
- array(
438
- 'name' => '',
439
- /* translators: %s: link */
440
- 'content' => '<i>' . sprintf( esc_html__( 'Users will able to remove products from the checkout page.', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
441
- )
442
- );
 
 
443
  ?>
444
  </div>
445
  <?php do_action( 'cartflows_custom_settings_tab_content', $options, $post_id ); ?>
347
  }
348
 
349
 
350
+ /**
351
+ * Pre Checkout tab
352
+ *
353
+ * @param array $options options.
354
+ * @param int $post_id post ID.
355
+ */
356
+ public function animate_title_settings( $options, $post_id ) {
357
+
358
+ echo wcf()->meta->get_hr_line_field( array() );
359
+
360
+ if ( ! _is_cartflows_pro() ) {
361
+ echo wcf()->meta->get_description_field(
362
+ array(
363
+ 'name' => 'wcf-upgrade-to-pro',
364
+ /* translators: %s: link */
365
+ 'content' => '<i>' . sprintf( __( 'Upgrade to %1$sCartFlows Pro%2$s for animate browser tab feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
366
+ )
367
+ );
368
+ } elseif ( _is_cartflows_pro_ver_less_than( '1.4.0' ) ) {
369
+
370
+ $version = '1.4.0';
371
+ echo wcf()->meta->get_description_field(
372
+ array(
373
+ 'name' => 'wcf-upgrade-to-pro',
374
+ /* translators: %s: link */
375
+ 'content' => '<i>' . sprintf( __( 'Update to %1$sCartFlows Pro%2$s to %3$s or above for animate browser tab feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>', $version ) . '</i>',
376
+ )
377
+ );
378
+ }
379
+
380
+ do_action( 'cartflows_animate_browser_tab_settings', $options, $post_id );
381
+ }
382
 
383
  /**
384
  * Product bump tab
443
  <div class="wcf-custom-settings-fields">
444
  <?php
445
 
446
+ echo wcf()->meta->get_text_field(
447
+ array(
448
+ 'label' => __( 'Place Order Button Text', 'cartflows' ),
449
+ 'name' => 'wcf-checkout-place-order-button-text',
450
+ 'value' => $options['wcf-checkout-place-order-button-text'],
451
+ 'attr' => array(
452
+ 'placeholder' => __( 'Place order', 'cartflows' ),
453
+ ),
454
+ 'help' => __( 'It will change the Place Order Button text on checkout page.', 'cartflows' ),
455
+ )
456
+ );
457
+
458
+ echo wcf()->meta->get_hr_line_field( array() );
459
+
460
+ echo wcf()->meta->get_checkbox_field(
461
+ array(
462
+ 'name' => 'wcf-remove-product-field',
463
+ 'value' => $options['wcf-remove-product-field'],
464
+ 'after' => esc_html__( 'Enable cart editing on checkout', 'cartflows' ),
465
+ )
466
+ );
467
+
468
+ echo wcf()->meta->get_description_field(
469
+ array(
470
+ 'name' => '',
471
+ /* translators: %s: link */
472
+ 'content' => '<i>' . sprintf( esc_html__( 'Users will able to remove products from the checkout page.', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
473
+ )
474
+ );
475
+
476
+ $this->animate_title_settings( $options, $post_id );
477
  ?>
478
  </div>
479
  <?php do_action( 'cartflows_custom_settings_tab_content', $options, $post_id ); ?>
modules/flow/classes/class-cartflows-flow-post-type.php CHANGED
@@ -1,383 +1,383 @@
1
- <?php
2
- /**
3
- * Flow post type
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Initialization
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Flow_Post_Type {
14
-
15
-
16
- /**
17
- * Member Variable
18
- *
19
- * @var instance
20
- */
21
- private static $instance;
22
-
23
- /**
24
- * Initiator
25
- */
26
- public static function get_instance() {
27
- if ( ! isset( self::$instance ) ) {
28
- self::$instance = new self();
29
- }
30
- return self::$instance;
31
- }
32
-
33
- /**
34
- * Constructor
35
- */
36
- public function __construct() {
37
-
38
- add_action( 'init', array( $this, 'flow_post_type' ) );
39
- add_action( 'admin_menu', array( $this, 'register_as_submenu' ), 100 );
40
- add_action( 'do_meta_boxes', array( $this, 'wcf_change_metabox_position' ) );
41
-
42
- add_filter( 'post_updated_messages', array( $this, 'custom_post_type_post_update_messages' ) );
43
-
44
- add_filter( 'display_post_states', array( $this, 'add_cartflows_post_state' ), 15, 1 );
45
-
46
- add_filter( 'hidden_meta_boxes', array( $this, 'display_flow_slug_meta_box' ), 10, 2 );
47
-
48
- /* View Post URL */
49
- add_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );
50
- add_filter( 'preview_post_link', array( $this, 'preview_post_link' ), 10, 2 );
51
- add_action( 'template_redirect', array( $this, 'redirect_to_step' ), 10 );
52
- }
53
-
54
- /**
55
- * Add CartFlows post status.
56
- *
57
- * @param array $post_states post data.
58
- * @return array
59
- */
60
- public function add_cartflows_post_state( $post_states ) {
61
-
62
- global $post;
63
-
64
- if ( isset( $post->post_type ) && CARTFLOWS_STEP_POST_TYPE === $post->post_type ) {
65
-
66
- $flow_id = get_post_meta( $post->ID, 'wcf-flow-id', true );
67
- $flow_title = get_the_title( $flow_id );
68
-
69
- $post_states['cartflows_step'] = '( ' . __( 'Flow: ', 'cartflows' ) . $flow_id . ' | ' . __( 'Name: ', 'cartflows' ) . $flow_title . ')';
70
-
71
- }
72
-
73
- return $post_states;
74
- }
75
-
76
- /**
77
- * Display slugdiv.
78
- *
79
- * @param array $hidden metaboxes.
80
- * @param obj $screen screen.
81
- * @return array
82
- */
83
- public function display_flow_slug_meta_box( $hidden, $screen ) {
84
- $post_type = $screen->id;
85
- if ( ! empty( $post_type ) && CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
86
- $pos = array_search( 'slugdiv', $hidden, true );
87
- unset( $hidden[ $pos ] );
88
- }
89
-
90
- return $hidden;
91
- }
92
-
93
- /**
94
- * Create custom post type
95
- */
96
- public function flow_post_type() {
97
-
98
- $labels = array(
99
- 'name' => esc_html_x( 'Flows', 'flow general name', 'cartflows' ),
100
- 'singular_name' => esc_html_x( 'Flow', 'flow singular name', 'cartflows' ),
101
- 'search_items' => esc_html__( 'Search Flows', 'cartflows' ),
102
- 'all_items' => esc_html__( 'All Flows', 'cartflows' ),
103
- 'edit_item' => esc_html__( 'Edit Flow', 'cartflows' ),
104
- 'view_item' => esc_html__( 'View Flow', 'cartflows' ),
105
- 'add_new' => esc_html__( 'Add New', 'cartflows' ),
106
- 'update_item' => esc_html__( 'Update Flow', 'cartflows' ),
107
- 'add_new_item' => esc_html__( 'Add New', 'cartflows' ),
108
- 'new_item_name' => esc_html__( 'New Flow Name', 'cartflows' ),
109
- );
110
-
111
- $args = array(
112
- 'labels' => $labels,
113
- 'show_in_menu' => false,
114
- 'public' => false, // it's not public, not own permalink.
115
- 'publicly_queryable' => true, // you should be able to query it.
116
- 'show_ui' => true,
117
- 'query_var' => true,
118
- 'can_export' => true,
119
- 'show_in_admin_bar' => true,
120
- 'exclude_from_search' => true,
121
- 'has_archive' => false, // it shouldn't have archive page.
122
- 'rewrite' => false, // it shouldn't have rewrite rules.
123
- 'supports' => array( 'title', 'thumbnail', 'slug' ),
124
- 'capability_type' => 'post',
125
- );
126
-
127
- if ( ! _is_cartflows_pro() ) {
128
-
129
- $flow_posts = get_posts(
130
- array(
131
- 'posts_per_page' => 4,
132
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
133
- 'post_status' => array( 'publish', 'pending', 'draft', 'future', 'private', 'inherit', 'trash' ),
134
- )
135
- );
136
-
137
- if ( is_array( $flow_posts ) ) {
138
-
139
- $flow_count = count( $flow_posts );
140
-
141
- if ( $flow_count > 3 || 3 === $flow_count ) {
142
-
143
- $args['capabilities'] = array(
144
- 'create_posts' => 'do_not_allow',
145
- );
146
- $args['map_meta_cap'] = true;
147
-
148
- // Add new notice button.
149
- add_action( 'admin_print_footer_scripts', array( $this, 'add_new_notice_button' ) );
150
-
151
- // Add the notice popup HTML to admin footer.
152
- add_action( 'admin_footer', array( $this, 'upgrade_to_pro_notice_popup' ) );
153
- }
154
- }
155
- }
156
-
157
- register_post_type( CARTFLOWS_FLOW_POST_TYPE, $args );
158
- }
159
-
160
- /**
161
- * Show custom add new button.
162
- */
163
- public function add_new_notice_button() {
164
-
165
- $screen = get_current_screen();
166
-
167
- if ( is_object( $screen ) && CARTFLOWS_FLOW_POST_TYPE === $screen->post_type && 'edit-cartflows_flow' === $screen->id ) {
168
- ?>
169
- <script>
170
- jQuery('.wrap h1.wp-heading-inline').after('<a type="button" class="wcf-custom-add-new-button button">Add New</a>');
171
- </script>
172
- <?php
173
- }
174
- }
175
-
176
- /**
177
- * Upgrade to pro notice popup.
178
- *
179
- * @since 1.3.4
180
- *
181
- * @return void
182
- */
183
- public function upgrade_to_pro_notice_popup() {
184
-
185
- ?>
186
- <div id="cartflows-upgrade-notice-overlay" style="display:none;"></div>
187
- <div id="cartflows-upgrade-notice-popup" style="display:none;">
188
- <div class="inner">
189
- <div class="heading">
190
- <span><?php esc_html_e( 'Upgrade to CartFlows Pro', 'cartflows' ); ?></span>
191
- <span class="cartflows-close-popup-button tb-close-icon"></span>
192
- </div>
193
- <div class="contents">
194
- <div class="wcf-notice">
195
- <p>Upgrade to CartFlows Pro for adding more flows and other features. <a href ="https://cartflows.com/" target="_blank"> Click here</a> to upgrade.</p>
196
- </div>
197
- </div>
198
- </div>
199
- </div>
200
- <?php
201
- }
202
-
203
- /**
204
- * Change metabox position.
205
- */
206
- public function wcf_change_metabox_position() {
207
-
208
- remove_meta_box( 'slugdiv', CARTFLOWS_FLOW_POST_TYPE, 'normal' );
209
- add_meta_box( 'slugdiv', __( 'Slug', 'cartflows' ), 'post_slug_meta_box', CARTFLOWS_FLOW_POST_TYPE, 'side', 'high' );
210
- }
211
-
212
- /**
213
- * Add post raw actions
214
- *
215
- * @param array $actions actions.
216
- * @param array $post post data.
217
- * @return array
218
- */
219
- public function post_row_actions( $actions, $post ) {
220
-
221
- $first_step = $this->get_first_step_url( $post );
222
-
223
- if ( $first_step && isset( $actions['view'] ) ) {
224
-
225
- $actions['view'] = '<a href="' . $first_step . '">' . __( 'View', 'cartflows' ) . '</a>';
226
- }
227
-
228
- return $actions;
229
- }
230
-
231
- /**
232
- * Returns previous post link
233
- *
234
- * @param string $prev_link previous link.
235
- * @param array $post post data.
236
- * @return string
237
- */
238
- public function preview_post_link( $prev_link, $post ) {
239
-
240
- if ( $this->is_flow_post_type( $post ) ) {
241
-
242
- $first_step = $this->get_first_step_url( $post );
243
-
244
- if ( $first_step ) {
245
-
246
- return $first_step;
247
- }
248
-
249
- return '';
250
- }
251
-
252
- return $prev_link;
253
- }
254
-
255
- /**
256
- * Check if post type is flow
257
- *
258
- * @param array $post post data.
259
- * @return bool
260
- */
261
- public function is_flow_post_type( $post ) {
262
-
263
- if ( isset( $post ) && CARTFLOWS_FLOW_POST_TYPE === $post->post_type ) {
264
-
265
- return true;
266
- }
267
-
268
- return false;
269
- }
270
-
271
- /**
272
- * Redirect to first step
273
- *
274
- * @return void
275
- */
276
- public function redirect_to_step() {
277
-
278
- global $post;
279
-
280
- $first_step = $this->get_first_step_url( $post );
281
-
282
- if ( $first_step ) {
283
-
284
- wp_safe_redirect( $first_step );
285
- die;
286
- }
287
- }
288
-
289
- /**
290
- * Return first step URL
291
- *
292
- * @param array $post post data.
293
- * @return bool
294
- */
295
- public function get_first_step_url( $post ) {
296
-
297
- if ( $this->is_flow_post_type( $post ) ) {
298
-
299
- $flow_id = $post->ID;
300
- $title = $post->post_title;
301
- $steps = get_post_meta( $flow_id, 'wcf-steps', true );
302
-
303
- if ( is_array( $steps ) && ! empty( $steps ) && isset( $steps[0]['id'] ) ) {
304
-
305
- return get_permalink( $steps[0]['id'] );
306
- }
307
- }
308
-
309
- return false;
310
- }
311
-
312
- /**
313
- * Register the admin menu for Custom Layouts
314
- *
315
- * @since 1.0.0
316
- * Moved the menu under Appearance -> Custom Layouts
317
- public function register_admin_menu() {
318
- add_submenu_page(
319
- CARTFLOWS_SLUG,
320
- __( 'Flows', 'wcf' ),
321
- __( 'Flows', 'wcf' ),
322
- 'edit_pages',
323
- 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE
324
- );
325
- }
326
- */
327
- public function register_as_submenu() {
328
-
329
- global $submenu;
330
-
331
- $submenu[ CARTFLOWS_SLUG ][0] = array( //phpcs:ignore
332
- __( 'Flows', 'cartflows' ),
333
- 'edit_pages',
334
- 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE,
335
- );
336
- }
337
-
338
- /**
339
- * Add Update messages for any custom post type
340
- *
341
- * @param array $messages Array of default messages.
342
- */
343
- public function custom_post_type_post_update_messages( $messages ) {
344
-
345
- $custom_post_type = get_post_type( get_the_ID() );
346
-
347
- if ( CARTFLOWS_FLOW_POST_TYPE == $custom_post_type ) {
348
-
349
- $obj = get_post_type_object( $custom_post_type );
350
- $singular_name = $obj->labels->singular_name;
351
- $messages[ $custom_post_type ] = array(
352
- 0 => '', // Unused. Messages start at index 1.
353
- /* translators: %s: singular custom post type name */
354
- 1 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
355
- /* translators: %s: singular custom post type name */
356
- 2 => sprintf( __( 'Custom %s updated.', 'cartflows' ), $singular_name ),
357
- /* translators: %s: singular custom post type name */
358
- 3 => sprintf( __( 'Custom %s deleted.', 'cartflows' ), $singular_name ),
359
- /* translators: %s: singular custom post type name */
360
- 4 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
361
- /* translators: %1$s: singular custom post type name ,%2$s: date and time of the revision */
362
- 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, //phpcs:ignore
363
- /* translators: %s: singular custom post type name */
364
- 6 => sprintf( __( '%s published.', 'cartflows' ), $singular_name ),
365
- /* translators: %s: singular custom post type name */
366
- 7 => sprintf( __( '%s saved.', 'cartflows' ), $singular_name ),
367
- /* translators: %s: singular custom post type name */
368
- 8 => sprintf( __( '%s submitted.', 'cartflows' ), $singular_name ),
369
- /* translators: %s: singular custom post type name */
370
- 9 => sprintf( __( '%s scheduled for.', 'cartflows' ), $singular_name ),
371
- /* translators: %s: singular custom post type name */
372
- 10 => sprintf( __( '%s draft updated.', 'cartflows' ), $singular_name ),
373
- );
374
- }
375
-
376
- return $messages;
377
- }
378
- }
379
-
380
- /**
381
- * Kicking this off by calling 'get_instance()' method
382
- */
383
- Cartflows_Flow_Post_Type::get_instance();
1
+ <?php
2
+ /**
3
+ * Flow post type
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Initialization
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Flow_Post_Type {
14
+
15
+
16
+ /**
17
+ * Member Variable
18
+ *
19
+ * @var instance
20
+ */
21
+ private static $instance;
22
+
23
+ /**
24
+ * Initiator
25
+ */
26
+ public static function get_instance() {
27
+ if ( ! isset( self::$instance ) ) {
28
+ self::$instance = new self();
29
+ }
30
+ return self::$instance;
31
+ }
32
+
33
+ /**
34
+ * Constructor
35
+ */
36
+ public function __construct() {
37
+
38
+ add_action( 'init', array( $this, 'flow_post_type' ) );
39
+ add_action( 'admin_menu', array( $this, 'register_as_submenu' ), 100 );
40
+ add_action( 'do_meta_boxes', array( $this, 'wcf_change_metabox_position' ) );
41
+
42
+ add_filter( 'post_updated_messages', array( $this, 'custom_post_type_post_update_messages' ) );
43
+
44
+ add_filter( 'display_post_states', array( $this, 'add_cartflows_post_state' ), 15, 1 );
45
+
46
+ add_filter( 'hidden_meta_boxes', array( $this, 'display_flow_slug_meta_box' ), 10, 2 );
47
+
48
+ /* View Post URL */
49
+ add_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );
50
+ add_filter( 'preview_post_link', array( $this, 'preview_post_link' ), 10, 2 );
51
+ add_action( 'template_redirect', array( $this, 'redirect_to_step' ), 10 );
52
+ }
53
+
54
+ /**
55
+ * Add CartFlows post status.
56
+ *
57
+ * @param array $post_states post data.
58
+ * @return array
59
+ */
60
+ public function add_cartflows_post_state( $post_states ) {
61
+
62
+ global $post;
63
+
64
+ if ( isset( $post->post_type ) && CARTFLOWS_STEP_POST_TYPE === $post->post_type ) {
65
+
66
+ $flow_id = get_post_meta( $post->ID, 'wcf-flow-id', true );
67
+ $flow_title = get_the_title( $flow_id );
68
+
69
+ $post_states['cartflows_step'] = '( ' . __( 'Flow: ', 'cartflows' ) . $flow_id . ' | ' . __( 'Name: ', 'cartflows' ) . $flow_title . ')';
70
+
71
+ }
72
+
73
+ return $post_states;
74
+ }
75
+
76
+ /**
77
+ * Display slugdiv.
78
+ *
79
+ * @param array $hidden metaboxes.
80
+ * @param obj $screen screen.
81
+ * @return array
82
+ */
83
+ public function display_flow_slug_meta_box( $hidden, $screen ) {
84
+ $post_type = $screen->id;
85
+ if ( ! empty( $post_type ) && CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
86
+ $pos = array_search( 'slugdiv', $hidden, true );
87
+ unset( $hidden[ $pos ] );
88
+ }
89
+
90
+ return $hidden;
91
+ }
92
+
93
+ /**
94
+ * Create custom post type
95
+ */
96
+ public function flow_post_type() {
97
+
98
+ $labels = array(
99
+ 'name' => esc_html_x( 'Flows', 'flow general name', 'cartflows' ),
100
+ 'singular_name' => esc_html_x( 'Flow', 'flow singular name', 'cartflows' ),
101
+ 'search_items' => esc_html__( 'Search Flows', 'cartflows' ),
102
+ 'all_items' => esc_html__( 'All Flows', 'cartflows' ),
103
+ 'edit_item' => esc_html__( 'Edit Flow', 'cartflows' ),
104
+ 'view_item' => esc_html__( 'View Flow', 'cartflows' ),
105
+ 'add_new' => esc_html__( 'Add New', 'cartflows' ),
106
+ 'update_item' => esc_html__( 'Update Flow', 'cartflows' ),
107
+ 'add_new_item' => esc_html__( 'Add New', 'cartflows' ),
108
+ 'new_item_name' => esc_html__( 'New Flow Name', 'cartflows' ),
109
+ );
110
+
111
+ $args = array(
112
+ 'labels' => $labels,
113
+ 'show_in_menu' => false,
114
+ 'public' => false, // it's not public, not own permalink.
115
+ 'publicly_queryable' => true, // you should be able to query it.
116
+ 'show_ui' => true,
117
+ 'query_var' => true,
118
+ 'can_export' => true,
119
+ 'show_in_admin_bar' => true,
120
+ 'exclude_from_search' => true,
121
+ 'has_archive' => false, // it shouldn't have archive page.
122
+ 'rewrite' => false, // it shouldn't have rewrite rules.
123
+ 'supports' => array( 'title', 'thumbnail', 'slug' ),
124
+ 'capability_type' => 'post',
125
+ );
126
+
127
+ if ( ! _is_cartflows_pro() ) {
128
+
129
+ $flow_posts = get_posts(
130
+ array(
131
+ 'posts_per_page' => 4,
132
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
133
+ 'post_status' => array( 'publish', 'pending', 'draft', 'future', 'private', 'inherit', 'trash' ),
134
+ )
135
+ );
136
+
137
+ if ( is_array( $flow_posts ) ) {
138
+
139
+ $flow_count = count( $flow_posts );
140
+
141
+ if ( $flow_count > 3 || 3 === $flow_count ) {
142
+
143
+ $args['capabilities'] = array(
144
+ 'create_posts' => 'do_not_allow',
145
+ );
146
+ $args['map_meta_cap'] = true;
147
+
148
+ // Add new notice button.
149
+ add_action( 'admin_print_footer_scripts', array( $this, 'add_new_notice_button' ) );
150
+
151
+ // Add the notice popup HTML to admin footer.
152
+ add_action( 'admin_footer', array( $this, 'upgrade_to_pro_notice_popup' ) );
153
+ }
154
+ }
155
+ }
156
+
157
+ register_post_type( CARTFLOWS_FLOW_POST_TYPE, $args );
158
+ }
159
+
160
+ /**
161
+ * Show custom add new button.
162
+ */
163
+ public function add_new_notice_button() {
164
+
165
+ $screen = get_current_screen();
166
+
167
+ if ( is_object( $screen ) && CARTFLOWS_FLOW_POST_TYPE === $screen->post_type && 'edit-cartflows_flow' === $screen->id ) {
168
+ ?>
169
+ <script>
170
+ jQuery('.wrap h1.wp-heading-inline').after('<a type="button" class="wcf-custom-add-new-button button">Add New</a>');
171
+ </script>
172
+ <?php
173
+ }
174
+ }
175
+
176
+ /**
177
+ * Upgrade to pro notice popup.
178
+ *
179
+ * @since 1.3.4
180
+ *
181
+ * @return void
182
+ */
183
+ public function upgrade_to_pro_notice_popup() {
184
+
185
+ ?>
186
+ <div id="cartflows-upgrade-notice-overlay" style="display:none;"></div>
187
+ <div id="cartflows-upgrade-notice-popup" style="display:none;">
188
+ <div class="inner">
189
+ <div class="heading">
190
+ <span><?php esc_html_e( 'Upgrade to CartFlows Pro', 'cartflows' ); ?></span>
191
+ <span class="cartflows-close-popup-button tb-close-icon"></span>
192
+ </div>
193
+ <div class="contents">
194
+ <div class="wcf-notice">
195
+ <p>Upgrade to CartFlows Pro for adding more flows and other features. <a href ="https://cartflows.com/" target="_blank"> Click here</a> to upgrade.</p>
196
+ </div>
197
+ </div>
198
+ </div>
199
+ </div>
200
+ <?php
201
+ }
202
+
203
+ /**
204
+ * Change metabox position.
205
+ */
206
+ public function wcf_change_metabox_position() {
207
+
208
+ remove_meta_box( 'slugdiv', CARTFLOWS_FLOW_POST_TYPE, 'normal' );
209
+ add_meta_box( 'slugdiv', __( 'Slug', 'cartflows' ), 'post_slug_meta_box', CARTFLOWS_FLOW_POST_TYPE, 'side', 'high' );
210
+ }
211
+
212
+ /**
213
+ * Add post raw actions
214
+ *
215
+ * @param array $actions actions.
216
+ * @param array $post post data.
217
+ * @return array
218
+ */
219
+ public function post_row_actions( $actions, $post ) {
220
+
221
+ $first_step = $this->get_first_step_url( $post );
222
+
223
+ if ( $first_step && isset( $actions['view'] ) ) {
224
+
225
+ $actions['view'] = '<a href="' . $first_step . '">' . __( 'View', 'cartflows' ) . '</a>';
226
+ }
227
+
228
+ return $actions;
229
+ }
230
+
231
+ /**
232
+ * Returns previous post link
233
+ *
234
+ * @param string $prev_link previous link.
235
+ * @param array $post post data.
236
+ * @return string
237
+ */
238
+ public function preview_post_link( $prev_link, $post ) {
239
+
240
+ if ( $this->is_flow_post_type( $post ) ) {
241
+
242
+ $first_step = $this->get_first_step_url( $post );
243
+
244
+ if ( $first_step ) {
245
+
246
+ return $first_step;
247
+ }
248
+
249
+ return '';
250
+ }
251
+
252
+ return $prev_link;
253
+ }
254
+
255
+ /**
256
+ * Check if post type is flow
257
+ *
258
+ * @param array $post post data.
259
+ * @return bool
260
+ */
261
+ public function is_flow_post_type( $post ) {
262
+
263
+ if ( isset( $post ) && CARTFLOWS_FLOW_POST_TYPE === $post->post_type ) {
264
+
265
+ return true;
266
+ }
267
+
268
+ return false;
269
+ }
270
+
271
+ /**
272
+ * Redirect to first step
273
+ *
274
+ * @return void
275
+ */
276
+ public function redirect_to_step() {
277
+
278
+ global $post;
279
+
280
+ $first_step = $this->get_first_step_url( $post );
281
+
282
+ if ( $first_step ) {
283
+
284
+ wp_safe_redirect( $first_step );
285
+ die;
286
+ }
287
+ }
288
+
289
+ /**
290
+ * Return first step URL
291
+ *
292
+ * @param array $post post data.
293
+ * @return bool
294
+ */
295
+ public function get_first_step_url( $post ) {
296
+
297
+ if ( $this->is_flow_post_type( $post ) ) {
298
+
299
+ $flow_id = $post->ID;
300
+ $title = $post->post_title;
301
+ $steps = get_post_meta( $flow_id, 'wcf-steps', true );
302
+
303
+ if ( is_array( $steps ) && ! empty( $steps ) && isset( $steps[0]['id'] ) ) {
304
+
305
+ return get_permalink( $steps[0]['id'] );
306
+ }
307
+ }
308
+
309
+ return false;
310
+ }
311
+
312
+ /**
313
+ * Register the admin menu for Custom Layouts
314
+ *
315
+ * @since 1.0.0
316
+ * Moved the menu under Appearance -> Custom Layouts
317
+ public function register_admin_menu() {
318
+ add_submenu_page(
319
+ CARTFLOWS_SLUG,
320
+ __( 'Flows', 'wcf' ),
321
+ __( 'Flows', 'wcf' ),
322
+ 'edit_pages',
323
+ 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE
324
+ );
325
+ }
326
+ */
327
+ public function register_as_submenu() {
328
+
329
+ global $submenu;
330
+
331
+ $submenu[ CARTFLOWS_SLUG ][0] = array( //phpcs:ignore
332
+ __( 'Flows', 'cartflows' ),
333
+ 'edit_pages',
334
+ 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE,
335
+ );
336
+ }
337
+
338
+ /**
339
+ * Add Update messages for any custom post type
340
+ *
341
+ * @param array $messages Array of default messages.
342
+ */
343
+ public function custom_post_type_post_update_messages( $messages ) {
344
+
345
+ $custom_post_type = get_post_type( get_the_ID() );
346
+
347
+ if ( CARTFLOWS_FLOW_POST_TYPE == $custom_post_type ) {
348
+
349
+ $obj = get_post_type_object( $custom_post_type );
350
+ $singular_name = $obj->labels->singular_name;
351
+ $messages[ $custom_post_type ] = array(
352
+ 0 => '', // Unused. Messages start at index 1.
353
+ /* translators: %s: singular custom post type name */
354
+ 1 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
355
+ /* translators: %s: singular custom post type name */
356
+ 2 => sprintf( __( 'Custom %s updated.', 'cartflows' ), $singular_name ),
357
+ /* translators: %s: singular custom post type name */
358
+ 3 => sprintf( __( 'Custom %s deleted.', 'cartflows' ), $singular_name ),
359
+ /* translators: %s: singular custom post type name */
360
+ 4 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
361
+ /* translators: %1$s: singular custom post type name ,%2$s: date and time of the revision */
362
+ 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, //phpcs:ignore
363
+ /* translators: %s: singular custom post type name */
364
+ 6 => sprintf( __( '%s published.', 'cartflows' ), $singular_name ),
365
+ /* translators: %s: singular custom post type name */
366
+ 7 => sprintf( __( '%s saved.', 'cartflows' ), $singular_name ),
367
+ /* translators: %s: singular custom post type name */
368
+ 8 => sprintf( __( '%s submitted.', 'cartflows' ), $singular_name ),
369
+ /* translators: %s: singular custom post type name */
370
+ 9 => sprintf( __( '%s scheduled for.', 'cartflows' ), $singular_name ),
371
+ /* translators: %s: singular custom post type name */
372
+ 10 => sprintf( __( '%s draft updated.', 'cartflows' ), $singular_name ),
373
+ );
374
+ }
375
+
376
+ return $messages;
377
+ }
378
+ }
379
+
380
+ /**
381
+ * Kicking this off by calling 'get_instance()' method
382
+ */
383
+ Cartflows_Flow_Post_Type::get_instance();
modules/flow/classes/class-cartflows-permalink.php CHANGED
@@ -1,159 +1,159 @@
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_Permalink {
14
-
15
-
16
- /**
17
- * Member Variable
18
- *
19
- * @var instance
20
- */
21
- private static $instance;
22
-
23
- /**
24
- * Initiator
25
- */
26
- public static function get_instance() {
27
- if ( ! isset( self::$instance ) ) {
28
- self::$instance = new self();
29
- }
30
- return self::$instance;
31
- }
32
-
33
- /**
34
- * Constructor
35
- */
36
- public function __construct() {
37
-
38
- add_filter( 'post_type_link', array( $this, 'post_type_permalinks' ), 10, 3 );
39
- add_action( 'init', array( $this, 'rewrite_step_rule' ) );
40
-
41
- add_action( 'pre_get_posts', array( $this, 'add_cpt_post_names_to_main_query' ), 20 );
42
-
43
- }
44
-
45
- /**
46
- * Modify permalink
47
- *
48
- * @param string $post_link post link.
49
- * @param array $post post data.
50
- * @param string $leavename leave name.
51
- * @return string
52
- */
53
- public function post_type_permalinks( $post_link, $post, $leavename ) {
54
-
55
- if ( isset( $post->post_type ) && CARTFLOWS_STEP_POST_TYPE == $post->post_type ) {
56
-
57
- $flow_id = get_post_meta( $post->ID, 'wcf-flow-id', true );
58
- $flow_name = get_post_field( 'post_name', $flow_id );
59
- $cf_permalink = Cartflows_Helper::get_permalink_settings();
60
-
61
- if ( isset( $cf_permalink['permalink_structure'] ) && ! empty( $cf_permalink['permalink_structure'] ) ) {
62
-
63
- $search = array( 'cartflows_flow', '%flowname%', 'cartflows_step' );
64
- $replace = array( $cf_permalink['permalink_flow_base'], $flow_name, $cf_permalink['permalink'] );
65
- $post_link = str_replace( $search, $replace, $post_link );
66
- } else {
67
-
68
- // If elementor page preview, return post link as it is.
69
- if ( isset( $_REQUEST['elementor-preview'] ) ) { //phpcs:ignore
70
- return $post_link;
71
- }
72
-
73
- $structure = get_option( 'permalink_structure' );
74
-
75
- if ( '/%postname%/' === $structure ) {
76
-
77
- $post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
78
-
79
- }
80
- }
81
- }
82
-
83
- return $post_link;
84
- }
85
-
86
- /**
87
- * Reqrite rules for acrtflows step.
88
- */
89
- public function rewrite_step_rule() {
90
-
91
- $cf_permalink = Cartflows_Helper::get_permalink_settings();
92
-
93
- if ( isset( $cf_permalink['permalink_structure'] ) ) {
94
- switch ( $cf_permalink['permalink_structure'] ) {
95
- case '/cartflows_flow/%flowname%/cartflows_step':
96
- add_rewrite_rule( '^' . $cf_permalink['permalink_flow_base'] . '/([^/]*)/' . $cf_permalink['permalink'] . '/([^\/]*)/?', 'index.php?cartflows_step=$matches[2]', 'top' );
97
- break;
98
-
99
- case '/cartflows_flow/%flowname%':
100
- add_rewrite_rule( '^' . $cf_permalink['permalink_flow_base'] . '/([^/]*)/([^/]*)/?', 'index.php?cartflows_step=$matches[2]', 'top' );
101
- break;
102
-
103
- case '/%flowname%/cartflows_step':
104
- add_rewrite_rule( '([^/]*)/' . $cf_permalink['permalink'] . '/([^\/]*)/?', 'index.php?cartflows_step=$matches[2]', 'top' );
105
-
106
- break;
107
-
108
- default:
109
- break;
110
- }
111
- }
112
-
113
- }
114
-
115
- /**
116
- * Have WordPress match postname to any of our public post types.
117
- * All of our public post types can have /post-name/ as the slug, so they need to be unique across all posts.
118
- * By default, WordPress only accounts for posts and pages where the slug is /post-name/.
119
- *
120
- * @param string $query query statement.
121
- */
122
- public function add_cpt_post_names_to_main_query( $query ) {
123
-
124
- // Bail if this is not the main query.
125
- if ( ! $query->is_main_query() ) {
126
- return;
127
- }
128
-
129
- // Bail if this query doesn't match our very specific rewrite rule.
130
- if ( ! isset( $query->query['thrive-variations'] ) && ! isset( $query->query['page'] ) || 2 !== count( $query->query ) ) {
131
- return;
132
- }
133
-
134
- // Bail if we're not querying based on the post name.
135
- if ( empty( $query->query['name'] ) ) {
136
- return;
137
- }
138
-
139
- // Add cartflows step post type to existing post type array.
140
- if ( isset( $query->query_vars['post_type'] ) && is_array( $query->query_vars['post_type'] ) ) {
141
-
142
- $post_types = $query->query_vars['post_type'];
143
-
144
- $post_types[] = CARTFLOWS_STEP_POST_TYPE;
145
-
146
- $query->set( 'post_type', $post_types );
147
-
148
- } else {
149
-
150
- // Add CPT to the list of post types WP will include when it queries based on the post name.
151
- $query->set( 'post_type', array( 'post', 'page', CARTFLOWS_STEP_POST_TYPE ) );
152
- }
153
- }
154
- }
155
-
156
- /**
157
- * Kicking this off by calling 'get_instance()' method
158
- */
159
- Cartflows_Permalink::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_Permalink {
14
+
15
+
16
+ /**
17
+ * Member Variable
18
+ *
19
+ * @var instance
20
+ */
21
+ private static $instance;
22
+
23
+ /**
24
+ * Initiator
25
+ */
26
+ public static function get_instance() {
27
+ if ( ! isset( self::$instance ) ) {
28
+ self::$instance = new self();
29
+ }
30
+ return self::$instance;
31
+ }
32
+
33
+ /**
34
+ * Constructor
35
+ */
36
+ public function __construct() {
37
+
38
+ add_filter( 'post_type_link', array( $this, 'post_type_permalinks' ), 10, 3 );
39
+ add_action( 'init', array( $this, 'rewrite_step_rule' ) );
40
+
41
+ add_action( 'pre_get_posts', array( $this, 'add_cpt_post_names_to_main_query' ), 20 );
42
+
43
+ }
44
+
45
+ /**
46
+ * Modify permalink
47
+ *
48
+ * @param string $post_link post link.
49
+ * @param array $post post data.
50
+ * @param string $leavename leave name.
51
+ * @return string
52
+ */
53
+ public function post_type_permalinks( $post_link, $post, $leavename ) {
54
+
55
+ if ( isset( $post->post_type ) && CARTFLOWS_STEP_POST_TYPE == $post->post_type ) {
56
+
57
+ $flow_id = get_post_meta( $post->ID, 'wcf-flow-id', true );
58
+ $flow_name = get_post_field( 'post_name', $flow_id );
59
+ $cf_permalink = Cartflows_Helper::get_permalink_settings();
60
+
61
+ if ( isset( $cf_permalink['permalink_structure'] ) && ! empty( $cf_permalink['permalink_structure'] ) ) {
62
+
63
+ $search = array( 'cartflows_flow', '%flowname%', 'cartflows_step' );
64
+ $replace = array( $cf_permalink['permalink_flow_base'], $flow_name, $cf_permalink['permalink'] );
65
+ $post_link = str_replace( $search, $replace, $post_link );
66
+ } else {
67
+
68
+ // If elementor page preview, return post link as it is.
69
+ if ( isset( $_REQUEST['elementor-preview'] ) ) { //phpcs:ignore
70
+ return $post_link;
71
+ }
72
+
73
+ $structure = get_option( 'permalink_structure' );
74
+
75
+ if ( '/%postname%/' === $structure ) {
76
+
77
+ $post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
78
+
79
+ }
80
+ }
81
+ }
82
+
83
+ return $post_link;
84
+ }
85
+
86
+ /**
87
+ * Reqrite rules for acrtflows step.
88
+ */
89
+ public function rewrite_step_rule() {
90
+
91
+ $cf_permalink = Cartflows_Helper::get_permalink_settings();
92
+
93
+ if ( isset( $cf_permalink['permalink_structure'] ) ) {
94
+ switch ( $cf_permalink['permalink_structure'] ) {
95
+ case '/cartflows_flow/%flowname%/cartflows_step':
96
+ add_rewrite_rule( '^' . $cf_permalink['permalink_flow_base'] . '/([^/]*)/' . $cf_permalink['permalink'] . '/([^\/]*)/?', 'index.php?cartflows_step=$matches[2]', 'top' );
97
+ break;
98
+
99
+ case '/cartflows_flow/%flowname%':
100
+ add_rewrite_rule( '^' . $cf_permalink['permalink_flow_base'] . '/([^/]*)/([^/]*)/?', 'index.php?cartflows_step=$matches[2]', 'top' );
101
+ break;
102
+
103
+ case '/%flowname%/cartflows_step':
104
+ add_rewrite_rule( '([^/]*)/' . $cf_permalink['permalink'] . '/([^\/]*)/?', 'index.php?cartflows_step=$matches[2]', 'top' );
105
+
106
+ break;
107
+
108
+ default:
109
+ break;
110
+ }
111
+ }
112
+
113
+ }
114
+
115
+ /**
116
+ * Have WordPress match postname to any of our public post types.
117
+ * All of our public post types can have /post-name/ as the slug, so they need to be unique across all posts.
118
+ * By default, WordPress only accounts for posts and pages where the slug is /post-name/.
119
+ *
120
+ * @param string $query query statement.
121
+ */
122
+ public function add_cpt_post_names_to_main_query( $query ) {
123
+
124
+ // Bail if this is not the main query.
125
+ if ( ! $query->is_main_query() ) {
126
+ return;
127
+ }
128
+
129
+ // Bail if this query doesn't match our very specific rewrite rule.
130
+ if ( ! isset( $query->query['thrive-variations'] ) && ! isset( $query->query['page'] ) || 2 !== count( $query->query ) ) {
131
+ return;
132
+ }
133
+
134
+ // Bail if we're not querying based on the post name.
135
+ if ( empty( $query->query['name'] ) ) {
136
+ return;
137
+ }
138
+
139
+ // Add cartflows step post type to existing post type array.
140
+ if ( isset( $query->query_vars['post_type'] ) && is_array( $query->query_vars['post_type'] ) ) {
141
+
142
+ $post_types = $query->query_vars['post_type'];
143
+
144
+ $post_types[] = CARTFLOWS_STEP_POST_TYPE;
145
+
146
+ $query->set( 'post_type', $post_types );
147
+
148
+ } else {
149
+
150
+ // Add CPT to the list of post types WP will include when it queries based on the post name.
151
+ $query->set( 'post_type', array( 'post', 'page', CARTFLOWS_STEP_POST_TYPE ) );
152
+ }
153
+ }
154
+ }
155
+
156
+ /**
157
+ * Kicking this off by calling 'get_instance()' method
158
+ */
159
+ Cartflows_Permalink::get_instance();
modules/flow/classes/class-cartflows-step-post-type.php CHANGED
@@ -1,468 +1,475 @@
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
-
49
- add_filter( 'wp_unique_post_slug', array( $this, 'prevent_slug_duplicates' ), 10, 6 );
50
-
51
- add_filter( 'template_include', array( $this, 'load_page_template' ), 90 );
52
- add_filter( 'template_redirect', array( $this, 'query_fix' ), 3 );
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
- public 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
- /* Remove Next / Previous Rel Link */
82
- remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
83
- add_filter( 'next_post_rel_link', '__return_empty_string' );
84
- add_filter( 'previous_post_rel_link', '__return_empty_string' );
85
-
86
- $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
87
-
88
- $page_template = apply_filters( 'cartflows_page_template', $page_template );
89
-
90
- $file = '';
91
-
92
- switch ( $page_template ) {
93
-
94
- case 'cartflows-default':
95
- $file = CARTFLOWS_FLOW_DIR . 'templates/template-default.php';
96
- $this->body_classes[] = $page_template;
97
- break;
98
- case 'cartflows-canvas':
99
- $file = CARTFLOWS_FLOW_DIR . 'templates/template-canvas.php';
100
- $this->body_classes[] = $page_template;
101
- break;
102
- default:
103
- /**
104
- * Remove Next/Prev Navigation
105
- */
106
- add_filter( 'next_post_link', '__return_empty_string' );
107
- add_filter( 'previous_post_link', '__return_empty_string' );
108
-
109
- $page = locate_template( array( 'page.php' ) );
110
-
111
- if ( ! empty( $page ) ) {
112
- $file = $page;
113
- }
114
-
115
- break;
116
-
117
- /**
118
- * Default:
119
- * $file = CARTFLOWS_FLOW_DIR . 'templates/template-default.php';
120
- * $this->body_classes[] = 'cartflows-default';
121
- * break;
122
- */
123
- }
124
-
125
- // Just to be safe, we check if the file exist first.
126
- if ( file_exists( $file ) ) {
127
-
128
- /* Add Body Class */
129
- add_filter( 'body_class', array( $this, 'body_class' ) );
130
-
131
- return $file;
132
- } else {
133
- echo $file;
134
- }
135
- }
136
-
137
- return $template;
138
- }
139
-
140
- /**
141
- * Body classes.
142
- *
143
- * @since 1.0.0
144
- * @param array $classes Body classes.
145
- * @return array
146
- */
147
- public function body_class( $classes = array() ) {
148
-
149
- $classes = array_merge( $classes, $this->body_classes );
150
-
151
- return $classes;
152
- }
153
-
154
- /**
155
- * Create custom post type
156
- */
157
- public function step_post_type() {
158
-
159
- $labels = array(
160
- 'name' => esc_html_x( 'Steps', 'flow step general name', 'cartflows' ),
161
- 'singular_name' => esc_html_x( 'Step', 'flow step singular name', 'cartflows' ),
162
- 'search_items' => esc_html__( 'Search Steps', 'cartflows' ),
163
- 'all_items' => esc_html__( 'All Steps', 'cartflows' ),
164
- 'edit_item' => esc_html__( 'Edit Step', 'cartflows' ),
165
- 'view_item' => esc_html__( 'View Step', 'cartflows' ),
166
- 'add_new' => esc_html__( 'Add New', 'cartflows' ),
167
- 'update_item' => esc_html__( 'Update Step', 'cartflows' ),
168
- 'add_new_item' => esc_html__( 'Add New', 'cartflows' ),
169
- 'new_item_name' => esc_html__( 'New Step Name', 'cartflows' ),
170
- );
171
-
172
- $permalink_settings = Cartflows_Helper::get_permalink_settings();
173
-
174
- $args = array(
175
- 'labels' => $labels,
176
- 'public' => true,
177
- 'query_var' => true,
178
- 'can_export' => true,
179
- 'exclude_from_search' => true,
180
- 'show_ui' => true,
181
- 'show_in_menu' => false,
182
- 'show_in_admin_bar' => true,
183
- 'supports' => array( 'title', 'editor', 'elementor', 'revisions' ),
184
- 'capability_type' => 'post',
185
- 'capabilities' => array(
186
- 'create_posts' => 'do_not_allow', // Prior to Wordpress 4.5, this was false.
187
- ),
188
- 'map_meta_cap' => true,
189
- );
190
-
191
- if ( isset( $permalink_settings['permalink_structure'] ) && ! empty( $permalink_settings['permalink_structure'] ) ) {
192
- $args['rewrite'] = array(
193
- 'slug' => $permalink_settings['permalink_structure'],
194
- 'with_front' => false,
195
- );
196
-
197
- } elseif ( isset( $permalink_settings['permalink'] ) && ! empty( $permalink_settings['permalink'] ) ) {
198
-
199
- $args['rewrite'] = array(
200
- 'slug' => $permalink_settings['permalink'],
201
- 'with_front' => false,
202
- );
203
- }
204
-
205
- register_post_type( CARTFLOWS_STEP_POST_TYPE, $args );
206
-
207
- // Step Type.
208
- $args = array(
209
- 'label' => __( 'Step Type', 'cartflows' ),
210
- 'public' => false,
211
- 'rewrite' => false,
212
- 'hierarchical' => false,
213
- );
214
-
215
- register_taxonomy( CARTFLOWS_TAXONOMY_STEP_TYPE, CARTFLOWS_STEP_POST_TYPE, $args );
216
-
217
- // Step Flow.
218
- $args = array(
219
- 'label' => __( 'Step Flow', 'cartflows' ),
220
- 'public' => false,
221
- 'rewrite' => false,
222
- 'hierarchical' => false,
223
- );
224
-
225
- register_taxonomy( CARTFLOWS_TAXONOMY_STEP_FLOW, CARTFLOWS_STEP_POST_TYPE, $args );
226
-
227
- if ( is_admin() ) {
228
- /**
229
- * Register 'Elementor' & 'Beaver Builder' site types.
230
- *
231
- * @see self::add_terms();
232
- */
233
- $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
234
-
235
- $terms = array(
236
- array(
237
- 'name' => __( 'Landing', 'cartflows' ),
238
- 'slug' => 'landing',
239
- 'args' => array(
240
- 'slug' => 'landing',
241
- ),
242
- ),
243
- array(
244
- 'name' => __( 'Checkout (Woo)', 'cartflows' ),
245
- 'slug' => 'checkout',
246
- 'args' => array(
247
- 'slug' => 'checkout',
248
- ),
249
- ),
250
- array(
251
- 'name' => __( 'Thank You (Woo)', 'cartflows' ),
252
- 'slug' => 'thankyou',
253
- 'args' => array(
254
- 'slug' => 'thankyou',
255
- ),
256
- ),
257
- array(
258
- 'name' => __( 'Upsell (Woo)', 'cartflows' ),
259
- 'slug' => 'upsell',
260
- 'args' => array(
261
- 'slug' => 'upsell',
262
- ),
263
- ),
264
- array(
265
- 'name' => __( 'Downsell (Woo)', 'cartflows' ),
266
- 'slug' => 'downsell',
267
- 'args' => array(
268
- 'slug' => 'downsell',
269
- ),
270
- ),
271
- );
272
-
273
- $this->add_terms( $taxonomy, $terms );
274
-
275
- }
276
- }
277
-
278
- /**
279
- * Add WordPress templates.
280
- *
281
- * Adds Cartflows templates to steps
282
- *
283
- * @since 1.0.0
284
- * @access public
285
- */
286
- public function add_wp_templates_support() {
287
- add_filter( 'theme_' . CARTFLOWS_STEP_POST_TYPE . '_templates', array( $this, 'add_page_templates' ), 99, 4 );
288
- }
289
-
290
- /**
291
- * Add page templates.
292
- *
293
- * @since 1.0.0
294
- * @access public
295
- *
296
- * @param array $page_templates Array of page templates.
297
- *
298
- * @param object $wp_theme wp theme.
299
- * @param object $post post.
300
- *
301
- * @return array Page templates.
302
- */
303
- public function add_page_templates( $page_templates, $wp_theme, $post ) {
304
-
305
- $page_templates = array(
306
- 'cartflows-default' => _x( 'CartFlows — Boxed', 'cartflows' ),
307
- 'cartflows-canvas' => _x( 'Template for Page Builders', 'cartflows' ),
308
- );
309
-
310
- return $page_templates;
311
- }
312
-
313
-
314
-
315
- /**
316
- * Query fixe throwing error on 404 page due our post type changes.
317
- * We are setting post_type as empty array to fix the issue.
318
- * Ther error was throwing due to redirect_canonical function
319
- * This fix is apply for 404 page only
320
- */
321
- public function query_fix() {
322
-
323
- global $wp_query;
324
-
325
- if ( $wp_query->is_404() ) {
326
- $wp_query->set( 'post_type', array() );
327
- }
328
- }
329
-
330
- /**
331
- * Prevent slug duplicated
332
- *
333
- * @param string $slug post slug.
334
- * @param int $post_ID post id.
335
- * @param string $post_status post status.
336
- * @param string $post_type post type.
337
- * @param int $post_parent post parent id.
338
- * @param string $original_slug original slug.
339
- * @return string
340
- */
341
- public function prevent_slug_duplicates( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) {
342
-
343
- $check_post_types = array(
344
- 'post',
345
- 'page',
346
- CARTFLOWS_STEP_POST_TYPE,
347
- );
348
-
349
- if ( ! in_array( $post_type, $check_post_types, true ) ) {
350
- return $slug;
351
- }
352
-
353
- if ( CARTFLOWS_STEP_POST_TYPE == $post_type ) {
354
- // Saving a post, check for duplicates in POST or PAGE post types.
355
- $post_match = get_page_by_path( $slug, 'OBJECT', 'post' );
356
- $page_match = get_page_by_path( $slug, 'OBJECT', 'page' );
357
-
358
- if ( $post_match || $page_match ) {
359
- $slug .= '-2';
360
- }
361
- } else {
362
-
363
- // Saving a POST or PAGE, check for duplicates in CARTFLOWS_STEP_POST_TYPE post type.
364
- $custom_post_type_match = get_page_by_path( $slug, 'OBJECT', CARTFLOWS_STEP_POST_TYPE );
365
-
366
- if ( $custom_post_type_match ) {
367
- $slug .= '-2';
368
- }
369
- }
370
-
371
- return $slug;
372
- }
373
-
374
- /**
375
- * Add Update messages for any custom post type
376
- *
377
- * @param array $messages Array of default messages.
378
- */
379
- public function post_update_messages( $messages ) {
380
-
381
- $custom_post_type = get_post_type( get_the_ID() );
382
-
383
- if ( CARTFLOWS_STEP_POST_TYPE == $custom_post_type ) {
384
-
385
- $obj = get_post_type_object( $custom_post_type );
386
- $singular_name = $obj->labels->singular_name;
387
- $messages[ $custom_post_type ] = array(
388
- 0 => '', // Unused. Messages start at index 1.
389
- /* translators: %s: singular custom post type name */
390
- 1 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
391
- /* translators: %s: singular custom post type name */
392
- 2 => sprintf( __( 'Custom %s updated.', 'cartflows' ), $singular_name ),
393
- /* translators: %s: singular custom post type name */
394
- 3 => sprintf( __( 'Custom %s deleted.', 'cartflows' ), $singular_name ),
395
- /* translators: %s: singular custom post type name */
396
- 4 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
397
- /* translators: %1$s: singular custom post type name ,%2$s: date and time of the revision */
398
- 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, //phpcs:ignore
399
- /* translators: %s: singular custom post type name */
400
- 6 => sprintf( __( '%s published.', 'cartflows' ), $singular_name ),
401
- /* translators: %s: singular custom post type name */
402
- 7 => sprintf( __( '%s saved.', 'cartflows' ), $singular_name ),
403
- /* translators: %s: singular custom post type name */
404
- 8 => sprintf( __( '%s submitted.', 'cartflows' ), $singular_name ),
405
- /* translators: %s: singular custom post type name */
406
- 9 => sprintf( __( '%s scheduled for.', 'cartflows' ), $singular_name ),
407
- /* translators: %s: singular custom post type name */
408
- 10 => sprintf( __( '%s draft updated.', 'cartflows' ), $singular_name ),
409
- );
410
- }
411
-
412
- return $messages;
413
- }
414
-
415
- /**
416
- * Add Terms for Taxonomy.
417
- *
418
- * => Example.
419
- *
420
- * $taxonomy = '{taxonomy}';
421
- * $terms = array(
422
- * array(
423
- * 'name' => 'Landing',
424
- * 'slug' => 'landing',
425
- * ),
426
- * array(
427
- * 'name' => 'Checkout',
428
- * 'slug' => 'checkout',
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
- public function add_terms( $taxonomy = '', $terms = array() ) {
440
-
441
- foreach ( $terms as $key => $term ) {
442
-
443
- $term_exist = term_exists( $term['slug'], $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
-
456
- $term['args'] = array( $term['slug'] );
457
-
458
- wp_insert_term( $term['name'], $taxonomy, $term['args'] );
459
- }
460
- }
461
- }
462
- }
463
- }
464
-
465
- /**
466
- * Kicking this off by calling 'get_instance()' method
467
- */
468
- 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
+
49
+ add_filter( 'wp_unique_post_slug', array( $this, 'prevent_slug_duplicates' ), 10, 6 );
50
+
51
+ add_filter( 'template_include', array( $this, 'load_page_template' ), 90 );
52
+ add_filter( 'template_redirect', array( $this, 'query_fix' ), 3 );
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
+ public 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
+ /* Remove Next / Previous Rel Link */
82
+ remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
83
+ add_filter( 'next_post_rel_link', '__return_empty_string' );
84
+ add_filter( 'previous_post_rel_link', '__return_empty_string' );
85
+
86
+ $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
87
+
88
+ $page_template = apply_filters( 'cartflows_page_template', $page_template );
89
+
90
+ $file = '';
91
+
92
+ switch ( $page_template ) {
93
+
94
+ case 'cartflows-default':
95
+ $file = CARTFLOWS_FLOW_DIR . 'templates/template-default.php';
96
+ $this->body_classes[] = $page_template;
97
+ break;
98
+ case 'cartflows-canvas':
99
+ $file = CARTFLOWS_FLOW_DIR . 'templates/template-canvas.php';
100
+ $this->body_classes[] = $page_template;
101
+ break;
102
+ default:
103
+ /**
104
+ * Remove Next/Prev Navigation
105
+ */
106
+ add_filter( 'next_post_link', '__return_empty_string' );
107
+ add_filter( 'previous_post_link', '__return_empty_string' );
108
+
109
+ $page = locate_template( array( 'page.php' ) );
110
+
111
+ if ( ! empty( $page ) ) {
112
+ $file = $page;
113
+ }
114
+
115
+ break;
116
+
117
+ /**
118
+ * Default:
119
+ * $file = CARTFLOWS_FLOW_DIR . 'templates/template-default.php';
120
+ * $this->body_classes[] = 'cartflows-default';
121
+ * break;
122
+ */
123
+ }
124
+
125
+ // Just to be safe, we check if the file exist first.
126
+ if ( file_exists( $file ) ) {
127
+
128
+ /* Add Body Class */
129
+ add_filter( 'body_class', array( $this, 'body_class' ) );
130
+
131
+ return $file;
132
+ } else {
133
+ echo $file;
134
+ }
135
+ }
136
+
137
+ return $template;
138
+ }
139
+
140
+ /**
141
+ * Body classes.
142
+ *
143
+ * @since 1.0.0
144
+ * @param array $classes Body classes.
145
+ * @return array
146
+ */
147
+ public function body_class( $classes = array() ) {
148
+
149
+ $classes = array_merge( $classes, $this->body_classes );
150
+
151
+ return $classes;
152
+ }
153
+
154
+ /**
155
+ * Create custom post type
156
+ */
157
+ public function step_post_type() {
158
+
159
+ $labels = array(
160
+ 'name' => esc_html_x( 'Steps', 'flow step general name', 'cartflows' ),
161
+ 'singular_name' => esc_html_x( 'Step', 'flow step singular name', 'cartflows' ),
162
+ 'search_items' => esc_html__( 'Search Steps', 'cartflows' ),
163
+ 'all_items' => esc_html__( 'All Steps', 'cartflows' ),
164
+ 'edit_item' => esc_html__( 'Edit Step', 'cartflows' ),
165
+ 'view_item' => esc_html__( 'View Step', 'cartflows' ),
166
+ 'add_new' => esc_html__( 'Add New', 'cartflows' ),
167
+ 'update_item' => esc_html__( 'Update Step', 'cartflows' ),
168
+ 'add_new_item' => esc_html__( 'Add New', 'cartflows' ),
169
+ 'new_item_name' => esc_html__( 'New Step Name', 'cartflows' ),
170
+ );
171
+
172
+ $permalink_settings = Cartflows_Helper::get_permalink_settings();
173
+
174
+ $args = array(
175
+ 'labels' => $labels,
176
+ 'public' => true,
177
+ 'query_var' => true,
178
+ 'can_export' => true,
179
+ 'exclude_from_search' => true,
180
+ 'show_ui' => true,
181
+ 'show_in_menu' => false,
182
+ 'show_in_admin_bar' => true,
183
+ 'supports' => array( 'title', 'editor', 'elementor', 'revisions' ),
184
+ 'capability_type' => 'post',
185
+ 'capabilities' => array(
186
+ 'create_posts' => 'do_not_allow', // Prior to Wordpress 4.5, this was false.
187
+ ),
188
+ 'map_meta_cap' => true,
189
+ );
190
+
191
+ if ( isset( $permalink_settings['permalink_structure'] ) && ! empty( $permalink_settings['permalink_structure'] ) ) {
192
+ $args['rewrite'] = array(
193
+ 'slug' => $permalink_settings['permalink_structure'],
194
+ 'with_front' => false,
195
+ );
196
+
197
+ } elseif ( isset( $permalink_settings['permalink'] ) && ! empty( $permalink_settings['permalink'] ) ) {
198
+
199
+ $args['rewrite'] = array(
200
+ 'slug' => $permalink_settings['permalink'],
201
+ 'with_front' => false,
202
+ );
203
+ }
204
+
205
+ register_post_type( CARTFLOWS_STEP_POST_TYPE, $args );
206
+
207
+ // Step Type.
208
+ $args = array(
209
+ 'label' => __( 'Step Type', 'cartflows' ),
210
+ 'public' => false,
211
+ 'rewrite' => false,
212
+ 'hierarchical' => false,
213
+ );
214
+
215
+ register_taxonomy( CARTFLOWS_TAXONOMY_STEP_TYPE, CARTFLOWS_STEP_POST_TYPE, $args );
216
+
217
+ // Step Flow.
218
+ $args = array(
219
+ 'label' => __( 'Step Flow', 'cartflows' ),
220
+ 'public' => false,
221
+ 'rewrite' => false,
222
+ 'hierarchical' => false,
223
+ );
224
+
225
+ register_taxonomy( CARTFLOWS_TAXONOMY_STEP_FLOW, CARTFLOWS_STEP_POST_TYPE, $args );
226
+
227
+ if ( is_admin() ) {
228
+ /**
229
+ * Register 'Elementor' & 'Beaver Builder' site types.
230
+ *
231
+ * @see self::add_terms();
232
+ */
233
+ $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
234
+
235
+ $terms = array(
236
+ array(
237
+ 'name' => __( 'Landing', 'cartflows' ),
238
+ 'slug' => 'landing',
239
+ 'args' => array(
240
+ 'slug' => 'landing',
241
+ ),
242
+ ),
243
+ array(
244
+ 'name' => __( 'Optin (Woo)', 'cartflows' ),
245
+ 'slug' => 'optin',
246
+ 'args' => array(
247
+ 'slug' => 'optin',
248
+ ),
249
+ ),
250
+ array(
251
+ 'name' => __( 'Checkout (Woo)', 'cartflows' ),
252
+ 'slug' => 'checkout',
253
+ 'args' => array(
254
+ 'slug' => 'checkout',
255
+ ),
256
+ ),
257
+ array(
258
+ 'name' => __( 'Thank You (Woo)', 'cartflows' ),
259
+ 'slug' => 'thankyou',
260
+ 'args' => array(
261
+ 'slug' => 'thankyou',
262
+ ),
263
+ ),
264
+ array(
265
+ 'name' => __( 'Upsell (Woo)', 'cartflows' ),
266
+ 'slug' => 'upsell',
267
+ 'args' => array(
268
+ 'slug' => 'upsell',
269
+ ),
270
+ ),
271
+ array(
272
+ 'name' => __( 'Downsell (Woo)', 'cartflows' ),
273
+ 'slug' => 'downsell',
274
+ 'args' => array(
275
+ 'slug' => 'downsell',
276
+ ),
277
+ ),
278
+ );
279
+
280
+ $this->add_terms( $taxonomy, $terms );
281
+
282
+ }
283
+ }
284
+
285
+ /**
286
+ * Add WordPress templates.
287
+ *
288
+ * Adds Cartflows templates to steps
289
+ *
290
+ * @since 1.0.0
291
+ * @access public
292
+ */
293
+ public function add_wp_templates_support() {
294
+ add_filter( 'theme_' . CARTFLOWS_STEP_POST_TYPE . '_templates', array( $this, 'add_page_templates' ), 99, 4 );
295
+ }
296
+
297
+ /**
298
+ * Add page templates.
299
+ *
300
+ * @since 1.0.0
301
+ * @access public
302
+ *
303
+ * @param array $page_templates Array of page templates.
304
+ *
305
+ * @param object $wp_theme wp theme.
306
+ * @param object $post post.
307
+ *
308
+ * @return array Page templates.
309
+ */
310
+ public function add_page_templates( $page_templates, $wp_theme, $post ) {
311
+
312
+ $page_templates = array(
313
+ 'cartflows-default' => _x( 'CartFlows — Boxed', 'cartflows' ),
314
+ 'cartflows-canvas' => _x( 'Template for Page Builders', 'cartflows' ),
315
+ );
316
+
317
+ return $page_templates;
318
+ }
319
+
320
+
321
+
322
+ /**
323
+ * Query fixe throwing error on 404 page due our post type changes.
324
+ * We are setting post_type as empty array to fix the issue.
325
+ * Ther error was throwing due to redirect_canonical function
326
+ * This fix is apply for 404 page only
327
+ */
328
+ public function query_fix() {
329
+
330
+ global $wp_query;
331
+
332
+ if ( $wp_query->is_404() ) {
333
+ $wp_query->set( 'post_type', array() );
334
+ }
335
+ }
336
+
337
+ /**
338
+ * Prevent slug duplicated
339
+ *
340
+ * @param string $slug post slug.
341
+ * @param int $post_ID post id.
342
+ * @param string $post_status post status.
343
+ * @param string $post_type post type.
344
+ * @param int $post_parent post parent id.
345
+ * @param string $original_slug original slug.
346
+ * @return string
347
+ */
348
+ public function prevent_slug_duplicates( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) {
349
+
350
+ $check_post_types = array(
351
+ 'post',
352
+ 'page',
353
+ CARTFLOWS_STEP_POST_TYPE,
354
+ );
355
+
356
+ if ( ! in_array( $post_type, $check_post_types, true ) ) {
357
+ return $slug;
358
+ }
359
+
360
+ if ( CARTFLOWS_STEP_POST_TYPE == $post_type ) {
361
+ // Saving a post, check for duplicates in POST or PAGE post types.
362
+ $post_match = get_page_by_path( $slug, 'OBJECT', 'post' );
363
+ $page_match = get_page_by_path( $slug, 'OBJECT', 'page' );
364
+
365
+ if ( $post_match || $page_match ) {
366
+ $slug .= '-2';
367
+ }
368
+ } else {
369
+
370
+ // Saving a POST or PAGE, check for duplicates in CARTFLOWS_STEP_POST_TYPE post type.
371
+ $custom_post_type_match = get_page_by_path( $slug, 'OBJECT', CARTFLOWS_STEP_POST_TYPE );
372
+
373
+ if ( $custom_post_type_match ) {
374
+ $slug .= '-2';
375
+ }
376
+ }
377
+
378
+ return $slug;
379
+ }
380
+
381
+ /**
382
+ * Add Update messages for any custom post type
383
+ *
384
+ * @param array $messages Array of default messages.
385
+ */
386
+ public function post_update_messages( $messages ) {
387
+
388
+ $custom_post_type = get_post_type( get_the_ID() );
389
+
390
+ if ( CARTFLOWS_STEP_POST_TYPE == $custom_post_type ) {
391
+
392
+ $obj = get_post_type_object( $custom_post_type );
393
+ $singular_name = $obj->labels->singular_name;
394
+ $messages[ $custom_post_type ] = array(
395
+ 0 => '', // Unused. Messages start at index 1.
396
+ /* translators: %s: singular custom post type name */
397
+ 1 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
398
+ /* translators: %s: singular custom post type name */
399
+ 2 => sprintf( __( 'Custom %s updated.', 'cartflows' ), $singular_name ),
400
+ /* translators: %s: singular custom post type name */
401
+ 3 => sprintf( __( 'Custom %s deleted.', 'cartflows' ), $singular_name ),
402
+ /* translators: %s: singular custom post type name */
403
+ 4 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
404
+ /* translators: %1$s: singular custom post type name ,%2$s: date and time of the revision */
405
+ 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, //phpcs:ignore
406
+ /* translators: %s: singular custom post type name */
407
+ 6 => sprintf( __( '%s published.', 'cartflows' ), $singular_name ),
408
+ /* translators: %s: singular custom post type name */
409
+ 7 => sprintf( __( '%s saved.', 'cartflows' ), $singular_name ),
410
+ /* translators: %s: singular custom post type name */
411
+ 8 => sprintf( __( '%s submitted.', 'cartflows' ), $singular_name ),
412
+ /* translators: %s: singular custom post type name */
413
+ 9 => sprintf( __( '%s scheduled for.', 'cartflows' ), $singular_name ),
414
+ /* translators: %s: singular custom post type name */
415
+ 10 => sprintf( __( '%s draft updated.', 'cartflows' ), $singular_name ),
416
+ );
417
+ }
418
+
419
+ return $messages;
420
+ }
421
+
422
+ /**
423
+ * Add Terms for Taxonomy.
424
+ *
425
+ * => Example.
426
+ *
427
+ * $taxonomy = '{taxonomy}';
428
+ * $terms = array(
429
+ * array(
430
+ * 'name' => 'Landing',
431
+ * 'slug' => 'landing',
432
+ * ),
433
+ * array(
434
+ * 'name' => 'Checkout',
435
+ * 'slug' => 'checkout',
436
+ * ),
437
+ * );
438
+ *
439
+ * self::add_terms( $taxonomy, $terms );
440
+ *
441
+ * @since 1.0.0
442
+ * @param string $taxonomy Taxonomy Name.
443
+ * @param array $terms Terms list.
444
+ * @return void
445
+ */
446
+ public function add_terms( $taxonomy = '', $terms = array() ) {
447
+
448
+ foreach ( $terms as $key => $term ) {
449
+
450
+ $term_exist = term_exists( $term['slug'], $taxonomy );
451
+
452
+ if ( empty( $term_exist ) ) {
453
+
454
+ /**
455
+ * Add additional args if passed from request.
456
+ *
457
+ * @see https://codex.wordpress.org/Function_Reference/wp_insert_term
458
+ */
459
+ if ( array_key_exists( 'args', $term ) ) {
460
+ wp_insert_term( $term['name'], $taxonomy, $term['args'] );
461
+ } else {
462
+
463
+ $term['args'] = array( $term['slug'] );
464
+
465
+ wp_insert_term( $term['name'], $taxonomy, $term['args'] );
466
+ }
467
+ }
468
+ }
469
+ }
470
+ }
471
+
472
+ /**
473
+ * Kicking this off by calling 'get_instance()' method
474
+ */
475
+ Cartflows_Step_Post_Type::get_instance();
modules/flow/view/meta-flow-steps.php CHANGED
@@ -1,209 +1,210 @@
1
- <?php
2
- /**
3
- * View Flow steps
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
9
-
10
- $steps = array(
11
- 'landing' => __( 'Landing', 'cartflows' ),
12
- 'checkout' => __( 'Checkout (Woo)', 'cartflows' ),
13
- 'thankyou' => __( 'Thank You (Woo)', 'cartflows' ),
14
- 'upsell' => __( 'Upsell (Woo)', 'cartflows' ),
15
- 'downsell' => __( 'Downsell (Woo)', 'cartflows' ),
16
- );
17
-
18
- ?>
19
- <div class="wcf-flow-steps-meta-box">
20
- <div class="wcf-flow-settings">
21
- <?php do_action( 'cartflows_above_flow_steps' ); ?>
22
- <div class="wcf-flow-steps-wrap">
23
- <div class="wcf-flow-steps-container">
24
- <?php if ( is_array( $options['steps'] ) ) { ?>
25
- <?php foreach ( $options['steps'] as $index => $data ) { ?>
26
- <?php
27
- $term_slug = '';
28
- $term_name = '';
29
- $step_wrap_class = '';
30
- $has_product_assigned = true;
31
- $is_global_checkout = '';
32
- $common = '';
33
- $data_step_id = intval( $data['id'] );
34
-
35
- if ( isset( $data['type'] ) ) {
36
- $term_slug = $data['type'];
37
- $term_name = $steps[ $data['type'] ];
38
- }
39
-
40
- if ( ! _is_cartflows_pro() && ( 'upsell' === $term_slug || 'downsell' === $term_slug ) ) {
41
- $step_wrap_class .= ' invalid-step';
42
- }
43
-
44
- if ( isset( $_GET['highlight-step-id'] ) ) { //phpcs:ignore
45
-
46
- $highlight_step_id = intval( $_GET['highlight-step-id'] ); //phpcs:ignore
47
-
48
- if ( $highlight_step_id === $data_step_id ) {
49
- $step_wrap_class .= ' wcf-new-step-highlight';
50
- }
51
- }
52
-
53
- if ( 'checkout' === $term_slug ) {
54
-
55
- $common = Cartflows_Helper::get_common_settings();
56
-
57
- $is_global_checkout = (int) $common['global_checkout'];
58
-
59
- if ( $data['id'] === $is_global_checkout ) {
60
- $step_wrap_class .= ' wcf-global-checkout';
61
- }
62
- }
63
-
64
- if ( 'upsell' === $term_slug || 'downsell' === $term_slug || 'checkout' === $term_slug ) {
65
-
66
- $has_product_assigned = Cartflows_Helper::has_product_assigned( $data['id'] );
67
-
68
- if ( ( ! $has_product_assigned ) && ( $data['id'] != $is_global_checkout ) ) {
69
- $step_wrap_class .= ' wcf-no-product-step';
70
- }
71
- }
72
-
73
- ?>
74
- <div class="wcf-step-wrap <?php echo $step_wrap_class; ?>" data-id="<?php echo $data['id']; ?>" data-term-slug="<?php echo esc_attr( $term_slug ); ?>">
75
- <div class="wcf-step">
76
- <div class="wcf-step-left-content">
77
- <span class="dashicons dashicons-menu"></span>
78
- <span><?php echo wp_trim_words( get_the_title( $data['id'] ), 3 ); ?></span>
79
- <span class="wcf-flow-badge"><?php echo esc_attr( $term_name ); ?></span>
80
-
81
- <?php
82
- if ( ( ! $has_product_assigned ) && ( $data['id'] != $is_global_checkout ) ) {
83
- ?>
84
- <span class="wcf-no-product-badge"><?php esc_html_e( 'No Product Assigned', 'cartflows' ); ?></span>
85
- <?php
86
- } elseif ( ( $has_product_assigned ) && ( $data['id'] === $is_global_checkout ) ) {
87
- ?>
88
- <span class="wcf-global-checkout-badge"><?php esc_html_e( 'Global Checkout - Remove selected checkout product', 'cartflows' ); ?></span>
89
- <?php
90
- } elseif ( ( ! $has_product_assigned ) && $data['id'] === $is_global_checkout ) {
91
- ?>
92
- <span class="wcf-global-checkout-badge"><?php esc_html_e( 'Global Checkout', 'cartflows' ); ?></span>
93
- <?php
94
- }
95
- ?>
96
-
97
- <input type="hidden" class="wcf-steps-hidden" name="wcf-steps[]" value="<?php echo $data['id']; ?>">
98
- <?php do_action( 'cartflows_step_left_content', $data['id'], $term_slug ); ?>
99
- </div>
100
- <div class="wcf-steps-action-buttons">
101
- <a href="<?php echo get_permalink( $data['id'] ); ?>" target="_blank" class="wcf-step-view wcf-action-button wp-ui-text-highlight" title="<?php echo esc_html__( 'View Step', 'cartflows' ); ?>" >
102
- <span class="dashicons dashicons-visibility"></span>
103
- <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'View', 'cartflows' ); ?></span>
104
- </a>
105
- <a href="<?php echo get_edit_post_link( $data['id'] ); ?>" class="wcf-step-edit wcf-action-button wp-ui-text-highlight" title="<?php echo esc_html__( 'Edit Step', 'cartflows' ); ?>" >
106
- <span class="dashicons dashicons-edit"></span>
107
- <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Edit', 'cartflows' ); ?></span>
108
- </a>
109
- <?php
110
- if ( _is_cartflows_pro() ) {
111
- ?>
112
- <a href="<?php echo wp_nonce_url( 'admin.php?action=cartflows_clone_step&post=' . $data['id'], 'step_clone', 'step_clone_nonce' ); ?>" class="wcf-step-clone wcf-action-button wp-ui-text-highlight" title="<?php echo esc_html__( 'Clone Step', 'cartflows' ); ?>" data-id="<?php echo $data['id']; ?>">
113
- <span class="dashicons dashicons-admin-page"></span>
114
- <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Clone', 'cartflows' ); ?></span>
115
- </a>
116
- <?php } ?>
117
- <a href="#" class="wcf-step-delete wcf-action-button wp-ui-text-highlight" title="<?php echo esc_html__( 'Delete Step', 'cartflows' ); ?>" data-id="<?php echo $data['id']; ?>">
118
- <span class="dashicons dashicons-trash"></span>
119
- <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Delete', 'cartflows' ); ?></span>
120
- </a>
121
- </div>
122
- </div>
123
- </div><!-- .wcf-step-wrap -->
124
- <?php } ?>
125
- <?php } ?>
126
- </div><!-- .wcf-flow-steps-container -->
127
- </div> <!-- .wcf-flow-steps-wrap -->
128
- <div class="wcf-flow-buttons-wrap"> <!-- .wcf-flow-buttons-wrap -->
129
- <?php do_action( 'cartflows_bellow_flow_steps' ); ?>
130
- <div class='wcf-add-new-step-btn-wrap'>
131
- <button class='wcf-trigger-popup button button-primary'>
132
- <?php echo esc_html__( 'Add New Step', 'cartflows' ); ?>
133
- </button>
134
- </div>
135
- </div><!-- .wcf-flow-buttons-wrap -->
136
- </div><!-- .wcf-flow-settings -->
137
-
138
- <div id="wcf-remote-step-importer" class="wcf-templates-popup-overlay">
139
- <div class="wcf-templates-popup-content">
140
- <div class="spinner"></div>
141
- <div class="wcf-templates-wrap wcf-templates-wrap-flows">
142
-
143
- <div id="wcf-remote-step-actions" class="wcf-template-header">
144
- <div class="wcf-template-logo-wrap">
145
- <span class="wcf-cartflows-logo-img">
146
- <span class="cartflows-logo-icon"></span>
147
- </span>
148
- <span class="wcf-cartflows-title"><?php esc_html_e( 'Steps Library', 'cartflows' ); ?></span>
149
- </div>
150
- <div class="wcf-tab-wrapper">
151
- <?php if ( 'other' !== $default_page_builder ) { ?>
152
- <div id="wcf-get-started-steps">
153
- <ul class="filter-links ">
154
- <li>
155
- <a href="#" class="current" data-slug="ready-templates" data-title="<?php esc_html_e( 'Ready Templates', 'cartflows' ); ?>"><?php esc_html_e( 'Ready Templates', 'cartflows' ); ?></a>
156
- </li>
157
- <li>
158
- <a href="#" data-slug="canvas" data-title="<?php esc_html_e( 'Create Your Own', 'cartflows' ); ?>"><?php esc_html_e( 'Create Your Own', 'cartflows' ); ?></a>
159
- </li>
160
- </ul>
161
- </div>
162
- <?php } ?>
163
- </div>
164
- <div class="wcf-popup-close-wrap">
165
- <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
166
- </div>
167
- </div>
168
-
169
- <!--<div class="wcf-search-form">
170
- <label class="screen-reader-text" for="wp-filter-search-input"><?php esc_html_e( 'Search Sites', 'cartflows' ); ?> </label>
171
- <input placeholder="<?php esc_html_e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
172
- </div>-->
173
-
174
- <div id="wcf-remote-content">
175
- <?php if ( 'other' !== $default_page_builder ) { ?>
176
- <div id="wcf-ready-templates">
177
- <div id="wcf-remote-filters">
178
- <div id="wcf-page-builders"></div>
179
- <div id="wcf-categories"></div>
180
- </div>
181
- <div class="wcf-page-builder-notice"></div>
182
- <div id="wcf-remote-step-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
183
- <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
184
- </div>
185
- <?php } ?>
186
- <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
187
- <div class="inner">
188
- <div id="wcf-scratch-steps-categories">
189
- <select class="step-type-filter-links filter-links">
190
- <option value="" class="current"> Select Step Type </option>
191
-
192
- <?php foreach ( $steps as $key => $value ) { ?>
193
- <option class="<?php echo $key; ?>" data-slug="<?php echo $key; ?>" data-title="<?php echo $key; ?>"><?php echo $value; ?></option>
194
- <?php } ?>
195
- </select>
196
- </div>
197
- <a href="#" class="button button-primary cartflows-step-import-blank"><?php esc_html_e( 'Create Step', 'cartflows' ); ?></a>
198
- <?php if ( ! _is_cartflows_pro() ) { ?>
199
- <div class="wcf-template-notice"><p><?php echo esc_html__( 'You need a Cartflows Pro version to import Upsell / Downsell', 'cartflows' ); ?></p></div>
200
- <?php } ?>
201
- <p class="wcf-learn-how"><a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank"><?php esc_html_e( 'Learn How', 'cartflows' ); ?> <i class="dashicons dashicons-external"></i></a></p>
202
- </div>
203
- </div>
204
- </div>
205
- </div>
206
- </div>
207
- </div><!-- .wcf-templates-popup-overlay -->
208
- </div>
209
- <?php
 
1
+ <?php
2
+ /**
3
+ * View Flow steps
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
9
+
10
+ $steps = array(
11
+ 'landing' => __( 'Landing', 'cartflows' ),
12
+ 'checkout' => __( 'Checkout (Woo)', 'cartflows' ),
13
+ 'thankyou' => __( 'Thank You (Woo)', 'cartflows' ),
14
+ 'upsell' => __( 'Upsell (Woo)', 'cartflows' ),
15
+ 'downsell' => __( 'Downsell (Woo)', 'cartflows' ),
16
+ 'optin' => __( 'Optin (Woo)', 'cartflows' ),
17
+ );
18
+
19
+ ?>
20
+ <div class="wcf-flow-steps-meta-box">
21
+ <div class="wcf-flow-settings">
22
+ <?php do_action( 'cartflows_above_flow_steps' ); ?>
23
+ <div class="wcf-flow-steps-wrap">
24
+ <div class="wcf-flow-steps-container">
25
+ <?php if ( is_array( $options['steps'] ) ) { ?>
26
+ <?php foreach ( $options['steps'] as $index => $data ) { ?>
27
+ <?php
28
+ $term_slug = '';
29
+ $term_name = '';
30
+ $step_wrap_class = '';
31
+ $has_product_assigned = true;
32
+ $is_global_checkout = '';
33
+ $common = '';
34
+ $data_step_id = intval( $data['id'] );
35
+
36
+ if ( isset( $data['type'] ) ) {
37
+ $term_slug = $data['type'];
38
+ $term_name = $steps[ $data['type'] ];
39
+ }
40
+
41
+ if ( ! _is_cartflows_pro() && ( 'upsell' === $term_slug || 'downsell' === $term_slug ) ) {
42
+ $step_wrap_class .= ' invalid-step';
43
+ }
44
+
45
+ if ( isset( $_GET['highlight-step-id'] ) ) { //phpcs:ignore
46
+
47
+ $highlight_step_id = intval( $_GET['highlight-step-id'] ); //phpcs:ignore
48
+
49
+ if ( $highlight_step_id === $data_step_id ) {
50
+ $step_wrap_class .= ' wcf-new-step-highlight';
51
+ }
52
+ }
53
+
54
+ if ( 'checkout' === $term_slug ) {
55
+
56
+ $common = Cartflows_Helper::get_common_settings();
57
+
58
+ $is_global_checkout = (int) $common['global_checkout'];
59
+
60
+ if ( $data['id'] === $is_global_checkout ) {
61
+ $step_wrap_class .= ' wcf-global-checkout';
62
+ }
63
+ }
64
+
65
+ if ( 'upsell' === $term_slug || 'downsell' === $term_slug || 'checkout' === $term_slug ) {
66
+
67
+ $has_product_assigned = Cartflows_Helper::has_product_assigned( $data['id'] );
68
+
69
+ if ( ( ! $has_product_assigned ) && ( $data['id'] != $is_global_checkout ) ) {
70
+ $step_wrap_class .= ' wcf-no-product-step';
71
+ }
72
+ }
73
+
74
+ ?>
75
+ <div class="wcf-step-wrap <?php echo $step_wrap_class; ?>" data-id="<?php echo $data['id']; ?>" data-term-slug="<?php echo esc_attr( $term_slug ); ?>">
76
+ <div class="wcf-step">
77
+ <div class="wcf-step-left-content">
78
+ <span class="dashicons dashicons-menu"></span>
79
+ <span><?php echo wp_trim_words( get_the_title( $data['id'] ), 3 ); ?></span>
80
+ <span class="wcf-flow-badge"><?php echo esc_attr( $term_name ); ?></span>
81
+
82
+ <?php
83
+ if ( ( ! $has_product_assigned ) && ( $data['id'] != $is_global_checkout ) ) {
84
+ ?>
85
+ <span class="wcf-no-product-badge"><?php esc_html_e( 'No Product Assigned', 'cartflows' ); ?></span>
86
+ <?php
87
+ } elseif ( ( $has_product_assigned ) && ( $data['id'] === $is_global_checkout ) ) {
88
+ ?>
89
+ <span class="wcf-global-checkout-badge"><?php esc_html_e( 'Global Checkout - Remove selected checkout product', 'cartflows' ); ?></span>
90
+ <?php
91
+ } elseif ( ( ! $has_product_assigned ) && $data['id'] === $is_global_checkout ) {
92
+ ?>
93
+ <span class="wcf-global-checkout-badge"><?php esc_html_e( 'Global Checkout', 'cartflows' ); ?></span>
94
+ <?php
95
+ }
96
+ ?>
97
+
98
+ <input type="hidden" class="wcf-steps-hidden" name="wcf-steps[]" value="<?php echo $data['id']; ?>">
99
+ <?php do_action( 'cartflows_step_left_content', $data['id'], $term_slug ); ?>
100
+ </div>
101
+ <div class="wcf-steps-action-buttons">
102
+ <a href="<?php echo get_permalink( $data['id'] ); ?>" target="_blank" class="wcf-step-view wcf-action-button wp-ui-text-highlight" title="<?php echo esc_html__( 'View Step', 'cartflows' ); ?>" >
103
+ <span class="dashicons dashicons-visibility"></span>
104
+ <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'View', 'cartflows' ); ?></span>
105
+ </a>
106
+ <a href="<?php echo get_edit_post_link( $data['id'] ); ?>" class="wcf-step-edit wcf-action-button wp-ui-text-highlight" title="<?php echo esc_html__( 'Edit Step', 'cartflows' ); ?>" >
107
+ <span class="dashicons dashicons-edit"></span>
108
+ <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Edit', 'cartflows' ); ?></span>
109
+ </a>
110
+ <?php
111
+ if ( _is_cartflows_pro() ) {
112
+ ?>
113
+ <a href="<?php echo wp_nonce_url( 'admin.php?action=cartflows_clone_step&post=' . $data['id'], 'step_clone', 'step_clone_nonce' ); ?>" class="wcf-step-clone wcf-action-button wp-ui-text-highlight" title="<?php echo esc_html__( 'Clone Step', 'cartflows' ); ?>" data-id="<?php echo $data['id']; ?>">
114
+ <span class="dashicons dashicons-admin-page"></span>
115
+ <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Clone', 'cartflows' ); ?></span>
116
+ </a>
117
+ <?php } ?>
118
+ <a href="#" class="wcf-step-delete wcf-action-button wp-ui-text-highlight" title="<?php echo esc_html__( 'Delete Step', 'cartflows' ); ?>" data-id="<?php echo $data['id']; ?>">
119
+ <span class="dashicons dashicons-trash"></span>
120
+ <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Delete', 'cartflows' ); ?></span>
121
+ </a>
122
+ </div>
123
+ </div>
124
+ </div><!-- .wcf-step-wrap -->
125
+ <?php } ?>
126
+ <?php } ?>
127
+ </div><!-- .wcf-flow-steps-container -->
128
+ </div> <!-- .wcf-flow-steps-wrap -->
129
+ <div class="wcf-flow-buttons-wrap"> <!-- .wcf-flow-buttons-wrap -->
130
+ <?php do_action( 'cartflows_bellow_flow_steps' ); ?>
131
+ <div class='wcf-add-new-step-btn-wrap'>
132
+ <button class='wcf-trigger-popup button button-primary'>
133
+ <?php echo esc_html__( 'Add New Step', 'cartflows' ); ?>
134
+ </button>
135
+ </div>
136
+ </div><!-- .wcf-flow-buttons-wrap -->
137
+ </div><!-- .wcf-flow-settings -->
138
+
139
+ <div id="wcf-remote-step-importer" class="wcf-templates-popup-overlay">
140
+ <div class="wcf-templates-popup-content">
141
+ <div class="spinner"></div>
142
+ <div class="wcf-templates-wrap wcf-templates-wrap-flows">
143
+
144
+ <div id="wcf-remote-step-actions" class="wcf-template-header">
145
+ <div class="wcf-template-logo-wrap">
146
+ <span class="wcf-cartflows-logo-img">
147
+ <span class="cartflows-logo-icon"></span>
148
+ </span>
149
+ <span class="wcf-cartflows-title"><?php esc_html_e( 'Steps Library', 'cartflows' ); ?></span>
150
+ </div>
151
+ <div class="wcf-tab-wrapper">
152
+ <?php if ( 'other' !== $default_page_builder ) { ?>
153
+ <div id="wcf-get-started-steps">
154
+ <ul class="filter-links ">
155
+ <li>
156
+ <a href="#" class="current" data-slug="ready-templates" data-title="<?php esc_html_e( 'Ready Templates', 'cartflows' ); ?>"><?php esc_html_e( 'Ready Templates', 'cartflows' ); ?></a>
157
+ </li>
158
+ <li>
159
+ <a href="#" data-slug="canvas" data-title="<?php esc_html_e( 'Create Your Own', 'cartflows' ); ?>"><?php esc_html_e( 'Create Your Own', 'cartflows' ); ?></a>
160
+ </li>
161
+ </ul>
162
+ </div>
163
+ <?php } ?>
164
+ </div>
165
+ <div class="wcf-popup-close-wrap">
166
+ <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
167
+ </div>
168
+ </div>
169
+
170
+ <!--<div class="wcf-search-form">
171
+ <label class="screen-reader-text" for="wp-filter-search-input"><?php esc_html_e( 'Search Sites', 'cartflows' ); ?> </label>
172
+ <input placeholder="<?php esc_html_e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
173
+ </div>-->
174
+
175
+ <div id="wcf-remote-content">
176
+ <?php if ( 'other' !== $default_page_builder ) { ?>
177
+ <div id="wcf-ready-templates">
178
+ <div id="wcf-remote-filters">
179
+ <div id="wcf-page-builders"></div>
180
+ <div id="wcf-categories"></div>
181
+ </div>
182
+ <div class="wcf-page-builder-notice"></div>
183
+ <div id="wcf-remote-step-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
184
+ <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
185
+ </div>
186
+ <?php } ?>
187
+ <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
188
+ <div class="inner">
189
+ <div id="wcf-scratch-steps-categories">
190
+ <select class="step-type-filter-links filter-links">
191
+ <option value="" class="current"> Select Step Type </option>
192
+
193
+ <?php foreach ( $steps as $key => $value ) { ?>
194
+ <option class="<?php echo $key; ?>" data-slug="<?php echo $key; ?>" data-title="<?php echo $key; ?>"><?php echo $value; ?></option>
195
+ <?php } ?>
196
+ </select>
197
+ </div>
198
+ <a href="#" class="button button-primary cartflows-step-import-blank"><?php esc_html_e( 'Create Step', 'cartflows' ); ?></a>
199
+ <?php if ( ! _is_cartflows_pro() ) { ?>
200
+ <div class="wcf-template-notice"><p><?php echo esc_html__( 'You need a Cartflows Pro version to import Upsell / Downsell', 'cartflows' ); ?></p></div>
201
+ <?php } ?>
202
+ <p class="wcf-learn-how"><a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank"><?php esc_html_e( 'Learn How', 'cartflows' ); ?> <i class="dashicons dashicons-external"></i></a></p>
203
+ </div>
204
+ </div>
205
+ </div>
206
+ </div>
207
+ </div>
208
+ </div><!-- .wcf-templates-popup-overlay -->
209
+ </div>
210
+ <?php
modules/landing/classes/class-cartflows-landing-markup.php CHANGED
@@ -1,139 +1,139 @@
1
- <?php
2
- /**
3
- * Markup
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Checkout Markup
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Landing_Markup {
14
-
15
-
16
- /**
17
- * Member Variable
18
- *
19
- * @var object instance
20
- */
21
- private static $instance;
22
-
23
- /**
24
- * Initiator
25
- */
26
- public static function get_instance() {
27
- if ( ! isset( self::$instance ) ) {
28
- self::$instance = new self();
29
- }
30
- return self::$instance;
31
- }
32
-
33
- /**
34
- * Constructor
35
- */
36
- public function __construct() {
37
-
38
- add_action( 'pre_get_posts', array( $this, 'wcf_pre_get_posts' ) );
39
- add_action( 'template_redirect', array( $this, 'template_redirect' ) );
40
-
41
- if ( is_admin() ) {
42
- add_filter( 'wp_dropdown_pages', array( $this, 'wp_dropdown_pages' ) );
43
- }
44
- }
45
-
46
- /**
47
- * Add landing pages in WordPress reading section.
48
- *
49
- * @param array $output output.
50
- */
51
- public function wp_dropdown_pages( $output ) {
52
-
53
- global $pagenow;
54
-
55
- if ( ( 'options-reading.php' === $pagenow || 'customize.php' === $pagenow ) && preg_match( '#page_on_front#', $output ) ) {
56
-
57
- $args = array(
58
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
59
- 'numberposts' => 100,
60
- 'meta_query' => array( //phpcs:ignore
61
- 'relation' => 'OR',
62
- array(
63
- 'key' => 'wcf-step-type',
64
- 'value' => 'landing',
65
- ),
66
- array(
67
- 'key' => 'wcf-step-type',
68
- 'value' => 'checkout',
69
- ),
70
- ),
71
- );
72
-
73
- $landing_pages = get_posts( $args );
74
-
75
- if ( is_array( $landing_pages ) && ! empty( $landing_pages ) ) {
76
-
77
- $cartflows_custom_option = '';
78
-
79
- $front_page_id = get_option( 'page_on_front' );
80
-
81
- foreach ( $landing_pages as $key => $landing_page ) {
82
-
83
- $selected = selected( $front_page_id, $landing_page->ID, false );
84
-
85
- $cartflows_custom_option .= "<option value=\"{$landing_page->ID}\"{$selected}>{$landing_page->post_title} ( #{$landing_page->ID} - CartFlows )</option>";
86
- }
87
-
88
- $cartflows_custom_option .= '</select>';
89
-
90
- $output = str_replace( '</select>', $cartflows_custom_option, $output );
91
- }
92
- }
93
-
94
- return $output;
95
- }
96
-
97
- /**
98
- * Set post query.
99
- *
100
- * @param string $query post query.
101
- */
102
- public function wcf_pre_get_posts( $query ) {
103
-
104
- if ( $query->is_main_query() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
105
-
106
- $post_type = $query->get( 'post_type' );
107
-
108
- $page_id = $query->get( 'page_id' );
109
-
110
- if ( empty( $post_type ) && ! empty( $page_id ) ) {
111
- $query->set( 'post_type', get_post_type( $page_id ) );
112
- }
113
- }
114
- }
115
-
116
- /**
117
- * Redirect to homepage if landing page set as home page.
118
- */
119
- public function template_redirect() {
120
-
121
- $compatibiliy = Cartflows_Compatibility::get_instance();
122
-
123
- // Do not redirect for page builder preview.
124
- if ( $compatibiliy->is_page_builder_preview() ) {
125
- return;
126
- }
127
-
128
- global $post;
129
-
130
- if ( is_singular() && ! is_front_page() && get_option( 'page_on_front' ) == $post->ID ) {
131
- wp_safe_redirect( site_url(), 301 );
132
- }
133
- }
134
- }
135
-
136
- /**
137
- * Kicking this off by calling 'get_instance()' method
138
- */
139
- Cartflows_Landing_Markup::get_instance();
1
+ <?php
2
+ /**
3
+ * Markup
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Checkout Markup
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Landing_Markup {
14
+
15
+
16
+ /**
17
+ * Member Variable
18
+ *
19
+ * @var object instance
20
+ */
21
+ private static $instance;
22
+
23
+ /**
24
+ * Initiator
25
+ */
26
+ public static function get_instance() {
27
+ if ( ! isset( self::$instance ) ) {
28
+ self::$instance = new self();
29
+ }
30
+ return self::$instance;
31
+ }
32
+
33
+ /**
34
+ * Constructor
35
+ */
36
+ public function __construct() {
37
+
38
+ add_action( 'pre_get_posts', array( $this, 'wcf_pre_get_posts' ) );
39
+ add_action( 'template_redirect', array( $this, 'template_redirect' ) );
40
+
41
+ if ( is_admin() ) {
42
+ add_filter( 'wp_dropdown_pages', array( $this, 'wp_dropdown_pages' ) );
43
+ }
44
+ }
45
+
46
+ /**
47
+ * Add landing pages in WordPress reading section.
48
+ *
49
+ * @param array $output output.
50
+ */
51
+ public function wp_dropdown_pages( $output ) {
52
+
53
+ global $pagenow;
54
+
55
+ if ( ( 'options-reading.php' === $pagenow || 'customize.php' === $pagenow ) && preg_match( '#page_on_front#', $output ) ) {
56
+
57
+ $args = array(
58
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
59
+ 'numberposts' => 100,
60
+ 'meta_query' => array( //phpcs:ignore
61
+ 'relation' => 'OR',
62
+ array(
63
+ 'key' => 'wcf-step-type',
64
+ 'value' => 'landing',
65
+ ),
66
+ array(
67
+ 'key' => 'wcf-step-type',
68
+ 'value' => 'checkout',
69
+ ),
70
+ ),
71
+ );
72
+
73
+ $landing_pages = get_posts( $args );
74
+
75
+ if ( is_array( $landing_pages ) && ! empty( $landing_pages ) ) {
76
+
77
+ $cartflows_custom_option = '';
78
+
79
+ $front_page_id = get_option( 'page_on_front' );
80
+
81
+ foreach ( $landing_pages as $key => $landing_page ) {
82
+
83
+ $selected = selected( $front_page_id, $landing_page->ID, false );
84
+
85
+ $cartflows_custom_option .= "<option value=\"{$landing_page->ID}\"{$selected}>{$landing_page->post_title} ( #{$landing_page->ID} - CartFlows )</option>";
86
+ }
87
+
88
+ $cartflows_custom_option .= '</select>';
89
+
90
+ $output = str_replace( '</select>', $cartflows_custom_option, $output );
91
+ }
92
+ }
93
+
94
+ return $output;
95
+ }
96
+
97
+ /**
98
+ * Set post query.
99
+ *
100
+ * @param string $query post query.
101
+ */
102
+ public function wcf_pre_get_posts( $query ) {
103
+
104
+ if ( $query->is_main_query() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
105
+
106
+ $post_type = $query->get( 'post_type' );
107
+
108
+ $page_id = $query->get( 'page_id' );
109
+
110
+ if ( empty( $post_type ) && ! empty( $page_id ) ) {
111
+ $query->set( 'post_type', get_post_type( $page_id ) );
112
+ }
113
+ }
114
+ }
115
+
116
+ /**
117
+ * Redirect to homepage if landing page set as home page.
118
+ */
119
+ public function template_redirect() {
120
+
121
+ $compatibiliy = Cartflows_Compatibility::get_instance();
122
+
123
+ // Do not redirect for page builder preview.
124
+ if ( $compatibiliy->is_page_builder_preview() ) {
125
+ return;
126
+ }
127
+
128
+ global $post;
129
+
130
+ if ( is_singular() && ! is_front_page() && get_option( 'page_on_front' ) == $post->ID ) {
131
+ wp_safe_redirect( site_url(), 301 );
132
+ }
133
+ }
134
+ }
135
+
136
+ /**
137
+ * Kicking this off by calling 'get_instance()' method
138
+ */
139
+ Cartflows_Landing_Markup::get_instance();
modules/optin/class-cartflows-optin.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Checkout
4
+ *
5
+ * @package Woo Funnel Cart
6
+ */
7
+
8
+ define( 'CARTFLOWS_OPTIN_DIR', CARTFLOWS_DIR . 'modules/optin/' );
9
+ define( 'CARTFLOWS_OPTIN_URL', CARTFLOWS_URL . 'modules/optin/' );
10
+
11
+ /**
12
+ * Initial Setup
13
+ *
14
+ * @since 1.0.0
15
+ */
16
+ class Cartflows_Optin {
17
+
18
+
19
+ /**
20
+ * Member Variable
21
+ *
22
+ * @var object instance
23
+ */
24
+ private static $instance;
25
+
26
+ /**
27
+ * Initiator
28
+ */
29
+ public static function get_instance() {
30
+ if ( ! isset( self::$instance ) ) {
31
+ self::$instance = new self();
32
+ }
33
+ return self::$instance;
34
+ }
35
+
36
+ /**
37
+ * Constructor function that initializes required actions and hooks
38
+ */
39
+ public function __construct() {
40
+ require_once CARTFLOWS_OPTIN_DIR . 'classes/class-cartflows-optin-markup.php';
41
+ require_once CARTFLOWS_OPTIN_DIR . 'classes/class-cartflows-optin-meta.php';
42
+ }
43
+ }
44
+ /**
45
+ * Kicking this off by calling 'get_instance()' method
46
+ */
47
+ Cartflows_Optin::get_instance();
modules/optin/classes/class-cartflows-optin-markup.php ADDED
@@ -0,0 +1,802 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_Optin_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_optin_fields' ), 10, 2 );
41
+
42
+ /* Optin Shortcode */
43
+ add_shortcode( 'cartflows_optin', array( $this, 'optin_shortcode_markup' ) );
44
+
45
+ /* Preconfigured cart data */
46
+ add_action( 'wp', array( $this, 'preconfigured_cart_data' ), 1 );
47
+
48
+ /* Optin shortcode data */
49
+ add_action( 'wp', array( $this, 'shortcode_load_data' ), 1000 );
50
+
51
+ /* Ajax Endpoint */
52
+ add_filter( 'woocommerce_ajax_get_endpoint', array( $this, 'get_ajax_endpoint' ), 10, 2 );
53
+ add_filter( 'woocommerce_login_redirect', array( $this, 'after_login_redirect' ), 10, 2 );
54
+
55
+ /* Optin Fields */
56
+ add_filter( 'woocommerce_default_address_fields', array( $this, 'set_optin_default_fields' ), 1000 );
57
+ /**
58
+ * It may required later
59
+ * add_filter( 'woocommerce_checkout_fields', array( $this, 'set_optin_fields' ) );
60
+ */
61
+ add_filter( 'woocommerce_billing_fields', array( $this, 'billing_optin_fields' ), 1000, 2 );
62
+
63
+ add_filter( 'woocommerce_checkout_required_field_notice', array( $this, 'change_field_label_in_required_notice' ), 100, 2 );
64
+
65
+ $this->elementor_editor_compatibility();
66
+ }
67
+
68
+ /**
69
+ * Elementor editor compatibility.
70
+ */
71
+ public function elementor_editor_compatibility() {
72
+
73
+ if ( ! empty( $_REQUEST['action'] ) && 'elementor' === $_REQUEST['action'] && is_admin() ) { //phpcs:ignore
74
+
75
+ if ( isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ) { //phpcs:ignore
76
+
77
+ if ( _wcf_check_is_optin_by_id( intval( $_GET['post'] ) ) ) { //phpcs:ignore
78
+
79
+ /* Submit Button */
80
+ add_filter( 'woocommerce_order_button_text', array( $this, 'place_order_button_text' ), 10, 1 );
81
+ }
82
+ }
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Change order button text .
88
+ *
89
+ * @param string $woo_button_text place order.
90
+ * @return string
91
+ */
92
+ public function place_order_button_text( $woo_button_text ) {
93
+
94
+ $optin_id = get_the_ID();
95
+
96
+ $wcf_order_button_text = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-text' );
97
+
98
+ if ( ! empty( $wcf_order_button_text ) ) {
99
+ $woo_button_text = $wcf_order_button_text;
100
+ }
101
+
102
+ return $woo_button_text;
103
+ }
104
+
105
+ /**
106
+ * Display all WooCommerce notices.
107
+ *
108
+ * @since 1.1.5
109
+ */
110
+ public function display_woo_notices() {
111
+
112
+ if ( null != WC()->session && function_exists( 'woocommerce_output_all_notices' ) ) {
113
+ woocommerce_output_all_notices();
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Check for checkout flag
119
+ *
120
+ * @param bool $is_checkout is checkout.
121
+ *
122
+ * @return bool
123
+ */
124
+ public function woo_checkout_flag( $is_checkout ) {
125
+
126
+ if ( ! is_admin() ) {
127
+
128
+ if ( _is_wcf_optin_type() ) {
129
+
130
+ $is_checkout = true;
131
+ }
132
+ }
133
+
134
+ return $is_checkout;
135
+ }
136
+
137
+ /**
138
+ * Render checkout shortcode markup.
139
+ *
140
+ * @param array $atts attributes.
141
+ * @return string
142
+ */
143
+ public function optin_shortcode_markup( $atts ) {
144
+
145
+ if ( ! function_exists( 'wc_print_notices' ) ) {
146
+ $notice_out = '<p class="woocommerce-notice">' . __( 'WooCommerce functions do not exist. If you are in an IFrame, please reload it.', 'cartflows' ) . '</p>';
147
+ $notice_out .= '<button onClick="location.reload()">' . __( 'Click Here to Reload', 'cartflows' ) . '</button>';
148
+
149
+ return $notice_out;
150
+ }
151
+
152
+ $atts = shortcode_atts(
153
+ array(
154
+ 'id' => 0,
155
+ ),
156
+ $atts
157
+ );
158
+
159
+ $optin_id = intval( $atts['id'] );
160
+
161
+ if ( empty( $optin_id ) ) {
162
+
163
+ if ( ! _is_wcf_optin_type() ) {
164
+
165
+ return '<h4>' . __( 'Please place shortcode on Optin step-type only.', 'cartflows' ) . '</h4>';
166
+ }
167
+
168
+ global $post;
169
+
170
+ $optin_id = intval( $post->ID );
171
+ }
172
+
173
+ $output = '';
174
+
175
+ ob_start();
176
+
177
+ do_action( 'cartflows_optin_form_before', $optin_id );
178
+
179
+ $optin_layout = 'default';
180
+
181
+ $template_default = CARTFLOWS_OPTIN_DIR . 'templates/optin-template-simple.php';
182
+
183
+ include $template_default;
184
+
185
+ $output .= ob_get_clean();
186
+
187
+ return $output;
188
+ }
189
+
190
+ /**
191
+ * Configure Cart Data.
192
+ *
193
+ * @since 1.0.0
194
+ *
195
+ * @return void
196
+ */
197
+ public function preconfigured_cart_data() {
198
+
199
+ if ( is_admin() ) {
200
+ return;
201
+ }
202
+
203
+ global $post;
204
+
205
+ if ( _is_wcf_optin_type() ) {
206
+
207
+ if ( wp_doing_ajax() ) {
208
+ return;
209
+ } else {
210
+
211
+ $optin_id = $post->ID;
212
+
213
+ do_action( 'cartflows_optin_before_configure_cart', $optin_id );
214
+
215
+ $products = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-product' );
216
+
217
+ if ( ! is_array( $products ) ) {
218
+ return;
219
+ }
220
+
221
+ /* Empty the current cart */
222
+ WC()->cart->empty_cart();
223
+
224
+ if ( is_array( $products ) && count( $products ) < 1 ) {
225
+ wc_add_notice( __( 'No product is selected. Please select a Simple, Virtual and Free product from the meta settings.', 'cartflows' ), 'error' );
226
+ return;
227
+ }
228
+
229
+ /* Set customer session if not set */
230
+ if ( ! is_user_logged_in() && WC()->cart->is_empty() ) {
231
+ WC()->session->set_customer_session_cookie( true );
232
+ }
233
+
234
+ $product_id = reset( $products );
235
+ $_product = wc_get_product( $product_id );
236
+
237
+ if ( ! empty( $_product ) ) {
238
+
239
+ if ( $_product->is_type( 'simple' ) && $_product->is_virtual() ) {
240
+
241
+ if ( $_product->get_price() > 0 ) {
242
+ wc_add_notice( __( 'Please update the selected product\'s price to zero (0).', 'cartflows' ), 'error' );
243
+ } else {
244
+
245
+ $quantity = 1;
246
+
247
+ WC()->cart->add_to_cart( $product_id, $quantity );
248
+ }
249
+ } else {
250
+
251
+ wc_add_notice( __( 'Please select a Simple, Virtual and Free product.', 'cartflows' ), 'error' );
252
+ }
253
+ } else {
254
+
255
+ wc_add_notice( __( 'Please select a Simple, Virtual and Free product.', 'cartflows' ), 'error' );
256
+ }
257
+
258
+ do_action( 'cartflows_optin_after_configure_cart', $optin_id );
259
+ }
260
+ }
261
+ }
262
+
263
+ /**
264
+ * Load shortcode data.
265
+ *
266
+ * @return void
267
+ */
268
+ public function shortcode_load_data() {
269
+
270
+ if ( _is_wcf_optin_type() ) {
271
+
272
+ add_action( 'wp_enqueue_scripts', array( $this, 'shortcode_scripts' ), 21 );
273
+
274
+ /* Show notices if cart has errors */
275
+ add_action( 'woocommerce_cart_has_errors', 'woocommerce_output_all_notices' );
276
+
277
+ // Outputting the hidden field in checkout page.
278
+ add_action( 'woocommerce_after_order_notes', array( $this, 'checkout_shortcode_post_id' ), 99 );
279
+ add_action( 'woocommerce_login_form_end', array( $this, 'checkout_shortcode_post_id' ), 99 );
280
+
281
+ /* Remove unnecessary option */
282
+ add_filter( 'woocommerce_enable_order_notes_field', '__return_false' );
283
+ add_filter( 'woocommerce_cart_needs_shipping_address', '__return_false' );
284
+
285
+ remove_all_actions( 'woocommerce_before_checkout_form' );
286
+ remove_all_actions( 'woocommerce_checkout_billing' );
287
+ remove_all_actions( 'woocommerce_checkout_shipping' );
288
+ remove_all_actions( 'woocommerce_checkout_before_order_review' );
289
+ remove_all_actions( 'woocommerce_checkout_order_review' );
290
+ remove_all_actions( 'woocommerce_checkout_after_order_review' );
291
+ add_filter( 'woocommerce_cart_needs_payment', '__return_false' );
292
+ add_filter( 'woocommerce_available_payment_gateways', array( $this, 'disable_payment_gateways' ) );
293
+
294
+ /* Paypal Expresss remove */
295
+
296
+ if ( function_exists( 'wc_gateway_ppec' ) ) {
297
+ remove_action( 'wp_enqueue_scripts', array( wc_gateway_ppec()->cart, 'enqueue_scripts' ) );
298
+ }
299
+
300
+ // Hook in actions once.
301
+ add_action( 'woocommerce_before_checkout_form', 'woocommerce_output_all_notices', 10 );
302
+ add_action( 'woocommerce_checkout_billing', array( WC()->checkout, 'checkout_form_billing' ) );
303
+ add_action( 'woocommerce_checkout_shipping', array( WC()->checkout, 'checkout_form_shipping' ) );
304
+ add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
305
+
306
+ /* Submit Button */
307
+ add_filter( 'woocommerce_order_button_text', array( $this, 'place_order_button_text' ), 10, 1 );
308
+
309
+ add_filter( 'woocommerce_get_terms_and_conditions_checkbox_text', '__return_false' );
310
+
311
+ global $post;
312
+
313
+ $optin_id = $post->ID;
314
+
315
+ do_action( 'cartflows_optin_before_shortcode', $optin_id );
316
+ }
317
+ }
318
+
319
+ /**
320
+ * Disable payment gateways.
321
+ *
322
+ * @param array $available_gateways gateways.
323
+ * @return array
324
+ */
325
+ public function disable_payment_gateways( $available_gateways ) {
326
+
327
+ if ( ! is_admin() ) {
328
+
329
+ $available_gateways = array();
330
+ }
331
+
332
+ return $available_gateways;
333
+ }
334
+
335
+ /**
336
+ * Render checkout ID hidden field.
337
+ *
338
+ * @param array $checkout checkout session data.
339
+ * @return void
340
+ */
341
+ public function checkout_shortcode_post_id( $checkout ) {
342
+
343
+ if ( ! _is_wcf_optin_type() ) {
344
+ return;
345
+ }
346
+
347
+ global $post;
348
+
349
+ $optin_id = $post->ID;
350
+
351
+ $flow_id = get_post_meta( $optin_id, 'wcf-flow-id', true );
352
+
353
+ echo '<input type="hidden" class="input-hidden _wcf_flow_id" name="_wcf_flow_id" value="' . intval( $flow_id ) . '">';
354
+ echo '<input type="hidden" class="input-hidden _wcf_optin_id" name="_wcf_optin_id" value="' . intval( $optin_id ) . '">';
355
+ }
356
+
357
+ /**
358
+ * Load shortcode scripts.
359
+ *
360
+ * @return void
361
+ */
362
+ public function shortcode_scripts() {
363
+
364
+ wp_enqueue_style( 'wcf-optin-template', wcf()->utils->get_css_url( 'optin-template' ), '', CARTFLOWS_VER );
365
+
366
+ wp_enqueue_script(
367
+ 'wcf-optin-template',
368
+ wcf()->utils->get_js_url( 'optin-template' ),
369
+ array( 'jquery' ),
370
+ CARTFLOWS_VER,
371
+ true
372
+ );
373
+
374
+ do_action( 'cartflows_optin_scripts' );
375
+
376
+ $style = $this->generate_style();
377
+
378
+ wp_add_inline_style( 'wcf-optin-template', $style );
379
+ }
380
+
381
+ /**
382
+ * Generate styles.
383
+ *
384
+ * @return string
385
+ */
386
+ public function generate_style() {
387
+
388
+ global $post;
389
+
390
+ $optin_id = $post->ID;
391
+
392
+ /* Load all fonts */
393
+ CartFlows_Font_Families::render_fonts( $optin_id );
394
+
395
+ $r = '';
396
+ $g = '';
397
+ $b = '';
398
+ $output = '';
399
+
400
+ /* Global */
401
+ $primary_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-primary-color' );
402
+ $base_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-base-font-family' );
403
+
404
+ /* Input Fields */
405
+ $input_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-font-family' );
406
+ $input_font_weight = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-font-weight' );
407
+ $field_input_size = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-field-size' );
408
+ $field_tb_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-tb-padding' );
409
+ $field_lr_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-lr-padding' );
410
+ $field_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-color' );
411
+ $field_bg_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-bg-color' );
412
+ $field_border_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-border-color' );
413
+ $field_label_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-label-color' );
414
+
415
+ if ( 'custom' == $field_input_size ) {
416
+ $field_input_size = '38px';
417
+ }
418
+
419
+ /* Submit Button */
420
+ $submit_button_width = '100%';
421
+ $optin_button_position = '';
422
+ $button_font_size = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-font-size' );
423
+ $button_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-button-font-family' );
424
+ $button_font_weight = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-button-font-weight' );
425
+ $submit_button_height = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-size' );
426
+ $submit_tb_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-tb-padding' );
427
+ $submit_lr_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-lr-padding' );
428
+ $submit_button_position = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-position' );
429
+ $submit_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-color' );
430
+ $submit_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-hover-color' );
431
+ $submit_bg_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-bg-color', $primary_color );
432
+ $submit_bg_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-bg-hover-color', $primary_color );
433
+ $submit_border_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-border-color', $primary_color );
434
+ $submit_border_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-border-hover-color', $primary_color );
435
+
436
+ if ( 'custom' == $submit_button_height ) {
437
+ $submit_button_height = '38px';
438
+ $submit_button_width = 'auto';
439
+
440
+ switch ( $submit_button_position ) {
441
+ case 'left':
442
+ $optin_button_position = '0 auto 0 0';
443
+ break;
444
+ case 'center':
445
+ $optin_button_position = '0 auto';
446
+ break;
447
+ case 'right':
448
+ $optin_button_position = '0 0 0 auto';
449
+ break;
450
+
451
+ default:
452
+ $optin_button_position = '0 auto';
453
+ break;
454
+ }
455
+
456
+ $output .= ".wcf-optin-form .woocommerce #order_review #payment button{
457
+ margin: {$optin_button_position};
458
+ }";
459
+ }
460
+
461
+ $output .= "
462
+ .wcf-optin-form .woocommerce #payment input[type=checkbox]:checked:before,
463
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type='checkbox']:checked:before{
464
+ color: {$primary_color};
465
+ }
466
+ .wcf-optin-form .woocommerce #payment input[type=radio]:checked:before{
467
+ background-color: {$primary_color};
468
+ }
469
+ .wcf-optin-form .woocommerce #payment input[type=checkbox]:focus,
470
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type='checkbox']:focus,
471
+ .wcf-optin-form .woocommerce #payment input[type=radio]:checked:focus,
472
+ .wcf-optin-form .woocommerce #payment input[type=radio]:not(:checked):focus{
473
+ border-color: {$primary_color};
474
+ box-shadow: 0 0 2px rgba( " . $r . ',' . $g . ',' . $b . ", .8);
475
+ }
476
+ .wcf-optin-form .woocommerce-checkout label{
477
+ color: {$field_label_color};
478
+ }
479
+
480
+ .wcf-optin-form #order_review .wcf-custom-coupon-field input[type='text'],
481
+ .wcf-optin-form .woocommerce form .form-row input.input-text,
482
+ .wcf-optin-form .woocommerce form .form-row textarea,
483
+ .wcf-optin-form .select2-container--default .select2-selection--single {
484
+ color: {$field_color};
485
+ background: {$field_bg_color};
486
+ border-color: {$field_border_color};
487
+ padding-top: {$field_tb_padding}px;
488
+ padding-bottom: {$field_tb_padding}px;
489
+ padding-left: {$field_lr_padding}px;
490
+ padding-right: {$field_lr_padding}px;
491
+ min-height: {$field_input_size};
492
+ font-family: {$input_font_family};
493
+ font-weight: {$input_font_weight};
494
+ }
495
+
496
+ .wcf-optin-form .woocommerce .col2-set .col-1,
497
+ .wcf-optin-form .woocommerce .col2-set .col-2,
498
+ .wcf-optin-form .woocommerce-checkout .shop_table,
499
+ .wcf-optin-form .woocommerce-checkout #order_review_heading,
500
+ .wcf-optin-form .woocommerce-checkout #payment,
501
+ .wcf-optin-form .woocommerce form.checkout_coupon {
502
+ font-family: {$input_font_family};
503
+ font-weight: {$input_font_weight};
504
+ }
505
+
506
+ .woocommerce table.shop_table th{
507
+ color: {$field_label_color};
508
+ }
509
+
510
+ .wcf-optin-form .woocommerce a{
511
+ color: {$primary_color};
512
+ }
513
+ .wcf-optin-form .select2-container--default .select2-selection--single .select2-selection__rendered {
514
+ color: {$field_color};
515
+ }
516
+ .wcf-optin-form ::-webkit-input-placeholder { /* Chrome/Opera/Safari */
517
+ color: {$field_color};
518
+ }
519
+ .wcf-optin-form ::-moz-placeholder { /* Firefox 19+ */
520
+ color: {$field_color};
521
+ }
522
+ .wcf-optin-form :-ms-input-placeholder { /* IE 10+ */
523
+ color: {$field_color};
524
+ }
525
+ .wcf-optin-form :-moz-placeholder { /* Firefox 18- */
526
+ color: {$field_color};
527
+ }
528
+ .wcf-optin-form .woocommerce form p.form-row label {
529
+ color: {$field_label_color};
530
+ font-family: {$input_font_family};
531
+ font-weight: {$input_font_weight};
532
+ }
533
+ .wcf-optin-form .woocommerce #order_review button,
534
+ .wcf-optin-form .woocommerce form.woocommerce-form-login .form-row button,
535
+ .wcf-optin-form .woocommerce #order_review button.wcf-btn-small {
536
+ color: {$submit_color};
537
+ background: {$submit_bg_color};
538
+ padding-top: {$submit_tb_padding}px;
539
+ padding-bottom: {$submit_tb_padding}px;
540
+ padding-left: {$submit_lr_padding}px;
541
+ padding-right: {$submit_lr_padding}px;
542
+ border-color: {$submit_border_color};
543
+ min-height: {$submit_button_height};
544
+ font-size: {$button_font_size}px;
545
+ font-family: {$button_font_family};
546
+ font-weight: {$button_font_weight};
547
+ width: {$submit_button_width};
548
+
549
+ }
550
+
551
+ .wcf-optin-form .woocommerce-checkout form.woocommerce-form-login .button,
552
+ .wcf-optin-form .woocommerce-checkout form.checkout_coupon .button{
553
+ background: {$submit_bg_color};
554
+ border: 1px {$submit_border_color} solid;
555
+ color: {$submit_color};
556
+ min-height: {$submit_button_height};
557
+ font-family: {$button_font_family};
558
+ font-weight: {$button_font_weight};
559
+ }
560
+ .wcf-optin-form .woocommerce-checkout form.login .button:hover,
561
+ .wcf-optin-form .woocommerce-checkout form.checkout_coupon .button:hover,
562
+ .wcf-optin-form .woocommerce #payment #place_order:hover,
563
+ .wcf-optin-form .woocommerce #order_review button.wcf-btn-small:hover{
564
+ color: {$submit_hover_color};
565
+ background-color: {$submit_bg_hover_color};
566
+ border-color: {$submit_border_hover_color};
567
+ }
568
+ .wcf-optin-form .woocommerce-info::before,
569
+ .wcf-optin-form .woocommerce-message::before{
570
+ color: {$primary_color};
571
+ }
572
+ .wcf-optin-form{
573
+ font-family: {$base_font_family};
574
+ }
575
+ img.emoji, img.wp-smiley {}";
576
+
577
+ return $output;
578
+ }
579
+
580
+ /**
581
+ * Get ajax end points.
582
+ *
583
+ * @param string $endpoint_url end point URL.
584
+ * @param string $request end point request.
585
+ * @return string
586
+ */
587
+ public function get_ajax_endpoint( $endpoint_url, $request ) {
588
+
589
+ global $post;
590
+
591
+ if ( ! empty( $post ) && ! empty( $_SERVER['REQUEST_URI'] ) ) {
592
+
593
+ if ( _is_wcf_optin_type() ) {
594
+
595
+ if ( mb_strpos( $endpoint_url, 'checkout', 0, 'utf-8' ) === false ) {
596
+
597
+ if ( '' === $request ) {
598
+ $query_args = array(
599
+ 'wc-ajax' => '%%endpoint%%',
600
+ );
601
+ } else {
602
+ $query_args = array(
603
+ 'wc-ajax' => $request,
604
+ );
605
+ }
606
+
607
+ $uri = explode( '?', $_SERVER['REQUEST_URI'], 2 ); //phpcs:ignore
608
+ $uri = $uri[0];
609
+
610
+ $endpoint_url = esc_url( add_query_arg( $query_args, $uri ) );
611
+ }
612
+ }
613
+ }
614
+
615
+ return $endpoint_url;
616
+ }
617
+
618
+
619
+ /**
620
+ * Save checkout fields.
621
+ *
622
+ * @param int $order_id order id.
623
+ * @param array $posted posted data.
624
+ * @return void
625
+ */
626
+ public function save_optin_fields( $order_id, $posted ) {
627
+
628
+ if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
629
+
630
+ $optin_id = wc_clean( wp_unslash( $_POST['_wcf_optin_id'] ) ); //phpcs:ignore
631
+
632
+ update_post_meta( $order_id, '_wcf_optin_id', $optin_id );
633
+
634
+ if ( isset( $_POST['_wcf_flow_id'] ) ) { //phpcs:ignore
635
+
636
+ $flow_id = wc_clean( wp_unslash( $_POST['_wcf_flow_id'] ) ); //phpcs:ignore
637
+
638
+ update_post_meta( $order_id, '_wcf_flow_id', $flow_id );
639
+ }
640
+ }
641
+
642
+ }
643
+
644
+ /**
645
+ * Redirect users to our checkout if hidden param
646
+ *
647
+ * @param string $redirect redirect url.
648
+ * @param object $user user.
649
+ * @return string
650
+ */
651
+ public function after_login_redirect( $redirect, $user ) {
652
+
653
+ if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
654
+
655
+ $optin_id = intval( $_POST['_wcf_optin_id'] ); //phpcs:ignore
656
+
657
+ $redirect = get_permalink( $optin_id );
658
+ }
659
+
660
+ return $redirect;
661
+ }
662
+
663
+
664
+ /**
665
+ * Add custom class to the fields to change the UI to three column.
666
+ *
667
+ * @param array $fields fields.
668
+ */
669
+ public function set_optin_default_fields( $fields ) {
670
+
671
+ if ( _is_wcf_optin_type() ) {
672
+
673
+ global $post;
674
+
675
+ $optin_id = $post->ID;
676
+ } else {
677
+
678
+ if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
679
+
680
+ $optin_id = wcf()->utils->get_optin_id_from_post_data();
681
+ } else {
682
+ return $fields;
683
+ }
684
+ }
685
+
686
+ $first_name = $fields['first_name'];
687
+ $last_name = $fields['last_name'];
688
+
689
+ /* Make fields required */
690
+ $first_name['required'] = true;
691
+ $last_name['required'] = true;
692
+
693
+ $fields = array(
694
+ 'first_name' => $first_name,
695
+ 'last_name' => $last_name,
696
+ );
697
+
698
+ return apply_filters( 'cartflows_optin_default_fields', $fields, $optin_id );
699
+ }
700
+
701
+ /**
702
+ * Add custom class to the fields to change the UI to three column.
703
+ *
704
+ * @param array $fields fields.
705
+ */
706
+ public function set_optin_fields( $fields ) {
707
+
708
+ if ( _is_wcf_optin_type() ) {
709
+
710
+ global $post;
711
+
712
+ $optin_id = $post->ID;
713
+ } else {
714
+
715
+ if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
716
+
717
+ $optin_id = wcf()->utils->get_optin_id_from_post_data();
718
+ } else {
719
+ return $fields;
720
+ }
721
+ }
722
+
723
+ $billing_first_name = $fields['billing']['billing_first_name'];
724
+ $billing_last_name = $fields['billing']['billing_last_name'];
725
+ $billing_email = $fields['billing']['billing_email'];
726
+
727
+ $fields['billing'] = array(
728
+ 'billing_first_name' => $billing_first_name,
729
+ 'billing_last_name' => $billing_last_name,
730
+ 'billing_email' => $billing_email,
731
+ );
732
+
733
+ return apply_filters( 'cartflows_optin_fields', $fields, $optin_id );
734
+ }
735
+
736
+ /**
737
+ * Billing field customization.
738
+ *
739
+ * @param array $fields fields data.
740
+ * @param string $country country name.
741
+ * @return array
742
+ */
743
+ public function billing_optin_fields( $fields, $country ) {
744
+
745
+ if ( _is_wcf_optin_type() ) {
746
+
747
+ global $post;
748
+
749
+ $optin_id = $post->ID;
750
+ } else {
751
+
752
+ if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
753
+ $optin_id = wcf()->utils->get_optin_id_from_post_data();
754
+ } else {
755
+ return $fields;
756
+ }
757
+ }
758
+
759
+ if ( is_wc_endpoint_url( 'edit-address' ) ) {
760
+ return $fields;
761
+ }
762
+
763
+ $billing_first_name = $fields['billing_first_name'];
764
+ $billing_last_name = $fields['billing_last_name'];
765
+ $billing_email = $fields['billing_email'];
766
+
767
+ /* Make fields required */
768
+ $billing_first_name['required'] = true;
769
+ $billing_last_name['required'] = true;
770
+
771
+ $fields = array(
772
+ 'billing_first_name' => $billing_first_name,
773
+ 'billing_last_name' => $billing_last_name,
774
+ 'billing_email' => $billing_email,
775
+ );
776
+
777
+ return apply_filters( 'cartflows_billing_optin_fields', $fields, $country, $optin_id );
778
+ }
779
+
780
+
781
+ /**
782
+ * Replace billing label.
783
+ *
784
+ * @param string $notice Notice.
785
+ * @param string $field_label Field name.
786
+ * @return string
787
+ */
788
+ public function change_field_label_in_required_notice( $notice, $field_label ) {
789
+
790
+ if ( _is_wcf_doing_optin_ajax() ) {
791
+
792
+ $notice = str_replace( 'Billing ', '', $notice );
793
+ }
794
+
795
+ return $notice;
796
+ }
797
+ }
798
+
799
+ /**
800
+ * Kicking this off by calling 'get_instance()' method
801
+ */
802
+ Cartflows_Optin_Markup::get_instance();
modules/optin/classes/class-cartflows-optin-meta.php ADDED
@@ -0,0 +1,672 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Checkout post meta
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Meta Boxes setup
10
+ */
11
+ class Cartflows_Optin_Meta extends Cartflows_Meta {
12
+
13
+
14
+ /**
15
+ * Instance
16
+ *
17
+ * @var $instance
18
+ */
19
+ private static $instance;
20
+
21
+ /**
22
+ * Meta Option
23
+ *
24
+ * @var $meta_option
25
+ */
26
+ private static $meta_option = null;
27
+
28
+ /**
29
+ * Initiator
30
+ */
31
+ public static function get_instance() {
32
+ if ( ! isset( self::$instance ) ) {
33
+ self::$instance = new self();
34
+ }
35
+
36
+ return self::$instance;
37
+ }
38
+
39
+ /**
40
+ * Constructor
41
+ */
42
+ public function __construct() {
43
+
44
+ /* Init Metabox */
45
+ add_action( 'load-post.php', array( $this, 'init_metabox' ) );
46
+ add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
47
+ }
48
+ /**
49
+ * Init Metabox
50
+ */
51
+ public function init_metabox() {
52
+
53
+ add_action( 'add_meta_boxes', array( $this, 'setup_meta_box' ) );
54
+ add_action( 'save_post', array( $this, 'save_meta_box' ) );
55
+ }
56
+
57
+ /**
58
+ * Setup Metabox
59
+ */
60
+ public function setup_meta_box() {
61
+
62
+ if ( _is_wcf_optin_type() ) {
63
+ add_meta_box(
64
+ 'wcf-optin-settings', // Id.
65
+ __( 'Optin Settings', 'cartflows' ), // Title.
66
+ array( $this, 'markup_meta_box' ), // Callback.
67
+ wcf()->utils->get_step_post_type(), // Post_type.
68
+ 'normal', // Context.
69
+ 'high' // Priority.
70
+ );
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Metabox Markup
76
+ *
77
+ * @param object $post Post object.
78
+ * @return void
79
+ */
80
+ public function markup_meta_box( $post ) {
81
+
82
+ wp_nonce_field( 'save-nonce-optin-step-meta', 'nonce-optin-step-meta' );
83
+
84
+ $stored = get_post_meta( $post->ID );
85
+
86
+ $optin_meta = self::get_meta_option( $post->ID );
87
+
88
+ // Set stored and override defaults.
89
+ foreach ( $stored as $key => $value ) {
90
+ if ( array_key_exists( $key, $optin_meta ) ) {
91
+ self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? maybe_unserialize( $stored[ $key ][0] ) : '';
92
+ } else {
93
+ self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : '';
94
+ }
95
+ }
96
+
97
+ // Get defaults.
98
+ $meta = self::get_meta_option( $post->ID );
99
+ $optin_meta = array();
100
+
101
+ foreach ( $meta as $key => $value ) {
102
+ $optin_meta[ $key ] = $meta[ $key ]['default'];
103
+ }
104
+
105
+ do_action( 'wcf_optin_settings_markup_before' );
106
+ $this->tabs_markup( $optin_meta, $post->ID );
107
+ do_action( 'wcf_optin_settings_markup_after' );
108
+ }
109
+
110
+ /**
111
+ * Page Header Tabs
112
+ *
113
+ * @param array $options options.
114
+ * @param int $post_id post ID.
115
+ */
116
+ public function tabs_markup( $options, $post_id ) {
117
+
118
+ $active_tab = get_post_meta( $post_id, 'wcf-active-tab', true );
119
+
120
+ if ( empty( $active_tab ) ) {
121
+ $active_tab = 'wcf-optin-shortcodes';
122
+ }
123
+
124
+ $tab_array = array(
125
+ array(
126
+ 'title' => __( 'Shortcodes', 'cartflows' ),
127
+ 'id' => 'wcf-optin-shortcodes',
128
+ 'class' => 'wcf-optin-shortcodes' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
129
+ 'icon' => 'dashicons-editor-code',
130
+ ),
131
+ array(
132
+ 'title' => __( 'Select Product', 'cartflows' ),
133
+ 'id' => 'wcf-optin-general',
134
+ 'class' => 'wcf-optin-general' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
135
+ 'icon' => 'dashicons-info',
136
+ ),
137
+ array(
138
+ 'title' => __( 'Design', 'cartflows' ),
139
+ 'id' => 'wcf-optin-style',
140
+ 'class' => 'wcf-optin-style' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
141
+ 'icon' => 'dashicons-admin-customizer',
142
+ ),
143
+ array(
144
+ 'title' => __( 'Form Fields', 'cartflows' ),
145
+ 'id' => 'wcf-optin-custom-fields',
146
+ 'class' => 'wcf-optin-custom-fields' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
147
+ 'icon' => 'dashicons-welcome-widgets-menus',
148
+ ),
149
+ array(
150
+ 'title' => __( 'Settings', 'cartflows' ),
151
+ 'id' => 'wcf-optin-custom-settings',
152
+ 'class' => 'wcf-optin-custom-settings' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
153
+ 'icon' => 'dashicons-admin-generic',
154
+ ),
155
+ array(
156
+ 'title' => __( 'Custom Script', 'cartflows' ),
157
+ 'id' => 'wcf-optin-custom-script-header',
158
+ 'class' => 'wcf-optin-custom-script-header' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
159
+ 'icon' => 'dashicons-format-aside',
160
+ ),
161
+ );
162
+
163
+ $tabs = $tab_array;
164
+
165
+ ?>
166
+ <div class="wcf-optin-table wcf-metabox-wrap widefat">
167
+ <div class="wcf-table-container">
168
+ <div class="wcf-column-left">
169
+ <div class="wcf-tab-wrapper">
170
+
171
+ <?php foreach ( $tabs as $key => $tab ) { ?>
172
+ <div class="<?php echo esc_attr( $tab['class'] ); ?>" data-tab="<?php echo esc_attr( $tab['id'] ); ?>">
173
+ <span class="dashicons <?php echo esc_attr( $tab['icon'] ); ?>"></span>
174
+ <span class="wcf-tab-title"><?php echo esc_html( $tab['title'] ); ?></span>
175
+ </div>
176
+ <?php } ?>
177
+
178
+ <input type="hidden" id="wcf-active-tab" name="wcf-active-tab" value="<?php echo esc_attr( $active_tab ); ?>" />
179
+ </div>
180
+ </div>
181
+ <div class="wcf-column-right">
182
+ <?php $this->tab_shortcodes( $options, $post_id ); ?>
183
+ <?php $this->tab_general( $options, $post_id ); ?>
184
+ <?php $this->tab_style( $options, $post_id ); ?>
185
+ <?php $this->tab_custom_fields( $options, $post_id ); ?>
186
+ <?php $this->tab_custom_settings( $options, $post_id ); ?>
187
+ <?php $this->tab_custom_script( $options, $post_id ); ?>
188
+ <?php $this->right_column_footer( $options, $post_id ); ?>
189
+ </div>
190
+ </div>
191
+ </div>
192
+
193
+ <?php
194
+ }
195
+
196
+ /**
197
+ * Shortcodes tab
198
+ *
199
+ * @param array $options options.
200
+ * @param int $post_id post ID.
201
+ */
202
+ public function tab_shortcodes( $options, $post_id ) {
203
+ ?>
204
+ <div class="wcf-optin-shortcodes wcf-tab-content widefat">
205
+
206
+ <?php
207
+
208
+ echo wcf()->meta->get_shortcode_field(
209
+ array(
210
+ 'label' => 'Optin Page',
211
+ 'name' => 'wcf-optin-shortcode',
212
+ 'content' => '[cartflows_optin]',
213
+ 'help' => esc_html__( 'Add this shortcode to your optin page', 'cartflows' ),
214
+ )
215
+ );
216
+ ?>
217
+ </div>
218
+ <?php
219
+ }
220
+
221
+
222
+ /**
223
+ * General tab
224
+ *
225
+ * @param array $options options.
226
+ * @param int $post_id post ID.
227
+ */
228
+ public function tab_general( $options, $post_id ) {
229
+ ?>
230
+ <div class="wcf-optin-general wcf-tab-content widefat">
231
+
232
+ <?php
233
+
234
+ echo wcf()->meta->get_product_selection_field(
235
+ array(
236
+ 'name' => 'wcf-optin-product',
237
+ 'value' => $options['wcf-optin-product'],
238
+ 'label' => __( 'Select Free Product', 'cartflows' ),
239
+ 'help' => __( 'Select Free and Virtual product only.', 'cartflows' ),
240
+ 'multiple' => false,
241
+ 'allow_clear' => true,
242
+ )
243
+ );
244
+
245
+ ?>
246
+ </div>
247
+ <?php
248
+ }
249
+
250
+ /**
251
+ * Tab custom fields
252
+ *
253
+ * @param array $options options.
254
+ * @param int $post_id post ID.
255
+ */
256
+ public function tab_custom_fields( $options, $post_id ) {
257
+ ?>
258
+ <div class="wcf-optin-custom-fields wcf-tab-content widefat">
259
+ <?php
260
+ /* Custom Checkout Fields Section */
261
+
262
+ if ( ! _is_cartflows_pro() ) {
263
+ echo wcf()->meta->get_description_field(
264
+ array(
265
+ 'name' => 'wcf-upgrade-to-pro',
266
+ /* translators: %s: link */
267
+ 'content' => '<i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature.', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
268
+ )
269
+ );
270
+ }
271
+ ?>
272
+ <?php do_action( 'cartflows_optin_custom_fields_tab_content', $options, $post_id ); ?>
273
+ </div>
274
+ <?php
275
+ }
276
+
277
+ /**
278
+ * Tab custom settings
279
+ *
280
+ * @param array $options options.
281
+ * @param int $post_id post ID.
282
+ */
283
+ public function tab_custom_settings( $options, $post_id ) {
284
+ ?>
285
+ <div class="wcf-optin-custom-settings wcf-tab-content widefat">
286
+ <div class="wcf-custom-settings-fields">
287
+ <?php
288
+ echo wcf()->meta->get_checkbox_field(
289
+ array(
290
+ 'label' => __( 'Pass Fields as URL Parameters', 'cartflows' ),
291
+ 'name' => 'wcf-optin-pass-fields',
292
+ 'value' => $options['wcf-optin-pass-fields'],
293
+ 'after' => __( 'Enable', 'cartflows' ),
294
+ 'help' => __( 'You can pass specific fields from the form to next step as URL query parameters.', 'cartflows' ),
295
+ 'toggle' => array(
296
+ 'fields' => array(
297
+ 'yes' => array( 'wcf-optin-pass-specific-fields' ),
298
+ ),
299
+ ),
300
+ )
301
+ );
302
+
303
+ echo wcf()->meta->get_text_field(
304
+ array(
305
+ 'label' => __( 'Enter form field', 'cartflows' ),
306
+ 'name' => 'wcf-optin-pass-specific-fields',
307
+ 'value' => $options['wcf-optin-pass-specific-fields'],
308
+ 'help' => __( 'Enter comma seprated field name. E.g. first_name, last_name', 'cartflows' ),
309
+ 'attr' => array(
310
+ 'placeholder' => __( 'Fields to pass, separated by commas', 'cartflows' ),
311
+ ),
312
+ )
313
+ );
314
+
315
+ echo wcf()->meta->get_description_field(
316
+ array(
317
+ 'name' => 'wcf-optin-pass-fields-doc',
318
+ 'content' => __( 'Enter comma seprated field name. E.g. first_name, last_name', 'cartflows' ),
319
+ /* translators: %s: link */
320
+ 'content' => sprintf( esc_html__( 'You can pass field value as a URL parameter to the next step. %1$sClick here%2$s for more information.', 'cartflows' ), '<a href="https://cartflows.com/docs/pass-variable-as-query-parameters-to-url/" target="_blank">', '</a>' ),
321
+ )
322
+ );
323
+
324
+ ?>
325
+ </div>
326
+ </div>
327
+ <?php
328
+ }
329
+
330
+ /**
331
+ * Tab style
332
+ *
333
+ * @param array $options options.
334
+ * @param int $post_id post ID.
335
+ */
336
+ public function tab_style( $options, $post_id ) {
337
+ ?>
338
+
339
+ <div class="wcf-optin-style wcf-tab-content widefat">
340
+ <?php
341
+ echo wcf()->meta->get_color_picker_field(
342
+ array(
343
+ 'label' => __( 'Primary Color', 'cartflows' ),
344
+ 'name' => 'wcf-primary-color',
345
+ 'value' => $options['wcf-primary-color'],
346
+ )
347
+ );
348
+
349
+ echo wcf()->meta->get_font_family_field(
350
+ array(
351
+ 'for' => 'wcf-base',
352
+ 'label' => esc_html__( 'Font Family', 'cartflows' ),
353
+ 'name' => 'wcf-base-font-family',
354
+ 'value' => $options['wcf-base-font-family'],
355
+ )
356
+ );
357
+ ?>
358
+ <div class="wcf-cs-fields">
359
+ <div class="wcf-cs-fields-options">
360
+ <?php
361
+ echo wcf()->meta->get_section(
362
+ array(
363
+ 'label' => __( 'Input Fields', 'cartflows' ),
364
+ )
365
+ );
366
+
367
+ $fields_skin_pro_option = array();
368
+ if ( ! _is_cartflows_pro() ) {
369
+ $fields_skin_pro_option = array(
370
+ 'floating-labels' => __( 'Floating Labels (Available in CartFlows Pro)', 'cartflows' ),
371
+ );
372
+ }
373
+
374
+ echo wcf()->meta->get_select_field(
375
+ array(
376
+ 'label' => __( 'Style', 'cartflows' ),
377
+ 'name' => 'wcf-input-fields-skins',
378
+ 'value' => $options['wcf-input-fields-skins'],
379
+ 'options' => array(
380
+ 'default' => esc_html__( 'Default', 'cartflows' ),
381
+ 'floating-labels' => esc_html__( 'Floating Labels', 'cartflows' ),
382
+ ),
383
+ 'pro-options' => $fields_skin_pro_option,
384
+
385
+ )
386
+ );
387
+
388
+ echo wcf()->meta->get_font_family_field(
389
+ array(
390
+ 'for' => 'wcf-input',
391
+ 'label' => esc_html__( 'Font Family', 'cartflows' ),
392
+ 'name' => 'wcf-input-font-family',
393
+ 'value' => $options['wcf-input-font-family'],
394
+ )
395
+ );
396
+
397
+ echo wcf()->meta->get_font_weight_field(
398
+ array(
399
+ 'for' => 'wcf-input',
400
+ 'label' => esc_html__( 'Font Weight', 'cartflows' ),
401
+ 'name' => 'wcf-input-font-weight',
402
+ 'value' => $options['wcf-input-font-weight'],
403
+ )
404
+ );
405
+
406
+ echo wcf()->meta->get_select_field(
407
+ array(
408
+ 'label' => __( 'Size', 'cartflows' ),
409
+ 'name' => 'wcf-input-field-size',
410
+ 'value' => $options['wcf-input-field-size'],
411
+ 'options' => array(
412
+ '33px' => esc_html__( 'Extra Small', 'cartflows' ),
413
+ '38px' => esc_html__( 'Small', 'cartflows' ),
414
+ '44px' => esc_html__( 'Medium', 'cartflows' ),
415
+ '58px' => esc_html__( 'Large', 'cartflows' ),
416
+ '68px' => esc_html__( 'Extra Large', 'cartflows' ),
417
+ 'custom' => esc_html__( 'Custom', 'cartflows' ),
418
+ ),
419
+ )
420
+ );
421
+
422
+ echo wcf()->meta->get_number_field(
423
+ array(
424
+ 'label' => __( 'Top Bottom Spacing', 'cartflows' ),
425
+ 'name' => 'wcf-field-tb-padding',
426
+ 'value' => $options['wcf-field-tb-padding'],
427
+ )
428
+ );
429
+
430
+ echo wcf()->meta->get_number_field(
431
+ array(
432
+ 'label' => __( 'Left Right Spacing', 'cartflows' ),
433
+ 'name' => 'wcf-field-lr-padding',
434
+ 'value' => $options['wcf-field-lr-padding'],
435
+ )
436
+ );
437
+
438
+ echo wcf()->meta->get_color_picker_field(
439
+ array(
440
+ 'label' => __( 'Label Color', 'cartflows' ),
441
+ 'name' => 'wcf-field-label-color',
442
+ 'value' => $options['wcf-field-label-color'],
443
+ )
444
+ );
445
+
446
+ echo wcf()->meta->get_color_picker_field(
447
+ array(
448
+ 'label' => __( 'Text / Placeholder Color', 'cartflows' ),
449
+ 'name' => 'wcf-field-color',
450
+ 'value' => $options['wcf-field-color'],
451
+ )
452
+ );
453
+
454
+ echo wcf()->meta->get_color_picker_field(
455
+ array(
456
+ 'label' => __( 'Background Color', 'cartflows' ),
457
+ 'name' => 'wcf-field-bg-color',
458
+ 'value' => $options['wcf-field-bg-color'],
459
+ )
460
+ );
461
+
462
+ echo wcf()->meta->get_color_picker_field(
463
+ array(
464
+ 'label' => __( 'Border Color', 'cartflows' ),
465
+ 'name' => 'wcf-field-border-color',
466
+ 'value' => $options['wcf-field-border-color'],
467
+ )
468
+ );
469
+
470
+ ?>
471
+ </div>
472
+ <div class="wcf-cs-button-options">
473
+ <?php
474
+
475
+ echo wcf()->meta->get_section(
476
+ array(
477
+ 'label' => __( 'Submit Button', 'cartflows' ),
478
+ )
479
+ );
480
+
481
+ echo wcf()->meta->get_text_field(
482
+ array(
483
+ 'label' => __( 'Button Text', 'cartflows' ),
484
+ 'name' => 'wcf-submit-button-text',
485
+ 'value' => $options['wcf-submit-button-text'],
486
+ 'attr' => array(
487
+ 'placeholder' => __( 'Submit', 'cartflows' ),
488
+ ),
489
+ )
490
+ );
491
+
492
+ echo wcf()->meta->get_number_field(
493
+ array(
494
+ 'label' => __( 'Font Size', 'cartflows' ),
495
+ 'name' => 'wcf-submit-font-size',
496
+ 'value' => $options['wcf-submit-font-size'],
497
+ )
498
+ );
499
+
500
+ echo wcf()->meta->get_font_family_field(
501
+ array(
502
+ 'for' => 'wcf-button',
503
+ 'label' => esc_html__( 'Font Family', 'cartflows' ),
504
+ 'name' => 'wcf-button-font-family',
505
+ 'value' => $options['wcf-button-font-family'],
506
+ )
507
+ );
508
+
509
+ echo wcf()->meta->get_font_weight_field(
510
+ array(
511
+ 'for' => 'wcf-button',
512
+ 'label' => esc_html__( 'Font Weight', 'cartflows' ),
513
+ 'name' => 'wcf-button-font-weight',
514
+ 'value' => $options['wcf-button-font-weight'],
515
+ )
516
+ );
517
+
518
+ echo wcf()->meta->get_select_field(
519
+ array(
520
+ 'label' => __( 'Size', 'cartflows' ),
521
+ 'name' => 'wcf-submit-button-size',
522
+ 'value' => $options['wcf-submit-button-size'],
523
+ 'options' => array(
524
+ '33px' => esc_html__( 'Extra Small', 'cartflows' ),
525
+ '38px' => esc_html__( 'Small', 'cartflows' ),
526
+ '44px' => esc_html__( 'Medium', 'cartflows' ),
527
+ '58px' => esc_html__( 'Large', 'cartflows' ),
528
+ '68px' => esc_html__( 'Extra Large', 'cartflows' ),
529
+ 'custom' => esc_html__( 'Custom', 'cartflows' ),
530
+ ),
531
+ )
532
+ );
533
+
534
+ echo wcf()->meta->get_number_field(
535
+ array(
536
+ 'label' => __( 'Top Bottom Spacing', 'cartflows' ),
537
+ 'name' => 'wcf-submit-tb-padding',
538
+ 'value' => $options['wcf-submit-tb-padding'],
539
+ )
540
+ );
541
+
542
+ echo wcf()->meta->get_number_field(
543
+ array(
544
+ 'label' => __( 'Left Right Spacing', 'cartflows' ),
545
+ 'name' => 'wcf-submit-lr-padding',
546
+ 'value' => $options['wcf-submit-lr-padding'],
547
+ )
548
+ );
549
+
550
+ echo wcf()->meta->get_select_field(
551
+ array(
552
+ 'label' => __( 'Position', 'cartflows' ),
553
+ 'name' => 'wcf-submit-button-position',
554
+ 'value' => $options['wcf-submit-button-position'],
555
+ 'options' => array(
556
+ 'left' => esc_html__( 'Left', 'cartflows' ),
557
+ 'center' => esc_html__( 'Center', 'cartflows' ),
558
+ 'right' => esc_html__( 'Right', 'cartflows' ),
559
+ ),
560
+ )
561
+ );
562
+
563
+ echo wcf()->meta->get_color_picker_field(
564
+ array(
565
+ 'label' => __( 'Text Color', 'cartflows' ),
566
+ 'name' => 'wcf-submit-color',
567
+ 'value' => $options['wcf-submit-color'],
568
+ )
569
+ );
570
+
571
+ echo wcf()->meta->get_color_picker_field(
572
+ array(
573
+ 'label' => __( 'Text Hover Color', 'cartflows' ),
574
+ 'name' => 'wcf-submit-hover-color',
575
+ 'value' => $options['wcf-submit-hover-color'],
576
+ )
577
+ );
578
+
579
+ echo wcf()->meta->get_color_picker_field(
580
+ array(
581
+ 'label' => __( 'Background Color', 'cartflows' ),
582
+ 'name' => 'wcf-submit-bg-color',
583
+ 'value' => $options['wcf-submit-bg-color'],
584
+ )
585
+ );
586
+
587
+ echo wcf()->meta->get_color_picker_field(
588
+ array(
589
+ 'label' => __( 'Background Hover Color', 'cartflows' ),
590
+ 'name' => 'wcf-submit-bg-hover-color',
591
+ 'value' => $options['wcf-submit-bg-hover-color'],
592
+ )
593
+ );
594
+
595
+ echo wcf()->meta->get_color_picker_field(
596
+ array(
597
+ 'label' => __( 'Border Color', 'cartflows' ),
598
+ 'name' => 'wcf-submit-border-color',
599
+ 'value' => $options['wcf-submit-border-color'],
600
+ )
601
+ );
602
+
603
+ echo wcf()->meta->get_color_picker_field(
604
+ array(
605
+ 'label' => __( 'Border Hover Color', 'cartflows' ),
606
+ 'name' => 'wcf-submit-border-hover-color',
607
+ 'value' => $options['wcf-submit-border-hover-color'],
608
+ )
609
+ );
610
+
611
+ ?>
612
+ </div>
613
+ </div>
614
+ <?php
615
+ echo wcf()->meta->get_hidden_field(
616
+ array(
617
+ 'name' => 'wcf-field-google-font-url',
618
+ 'value' => $options['wcf-field-google-font-url'],
619
+ )
620
+ );
621
+ ?>
622
+ </div>
623
+ <?php
624
+ }
625
+
626
+ /**
627
+ * Get metabox options
628
+ *
629
+ * @param int $post_id post ID.
630
+ */
631
+ public static function get_meta_option( $post_id ) {
632
+
633
+ if ( null === self::$meta_option ) {
634
+
635
+ /**
636
+ * Set metabox options
637
+ *
638
+ * @see http://php.net/manual/en/filter.filters.sanitize.php
639
+ */
640
+ self::$meta_option = wcf()->options->get_optin_fields( $post_id );
641
+ }
642
+
643
+ return self::$meta_option;
644
+ }
645
+
646
+ /**
647
+ * Metabox Save
648
+ *
649
+ * @param number $post_id Post ID.
650
+ * @return void
651
+ */
652
+ public function save_meta_box( $post_id ) {
653
+
654
+ // Checks save status.
655
+ $is_autosave = wp_is_post_autosave( $post_id );
656
+ $is_revision = wp_is_post_revision( $post_id );
657
+
658
+ $is_valid_nonce = ( isset( $_POST['nonce-optin-step-meta'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce-optin-step-meta'] ) ), 'save-nonce-optin-step-meta' ) ) ? true : false;
659
+
660
+ // Exits script depending on save status.
661
+ if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
662
+ return;
663
+ }
664
+
665
+ wcf()->options->save_optin_fields( $post_id );
666
+ }
667
+ }
668
+
669
+ /**
670
+ * Kicking this off by calling 'get_instance()' method
671
+ */
672
+ Cartflows_Optin_Meta::get_instance();
modules/optin/templates/optin-template-simple.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Checkout template
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ $optin_layout = 'one-column';
9
+ $fields_skins = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-fields-skins' );
10
+ ?>
11
+ <div id="wcf-optin-form" class="wcf-optin-form wcf-optin-form-one-column wcf-field-<?php echo $fields_skins; ?>">
12
+
13
+ <!-- CHECKOUT SHORTCODE -->
14
+ <?php do_action( 'cartflows_optin_before_main_section', $optin_layout ); ?>
15
+
16
+ <?php
17
+
18
+ $checkout_html = do_shortcode( '[woocommerce_checkout]' );
19
+
20
+ if (
21
+ empty( $checkout_html ) ||
22
+ trim( $checkout_html ) == '<div class="woocommerce"></div>'
23
+ ) {
24
+
25
+ echo esc_html__( 'Your cart is currently empty.', 'cartflows' );
26
+ } else {
27
+ echo $checkout_html;
28
+ }
29
+ ?>
30
+
31
+ <?php do_action( 'cartflows_optin_after_main_section', $optin_layout ); ?>
32
+ <!-- END CHECKOUT SHORTCODE -->
33
+ </div>
modules/thankyou/classes/class-cartflows-thankyou-markup.php CHANGED
@@ -93,7 +93,15 @@ class Cartflows_Thankyou_Markup {
93
 
94
  $order = false;
95
 
96
- if ( ! isset( $_GET['wcf-order'] ) && wcf()->flow->is_flow_testmode() ) { //phpcs:ignore
 
 
 
 
 
 
 
 
97
  $args = array(
98
  'limit' => 1,
99
  'order' => 'DESC',
@@ -113,13 +121,13 @@ class Cartflows_Thankyou_Markup {
113
  }
114
  }
115
  } else {
116
- if ( ! isset( $_GET['wcf-order'] ) ) { //phpcs:ignore
117
  return '<p class="woocommerce-notice">Order not found. You cannot access this page directly.</p>';
118
  }
119
 
120
  // Get the order.
121
- $order_id = apply_filters( 'woocommerce_thankyou_order_id', empty( $_GET['wcf-order'] ) ? 0 : intval( $_GET['wcf-order'] ) ); //phpcs:ignore
122
- $order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['wcf-key'] ) ? '' : wc_clean( wp_unslash( $_GET['wcf-key'] ) ) ); //phpcs:ignore
123
 
124
  if ( $order_id > 0 ) {
125
  $order = wc_get_order( $order_id );
@@ -228,6 +236,7 @@ class Cartflows_Thankyou_Markup {
228
 
229
  $text_color = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-text-color' );
230
  $text_font_family = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-font-family' );
 
231
  $heading_text_color = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-heading-color' );
232
  $heading_font_family = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-heading-font-family' );
233
  $heading_font_weight = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-heading-font-wt' );
@@ -247,13 +256,15 @@ class Cartflows_Thankyou_Markup {
247
  color: {$text_color};
248
  font-family: {$text_font_family};
249
  max-width:{$container_width}px;
 
250
  }
251
 
252
  .woocommerce-order h2.woocommerce-column__title,
253
  .woocommerce-order h2.woocommerce-order-details__title,
254
  .woocommerce-order .woocommerce-thankyou-order-received,
255
  .woocommerce-order-details h2,
256
- .woocommerce-order h2.wc-bacs-bank-details-heading {
 
257
  color: {$heading_text_color};
258
  font-family: {$heading_font_family};
259
  font-weight: {$heading_font_weight};
@@ -262,7 +273,8 @@ class Cartflows_Thankyou_Markup {
262
  .woocommerce-order ul.order_details,
263
  .woocommerce-order .woocommerce-order-details,
264
  .woocommerce-order .woocommerce-customer-details,
265
- .woocommerce-order .woocommerce-bacs-bank-details{
 
266
  background-color: {$section_bg_color}
267
  }
268
  img.emoji, img.wp-smiley {}
93
 
94
  $order = false;
95
 
96
+ $id_param = 'wcf-order';
97
+ $key_param = 'wcf-key';
98
+
99
+ if ( isset( $_GET['wcf-opt-order'] ) ) { //phpcs:ignore
100
+ $id_param = 'wcf-opt-order';
101
+ $key_param = 'wcf-opt-key';
102
+ }
103
+
104
+ if ( ! isset( $_GET[ $id_param ] ) && wcf()->flow->is_flow_testmode() ) { //phpcs:ignore
105
  $args = array(
106
  'limit' => 1,
107
  'order' => 'DESC',
121
  }
122
  }
123
  } else {
124
+ if ( ! isset( $_GET[ $id_param ] ) ) { //phpcs:ignore
125
  return '<p class="woocommerce-notice">Order not found. You cannot access this page directly.</p>';
126
  }
127
 
128
  // Get the order.
129
+ $order_id = apply_filters( 'woocommerce_thankyou_order_id', empty( $_GET[ $id_param ] ) ? 0 : intval( $_GET[ $id_param ] ) ); //phpcs:ignore
130
+ $order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET[ $key_param ] ) ? '' : wc_clean( wp_unslash( $_GET[ $key_param ] ) ) ); //phpcs:ignore
131
 
132
  if ( $order_id > 0 ) {
133
  $order = wc_get_order( $order_id );
236
 
237
  $text_color = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-text-color' );
238
  $text_font_family = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-font-family' );
239
+ $text_font_size = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-font-size' );
240
  $heading_text_color = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-heading-color' );
241
  $heading_font_family = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-heading-font-family' );
242
  $heading_font_weight = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-heading-font-wt' );
256
  color: {$text_color};
257
  font-family: {$text_font_family};
258
  max-width:{$container_width}px;
259
+ font-size: {$text_font_size}px;
260
  }
261
 
262
  .woocommerce-order h2.woocommerce-column__title,
263
  .woocommerce-order h2.woocommerce-order-details__title,
264
  .woocommerce-order .woocommerce-thankyou-order-received,
265
  .woocommerce-order-details h2,
266
+ .woocommerce-order h2.wc-bacs-bank-details-heading,
267
+ .woocommerce-order h2.woocommerce-order-downloads__title {
268
  color: {$heading_text_color};
269
  font-family: {$heading_font_family};
270
  font-weight: {$heading_font_weight};
273
  .woocommerce-order ul.order_details,
274
  .woocommerce-order .woocommerce-order-details,
275
  .woocommerce-order .woocommerce-customer-details,
276
+ .woocommerce-order .woocommerce-bacs-bank-details,
277
+ .woocommerce-order .woocommerce-order-downloads{
278
  background-color: {$section_bg_color}
279
  }
280
  img.emoji, img.wp-smiley {}
modules/thankyou/classes/class-cartflows-thankyou-meta.php CHANGED
@@ -212,6 +212,14 @@ class Cartflows_Thankyou_Meta extends Cartflows_Meta {
212
  )
213
  );
214
 
 
 
 
 
 
 
 
 
215
  echo wcf()->meta->get_section(
216
  array(
217
  'label' => __( 'Heading', 'cartflows' ),
212
  )
213
  );
214
 
215
+ echo wcf()->meta->get_number_field(
216
+ array(
217
+ 'label' => __( 'Font Size', 'cartflows' ),
218
+ 'name' => 'wcf-tq-font-size',
219
+ 'value' => $options['wcf-tq-font-size'],
220
+ )
221
+ );
222
+
223
  echo wcf()->meta->get_section(
224
  array(
225
  'label' => __( 'Heading', 'cartflows' ),
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === Funnel Builder by CartFlows - Create High Converting Sales Funnels For WordPress ===
2
  Contributors: brainstormforce, wpcrafter
3
  Donate link: https://www.paypal.me/BrainstormForce
4
  Tags: woocommerce, funnel builder, sales funnels, elementor, beaver builder
5
  Requires at least: 4.4
6
  Tested up to: 5.3.2
7
- Stable tag: 1.3.5
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -125,6 +125,14 @@ Glad you asked! CartFlows Pro is an optional add-on to CartFlows that adds addit
125
 
126
  == Changelog ==
127
 
 
 
 
 
 
 
 
 
128
  = Version 1.3.5 - Tuesday, 28th January 2020 =
129
  * New: Option added for thank you page redirection.
130
  * Fix: Pro version's two-step CSS conflict with the DIVI, the second tab was not displaying.
1
+ === Funnel Builder by CartFlows - Create High Converting Sales Funnels For WordPress ===
2
  Contributors: brainstormforce, wpcrafter
3
  Donate link: https://www.paypal.me/BrainstormForce
4
  Tags: woocommerce, funnel builder, sales funnels, elementor, beaver builder
5
  Requires at least: 4.4
6
  Tested up to: 5.3.2
7
+ Stable tag: 1.4.1
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
125
 
126
  == Changelog ==
127
 
128
+ = Version 1.4.1 - Thursday, 13th February 2020 =
129
+ * Fix: Optin step was redirecting to the global checkout.
130
+
131
+ = Version 1.4.0 - Tuesday, 11th February 2020 =
132
+ * New: Introduced a new optin step type for lead generation.
133
+ * Improvement: Added compatibility for a future release of CartFlows Pro.
134
+ * Fix: Fatal Error while editing the page in elementor preview mode if the WooCommerce is not installed.
135
+
136
  = Version 1.3.5 - Tuesday, 28th January 2020 =
137
  * New: Option added for thank you page redirection.
138
  * Fix: Pro version's two-step CSS conflict with the DIVI, the second tab was not displaying.