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

Version Description

Download this release

Release Info

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

Code changes from version 1.3.3 to 1.3.4

Files changed (40) hide show
  1. admin/assets/css/global-admin-rtl.css +88 -1
  2. admin/assets/css/global-admin.css +88 -1
  3. admin/assets/js/global-admin.js +18 -0
  4. assets/css/import-rtl.css +3 -1
  5. assets/css/import.css +3 -1
  6. assets/js/import.js +10 -8
  7. assets/min-js/import.min.js +1 -1
  8. cartflows.php +1 -1
  9. changelog.txt +5 -0
  10. classes/class-cartflows-admin.php +620 -620
  11. classes/class-cartflows-cloning.php +20 -0
  12. classes/class-cartflows-default-meta.php +43 -39
  13. classes/class-cartflows-frontend.php +5 -1
  14. classes/class-cartflows-functions.php +447 -447
  15. classes/class-cartflows-importer.php +1 -1
  16. classes/class-cartflows-learndash-compatibility.php +140 -133
  17. classes/class-cartflows-loader.php +2 -1
  18. classes/class-cartflows-logger.php +183 -183
  19. classes/class-cartflows-meta.php +75 -75
  20. classes/class-cartflows-session.php +245 -245
  21. classes/class-cartflows-wizard.php +679 -679
  22. includes/admin/cartflows-general-bck.php +47 -47
  23. includes/admin/cartflows-general.php +370 -370
  24. includes/exporter.php +23 -23
  25. includes/importer.php +26 -26
  26. languages/cartflows.pot +1813 -1797
  27. modules/checkout/classes/class-cartflows-checkout-markup.php +24 -0
  28. modules/checkout/classes/class-cartflows-checkout-meta.php +15 -1
  29. modules/checkout/templates/embed/checkout-template-simple.php +33 -33
  30. modules/checkout/templates/wcf-template.php +58 -58
  31. modules/flow/classes/class-cartflows-flow-meta.php +780 -780
  32. modules/flow/classes/class-cartflows-flow-post-type.php +383 -334
  33. modules/flow/classes/class-cartflows-permalink.php +159 -159
  34. modules/flow/classes/class-cartflows-step-post-type.php +468 -468
  35. modules/flow/view/meta-flow-steps.php +5 -1
  36. modules/landing/classes/class-cartflows-landing-meta.php +235 -235
  37. modules/thankyou/classes/class-cartflows-thankyou-markup.php +296 -296
  38. modules/thankyou/classes/class-cartflows-thankyou-meta.php +371 -371
  39. modules/widgets/class-cartflows-next-step.php +154 -154
  40. readme.txt +7 -2
admin/assets/css/global-admin-rtl.css CHANGED
@@ -831,6 +831,91 @@ input[type="text"].error:focus{
831
  box-shadow: none;
832
  }
833
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
834
 
835
  /**
836
  * ******************************
@@ -859,4 +944,6 @@ input[type="text"].error:focus{
859
  .wcf-column-right{
860
  width: calc( 100% - 300px );
861
  }
862
- }
 
 
831
  box-shadow: none;
832
  }
833
 
834
+ /**
835
+ * Display upgrade popup custom button
836
+ */
837
+ .wcf-custom-add-new-button.button{
838
+ margin: 10px;
839
+ }
840
+
841
+
842
+ /**
843
+ * Display upgrade popup CSS
844
+ */
845
+
846
+ #cartflows-upgrade-notice-overlay {
847
+ background: #000000b3;
848
+ filter: alpha(opacity=70);
849
+ position: fixed;
850
+ top: 0;
851
+ left: 0;
852
+ bottom: 0;
853
+ right: 0;
854
+ z-index: 100050;
855
+ }
856
+
857
+ #cartflows-upgrade-notice-popup table {
858
+ border: none !important;
859
+ -webkit-box-shadow: none !important;
860
+ box-shadow: none !important;
861
+ }
862
+
863
+ #cartflows-upgrade-notice-popup .inner {
864
+ -webkit-transform: translate(50%, -50%);
865
+ -ms-transform: translate(50%, -50%);
866
+ transform: translate(50%, -50%);
867
+ background: #fff;
868
+ -webkit-box-sizing: border-box;
869
+ -moz-box-sizing: border-box;
870
+ box-sizing: border-box;
871
+ position: fixed;
872
+ background-color: #fff;
873
+ z-index: 100059;
874
+ text-align: right;
875
+ top: 50%;
876
+ right: 50%;
877
+ width: 350px;
878
+ -webkit-box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
879
+ box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
880
+ }
881
+
882
+ #cartflows-upgrade-notice-popup .heading {
883
+ float: right;
884
+ font-weight: 600;
885
+ line-height: 35px;
886
+ overflow: hidden;
887
+ padding: 0px 20px;
888
+ text-overflow: ellipsis;
889
+ white-space: nowrap;
890
+ width: -webkit-calc( 100% - 40px );
891
+ width: calc( 100% - 40px );
892
+ background: #fff;
893
+ font-size: 14px;
894
+ border-bottom: 1px solid #e5e5e5;
895
+ }
896
+ .cartflows-close-popup-button{
897
+ border-right: 1px #eee solid;
898
+ top: 3px;
899
+ }
900
+ .cartflows-close-popup-button:hover{
901
+ cursor: pointer;
902
+ }
903
+
904
+ #cartflows-upgrade-notice-popup .contents {
905
+ clear: both;
906
+ background: #f1f1f1;
907
+ padding: 0px 10px;
908
+ }
909
+
910
+ #cartflows-upgrade-notice-popup .notice {
911
+ margin: 0 20px 5px 20px;
912
+ }
913
+
914
+ #cartflows-upgrade-notice-popup .wcf-notice{
915
+ padding:10px;
916
+ }
917
+
918
+
919
 
920
  /**
921
  * ******************************
944
  .wcf-column-right{
945
  width: calc( 100% - 300px );
946
  }
947
+ }
948
+
949
+
admin/assets/css/global-admin.css CHANGED
@@ -831,6 +831,91 @@ input[type="text"].error:focus{
831
  box-shadow: none;
832
  }
833
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
834
 
835
  /**
836
  * ******************************
@@ -859,4 +944,6 @@ input[type="text"].error:focus{
859
  .wcf-column-right{
860
  width: calc( 100% - 300px );
861
  }
862
- }
 
 
831
  box-shadow: none;
832
  }
833
 
834
+ /**
835
+ * Display upgrade popup custom button
836
+ */
837
+ .wcf-custom-add-new-button.button{
838
+ margin: 10px;
839
+ }
840
+
841
+
842
+ /**
843
+ * Display upgrade popup CSS
844
+ */
845
+
846
+ #cartflows-upgrade-notice-overlay {
847
+ background: #000000b3;
848
+ filter: alpha(opacity=70);
849
+ position: fixed;
850
+ top: 0;
851
+ right: 0;
852
+ bottom: 0;
853
+ left: 0;
854
+ z-index: 100050;
855
+ }
856
+
857
+ #cartflows-upgrade-notice-popup table {
858
+ border: none !important;
859
+ -webkit-box-shadow: none !important;
860
+ box-shadow: none !important;
861
+ }
862
+
863
+ #cartflows-upgrade-notice-popup .inner {
864
+ -webkit-transform: translate(-50%, -50%);
865
+ -ms-transform: translate(-50%, -50%);
866
+ transform: translate(-50%, -50%);
867
+ background: #fff;
868
+ -webkit-box-sizing: border-box;
869
+ -moz-box-sizing: border-box;
870
+ box-sizing: border-box;
871
+ position: fixed;
872
+ background-color: #fff;
873
+ z-index: 100059;
874
+ text-align: left;
875
+ top: 50%;
876
+ left: 50%;
877
+ width: 350px;
878
+ -webkit-box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
879
+ box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
880
+ }
881
+
882
+ #cartflows-upgrade-notice-popup .heading {
883
+ float: left;
884
+ font-weight: 600;
885
+ line-height: 35px;
886
+ overflow: hidden;
887
+ padding: 0px 20px;
888
+ text-overflow: ellipsis;
889
+ white-space: nowrap;
890
+ width: -webkit-calc( 100% - 40px );
891
+ width: calc( 100% - 40px );
892
+ background: #fff;
893
+ font-size: 14px;
894
+ border-bottom: 1px solid #e5e5e5;
895
+ }
896
+ .cartflows-close-popup-button{
897
+ border-left: 1px #eee solid;
898
+ top: 3px;
899
+ }
900
+ .cartflows-close-popup-button:hover{
901
+ cursor: pointer;
902
+ }
903
+
904
+ #cartflows-upgrade-notice-popup .contents {
905
+ clear: both;
906
+ background: #f1f1f1;
907
+ padding: 0px 10px;
908
+ }
909
+
910
+ #cartflows-upgrade-notice-popup .notice {
911
+ margin: 0 20px 5px 20px;
912
+ }
913
+
914
+ #cartflows-upgrade-notice-popup .wcf-notice{
915
+ padding:10px;
916
+ }
917
+
918
+
919
 
920
  /**
921
  * ******************************
944
  .wcf-column-right{
945
  width: calc( 100% - 300px );
946
  }
947
+ }
948
+
949
+
admin/assets/js/global-admin.js CHANGED
@@ -136,6 +136,22 @@
136
  }
137
  }
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  $( document ).ready(function() {
140
  //alert("Before Stattement");
141
  $( '#field-wcf-shortcode' ).appendTo( '#wcf-checkout-settings .hndle span' );
@@ -153,6 +169,8 @@
153
  highlight_the_metabox();
154
 
155
  wcf_toggle_post_update();
 
 
156
 
157
  });
158
 
136
  }
137
  }
138
 
139
+ function show_upgrade_to_pro_popup(){
140
+
141
+ $('.wcf-custom-add-new-button').click(function(){
142
+ $('#cartflows-upgrade-notice-popup').show();
143
+ $('#cartflows-upgrade-notice-overlay').show();
144
+ });
145
+ $('.cartflows-close-popup-button').click(function(){
146
+ $('#cartflows-upgrade-notice-popup').hide();
147
+ $('#cartflows-upgrade-notice-overlay').hide();
148
+ });
149
+ $('#cartflows-upgrade-notice-overlay').click(function(){
150
+ $('#cartflows-upgrade-notice-popup').hide();
151
+ $('#cartflows-upgrade-notice-overlay').hide();
152
+ });
153
+ }
154
+
155
  $( document ).ready(function() {
156
  //alert("Before Stattement");
157
  $( '#field-wcf-shortcode' ).appendTo( '#wcf-checkout-settings .hndle span' );
169
  highlight_the_metabox();
170
 
171
  wcf_toggle_post_update();
172
+
173
+ show_upgrade_to_pro_popup();
174
 
175
  });
176
 
assets/css/import-rtl.css CHANGED
@@ -1077,4 +1077,6 @@ html.wcf-popup-open{
1077
 
1078
  .wcf-hidden{
1079
  display: none;
1080
- }
 
 
1077
 
1078
  .wcf-hidden{
1079
  display: none;
1080
+ }
1081
+
1082
+
assets/css/import.css CHANGED
@@ -1077,4 +1077,6 @@ html.wcf-popup-open{
1077
 
1078
  .wcf-hidden{
1079
  display: none;
1080
- }
 
 
1077
 
1078
  .wcf-hidden{
1079
  display: none;
1080
+ }
1081
+
1082
+
assets/js/import.js CHANGED
@@ -1322,6 +1322,7 @@ var CartFlowsAjaxQueue = (function() {
1322
  step_type = step_slug,
1323
  step_count = $('.wcf-step-wrap[data-term-slug="'+step_slug+'"]').length || 1,
1324
  step_custom_title = step_title + ' ' + ( parseInt( step_count ) + 1 );
 
1325
 
1326
  $('#wcf-start-from-scratch .wcf-notice-wrap ').remove();
1327
 
@@ -1338,17 +1339,17 @@ var CartFlowsAjaxQueue = (function() {
1338
 
1339
  if ( ! CartFlowsImportVars._is_pro_active ) {
1340
 
1341
- if ( 'checkout' === step_type ) {
1342
- var checkout_steps = $( '.wcf-step-wrap[data-term-slug="checkout"]');
1343
 
1344
- if ( 0 < checkout_steps.length ) {
1345
 
1346
  var parent_template = btn.parents('.template.importing');
1347
 
1348
  btn.removeClass('importing updating-message')
1349
  .text('Import Failed!');
1350
 
1351
- $('#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 Checkout step.</p></div></div>' );
1352
 
1353
  return;
1354
  }
@@ -1410,14 +1411,15 @@ var CartFlowsAjaxQueue = (function() {
1410
  step_title = btn.data('title') || '',
1411
  step_custom_title = step_title + ' ' + ( parseInt( step_count ) + 1 ),
1412
  self = CartFlowsImport;
 
1413
 
1414
  if ( ! CartFlowsImportVars._is_pro_active ) {
1415
 
1416
- if ( 'checkout' === step_slug ) {
1417
 
1418
- var checkout_steps = $( '.wcf-step-wrap[data-term-slug="checkout"]');
1419
 
1420
- if ( 0 < checkout_steps.length ) {
1421
 
1422
  var parent_template = btn.parents('.template');
1423
 
@@ -1430,7 +1432,7 @@ var CartFlowsAjaxQueue = (function() {
1430
 
1431
  notice_wrap.find('a')
1432
  .addClass('notice notice-warning ')
1433
- .text ( 'Upgrade to Pro for adding more than one Checkout step' );
1434
 
1435
  $('#wcf-remote-step-importer').removeClass('request-process');
1436
  return;
1322
  step_type = step_slug,
1323
  step_count = $('.wcf-step-wrap[data-term-slug="'+step_slug+'"]').length || 1,
1324
  step_custom_title = step_title + ' ' + ( parseInt( step_count ) + 1 );
1325
+ all_step_type = [ 'landing', 'checkout', 'thankyou' ];
1326
 
1327
  $('#wcf-start-from-scratch .wcf-notice-wrap ').remove();
1328
 
1339
 
1340
  if ( ! CartFlowsImportVars._is_pro_active ) {
1341
 
1342
+ if ( jQuery.inArray( step_type, all_step_type ) != '-1' ) {
1343
+ var current_steps = $( '.wcf-step-wrap[data-term-slug="'+step_type+'"]');
1344
 
1345
+ if ( 0 < current_steps.length ) {
1346
 
1347
  var parent_template = btn.parents('.template.importing');
1348
 
1349
  btn.removeClass('importing updating-message')
1350
  .text('Import Failed!');
1351
 
1352
+ $('#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 '+step_type.charAt(0).toUpperCase()+step_type.slice(1)+' step.</p></div></div>' );
1353
 
1354
  return;
1355
  }
1411
  step_title = btn.data('title') || '',
1412
  step_custom_title = step_title + ' ' + ( parseInt( step_count ) + 1 ),
1413
  self = CartFlowsImport;
1414
+ all_step_slug = [ 'landing', 'checkout', 'thankyou' ];
1415
 
1416
  if ( ! CartFlowsImportVars._is_pro_active ) {
1417
 
1418
+ if ( jQuery.inArray( step_slug, all_step_slug ) != '-1' ) {
1419
 
1420
+ var current_step_slug = $( '.wcf-step-wrap[data-term-slug="'+step_slug+'"]');
1421
 
1422
+ if ( 0 < current_step_slug.length ) {
1423
 
1424
  var parent_template = btn.parents('.template');
1425
 
1432
 
1433
  notice_wrap.find('a')
1434
  .addClass('notice notice-warning ')
1435
+ .text ( 'Upgrade to Pro for adding more than one '+step_slug.charAt(0).toUpperCase()+step_slug.slice(1)+' step' );
1436
 
1437
  $('#wcf-remote-step-importer').removeClass('request-process');
1438
  return;
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(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("checkout"===l)if(0<c('.wcf-step-wrap[data-term-slug="checkout"]').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 Checkout 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,!CartFlowsImportVars._is_pro_active)&&("checkout"===e&&0<c('.wcf-step-wrap[data-term-slug="checkout"]').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 Checkout 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 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);
cartflows.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: CartFlows
4
  * Plugin URI: https://cartflows.com/
5
  * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
- * Version: 1.3.3
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: cartflows
3
  * Plugin Name: CartFlows
4
  * Plugin URI: https://cartflows.com/
5
  * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
+ * Version: 1.3.4
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: cartflows
changelog.txt CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  Version 1.3.3 - Thursday, 26th December 2019
2
  - Improvement: Added filter `cartflows_global_checkout_url` for global checkout.
3
  - Fix: Thrive's split test option was not displaying in some cases.
1
+ Version 1.3.4 - Tuesday, 14th January 2020
2
+ - New: Option added to change order button text for each flow.
3
+ - Improvement: WooCommerce Google Analytics Integration plugin's compatibility added.
4
+ - Fix: LearnDash deprecated function notice.
5
+
6
  Version 1.3.3 - Thursday, 26th December 2019
7
  - Improvement: Added filter `cartflows_global_checkout_url` for global checkout.
8
  - Fix: Thrive's split test option was not displaying in some cases.
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'] ) {
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'] ) ) : '';
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'] ) ) : '';
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'] ) {
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'] ) ) : '';
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'] ) ) : '';
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-cloning.php CHANGED
@@ -421,6 +421,26 @@ class Cartflows_Cloning {
421
  }
422
 
423
  $actions['clone'] = '<a href="' . wp_nonce_url( 'admin.php?action=cartflows_clone_flow&post=' . $post->ID, basename( __FILE__ ), 'flow_clone_nonce' ) . '" title="' . __( 'Clone this flow', 'cartflows' ) . '" rel="permalink">' . __( 'Clone', 'cartflows' ) . '</a>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
424
  }
425
 
426
  return $actions;
421
  }
422
 
423
  $actions['clone'] = '<a href="' . wp_nonce_url( 'admin.php?action=cartflows_clone_flow&post=' . $post->ID, basename( __FILE__ ), 'flow_clone_nonce' ) . '" title="' . __( 'Clone this flow', 'cartflows' ) . '" rel="permalink">' . __( 'Clone', 'cartflows' ) . '</a>';
424
+
425
+ if ( ! _is_cartflows_pro() ) {
426
+
427
+ $flow_posts = get_posts(
428
+ array(
429
+ 'posts_per_page' => 4,
430
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
431
+ 'post_status' => array( 'publish', 'pending', 'draft', 'future', 'private', 'inherit', 'trash' ),
432
+ )
433
+ );
434
+
435
+ if ( is_array( $flow_posts ) ) {
436
+
437
+ $flow_count = count( $flow_posts );
438
+
439
+ if ( $flow_count > 3 || 3 === $flow_count ) {
440
+ unset( $actions['clone'] );
441
+ }
442
+ }
443
+ }
444
  }
445
 
446
  return $actions;
classes/class-cartflows-default-meta.php CHANGED
@@ -75,159 +75,163 @@ class Cartflows_Default_Meta {
75
 
76
  if ( null === self::$checkout_fields ) {
77
  self::$checkout_fields = array(
78
- 'wcf-field-google-font-url' => array(
79
  'default' => '',
80
  'sanitize' => 'FILTER_DEFAULT',
81
  ),
82
- 'wcf-checkout-products' => array(
83
  'default' => array(),
84
  'sanitize' => 'FILTER_CARTFLOWS_CHECKOUT_PRODUCTS',
85
  ),
86
- 'wcf-checkout-layout' => array(
87
  'default' => 'two-column',
88
  'sanitize' => 'FILTER_DEFAULT',
89
  ),
90
- 'wcf-input-font-family' => array(
 
 
 
 
91
  'default' => '',
92
  'sanitize' => 'FILTER_DEFAULT',
93
  ),
94
- 'wcf-input-font-weight' => array(
95
  'default' => '',
96
  'sanitize' => 'FILTER_DEFAULT',
97
  ),
98
- 'wcf-heading-font-family' => array(
99
  'default' => '',
100
  'sanitize' => 'FILTER_DEFAULT',
101
  ),
102
- 'wcf-heading-font-weight' => array(
103
  'default' => '',
104
  'sanitize' => 'FILTER_DEFAULT',
105
  ),
106
- 'wcf-base-font-family' => array(
107
  'default' => '',
108
  'sanitize' => 'FILTER_DEFAULT',
109
  ),
110
- 'wcf-advance-options-fields' => array(
111
  'default' => '',
112
  'sanitize' => 'FILTER_DEFAULT',
113
  ),
114
- 'wcf-remove-product-field' => array(
115
  'default' => '',
116
  'sanitize' => 'FILTER_DEFAULT',
117
  ),
118
- 'wcf-base-font-weight' => array(
119
  'default' => '',
120
  'sanitize' => 'FILTER_DEFAULT',
121
  ),
122
- 'wcf-button-font-family' => array(
123
  'default' => '',
124
  'sanitize' => 'FILTER_DEFAULT',
125
  ),
126
- 'wcf-button-font-weight' => array(
127
  'default' => '',
128
  'sanitize' => 'FILTER_DEFAULT',
129
  ),
130
- 'wcf-primary-color' => array(
131
  'default' => '',
132
  'sanitize' => 'FILTER_DEFAULT',
133
  ),
134
- 'wcf-heading-color' => array(
135
  'default' => '',
136
  'sanitize' => 'FILTER_DEFAULT',
137
  ),
138
- 'wcf-section-bg-color' => array(
139
  'default' => '',
140
  'sanitize' => 'FILTER_DEFAULT',
141
  ),
142
- 'wcf-hl-bg-color' => array(
143
  'default' => '',
144
  'sanitize' => 'FILTER_DEFAULT',
145
  ),
146
- 'wcf-field-tb-padding' => array(
147
  'default' => '',
148
  'sanitize' => 'FILTER_DEFAULT',
149
  ),
150
- 'wcf-field-lr-padding' => array(
151
  'default' => '',
152
  'sanitize' => 'FILTER_DEFAULT',
153
  ),
154
- 'wcf-fields-skins' => array(
155
  'default' => '',
156
  'sanitize' => 'FILTER_DEFAULT',
157
  ),
158
- 'wcf-input-field-size' => array(
159
  'default' => '33px',
160
  'sanitize' => 'FILTER_DEFAULT',
161
  ),
162
- 'wcf-field-color' => array(
163
  'default' => '',
164
  'sanitize' => 'FILTER_DEFAULT',
165
  ),
166
- 'wcf-field-bg-color' => array(
167
  'default' => '',
168
  'sanitize' => 'FILTER_DEFAULT',
169
  ),
170
- 'wcf-field-border-color' => array(
171
  'default' => '',
172
  'sanitize' => 'FILTER_DEFAULT',
173
  ),
174
- 'wcf-box-border-color' => array(
175
  'default' => '',
176
  'sanitize' => 'FILTER_DEFAULT',
177
  ),
178
- 'wcf-field-label-color' => array(
179
  'default' => '',
180
  'sanitize' => 'FILTER_DEFAULT',
181
  ),
182
- 'wcf-submit-tb-padding' => array(
183
  'default' => '',
184
  'sanitize' => 'FILTER_DEFAULT',
185
  ),
186
- 'wcf-submit-lr-padding' => array(
187
  'default' => '',
188
  'sanitize' => 'FILTER_DEFAULT',
189
  ),
190
- 'wcf-input-button-size' => array(
191
  'default' => '33px',
192
  'sanitize' => 'FILTER_DEFAULT',
193
  ),
194
- 'wcf-submit-color' => array(
195
  'default' => '',
196
  'sanitize' => 'FILTER_DEFAULT',
197
  ),
198
- 'wcf-submit-hover-color' => array(
199
  'default' => '',
200
  'sanitize' => 'FILTER_DEFAULT',
201
  ),
202
- 'wcf-submit-bg-color' => array(
203
  'default' => '',
204
  'sanitize' => 'FILTER_DEFAULT',
205
  ),
206
- 'wcf-submit-bg-hover-color' => array(
207
  'default' => '',
208
  'sanitize' => 'FILTER_DEFAULT',
209
  ),
210
- 'wcf-submit-border-color' => array(
211
  'default' => '',
212
  'sanitize' => 'FILTER_DEFAULT',
213
  ),
214
- 'wcf-submit-border-hover-color' => array(
215
  'default' => '',
216
  'sanitize' => 'FILTER_DEFAULT',
217
  ),
218
- 'wcf-active-tab' => array(
219
  'default' => '',
220
  'sanitize' => 'FILTER_DEFAULT',
221
  ),
222
- 'wcf-header-logo-image' => array(
223
  'default' => '',
224
  'sanitize' => 'FILTER_DEFAULT',
225
  ),
226
- 'wcf-header-logo-width' => array(
227
  'default' => '',
228
  'sanitize' => 'FILTER_DEFAULT',
229
  ),
230
- 'wcf-custom-script' => array(
231
  'default' => '',
232
  'sanitize' => 'FILTER_DEFAULT',
233
  ),
75
 
76
  if ( null === self::$checkout_fields ) {
77
  self::$checkout_fields = array(
78
+ 'wcf-field-google-font-url' => array(
79
  'default' => '',
80
  'sanitize' => 'FILTER_DEFAULT',
81
  ),
82
+ 'wcf-checkout-products' => array(
83
  'default' => array(),
84
  'sanitize' => 'FILTER_CARTFLOWS_CHECKOUT_PRODUCTS',
85
  ),
86
+ 'wcf-checkout-layout' => array(
87
  'default' => 'two-column',
88
  'sanitize' => 'FILTER_DEFAULT',
89
  ),
90
+ 'wcf-input-font-family' => array(
91
+ 'default' => '',
92
+ 'sanitize' => 'FILTER_DEFAULT',
93
+ ),
94
+ 'wcf-input-font-weight' => array(
95
  'default' => '',
96
  'sanitize' => 'FILTER_DEFAULT',
97
  ),
98
+ 'wcf-heading-font-family' => array(
99
  'default' => '',
100
  'sanitize' => 'FILTER_DEFAULT',
101
  ),
102
+ 'wcf-heading-font-weight' => array(
103
  'default' => '',
104
  'sanitize' => 'FILTER_DEFAULT',
105
  ),
106
+ 'wcf-base-font-family' => array(
107
  'default' => '',
108
  'sanitize' => 'FILTER_DEFAULT',
109
  ),
110
+ 'wcf-advance-options-fields' => array(
111
  'default' => '',
112
  'sanitize' => 'FILTER_DEFAULT',
113
  ),
114
+ 'wcf-remove-product-field' => array(
115
  'default' => '',
116
  'sanitize' => 'FILTER_DEFAULT',
117
  ),
118
+ 'wcf-checkout-place-order-button-text' => array(
119
  'default' => '',
120
  'sanitize' => 'FILTER_DEFAULT',
121
  ),
122
+ 'wcf-base-font-weight' => array(
123
  'default' => '',
124
  'sanitize' => 'FILTER_DEFAULT',
125
  ),
126
+ 'wcf-button-font-family' => array(
127
  'default' => '',
128
  'sanitize' => 'FILTER_DEFAULT',
129
  ),
130
+ 'wcf-button-font-weight' => array(
131
  'default' => '',
132
  'sanitize' => 'FILTER_DEFAULT',
133
  ),
134
+ 'wcf-primary-color' => array(
135
  'default' => '',
136
  'sanitize' => 'FILTER_DEFAULT',
137
  ),
138
+ 'wcf-heading-color' => array(
139
  'default' => '',
140
  'sanitize' => 'FILTER_DEFAULT',
141
  ),
142
+ 'wcf-section-bg-color' => array(
143
  'default' => '',
144
  'sanitize' => 'FILTER_DEFAULT',
145
  ),
146
+ 'wcf-hl-bg-color' => array(
147
  'default' => '',
148
  'sanitize' => 'FILTER_DEFAULT',
149
  ),
150
+ 'wcf-field-tb-padding' => array(
151
  'default' => '',
152
  'sanitize' => 'FILTER_DEFAULT',
153
  ),
154
+ 'wcf-field-lr-padding' => array(
155
  'default' => '',
156
  'sanitize' => 'FILTER_DEFAULT',
157
  ),
158
+ 'wcf-fields-skins' => array(
159
  'default' => '',
160
  'sanitize' => 'FILTER_DEFAULT',
161
  ),
162
+ 'wcf-input-field-size' => array(
163
  'default' => '33px',
164
  'sanitize' => 'FILTER_DEFAULT',
165
  ),
166
+ 'wcf-field-color' => array(
167
  'default' => '',
168
  'sanitize' => 'FILTER_DEFAULT',
169
  ),
170
+ 'wcf-field-bg-color' => array(
171
  'default' => '',
172
  'sanitize' => 'FILTER_DEFAULT',
173
  ),
174
+ 'wcf-field-border-color' => array(
175
  'default' => '',
176
  'sanitize' => 'FILTER_DEFAULT',
177
  ),
178
+ 'wcf-box-border-color' => array(
179
  'default' => '',
180
  'sanitize' => 'FILTER_DEFAULT',
181
  ),
182
+ 'wcf-field-label-color' => array(
183
  'default' => '',
184
  'sanitize' => 'FILTER_DEFAULT',
185
  ),
186
+ 'wcf-submit-tb-padding' => array(
187
  'default' => '',
188
  'sanitize' => 'FILTER_DEFAULT',
189
  ),
190
+ 'wcf-submit-lr-padding' => array(
191
  'default' => '',
192
  'sanitize' => 'FILTER_DEFAULT',
193
  ),
194
+ 'wcf-input-button-size' => array(
195
  'default' => '33px',
196
  'sanitize' => 'FILTER_DEFAULT',
197
  ),
198
+ 'wcf-submit-color' => array(
199
  'default' => '',
200
  'sanitize' => 'FILTER_DEFAULT',
201
  ),
202
+ 'wcf-submit-hover-color' => array(
203
  'default' => '',
204
  'sanitize' => 'FILTER_DEFAULT',
205
  ),
206
+ 'wcf-submit-bg-color' => array(
207
  'default' => '',
208
  'sanitize' => 'FILTER_DEFAULT',
209
  ),
210
+ 'wcf-submit-bg-hover-color' => array(
211
  'default' => '',
212
  'sanitize' => 'FILTER_DEFAULT',
213
  ),
214
+ 'wcf-submit-border-color' => array(
215
  'default' => '',
216
  'sanitize' => 'FILTER_DEFAULT',
217
  ),
218
+ 'wcf-submit-border-hover-color' => array(
219
  'default' => '',
220
  'sanitize' => 'FILTER_DEFAULT',
221
  ),
222
+ 'wcf-active-tab' => array(
223
  'default' => '',
224
  'sanitize' => 'FILTER_DEFAULT',
225
  ),
226
+ 'wcf-header-logo-image' => array(
227
  'default' => '',
228
  'sanitize' => 'FILTER_DEFAULT',
229
  ),
230
+ 'wcf-header-logo-width' => array(
231
  'default' => '',
232
  'sanitize' => 'FILTER_DEFAULT',
233
  ),
234
+ 'wcf-custom-script' => array(
235
  'default' => '',
236
  'sanitize' => 'FILTER_DEFAULT',
237
  ),
classes/class-cartflows-frontend.php CHANGED
@@ -246,7 +246,7 @@ class Cartflows_Frontend {
246
  public function set_flow_session() {
247
 
248
  if ( wcf()->utils->is_step_post_type() ) {
249
-
250
  add_action( 'wp_head', array( $this, 'noindex_flow' ) );
251
 
252
  wcf()->utils->do_not_cache();
@@ -262,6 +262,10 @@ class Cartflows_Frontend {
262
  $_REQUEST['order'] = sanitize_text_field( wp_unslash( $_GET['wcf-order'] ) );
263
  $_GET['order-received'] = sanitize_text_field( wp_unslash( $_GET['wcf-order'] ) );
264
  $_REQUEST['order-received'] = sanitize_text_field( wp_unslash( $_GET['wcf-order'] ) );
 
 
 
 
265
  }
266
  }
267
  }
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();
262
  $_REQUEST['order'] = sanitize_text_field( wp_unslash( $_GET['wcf-order'] ) );
263
  $_GET['order-received'] = sanitize_text_field( wp_unslash( $_GET['wcf-order'] ) );
264
  $_REQUEST['order-received'] = sanitize_text_field( wp_unslash( $_GET['wcf-order'] ) );
265
+
266
+ if ( _is_wcf_thankyou_type() ) {
267
+ $wp->set_query_var( 'order-received', intval( wp_unslash( $_GET['wcf-order'] ) ) );
268
+ }
269
  }
270
  }
271
  }
classes/class-cartflows-functions.php CHANGED
@@ -1,447 +1,447 @@
1
- <?php
2
- /**
3
- * CartFlows Functions.
4
- *
5
- * @package CARTFLOWS
6
- */
7
-
8
- if ( ! defined( 'ABSPATH' ) ) {
9
- exit; // Exit if accessed directly.
10
- }
11
-
12
- /**
13
- * Fatal error mb_strpos fallback.
14
- *
15
- * @param string $string string where to find.
16
- * @param string $search string to search.
17
- * @since 1.0.0
18
- */
19
- function wcf_mb_strpos( $string, $search ) {
20
-
21
- if ( function_exists( 'mb_strpos' ) ) {
22
- return mb_strpos( $string, $search, 0, 'utf-8' );
23
- } else {
24
- return strpos( $string, $search );
25
- }
26
- }
27
-
28
- /**
29
- * Check if cartflows pro activated.
30
- *
31
- * @since 1.0.0
32
- */
33
- function _is_cartflows_pro() {
34
-
35
- if ( defined( 'CARTFLOWS_PRO_FILE' ) ) {
36
- return true;
37
- }
38
-
39
- return false;
40
-
41
- }
42
-
43
- /**
44
- * Returns pro version number.
45
- *
46
- * @param int $version version number.
47
- * @since 1.0.0
48
- */
49
- function _is_cartflows_pro_ver_less_than( $version ) {
50
-
51
- if ( defined( 'CARTFLOWS_PRO_VER' ) && version_compare( CARTFLOWS_PRO_VER, $version, '<' ) ) {
52
- return true;
53
- }
54
-
55
- return false;
56
- }
57
-
58
- /**
59
- * Returns step id.
60
- *
61
- * @since 1.0.0
62
- */
63
- function _get_wcf_post_id() {
64
-
65
- global $post;
66
-
67
- if ( isset( $post->ID ) ) {
68
- return $post->ID;
69
- }
70
-
71
- return 0;
72
- }
73
-
74
- /**
75
- * Returns step id.
76
- *
77
- * @since 1.0.0
78
- */
79
- function _get_wcf_step_id() {
80
-
81
- if ( wcf()->utils->is_step_post_type() ) {
82
-
83
- global $post;
84
-
85
- return $post->ID;
86
- }
87
-
88
- return false;
89
- }
90
-
91
- /**
92
- * Check if it is a landing page?
93
- *
94
- * @since 1.0.0
95
- */
96
- function _is_wcf_landing_type() {
97
-
98
- if ( wcf()->utils->is_step_post_type() ) {
99
-
100
- global $post;
101
-
102
- if ( 'landing' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
103
-
104
- return true;
105
- }
106
- }
107
-
108
- return false;
109
- }
110
-
111
- /**
112
- * Returns landing id.
113
- *
114
- * @since 1.0.0
115
- */
116
- function _get_wcf_landing_id() {
117
-
118
- if ( _is_wcf_landing_type() ) {
119
-
120
- global $post;
121
-
122
- return $post->ID;
123
- }
124
-
125
- return false;
126
- }
127
-
128
- /**
129
- * Is custom checkout?
130
- *
131
- * @param int $checkout_id checkout ID.
132
- * @since 1.0.0
133
- */
134
- function _is_wcf_meta_custom_checkout( $checkout_id ) {
135
-
136
- $is_custom = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-custom-checkout-fields' );
137
-
138
- if ( 'yes' === $is_custom ) {
139
-
140
- return true;
141
- }
142
-
143
- return false;
144
- }
145
-
146
- /**
147
- * Check if page is cartflow checkout.
148
- *
149
- * @since 1.0.0
150
- * @return bool
151
- */
152
- function _is_wcf_checkout_type() {
153
-
154
- if ( wcf()->utils->is_step_post_type() ) {
155
-
156
- global $post;
157
-
158
- if ( 'checkout' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
159
-
160
- return true;
161
- }
162
- }
163
-
164
- return false;
165
- }
166
-
167
- /**
168
- * Check if AJAX call is in progress.
169
- *
170
- * @since 1.0.0
171
- * @return bool
172
- */
173
- function _is_wcf_doing_checkout_ajax() {
174
-
175
- if ( wp_doing_ajax() ) {
176
-
177
- if ( isset( $_GET['wc-ajax'] ) &&
178
- 'checkout' === $_GET['wc-ajax'] &&
179
- isset( $_POST['_wcf_checkout_id'] )
180
- ) {
181
- return true;
182
- }
183
- }
184
-
185
- return false;
186
- }
187
-
188
-
189
- /**
190
- * Returns checkout ID.
191
- *
192
- * @since 1.0.0
193
- * @return int/bool
194
- */
195
- function _get_wcf_checkout_id() {
196
-
197
- if ( _is_wcf_checkout_type() ) {
198
-
199
- global $post;
200
-
201
- return $post->ID;
202
- }
203
-
204
- return false;
205
- }
206
-
207
- /**
208
- * Check if it is checkout shortcode.
209
- *
210
- * @since 1.0.0
211
- * @return bool
212
- */
213
- function _is_wcf_checkout_shortcode() {
214
-
215
- global $post;
216
-
217
- if ( ! empty( $post ) && has_shortcode( $post->post_content, 'cartflows_checkout' ) ) {
218
-
219
- return true;
220
- }
221
-
222
- return false;
223
- }
224
-
225
- /**
226
- * Check if it is checkout shortcode.
227
- *
228
- * @since 1.0.0
229
- * @param string $content shortcode content.
230
- * @return bool
231
- */
232
- function _get_wcf_checkout_id_from_shortcode( $content = '' ) {
233
-
234
- $checkout_id = 0;
235
-
236
- if ( ! empty( $content ) ) {
237
-
238
- $regex_pattern = get_shortcode_regex( array( 'cartflows_checkout' ) );
239
-
240
- preg_match( '/' . $regex_pattern . '/s', $content, $regex_matches );
241
-
242
- if ( ! empty( $regex_matches ) ) {
243
-
244
- if ( 'cartflows_checkout' == $regex_matches[2] ) {
245
-
246
- $attribure_str = str_replace( ' ', '&', trim( $regex_matches[3] ) );
247
- $attribure_str = str_replace( '"', '', $attribure_str );
248
-
249
- $attributes = wp_parse_args( $attribure_str );
250
-
251
- if ( isset( $attributes['id'] ) ) {
252
- $checkout_id = $attributes['id'];
253
- }
254
- }
255
- }
256
- }
257
-
258
- return $checkout_id;
259
- }
260
-
261
- /**
262
- * Check if post type is upsell.
263
- *
264
- * @since 1.0.0
265
- * @return bool
266
- */
267
- function _is_wcf_upsell_type() {
268
-
269
- if ( wcf()->utils->is_step_post_type() ) {
270
-
271
- global $post;
272
-
273
- if ( 'upsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
274
-
275
- return true;
276
- }
277
- }
278
-
279
- return false;
280
- }
281
-
282
- /**
283
- * Returns upsell ID.
284
- *
285
- * @since 1.0.0
286
- * @return int/bool
287
- */
288
- function _get_wcf_upsell_id() {
289
-
290
- if ( _is_wcf_upsell_type() ) {
291
-
292
- global $post;
293
-
294
- return $post->ID;
295
- }
296
-
297
- return false;
298
- }
299
-
300
- /**
301
- * Check if post is of type downsell.
302
- *
303
- * @since 1.0.0
304
- * @return int/bool
305
- */
306
- function _is_wcf_downsell_type() {
307
-
308
- if ( wcf()->utils->is_step_post_type() ) {
309
-
310
- global $post;
311
-
312
- if ( 'downsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
313
-
314
- return true;
315
- }
316
- }
317
-
318
- return false;
319
- }
320
-
321
- /**
322
- * Get downsell page ID.
323
- *
324
- * @since 1.0.0
325
- * @return int/bool
326
- */
327
- function _get_wcf_downsell_id() {
328
-
329
- if ( _is_wcf_downsell_type() ) {
330
-
331
- global $post;
332
-
333
- return $post->ID;
334
- }
335
-
336
- return false;
337
- }
338
-
339
- /**
340
- * Check if page is of thank you type.
341
- *
342
- * @since 1.0.0
343
- * @return int/bool
344
- */
345
- function _is_wcf_thankyou_type() {
346
-
347
- if ( wcf()->utils->is_step_post_type() ) {
348
-
349
- global $post;
350
-
351
- if ( 'thankyou' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
352
-
353
- return true;
354
- }
355
- }
356
-
357
- return false;
358
- }
359
-
360
- /**
361
- * Get thank you page ID.
362
- *
363
- * @since 1.0.0
364
- * @return int/bool
365
- */
366
- function _get_wcf_thankyou_id() {
367
-
368
- if ( _is_wcf_thankyou_type() ) {
369
-
370
- global $post;
371
-
372
- return $post->ID;
373
- }
374
-
375
- return false;
376
- }
377
-
378
-
379
- /**
380
- * Check if post type is upsell.
381
- *
382
- * @since 1.0.0
383
- * @return bool
384
- */
385
- function _is_wcf_base_offer_type() {
386
-
387
- if ( wcf()->utils->is_step_post_type() ) {
388
-
389
- global $post;
390
-
391
- $step_type = get_post_meta( $post->ID, 'wcf-step-type', true );
392
-
393
- if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
394
-
395
- return true;
396
- }
397
- }
398
-
399
- return false;
400
- }
401
-
402
- /**
403
- * Returns upsell ID.
404
- *
405
- * @since 1.0.0
406
- * @return int/bool
407
- */
408
- function _get_wcf_base_offer_id() {
409
-
410
- if ( _is_wcf_base_offer_type() ) {
411
-
412
- global $post;
413
-
414
- return $post->ID;
415
- }
416
-
417
- return false;
418
- }
419
-
420
-
421
- /**
422
- * Define a constant if it is not already defined.
423
- *
424
- * @since 3.0.0
425
- * @param string $name Constant name.
426
- * @param mixed $value Value.
427
- */
428
- function wcf_maybe_define_constant( $name, $value ) {
429
- if ( ! defined( $name ) ) {
430
- define( $name, $value );
431
- }
432
- }
433
-
434
-
435
- if ( ! function_exists( 'wp_body_open' ) ) {
436
- /**
437
- * Fire the wp_body_open action.
438
- *
439
- * Added for backwards compatibility to support WordPress versions prior to 5.2.0.
440
- */
441
- function wp_body_open() {
442
- /**
443
- * Triggered after the opening <body> tag.
444
- */
445
- do_action( 'wp_body_open' );
446
- }
447
- }
1
+ <?php
2
+ /**
3
+ * CartFlows Functions.
4
+ *
5
+ * @package CARTFLOWS
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+
12
+ /**
13
+ * Fatal error mb_strpos fallback.
14
+ *
15
+ * @param string $string string where to find.
16
+ * @param string $search string to search.
17
+ * @since 1.0.0
18
+ */
19
+ function wcf_mb_strpos( $string, $search ) {
20
+
21
+ if ( function_exists( 'mb_strpos' ) ) {
22
+ return mb_strpos( $string, $search, 0, 'utf-8' );
23
+ } else {
24
+ return strpos( $string, $search );
25
+ }
26
+ }
27
+
28
+ /**
29
+ * Check if cartflows pro activated.
30
+ *
31
+ * @since 1.0.0
32
+ */
33
+ function _is_cartflows_pro() {
34
+
35
+ if ( defined( 'CARTFLOWS_PRO_FILE' ) ) {
36
+ return true;
37
+ }
38
+
39
+ return false;
40
+
41
+ }
42
+
43
+ /**
44
+ * Returns pro version number.
45
+ *
46
+ * @param int $version version number.
47
+ * @since 1.0.0
48
+ */
49
+ function _is_cartflows_pro_ver_less_than( $version ) {
50
+
51
+ if ( defined( 'CARTFLOWS_PRO_VER' ) && version_compare( CARTFLOWS_PRO_VER, $version, '<' ) ) {
52
+ return true;
53
+ }
54
+
55
+ return false;
56
+ }
57
+
58
+ /**
59
+ * Returns step id.
60
+ *
61
+ * @since 1.0.0
62
+ */
63
+ function _get_wcf_post_id() {
64
+
65
+ global $post;
66
+
67
+ if ( isset( $post->ID ) ) {
68
+ return $post->ID;
69
+ }
70
+
71
+ return 0;
72
+ }
73
+
74
+ /**
75
+ * Returns step id.
76
+ *
77
+ * @since 1.0.0
78
+ */
79
+ function _get_wcf_step_id() {
80
+
81
+ if ( wcf()->utils->is_step_post_type() ) {
82
+
83
+ global $post;
84
+
85
+ return $post->ID;
86
+ }
87
+
88
+ return false;
89
+ }
90
+
91
+ /**
92
+ * Check if it is a landing page?
93
+ *
94
+ * @since 1.0.0
95
+ */
96
+ function _is_wcf_landing_type() {
97
+
98
+ if ( wcf()->utils->is_step_post_type() ) {
99
+
100
+ global $post;
101
+
102
+ if ( 'landing' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
103
+
104
+ return true;
105
+ }
106
+ }
107
+
108
+ return false;
109
+ }
110
+
111
+ /**
112
+ * Returns landing id.
113
+ *
114
+ * @since 1.0.0
115
+ */
116
+ function _get_wcf_landing_id() {
117
+
118
+ if ( _is_wcf_landing_type() ) {
119
+
120
+ global $post;
121
+
122
+ return $post->ID;
123
+ }
124
+
125
+ return false;
126
+ }
127
+
128
+ /**
129
+ * Is custom checkout?
130
+ *
131
+ * @param int $checkout_id checkout ID.
132
+ * @since 1.0.0
133
+ */
134
+ function _is_wcf_meta_custom_checkout( $checkout_id ) {
135
+
136
+ $is_custom = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-custom-checkout-fields' );
137
+
138
+ if ( 'yes' === $is_custom ) {
139
+
140
+ return true;
141
+ }
142
+
143
+ return false;
144
+ }
145
+
146
+ /**
147
+ * Check if page is cartflow checkout.
148
+ *
149
+ * @since 1.0.0
150
+ * @return bool
151
+ */
152
+ function _is_wcf_checkout_type() {
153
+
154
+ if ( wcf()->utils->is_step_post_type() ) {
155
+
156
+ global $post;
157
+
158
+ if ( 'checkout' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
159
+
160
+ return true;
161
+ }
162
+ }
163
+
164
+ return false;
165
+ }
166
+
167
+ /**
168
+ * Check if AJAX call is in progress.
169
+ *
170
+ * @since 1.0.0
171
+ * @return bool
172
+ */
173
+ function _is_wcf_doing_checkout_ajax() {
174
+
175
+ if ( wp_doing_ajax() ) {
176
+
177
+ if ( isset( $_GET['wc-ajax'] ) &&
178
+ 'checkout' === $_GET['wc-ajax'] &&
179
+ isset( $_POST['_wcf_checkout_id'] )
180
+ ) {
181
+ return true;
182
+ }
183
+ }
184
+
185
+ return false;
186
+ }
187
+
188
+
189
+ /**
190
+ * Returns checkout ID.
191
+ *
192
+ * @since 1.0.0
193
+ * @return int/bool
194
+ */
195
+ function _get_wcf_checkout_id() {
196
+
197
+ if ( _is_wcf_checkout_type() ) {
198
+
199
+ global $post;
200
+
201
+ return $post->ID;
202
+ }
203
+
204
+ return false;
205
+ }
206
+
207
+ /**
208
+ * Check if it is checkout shortcode.
209
+ *
210
+ * @since 1.0.0
211
+ * @return bool
212
+ */
213
+ function _is_wcf_checkout_shortcode() {
214
+
215
+ global $post;
216
+
217
+ if ( ! empty( $post ) && has_shortcode( $post->post_content, 'cartflows_checkout' ) ) {
218
+
219
+ return true;
220
+ }
221
+
222
+ return false;
223
+ }
224
+
225
+ /**
226
+ * Check if it is checkout shortcode.
227
+ *
228
+ * @since 1.0.0
229
+ * @param string $content shortcode content.
230
+ * @return bool
231
+ */
232
+ function _get_wcf_checkout_id_from_shortcode( $content = '' ) {
233
+
234
+ $checkout_id = 0;
235
+
236
+ if ( ! empty( $content ) ) {
237
+
238
+ $regex_pattern = get_shortcode_regex( array( 'cartflows_checkout' ) );
239
+
240
+ preg_match( '/' . $regex_pattern . '/s', $content, $regex_matches );
241
+
242
+ if ( ! empty( $regex_matches ) ) {
243
+
244
+ if ( 'cartflows_checkout' == $regex_matches[2] ) {
245
+
246
+ $attribure_str = str_replace( ' ', '&', trim( $regex_matches[3] ) );
247
+ $attribure_str = str_replace( '"', '', $attribure_str );
248
+
249
+ $attributes = wp_parse_args( $attribure_str );
250
+
251
+ if ( isset( $attributes['id'] ) ) {
252
+ $checkout_id = $attributes['id'];
253
+ }
254
+ }
255
+ }
256
+ }
257
+
258
+ return $checkout_id;
259
+ }
260
+
261
+ /**
262
+ * Check if post type is upsell.
263
+ *
264
+ * @since 1.0.0
265
+ * @return bool
266
+ */
267
+ function _is_wcf_upsell_type() {
268
+
269
+ if ( wcf()->utils->is_step_post_type() ) {
270
+
271
+ global $post;
272
+
273
+ if ( 'upsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
274
+
275
+ return true;
276
+ }
277
+ }
278
+
279
+ return false;
280
+ }
281
+
282
+ /**
283
+ * Returns upsell ID.
284
+ *
285
+ * @since 1.0.0
286
+ * @return int/bool
287
+ */
288
+ function _get_wcf_upsell_id() {
289
+
290
+ if ( _is_wcf_upsell_type() ) {
291
+
292
+ global $post;
293
+
294
+ return $post->ID;
295
+ }
296
+
297
+ return false;
298
+ }
299
+
300
+ /**
301
+ * Check if post is of type downsell.
302
+ *
303
+ * @since 1.0.0
304
+ * @return int/bool
305
+ */
306
+ function _is_wcf_downsell_type() {
307
+
308
+ if ( wcf()->utils->is_step_post_type() ) {
309
+
310
+ global $post;
311
+
312
+ if ( 'downsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
313
+
314
+ return true;
315
+ }
316
+ }
317
+
318
+ return false;
319
+ }
320
+
321
+ /**
322
+ * Get downsell page ID.
323
+ *
324
+ * @since 1.0.0
325
+ * @return int/bool
326
+ */
327
+ function _get_wcf_downsell_id() {
328
+
329
+ if ( _is_wcf_downsell_type() ) {
330
+
331
+ global $post;
332
+
333
+ return $post->ID;
334
+ }
335
+
336
+ return false;
337
+ }
338
+
339
+ /**
340
+ * Check if page is of thank you type.
341
+ *
342
+ * @since 1.0.0
343
+ * @return int/bool
344
+ */
345
+ function _is_wcf_thankyou_type() {
346
+
347
+ if ( wcf()->utils->is_step_post_type() ) {
348
+
349
+ global $post;
350
+
351
+ if ( 'thankyou' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
352
+
353
+ return true;
354
+ }
355
+ }
356
+
357
+ return false;
358
+ }
359
+
360
+ /**
361
+ * Get thank you page ID.
362
+ *
363
+ * @since 1.0.0
364
+ * @return int/bool
365
+ */
366
+ function _get_wcf_thankyou_id() {
367
+
368
+ if ( _is_wcf_thankyou_type() ) {
369
+
370
+ global $post;
371
+
372
+ return $post->ID;
373
+ }
374
+
375
+ return false;
376
+ }
377
+
378
+
379
+ /**
380
+ * Check if post type is upsell.
381
+ *
382
+ * @since 1.0.0
383
+ * @return bool
384
+ */
385
+ function _is_wcf_base_offer_type() {
386
+
387
+ if ( wcf()->utils->is_step_post_type() ) {
388
+
389
+ global $post;
390
+
391
+ $step_type = get_post_meta( $post->ID, 'wcf-step-type', true );
392
+
393
+ if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
394
+
395
+ return true;
396
+ }
397
+ }
398
+
399
+ return false;
400
+ }
401
+
402
+ /**
403
+ * Returns upsell ID.
404
+ *
405
+ * @since 1.0.0
406
+ * @return int/bool
407
+ */
408
+ function _get_wcf_base_offer_id() {
409
+
410
+ if ( _is_wcf_base_offer_type() ) {
411
+
412
+ global $post;
413
+
414
+ return $post->ID;
415
+ }
416
+
417
+ return false;
418
+ }
419
+
420
+
421
+ /**
422
+ * Define a constant if it is not already defined.
423
+ *
424
+ * @since 3.0.0
425
+ * @param string $name Constant name.
426
+ * @param mixed $value Value.
427
+ */
428
+ function wcf_maybe_define_constant( $name, $value ) {
429
+ if ( ! defined( $name ) ) {
430
+ define( $name, $value );
431
+ }
432
+ }
433
+
434
+
435
+ if ( ! function_exists( 'wp_body_open' ) ) {
436
+ /**
437
+ * Fire the wp_body_open action.
438
+ *
439
+ * Added for backwards compatibility to support WordPress versions prior to 5.2.0.
440
+ */
441
+ function wp_body_open() {
442
+ /**
443
+ * Triggered after the opening <body> tag.
444
+ */
445
+ do_action( 'wp_body_open' );
446
+ }
447
+ }
classes/class-cartflows-importer.php CHANGED
@@ -825,7 +825,7 @@ if ( ! class_exists( 'CartFlows_Importer' ) ) :
825
  }
826
  ?>
827
  <div class="wcf-page-builder-message">
828
- <p><?php /* translators: %s: Plugin string */ printf( esc_html__( '%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>
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>
classes/class-cartflows-learndash-compatibility.php CHANGED
@@ -1,133 +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
- $template = get_course_meta_setting( get_the_id(), 'wcf_course_template' );
63
- if ( 'none' !== $template && $template ) {
64
- $link = get_permalink( $template );
65
- wp_safe_redirect( $link );
66
- }
67
- }
68
-
69
- /**
70
- * Add settings inside learndash settings.
71
- *
72
- * @param array $fields fields.
73
- * @return mixed
74
- */
75
- public function cartflows_course_setting_fields( $fields ) {
76
- global $post;
77
-
78
- $all_posts = array(
79
- 'none' => __( 'None', 'cartflows' ),
80
- );
81
-
82
- $landing_steps = get_posts(
83
- array(
84
- 'posts_per_page' => -1,
85
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
86
- 'post_status' => 'publish',
87
- 'orderby' => 'ID',
88
- 'order' => 'DESC',
89
- 'meta_query' => array( //phpcs:ignore
90
- array(
91
- 'key' => 'wcf-step-type',
92
- 'value' => array( 'landing', 'checkout' ),
93
- 'compare' => 'IN',
94
- ),
95
- ),
96
- )
97
- );
98
-
99
- foreach ( $landing_steps as $landing_step ) {
100
- $all_posts[ $landing_step->ID ] = get_the_title( $landing_step->ID ) . ' ( #' . $landing_step->ID . ')';
101
- }
102
-
103
- $selected = get_post_meta( get_the_ID(), 'wcf_course_template', true );
104
- $description = sprintf(
105
- /* translators: 1: anchor start, 2: anchor close */
106
- __( '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' ),
107
- '<a href="' . esc_url( admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&add-new-flow' ) ) . '">',
108
- '</a>'
109
- );
110
-
111
- $fields['sfwd-courses']['fields']['wcf_course_template'] = array(
112
- 'name' => __( 'Select CartFlows Template for this Course', 'cartflows' ),
113
- 'type' => 'select',
114
- 'initial_options' => $all_posts,
115
- 'default' => 'none',
116
- 'help_text' => $description,
117
- 'show_in_rest' => true,
118
- 'rest_args' => array(
119
- 'schema' => array(
120
- 'type' => 'string',
121
- ),
122
- ),
123
- );
124
-
125
- return $fields;
126
- }
127
-
128
- }
129
-
130
- /**
131
- * Kicking this off by calling 'get_instance()' method
132
- */
133
- 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
@@ -126,7 +126,7 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
126
  define( 'CARTFLOWS_BASE', plugin_basename( CARTFLOWS_FILE ) );
127
  define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
128
  define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
129
- define( 'CARTFLOWS_VER', '1.3.3' );
130
  define( 'CARTFLOWS_SLUG', 'cartflows' );
131
  define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
132
 
@@ -519,6 +519,7 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
519
 
520
  $this->create_files();
521
  include_once CARTFLOWS_DIR . 'classes/class-cartflows-helper.php';
 
522
  include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-flow-post-type.php';
523
  include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-step-post-type.php';
524
 
126
  define( 'CARTFLOWS_BASE', plugin_basename( CARTFLOWS_FILE ) );
127
  define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
128
  define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
129
+ define( 'CARTFLOWS_VER', '1.3.4' );
130
  define( 'CARTFLOWS_SLUG', 'cartflows' );
131
  define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
132
 
519
 
520
  $this->create_files();
521
  include_once CARTFLOWS_DIR . 'classes/class-cartflows-helper.php';
522
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-functions.php';
523
  include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-flow-post-type.php';
524
  include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-step-post-type.php';
525
 
classes/class-cartflows-logger.php CHANGED
@@ -1,183 +1,183 @@
1
- <?php
2
- /**
3
- * Logger.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Initialization
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Logger {
14
-
15
-
16
- /**
17
- * Member Variable
18
- *
19
- * @var instance
20
- */
21
- private static $instance;
22
-
23
- /**
24
- * Member Variable
25
- *
26
- * @var logger
27
- */
28
- public $logger;
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
- /* Load WC Logger */
46
- add_action( 'init', array( $this, 'init_wc_logger' ), 99 );
47
-
48
- $page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING );
49
-
50
- if ( CARTFLOWS_SETTINGS === $page ) {
51
- add_filter( 'admin_footer_text', array( $this, 'add_footer_link' ), 99 );
52
- }
53
-
54
- }
55
-
56
- /**
57
- * Add footer link.
58
- */
59
- public function add_footer_link() {
60
- $settings_url = add_query_arg(
61
- array(
62
- 'page' => CARTFLOWS_SETTINGS,
63
- 'cartflows-error-log' => 1,
64
- ),
65
- admin_url( '/admin.php' )
66
- );
67
-
68
- echo '<span id="footer-thankyou"> Thank you for using <a href="https://cartflows.com/">CartFlows</a></span> | <a href="' . $settings_url . '"> View Logs </a>';
69
- }
70
-
71
- /**
72
- * Inint Logger.
73
- *
74
- * @since 1.0.0
75
- */
76
- public function init_wc_logger() {
77
- if ( class_exists( 'CartFlows_WC_Logger' ) ) {
78
- $this->logger = new CartFlows_WC_Logger();
79
- }
80
- }
81
-
82
- /**
83
- * Write log
84
- *
85
- * @param string $message log message.
86
- * @param string $level type of log.
87
- * @since 1.0.0
88
- */
89
- public function log( $message, $level = 'info' ) {
90
-
91
- $enable_log = apply_filters( 'cartflows_enable_log', 'enable' );
92
-
93
- if ( 'enable' === $enable_log &&
94
- is_a( $this->logger, 'CartFlows_WC_Logger' ) &&
95
- did_action( 'plugins_loaded' )
96
- ) {
97
-
98
- $this->logger->log( $level, $message, array( 'source' => 'cartflows' ) );
99
- }
100
- }
101
-
102
- /**
103
- * Write log
104
- *
105
- * @param string $message log message.
106
- * @param string $level type of log.
107
- * @since 1.0.0
108
- */
109
- public function import_log( $message, $level = 'info' ) {
110
-
111
- if ( defined( 'WP_DEBUG' ) &&
112
- WP_DEBUG &&
113
- is_a( $this->logger, 'CartFlows_WC_Logger' ) &&
114
- did_action( 'plugins_loaded' )
115
- ) {
116
-
117
- $this->logger->log( $level, $message, array( 'source' => 'cartflows-import' ) );
118
- }
119
- }
120
-
121
- /**
122
- * Get all log files in the log directory.
123
- *
124
- * @return array
125
- */
126
- public static function get_log_files() {
127
- $files = scandir( CARTFLOWS_LOG_DIR );
128
- $result = array();
129
-
130
- if ( ! empty( $files ) ) {
131
- foreach ( $files as $key => $value ) {
132
- if ( ! in_array( $value, array( '.', '..' ), true ) ) {
133
- if ( ! is_dir( $value ) && strstr( $value, '.log' ) ) {
134
- $result[ sanitize_title( $value ) ] = $value;
135
- }
136
- }
137
- }
138
- }
139
-
140
- return $result;
141
- }
142
-
143
- /**
144
- * Return the log file handle.
145
- *
146
- * @param string $filename Filename to get the handle for.
147
- * @return string
148
- */
149
- public static function get_log_file_handle( $filename ) {
150
- return substr( $filename, 0, strlen( $filename ) > 48 ? strlen( $filename ) - 48 : strlen( $filename ) - 4 );
151
- }
152
-
153
- /**
154
- * Show the log page contents for file log handler.
155
- */
156
- public static function status_logs_file() {
157
-
158
- if ( ! empty( $_REQUEST['handle'] ) ) {
159
-
160
- if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ), 'remove_log' ) ) {
161
- wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'cartflows' ) );
162
- }
163
- wp_delete_file( CARTFLOWS_LOG_DIR . rtrim( $_REQUEST['handle'], '-log' ) . '.log' ); //phpcs:ignore
164
- echo "<div style='padding: 15px;' class='updated inline'> Log deleted successfully! </div>";
165
- }
166
-
167
- $logs = self::get_log_files();
168
- if ( ! empty( $_REQUEST['log_file'] ) && isset( $logs[ sanitize_title( wp_unslash( $_REQUEST['log_file'] ) ) ] ) ) {
169
- $viewed_log = $logs[ sanitize_title( wp_unslash( $_REQUEST['log_file'] ) ) ];
170
- } elseif ( ! empty( $logs ) ) {
171
- $viewed_log = current( $logs );
172
- }
173
- $handle = ! empty( $viewed_log ) ? self::get_log_file_handle( $viewed_log ) : '';
174
-
175
- include_once CARTFLOWS_DIR . 'includes/admin/cartflows-error-log.php';
176
- }
177
-
178
- }
179
-
180
- /**
181
- * Kicking this off by calling 'get_instance()' method
182
- */
183
- Cartflows_Logger::get_instance();
1
+ <?php
2
+ /**
3
+ * Logger.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Initialization
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Logger {
14
+
15
+
16
+ /**
17
+ * Member Variable
18
+ *
19
+ * @var instance
20
+ */
21
+ private static $instance;
22
+
23
+ /**
24
+ * Member Variable
25
+ *
26
+ * @var logger
27
+ */
28
+ public $logger;
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
+ /* Load WC Logger */
46
+ add_action( 'init', array( $this, 'init_wc_logger' ), 99 );
47
+
48
+ $page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING );
49
+
50
+ if ( CARTFLOWS_SETTINGS === $page ) {
51
+ add_filter( 'admin_footer_text', array( $this, 'add_footer_link' ), 99 );
52
+ }
53
+
54
+ }
55
+
56
+ /**
57
+ * Add footer link.
58
+ */
59
+ public function add_footer_link() {
60
+ $settings_url = add_query_arg(
61
+ array(
62
+ 'page' => CARTFLOWS_SETTINGS,
63
+ 'cartflows-error-log' => 1,
64
+ ),
65
+ admin_url( '/admin.php' )
66
+ );
67
+
68
+ echo '<span id="footer-thankyou"> Thank you for using <a href="https://cartflows.com/">CartFlows</a></span> | <a href="' . $settings_url . '"> View Logs </a>';
69
+ }
70
+
71
+ /**
72
+ * Inint Logger.
73
+ *
74
+ * @since 1.0.0
75
+ */
76
+ public function init_wc_logger() {
77
+ if ( class_exists( 'CartFlows_WC_Logger' ) ) {
78
+ $this->logger = new CartFlows_WC_Logger();
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Write log
84
+ *
85
+ * @param string $message log message.
86
+ * @param string $level type of log.
87
+ * @since 1.0.0
88
+ */
89
+ public function log( $message, $level = 'info' ) {
90
+
91
+ $enable_log = apply_filters( 'cartflows_enable_log', 'enable' );
92
+
93
+ if ( 'enable' === $enable_log &&
94
+ is_a( $this->logger, 'CartFlows_WC_Logger' ) &&
95
+ did_action( 'plugins_loaded' )
96
+ ) {
97
+
98
+ $this->logger->log( $level, $message, array( 'source' => 'cartflows' ) );
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Write log
104
+ *
105
+ * @param string $message log message.
106
+ * @param string $level type of log.
107
+ * @since 1.0.0
108
+ */
109
+ public function import_log( $message, $level = 'info' ) {
110
+
111
+ if ( defined( 'WP_DEBUG' ) &&
112
+ WP_DEBUG &&
113
+ is_a( $this->logger, 'CartFlows_WC_Logger' ) &&
114
+ did_action( 'plugins_loaded' )
115
+ ) {
116
+
117
+ $this->logger->log( $level, $message, array( 'source' => 'cartflows-import' ) );
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Get all log files in the log directory.
123
+ *
124
+ * @return array
125
+ */
126
+ public static function get_log_files() {
127
+ $files = scandir( CARTFLOWS_LOG_DIR );
128
+ $result = array();
129
+
130
+ if ( ! empty( $files ) ) {
131
+ foreach ( $files as $key => $value ) {
132
+ if ( ! in_array( $value, array( '.', '..' ), true ) ) {
133
+ if ( ! is_dir( $value ) && strstr( $value, '.log' ) ) {
134
+ $result[ sanitize_title( $value ) ] = $value;
135
+ }
136
+ }
137
+ }
138
+ }
139
+
140
+ return $result;
141
+ }
142
+
143
+ /**
144
+ * Return the log file handle.
145
+ *
146
+ * @param string $filename Filename to get the handle for.
147
+ * @return string
148
+ */
149
+ public static function get_log_file_handle( $filename ) {
150
+ return substr( $filename, 0, strlen( $filename ) > 48 ? strlen( $filename ) - 48 : strlen( $filename ) - 4 );
151
+ }
152
+
153
+ /**
154
+ * Show the log page contents for file log handler.
155
+ */
156
+ public static function status_logs_file() {
157
+
158
+ if ( ! empty( $_REQUEST['handle'] ) ) {
159
+
160
+ if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ), 'remove_log' ) ) {
161
+ wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'cartflows' ) );
162
+ }
163
+ wp_delete_file( CARTFLOWS_LOG_DIR . rtrim( $_REQUEST['handle'], '-log' ) . '.log' ); //phpcs:ignore
164
+ echo "<div style='padding: 15px;' class='updated inline'> Log deleted successfully! </div>";
165
+ }
166
+
167
+ $logs = self::get_log_files();
168
+ if ( ! empty( $_REQUEST['log_file'] ) && isset( $logs[ sanitize_title( wp_unslash( $_REQUEST['log_file'] ) ) ] ) ) {
169
+ $viewed_log = $logs[ sanitize_title( wp_unslash( $_REQUEST['log_file'] ) ) ];
170
+ } elseif ( ! empty( $logs ) ) {
171
+ $viewed_log = current( $logs );
172
+ }
173
+ $handle = ! empty( $viewed_log ) ? self::get_log_file_handle( $viewed_log ) : '';
174
+
175
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-error-log.php';
176
+ }
177
+
178
+ }
179
+
180
+ /**
181
+ * Kicking this off by calling 'get_instance()' method
182
+ */
183
+ Cartflows_Logger::get_instance();
classes/class-cartflows-meta.php CHANGED
@@ -1,75 +1,75 @@
1
- <?php
2
- /**
3
- * CartFlows Meta
4
- *
5
- * @package CartFlows
6
- * @since 1.0.0
7
- */
8
-
9
- if ( ! class_exists( 'Cartflows_Meta' ) ) :
10
-
11
- /**
12
- * CartFlows_Meta
13
- *
14
- * @since 1.0.0
15
- */
16
- class Cartflows_Meta {
17
- /**
18
- * Constructor
19
- *
20
- * @since 1.0.0
21
- */
22
- public function __construct() {
23
- }
24
-
25
- /**
26
- * Flow & Step Actions
27
- *
28
- * @param array $options options.
29
- * @param int $post_id post ID.
30
- */
31
- public function right_column_footer( $options, $post_id ) {
32
- ?>
33
- <div class="wcf-column-right-footer">
34
- <?php submit_button( __( 'Update', 'cartflows' ), 'primary', 'save', false ); ?>
35
-
36
- <?php
37
- $flow_id = get_post_meta( $post_id, 'wcf-flow-id', true );
38
- if ( $flow_id ) {
39
- ?>
40
- <a href="<?php echo esc_url( get_edit_post_link( $flow_id ) ); ?>" class="button pull-right wcf-back-to-flow-edit">
41
- <i class="dashicons dashicons-arrow-left-alt"></i>
42
- <?php esc_html_e( 'Back to edit Flow', 'cartflows' ); ?>
43
- </a>
44
- <?php } ?>
45
-
46
- </div>
47
- <?php
48
- }
49
-
50
- /**
51
- * Script Header (Used for add script into header)
52
- *
53
- * @param array $options options.
54
- * @param int $post_id post ID.
55
- */
56
- public function tab_custom_script( $options, $post_id ) {
57
- ?>
58
- <div class="wcf-<?php echo wcf()->utils->get_step_type( $post_id ); ?>-custom-script-header wcf-tab-content widefat">
59
- <?php
60
- /* Script added onto the header */
61
- echo wcf()->meta->get_area_field(
62
- array(
63
- 'label' => __( 'Custom Script', 'cartflows' ),
64
- 'name' => 'wcf-custom-script',
65
- 'value' => htmlspecialchars( $options['wcf-custom-script'], ENT_COMPAT, 'utf-8' ),
66
- 'help' => esc_html__( 'Custom script lets you add your own custom script on front end of this flow page.', 'cartflows' ),
67
- )
68
- );
69
- ?>
70
- </div>
71
- <?php
72
- }
73
- }
74
-
75
- endif;
1
+ <?php
2
+ /**
3
+ * CartFlows Meta
4
+ *
5
+ * @package CartFlows
6
+ * @since 1.0.0
7
+ */
8
+
9
+ if ( ! class_exists( 'Cartflows_Meta' ) ) :
10
+
11
+ /**
12
+ * CartFlows_Meta
13
+ *
14
+ * @since 1.0.0
15
+ */
16
+ class Cartflows_Meta {
17
+ /**
18
+ * Constructor
19
+ *
20
+ * @since 1.0.0
21
+ */
22
+ public function __construct() {
23
+ }
24
+
25
+ /**
26
+ * Flow & Step Actions
27
+ *
28
+ * @param array $options options.
29
+ * @param int $post_id post ID.
30
+ */
31
+ public function right_column_footer( $options, $post_id ) {
32
+ ?>
33
+ <div class="wcf-column-right-footer">
34
+ <?php submit_button( __( 'Update', 'cartflows' ), 'primary', 'save', false ); ?>
35
+
36
+ <?php
37
+ $flow_id = get_post_meta( $post_id, 'wcf-flow-id', true );
38
+ if ( $flow_id ) {
39
+ ?>
40
+ <a href="<?php echo esc_url( get_edit_post_link( $flow_id ) ); ?>" class="button pull-right wcf-back-to-flow-edit">
41
+ <i class="dashicons dashicons-arrow-left-alt"></i>
42
+ <?php esc_html_e( 'Back to edit Flow', 'cartflows' ); ?>
43
+ </a>
44
+ <?php } ?>
45
+
46
+ </div>
47
+ <?php
48
+ }
49
+
50
+ /**
51
+ * Script Header (Used for add script into header)
52
+ *
53
+ * @param array $options options.
54
+ * @param int $post_id post ID.
55
+ */
56
+ public function tab_custom_script( $options, $post_id ) {
57
+ ?>
58
+ <div class="wcf-<?php echo wcf()->utils->get_step_type( $post_id ); ?>-custom-script-header wcf-tab-content widefat">
59
+ <?php
60
+ /* Script added onto the header */
61
+ echo wcf()->meta->get_area_field(
62
+ array(
63
+ 'label' => __( 'Custom Script', 'cartflows' ),
64
+ 'name' => 'wcf-custom-script',
65
+ 'value' => htmlspecialchars( $options['wcf-custom-script'], ENT_COMPAT, 'utf-8' ),
66
+ 'help' => esc_html__( 'Custom script lets you add your own custom script on front end of this flow page.', 'cartflows' ),
67
+ )
68
+ );
69
+ ?>
70
+ </div>
71
+ <?php
72
+ }
73
+ }
74
+
75
+ endif;
classes/class-cartflows-session.php CHANGED
@@ -1,245 +1,245 @@
1
- <?php
2
- /**
3
- * Session
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Initialization
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Session {
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
- }
39
-
40
- /**
41
- * Set session
42
- *
43
- * @param int $flow_id flow ID.
44
- * @param array $data trasient data.
45
- */
46
- public function set_session( $flow_id, $data = array() ) {
47
-
48
- if ( isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
49
- $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
50
- } else {
51
- $key = $flow_id . '_' . md5( time() . wp_rand() );
52
- }
53
-
54
- // Set the browser cookie to expire in 30 minutes.
55
- setcookie( 'cartflows_session_' . $flow_id, $key, time() + 30 * MINUTE_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );
56
-
57
- // Try to grab the transient from the database, if it exists.
58
- $transient = $data;
59
-
60
- // Store the transient, but expire in 30 minutes.
61
- set_transient( 'cartflows_data_' . $key, $transient, 30 * MINUTE_IN_SECONDS );
62
-
63
- wp_cache_set( 'cartflows_data_' . $key, $transient );
64
-
65
- wcf()->logger->log( 'Flow-' . $flow_id . ' Session Set : ' . $key . ' ' . wp_json_encode( $transient ) );
66
- }
67
-
68
- /**
69
- * Update session
70
- *
71
- * @param int $flow_id flow ID.
72
- * @param array $data trasient data.
73
- */
74
- public function update_session( $flow_id, $data = array() ) {
75
-
76
- if ( ! isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
77
-
78
- $this->set_session( $flow_id, $data );
79
- }
80
-
81
- $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
82
-
83
- // Try to grab the transient from the database, if it exists.
84
- $transient = get_transient( 'cartflows_data_' . $key );
85
-
86
- // Set the browser cookie to expire in 30 minutes.
87
- setcookie( 'cartflows_session_' . $flow_id, $key, time() + 30 * MINUTE_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );
88
-
89
- // Store the transient, but expire in 30 minutes.
90
- set_transient( 'cartflows_data_' . $key, $transient, 30 * MINUTE_IN_SECONDS );
91
-
92
- wp_cache_set( 'cartflows_data_' . $key, $transient );
93
- }
94
-
95
- /**
96
- * Destroy session
97
- *
98
- * @param int $flow_id flow ID.
99
- */
100
- public function destroy_session( $flow_id ) {
101
-
102
- if ( isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
103
-
104
- $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
105
-
106
- // Delete Transient.
107
- delete_transient( 'cartflows_data_' . $key );
108
-
109
- wp_cache_delete( 'cartflows_data_' . $key );
110
-
111
- unset( $_COOKIE[ 'cartflows_session_' . $flow_id ] );
112
-
113
- // empty value and expiration one hour before.
114
- setcookie( 'cartflows_session_' . $flow_id, $key, time() - 3600, COOKIEPATH, COOKIE_DOMAIN );
115
-
116
- wcf()->logger->log( 'Flow-' . $flow_id . ' Session Destroyed : ' . $key );
117
- }
118
- }
119
-
120
- /**
121
- * Get session
122
- */
123
- public function get_session() {
124
-
125
- if ( isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
126
-
127
- $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
128
-
129
- $data = get_transient( 'cartflows_data_' . $key );
130
- }
131
- }
132
-
133
- /**
134
- * Update transient data for cart flows.
135
- *
136
- * @param int $flow_id flow ID.
137
- * @param array $data data.
138
- */
139
- public function update_data( $flow_id, $data = array() ) {
140
-
141
- if ( isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
142
-
143
- $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
144
-
145
- // Try to grab the transient from the database, if it exists.
146
- $transient = get_transient( 'cartflows_data_' . $key );
147
-
148
- if ( ! is_array( $transient ) ) {
149
- $transient = array();
150
- }
151
-
152
- $transient = array_merge( $transient, $data );
153
-
154
- // Store the transient, but expire in 30 minutes.
155
- set_transient( 'cartflows_data_' . $key, $transient, 30 * MINUTE_IN_SECONDS );
156
-
157
- wp_cache_set( 'cartflows_data_' . $key, $transient );
158
- }
159
- }
160
-
161
- /**
162
- * Update transient data for cart flows.
163
- *
164
- * @param int $flow_id flow ID.
165
- * @return bool
166
- */
167
- public function get_data( $flow_id ) {
168
-
169
- if ( isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
170
-
171
- $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
172
-
173
- // Try to grab the transient from the database, if it exists.
174
- $transient = get_transient( 'cartflows_data_' . $key );
175
-
176
- if ( is_array( $transient ) ) {
177
- return $transient;
178
- }
179
- }
180
-
181
- return false;
182
- }
183
-
184
-
185
- /**
186
- * Check if session is active.
187
- *
188
- * @param int $flow_id flow ID.
189
- * @return bool
190
- */
191
- public function is_active_session( $flow_id ) {
192
-
193
- $is_active = false;
194
-
195
- if ( isset( $_GET['wcf-sk'] ) && isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
196
-
197
- $sk = sanitize_text_field( wp_unslash( $_GET['wcf-sk'] ) );
198
- $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
199
-
200
- if ( $sk === $key ) {
201
-
202
- if ( isset( $_GET['wcf-order'] ) && isset( $_GET['wcf-key'] ) ) {
203
-
204
- // Get the order.
205
- $order_id = empty( $_GET['wcf-order'] ) ? 0 : intval( $_GET['wcf-order'] );
206
- $order_key = empty( $_GET['wcf-key'] ) ? '' : wc_clean( wp_unslash( $_GET['wcf-key'] ) ); //phpcs:ignore
207
-
208
- if ( $order_id > 0 ) {
209
-
210
- $order = wc_get_order( $order_id );
211
-
212
- if ( $order && $order->get_order_key() === $order_key ) {
213
- $is_active = true;
214
- }
215
- }
216
- }
217
- }
218
- }
219
-
220
- return $is_active;
221
- }
222
-
223
- /**
224
- * Get session key for flow
225
- *
226
- * @param int $flow_id flow ID.
227
- * @return bool
228
- */
229
- public function get_session_key( $flow_id ) {
230
-
231
- if ( isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
232
-
233
- $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
234
-
235
- return $key;
236
- }
237
-
238
- return false;
239
- }
240
- }
241
-
242
- /**
243
- * Kicking this off by calling 'get_instance()' method
244
- */
245
- Cartflows_Session::get_instance();
1
+ <?php
2
+ /**
3
+ * Session
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Initialization
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Session {
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
+ }
39
+
40
+ /**
41
+ * Set session
42
+ *
43
+ * @param int $flow_id flow ID.
44
+ * @param array $data trasient data.
45
+ */
46
+ public function set_session( $flow_id, $data = array() ) {
47
+
48
+ if ( isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
49
+ $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
50
+ } else {
51
+ $key = $flow_id . '_' . md5( time() . wp_rand() );
52
+ }
53
+
54
+ // Set the browser cookie to expire in 30 minutes.
55
+ setcookie( 'cartflows_session_' . $flow_id, $key, time() + 30 * MINUTE_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );
56
+
57
+ // Try to grab the transient from the database, if it exists.
58
+ $transient = $data;
59
+
60
+ // Store the transient, but expire in 30 minutes.
61
+ set_transient( 'cartflows_data_' . $key, $transient, 30 * MINUTE_IN_SECONDS );
62
+
63
+ wp_cache_set( 'cartflows_data_' . $key, $transient );
64
+
65
+ wcf()->logger->log( 'Flow-' . $flow_id . ' Session Set : ' . $key . ' ' . wp_json_encode( $transient ) );
66
+ }
67
+
68
+ /**
69
+ * Update session
70
+ *
71
+ * @param int $flow_id flow ID.
72
+ * @param array $data trasient data.
73
+ */
74
+ public function update_session( $flow_id, $data = array() ) {
75
+
76
+ if ( ! isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
77
+
78
+ $this->set_session( $flow_id, $data );
79
+ }
80
+
81
+ $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
82
+
83
+ // Try to grab the transient from the database, if it exists.
84
+ $transient = get_transient( 'cartflows_data_' . $key );
85
+
86
+ // Set the browser cookie to expire in 30 minutes.
87
+ setcookie( 'cartflows_session_' . $flow_id, $key, time() + 30 * MINUTE_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );
88
+
89
+ // Store the transient, but expire in 30 minutes.
90
+ set_transient( 'cartflows_data_' . $key, $transient, 30 * MINUTE_IN_SECONDS );
91
+
92
+ wp_cache_set( 'cartflows_data_' . $key, $transient );
93
+ }
94
+
95
+ /**
96
+ * Destroy session
97
+ *
98
+ * @param int $flow_id flow ID.
99
+ */
100
+ public function destroy_session( $flow_id ) {
101
+
102
+ if ( isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
103
+
104
+ $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
105
+
106
+ // Delete Transient.
107
+ delete_transient( 'cartflows_data_' . $key );
108
+
109
+ wp_cache_delete( 'cartflows_data_' . $key );
110
+
111
+ unset( $_COOKIE[ 'cartflows_session_' . $flow_id ] );
112
+
113
+ // empty value and expiration one hour before.
114
+ setcookie( 'cartflows_session_' . $flow_id, $key, time() - 3600, COOKIEPATH, COOKIE_DOMAIN );
115
+
116
+ wcf()->logger->log( 'Flow-' . $flow_id . ' Session Destroyed : ' . $key );
117
+ }
118
+ }
119
+
120
+ /**
121
+ * Get session
122
+ */
123
+ public function get_session() {
124
+
125
+ if ( isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
126
+
127
+ $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
128
+
129
+ $data = get_transient( 'cartflows_data_' . $key );
130
+ }
131
+ }
132
+
133
+ /**
134
+ * Update transient data for cart flows.
135
+ *
136
+ * @param int $flow_id flow ID.
137
+ * @param array $data data.
138
+ */
139
+ public function update_data( $flow_id, $data = array() ) {
140
+
141
+ if ( isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
142
+
143
+ $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
144
+
145
+ // Try to grab the transient from the database, if it exists.
146
+ $transient = get_transient( 'cartflows_data_' . $key );
147
+
148
+ if ( ! is_array( $transient ) ) {
149
+ $transient = array();
150
+ }
151
+
152
+ $transient = array_merge( $transient, $data );
153
+
154
+ // Store the transient, but expire in 30 minutes.
155
+ set_transient( 'cartflows_data_' . $key, $transient, 30 * MINUTE_IN_SECONDS );
156
+
157
+ wp_cache_set( 'cartflows_data_' . $key, $transient );
158
+ }
159
+ }
160
+
161
+ /**
162
+ * Update transient data for cart flows.
163
+ *
164
+ * @param int $flow_id flow ID.
165
+ * @return bool
166
+ */
167
+ public function get_data( $flow_id ) {
168
+
169
+ if ( isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
170
+
171
+ $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
172
+
173
+ // Try to grab the transient from the database, if it exists.
174
+ $transient = get_transient( 'cartflows_data_' . $key );
175
+
176
+ if ( is_array( $transient ) ) {
177
+ return $transient;
178
+ }
179
+ }
180
+
181
+ return false;
182
+ }
183
+
184
+
185
+ /**
186
+ * Check if session is active.
187
+ *
188
+ * @param int $flow_id flow ID.
189
+ * @return bool
190
+ */
191
+ public function is_active_session( $flow_id ) {
192
+
193
+ $is_active = false;
194
+
195
+ if ( isset( $_GET['wcf-sk'] ) && isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
196
+
197
+ $sk = sanitize_text_field( wp_unslash( $_GET['wcf-sk'] ) );
198
+ $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
199
+
200
+ if ( $sk === $key ) {
201
+
202
+ if ( isset( $_GET['wcf-order'] ) && isset( $_GET['wcf-key'] ) ) {
203
+
204
+ // Get the order.
205
+ $order_id = empty( $_GET['wcf-order'] ) ? 0 : intval( $_GET['wcf-order'] );
206
+ $order_key = empty( $_GET['wcf-key'] ) ? '' : wc_clean( wp_unslash( $_GET['wcf-key'] ) ); //phpcs:ignore
207
+
208
+ if ( $order_id > 0 ) {
209
+
210
+ $order = wc_get_order( $order_id );
211
+
212
+ if ( $order && $order->get_order_key() === $order_key ) {
213
+ $is_active = true;
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
219
+
220
+ return $is_active;
221
+ }
222
+
223
+ /**
224
+ * Get session key for flow
225
+ *
226
+ * @param int $flow_id flow ID.
227
+ * @return bool
228
+ */
229
+ public function get_session_key( $flow_id ) {
230
+
231
+ if ( isset( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) ) {
232
+
233
+ $key = (string) sanitize_text_field( wp_unslash( $_COOKIE[ 'cartflows_session_' . $flow_id ] ) );
234
+
235
+ return $key;
236
+ }
237
+
238
+ return false;
239
+ }
240
+ }
241
+
242
+ /**
243
+ * Kicking this off by calling 'get_instance()' method
244
+ */
245
+ Cartflows_Session::get_instance();
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_key( 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'] ) {
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'] ) {
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'] ) {
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_key( $_GET['step'] ) : current( array_keys( $this->steps ) );
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'] ) ) {
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'] ) ) : '';
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'] ) ) {
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_key( 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'] ) {
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'] ) {
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'] ) {
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_key( $_GET['step'] ) : current( array_keys( $this->steps ) );
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'] ) ) {
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'] ) ) : '';
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'] ) ) {
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-general-bck.php CHANGED
@@ -1,47 +1,47 @@
1
- <?php
2
- /**
3
- * General Setting Form
4
- *
5
- * @package CARTFLOWS
6
- */
7
-
8
- $extensions = array(
9
- 'common' => array(
10
- 'title' => __( 'Selec', 'cartflows' ),
11
- 'setting_url' => admin_url( 'admin.php?page=' . CARTFLOWS_SETTINGS . '&action=common-settings' ),
12
- ),
13
- );
14
-
15
- ?>
16
-
17
- <div class="wcf-container wcf-<?php echo $action; ?>">
18
- <div id="poststuff">
19
- <div id="post-body" class="columns-2">
20
- <div id="post-body-content">
21
- <!-- All WordPress Notices below header -->
22
- <h1 class="screen-reader-text"> <?php esc_html_e( 'General', 'cartflows' ); ?> </h1>
23
- <div class="widgets postbox">
24
- <h2 class="hndle wcf-flex wcf-widgets-heading"><span><?php esc_html_e( 'Welcome', 'cartflows' ); ?></span>
25
- </h2>
26
- <div class="inside">
27
- <ul class="wcf-setting-tab-wrapper" >
28
- <?php
29
-
30
- foreach ( $extensions as $key => $data ) {
31
- echo '<li id="' . esc_attr( $key ) . '" class="wcf-setting-tab ' . esc_attr( $key ) . '">';
32
- echo '<a class="wcf-tab-title" href="#" target="_blank" rel="noopener">' . esc_attr( $data['title'] ) . '</a>';
33
- echo '<div class="wcf-tab-link-wrapper">';
34
- echo '<a class="wcf-tab-link" href="' . esc_url( $data['setting_url'] ) . '">' . esc_html__( 'Settings', 'cartflows' ) . '</a>';
35
- echo '</div>';
36
- echo '</li>';
37
- }
38
- ?>
39
- </ul>
40
- </div>
41
- </div>
42
- </div>
43
- </div>
44
- <!-- /post-body -->
45
- <br class="clear">
46
- </div>
47
- </div>
1
+ <?php
2
+ /**
3
+ * General Setting Form
4
+ *
5
+ * @package CARTFLOWS
6
+ */
7
+
8
+ $extensions = array(
9
+ 'common' => array(
10
+ 'title' => __( 'Selec', 'cartflows' ),
11
+ 'setting_url' => admin_url( 'admin.php?page=' . CARTFLOWS_SETTINGS . '&action=common-settings' ),
12
+ ),
13
+ );
14
+
15
+ ?>
16
+
17
+ <div class="wcf-container wcf-<?php echo $action; ?>">
18
+ <div id="poststuff">
19
+ <div id="post-body" class="columns-2">
20
+ <div id="post-body-content">
21
+ <!-- All WordPress Notices below header -->
22
+ <h1 class="screen-reader-text"> <?php esc_html_e( 'General', 'cartflows' ); ?> </h1>
23
+ <div class="widgets postbox">
24
+ <h2 class="hndle wcf-flex wcf-widgets-heading"><span><?php esc_html_e( 'Welcome', 'cartflows' ); ?></span>
25
+ </h2>
26
+ <div class="inside">
27
+ <ul class="wcf-setting-tab-wrapper" >
28
+ <?php
29
+
30
+ foreach ( $extensions as $key => $data ) {
31
+ echo '<li id="' . esc_attr( $key ) . '" class="wcf-setting-tab ' . esc_attr( $key ) . '">';
32
+ echo '<a class="wcf-tab-title" href="#" target="_blank" rel="noopener">' . esc_attr( $data['title'] ) . '</a>';
33
+ echo '<div class="wcf-tab-link-wrapper">';
34
+ echo '<a class="wcf-tab-link" href="' . esc_url( $data['setting_url'] ) . '">' . esc_html__( 'Settings', 'cartflows' ) . '</a>';
35
+ echo '</div>';
36
+ echo '</li>';
37
+ }
38
+ ?>
39
+ </ul>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ <!-- /post-body -->
45
+ <br class="clear">
46
+ </div>
47
+ </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';
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';
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
+ ?>
includes/exporter.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
- /**
3
- * Exporter
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- ?>
9
- <div class="cartflows-ie">
10
- <div class="postbox">
11
- <div class="inside">
12
- <h3><?php esc_html_e( 'Export Flows to a JSON file', 'cartflows' ); ?></h3>
13
- <p><?php esc_html_e( 'This tool allows you to generate and download a JSON file containing a list of all flows.', 'cartflows' ); ?></p>
14
- <form method="post">
15
- <p><input type="hidden" name="cartflows-action" value="export" /></p>
16
- <p style="margin-bottom:0">
17
- <?php wp_nonce_field( 'cartflows-action-nonce', 'cartflows-action-nonce' ); ?>
18
- <?php submit_button( __( 'Export', 'cartflows' ), 'button-primary', 'submit', false, array( 'id' => '' ) ); ?>
19
- </p>
20
- </form>
21
- </div>
22
- </div>
23
- </div>
1
+ <?php
2
+ /**
3
+ * Exporter
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ ?>
9
+ <div class="cartflows-ie">
10
+ <div class="postbox">
11
+ <div class="inside">
12
+ <h3><?php esc_html_e( 'Export Flows to a JSON file', 'cartflows' ); ?></h3>
13
+ <p><?php esc_html_e( 'This tool allows you to generate and download a JSON file containing a list of all flows.', 'cartflows' ); ?></p>
14
+ <form method="post">
15
+ <p><input type="hidden" name="cartflows-action" value="export" /></p>
16
+ <p style="margin-bottom:0">
17
+ <?php wp_nonce_field( 'cartflows-action-nonce', 'cartflows-action-nonce' ); ?>
18
+ <?php submit_button( __( 'Export', 'cartflows' ), 'button-primary', 'submit', false, array( 'id' => '' ) ); ?>
19
+ </p>
20
+ </form>
21
+ </div>
22
+ </div>
23
+ </div>
includes/importer.php CHANGED
@@ -1,26 +1,26 @@
1
- <?php
2
- /**
3
- * Importer
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- ?>
9
- <div class="cartflows-ie">
10
- <div class="postbox">
11
- <div class="inside">
12
- <h3><?php esc_html_e( 'Import Flows to a JSON file', 'cartflows' ); ?></h3>
13
- <p><?php esc_html_e( 'This tool allows you to import the flows from the JSON file.', 'cartflows' ); ?></p>
14
- <form method="post" enctype="multipart/form-data">
15
- <p>
16
- <input type="file" name="file"/>
17
- <input type="hidden" name="cartflows-action" value="import" />
18
- </p>
19
- <p style="margin-bottom:0">
20
- <?php wp_nonce_field( 'cartflows-action-nonce', 'cartflows-action-nonce' ); ?>
21
- <?php submit_button( __( 'Import', 'cartflows' ), 'button-primary', 'submit', false, array( 'id' => '' ) ); ?>
22
- </p>
23
- </form>
24
- </div>
25
- </div>
26
- </div>
1
+ <?php
2
+ /**
3
+ * Importer
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ ?>
9
+ <div class="cartflows-ie">
10
+ <div class="postbox">
11
+ <div class="inside">
12
+ <h3><?php esc_html_e( 'Import Flows to a JSON file', 'cartflows' ); ?></h3>
13
+ <p><?php esc_html_e( 'This tool allows you to import the flows from the JSON file.', 'cartflows' ); ?></p>
14
+ <form method="post" enctype="multipart/form-data">
15
+ <p>
16
+ <input type="file" name="file"/>
17
+ <input type="hidden" name="cartflows-action" value="import" />
18
+ </p>
19
+ <p style="margin-bottom:0">
20
+ <?php wp_nonce_field( 'cartflows-action-nonce', 'cartflows-action-nonce' ); ?>
21
+ <?php submit_button( __( 'Import', 'cartflows' ), 'button-primary', 'submit', false, array( 'id' => '' ) ); ?>
22
+ </p>
23
+ </form>
24
+ </div>
25
+ </div>
26
+ </div>
languages/cartflows.pot CHANGED
@@ -1,1798 +1,1814 @@
1
- # Copyright (C) 2019 CartFlows Inc
2
- # This file is distributed under the same license as the CartFlows package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: CartFlows 1.3.3\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
- "POT-Creation-Date: 2019-12-26 07:34:34+00:00\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=utf-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
- "Language: en\n"
15
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
- "X-Poedit-Country: United States\n"
17
- "X-Poedit-SourceCharset: UTF-8\n"
18
- "X-Poedit-KeywordsList: "
19
- "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
20
- "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
21
- "X-Poedit-Basepath: ../\n"
22
- "X-Poedit-SearchPath-0: .\n"
23
- "X-Poedit-Bookmarks: \n"
24
- "X-Textdomain-Support: yes\n"
25
- "X-Generator: grunt-wp-i18n 1.0.3\n"
26
-
27
- #: classes/batch-process/class-cartflows-importer-elementor.php:44
28
- msgid "Invalid content."
29
- msgstr ""
30
-
31
- #: classes/batch-process/class-cartflows-importer-elementor.php:52
32
- msgid "Invalid content. Expected an array."
33
- msgstr ""
34
-
35
- #: classes/batch-process/helpers/class-wp-background-process.php:435
36
- msgid "Every %d Minutes"
37
- msgstr ""
38
-
39
- #: classes/class-cartflows-admin-fields.php:231
40
- msgid "Select"
41
- msgstr ""
42
-
43
- #: classes/class-cartflows-admin-fields.php:234
44
- msgid "No Checkout Steps"
45
- msgstr ""
46
-
47
- #: classes/class-cartflows-admin-fields.php:260
48
- #. translators: %s: link
49
- msgid ""
50
- "Be sure not to add any product in above selected Global Checkout step. "
51
- "Please read information about how to set up Global Checkout %1$shere%2$s."
52
- msgstr ""
53
-
54
- #: classes/class-cartflows-admin.php:153 classes/class-cartflows-admin.php:154
55
- #: includes/admin/cartflows-general-bck.php:34
56
- msgid "Settings"
57
- msgstr ""
58
-
59
- #: classes/class-cartflows-admin.php:405
60
- msgid "Installing and activating.."
61
- msgstr ""
62
-
63
- #: classes/class-cartflows-admin.php:406
64
- msgid "There was an error with the installation of plugin."
65
- msgstr ""
66
-
67
- #: classes/class-cartflows-admin.php:460
68
- msgid "Flows Library"
69
- msgstr ""
70
-
71
- #: classes/class-cartflows-admin.php:467
72
- #: modules/flow/view/meta-flow-steps.php:145
73
- msgid "Ready Templates"
74
- msgstr ""
75
-
76
- #: classes/class-cartflows-admin.php:470
77
- #: modules/flow/view/meta-flow-steps.php:148
78
- msgid "Create Your Own"
79
- msgstr ""
80
-
81
- #: classes/class-cartflows-admin.php:481
82
- #: modules/flow/view/meta-flow-steps.php:160
83
- msgid "Search Sites"
84
- msgstr ""
85
-
86
- #: classes/class-cartflows-admin.php:482
87
- #: modules/flow/view/meta-flow-steps.php:161
88
- msgid "Search Flow..."
89
- msgstr ""
90
-
91
- #: classes/class-cartflows-admin.php:499
92
- msgid "Design Your Flow"
93
- msgstr ""
94
-
95
- #: classes/class-cartflows-admin.php:500
96
- #: classes/class-cartflows-importer.php:636
97
- #: classes/class-cartflows-importer.php:735
98
- #: modules/flow/view/meta-flow-steps.php:191
99
- msgid "Learn How"
100
- msgstr ""
101
-
102
- #: classes/class-cartflows-api.php:368
103
- msgid "Request successfully processed!"
104
- msgstr ""
105
-
106
- #: classes/class-cartflows-cloning.php:423
107
- msgid "Clone this flow"
108
- msgstr ""
109
-
110
- #: classes/class-cartflows-cloning.php:423
111
- #: modules/flow/view/meta-flow-steps.php:105
112
- msgid "Clone"
113
- msgstr ""
114
-
115
- #: classes/class-cartflows-flow-frontend.php:53
116
- msgid ""
117
- "Test mode is active — which displays random products for previewing. It can "
118
- "be deactivated from the flow settings in the admin dashboard."
119
- msgstr ""
120
-
121
- #: classes/class-cartflows-flow-frontend.php:58
122
- msgid "Click here to disable it"
123
- msgstr ""
124
-
125
- #: classes/class-cartflows-importer.php:80
126
- msgid "Export this flow"
127
- msgstr ""
128
-
129
- #: classes/class-cartflows-importer.php:80 includes/exporter.php:18
130
- msgid "Export"
131
- msgstr ""
132
-
133
- #: classes/class-cartflows-importer.php:91
134
- msgid "Flow Export"
135
- msgstr ""
136
-
137
- #: classes/class-cartflows-importer.php:92
138
- msgid "Flow Import"
139
- msgstr ""
140
-
141
- #: classes/class-cartflows-importer.php:103
142
- msgid "No post to export has been supplied!"
143
- msgstr ""
144
-
145
- #: classes/class-cartflows-importer.php:294
146
- msgid "Please upload a valid .json file"
147
- msgstr ""
148
-
149
- #: classes/class-cartflows-importer.php:300
150
- msgid "Please upload a file to import"
151
- msgstr ""
152
-
153
- #: classes/class-cartflows-importer.php:477
154
- msgid "Successfully imported flows."
155
- msgstr ""
156
-
157
- #: classes/class-cartflows-importer.php:509
158
- msgid "Loading Steps"
159
- msgstr ""
160
-
161
- #: classes/class-cartflows-importer.php:511
162
- msgid "Getting steps from the cloud. Please wait for the moment."
163
- msgstr ""
164
-
165
- #: classes/class-cartflows-importer.php:522
166
- msgid "Searching Template.."
167
- msgstr ""
168
-
169
- #: classes/class-cartflows-importer.php:524
170
- msgid "Getting templates from the cloud. Please wait for the moment."
171
- msgstr ""
172
-
173
- #: classes/class-cartflows-importer.php:533
174
- msgid "Importing.."
175
- msgstr ""
176
-
177
- #: classes/class-cartflows-importer.php:542
178
- #: classes/class-cartflows-importer.php:582
179
- msgid "Imported"
180
- msgstr ""
181
-
182
- #: classes/class-cartflows-importer.php:543
183
- #: classes/class-cartflows-importer.php:583
184
- msgid "Thanks for patience"
185
- msgstr ""
186
-
187
- #: classes/class-cartflows-importer.php:552
188
- #: classes/class-cartflows-importer.php:564
189
- msgid "Coming Soon!"
190
- msgstr ""
191
-
192
- #: classes/class-cartflows-importer.php:583
193
- msgid "Redirecting to the Elementor edit window."
194
- msgstr ""
195
-
196
- #: classes/class-cartflows-importer.php:629
197
- #: classes/class-cartflows-importer.php:745
198
- msgid "Pro"
199
- msgstr ""
200
-
201
- #: classes/class-cartflows-importer.php:670
202
- #: classes/class-cartflows-importer.php:777
203
- msgid "Activate License"
204
- msgstr ""
205
-
206
- #: classes/class-cartflows-importer.php:672
207
- #: classes/class-cartflows-importer.php:779
208
- #: modules/flow/classes/class-cartflows-flow-meta.php:541
209
- msgid "Get Pro"
210
- msgstr ""
211
-
212
- #: classes/class-cartflows-importer.php:697
213
- msgid "Create"
214
- msgstr ""
215
-
216
- #: classes/class-cartflows-importer.php:796
217
- msgid "Under Maintenance.."
218
- msgstr ""
219
-
220
- #: classes/class-cartflows-importer.php:797
221
- msgid ""
222
- "If you are seeing this message, most likely our servers are under routine "
223
- "maintenance and we will be back shortly."
224
- msgstr ""
225
-
226
- #: classes/class-cartflows-importer.php:798
227
- msgid ""
228
- "In rare case, it is possible your website is having trouble connecting with "
229
- "ours. If you need help, please feel free to get in touch with us from our "
230
- "website.."
231
- msgstr ""
232
-
233
- #: classes/class-cartflows-importer.php:828
234
- #. translators: %s: Plugin string
235
- msgid ""
236
- "%1$s to see CartFlows templates. If you prefer another page builder tool, "
237
- "you can <a href=\"%2$s\" target=\"blank\">select it here</a>."
238
- msgstr ""
239
-
240
- #: classes/class-cartflows-importer.php:843
241
- msgid "All"
242
- msgstr ""
243
-
244
- #: classes/class-cartflows-importer.php:846
245
- msgid "Select Step Type"
246
- msgstr ""
247
-
248
- #: classes/class-cartflows-importer.php:922
249
- msgid "Import from Cloud"
250
- msgstr ""
251
-
252
- #: classes/class-cartflows-importer.php:1236
253
- msgid "Sales Landing"
254
- msgstr ""
255
-
256
- #: classes/class-cartflows-importer.php:1240
257
- #: modules/flow/classes/class-cartflows-step-post-type.php:244
258
- #: modules/flow/view/meta-flow-steps.php:12
259
- msgid "Checkout (Woo)"
260
- msgstr ""
261
-
262
- #: classes/class-cartflows-importer.php:1244
263
- #: modules/flow/classes/class-cartflows-step-post-type.php:251
264
- #: modules/flow/view/meta-flow-steps.php:13
265
- msgid "Thank You (Woo)"
266
- msgstr ""
267
-
268
- #: classes/class-cartflows-importer.php:1252
269
- #: modules/flow/classes/class-cartflows-step-post-type.php:237
270
- #: modules/flow/view/meta-flow-steps.php:11
271
- msgid "Landing"
272
- msgstr ""
273
-
274
- #: classes/class-cartflows-importer.php:1256
275
- msgid "Thank You"
276
- msgstr ""
277
-
278
- #: classes/class-cartflows-importer.php:1358
279
- #. translators: %s: template ID
280
- msgid "Invalid template id %1$s or post id %2$s."
281
- msgstr ""
282
-
283
- #: classes/class-cartflows-importer.php:1416
284
- #. translators: %s: flow ID
285
- msgid "Invalid flow id %1$s OR step type %2$s."
286
- msgstr ""
287
-
288
- #: classes/class-cartflows-importer.php:1541
289
- msgid ""
290
- "Elementor is not activated. Please activate plugin Elementor Page Builder "
291
- "to import the step."
292
- msgstr ""
293
-
294
- #: classes/class-cartflows-importer.php:1644
295
- msgid "Action failed. Invalid Security Nonce."
296
- msgstr ""
297
-
298
- #: classes/class-cartflows-importer.php:1651
299
- msgid "User have not plugin install permissions."
300
- msgstr ""
301
-
302
- #: classes/class-cartflows-importer.php:1673
303
- msgid "Plugin Successfully Activated"
304
- msgstr ""
305
-
306
- #: classes/class-cartflows-learndash-compatibility.php:79
307
- msgid "None"
308
- msgstr ""
309
-
310
- #: classes/class-cartflows-learndash-compatibility.php:106
311
- #. translators: 1: anchor start, 2: anchor close
312
- msgid ""
313
- "Non-enrolled students will redirect to the selected CartFlows template. If "
314
- "you have not created any Flow already, add new Flow from %1$shere%2$s."
315
- msgstr ""
316
-
317
- #: classes/class-cartflows-learndash-compatibility.php:112
318
- msgid "Select CartFlows Template for this Course"
319
- msgstr ""
320
-
321
- #: classes/class-cartflows-loader.php:225
322
- #. translators: %s: html tags
323
- msgid ""
324
- "You are using an older version of %1$sCartFlows Pro%2$s. Please update "
325
- "%1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher."
326
- msgstr ""
327
-
328
- #: classes/class-cartflows-loader.php:482
329
- #. translators: %s: html tags
330
- msgid ""
331
- "This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & "
332
- "activated."
333
- msgstr ""
334
-
335
- #: classes/class-cartflows-loader.php:492
336
- msgid "Activate WooCommerce"
337
- msgstr ""
338
-
339
- #: classes/class-cartflows-loader.php:500
340
- msgid "Install WooCommerce"
341
- msgstr ""
342
-
343
- #: classes/class-cartflows-logger.php:161
344
- msgid "Action failed. Please refresh the page and retry."
345
- msgstr ""
346
-
347
- #: classes/class-cartflows-meta-fields.php:86
348
- msgid "Thin 100"
349
- msgstr ""
350
-
351
- #: classes/class-cartflows-meta-fields.php:87
352
- msgid "Extra-Light 200"
353
- msgstr ""
354
-
355
- #: classes/class-cartflows-meta-fields.php:88
356
- msgid "Light 300"
357
- msgstr ""
358
-
359
- #: classes/class-cartflows-meta-fields.php:89
360
- msgid "Normal 400"
361
- msgstr ""
362
-
363
- #: classes/class-cartflows-meta-fields.php:90
364
- msgid "Medium 500"
365
- msgstr ""
366
-
367
- #: classes/class-cartflows-meta-fields.php:91
368
- msgid "Semi-Bold 600"
369
- msgstr ""
370
-
371
- #: classes/class-cartflows-meta-fields.php:92
372
- msgid "Bold 700"
373
- msgstr ""
374
-
375
- #: classes/class-cartflows-meta-fields.php:93
376
- msgid "Extra-Bold 800"
377
- msgstr ""
378
-
379
- #: classes/class-cartflows-meta-fields.php:94
380
- msgid "Ultra-Bold 900"
381
- msgstr ""
382
-
383
- #: classes/class-cartflows-meta-fields.php:217
384
- #: classes/class-cartflows-meta-fields.php:325
385
- #: classes/class-cartflows-meta-fields.php:1426
386
- msgid "Remove"
387
- msgstr ""
388
-
389
- #: classes/class-cartflows-meta-fields.php:446
390
- msgid "Field Width"
391
- msgstr ""
392
-
393
- #: classes/class-cartflows-meta-fields.php:450
394
- msgid "33%"
395
- msgstr ""
396
-
397
- #: classes/class-cartflows-meta-fields.php:451
398
- msgid "50%"
399
- msgstr ""
400
-
401
- #: classes/class-cartflows-meta-fields.php:452
402
- msgid "100%"
403
- msgstr ""
404
-
405
- #: classes/class-cartflows-meta-fields.php:463
406
- msgid "Field Label"
407
- msgstr ""
408
-
409
- #: classes/class-cartflows-meta-fields.php:477
410
- msgid "Options"
411
- msgstr ""
412
-
413
- #: classes/class-cartflows-meta-fields.php:492
414
- #: classes/class-cartflows-meta-fields.php:505
415
- #: includes/admin/cartflows-general.php:123
416
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:555
417
- msgid "Default"
418
- msgstr ""
419
-
420
- #: classes/class-cartflows-meta-fields.php:496
421
- msgid "Checked"
422
- msgstr ""
423
-
424
- #: classes/class-cartflows-meta-fields.php:497
425
- msgid "Un-Checked"
426
- msgstr ""
427
-
428
- #: classes/class-cartflows-meta-fields.php:518
429
- msgid "Placeholder"
430
- msgstr ""
431
-
432
- #: classes/class-cartflows-meta-fields.php:530
433
- msgid "Required"
434
- msgstr ""
435
-
436
- #: classes/class-cartflows-meta-fields.php:542
437
- msgid "Enable this field"
438
- msgstr ""
439
-
440
- #: classes/class-cartflows-meta-fields.php:562
441
- msgid "Label"
442
- msgstr ""
443
-
444
- #: classes/class-cartflows-meta-fields.php:999
445
- #: classes/class-cartflows-meta-fields.php:1418
446
- msgid "Search for a product&hellip;"
447
- msgstr ""
448
-
449
- #: classes/class-cartflows-meta-fields.php:1040
450
- msgid "Search for a coupon&hellip;"
451
- msgstr ""
452
-
453
- #: classes/class-cartflows-meta.php:34
454
- msgid "Update"
455
- msgstr ""
456
-
457
- #: classes/class-cartflows-meta.php:42
458
- #: modules/flow/classes/class-cartflows-flow-meta.php:84
459
- msgid "Back to edit Flow"
460
- msgstr ""
461
-
462
- #: classes/class-cartflows-meta.php:63
463
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:193
464
- #: modules/landing/classes/class-cartflows-landing-meta.php:136
465
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:148
466
- msgid "Custom Script"
467
- msgstr ""
468
-
469
- #: classes/class-cartflows-meta.php:66
470
- msgid ""
471
- "Custom script lets you add your own custom script on front end of this flow "
472
- "page."
473
- msgstr ""
474
-
475
- #: classes/class-cartflows-metabox.php:59
476
- msgid "Flow Details"
477
- msgstr ""
478
-
479
- #: classes/class-cartflows-wizard.php:83
480
- msgid "Thanks for installing and using CartFlows!"
481
- msgstr ""
482
-
483
- #: classes/class-cartflows-wizard.php:84
484
- msgid ""
485
- "It is easy to use the CartFlows. Please use the setup wizard to quick start "
486
- "setup."
487
- msgstr ""
488
-
489
- #: classes/class-cartflows-wizard.php:86
490
- msgid "Start Wizard"
491
- msgstr ""
492
-
493
- #: classes/class-cartflows-wizard.php:87
494
- msgid "Skip Setup"
495
- msgstr ""
496
-
497
- #: classes/class-cartflows-wizard.php:117
498
- #: includes/admin/cartflows-general-bck.php:24
499
- msgid "Welcome"
500
- msgstr ""
501
-
502
- #: classes/class-cartflows-wizard.php:122
503
- msgid "Page Builder"
504
- msgstr ""
505
-
506
- #: classes/class-cartflows-wizard.php:126
507
- msgid "Checkout"
508
- msgstr ""
509
-
510
- #: classes/class-cartflows-wizard.php:130
511
- msgid "Training"
512
- msgstr ""
513
-
514
- #: classes/class-cartflows-wizard.php:134
515
- msgid "Ready!"
516
- msgstr ""
517
-
518
- #: classes/class-cartflows-wizard.php:208
519
- msgid "CartFlows Setup"
520
- msgstr ""
521
-
522
- #: classes/class-cartflows-wizard.php:234
523
- msgid "Exit Setup Wizard"
524
- msgstr ""
525
-
526
- #: classes/class-cartflows-wizard.php:287
527
- msgid "Welcome to CartFlows!"
528
- msgstr ""
529
-
530
- #: classes/class-cartflows-wizard.php:288
531
- msgid ""
532
- "Thank you for choosing CartFlows to get more leads, increase conversions, & "
533
- "maximize profits. This short setup wizard will guide you though configuring "
534
- "CartFlows and creating your first funnel."
535
- msgstr ""
536
-
537
- #: classes/class-cartflows-wizard.php:294
538
- msgid "Lets Go »"
539
- msgstr ""
540
-
541
- #: classes/class-cartflows-wizard.php:321
542
- msgid "Page Builder Setup"
543
- msgstr ""
544
-
545
- #: classes/class-cartflows-wizard.php:322
546
- msgid "Please select a page builder you would like to use with CartFlows."
547
- msgstr ""
548
-
549
- #: classes/class-cartflows-wizard.php:327
550
- msgid "Select Page Builder"
551
- msgstr ""
552
-
553
- #: classes/class-cartflows-wizard.php:334
554
- #: includes/admin/cartflows-general.php:88
555
- msgid "Elementor"
556
- msgstr ""
557
-
558
- #: classes/class-cartflows-wizard.php:344
559
- msgid "Beaver Builder Plugin (Lite Version)"
560
- msgstr ""
561
-
562
- #: classes/class-cartflows-wizard.php:354
563
- #: includes/admin/cartflows-general.php:90
564
- msgid "Divi"
565
- msgstr ""
566
-
567
- #: classes/class-cartflows-wizard.php:364
568
- #: includes/admin/cartflows-general.php:91
569
- msgid "Other"
570
- msgstr ""
571
-
572
- #: classes/class-cartflows-wizard.php:386
573
- msgid ""
574
- "While CartFlows Should work with most page builders, we offer templates for "
575
- "the above page builders."
576
- msgstr ""
577
-
578
- #: classes/class-cartflows-wizard.php:389
579
- #: classes/class-cartflows-wizard.php:434
580
- #: classes/class-cartflows-wizard.php:613
581
- msgid "« Previous"
582
- msgstr ""
583
-
584
- #: classes/class-cartflows-wizard.php:392
585
- msgid "Skip this step"
586
- msgstr ""
587
-
588
- #: classes/class-cartflows-wizard.php:393
589
- msgid "Next »"
590
- msgstr ""
591
-
592
- #: classes/class-cartflows-wizard.php:412
593
- msgid "Choose a checkout"
594
- msgstr ""
595
-
596
- #: classes/class-cartflows-wizard.php:415
597
- msgid ""
598
- "While CartFlows is designed to use WooCommerce sell digital and physical "
599
- "products, not all funnels need a checkout system."
600
- msgstr ""
601
-
602
- #: classes/class-cartflows-wizard.php:417
603
- msgid ""
604
- "Would you like to install WooCommerce to sell digital and physical products "
605
- "in your funnels?"
606
- msgstr ""
607
-
608
- #: classes/class-cartflows-wizard.php:424
609
- msgid "The following plugin will be installed and activated for you:"
610
- msgstr ""
611
-
612
- #: classes/class-cartflows-wizard.php:425
613
- msgid "WooCommerce"
614
- msgstr ""
615
-
616
- #: classes/class-cartflows-wizard.php:426
617
- msgid "WooCommerce Cart Abandonment Recovery"
618
- msgstr ""
619
-
620
- #: classes/class-cartflows-wizard.php:437
621
- #: classes/class-cartflows-wizard.php:616
622
- msgid "No thanks"
623
- msgstr ""
624
-
625
- #: classes/class-cartflows-wizard.php:438
626
- msgid "Yes"
627
- msgstr ""
628
-
629
- #: classes/class-cartflows-wizard.php:549
630
- msgid "Congratulations, You Did It!"
631
- msgstr ""
632
-
633
- #: classes/class-cartflows-wizard.php:556
634
- msgid ""
635
- "CartFlows is ready to use on your website. You've successfully completed "
636
- "the setup process and all that is left for you to do is create your first "
637
- "flow."
638
- msgstr ""
639
-
640
- #: classes/class-cartflows-wizard.php:570
641
- msgid "Create a flow"
642
- msgstr ""
643
-
644
- #: classes/class-cartflows-wizard.php:587
645
- msgid "Exclusive CartFlows Training Course Offer"
646
- msgstr ""
647
-
648
- #: classes/class-cartflows-wizard.php:598
649
- msgid ""
650
- "We want you to get off to a great start using CartFlows, so we would like "
651
- "to give access to our exclusive training course."
652
- msgstr ""
653
-
654
- #: classes/class-cartflows-wizard.php:599
655
- msgid "Get access to this couse, for free, by entering your email below."
656
- msgstr ""
657
-
658
- #: classes/class-cartflows-wizard.php:601
659
- msgid "Enter Email address"
660
- msgstr ""
661
-
662
- #: classes/class-cartflows-wizard.php:617
663
- msgid "Allow"
664
- msgstr ""
665
-
666
- #: classes/logger/class-cartflows-log-handler-file.php:351
667
- #: classes/logger/class-cartflows-log-handler-file.php:371
668
- msgid "This method should not be called before plugins_loaded."
669
- msgstr ""
670
-
671
- #: classes/logger/class-cartflows-wc-logger.php:58
672
- #. translators: 1: class name 2: Cartflows_Log_Handler_Interface
673
- msgid "The provided handler %1$s does not implement %2$s."
674
- msgstr ""
675
-
676
- #: classes/logger/class-cartflows-wc-logger.php:136
677
- #. translators: 1: Cartflows_WC_Logger::log 2: level
678
- msgid "%1$s was called with an invalid level \"%2$s\"."
679
- msgstr ""
680
-
681
- #: includes/admin/cartflows-admin.php:19
682
- #: includes/admin/cartflows-general.php:44
683
- msgid "Modernizing WordPress eCommerce!"
684
- msgstr ""
685
-
686
- #: includes/admin/cartflows-admin.php:29
687
- msgid "Settings saved successfully."
688
- msgstr ""
689
-
690
- #: includes/admin/cartflows-error-log.php:36
691
- msgid "%1$s at %2$s"
692
- msgstr ""
693
-
694
- #: includes/admin/cartflows-error-log.php:41
695
- #: modules/flow/classes/class-cartflows-flow-post-type.php:176
696
- #: modules/flow/view/meta-flow-steps.php:97
697
- msgid "View"
698
- msgstr ""
699
-
700
- #: includes/admin/cartflows-error-log.php:65
701
- msgid "Delete log"
702
- msgstr ""
703
-
704
- #: includes/admin/cartflows-error-log.php:70
705
- msgid "There are currently no logs to view."
706
- msgstr ""
707
-
708
- #: includes/admin/cartflows-general-bck.php:10
709
- msgid "Selec"
710
- msgstr ""
711
-
712
- #: includes/admin/cartflows-general-bck.php:22
713
- msgid "General"
714
- msgstr ""
715
-
716
- #: includes/admin/cartflows-general.php:29
717
- #: includes/admin/cartflows-general.php:52
718
- msgid "General Settings"
719
- msgstr ""
720
-
721
- #: includes/admin/cartflows-general.php:36
722
- msgid "Getting Started"
723
- msgstr ""
724
-
725
- #: includes/admin/cartflows-general.php:65
726
- msgid "Disallow search engines from indexing flows"
727
- msgstr ""
728
-
729
- #: includes/admin/cartflows-general.php:75
730
- #: modules/flow/view/meta-flow-steps.php:86
731
- msgid "Global Checkout"
732
- msgstr ""
733
-
734
- #: includes/admin/cartflows-general.php:84
735
- msgid "Show Templates designed with"
736
- msgstr ""
737
-
738
- #: includes/admin/cartflows-general.php:85
739
- msgid ""
740
- "CartFlows offers flow templates that can be imported in one click. These "
741
- "templates are available in few different page builders. Please choose your "
742
- "preferred page builder from the list so you will only see templates that "
743
- "are made using that page builder.."
744
- msgstr ""
745
-
746
- #: includes/admin/cartflows-general.php:89
747
- msgid "Beaver Builder"
748
- msgstr ""
749
-
750
- #: includes/admin/cartflows-general.php:100
751
- #: includes/admin/cartflows-general.php:182
752
- #: includes/admin/cartflows-general.php:267
753
- msgid "Save Changes"
754
- msgstr ""
755
-
756
- #: includes/admin/cartflows-general.php:108
757
- msgid "Permalink Settings"
758
- msgstr ""
759
-
760
- #: includes/admin/cartflows-general.php:129
761
- msgid "Flow and Step Slug"
762
- msgstr ""
763
-
764
- #: includes/admin/cartflows-general.php:135
765
- msgid "Flow Slug"
766
- msgstr ""
767
-
768
- #: includes/admin/cartflows-general.php:141
769
- msgid "Step Slug"
770
- msgstr ""
771
-
772
- #: includes/admin/cartflows-general.php:153
773
- msgid "Post Type Permalink Base"
774
- msgstr ""
775
-
776
- #: includes/admin/cartflows-general.php:161
777
- msgid "Step Base"
778
- msgstr ""
779
-
780
- #: includes/admin/cartflows-general.php:171
781
- msgid "Flow Base"
782
- msgstr ""
783
-
784
- #: includes/admin/cartflows-general.php:183
785
- msgid "Set Default"
786
- msgstr ""
787
-
788
- #: includes/admin/cartflows-general.php:196
789
- msgid "Facebook Pixel Settings"
790
- msgstr ""
791
-
792
- #: includes/admin/cartflows-general.php:211
793
- msgid "Enable Facebook Pixel Tracking"
794
- msgstr ""
795
-
796
- #: includes/admin/cartflows-general.php:222
797
- msgid "Enter Facebook pixel ID"
798
- msgstr ""
799
-
800
- #: includes/admin/cartflows-general.php:230
801
- msgid "Enable Events:"
802
- msgstr ""
803
-
804
- #: includes/admin/cartflows-general.php:239
805
- msgid "Initiate Checkout"
806
- msgstr ""
807
-
808
- #: includes/admin/cartflows-general.php:248
809
- msgid "Add Payment Info"
810
- msgstr ""
811
-
812
- #: includes/admin/cartflows-general.php:257
813
- msgid "Purchase Complete"
814
- msgstr ""
815
-
816
- #: includes/admin/cartflows-general.php:284
817
- msgid "Knowledge Base"
818
- msgstr ""
819
-
820
- #: includes/admin/cartflows-general.php:288
821
- msgid "Not sure how something works? Take a peek at the knowledge base and learn."
822
- msgstr ""
823
-
824
- #: includes/admin/cartflows-general.php:291
825
- msgid "Visit Knowledge Base »"
826
- msgstr ""
827
-
828
- #: includes/admin/cartflows-general.php:299
829
- msgid "Community"
830
- msgstr ""
831
-
832
- #: includes/admin/cartflows-general.php:303
833
- msgid ""
834
- "Join the community of super helpful CartFlows users. Say hello, ask "
835
- "questions, give feedback and help each other!"
836
- msgstr ""
837
-
838
- #: includes/admin/cartflows-general.php:306
839
- msgid "Join Our Facebook Group »"
840
- msgstr ""
841
-
842
- #: includes/admin/cartflows-general.php:314
843
- msgid "Five Star Support"
844
- msgstr ""
845
-
846
- #: includes/admin/cartflows-general.php:318
847
- msgid "Got a question? Get in touch with CartFlows developers. We're happy to help!"
848
- msgstr ""
849
-
850
- #: includes/admin/cartflows-general.php:321
851
- msgid "Submit a Ticket »"
852
- msgstr ""
853
-
854
- #: includes/admin/cartflows-general.php:331
855
- msgid "Load Minified CSS"
856
- msgstr ""
857
-
858
- #: includes/admin/cartflows-general.php:336
859
- msgid ""
860
- "Load the Minified CSS from here. Just Enable it by checking the below given "
861
- "checkbox."
862
- msgstr ""
863
-
864
- #: includes/admin/cartflows-general.php:343
865
- msgid "Load minified CSS & JS Files"
866
- msgstr ""
867
-
868
- #: includes/admin/cartflows-general.php:348
869
- msgid "Save"
870
- msgstr ""
871
-
872
- #: includes/exporter.php:12
873
- msgid "Export Flows to a JSON file"
874
- msgstr ""
875
-
876
- #: includes/exporter.php:13
877
- msgid ""
878
- "This tool allows you to generate and download a JSON file containing a list "
879
- "of all flows."
880
- msgstr ""
881
-
882
- #: includes/importer.php:12
883
- msgid "Import Flows to a JSON file"
884
- msgstr ""
885
-
886
- #: includes/importer.php:13
887
- msgid "This tool allows you to import the flows from the JSON file."
888
- msgstr ""
889
-
890
- #: includes/importer.php:21
891
- msgid "Import"
892
- msgstr ""
893
-
894
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:232
895
- #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:65
896
- msgid ""
897
- "WooCommerce functions do not exist. If you are in an IFrame, please reload "
898
- "it."
899
- msgstr ""
900
-
901
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:233
902
- #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:66
903
- msgid "Click Here to Reload"
904
- msgstr ""
905
-
906
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:251
907
- msgid "Checkout ID not found"
908
- msgstr ""
909
-
910
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:314
911
- #: modules/checkout/templates/embed/checkout-template-simple.php:25
912
- #: modules/checkout/templates/wcf-template.php:36
913
- msgid "Your cart is currently empty."
914
- msgstr ""
915
-
916
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:379
917
- msgid ""
918
- "No product is selected. Please select products from the checkout meta "
919
- "settings to continue."
920
- msgstr ""
921
-
922
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:432
923
- msgid "Variations Not set"
924
- msgstr ""
925
-
926
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:440
927
- msgid "This product can't be purchased"
928
- msgstr ""
929
-
930
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1051
931
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1094
932
- msgid "Coupon Code"
933
- msgstr ""
934
-
935
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1052
936
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1103
937
- msgid "Apply"
938
- msgstr ""
939
-
940
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1259
941
- msgid "Sorry there was a problem removing this coupon."
942
- msgstr ""
943
-
944
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1262
945
- msgid "Coupon has been removed."
946
- msgstr ""
947
-
948
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1281
949
- msgid "Sorry there was a problem removing "
950
- msgstr ""
951
-
952
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1284
953
- msgid " has been removed."
954
- msgstr ""
955
-
956
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:66
957
- msgid "Checkout Layout"
958
- msgstr ""
959
-
960
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:151
961
- #: modules/landing/classes/class-cartflows-landing-meta.php:130
962
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:130
963
- msgid "Shortcodes"
964
- msgstr ""
965
-
966
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:157
967
- msgid "Select Product"
968
- msgstr ""
969
-
970
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:163
971
- msgid "Order Bump"
972
- msgstr ""
973
-
974
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:169
975
- msgid "Checkout Offer"
976
- msgstr ""
977
-
978
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:175
979
- msgid "Checkout Design"
980
- msgstr ""
981
-
982
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:181
983
- msgid "Checkout Fields"
984
- msgstr ""
985
-
986
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:187
987
- msgid "Checkout Settings"
988
- msgstr ""
989
-
990
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:204
991
- msgid "Logo (Optional)"
992
- msgstr ""
993
-
994
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:266
995
- msgid "Add this shortcode to your checkout page"
996
- msgstr ""
997
-
998
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:302
999
- #. translators: %s: link
1000
- msgid ""
1001
- "Upgrade to %1$sCartFlows Pro%2$s for Pre-applied Coupon, Product Variations "
1002
- "& Quantity Options."
1003
- msgstr ""
1004
-
1005
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:329
1006
- #. translators: %s: link
1007
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Checkout Offer feature"
1008
- msgstr ""
1009
-
1010
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:339
1011
- #. translators: %s: link
1012
- msgid "Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature"
1013
- msgstr ""
1014
-
1015
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:367
1016
- #. translators: %s: link
1017
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature."
1018
- msgstr ""
1019
-
1020
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:394
1021
- #. translators: %s: link
1022
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature."
1023
- msgstr ""
1024
-
1025
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:418
1026
- msgid "Enable cart editing on checkout"
1027
- msgstr ""
1028
-
1029
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:426
1030
- #. translators: %s: link
1031
- msgid "Users will able to remove products from the checkout page."
1032
- msgstr ""
1033
-
1034
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:454
1035
- msgid "One Column (Available in CartFlows Pro) "
1036
- msgstr ""
1037
-
1038
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:455
1039
- msgid "Two Step (Available in CartFlows Pro) "
1040
- msgstr ""
1041
-
1042
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:461
1043
- msgid "Checkout Skin"
1044
- msgstr ""
1045
-
1046
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:465
1047
- msgid "One Column"
1048
- msgstr ""
1049
-
1050
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:466
1051
- msgid "Two Column"
1052
- msgstr ""
1053
-
1054
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:467
1055
- msgid "Two Step"
1056
- msgstr ""
1057
-
1058
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:476
1059
- msgid "Primary Color"
1060
- msgstr ""
1061
-
1062
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:485
1063
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:520
1064
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:566
1065
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:658
1066
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:203
1067
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:226
1068
- msgid "Font Family"
1069
- msgstr ""
1070
-
1071
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:493
1072
- msgid "Advance Options"
1073
- msgstr ""
1074
-
1075
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:505
1076
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:211
1077
- msgid "Heading"
1078
- msgstr ""
1079
-
1080
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:511
1081
- msgid "Heading Color"
1082
- msgstr ""
1083
-
1084
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:529
1085
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:575
1086
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:667
1087
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:235
1088
- msgid "Font Weight"
1089
- msgstr ""
1090
-
1091
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:537
1092
- msgid "Input Fields"
1093
- msgstr ""
1094
-
1095
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:545
1096
- msgid "Floating Labels (Available in CartFlows Pro)"
1097
- msgstr ""
1098
-
1099
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:551
1100
- msgid "Style"
1101
- msgstr ""
1102
-
1103
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:556
1104
- msgid "Floating Labels"
1105
- msgstr ""
1106
-
1107
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:583
1108
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:675
1109
- msgid "Size"
1110
- msgstr ""
1111
-
1112
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:587
1113
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:679
1114
- msgid "Extra Small"
1115
- msgstr ""
1116
-
1117
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:588
1118
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:680
1119
- msgid "Small"
1120
- msgstr ""
1121
-
1122
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:589
1123
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:681
1124
- msgid "Medium"
1125
- msgstr ""
1126
-
1127
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:590
1128
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:682
1129
- msgid "Large"
1130
- msgstr ""
1131
-
1132
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:591
1133
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:683
1134
- msgid "Extra Large"
1135
- msgstr ""
1136
-
1137
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:592
1138
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:684
1139
- msgid "Custom"
1140
- msgstr ""
1141
-
1142
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:599
1143
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:691
1144
- msgid "Top Bottom Spacing"
1145
- msgstr ""
1146
-
1147
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:607
1148
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:699
1149
- msgid "Left Right Spacing"
1150
- msgstr ""
1151
-
1152
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:615
1153
- msgid "Text / Placeholder Color"
1154
- msgstr ""
1155
-
1156
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:623
1157
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:723
1158
- msgid "Background Color"
1159
- msgstr ""
1160
-
1161
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:631
1162
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:739
1163
- msgid "Border Color"
1164
- msgstr ""
1165
-
1166
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:638
1167
- msgid "Label Color"
1168
- msgstr ""
1169
-
1170
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:651
1171
- msgid "Buttons"
1172
- msgstr ""
1173
-
1174
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:707
1175
- msgid "Text Color"
1176
- msgstr ""
1177
-
1178
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:715
1179
- msgid "Text Hover Color"
1180
- msgstr ""
1181
-
1182
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:731
1183
- msgid "Background Hover Color"
1184
- msgstr ""
1185
-
1186
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:747
1187
- msgid "Border Hover Color"
1188
- msgstr ""
1189
-
1190
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:760
1191
- msgid "Sections"
1192
- msgstr ""
1193
-
1194
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:766
1195
- msgid "Highlight Area Background Color"
1196
- msgstr ""
1197
-
1198
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:805
1199
- msgid "Header Logo"
1200
- msgstr ""
1201
-
1202
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:813
1203
- msgid "Logo Width (In px)"
1204
- msgstr ""
1205
-
1206
- #: modules/checkout/templates/wcf-template.php:46
1207
- msgid "Copyright &copy;"
1208
- msgstr ""
1209
-
1210
- #: modules/checkout/templates/wcf-template.php:50
1211
- msgid "All Rights Reserved"
1212
- msgstr ""
1213
-
1214
- #: modules/flow/classes/class-cartflows-flow-meta.php:199
1215
- #. translators: %s flow id
1216
- msgid "Steps not created for flow - %s"
1217
- msgstr ""
1218
-
1219
- #: modules/flow/classes/class-cartflows-flow-meta.php:213
1220
- #. translators: %s flow id
1221
- msgid "Steps already exists. Flow - %s"
1222
- msgstr ""
1223
-
1224
- #: modules/flow/classes/class-cartflows-flow-meta.php:224
1225
- msgid "Landing Page"
1226
- msgstr ""
1227
-
1228
- #: modules/flow/classes/class-cartflows-flow-meta.php:225
1229
- msgid "Checkout Page"
1230
- msgstr ""
1231
-
1232
- #: modules/flow/classes/class-cartflows-flow-meta.php:226
1233
- msgid "Thank You Page"
1234
- msgstr ""
1235
-
1236
- #: modules/flow/classes/class-cartflows-flow-meta.php:262
1237
- #. translators: %s flow id
1238
- msgid "Steps created for flow - %s"
1239
- msgstr ""
1240
-
1241
- #: modules/flow/classes/class-cartflows-flow-meta.php:334
1242
- #. translators: %s flow id
1243
- msgid "Step not deleted for flow - %s"
1244
- msgstr ""
1245
-
1246
- #: modules/flow/classes/class-cartflows-flow-meta.php:365
1247
- #. translators: %s flow id
1248
- msgid "Step deleted for flow - %s"
1249
- msgstr ""
1250
-
1251
- #: modules/flow/classes/class-cartflows-flow-meta.php:389
1252
- #. translators: %s flow id
1253
- msgid "Steps not sorted for flow - %s"
1254
- msgstr ""
1255
-
1256
- #: modules/flow/classes/class-cartflows-flow-meta.php:412
1257
- #. translators: %s flow id
1258
- msgid "Steps sorted for flow - %s"
1259
- msgstr ""
1260
-
1261
- #: modules/flow/classes/class-cartflows-flow-meta.php:523
1262
- msgid "Analytics"
1263
- msgstr ""
1264
-
1265
- #: modules/flow/classes/class-cartflows-flow-meta.php:540
1266
- #. translators: %s: link
1267
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Analytics feature"
1268
- msgstr ""
1269
-
1270
- #: modules/flow/classes/class-cartflows-flow-meta.php:558
1271
- msgid "Flow Settings"
1272
- msgstr ""
1273
-
1274
- #: modules/flow/classes/class-cartflows-flow-meta.php:643
1275
- msgid "Enable Test Mode"
1276
- msgstr ""
1277
-
1278
- #: modules/flow/classes/class-cartflows-flow-meta.php:650
1279
- msgid ""
1280
- "If you are using WooCommerce plugin then test mode will add random products "
1281
- "in your flow, so you can preview it easily while testing."
1282
- msgstr ""
1283
-
1284
- #: modules/flow/classes/class-cartflows-flow-meta.php:769
1285
- #: modules/flow/view/meta-flow-steps.php:122
1286
- msgid "Add New Step"
1287
- msgstr ""
1288
-
1289
- #: modules/flow/classes/class-cartflows-flow-post-type.php:69
1290
- msgid "Flow: "
1291
- msgstr ""
1292
-
1293
- #: modules/flow/classes/class-cartflows-flow-post-type.php:69
1294
- msgid "Name: "
1295
- msgstr ""
1296
-
1297
- #: modules/flow/classes/class-cartflows-flow-post-type.php:101
1298
- msgid "Search Flows"
1299
- msgstr ""
1300
-
1301
- #: modules/flow/classes/class-cartflows-flow-post-type.php:102
1302
- msgid "All Flows"
1303
- msgstr ""
1304
-
1305
- #: modules/flow/classes/class-cartflows-flow-post-type.php:103
1306
- msgid "Edit Flow"
1307
- msgstr ""
1308
-
1309
- #: modules/flow/classes/class-cartflows-flow-post-type.php:104
1310
- msgid "View Flow"
1311
- msgstr ""
1312
-
1313
- #: modules/flow/classes/class-cartflows-flow-post-type.php:105
1314
- #: modules/flow/classes/class-cartflows-flow-post-type.php:107
1315
- #: modules/flow/classes/class-cartflows-step-post-type.php:166
1316
- #: modules/flow/classes/class-cartflows-step-post-type.php:168
1317
- msgid "Add New"
1318
- msgstr ""
1319
-
1320
- #: modules/flow/classes/class-cartflows-flow-post-type.php:106
1321
- msgid "Update Flow"
1322
- msgstr ""
1323
-
1324
- #: modules/flow/classes/class-cartflows-flow-post-type.php:108
1325
- msgid "New Flow Name"
1326
- msgstr ""
1327
-
1328
- #: modules/flow/classes/class-cartflows-flow-post-type.php:160
1329
- msgid "Slug"
1330
- msgstr ""
1331
-
1332
- #: modules/flow/classes/class-cartflows-flow-post-type.php:283
1333
- msgid "Flows"
1334
- msgstr ""
1335
-
1336
- #: modules/flow/classes/class-cartflows-flow-post-type.php:305
1337
- #: modules/flow/classes/class-cartflows-flow-post-type.php:311
1338
- #: modules/flow/classes/class-cartflows-step-post-type.php:390
1339
- #: modules/flow/classes/class-cartflows-step-post-type.php:396
1340
- #. translators: %s: singular custom post type name
1341
- msgid "%s updated."
1342
- msgstr ""
1343
-
1344
- #: modules/flow/classes/class-cartflows-flow-post-type.php:307
1345
- #: modules/flow/classes/class-cartflows-step-post-type.php:392
1346
- #. translators: %s: singular custom post type name
1347
- msgid "Custom %s updated."
1348
- msgstr ""
1349
-
1350
- #: modules/flow/classes/class-cartflows-flow-post-type.php:309
1351
- #: modules/flow/classes/class-cartflows-step-post-type.php:394
1352
- #. translators: %s: singular custom post type name
1353
- msgid "Custom %s deleted."
1354
- msgstr ""
1355
-
1356
- #: modules/flow/classes/class-cartflows-flow-post-type.php:313
1357
- #: modules/flow/classes/class-cartflows-step-post-type.php:398
1358
- #. translators: %1$s: singular custom post type name ,%2$s: date and time of
1359
- #. the revision
1360
- msgid "%1$s restored to revision from %2$s"
1361
- msgstr ""
1362
-
1363
- #: modules/flow/classes/class-cartflows-flow-post-type.php:315
1364
- #: modules/flow/classes/class-cartflows-step-post-type.php:400
1365
- #. translators: %s: singular custom post type name
1366
- msgid "%s published."
1367
- msgstr ""
1368
-
1369
- #: modules/flow/classes/class-cartflows-flow-post-type.php:317
1370
- #: modules/flow/classes/class-cartflows-step-post-type.php:402
1371
- #. translators: %s: singular custom post type name
1372
- msgid "%s saved."
1373
- msgstr ""
1374
-
1375
- #: modules/flow/classes/class-cartflows-flow-post-type.php:319
1376
- #: modules/flow/classes/class-cartflows-step-post-type.php:404
1377
- #. translators: %s: singular custom post type name
1378
- msgid "%s submitted."
1379
- msgstr ""
1380
-
1381
- #: modules/flow/classes/class-cartflows-flow-post-type.php:321
1382
- #: modules/flow/classes/class-cartflows-step-post-type.php:406
1383
- #. translators: %s: singular custom post type name
1384
- msgid "%s scheduled for."
1385
- msgstr ""
1386
-
1387
- #: modules/flow/classes/class-cartflows-flow-post-type.php:323
1388
- #: modules/flow/classes/class-cartflows-step-post-type.php:408
1389
- #. translators: %s: singular custom post type name
1390
- msgid "%s draft updated."
1391
- msgstr ""
1392
-
1393
- #: modules/flow/classes/class-cartflows-flow-shortcodes.php:148
1394
- #: modules/widgets/class-cartflows-next-step.php:78
1395
- msgid "Next Step"
1396
- msgstr ""
1397
-
1398
- #: modules/flow/classes/class-cartflows-step-post-type.php:162
1399
- msgid "Search Steps"
1400
- msgstr ""
1401
-
1402
- #: modules/flow/classes/class-cartflows-step-post-type.php:163
1403
- msgid "All Steps"
1404
- msgstr ""
1405
-
1406
- #: modules/flow/classes/class-cartflows-step-post-type.php:164
1407
- #: modules/flow/view/meta-flow-steps.php:99
1408
- msgid "Edit Step"
1409
- msgstr ""
1410
-
1411
- #: modules/flow/classes/class-cartflows-step-post-type.php:165
1412
- #: modules/flow/view/meta-flow-steps.php:95
1413
- msgid "View Step"
1414
- msgstr ""
1415
-
1416
- #: modules/flow/classes/class-cartflows-step-post-type.php:167
1417
- msgid "Update Step"
1418
- msgstr ""
1419
-
1420
- #: modules/flow/classes/class-cartflows-step-post-type.php:169
1421
- msgid "New Step Name"
1422
- msgstr ""
1423
-
1424
- #: modules/flow/classes/class-cartflows-step-post-type.php:209
1425
- msgid "Step Type"
1426
- msgstr ""
1427
-
1428
- #: modules/flow/classes/class-cartflows-step-post-type.php:219
1429
- msgid "Step Flow"
1430
- msgstr ""
1431
-
1432
- #: modules/flow/classes/class-cartflows-step-post-type.php:258
1433
- #: modules/flow/view/meta-flow-steps.php:14
1434
- msgid "Upsell (Woo)"
1435
- msgstr ""
1436
-
1437
- #: modules/flow/classes/class-cartflows-step-post-type.php:265
1438
- #: modules/flow/view/meta-flow-steps.php:15
1439
- msgid "Downsell (Woo)"
1440
- msgstr ""
1441
-
1442
- #: modules/flow/view/meta-flow-steps.php:78
1443
- msgid "No Product Assigned"
1444
- msgstr ""
1445
-
1446
- #: modules/flow/view/meta-flow-steps.php:82
1447
- msgid "Global Checkout - Remove selected checkout product"
1448
- msgstr ""
1449
-
1450
- #: modules/flow/view/meta-flow-steps.php:101
1451
- msgid "Edit"
1452
- msgstr ""
1453
-
1454
- #: modules/flow/view/meta-flow-steps.php:103
1455
- msgid "Clone Step"
1456
- msgstr ""
1457
-
1458
- #: modules/flow/view/meta-flow-steps.php:107
1459
- msgid "Delete Step"
1460
- msgstr ""
1461
-
1462
- #: modules/flow/view/meta-flow-steps.php:109
1463
- msgid "Delete"
1464
- msgstr ""
1465
-
1466
- #: modules/flow/view/meta-flow-steps.php:138
1467
- msgid "Steps Library"
1468
- msgstr ""
1469
-
1470
- #: modules/flow/view/meta-flow-steps.php:187
1471
- msgid "Create Step"
1472
- msgstr ""
1473
-
1474
- #: modules/flow/view/meta-flow-steps.php:189
1475
- msgid "You need a Cartflows Pro version to import Upsell / Downsell"
1476
- msgstr ""
1477
-
1478
- #: modules/landing/classes/class-cartflows-landing-meta.php:66
1479
- msgid "Landing Page Settings"
1480
- msgstr ""
1481
-
1482
- #: modules/landing/classes/class-cartflows-landing-meta.php:169
1483
- msgid "Next Step Link"
1484
- msgstr ""
1485
-
1486
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:65
1487
- msgid "Thank You Page Settings"
1488
- msgstr ""
1489
-
1490
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:136
1491
- msgid "Thank You Design"
1492
- msgstr ""
1493
-
1494
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:142
1495
- msgid "Thank You Fields"
1496
- msgstr ""
1497
-
1498
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:176
1499
- msgid "Order Details"
1500
- msgstr ""
1501
-
1502
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:188
1503
- msgid "Text"
1504
- msgstr ""
1505
-
1506
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:194
1507
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:217
1508
- msgid "Color"
1509
- msgstr ""
1510
-
1511
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:243
1512
- msgid "Advanced Options"
1513
- msgstr ""
1514
-
1515
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:253
1516
- msgid "Container Width (In px)"
1517
- msgstr ""
1518
-
1519
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:261
1520
- msgid "Section Background Color"
1521
- msgstr ""
1522
-
1523
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:275
1524
- msgid "Enable Order Overview "
1525
- msgstr ""
1526
-
1527
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:283
1528
- msgid "Enable Order Details "
1529
- msgstr ""
1530
-
1531
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:291
1532
- msgid "Enable Billing Details "
1533
- msgstr ""
1534
-
1535
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:299
1536
- msgid "Enable Shipping Details "
1537
- msgstr ""
1538
-
1539
- #: modules/widgets/class-cartflows-next-step.php:24
1540
- msgid "CartFlows Next Step"
1541
- msgstr ""
1542
-
1543
- #: modules/widgets/class-cartflows-next-step.php:26
1544
- msgid "Next Step Widgets"
1545
- msgstr ""
1546
-
1547
- #: modules/widgets/class-cartflows-next-step.php:106
1548
- msgid "New title"
1549
- msgstr ""
1550
-
1551
- #: modules/widgets/class-cartflows-next-step.php:123
1552
- msgid "Title:"
1553
- msgstr ""
1554
-
1555
- #: modules/widgets/class-cartflows-next-step.php:127
1556
- msgid "Flow ID:"
1557
- msgstr ""
1558
-
1559
- #: modules/widgets/class-cartflows-next-step.php:131
1560
- msgid "Step ID:"
1561
- msgstr ""
1562
-
1563
- #: woocommerce/template/cart/cart-shipping.php:51
1564
- #. Translators: $s shipping destination.
1565
- msgid "Estimate for %s."
1566
- msgstr ""
1567
-
1568
- #: woocommerce/template/cart/cart-shipping.php:52
1569
- msgid "Change address"
1570
- msgstr ""
1571
-
1572
- #: woocommerce/template/cart/cart-shipping.php:54
1573
- msgid "This is only an estimate. Prices will be updated during checkout."
1574
- msgstr ""
1575
-
1576
- #: woocommerce/template/cart/cart-shipping.php:61
1577
- msgid "Enter your address to view shipping options."
1578
- msgstr ""
1579
-
1580
- #: woocommerce/template/cart/cart-shipping.php:63
1581
- msgid ""
1582
- "There are no shipping methods available. Please ensure that your address "
1583
- "has been entered correctly, or contact us if you need any help."
1584
- msgstr ""
1585
-
1586
- #: woocommerce/template/cart/cart-shipping.php:66
1587
- #. Translators: $s shipping destination.
1588
- msgid "No shipping options were found for %s."
1589
- msgstr ""
1590
-
1591
- #: woocommerce/template/cart/cart-shipping.php:67
1592
- msgid "Enter a different address"
1593
- msgstr ""
1594
-
1595
- #: woocommerce/template/checkout/form-billing.php:27
1596
- msgid "Billing &amp; Shipping"
1597
- msgstr ""
1598
-
1599
- #: woocommerce/template/checkout/form-billing.php:31
1600
- msgid "Billing details"
1601
- msgstr ""
1602
-
1603
- #: woocommerce/template/checkout/form-billing.php:59
1604
- msgid "Create an account?"
1605
- msgstr ""
1606
-
1607
- #: woocommerce/template/checkout/form-checkout.php:26
1608
- msgid "You must be logged in to checkout."
1609
- msgstr ""
1610
-
1611
- #: woocommerce/template/checkout/form-checkout.php:52
1612
- msgid "Your order"
1613
- msgstr ""
1614
-
1615
- #: woocommerce/template/checkout/form-coupon.php:26
1616
- msgid "Have a coupon?"
1617
- msgstr ""
1618
-
1619
- #: woocommerce/template/checkout/form-coupon.php:26
1620
- msgid "Click here to enter your code"
1621
- msgstr ""
1622
-
1623
- #: woocommerce/template/checkout/form-coupon.php:31
1624
- msgid "If you have a coupon code, please apply it below."
1625
- msgstr ""
1626
-
1627
- #: woocommerce/template/checkout/form-coupon.php:34
1628
- msgid "Coupon code"
1629
- msgstr ""
1630
-
1631
- #: woocommerce/template/checkout/form-coupon.php:38
1632
- msgid "Apply coupon"
1633
- msgstr ""
1634
-
1635
- #: woocommerce/template/checkout/form-login.php:26
1636
- msgid "Returning customer?"
1637
- msgstr ""
1638
-
1639
- #: woocommerce/template/checkout/form-login.php:26
1640
- msgid "Click here to login"
1641
- msgstr ""
1642
-
1643
- #: woocommerce/template/checkout/form-login.php:32
1644
- msgid ""
1645
- "If you have shopped with us before, please enter your details below. If you "
1646
- "are a new customer, please proceed to the Billing &amp; Shipping section."
1647
- msgstr ""
1648
-
1649
- #: woocommerce/template/checkout/form-shipping.php:26
1650
- msgid "Ship to a different address?"
1651
- msgstr ""
1652
-
1653
- #: woocommerce/template/checkout/form-shipping.php:57
1654
- msgid "Additional information"
1655
- msgstr ""
1656
-
1657
- #: woocommerce/template/checkout/payment.php:33
1658
- msgid ""
1659
- "Sorry, it seems that there are no available payment methods for your state. "
1660
- "Please contact us if you require assistance or wish to make alternate "
1661
- "arrangements."
1662
- msgstr ""
1663
-
1664
- #: woocommerce/template/checkout/payment.php:33
1665
- msgid "Please fill in your details above to see available payment methods."
1666
- msgstr ""
1667
-
1668
- #: woocommerce/template/checkout/payment.php:42
1669
- #. translators: $1 and $2 opening and closing emphasis tags respectively
1670
- msgid ""
1671
- "Since your browser does not support JavaScript, or it is disabled, please "
1672
- "ensure you click the %1$sUpdate Totals%2$s button before placing your "
1673
- "order. You may be charged more than the amount stated above if you fail to "
1674
- "do so."
1675
- msgstr ""
1676
-
1677
- #: woocommerce/template/checkout/payment.php:44
1678
- msgid "Update totals"
1679
- msgstr ""
1680
-
1681
- #: woocommerce/template/checkout/review-order.php:26
1682
- msgid "Product"
1683
- msgstr ""
1684
-
1685
- #: woocommerce/template/checkout/review-order.php:27
1686
- #: woocommerce/template/checkout/review-order.php:107
1687
- msgid "Total"
1688
- msgstr ""
1689
-
1690
- #: woocommerce/template/checkout/review-order.php:60
1691
- msgid "Subtotal"
1692
- msgstr ""
1693
-
1694
- #: woocommerce/template/checkout/thankyou.php:30
1695
- msgid ""
1696
- "Unfortunately your order cannot be processed as the originating "
1697
- "bank/merchant has declined your transaction. Please attempt your purchase "
1698
- "again."
1699
- msgstr ""
1700
-
1701
- #: woocommerce/template/checkout/thankyou.php:33
1702
- msgid "Pay"
1703
- msgstr ""
1704
-
1705
- #: woocommerce/template/checkout/thankyou.php:35
1706
- msgid "My account"
1707
- msgstr ""
1708
-
1709
- #: woocommerce/template/checkout/thankyou.php:41
1710
- #: woocommerce/template/checkout/thankyou.php:83
1711
- msgid "Thank you. Your order has been received."
1712
- msgstr ""
1713
-
1714
- #: woocommerce/template/checkout/thankyou.php:46
1715
- msgid "Order number:"
1716
- msgstr ""
1717
-
1718
- #: woocommerce/template/checkout/thankyou.php:51
1719
- msgid "Date:"
1720
- msgstr ""
1721
-
1722
- #: woocommerce/template/checkout/thankyou.php:57
1723
- msgid "Email:"
1724
- msgstr ""
1725
-
1726
- #: woocommerce/template/checkout/thankyou.php:63
1727
- msgid "Total:"
1728
- msgstr ""
1729
-
1730
- #: woocommerce/template/checkout/thankyou.php:69
1731
- msgid "Payment method:"
1732
- msgstr ""
1733
-
1734
- #: woocommerce/template/global/form-login.php:34
1735
- msgid "Username or email"
1736
- msgstr ""
1737
-
1738
- #: woocommerce/template/global/form-login.php:38
1739
- msgid "Password"
1740
- msgstr ""
1741
-
1742
- #: woocommerce/template/global/form-login.php:48
1743
- msgid "Login"
1744
- msgstr ""
1745
-
1746
- #: woocommerce/template/global/form-login.php:53
1747
- msgid "Remember me"
1748
- msgstr ""
1749
-
1750
- #: woocommerce/template/global/form-login.php:57
1751
- msgid "Lost your password?"
1752
- msgstr ""
1753
-
1754
- #. Plugin Name of the plugin/theme
1755
- msgid "CartFlows"
1756
- msgstr ""
1757
-
1758
- #. Author URI of the plugin/theme
1759
- msgid "https://cartflows.com/"
1760
- msgstr ""
1761
-
1762
- #. Description of the plugin/theme
1763
- msgid "Create beautiful checkout pages & sales flows for WooCommerce."
1764
- msgstr ""
1765
-
1766
- #. Author of the plugin/theme
1767
- msgid "CartFlows Inc"
1768
- msgstr ""
1769
-
1770
- #: modules/flow/classes/class-cartflows-flow-post-type.php:99
1771
- msgctxt "flow general name"
1772
- msgid "Flows"
1773
- msgstr ""
1774
-
1775
- #: modules/flow/classes/class-cartflows-flow-post-type.php:100
1776
- msgctxt "flow singular name"
1777
- msgid "Flow"
1778
- msgstr ""
1779
-
1780
- #: modules/flow/classes/class-cartflows-step-post-type.php:160
1781
- msgctxt "flow step general name"
1782
- msgid "Steps"
1783
- msgstr ""
1784
-
1785
- #: modules/flow/classes/class-cartflows-step-post-type.php:161
1786
- msgctxt "flow step singular name"
1787
- msgid "Step"
1788
- msgstr ""
1789
-
1790
- #: modules/flow/classes/class-cartflows-step-post-type.php:306
1791
- msgctxt "cartflows"
1792
- msgid "CartFlows Boxed"
1793
- msgstr ""
1794
-
1795
- #: modules/flow/classes/class-cartflows-step-post-type.php:307
1796
- msgctxt "cartflows"
1797
- msgid "Template for Page Builders"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1798
  msgstr ""
1
+ # Copyright (C) 2020 CartFlows Inc
2
+ # This file is distributed under the same license as the CartFlows package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: CartFlows 1.3.4\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
+ "POT-Creation-Date: 2020-01-14 07:19: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"
11
+ "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+ "Language: en\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+ "X-Poedit-Country: United States\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-KeywordsList: "
19
+ "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
20
+ "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
21
+ "X-Poedit-Basepath: ../\n"
22
+ "X-Poedit-SearchPath-0: .\n"
23
+ "X-Poedit-Bookmarks: \n"
24
+ "X-Textdomain-Support: yes\n"
25
+ "X-Generator: grunt-wp-i18n 1.0.3\n"
26
+
27
+ #: classes/batch-process/class-cartflows-importer-elementor.php:44
28
+ msgid "Invalid content."
29
+ msgstr ""
30
+
31
+ #: classes/batch-process/class-cartflows-importer-elementor.php:52
32
+ msgid "Invalid content. Expected an array."
33
+ msgstr ""
34
+
35
+ #: classes/batch-process/helpers/class-wp-background-process.php:435
36
+ msgid "Every %d Minutes"
37
+ msgstr ""
38
+
39
+ #: classes/class-cartflows-admin-fields.php:231
40
+ msgid "Select"
41
+ msgstr ""
42
+
43
+ #: classes/class-cartflows-admin-fields.php:234
44
+ msgid "No Checkout Steps"
45
+ msgstr ""
46
+
47
+ #: classes/class-cartflows-admin-fields.php:260
48
+ #. translators: %s: link
49
+ msgid ""
50
+ "Be sure not to add any product in above selected Global Checkout step. "
51
+ "Please read information about how to set up Global Checkout %1$shere%2$s."
52
+ msgstr ""
53
+
54
+ #: classes/class-cartflows-admin.php:153 classes/class-cartflows-admin.php:154
55
+ #: includes/admin/cartflows-general-bck.php:34
56
+ msgid "Settings"
57
+ msgstr ""
58
+
59
+ #: classes/class-cartflows-admin.php:405
60
+ msgid "Installing and activating.."
61
+ msgstr ""
62
+
63
+ #: classes/class-cartflows-admin.php:406
64
+ msgid "There was an error with the installation of plugin."
65
+ msgstr ""
66
+
67
+ #: classes/class-cartflows-admin.php:460
68
+ msgid "Flows Library"
69
+ msgstr ""
70
+
71
+ #: classes/class-cartflows-admin.php:467
72
+ #: modules/flow/view/meta-flow-steps.php:149
73
+ msgid "Ready Templates"
74
+ msgstr ""
75
+
76
+ #: classes/class-cartflows-admin.php:470
77
+ #: modules/flow/view/meta-flow-steps.php:152
78
+ msgid "Create Your Own"
79
+ msgstr ""
80
+
81
+ #: classes/class-cartflows-admin.php:481
82
+ #: modules/flow/view/meta-flow-steps.php:164
83
+ msgid "Search Sites"
84
+ msgstr ""
85
+
86
+ #: classes/class-cartflows-admin.php:482
87
+ #: modules/flow/view/meta-flow-steps.php:165
88
+ msgid "Search Flow..."
89
+ msgstr ""
90
+
91
+ #: classes/class-cartflows-admin.php:499
92
+ msgid "Design Your Flow"
93
+ msgstr ""
94
+
95
+ #: classes/class-cartflows-admin.php:500
96
+ #: classes/class-cartflows-importer.php:636
97
+ #: classes/class-cartflows-importer.php:735
98
+ #: modules/flow/view/meta-flow-steps.php:195
99
+ msgid "Learn How"
100
+ msgstr ""
101
+
102
+ #: classes/class-cartflows-api.php:368
103
+ msgid "Request successfully processed!"
104
+ msgstr ""
105
+
106
+ #: classes/class-cartflows-cloning.php:423
107
+ msgid "Clone this flow"
108
+ msgstr ""
109
+
110
+ #: classes/class-cartflows-cloning.php:423
111
+ #: modules/flow/view/meta-flow-steps.php:108
112
+ msgid "Clone"
113
+ msgstr ""
114
+
115
+ #: classes/class-cartflows-flow-frontend.php:53
116
+ msgid ""
117
+ "Test mode is active — which displays random products for previewing. It can "
118
+ "be deactivated from the flow settings in the admin dashboard."
119
+ msgstr ""
120
+
121
+ #: classes/class-cartflows-flow-frontend.php:58
122
+ msgid "Click here to disable it"
123
+ msgstr ""
124
+
125
+ #: classes/class-cartflows-importer.php:80
126
+ msgid "Export this flow"
127
+ msgstr ""
128
+
129
+ #: classes/class-cartflows-importer.php:80 includes/exporter.php:18
130
+ msgid "Export"
131
+ msgstr ""
132
+
133
+ #: classes/class-cartflows-importer.php:91
134
+ msgid "Flow Export"
135
+ msgstr ""
136
+
137
+ #: classes/class-cartflows-importer.php:92
138
+ msgid "Flow Import"
139
+ msgstr ""
140
+
141
+ #: classes/class-cartflows-importer.php:103
142
+ msgid "No post to export has been supplied!"
143
+ msgstr ""
144
+
145
+ #: classes/class-cartflows-importer.php:294
146
+ msgid "Please upload a valid .json file"
147
+ msgstr ""
148
+
149
+ #: classes/class-cartflows-importer.php:300
150
+ msgid "Please upload a file to import"
151
+ msgstr ""
152
+
153
+ #: classes/class-cartflows-importer.php:477
154
+ msgid "Successfully imported flows."
155
+ msgstr ""
156
+
157
+ #: classes/class-cartflows-importer.php:509
158
+ msgid "Loading Steps"
159
+ msgstr ""
160
+
161
+ #: classes/class-cartflows-importer.php:511
162
+ msgid "Getting steps from the cloud. Please wait for the moment."
163
+ msgstr ""
164
+
165
+ #: classes/class-cartflows-importer.php:522
166
+ msgid "Searching Template.."
167
+ msgstr ""
168
+
169
+ #: classes/class-cartflows-importer.php:524
170
+ msgid "Getting templates from the cloud. Please wait for the moment."
171
+ msgstr ""
172
+
173
+ #: classes/class-cartflows-importer.php:533
174
+ msgid "Importing.."
175
+ msgstr ""
176
+
177
+ #: classes/class-cartflows-importer.php:542
178
+ #: classes/class-cartflows-importer.php:582
179
+ msgid "Imported"
180
+ msgstr ""
181
+
182
+ #: classes/class-cartflows-importer.php:543
183
+ #: classes/class-cartflows-importer.php:583
184
+ msgid "Thanks for patience"
185
+ msgstr ""
186
+
187
+ #: classes/class-cartflows-importer.php:552
188
+ #: classes/class-cartflows-importer.php:564
189
+ msgid "Coming Soon!"
190
+ msgstr ""
191
+
192
+ #: classes/class-cartflows-importer.php:583
193
+ msgid "Redirecting to the Elementor edit window."
194
+ msgstr ""
195
+
196
+ #: classes/class-cartflows-importer.php:629
197
+ #: classes/class-cartflows-importer.php:745
198
+ msgid "Pro"
199
+ msgstr ""
200
+
201
+ #: classes/class-cartflows-importer.php:670
202
+ #: classes/class-cartflows-importer.php:777
203
+ msgid "Activate License"
204
+ msgstr ""
205
+
206
+ #: classes/class-cartflows-importer.php:672
207
+ #: classes/class-cartflows-importer.php:779
208
+ #: modules/flow/classes/class-cartflows-flow-meta.php:541
209
+ msgid "Get Pro"
210
+ msgstr ""
211
+
212
+ #: classes/class-cartflows-importer.php:697
213
+ msgid "Create"
214
+ msgstr ""
215
+
216
+ #: classes/class-cartflows-importer.php:796
217
+ msgid "Under Maintenance.."
218
+ msgstr ""
219
+
220
+ #: classes/class-cartflows-importer.php:797
221
+ msgid ""
222
+ "If you are seeing this message, most likely our servers are under routine "
223
+ "maintenance and we will be back shortly."
224
+ msgstr ""
225
+
226
+ #: classes/class-cartflows-importer.php:798
227
+ msgid ""
228
+ "In rare case, it is possible your website is having trouble connecting with "
229
+ "ours. If you need help, please feel free to get in touch with us from our "
230
+ "website.."
231
+ msgstr ""
232
+
233
+ #: classes/class-cartflows-importer.php:828
234
+ #. translators: %s: Plugin string
235
+ msgid ""
236
+ "%1$s to see CartFlows templates. If you prefer another page builder tool, "
237
+ "you can <a href=\"%2$s\" target=\"blank\">select it here</a>."
238
+ msgstr ""
239
+
240
+ #: classes/class-cartflows-importer.php:843
241
+ msgid "All"
242
+ msgstr ""
243
+
244
+ #: classes/class-cartflows-importer.php:846
245
+ msgid "Select Step Type"
246
+ msgstr ""
247
+
248
+ #: classes/class-cartflows-importer.php:922
249
+ msgid "Import from Cloud"
250
+ msgstr ""
251
+
252
+ #: classes/class-cartflows-importer.php:1236
253
+ msgid "Sales Landing"
254
+ msgstr ""
255
+
256
+ #: classes/class-cartflows-importer.php:1240
257
+ #: modules/flow/classes/class-cartflows-step-post-type.php:244
258
+ #: modules/flow/view/meta-flow-steps.php:12
259
+ msgid "Checkout (Woo)"
260
+ msgstr ""
261
+
262
+ #: classes/class-cartflows-importer.php:1244
263
+ #: modules/flow/classes/class-cartflows-step-post-type.php:251
264
+ #: modules/flow/view/meta-flow-steps.php:13
265
+ msgid "Thank You (Woo)"
266
+ msgstr ""
267
+
268
+ #: classes/class-cartflows-importer.php:1252
269
+ #: modules/flow/classes/class-cartflows-step-post-type.php:237
270
+ #: modules/flow/view/meta-flow-steps.php:11
271
+ msgid "Landing"
272
+ msgstr ""
273
+
274
+ #: classes/class-cartflows-importer.php:1256
275
+ msgid "Thank You"
276
+ msgstr ""
277
+
278
+ #: classes/class-cartflows-importer.php:1358
279
+ #. translators: %s: template ID
280
+ msgid "Invalid template id %1$s or post id %2$s."
281
+ msgstr ""
282
+
283
+ #: classes/class-cartflows-importer.php:1416
284
+ #. translators: %s: flow ID
285
+ msgid "Invalid flow id %1$s OR step type %2$s."
286
+ msgstr ""
287
+
288
+ #: classes/class-cartflows-importer.php:1541
289
+ msgid ""
290
+ "Elementor is not activated. Please activate plugin Elementor Page Builder "
291
+ "to import the step."
292
+ msgstr ""
293
+
294
+ #: classes/class-cartflows-importer.php:1644
295
+ msgid "Action failed. Invalid Security Nonce."
296
+ msgstr ""
297
+
298
+ #: classes/class-cartflows-importer.php:1651
299
+ msgid "User have not plugin install permissions."
300
+ msgstr ""
301
+
302
+ #: classes/class-cartflows-importer.php:1673
303
+ msgid "Plugin Successfully Activated"
304
+ msgstr ""
305
+
306
+ #: classes/class-cartflows-learndash-compatibility.php:86
307
+ msgid "None"
308
+ msgstr ""
309
+
310
+ #: classes/class-cartflows-learndash-compatibility.php:113
311
+ #. translators: 1: anchor start, 2: anchor close
312
+ msgid ""
313
+ "Non-enrolled students will redirect to the selected CartFlows template. If "
314
+ "you have not created any Flow already, add new Flow from %1$shere%2$s."
315
+ msgstr ""
316
+
317
+ #: classes/class-cartflows-learndash-compatibility.php:119
318
+ msgid "Select CartFlows Template for this Course"
319
+ msgstr ""
320
+
321
+ #: classes/class-cartflows-loader.php:225
322
+ #. translators: %s: html tags
323
+ msgid ""
324
+ "You are using an older version of %1$sCartFlows Pro%2$s. Please update "
325
+ "%1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher."
326
+ msgstr ""
327
+
328
+ #: classes/class-cartflows-loader.php:482
329
+ #. translators: %s: html tags
330
+ msgid ""
331
+ "This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & "
332
+ "activated."
333
+ msgstr ""
334
+
335
+ #: classes/class-cartflows-loader.php:492
336
+ msgid "Activate WooCommerce"
337
+ msgstr ""
338
+
339
+ #: classes/class-cartflows-loader.php:500
340
+ msgid "Install WooCommerce"
341
+ msgstr ""
342
+
343
+ #: classes/class-cartflows-logger.php:161
344
+ msgid "Action failed. Please refresh the page and retry."
345
+ msgstr ""
346
+
347
+ #: classes/class-cartflows-meta-fields.php:86
348
+ msgid "Thin 100"
349
+ msgstr ""
350
+
351
+ #: classes/class-cartflows-meta-fields.php:87
352
+ msgid "Extra-Light 200"
353
+ msgstr ""
354
+
355
+ #: classes/class-cartflows-meta-fields.php:88
356
+ msgid "Light 300"
357
+ msgstr ""
358
+
359
+ #: classes/class-cartflows-meta-fields.php:89
360
+ msgid "Normal 400"
361
+ msgstr ""
362
+
363
+ #: classes/class-cartflows-meta-fields.php:90
364
+ msgid "Medium 500"
365
+ msgstr ""
366
+
367
+ #: classes/class-cartflows-meta-fields.php:91
368
+ msgid "Semi-Bold 600"
369
+ msgstr ""
370
+
371
+ #: classes/class-cartflows-meta-fields.php:92
372
+ msgid "Bold 700"
373
+ msgstr ""
374
+
375
+ #: classes/class-cartflows-meta-fields.php:93
376
+ msgid "Extra-Bold 800"
377
+ msgstr ""
378
+
379
+ #: classes/class-cartflows-meta-fields.php:94
380
+ msgid "Ultra-Bold 900"
381
+ msgstr ""
382
+
383
+ #: classes/class-cartflows-meta-fields.php:217
384
+ #: classes/class-cartflows-meta-fields.php:325
385
+ #: classes/class-cartflows-meta-fields.php:1426
386
+ msgid "Remove"
387
+ msgstr ""
388
+
389
+ #: classes/class-cartflows-meta-fields.php:446
390
+ msgid "Field Width"
391
+ msgstr ""
392
+
393
+ #: classes/class-cartflows-meta-fields.php:450
394
+ msgid "33%"
395
+ msgstr ""
396
+
397
+ #: classes/class-cartflows-meta-fields.php:451
398
+ msgid "50%"
399
+ msgstr ""
400
+
401
+ #: classes/class-cartflows-meta-fields.php:452
402
+ msgid "100%"
403
+ msgstr ""
404
+
405
+ #: classes/class-cartflows-meta-fields.php:463
406
+ msgid "Field Label"
407
+ msgstr ""
408
+
409
+ #: classes/class-cartflows-meta-fields.php:477
410
+ msgid "Options"
411
+ msgstr ""
412
+
413
+ #: classes/class-cartflows-meta-fields.php:492
414
+ #: classes/class-cartflows-meta-fields.php:505
415
+ #: includes/admin/cartflows-general.php:123
416
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:569
417
+ msgid "Default"
418
+ msgstr ""
419
+
420
+ #: classes/class-cartflows-meta-fields.php:496
421
+ msgid "Checked"
422
+ msgstr ""
423
+
424
+ #: classes/class-cartflows-meta-fields.php:497
425
+ msgid "Un-Checked"
426
+ msgstr ""
427
+
428
+ #: classes/class-cartflows-meta-fields.php:518
429
+ msgid "Placeholder"
430
+ msgstr ""
431
+
432
+ #: classes/class-cartflows-meta-fields.php:530
433
+ msgid "Required"
434
+ msgstr ""
435
+
436
+ #: classes/class-cartflows-meta-fields.php:542
437
+ msgid "Enable this field"
438
+ msgstr ""
439
+
440
+ #: classes/class-cartflows-meta-fields.php:562
441
+ msgid "Label"
442
+ msgstr ""
443
+
444
+ #: classes/class-cartflows-meta-fields.php:999
445
+ #: classes/class-cartflows-meta-fields.php:1418
446
+ msgid "Search for a product&hellip;"
447
+ msgstr ""
448
+
449
+ #: classes/class-cartflows-meta-fields.php:1040
450
+ msgid "Search for a coupon&hellip;"
451
+ msgstr ""
452
+
453
+ #: classes/class-cartflows-meta.php:34
454
+ msgid "Update"
455
+ msgstr ""
456
+
457
+ #: classes/class-cartflows-meta.php:42
458
+ #: modules/flow/classes/class-cartflows-flow-meta.php:84
459
+ msgid "Back to edit Flow"
460
+ msgstr ""
461
+
462
+ #: classes/class-cartflows-meta.php:63
463
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:192
464
+ #: modules/landing/classes/class-cartflows-landing-meta.php:136
465
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:148
466
+ msgid "Custom Script"
467
+ msgstr ""
468
+
469
+ #: classes/class-cartflows-meta.php:66
470
+ msgid ""
471
+ "Custom script lets you add your own custom script on front end of this flow "
472
+ "page."
473
+ msgstr ""
474
+
475
+ #: classes/class-cartflows-metabox.php:59
476
+ msgid "Flow Details"
477
+ msgstr ""
478
+
479
+ #: classes/class-cartflows-wizard.php:83
480
+ msgid "Thanks for installing and using CartFlows!"
481
+ msgstr ""
482
+
483
+ #: classes/class-cartflows-wizard.php:84
484
+ msgid ""
485
+ "It is easy to use the CartFlows. Please use the setup wizard to quick start "
486
+ "setup."
487
+ msgstr ""
488
+
489
+ #: classes/class-cartflows-wizard.php:86
490
+ msgid "Start Wizard"
491
+ msgstr ""
492
+
493
+ #: classes/class-cartflows-wizard.php:87
494
+ msgid "Skip Setup"
495
+ msgstr ""
496
+
497
+ #: classes/class-cartflows-wizard.php:117
498
+ #: includes/admin/cartflows-general-bck.php:24
499
+ msgid "Welcome"
500
+ msgstr ""
501
+
502
+ #: classes/class-cartflows-wizard.php:122
503
+ msgid "Page Builder"
504
+ msgstr ""
505
+
506
+ #: classes/class-cartflows-wizard.php:126
507
+ msgid "Checkout"
508
+ msgstr ""
509
+
510
+ #: classes/class-cartflows-wizard.php:130
511
+ msgid "Training"
512
+ msgstr ""
513
+
514
+ #: classes/class-cartflows-wizard.php:134
515
+ msgid "Ready!"
516
+ msgstr ""
517
+
518
+ #: classes/class-cartflows-wizard.php:208
519
+ msgid "CartFlows Setup"
520
+ msgstr ""
521
+
522
+ #: classes/class-cartflows-wizard.php:234
523
+ msgid "Exit Setup Wizard"
524
+ msgstr ""
525
+
526
+ #: classes/class-cartflows-wizard.php:287
527
+ msgid "Welcome to CartFlows!"
528
+ msgstr ""
529
+
530
+ #: classes/class-cartflows-wizard.php:288
531
+ msgid ""
532
+ "Thank you for choosing CartFlows to get more leads, increase conversions, & "
533
+ "maximize profits. This short setup wizard will guide you though configuring "
534
+ "CartFlows and creating your first funnel."
535
+ msgstr ""
536
+
537
+ #: classes/class-cartflows-wizard.php:294
538
+ msgid "Lets Go »"
539
+ msgstr ""
540
+
541
+ #: classes/class-cartflows-wizard.php:321
542
+ msgid "Page Builder Setup"
543
+ msgstr ""
544
+
545
+ #: classes/class-cartflows-wizard.php:322
546
+ msgid "Please select a page builder you would like to use with CartFlows."
547
+ msgstr ""
548
+
549
+ #: classes/class-cartflows-wizard.php:327
550
+ msgid "Select Page Builder"
551
+ msgstr ""
552
+
553
+ #: classes/class-cartflows-wizard.php:334
554
+ #: includes/admin/cartflows-general.php:88
555
+ msgid "Elementor"
556
+ msgstr ""
557
+
558
+ #: classes/class-cartflows-wizard.php:344
559
+ msgid "Beaver Builder Plugin (Lite Version)"
560
+ msgstr ""
561
+
562
+ #: classes/class-cartflows-wizard.php:354
563
+ #: includes/admin/cartflows-general.php:90
564
+ msgid "Divi"
565
+ msgstr ""
566
+
567
+ #: classes/class-cartflows-wizard.php:364
568
+ #: includes/admin/cartflows-general.php:91
569
+ msgid "Other"
570
+ msgstr ""
571
+
572
+ #: classes/class-cartflows-wizard.php:386
573
+ msgid ""
574
+ "While CartFlows Should work with most page builders, we offer templates for "
575
+ "the above page builders."
576
+ msgstr ""
577
+
578
+ #: classes/class-cartflows-wizard.php:389
579
+ #: classes/class-cartflows-wizard.php:434
580
+ #: classes/class-cartflows-wizard.php:613
581
+ msgid "« Previous"
582
+ msgstr ""
583
+
584
+ #: classes/class-cartflows-wizard.php:392
585
+ msgid "Skip this step"
586
+ msgstr ""
587
+
588
+ #: classes/class-cartflows-wizard.php:393
589
+ msgid "Next »"
590
+ msgstr ""
591
+
592
+ #: classes/class-cartflows-wizard.php:412
593
+ msgid "Choose a checkout"
594
+ msgstr ""
595
+
596
+ #: classes/class-cartflows-wizard.php:415
597
+ msgid ""
598
+ "While CartFlows is designed to use WooCommerce sell digital and physical "
599
+ "products, not all funnels need a checkout system."
600
+ msgstr ""
601
+
602
+ #: classes/class-cartflows-wizard.php:417
603
+ msgid ""
604
+ "Would you like to install WooCommerce to sell digital and physical products "
605
+ "in your funnels?"
606
+ msgstr ""
607
+
608
+ #: classes/class-cartflows-wizard.php:424
609
+ msgid "The following plugin will be installed and activated for you:"
610
+ msgstr ""
611
+
612
+ #: classes/class-cartflows-wizard.php:425
613
+ msgid "WooCommerce"
614
+ msgstr ""
615
+
616
+ #: classes/class-cartflows-wizard.php:426
617
+ msgid "WooCommerce Cart Abandonment Recovery"
618
+ msgstr ""
619
+
620
+ #: classes/class-cartflows-wizard.php:437
621
+ #: classes/class-cartflows-wizard.php:616
622
+ msgid "No thanks"
623
+ msgstr ""
624
+
625
+ #: classes/class-cartflows-wizard.php:438
626
+ msgid "Yes"
627
+ msgstr ""
628
+
629
+ #: classes/class-cartflows-wizard.php:549
630
+ msgid "Congratulations, You Did It!"
631
+ msgstr ""
632
+
633
+ #: classes/class-cartflows-wizard.php:556
634
+ msgid ""
635
+ "CartFlows is ready to use on your website. You've successfully completed "
636
+ "the setup process and all that is left for you to do is create your first "
637
+ "flow."
638
+ msgstr ""
639
+
640
+ #: classes/class-cartflows-wizard.php:570
641
+ msgid "Create a flow"
642
+ msgstr ""
643
+
644
+ #: classes/class-cartflows-wizard.php:587
645
+ msgid "Exclusive CartFlows Training Course Offer"
646
+ msgstr ""
647
+
648
+ #: classes/class-cartflows-wizard.php:598
649
+ msgid ""
650
+ "We want you to get off to a great start using CartFlows, so we would like "
651
+ "to give access to our exclusive training course."
652
+ msgstr ""
653
+
654
+ #: classes/class-cartflows-wizard.php:599
655
+ msgid "Get access to this couse, for free, by entering your email below."
656
+ msgstr ""
657
+
658
+ #: classes/class-cartflows-wizard.php:601
659
+ msgid "Enter Email address"
660
+ msgstr ""
661
+
662
+ #: classes/class-cartflows-wizard.php:617
663
+ msgid "Allow"
664
+ msgstr ""
665
+
666
+ #: classes/logger/class-cartflows-log-handler-file.php:351
667
+ #: classes/logger/class-cartflows-log-handler-file.php:371
668
+ msgid "This method should not be called before plugins_loaded."
669
+ msgstr ""
670
+
671
+ #: classes/logger/class-cartflows-wc-logger.php:58
672
+ #. translators: 1: class name 2: Cartflows_Log_Handler_Interface
673
+ msgid "The provided handler %1$s does not implement %2$s."
674
+ msgstr ""
675
+
676
+ #: classes/logger/class-cartflows-wc-logger.php:136
677
+ #. translators: 1: Cartflows_WC_Logger::log 2: level
678
+ msgid "%1$s was called with an invalid level \"%2$s\"."
679
+ msgstr ""
680
+
681
+ #: includes/admin/cartflows-admin.php:19
682
+ #: includes/admin/cartflows-general.php:44
683
+ msgid "Modernizing WordPress eCommerce!"
684
+ msgstr ""
685
+
686
+ #: includes/admin/cartflows-admin.php:29
687
+ msgid "Settings saved successfully."
688
+ msgstr ""
689
+
690
+ #: includes/admin/cartflows-error-log.php:36
691
+ msgid "%1$s at %2$s"
692
+ msgstr ""
693
+
694
+ #: includes/admin/cartflows-error-log.php:41
695
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:225
696
+ #: modules/flow/view/meta-flow-steps.php:97
697
+ msgid "View"
698
+ msgstr ""
699
+
700
+ #: includes/admin/cartflows-error-log.php:65
701
+ msgid "Delete log"
702
+ msgstr ""
703
+
704
+ #: includes/admin/cartflows-error-log.php:70
705
+ msgid "There are currently no logs to view."
706
+ msgstr ""
707
+
708
+ #: includes/admin/cartflows-general-bck.php:10
709
+ msgid "Selec"
710
+ msgstr ""
711
+
712
+ #: includes/admin/cartflows-general-bck.php:22
713
+ msgid "General"
714
+ msgstr ""
715
+
716
+ #: includes/admin/cartflows-general.php:29
717
+ #: includes/admin/cartflows-general.php:52
718
+ msgid "General Settings"
719
+ msgstr ""
720
+
721
+ #: includes/admin/cartflows-general.php:36
722
+ msgid "Getting Started"
723
+ msgstr ""
724
+
725
+ #: includes/admin/cartflows-general.php:65
726
+ msgid "Disallow search engines from indexing flows"
727
+ msgstr ""
728
+
729
+ #: includes/admin/cartflows-general.php:75
730
+ #: modules/flow/view/meta-flow-steps.php:86
731
+ msgid "Global Checkout"
732
+ msgstr ""
733
+
734
+ #: includes/admin/cartflows-general.php:84
735
+ msgid "Show Templates designed with"
736
+ msgstr ""
737
+
738
+ #: includes/admin/cartflows-general.php:85
739
+ msgid ""
740
+ "CartFlows offers flow templates that can be imported in one click. These "
741
+ "templates are available in few different page builders. Please choose your "
742
+ "preferred page builder from the list so you will only see templates that "
743
+ "are made using that page builder.."
744
+ msgstr ""
745
+
746
+ #: includes/admin/cartflows-general.php:89
747
+ msgid "Beaver Builder"
748
+ msgstr ""
749
+
750
+ #: includes/admin/cartflows-general.php:100
751
+ #: includes/admin/cartflows-general.php:182
752
+ #: includes/admin/cartflows-general.php:267
753
+ msgid "Save Changes"
754
+ msgstr ""
755
+
756
+ #: includes/admin/cartflows-general.php:108
757
+ msgid "Permalink Settings"
758
+ msgstr ""
759
+
760
+ #: includes/admin/cartflows-general.php:129
761
+ msgid "Flow and Step Slug"
762
+ msgstr ""
763
+
764
+ #: includes/admin/cartflows-general.php:135
765
+ msgid "Flow Slug"
766
+ msgstr ""
767
+
768
+ #: includes/admin/cartflows-general.php:141
769
+ msgid "Step Slug"
770
+ msgstr ""
771
+
772
+ #: includes/admin/cartflows-general.php:153
773
+ msgid "Post Type Permalink Base"
774
+ msgstr ""
775
+
776
+ #: includes/admin/cartflows-general.php:161
777
+ msgid "Step Base"
778
+ msgstr ""
779
+
780
+ #: includes/admin/cartflows-general.php:171
781
+ msgid "Flow Base"
782
+ msgstr ""
783
+
784
+ #: includes/admin/cartflows-general.php:183
785
+ msgid "Set Default"
786
+ msgstr ""
787
+
788
+ #: includes/admin/cartflows-general.php:196
789
+ msgid "Facebook Pixel Settings"
790
+ msgstr ""
791
+
792
+ #: includes/admin/cartflows-general.php:211
793
+ msgid "Enable Facebook Pixel Tracking"
794
+ msgstr ""
795
+
796
+ #: includes/admin/cartflows-general.php:222
797
+ msgid "Enter Facebook pixel ID"
798
+ msgstr ""
799
+
800
+ #: includes/admin/cartflows-general.php:230
801
+ msgid "Enable Events:"
802
+ msgstr ""
803
+
804
+ #: includes/admin/cartflows-general.php:239
805
+ msgid "Initiate Checkout"
806
+ msgstr ""
807
+
808
+ #: includes/admin/cartflows-general.php:248
809
+ msgid "Add Payment Info"
810
+ msgstr ""
811
+
812
+ #: includes/admin/cartflows-general.php:257
813
+ msgid "Purchase Complete"
814
+ msgstr ""
815
+
816
+ #: includes/admin/cartflows-general.php:284
817
+ msgid "Knowledge Base"
818
+ msgstr ""
819
+
820
+ #: includes/admin/cartflows-general.php:288
821
+ msgid "Not sure how something works? Take a peek at the knowledge base and learn."
822
+ msgstr ""
823
+
824
+ #: includes/admin/cartflows-general.php:291
825
+ msgid "Visit Knowledge Base »"
826
+ msgstr ""
827
+
828
+ #: includes/admin/cartflows-general.php:299
829
+ msgid "Community"
830
+ msgstr ""
831
+
832
+ #: includes/admin/cartflows-general.php:303
833
+ msgid ""
834
+ "Join the community of super helpful CartFlows users. Say hello, ask "
835
+ "questions, give feedback and help each other!"
836
+ msgstr ""
837
+
838
+ #: includes/admin/cartflows-general.php:306
839
+ msgid "Join Our Facebook Group »"
840
+ msgstr ""
841
+
842
+ #: includes/admin/cartflows-general.php:314
843
+ msgid "Five Star Support"
844
+ msgstr ""
845
+
846
+ #: includes/admin/cartflows-general.php:318
847
+ msgid "Got a question? Get in touch with CartFlows developers. We're happy to help!"
848
+ msgstr ""
849
+
850
+ #: includes/admin/cartflows-general.php:321
851
+ msgid "Submit a Ticket »"
852
+ msgstr ""
853
+
854
+ #: includes/admin/cartflows-general.php:331
855
+ msgid "Load Minified CSS"
856
+ msgstr ""
857
+
858
+ #: includes/admin/cartflows-general.php:336
859
+ msgid ""
860
+ "Load the Minified CSS from here. Just Enable it by checking the below given "
861
+ "checkbox."
862
+ msgstr ""
863
+
864
+ #: includes/admin/cartflows-general.php:343
865
+ msgid "Load minified CSS & JS Files"
866
+ msgstr ""
867
+
868
+ #: includes/admin/cartflows-general.php:348
869
+ msgid "Save"
870
+ msgstr ""
871
+
872
+ #: includes/exporter.php:12
873
+ msgid "Export Flows to a JSON file"
874
+ msgstr ""
875
+
876
+ #: includes/exporter.php:13
877
+ msgid ""
878
+ "This tool allows you to generate and download a JSON file containing a list "
879
+ "of all flows."
880
+ msgstr ""
881
+
882
+ #: includes/importer.php:12
883
+ msgid "Import Flows to a JSON file"
884
+ msgstr ""
885
+
886
+ #: includes/importer.php:13
887
+ msgid "This tool allows you to import the flows from the JSON file."
888
+ msgstr ""
889
+
890
+ #: includes/importer.php:21
891
+ msgid "Import"
892
+ msgstr ""
893
+
894
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:254
895
+ #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:65
896
+ msgid ""
897
+ "WooCommerce functions do not exist. If you are in an IFrame, please reload "
898
+ "it."
899
+ msgstr ""
900
+
901
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:255
902
+ #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:66
903
+ msgid "Click Here to Reload"
904
+ msgstr ""
905
+
906
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:273
907
+ msgid "Checkout ID not found"
908
+ msgstr ""
909
+
910
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:336
911
+ #: modules/checkout/templates/embed/checkout-template-simple.php:25
912
+ #: modules/checkout/templates/wcf-template.php:36
913
+ msgid "Your cart is currently empty."
914
+ msgstr ""
915
+
916
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:401
917
+ msgid ""
918
+ "No product is selected. Please select products from the checkout meta "
919
+ "settings to continue."
920
+ msgstr ""
921
+
922
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:454
923
+ msgid "Variations Not set"
924
+ msgstr ""
925
+
926
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:462
927
+ msgid "This product can't be purchased"
928
+ msgstr ""
929
+
930
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1075
931
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1118
932
+ msgid "Coupon Code"
933
+ msgstr ""
934
+
935
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1076
936
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1127
937
+ msgid "Apply"
938
+ msgstr ""
939
+
940
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1283
941
+ msgid "Sorry there was a problem removing this coupon."
942
+ msgstr ""
943
+
944
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1286
945
+ msgid "Coupon has been removed."
946
+ msgstr ""
947
+
948
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1305
949
+ msgid "Sorry there was a problem removing "
950
+ msgstr ""
951
+
952
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1308
953
+ msgid " has been removed."
954
+ msgstr ""
955
+
956
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:65
957
+ msgid "Checkout Layout"
958
+ msgstr ""
959
+
960
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:150
961
+ #: modules/landing/classes/class-cartflows-landing-meta.php:130
962
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:130
963
+ msgid "Shortcodes"
964
+ msgstr ""
965
+
966
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:156
967
+ msgid "Select Product"
968
+ msgstr ""
969
+
970
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:162
971
+ msgid "Order Bump"
972
+ msgstr ""
973
+
974
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:168
975
+ msgid "Checkout Offer"
976
+ msgstr ""
977
+
978
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:174
979
+ msgid "Checkout Design"
980
+ msgstr ""
981
+
982
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:180
983
+ msgid "Checkout Fields"
984
+ msgstr ""
985
+
986
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:186
987
+ msgid "Checkout Settings"
988
+ msgstr ""
989
+
990
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:203
991
+ msgid "Logo (Optional)"
992
+ msgstr ""
993
+
994
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:265
995
+ msgid "Add this shortcode to your checkout page"
996
+ msgstr ""
997
+
998
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:301
999
+ #. translators: %s: link
1000
+ msgid ""
1001
+ "Upgrade to %1$sCartFlows Pro%2$s for Pre-applied Coupon, Product Variations "
1002
+ "& Quantity Options."
1003
+ msgstr ""
1004
+
1005
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:328
1006
+ #. translators: %s: link
1007
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Checkout Offer feature"
1008
+ msgstr ""
1009
+
1010
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:338
1011
+ #. translators: %s: link
1012
+ msgid "Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature"
1013
+ msgstr ""
1014
+
1015
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:366
1016
+ #. translators: %s: link
1017
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature."
1018
+ msgstr ""
1019
+
1020
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:393
1021
+ #. translators: %s: link
1022
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature."
1023
+ msgstr ""
1024
+
1025
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:416
1026
+ msgid "Place Order Button Text"
1027
+ msgstr ""
1028
+
1029
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:420
1030
+ msgid "Place order"
1031
+ msgstr ""
1032
+
1033
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:422
1034
+ msgid "It will change the Place Order Button text on checkout page."
1035
+ msgstr ""
1036
+
1037
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:432
1038
+ msgid "Enable cart editing on checkout"
1039
+ msgstr ""
1040
+
1041
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:440
1042
+ #. translators: %s: link
1043
+ msgid "Users will able to remove products from the checkout page."
1044
+ msgstr ""
1045
+
1046
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:468
1047
+ msgid "One Column (Available in CartFlows Pro) "
1048
+ msgstr ""
1049
+
1050
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:469
1051
+ msgid "Two Step (Available in CartFlows Pro) "
1052
+ msgstr ""
1053
+
1054
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:475
1055
+ msgid "Checkout Skin"
1056
+ msgstr ""
1057
+
1058
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:479
1059
+ msgid "One Column"
1060
+ msgstr ""
1061
+
1062
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:480
1063
+ msgid "Two Column"
1064
+ msgstr ""
1065
+
1066
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:481
1067
+ msgid "Two Step"
1068
+ msgstr ""
1069
+
1070
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:490
1071
+ msgid "Primary Color"
1072
+ msgstr ""
1073
+
1074
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:499
1075
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:534
1076
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:580
1077
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:672
1078
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:203
1079
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:226
1080
+ msgid "Font Family"
1081
+ msgstr ""
1082
+
1083
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:507
1084
+ msgid "Advance Options"
1085
+ msgstr ""
1086
+
1087
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:519
1088
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:211
1089
+ msgid "Heading"
1090
+ msgstr ""
1091
+
1092
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:525
1093
+ msgid "Heading Color"
1094
+ msgstr ""
1095
+
1096
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:543
1097
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:589
1098
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:681
1099
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:235
1100
+ msgid "Font Weight"
1101
+ msgstr ""
1102
+
1103
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:551
1104
+ msgid "Input Fields"
1105
+ msgstr ""
1106
+
1107
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:559
1108
+ msgid "Floating Labels (Available in CartFlows Pro)"
1109
+ msgstr ""
1110
+
1111
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:565
1112
+ msgid "Style"
1113
+ msgstr ""
1114
+
1115
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:570
1116
+ msgid "Floating Labels"
1117
+ msgstr ""
1118
+
1119
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:597
1120
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:689
1121
+ msgid "Size"
1122
+ msgstr ""
1123
+
1124
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:601
1125
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:693
1126
+ msgid "Extra Small"
1127
+ msgstr ""
1128
+
1129
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:602
1130
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:694
1131
+ msgid "Small"
1132
+ msgstr ""
1133
+
1134
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:603
1135
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:695
1136
+ msgid "Medium"
1137
+ msgstr ""
1138
+
1139
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:604
1140
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:696
1141
+ msgid "Large"
1142
+ msgstr ""
1143
+
1144
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:605
1145
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:697
1146
+ msgid "Extra Large"
1147
+ msgstr ""
1148
+
1149
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:606
1150
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:698
1151
+ msgid "Custom"
1152
+ msgstr ""
1153
+
1154
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:613
1155
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:705
1156
+ msgid "Top Bottom Spacing"
1157
+ msgstr ""
1158
+
1159
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:621
1160
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:713
1161
+ msgid "Left Right Spacing"
1162
+ msgstr ""
1163
+
1164
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:629
1165
+ msgid "Text / Placeholder Color"
1166
+ msgstr ""
1167
+
1168
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:637
1169
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:737
1170
+ msgid "Background Color"
1171
+ msgstr ""
1172
+
1173
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:645
1174
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:753
1175
+ msgid "Border Color"
1176
+ msgstr ""
1177
+
1178
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:652
1179
+ msgid "Label Color"
1180
+ msgstr ""
1181
+
1182
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:665
1183
+ msgid "Buttons"
1184
+ msgstr ""
1185
+
1186
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:721
1187
+ msgid "Text Color"
1188
+ msgstr ""
1189
+
1190
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:729
1191
+ msgid "Text Hover Color"
1192
+ msgstr ""
1193
+
1194
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:745
1195
+ msgid "Background Hover Color"
1196
+ msgstr ""
1197
+
1198
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:761
1199
+ msgid "Border Hover Color"
1200
+ msgstr ""
1201
+
1202
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:774
1203
+ msgid "Sections"
1204
+ msgstr ""
1205
+
1206
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:780
1207
+ msgid "Highlight Area Background Color"
1208
+ msgstr ""
1209
+
1210
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:819
1211
+ msgid "Header Logo"
1212
+ msgstr ""
1213
+
1214
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:827
1215
+ msgid "Logo Width (In px)"
1216
+ msgstr ""
1217
+
1218
+ #: modules/checkout/templates/wcf-template.php:46
1219
+ msgid "Copyright &copy;"
1220
+ msgstr ""
1221
+
1222
+ #: modules/checkout/templates/wcf-template.php:50
1223
+ msgid "All Rights Reserved"
1224
+ msgstr ""
1225
+
1226
+ #: modules/flow/classes/class-cartflows-flow-meta.php:199
1227
+ #. translators: %s flow id
1228
+ msgid "Steps not created for flow - %s"
1229
+ msgstr ""
1230
+
1231
+ #: modules/flow/classes/class-cartflows-flow-meta.php:213
1232
+ #. translators: %s flow id
1233
+ msgid "Steps already exists. Flow - %s"
1234
+ msgstr ""
1235
+
1236
+ #: modules/flow/classes/class-cartflows-flow-meta.php:224
1237
+ msgid "Landing Page"
1238
+ msgstr ""
1239
+
1240
+ #: modules/flow/classes/class-cartflows-flow-meta.php:225
1241
+ msgid "Checkout Page"
1242
+ msgstr ""
1243
+
1244
+ #: modules/flow/classes/class-cartflows-flow-meta.php:226
1245
+ msgid "Thank You Page"
1246
+ msgstr ""
1247
+
1248
+ #: modules/flow/classes/class-cartflows-flow-meta.php:262
1249
+ #. translators: %s flow id
1250
+ msgid "Steps created for flow - %s"
1251
+ msgstr ""
1252
+
1253
+ #: modules/flow/classes/class-cartflows-flow-meta.php:334
1254
+ #. translators: %s flow id
1255
+ msgid "Step not deleted for flow - %s"
1256
+ msgstr ""
1257
+
1258
+ #: modules/flow/classes/class-cartflows-flow-meta.php:365
1259
+ #. translators: %s flow id
1260
+ msgid "Step deleted for flow - %s"
1261
+ msgstr ""
1262
+
1263
+ #: modules/flow/classes/class-cartflows-flow-meta.php:389
1264
+ #. translators: %s flow id
1265
+ msgid "Steps not sorted for flow - %s"
1266
+ msgstr ""
1267
+
1268
+ #: modules/flow/classes/class-cartflows-flow-meta.php:412
1269
+ #. translators: %s flow id
1270
+ msgid "Steps sorted for flow - %s"
1271
+ msgstr ""
1272
+
1273
+ #: modules/flow/classes/class-cartflows-flow-meta.php:523
1274
+ msgid "Analytics"
1275
+ msgstr ""
1276
+
1277
+ #: modules/flow/classes/class-cartflows-flow-meta.php:540
1278
+ #. translators: %s: link
1279
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Analytics feature"
1280
+ msgstr ""
1281
+
1282
+ #: modules/flow/classes/class-cartflows-flow-meta.php:558
1283
+ msgid "Flow Settings"
1284
+ msgstr ""
1285
+
1286
+ #: modules/flow/classes/class-cartflows-flow-meta.php:643
1287
+ msgid "Enable Test Mode"
1288
+ msgstr ""
1289
+
1290
+ #: modules/flow/classes/class-cartflows-flow-meta.php:650
1291
+ msgid ""
1292
+ "If you are using WooCommerce plugin then test mode will add random products "
1293
+ "in your flow, so you can preview it easily while testing."
1294
+ msgstr ""
1295
+
1296
+ #: modules/flow/classes/class-cartflows-flow-meta.php:769
1297
+ #: modules/flow/view/meta-flow-steps.php:126
1298
+ msgid "Add New Step"
1299
+ msgstr ""
1300
+
1301
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:69
1302
+ msgid "Flow: "
1303
+ msgstr ""
1304
+
1305
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:69
1306
+ msgid "Name: "
1307
+ msgstr ""
1308
+
1309
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:101
1310
+ msgid "Search Flows"
1311
+ msgstr ""
1312
+
1313
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:102
1314
+ msgid "All Flows"
1315
+ msgstr ""
1316
+
1317
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:103
1318
+ msgid "Edit Flow"
1319
+ msgstr ""
1320
+
1321
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:104
1322
+ msgid "View Flow"
1323
+ msgstr ""
1324
+
1325
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:105
1326
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:107
1327
+ #: modules/flow/classes/class-cartflows-step-post-type.php:166
1328
+ #: modules/flow/classes/class-cartflows-step-post-type.php:168
1329
+ msgid "Add New"
1330
+ msgstr ""
1331
+
1332
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:106
1333
+ msgid "Update Flow"
1334
+ msgstr ""
1335
+
1336
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:108
1337
+ msgid "New Flow Name"
1338
+ msgstr ""
1339
+
1340
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:190
1341
+ msgid "Upgrade to CartFlows Pro"
1342
+ msgstr ""
1343
+
1344
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:209
1345
+ msgid "Slug"
1346
+ msgstr ""
1347
+
1348
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:332
1349
+ msgid "Flows"
1350
+ msgstr ""
1351
+
1352
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:354
1353
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:360
1354
+ #: modules/flow/classes/class-cartflows-step-post-type.php:390
1355
+ #: modules/flow/classes/class-cartflows-step-post-type.php:396
1356
+ #. translators: %s: singular custom post type name
1357
+ msgid "%s updated."
1358
+ msgstr ""
1359
+
1360
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:356
1361
+ #: modules/flow/classes/class-cartflows-step-post-type.php:392
1362
+ #. translators: %s: singular custom post type name
1363
+ msgid "Custom %s updated."
1364
+ msgstr ""
1365
+
1366
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:358
1367
+ #: modules/flow/classes/class-cartflows-step-post-type.php:394
1368
+ #. translators: %s: singular custom post type name
1369
+ msgid "Custom %s deleted."
1370
+ msgstr ""
1371
+
1372
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:362
1373
+ #: modules/flow/classes/class-cartflows-step-post-type.php:398
1374
+ #. translators: %1$s: singular custom post type name ,%2$s: date and time of
1375
+ #. the revision
1376
+ msgid "%1$s restored to revision from %2$s"
1377
+ msgstr ""
1378
+
1379
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:364
1380
+ #: modules/flow/classes/class-cartflows-step-post-type.php:400
1381
+ #. translators: %s: singular custom post type name
1382
+ msgid "%s published."
1383
+ msgstr ""
1384
+
1385
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:366
1386
+ #: modules/flow/classes/class-cartflows-step-post-type.php:402
1387
+ #. translators: %s: singular custom post type name
1388
+ msgid "%s saved."
1389
+ msgstr ""
1390
+
1391
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:368
1392
+ #: modules/flow/classes/class-cartflows-step-post-type.php:404
1393
+ #. translators: %s: singular custom post type name
1394
+ msgid "%s submitted."
1395
+ msgstr ""
1396
+
1397
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:370
1398
+ #: modules/flow/classes/class-cartflows-step-post-type.php:406
1399
+ #. translators: %s: singular custom post type name
1400
+ msgid "%s scheduled for."
1401
+ msgstr ""
1402
+
1403
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:372
1404
+ #: modules/flow/classes/class-cartflows-step-post-type.php:408
1405
+ #. translators: %s: singular custom post type name
1406
+ msgid "%s draft updated."
1407
+ msgstr ""
1408
+
1409
+ #: modules/flow/classes/class-cartflows-flow-shortcodes.php:148
1410
+ #: modules/widgets/class-cartflows-next-step.php:78
1411
+ msgid "Next Step"
1412
+ msgstr ""
1413
+
1414
+ #: modules/flow/classes/class-cartflows-step-post-type.php:162
1415
+ msgid "Search Steps"
1416
+ msgstr ""
1417
+
1418
+ #: modules/flow/classes/class-cartflows-step-post-type.php:163
1419
+ msgid "All Steps"
1420
+ msgstr ""
1421
+
1422
+ #: modules/flow/classes/class-cartflows-step-post-type.php:164
1423
+ #: modules/flow/view/meta-flow-steps.php:99
1424
+ msgid "Edit Step"
1425
+ msgstr ""
1426
+
1427
+ #: modules/flow/classes/class-cartflows-step-post-type.php:165
1428
+ #: modules/flow/view/meta-flow-steps.php:95
1429
+ msgid "View Step"
1430
+ msgstr ""
1431
+
1432
+ #: modules/flow/classes/class-cartflows-step-post-type.php:167
1433
+ msgid "Update Step"
1434
+ msgstr ""
1435
+
1436
+ #: modules/flow/classes/class-cartflows-step-post-type.php:169
1437
+ msgid "New Step Name"
1438
+ msgstr ""
1439
+
1440
+ #: modules/flow/classes/class-cartflows-step-post-type.php:209
1441
+ msgid "Step Type"
1442
+ msgstr ""
1443
+
1444
+ #: modules/flow/classes/class-cartflows-step-post-type.php:219
1445
+ msgid "Step Flow"
1446
+ msgstr ""
1447
+
1448
+ #: modules/flow/classes/class-cartflows-step-post-type.php:258
1449
+ #: modules/flow/view/meta-flow-steps.php:14
1450
+ msgid "Upsell (Woo)"
1451
+ msgstr ""
1452
+
1453
+ #: modules/flow/classes/class-cartflows-step-post-type.php:265
1454
+ #: modules/flow/view/meta-flow-steps.php:15
1455
+ msgid "Downsell (Woo)"
1456
+ msgstr ""
1457
+
1458
+ #: modules/flow/view/meta-flow-steps.php:78
1459
+ msgid "No Product Assigned"
1460
+ msgstr ""
1461
+
1462
+ #: modules/flow/view/meta-flow-steps.php:82
1463
+ msgid "Global Checkout - Remove selected checkout product"
1464
+ msgstr ""
1465
+
1466
+ #: modules/flow/view/meta-flow-steps.php:101
1467
+ msgid "Edit"
1468
+ msgstr ""
1469
+
1470
+ #: modules/flow/view/meta-flow-steps.php:106
1471
+ msgid "Clone Step"
1472
+ msgstr ""
1473
+
1474
+ #: modules/flow/view/meta-flow-steps.php:111
1475
+ msgid "Delete Step"
1476
+ msgstr ""
1477
+
1478
+ #: modules/flow/view/meta-flow-steps.php:113
1479
+ msgid "Delete"
1480
+ msgstr ""
1481
+
1482
+ #: modules/flow/view/meta-flow-steps.php:142
1483
+ msgid "Steps Library"
1484
+ msgstr ""
1485
+
1486
+ #: modules/flow/view/meta-flow-steps.php:191
1487
+ msgid "Create Step"
1488
+ msgstr ""
1489
+
1490
+ #: modules/flow/view/meta-flow-steps.php:193
1491
+ msgid "You need a Cartflows Pro version to import Upsell / Downsell"
1492
+ msgstr ""
1493
+
1494
+ #: modules/landing/classes/class-cartflows-landing-meta.php:66
1495
+ msgid "Landing Page Settings"
1496
+ msgstr ""
1497
+
1498
+ #: modules/landing/classes/class-cartflows-landing-meta.php:169
1499
+ msgid "Next Step Link"
1500
+ msgstr ""
1501
+
1502
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:65
1503
+ msgid "Thank You Page Settings"
1504
+ msgstr ""
1505
+
1506
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:136
1507
+ msgid "Thank You Design"
1508
+ msgstr ""
1509
+
1510
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:142
1511
+ msgid "Thank You Fields"
1512
+ msgstr ""
1513
+
1514
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:176
1515
+ msgid "Order Details"
1516
+ msgstr ""
1517
+
1518
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:188
1519
+ msgid "Text"
1520
+ msgstr ""
1521
+
1522
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:194
1523
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:217
1524
+ msgid "Color"
1525
+ msgstr ""
1526
+
1527
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:243
1528
+ msgid "Advanced Options"
1529
+ msgstr ""
1530
+
1531
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:253
1532
+ msgid "Container Width (In px)"
1533
+ msgstr ""
1534
+
1535
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:261
1536
+ msgid "Section Background Color"
1537
+ msgstr ""
1538
+
1539
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:275
1540
+ msgid "Enable Order Overview "
1541
+ msgstr ""
1542
+
1543
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:283
1544
+ msgid "Enable Order Details "
1545
+ msgstr ""
1546
+
1547
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:291
1548
+ msgid "Enable Billing Details "
1549
+ msgstr ""
1550
+
1551
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:299
1552
+ msgid "Enable Shipping Details "
1553
+ msgstr ""
1554
+
1555
+ #: modules/widgets/class-cartflows-next-step.php:24
1556
+ msgid "CartFlows Next Step"
1557
+ msgstr ""
1558
+
1559
+ #: modules/widgets/class-cartflows-next-step.php:26
1560
+ msgid "Next Step Widgets"
1561
+ msgstr ""
1562
+
1563
+ #: modules/widgets/class-cartflows-next-step.php:106
1564
+ msgid "New title"
1565
+ msgstr ""
1566
+
1567
+ #: modules/widgets/class-cartflows-next-step.php:123
1568
+ msgid "Title:"
1569
+ msgstr ""
1570
+
1571
+ #: modules/widgets/class-cartflows-next-step.php:127
1572
+ msgid "Flow ID:"
1573
+ msgstr ""
1574
+
1575
+ #: modules/widgets/class-cartflows-next-step.php:131
1576
+ msgid "Step ID:"
1577
+ msgstr ""
1578
+
1579
+ #: woocommerce/template/cart/cart-shipping.php:51
1580
+ #. Translators: $s shipping destination.
1581
+ msgid "Estimate for %s."
1582
+ msgstr ""
1583
+
1584
+ #: woocommerce/template/cart/cart-shipping.php:52
1585
+ msgid "Change address"
1586
+ msgstr ""
1587
+
1588
+ #: woocommerce/template/cart/cart-shipping.php:54
1589
+ msgid "This is only an estimate. Prices will be updated during checkout."
1590
+ msgstr ""
1591
+
1592
+ #: woocommerce/template/cart/cart-shipping.php:61
1593
+ msgid "Enter your address to view shipping options."
1594
+ msgstr ""
1595
+
1596
+ #: woocommerce/template/cart/cart-shipping.php:63
1597
+ msgid ""
1598
+ "There are no shipping methods available. Please ensure that your address "
1599
+ "has been entered correctly, or contact us if you need any help."
1600
+ msgstr ""
1601
+
1602
+ #: woocommerce/template/cart/cart-shipping.php:66
1603
+ #. Translators: $s shipping destination.
1604
+ msgid "No shipping options were found for %s."
1605
+ msgstr ""
1606
+
1607
+ #: woocommerce/template/cart/cart-shipping.php:67
1608
+ msgid "Enter a different address"
1609
+ msgstr ""
1610
+
1611
+ #: woocommerce/template/checkout/form-billing.php:27
1612
+ msgid "Billing &amp; Shipping"
1613
+ msgstr ""
1614
+
1615
+ #: woocommerce/template/checkout/form-billing.php:31
1616
+ msgid "Billing details"
1617
+ msgstr ""
1618
+
1619
+ #: woocommerce/template/checkout/form-billing.php:59
1620
+ msgid "Create an account?"
1621
+ msgstr ""
1622
+
1623
+ #: woocommerce/template/checkout/form-checkout.php:26
1624
+ msgid "You must be logged in to checkout."
1625
+ msgstr ""
1626
+
1627
+ #: woocommerce/template/checkout/form-checkout.php:52
1628
+ msgid "Your order"
1629
+ msgstr ""
1630
+
1631
+ #: woocommerce/template/checkout/form-coupon.php:26
1632
+ msgid "Have a coupon?"
1633
+ msgstr ""
1634
+
1635
+ #: woocommerce/template/checkout/form-coupon.php:26
1636
+ msgid "Click here to enter your code"
1637
+ msgstr ""
1638
+
1639
+ #: woocommerce/template/checkout/form-coupon.php:31
1640
+ msgid "If you have a coupon code, please apply it below."
1641
+ msgstr ""
1642
+
1643
+ #: woocommerce/template/checkout/form-coupon.php:34
1644
+ msgid "Coupon code"
1645
+ msgstr ""
1646
+
1647
+ #: woocommerce/template/checkout/form-coupon.php:38
1648
+ msgid "Apply coupon"
1649
+ msgstr ""
1650
+
1651
+ #: woocommerce/template/checkout/form-login.php:26
1652
+ msgid "Returning customer?"
1653
+ msgstr ""
1654
+
1655
+ #: woocommerce/template/checkout/form-login.php:26
1656
+ msgid "Click here to login"
1657
+ msgstr ""
1658
+
1659
+ #: woocommerce/template/checkout/form-login.php:32
1660
+ msgid ""
1661
+ "If you have shopped with us before, please enter your details below. If you "
1662
+ "are a new customer, please proceed to the Billing &amp; Shipping section."
1663
+ msgstr ""
1664
+
1665
+ #: woocommerce/template/checkout/form-shipping.php:26
1666
+ msgid "Ship to a different address?"
1667
+ msgstr ""
1668
+
1669
+ #: woocommerce/template/checkout/form-shipping.php:57
1670
+ msgid "Additional information"
1671
+ msgstr ""
1672
+
1673
+ #: woocommerce/template/checkout/payment.php:33
1674
+ msgid ""
1675
+ "Sorry, it seems that there are no available payment methods for your state. "
1676
+ "Please contact us if you require assistance or wish to make alternate "
1677
+ "arrangements."
1678
+ msgstr ""
1679
+
1680
+ #: woocommerce/template/checkout/payment.php:33
1681
+ msgid "Please fill in your details above to see available payment methods."
1682
+ msgstr ""
1683
+
1684
+ #: woocommerce/template/checkout/payment.php:42
1685
+ #. translators: $1 and $2 opening and closing emphasis tags respectively
1686
+ msgid ""
1687
+ "Since your browser does not support JavaScript, or it is disabled, please "
1688
+ "ensure you click the %1$sUpdate Totals%2$s button before placing your "
1689
+ "order. You may be charged more than the amount stated above if you fail to "
1690
+ "do so."
1691
+ msgstr ""
1692
+
1693
+ #: woocommerce/template/checkout/payment.php:44
1694
+ msgid "Update totals"
1695
+ msgstr ""
1696
+
1697
+ #: woocommerce/template/checkout/review-order.php:26
1698
+ msgid "Product"
1699
+ msgstr ""
1700
+
1701
+ #: woocommerce/template/checkout/review-order.php:27
1702
+ #: woocommerce/template/checkout/review-order.php:107
1703
+ msgid "Total"
1704
+ msgstr ""
1705
+
1706
+ #: woocommerce/template/checkout/review-order.php:60
1707
+ msgid "Subtotal"
1708
+ msgstr ""
1709
+
1710
+ #: woocommerce/template/checkout/thankyou.php:30
1711
+ msgid ""
1712
+ "Unfortunately your order cannot be processed as the originating "
1713
+ "bank/merchant has declined your transaction. Please attempt your purchase "
1714
+ "again."
1715
+ msgstr ""
1716
+
1717
+ #: woocommerce/template/checkout/thankyou.php:33
1718
+ msgid "Pay"
1719
+ msgstr ""
1720
+
1721
+ #: woocommerce/template/checkout/thankyou.php:35
1722
+ msgid "My account"
1723
+ msgstr ""
1724
+
1725
+ #: woocommerce/template/checkout/thankyou.php:41
1726
+ #: woocommerce/template/checkout/thankyou.php:83
1727
+ msgid "Thank you. Your order has been received."
1728
+ msgstr ""
1729
+
1730
+ #: woocommerce/template/checkout/thankyou.php:46
1731
+ msgid "Order number:"
1732
+ msgstr ""
1733
+
1734
+ #: woocommerce/template/checkout/thankyou.php:51
1735
+ msgid "Date:"
1736
+ msgstr ""
1737
+
1738
+ #: woocommerce/template/checkout/thankyou.php:57
1739
+ msgid "Email:"
1740
+ msgstr ""
1741
+
1742
+ #: woocommerce/template/checkout/thankyou.php:63
1743
+ msgid "Total:"
1744
+ msgstr ""
1745
+
1746
+ #: woocommerce/template/checkout/thankyou.php:69
1747
+ msgid "Payment method:"
1748
+ msgstr ""
1749
+
1750
+ #: woocommerce/template/global/form-login.php:34
1751
+ msgid "Username or email"
1752
+ msgstr ""
1753
+
1754
+ #: woocommerce/template/global/form-login.php:38
1755
+ msgid "Password"
1756
+ msgstr ""
1757
+
1758
+ #: woocommerce/template/global/form-login.php:48
1759
+ msgid "Login"
1760
+ msgstr ""
1761
+
1762
+ #: woocommerce/template/global/form-login.php:53
1763
+ msgid "Remember me"
1764
+ msgstr ""
1765
+
1766
+ #: woocommerce/template/global/form-login.php:57
1767
+ msgid "Lost your password?"
1768
+ msgstr ""
1769
+
1770
+ #. Plugin Name of the plugin/theme
1771
+ msgid "CartFlows"
1772
+ msgstr ""
1773
+
1774
+ #. Author URI of the plugin/theme
1775
+ msgid "https://cartflows.com/"
1776
+ msgstr ""
1777
+
1778
+ #. Description of the plugin/theme
1779
+ msgid "Create beautiful checkout pages & sales flows for WooCommerce."
1780
+ msgstr ""
1781
+
1782
+ #. Author of the plugin/theme
1783
+ msgid "CartFlows Inc"
1784
+ msgstr ""
1785
+
1786
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:99
1787
+ msgctxt "flow general name"
1788
+ msgid "Flows"
1789
+ msgstr ""
1790
+
1791
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:100
1792
+ msgctxt "flow singular name"
1793
+ msgid "Flow"
1794
+ msgstr ""
1795
+
1796
+ #: modules/flow/classes/class-cartflows-step-post-type.php:160
1797
+ msgctxt "flow step general name"
1798
+ msgid "Steps"
1799
+ msgstr ""
1800
+
1801
+ #: modules/flow/classes/class-cartflows-step-post-type.php:161
1802
+ msgctxt "flow step singular name"
1803
+ msgid "Step"
1804
+ msgstr ""
1805
+
1806
+ #: modules/flow/classes/class-cartflows-step-post-type.php:306
1807
+ msgctxt "cartflows"
1808
+ msgid "CartFlows — Boxed"
1809
+ msgstr ""
1810
+
1811
+ #: modules/flow/classes/class-cartflows-step-post-type.php:307
1812
+ msgctxt "cartflows"
1813
+ msgid "Template for Page Builders"
1814
  msgstr ""
modules/checkout/classes/class-cartflows-checkout-markup.php CHANGED
@@ -136,6 +136,28 @@ class Cartflows_Checkout_Markup {
136
 
137
  }
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  /**
140
  * Display all WooCommerce notices.
141
  *
@@ -492,6 +514,8 @@ class Cartflows_Checkout_Markup {
492
 
493
  add_filter( 'woocommerce_cart_totals_coupon_html', array( $this, 'remove_coupon_text' ) );
494
 
 
 
495
  global $post;
496
 
497
  if ( _is_wcf_checkout_type() ) {
136
 
137
  }
138
 
139
+ /**
140
+ * Change order button text .
141
+ *
142
+ * @param string $woo_button_text place order.
143
+ * @return string
144
+ */
145
+ public function place_order_button_text( $woo_button_text ) {
146
+
147
+ $checkout_id = get_the_ID();
148
+ if ( ! $checkout_id ) {
149
+ $checkout_id = ( isset( $_POST['option']['checkout_id'] ) ) ? intval( $_POST['option']['checkout_id'] ) : 0;
150
+ }
151
+
152
+ $wcf_order_button_text = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-place-order-button-text' );
153
+
154
+ if ( ! empty( $wcf_order_button_text ) ) {
155
+ $woo_button_text = $wcf_order_button_text;
156
+ }
157
+
158
+ return $woo_button_text;
159
+ }
160
+
161
  /**
162
  * Display all WooCommerce notices.
163
  *
514
 
515
  add_filter( 'woocommerce_cart_totals_coupon_html', array( $this, 'remove_coupon_text' ) );
516
 
517
+ add_filter( 'woocommerce_order_button_text', array( $this, 'place_order_button_text' ), 10, 1 );
518
+
519
  global $post;
520
 
521
  if ( _is_wcf_checkout_type() ) {
modules/checkout/classes/class-cartflows-checkout-meta.php CHANGED
@@ -45,7 +45,6 @@ class Cartflows_Checkout_Meta extends Cartflows_Meta {
45
  add_action( 'load-post.php', array( $this, 'init_metabox' ) );
46
  add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
47
  }
48
-
49
  /**
50
  * Init Metabox
51
  */
@@ -411,6 +410,21 @@ class Cartflows_Checkout_Meta extends Cartflows_Meta {
411
  <div class="wcf-checkout-custom-settings wcf-tab-content widefat">
412
  <div class="wcf-custom-settings-fields">
413
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  echo wcf()->meta->get_checkbox_field(
415
  array(
416
  'name' => 'wcf-remove-product-field',
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
  */
410
  <div class="wcf-checkout-custom-settings wcf-tab-content widefat">
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',
modules/checkout/templates/embed/checkout-template-simple.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
- /**
3
- * Checkout template
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- $checkout_layout = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-layout' );
9
- $fields_skins = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-fields-skins' );
10
- ?>
11
- <div id="wcf-embed-checkout-form" class="wcf-embed-checkout-form wcf-embed-checkout-form-<?php echo $checkout_layout; ?> wcf-field-<?php echo $fields_skins; ?>">
12
- <!-- CHECKOUT SHORTCODE -->
13
- <?php do_action( 'cartflows_add_before_main_section', $checkout_layout ); ?>
14
-
15
- <?php
16
- $checkout_html = do_shortcode( '[woocommerce_checkout]' );
17
-
18
- if (
19
- empty( $checkout_html ) ||
20
- trim( $checkout_html ) == '<div class="woocommerce"></div>'
21
- ) {
22
-
23
- do_action( 'cartflows_checkout_cart_empty', $checkout_id );
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_add_after_main_section', $arg = '' ); ?>
32
- <!-- END CHECKOUT SHORTCODE -->
33
- </div>
1
+ <?php
2
+ /**
3
+ * Checkout template
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ $checkout_layout = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-layout' );
9
+ $fields_skins = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-fields-skins' );
10
+ ?>
11
+ <div id="wcf-embed-checkout-form" class="wcf-embed-checkout-form wcf-embed-checkout-form-<?php echo $checkout_layout; ?> wcf-field-<?php echo $fields_skins; ?>">
12
+ <!-- CHECKOUT SHORTCODE -->
13
+ <?php do_action( 'cartflows_add_before_main_section', $checkout_layout ); ?>
14
+
15
+ <?php
16
+ $checkout_html = do_shortcode( '[woocommerce_checkout]' );
17
+
18
+ if (
19
+ empty( $checkout_html ) ||
20
+ trim( $checkout_html ) == '<div class="woocommerce"></div>'
21
+ ) {
22
+
23
+ do_action( 'cartflows_checkout_cart_empty', $checkout_id );
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_add_after_main_section', $arg = '' ); ?>
32
+ <!-- END CHECKOUT SHORTCODE -->
33
+ </div>
modules/checkout/templates/wcf-template.php CHANGED
@@ -1,58 +1,58 @@
1
- <?php
2
- /**
3
- * Flow
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- ?>
9
- <!DOCTYPE html>
10
- <html <?php language_attributes(); ?>>
11
- <head>
12
- <meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>">
13
- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
14
- <meta name="robots" content="noindex">
15
- <title><?php wp_title( '-', true, 'right' ); ?><?php bloginfo( 'name' ); ?></title>
16
- <link rel="profile" href="http://gmpg.org/xfn/11" />
17
-
18
- <?php wp_head(); ?>
19
- </head>
20
- <body <?php body_class(); ?>>
21
- <div class="wrapper">
22
- <header class="header">
23
- </header>
24
-
25
- <div class="main-container">
26
- <div class="checkout-forms">
27
- <!-- CHECKOUT SHORTCODE -->
28
- <?php
29
-
30
- $checkout_html = do_shortcode( '[woocommerce_checkout]' );
31
-
32
- if (
33
- empty( $checkout_html ) ||
34
- trim( $checkout_html ) == '<div class="woocommerce"></div>'
35
- ) {
36
- echo esc_html__( 'Your cart is currently empty.', 'cartflows' );
37
- } else {
38
- echo $checkout_html;
39
- }
40
- ?>
41
- <!-- END CHECKOUT SHORTCODE -->
42
- </div>
43
- </div>
44
-
45
- <footer class="footer">
46
- <p><?php esc_html_e( 'Copyright &copy;', 'cartflows' ); ?> <?php
47
- echo gmdate( 'Y' );
48
- echo ' ' . get_bloginfo( 'name' );
49
- ?>
50
- - <?php esc_html_e( 'All Rights Reserved', 'cartflows' ); ?></p>
51
- </footer>
52
- </div>
53
-
54
- <div class="wcf-hide">
55
- <?php wp_footer(); ?>
56
- </div>
57
- </body>
58
- </html>
1
+ <?php
2
+ /**
3
+ * Flow
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ ?>
9
+ <!DOCTYPE html>
10
+ <html <?php language_attributes(); ?>>
11
+ <head>
12
+ <meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>">
13
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
14
+ <meta name="robots" content="noindex">
15
+ <title><?php wp_title( '-', true, 'right' ); ?><?php bloginfo( 'name' ); ?></title>
16
+ <link rel="profile" href="http://gmpg.org/xfn/11" />
17
+
18
+ <?php wp_head(); ?>
19
+ </head>
20
+ <body <?php body_class(); ?>>
21
+ <div class="wrapper">
22
+ <header class="header">
23
+ </header>
24
+
25
+ <div class="main-container">
26
+ <div class="checkout-forms">
27
+ <!-- CHECKOUT SHORTCODE -->
28
+ <?php
29
+
30
+ $checkout_html = do_shortcode( '[woocommerce_checkout]' );
31
+
32
+ if (
33
+ empty( $checkout_html ) ||
34
+ trim( $checkout_html ) == '<div class="woocommerce"></div>'
35
+ ) {
36
+ echo esc_html__( 'Your cart is currently empty.', 'cartflows' );
37
+ } else {
38
+ echo $checkout_html;
39
+ }
40
+ ?>
41
+ <!-- END CHECKOUT SHORTCODE -->
42
+ </div>
43
+ </div>
44
+
45
+ <footer class="footer">
46
+ <p><?php esc_html_e( 'Copyright &copy;', 'cartflows' ); ?> <?php
47
+ echo gmdate( 'Y' );
48
+ echo ' ' . get_bloginfo( 'name' );
49
+ ?>
50
+ - <?php esc_html_e( 'All Rights Reserved', 'cartflows' ); ?></p>
51
+ </footer>
52
+ </div>
53
+
54
+ <div class="wcf-hide">
55
+ <?php wp_footer(); ?>
56
+ </div>
57
+ </body>
58
+ </html>
modules/flow/classes/class-cartflows-flow-meta.php CHANGED
@@ -1,780 +1,780 @@
1
- <?php
2
- /**
3
- * Flow meta
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Meta Boxes setup
10
- */
11
- class Cartflows_Flow_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;
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
- add_action( 'admin_head', array( $this, 'menu_highlight' ) );
45
-
46
- add_action( 'admin_init', array( $this, 'admin_init_actions' ) );
47
-
48
- /* Init Metabox */
49
- add_action( 'load-post.php', array( $this, 'init_metabox' ) );
50
- add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
51
-
52
- /* Add Scripts */
53
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ), 20 );
54
-
55
- add_action( 'wp_ajax_cartflows_setup_default_steps', array( $this, 'cartflows_setup_default_steps' ) );
56
- add_action( 'wp_ajax_cartflows_delete_flow_step', array( $this, 'cartflows_delete_flow_step' ) );
57
-
58
- add_action( 'wp_ajax_cartflows_reorder_flow_steps', array( $this, 'cartflows_reorder_flow_steps' ) );
59
-
60
- add_action( 'admin_notices', array( $this, 'admin_notices' ) );
61
-
62
- add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
63
- }
64
-
65
- /**
66
- * Display admin notices.
67
- *
68
- * @since 1.0.0
69
- *
70
- * @return void
71
- */
72
- public function admin_notices() {
73
-
74
- if ( CARTFLOWS_STEP_POST_TYPE !== get_post_type() ) {
75
- return;
76
- }
77
-
78
- $flow_id = get_post_meta( get_the_id(), 'wcf-flow-id', true );
79
- if ( $flow_id ) { ?>
80
- <div class="wcf-notice-back-edit-flow">
81
- <p>
82
- <a href="<?php echo esc_url( get_edit_post_link( $flow_id ) ); ?>" class="button button-primary button-hero" style="text-decoration: none;">
83
- <i class="dashicons dashicons-arrow-left-alt"></i>
84
- <?php esc_html_e( 'Back to edit Flow', 'cartflows' ); ?>
85
- </a>
86
- </p>
87
- </div>
88
- <?php
89
- }
90
- }
91
-
92
- /**
93
- * Initialize admin actions.
94
- *
95
- * @since 1.0.0
96
- *
97
- * @return void
98
- */
99
- public function admin_init_actions() {
100
- add_action( 'before_delete_post', array( $this, 'step_post_sync' ) );
101
- add_action( 'wp_trash_post', array( $this, 'step_post_trash_sync' ) );
102
- add_action( 'untrashed_post', array( $this, 'step_post_untrash_sync' ) );
103
- }
104
-
105
- /**
106
- * Delete term data and steps data after deleting flow.
107
- *
108
- * @since 1.0.0
109
- * @param int $pid post id.
110
- *
111
- * @return void
112
- */
113
- public function step_post_sync( $pid ) {
114
-
115
- global $post_type;
116
-
117
- if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
118
-
119
- $steps = get_post_meta( $pid, 'wcf-steps', true );
120
-
121
- if ( $steps && is_array( $steps ) ) {
122
- foreach ( $steps as $i => $step ) {
123
- wp_delete_post( $step['id'], true );
124
- }
125
- }
126
-
127
- $term_data = term_exists( 'flow-' . $pid, CARTFLOWS_TAXONOMY_STEP_FLOW );
128
-
129
- if ( is_array( $term_data ) ) {
130
- wp_delete_term( $term_data['term_id'], CARTFLOWS_TAXONOMY_STEP_FLOW );
131
- }
132
- }
133
- }
134
-
135
- /**
136
- * Trash steps data after trashing flow.
137
- *
138
- * @since 1.0.0
139
- * @param int $pid post id.
140
- *
141
- * @return void
142
- */
143
- public function step_post_trash_sync( $pid ) {
144
-
145
- global $post_type;
146
-
147
- if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
148
-
149
- $steps = get_post_meta( $pid, 'wcf-steps', true );
150
-
151
- if ( $steps && is_array( $steps ) ) {
152
- foreach ( $steps as $i => $step ) {
153
- wp_trash_post( $step['id'] );
154
- }
155
- }
156
- }
157
- }
158
-
159
- /**
160
- * Untrash steps data after restoring flow.
161
- *
162
- * @since 1.0.0
163
- * @param int $pid post id.
164
- *
165
- * @return void
166
- */
167
- public function step_post_untrash_sync( $pid ) {
168
-
169
- global $post_type;
170
-
171
- if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
172
-
173
- $steps = get_post_meta( $pid, 'wcf-steps', true );
174
-
175
- if ( $steps && is_array( $steps ) ) {
176
- foreach ( $steps as $i => $step ) {
177
- wp_untrash_post( $step['id'] );
178
- }
179
- }
180
- }
181
- }
182
-
183
- /**
184
- * Setup default steps for flow
185
- *
186
- * @since 1.0.0
187
- *
188
- * @return void
189
- */
190
- public function cartflows_setup_default_steps() {
191
-
192
- check_ajax_referer( 'wcf-setup-default-steps', 'security' );
193
-
194
- $flow_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : '';
195
-
196
- $result = array(
197
- 'status' => false,
198
- /* translators: %s flow id */
199
- 'text' => sprintf( __( 'Steps not created for flow - %s', 'cartflows' ), $flow_id ),
200
- );
201
-
202
- if ( ! $flow_id ) {
203
- wp_send_json( $result );
204
- }
205
-
206
- $is_step_exists = get_post_meta( $flow_id, 'wcf-steps', true );
207
-
208
- if ( $is_step_exists ) {
209
-
210
- $result = array(
211
- 'status' => false,
212
- /* translators: %s flow id */
213
- 'text' => sprintf( __( 'Steps already exists. Flow - %s', 'cartflows' ), $flow_id ),
214
- );
215
-
216
- wp_send_json( $result );
217
- }
218
-
219
- /* Start Creating */
220
-
221
- $flow_steps = array();
222
-
223
- $steps_data = array(
224
- 'landing' => __( 'Landing Page', 'cartflows' ),
225
- 'checkout' => __( 'Checkout Page', 'cartflows' ),
226
- 'thankyou' => __( 'Thank You Page', 'cartflows' ),
227
- );
228
-
229
- foreach ( $steps_data as $slug => $title ) {
230
-
231
- $step_id = wp_insert_post(
232
- array(
233
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
234
- 'post_title' => $title,
235
- 'post_content' => '[cartflows_navigation]',
236
- 'post_status' => 'publish',
237
- )
238
- );
239
-
240
- if ( $step_id ) {
241
-
242
- $flow_steps[] = array(
243
- 'id' => $step_id,
244
- 'title' => $title,
245
- 'type' => $slug,
246
- );
247
-
248
- // insert post meta.
249
- update_post_meta( $step_id, 'wcf-flow-id', $flow_id );
250
- update_post_meta( $step_id, 'wcf-step-type', $slug );
251
-
252
- wp_set_object_terms( $step_id, $slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
253
- wp_set_object_terms( $step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
254
- }
255
- }
256
-
257
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
258
-
259
- $result = array(
260
- 'status' => true,
261
- /* translators: %s flow id */
262
- 'text' => sprintf( __( 'Steps created for flow - %s', 'cartflows' ), $flow_id ),
263
- 'redirect' => get_edit_post_link( $flow_id ),
264
- );
265
-
266
- wp_send_json( $result );
267
- }
268
-
269
- /**
270
- * Create step for given flow.
271
- *
272
- * @param int $flow_id flow ID.
273
- * @param int $step_type step type.
274
- * @param int $step_title step title.
275
- * @since 1.0.0
276
- *
277
- * @return int
278
- */
279
- public function create_step( $flow_id, $step_type, $step_title ) {
280
-
281
- $new_step_id = wp_insert_post(
282
- array(
283
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
284
- 'post_title' => $step_title,
285
- 'post_status' => 'publish',
286
- )
287
- );
288
-
289
- if ( $new_step_id ) {
290
-
291
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
292
-
293
- if ( ! is_array( $flow_steps ) ) {
294
- $flow_steps = array();
295
- }
296
-
297
- $flow_steps[] = array(
298
- 'id' => $new_step_id,
299
- 'title' => $step_title,
300
- 'type' => $step_type,
301
- );
302
-
303
- // insert post meta.
304
- update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
305
- update_post_meta( $new_step_id, 'wcf-step-type', $step_type );
306
-
307
- wp_set_object_terms( $new_step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
308
- wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
309
- }
310
-
311
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
312
-
313
- return $new_step_id;
314
- }
315
-
316
- /**
317
- * Delete step for flow
318
- *
319
- * @since 1.0.0
320
- *
321
- * @return void
322
- */
323
- public function cartflows_delete_flow_step() {
324
-
325
- check_ajax_referer( 'wcf-delete-flow-step', 'security' );
326
-
327
- if ( isset( $_POST['post_id'] ) && isset( $_POST['step_id'] ) ) {
328
- $flow_id = intval( $_POST['post_id'] );
329
- $step_id = intval( $_POST['step_id'] );
330
- }
331
- $result = array(
332
- 'status' => false,
333
- /* translators: %s flow id */
334
- 'text' => sprintf( __( 'Step not deleted for flow - %s', 'cartflows' ), $flow_id ),
335
- );
336
-
337
- if ( ! $flow_id || ! $step_id ) {
338
- wp_send_json( $result );
339
- }
340
-
341
- wp_delete_post( $step_id, true );
342
-
343
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
344
-
345
- if ( ! is_array( $flow_steps ) ) {
346
- wp_send_json( $result );
347
- }
348
-
349
- foreach ( $flow_steps as $index => $data ) {
350
-
351
- if ( intval( $data['id'] ) === $step_id ) {
352
- unset( $flow_steps[ $index ] );
353
- break;
354
- }
355
- }
356
-
357
- /* Set index order properly */
358
- $flow_steps = array_merge( $flow_steps );
359
-
360
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
361
-
362
- $result = array(
363
- 'status' => true,
364
- /* translators: %s flow id */
365
- 'text' => sprintf( __( 'Step deleted for flow - %s', 'cartflows' ), $flow_id ),
366
- );
367
-
368
- wp_send_json( $result );
369
- }
370
-
371
- /**
372
- * Reorder step flow
373
- *
374
- * @since 1.0.0
375
- *
376
- * @return void
377
- */
378
- public function cartflows_reorder_flow_steps() {
379
-
380
- check_ajax_referer( 'wcf-reorder-flow-steps', 'security' );
381
-
382
- if ( isset( $_POST['post_id'] ) && isset( $_POST['step_ids'] ) ) {
383
- $flow_id = intval( $_POST['post_id'] );
384
- $step_ids = array_map( 'intval', $_POST['step_ids'] );
385
- }
386
- $result = array(
387
- 'status' => false,
388
- /* translators: %s flow id */
389
- 'text' => sprintf( __( 'Steps not sorted for flow - %s', 'cartflows' ), $flow_id ),
390
- );
391
-
392
- if ( ! $flow_id || ! is_array( $step_ids ) ) {
393
- wp_send_json( $result );
394
- }
395
-
396
- $new_flow_steps = array();
397
-
398
- foreach ( $step_ids as $index => $step_id ) {
399
-
400
- $new_flow_steps[] = array(
401
- 'id' => intval( $step_id ),
402
- 'title' => get_the_title( $step_id ),
403
- 'type' => get_post_meta( $step_id, 'wcf-step-type', true ),
404
- );
405
- }
406
-
407
- update_post_meta( $flow_id, 'wcf-steps', $new_flow_steps );
408
-
409
- $result = array(
410
- 'status' => true,
411
- /* translators: %s flow id */
412
- 'text' => sprintf( __( 'Steps sorted for flow - %s', 'cartflows' ), $flow_id ),
413
- );
414
-
415
- wp_send_json( $result );
416
- }
417
-
418
-
419
- /**
420
- * Load admin scripts
421
- *
422
- * @since 1.0.0
423
- *
424
- * @return void
425
- */
426
- public function admin_scripts() {
427
-
428
- global $pagenow;
429
- global $post;
430
-
431
- $screen = get_current_screen();
432
-
433
- if ( ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) && CARTFLOWS_FLOW_POST_TYPE == $screen->post_type ) {
434
-
435
- wp_enqueue_script(
436
- 'wcf-flow-meta',
437
- CARTFLOWS_URL . 'admin/assets/js/flow-admin-edit.js',
438
- array( 'jquery', 'jquery-ui-sortable' ),
439
- CARTFLOWS_VER,
440
- true
441
- );
442
-
443
- wp_enqueue_style( 'wcf-flow-meta', CARTFLOWS_URL . 'admin/assets/css/flow-admin-edit.css', '', CARTFLOWS_VER );
444
- wp_style_add_data( 'wcf-flow-meta', 'rtl', 'replace' );
445
-
446
- $localize = array(
447
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
448
- );
449
-
450
- wp_localize_script( 'jquery', 'cartflows', apply_filters( 'wcf_js_localize', $localize ) );
451
- }
452
- }
453
-
454
- /**
455
- * Initialize meta box
456
- *
457
- * @since 1.0.0
458
- *
459
- * @return void
460
- */
461
- public function init_metabox() {
462
-
463
- /**
464
- * Fires after the title field.
465
- *
466
- * @param WP_Post $post Post object.
467
- */
468
- add_action( 'add_meta_boxes', array( $this, 'settings_meta_box' ) );
469
- add_action( 'edit_form_after_title', array( $this, 'setup_meta_box' ) );
470
- add_action( 'save_post', array( $this, 'save_meta_box' ) );
471
- }
472
-
473
- /**
474
- * Is first time import?
475
- *
476
- * @param integer $post_id post ID.
477
- * @return bool
478
- */
479
- public function is_flow_imported( $post_id = 0 ) {
480
-
481
- if ( 0 === $post_id ) {
482
- $post_id = get_the_ID();
483
- }
484
-
485
- $steps = get_post_meta( $post_id, 'wcf-steps', true );
486
- $choice = get_post_meta( $post_id, 'wcf-flow-choise', true );
487
-
488
- if ( empty( $steps ) && 'import' === $choice ) {
489
- return true;
490
- }
491
-
492
- return false;
493
- }
494
-
495
- /**
496
- * Setup meta box.
497
- *
498
- * @return void
499
- */
500
- public function setup_meta_box() {
501
- if ( ! Cartflows_Admin::is_flow_edit_admin() ) {
502
- return;
503
- }
504
-
505
- /**
506
- * Adding Add new step button to the top*/
507
- echo $this->add_add_new_step_button();
508
-
509
- $this->markup_meta_box();
510
-
511
- $this->add_upgrade_to_pro_metabox();
512
- }
513
-
514
-
515
- /**
516
- * Add metabox when cartflows pro is not enabled.
517
- */
518
- public function add_upgrade_to_pro_metabox() {
519
-
520
- if ( ! _is_cartflows_pro() ) {
521
- add_meta_box(
522
- 'wcf-upgrade-pro',
523
- __( 'Analytics', 'cartflows' ),
524
- array( $this, 'upgrade_to_pro' ),
525
- CARTFLOWS_FLOW_POST_TYPE,
526
- 'side',
527
- 'high'
528
- );
529
- }
530
-
531
- }
532
-
533
- /**
534
- * Show Upgrade To Pro markup.
535
- */
536
- public function upgrade_to_pro() {
537
-
538
- echo '<div>';
539
- /* translators: %s: link */
540
- echo '<p><i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Analytics feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i></p>';
541
- echo '<p><a target="_blank" href="https://cartflows.com/" class="button button-primary">' . esc_html__( 'Get Pro', 'cartflows' ) . '</a></p>';
542
- echo '</div>';
543
-
544
- }
545
-
546
- /**
547
- * Settings meta box.
548
- *
549
- * @return void
550
- */
551
- public function settings_meta_box() {
552
-
553
- if ( CARTFLOWS_FLOW_POST_TYPE === get_post_type() ) {
554
-
555
- /* No need of sandbox will delete it later */
556
- add_meta_box(
557
- 'wcf-sandbox-settings', // Id.
558
- __( 'Flow Settings', 'cartflows' ), // Title.
559
- array( $this, 'sandbox_meta_box' ), // Callback.
560
- CARTFLOWS_FLOW_POST_TYPE, // Post_type.
561
- 'side', // Context.
562
- 'high' // Priority.
563
- );
564
-
565
- do_action( 'cartflows_add_flow_metabox' );
566
- }
567
- }
568
-
569
- /**
570
- * Metabox Markup
571
- *
572
- * @return void
573
- */
574
- public function markup_meta_box() {
575
- global $post;
576
-
577
- wp_nonce_field( 'save-nonce-flow-meta', 'nonce-flow-meta' );
578
-
579
- // Get defaults.
580
- $meta = self::get_current_post_meta( $post->ID );
581
-
582
- /**
583
- * Get options
584
- */
585
- $updated_data = array(
586
- 'steps' => $meta['wcf-steps']['default'],
587
- );
588
-
589
- do_action( 'wcf_flow_settings_markup_before', $meta );
590
- $this->page_header_tab( $updated_data );
591
- do_action( 'wcf_flow_settings_markup_after', $meta );
592
- }
593
-
594
- /**
595
- * Metabox Markup
596
- *
597
- * @param object $post Post object.
598
- * @return void
599
- */
600
- public function sandbox_meta_box( $post ) {
601
-
602
- // Get defaults.
603
- $meta = self::get_current_post_meta( $post->ID );
604
-
605
- /**
606
- * Get options
607
- */
608
- foreach ( $meta as $key => $value ) {
609
- $updated_data[ $key ] = $meta[ $key ]['default'];
610
- }
611
-
612
- do_action( 'wcf_flow_sandbox_markup_before', $meta );
613
- $this->sandbox_markup( $updated_data );
614
- do_action( 'wcf_flow_sandbox_markup_after', $meta );
615
- }
616
-
617
- /**
618
- * Page Header Tabs
619
- *
620
- * @param array $options Post meta.
621
- * @return void
622
- */
623
- public function page_header_tab( $options ) {
624
-
625
- include_once CARTFLOWS_FLOW_DIR . 'view/meta-flow-steps.php';
626
- }
627
-
628
- /**
629
- * Sandbox Markup
630
- *
631
- * @param array $options Post meta.
632
- * @return void
633
- */
634
- public function sandbox_markup( $options ) {
635
- ?>
636
- <div class="wcf-flow-sandbox-table wcf-general-metabox-wrap widefat">
637
- <div class="wcf-flow-sandbox-table-container">
638
- <?php
639
- echo wcf()->meta->get_checkbox_field(
640
- array(
641
- 'name' => 'wcf-testing',
642
- 'value' => $options['wcf-testing'],
643
- 'after' => esc_html__( 'Enable Test Mode', 'cartflows' ),
644
- )
645
- );
646
-
647
- echo wcf()->meta->get_description_field(
648
- array(
649
- 'name' => 'wcf-testing-note',
650
- 'content' => esc_html__( 'If you are using WooCommerce plugin then test mode will add random products in your flow, so you can preview it easily while testing.', 'cartflows' ),
651
- )
652
- );
653
-
654
- ?>
655
- </div>
656
- </div>
657
- <?php
658
- }
659
-
660
- /**
661
- * Keep the menu open when editing the flows.
662
- * Highlights the wanted admin (sub-) menu items for the CPT.
663
- *
664
- * @since 1.0.0
665
- */
666
- public function menu_highlight() {
667
- global $parent_file, $submenu_file, $post_type;
668
- if ( CARTFLOWS_FLOW_POST_TYPE == $post_type ) :
669
- $parent_file = CARTFLOWS_SLUG;//phpcs:ignore
670
- $submenu_file = 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE;//phpcs:ignore
671
- endif;
672
- }
673
-
674
- /**
675
- * Get metabox options
676
- *
677
- * @param int $post_id post id.
678
- * @return array
679
- */
680
- public static function get_meta_option( $post_id ) {
681
-
682
- if ( null === self::$meta_option ) {
683
- /**
684
- * Set metabox options
685
- */
686
- self::$meta_option = wcf()->options->get_flow_fields( $post_id );
687
- }
688
-
689
- return self::$meta_option;
690
- }
691
-
692
- /**
693
- * Get metabox options
694
- *
695
- * @param int $post_id post ID.
696
- * @return array
697
- */
698
- public static function get_current_post_meta( $post_id ) {
699
-
700
- $stored = get_post_meta( $post_id );
701
-
702
- $default_meta = self::get_meta_option( $post_id );
703
-
704
- // Set stored and override defaults.
705
- foreach ( $stored as $key => $value ) {
706
- if ( array_key_exists( $key, $default_meta ) ) {
707
- self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? maybe_unserialize( $stored[ $key ][0] ) : '';
708
- } else {
709
- self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : '';
710
- }
711
- }
712
-
713
- return self::get_meta_option( $post_id );
714
- }
715
-
716
- /**
717
- * Metabox Save
718
- *
719
- * @param number $post_id Post ID.
720
- * @return void
721
- */
722
- public function save_meta_box( $post_id ) {
723
-
724
- // Checks save status.
725
- $is_autosave = wp_is_post_autosave( $post_id );
726
- $is_revision = wp_is_post_revision( $post_id );
727
-
728
- $is_valid_nonce = ( isset( $_POST['nonce-flow-meta'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce-flow-meta'] ) ), 'save-nonce-flow-meta' ) ) ? true : false;
729
-
730
- // Exits script depending on save status.
731
- if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
732
- return;
733
- }
734
-
735
- wcf()->options->save_flow_fields( $post_id );
736
- }
737
-
738
- /**
739
- * Localize variables in admin
740
- *
741
- * @param array $vars variables.
742
- */
743
- public function localize_vars( $vars ) {
744
-
745
- $ajax_actions = array(
746
- 'wcf_setup_default_steps',
747
- 'wcf_add_flow_step',
748
- 'wcf_delete_flow_step',
749
- 'wcf_reorder_flow_steps',
750
- );
751
-
752
- foreach ( $ajax_actions as $action ) {
753
-
754
- $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
755
- }
756
-
757
- return $vars;
758
- }
759
-
760
- /**
761
- * Add New Step Button
762
- *
763
- * @return string
764
- */
765
- public function add_add_new_step_button() {
766
- $add_new_btn_markup = '<style>.wrap{ position:relative;}</style>';
767
- $add_new_btn_markup .= "<div class='wcf-button-wrap'>";
768
- $add_new_btn_markup .= "<button class='wcf-trigger-popup page-title-action'>";
769
- $add_new_btn_markup .= esc_html__( 'Add New Step', 'cartflows' );
770
- $add_new_btn_markup .= '</button>';
771
- $add_new_btn_markup .= '</div>';
772
-
773
- return $add_new_btn_markup;
774
- }
775
- }
776
-
777
- /**
778
- * Kicking this off by calling 'get_instance()' method
779
- */
780
- Cartflows_Flow_Meta::get_instance();
1
+ <?php
2
+ /**
3
+ * Flow meta
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Meta Boxes setup
10
+ */
11
+ class Cartflows_Flow_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;
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
+ add_action( 'admin_head', array( $this, 'menu_highlight' ) );
45
+
46
+ add_action( 'admin_init', array( $this, 'admin_init_actions' ) );
47
+
48
+ /* Init Metabox */
49
+ add_action( 'load-post.php', array( $this, 'init_metabox' ) );
50
+ add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
51
+
52
+ /* Add Scripts */
53
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ), 20 );
54
+
55
+ add_action( 'wp_ajax_cartflows_setup_default_steps', array( $this, 'cartflows_setup_default_steps' ) );
56
+ add_action( 'wp_ajax_cartflows_delete_flow_step', array( $this, 'cartflows_delete_flow_step' ) );
57
+
58
+ add_action( 'wp_ajax_cartflows_reorder_flow_steps', array( $this, 'cartflows_reorder_flow_steps' ) );
59
+
60
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
61
+
62
+ add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
63
+ }
64
+
65
+ /**
66
+ * Display admin notices.
67
+ *
68
+ * @since 1.0.0
69
+ *
70
+ * @return void
71
+ */
72
+ public function admin_notices() {
73
+
74
+ if ( CARTFLOWS_STEP_POST_TYPE !== get_post_type() ) {
75
+ return;
76
+ }
77
+
78
+ $flow_id = get_post_meta( get_the_id(), 'wcf-flow-id', true );
79
+ if ( $flow_id ) { ?>
80
+ <div class="wcf-notice-back-edit-flow">
81
+ <p>
82
+ <a href="<?php echo esc_url( get_edit_post_link( $flow_id ) ); ?>" class="button button-primary button-hero" style="text-decoration: none;">
83
+ <i class="dashicons dashicons-arrow-left-alt"></i>
84
+ <?php esc_html_e( 'Back to edit Flow', 'cartflows' ); ?>
85
+ </a>
86
+ </p>
87
+ </div>
88
+ <?php
89
+ }
90
+ }
91
+
92
+ /**
93
+ * Initialize admin actions.
94
+ *
95
+ * @since 1.0.0
96
+ *
97
+ * @return void
98
+ */
99
+ public function admin_init_actions() {
100
+ add_action( 'before_delete_post', array( $this, 'step_post_sync' ) );
101
+ add_action( 'wp_trash_post', array( $this, 'step_post_trash_sync' ) );
102
+ add_action( 'untrashed_post', array( $this, 'step_post_untrash_sync' ) );
103
+ }
104
+
105
+ /**
106
+ * Delete term data and steps data after deleting flow.
107
+ *
108
+ * @since 1.0.0
109
+ * @param int $pid post id.
110
+ *
111
+ * @return void
112
+ */
113
+ public function step_post_sync( $pid ) {
114
+
115
+ global $post_type;
116
+
117
+ if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
118
+
119
+ $steps = get_post_meta( $pid, 'wcf-steps', true );
120
+
121
+ if ( $steps && is_array( $steps ) ) {
122
+ foreach ( $steps as $i => $step ) {
123
+ wp_delete_post( $step['id'], true );
124
+ }
125
+ }
126
+
127
+ $term_data = term_exists( 'flow-' . $pid, CARTFLOWS_TAXONOMY_STEP_FLOW );
128
+
129
+ if ( is_array( $term_data ) ) {
130
+ wp_delete_term( $term_data['term_id'], CARTFLOWS_TAXONOMY_STEP_FLOW );
131
+ }
132
+ }
133
+ }
134
+
135
+ /**
136
+ * Trash steps data after trashing flow.
137
+ *
138
+ * @since 1.0.0
139
+ * @param int $pid post id.
140
+ *
141
+ * @return void
142
+ */
143
+ public function step_post_trash_sync( $pid ) {
144
+
145
+ global $post_type;
146
+
147
+ if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
148
+
149
+ $steps = get_post_meta( $pid, 'wcf-steps', true );
150
+
151
+ if ( $steps && is_array( $steps ) ) {
152
+ foreach ( $steps as $i => $step ) {
153
+ wp_trash_post( $step['id'] );
154
+ }
155
+ }
156
+ }
157
+ }
158
+
159
+ /**
160
+ * Untrash steps data after restoring flow.
161
+ *
162
+ * @since 1.0.0
163
+ * @param int $pid post id.
164
+ *
165
+ * @return void
166
+ */
167
+ public function step_post_untrash_sync( $pid ) {
168
+
169
+ global $post_type;
170
+
171
+ if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
172
+
173
+ $steps = get_post_meta( $pid, 'wcf-steps', true );
174
+
175
+ if ( $steps && is_array( $steps ) ) {
176
+ foreach ( $steps as $i => $step ) {
177
+ wp_untrash_post( $step['id'] );
178
+ }
179
+ }
180
+ }
181
+ }
182
+
183
+ /**
184
+ * Setup default steps for flow
185
+ *
186
+ * @since 1.0.0
187
+ *
188
+ * @return void
189
+ */
190
+ public function cartflows_setup_default_steps() {
191
+
192
+ check_ajax_referer( 'wcf-setup-default-steps', 'security' );
193
+
194
+ $flow_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : '';
195
+
196
+ $result = array(
197
+ 'status' => false,
198
+ /* translators: %s flow id */
199
+ 'text' => sprintf( __( 'Steps not created for flow - %s', 'cartflows' ), $flow_id ),
200
+ );
201
+
202
+ if ( ! $flow_id ) {
203
+ wp_send_json( $result );
204
+ }
205
+
206
+ $is_step_exists = get_post_meta( $flow_id, 'wcf-steps', true );
207
+
208
+ if ( $is_step_exists ) {
209
+
210
+ $result = array(
211
+ 'status' => false,
212
+ /* translators: %s flow id */
213
+ 'text' => sprintf( __( 'Steps already exists. Flow - %s', 'cartflows' ), $flow_id ),
214
+ );
215
+
216
+ wp_send_json( $result );
217
+ }
218
+
219
+ /* Start Creating */
220
+
221
+ $flow_steps = array();
222
+
223
+ $steps_data = array(
224
+ 'landing' => __( 'Landing Page', 'cartflows' ),
225
+ 'checkout' => __( 'Checkout Page', 'cartflows' ),
226
+ 'thankyou' => __( 'Thank You Page', 'cartflows' ),
227
+ );
228
+
229
+ foreach ( $steps_data as $slug => $title ) {
230
+
231
+ $step_id = wp_insert_post(
232
+ array(
233
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
234
+ 'post_title' => $title,
235
+ 'post_content' => '[cartflows_navigation]',
236
+ 'post_status' => 'publish',
237
+ )
238
+ );
239
+
240
+ if ( $step_id ) {
241
+
242
+ $flow_steps[] = array(
243
+ 'id' => $step_id,
244
+ 'title' => $title,
245
+ 'type' => $slug,
246
+ );
247
+
248
+ // insert post meta.
249
+ update_post_meta( $step_id, 'wcf-flow-id', $flow_id );
250
+ update_post_meta( $step_id, 'wcf-step-type', $slug );
251
+
252
+ wp_set_object_terms( $step_id, $slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
253
+ wp_set_object_terms( $step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
254
+ }
255
+ }
256
+
257
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
258
+
259
+ $result = array(
260
+ 'status' => true,
261
+ /* translators: %s flow id */
262
+ 'text' => sprintf( __( 'Steps created for flow - %s', 'cartflows' ), $flow_id ),
263
+ 'redirect' => get_edit_post_link( $flow_id ),
264
+ );
265
+
266
+ wp_send_json( $result );
267
+ }
268
+
269
+ /**
270
+ * Create step for given flow.
271
+ *
272
+ * @param int $flow_id flow ID.
273
+ * @param int $step_type step type.
274
+ * @param int $step_title step title.
275
+ * @since 1.0.0
276
+ *
277
+ * @return int
278
+ */
279
+ public function create_step( $flow_id, $step_type, $step_title ) {
280
+
281
+ $new_step_id = wp_insert_post(
282
+ array(
283
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
284
+ 'post_title' => $step_title,
285
+ 'post_status' => 'publish',
286
+ )
287
+ );
288
+
289
+ if ( $new_step_id ) {
290
+
291
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
292
+
293
+ if ( ! is_array( $flow_steps ) ) {
294
+ $flow_steps = array();
295
+ }
296
+
297
+ $flow_steps[] = array(
298
+ 'id' => $new_step_id,
299
+ 'title' => $step_title,
300
+ 'type' => $step_type,
301
+ );
302
+
303
+ // insert post meta.
304
+ update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
305
+ update_post_meta( $new_step_id, 'wcf-step-type', $step_type );
306
+
307
+ wp_set_object_terms( $new_step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
308
+ wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
309
+ }
310
+
311
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
312
+
313
+ return $new_step_id;
314
+ }
315
+
316
+ /**
317
+ * Delete step for flow
318
+ *
319
+ * @since 1.0.0
320
+ *
321
+ * @return void
322
+ */
323
+ public function cartflows_delete_flow_step() {
324
+
325
+ check_ajax_referer( 'wcf-delete-flow-step', 'security' );
326
+
327
+ if ( isset( $_POST['post_id'] ) && isset( $_POST['step_id'] ) ) {
328
+ $flow_id = intval( $_POST['post_id'] );
329
+ $step_id = intval( $_POST['step_id'] );
330
+ }
331
+ $result = array(
332
+ 'status' => false,
333
+ /* translators: %s flow id */
334
+ 'text' => sprintf( __( 'Step not deleted for flow - %s', 'cartflows' ), $flow_id ),
335
+ );
336
+
337
+ if ( ! $flow_id || ! $step_id ) {
338
+ wp_send_json( $result );
339
+ }
340
+
341
+ wp_delete_post( $step_id, true );
342
+
343
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
344
+
345
+ if ( ! is_array( $flow_steps ) ) {
346
+ wp_send_json( $result );
347
+ }
348
+
349
+ foreach ( $flow_steps as $index => $data ) {
350
+
351
+ if ( intval( $data['id'] ) === $step_id ) {
352
+ unset( $flow_steps[ $index ] );
353
+ break;
354
+ }
355
+ }
356
+
357
+ /* Set index order properly */
358
+ $flow_steps = array_merge( $flow_steps );
359
+
360
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
361
+
362
+ $result = array(
363
+ 'status' => true,
364
+ /* translators: %s flow id */
365
+ 'text' => sprintf( __( 'Step deleted for flow - %s', 'cartflows' ), $flow_id ),
366
+ );
367
+
368
+ wp_send_json( $result );
369
+ }
370
+
371
+ /**
372
+ * Reorder step flow
373
+ *
374
+ * @since 1.0.0
375
+ *
376
+ * @return void
377
+ */
378
+ public function cartflows_reorder_flow_steps() {
379
+
380
+ check_ajax_referer( 'wcf-reorder-flow-steps', 'security' );
381
+
382
+ if ( isset( $_POST['post_id'] ) && isset( $_POST['step_ids'] ) ) {
383
+ $flow_id = intval( $_POST['post_id'] );
384
+ $step_ids = array_map( 'intval', $_POST['step_ids'] );
385
+ }
386
+ $result = array(
387
+ 'status' => false,
388
+ /* translators: %s flow id */
389
+ 'text' => sprintf( __( 'Steps not sorted for flow - %s', 'cartflows' ), $flow_id ),
390
+ );
391
+
392
+ if ( ! $flow_id || ! is_array( $step_ids ) ) {
393
+ wp_send_json( $result );
394
+ }
395
+
396
+ $new_flow_steps = array();
397
+
398
+ foreach ( $step_ids as $index => $step_id ) {
399
+
400
+ $new_flow_steps[] = array(
401
+ 'id' => intval( $step_id ),
402
+ 'title' => get_the_title( $step_id ),
403
+ 'type' => get_post_meta( $step_id, 'wcf-step-type', true ),
404
+ );
405
+ }
406
+
407
+ update_post_meta( $flow_id, 'wcf-steps', $new_flow_steps );
408
+
409
+ $result = array(
410
+ 'status' => true,
411
+ /* translators: %s flow id */
412
+ 'text' => sprintf( __( 'Steps sorted for flow - %s', 'cartflows' ), $flow_id ),
413
+ );
414
+
415
+ wp_send_json( $result );
416
+ }
417
+
418
+
419
+ /**
420
+ * Load admin scripts
421
+ *
422
+ * @since 1.0.0
423
+ *
424
+ * @return void
425
+ */
426
+ public function admin_scripts() {
427
+
428
+ global $pagenow;
429
+ global $post;
430
+
431
+ $screen = get_current_screen();
432
+
433
+ if ( ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) && CARTFLOWS_FLOW_POST_TYPE == $screen->post_type ) {
434
+
435
+ wp_enqueue_script(
436
+ 'wcf-flow-meta',
437
+ CARTFLOWS_URL . 'admin/assets/js/flow-admin-edit.js',
438
+ array( 'jquery', 'jquery-ui-sortable' ),
439
+ CARTFLOWS_VER,
440
+ true
441
+ );
442
+
443
+ wp_enqueue_style( 'wcf-flow-meta', CARTFLOWS_URL . 'admin/assets/css/flow-admin-edit.css', '', CARTFLOWS_VER );
444
+ wp_style_add_data( 'wcf-flow-meta', 'rtl', 'replace' );
445
+
446
+ $localize = array(
447
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
448
+ );
449
+
450
+ wp_localize_script( 'jquery', 'cartflows', apply_filters( 'wcf_js_localize', $localize ) );
451
+ }
452
+ }
453
+
454
+ /**
455
+ * Initialize meta box
456
+ *
457
+ * @since 1.0.0
458
+ *
459
+ * @return void
460
+ */
461
+ public function init_metabox() {
462
+
463
+ /**
464
+ * Fires after the title field.
465
+ *
466
+ * @param WP_Post $post Post object.
467
+ */
468
+ add_action( 'add_meta_boxes', array( $this, 'settings_meta_box' ) );
469
+ add_action( 'edit_form_after_title', array( $this, 'setup_meta_box' ) );
470
+ add_action( 'save_post', array( $this, 'save_meta_box' ) );
471
+ }
472
+
473
+ /**
474
+ * Is first time import?
475
+ *
476
+ * @param integer $post_id post ID.
477
+ * @return bool
478
+ */
479
+ public function is_flow_imported( $post_id = 0 ) {
480
+
481
+ if ( 0 === $post_id ) {
482
+ $post_id = get_the_ID();
483
+ }
484
+
485
+ $steps = get_post_meta( $post_id, 'wcf-steps', true );
486
+ $choice = get_post_meta( $post_id, 'wcf-flow-choise', true );
487
+
488
+ if ( empty( $steps ) && 'import' === $choice ) {
489
+ return true;
490
+ }
491
+
492
+ return false;
493
+ }
494
+
495
+ /**
496
+ * Setup meta box.
497
+ *
498
+ * @return void
499
+ */
500
+ public function setup_meta_box() {
501
+ if ( ! Cartflows_Admin::is_flow_edit_admin() ) {
502
+ return;
503
+ }
504
+
505
+ /**
506
+ * Adding Add new step button to the top*/
507
+ echo $this->add_add_new_step_button();
508
+
509
+ $this->markup_meta_box();
510
+
511
+ $this->add_upgrade_to_pro_metabox();
512
+ }
513
+
514
+
515
+ /**
516
+ * Add metabox when cartflows pro is not enabled.
517
+ */
518
+ public function add_upgrade_to_pro_metabox() {
519
+
520
+ if ( ! _is_cartflows_pro() ) {
521
+ add_meta_box(
522
+ 'wcf-upgrade-pro',
523
+ __( 'Analytics', 'cartflows' ),
524
+ array( $this, 'upgrade_to_pro' ),
525
+ CARTFLOWS_FLOW_POST_TYPE,
526
+ 'side',
527
+ 'high'
528
+ );
529
+ }
530
+
531
+ }
532
+
533
+ /**
534
+ * Show Upgrade To Pro markup.
535
+ */
536
+ public function upgrade_to_pro() {
537
+
538
+ echo '<div>';
539
+ /* translators: %s: link */
540
+ echo '<p><i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Analytics feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i></p>';
541
+ echo '<p><a target="_blank" href="https://cartflows.com/" class="button button-primary">' . esc_html__( 'Get Pro', 'cartflows' ) . '</a></p>';
542
+ echo '</div>';
543
+
544
+ }
545
+
546
+ /**
547
+ * Settings meta box.
548
+ *
549
+ * @return void
550
+ */
551
+ public function settings_meta_box() {
552
+
553
+ if ( CARTFLOWS_FLOW_POST_TYPE === get_post_type() ) {
554
+
555
+ /* No need of sandbox will delete it later */
556
+ add_meta_box(
557
+ 'wcf-sandbox-settings', // Id.
558
+ __( 'Flow Settings', 'cartflows' ), // Title.
559
+ array( $this, 'sandbox_meta_box' ), // Callback.
560
+ CARTFLOWS_FLOW_POST_TYPE, // Post_type.
561
+ 'side', // Context.
562
+ 'high' // Priority.
563
+ );
564
+
565
+ do_action( 'cartflows_add_flow_metabox' );
566
+ }
567
+ }
568
+
569
+ /**
570
+ * Metabox Markup
571
+ *
572
+ * @return void
573
+ */
574
+ public function markup_meta_box() {
575
+ global $post;
576
+
577
+ wp_nonce_field( 'save-nonce-flow-meta', 'nonce-flow-meta' );
578
+
579
+ // Get defaults.
580
+ $meta = self::get_current_post_meta( $post->ID );
581
+
582
+ /**
583
+ * Get options
584
+ */
585
+ $updated_data = array(
586
+ 'steps' => $meta['wcf-steps']['default'],
587
+ );
588
+
589
+ do_action( 'wcf_flow_settings_markup_before', $meta );
590
+ $this->page_header_tab( $updated_data );
591
+ do_action( 'wcf_flow_settings_markup_after', $meta );
592
+ }
593
+
594
+ /**
595
+ * Metabox Markup
596
+ *
597
+ * @param object $post Post object.
598
+ * @return void
599
+ */
600
+ public function sandbox_meta_box( $post ) {
601
+
602
+ // Get defaults.
603
+ $meta = self::get_current_post_meta( $post->ID );
604
+
605
+ /**
606
+ * Get options
607
+ */
608
+ foreach ( $meta as $key => $value ) {
609
+ $updated_data[ $key ] = $meta[ $key ]['default'];
610
+ }
611
+
612
+ do_action( 'wcf_flow_sandbox_markup_before', $meta );
613
+ $this->sandbox_markup( $updated_data );
614
+ do_action( 'wcf_flow_sandbox_markup_after', $meta );
615
+ }
616
+
617
+ /**
618
+ * Page Header Tabs
619
+ *
620
+ * @param array $options Post meta.
621
+ * @return void
622
+ */
623
+ public function page_header_tab( $options ) {
624
+
625
+ include_once CARTFLOWS_FLOW_DIR . 'view/meta-flow-steps.php';
626
+ }
627
+
628
+ /**
629
+ * Sandbox Markup
630
+ *
631
+ * @param array $options Post meta.
632
+ * @return void
633
+ */
634
+ public function sandbox_markup( $options ) {
635
+ ?>
636
+ <div class="wcf-flow-sandbox-table wcf-general-metabox-wrap widefat">
637
+ <div class="wcf-flow-sandbox-table-container">
638
+ <?php
639
+ echo wcf()->meta->get_checkbox_field(
640
+ array(
641
+ 'name' => 'wcf-testing',
642
+ 'value' => $options['wcf-testing'],
643
+ 'after' => esc_html__( 'Enable Test Mode', 'cartflows' ),
644
+ )
645
+ );
646
+
647
+ echo wcf()->meta->get_description_field(
648
+ array(
649
+ 'name' => 'wcf-testing-note',
650
+ 'content' => esc_html__( 'If you are using WooCommerce plugin then test mode will add random products in your flow, so you can preview it easily while testing.', 'cartflows' ),
651
+ )
652
+ );
653
+
654
+ ?>
655
+ </div>
656
+ </div>
657
+ <?php
658
+ }
659
+
660
+ /**
661
+ * Keep the menu open when editing the flows.
662
+ * Highlights the wanted admin (sub-) menu items for the CPT.
663
+ *
664
+ * @since 1.0.0
665
+ */
666
+ public function menu_highlight() {
667
+ global $parent_file, $submenu_file, $post_type;
668
+ if ( CARTFLOWS_FLOW_POST_TYPE == $post_type ) :
669
+ $parent_file = CARTFLOWS_SLUG;//phpcs:ignore
670
+ $submenu_file = 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE;//phpcs:ignore
671
+ endif;
672
+ }
673
+
674
+ /**
675
+ * Get metabox options
676
+ *
677
+ * @param int $post_id post id.
678
+ * @return array
679
+ */
680
+ public static function get_meta_option( $post_id ) {
681
+
682
+ if ( null === self::$meta_option ) {
683
+ /**
684
+ * Set metabox options
685
+ */
686
+ self::$meta_option = wcf()->options->get_flow_fields( $post_id );
687
+ }
688
+
689
+ return self::$meta_option;
690
+ }
691
+
692
+ /**
693
+ * Get metabox options
694
+ *
695
+ * @param int $post_id post ID.
696
+ * @return array
697
+ */
698
+ public static function get_current_post_meta( $post_id ) {
699
+
700
+ $stored = get_post_meta( $post_id );
701
+
702
+ $default_meta = self::get_meta_option( $post_id );
703
+
704
+ // Set stored and override defaults.
705
+ foreach ( $stored as $key => $value ) {
706
+ if ( array_key_exists( $key, $default_meta ) ) {
707
+ self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? maybe_unserialize( $stored[ $key ][0] ) : '';
708
+ } else {
709
+ self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : '';
710
+ }
711
+ }
712
+
713
+ return self::get_meta_option( $post_id );
714
+ }
715
+
716
+ /**
717
+ * Metabox Save
718
+ *
719
+ * @param number $post_id Post ID.
720
+ * @return void
721
+ */
722
+ public function save_meta_box( $post_id ) {
723
+
724
+ // Checks save status.
725
+ $is_autosave = wp_is_post_autosave( $post_id );
726
+ $is_revision = wp_is_post_revision( $post_id );
727
+
728
+ $is_valid_nonce = ( isset( $_POST['nonce-flow-meta'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce-flow-meta'] ) ), 'save-nonce-flow-meta' ) ) ? true : false;
729
+
730
+ // Exits script depending on save status.
731
+ if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
732
+ return;
733
+ }
734
+
735
+ wcf()->options->save_flow_fields( $post_id );
736
+ }
737
+
738
+ /**
739
+ * Localize variables in admin
740
+ *
741
+ * @param array $vars variables.
742
+ */
743
+ public function localize_vars( $vars ) {
744
+
745
+ $ajax_actions = array(
746
+ 'wcf_setup_default_steps',
747
+ 'wcf_add_flow_step',
748
+ 'wcf_delete_flow_step',
749
+ 'wcf_reorder_flow_steps',
750
+ );
751
+
752
+ foreach ( $ajax_actions as $action ) {
753
+
754
+ $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
755
+ }
756
+
757
+ return $vars;
758
+ }
759
+
760
+ /**
761
+ * Add New Step Button
762
+ *
763
+ * @return string
764
+ */
765
+ public function add_add_new_step_button() {
766
+ $add_new_btn_markup = '<style>.wrap{ position:relative;}</style>';
767
+ $add_new_btn_markup .= "<div class='wcf-button-wrap'>";
768
+ $add_new_btn_markup .= "<button class='wcf-trigger-popup page-title-action'>";
769
+ $add_new_btn_markup .= esc_html__( 'Add New Step', 'cartflows' );
770
+ $add_new_btn_markup .= '</button>';
771
+ $add_new_btn_markup .= '</div>';
772
+
773
+ return $add_new_btn_markup;
774
+ }
775
+ }
776
+
777
+ /**
778
+ * Kicking this off by calling 'get_instance()' method
779
+ */
780
+ Cartflows_Flow_Meta::get_instance();
modules/flow/classes/class-cartflows-flow-post-type.php CHANGED
@@ -1,334 +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
- if ( isset( $_GET['post_type'] ) && CARTFLOWS_STEP_POST_TYPE == $_GET['post_type'] ) {
63
-
64
- global $post;
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 ( false && ! _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
- }
149
- }
150
-
151
- register_post_type( CARTFLOWS_FLOW_POST_TYPE, $args );
152
- }
153
-
154
- /**
155
- * Change metabox position.
156
- */
157
- public function wcf_change_metabox_position() {
158
-
159
- remove_meta_box( 'slugdiv', CARTFLOWS_FLOW_POST_TYPE, 'normal' );
160
- add_meta_box( 'slugdiv', __( 'Slug', 'cartflows' ), 'post_slug_meta_box', CARTFLOWS_FLOW_POST_TYPE, 'side', 'high' );
161
- }
162
-
163
- /**
164
- * Add post raw actions
165
- *
166
- * @param array $actions actions.
167
- * @param array $post post data.
168
- * @return array
169
- */
170
- public function post_row_actions( $actions, $post ) {
171
-
172
- $first_step = $this->get_first_step_url( $post );
173
-
174
- if ( $first_step && isset( $actions['view'] ) ) {
175
-
176
- $actions['view'] = '<a href="' . $first_step . '">' . __( 'View', 'cartflows' ) . '</a>';
177
- }
178
-
179
- return $actions;
180
- }
181
-
182
- /**
183
- * Returns previous post link
184
- *
185
- * @param string $prev_link previous link.
186
- * @param array $post post data.
187
- * @return string
188
- */
189
- public function preview_post_link( $prev_link, $post ) {
190
-
191
- if ( $this->is_flow_post_type( $post ) ) {
192
-
193
- $first_step = $this->get_first_step_url( $post );
194
-
195
- if ( $first_step ) {
196
-
197
- return $first_step;
198
- }
199
-
200
- return '';
201
- }
202
-
203
- return $prev_link;
204
- }
205
-
206
- /**
207
- * Check if post type is flow
208
- *
209
- * @param array $post post data.
210
- * @return bool
211
- */
212
- public function is_flow_post_type( $post ) {
213
-
214
- if ( isset( $post ) && CARTFLOWS_FLOW_POST_TYPE === $post->post_type ) {
215
-
216
- return true;
217
- }
218
-
219
- return false;
220
- }
221
-
222
- /**
223
- * Redirect to first step
224
- *
225
- * @return void
226
- */
227
- public function redirect_to_step() {
228
-
229
- global $post;
230
-
231
- $first_step = $this->get_first_step_url( $post );
232
-
233
- if ( $first_step ) {
234
-
235
- wp_safe_redirect( $first_step );
236
- die;
237
- }
238
- }
239
-
240
- /**
241
- * Return first step URL
242
- *
243
- * @param array $post post data.
244
- * @return bool
245
- */
246
- public function get_first_step_url( $post ) {
247
-
248
- if ( $this->is_flow_post_type( $post ) ) {
249
-
250
- $flow_id = $post->ID;
251
- $title = $post->post_title;
252
- $steps = get_post_meta( $flow_id, 'wcf-steps', true );
253
-
254
- if ( is_array( $steps ) && ! empty( $steps ) && isset( $steps[0]['id'] ) ) {
255
-
256
- return get_permalink( $steps[0]['id'] );
257
- }
258
- }
259
-
260
- return false;
261
- }
262
-
263
- /**
264
- * Register the admin menu for Custom Layouts
265
- *
266
- * @since 1.0.0
267
- * Moved the menu under Appearance -> Custom Layouts
268
- public function register_admin_menu() {
269
- add_submenu_page(
270
- CARTFLOWS_SLUG,
271
- __( 'Flows', 'wcf' ),
272
- __( 'Flows', 'wcf' ),
273
- 'edit_pages',
274
- 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE
275
- );
276
- }
277
- */
278
- public function register_as_submenu() {
279
-
280
- global $submenu;
281
-
282
- $submenu[ CARTFLOWS_SLUG ][0] = array( //phpcs:ignore
283
- __( 'Flows', 'cartflows' ),
284
- 'edit_pages',
285
- 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE,
286
- );
287
- }
288
-
289
- /**
290
- * Add Update messages for any custom post type
291
- *
292
- * @param array $messages Array of default messages.
293
- */
294
- public function custom_post_type_post_update_messages( $messages ) {
295
-
296
- $custom_post_type = get_post_type( get_the_ID() );
297
-
298
- if ( CARTFLOWS_FLOW_POST_TYPE == $custom_post_type ) {
299
-
300
- $obj = get_post_type_object( $custom_post_type );
301
- $singular_name = $obj->labels->singular_name;
302
- $messages[ $custom_post_type ] = array(
303
- 0 => '', // Unused. Messages start at index 1.
304
- /* translators: %s: singular custom post type name */
305
- 1 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
306
- /* translators: %s: singular custom post type name */
307
- 2 => sprintf( __( 'Custom %s updated.', 'cartflows' ), $singular_name ),
308
- /* translators: %s: singular custom post type name */
309
- 3 => sprintf( __( 'Custom %s deleted.', 'cartflows' ), $singular_name ),
310
- /* translators: %s: singular custom post type name */
311
- 4 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
312
- /* translators: %1$s: singular custom post type name ,%2$s: date and time of the revision */
313
- 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,
314
- /* translators: %s: singular custom post type name */
315
- 6 => sprintf( __( '%s published.', 'cartflows' ), $singular_name ),
316
- /* translators: %s: singular custom post type name */
317
- 7 => sprintf( __( '%s saved.', 'cartflows' ), $singular_name ),
318
- /* translators: %s: singular custom post type name */
319
- 8 => sprintf( __( '%s submitted.', 'cartflows' ), $singular_name ),
320
- /* translators: %s: singular custom post type name */
321
- 9 => sprintf( __( '%s scheduled for.', 'cartflows' ), $singular_name ),
322
- /* translators: %s: singular custom post type name */
323
- 10 => sprintf( __( '%s draft updated.', 'cartflows' ), $singular_name ),
324
- );
325
- }
326
-
327
- return $messages;
328
- }
329
- }
330
-
331
- /**
332
- * Kicking this off by calling 'get_instance()' method
333
- */
334
- 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
+ if ( isset( $_GET['post_type'] ) && CARTFLOWS_STEP_POST_TYPE == $_GET['post_type'] ) {
63
+
64
+ global $post;
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,
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'] ) ) {
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'] ) ) {
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,468 @@
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,
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' => __( '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,
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();
modules/flow/view/meta-flow-steps.php CHANGED
@@ -99,11 +99,15 @@ $steps = array(
99
  <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' ); ?>" >
100
  <span class="dashicons dashicons-edit"></span>
101
  <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Edit', 'cartflows' ); ?></span>
102
- </a>
 
 
 
103
  <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']; ?>">
104
  <span class="dashicons dashicons-admin-page"></span>
105
  <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Clone', 'cartflows' ); ?></span>
106
  </a>
 
107
  <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']; ?>">
108
  <span class="dashicons dashicons-trash"></span>
109
  <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Delete', 'cartflows' ); ?></span>
99
  <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' ); ?>" >
100
  <span class="dashicons dashicons-edit"></span>
101
  <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Edit', 'cartflows' ); ?></span>
102
+ </a>
103
+ <?php
104
+ if ( _is_cartflows_pro() ) {
105
+ ?>
106
  <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']; ?>">
107
  <span class="dashicons dashicons-admin-page"></span>
108
  <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Clone', 'cartflows' ); ?></span>
109
  </a>
110
+ <?php } ?>
111
  <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']; ?>">
112
  <span class="dashicons dashicons-trash"></span>
113
  <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Delete', 'cartflows' ); ?></span>
modules/landing/classes/class-cartflows-landing-meta.php CHANGED
@@ -1,235 +1,235 @@
1
- <?php
2
- /**
3
- * Landing post meta box
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Meta Boxes setup
10
- */
11
- class Cartflows_Landing_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
- /**
50
- * Init Metabox
51
- */
52
- public function init_metabox() {
53
-
54
- add_action( 'add_meta_boxes', array( $this, 'setup_meta_box' ) );
55
- add_action( 'save_post', array( $this, 'save_meta_box' ) );
56
- }
57
-
58
- /**
59
- * Setup Metabox
60
- */
61
- public function setup_meta_box() {
62
-
63
- if ( _is_wcf_landing_type() ) {
64
- add_meta_box(
65
- 'wcf-ladning-settings', // Id.
66
- __( 'Landing Page Settings', 'cartflows' ), // Title.
67
- array( $this, 'landing_meta_box' ), // Callback.
68
- wcf()->utils->get_step_post_type(), // Post_type.
69
- 'normal', // Context.
70
- 'high' // Priority.
71
- );
72
- }
73
- }
74
-
75
- /**
76
- * Landing Metabox Markup
77
- *
78
- * @param object $post Post object.
79
- * @return void
80
- */
81
- public function landing_meta_box( $post ) {
82
-
83
- wp_nonce_field( 'save-nonce-landing-step-meta', 'nonce-landing-step-meta' );
84
- $stored = get_post_meta( $post->ID );
85
-
86
- $checkout_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, $checkout_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
-
100
- /**
101
- * Get options
102
- */
103
- $landing_data = array();
104
- foreach ( $meta as $key => $value ) {
105
-
106
- $landing_data[ $key ] = $meta[ $key ]['default'];
107
- }
108
-
109
- do_action( 'wcf_landing_settings_markup_before', $meta );
110
- $this->page_header_tab( $landing_data, $post->ID );
111
- do_action( 'wcf_landing_settings_markup_after', $meta );
112
- }
113
-
114
- /**
115
- * Page Header Tabs
116
- *
117
- * @param array $options Post meta.
118
- * @param int $post_id Post ID.
119
- */
120
- public function page_header_tab( $options, $post_id ) {
121
-
122
- $active_tab = get_post_meta( $post_id, 'wcf_active_tab', true );
123
-
124
- if ( empty( $active_tab ) ) {
125
- $active_tab = 'wcf-landing-shortcodes';
126
- }
127
-
128
- $tabs = array(
129
- array(
130
- 'title' => __( 'Shortcodes', 'cartflows' ),
131
- 'id' => 'wcf-landing-shortcodes',
132
- 'class' => 'wcf-landing-shortcodes' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
133
- 'icon' => 'dashicons-info',
134
- ),
135
- array(
136
- 'title' => __( 'Custom Script', 'cartflows' ),
137
- 'id' => 'wcf-landing-custom-script-header',
138
- 'class' => 'wcf-landing-custom-script-header' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
139
- 'icon' => 'dashicons-format-aside',
140
- ),
141
- );
142
-
143
- ?>
144
- <div class="wcf-landing-table wcf-metabox-wrap widefat">
145
- <div class="wcf-table-container">
146
- <div class="wcf-column-left">
147
- <div class="wcf-tab-wrapper">
148
-
149
- <?php foreach ( $tabs as $key => $tab ) { ?>
150
- <div class="<?php echo esc_attr( $tab['class'] ); ?>" data-tab="<?php echo esc_attr( $tab['id'] ); ?>">
151
- <span class="dashicons <?php echo esc_attr( $tab['icon'] ); ?>"></span>
152
- <span class="wcf-tab-title"><?php echo esc_html( $tab['title'] ); ?></span>
153
- </div>
154
- <?php } ?>
155
- <input type="hidden" id="wcf_active_tab" name="wcf_active_tab" value="<?php echo esc_attr( $active_tab ); ?>" />
156
-
157
- </div>
158
- </div>
159
- <div class="wcf-column-right">
160
- <div class="wcf-landing-shortcodes wcf-tab-content active widefat">
161
- <?php
162
-
163
- $next_step_link = wcf()->utils->get_linking_url(
164
- array( 'class' => 'wcf-next-step' )
165
- );
166
-
167
- echo wcf()->meta->get_shortcode_field(
168
- array(
169
- 'label' => __( 'Next Step Link', 'cartflows' ),
170
- 'name' => 'wcf-next-step-link',
171
- 'content' => $next_step_link,
172
- )
173
- );
174
-
175
- ?>
176
- </div>
177
-
178
- <?php $this->tab_custom_script( $options, $post_id ); ?>
179
-
180
- <?php $this->right_column_footer( $options, $post_id ); ?>
181
- </div>
182
- </div>
183
- </div>
184
-
185
- <?php
186
-
187
- }
188
-
189
- /**
190
- * Get metabox options
191
- *
192
- * @param int $post_id post ID.
193
- * @return array
194
- */
195
- public static function get_meta_option( $post_id ) {
196
-
197
- if ( null === self::$meta_option ) {
198
- /**
199
- * Set metabox options
200
- *
201
- * @see http://php.net/manual/en/filter.filters.sanitize.php
202
- */
203
- self::$meta_option = wcf()->options->get_landing_fields( $post_id );
204
- }
205
-
206
- return self::$meta_option;
207
- }
208
-
209
- /**
210
- * Metabox Save
211
- *
212
- * @param number $post_id Post ID.
213
- * @return void
214
- */
215
- public function save_meta_box( $post_id ) {
216
-
217
- // Checks save status.
218
- $is_autosave = wp_is_post_autosave( $post_id );
219
- $is_revision = wp_is_post_revision( $post_id );
220
-
221
- $is_valid_nonce = ( isset( $_POST['nonce-landing-step-meta'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce-landing-step-meta'] ) ), 'save-nonce-landing-step-meta' ) ) ? true : false;
222
-
223
- // Exits script depending on save status.
224
- if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
225
- return;
226
- }
227
-
228
- wcf()->options->save_landing_fields( $post_id );
229
- }
230
- }
231
-
232
- /**
233
- * Kicking this off by calling 'get_instance()' method
234
- */
235
- Cartflows_Landing_Meta::get_instance();
1
+ <?php
2
+ /**
3
+ * Landing post meta box
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Meta Boxes setup
10
+ */
11
+ class Cartflows_Landing_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
+ /**
50
+ * Init Metabox
51
+ */
52
+ public function init_metabox() {
53
+
54
+ add_action( 'add_meta_boxes', array( $this, 'setup_meta_box' ) );
55
+ add_action( 'save_post', array( $this, 'save_meta_box' ) );
56
+ }
57
+
58
+ /**
59
+ * Setup Metabox
60
+ */
61
+ public function setup_meta_box() {
62
+
63
+ if ( _is_wcf_landing_type() ) {
64
+ add_meta_box(
65
+ 'wcf-ladning-settings', // Id.
66
+ __( 'Landing Page Settings', 'cartflows' ), // Title.
67
+ array( $this, 'landing_meta_box' ), // Callback.
68
+ wcf()->utils->get_step_post_type(), // Post_type.
69
+ 'normal', // Context.
70
+ 'high' // Priority.
71
+ );
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Landing Metabox Markup
77
+ *
78
+ * @param object $post Post object.
79
+ * @return void
80
+ */
81
+ public function landing_meta_box( $post ) {
82
+
83
+ wp_nonce_field( 'save-nonce-landing-step-meta', 'nonce-landing-step-meta' );
84
+ $stored = get_post_meta( $post->ID );
85
+
86
+ $checkout_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, $checkout_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
+
100
+ /**
101
+ * Get options
102
+ */
103
+ $landing_data = array();
104
+ foreach ( $meta as $key => $value ) {
105
+
106
+ $landing_data[ $key ] = $meta[ $key ]['default'];
107
+ }
108
+
109
+ do_action( 'wcf_landing_settings_markup_before', $meta );
110
+ $this->page_header_tab( $landing_data, $post->ID );
111
+ do_action( 'wcf_landing_settings_markup_after', $meta );
112
+ }
113
+
114
+ /**
115
+ * Page Header Tabs
116
+ *
117
+ * @param array $options Post meta.
118
+ * @param int $post_id Post ID.
119
+ */
120
+ public function page_header_tab( $options, $post_id ) {
121
+
122
+ $active_tab = get_post_meta( $post_id, 'wcf_active_tab', true );
123
+
124
+ if ( empty( $active_tab ) ) {
125
+ $active_tab = 'wcf-landing-shortcodes';
126
+ }
127
+
128
+ $tabs = array(
129
+ array(
130
+ 'title' => __( 'Shortcodes', 'cartflows' ),
131
+ 'id' => 'wcf-landing-shortcodes',
132
+ 'class' => 'wcf-landing-shortcodes' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
133
+ 'icon' => 'dashicons-info',
134
+ ),
135
+ array(
136
+ 'title' => __( 'Custom Script', 'cartflows' ),
137
+ 'id' => 'wcf-landing-custom-script-header',
138
+ 'class' => 'wcf-landing-custom-script-header' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
139
+ 'icon' => 'dashicons-format-aside',
140
+ ),
141
+ );
142
+
143
+ ?>
144
+ <div class="wcf-landing-table wcf-metabox-wrap widefat">
145
+ <div class="wcf-table-container">
146
+ <div class="wcf-column-left">
147
+ <div class="wcf-tab-wrapper">
148
+
149
+ <?php foreach ( $tabs as $key => $tab ) { ?>
150
+ <div class="<?php echo esc_attr( $tab['class'] ); ?>" data-tab="<?php echo esc_attr( $tab['id'] ); ?>">
151
+ <span class="dashicons <?php echo esc_attr( $tab['icon'] ); ?>"></span>
152
+ <span class="wcf-tab-title"><?php echo esc_html( $tab['title'] ); ?></span>
153
+ </div>
154
+ <?php } ?>
155
+ <input type="hidden" id="wcf_active_tab" name="wcf_active_tab" value="<?php echo esc_attr( $active_tab ); ?>" />
156
+
157
+ </div>
158
+ </div>
159
+ <div class="wcf-column-right">
160
+ <div class="wcf-landing-shortcodes wcf-tab-content active widefat">
161
+ <?php
162
+
163
+ $next_step_link = wcf()->utils->get_linking_url(
164
+ array( 'class' => 'wcf-next-step' )
165
+ );
166
+
167
+ echo wcf()->meta->get_shortcode_field(
168
+ array(
169
+ 'label' => __( 'Next Step Link', 'cartflows' ),
170
+ 'name' => 'wcf-next-step-link',
171
+ 'content' => $next_step_link,
172
+ )
173
+ );
174
+
175
+ ?>
176
+ </div>
177
+
178
+ <?php $this->tab_custom_script( $options, $post_id ); ?>
179
+
180
+ <?php $this->right_column_footer( $options, $post_id ); ?>
181
+ </div>
182
+ </div>
183
+ </div>
184
+
185
+ <?php
186
+
187
+ }
188
+
189
+ /**
190
+ * Get metabox options
191
+ *
192
+ * @param int $post_id post ID.
193
+ * @return array
194
+ */
195
+ public static function get_meta_option( $post_id ) {
196
+
197
+ if ( null === self::$meta_option ) {
198
+ /**
199
+ * Set metabox options
200
+ *
201
+ * @see http://php.net/manual/en/filter.filters.sanitize.php
202
+ */
203
+ self::$meta_option = wcf()->options->get_landing_fields( $post_id );
204
+ }
205
+
206
+ return self::$meta_option;
207
+ }
208
+
209
+ /**
210
+ * Metabox Save
211
+ *
212
+ * @param number $post_id Post ID.
213
+ * @return void
214
+ */
215
+ public function save_meta_box( $post_id ) {
216
+
217
+ // Checks save status.
218
+ $is_autosave = wp_is_post_autosave( $post_id );
219
+ $is_revision = wp_is_post_revision( $post_id );
220
+
221
+ $is_valid_nonce = ( isset( $_POST['nonce-landing-step-meta'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce-landing-step-meta'] ) ), 'save-nonce-landing-step-meta' ) ) ? true : false;
222
+
223
+ // Exits script depending on save status.
224
+ if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
225
+ return;
226
+ }
227
+
228
+ wcf()->options->save_landing_fields( $post_id );
229
+ }
230
+ }
231
+
232
+ /**
233
+ * Kicking this off by calling 'get_instance()' method
234
+ */
235
+ Cartflows_Landing_Meta::get_instance();
modules/thankyou/classes/class-cartflows-thankyou-markup.php CHANGED
@@ -1,296 +1,296 @@
1
- <?php
2
- /**
3
- * Front end and markup
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Checkout Markup
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Thankyou_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
- /* Downsell Shortcode */
39
- add_shortcode( 'cartflows_order_details', array( $this, 'cartflows_order_details_shortcode_markup' ) );
40
-
41
- add_action( 'wp_enqueue_scripts', array( $this, 'thank_you_scripts' ), 21 );
42
-
43
- add_action( 'woocommerce_is_order_received_page', array( $this, 'set_order_received_page' ) );
44
-
45
- /* Set is checkout flag */
46
- add_filter( 'woocommerce_is_checkout', array( $this, 'woo_checkout_flag' ), 9999 );
47
- }
48
-
49
- /**
50
- * Order shortcode markup
51
- *
52
- * @param array $atts attributes.
53
- * @since 1.0.0
54
- */
55
- public function cartflows_order_details_shortcode_markup( $atts ) {
56
-
57
- $output = '';
58
-
59
- if ( _is_wcf_thankyou_type() ) {
60
- /* Remove order item link */
61
- add_filter( 'woocommerce_order_item_permalink', '__return_false' );
62
-
63
- if ( ! function_exists( 'wc_print_notices' ) ) {
64
-
65
- $notice_out = '<p class="woocommerce-notice">' . __( 'WooCommerce functions do not exist. If you are in an IFrame, please reload it.', 'cartflows' ) . '</p>';
66
- $notice_out .= '<button onClick="location.reload()">' . __( 'Click Here to Reload', 'cartflows' ) . '</button>';
67
-
68
- return $notice_out;
69
- }
70
-
71
- $order = false;
72
-
73
- if ( ! isset( $_GET['wcf-order'] ) && wcf()->flow->is_flow_testmode() ) {
74
- $args = array(
75
- 'limit' => 1,
76
- 'order' => 'DESC',
77
- 'post_type' => 'shop_order',
78
- 'status' => array( 'completed', 'processing' ),
79
- );
80
-
81
- $latest_order = wc_get_orders( $args );
82
-
83
- $order_id = ( ! empty( $latest_order ) ) ? current( $latest_order )->get_id() : 0;
84
-
85
- if ( $order_id > 0 ) {
86
- $order = wc_get_order( $order_id );
87
-
88
- if ( ! $order ) {
89
- $order = false;
90
- }
91
- }
92
- } else {
93
- if ( ! isset( $_GET['wcf-order'] ) ) {
94
- return '<p class="woocommerce-notice">Order not found. You cannot access this page directly.</p>';
95
- }
96
-
97
- // Get the order.
98
- $order_id = apply_filters( 'woocommerce_thankyou_order_id', empty( $_GET['wcf-order'] ) ? 0 : intval( $_GET['wcf-order'] ) );
99
- $order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['wcf-key'] ) ? '' : wc_clean( wp_unslash( $_GET['wcf-key'] ) ) ); //phpcs:ignore
100
-
101
- if ( $order_id > 0 ) {
102
- $order = wc_get_order( $order_id );
103
-
104
- if ( ! $order || $order->get_order_key() !== $order_key ) {
105
- $order = false;
106
- }
107
- }
108
- }
109
-
110
- // Empty awaiting payment session.
111
- unset( WC()->session->order_awaiting_payment );
112
-
113
- if ( null !== WC()->session ) {
114
- if ( ! isset( WC()->cart ) || '' === WC()->cart ) {
115
- WC()->cart = new WC_Cart();
116
- }
117
-
118
- if ( ! WC()->cart->is_empty() ) {
119
- // wc_empty_cart();
120
- // Empty current cart.
121
- WC()->cart->empty_cart( true );
122
-
123
- wc_clear_notices();
124
- }
125
-
126
- wc_print_notices();
127
- }
128
-
129
- ob_start();
130
- echo "<div class='wcf-thankyou-wrap'>";
131
- wc_get_template( 'checkout/thankyou.php', array( 'order' => $order ) );
132
- echo '</div>';
133
- $output = ob_get_clean();
134
- }
135
-
136
- return $output;
137
- }
138
-
139
- /**
140
- * Load Thank You scripts.
141
- *
142
- * @return void
143
- */
144
- public function thank_you_scripts() {
145
-
146
- if ( _is_wcf_thankyou_type() ) {
147
- do_action( 'cartflows_thank_you_scripts' );
148
-
149
- $style = $this->generate_thank_you_style();
150
-
151
- wp_add_inline_style( 'wcf-frontend-global', $style );
152
- }
153
- }
154
-
155
- /**
156
- * Set thank you as a order received page.
157
- *
158
- * @param boolean $is_order_page order page.
159
- * @return boolean
160
- */
161
- public function set_order_received_page( $is_order_page ) {
162
-
163
- if ( _is_wcf_thankyou_type() ) {
164
- $is_order_page = true;
165
- }
166
-
167
- return $is_order_page;
168
- }
169
-
170
- /**
171
- * Generate Thank You Styles.
172
- *
173
- * @return string
174
- */
175
- public function generate_thank_you_style() {
176
-
177
- global $post;
178
-
179
- if ( _is_wcf_thankyou_type() ) {
180
- $thank_you_id = $post->ID;
181
- } else {
182
- $thank_you_id = _get_wcf_thankyou_id( $post->post_content );
183
- }
184
-
185
- CartFlows_Font_Families::render_fonts( $thank_you_id );
186
-
187
- $text_color = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-text-color' );
188
- $text_font_family = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-font-family' );
189
- $heading_text_color = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-heading-color' );
190
- $heading_font_family = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-heading-font-family' );
191
- $heading_font_weight = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-heading-font-wt' );
192
- $container_width = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-container-width' );
193
- $section_bg_color = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-section-bg-color' );
194
-
195
- $show_order_review = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-show-overview-section' );
196
-
197
- $show_order_details = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-show-details-section' );
198
-
199
- $show_billing_details = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-show-billing-section' );
200
-
201
- $show_shipping_details = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-show-shipping-section' );
202
-
203
- $output = "
204
- .wcf-thankyou-wrap{
205
- color: {$text_color};
206
- font-family: {$text_font_family};
207
- max-width:{$container_width}px;
208
- }
209
-
210
- .woocommerce-order h2.woocommerce-column__title,
211
- .woocommerce-order h2.woocommerce-order-details__title,
212
- .woocommerce-order .woocommerce-thankyou-order-received,
213
- .woocommerce-order-details h2,
214
- .woocommerce-order h2.wc-bacs-bank-details-heading {
215
- color: {$heading_text_color};
216
- font-family: {$heading_font_family};
217
- font-weight: {$heading_font_weight};
218
- }
219
-
220
- .woocommerce-order ul.order_details,
221
- .woocommerce-order .woocommerce-order-details,
222
- .woocommerce-order .woocommerce-customer-details,
223
- .woocommerce-order .woocommerce-bacs-bank-details{
224
- background-color: {$section_bg_color}
225
- }
226
- img.emoji, img.wp-smiley {}
227
- ";
228
-
229
- if ( 'no' == $show_order_review ) {
230
- $output .= '
231
- .woocommerce-order ul.order_details{
232
- display: none;
233
- }
234
- ';
235
- }
236
-
237
- if ( 'no' == $show_order_details ) {
238
- $output .= '
239
- .woocommerce-order .woocommerce-order-details{
240
- display: none;
241
- }
242
- ';
243
- }
244
-
245
- if ( 'no' == $show_billing_details ) {
246
- $output .= '
247
- .woocommerce-order .woocommerce-customer-details .woocommerce-column--billing-address{
248
- display: none;
249
- }
250
- ';
251
- }
252
-
253
- if ( 'no' == $show_shipping_details ) {
254
- $output .= '
255
- .woocommerce-order .woocommerce-customer-details .woocommerce-column--shipping-address{
256
- display: none;
257
- }
258
- ';
259
- }
260
-
261
- if ( 'no' == $show_billing_details && 'no' == $show_shipping_details ) {
262
- $output .= '
263
- .woocommerce-order .woocommerce-customer-details{
264
- display: none;
265
- }
266
- ';
267
- }
268
-
269
- return $output;
270
- }
271
-
272
- /**
273
- * Set as a checkout page if it is thank you page.
274
- * Thank you page need to be set as a checkout page.
275
- * Becauye ayment gateways will not load if it is not checkout.
276
- *
277
- * @param bool $is_checkout is checkout.
278
- *
279
- * @return bool
280
- */
281
- public function woo_checkout_flag( $is_checkout ) {
282
-
283
- if ( ! is_admin() ) {
284
- if ( _is_wcf_thankyou_type() ) {
285
- $is_checkout = true;
286
- }
287
- }
288
-
289
- return $is_checkout;
290
- }
291
- }
292
-
293
- /**
294
- * Kicking this off by calling 'get_instance()' method
295
- */
296
- Cartflows_Thankyou_Markup::get_instance();
1
+ <?php
2
+ /**
3
+ * Front end and markup
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Checkout Markup
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Thankyou_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
+ /* Downsell Shortcode */
39
+ add_shortcode( 'cartflows_order_details', array( $this, 'cartflows_order_details_shortcode_markup' ) );
40
+
41
+ add_action( 'wp_enqueue_scripts', array( $this, 'thank_you_scripts' ), 21 );
42
+
43
+ add_action( 'woocommerce_is_order_received_page', array( $this, 'set_order_received_page' ) );
44
+
45
+ /* Set is checkout flag */
46
+ add_filter( 'woocommerce_is_checkout', array( $this, 'woo_checkout_flag' ), 9999 );
47
+ }
48
+
49
+ /**
50
+ * Order shortcode markup
51
+ *
52
+ * @param array $atts attributes.
53
+ * @since 1.0.0
54
+ */
55
+ public function cartflows_order_details_shortcode_markup( $atts ) {
56
+
57
+ $output = '';
58
+
59
+ if ( _is_wcf_thankyou_type() ) {
60
+ /* Remove order item link */
61
+ add_filter( 'woocommerce_order_item_permalink', '__return_false' );
62
+
63
+ if ( ! function_exists( 'wc_print_notices' ) ) {
64
+
65
+ $notice_out = '<p class="woocommerce-notice">' . __( 'WooCommerce functions do not exist. If you are in an IFrame, please reload it.', 'cartflows' ) . '</p>';
66
+ $notice_out .= '<button onClick="location.reload()">' . __( 'Click Here to Reload', 'cartflows' ) . '</button>';
67
+
68
+ return $notice_out;
69
+ }
70
+
71
+ $order = false;
72
+
73
+ if ( ! isset( $_GET['wcf-order'] ) && wcf()->flow->is_flow_testmode() ) {
74
+ $args = array(
75
+ 'limit' => 1,
76
+ 'order' => 'DESC',
77
+ 'post_type' => 'shop_order',
78
+ 'status' => array( 'completed', 'processing' ),
79
+ );
80
+
81
+ $latest_order = wc_get_orders( $args );
82
+
83
+ $order_id = ( ! empty( $latest_order ) ) ? current( $latest_order )->get_id() : 0;
84
+
85
+ if ( $order_id > 0 ) {
86
+ $order = wc_get_order( $order_id );
87
+
88
+ if ( ! $order ) {
89
+ $order = false;
90
+ }
91
+ }
92
+ } else {
93
+ if ( ! isset( $_GET['wcf-order'] ) ) {
94
+ return '<p class="woocommerce-notice">Order not found. You cannot access this page directly.</p>';
95
+ }
96
+
97
+ // Get the order.
98
+ $order_id = apply_filters( 'woocommerce_thankyou_order_id', empty( $_GET['wcf-order'] ) ? 0 : intval( $_GET['wcf-order'] ) );
99
+ $order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['wcf-key'] ) ? '' : wc_clean( wp_unslash( $_GET['wcf-key'] ) ) ); //phpcs:ignore
100
+
101
+ if ( $order_id > 0 ) {
102
+ $order = wc_get_order( $order_id );
103
+
104
+ if ( ! $order || $order->get_order_key() !== $order_key ) {
105
+ $order = false;
106
+ }
107
+ }
108
+ }
109
+
110
+ // Empty awaiting payment session.
111
+ unset( WC()->session->order_awaiting_payment );
112
+
113
+ if ( null !== WC()->session ) {
114
+ if ( ! isset( WC()->cart ) || '' === WC()->cart ) {
115
+ WC()->cart = new WC_Cart();
116
+ }
117
+
118
+ if ( ! WC()->cart->is_empty() ) {
119
+ // wc_empty_cart();
120
+ // Empty current cart.
121
+ WC()->cart->empty_cart( true );
122
+
123
+ wc_clear_notices();
124
+ }
125
+
126
+ wc_print_notices();
127
+ }
128
+
129
+ ob_start();
130
+ echo "<div class='wcf-thankyou-wrap'>";
131
+ wc_get_template( 'checkout/thankyou.php', array( 'order' => $order ) );
132
+ echo '</div>';
133
+ $output = ob_get_clean();
134
+ }
135
+
136
+ return $output;
137
+ }
138
+
139
+ /**
140
+ * Load Thank You scripts.
141
+ *
142
+ * @return void
143
+ */
144
+ public function thank_you_scripts() {
145
+
146
+ if ( _is_wcf_thankyou_type() ) {
147
+ do_action( 'cartflows_thank_you_scripts' );
148
+
149
+ $style = $this->generate_thank_you_style();
150
+
151
+ wp_add_inline_style( 'wcf-frontend-global', $style );
152
+ }
153
+ }
154
+
155
+ /**
156
+ * Set thank you as a order received page.
157
+ *
158
+ * @param boolean $is_order_page order page.
159
+ * @return boolean
160
+ */
161
+ public function set_order_received_page( $is_order_page ) {
162
+
163
+ if ( _is_wcf_thankyou_type() ) {
164
+ $is_order_page = true;
165
+ }
166
+
167
+ return $is_order_page;
168
+ }
169
+
170
+ /**
171
+ * Generate Thank You Styles.
172
+ *
173
+ * @return string
174
+ */
175
+ public function generate_thank_you_style() {
176
+
177
+ global $post;
178
+
179
+ if ( _is_wcf_thankyou_type() ) {
180
+ $thank_you_id = $post->ID;
181
+ } else {
182
+ $thank_you_id = _get_wcf_thankyou_id( $post->post_content );
183
+ }
184
+
185
+ CartFlows_Font_Families::render_fonts( $thank_you_id );
186
+
187
+ $text_color = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-text-color' );
188
+ $text_font_family = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-font-family' );
189
+ $heading_text_color = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-heading-color' );
190
+ $heading_font_family = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-heading-font-family' );
191
+ $heading_font_weight = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-heading-font-wt' );
192
+ $container_width = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-container-width' );
193
+ $section_bg_color = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-tq-section-bg-color' );
194
+
195
+ $show_order_review = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-show-overview-section' );
196
+
197
+ $show_order_details = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-show-details-section' );
198
+
199
+ $show_billing_details = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-show-billing-section' );
200
+
201
+ $show_shipping_details = wcf()->options->get_thankyou_meta_value( $thank_you_id, 'wcf-show-shipping-section' );
202
+
203
+ $output = "
204
+ .wcf-thankyou-wrap{
205
+ color: {$text_color};
206
+ font-family: {$text_font_family};
207
+ max-width:{$container_width}px;
208
+ }
209
+
210
+ .woocommerce-order h2.woocommerce-column__title,
211
+ .woocommerce-order h2.woocommerce-order-details__title,
212
+ .woocommerce-order .woocommerce-thankyou-order-received,
213
+ .woocommerce-order-details h2,
214
+ .woocommerce-order h2.wc-bacs-bank-details-heading {
215
+ color: {$heading_text_color};
216
+ font-family: {$heading_font_family};
217
+ font-weight: {$heading_font_weight};
218
+ }
219
+
220
+ .woocommerce-order ul.order_details,
221
+ .woocommerce-order .woocommerce-order-details,
222
+ .woocommerce-order .woocommerce-customer-details,
223
+ .woocommerce-order .woocommerce-bacs-bank-details{
224
+ background-color: {$section_bg_color}
225
+ }
226
+ img.emoji, img.wp-smiley {}
227
+ ";
228
+
229
+ if ( 'no' == $show_order_review ) {
230
+ $output .= '
231
+ .woocommerce-order ul.order_details{
232
+ display: none;
233
+ }
234
+ ';
235
+ }
236
+
237
+ if ( 'no' == $show_order_details ) {
238
+ $output .= '
239
+ .woocommerce-order .woocommerce-order-details{
240
+ display: none;
241
+ }
242
+ ';
243
+ }
244
+
245
+ if ( 'no' == $show_billing_details ) {
246
+ $output .= '
247
+ .woocommerce-order .woocommerce-customer-details .woocommerce-column--billing-address{
248
+ display: none;
249
+ }
250
+ ';
251
+ }
252
+
253
+ if ( 'no' == $show_shipping_details ) {
254
+ $output .= '
255
+ .woocommerce-order .woocommerce-customer-details .woocommerce-column--shipping-address{
256
+ display: none;
257
+ }
258
+ ';
259
+ }
260
+
261
+ if ( 'no' == $show_billing_details && 'no' == $show_shipping_details ) {
262
+ $output .= '
263
+ .woocommerce-order .woocommerce-customer-details{
264
+ display: none;
265
+ }
266
+ ';
267
+ }
268
+
269
+ return $output;
270
+ }
271
+
272
+ /**
273
+ * Set as a checkout page if it is thank you page.
274
+ * Thank you page need to be set as a checkout page.
275
+ * Becauye ayment gateways will not load if it is not checkout.
276
+ *
277
+ * @param bool $is_checkout is checkout.
278
+ *
279
+ * @return bool
280
+ */
281
+ public function woo_checkout_flag( $is_checkout ) {
282
+
283
+ if ( ! is_admin() ) {
284
+ if ( _is_wcf_thankyou_type() ) {
285
+ $is_checkout = true;
286
+ }
287
+ }
288
+
289
+ return $is_checkout;
290
+ }
291
+ }
292
+
293
+ /**
294
+ * Kicking this off by calling 'get_instance()' method
295
+ */
296
+ Cartflows_Thankyou_Markup::get_instance();
modules/thankyou/classes/class-cartflows-thankyou-meta.php CHANGED
@@ -1,371 +1,371 @@
1
- <?php
2
- /**
3
- * Checkout post meta box
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Meta Boxes setup
10
- */
11
- class Cartflows_Thankyou_Meta extends Cartflows_Meta {
12
-
13
- /**
14
- * Instance
15
- *
16
- * @var $instance
17
- */
18
- private static $instance;
19
-
20
- /**
21
- * Meta Option
22
- *
23
- * @var $meta_option
24
- */
25
- private static $meta_option = null;
26
-
27
- /**
28
- * Initiator
29
- */
30
- public static function get_instance() {
31
- if ( ! isset( self::$instance ) ) {
32
- self::$instance = new self();
33
- }
34
-
35
- return self::$instance;
36
- }
37
-
38
- /**
39
- * Constructor
40
- */
41
- public function __construct() {
42
-
43
- /* Init Metabox */
44
- add_action( 'load-post.php', array( $this, 'init_metabox' ) );
45
- add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
46
- }
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_thankyou_type() ) {
63
- add_meta_box(
64
- 'wcf-thankyou-settings', // Id.
65
- __( 'Thank You Page 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-thankyou-step-meta', 'nonce-thankyou-step-meta' );
83
- $stored = get_post_meta( $post->ID );
84
-
85
- $checkout_meta = self::get_meta_option( $post->ID );
86
-
87
- // Set stored and override defaults.
88
- foreach ( $stored as $key => $value ) {
89
- if ( array_key_exists( $key, $checkout_meta ) ) {
90
- self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? maybe_unserialize( $stored[ $key ][0] ) : '';
91
- } else {
92
- self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : '';
93
- }
94
- }
95
-
96
- // Get defaults.
97
- $meta = self::get_meta_option( $post->ID );
98
-
99
- /**
100
- * Get options
101
- */
102
- $thankyou_data = array();
103
-
104
- foreach ( $meta as $key => $value ) {
105
-
106
- $thankyou_data[ $key ] = $meta[ $key ]['default'];
107
- }
108
-
109
- do_action( 'wcf_thankyou_settings_markup_before', $meta );
110
- $this->page_header_tab( $thankyou_data, $post->ID );
111
- do_action( 'wcf_thankyou_settings_markup_after', $meta );
112
- }
113
-
114
- /**
115
- * Page Header Tabs
116
- *
117
- * @param array $options Post meta.
118
- * @param int $post_id Post ID.
119
- */
120
- public function page_header_tab( $options, $post_id ) {
121
-
122
- $active_tab = get_post_meta( $post_id, 'wcf-active-tab', true );
123
-
124
- if ( empty( $active_tab ) ) {
125
- $active_tab = 'wcf-thankyou-shortcodes';
126
- }
127
-
128
- $tabs = array(
129
- array(
130
- 'title' => __( 'Shortcodes', 'cartflows' ),
131
- 'id' => 'wcf-thankyou-shortcodes',
132
- 'class' => 'wcf-thankyou-shortcodes' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
133
- 'icon' => 'dashicons-editor-code',
134
- ),
135
- array(
136
- 'title' => __( 'Thank You Design', 'cartflows' ),
137
- 'id' => 'wcf-thankyou-design',
138
- 'class' => 'wcf-thankyou-design' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
139
- 'icon' => 'dashicons-admin-customizer',
140
- ),
141
- array(
142
- 'title' => __( 'Thank You Fields', 'cartflows' ),
143
- 'id' => 'wcf-thankyou-fields',
144
- 'class' => 'wcf-thankyou-fields' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
145
- 'icon' => 'dashicons-welcome-widgets-menus',
146
- ),
147
- array(
148
- 'title' => __( 'Custom Script', 'cartflows' ),
149
- 'id' => 'wcf-thankyou-custom-script-header',
150
- 'class' => 'wcf-thankyou-custom-script-header' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
151
- 'icon' => 'dashicons-format-aside',
152
- ),
153
- );
154
-
155
- ?>
156
- <div class="wcf-thankyou-table wcf-metabox-wrap widefat">
157
- <div class="wcf-table-container">
158
- <div class="wcf-column-left">
159
- <div class="wcf-tab-wrapper">
160
-
161
- <?php foreach ( $tabs as $key => $tab ) { ?>
162
- <div class="<?php echo esc_attr( $tab['class'] ); ?>" data-tab="<?php echo esc_attr( $tab['id'] ); ?>">
163
- <span class="dashicons <?php echo esc_attr( $tab['icon'] ); ?>"></span>
164
- <span class="wcf-tab-title"><?php echo esc_html( $tab['title'] ); ?></span>
165
- </div>
166
- <?php } ?>
167
- <input type="hidden" id="wcf-active-tab" name="wcf-active-tab" value="<?php echo esc_attr( $active_tab ); ?>" />
168
-
169
- </div>
170
- </div>
171
- <div class="wcf-column-right">
172
- <div class="wcf-thankyou-shortcodes wcf-tab-content active widefat">
173
- <?php
174
- echo wcf()->meta->get_shortcode_field(
175
- array(
176
- 'label' => __( 'Order Details', 'cartflows' ),
177
- 'name' => 'wcf-order-details',
178
- 'content' => esc_html( '[cartflows_order_details]' ),
179
- )
180
- );
181
- ?>
182
- </div>
183
- <div class="wcf-thankyou-design wcf-tab-content widefat">
184
- <?php
185
-
186
- echo wcf()->meta->get_section(
187
- array(
188
- 'label' => __( 'Text', 'cartflows' ),
189
- )
190
- );
191
-
192
- echo wcf()->meta->get_color_picker_field(
193
- array(
194
- 'label' => __( 'Color', 'cartflows' ),
195
- 'name' => 'wcf-tq-text-color',
196
- 'value' => $options['wcf-tq-text-color'],
197
- )
198
- );
199
-
200
- echo wcf()->meta->get_font_family_field(
201
- array(
202
- 'for' => 'wcf-tq-font-family',
203
- 'label' => esc_html__( 'Font Family', 'cartflows' ),
204
- 'name' => 'wcf-tq-font-family',
205
- 'value' => $options['wcf-tq-font-family'],
206
- )
207
- );
208
-
209
- echo wcf()->meta->get_section(
210
- array(
211
- 'label' => __( 'Heading', 'cartflows' ),
212
- )
213
- );
214
-
215
- echo wcf()->meta->get_color_picker_field(
216
- array(
217
- 'label' => __( 'Color', 'cartflows' ),
218
- 'name' => 'wcf-tq-heading-color',
219
- 'value' => $options['wcf-tq-heading-color'],
220
- )
221
- );
222
-
223
- echo wcf()->meta->get_font_family_field(
224
- array(
225
- 'for' => 'wcf-tq-heading-font-family',
226
- 'label' => esc_html__( 'Font Family', 'cartflows' ),
227
- 'name' => 'wcf-tq-heading-font-family',
228
- 'value' => $options['wcf-tq-heading-font-family'],
229
- )
230
- );
231
-
232
- echo wcf()->meta->get_font_weight_field(
233
- array(
234
- 'for' => 'wcf-tq-heading-font-family',
235
- 'label' => esc_html__( 'Font Weight', 'cartflows' ),
236
- 'name' => 'wcf-tq-heading-font-wt',
237
- 'value' => $options['wcf-tq-heading-font-wt'],
238
- )
239
- );
240
-
241
- echo wcf()->meta->get_checkbox_field(
242
- array(
243
- 'label' => __( 'Advanced Options', 'cartflows' ),
244
- 'name' => 'wcf-tq-advance-options-fields',
245
- 'value' => $options['wcf-tq-advance-options-fields'],
246
- 'after' => 'Enable',
247
- )
248
- );
249
-
250
- echo wcf()->meta->get_number_field(
251
- array(
252
- 'for' => 'wcf-heading',
253
- 'label' => esc_html__( 'Container Width (In px)', 'cartflows' ),
254
- 'name' => 'wcf-tq-container-width',
255
- 'value' => $options['wcf-tq-container-width'],
256
- )
257
- );
258
-
259
- echo wcf()->meta->get_color_picker_field(
260
- array(
261
- 'label' => __( 'Section Background Color', 'cartflows' ),
262
- 'name' => 'wcf-tq-section-bg-color',
263
- 'value' => $options['wcf-tq-section-bg-color'],
264
- )
265
- );
266
-
267
- ?>
268
- </div>
269
- <div class="wcf-thankyou-fields wcf-tab-content widefat">
270
- <?php
271
- echo wcf()->meta->get_checkbox_field(
272
- array(
273
- 'name' => 'wcf-show-overview-section',
274
- 'value' => $options['wcf-show-overview-section'],
275
- 'after' => esc_html__( 'Enable Order Overview ', 'cartflows' ),
276
- )
277
- );
278
-
279
- echo wcf()->meta->get_checkbox_field(
280
- array(
281
- 'name' => 'wcf-show-details-section',
282
- 'value' => $options['wcf-show-details-section'],
283
- 'after' => esc_html__( 'Enable Order Details ', 'cartflows' ),
284
- )
285
- );
286
-
287
- echo wcf()->meta->get_checkbox_field(
288
- array(
289
- 'name' => 'wcf-show-billing-section',
290
- 'value' => $options['wcf-show-billing-section'],
291
- 'after' => esc_html__( 'Enable Billing Details ', 'cartflows' ),
292
- )
293
- );
294
-
295
- echo wcf()->meta->get_checkbox_field(
296
- array(
297
- 'name' => 'wcf-show-shipping-section',
298
- 'value' => $options['wcf-show-shipping-section'],
299
- 'after' => esc_html__( 'Enable Shipping Details ', 'cartflows' ),
300
- )
301
- );
302
-
303
- echo wcf()->meta->get_hidden_field(
304
- array(
305
- 'name' => 'wcf-field-google-font-url',
306
- 'value' => $options['wcf-field-google-font-url'],
307
- )
308
- );
309
- ?>
310
- </div>
311
-
312
- <?php $this->tab_custom_script( $options, $post_id ); ?>
313
-
314
- <?php $this->right_column_footer( $options, $post_id ); ?>
315
- </div>
316
- </div>
317
- </div>
318
-
319
- <?php
320
-
321
- }
322
-
323
- /**
324
- * Get metabox options
325
- *
326
- * @param int $post_id post ID.
327
- * @return array
328
- */
329
- public static function get_meta_option( $post_id ) {
330
-
331
- if ( null === self::$meta_option ) {
332
-
333
- /**
334
- * Set metabox options
335
- *
336
- * @see http://php.net/manual/en/filter.filters.sanitize.php
337
- */
338
- self::$meta_option = wcf()->options->get_thankyou_fields( $post_id );
339
- }
340
-
341
- return self::$meta_option;
342
-
343
- }
344
-
345
- /**
346
- * Metabox Save
347
- *
348
- * @param number $post_id Post ID.
349
- * @return void
350
- */
351
- public function save_meta_box( $post_id ) {
352
-
353
- // Checks save status.
354
- $is_autosave = wp_is_post_autosave( $post_id );
355
- $is_revision = wp_is_post_revision( $post_id );
356
-
357
- $is_valid_nonce = ( isset( $_POST['nonce-thankyou-step-meta'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce-thankyou-step-meta'] ) ), 'save-nonce-thankyou-step-meta' ) ) ? true : false;
358
-
359
- // Exits script depending on save status.
360
- if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
361
- return;
362
- }
363
-
364
- wcf()->options->save_thankyou_fields( $post_id );
365
- }
366
- }
367
-
368
- /**
369
- * Kicking this off by calling 'get_instance()' method
370
- */
371
- Cartflows_Thankyou_Meta::get_instance();
1
+ <?php
2
+ /**
3
+ * Checkout post meta box
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Meta Boxes setup
10
+ */
11
+ class Cartflows_Thankyou_Meta extends Cartflows_Meta {
12
+
13
+ /**
14
+ * Instance
15
+ *
16
+ * @var $instance
17
+ */
18
+ private static $instance;
19
+
20
+ /**
21
+ * Meta Option
22
+ *
23
+ * @var $meta_option
24
+ */
25
+ private static $meta_option = null;
26
+
27
+ /**
28
+ * Initiator
29
+ */
30
+ public static function get_instance() {
31
+ if ( ! isset( self::$instance ) ) {
32
+ self::$instance = new self();
33
+ }
34
+
35
+ return self::$instance;
36
+ }
37
+
38
+ /**
39
+ * Constructor
40
+ */
41
+ public function __construct() {
42
+
43
+ /* Init Metabox */
44
+ add_action( 'load-post.php', array( $this, 'init_metabox' ) );
45
+ add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
46
+ }
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_thankyou_type() ) {
63
+ add_meta_box(
64
+ 'wcf-thankyou-settings', // Id.
65
+ __( 'Thank You Page 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-thankyou-step-meta', 'nonce-thankyou-step-meta' );
83
+ $stored = get_post_meta( $post->ID );
84
+
85
+ $checkout_meta = self::get_meta_option( $post->ID );
86
+
87
+ // Set stored and override defaults.
88
+ foreach ( $stored as $key => $value ) {
89
+ if ( array_key_exists( $key, $checkout_meta ) ) {
90
+ self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? maybe_unserialize( $stored[ $key ][0] ) : '';
91
+ } else {
92
+ self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : '';
93
+ }
94
+ }
95
+
96
+ // Get defaults.
97
+ $meta = self::get_meta_option( $post->ID );
98
+
99
+ /**
100
+ * Get options
101
+ */
102
+ $thankyou_data = array();
103
+
104
+ foreach ( $meta as $key => $value ) {
105
+
106
+ $thankyou_data[ $key ] = $meta[ $key ]['default'];
107
+ }
108
+
109
+ do_action( 'wcf_thankyou_settings_markup_before', $meta );
110
+ $this->page_header_tab( $thankyou_data, $post->ID );
111
+ do_action( 'wcf_thankyou_settings_markup_after', $meta );
112
+ }
113
+
114
+ /**
115
+ * Page Header Tabs
116
+ *
117
+ * @param array $options Post meta.
118
+ * @param int $post_id Post ID.
119
+ */
120
+ public function page_header_tab( $options, $post_id ) {
121
+
122
+ $active_tab = get_post_meta( $post_id, 'wcf-active-tab', true );
123
+
124
+ if ( empty( $active_tab ) ) {
125
+ $active_tab = 'wcf-thankyou-shortcodes';
126
+ }
127
+
128
+ $tabs = array(
129
+ array(
130
+ 'title' => __( 'Shortcodes', 'cartflows' ),
131
+ 'id' => 'wcf-thankyou-shortcodes',
132
+ 'class' => 'wcf-thankyou-shortcodes' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
133
+ 'icon' => 'dashicons-editor-code',
134
+ ),
135
+ array(
136
+ 'title' => __( 'Thank You Design', 'cartflows' ),
137
+ 'id' => 'wcf-thankyou-design',
138
+ 'class' => 'wcf-thankyou-design' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
139
+ 'icon' => 'dashicons-admin-customizer',
140
+ ),
141
+ array(
142
+ 'title' => __( 'Thank You Fields', 'cartflows' ),
143
+ 'id' => 'wcf-thankyou-fields',
144
+ 'class' => 'wcf-thankyou-fields' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
145
+ 'icon' => 'dashicons-welcome-widgets-menus',
146
+ ),
147
+ array(
148
+ 'title' => __( 'Custom Script', 'cartflows' ),
149
+ 'id' => 'wcf-thankyou-custom-script-header',
150
+ 'class' => 'wcf-thankyou-custom-script-header' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
151
+ 'icon' => 'dashicons-format-aside',
152
+ ),
153
+ );
154
+
155
+ ?>
156
+ <div class="wcf-thankyou-table wcf-metabox-wrap widefat">
157
+ <div class="wcf-table-container">
158
+ <div class="wcf-column-left">
159
+ <div class="wcf-tab-wrapper">
160
+
161
+ <?php foreach ( $tabs as $key => $tab ) { ?>
162
+ <div class="<?php echo esc_attr( $tab['class'] ); ?>" data-tab="<?php echo esc_attr( $tab['id'] ); ?>">
163
+ <span class="dashicons <?php echo esc_attr( $tab['icon'] ); ?>"></span>
164
+ <span class="wcf-tab-title"><?php echo esc_html( $tab['title'] ); ?></span>
165
+ </div>
166
+ <?php } ?>
167
+ <input type="hidden" id="wcf-active-tab" name="wcf-active-tab" value="<?php echo esc_attr( $active_tab ); ?>" />
168
+
169
+ </div>
170
+ </div>
171
+ <div class="wcf-column-right">
172
+ <div class="wcf-thankyou-shortcodes wcf-tab-content active widefat">
173
+ <?php
174
+ echo wcf()->meta->get_shortcode_field(
175
+ array(
176
+ 'label' => __( 'Order Details', 'cartflows' ),
177
+ 'name' => 'wcf-order-details',
178
+ 'content' => esc_html( '[cartflows_order_details]' ),
179
+ )
180
+ );
181
+ ?>
182
+ </div>
183
+ <div class="wcf-thankyou-design wcf-tab-content widefat">
184
+ <?php
185
+
186
+ echo wcf()->meta->get_section(
187
+ array(
188
+ 'label' => __( 'Text', 'cartflows' ),
189
+ )
190
+ );
191
+
192
+ echo wcf()->meta->get_color_picker_field(
193
+ array(
194
+ 'label' => __( 'Color', 'cartflows' ),
195
+ 'name' => 'wcf-tq-text-color',
196
+ 'value' => $options['wcf-tq-text-color'],
197
+ )
198
+ );
199
+
200
+ echo wcf()->meta->get_font_family_field(
201
+ array(
202
+ 'for' => 'wcf-tq-font-family',
203
+ 'label' => esc_html__( 'Font Family', 'cartflows' ),
204
+ 'name' => 'wcf-tq-font-family',
205
+ 'value' => $options['wcf-tq-font-family'],
206
+ )
207
+ );
208
+
209
+ echo wcf()->meta->get_section(
210
+ array(
211
+ 'label' => __( 'Heading', 'cartflows' ),
212
+ )
213
+ );
214
+
215
+ echo wcf()->meta->get_color_picker_field(
216
+ array(
217
+ 'label' => __( 'Color', 'cartflows' ),
218
+ 'name' => 'wcf-tq-heading-color',
219
+ 'value' => $options['wcf-tq-heading-color'],
220
+ )
221
+ );
222
+
223
+ echo wcf()->meta->get_font_family_field(
224
+ array(
225
+ 'for' => 'wcf-tq-heading-font-family',
226
+ 'label' => esc_html__( 'Font Family', 'cartflows' ),
227
+ 'name' => 'wcf-tq-heading-font-family',
228
+ 'value' => $options['wcf-tq-heading-font-family'],
229
+ )
230
+ );
231
+
232
+ echo wcf()->meta->get_font_weight_field(
233
+ array(
234
+ 'for' => 'wcf-tq-heading-font-family',
235
+ 'label' => esc_html__( 'Font Weight', 'cartflows' ),
236
+ 'name' => 'wcf-tq-heading-font-wt',
237
+ 'value' => $options['wcf-tq-heading-font-wt'],
238
+ )
239
+ );
240
+
241
+ echo wcf()->meta->get_checkbox_field(
242
+ array(
243
+ 'label' => __( 'Advanced Options', 'cartflows' ),
244
+ 'name' => 'wcf-tq-advance-options-fields',
245
+ 'value' => $options['wcf-tq-advance-options-fields'],
246
+ 'after' => 'Enable',
247
+ )
248
+ );
249
+
250
+ echo wcf()->meta->get_number_field(
251
+ array(
252
+ 'for' => 'wcf-heading',
253
+ 'label' => esc_html__( 'Container Width (In px)', 'cartflows' ),
254
+ 'name' => 'wcf-tq-container-width',
255
+ 'value' => $options['wcf-tq-container-width'],
256
+ )
257
+ );
258
+
259
+ echo wcf()->meta->get_color_picker_field(
260
+ array(
261
+ 'label' => __( 'Section Background Color', 'cartflows' ),
262
+ 'name' => 'wcf-tq-section-bg-color',
263
+ 'value' => $options['wcf-tq-section-bg-color'],
264
+ )
265
+ );
266
+
267
+ ?>
268
+ </div>
269
+ <div class="wcf-thankyou-fields wcf-tab-content widefat">
270
+ <?php
271
+ echo wcf()->meta->get_checkbox_field(
272
+ array(
273
+ 'name' => 'wcf-show-overview-section',
274
+ 'value' => $options['wcf-show-overview-section'],
275
+ 'after' => esc_html__( 'Enable Order Overview ', 'cartflows' ),
276
+ )
277
+ );
278
+
279
+ echo wcf()->meta->get_checkbox_field(
280
+ array(
281
+ 'name' => 'wcf-show-details-section',
282
+ 'value' => $options['wcf-show-details-section'],
283
+ 'after' => esc_html__( 'Enable Order Details ', 'cartflows' ),
284
+ )
285
+ );
286
+
287
+ echo wcf()->meta->get_checkbox_field(
288
+ array(
289
+ 'name' => 'wcf-show-billing-section',
290
+ 'value' => $options['wcf-show-billing-section'],
291
+ 'after' => esc_html__( 'Enable Billing Details ', 'cartflows' ),
292
+ )
293
+ );
294
+
295
+ echo wcf()->meta->get_checkbox_field(
296
+ array(
297
+ 'name' => 'wcf-show-shipping-section',
298
+ 'value' => $options['wcf-show-shipping-section'],
299
+ 'after' => esc_html__( 'Enable Shipping Details ', 'cartflows' ),
300
+ )
301
+ );
302
+
303
+ echo wcf()->meta->get_hidden_field(
304
+ array(
305
+ 'name' => 'wcf-field-google-font-url',
306
+ 'value' => $options['wcf-field-google-font-url'],
307
+ )
308
+ );
309
+ ?>
310
+ </div>
311
+
312
+ <?php $this->tab_custom_script( $options, $post_id ); ?>
313
+
314
+ <?php $this->right_column_footer( $options, $post_id ); ?>
315
+ </div>
316
+ </div>
317
+ </div>
318
+
319
+ <?php
320
+
321
+ }
322
+
323
+ /**
324
+ * Get metabox options
325
+ *
326
+ * @param int $post_id post ID.
327
+ * @return array
328
+ */
329
+ public static function get_meta_option( $post_id ) {
330
+
331
+ if ( null === self::$meta_option ) {
332
+
333
+ /**
334
+ * Set metabox options
335
+ *
336
+ * @see http://php.net/manual/en/filter.filters.sanitize.php
337
+ */
338
+ self::$meta_option = wcf()->options->get_thankyou_fields( $post_id );
339
+ }
340
+
341
+ return self::$meta_option;
342
+
343
+ }
344
+
345
+ /**
346
+ * Metabox Save
347
+ *
348
+ * @param number $post_id Post ID.
349
+ * @return void
350
+ */
351
+ public function save_meta_box( $post_id ) {
352
+
353
+ // Checks save status.
354
+ $is_autosave = wp_is_post_autosave( $post_id );
355
+ $is_revision = wp_is_post_revision( $post_id );
356
+
357
+ $is_valid_nonce = ( isset( $_POST['nonce-thankyou-step-meta'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce-thankyou-step-meta'] ) ), 'save-nonce-thankyou-step-meta' ) ) ? true : false;
358
+
359
+ // Exits script depending on save status.
360
+ if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
361
+ return;
362
+ }
363
+
364
+ wcf()->options->save_thankyou_fields( $post_id );
365
+ }
366
+ }
367
+
368
+ /**
369
+ * Kicking this off by calling 'get_instance()' method
370
+ */
371
+ Cartflows_Thankyou_Meta::get_instance();
modules/widgets/class-cartflows-next-step.php CHANGED
@@ -1,154 +1,154 @@
1
- <?php
2
- /**
3
- * Next Step Widget
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Initial Setup
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Next_Step extends WP_Widget {
14
-
15
- /**
16
- * Constructor
17
- */
18
- public function __construct() {
19
-
20
- parent::__construct(
21
- // Base ID of your widget.
22
- 'cartflows_next_step',
23
- // Widget name will appear in UI.
24
- __( 'CartFlows Next Step', 'cartflows' ),
25
- // Widget description.
26
- array( 'description' => __( 'Next Step Widgets', 'cartflows' ) )
27
- );
28
- }
29
-
30
- /**
31
- * Creating widget front-end
32
- *
33
- * @param array $args arguments array.
34
- * @param array $instance widget instance.
35
- */
36
- public function widget( $args, $instance ) {
37
-
38
- $title = apply_filters( 'widget_title', $instance['title'] );
39
-
40
- $step_id = intval( $instance['step_id'] );
41
- $flow_id = intval( $instance['flow_id'] );
42
-
43
- if ( ! $step_id || ! $flow_id ) {
44
-
45
- global $post;
46
-
47
- if ( $post && CARTFLOWS_STEP_POST_TYPE === $post->post_type ) {
48
- $step_id = intval( $post->ID );
49
- $flow_id = intval( get_post_meta( $step_id, 'wcf-flow-id', true ) );
50
- }
51
- }
52
- $output = 'No Data';
53
-
54
- if ( $flow_id ) {
55
-
56
- $navigation = false;
57
-
58
- $steps = get_post_meta( $flow_id, 'wcf-steps', true );
59
-
60
- if ( is_array( $steps ) && ! empty( $steps ) ) {
61
-
62
- foreach ( $steps as $i => $step ) {
63
-
64
- if ( intval( $step['id'] ) === $step_id ) {
65
-
66
- $next_i = $i + 1;
67
-
68
- if ( isset( $steps[ $next_i ] ) ) {
69
- $navigation = $steps[ $next_i ];
70
- }
71
-
72
- break;
73
- }
74
- }
75
-
76
- if ( $navigation && is_array( $navigation ) ) {
77
-
78
- $output = '<div class="wcf-step-navigation"><a class="button" target="_self" href="' . get_permalink( $navigation['id'] ) . '">' . __( 'Next Step', 'cartflows' ) . '</a></div>';
79
- }
80
- }
81
- }
82
-
83
- // before and after widget arguments are defined by themes.
84
- echo $args['before_widget'];
85
-
86
- if ( ! empty( $title ) ) {
87
- echo $args['before_title'] . $title . $args['after_title'];
88
- }
89
-
90
- // This is where you run the code and display the output.
91
- echo $output;
92
-
93
- echo $args['after_widget'];
94
- }
95
-
96
- /**
97
- * Creating widget back-end
98
- *
99
- * @param array $instance widget instance.
100
- */
101
- public function form( $instance ) {
102
-
103
- if ( isset( $instance['title'] ) ) {
104
- $title = $instance['title'];
105
- } else {
106
- $title = __( 'New title', 'cartflows' );
107
- }
108
-
109
- if ( isset( $instance['flow_id'] ) ) {
110
- $flow_id = $instance['flow_id'];
111
- } else {
112
- $flow_id = '';
113
- }
114
-
115
- if ( isset( $instance['step_id'] ) ) {
116
- $step_id = $instance['step_id'];
117
- } else {
118
- $step_id = '';
119
- }
120
- // Widget admin form.
121
- ?>
122
- <p>
123
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:', 'cartflows' ); ?></label>
124
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
125
- </p>
126
- <p>
127
- <label for="<?php echo $this->get_field_id( 'flow_id' ); ?>"><?php esc_html_e( 'Flow ID:', 'cartflows' ); ?></label>
128
- <input class="widefat" id="<?php echo $this->get_field_id( 'flow_id' ); ?>" name="<?php echo $this->get_field_name( 'flow_id' ); ?>" type="text" value="<?php echo esc_attr( $flow_id ); ?>" />
129
- </p>
130
- <p>
131
- <label for="<?php echo $this->get_field_id( 'step_id' ); ?>"><?php esc_html_e( 'Step ID:', 'cartflows' ); ?></label>
132
- <input class="widefat" id="<?php echo $this->get_field_id( 'step_id' ); ?>" name="<?php echo $this->get_field_name( 'step_id' ); ?>" type="text" value="<?php echo esc_attr( $step_id ); ?>" />
133
- </p>
134
- <?php
135
- }
136
-
137
- /**
138
- * Updating widget replacing old instances with new
139
- *
140
- * @param array $new_instance new widget instance.
141
- * @param array $old_instance old widget instance.
142
- * @return array
143
- */
144
- public function update( $new_instance, $old_instance ) {
145
-
146
- $instance = array();
147
-
148
- $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? wp_strip_all_tags( $new_instance['title'] ) : '';
149
- $instance['flow_id'] = ( ! empty( $new_instance['flow_id'] ) ) ? wp_strip_all_tags( $new_instance['flow_id'] ) : '';
150
- $instance['step_id'] = ( ! empty( $new_instance['step_id'] ) ) ? wp_strip_all_tags( $new_instance['step_id'] ) : '';
151
-
152
- return $instance;
153
- }
154
- }
1
+ <?php
2
+ /**
3
+ * Next Step Widget
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Initial Setup
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Next_Step extends WP_Widget {
14
+
15
+ /**
16
+ * Constructor
17
+ */
18
+ public function __construct() {
19
+
20
+ parent::__construct(
21
+ // Base ID of your widget.
22
+ 'cartflows_next_step',
23
+ // Widget name will appear in UI.
24
+ __( 'CartFlows Next Step', 'cartflows' ),
25
+ // Widget description.
26
+ array( 'description' => __( 'Next Step Widgets', 'cartflows' ) )
27
+ );
28
+ }
29
+
30
+ /**
31
+ * Creating widget front-end
32
+ *
33
+ * @param array $args arguments array.
34
+ * @param array $instance widget instance.
35
+ */
36
+ public function widget( $args, $instance ) {
37
+
38
+ $title = apply_filters( 'widget_title', $instance['title'] );
39
+
40
+ $step_id = intval( $instance['step_id'] );
41
+ $flow_id = intval( $instance['flow_id'] );
42
+
43
+ if ( ! $step_id || ! $flow_id ) {
44
+
45
+ global $post;
46
+
47
+ if ( $post && CARTFLOWS_STEP_POST_TYPE === $post->post_type ) {
48
+ $step_id = intval( $post->ID );
49
+ $flow_id = intval( get_post_meta( $step_id, 'wcf-flow-id', true ) );
50
+ }
51
+ }
52
+ $output = 'No Data';
53
+
54
+ if ( $flow_id ) {
55
+
56
+ $navigation = false;
57
+
58
+ $steps = get_post_meta( $flow_id, 'wcf-steps', true );
59
+
60
+ if ( is_array( $steps ) && ! empty( $steps ) ) {
61
+
62
+ foreach ( $steps as $i => $step ) {
63
+
64
+ if ( intval( $step['id'] ) === $step_id ) {
65
+
66
+ $next_i = $i + 1;
67
+
68
+ if ( isset( $steps[ $next_i ] ) ) {
69
+ $navigation = $steps[ $next_i ];
70
+ }
71
+
72
+ break;
73
+ }
74
+ }
75
+
76
+ if ( $navigation && is_array( $navigation ) ) {
77
+
78
+ $output = '<div class="wcf-step-navigation"><a class="button" target="_self" href="' . get_permalink( $navigation['id'] ) . '">' . __( 'Next Step', 'cartflows' ) . '</a></div>';
79
+ }
80
+ }
81
+ }
82
+
83
+ // before and after widget arguments are defined by themes.
84
+ echo $args['before_widget'];
85
+
86
+ if ( ! empty( $title ) ) {
87
+ echo $args['before_title'] . $title . $args['after_title'];
88
+ }
89
+
90
+ // This is where you run the code and display the output.
91
+ echo $output;
92
+
93
+ echo $args['after_widget'];
94
+ }
95
+
96
+ /**
97
+ * Creating widget back-end
98
+ *
99
+ * @param array $instance widget instance.
100
+ */
101
+ public function form( $instance ) {
102
+
103
+ if ( isset( $instance['title'] ) ) {
104
+ $title = $instance['title'];
105
+ } else {
106
+ $title = __( 'New title', 'cartflows' );
107
+ }
108
+
109
+ if ( isset( $instance['flow_id'] ) ) {
110
+ $flow_id = $instance['flow_id'];
111
+ } else {
112
+ $flow_id = '';
113
+ }
114
+
115
+ if ( isset( $instance['step_id'] ) ) {
116
+ $step_id = $instance['step_id'];
117
+ } else {
118
+ $step_id = '';
119
+ }
120
+ // Widget admin form.
121
+ ?>
122
+ <p>
123
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:', 'cartflows' ); ?></label>
124
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
125
+ </p>
126
+ <p>
127
+ <label for="<?php echo $this->get_field_id( 'flow_id' ); ?>"><?php esc_html_e( 'Flow ID:', 'cartflows' ); ?></label>
128
+ <input class="widefat" id="<?php echo $this->get_field_id( 'flow_id' ); ?>" name="<?php echo $this->get_field_name( 'flow_id' ); ?>" type="text" value="<?php echo esc_attr( $flow_id ); ?>" />
129
+ </p>
130
+ <p>
131
+ <label for="<?php echo $this->get_field_id( 'step_id' ); ?>"><?php esc_html_e( 'Step ID:', 'cartflows' ); ?></label>
132
+ <input class="widefat" id="<?php echo $this->get_field_id( 'step_id' ); ?>" name="<?php echo $this->get_field_name( 'step_id' ); ?>" type="text" value="<?php echo esc_attr( $step_id ); ?>" />
133
+ </p>
134
+ <?php
135
+ }
136
+
137
+ /**
138
+ * Updating widget replacing old instances with new
139
+ *
140
+ * @param array $new_instance new widget instance.
141
+ * @param array $old_instance old widget instance.
142
+ * @return array
143
+ */
144
+ public function update( $new_instance, $old_instance ) {
145
+
146
+ $instance = array();
147
+
148
+ $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? wp_strip_all_tags( $new_instance['title'] ) : '';
149
+ $instance['flow_id'] = ( ! empty( $new_instance['flow_id'] ) ) ? wp_strip_all_tags( $new_instance['flow_id'] ) : '';
150
+ $instance['step_id'] = ( ! empty( $new_instance['step_id'] ) ) ? wp_strip_all_tags( $new_instance['step_id'] ) : '';
151
+
152
+ return $instance;
153
+ }
154
+ }
readme.txt CHANGED
@@ -3,8 +3,8 @@ 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
7
- Stable tag: 1.3.3
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,11 @@ Glad you asked! CartFlows Pro is an optional add-on to CartFlows that adds addit
125
 
126
  == Changelog ==
127
 
 
 
 
 
 
128
  = Version 1.3.3 - Thursday, 26th December 2019 =
129
  * Improvement: Added filter `cartflows_global_checkout_url` for global checkout.
130
  * Fix: Thrive's split test option was not displaying in some cases.
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.4
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.3.4 - Tuesday, 14th January 2020 =
129
+ * New: Option added to change order button text for each flow.
130
+ * Improvement: WooCommerce Google Analytics Integration plugin's compatibility added.
131
+ * Fix: LearnDash deprecated function notice.
132
+
133
  = Version 1.3.3 - Thursday, 26th December 2019 =
134
  * Improvement: Added filter `cartflows_global_checkout_url` for global checkout.
135
  * Fix: Thrive's split test option was not displaying in some cases.