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

Version Description

Download this release

Release Info

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

Code changes from version 1.5.18 to 1.5.19

Files changed (59) hide show
  1. admin/assets/js/global-admin.js +20 -0
  2. admin/bsf-analytics/class-bsf-analytics-loader.php +118 -118
  3. assets/js/import.js +3 -1
  4. assets/js/lib/jquery-cookie/jquery.cookie.js +117 -0
  5. assets/js/lib/jquery-cookie/jquery.cookie.min.js +8 -0
  6. assets/min-js/import.min.js +1 -1
  7. cartflows.php +1 -1
  8. changelog.txt +4 -0
  9. classes/class-cartflows-admin.php +750 -740
  10. classes/class-cartflows-cloning.php +469 -469
  11. classes/class-cartflows-flow-frontend.php +214 -214
  12. classes/class-cartflows-frontend.php +682 -672
  13. classes/class-cartflows-functions.php +7 -1
  14. classes/class-cartflows-helper.php +7 -5
  15. classes/class-cartflows-importer.php +1742 -1742
  16. classes/class-cartflows-loader.php +7 -1
  17. classes/class-cartflows-logger.php +183 -183
  18. classes/class-cartflows-meta-fields.php +1046 -1046
  19. classes/class-cartflows-stats.php +87 -87
  20. classes/class-cartflows-step-factory.php +250 -250
  21. classes/class-cartflows-update.php +146 -146
  22. classes/class-cartflows-utils.php +581 -581
  23. classes/class-cartflows-wizard.php +751 -751
  24. includes/admin/cartflows-admin-header.php +21 -21
  25. includes/admin/cartflows-admin.php +35 -35
  26. includes/admin/cartflows-general.php +507 -507
  27. includes/admin/cartflows-home.php +92 -92
  28. includes/meta-fields/generate-product-repeater.php +99 -99
  29. languages/cartflows.pot +3056 -2623
  30. modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php +834 -0
  31. modules/beaver-builder/cartflows-bb-checkout-form/icon/bb-checkout-form.svg +6 -0
  32. modules/beaver-builder/cartflows-bb-checkout-form/includes/frontend.css.php +381 -0
  33. modules/beaver-builder/cartflows-bb-checkout-form/includes/frontend.php +21 -0
  34. modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php +465 -0
  35. modules/beaver-builder/cartflows-bb-next-step/css/frontend.css +526 -0
  36. modules/beaver-builder/cartflows-bb-next-step/icon/bb-next-step.svg +6 -0
  37. modules/beaver-builder/cartflows-bb-next-step/includes/frontend.css.php +574 -0
  38. modules/beaver-builder/cartflows-bb-next-step/includes/frontend.php +55 -0
  39. modules/beaver-builder/cartflows-bb-next-step/js/settings.js +117 -0
  40. modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php +430 -0
  41. modules/beaver-builder/cartflows-bb-optin-form/icon/bb-optin-form.svg +6 -0
  42. modules/beaver-builder/cartflows-bb-optin-form/includes/frontend.css.php +125 -0
  43. modules/beaver-builder/cartflows-bb-optin-form/includes/frontend.php +18 -0
  44. modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php +489 -0
  45. modules/beaver-builder/cartflows-bb-order-details/css/frontend.css +25 -0
  46. modules/beaver-builder/cartflows-bb-order-details/icon/bb-order-details.svg +6 -0
  47. modules/beaver-builder/cartflows-bb-order-details/includes/frontend.css.php +202 -0
  48. modules/beaver-builder/cartflows-bb-order-details/includes/frontend.php +22 -0
  49. modules/beaver-builder/cartflows-bb-order-details/js/settings.js +33 -0
  50. modules/beaver-builder/class-cartflows-bb-modules-loader.php +108 -0
  51. modules/beaver-builder/classes/class-cartflows-bb-editor.php +69 -0
  52. modules/beaver-builder/classes/class-cartflows-bb-helper.php +151 -0
  53. modules/checkout/classes/class-cartflows-checkout-markup.php +34 -3
  54. modules/flow/classes/class-cartflows-flow-meta.php +866 -866
  55. modules/flow/classes/class-cartflows-flow-post-type.php +373 -373
  56. modules/flow/view/meta-flow-steps.php +158 -158
  57. modules/flow/view/view-remote-importer.php +78 -78
  58. modules/landing/classes/class-cartflows-landing-markup.php +147 -147
  59. modules/optin/classes/class-cartflows-optin-markup.php +2 -0
admin/assets/js/global-admin.js CHANGED
@@ -468,9 +468,29 @@
468
  }
469
  };
470
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
471
  /* Trigger update button click */
472
  wcf_trigger_update_button_click();
473
 
 
 
474
  setTimeout(function () {
475
  wcf_back_flow_button();
476
  }, 300);
468
  }
469
  };
470
 
471
+ var wcf_show_woo_require_notice = function(){
472
+ ( function( wp ) {
473
+ let step_types = ['checkout', 'optin', 'thankyou', 'upsell', 'downsell'];
474
+
475
+ if( step_types.includes(cartflows_admin.current_step_type) && false === cartflows_admin.wc_status['active'] ){
476
+
477
+ wp.data.dispatch( 'core/notices' ).createNotice(
478
+ 'error', // Can be one of: success, info, warning, error.
479
+ cartflows_admin.wc_status['message'],
480
+ {
481
+ isDismissible: false, // Whether the user can dismiss the notice.
482
+ }
483
+ );
484
+ }
485
+
486
+ } )( window.wp );
487
+ }
488
+
489
  /* Trigger update button click */
490
  wcf_trigger_update_button_click();
491
 
492
+ wcf_show_woo_require_notice();
493
+
494
  setTimeout(function () {
495
  wcf_back_flow_button();
496
  }, 300);
admin/bsf-analytics/class-bsf-analytics-loader.php CHANGED
@@ -1,118 +1,118 @@
1
- <?php
2
- /**
3
- * BSF analytics loader file.
4
- *
5
- * @version 1.0.0
6
- *
7
- * @package bsf-analytics
8
- */
9
-
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit();
12
- }
13
-
14
- /**
15
- * Class BSF_Analytics_Loader.
16
- */
17
- class BSF_Analytics_Loader {
18
-
19
- /**
20
- * Analytics Entities.
21
- *
22
- * @access private
23
- * @var array Entities array.
24
- */
25
- private $entities = array();
26
-
27
- /**
28
- * Analytics Version.
29
- *
30
- * @access private
31
- * @var float analytics version.
32
- */
33
- private $analytics_version = '';
34
-
35
- /**
36
- * Analytics path.
37
- *
38
- * @access private
39
- * @var string path array.
40
- */
41
- private $analytics_path = '';
42
-
43
- /**
44
- * Instance
45
- *
46
- * @access private
47
- * @var object Class object.
48
- */
49
- private static $instance = null;
50
-
51
- /**
52
- * Get instace of class.
53
- *
54
- * @return object
55
- */
56
- public static function get_instance() {
57
- if ( null === self::$instance ) {
58
- self::$instance = new self();
59
- }
60
-
61
- return self::$instance;
62
- }
63
-
64
- /**
65
- * Constructor
66
- */
67
- public function __construct() {
68
- add_action( 'init', array( $this, 'load_analytics' ) );
69
- }
70
-
71
- /**
72
- * Set entity for analytics.
73
- *
74
- * @param string $data Entity attributes data.
75
- * @return void
76
- */
77
- public function set_entity( $data ) {
78
- array_push( $this->entities, $data );
79
- }
80
-
81
- /**
82
- * Load Analytics library.
83
- *
84
- * @return void
85
- */
86
- public function load_analytics() {
87
- $unique_entities = array();
88
-
89
- if ( ! empty( $this->entities ) ) {
90
- foreach ( $this->entities as $entity ) {
91
- foreach ( $entity as $key => $data ) {
92
-
93
- if ( isset( $data['path'] ) ) {
94
- if ( file_exists( $data['path'] . '/version.json' ) ) {
95
- $file_contents = file_get_contents( $data['path'] . '/version.json' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
96
- $analytics_version = json_decode( $file_contents, 1 );
97
- $analytics_version = $analytics_version['bsf-analytics-ver'];
98
-
99
- if ( version_compare( $analytics_version, $this->analytics_version, '>' ) ) {
100
- $this->analytics_version = $analytics_version;
101
- $this->analytics_path = $data['path'];
102
- }
103
- }
104
- }
105
-
106
- if ( ! isset( $unique_entities[ $key ] ) ) {
107
- $unique_entities[ $key ] = $data;
108
- }
109
- }
110
- }
111
-
112
- if ( file_exists( $this->analytics_path ) && ! class_exists( 'BSF_Analytics' ) ) {
113
- require_once $this->analytics_path . '/class-bsf-analytics.php';
114
- new BSF_Analytics( $unique_entities, $this->analytics_path, $this->analytics_version );
115
- }
116
- }
117
- }
118
- }
1
+ <?php
2
+ /**
3
+ * BSF analytics loader file.
4
+ *
5
+ * @version 1.0.0
6
+ *
7
+ * @package bsf-analytics
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit();
12
+ }
13
+
14
+ /**
15
+ * Class BSF_Analytics_Loader.
16
+ */
17
+ class BSF_Analytics_Loader {
18
+
19
+ /**
20
+ * Analytics Entities.
21
+ *
22
+ * @access private
23
+ * @var array Entities array.
24
+ */
25
+ private $entities = array();
26
+
27
+ /**
28
+ * Analytics Version.
29
+ *
30
+ * @access private
31
+ * @var float analytics version.
32
+ */
33
+ private $analytics_version = '';
34
+
35
+ /**
36
+ * Analytics path.
37
+ *
38
+ * @access private
39
+ * @var string path array.
40
+ */
41
+ private $analytics_path = '';
42
+
43
+ /**
44
+ * Instance
45
+ *
46
+ * @access private
47
+ * @var object Class object.
48
+ */
49
+ private static $instance = null;
50
+
51
+ /**
52
+ * Get instace of class.
53
+ *
54
+ * @return object
55
+ */
56
+ public static function get_instance() {
57
+ if ( null === self::$instance ) {
58
+ self::$instance = new self();
59
+ }
60
+
61
+ return self::$instance;
62
+ }
63
+
64
+ /**
65
+ * Constructor
66
+ */
67
+ public function __construct() {
68
+ add_action( 'init', array( $this, 'load_analytics' ) );
69
+ }
70
+
71
+ /**
72
+ * Set entity for analytics.
73
+ *
74
+ * @param string $data Entity attributes data.
75
+ * @return void
76
+ */
77
+ public function set_entity( $data ) {
78
+ array_push( $this->entities, $data );
79
+ }
80
+
81
+ /**
82
+ * Load Analytics library.
83
+ *
84
+ * @return void
85
+ */
86
+ public function load_analytics() {
87
+ $unique_entities = array();
88
+
89
+ if ( ! empty( $this->entities ) ) {
90
+ foreach ( $this->entities as $entity ) {
91
+ foreach ( $entity as $key => $data ) {
92
+
93
+ if ( isset( $data['path'] ) ) {
94
+ if ( file_exists( $data['path'] . '/version.json' ) ) {
95
+ $file_contents = file_get_contents( $data['path'] . '/version.json' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
96
+ $analytics_version = json_decode( $file_contents, 1 );
97
+ $analytics_version = $analytics_version['bsf-analytics-ver'];
98
+
99
+ if ( version_compare( $analytics_version, $this->analytics_version, '>' ) ) {
100
+ $this->analytics_version = $analytics_version;
101
+ $this->analytics_path = $data['path'];
102
+ }
103
+ }
104
+ }
105
+
106
+ if ( ! isset( $unique_entities[ $key ] ) ) {
107
+ $unique_entities[ $key ] = $data;
108
+ }
109
+ }
110
+ }
111
+
112
+ if ( file_exists( $this->analytics_path ) && ! class_exists( 'BSF_Analytics' ) ) {
113
+ require_once $this->analytics_path . '/class-bsf-analytics.php';
114
+ new BSF_Analytics( $unique_entities, $this->analytics_path, $this->analytics_version );
115
+ }
116
+ }
117
+ }
118
+ }
assets/js/import.js CHANGED
@@ -532,7 +532,9 @@ var CartFlowsAjaxQueue = (function() {
532
 
533
  $step_type = $('.step-type-filter-links').find('option:selected').data('slug');
534
 
535
- if ( ( 'no' === CartFlowsImportVars.is_wc_installed || 'no' === CartFlowsImportVars.is_wc_activated ) && ( 'upsell' === $step_type || 'downsell' === $step_type || 'checkout' === $step_type || 'thankyou' === $step_type)) {
 
 
536
  $(".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>");
537
  $('.cartflows-step-import-blank').addClass('disabled').css('pointer-events', 'none');
538
  return;
532
 
533
  $step_type = $('.step-type-filter-links').find('option:selected').data('slug');
534
 
535
+ var allowed_step = ['optin', 'checkout', 'upsell', 'downsell', 'thankyou'];
536
+
537
+ if ( ( 'no' === CartFlowsImportVars.is_wc_installed || 'no' === CartFlowsImportVars.is_wc_activated ) && allowed_step.includes($step_type)) {
538
  $(".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>");
539
  $('.cartflows-step-import-blank').addClass('disabled').css('pointer-events', 'none');
540
  return;
assets/js/lib/jquery-cookie/jquery.cookie.js ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Cookie Plugin v1.4.1
3
+ * https://github.com/carhartl/jquery-cookie
4
+ *
5
+ * Copyright 2013 Klaus Hartl
6
+ * Released under the MIT license
7
+ */
8
+ (function (factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ // AMD
11
+ define(['jquery'], factory);
12
+ } else if (typeof exports === 'object') {
13
+ // CommonJS
14
+ factory(require('jquery'));
15
+ } else {
16
+ // Browser globals
17
+ factory(jQuery);
18
+ }
19
+ }(function ($) {
20
+
21
+ var pluses = /\+/g;
22
+
23
+ function encode(s) {
24
+ return config.raw ? s : encodeURIComponent(s);
25
+ }
26
+
27
+ function decode(s) {
28
+ return config.raw ? s : decodeURIComponent(s);
29
+ }
30
+
31
+ function stringifyCookieValue(value) {
32
+ return encode(config.json ? JSON.stringify(value) : String(value));
33
+ }
34
+
35
+ function parseCookieValue(s) {
36
+ if (s.indexOf('"') === 0) {
37
+ // This is a quoted cookie as according to RFC2068, unescape...
38
+ s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
39
+ }
40
+
41
+ try {
42
+ // Replace server-side written pluses with spaces.
43
+ // If we can't decode the cookie, ignore it, it's unusable.
44
+ // If we can't parse the cookie, ignore it, it's unusable.
45
+ s = decodeURIComponent(s.replace(pluses, ' '));
46
+ return config.json ? JSON.parse(s) : s;
47
+ } catch(e) {}
48
+ }
49
+
50
+ function read(s, converter) {
51
+ var value = config.raw ? s : parseCookieValue(s);
52
+ return $.isFunction(converter) ? converter(value) : value;
53
+ }
54
+
55
+ var config = $.cookie = function (key, value, options) {
56
+
57
+ // Write
58
+
59
+ if (value !== undefined && !$.isFunction(value)) {
60
+ options = $.extend({}, config.defaults, options);
61
+
62
+ if (typeof options.expires === 'number') {
63
+ var days = options.expires, t = options.expires = new Date();
64
+ t.setTime(+t + days * 864e+5);
65
+ }
66
+
67
+ return (document.cookie = [
68
+ encode(key), '=', stringifyCookieValue(value),
69
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
70
+ options.path ? '; path=' + options.path : '',
71
+ options.domain ? '; domain=' + options.domain : '',
72
+ options.secure ? '; secure' : ''
73
+ ].join(''));
74
+ }
75
+
76
+ // Read
77
+
78
+ var result = key ? undefined : {};
79
+
80
+ // To prevent the for loop in the first place assign an empty array
81
+ // in case there are no cookies at all. Also prevents odd result when
82
+ // calling $.cookie().
83
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
84
+
85
+ for (var i = 0, l = cookies.length; i < l; i++) {
86
+ var parts = cookies[i].split('=');
87
+ var name = decode(parts.shift());
88
+ var cookie = parts.join('=');
89
+
90
+ if (key && key === name) {
91
+ // If second argument (value) is a function it's a converter...
92
+ result = read(cookie, value);
93
+ break;
94
+ }
95
+
96
+ // Prevent storing a cookie that we couldn't decode.
97
+ if (!key && (cookie = read(cookie)) !== undefined) {
98
+ result[name] = cookie;
99
+ }
100
+ }
101
+
102
+ return result;
103
+ };
104
+
105
+ config.defaults = {};
106
+
107
+ $.removeCookie = function (key, options) {
108
+ if ($.cookie(key) === undefined) {
109
+ return false;
110
+ }
111
+
112
+ // Must not alter options, thus extending a fresh object...
113
+ $.cookie(key, '', $.extend({}, options, { expires: -1 }));
114
+ return !$.cookie(key);
115
+ };
116
+
117
+ }));
assets/js/lib/jquery-cookie/jquery.cookie.min.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Cookie Plugin v1.4.1
3
+ * https://github.com/carhartl/jquery-cookie
4
+ *
5
+ * Copyright 2013 Klaus Hartl
6
+ * Released under the MIT license
7
+ */
8
+ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){function n(e){return c.raw?e:encodeURIComponent(e)}function i(e){return c.raw?e:decodeURIComponent(e)}function o(e){return n(c.json?JSON.stringify(e):String(e))}function r(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(u," ")),c.json?JSON.parse(e):e}catch(n){}}function t(n,i){var o=c.raw?n:r(n);return e.isFunction(i)?i(o):o}var u=/\+/g,c=e.cookie=function(r,u,f){if(u!==undefined&&!e.isFunction(u)){if("number"==typeof(f=e.extend({},c.defaults,f)).expires){var d=f.expires,a=f.expires=new Date;a.setTime(+a+864e5*d)}return document.cookie=[n(r),"=",o(u),f.expires?"; expires="+f.expires.toUTCString():"",f.path?"; path="+f.path:"",f.domain?"; domain="+f.domain:"",f.secure?"; secure":""].join("")}for(var p=r?undefined:{},s=document.cookie?document.cookie.split("; "):[],m=0,x=s.length;m<x;m++){var k=s[m].split("="),l=i(k.shift()),j=k.join("=");if(r&&r===l){p=t(j,u);break}r||(j=t(j))===undefined||(p[l]=j)}return p};c.defaults={},e.removeCookie=function(n,i){return e.cookie(n)!==undefined&&(e.cookie(n,"",e.extend({},i,{expires:-1})),!e.cookie(n))}});
assets/min-js/import.min.js CHANGED
@@ -1 +1 @@
1
- var CartFlowsAjaxQueue=function(){var a=[];return{add:function(t){a.push(t)},remove:function(t){-1<jQuery.inArray(t,a)&&a.splice($.inArray(t,a),1)},run:function(){var t,e=this;a.length?(t=a[0].complete,a[0].complete=function(){"function"==typeof t&&t(),a.shift(),e.run.apply(e,[])},jQuery.ajax(a[0])):e.tid=setTimeout(function(){e.run.apply(e,[])},1e3)},stop:function(){a=[],clearTimeout(this.tid)}}}();!function(c){CartFlowsImport={doc:c(document),wrap:c(".wcf-flow-steps-data-wrap"),inner:c(".wcf-flow-steps-data-wrap-importer"),post_id:c("#post_ID").val(),_ref:null,_api_step_type:{},_api_params:{},all_steps:0,remaining_steps:0,remaining_install_plugins:0,remaining_active_plugins:0,woo_required_steps:["checkout","upsell","downsell","thankyou","optin"],step_order:["landing","checkout","upsell","downsell","thankyou","optin"],new_step_names:{landing:"Landing",checkout:"Checkout (Woo)",upsell:"Upsell (Woo)",downsell:"Downsell (Woo)",thankyou:"Thank You (Woo)",optin:"Optin (Woo)"},init:function(){if(this._bind(),"other"!==CartFlowsImportVars.default_page_builder&&(c(".post-type-cartflows_flow").hasClass("edit-php")&&this._process_cache_remote_flows(),c(".post-type-cartflows_flow").hasClass("post-php")&&this._process_cache_remote_steps()),c(".post-type-cartflows_flow").hasClass("edit-php")&&null!==this._getParamFromURL("add-new-flow")&&this._render_remote_flows(),c(".post-type-cartflows_flow").hasClass("post-php")&&null!==this._getParamFromURL("add-new-step")&&this._render_remote_steps(),this._getParamFromURL("highlight-step-id")){var t=c('.wcf-step-wrap[data-id="'+this._getParamFromURL("highlight-step-id")+'"]');t.length&&c("html, body").animate({scrollTop:t.offset().top},1500)}if(c(".post-type-cartflows_flow").hasClass("edit-php")){var e=c(".edit-php.post-type-cartflows_flow").find(".page-title-action:first");e.after('<a href="'+CartFlowsImportVars.export_url+'" class="page-title-action">Export</a>'),e.after('<a href="'+CartFlowsImportVars.import_url+'" class="page-title-action">Import</a>')}},_getParamFromURL:function(t,e){e=e||window.location.href,t=t.replace(/[\[\]]/g,"\\$&");var a=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null},_bind:function(){var t=CartFlowsImport;t.doc.on("click",".wcf-install-plugin",t._install_plugin),t.doc.on("cartflows-api-request-fail",t._api_request_failed),t.doc.on("click","#wcf-get-started-steps a, .wcf-create-from-scratch-link",t._toggle_ready_templates),t.doc.on("click",".cartflows-flow-import-blank",t._create_default_flow),t.doc.on("click","#wcf-remote-flow-importer .wcf-page-builder-links a",t._filterFlowPageBuilderClick),t.doc.on("click","#wcf-remote-step-importer #wcf-categories .step-type-filter-links a",t._filterBlankStepCategoryClick),t.doc.on("change","#wcf-remote-step-importer #wcf-scratch-steps-categories .step-type-filter-links",t._filterBlankStepCategoryChange),t.doc.on("click","#wcf-get-started-steps",t._filterBlankStepCategoryChange),t.doc.on("click","#wcf-remote-step-importer .wcf-page-builder-links a",t._filterStepPageBuilderClick),t.doc.on("click",".cartflows-step-import-blank:not(.get-pro)",t._create_blank_step),t.doc.on("click","#wcf-remote-step-importer .cartflows-step-import",t._process_import_step),t.doc.on("click","#wcf-remote-flow-importer .cartflows-step-import",t._process_import_flow),t.doc.on("click",".cartflows-preview-flow-step",t._preview_individual),t.doc.on("add_template_to_page-fail",t._add_template_to_page_fail),c("body").on("thickbox:iframe:loaded",t._previewLoaded),c(document).on("keyup input","#wcf-remote-step-importer .wcf-flow-search-input",t._remote_step_search),c(document).on("click",".actions a",t._previewResponsive),c(document).on("click",".page-title-action:first",t._render_remote_flows),c(document).on("click",".wcf-trigger-popup",t._render_remote_steps),c(document).on("click",".wcf-templates-popup-overlay",t._close_template_popup),c(document).on("click",".wcf-popup-close-wrap .close-icon",t._close_template_popup),c(document).on("wp-plugin-install-success",t._installSuccess),c(document).on("click",".wcf-activate-wc",t._installWc)},_install_plugin:function(t){t.preventDefault();var e=c(this);if(!e.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process"),c("#wcf-remote-step-importer").addClass("request-process"),e.addClass("updating-message button");var a=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(a,function(t,e){"install"===e.status&&CartFlowsImport.remaining_install_plugins++,"activate"===e.status&&CartFlowsImport.remaining_active_plugins++}),CartFlowsImport.remaining_install_plugins?CartFlowsImport._install_all_plugins():CartFlowsImport.remaining_active_plugins?CartFlowsImport._activate_all_plugins():c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps()}},_install_all_plugins:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(t,function(t,e){"install"===e.status&&wp.updates.queue.push({action:"install-plugin",data:{slug:e.slug}})}),wp.updates.queueChecker()},_activate_all_plugins:function(){if(CartFlowsImport.remaining_active_plugins||CartFlowsImport.remaining_install_plugins){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;CartFlowsAjaxQueue.stop(),CartFlowsAjaxQueue.run(),c.each(t,function(t,e){"activate"===e.status&&CartFlowsAjaxQueue.add({url:CartFlowsImportVars.ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:e.init,security:CartFlowsImportVars.cartflows_activate_plugin_nonce},success:function(t){CartFlowsImport.remaining_active_plugins--,CartFlowsImport.remaining_active_plugins||CartFlowsImport.remaining_install_plugins||(c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps())}})})}else c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps()},_installSuccess:function(t,a){t.preventDefault(),"no"===CartFlowsImportVars.is_wc_activated&&CartFlowsImport._activateWc();var e=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(e,function(t,e){"install"===e.status&&a.slug===e.slug&&c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:e.init,security:CartFlowsImportVars.cartflows_activate_plugin_nonce}}).done(function(t,e,a){CartFlowsImport.remaining_install_plugins--,CartFlowsImport.remaining_install_plugins||CartFlowsImport._activate_all_plugins()})})},_api_request_failed:function(t,e,a,s){"error"==s&&(c("#wcf-remote-content-failed").length||c("#wcf-ready-templates").html(wp.template("cartflows-website-unreachable")))},_toggle_ready_templates:function(t){t.preventDefault();var e=c(this).data("slug")||"";c("#wcf-get-started-steps").find("a").removeClass("current"),c("#wcf-get-started-steps").find('a[data-slug="'+e+'"]').addClass("current"),"canvas"==e?(c("#wcf-ready-templates").hide(),c("#wcf-start-from-scratch").show()):(c("#wcf-ready-templates").show(),c("#wcf-start-from-scratch").hide()),!c(".wcf-page-builder-notice").length&&c("#wcf-remote-step-importer").length&&CartFlowsImport._showSteps()},_switch_step_tab:function(t){t.preventDefault();var e=c(".wcf-tab > li.active > a").attr("href");c(".wcf-tab > li.active").removeClass("active"),c(this).parents("li").addClass("active"),c(e).removeClass("active"),c(e).addClass("hide");var a=c(this).attr("href");c(a).removeClass("hide"),c(a).addClass("active")},_remote_step_search:function(t){t.preventDefault(),c(".step-type-filter-links").find("option").removeClass("current"),c(".step-type-filter-links").find("option:first-child").addClass("current"),window.clearTimeout(CartFlowsImport._ref),CartFlowsImport._ref=window.setTimeout(function(){CartFlowsImport._ref=null,CartFlowsImport._showSteps()},500)},_previewResponsive:function(t){t.preventDefault();var e=c(this).find(".dashicons"),a=e.attr("data-view")||"";c("#TB_window").removeClass("desktop tablet mobile"),c("#TB_window").addClass(a),c(".actions .dashicons").removeClass("active"),e.addClass("active"),c("#TB_iframeContent").removeClass(),c("#TB_iframeContent").addClass(a)},_filterStepPageBuilderClick:function(t){t.preventDefault(),c(this).parents("ul").find("a").removeClass("current"),c(this).addClass("current");var e=c(".step-type-filter-links .current").data("slug")||"";"upsell"===e||"downsell"===e?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),c(".wcf-page-builder-notice").html(""),c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps()},_filterBlankStepCategoryClick:function(t){t.preventDefault(),c(".wcf-page-builder-notice").html("");var e=c(this).data("group")||"";e&&(c("#wcf-scratch-steps-categories .step-type-filter-links").val(e),c("#wcf-scratch-steps-categories .step-type-filter-links option").removeClass("current"),c('#wcf-scratch-steps-categories .step-type-filter-links option[data-group="'+e+'"]').addClass("current")),c(".step-type-filter-links").find("a").removeClass("current"),c(this).addClass("current"),$step_type=c(this).data("slug"),"upsell"===$step_type||"downsell"===$step_type?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),""!=CartFlowsImportVars._is_pro_active||"upsell"!=$step_type&&"downsell"!=$step_type?(c(".cartflows-step-import-blank").text("Create Step"),c(".cartflows-step-import-blank").removeClass("get-pro"),c(".cartflows-step-import-blank").removeAttr("target")):(c(".cartflows-step-import-blank").text("Get Pro"),c(".cartflows-step-import-blank").attr("href",CartFlowsImportVars.domain_url),c(".cartflows-step-import-blank").attr("target","_blank"),c(".cartflows-step-import-blank").addClass("get-pro")),c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps()},_filterBlankStepCategoryChange:function(t){t.preventDefault(),c(".wcf-notice-wrap").remove(),c(".cartflows-step-import-blank").css("pointer-events","auto").removeClass("disabled");var e=c(".step-type-filter-links").find("option:selected").val()||"";if(e&&(c(".step-type-filter-links").val(e),c(".step-type-filter-links").find("a").removeClass("current"),c(".step-type-filter-links").find('a[data-group="'+e+'"]').addClass("current")),c(".step-type-filter-links").find("option").removeClass("current"),c(".step-type-filter-links").find("option:selected").addClass("current"),$step_type=c(".step-type-filter-links").find("option:selected").data("slug"),!("no"!==CartFlowsImportVars.is_wc_installed&&"no"!==CartFlowsImportVars.is_wc_activated||"upsell"!==$step_type&&"downsell"!==$step_type&&"checkout"!==$step_type&&"thankyou"!==$step_type))return c(".cartflows-step-import-blank").after("<p class='wcf-notice-wrap' style='text-align: center'>You need WooCommerce plugin installed and actived to use this product flow. <br/><br/> <a href='#' class='wcf-activate-wc button-secondary'> Click here to install and activate WooCommerce </a> </p>"),void c(".cartflows-step-import-blank").addClass("disabled").css("pointer-events","none");"upsell"===$step_type||"downsell"===$step_type?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),""!=CartFlowsImportVars._is_pro_active||"upsell"!=$step_type&&"downsell"!=$step_type?(c(".cartflows-step-import-blank").text("Create Step"),c(".cartflows-step-import-blank").removeClass("get-pro"),c(".cartflows-step-import-blank").removeAttr("target")):(c(".cartflows-step-import-blank").text("Get Pro"),c(".cartflows-step-import-blank").attr("href",CartFlowsImportVars.domain_url),c(".cartflows-step-import-blank").attr("target","_blank"),c(".cartflows-step-import-blank").addClass("get-pro")),!c(".wcf-page-builder-notice").length&&c("#wcf-remote-step-importer").length&&(c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps())},_showSteps:function(){var t={licence_args:CartFlowsImportVars.licence_args,per_page:100,_fields:CartFlowsImportVars.step_fields.toString()},e=c("#wcf-categories .step-type-filter-links").find(".current").data("group")||"",s=c("#wcf-categories .step-type-filter-links").find(".current").data("slug");""!==e&&"all"!==e&&(t[CartFlowsImportVars.step_type]=e);e=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("group")||"",s=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("slug")||"";var r=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("title")||"Page Builder";""!==e&&"all"!==e&&(t[CartFlowsImportVars.step_page_builder]=e);var a={remote_slug:CartFlowsImportVars.step,slug:CartFlowsImportVars.step+"?"+decodeURIComponent(c.param(t))};CartFlowsAPI._api_request(a,function(a){a.current_step_type=s,"yes"!==CartFlowsImportVars.is_wc_activated&&c.each(a.items,function(t,e){a.items[t].woo_required=!1,0<=c.inArray(e.step_type.slug,CartFlowsImport.woo_required_steps)&&(a.items[t].woo_required=!0)});var t=wp.template("cartflows-steps-list");parseInt(a.items_count)?c("#wcf-remote-step-list").html(t(a)):(c("#wcf-remote-step-list").html(wp.template("cartflows-no-steps")),c(".cartflows-no-steps").find(".description").html("We are working on ready templates designed with "+r+'.<br/>Meanwhile you can <a href="#" data-slug="canvas" class="wcf-create-from-scratch-link">create your own designs</a> easily.')),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-step-importer").removeClass("request-process")})},_apiAddParam_per_page:function(){CartFlowsImport._api_params.per_page=100},_apiAddParam_licence_args:function(){CartFlowsImport._api_params.licence_args=CartFlowsImportVars.licence_args},_apiAddParam_search:function(){var t=c(".wcf-flow-search-input").val()||"";""!==t&&(CartFlowsImport._api_params.search=t)},_close_popup:function(){c("#cartflows-steps").fadeOut(),c("body").removeClass("cartflows-popup-is-open")},_post_auto_save:function(){var t=c("#title"),e=c("#title-prompt-text"),a=CartFlowsImport;t.val()||(t.val("CartFlows #"+a.post_id),e.length&&e.remove()),wp.autosave&&wp.autosave.server.triggerSave()},_process_cache_remote_flows:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins,a=!0;c.each(t,function(t,e){a&&("install"!==e.status&&"activate"!==e.status||(a=!1))}),!1===a?(c(".wcf-page-builder-notice").html(wp.template("cartflows-page-builder-notice")),c("#wcf-remote-flow-list").find(".spinner").remove()):CartFlowsImport._cache_remote_flows()},_cache_remote_flows:function(){CartFlowsImport;var t={search:CartFlowsImportVars.default_page_builder,licence_args:CartFlowsImportVars.licence_args,hide_empty:!1,_fields:CartFlowsImportVars.flow_page_builder_fields.toString()},e={remote_slug:CartFlowsImportVars.flow_page_builder,slug:CartFlowsImportVars.flow_page_builder+"?"+decodeURIComponent(c.param(t)),wrapper_class:"wcf-page-builder-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-page-builders").html(e(t)),c("#wcf-page-builders").find("li:first a").addClass("current");var a={licence_args:CartFlowsImportVars.licence_args,hide_empty:!0,_fields:CartFlowsImportVars.flow_type_fields.toString()},s={remote_slug:CartFlowsImportVars.flow_type,slug:CartFlowsImportVars.flow_type+"?"+decodeURIComponent(c.param(a)),wrapper_class:"flow-type-filter-links filter-links",show_all:!1};CartFlowsAPI._api_request(s,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-categories").html(e(t)),c("#wcf-categories").find("li:first a").addClass("current"),CartFlowsImport._showFlows()})})},_render_remote_flows:function(t){t&&t.preventDefault(),c("#wcf-remote-flow-importer").addClass("open"),c("html").addClass("wcf-popup-open")},_process_cache_remote_steps:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins,a=!0;c.each(t,function(t,e){a&&("install"!==e.status&&"activate"!==e.status||(a=!1))}),!1===a?(c(".wcf-page-builder-notice").html(wp.template("cartflows-page-builder-notice")),c("#wcf-remote-step-list").find(".spinner").remove()):CartFlowsImport._cache_remote_steps()},mapOrder:function(t,r,o){return t.sort(function(t,e){var a=t[o],s=e[o];return-1===r.indexOf(a)?0:r.indexOf(a)>r.indexOf(s)?1:-1}),t},_cache_remote_steps:function(){CartFlowsImport;c("html").addClass("wcf-steps-loading");var t={search:CartFlowsImportVars.default_page_builder,licence_args:CartFlowsImportVars.licence_args,hide_empty:!1,_fields:CartFlowsImportVars.step_page_builder_fields.toString()},e={remote_slug:CartFlowsImportVars.step_page_builder,slug:CartFlowsImportVars.step_page_builder+"?"+decodeURIComponent(c.param(t)),wrapper_class:"wcf-page-builder-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-page-builders").html(e(t)),c("#wcf-page-builders").find("li:first a").addClass("current")});t={licence_args:CartFlowsImportVars.licence_args,_fields:CartFlowsImportVars.step_type_fields.toString()},e={remote_slug:CartFlowsImportVars.step_type,slug:CartFlowsImportVars.step_type+"?"+decodeURIComponent(c.param(t)),wrapper_class:"step-type-filter-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){t.items=CartFlowsImport.mapOrder(t.items,CartFlowsImport.step_order,"slug");var s=t,r=t.items_count;if(t.items)for(key in t.items){t.items[key].name=CartFlowsImport.new_step_names[t.items[key].slug];var e={licence_args:CartFlowsImportVars.licence_args,per_page:100,_fields:CartFlowsImportVars.step_fields.toString()};e[CartFlowsImportVars.step_type]=t.items[key].id;var a={remote_slug:CartFlowsImportVars.step,slug:CartFlowsImportVars.step+"?"+decodeURIComponent(c.param(e))};CartFlowsAPI._api_request(a,function(t){var e=wp.template("cartflows-steps-list");if(parseInt(t.items_count)?c("#wcf-remote-step-list").html(e(t)):c("#wcf-remote-step-list").html(wp.template("cartflows-no-steps")),0==--r){var a=wp.template("cartflows-term-filters-dropdown");e=wp.template("cartflows-term-filters");c("#wcf-categories").html(e(s)),c("#wcf-scratch-steps-categories").html(a(s)),c("#wcf-scratch-steps-categories").find("option:first").addClass("current"),c("#wcf-categories").find("li a[data-slug=landing]").addClass("current"),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-content").find(".spinner").remove(),CartFlowsImport._showSteps(),c("html").removeClass("wcf-steps-loading")}})}})},_render_remote_steps:function(t){t&&t.preventDefault(),c("#wcf-remote-step-importer").addClass("open"),c("html").addClass("wcf-popup-open")},_categorize_data:function(t){var s=[];return c.each(t,function(t,e){var a=e.step_type.slug;void 0===s[a]&&(s[a]=[]),s[a].push(e)}),s},_close_template_popup:function(t){(c(t.target).hasClass("wcf-templates-popup-overlay")||c(t.target).hasClass("close-icon"))&&(c(".wcf-templates-popup-overlay").hasClass("request-process")||(c("html").removeClass("wcf-popup-open"),c(".wcf-templates-popup-overlay").removeClass("open")))},_ajax:function(t,s,r){var o=CartFlowsImport;c.ajax({url:ajaxurl,type:"POST",data:t}).done(function(t,e,a){s&&"function"==typeof s&&s({request:t,status:e,XHR:a}),o.doc.trigger(r+"-done",[t,e,a])}).fail(function(t,e){o.doc.trigger(r+"-fail",[t,e])}).always(function(){o.doc.trigger(r+"-always")})},_empty:function(t){if("number"==typeof t||"boolean"==typeof t)return!1;if(null==t)return!0;if(void 0!==t.length)return 0==t.length;var e=0;for(var a in t)t.hasOwnProperty(a)&&e++;return 0==e},_preview_individual:function(){var t=c(this).data("id")||"",e=c(this).data("href")||"";c(".cartflows-preview-flow-step").removeClass("active"),c('.cartflows-preview-flow-step[data-id="'+t+'"]').addClass("active"),c("#TB_window").addClass("cartflows-thickbox-loading"),c("#TB_iframeContent").removeAttr("onload"),c("#TB_iframeContent").removeAttr("src"),c("#TB_iframeContent").attr("src",e),c("#TB_iframeContent").attr("onload","CartFlowsImport.showIframe()")},showIframe:function(){c("#TB_load").remove(),c("#TB_window").css({visibility:"visible"}),c("#TB_window").removeClass("cartflows-thickbox-loading")},_previewLoaded:function(t){t.preventDefault(),c("#TB_window").removeClass("cartflows-thickbox-loading")},_filterFlowPageBuilderClick:function(t){t.preventDefault(),c(this).parents("ul").find("a").removeClass("current"),c(this).addClass("current"),c(".wcf-page-builder-notice").html(""),c("#wcf-remote-flow-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showFlows()},_showFlows:function(){var t={licence_args:CartFlowsImportVars.licence_args,_fields:CartFlowsImportVars.flow_fields.toString(),per_page:100},e=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("group")||"";c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("slug"),c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("title");""!==e&&"all"!==e&&(t[CartFlowsImportVars.flow_page_builder]=e);var a={remote_slug:CartFlowsImportVars.flow,slug:CartFlowsImportVars.flow+"?"+decodeURIComponent(c.param(t))};CartFlowsAPI._api_request(a,function(s){"yes"!==CartFlowsImportVars.is_wc_activated&&c.each(s.items,function(a,t){s.items[a].woo_required=!1,c.each(t.flow_steps,function(t,e){0<=c.inArray(e.type,CartFlowsImport.woo_required_steps)&&(s.items[a].woo_required=!0)})});var t=wp.template("cartflows-flows-list");parseInt(s.items_count)?c("#wcf-remote-flow-list").html(t(s)):c("#wcf-remote-flow-list").html(wp.template("cartflows-no-flows")),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-flow-importer").removeClass("request-process")})},_create_default_flow:function(t){t.preventDefault();var e=CartFlowsImport,a=c(this);if(!a.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process"),a.addClass("updating-message").text("Creating Flow.."),a.parents(".template").addClass("importing");var s={action:"cartflows_default_flow",security:cartflows_admin.cf_default_flow_nonce};e._ajax(s,function(t){if(t.request.success){var e=t.request.data;setTimeout(function(){a.removeClass("updating-message").text("Flow Created! Redirecting.."),window.location=CartFlowsImportVars.admin_url+"post.php?post="+e+"&action=edit"},3e3)}})}},_activate_plugin:function(t){var e=CartFlowsImport,a={action:"cartflows_activate_plugin",plugin_init:t,security:CartFlowsImportVars.cartflows_activate_plugin_nonce};e._ajax(a,function(t){})},_process_import_flow:function(t){t.preventDefault();var s=c(this);if(!s.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process");var e=CartFlowsImport;s.text("Creating Flow.."),s.addClass("updating-message"),s.parents(".template").addClass("importing");var a=s.data("flow-steps")||"",r=""!==a?JSON.parse("["+a+"]"):[],o={action:"cartflows_create_flow",security:cartflows_admin.cf_create_flow_nonce};e._ajax(o,function(t){if(t.request.success){var a=t.request.data;r&&(CartFlowsAjaxQueue.stop(),CartFlowsAjaxQueue.run(),CartFlowsImport.all_steps=r.length,s.addClass("updating-message").text("Importing Step 1 of "+CartFlowsImport.all_steps),c.each(r,function(t,e){CartFlowsAjaxQueue.add({url:CartFlowsImportVars.ajaxurl,type:"POST",data:{action:"cartflows_import_flow_step",flow_id:a,template_id:e,security:cartflows_admin.cf_import_flow_step_nonce},success:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Imported Step "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message").text("All Imported! Redirecting.."),window.location=CartFlowsImportVars.admin_url+"post.php?post="+a+"&action=edit"},3e3)):s.addClass("updating-message").text("Importing Step "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)},error:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,template=s.parents(".template.importing"),template.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.statusText),CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Failed "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message button-primary").addClass("disabled")},3e3)):s.addClass("updating-message").text("Failed "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)},fail:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Imported "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message").text("All Step Imported! Reloading.."),location.reload()},3e3)):s.addClass("updating-message").text("Importing "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)}})}))}})}},_handle_error:function(t){c(".cartflows-step-import.updating-message").addClass("updating-message").text(t.errorMessage)},_create_blank_step:function(t){t.preventDefault();var a=c(this),e=CartFlowsImport,s=c("#post_ID").val(),r=c("#wcf-scratch-steps-categories .step-type-filter-links .current").data("slug")||"",o=c("#wcf-scratch-steps-categories .step-type-filter-links .current").data("title")||"",l=r,i=c('.wcf-step-wrap[data-term-slug="'+r+'"]').length||1,p=o+" "+(parseInt(i)+1);if(all_step_type=["landing","checkout","thankyou"],c("#wcf-start-from-scratch .wcf-notice-wrap ").remove(),""!==l){if(CartFlowsImportVars._is_pro_active||"upsell"!==l&&"downsell"!==l){if(a.parents(".template").addClass("importing"),!CartFlowsImportVars._is_pro_active)if("-1"!=jQuery.inArray(l,all_step_type))if(0<c('.wcf-step-wrap[data-term-slug="'+l+'"]').length){a.parents(".template.importing");return a.removeClass("importing updating-message").text("Import Failed!"),void c("#wcf-start-from-scratch .inner").append('<div class="wcf-notice-wrap"><div class="notice notice-warning wcf-notice"><p>Upgrade to Pro for adding more than one '+l.charAt(0).toUpperCase()+l.slice(1)+" step.</p></div></div>")}if(c("#wcf-remote-step-importer").addClass("request-process"),c(".cartflows-step-import").addClass("disabled"),a.addClass("importing updating-message").text("Creating.."),c("body").hasClass("post-type-cartflows_flow")){var n={action:"cartflows_step_create_blank",flow_id:s,step_type:l,step_title:p,security:cartflows_admin.cf_step_create_blank_nonce};e._ajax(n,function(t){CartFlowsImport;var e=a.parents(".template.importing");t.request.success?(a.text("Created. Reloading.."),setTimeout(function(){window.location.href=window.location.href+"&highlight-step-id="+t.request.data},3e3)):(a.removeClass("importing updating-message").text("Creating Failed!"),c("#wcf-remote-step-importer").removeClass("request-process"),e.find(".cartflows-step-preview").append("<div class='preview'></div>"),e.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.request.data))})}}}else c("#wcf-start-from-scratch .inner").append('<div class="wcf-notice-wrap"><div class="notice notice-info"><p>Please select the step type.</p></div></div>')},_process_import_step:function(t){t.preventDefault();var a=c(this),e=a.data("slug")||"",s=c('.wcf-step-wrap[data-term-slug="'+e+'"]').length||1;if((step_title=a.data("title")||"",step_custom_title=step_title+" "+(parseInt(s)+1),o=CartFlowsImport,all_step_slug=["landing","checkout","thankyou"],!CartFlowsImportVars._is_pro_active)&&("-1"!=jQuery.inArray(e,all_step_slug)&&0<c('.wcf-step-wrap[data-term-slug="'+e+'"]').length)){var r=a.parents(".template");return a.removeClass("importing updating-message").text("Import Failed!"),r.find(".preview").hide(),r.find("#wcf_create_notice").show().find("a").addClass("notice notice-warning ").text("Upgrade to Pro for adding more than one "+e.charAt(0).toUpperCase()+e.slice(1)+" step"),void c("#wcf-remote-step-importer").removeClass("request-process")}if(!a.hasClass("updating-message")){c("#wcf-remote-step-importer").addClass("request-process");var o=CartFlowsImport;a.addClass("updating-message"),a.parents(".template").addClass("importing");var l=a.data("template-id")||"",i=c("#post_ID").val(),p=e;o=CartFlowsImport;if(c(".cartflows-step-import-blank").addClass("disabled"),c(".cartflows-step-import").addClass("disabled"),a.addClass("importing updating-message").text("Importing.."),c("body").hasClass("post-type-cartflows_flow")){var n={action:"cartflows_step_import",flow_id:i,template_id:l,step_title:step_custom_title,step_type:p,security:cartflows_admin.cf_step_import_nonce};o._ajax(n,function(t){CartFlowsImport;var e=a.parents(".template.importing");t.request.success?(a.text("Imported. Reloading.."),setTimeout(function(){window.location.href=window.location.href+"&highlight-step-id="+t.request.data},3e3)):(c(".wcf-templates-popup-overlay").removeClass("request-process"),a.removeClass("importing updating-message").text("Import Failed!"),e.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.request.data))},"add_template_to_page")}}},_add_template_to_page_fail:function(t,e,a){t.preventDefault();CartFlowsImport;var s=c(".wcf-flow-steps-data-wrap-importer .template.importing");s.find(".cartflows-step-import").removeClass("importing updating-message").text("Import Failed!"),s.find(".preview").addClass("notice notice-warning").removeClass("preview").text(e.responseText)},_activateWc:function(t){c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:"woocommerce/woocommerce.php",security:CartFlowsImportVars.cartflows_activate_plugin_nonce}}).done(function(t,e,a){c(".wcf-notice-wrap").addClass("wcf-hidden"),c(".cartflows-template-selector").removeAttr("disabled"),CartFlowsImport.wc_installed=!0,CartFlowsImportVars.is_wc_installed="yes",CartFlowsImportVars.is_wc_activated="yes",location.reload(!0),window.location.search+="&add-new-flow"})},_installWc:function(t){c(this).addClass("updating-message button"),c(this).text(cartflows_admin.wc_activating_message),0==cartflows_admin.wc_status.installed?(wp.updates.shouldRequestFilesystemCredentials&&!wp.updates.ajaxLocked&&(wp.updates.requestFilesystemCredentials(t),$document.on("credential-modal-cancel",function(){c(".install-now.updating-message").removeClass("updating-message").text(wp.updates.l10n.installNow),wp.a11y.speak(wp.updates.l10n.updateCancel,"polite")})),wp.updates.installPlugin({slug:"woocommerce"})):CartFlowsImport._activateWc()}},c(function(){CartFlowsImport.init()})}(jQuery);
1
+ var CartFlowsAjaxQueue=function(){var a=[];return{add:function(t){a.push(t)},remove:function(t){-1<jQuery.inArray(t,a)&&a.splice($.inArray(t,a),1)},run:function(){var t,e=this;a.length?(t=a[0].complete,a[0].complete=function(){"function"==typeof t&&t(),a.shift(),e.run.apply(e,[])},jQuery.ajax(a[0])):e.tid=setTimeout(function(){e.run.apply(e,[])},1e3)},stop:function(){a=[],clearTimeout(this.tid)}}}();!function(c){CartFlowsImport={doc:c(document),wrap:c(".wcf-flow-steps-data-wrap"),inner:c(".wcf-flow-steps-data-wrap-importer"),post_id:c("#post_ID").val(),_ref:null,_api_step_type:{},_api_params:{},all_steps:0,remaining_steps:0,remaining_install_plugins:0,remaining_active_plugins:0,woo_required_steps:["checkout","upsell","downsell","thankyou","optin"],step_order:["landing","checkout","upsell","downsell","thankyou","optin"],new_step_names:{landing:"Landing",checkout:"Checkout (Woo)",upsell:"Upsell (Woo)",downsell:"Downsell (Woo)",thankyou:"Thank You (Woo)",optin:"Optin (Woo)"},init:function(){if(this._bind(),"other"!==CartFlowsImportVars.default_page_builder&&(c(".post-type-cartflows_flow").hasClass("edit-php")&&this._process_cache_remote_flows(),c(".post-type-cartflows_flow").hasClass("post-php")&&this._process_cache_remote_steps()),c(".post-type-cartflows_flow").hasClass("edit-php")&&null!==this._getParamFromURL("add-new-flow")&&this._render_remote_flows(),c(".post-type-cartflows_flow").hasClass("post-php")&&null!==this._getParamFromURL("add-new-step")&&this._render_remote_steps(),this._getParamFromURL("highlight-step-id")){var t=c('.wcf-step-wrap[data-id="'+this._getParamFromURL("highlight-step-id")+'"]');t.length&&c("html, body").animate({scrollTop:t.offset().top},1500)}if(c(".post-type-cartflows_flow").hasClass("edit-php")){var e=c(".edit-php.post-type-cartflows_flow").find(".page-title-action:first");e.after('<a href="'+CartFlowsImportVars.export_url+'" class="page-title-action">Export</a>'),e.after('<a href="'+CartFlowsImportVars.import_url+'" class="page-title-action">Import</a>')}},_getParamFromURL:function(t,e){e=e||window.location.href,t=t.replace(/[\[\]]/g,"\\$&");var a=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null},_bind:function(){var t=CartFlowsImport;t.doc.on("click",".wcf-install-plugin",t._install_plugin),t.doc.on("cartflows-api-request-fail",t._api_request_failed),t.doc.on("click","#wcf-get-started-steps a, .wcf-create-from-scratch-link",t._toggle_ready_templates),t.doc.on("click",".cartflows-flow-import-blank",t._create_default_flow),t.doc.on("click","#wcf-remote-flow-importer .wcf-page-builder-links a",t._filterFlowPageBuilderClick),t.doc.on("click","#wcf-remote-step-importer #wcf-categories .step-type-filter-links a",t._filterBlankStepCategoryClick),t.doc.on("change","#wcf-remote-step-importer #wcf-scratch-steps-categories .step-type-filter-links",t._filterBlankStepCategoryChange),t.doc.on("click","#wcf-get-started-steps",t._filterBlankStepCategoryChange),t.doc.on("click","#wcf-remote-step-importer .wcf-page-builder-links a",t._filterStepPageBuilderClick),t.doc.on("click",".cartflows-step-import-blank:not(.get-pro)",t._create_blank_step),t.doc.on("click","#wcf-remote-step-importer .cartflows-step-import",t._process_import_step),t.doc.on("click","#wcf-remote-flow-importer .cartflows-step-import",t._process_import_flow),t.doc.on("click",".cartflows-preview-flow-step",t._preview_individual),t.doc.on("add_template_to_page-fail",t._add_template_to_page_fail),c("body").on("thickbox:iframe:loaded",t._previewLoaded),c(document).on("keyup input","#wcf-remote-step-importer .wcf-flow-search-input",t._remote_step_search),c(document).on("click",".actions a",t._previewResponsive),c(document).on("click",".page-title-action:first",t._render_remote_flows),c(document).on("click",".wcf-trigger-popup",t._render_remote_steps),c(document).on("click",".wcf-templates-popup-overlay",t._close_template_popup),c(document).on("click",".wcf-popup-close-wrap .close-icon",t._close_template_popup),c(document).on("wp-plugin-install-success",t._installSuccess),c(document).on("click",".wcf-activate-wc",t._installWc)},_install_plugin:function(t){t.preventDefault();var e=c(this);if(!e.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process"),c("#wcf-remote-step-importer").addClass("request-process"),e.addClass("updating-message button");var a=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(a,function(t,e){"install"===e.status&&CartFlowsImport.remaining_install_plugins++,"activate"===e.status&&CartFlowsImport.remaining_active_plugins++}),CartFlowsImport.remaining_install_plugins?CartFlowsImport._install_all_plugins():CartFlowsImport.remaining_active_plugins?CartFlowsImport._activate_all_plugins():c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps()}},_install_all_plugins:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(t,function(t,e){"install"===e.status&&wp.updates.queue.push({action:"install-plugin",data:{slug:e.slug}})}),wp.updates.queueChecker()},_activate_all_plugins:function(){if(CartFlowsImport.remaining_active_plugins||CartFlowsImport.remaining_install_plugins){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;CartFlowsAjaxQueue.stop(),CartFlowsAjaxQueue.run(),c.each(t,function(t,e){"activate"===e.status&&CartFlowsAjaxQueue.add({url:CartFlowsImportVars.ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:e.init,security:CartFlowsImportVars.cartflows_activate_plugin_nonce},success:function(t){CartFlowsImport.remaining_active_plugins--,CartFlowsImport.remaining_active_plugins||CartFlowsImport.remaining_install_plugins||(c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps())}})})}else c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps()},_installSuccess:function(t,a){t.preventDefault(),"no"===CartFlowsImportVars.is_wc_activated&&CartFlowsImport._activateWc();var e=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(e,function(t,e){"install"===e.status&&a.slug===e.slug&&c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:e.init,security:CartFlowsImportVars.cartflows_activate_plugin_nonce}}).done(function(t,e,a){CartFlowsImport.remaining_install_plugins--,CartFlowsImport.remaining_install_plugins||CartFlowsImport._activate_all_plugins()})})},_api_request_failed:function(t,e,a,s){"error"==s&&(c("#wcf-remote-content-failed").length||c("#wcf-ready-templates").html(wp.template("cartflows-website-unreachable")))},_toggle_ready_templates:function(t){t.preventDefault();var e=c(this).data("slug")||"";c("#wcf-get-started-steps").find("a").removeClass("current"),c("#wcf-get-started-steps").find('a[data-slug="'+e+'"]').addClass("current"),"canvas"==e?(c("#wcf-ready-templates").hide(),c("#wcf-start-from-scratch").show()):(c("#wcf-ready-templates").show(),c("#wcf-start-from-scratch").hide()),!c(".wcf-page-builder-notice").length&&c("#wcf-remote-step-importer").length&&CartFlowsImport._showSteps()},_switch_step_tab:function(t){t.preventDefault();var e=c(".wcf-tab > li.active > a").attr("href");c(".wcf-tab > li.active").removeClass("active"),c(this).parents("li").addClass("active"),c(e).removeClass("active"),c(e).addClass("hide");var a=c(this).attr("href");c(a).removeClass("hide"),c(a).addClass("active")},_remote_step_search:function(t){t.preventDefault(),c(".step-type-filter-links").find("option").removeClass("current"),c(".step-type-filter-links").find("option:first-child").addClass("current"),window.clearTimeout(CartFlowsImport._ref),CartFlowsImport._ref=window.setTimeout(function(){CartFlowsImport._ref=null,CartFlowsImport._showSteps()},500)},_previewResponsive:function(t){t.preventDefault();var e=c(this).find(".dashicons"),a=e.attr("data-view")||"";c("#TB_window").removeClass("desktop tablet mobile"),c("#TB_window").addClass(a),c(".actions .dashicons").removeClass("active"),e.addClass("active"),c("#TB_iframeContent").removeClass(),c("#TB_iframeContent").addClass(a)},_filterStepPageBuilderClick:function(t){t.preventDefault(),c(this).parents("ul").find("a").removeClass("current"),c(this).addClass("current");var e=c(".step-type-filter-links .current").data("slug")||"";"upsell"===e||"downsell"===e?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),c(".wcf-page-builder-notice").html(""),c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps()},_filterBlankStepCategoryClick:function(t){t.preventDefault(),c(".wcf-page-builder-notice").html("");var e=c(this).data("group")||"";e&&(c("#wcf-scratch-steps-categories .step-type-filter-links").val(e),c("#wcf-scratch-steps-categories .step-type-filter-links option").removeClass("current"),c('#wcf-scratch-steps-categories .step-type-filter-links option[data-group="'+e+'"]').addClass("current")),c(".step-type-filter-links").find("a").removeClass("current"),c(this).addClass("current"),$step_type=c(this).data("slug"),"upsell"===$step_type||"downsell"===$step_type?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),""!=CartFlowsImportVars._is_pro_active||"upsell"!=$step_type&&"downsell"!=$step_type?(c(".cartflows-step-import-blank").text("Create Step"),c(".cartflows-step-import-blank").removeClass("get-pro"),c(".cartflows-step-import-blank").removeAttr("target")):(c(".cartflows-step-import-blank").text("Get Pro"),c(".cartflows-step-import-blank").attr("href",CartFlowsImportVars.domain_url),c(".cartflows-step-import-blank").attr("target","_blank"),c(".cartflows-step-import-blank").addClass("get-pro")),c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps()},_filterBlankStepCategoryChange:function(t){t.preventDefault(),c(".wcf-notice-wrap").remove(),c(".cartflows-step-import-blank").css("pointer-events","auto").removeClass("disabled");var e=c(".step-type-filter-links").find("option:selected").val()||"";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");if(("no"===CartFlowsImportVars.is_wc_installed||"no"===CartFlowsImportVars.is_wc_activated)&&["optin","checkout","upsell","downsell","thankyou"].includes($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:100,_fields:CartFlowsImportVars.step_fields.toString()},e=c("#wcf-categories .step-type-filter-links").find(".current").data("group")||"",s=c("#wcf-categories .step-type-filter-links").find(".current").data("slug");""!==e&&"all"!==e&&(t[CartFlowsImportVars.step_type]=e);e=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("group")||"",s=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("slug")||"";var r=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("title")||"Page Builder";""!==e&&"all"!==e&&(t[CartFlowsImportVars.step_page_builder]=e);var a={remote_slug:CartFlowsImportVars.step,slug:CartFlowsImportVars.step+"?"+decodeURIComponent(c.param(t))};CartFlowsAPI._api_request(a,function(a){a.current_step_type=s,"yes"!==CartFlowsImportVars.is_wc_activated&&c.each(a.items,function(t,e){a.items[t].woo_required=!1,0<=c.inArray(e.step_type.slug,CartFlowsImport.woo_required_steps)&&(a.items[t].woo_required=!0)});var t=wp.template("cartflows-steps-list");parseInt(a.items_count)?c("#wcf-remote-step-list").html(t(a)):(c("#wcf-remote-step-list").html(wp.template("cartflows-no-steps")),c(".cartflows-no-steps").find(".description").html("We are working on ready templates designed with "+r+'.<br/>Meanwhile you can <a href="#" data-slug="canvas" class="wcf-create-from-scratch-link">create your own designs</a> easily.')),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-step-importer").removeClass("request-process")})},_apiAddParam_per_page:function(){CartFlowsImport._api_params.per_page=100},_apiAddParam_licence_args:function(){CartFlowsImport._api_params.licence_args=CartFlowsImportVars.licence_args},_apiAddParam_search:function(){var t=c(".wcf-flow-search-input").val()||"";""!==t&&(CartFlowsImport._api_params.search=t)},_close_popup:function(){c("#cartflows-steps").fadeOut(),c("body").removeClass("cartflows-popup-is-open")},_post_auto_save:function(){var t=c("#title"),e=c("#title-prompt-text"),a=CartFlowsImport;t.val()||(t.val("CartFlows #"+a.post_id),e.length&&e.remove()),wp.autosave&&wp.autosave.server.triggerSave()},_process_cache_remote_flows:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins,a=!0;c.each(t,function(t,e){a&&("install"!==e.status&&"activate"!==e.status||(a=!1))}),!1===a?(c(".wcf-page-builder-notice").html(wp.template("cartflows-page-builder-notice")),c("#wcf-remote-flow-list").find(".spinner").remove()):CartFlowsImport._cache_remote_flows()},_cache_remote_flows:function(){CartFlowsImport;var t={search:CartFlowsImportVars.default_page_builder,licence_args:CartFlowsImportVars.licence_args,hide_empty:!1,_fields:CartFlowsImportVars.flow_page_builder_fields.toString()},e={remote_slug:CartFlowsImportVars.flow_page_builder,slug:CartFlowsImportVars.flow_page_builder+"?"+decodeURIComponent(c.param(t)),wrapper_class:"wcf-page-builder-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-page-builders").html(e(t)),c("#wcf-page-builders").find("li:first a").addClass("current");var a={licence_args:CartFlowsImportVars.licence_args,hide_empty:!0,_fields:CartFlowsImportVars.flow_type_fields.toString()},s={remote_slug:CartFlowsImportVars.flow_type,slug:CartFlowsImportVars.flow_type+"?"+decodeURIComponent(c.param(a)),wrapper_class:"flow-type-filter-links filter-links",show_all:!1};CartFlowsAPI._api_request(s,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-categories").html(e(t)),c("#wcf-categories").find("li:first a").addClass("current"),CartFlowsImport._showFlows()})})},_render_remote_flows:function(t){t&&t.preventDefault(),c("#wcf-remote-flow-importer").addClass("open"),c("html").addClass("wcf-popup-open")},_process_cache_remote_steps:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins,a=!0;c.each(t,function(t,e){a&&("install"!==e.status&&"activate"!==e.status||(a=!1))}),!1===a?(c(".wcf-page-builder-notice").html(wp.template("cartflows-page-builder-notice")),c("#wcf-remote-step-list").find(".spinner").remove()):CartFlowsImport._cache_remote_steps()},mapOrder:function(t,r,o){return t.sort(function(t,e){var a=t[o],s=e[o];return-1===r.indexOf(a)?0:r.indexOf(a)>r.indexOf(s)?1:-1}),t},_cache_remote_steps:function(){CartFlowsImport;c("html").addClass("wcf-steps-loading");var t={search:CartFlowsImportVars.default_page_builder,licence_args:CartFlowsImportVars.licence_args,hide_empty:!1,_fields:CartFlowsImportVars.step_page_builder_fields.toString()},e={remote_slug:CartFlowsImportVars.step_page_builder,slug:CartFlowsImportVars.step_page_builder+"?"+decodeURIComponent(c.param(t)),wrapper_class:"wcf-page-builder-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-page-builders").html(e(t)),c("#wcf-page-builders").find("li:first a").addClass("current")});t={licence_args:CartFlowsImportVars.licence_args,_fields:CartFlowsImportVars.step_type_fields.toString()},e={remote_slug:CartFlowsImportVars.step_type,slug:CartFlowsImportVars.step_type+"?"+decodeURIComponent(c.param(t)),wrapper_class:"step-type-filter-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){t.items=CartFlowsImport.mapOrder(t.items,CartFlowsImport.step_order,"slug");var s=t,r=t.items_count;if(t.items)for(key in t.items){t.items[key].name=CartFlowsImport.new_step_names[t.items[key].slug];var e={licence_args:CartFlowsImportVars.licence_args,per_page:100,_fields:CartFlowsImportVars.step_fields.toString()};e[CartFlowsImportVars.step_type]=t.items[key].id;var a={remote_slug:CartFlowsImportVars.step,slug:CartFlowsImportVars.step+"?"+decodeURIComponent(c.param(e))};CartFlowsAPI._api_request(a,function(t){var e=wp.template("cartflows-steps-list");if(parseInt(t.items_count)?c("#wcf-remote-step-list").html(e(t)):c("#wcf-remote-step-list").html(wp.template("cartflows-no-steps")),0==--r){var a=wp.template("cartflows-term-filters-dropdown");e=wp.template("cartflows-term-filters");c("#wcf-categories").html(e(s)),c("#wcf-scratch-steps-categories").html(a(s)),c("#wcf-scratch-steps-categories").find("option:first").addClass("current"),c("#wcf-categories").find("li a[data-slug=landing]").addClass("current"),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-content").find(".spinner").remove(),CartFlowsImport._showSteps(),c("html").removeClass("wcf-steps-loading")}})}})},_render_remote_steps:function(t){t&&t.preventDefault(),c("#wcf-remote-step-importer").addClass("open"),c("html").addClass("wcf-popup-open")},_categorize_data:function(t){var s=[];return c.each(t,function(t,e){var a=e.step_type.slug;void 0===s[a]&&(s[a]=[]),s[a].push(e)}),s},_close_template_popup:function(t){(c(t.target).hasClass("wcf-templates-popup-overlay")||c(t.target).hasClass("close-icon"))&&(c(".wcf-templates-popup-overlay").hasClass("request-process")||(c("html").removeClass("wcf-popup-open"),c(".wcf-templates-popup-overlay").removeClass("open")))},_ajax:function(t,s,r){var o=CartFlowsImport;c.ajax({url:ajaxurl,type:"POST",data:t}).done(function(t,e,a){s&&"function"==typeof s&&s({request:t,status:e,XHR:a}),o.doc.trigger(r+"-done",[t,e,a])}).fail(function(t,e){o.doc.trigger(r+"-fail",[t,e])}).always(function(){o.doc.trigger(r+"-always")})},_empty:function(t){if("number"==typeof t||"boolean"==typeof t)return!1;if(null==t)return!0;if(void 0!==t.length)return 0==t.length;var e=0;for(var a in t)t.hasOwnProperty(a)&&e++;return 0==e},_preview_individual:function(){var t=c(this).data("id")||"",e=c(this).data("href")||"";c(".cartflows-preview-flow-step").removeClass("active"),c('.cartflows-preview-flow-step[data-id="'+t+'"]').addClass("active"),c("#TB_window").addClass("cartflows-thickbox-loading"),c("#TB_iframeContent").removeAttr("onload"),c("#TB_iframeContent").removeAttr("src"),c("#TB_iframeContent").attr("src",e),c("#TB_iframeContent").attr("onload","CartFlowsImport.showIframe()")},showIframe:function(){c("#TB_load").remove(),c("#TB_window").css({visibility:"visible"}),c("#TB_window").removeClass("cartflows-thickbox-loading")},_previewLoaded:function(t){t.preventDefault(),c("#TB_window").removeClass("cartflows-thickbox-loading")},_filterFlowPageBuilderClick:function(t){t.preventDefault(),c(this).parents("ul").find("a").removeClass("current"),c(this).addClass("current"),c(".wcf-page-builder-notice").html(""),c("#wcf-remote-flow-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showFlows()},_showFlows:function(){var t={licence_args:CartFlowsImportVars.licence_args,_fields:CartFlowsImportVars.flow_fields.toString(),per_page:100},e=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("group")||"";c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("slug"),c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("title");""!==e&&"all"!==e&&(t[CartFlowsImportVars.flow_page_builder]=e);var a={remote_slug:CartFlowsImportVars.flow,slug:CartFlowsImportVars.flow+"?"+decodeURIComponent(c.param(t))};CartFlowsAPI._api_request(a,function(s){"yes"!==CartFlowsImportVars.is_wc_activated&&c.each(s.items,function(a,t){s.items[a].woo_required=!1,c.each(t.flow_steps,function(t,e){0<=c.inArray(e.type,CartFlowsImport.woo_required_steps)&&(s.items[a].woo_required=!0)})});var t=wp.template("cartflows-flows-list");parseInt(s.items_count)?c("#wcf-remote-flow-list").html(t(s)):c("#wcf-remote-flow-list").html(wp.template("cartflows-no-flows")),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-flow-importer").removeClass("request-process")})},_create_default_flow:function(t){t.preventDefault();var e=CartFlowsImport,a=c(this);if(!a.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process"),a.addClass("updating-message").text("Creating Flow.."),a.parents(".template").addClass("importing");var s={action:"cartflows_default_flow",security:cartflows_admin.cf_default_flow_nonce};e._ajax(s,function(t){if(t.request.success){var e=t.request.data;setTimeout(function(){a.removeClass("updating-message").text("Flow Created! Redirecting.."),window.location=CartFlowsImportVars.admin_url+"post.php?post="+e+"&action=edit"},3e3)}})}},_activate_plugin:function(t){var e=CartFlowsImport,a={action:"cartflows_activate_plugin",plugin_init:t,security:CartFlowsImportVars.cartflows_activate_plugin_nonce};e._ajax(a,function(t){})},_process_import_flow:function(t){t.preventDefault();var s=c(this);if(!s.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process");var e=CartFlowsImport;s.text("Creating Flow.."),s.addClass("updating-message"),s.parents(".template").addClass("importing");var a=s.data("flow-steps")||"",r=""!==a?JSON.parse("["+a+"]"):[],o={action:"cartflows_create_flow",security:cartflows_admin.cf_create_flow_nonce};e._ajax(o,function(t){if(t.request.success){var a=t.request.data;r&&(CartFlowsAjaxQueue.stop(),CartFlowsAjaxQueue.run(),CartFlowsImport.all_steps=r.length,s.addClass("updating-message").text("Importing Step 1 of "+CartFlowsImport.all_steps),c.each(r,function(t,e){CartFlowsAjaxQueue.add({url:CartFlowsImportVars.ajaxurl,type:"POST",data:{action:"cartflows_import_flow_step",flow_id:a,template_id:e,security:cartflows_admin.cf_import_flow_step_nonce},success:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Imported Step "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message").text("All Imported! Redirecting.."),window.location=CartFlowsImportVars.admin_url+"post.php?post="+a+"&action=edit"},3e3)):s.addClass("updating-message").text("Importing Step "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)},error:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,template=s.parents(".template.importing"),template.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.statusText),CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Failed "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message button-primary").addClass("disabled")},3e3)):s.addClass("updating-message").text("Failed "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)},fail:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Imported "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message").text("All Step Imported! Reloading.."),location.reload()},3e3)):s.addClass("updating-message").text("Importing "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)}})}))}})}},_handle_error:function(t){c(".cartflows-step-import.updating-message").addClass("updating-message").text(t.errorMessage)},_create_blank_step:function(t){t.preventDefault();var a=c(this),e=CartFlowsImport,s=c("#post_ID").val(),r=c("#wcf-scratch-steps-categories .step-type-filter-links .current").data("slug")||"",o=c("#wcf-scratch-steps-categories .step-type-filter-links .current").data("title")||"",l=r,i=c('.wcf-step-wrap[data-term-slug="'+r+'"]').length||1,p=o+" "+(parseInt(i)+1);if(all_step_type=["landing","checkout","thankyou"],c("#wcf-start-from-scratch .wcf-notice-wrap ").remove(),""!==l){if(CartFlowsImportVars._is_pro_active||"upsell"!==l&&"downsell"!==l){if(a.parents(".template").addClass("importing"),!CartFlowsImportVars._is_pro_active)if("-1"!=jQuery.inArray(l,all_step_type))if(0<c('.wcf-step-wrap[data-term-slug="'+l+'"]').length){a.parents(".template.importing");return a.removeClass("importing updating-message").text("Import Failed!"),void c("#wcf-start-from-scratch .inner").append('<div class="wcf-notice-wrap"><div class="notice notice-warning wcf-notice"><p>Upgrade to Pro for adding more than one '+l.charAt(0).toUpperCase()+l.slice(1)+" step.</p></div></div>")}if(c("#wcf-remote-step-importer").addClass("request-process"),c(".cartflows-step-import").addClass("disabled"),a.addClass("importing updating-message").text("Creating.."),c("body").hasClass("post-type-cartflows_flow")){var n={action:"cartflows_step_create_blank",flow_id:s,step_type:l,step_title:p,security:cartflows_admin.cf_step_create_blank_nonce};e._ajax(n,function(t){CartFlowsImport;var e=a.parents(".template.importing");t.request.success?(a.text("Created. Reloading.."),setTimeout(function(){window.location.href=window.location.href+"&highlight-step-id="+t.request.data},3e3)):(a.removeClass("importing updating-message").text("Creating Failed!"),c("#wcf-remote-step-importer").removeClass("request-process"),e.find(".cartflows-step-preview").append("<div class='preview'></div>"),e.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.request.data))})}}}else c("#wcf-start-from-scratch .inner").append('<div class="wcf-notice-wrap"><div class="notice notice-info"><p>Please select the step type.</p></div></div>')},_process_import_step:function(t){t.preventDefault();var a=c(this),e=a.data("slug")||"",s=c('.wcf-step-wrap[data-term-slug="'+e+'"]').length||1;if((step_title=a.data("title")||"",step_custom_title=step_title+" "+(parseInt(s)+1),o=CartFlowsImport,all_step_slug=["landing","checkout","thankyou"],!CartFlowsImportVars._is_pro_active)&&("-1"!=jQuery.inArray(e,all_step_slug)&&0<c('.wcf-step-wrap[data-term-slug="'+e+'"]').length)){var r=a.parents(".template");return a.removeClass("importing updating-message").text("Import Failed!"),r.find(".preview").hide(),r.find("#wcf_create_notice").show().find("a").addClass("notice notice-warning ").text("Upgrade to Pro for adding more than one "+e.charAt(0).toUpperCase()+e.slice(1)+" step"),void c("#wcf-remote-step-importer").removeClass("request-process")}if(!a.hasClass("updating-message")){c("#wcf-remote-step-importer").addClass("request-process");var o=CartFlowsImport;a.addClass("updating-message"),a.parents(".template").addClass("importing");var l=a.data("template-id")||"",i=c("#post_ID").val(),p=e;o=CartFlowsImport;if(c(".cartflows-step-import-blank").addClass("disabled"),c(".cartflows-step-import").addClass("disabled"),a.addClass("importing updating-message").text("Importing.."),c("body").hasClass("post-type-cartflows_flow")){var n={action:"cartflows_step_import",flow_id:i,template_id:l,step_title:step_custom_title,step_type:p,security:cartflows_admin.cf_step_import_nonce};o._ajax(n,function(t){CartFlowsImport;var e=a.parents(".template.importing");t.request.success?(a.text("Imported. Reloading.."),setTimeout(function(){window.location.href=window.location.href+"&highlight-step-id="+t.request.data},3e3)):(c(".wcf-templates-popup-overlay").removeClass("request-process"),a.removeClass("importing updating-message").text("Import Failed!"),e.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.request.data))},"add_template_to_page")}}},_add_template_to_page_fail:function(t,e,a){t.preventDefault();CartFlowsImport;var s=c(".wcf-flow-steps-data-wrap-importer .template.importing");s.find(".cartflows-step-import").removeClass("importing updating-message").text("Import Failed!"),s.find(".preview").addClass("notice notice-warning").removeClass("preview").text(e.responseText)},_activateWc:function(t){c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:"woocommerce/woocommerce.php",security:CartFlowsImportVars.cartflows_activate_plugin_nonce}}).done(function(t,e,a){c(".wcf-notice-wrap").addClass("wcf-hidden"),c(".cartflows-template-selector").removeAttr("disabled"),CartFlowsImport.wc_installed=!0,CartFlowsImportVars.is_wc_installed="yes",CartFlowsImportVars.is_wc_activated="yes",location.reload(!0),window.location.search+="&add-new-flow"})},_installWc:function(t){c(this).addClass("updating-message button"),c(this).text(cartflows_admin.wc_activating_message),0==cartflows_admin.wc_status.installed?(wp.updates.shouldRequestFilesystemCredentials&&!wp.updates.ajaxLocked&&(wp.updates.requestFilesystemCredentials(t),$document.on("credential-modal-cancel",function(){c(".install-now.updating-message").removeClass("updating-message").text(wp.updates.l10n.installNow),wp.a11y.speak(wp.updates.l10n.updateCancel,"polite")})),wp.updates.installPlugin({slug:"woocommerce"})):CartFlowsImport._activateWc()}},c(function(){CartFlowsImport.init()})}(jQuery);
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.5.18
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.5.19
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: cartflows
changelog.txt CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  Version 1.5.18 - Tuesday, 29th September 2020
2
  - New: Introduced Elementor widgets.
3
  - Improvement: Added split test compatibility for a global checkout.
1
+ Version 1.5.19 - Tuesday, 13th October 2020
2
+ - New: Introduced Beaver Builder widgets.
3
+ - Fix: Facebook Pixel tracking events were not getting triggered when WooCommerce was not activated.
4
+
5
  Version 1.5.18 - Tuesday, 29th September 2020
6
  - New: Introduced Elementor widgets.
7
  - Improvement: Added split test compatibility for a global checkout.
classes/class-cartflows-admin.php CHANGED
@@ -1,740 +1,750 @@
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
- add_action( 'in_admin_header', __CLASS__ . '::embed_page_header' );
62
-
63
- add_filter( 'get_user_option_meta-box-order_' . CARTFLOWS_STEP_POST_TYPE, __CLASS__ . '::metabox_order' );
64
- }
65
-
66
- /**
67
- * Metabox fixed orders.
68
- *
69
- * @param array $metabox_orders Orders.
70
- * @return array
71
- */
72
- public static function metabox_order( $metabox_orders ) {
73
-
74
- if ( isset( $metabox_orders['side'] ) ) {
75
-
76
- $metabox_orders['side'] = str_replace(
77
- array(
78
- 'wcf-checkout-settings',
79
- 'wcf-ladning-settings',
80
- 'wcf-optin-settings',
81
- 'wcf-thankyou-settings',
82
- ),
83
- '',
84
- $metabox_orders['side']
85
- );
86
- }
87
-
88
- return $metabox_orders;
89
- }
90
-
91
- /**
92
- * After save of permalinks.
93
- */
94
- public static function cartflows_after_save_permalinks() {
95
-
96
- $has_saved_permalinks = get_option( 'cartflows_permalink_saved' );
97
- if ( $has_saved_permalinks ) {
98
- flush_rewrite_rules();
99
- delete_option( 'cartflows_permalink_saved' );
100
- }
101
- }
102
-
103
-
104
- /**
105
- * Initialize after Cartflows pro get loaded.
106
- */
107
- public static function settings_admin_scripts() {
108
- // Enqueue admin scripts.
109
- if ( isset( $_GET['page'] ) && ( 'cartflows' === $_GET['page'] || false !== strpos( $_GET['page'], 'cartflows_' ) ) ) { //phpcs:ignore
110
- add_action( 'admin_enqueue_scripts', __CLASS__ . '::styles_scripts' );
111
-
112
- self::save_settings();
113
- }
114
- }
115
- /**
116
- * Show action on plugin page.
117
- *
118
- * @param array $links links.
119
- * @return array
120
- */
121
- public static function add_action_links( $links ) {
122
- $mylinks = array(
123
- '<a href="' . admin_url( 'admin.php?page=' . CARTFLOWS_SETTINGS ) . '">Settings</a>',
124
- '<a target="_blank" href="' . esc_url( 'https://cartflows.com/docs' ) . '">Docs</a>',
125
- );
126
-
127
- if ( ! _is_cartflows_pro() ) {
128
- array_push( $mylinks, '<a style="color: #39b54a; font-weight: bold;" target="_blank" href="' . esc_url( 'https://cartflows.com/pricing/' ) . '"> Go Pro </a>' );
129
- }
130
-
131
- return array_merge( $links, $mylinks );
132
- }
133
-
134
- /**
135
- * Initialises the Plugin Name.
136
- *
137
- * @since 1.0.0
138
- * @return void
139
- */
140
- public static function initialise_plugin() {
141
-
142
- $name = 'Cartflows';
143
- $short_name = 'Cflows';
144
-
145
- define( 'CARTFLOWS_PLUGIN_NAME', $name );
146
- define( 'CARTFLOWS_PLUGIN_SHORT_NAME', $short_name );
147
- }
148
-
149
- /**
150
- * Renders the admin settings menu.
151
- *
152
- * @since 1.0.0
153
- * @return void
154
- */
155
- public static function menu() {
156
-
157
- if ( ! current_user_can( 'manage_options' ) ) {
158
- return;
159
- }
160
-
161
- add_menu_page(
162
- 'CartFlows',
163
- 'CartFlows',
164
- 'manage_options',
165
- CARTFLOWS_SLUG,
166
- __CLASS__ . '::render',
167
- 'data:image/svg+xml;base64,' . base64_encode( file_get_contents( CARTFLOWS_DIR . 'assets/images/cartflows-icon.svg' ) ),//phpcs:ignore
168
- 39.7
169
- );
170
-
171
- }
172
-
173
- /**
174
- * Add submenu to admin menu.
175
- *
176
- * @since 1.0.0
177
- */
178
- public static function submenu() {
179
-
180
- global $submenu;
181
-
182
- $parent_slug = CARTFLOWS_SLUG;
183
- $capability = 'manage_options';
184
-
185
- // Home menu.
186
- $submenu[ $parent_slug ][0][0] = __( 'Home', 'cartflows' ); //phpcs:ignore
187
-
188
- // Add settings menu.
189
- add_submenu_page(
190
- $parent_slug,
191
- __( 'Settings', 'cartflows' ),
192
- __( 'Settings', 'cartflows' ),
193
- $capability,
194
- 'cartflows_settings',
195
- __CLASS__ . '::render'
196
- );
197
- }
198
-
199
- /**
200
- * Renders the admin settings.
201
- *
202
- * @since 1.0.0
203
- * @return void
204
- */
205
- public static function render() {
206
- $menu_page_slug = ( isset( $_GET['page'] ) ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : CARTFLOWS_SETTINGS; //phpcs:ignore
207
- $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
208
- $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
209
- $action = str_replace( '_', '-', $action );
210
-
211
- // Enable header icon filter below.
212
- $header_wrapper_class = apply_filters( 'cartflows_admin_header_wrapper_class', array( $action, $menu_page_slug ) );
213
-
214
- include_once CARTFLOWS_DIR . 'includes/admin/cartflows-admin.php';
215
- }
216
-
217
- /**
218
- * Renders the admin settings content.
219
- *
220
- * @since 1.0.0
221
- * @param sting $menu_page_slug current page name.
222
- *
223
- * @return void
224
- */
225
- public static function render_content( $menu_page_slug ) {
226
-
227
- if ( CARTFLOWS_SETTINGS === $menu_page_slug ) {
228
-
229
- $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
230
- $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
231
- $action = str_replace( '_', '-', $action );
232
- $action = 'general';
233
-
234
- include_once CARTFLOWS_DIR . 'includes/admin/cartflows-general.php';
235
- }
236
-
237
- if ( 'cartflows' === $menu_page_slug ) {
238
-
239
- $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
240
- $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
241
- $action = str_replace( '_', '-', $action );
242
- $action = 'general';
243
-
244
- include_once CARTFLOWS_DIR . 'includes/admin/cartflows-home.php';
245
- }
246
- }
247
-
248
- /**
249
- * Save Global Setting options.
250
- *
251
- * @since 1.0.0
252
- */
253
- public static function save_common_settings() {
254
-
255
- if ( isset( $_POST['cartflows-common-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-common-settings-nonce'] ) ), 'cartflows-common-settings' ) ) {
256
-
257
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
258
- $new_settings = array();
259
-
260
- if ( isset( $_POST['_cartflows_common'] ) ) {
261
- // Loop through the input and sanitize each of the values.
262
- $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_common'] ) ); //phpcs:ignore
263
- }
264
-
265
- Cartflows_Helper::update_admin_settings_option( '_cartflows_common', $new_settings, false );
266
-
267
- $query = array(
268
- 'message' => 'saved',
269
- );
270
-
271
- $redirect_to = add_query_arg( $query, $url );
272
-
273
- wp_safe_redirect( $redirect_to );
274
- exit;
275
- } // End if statement.
276
- }
277
-
278
- /**
279
- * Save Debug Setting options.
280
- *
281
- * @since 1.1.14
282
- */
283
- public static function save_debug_settings() {
284
-
285
- if ( isset( $_POST['cartflows-debug-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-debug-settings-nonce'] ) ), 'cartflows-debug-settings' ) ) {
286
-
287
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
288
- $new_settings = array();
289
-
290
- if ( isset( $_POST['_cartflows_debug_data'] ) ) {
291
- $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_debug_data'] ) ); //phpcs:ignore
292
- }
293
-
294
- Cartflows_Helper::update_admin_settings_option( '_cartflows_debug_data', $new_settings, false );
295
-
296
- $query = array(
297
- 'message' => 'saved',
298
- );
299
-
300
- $redirect_to = add_query_arg( $query, $url );
301
-
302
- wp_safe_redirect( $redirect_to );
303
- exit;
304
-
305
- }
306
- }
307
-
308
-
309
- /**
310
- * Save permalink Setting options.
311
- *
312
- * @since 1.1.14
313
- */
314
- public static function save_permalink_settings() {
315
-
316
- if ( isset( $_POST['cartflows-permalink-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-permalink-settings-nonce'] ) ), 'cartflows-permalink-settings' ) ) {
317
-
318
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
319
- $new_settings = array();
320
-
321
- if ( isset( $_POST['reset'] ) ) {
322
- $_POST['_cartflows_permalink'] = array(
323
- 'permalink' => CARTFLOWS_STEP_POST_TYPE,
324
- 'permalink_flow_base' => CARTFLOWS_FLOW_POST_TYPE,
325
- 'permalink_structure' => '',
326
- );
327
-
328
- }
329
-
330
- if ( isset( $_POST['_cartflows_permalink'] ) ) {
331
- $cartflows_permalink_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_permalink'] ) ); //phpcs:ignore
332
-
333
- if ( empty( $cartflows_permalink_settings['permalink'] ) ) {
334
- $new_settings['permalink'] = CARTFLOWS_STEP_POST_TYPE;
335
- } else {
336
- $new_settings['permalink'] = $cartflows_permalink_settings['permalink'];
337
- }
338
-
339
- if ( empty( $cartflows_permalink_settings['permalink_flow_base'] ) ) {
340
- $new_settings['permalink_flow_base'] = CARTFLOWS_FLOW_POST_TYPE;
341
- } else {
342
- $new_settings['permalink_flow_base'] = $cartflows_permalink_settings['permalink_flow_base'];
343
- }
344
-
345
- $new_settings['permalink_structure'] = $cartflows_permalink_settings['permalink_structure'];
346
-
347
- }
348
-
349
- Cartflows_Helper::update_admin_settings_option( '_cartflows_permalink', $new_settings, false );
350
-
351
- $query = array(
352
- 'message' => 'saved',
353
- );
354
-
355
- $redirect_to = add_query_arg( $query, $url );
356
-
357
- update_option( 'cartflows_permalink_saved', true );
358
-
359
- wp_safe_redirect( $redirect_to );
360
- exit;
361
-
362
- }
363
- }
364
-
365
- /**
366
- * Save google analytics Setting options.
367
- *
368
- * @since 1.1.14
369
- */
370
- public static function save_google_analytics_settings() {
371
-
372
- if ( isset( $_POST['cartflows-google-analytics-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-google-analytics-settings-nonce'] ) ), 'cartflows-google-analytics-settings' ) ) {
373
-
374
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
375
- $new_settings = array();
376
-
377
- if ( isset( $_POST['_cartflows_google_analytics'] ) ) {
378
- $new_settings = self::sanitize_form_inputs( $_POST['_cartflows_google_analytics'] ); //phpcs:ignore
379
-
380
- }
381
-
382
- Cartflows_Helper::update_admin_settings_option( '_cartflows_google_analytics', $new_settings, true );
383
-
384
- $query = array(
385
- 'message' => 'saved',
386
- );
387
-
388
- $redirect_to = add_query_arg( $query, $url );
389
-
390
- wp_safe_redirect( $redirect_to );
391
- exit;
392
-
393
- }
394
- }
395
-
396
- /**
397
- * Loop through the input and sanitize each of the values.
398
- *
399
- * @param array $input_settings input settings.
400
- * @return array
401
- */
402
- public static function sanitize_form_inputs( $input_settings = array() ) {
403
- $new_settings = array();
404
- foreach ( $input_settings as $key => $val ) {
405
-
406
- if ( is_array( $val ) ) {
407
- foreach ( $val as $k => $v ) {
408
- $new_settings[ $key ][ $k ] = ( isset( $val[ $k ] ) ) ? sanitize_text_field( $v ) : '';
409
- }
410
- } else {
411
- $new_settings[ $key ] = ( isset( $input_settings[ $key ] ) ) ? sanitize_text_field( $val ) : '';
412
- }
413
- }
414
- return $new_settings;
415
- }
416
-
417
- /**
418
- * Check is cartflows admin.
419
- *
420
- * @since 1.0.0
421
- * @return boolean
422
- */
423
- public static function is_global_admin() {
424
-
425
- $current_screen = get_current_screen();
426
-
427
- if (
428
- is_object( $current_screen ) &&
429
- isset( $current_screen->post_type ) &&
430
- ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ||
431
- CARTFLOWS_STEP_POST_TYPE === $current_screen->post_type
432
- )
433
- ) {
434
- return true;
435
- }
436
- return false;
437
- }
438
-
439
- /**
440
- * Check is flow admin.
441
- *
442
- * @since 1.0.0
443
- * @return boolean
444
- */
445
- public static function is_flow_edit_admin() {
446
-
447
- $current_screen = get_current_screen();
448
-
449
- if (
450
- is_object( $current_screen ) &&
451
- isset( $current_screen->post_type ) &&
452
- ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ) &&
453
- isset( $current_screen->base ) &&
454
- ( 'post' === $current_screen->base )
455
- ) {
456
- return true;
457
- }
458
- return false;
459
- }
460
-
461
- /**
462
- * Global Admin Scripts.
463
- *
464
- * @since 1.0.0
465
- */
466
- public static function global_admin_scripts() {
467
-
468
- $installed_plugins = get_plugins();
469
- $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? true : false;
470
- $edit_test_mode = filter_input( INPUT_GET, 'edit_test_mode', FILTER_SANITIZE_STRING );
471
- $edit_test_mode = 'yes' === $edit_test_mode ? true : false;
472
-
473
- $localize = array(
474
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
475
- 'ajax_nonce' => wp_create_nonce( 'cartflows-nonce' ),
476
- 'wc_status' => array(
477
- 'installed' => $is_wc_installed,
478
- 'active' => wcf()->is_woo_active,
479
- ),
480
- 'wc_activating_message' => __( 'Installing and activating..', 'cartflows' ),
481
- 'wc_install_error' => __( 'There was an error with the installation of plugin.', 'cartflows' ),
482
- 'wcf_edit_test_mode' => $edit_test_mode,
483
- 'wcf_fetch_stats_nonce' => wp_create_nonce( 'wcf-fetch-stats' ),
484
- );
485
-
486
- $localize = apply_filters( 'cartflows_admin_js_localize', $localize );
487
-
488
- $localize_script = '<!-- script to print the admin localized variables -->';
489
- $localize_script .= '<script type="text/javascript">';
490
- $localize_script .= 'var cartflows_admin = ' . wp_json_encode( $localize ) . ';';
491
- $localize_script .= '</script>';
492
-
493
- echo $localize_script;
494
-
495
- if ( self::is_global_admin() ) {
496
-
497
- // Styles.
498
- wp_enqueue_style( 'cartflows-global-admin', CARTFLOWS_URL . 'admin/assets/css/global-admin.css', array(), CARTFLOWS_VER );
499
- wp_style_add_data( 'cartflows-global-admin', 'rtl', 'replace' );
500
-
501
- wp_enqueue_script(
502
- 'wcf-global-admin',
503
- CARTFLOWS_URL . 'admin/assets/js/global-admin.js',
504
- array( 'jquery' ),
505
- CARTFLOWS_VER,
506
- true
507
- );
508
-
509
- do_action( 'cartflows_global_admin_scripts' );
510
- }
511
- }
512
-
513
- /**
514
- * Global Admin Data.
515
- *
516
- * @since 1.0.0
517
- */
518
- public static function global_admin_data() {
519
-
520
- $current_screen = get_current_screen();
521
-
522
- if ( ! $current_screen ) {
523
- return;
524
- }
525
-
526
- if ( 'edit-' . CARTFLOWS_FLOW_POST_TYPE != $current_screen->id ) {
527
- return;
528
- }
529
-
530
- $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
531
- ?>
532
-
533
- <div id="wcf-remote-flow-importer" class="wcf-templates-popup-overlay">
534
- <div class="wcf-templates-popup-content">
535
- <div class="spinner"></div>
536
- <div class="wcf-templates-wrap wcf-templates-wrap-flows">
537
-
538
- <div id="wcf-remote-flow-actions" class="wcf-template-header">
539
- <div class="wcf-template-logo-wrap">
540
- <span class="wcf-cartflows-logo-img">
541
- <span class="cartflows-logo-icon"></span>
542
- </span>
543
- <span class="wcf-cartflows-title"><?php esc_html_e( 'Flows Library', 'cartflows' ); ?></span>
544
- </div>
545
- <div class="wcf-tab-wrapper">
546
- <?php if ( 'other' !== $default_page_builder ) { ?>
547
- <div id="wcf-get-started-steps">
548
- <ul class="filter-links ">
549
- <li>
550
- <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>
551
- </li>
552
- <li>
553
- <a href="#" data-slug="canvas" data-title="<?php esc_html_e( 'Create Your Own', 'cartflows' ); ?>"><?php esc_html_e( 'Create Your Own', 'cartflows' ); ?></a>
554
- </li>
555
- </ul>
556
- </div>
557
- <?php } ?>
558
- </div>
559
- <div class="wcf-popup-close-wrap">
560
- <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
561
- </div>
562
- </div>
563
- <!-- <div class="wcf-search-form">
564
- <label class="screen-reader-text" for="wp-filter-search-input"><?php esc_html_e( 'Search Sites', 'cartflows' ); ?> </label>
565
- <input placeholder="<?php esc_html_e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
566
- </div> -->
567
-
568
- <div id="wcf-remote-content">
569
- <?php if ( 'other' !== $default_page_builder ) { ?>
570
- <div id="wcf-ready-templates">
571
- <div id="wcf-remote-filters">
572
- <div id="wcf-page-builders"></div>
573
- <div id="wcf-categories"></div>
574
- </div>
575
- <div class="wcf-page-builder-notice"></div>
576
- <div id="wcf-remote-flow-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
577
- <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
578
- </div>
579
- <?php } ?>
580
- <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
581
- <div class="inner">
582
- <a href="#" class="button button-hero button-primary cartflows-flow-import-blank"><?php esc_html_e( 'Design Your Flow', 'cartflows' ); ?></a>
583
- <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>
584
- </div>
585
- </div>
586
- </div>
587
- </div>
588
- </div>
589
- </div>
590
-
591
- <?php
592
- }
593
-
594
- /**
595
- * Enqueues the needed CSS/JS for the builder's admin settings page.
596
- *
597
- * @since 1.0.0
598
- */
599
- public static function styles_scripts() {
600
-
601
- // Styles.
602
- wp_enqueue_style( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/css/admin-menu-settings.css', array(), CARTFLOWS_VER );
603
- wp_style_add_data( 'cartflows-admin-settings', 'rtl', 'replace' );
604
-
605
- // Script.
606
- wp_enqueue_script( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/js/admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), CARTFLOWS_VER, false );
607
-
608
- $localize = array(
609
- 'ajax_nonce' => wp_create_nonce( 'cartflows-widget-nonce' ),
610
- );
611
-
612
- wp_localize_script( 'cartflows-admin-settings', 'cartflows', apply_filters( 'cartflows_js_localize', $localize ) );
613
-
614
- do_action( 'cartflows_admin_settings_after_enqueue_scripts' );
615
- }
616
-
617
- /**
618
- * Save All admin settings here
619
- */
620
- public static function save_settings() {
621
-
622
- // Only admins can save settings.
623
- if ( ! current_user_can( 'manage_options' ) ) {
624
- return;
625
- }
626
-
627
- self::save_common_settings();
628
- self::save_debug_settings();
629
- self::save_permalink_settings();
630
-
631
- self::save_google_analytics_settings();
632
- self::save_facebook_settings();
633
-
634
- // Let extensions hook into saving.
635
- do_action( 'cartflows_admin_settings_save' );
636
- }
637
-
638
- /**
639
- * Get and return page URL
640
- *
641
- * @param string $menu_slug Menu name.
642
- * @since 1.0.0
643
- * @return string page url
644
- */
645
- public static function get_page_url( $menu_slug ) {
646
-
647
- $parent_page = self::$default_menu_position;
648
-
649
- if ( strpos( $parent_page, '?' ) !== false ) {
650
- $query_var = '&page=' . self::$plugin_slug;
651
- } else {
652
- $query_var = '?page=' . self::$plugin_slug;
653
- }
654
-
655
- $parent_page_url = admin_url( $parent_page . $query_var );
656
-
657
- $url = $parent_page_url . '&action=' . $menu_slug;
658
-
659
- return esc_url( $url );
660
- }
661
-
662
- /**
663
- * Admin body classes.
664
- *
665
- * Body classes to be added to <body> tag in admin page
666
- *
667
- * @param String $classes body classes returned from the filter.
668
- * @return String body classes to be added to <body> tag in admin page
669
- */
670
- public static function add_admin_body_class( $classes ) {
671
-
672
- $classes .= ' cartflows-' . CARTFLOWS_VER;
673
-
674
- return $classes;
675
- }
676
-
677
- /**
678
- * Save Global Setting options.
679
- *
680
- * @since 1.0.0
681
- */
682
- public static function save_facebook_settings() {
683
-
684
- if ( isset( $_POST['cartflows-facebook-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-facebook-settings-nonce'] ) ), 'cartflows-facebook-settings' ) ) {
685
-
686
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
687
- $new_settings = array();
688
-
689
- if ( isset( $_POST['_cartflows_facebook'] ) ) {
690
- $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_facebook'] ) ); //phpcs:ignore
691
- }
692
-
693
- Cartflows_Helper::update_admin_settings_option( '_cartflows_facebook', $new_settings, false );
694
- $query = array(
695
- 'message' => 'saved',
696
- );
697
- $redirect_to = add_query_arg( $query, $url );
698
- wp_safe_redirect( $redirect_to );
699
- exit;
700
- }
701
- }
702
-
703
- /**
704
- * Show embed header.
705
- *
706
- * @since 1.0.0
707
- */
708
- public static function show_embed_header() {
709
-
710
- $current_screen = get_current_screen();
711
-
712
- if (
713
- is_object( $current_screen ) &&
714
- isset( $current_screen->post_type ) &&
715
- ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ) &&
716
- isset( $current_screen->base ) &&
717
- ( 'post' === $current_screen->base || 'edit' === $current_screen->base )
718
- ) {
719
- return true;
720
- }
721
-
722
- return false;
723
- }
724
- /**
725
- * Set up a div for the header embed to render into.
726
- * The initial contents here are meant as a place loader for when the PHP page initialy loads.
727
- */
728
- public static function embed_page_header() {
729
-
730
- if ( ! is_admin() || ! self::show_embed_header() ) {
731
- return;
732
- }
733
-
734
- wp_enqueue_style( 'cartflows-admin-embed-header', CARTFLOWS_URL . 'admin/assets/css/admin-embed-header.css', array(), CARTFLOWS_VER );
735
-
736
- include_once CARTFLOWS_DIR . 'includes/admin/cartflows-admin-header.php';
737
- }
738
- }
739
-
740
- 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
+ add_action( 'in_admin_header', __CLASS__ . '::embed_page_header' );
62
+
63
+ add_filter( 'get_user_option_meta-box-order_' . CARTFLOWS_STEP_POST_TYPE, __CLASS__ . '::metabox_order' );
64
+ }
65
+
66
+ /**
67
+ * Metabox fixed orders.
68
+ *
69
+ * @param array $metabox_orders Orders.
70
+ * @return array
71
+ */
72
+ public static function metabox_order( $metabox_orders ) {
73
+
74
+ if ( isset( $metabox_orders['side'] ) ) {
75
+
76
+ $metabox_orders['side'] = str_replace(
77
+ array(
78
+ 'wcf-checkout-settings',
79
+ 'wcf-ladning-settings',
80
+ 'wcf-optin-settings',
81
+ 'wcf-thankyou-settings',
82
+ ),
83
+ '',
84
+ $metabox_orders['side']
85
+ );
86
+ }
87
+
88
+ return $metabox_orders;
89
+ }
90
+
91
+ /**
92
+ * After save of permalinks.
93
+ */
94
+ public static function cartflows_after_save_permalinks() {
95
+
96
+ $has_saved_permalinks = get_option( 'cartflows_permalink_saved' );
97
+ if ( $has_saved_permalinks ) {
98
+ flush_rewrite_rules();
99
+ delete_option( 'cartflows_permalink_saved' );
100
+ }
101
+ }
102
+
103
+
104
+ /**
105
+ * Initialize after Cartflows pro get loaded.
106
+ */
107
+ public static function settings_admin_scripts() {
108
+ // Enqueue admin scripts.
109
+ if ( isset( $_GET['page'] ) && ( 'cartflows' === $_GET['page'] || false !== strpos( $_GET['page'], 'cartflows_' ) ) ) { //phpcs:ignore
110
+ add_action( 'admin_enqueue_scripts', __CLASS__ . '::styles_scripts' );
111
+
112
+ self::save_settings();
113
+ }
114
+ }
115
+ /**
116
+ * Show action on plugin page.
117
+ *
118
+ * @param array $links links.
119
+ * @return array
120
+ */
121
+ public static function add_action_links( $links ) {
122
+ $mylinks = array(
123
+ '<a href="' . admin_url( 'admin.php?page=' . CARTFLOWS_SETTINGS ) . '">Settings</a>',
124
+ '<a target="_blank" href="' . esc_url( 'https://cartflows.com/docs' ) . '">Docs</a>',
125
+ );
126
+
127
+ if ( ! _is_cartflows_pro() ) {
128
+ array_push( $mylinks, '<a style="color: #39b54a; font-weight: bold;" target="_blank" href="' . esc_url( 'https://cartflows.com/pricing/' ) . '"> Go Pro </a>' );
129
+ }
130
+
131
+ return array_merge( $links, $mylinks );
132
+ }
133
+
134
+ /**
135
+ * Initialises the Plugin Name.
136
+ *
137
+ * @since 1.0.0
138
+ * @return void
139
+ */
140
+ public static function initialise_plugin() {
141
+
142
+ $name = 'Cartflows';
143
+ $short_name = 'Cflows';
144
+
145
+ define( 'CARTFLOWS_PLUGIN_NAME', $name );
146
+ define( 'CARTFLOWS_PLUGIN_SHORT_NAME', $short_name );
147
+ }
148
+
149
+ /**
150
+ * Renders the admin settings menu.
151
+ *
152
+ * @since 1.0.0
153
+ * @return void
154
+ */
155
+ public static function menu() {
156
+
157
+ if ( ! current_user_can( 'manage_options' ) ) {
158
+ return;
159
+ }
160
+
161
+ add_menu_page(
162
+ 'CartFlows',
163
+ 'CartFlows',
164
+ 'manage_options',
165
+ CARTFLOWS_SLUG,
166
+ __CLASS__ . '::render',
167
+ 'data:image/svg+xml;base64,' . base64_encode( file_get_contents( CARTFLOWS_DIR . 'assets/images/cartflows-icon.svg' ) ),//phpcs:ignore
168
+ 39.7
169
+ );
170
+
171
+ }
172
+
173
+ /**
174
+ * Add submenu to admin menu.
175
+ *
176
+ * @since 1.0.0
177
+ */
178
+ public static function submenu() {
179
+
180
+ global $submenu;
181
+
182
+ $parent_slug = CARTFLOWS_SLUG;
183
+ $capability = 'manage_options';
184
+
185
+ // Home menu.
186
+ $submenu[ $parent_slug ][0][0] = __( 'Home', 'cartflows' ); //phpcs:ignore
187
+
188
+ // Add settings menu.
189
+ add_submenu_page(
190
+ $parent_slug,
191
+ __( 'Settings', 'cartflows' ),
192
+ __( 'Settings', 'cartflows' ),
193
+ $capability,
194
+ 'cartflows_settings',
195
+ __CLASS__ . '::render'
196
+ );
197
+ }
198
+
199
+ /**
200
+ * Renders the admin settings.
201
+ *
202
+ * @since 1.0.0
203
+ * @return void
204
+ */
205
+ public static function render() {
206
+ $menu_page_slug = ( isset( $_GET['page'] ) ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : CARTFLOWS_SETTINGS; //phpcs:ignore
207
+ $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
208
+ $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
209
+ $action = str_replace( '_', '-', $action );
210
+
211
+ // Enable header icon filter below.
212
+ $header_wrapper_class = apply_filters( 'cartflows_admin_header_wrapper_class', array( $action, $menu_page_slug ) );
213
+
214
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-admin.php';
215
+ }
216
+
217
+ /**
218
+ * Renders the admin settings content.
219
+ *
220
+ * @since 1.0.0
221
+ * @param sting $menu_page_slug current page name.
222
+ *
223
+ * @return void
224
+ */
225
+ public static function render_content( $menu_page_slug ) {
226
+
227
+ if ( CARTFLOWS_SETTINGS === $menu_page_slug ) {
228
+
229
+ $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
230
+ $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
231
+ $action = str_replace( '_', '-', $action );
232
+ $action = 'general';
233
+
234
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-general.php';
235
+ }
236
+
237
+ if ( 'cartflows' === $menu_page_slug ) {
238
+
239
+ $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
240
+ $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
241
+ $action = str_replace( '_', '-', $action );
242
+ $action = 'general';
243
+
244
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-home.php';
245
+ }
246
+ }
247
+
248
+ /**
249
+ * Save Global Setting options.
250
+ *
251
+ * @since 1.0.0
252
+ */
253
+ public static function save_common_settings() {
254
+
255
+ if ( isset( $_POST['cartflows-common-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-common-settings-nonce'] ) ), 'cartflows-common-settings' ) ) {
256
+
257
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
258
+ $new_settings = array();
259
+
260
+ if ( isset( $_POST['_cartflows_common'] ) ) {
261
+ // Loop through the input and sanitize each of the values.
262
+ $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_common'] ) ); //phpcs:ignore
263
+ }
264
+
265
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_common', $new_settings, false );
266
+
267
+ $query = array(
268
+ 'message' => 'saved',
269
+ );
270
+
271
+ $redirect_to = add_query_arg( $query, $url );
272
+
273
+ wp_safe_redirect( $redirect_to );
274
+ exit;
275
+ } // End if statement.
276
+ }
277
+
278
+ /**
279
+ * Save Debug Setting options.
280
+ *
281
+ * @since 1.1.14
282
+ */
283
+ public static function save_debug_settings() {
284
+
285
+ if ( isset( $_POST['cartflows-debug-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-debug-settings-nonce'] ) ), 'cartflows-debug-settings' ) ) {
286
+
287
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
288
+ $new_settings = array();
289
+
290
+ if ( isset( $_POST['_cartflows_debug_data'] ) ) {
291
+ $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_debug_data'] ) ); //phpcs:ignore
292
+ }
293
+
294
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_debug_data', $new_settings, false );
295
+
296
+ $query = array(
297
+ 'message' => 'saved',
298
+ );
299
+
300
+ $redirect_to = add_query_arg( $query, $url );
301
+
302
+ wp_safe_redirect( $redirect_to );
303
+ exit;
304
+
305
+ }
306
+ }
307
+
308
+
309
+ /**
310
+ * Save permalink Setting options.
311
+ *
312
+ * @since 1.1.14
313
+ */
314
+ public static function save_permalink_settings() {
315
+
316
+ if ( isset( $_POST['cartflows-permalink-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-permalink-settings-nonce'] ) ), 'cartflows-permalink-settings' ) ) {
317
+
318
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
319
+ $new_settings = array();
320
+
321
+ if ( isset( $_POST['reset'] ) ) {
322
+ $_POST['_cartflows_permalink'] = array(
323
+ 'permalink' => CARTFLOWS_STEP_POST_TYPE,
324
+ 'permalink_flow_base' => CARTFLOWS_FLOW_POST_TYPE,
325
+ 'permalink_structure' => '',
326
+ );
327
+
328
+ }
329
+
330
+ if ( isset( $_POST['_cartflows_permalink'] ) ) {
331
+ $cartflows_permalink_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_permalink'] ) ); //phpcs:ignore
332
+
333
+ if ( empty( $cartflows_permalink_settings['permalink'] ) ) {
334
+ $new_settings['permalink'] = CARTFLOWS_STEP_POST_TYPE;
335
+ } else {
336
+ $new_settings['permalink'] = $cartflows_permalink_settings['permalink'];
337
+ }
338
+
339
+ if ( empty( $cartflows_permalink_settings['permalink_flow_base'] ) ) {
340
+ $new_settings['permalink_flow_base'] = CARTFLOWS_FLOW_POST_TYPE;
341
+ } else {
342
+ $new_settings['permalink_flow_base'] = $cartflows_permalink_settings['permalink_flow_base'];
343
+ }
344
+
345
+ $new_settings['permalink_structure'] = $cartflows_permalink_settings['permalink_structure'];
346
+
347
+ }
348
+
349
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_permalink', $new_settings, false );
350
+
351
+ $query = array(
352
+ 'message' => 'saved',
353
+ );
354
+
355
+ $redirect_to = add_query_arg( $query, $url );
356
+
357
+ update_option( 'cartflows_permalink_saved', true );
358
+
359
+ wp_safe_redirect( $redirect_to );
360
+ exit;
361
+
362
+ }
363
+ }
364
+
365
+ /**
366
+ * Save google analytics Setting options.
367
+ *
368
+ * @since 1.1.14
369
+ */
370
+ public static function save_google_analytics_settings() {
371
+
372
+ if ( isset( $_POST['cartflows-google-analytics-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-google-analytics-settings-nonce'] ) ), 'cartflows-google-analytics-settings' ) ) {
373
+
374
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
375
+ $new_settings = array();
376
+
377
+ if ( isset( $_POST['_cartflows_google_analytics'] ) ) {
378
+ $new_settings = self::sanitize_form_inputs( $_POST['_cartflows_google_analytics'] ); //phpcs:ignore
379
+
380
+ }
381
+
382
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_google_analytics', $new_settings, true );
383
+
384
+ $query = array(
385
+ 'message' => 'saved',
386
+ );
387
+
388
+ $redirect_to = add_query_arg( $query, $url );
389
+
390
+ wp_safe_redirect( $redirect_to );
391
+ exit;
392
+
393
+ }
394
+ }
395
+
396
+ /**
397
+ * Loop through the input and sanitize each of the values.
398
+ *
399
+ * @param array $input_settings input settings.
400
+ * @return array
401
+ */
402
+ public static function sanitize_form_inputs( $input_settings = array() ) {
403
+ $new_settings = array();
404
+ foreach ( $input_settings as $key => $val ) {
405
+
406
+ if ( is_array( $val ) ) {
407
+ foreach ( $val as $k => $v ) {
408
+ $new_settings[ $key ][ $k ] = ( isset( $val[ $k ] ) ) ? sanitize_text_field( $v ) : '';
409
+ }
410
+ } else {
411
+ $new_settings[ $key ] = ( isset( $input_settings[ $key ] ) ) ? sanitize_text_field( $val ) : '';
412
+ }
413
+ }
414
+ return $new_settings;
415
+ }
416
+
417
+ /**
418
+ * Check is cartflows admin.
419
+ *
420
+ * @since 1.0.0
421
+ * @return boolean
422
+ */
423
+ public static function is_global_admin() {
424
+
425
+ $current_screen = get_current_screen();
426
+
427
+ if (
428
+ is_object( $current_screen ) &&
429
+ isset( $current_screen->post_type ) &&
430
+ ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ||
431
+ CARTFLOWS_STEP_POST_TYPE === $current_screen->post_type
432
+ )
433
+ ) {
434
+ return true;
435
+ }
436
+ return false;
437
+ }
438
+
439
+ /**
440
+ * Check is flow admin.
441
+ *
442
+ * @since 1.0.0
443
+ * @return boolean
444
+ */
445
+ public static function is_flow_edit_admin() {
446
+
447
+ $current_screen = get_current_screen();
448
+
449
+ if (
450
+ is_object( $current_screen ) &&
451
+ isset( $current_screen->post_type ) &&
452
+ ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ) &&
453
+ isset( $current_screen->base ) &&
454
+ ( 'post' === $current_screen->base )
455
+ ) {
456
+ return true;
457
+ }
458
+ return false;
459
+ }
460
+
461
+ /**
462
+ * Global Admin Scripts.
463
+ *
464
+ * @since 1.0.0
465
+ */
466
+ public static function global_admin_scripts() {
467
+
468
+ global $post;
469
+
470
+ $installed_plugins = get_plugins();
471
+ $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? true : false;
472
+ $edit_test_mode = filter_input( INPUT_GET, 'edit_test_mode', FILTER_SANITIZE_STRING );
473
+ $edit_test_mode = 'yes' === $edit_test_mode ? true : false;
474
+ $step_type = '';
475
+
476
+ if ( self::is_global_admin() && $post ) {
477
+
478
+ $step_type = get_post_meta( $post->ID, 'wcf-step-type', true ) ? get_post_meta( $post->ID, 'wcf-step-type', true ) : '';
479
+ }
480
+
481
+ $localize = array(
482
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
483
+ 'ajax_nonce' => wp_create_nonce( 'cartflows-nonce' ),
484
+ 'wc_status' => array(
485
+ 'installed' => $is_wc_installed,
486
+ 'active' => wcf()->is_woo_active,
487
+ 'message' => __( 'This page requires WooCommerce plugin installed and activated!', 'cartflows' ),
488
+ ),
489
+ 'current_step_type' => $step_type,
490
+ 'wc_activating_message' => __( 'Installing and activating..', 'cartflows' ),
491
+ 'wc_install_error' => __( 'There was an error with the installation of plugin.', 'cartflows' ),
492
+ 'wcf_edit_test_mode' => $edit_test_mode,
493
+ 'wcf_fetch_stats_nonce' => wp_create_nonce( 'wcf-fetch-stats' ),
494
+ );
495
+
496
+ $localize = apply_filters( 'cartflows_admin_js_localize', $localize );
497
+
498
+ $localize_script = '<!-- script to print the admin localized variables -->';
499
+ $localize_script .= '<script type="text/javascript">';
500
+ $localize_script .= 'var cartflows_admin = ' . wp_json_encode( $localize ) . ';';
501
+ $localize_script .= '</script>';
502
+
503
+ echo $localize_script;
504
+
505
+ if ( self::is_global_admin() ) {
506
+
507
+ // Styles.
508
+ wp_enqueue_style( 'cartflows-global-admin', CARTFLOWS_URL . 'admin/assets/css/global-admin.css', array(), CARTFLOWS_VER );
509
+ wp_style_add_data( 'cartflows-global-admin', 'rtl', 'replace' );
510
+
511
+ wp_enqueue_script(
512
+ 'wcf-global-admin',
513
+ CARTFLOWS_URL . 'admin/assets/js/global-admin.js',
514
+ array( 'jquery' ),
515
+ CARTFLOWS_VER,
516
+ true
517
+ );
518
+
519
+ do_action( 'cartflows_global_admin_scripts' );
520
+ }
521
+ }
522
+
523
+ /**
524
+ * Global Admin Data.
525
+ *
526
+ * @since 1.0.0
527
+ */
528
+ public static function global_admin_data() {
529
+
530
+ $current_screen = get_current_screen();
531
+
532
+ if ( ! $current_screen ) {
533
+ return;
534
+ }
535
+
536
+ if ( 'edit-' . CARTFLOWS_FLOW_POST_TYPE != $current_screen->id ) {
537
+ return;
538
+ }
539
+
540
+ $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
541
+ ?>
542
+
543
+ <div id="wcf-remote-flow-importer" class="wcf-templates-popup-overlay">
544
+ <div class="wcf-templates-popup-content">
545
+ <div class="spinner"></div>
546
+ <div class="wcf-templates-wrap wcf-templates-wrap-flows">
547
+
548
+ <div id="wcf-remote-flow-actions" class="wcf-template-header">
549
+ <div class="wcf-template-logo-wrap">
550
+ <span class="wcf-cartflows-logo-img">
551
+ <span class="cartflows-logo-icon"></span>
552
+ </span>
553
+ <span class="wcf-cartflows-title"><?php esc_html_e( 'Flows Library', 'cartflows' ); ?></span>
554
+ </div>
555
+ <div class="wcf-tab-wrapper">
556
+ <?php if ( 'other' !== $default_page_builder ) { ?>
557
+ <div id="wcf-get-started-steps">
558
+ <ul class="filter-links ">
559
+ <li>
560
+ <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>
561
+ </li>
562
+ <li>
563
+ <a href="#" data-slug="canvas" data-title="<?php esc_html_e( 'Create Your Own', 'cartflows' ); ?>"><?php esc_html_e( 'Create Your Own', 'cartflows' ); ?></a>
564
+ </li>
565
+ </ul>
566
+ </div>
567
+ <?php } ?>
568
+ </div>
569
+ <div class="wcf-popup-close-wrap">
570
+ <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
571
+ </div>
572
+ </div>
573
+ <!-- <div class="wcf-search-form">
574
+ <label class="screen-reader-text" for="wp-filter-search-input"><?php esc_html_e( 'Search Sites', 'cartflows' ); ?> </label>
575
+ <input placeholder="<?php esc_html_e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
576
+ </div> -->
577
+
578
+ <div id="wcf-remote-content">
579
+ <?php if ( 'other' !== $default_page_builder ) { ?>
580
+ <div id="wcf-ready-templates">
581
+ <div id="wcf-remote-filters">
582
+ <div id="wcf-page-builders"></div>
583
+ <div id="wcf-categories"></div>
584
+ </div>
585
+ <div class="wcf-page-builder-notice"></div>
586
+ <div id="wcf-remote-flow-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
587
+ <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
588
+ </div>
589
+ <?php } ?>
590
+ <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
591
+ <div class="inner">
592
+ <a href="#" class="button button-hero button-primary cartflows-flow-import-blank"><?php esc_html_e( 'Design Your Flow', 'cartflows' ); ?></a>
593
+ <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>
594
+ </div>
595
+ </div>
596
+ </div>
597
+ </div>
598
+ </div>
599
+ </div>
600
+
601
+ <?php
602
+ }
603
+
604
+ /**
605
+ * Enqueues the needed CSS/JS for the builder's admin settings page.
606
+ *
607
+ * @since 1.0.0
608
+ */
609
+ public static function styles_scripts() {
610
+
611
+ // Styles.
612
+ wp_enqueue_style( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/css/admin-menu-settings.css', array(), CARTFLOWS_VER );
613
+ wp_style_add_data( 'cartflows-admin-settings', 'rtl', 'replace' );
614
+
615
+ // Script.
616
+ wp_enqueue_script( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/js/admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), CARTFLOWS_VER, false );
617
+
618
+ $localize = array(
619
+ 'ajax_nonce' => wp_create_nonce( 'cartflows-widget-nonce' ),
620
+ );
621
+
622
+ wp_localize_script( 'cartflows-admin-settings', 'cartflows', apply_filters( 'cartflows_js_localize', $localize ) );
623
+
624
+ do_action( 'cartflows_admin_settings_after_enqueue_scripts' );
625
+ }
626
+
627
+ /**
628
+ * Save All admin settings here
629
+ */
630
+ public static function save_settings() {
631
+
632
+ // Only admins can save settings.
633
+ if ( ! current_user_can( 'manage_options' ) ) {
634
+ return;
635
+ }
636
+
637
+ self::save_common_settings();
638
+ self::save_debug_settings();
639
+ self::save_permalink_settings();
640
+
641
+ self::save_google_analytics_settings();
642
+ self::save_facebook_settings();
643
+
644
+ // Let extensions hook into saving.
645
+ do_action( 'cartflows_admin_settings_save' );
646
+ }
647
+
648
+ /**
649
+ * Get and return page URL
650
+ *
651
+ * @param string $menu_slug Menu name.
652
+ * @since 1.0.0
653
+ * @return string page url
654
+ */
655
+ public static function get_page_url( $menu_slug ) {
656
+
657
+ $parent_page = self::$default_menu_position;
658
+
659
+ if ( strpos( $parent_page, '?' ) !== false ) {
660
+ $query_var = '&page=' . self::$plugin_slug;
661
+ } else {
662
+ $query_var = '?page=' . self::$plugin_slug;
663
+ }
664
+
665
+ $parent_page_url = admin_url( $parent_page . $query_var );
666
+
667
+ $url = $parent_page_url . '&action=' . $menu_slug;
668
+
669
+ return esc_url( $url );
670
+ }
671
+
672
+ /**
673
+ * Admin body classes.
674
+ *
675
+ * Body classes to be added to <body> tag in admin page
676
+ *
677
+ * @param String $classes body classes returned from the filter.
678
+ * @return String body classes to be added to <body> tag in admin page
679
+ */
680
+ public static function add_admin_body_class( $classes ) {
681
+
682
+ $classes .= ' cartflows-' . CARTFLOWS_VER;
683
+
684
+ return $classes;
685
+ }
686
+
687
+ /**
688
+ * Save Global Setting options.
689
+ *
690
+ * @since 1.0.0
691
+ */
692
+ public static function save_facebook_settings() {
693
+
694
+ if ( isset( $_POST['cartflows-facebook-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-facebook-settings-nonce'] ) ), 'cartflows-facebook-settings' ) ) {
695
+
696
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
697
+ $new_settings = array();
698
+
699
+ if ( isset( $_POST['_cartflows_facebook'] ) ) {
700
+ $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_facebook'] ) ); //phpcs:ignore
701
+ }
702
+
703
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_facebook', $new_settings, false );
704
+ $query = array(
705
+ 'message' => 'saved',
706
+ );
707
+ $redirect_to = add_query_arg( $query, $url );
708
+ wp_safe_redirect( $redirect_to );
709
+ exit;
710
+ }
711
+ }
712
+
713
+ /**
714
+ * Show embed header.
715
+ *
716
+ * @since 1.0.0
717
+ */
718
+ public static function show_embed_header() {
719
+
720
+ $current_screen = get_current_screen();
721
+
722
+ if (
723
+ is_object( $current_screen ) &&
724
+ isset( $current_screen->post_type ) &&
725
+ ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ) &&
726
+ isset( $current_screen->base ) &&
727
+ ( 'post' === $current_screen->base || 'edit' === $current_screen->base )
728
+ ) {
729
+ return true;
730
+ }
731
+
732
+ return false;
733
+ }
734
+ /**
735
+ * Set up a div for the header embed to render into.
736
+ * The initial contents here are meant as a place loader for when the PHP page initialy loads.
737
+ */
738
+ public static function embed_page_header() {
739
+
740
+ if ( ! is_admin() || ! self::show_embed_header() ) {
741
+ return;
742
+ }
743
+
744
+ wp_enqueue_style( 'cartflows-admin-embed-header', CARTFLOWS_URL . 'admin/assets/css/admin-embed-header.css', array(), CARTFLOWS_VER );
745
+
746
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-admin-header.php';
747
+ }
748
+ }
749
+
750
+ Cartflows_Admin::init();
classes/class-cartflows-cloning.php CHANGED
@@ -1,469 +1,469 @@
1
- <?php
2
- /**
3
- * Cloning.
4
- *
5
- * @package cartflows-pro
6
- */
7
-
8
- /**
9
- * Initialization
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Cloning {
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_row_actions', array( $this, 'clone_link' ), 99, 2 );
39
- add_action( 'admin_action_cartflows_clone_flow', array( $this, 'clone_flow' ) );
40
- add_action( 'wp_ajax_cartflows_clone_flow_step', array( $this, 'clone_step' ) );
41
- }
42
-
43
- /**
44
- * Clone flow with steps and its meta.
45
- */
46
- public function clone_flow() {
47
-
48
- global $wpdb;
49
-
50
- if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && 'cartflows_clone_flow' === $_REQUEST['action'] ) ) ) {
51
- wp_die( 'No post to duplicate has been supplied!' );
52
- }
53
-
54
- /*
55
- * Nonce verification
56
- */
57
- if ( ! isset( $_GET['flow_clone_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['flow_clone_nonce'] ) ), basename( __FILE__ ) ) ) {
58
- return;
59
- }
60
-
61
- /**
62
- * Get the original post id
63
- */
64
- $post_id = ( isset( $_GET['post'] ) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );
65
-
66
- /**
67
- * And all the original post data then
68
- */
69
- $post = get_post( $post_id );
70
-
71
- /**
72
- * Assign current user to be the new post author
73
- */
74
- $current_user = wp_get_current_user();
75
- $new_post_author = $current_user->ID;
76
-
77
- /**
78
- * If post data exists, create the post duplicate
79
- */
80
- if ( isset( $post ) && null !== $post ) {
81
-
82
- /**
83
- * New post data array
84
- */
85
-
86
- $args = array(
87
- 'comment_status' => $post->comment_status,
88
- 'ping_status' => $post->ping_status,
89
- 'post_author' => $new_post_author,
90
- 'post_content' => $post->post_content,
91
- 'post_excerpt' => $post->post_excerpt,
92
- 'post_name' => $post->post_name,
93
- 'post_parent' => $post->post_parent,
94
- 'post_password' => $post->post_password,
95
- 'post_status' => $post->post_status,
96
- 'post_title' => $post->post_title . ' Clone',
97
- 'post_type' => $post->post_type,
98
- 'to_ping' => $post->to_ping,
99
- 'menu_order' => $post->menu_order,
100
- );
101
-
102
- /**
103
- * Insert the post
104
- */
105
- $new_flow_id = wp_insert_post( $args );
106
-
107
- /**
108
- * Get all current post terms ad set them to the new post
109
- */
110
- // returns array of taxonomy names for post type, ex array("category", "post_tag");.
111
- $taxonomies = get_object_taxonomies( $post->post_type );
112
-
113
- foreach ( $taxonomies as $taxonomy ) {
114
-
115
- $post_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'slugs' ) );
116
-
117
- wp_set_object_terms( $new_flow_id, $post_terms, $taxonomy, false );
118
- }
119
-
120
- /**
121
- * Duplicate all post meta just in two SQL queries
122
- */
123
- // @codingStandardsIgnoreStart
124
- $post_meta_infos = $wpdb->get_results(
125
- "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id"
126
- );
127
- // @codingStandardsIgnoreEnd
128
-
129
- if ( ! empty( $post_meta_infos ) ) {
130
-
131
- $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) VALUES ";
132
-
133
- $sql_query_sel = array();
134
-
135
- foreach ( $post_meta_infos as $meta_info ) {
136
-
137
- $meta_key = $meta_info->meta_key;
138
-
139
- if ( '_wp_old_slug' === $meta_key ) {
140
- continue;
141
- }
142
-
143
- $meta_value = addslashes( $meta_info->meta_value );
144
-
145
- $sql_query_sel[] = "($new_flow_id, '$meta_key', '$meta_value')";
146
- }
147
-
148
- $sql_query .= implode( ',', $sql_query_sel );
149
-
150
- // @codingStandardsIgnoreStart
151
- $wpdb->query( $sql_query );
152
- // @codingStandardsIgnoreEnd
153
- }
154
-
155
- /* Steps Cloning */
156
- $flow_steps = get_post_meta( $post_id, 'wcf-steps', true );
157
- $new_flow_steps = array();
158
-
159
- /* Set Steps Empty */
160
- update_post_meta( $new_flow_id, 'wcf-steps', $new_flow_steps );
161
-
162
- if ( is_array( $flow_steps ) && ! empty( $flow_steps ) ) {
163
-
164
- foreach ( $flow_steps as $index => $step_data ) {
165
-
166
- $step_id = $step_data['id'];
167
- $step_type = get_post_meta( $step_id, 'wcf-step-type', true );
168
-
169
- $step_object = get_post( $step_id );
170
-
171
- /**
172
- * New step post data array
173
- */
174
- $step_args = array(
175
- 'comment_status' => $step_object->comment_status,
176
- 'ping_status' => $step_object->ping_status,
177
- 'post_author' => $new_post_author,
178
- 'post_content' => $step_object->post_content,
179
- 'post_excerpt' => $step_object->post_excerpt,
180
- 'post_name' => $step_object->post_name,
181
- 'post_parent' => $step_object->post_parent,
182
- 'post_password' => $step_object->post_password,
183
- 'post_status' => $step_object->post_status,
184
- 'post_title' => $step_object->post_title,
185
- 'post_type' => $step_object->post_type,
186
- 'to_ping' => $step_object->to_ping,
187
- 'menu_order' => $step_object->menu_order,
188
- );
189
-
190
- /**
191
- * Insert the post
192
- */
193
- $new_step_id = wp_insert_post( $step_args );
194
-
195
- /**
196
- * Duplicate all step meta
197
- */
198
- // @codingStandardsIgnoreStart
199
- $post_meta_infos = $wpdb->get_results(
200
- "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$step_id"
201
- );
202
- // @codingStandardsIgnoreEnd
203
-
204
- if ( ! empty( $post_meta_infos ) ) {
205
-
206
- $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) VALUES ";
207
-
208
- $sql_query_sel = array();
209
-
210
- foreach ( $post_meta_infos as $meta_info ) {
211
-
212
- $meta_key = $meta_info->meta_key;
213
-
214
- if ( '_wp_old_slug' === $meta_key ) {
215
- continue;
216
- }
217
-
218
- $meta_value = addslashes( $meta_info->meta_value );
219
-
220
- $sql_query_sel[] = "($new_step_id, '$meta_key', '$meta_value')";
221
- }
222
-
223
- $sql_query .= implode( ',', $sql_query_sel );
224
-
225
- // @codingStandardsIgnoreStart
226
- $wpdb->query( $sql_query );
227
- // @codingStandardsIgnoreEnd
228
- }
229
-
230
- // insert post meta.
231
- update_post_meta( $new_step_id, 'wcf-flow-id', $new_flow_id );
232
- update_post_meta( $new_step_id, 'wcf-step-type', $step_type );
233
-
234
- wp_set_object_terms( $new_step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
235
- wp_set_object_terms( $new_step_id, 'flow-' . $new_flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
236
-
237
- /* Add New Flow Steps */
238
- $new_flow_steps[] = array(
239
- 'id' => $new_step_id,
240
- 'title' => $step_object->post_title,
241
- 'type' => $step_type,
242
- );
243
- }
244
- }
245
-
246
- /* Update New Flow Step Post Meta */
247
- update_post_meta( $new_flow_id, 'wcf-steps', $new_flow_steps );
248
-
249
- /* Clear Page Builder Cache */
250
- $this->clear_cache();
251
-
252
- /**
253
- * Redirect to the new flow edit screen
254
- */
255
- wp_safe_redirect( admin_url( 'post.php?action=edit&post=' . $new_flow_id ) );
256
- exit;
257
- } else {
258
- wp_die( 'Post creation failed, could not find original post: ' . $post_id );
259
- }
260
- }
261
-
262
- /**
263
- * Clone step with its meta.
264
- */
265
- public function clone_step() {
266
-
267
- global $wpdb;
268
-
269
- if ( ! current_user_can( 'manage_options' ) ) {
270
- return;
271
- }
272
-
273
- check_ajax_referer( 'wcf-clone-flow-step', 'security' );
274
-
275
- if ( isset( $_POST['post_id'] ) && isset( $_POST['step_id'] ) ) {
276
- $flow_id = intval( $_POST['post_id'] );
277
- $step_id = intval( $_POST['step_id'] );
278
- }
279
-
280
- $result = array(
281
- 'status' => false,
282
- 'reload' => true,
283
- /* translators: %s flow id */
284
- 'text' => sprintf( __( 'Can\'t clone this step - %1$s. Flow - %2$s', 'cartflows' ), $step_id, $flow_id ),
285
- );
286
-
287
- if ( ! $flow_id || ! $step_id ) {
288
- wp_send_json( $result );
289
- }
290
-
291
- /**
292
- * And all the original post data then
293
- */
294
- $post = get_post( $step_id );
295
-
296
- /**
297
- * Assign current user to be the new post author
298
- */
299
- $current_user = wp_get_current_user();
300
- $new_post_author = $current_user->ID;
301
-
302
- /**
303
- * If post data exists, create the post duplicate
304
- */
305
- if ( isset( $post ) && null !== $post ) {
306
-
307
- /**
308
- * New post data array
309
- */
310
- $args = array(
311
- 'comment_status' => $post->comment_status,
312
- 'ping_status' => $post->ping_status,
313
- 'post_author' => $new_post_author,
314
- 'post_content' => $post->post_content,
315
- 'post_excerpt' => $post->post_excerpt,
316
- 'post_name' => $post->post_name,
317
- 'post_parent' => $post->post_parent,
318
- 'post_password' => $post->post_password,
319
- 'post_status' => $post->post_status,
320
- 'post_title' => $post->post_title . ' Clone',
321
- 'post_type' => $post->post_type,
322
- 'to_ping' => $post->to_ping,
323
- 'menu_order' => $post->menu_order,
324
- );
325
-
326
- /**
327
- * Insert the post
328
- */
329
- $new_step_id = wp_insert_post( $args );
330
-
331
- /**
332
- * Get all current post terms ad set them to the new post
333
- */
334
- // returns array of taxonomy names for post type, ex array("category", "post_tag");.
335
- $taxonomies = get_object_taxonomies( $post->post_type );
336
-
337
- foreach ( $taxonomies as $taxonomy ) {
338
-
339
- $post_terms = wp_get_object_terms( $step_id, $taxonomy, array( 'fields' => 'slugs' ) );
340
-
341
- wp_set_object_terms( $new_step_id, $post_terms, $taxonomy, false );
342
- }
343
-
344
- /**
345
- * Duplicate all post meta just in two SQL queries
346
- */
347
- // @codingStandardsIgnoreStart
348
- $post_meta_infos = $wpdb->get_results(
349
- "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$step_id"
350
- );
351
- // @codingStandardsIgnoreEnd
352
-
353
- if ( ! empty( $post_meta_infos ) ) {
354
-
355
- $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) VALUES ";
356
-
357
- $sql_query_sel = array();
358
-
359
- foreach ( $post_meta_infos as $meta_info ) {
360
-
361
- $meta_key = $meta_info->meta_key;
362
-
363
- if ( '_wp_old_slug' === $meta_key ) {
364
- continue;
365
- }
366
-
367
- $meta_value = addslashes( $meta_info->meta_value );
368
-
369
- $sql_query_sel[] = "($new_step_id, '$meta_key', '$meta_value')";
370
- }
371
-
372
- $sql_query .= implode( ',', $sql_query_sel );
373
-
374
- // @codingStandardsIgnoreStart
375
- $wpdb->query( $sql_query );
376
- // @codingStandardsIgnoreEnd
377
- }
378
-
379
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
380
- $step_type = get_post_meta( $step_id, 'wcf-step-type', true );
381
-
382
- if ( ! is_array( $flow_steps ) ) {
383
- $flow_steps = array();
384
- }
385
-
386
- $flow_steps[] = array(
387
- 'id' => $new_step_id,
388
- 'title' => $post->post_title,
389
- 'type' => $step_type,
390
- );
391
-
392
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
393
-
394
- /* Clear Page Builder Cache */
395
- $this->clear_cache();
396
-
397
- $result = array(
398
- 'status' => true,
399
- 'reload' => true,
400
- /* translators: %s flow id */
401
- 'text' => sprintf( __( 'Step - %1$s cloned. Flow - %2$s', 'cartflows' ), $step_id, $flow_id ),
402
- );
403
- }
404
-
405
- wp_send_json( $result );
406
- }
407
-
408
- /**
409
- * Add the clone link to action list for flows row actions
410
- *
411
- * @param array $actions Actions array.
412
- * @param object $post Post object.
413
- *
414
- * @return array
415
- */
416
- public function clone_link( $actions, $post ) {
417
-
418
- if ( current_user_can( 'edit_posts' ) && isset( $post ) && CARTFLOWS_FLOW_POST_TYPE === $post->post_type ) {
419
-
420
- if ( isset( $actions['duplicate'] ) ) { // Duplicate page plugin remove.
421
- unset( $actions['duplicate'] );
422
- }
423
- if ( isset( $actions['edit_as_new_draft'] ) ) { // Duplicate post plugin remove.
424
- unset( $actions['edit_as_new_draft'] );
425
- }
426
-
427
- $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>';
428
-
429
- if ( ! _is_cartflows_pro() ) {
430
-
431
- $flow_posts = get_posts(
432
- array(
433
- 'posts_per_page' => 4,
434
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
435
- 'post_status' => array( 'publish', 'pending', 'draft', 'future', 'private' ),
436
- )
437
- );
438
-
439
- if ( is_array( $flow_posts ) ) {
440
-
441
- $flow_count = count( $flow_posts );
442
-
443
- if ( $flow_count > 3 || 3 === $flow_count ) {
444
- unset( $actions['clone'] );
445
- }
446
- }
447
- }
448
- }
449
-
450
- return $actions;
451
- }
452
-
453
- /**
454
- * Clear Page Builder Cache
455
- */
456
- public function clear_cache() {
457
-
458
- // Clear 'Elementor' file cache.
459
- if ( class_exists( '\Elementor\Plugin' ) ) {
460
- Elementor\Plugin::$instance->files_manager->clear_cache();
461
- }
462
- }
463
-
464
- }
465
-
466
- /**
467
- * Kicking this off by calling 'get_instance()' method
468
- */
469
- Cartflows_Cloning::get_instance();
1
+ <?php
2
+ /**
3
+ * Cloning.
4
+ *
5
+ * @package cartflows-pro
6
+ */
7
+
8
+ /**
9
+ * Initialization
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Cloning {
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_row_actions', array( $this, 'clone_link' ), 99, 2 );
39
+ add_action( 'admin_action_cartflows_clone_flow', array( $this, 'clone_flow' ) );
40
+ add_action( 'wp_ajax_cartflows_clone_flow_step', array( $this, 'clone_step' ) );
41
+ }
42
+
43
+ /**
44
+ * Clone flow with steps and its meta.
45
+ */
46
+ public function clone_flow() {
47
+
48
+ global $wpdb;
49
+
50
+ if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && 'cartflows_clone_flow' === $_REQUEST['action'] ) ) ) {
51
+ wp_die( 'No post to duplicate has been supplied!' );
52
+ }
53
+
54
+ /*
55
+ * Nonce verification
56
+ */
57
+ if ( ! isset( $_GET['flow_clone_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['flow_clone_nonce'] ) ), basename( __FILE__ ) ) ) {
58
+ return;
59
+ }
60
+
61
+ /**
62
+ * Get the original post id
63
+ */
64
+ $post_id = ( isset( $_GET['post'] ) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );
65
+
66
+ /**
67
+ * And all the original post data then
68
+ */
69
+ $post = get_post( $post_id );
70
+
71
+ /**
72
+ * Assign current user to be the new post author
73
+ */
74
+ $current_user = wp_get_current_user();
75
+ $new_post_author = $current_user->ID;
76
+
77
+ /**
78
+ * If post data exists, create the post duplicate
79
+ */
80
+ if ( isset( $post ) && null !== $post ) {
81
+
82
+ /**
83
+ * New post data array
84
+ */
85
+
86
+ $args = array(
87
+ 'comment_status' => $post->comment_status,
88
+ 'ping_status' => $post->ping_status,
89
+ 'post_author' => $new_post_author,
90
+ 'post_content' => $post->post_content,
91
+ 'post_excerpt' => $post->post_excerpt,
92
+ 'post_name' => $post->post_name,
93
+ 'post_parent' => $post->post_parent,
94
+ 'post_password' => $post->post_password,
95
+ 'post_status' => $post->post_status,
96
+ 'post_title' => $post->post_title . ' Clone',
97
+ 'post_type' => $post->post_type,
98
+ 'to_ping' => $post->to_ping,
99
+ 'menu_order' => $post->menu_order,
100
+ );
101
+
102
+ /**
103
+ * Insert the post
104
+ */
105
+ $new_flow_id = wp_insert_post( $args );
106
+
107
+ /**
108
+ * Get all current post terms ad set them to the new post
109
+ */
110
+ // returns array of taxonomy names for post type, ex array("category", "post_tag");.
111
+ $taxonomies = get_object_taxonomies( $post->post_type );
112
+
113
+ foreach ( $taxonomies as $taxonomy ) {
114
+
115
+ $post_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'slugs' ) );
116
+
117
+ wp_set_object_terms( $new_flow_id, $post_terms, $taxonomy, false );
118
+ }
119
+
120
+ /**
121
+ * Duplicate all post meta just in two SQL queries
122
+ */
123
+ // @codingStandardsIgnoreStart
124
+ $post_meta_infos = $wpdb->get_results(
125
+ "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id"
126
+ );
127
+ // @codingStandardsIgnoreEnd
128
+
129
+ if ( ! empty( $post_meta_infos ) ) {
130
+
131
+ $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) VALUES ";
132
+
133
+ $sql_query_sel = array();
134
+
135
+ foreach ( $post_meta_infos as $meta_info ) {
136
+
137
+ $meta_key = $meta_info->meta_key;
138
+
139
+ if ( '_wp_old_slug' === $meta_key ) {
140
+ continue;
141
+ }
142
+
143
+ $meta_value = addslashes( $meta_info->meta_value );
144
+
145
+ $sql_query_sel[] = "($new_flow_id, '$meta_key', '$meta_value')";
146
+ }
147
+
148
+ $sql_query .= implode( ',', $sql_query_sel );
149
+
150
+ // @codingStandardsIgnoreStart
151
+ $wpdb->query( $sql_query );
152
+ // @codingStandardsIgnoreEnd
153
+ }
154
+
155
+ /* Steps Cloning */
156
+ $flow_steps = get_post_meta( $post_id, 'wcf-steps', true );
157
+ $new_flow_steps = array();
158
+
159
+ /* Set Steps Empty */
160
+ update_post_meta( $new_flow_id, 'wcf-steps', $new_flow_steps );
161
+
162
+ if ( is_array( $flow_steps ) && ! empty( $flow_steps ) ) {
163
+
164
+ foreach ( $flow_steps as $index => $step_data ) {
165
+
166
+ $step_id = $step_data['id'];
167
+ $step_type = get_post_meta( $step_id, 'wcf-step-type', true );
168
+
169
+ $step_object = get_post( $step_id );
170
+
171
+ /**
172
+ * New step post data array
173
+ */
174
+ $step_args = array(
175
+ 'comment_status' => $step_object->comment_status,
176
+ 'ping_status' => $step_object->ping_status,
177
+ 'post_author' => $new_post_author,
178
+ 'post_content' => $step_object->post_content,
179
+ 'post_excerpt' => $step_object->post_excerpt,
180
+ 'post_name' => $step_object->post_name,
181
+ 'post_parent' => $step_object->post_parent,
182
+ 'post_password' => $step_object->post_password,
183
+ 'post_status' => $step_object->post_status,
184
+ 'post_title' => $step_object->post_title,
185
+ 'post_type' => $step_object->post_type,
186
+ 'to_ping' => $step_object->to_ping,
187
+ 'menu_order' => $step_object->menu_order,
188
+ );
189
+
190
+ /**
191
+ * Insert the post
192
+ */
193
+ $new_step_id = wp_insert_post( $step_args );
194
+
195
+ /**
196
+ * Duplicate all step meta
197
+ */
198
+ // @codingStandardsIgnoreStart
199
+ $post_meta_infos = $wpdb->get_results(
200
+ "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$step_id"
201
+ );
202
+ // @codingStandardsIgnoreEnd
203
+
204
+ if ( ! empty( $post_meta_infos ) ) {
205
+
206
+ $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) VALUES ";
207
+
208
+ $sql_query_sel = array();
209
+
210
+ foreach ( $post_meta_infos as $meta_info ) {
211
+
212
+ $meta_key = $meta_info->meta_key;
213
+
214
+ if ( '_wp_old_slug' === $meta_key ) {
215
+ continue;
216
+ }
217
+
218
+ $meta_value = addslashes( $meta_info->meta_value );
219
+
220
+ $sql_query_sel[] = "($new_step_id, '$meta_key', '$meta_value')";
221
+ }
222
+
223
+ $sql_query .= implode( ',', $sql_query_sel );
224
+
225
+ // @codingStandardsIgnoreStart
226
+ $wpdb->query( $sql_query );
227
+ // @codingStandardsIgnoreEnd
228
+ }
229
+
230
+ // insert post meta.
231
+ update_post_meta( $new_step_id, 'wcf-flow-id', $new_flow_id );
232
+ update_post_meta( $new_step_id, 'wcf-step-type', $step_type );
233
+
234
+ wp_set_object_terms( $new_step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
235
+ wp_set_object_terms( $new_step_id, 'flow-' . $new_flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
236
+
237
+ /* Add New Flow Steps */
238
+ $new_flow_steps[] = array(
239
+ 'id' => $new_step_id,
240
+ 'title' => $step_object->post_title,
241
+ 'type' => $step_type,
242
+ );
243
+ }
244
+ }
245
+
246
+ /* Update New Flow Step Post Meta */
247
+ update_post_meta( $new_flow_id, 'wcf-steps', $new_flow_steps );
248
+
249
+ /* Clear Page Builder Cache */
250
+ $this->clear_cache();
251
+
252
+ /**
253
+ * Redirect to the new flow edit screen
254
+ */
255
+ wp_safe_redirect( admin_url( 'post.php?action=edit&post=' . $new_flow_id ) );
256
+ exit;
257
+ } else {
258
+ wp_die( 'Post creation failed, could not find original post: ' . $post_id );
259
+ }
260
+ }
261
+
262
+ /**
263
+ * Clone step with its meta.
264
+ */
265
+ public function clone_step() {
266
+
267
+ global $wpdb;
268
+
269
+ if ( ! current_user_can( 'manage_options' ) ) {
270
+ return;
271
+ }
272
+
273
+ check_ajax_referer( 'wcf-clone-flow-step', 'security' );
274
+
275
+ if ( isset( $_POST['post_id'] ) && isset( $_POST['step_id'] ) ) {
276
+ $flow_id = intval( $_POST['post_id'] );
277
+ $step_id = intval( $_POST['step_id'] );
278
+ }
279
+
280
+ $result = array(
281
+ 'status' => false,
282
+ 'reload' => true,
283
+ /* translators: %s flow id */
284
+ 'text' => sprintf( __( 'Can\'t clone this step - %1$s. Flow - %2$s', 'cartflows' ), $step_id, $flow_id ),
285
+ );
286
+
287
+ if ( ! $flow_id || ! $step_id ) {
288
+ wp_send_json( $result );
289
+ }
290
+
291
+ /**
292
+ * And all the original post data then
293
+ */
294
+ $post = get_post( $step_id );
295
+
296
+ /**
297
+ * Assign current user to be the new post author
298
+ */
299
+ $current_user = wp_get_current_user();
300
+ $new_post_author = $current_user->ID;
301
+
302
+ /**
303
+ * If post data exists, create the post duplicate
304
+ */
305
+ if ( isset( $post ) && null !== $post ) {
306
+
307
+ /**
308
+ * New post data array
309
+ */
310
+ $args = array(
311
+ 'comment_status' => $post->comment_status,
312
+ 'ping_status' => $post->ping_status,
313
+ 'post_author' => $new_post_author,
314
+ 'post_content' => $post->post_content,
315
+ 'post_excerpt' => $post->post_excerpt,
316
+ 'post_name' => $post->post_name,
317
+ 'post_parent' => $post->post_parent,
318
+ 'post_password' => $post->post_password,
319
+ 'post_status' => $post->post_status,
320
+ 'post_title' => $post->post_title . ' Clone',
321
+ 'post_type' => $post->post_type,
322
+ 'to_ping' => $post->to_ping,
323
+ 'menu_order' => $post->menu_order,
324
+ );
325
+
326
+ /**
327
+ * Insert the post
328
+ */
329
+ $new_step_id = wp_insert_post( $args );
330
+
331
+ /**
332
+ * Get all current post terms ad set them to the new post
333
+ */
334
+ // returns array of taxonomy names for post type, ex array("category", "post_tag");.
335
+ $taxonomies = get_object_taxonomies( $post->post_type );
336
+
337
+ foreach ( $taxonomies as $taxonomy ) {
338
+
339
+ $post_terms = wp_get_object_terms( $step_id, $taxonomy, array( 'fields' => 'slugs' ) );
340
+
341
+ wp_set_object_terms( $new_step_id, $post_terms, $taxonomy, false );
342
+ }
343
+
344
+ /**
345
+ * Duplicate all post meta just in two SQL queries
346
+ */
347
+ // @codingStandardsIgnoreStart
348
+ $post_meta_infos = $wpdb->get_results(
349
+ "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$step_id"
350
+ );
351
+ // @codingStandardsIgnoreEnd
352
+
353
+ if ( ! empty( $post_meta_infos ) ) {
354
+
355
+ $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) VALUES ";
356
+
357
+ $sql_query_sel = array();
358
+
359
+ foreach ( $post_meta_infos as $meta_info ) {
360
+
361
+ $meta_key = $meta_info->meta_key;
362
+
363
+ if ( '_wp_old_slug' === $meta_key ) {
364
+ continue;
365
+ }
366
+
367
+ $meta_value = addslashes( $meta_info->meta_value );
368
+
369
+ $sql_query_sel[] = "($new_step_id, '$meta_key', '$meta_value')";
370
+ }
371
+
372
+ $sql_query .= implode( ',', $sql_query_sel );
373
+
374
+ // @codingStandardsIgnoreStart
375
+ $wpdb->query( $sql_query );
376
+ // @codingStandardsIgnoreEnd
377
+ }
378
+
379
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
380
+ $step_type = get_post_meta( $step_id, 'wcf-step-type', true );
381
+
382
+ if ( ! is_array( $flow_steps ) ) {
383
+ $flow_steps = array();
384
+ }
385
+
386
+ $flow_steps[] = array(
387
+ 'id' => $new_step_id,
388
+ 'title' => $post->post_title,
389
+ 'type' => $step_type,
390
+ );
391
+
392
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
393
+
394
+ /* Clear Page Builder Cache */
395
+ $this->clear_cache();
396
+
397
+ $result = array(
398
+ 'status' => true,
399
+ 'reload' => true,
400
+ /* translators: %s flow id */
401
+ 'text' => sprintf( __( 'Step - %1$s cloned. Flow - %2$s', 'cartflows' ), $step_id, $flow_id ),
402
+ );
403
+ }
404
+
405
+ wp_send_json( $result );
406
+ }
407
+
408
+ /**
409
+ * Add the clone link to action list for flows row actions
410
+ *
411
+ * @param array $actions Actions array.
412
+ * @param object $post Post object.
413
+ *
414
+ * @return array
415
+ */
416
+ public function clone_link( $actions, $post ) {
417
+
418
+ if ( current_user_can( 'edit_posts' ) && isset( $post ) && CARTFLOWS_FLOW_POST_TYPE === $post->post_type ) {
419
+
420
+ if ( isset( $actions['duplicate'] ) ) { // Duplicate page plugin remove.
421
+ unset( $actions['duplicate'] );
422
+ }
423
+ if ( isset( $actions['edit_as_new_draft'] ) ) { // Duplicate post plugin remove.
424
+ unset( $actions['edit_as_new_draft'] );
425
+ }
426
+
427
+ $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>';
428
+
429
+ if ( ! _is_cartflows_pro() ) {
430
+
431
+ $flow_posts = get_posts(
432
+ array(
433
+ 'posts_per_page' => 4,
434
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
435
+ 'post_status' => array( 'publish', 'pending', 'draft', 'future', 'private' ),
436
+ )
437
+ );
438
+
439
+ if ( is_array( $flow_posts ) ) {
440
+
441
+ $flow_count = count( $flow_posts );
442
+
443
+ if ( $flow_count > 3 || 3 === $flow_count ) {
444
+ unset( $actions['clone'] );
445
+ }
446
+ }
447
+ }
448
+ }
449
+
450
+ return $actions;
451
+ }
452
+
453
+ /**
454
+ * Clear Page Builder Cache
455
+ */
456
+ public function clear_cache() {
457
+
458
+ // Clear 'Elementor' file cache.
459
+ if ( class_exists( '\Elementor\Plugin' ) ) {
460
+ Elementor\Plugin::$instance->files_manager->clear_cache();
461
+ }
462
+ }
463
+
464
+ }
465
+
466
+ /**
467
+ * Kicking this off by calling 'get_instance()' method
468
+ */
469
+ Cartflows_Cloning::get_instance();
classes/class-cartflows-flow-frontend.php CHANGED
@@ -1,214 +1,214 @@
1
- <?php
2
- /**
3
- * Frontend & Markup
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Flow Markup
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Flow_Frontend {
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
- /* Analytics */
39
- add_action( 'cartflows_wp_footer', array( $this, 'footer_markup' ) );
40
- }
41
-
42
- /**
43
- * Footer markup
44
- */
45
- public function footer_markup() {
46
-
47
- if ( wcf()->utils->is_step_post_type() ) {
48
- // @codingStandardsIgnoreStart
49
- $flow_id = wcf()->utils->get_flow_id();
50
- ?>
51
- <?php if( $this->is_flow_testmode( $flow_id ) ) { ?>
52
- <div class="wcf-preview-mode">
53
- <span><?php _e( 'Test mode is active — which displays random products for previewing. It can be deactivated from the flow settings in the admin dashboard.', 'cartflows' ); ?></span>
54
- <?php if ( current_user_can( 'manage_options' ) ) { ?>
55
- <?php
56
- $flow_edit_link = add_query_arg( 'edit_test_mode', 'yes', get_edit_post_link( $flow_id ) );
57
- ?>
58
- <a href="<?php echo $flow_edit_link; ?>"><?php _e( 'Click here to disable it', 'cartflows'); ?></a>
59
- <?php } ?>
60
- </div>
61
- <?php } ?>
62
- <?php
63
- // @codingStandardsIgnoreEnd
64
- }
65
- }
66
-
67
- /**
68
- * Check if flow test mode is enable.
69
- *
70
- * @since 1.0.0
71
- * @param int $flow_id flow ID.
72
- *
73
- * @return boolean
74
- */
75
- public function is_flow_testmode( $flow_id = '' ) {
76
-
77
- if ( ! $flow_id ) {
78
- $flow_id = wcf()->utils->get_flow_id();
79
- }
80
-
81
- $test_mode = wcf()->options->get_flow_meta_value( $flow_id, 'wcf-testing' );
82
-
83
- if ( 'no' === $test_mode ) {
84
- return false;
85
- }
86
-
87
- return true;
88
- }
89
-
90
- /**
91
- * Get steps data.
92
- *
93
- * @since 1.0.0
94
- * @param int $flow_id flow ID.
95
- *
96
- * @return array
97
- */
98
- public function get_steps( $flow_id ) {
99
-
100
- $steps = get_post_meta( $flow_id, 'wcf-steps', true );
101
-
102
- if ( ! is_array( $steps ) ) {
103
-
104
- $steps = array();
105
- }
106
-
107
- return $steps;
108
- }
109
-
110
- /**
111
- * Check thank you page exists.
112
- *
113
- * @since 1.0.0
114
- * @param array $order order data.
115
- *
116
- * @return bool
117
- */
118
- public function is_thankyou_page_exists( $order ) {
119
-
120
- $thankyou_step_exist = false;
121
-
122
- $flow_id = wcf()->utils->get_flow_id_from_order( $order->get_id() );
123
-
124
- if ( $flow_id ) {
125
-
126
- $step_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
127
-
128
- // Get control step and flow steps.
129
- $wcf_step_obj = wcf_get_step( $step_id );
130
- $flow_steps = $wcf_step_obj->get_flow_steps();
131
- $control_step = $wcf_step_obj->get_control_step();
132
-
133
- if ( is_array( $flow_steps ) ) {
134
-
135
- $current_step_found = false;
136
-
137
- foreach ( $flow_steps as $index => $data ) {
138
-
139
- if ( $current_step_found ) {
140
-
141
- if ( 'thankyou' === $data['type'] ) {
142
-
143
- $thankyou_step_exist = true;
144
- break;
145
- }
146
- } else {
147
-
148
- if ( intval( $data['id'] ) === $control_step ) {
149
-
150
- $current_step_found = true;
151
- }
152
- }
153
- }
154
- }
155
- }
156
-
157
- return $thankyou_step_exist;
158
- }
159
-
160
- /**
161
- * Check thank you page exists.
162
- *
163
- * @since 1.0.0
164
- * @param array $order order data.
165
- *
166
- * @return bool
167
- */
168
- public function get_thankyou_page_id( $order ) {
169
-
170
- $thankyou_step_id = false;
171
-
172
- $flow_id = wcf()->utils->get_flow_id_from_order( $order->get_id() );
173
-
174
- if ( $flow_id ) {
175
-
176
- $step_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
177
-
178
- // Get control step and flow steps.
179
- $wcf_step_obj = wcf_get_step( $step_id );
180
- $flow_steps = $wcf_step_obj->get_flow_steps();
181
- $control_step = $wcf_step_obj->get_control_step();
182
-
183
- if ( is_array( $flow_steps ) ) {
184
-
185
- $current_step_found = false;
186
-
187
- foreach ( $flow_steps as $index => $data ) {
188
-
189
- if ( $current_step_found ) {
190
-
191
- if ( 'thankyou' === $data['type'] ) {
192
-
193
- $thankyou_step_id = intval( $data['id'] );
194
- break;
195
- }
196
- } else {
197
-
198
- if ( intval( $data['id'] ) === $control_step ) {
199
-
200
- $current_step_found = true;
201
- }
202
- }
203
- }
204
- }
205
- }
206
-
207
- return $thankyou_step_id;
208
- }
209
- }
210
-
211
- /**
212
- * Kicking this off by calling 'get_instance()' method
213
- */
214
- Cartflows_Flow_Frontend::get_instance();
1
+ <?php
2
+ /**
3
+ * Frontend & Markup
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Flow Markup
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Flow_Frontend {
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
+ /* Analytics */
39
+ add_action( 'cartflows_wp_footer', array( $this, 'footer_markup' ) );
40
+ }
41
+
42
+ /**
43
+ * Footer markup
44
+ */
45
+ public function footer_markup() {
46
+
47
+ if ( wcf()->utils->is_step_post_type() ) {
48
+ // @codingStandardsIgnoreStart
49
+ $flow_id = wcf()->utils->get_flow_id();
50
+ ?>
51
+ <?php if( $this->is_flow_testmode( $flow_id ) ) { ?>
52
+ <div class="wcf-preview-mode">
53
+ <span><?php _e( 'Test mode is active — which displays random products for previewing. It can be deactivated from the flow settings in the admin dashboard.', 'cartflows' ); ?></span>
54
+ <?php if ( current_user_can( 'manage_options' ) ) { ?>
55
+ <?php
56
+ $flow_edit_link = add_query_arg( 'edit_test_mode', 'yes', get_edit_post_link( $flow_id ) );
57
+ ?>
58
+ <a href="<?php echo $flow_edit_link; ?>"><?php _e( 'Click here to disable it', 'cartflows'); ?></a>
59
+ <?php } ?>
60
+ </div>
61
+ <?php } ?>
62
+ <?php
63
+ // @codingStandardsIgnoreEnd
64
+ }
65
+ }
66
+
67
+ /**
68
+ * Check if flow test mode is enable.
69
+ *
70
+ * @since 1.0.0
71
+ * @param int $flow_id flow ID.
72
+ *
73
+ * @return boolean
74
+ */
75
+ public function is_flow_testmode( $flow_id = '' ) {
76
+
77
+ if ( ! $flow_id ) {
78
+ $flow_id = wcf()->utils->get_flow_id();
79
+ }
80
+
81
+ $test_mode = wcf()->options->get_flow_meta_value( $flow_id, 'wcf-testing' );
82
+
83
+ if ( 'no' === $test_mode ) {
84
+ return false;
85
+ }
86
+
87
+ return true;
88
+ }
89
+
90
+ /**
91
+ * Get steps data.
92
+ *
93
+ * @since 1.0.0
94
+ * @param int $flow_id flow ID.
95
+ *
96
+ * @return array
97
+ */
98
+ public function get_steps( $flow_id ) {
99
+
100
+ $steps = get_post_meta( $flow_id, 'wcf-steps', true );
101
+
102
+ if ( ! is_array( $steps ) ) {
103
+
104
+ $steps = array();
105
+ }
106
+
107
+ return $steps;
108
+ }
109
+
110
+ /**
111
+ * Check thank you page exists.
112
+ *
113
+ * @since 1.0.0
114
+ * @param array $order order data.
115
+ *
116
+ * @return bool
117
+ */
118
+ public function is_thankyou_page_exists( $order ) {
119
+
120
+ $thankyou_step_exist = false;
121
+
122
+ $flow_id = wcf()->utils->get_flow_id_from_order( $order->get_id() );
123
+
124
+ if ( $flow_id ) {
125
+
126
+ $step_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
127
+
128
+ // Get control step and flow steps.
129
+ $wcf_step_obj = wcf_get_step( $step_id );
130
+ $flow_steps = $wcf_step_obj->get_flow_steps();
131
+ $control_step = $wcf_step_obj->get_control_step();
132
+
133
+ if ( is_array( $flow_steps ) ) {
134
+
135
+ $current_step_found = false;
136
+
137
+ foreach ( $flow_steps as $index => $data ) {
138
+
139
+ if ( $current_step_found ) {
140
+
141
+ if ( 'thankyou' === $data['type'] ) {
142
+
143
+ $thankyou_step_exist = true;
144
+ break;
145
+ }
146
+ } else {
147
+
148
+ if ( intval( $data['id'] ) === $control_step ) {
149
+
150
+ $current_step_found = true;
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+
157
+ return $thankyou_step_exist;
158
+ }
159
+
160
+ /**
161
+ * Check thank you page exists.
162
+ *
163
+ * @since 1.0.0
164
+ * @param array $order order data.
165
+ *
166
+ * @return bool
167
+ */
168
+ public function get_thankyou_page_id( $order ) {
169
+
170
+ $thankyou_step_id = false;
171
+
172
+ $flow_id = wcf()->utils->get_flow_id_from_order( $order->get_id() );
173
+
174
+ if ( $flow_id ) {
175
+
176
+ $step_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
177
+
178
+ // Get control step and flow steps.
179
+ $wcf_step_obj = wcf_get_step( $step_id );
180
+ $flow_steps = $wcf_step_obj->get_flow_steps();
181
+ $control_step = $wcf_step_obj->get_control_step();
182
+
183
+ if ( is_array( $flow_steps ) ) {
184
+
185
+ $current_step_found = false;
186
+
187
+ foreach ( $flow_steps as $index => $data ) {
188
+
189
+ if ( $current_step_found ) {
190
+
191
+ if ( 'thankyou' === $data['type'] ) {
192
+
193
+ $thankyou_step_id = intval( $data['id'] );
194
+ break;
195
+ }
196
+ } else {
197
+
198
+ if ( intval( $data['id'] ) === $control_step ) {
199
+
200
+ $current_step_found = true;
201
+ }
202
+ }
203
+ }
204
+ }
205
+ }
206
+
207
+ return $thankyou_step_id;
208
+ }
209
+ }
210
+
211
+ /**
212
+ * Kicking this off by calling 'get_instance()' method
213
+ */
214
+ Cartflows_Flow_Frontend::get_instance();
classes/class-cartflows-frontend.php CHANGED
@@ -1,672 +1,682 @@
1
- <?php
2
- /**
3
- * CartFlows Frontend.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Class Cartflows_Frontend.
10
- */
11
- class Cartflows_Frontend {
12
-
13
- /**
14
- * Member Variable
15
- *
16
- * @var instance
17
- */
18
- private static $instance;
19
-
20
- /**
21
- * Initiator
22
- */
23
- public static function get_instance() {
24
- if ( ! isset( self::$instance ) ) {
25
- self::$instance = new self();
26
- }
27
- return self::$instance;
28
- }
29
-
30
- /**
31
- * Constructor
32
- */
33
- public function __construct() {
34
-
35
- /* Set / Destroy Flow Sessions. Set data */
36
- add_action( 'wp', array( $this, 'init_actions' ), 1 );
37
-
38
- add_action( 'init', array( $this, 'debug_data_setting_actions' ) );
39
- add_action( 'init', array( $this, 'setup_optin_checkout_filter' ) );
40
- /* Enqueue global required scripts */
41
- add_action( 'wp', array( $this, 'wp_actions' ), 55 );
42
-
43
- /* Modify the checkout order received url to go thank you page in our flow */
44
- add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_to_thankyou_page' ), 10, 2 );
45
-
46
- add_action( 'wp_head', array( $this, 'facebook_pixel_init' ) );
47
-
48
- }
49
-
50
- /**
51
- * Redirect to thank page if upsell not exists
52
- *
53
- * @param string $order_recieve_url url.
54
- * @param object $order order object.
55
- * @since 1.0.0
56
- */
57
- public function redirect_to_thankyou_page( $order_recieve_url, $order ) {
58
-
59
- /* Only for thank you page */
60
- wcf()->logger->log( 'Start-' . __CLASS__ . '::' . __FUNCTION__ );
61
- wcf()->logger->log( 'Only for thank you page' );
62
-
63
- if ( wcf()->flow->is_thankyou_page_exists( $order ) ) {
64
-
65
- if ( _is_wcf_doing_checkout_ajax() ) {
66
-
67
- $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
68
-
69
- if ( ! $checkout_id ) {
70
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
71
- }
72
- } else {
73
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
74
- }
75
-
76
- wcf()->logger->log( 'Checkout ID : ' . $checkout_id );
77
-
78
- if ( $checkout_id ) {
79
-
80
- $thankyou_step_id = wcf()->flow->get_thankyou_page_id( $order );
81
-
82
- if ( $thankyou_step_id ) {
83
-
84
- $order_recieve_url = get_permalink( $thankyou_step_id );
85
-
86
- $order_recieve_url = add_query_arg(
87
- array(
88
- 'wcf-key' => $order->get_order_key(),
89
- 'wcf-order' => $order->get_id(),
90
- ),
91
- $order_recieve_url
92
- );
93
- }
94
- }
95
- }
96
-
97
- wcf()->logger->log( 'End-' . __CLASS__ . '::' . __FUNCTION__ );
98
-
99
- Cartflows_Helper::send_fb_response_if_enabled( $order->get_id() );
100
-
101
- Cartflows_Tracking::send_ga_data_if_enabled( $order->get_id() );
102
-
103
- return $order_recieve_url;
104
- }
105
-
106
- /**
107
- * Cancel and redirect to checkout
108
- *
109
- * @param string $return_url url.
110
- * @since 1.0.0
111
- */
112
- public function redirect_to_checkout_on_cancel( $return_url ) {
113
-
114
- if ( _is_wcf_doing_checkout_ajax() ) {
115
-
116
- $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
117
-
118
- if ( ! $checkout_id ) {
119
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
120
- }
121
- } else {
122
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
123
- }
124
-
125
- if ( $checkout_id ) {
126
-
127
- $return_url = add_query_arg(
128
- array(
129
- 'cancel_order' => 'true',
130
- '_wpnonce' => wp_create_nonce( 'woocommerce-cancel_order' ),
131
- ),
132
- get_permalink( $checkout_id )
133
- );
134
- }
135
-
136
- return $return_url;
137
- }
138
-
139
-
140
- /**
141
- * Remove theme styles.
142
- *
143
- * @since 1.0.0
144
- */
145
- public function remove_theme_styles() {
146
-
147
- if ( Cartflows_Compatibility::get_instance()->is_compatibility_theme_enabled() ) {
148
- return;
149
- }
150
-
151
- $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
152
-
153
- $page_template = apply_filters( 'cartflows_page_template', $page_template );
154
-
155
- if ( ! _wcf_supported_template( $page_template ) ) {
156
- return;
157
- }
158
-
159
- // get all styles data.
160
- global $wp_styles;
161
- global $wp_scripts;
162
-
163
- $get_stylesheet = 'themes/' . get_stylesheet() . '/';
164
- $get_template = 'themes/' . get_template() . '/';
165
-
166
- $remove_styles = apply_filters( 'cartflows_remove_theme_styles', true );
167
-
168
- if ( $remove_styles ) {
169
-
170
- // loop over all of the registered scripts..
171
- foreach ( $wp_styles->registered as $handle => $data ) {
172
-
173
- if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
174
-
175
- // remove it.
176
- wp_deregister_style( $handle );
177
- wp_dequeue_style( $handle );
178
- }
179
- }
180
- }
181
-
182
- $remove_scripts = apply_filters( 'cartflows_remove_theme_scripts', true );
183
-
184
- if ( $remove_scripts ) {
185
-
186
- // loop over all of the registered scripts.
187
- foreach ( $wp_scripts->registered as $handle => $data ) {
188
-
189
- if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
190
-
191
- // remove it.
192
- wp_deregister_script( $handle );
193
- wp_dequeue_script( $handle );
194
- }
195
- }
196
- }
197
-
198
- }
199
-
200
- /**
201
- * Update main order data in transient.
202
- *
203
- * @param array $woo_styles new styles array.
204
- * @since 1.0.0
205
- * @return array.
206
- */
207
- public function woo_default_css( $woo_styles ) {
208
-
209
- $woo_styles = array(
210
- 'woocommerce-layout' => array(
211
- 'src' => plugins_url( 'assets/css/woocommerce-layout.css', WC_PLUGIN_FILE ),
212
- 'deps' => '',
213
- 'version' => WC_VERSION,
214
- 'media' => 'all',
215
- 'has_rtl' => true,
216
- ),
217
- 'woocommerce-smallscreen' => array(
218
- 'src' => plugins_url( 'assets/css/woocommerce-smallscreen.css', WC_PLUGIN_FILE ),
219
- 'deps' => 'woocommerce-layout',
220
- 'version' => WC_VERSION,
221
- 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', '768px' ) . ')',
222
- 'has_rtl' => true,
223
- ),
224
- 'woocommerce-general' => array(
225
- 'src' => plugins_url( 'assets/css/woocommerce.css', WC_PLUGIN_FILE ),
226
- 'deps' => '',
227
- 'version' => WC_VERSION,
228
- 'media' => 'all',
229
- 'has_rtl' => true,
230
- ),
231
- );
232
-
233
- return $woo_styles;
234
- }
235
-
236
- /**
237
- * Init Actions.
238
- *
239
- * @since 1.0.0
240
- */
241
- public function init_actions() {
242
-
243
- if ( wcf()->utils->is_step_post_type() ) {
244
-
245
- global $post;
246
-
247
- $GLOBALS['wcf_step'] = wcf_get_step( $post->ID );
248
-
249
- do_action( 'cartflows_wp', $post->ID );
250
-
251
- $this->set_flow_session();
252
- }
253
- }
254
-
255
- /**
256
- * Set flow session.
257
- *
258
- * @since 1.0.0
259
- */
260
- public function set_flow_session() {
261
-
262
- global $wp;
263
-
264
- add_action( 'wp_head', array( $this, 'noindex_flow' ) );
265
-
266
- wcf()->utils->do_not_cache();
267
-
268
- if ( _is_wcf_thankyou_type() ) {
269
- /* Set key to support pixel */
270
- if ( isset( $_GET['wcf-key'] ) ) { //phpcs:ignore
271
-
272
- $wcf_key = sanitize_text_field( wp_unslash( $_GET['wcf-key'] ) ); //phpcs:ignore
273
-
274
- $_GET['key'] = $wcf_key;
275
- $_REQUEST['key'] = $wcf_key;
276
- }
277
-
278
- if ( isset( $_GET['wcf-order'] ) ) { //phpcs:ignore
279
-
280
- $wcf_order = intval( wp_unslash( $_GET['wcf-order'] ) ); //phpcs:ignore
281
-
282
- $_GET['order'] = $wcf_order;
283
- $_REQUEST['order'] = $wcf_order;
284
- $_GET['order-received'] = $wcf_order;
285
- $_REQUEST['order-received'] = $wcf_order;
286
-
287
- $wp->set_query_var( 'order-received', $wcf_order );
288
- }
289
- }
290
- }
291
-
292
- /**
293
- * Add noindex, nofollow.
294
- *
295
- * @since 1.0.0
296
- */
297
- public function noindex_flow() {
298
-
299
- $common = Cartflows_Helper::get_common_settings();
300
-
301
- if ( 'enable' === $common['disallow_indexing'] ) {
302
- echo '<meta name="robots" content="noindex,nofollow">';
303
- }
304
- }
305
-
306
- /**
307
- * WP Actions.
308
- *
309
- * @since 1.0.0
310
- */
311
- public function wp_actions() {
312
-
313
- if ( wcf()->utils->is_step_post_type() ) {
314
-
315
- if ( ! wcf()->is_woo_active && wcf()->utils->check_is_woo_required_page() ) {
316
- wp_die( ' This page requires WooCommerce plugin installed and activated!', 'WooCommerce Required' );
317
- }
318
-
319
- /* CSS Compatibility for All theme */
320
- add_filter( 'woocommerce_enqueue_styles', array( $this, 'woo_default_css' ), 9999 );
321
-
322
- add_action( 'wp_enqueue_scripts', array( $this, 'remove_theme_styles' ), 9999 );
323
- add_action( 'wp_enqueue_scripts', array( $this, 'global_flow_scripts' ), 20 );
324
-
325
- /* Load woo templates from plugin */
326
- add_filter( 'woocommerce_locate_template', array( $this, 'override_woo_template' ), 20, 3 );
327
-
328
- /* Add version class to body in frontend. */
329
- add_filter( 'body_class', array( $this, 'add_cartflows_lite_version_to_body' ) );
330
-
331
- /* Custom Script Option */
332
- add_action( 'wp_head', array( $this, 'custom_script_option' ) );
333
-
334
- /* Remove the action applied by the Flatsome theme */
335
- if ( Cartflows_Compatibility::get_instance()->is_flatsome_enabled() ) {
336
- $this->remove_flatsome_action();
337
- }
338
- }
339
- }
340
-
341
- /**
342
- * Function for facebook pixel.
343
- */
344
- public function facebook_pixel_init() {
345
-
346
- $facebook_settings = Cartflows_Helper::get_facebook_settings();
347
- if ( 'enable' === $facebook_settings['facebook_pixel_tracking'] ) {
348
-
349
- $facebook_id = $facebook_settings['facebook_pixel_id'];
350
- echo '<!-- Facebook Pixel Script By CartFlows -->';
351
- $fb_script = "<script type='text/javascript'>
352
- !function(f,b,e,v,n,t,s)
353
- {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
354
- n.callMethod.apply(n,arguments):n.queue.push(arguments)};
355
- if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
356
- n.queue=[];t=b.createElement(e);t.async=!0;
357
- t.src=v;s=b.getElementsByTagName(e)[0];
358
- s.parentNode.insertBefore(t,s)}(window, document,'script',
359
- 'https://connect.facebook.net/en_US/fbevents.js');
360
- </script>
361
- <noscript><img height='1' width='1' style='display:none' src='https://www.facebook.com/tr?id=" . $facebook_id . "&ev=PageView&noscript=1'/></noscript>";
362
-
363
- $fb_page_view = "<script type='text/javascript'>
364
- fbq('init', $facebook_id);
365
- fbq('track', 'PageView', {'plugin': 'CartFlows'});
366
- </script>";
367
-
368
- if ( 'enable' === $facebook_settings['facebook_pixel_tracking_for_site'] && ! wcf()->utils->is_step_post_type() ) {
369
- echo $fb_script;
370
- echo $fb_page_view;
371
- } else {
372
- echo $fb_script;
373
- }
374
- echo '<!-- End Facebook Pixel Script By CartFlows -->';
375
- }
376
-
377
- }
378
-
379
- /**
380
- * Debug Data Setting Actions.
381
- *
382
- * @since 1.1.14
383
- */
384
- public function debug_data_setting_actions() {
385
-
386
- add_filter( 'cartflows_load_min_assets', array( $this, 'allow_load_minify' ) );
387
- }
388
-
389
- /**
390
- * Get/Set the allow minify option.
391
- *
392
- * @since 1.1.14
393
- */
394
- public function allow_load_minify() {
395
- $debug_data = Cartflows_Helper::get_debug_settings();
396
- $allow_minified = $debug_data['allow_minified_files'];
397
- $allow_minify = false;
398
-
399
- if ( 'enable' === $allow_minified ) {
400
- $allow_minify = true;
401
- }
402
-
403
- return $allow_minify;
404
- }
405
-
406
- /**
407
- * Global flow scripts.
408
- *
409
- * @since 1.0.0
410
- */
411
- public function global_flow_scripts() {
412
-
413
- global $post, $wcf_step;
414
-
415
- $flow = $wcf_step->get_flow_id();
416
- $current_step = $wcf_step->get_current_step();
417
- $control_step = $wcf_step->get_control_step();
418
- $next_step_link = '';
419
- $compatibility = Cartflows_Compatibility::get_instance();
420
-
421
- if ( _is_wcf_landing_type() ) {
422
-
423
- $next_step_id = $wcf_step->get_direct_next_step_id();
424
- $next_step_link = get_permalink( $next_step_id );
425
- }
426
-
427
- $page_template = get_post_meta( $current_step, '_wp_page_template', true );
428
-
429
- $fb_active = Cartflows_Helper::get_facebook_settings();
430
- $ga_active = Cartflows_Helper::get_google_analytics_settings();
431
- $params = array();
432
- $ga_param = array();
433
-
434
- if ( 'enable' === $fb_active['facebook_pixel_tracking'] && Cartflows_Loader::get_instance()->is_woo_active ) {
435
-
436
- $params = Cartflows_Helper::prepare_cart_data_fb_response();
437
- }
438
-
439
- if ( 'enable' === $ga_active['enable_google_analytics'] ) {
440
- $ga_param = Cartflows_Tracking::get_ga_items_list();
441
- }
442
-
443
- $localize = array(
444
- 'ajax_url' => admin_url( 'admin-ajax.php', 'relative' ),
445
- 'is_pb_preview' => $compatibility->is_page_builder_preview(),
446
- 'current_theme' => $compatibility->get_current_theme(),
447
- 'current_flow' => $flow,
448
- 'current_step' => $current_step,
449
- 'control_step' => $control_step,
450
- 'next_step' => $next_step_link,
451
- 'page_template' => $page_template,
452
- 'is_checkout_page' => _is_wcf_checkout_type(),
453
- 'params' => $params,
454
- 'fb_active' => $fb_active,
455
- 'wcf_ga_active' => $ga_active,
456
- 'ga_param' => $ga_param,
457
- );
458
-
459
- $localize = apply_filters( 'global_cartflows_js_localize', $localize );
460
-
461
- $localize_script = '<!-- script to print the admin localized variables -->';
462
- $localize_script .= '<script type="text/javascript">';
463
- $localize_script .= 'var cartflows = ' . wp_json_encode( $localize ) . ';';
464
- $localize_script .= '</script>';
465
-
466
- echo $localize_script;
467
-
468
- if ( _wcf_supported_template( $page_template ) ) {
469
-
470
- wp_enqueue_style( 'wcf-normalize-frontend-global', wcf()->utils->get_css_url( 'cartflows-normalize' ), array(), CARTFLOWS_VER );
471
- }
472
-
473
- wp_enqueue_style( 'wcf-frontend-global', wcf()->utils->get_css_url( 'frontend' ), array(), CARTFLOWS_VER );
474
-
475
- wp_enqueue_script(
476
- 'wcf-frontend-global',
477
- wcf()->utils->get_js_url( 'frontend' ),
478
- array( 'jquery', 'jquery-cookie' ),
479
- CARTFLOWS_VER,
480
- false
481
- );
482
- }
483
-
484
- /**
485
- * Custom Script in head.
486
- *
487
- * @since 1.0.0
488
- */
489
- public function custom_script_option() {
490
-
491
- /* Add custom script to header in frontend. */
492
- $script = $this->get_custom_script();
493
- if ( '' !== $script ) {
494
- if ( false === strpos( $script, '<script' ) ) {
495
- $script = '<script>' . $script . '</script>';
496
- }
497
- echo '<!-- Custom CartFlows Script -->';
498
- echo $script;
499
- echo '<!-- End Custom CartFlows Script -->';
500
- }
501
- }
502
-
503
- /**
504
- * Override woo templates.
505
- *
506
- * @param string $template new Template full path.
507
- * @param string $template_name Template name.
508
- * @param string $template_path Template Path.
509
- * @since 1.1.5
510
- * @return string.
511
- */
512
- public function override_woo_template( $template, $template_name, $template_path ) {
513
-
514
- global $woocommerce;
515
-
516
- $_template = $template;
517
-
518
- $plugin_path = CARTFLOWS_DIR . 'woocommerce/template/';
519
-
520
- if ( file_exists( $plugin_path . $template_name ) ) {
521
- $template = $plugin_path . $template_name;
522
- }
523
-
524
- if ( ! $template ) {
525
- $template = $_template;
526
- }
527
-
528
- return $template;
529
- }
530
-
531
- /**
532
- * Remove the action applied by the Flatsome theme.
533
- *
534
- * @since 1.1.5
535
- * @return void.
536
- */
537
- public function remove_flatsome_action() {
538
-
539
- // Remove action where flatsome dequeued the woocommerce's default styles.
540
- remove_action( 'wp_enqueue_scripts', 'flatsome_woocommerce_scripts_styles', 98 );
541
- }
542
-
543
- /**
544
- * Add version class to body in frontend.
545
- *
546
- * @since 1.1.5
547
- * @param array $classes classes.
548
- * @return array $classes classes.
549
- */
550
- public function add_cartflows_lite_version_to_body( $classes ) {
551
-
552
- $classes[] = 'cartflows-' . CARTFLOWS_VER;
553
-
554
- return $classes;
555
-
556
- }
557
-
558
- /**
559
- * Get custom script data.
560
- *
561
- * @since 1.0.0
562
- */
563
- public function get_custom_script() {
564
-
565
- global $post;
566
-
567
- $script = get_post_meta( $post->ID, 'wcf-custom-script', true );
568
-
569
- return $script;
570
- }
571
-
572
-
573
- /**
574
- * Set appropriate filter sctions.
575
- *
576
- * @since 1.1.14
577
- */
578
- public function setup_optin_checkout_filter() {
579
-
580
- if ( _is_wcf_doing_optin_ajax() ) {
581
- /* Modify the optin order received url to go next step */
582
- remove_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_to_thankyou_page' ), 10, 2 );
583
- add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_optin_to_next_step' ), 10, 2 );
584
- }
585
- }
586
-
587
- /**
588
- * Redirect to thank page if upsell not exists
589
- *
590
- * @param string $order_recieve_url url.
591
- * @param object $order order object.
592
- * @since 1.0.0
593
- */
594
- public function redirect_optin_to_next_step( $order_recieve_url, $order ) {
595
-
596
- /* Only for optin page */
597
- wcf()->logger->log( 'Start-' . __CLASS__ . '::' . __FUNCTION__ );
598
- wcf()->logger->log( 'Only for optin page' );
599
-
600
- if ( _is_wcf_doing_optin_ajax() ) {
601
-
602
- $optin_id = wcf()->utils->get_optin_id_from_post_data();
603
-
604
- if ( ! $optin_id ) {
605
- $optin_id = wcf()->utils->get_optin_id_from_order( $order->get_id() );
606
- }
607
- } else {
608
- $optin_id = wcf()->utils->get_optin_id_from_order( $order->get_id() );
609
- }
610
-
611
- wcf()->logger->log( 'Optin ID : ' . $optin_id );
612
-
613
- if ( $optin_id ) {
614
-
615
- $wcf_step_obj = wcf_get_step( $optin_id );
616
- $next_step_id = $wcf_step_obj->get_direct_next_step_id();
617
-
618
- if ( $next_step_id ) {
619
-
620
- $order_recieve_url = get_permalink( $next_step_id );
621
- $query_param = array(
622
- 'wcf-key' => $order->get_order_key(),
623
- 'wcf-order' => $order->get_id(),
624
- );
625
-
626
- if ( 'yes' === wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-pass-fields' ) ) {
627
-
628
- $fields_string = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-pass-specific-fields' );
629
-
630
- $fields = array_map( 'trim', explode( ',', $fields_string ) );
631
-
632
- if ( is_array( $fields ) ) {
633
-
634
- $order_id = $order->get_id();
635
-
636
- foreach ( $fields as $in => $key ) {
637
- switch ( $key ) {
638
- case 'first_name':
639
- $query_param[ $key ] = $order->get_billing_first_name();
640
- break;
641
- case 'last_name':
642
- $query_param[ $key ] = $order->get_billing_last_name();
643
- break;
644
- case 'email':
645
- $query_param[ $key ] = $order->get_billing_email();
646
- break;
647
- default:
648
- $query_param[ $key ] = get_post_meta( $order_id, '_billing_' . $key, true );
649
- break;
650
- }
651
- }
652
- }
653
- }
654
-
655
- $order_recieve_url = add_query_arg(
656
- $query_param,
657
- $order_recieve_url
658
- );
659
- }
660
- }
661
-
662
- wcf()->logger->log( 'End-' . __CLASS__ . '::' . __FUNCTION__ );
663
-
664
- return $order_recieve_url;
665
- }
666
- }
667
-
668
- /**
669
- * Prepare if class 'Cartflows_Frontend' exist.
670
- * Kicking this off by calling 'get_instance()' method
671
- */
672
- Cartflows_Frontend::get_instance();
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CartFlows Frontend.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Class Cartflows_Frontend.
10
+ */
11
+ class Cartflows_Frontend {
12
+
13
+ /**
14
+ * Member Variable
15
+ *
16
+ * @var instance
17
+ */
18
+ private static $instance;
19
+
20
+ /**
21
+ * Initiator
22
+ */
23
+ public static function get_instance() {
24
+ if ( ! isset( self::$instance ) ) {
25
+ self::$instance = new self();
26
+ }
27
+ return self::$instance;
28
+ }
29
+
30
+ /**
31
+ * Constructor
32
+ */
33
+ public function __construct() {
34
+
35
+ /* Set / Destroy Flow Sessions. Set data */
36
+ add_action( 'wp', array( $this, 'init_actions' ), 1 );
37
+
38
+ add_action( 'init', array( $this, 'debug_data_setting_actions' ) );
39
+ add_action( 'init', array( $this, 'setup_optin_checkout_filter' ) );
40
+ /* Enqueue global required scripts */
41
+ add_action( 'wp', array( $this, 'wp_actions' ), 55 );
42
+
43
+ /* Modify the checkout order received url to go thank you page in our flow */
44
+ add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_to_thankyou_page' ), 10, 2 );
45
+
46
+ add_action( 'wp_head', array( $this, 'facebook_pixel_init' ) );
47
+
48
+ }
49
+
50
+ /**
51
+ * Redirect to thank page if upsell not exists
52
+ *
53
+ * @param string $order_recieve_url url.
54
+ * @param object $order order object.
55
+ * @since 1.0.0
56
+ */
57
+ public function redirect_to_thankyou_page( $order_recieve_url, $order ) {
58
+
59
+ /* Only for thank you page */
60
+ wcf()->logger->log( 'Start-' . __CLASS__ . '::' . __FUNCTION__ );
61
+ wcf()->logger->log( 'Only for thank you page' );
62
+
63
+ if ( wcf()->flow->is_thankyou_page_exists( $order ) ) {
64
+
65
+ if ( _is_wcf_doing_checkout_ajax() ) {
66
+
67
+ $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
68
+
69
+ if ( ! $checkout_id ) {
70
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
71
+ }
72
+ } else {
73
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
74
+ }
75
+
76
+ wcf()->logger->log( 'Checkout ID : ' . $checkout_id );
77
+
78
+ if ( $checkout_id ) {
79
+
80
+ $thankyou_step_id = wcf()->flow->get_thankyou_page_id( $order );
81
+
82
+ if ( $thankyou_step_id ) {
83
+
84
+ $order_recieve_url = get_permalink( $thankyou_step_id );
85
+
86
+ $order_recieve_url = add_query_arg(
87
+ array(
88
+ 'wcf-key' => $order->get_order_key(),
89
+ 'wcf-order' => $order->get_id(),
90
+ ),
91
+ $order_recieve_url
92
+ );
93
+ }
94
+ }
95
+ }
96
+
97
+ wcf()->logger->log( 'End-' . __CLASS__ . '::' . __FUNCTION__ );
98
+
99
+ Cartflows_Helper::send_fb_response_if_enabled( $order->get_id() );
100
+
101
+ Cartflows_Tracking::send_ga_data_if_enabled( $order->get_id() );
102
+
103
+ return $order_recieve_url;
104
+ }
105
+
106
+ /**
107
+ * Cancel and redirect to checkout
108
+ *
109
+ * @param string $return_url url.
110
+ * @since 1.0.0
111
+ */
112
+ public function redirect_to_checkout_on_cancel( $return_url ) {
113
+
114
+ if ( _is_wcf_doing_checkout_ajax() ) {
115
+
116
+ $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
117
+
118
+ if ( ! $checkout_id ) {
119
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
120
+ }
121
+ } else {
122
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
123
+ }
124
+
125
+ if ( $checkout_id ) {
126
+
127
+ $return_url = add_query_arg(
128
+ array(
129
+ 'cancel_order' => 'true',
130
+ '_wpnonce' => wp_create_nonce( 'woocommerce-cancel_order' ),
131
+ ),
132
+ get_permalink( $checkout_id )
133
+ );
134
+ }
135
+
136
+ return $return_url;
137
+ }
138
+
139
+
140
+ /**
141
+ * Remove theme styles.
142
+ *
143
+ * @since 1.0.0
144
+ */
145
+ public function remove_theme_styles() {
146
+
147
+ if ( Cartflows_Compatibility::get_instance()->is_compatibility_theme_enabled() ) {
148
+ return;
149
+ }
150
+
151
+ $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
152
+
153
+ $page_template = apply_filters( 'cartflows_page_template', $page_template );
154
+
155
+ if ( ! _wcf_supported_template( $page_template ) ) {
156
+ return;
157
+ }
158
+
159
+ // get all styles data.
160
+ global $wp_styles;
161
+ global $wp_scripts;
162
+
163
+ $get_stylesheet = 'themes/' . get_stylesheet() . '/';
164
+ $get_template = 'themes/' . get_template() . '/';
165
+
166
+ $remove_styles = apply_filters( 'cartflows_remove_theme_styles', true );
167
+
168
+ if ( $remove_styles ) {
169
+
170
+ // loop over all of the registered scripts..
171
+ foreach ( $wp_styles->registered as $handle => $data ) {
172
+
173
+ if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
174
+
175
+ // remove it.
176
+ wp_deregister_style( $handle );
177
+ wp_dequeue_style( $handle );
178
+ }
179
+ }
180
+ }
181
+
182
+ $remove_scripts = apply_filters( 'cartflows_remove_theme_scripts', true );
183
+
184
+ if ( $remove_scripts ) {
185
+
186
+ // loop over all of the registered scripts.
187
+ foreach ( $wp_scripts->registered as $handle => $data ) {
188
+
189
+ if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
190
+
191
+ // remove it.
192
+ wp_deregister_script( $handle );
193
+ wp_dequeue_script( $handle );
194
+ }
195
+ }
196
+ }
197
+
198
+ }
199
+
200
+ /**
201
+ * Update main order data in transient.
202
+ *
203
+ * @param array $woo_styles new styles array.
204
+ * @since 1.0.0
205
+ * @return array.
206
+ */
207
+ public function woo_default_css( $woo_styles ) {
208
+
209
+ $woo_styles = array(
210
+ 'woocommerce-layout' => array(
211
+ 'src' => plugins_url( 'assets/css/woocommerce-layout.css', WC_PLUGIN_FILE ),
212
+ 'deps' => '',
213
+ 'version' => WC_VERSION,
214
+ 'media' => 'all',
215
+ 'has_rtl' => true,
216
+ ),
217
+ 'woocommerce-smallscreen' => array(
218
+ 'src' => plugins_url( 'assets/css/woocommerce-smallscreen.css', WC_PLUGIN_FILE ),
219
+ 'deps' => 'woocommerce-layout',
220
+ 'version' => WC_VERSION,
221
+ 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', '768px' ) . ')',
222
+ 'has_rtl' => true,
223
+ ),
224
+ 'woocommerce-general' => array(
225
+ 'src' => plugins_url( 'assets/css/woocommerce.css', WC_PLUGIN_FILE ),
226
+ 'deps' => '',
227
+ 'version' => WC_VERSION,
228
+ 'media' => 'all',
229
+ 'has_rtl' => true,
230
+ ),
231
+ );
232
+
233
+ return $woo_styles;
234
+ }
235
+
236
+ /**
237
+ * Init Actions.
238
+ *
239
+ * @since 1.0.0
240
+ */
241
+ public function init_actions() {
242
+
243
+ if ( wcf()->utils->is_step_post_type() ) {
244
+
245
+ global $post;
246
+
247
+ $GLOBALS['wcf_step'] = wcf_get_step( $post->ID );
248
+
249
+ do_action( 'cartflows_wp', $post->ID );
250
+
251
+ $this->set_flow_session();
252
+ }
253
+ }
254
+
255
+ /**
256
+ * Set flow session.
257
+ *
258
+ * @since 1.0.0
259
+ */
260
+ public function set_flow_session() {
261
+
262
+ global $wp;
263
+
264
+ add_action( 'wp_head', array( $this, 'noindex_flow' ) );
265
+
266
+ wcf()->utils->do_not_cache();
267
+
268
+ if ( _is_wcf_thankyou_type() ) {
269
+ /* Set key to support pixel */
270
+ if ( isset( $_GET['wcf-key'] ) ) { //phpcs:ignore
271
+
272
+ $wcf_key = sanitize_text_field( wp_unslash( $_GET['wcf-key'] ) ); //phpcs:ignore
273
+
274
+ $_GET['key'] = $wcf_key;
275
+ $_REQUEST['key'] = $wcf_key;
276
+ }
277
+
278
+ if ( isset( $_GET['wcf-order'] ) ) { //phpcs:ignore
279
+
280
+ $wcf_order = intval( wp_unslash( $_GET['wcf-order'] ) ); //phpcs:ignore
281
+
282
+ $_GET['order'] = $wcf_order;
283
+ $_REQUEST['order'] = $wcf_order;
284
+ $_GET['order-received'] = $wcf_order;
285
+ $_REQUEST['order-received'] = $wcf_order;
286
+
287
+ $wp->set_query_var( 'order-received', $wcf_order );
288
+ }
289
+ }
290
+ }
291
+
292
+ /**
293
+ * Add noindex, nofollow.
294
+ *
295
+ * @since 1.0.0
296
+ */
297
+ public function noindex_flow() {
298
+
299
+ $common = Cartflows_Helper::get_common_settings();
300
+
301
+ if ( 'enable' === $common['disallow_indexing'] ) {
302
+ echo '<meta name="robots" content="noindex,nofollow">';
303
+ }
304
+ }
305
+
306
+ /**
307
+ * WP Actions.
308
+ *
309
+ * @since 1.0.0
310
+ */
311
+ public function wp_actions() {
312
+
313
+ if ( wcf()->utils->is_step_post_type() ) {
314
+
315
+ if ( ! wcf()->is_woo_active && wcf()->utils->check_is_woo_required_page() ) {
316
+ wp_die( ' This page requires WooCommerce plugin installed and activated!', 'WooCommerce Required' );
317
+ }
318
+
319
+ /* CSS Compatibility for All theme */
320
+ add_filter( 'woocommerce_enqueue_styles', array( $this, 'woo_default_css' ), 9999 );
321
+
322
+ add_action( 'wp_enqueue_scripts', array( $this, 'remove_theme_styles' ), 9999 );
323
+ add_action( 'wp_enqueue_scripts', array( $this, 'global_flow_scripts' ), 20 );
324
+
325
+ /* Load woo templates from plugin */
326
+ add_filter( 'woocommerce_locate_template', array( $this, 'override_woo_template' ), 20, 3 );
327
+
328
+ /* Add version class to body in frontend. */
329
+ add_filter( 'body_class', array( $this, 'add_cartflows_lite_version_to_body' ) );
330
+
331
+ /* Custom Script Option */
332
+ add_action( 'wp_head', array( $this, 'custom_script_option' ) );
333
+
334
+ /* Remove the action applied by the Flatsome theme */
335
+ if ( Cartflows_Compatibility::get_instance()->is_flatsome_enabled() ) {
336
+ $this->remove_flatsome_action();
337
+ }
338
+ }
339
+ }
340
+
341
+ /**
342
+ * Function for facebook pixel.
343
+ */
344
+ public function facebook_pixel_init() {
345
+
346
+ $facebook_settings = Cartflows_Helper::get_facebook_settings();
347
+ if ( 'enable' === $facebook_settings['facebook_pixel_tracking'] ) {
348
+
349
+ $facebook_id = $facebook_settings['facebook_pixel_id'];
350
+ echo '<!-- Facebook Pixel Script By CartFlows -->';
351
+ $fb_script = "<script type='text/javascript'>
352
+ !function(f,b,e,v,n,t,s)
353
+ {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
354
+ n.callMethod.apply(n,arguments):n.queue.push(arguments)};
355
+ if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
356
+ n.queue=[];t=b.createElement(e);t.async=!0;
357
+ t.src=v;s=b.getElementsByTagName(e)[0];
358
+ s.parentNode.insertBefore(t,s)}(window, document,'script',
359
+ 'https://connect.facebook.net/en_US/fbevents.js');
360
+ </script>
361
+ <noscript><img height='1' width='1' style='display:none' src='https://www.facebook.com/tr?id=" . $facebook_id . "&ev=PageView&noscript=1'/></noscript>";
362
+
363
+ $fb_page_view = "<script type='text/javascript'>
364
+ fbq('init', $facebook_id);
365
+ fbq('track', 'PageView', {'plugin': 'CartFlows'});
366
+ </script>";
367
+
368
+ if ( 'enable' === $facebook_settings['facebook_pixel_tracking_for_site'] && ! wcf()->utils->is_step_post_type() ) {
369
+ echo $fb_script;
370
+ echo $fb_page_view;
371
+ } else {
372
+ echo $fb_script;
373
+ }
374
+ echo '<!-- End Facebook Pixel Script By CartFlows -->';
375
+ }
376
+
377
+ }
378
+
379
+ /**
380
+ * Debug Data Setting Actions.
381
+ *
382
+ * @since 1.1.14
383
+ */
384
+ public function debug_data_setting_actions() {
385
+
386
+ add_filter( 'cartflows_load_min_assets', array( $this, 'allow_load_minify' ) );
387
+ }
388
+
389
+ /**
390
+ * Get/Set the allow minify option.
391
+ *
392
+ * @since 1.1.14
393
+ */
394
+ public function allow_load_minify() {
395
+ $debug_data = Cartflows_Helper::get_debug_settings();
396
+ $allow_minified = $debug_data['allow_minified_files'];
397
+ $allow_minify = false;
398
+
399
+ if ( 'enable' === $allow_minified ) {
400
+ $allow_minify = true;
401
+ }
402
+
403
+ return $allow_minify;
404
+ }
405
+
406
+ /**
407
+ * Global flow scripts.
408
+ *
409
+ * @since 1.0.0
410
+ */
411
+ public function global_flow_scripts() {
412
+
413
+ global $post, $wcf_step;
414
+
415
+ $flow = $wcf_step->get_flow_id();
416
+ $current_step = $wcf_step->get_current_step();
417
+ $control_step = $wcf_step->get_control_step();
418
+ $next_step_link = '';
419
+ $compatibility = Cartflows_Compatibility::get_instance();
420
+
421
+ if ( _is_wcf_landing_type() ) {
422
+
423
+ $next_step_id = $wcf_step->get_direct_next_step_id();
424
+ $next_step_link = get_permalink( $next_step_id );
425
+ }
426
+
427
+ $page_template = get_post_meta( $current_step, '_wp_page_template', true );
428
+
429
+ $fb_active = Cartflows_Helper::get_facebook_settings();
430
+ $ga_active = Cartflows_Helper::get_google_analytics_settings();
431
+ $params = array();
432
+ $ga_param = array();
433
+
434
+ if ( 'enable' === $fb_active['facebook_pixel_tracking'] && Cartflows_Loader::get_instance()->is_woo_active ) {
435
+
436
+ $params = Cartflows_Helper::prepare_cart_data_fb_response();
437
+ }
438
+
439
+ if ( 'enable' === $ga_active['enable_google_analytics'] ) {
440
+ $ga_param = Cartflows_Tracking::get_ga_items_list();
441
+ }
442
+
443
+ $localize = array(
444
+ 'ajax_url' => admin_url( 'admin-ajax.php', 'relative' ),
445
+ 'is_pb_preview' => $compatibility->is_page_builder_preview(),
446
+ 'current_theme' => $compatibility->get_current_theme(),
447
+ 'current_flow' => $flow,
448
+ 'current_step' => $current_step,
449
+ 'control_step' => $control_step,
450
+ 'next_step' => $next_step_link,
451
+ 'page_template' => $page_template,
452
+ 'is_checkout_page' => _is_wcf_checkout_type(),
453
+ 'params' => $params,
454
+ 'fb_active' => $fb_active,
455
+ 'wcf_ga_active' => $ga_active,
456
+ 'ga_param' => $ga_param,
457
+ );
458
+
459
+ $localize = apply_filters( 'global_cartflows_js_localize', $localize );
460
+
461
+ $localize_script = '<!-- script to print the admin localized variables -->';
462
+ $localize_script .= '<script type="text/javascript">';
463
+ $localize_script .= 'var cartflows = ' . wp_json_encode( $localize ) . ';';
464
+ $localize_script .= '</script>';
465
+
466
+ echo $localize_script;
467
+
468
+ if ( _wcf_supported_template( $page_template ) ) {
469
+
470
+ wp_enqueue_style( 'wcf-normalize-frontend-global', wcf()->utils->get_css_url( 'cartflows-normalize' ), array(), CARTFLOWS_VER );
471
+ }
472
+
473
+ if ( ! wcf()->is_woo_active ) {
474
+ wp_register_script(
475
+ 'jquery-cookie',
476
+ CARTFLOWS_URL . 'assets/js/lib/jquery-cookie/jquery.cookie.min.js',
477
+ array( 'jquery' ),
478
+ CARTFLOWS_VER,
479
+ false
480
+ );
481
+ }
482
+
483
+ wp_enqueue_style( 'wcf-frontend-global', wcf()->utils->get_css_url( 'frontend' ), array(), CARTFLOWS_VER );
484
+
485
+ wp_enqueue_script(
486
+ 'wcf-frontend-global',
487
+ wcf()->utils->get_js_url( 'frontend' ),
488
+ array( 'jquery', 'jquery-cookie' ),
489
+ CARTFLOWS_VER,
490
+ false
491
+ );
492
+ }
493
+
494
+ /**
495
+ * Custom Script in head.
496
+ *
497
+ * @since 1.0.0
498
+ */
499
+ public function custom_script_option() {
500
+
501
+ /* Add custom script to header in frontend. */
502
+ $script = $this->get_custom_script();
503
+ if ( '' !== $script ) {
504
+ if ( false === strpos( $script, '<script' ) ) {
505
+ $script = '<script>' . $script . '</script>';
506
+ }
507
+ echo '<!-- Custom CartFlows Script -->';
508
+ echo $script;
509
+ echo '<!-- End Custom CartFlows Script -->';
510
+ }
511
+ }
512
+
513
+ /**
514
+ * Override woo templates.
515
+ *
516
+ * @param string $template new Template full path.
517
+ * @param string $template_name Template name.
518
+ * @param string $template_path Template Path.
519
+ * @since 1.1.5
520
+ * @return string.
521
+ */
522
+ public function override_woo_template( $template, $template_name, $template_path ) {
523
+
524
+ global $woocommerce;
525
+
526
+ $_template = $template;
527
+
528
+ $plugin_path = CARTFLOWS_DIR . 'woocommerce/template/';
529
+
530
+ if ( file_exists( $plugin_path . $template_name ) ) {
531
+ $template = $plugin_path . $template_name;
532
+ }
533
+
534
+ if ( ! $template ) {
535
+ $template = $_template;
536
+ }
537
+
538
+ return $template;
539
+ }
540
+
541
+ /**
542
+ * Remove the action applied by the Flatsome theme.
543
+ *
544
+ * @since 1.1.5
545
+ * @return void.
546
+ */
547
+ public function remove_flatsome_action() {
548
+
549
+ // Remove action where flatsome dequeued the woocommerce's default styles.
550
+ remove_action( 'wp_enqueue_scripts', 'flatsome_woocommerce_scripts_styles', 98 );
551
+ }
552
+
553
+ /**
554
+ * Add version class to body in frontend.
555
+ *
556
+ * @since 1.1.5
557
+ * @param array $classes classes.
558
+ * @return array $classes classes.
559
+ */
560
+ public function add_cartflows_lite_version_to_body( $classes ) {
561
+
562
+ $classes[] = 'cartflows-' . CARTFLOWS_VER;
563
+
564
+ return $classes;
565
+
566
+ }
567
+
568
+ /**
569
+ * Get custom script data.
570
+ *
571
+ * @since 1.0.0
572
+ */
573
+ public function get_custom_script() {
574
+
575
+ global $post;
576
+
577
+ $script = get_post_meta( $post->ID, 'wcf-custom-script', true );
578
+
579
+ return $script;
580
+ }
581
+
582
+
583
+ /**
584
+ * Set appropriate filter sctions.
585
+ *
586
+ * @since 1.1.14
587
+ */
588
+ public function setup_optin_checkout_filter() {
589
+
590
+ if ( _is_wcf_doing_optin_ajax() ) {
591
+ /* Modify the optin order received url to go next step */
592
+ remove_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_to_thankyou_page' ), 10, 2 );
593
+ add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_optin_to_next_step' ), 10, 2 );
594
+ }
595
+ }
596
+
597
+ /**
598
+ * Redirect to thank page if upsell not exists
599
+ *
600
+ * @param string $order_recieve_url url.
601
+ * @param object $order order object.
602
+ * @since 1.0.0
603
+ */
604
+ public function redirect_optin_to_next_step( $order_recieve_url, $order ) {
605
+
606
+ /* Only for optin page */
607
+ wcf()->logger->log( 'Start-' . __CLASS__ . '::' . __FUNCTION__ );
608
+ wcf()->logger->log( 'Only for optin page' );
609
+
610
+ if ( _is_wcf_doing_optin_ajax() ) {
611
+
612
+ $optin_id = wcf()->utils->get_optin_id_from_post_data();
613
+
614
+ if ( ! $optin_id ) {
615
+ $optin_id = wcf()->utils->get_optin_id_from_order( $order->get_id() );
616
+ }
617
+ } else {
618
+ $optin_id = wcf()->utils->get_optin_id_from_order( $order->get_id() );
619
+ }
620
+
621
+ wcf()->logger->log( 'Optin ID : ' . $optin_id );
622
+
623
+ if ( $optin_id ) {
624
+
625
+ $wcf_step_obj = wcf_get_step( $optin_id );
626
+ $next_step_id = $wcf_step_obj->get_direct_next_step_id();
627
+
628
+ if ( $next_step_id ) {
629
+
630
+ $order_recieve_url = get_permalink( $next_step_id );
631
+ $query_param = array(
632
+ 'wcf-key' => $order->get_order_key(),
633
+ 'wcf-order' => $order->get_id(),
634
+ );
635
+
636
+ if ( 'yes' === wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-pass-fields' ) ) {
637
+
638
+ $fields_string = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-pass-specific-fields' );
639
+
640
+ $fields = array_map( 'trim', explode( ',', $fields_string ) );
641
+
642
+ if ( is_array( $fields ) ) {
643
+
644
+ $order_id = $order->get_id();
645
+
646
+ foreach ( $fields as $in => $key ) {
647
+ switch ( $key ) {
648
+ case 'first_name':
649
+ $query_param[ $key ] = $order->get_billing_first_name();
650
+ break;
651
+ case 'last_name':
652
+ $query_param[ $key ] = $order->get_billing_last_name();
653
+ break;
654
+ case 'email':
655
+ $query_param[ $key ] = $order->get_billing_email();
656
+ break;
657
+ default:
658
+ $query_param[ $key ] = get_post_meta( $order_id, '_billing_' . $key, true );
659
+ break;
660
+ }
661
+ }
662
+ }
663
+ }
664
+
665
+ $order_recieve_url = add_query_arg(
666
+ $query_param,
667
+ $order_recieve_url
668
+ );
669
+ }
670
+ }
671
+
672
+ wcf()->logger->log( 'End-' . __CLASS__ . '::' . __FUNCTION__ );
673
+
674
+ return $order_recieve_url;
675
+ }
676
+ }
677
+
678
+ /**
679
+ * Prepare if class 'Cartflows_Frontend' exist.
680
+ * Kicking this off by calling 'get_instance()' method
681
+ */
682
+ Cartflows_Frontend::get_instance();
classes/class-cartflows-functions.php CHANGED
@@ -549,11 +549,17 @@ function wcf_get_page_builder_notice() {
549
  $notice = '';
550
  $page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
551
 
 
 
552
  $page_builder_data = array(
553
- 'elementor' => array(
554
  'name' => 'Elementor',
555
  'doc' => 'https://cartflows.com/docs/elementor-widgets-of-cartflows/',
556
  ),
 
 
 
 
557
  );
558
 
559
  if ( isset( $page_builder_data[ $page_builder ] ) ) {
549
  $notice = '';
550
  $page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
551
 
552
+ $supported_page_builders = array( 'elementor', 'beaver-builder' );
553
+
554
  $page_builder_data = array(
555
+ 'elementor' => array(
556
  'name' => 'Elementor',
557
  'doc' => 'https://cartflows.com/docs/elementor-widgets-of-cartflows/',
558
  ),
559
+ 'beaver-builder' => array(
560
+ 'name' => 'Beaver Builder',
561
+ 'doc' => 'https://cartflows.com/docs/beaver-builder-modules-of-cartflows/',
562
+ ),
563
  );
564
 
565
  if ( isset( $page_builder_data[ $page_builder ] ) ) {
classes/class-cartflows-helper.php CHANGED
@@ -292,13 +292,15 @@ class Cartflows_Helper {
292
 
293
  if ( null === self::$common ) {
294
 
 
 
 
 
 
 
295
  $common_default = apply_filters(
296
  'cartflows_common_settings_default',
297
- array(
298
- 'disallow_indexing' => 'disable',
299
- 'global_checkout' => '',
300
- 'default_page_builder' => 'elementor',
301
- )
302
  );
303
 
304
  $common = self::get_admin_settings_option( '_cartflows_common', false, false );
292
 
293
  if ( null === self::$common ) {
294
 
295
+ $common_settings = array(
296
+ 'disallow_indexing' => 'disable',
297
+ 'global_checkout' => '',
298
+ 'default_page_builder' => 'elementor',
299
+ );
300
+
301
  $common_default = apply_filters(
302
  'cartflows_common_settings_default',
303
+ $common_settings
 
 
 
 
304
  );
305
 
306
  $common = self::get_admin_settings_option( '_cartflows_common', false, false );
classes/class-cartflows-importer.php CHANGED
@@ -1,1742 +1,1742 @@
1
- <?php
2
- /**
3
- * CartFlows Admin
4
- *
5
- * @package CartFlows
6
- * @since 1.0.0
7
- */
8
-
9
- if ( ! class_exists( 'CartFlows_Importer' ) ) :
10
-
11
- /**
12
- * CartFlows Import
13
- *
14
- * @since 1.0.0
15
- */
16
- class CartFlows_Importer {
17
-
18
- /**
19
- * Instance
20
- *
21
- * @since 1.0.0
22
- * @access private
23
- * @var object Class object.
24
- */
25
- private static $instance;
26
-
27
- /**
28
- * Initiator
29
- *
30
- * @since 1.0.0
31
- * @return object initialized object of class.
32
- */
33
- public static function get_instance() {
34
- if ( ! isset( self::$instance ) ) {
35
- self::$instance = new self();
36
- }
37
-
38
- return self::$instance;
39
- }
40
-
41
- /**
42
- * Constructor
43
- *
44
- * @since 1.0.0
45
- */
46
- public function __construct() {
47
- add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
48
-
49
- add_action( 'wp_ajax_cartflows_step_import', array( $this, 'import_step' ) );
50
- add_action( 'wp_ajax_cartflows_create_flow', array( $this, 'create_flow' ) );
51
- add_action( 'wp_ajax_cartflows_import_flow_step', array( $this, 'import_flow' ) );
52
- add_action( 'wp_ajax_cartflows_default_flow', array( $this, 'create_default_flow' ) );
53
- add_action( 'wp_ajax_cartflows_step_create_blank', array( $this, 'step_create_blank' ) );
54
-
55
- add_action( 'admin_footer', array( $this, 'js_templates' ) );
56
- add_action( 'cartflows_import_complete', array( $this, 'clear_cache' ) );
57
-
58
- add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
59
-
60
- add_action( 'wp_ajax_cartflows_activate_plugin', array( $this, 'activate_plugin' ) );
61
-
62
- add_action( 'admin_menu', array( $this, 'add_to_menus' ) );
63
- add_action( 'admin_init', array( $this, 'export_json' ) );
64
- add_action( 'admin_init', array( $this, 'import_json' ) );
65
- add_filter( 'post_row_actions', array( $this, 'export_link' ), 10, 2 );
66
- add_action( 'admin_action_cartflows_export_flow', array( $this, 'export_flow' ) );
67
- }
68
-
69
- /**
70
- * Add the export link to action list for flows row actions
71
- *
72
- * @since 1.1.4
73
- *
74
- * @param array $actions Actions array.
75
- * @param object $post Post object.
76
- *
77
- * @return array
78
- */
79
- public function export_link( $actions, $post ) {
80
- if ( current_user_can( 'edit_posts' ) && isset( $post ) && CARTFLOWS_FLOW_POST_TYPE === $post->post_type ) {
81
- $actions['export'] = '<a href="' . wp_nonce_url( 'admin.php?action=cartflows_export_flow&post=' . $post->ID, basename( __FILE__ ), 'flow_export_nonce' ) . '" title="' . __( 'Export this flow', 'cartflows' ) . '" rel="permalink">' . __( 'Export', 'cartflows' ) . '</a>';
82
- }
83
- return $actions;
84
- }
85
-
86
- /**
87
- * Add menus
88
- *
89
- * @since 1.1.4
90
- */
91
- public function add_to_menus() {
92
- add_submenu_page( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE, __( 'Flow Export', 'cartflows' ), __( 'Flow Export', 'cartflows' ), 'export', 'flow_exporter', array( $this, 'exporter_markup' ) );
93
- add_submenu_page( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE, __( 'Flow Import', 'cartflows' ), __( 'Flow Import', 'cartflows' ), 'import', 'flow_importer', array( $this, 'importer_markup' ) );
94
- }
95
-
96
- /**
97
- * Export flow with steps and its meta
98
- *
99
- * @since 1.1.4
100
- */
101
- public function export_flow() {
102
-
103
- if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && 'cartflows_export_flow' == $_REQUEST['action'] ) ) ) {
104
- wp_die( esc_html__( 'No post to export has been supplied!', 'cartflows' ) );
105
- }
106
-
107
- if ( ! isset( $_GET['flow_export_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['flow_export_nonce'] ) ), basename( __FILE__ ) ) ) {
108
- return;
109
- }
110
-
111
- // Get the original post id.
112
- $flow_id = ( isset( $_GET['post'] ) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );
113
-
114
- $flows = array();
115
- $flows[] = $this->get_flow_export_data( $flow_id );
116
- $flows = apply_filters( 'cartflows_export_data', $flows );
117
-
118
- nocache_headers();
119
- header( 'Content-Type: application/json; charset=utf-8' );
120
- header( 'Content-Disposition: attachment; filename=cartflows-flow-' . $flow_id . '-' . gmdate( 'm-d-Y' ) . '.json' );
121
- header( 'Expires: 0' );
122
-
123
- echo wp_json_encode( $flows );
124
- exit;
125
- }
126
-
127
- /**
128
- * Export flow markup
129
- *
130
- * @since 1.1.4
131
- */
132
- public function exporter_markup() {
133
- include_once CARTFLOWS_DIR . 'includes/exporter.php';
134
- }
135
-
136
- /**
137
- * Import flow markup
138
- *
139
- * @since 1.1.4
140
- */
141
- public function importer_markup() {
142
- include_once CARTFLOWS_DIR . 'includes/importer.php';
143
- }
144
-
145
- /**
146
- * Export flow
147
- *
148
- * @since 1.1.4
149
- */
150
- public function export_json() {
151
- if ( empty( $_POST['cartflows-action'] ) || 'export' != $_POST['cartflows-action'] ) {
152
- return;
153
- }
154
-
155
- if ( ! isset( $_POST['cartflows-action-nonce'] ) || empty( $_POST['cartflows-action-nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-action-nonce'] ) ), 'cartflows-action-nonce' ) ) {
156
- return;
157
- }
158
-
159
- if ( ! current_user_can( 'manage_options' ) ) {
160
- return;
161
- }
162
-
163
- $flows = $this->get_all_flow_export_data();
164
- $flows = apply_filters( 'cartflows_export_data', $flows );
165
-
166
- nocache_headers();
167
- header( 'Content-Type: application/json; charset=utf-8' );
168
- header( 'Content-Disposition: attachment; filename=cartflows-flow-export-' . gmdate( 'm-d-Y' ) . '.json' );
169
- header( 'Expires: 0' );
170
-
171
- echo wp_json_encode( $flows );
172
- exit;
173
- }
174
-
175
- /**
176
- * Get flow export data
177
- *
178
- * @since 1.1.4
179
- *
180
- * @param integer $flow_id Flow ID.
181
- * @return array
182
- */
183
- public function get_flow_export_data( $flow_id ) {
184
-
185
- $export_all = apply_filters( 'cartflows_export_all', true );
186
-
187
- $valid_step_meta_keys = array(
188
- '_wp_page_template',
189
- '_thumbnail_id',
190
- 'classic-editor-remember',
191
- );
192
-
193
- $new_steps = array();
194
- $steps = get_post_meta( $flow_id, 'wcf-steps', true );
195
- if ( $steps ) {
196
- foreach ( $steps as $key => $step ) {
197
-
198
- // Add step post meta.
199
- $new_all_meta = array();
200
- $all_meta = get_post_meta( $step['id'] );
201
-
202
- // Add single step.
203
- $step_data_arr = array(
204
- 'title' => get_the_title( $step['id'] ),
205
- 'type' => $step['type'],
206
- 'meta' => $all_meta,
207
- 'post_content' => '',
208
- );
209
-
210
- if ( $export_all ) {
211
-
212
- $step_post_obj = get_post( $step['id'] );
213
-
214
- $step_data_arr['post_content'] = $step_post_obj->post_content;
215
- }
216
-
217
- $new_steps[] = $step_data_arr;
218
- }
219
- }
220
-
221
- // Add single flow.
222
- return array(
223
- 'title' => get_the_title( $flow_id ),
224
- 'steps' => $new_steps,
225
- );
226
- }
227
-
228
- /**
229
- * Get all flow export data
230
- *
231
- * @since 1.1.4
232
- */
233
- public function get_all_flow_export_data() {
234
-
235
- $query_args = array(
236
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
237
-
238
- // Query performance optimization.
239
- 'fields' => 'ids',
240
- 'no_found_rows' => true,
241
- 'posts_per_page' => -1,
242
- );
243
-
244
- $query = new WP_Query( $query_args );
245
- $flows = array();
246
- if ( $query->posts ) {
247
- foreach ( $query->posts as $key => $post_id ) {
248
- $flows[] = $this->get_flow_export_data( $post_id );
249
- }
250
- }
251
-
252
- return $flows;
253
- }
254
-
255
- /**
256
- * Import our exported file
257
- *
258
- * @since 1.1.4
259
- */
260
- public function import_json() {
261
- if ( empty( $_POST['cartflows-action'] ) || 'import' != $_POST['cartflows-action'] ) {
262
- return;
263
- }
264
-
265
- if ( ! isset( $_POST['cartflows-action-nonce'] ) || empty( $_POST['cartflows-action-nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-action-nonce'] ) ), 'cartflows-action-nonce' ) ) {
266
- return;
267
- }
268
-
269
- if ( ! current_user_can( 'manage_options' ) ) {
270
- return;
271
- }
272
-
273
- $filename = $_FILES['file']['name']; //phpcs:ignore
274
- $file_info = explode( '.', $filename );
275
- $extension = end( $file_info );
276
-
277
- if ( 'json' != $extension ) {
278
- wp_die( esc_html__( 'Please upload a valid .json file', 'cartflows' ) );
279
- }
280
-
281
- $file = $_FILES['file']['tmp_name']; //phpcs:ignore
282
-
283
- if ( empty( $file ) ) {
284
- wp_die( esc_html__( 'Please upload a file to import', 'cartflows' ) );
285
- }
286
-
287
- // Retrieve the settings from the file and convert the JSON object to an array.
288
- $flows = json_decode( file_get_contents( $file ), true );//phpcs:ignore
289
-
290
- $this->import_from_json_data( $flows );
291
-
292
- add_action( 'admin_notices', array( $this, 'imported_successfully' ) );
293
- }
294
-
295
- /**
296
- * Import flow from the JSON data
297
- *
298
- * @since x.x.x
299
- * @param array $flows JSON array.
300
- * @return void
301
- */
302
- public function import_from_json_data( $flows ) {
303
- if ( $flows ) {
304
-
305
- $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
306
-
307
- foreach ( $flows as $key => $flow ) {
308
-
309
- $flow_title = $flow['title'];
310
- if ( post_exists( $flow['title'] ) ) {
311
- $flow_title = $flow['title'] . ' Copy';
312
- }
313
-
314
- // Create post object.
315
- $new_flow_args = apply_filters(
316
- 'cartflows_flow_importer_args',
317
- array(
318
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
319
- 'post_title' => $flow_title,
320
- 'post_status' => 'publish',
321
- )
322
- );
323
-
324
- // Insert the post into the database.
325
- $flow_id = wp_insert_post( $new_flow_args );
326
-
327
- /**
328
- * Fire after flow import
329
- *
330
- * @since x.x.x
331
- * @param int $flow_id Flow ID.
332
- * @param array $new_flow_args Flow post args.
333
- * @param array $flows Flow JSON data.
334
- */
335
- do_action( 'cartflows_flow_imported', $flow_id, $new_flow_args, $flows );
336
-
337
- if ( $flow['steps'] ) {
338
- foreach ( $flow['steps'] as $key => $step ) {
339
-
340
- $new_all_meta = array();
341
- if ( is_array( $step['meta'] ) ) {
342
- foreach ( $step['meta'] as $meta_key => $mvalue ) {
343
- $new_all_meta[ $meta_key ] = maybe_unserialize( $mvalue[0] );
344
- }
345
- }
346
- $new_step_args = apply_filters(
347
- 'cartflows_step_importer_args',
348
- array(
349
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
350
- 'post_title' => $step['title'],
351
- 'post_status' => 'publish',
352
- 'meta_input' => $new_all_meta,
353
- 'post_content' => isset( $step['post_content'] ) ? $step['post_content'] : '',
354
- )
355
- );
356
-
357
- $new_step_id = wp_insert_post( $new_step_args );
358
-
359
- /**
360
- * Fire after step import
361
- *
362
- * @since x.x.x
363
- * @param int $new_step_id step ID.
364
- * @param int $flow_id flow ID.
365
- * @param array $new_step_args Step post args.
366
- * @param array $flow_steps Flow steps.
367
- * @param array $flows All flows JSON data.
368
- */
369
- do_action( 'cartflows_step_imported', $new_step_id, $flow_id, $new_step_args, $flow['steps'], $flows );
370
-
371
- // Insert post meta.
372
- update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
373
-
374
- $step_taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
375
- $current_term = term_exists( $step['type'], $step_taxonomy );
376
-
377
- // // Set type object.
378
- $data = get_term( $current_term['term_id'], $step_taxonomy );
379
- $step_slug = $data->slug;
380
- wp_set_object_terms( $new_step_id, $data->slug, $step_taxonomy );
381
-
382
- // Set type.
383
- update_post_meta( $new_step_id, 'wcf-step-type', $data->slug );
384
-
385
- // Set flow.
386
- wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
387
-
388
- self::get_instance()->set_step_to_flow( $flow_id, $new_step_id, $step['title'], $step_slug );
389
-
390
- if ( isset( $step['post_content'] ) && ! empty( $step['post_content'] ) ) {
391
-
392
- // Download and replace images.
393
- $content = $this->get_content( $step['post_content'] );
394
-
395
- // Update post content.
396
- wp_update_post(
397
- array(
398
- 'ID' => $new_step_id,
399
- 'post_content' => $content,
400
- )
401
- );
402
- }
403
-
404
- // Elementor Data.
405
- if ( ( 'elementor' === $default_page_builder ) && class_exists( '\Elementor\Plugin' ) ) {
406
- // Add "elementor" in import [queue].
407
- // @todo Remove required `allow_url_fopen` support.
408
- if ( ini_get( 'allow_url_fopen' ) && isset( $step['meta']['_elementor_data'] ) ) {
409
- $obj = new \Elementor\TemplateLibrary\CartFlows_Importer_Elementor();
410
- $obj->import_single_template( $new_step_id );
411
- }
412
- }
413
-
414
- // Beaver Builder.
415
- if ( ( 'beaver-builder' === $default_page_builder ) && class_exists( 'FLBuilder' ) ) {
416
- if ( isset( $step['meta']['_fl_builder_data'] ) ) {
417
- CartFlows_Importer_Beaver_Builder::get_instance()->import_single_post( $new_step_id );
418
- }
419
- }
420
- }
421
- }
422
- }
423
- }
424
- }
425
-
426
- /**
427
- * Download and Replace hotlink images
428
- *
429
- * @since x.x.x
430
- *
431
- * @param string $content Mixed post content.
432
- * @return array Hotlink image array.
433
- */
434
- public function get_content( $content = '' ) {
435
-
436
- $content = stripslashes( $content );
437
-
438
- // Extract all links.
439
- $all_links = wp_extract_urls( $content );
440
-
441
- // Not have any link.
442
- if ( empty( $all_links ) ) {
443
- return $content;
444
- }
445
-
446
- $link_mapping = array();
447
- $image_links = array();
448
- $other_links = array();
449
-
450
- // Extract normal and image links.
451
- foreach ( $all_links as $key => $link ) {
452
- if ( preg_match( '/^((https?:\/\/)|(www\.))([a-z0-9-].?)+(:[0-9]+)?\/[\w\-]+\.(jpg|png|gif|jpeg)\/?$/i', $link ) ) {
453
-
454
- // Get all image links.
455
- // Avoid *-150x, *-300x and *-1024x images.
456
- if (
457
- false === strpos( $link, '-150x' ) &&
458
- false === strpos( $link, '-300x' ) &&
459
- false === strpos( $link, '-1024x' )
460
- ) {
461
- $image_links[] = $link;
462
- }
463
- } else {
464
-
465
- // Collect other links.
466
- $other_links[] = $link;
467
- }
468
- }
469
-
470
- // Step 1: Download images.
471
- if ( ! empty( $image_links ) ) {
472
- foreach ( $image_links as $key => $image_url ) {
473
- // Download remote image.
474
- $image = array(
475
- 'url' => $image_url,
476
- 'id' => 0,
477
- );
478
- $downloaded_image = CartFlows_Import_Image::get_instance()->import( $image );
479
-
480
- // Old and New image mapping links.
481
- $link_mapping[ $image_url ] = $downloaded_image['url'];
482
- }
483
- }
484
-
485
- // Step 3: Replace mapping links.
486
- foreach ( $link_mapping as $old_url => $new_url ) {
487
- $content = str_replace( $old_url, $new_url, $content );
488
-
489
- // Replace the slashed URLs if any exist.
490
- $old_url = str_replace( '/', '/\\', $old_url );
491
- $new_url = str_replace( '/', '/\\', $new_url );
492
- $content = str_replace( $old_url, $new_url, $content );
493
- }
494
-
495
- return $content;
496
- }
497
-
498
- /**
499
- * Imported notice
500
- *
501
- * @since 1.1.4
502
- */
503
- public function imported_successfully() {
504
- ?>
505
- <div class="notice notice-success">
506
- <p><?php esc_html_e( 'Successfully imported flows.', 'cartflows' ); ?></p>
507
- </div>
508
- <?php
509
- }
510
-
511
- /**
512
- * Clear Cache.
513
- *
514
- * @since 1.0.0
515
- */
516
- public function clear_cache() {
517
- // Clear 'Elementor' file cache.
518
- if ( class_exists( '\Elementor\Plugin' ) ) {
519
- \Elementor\Plugin::$instance->files_manager->clear_cache();
520
- }
521
- }
522
-
523
- /**
524
- * JS Templates
525
- *
526
- * @since 1.0.0
527
- *
528
- * @return void
529
- */
530
- public function js_templates() {
531
-
532
- // Loading Templates.
533
- ?>
534
- <script type="text/template" id="tmpl-cartflows-step-loading">
535
- <div class="template-message-block cartflows-step-loading">
536
- <h2>
537
- <span class="spinner"></span>
538
- <?php esc_html_e( 'Loading Steps', 'cartflows' ); ?>
539
- </h2>
540
- <p class="description"><?php esc_html_e( 'Getting steps from the cloud. Please wait for the moment.', 'cartflows' ); ?></p>
541
- </div>
542
- </script>
543
-
544
- <?php
545
- // Search Templates.
546
- ?>
547
- <script type="text/template" id="tmpl-cartflows-searching-templates">
548
- <div class="template-message-block cartflows-searching-templates">
549
- <h2>
550
- <span class="spinner"></span>
551
- <?php esc_html_e( 'Searching Template..', 'cartflows' ); ?>
552
- </h2>
553
- <p class="description"><?php esc_html_e( 'Getting templates from the cloud. Please wait for the moment.', 'cartflows' ); ?></p>
554
- </div>
555
- </script>
556
-
557
- <?php
558
- // CartFlows Importing Template.
559
- ?>
560
- <script type="text/template" id="tmpl-cartflows-step-importing">
561
- <div class="template-message-block cartflows-step-importing">
562
- <h2><span class="spinner"></span> <?php esc_html_e( 'Importing..', 'cartflows' ); ?></h2>
563
- </div>
564
- </script>
565
-
566
- <?php
567
- // CartFlows Imported.
568
- ?>
569
- <script type="text/template" id="tmpl-cartflows-step-imported">
570
- <div class="template-message-block cartflows-step-imported">
571
- <h2><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Imported', 'cartflows' ); ?></h2>
572
- <p class="description"><?php esc_html_e( 'Thanks for patience', 'cartflows' ); ?> <span class="dashicons dashicons-smiley"></span></p></div>
573
- </script>
574
-
575
- <?php
576
- // No templates.
577
- ?>
578
- <script type="text/template" id="tmpl-cartflows-no-steps">
579
- <div class="cartflows-no-steps">
580
- <div class="template-message-block">
581
- <h2><?php esc_html_e( 'Coming Soon!', 'cartflows' ); ?></h2>
582
- <p class="description"></p>
583
- </div>
584
- </div>
585
- </script>
586
-
587
- <?php
588
- // No templates.
589
- ?>
590
- <script type="text/template" id="tmpl-cartflows-no-flows">
591
- <div class="cartflows-no-flows">
592
- <div class="template-message-block">
593
- <h2><?php esc_html_e( 'Coming Soon!', 'cartflows' ); ?></h2>
594
- <p class="description"></p>
595
- </div>
596
- </div>
597
- </script>
598
-
599
- <?php
600
- // Error handling.
601
- ?>
602
- <script type="text/template" id="tmpl-templator-error">
603
- <div class="notice notice-error"><p>{{ data }}</p></div>
604
- </script>
605
-
606
- <?php
607
- // Redirect to Elementor.
608
- ?>
609
- <script type="text/template" id="tmpl-templator-redirect-to-elementor">
610
- <div class="template-message-block templator-redirect-to-elementor">
611
- <h2><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Imported', 'cartflows' ); ?></h2>
612
- <p class="description"><?php esc_html_e( 'Thanks for patience', 'cartflows' ); ?> <span class="dashicons dashicons-smiley"></span><br/><br/><?php esc_html_e( 'Redirecting to the Elementor edit window.', 'cartflows' ); ?> </p></div>
613
- </script>
614
-
615
- <?php
616
- /**
617
- * Responsive Buttons
618
- */
619
- ?>
620
- <script type="text/template" id="tmpl-cartflows-responsive-view">
621
- <span class="responsive-view">
622
- <span class="actions">
623
- <a class="desktop" href="#"><span data-view="desktop " class="active dashicons dashicons-desktop"></span></a>
624
- <a class="tablet" href="#"><span data-view="tablet" class="dashicons dashicons-tablet"></span></a>
625
- <a class="mobile" href="#"><span data-view="mobile" class="dashicons dashicons-smartphone"></span></a>
626
- </span>
627
- </span>
628
- </script>
629
-
630
- <?php
631
- // Templates data.
632
- ?>
633
- <script type="text/template" id="tmpl-cartflows-flows-list">
634
-
635
- <# console.log( data.items.length ) #>
636
- <# console.log( data.items ) #>
637
- <# if ( data.items.length ) { #>
638
- <# for ( key in data.items ) { #>
639
- <#
640
- var flow_steps = [];
641
- if( data.items[ key ].flow_steps ) {
642
- flow_steps = data.items[ key ].flow_steps.map(function(value,index) {
643
- return value['id'];
644
- });
645
- }
646
- #>
647
- <div class="inner">
648
- <div class="template">
649
- <span class="thumbnail site-preview cartflows-preview-flow-steps" data-flow-steps="{{ JSON.stringify( data.items[ key ].flow_steps ) }}" data-title="{{ data.items[ key ].title.rendered }}">
650
- <div class="template-screenshot">
651
- <# if( data.items[ key ].featured_image_url ) { #>
652
- <img src="{{ data.items[ key ].featured_image_url }}" />
653
- <# } else { #>
654
- <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/400x400.jpg" />
655
- <# } #>
656
- </div>
657
- <# if( data.items[ key ].flow_type && 'pro' === data.items[ key ].flow_type.slug ) { #>
658
- <span class="wcf-flow-type pro"><?php esc_html_e( 'Pro', 'cartflows' ); ?></span>
659
- <# } #>
660
- <# if( data.items[ key ].woo_required ) { #>
661
- <div class="notice notice-info" style="width: auto;">
662
- <p class="wcf-learn-how">
663
- Install/Activate WooCommerce to use this template.
664
- <a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank">
665
- <strong><?php esc_html_e( 'Learn How', 'cartflows' ); ?></strong>
666
- <i class="dashicons dashicons-external"></i>
667
- </a>
668
- </p>
669
- </div>
670
- <# } else { #>
671
- <a href="<?php echo CARTFLOWS_TEMPLATES_URL . 'preview/?'; ?>flow={{ data.items[ key ].id }}&title={{{ data.items[ key ].title.rendered }}}" class="preview" target="_blank">Preview <i class="dashicons dashicons-external"></i></a>
672
- <# } #>
673
-
674
- </span>
675
- <div class="template-id-container">
676
- <h3 class="template-name"> {{{ data.items[ key ].title.rendered }}} </h3>
677
- <div class="template-actions">
678
-
679
- <#
680
- if( data.items[ key ].page_builder.slug ) {
681
- required_plugin_group = data.items[ key ].page_builder.slug;
682
- } else {
683
- required_plugin_group = '';
684
- }
685
-
686
- if( data.items[ key ].page_builder.slug && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug] && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug].button_title ) {
687
- import_btn_title = CartFlowsImportVars.required_plugins[ data.items[ key ].page_builder.slug ].button_title;
688
- } else {
689
- import_btn_title = 'Import';
690
- } #>
691
-
692
- <# if( data.items[ key ].licence_status && 'valid' === data.items[ key ].licence_status ) { #>
693
- <# if( ! data.items[ key ].woo_required ) { #>
694
- <a data-flow-steps="{{ flow_steps }}" data-required-plugin-group="{{required_plugin_group}}" href="#" class="button button-primary cartflows-step-import" data-template-id="{{ data.items[ key ].id }}">{{ import_btn_title }}</a>
695
- <# } else { #>
696
- <a href='#' class='wcf-activate-wc button-primary'>Install & activate Woo</a>
697
- <# } #>
698
- <# } else if( CartFlowsImportVars._is_pro_active ) { #>
699
- <a target="_blank" href="<?php echo esc_url( admin_url( 'plugins.php?cartflows-license-popup' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate License', 'cartflows' ); ?></a>
700
- <# } else { #>
701
- <a target="_blank" href="<?php echo esc_url( CARTFLOWS_DOMAIN_URL ); ?>" class="button button-primary"><?php esc_html_e( 'Get Pro', 'cartflows' ); ?></a>
702
- <# } #>
703
- </div>
704
- </div>
705
- </div>
706
- </div>
707
- <# } #>
708
- <# } #>
709
- </script>
710
-
711
- <?php
712
- // Empty Step.
713
- ?>
714
- <script type="text/template" id="tmpl-cartflows-create-blank-step">
715
- <div class="inner">
716
- <div class="template">
717
- <span class="thumbnail site-preview cartflows-flow-preview">
718
- <div class="template-screenshot">
719
- <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/start-scratch.jpg" />
720
- </div>
721
- <div id="wcf_create_notice" class=""><a href="https://cartflows.com/" target="_blank"></a></div>
722
- </span>
723
- <div class="template-id-container">
724
- <h3 class="template-name"> Blank </h3>
725
- <div class="template-actions">
726
- <a href="#" class="button button-primary cartflows-step-import-blank"><?php esc_html_e( 'Create', 'cartflows' ); ?></a>
727
- </div>
728
- </div>
729
- </div>
730
- </div>
731
- </script>
732
-
733
- <?php
734
- // Templates data.
735
- ?>
736
- <script type="text/template" id="tmpl-cartflows-steps-list">
737
- <# if ( data.items.length ) { #>
738
- <# for ( key in data.items ) { #>
739
- <#
740
- var flow_steps = [];
741
- if( data.items[ key ].flow_steps ) {
742
- flow_steps = data.items[ key ].flow_steps.map(function(value,index) {
743
- return value['id'];
744
- });
745
- }
746
- #>
747
- <div class="inner">
748
- <div class="template">
749
- <span class="thumbnail site-preview cartflows-preview-flow-steps" data-flow-steps="{{ JSON.stringify( data.items[ key ].flow_steps ) }}" data-title="{{ data.items[ key ].title.rendered }}">
750
- <div class="template-screenshot">
751
- <# if( data.items[ key ].featured_image_url ) { #>
752
- <img src="{{ data.items[ key ].featured_image_url }}" />
753
- <# } else { #>
754
- <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/400x400.jpg" />
755
- <# } #>
756
- </div>
757
- <div id="wcf_create_notice" class=""><a href="https://cartflows.com/" target="_blank"></a></div>
758
-
759
- <# if( data.items[ key ].woo_required ) { #>
760
- <div class="notice notice-info" style="width: auto;">
761
- <p class="wcf-learn-how">
762
- Install/Activate WooCommerce to use this template.
763
- <a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank">
764
- <strong><?php esc_html_e( 'Learn How', 'cartflows' ); ?></strong>
765
- <i class="dashicons dashicons-external"></i>
766
- </a>
767
- </p>
768
- </div>
769
- <# } else { #>
770
- <a href="<?php echo CARTFLOWS_TEMPLATES_URL . 'preview/?'; ?>step={{ data.items[ key ].id }}&title={{{ data.items[ key ].title.rendered }}}" class="preview" target="_blank">Preview <i class="dashicons dashicons-external"></i></a>
771
- <# } #>
772
-
773
- <# if( data.items[ key ].flow_type && 'pro' === data.items[ key ].flow_type.slug ) { #>
774
- <span class="wcf-flow-type pro"><?php esc_html_e( 'Pro', 'cartflows' ); ?></span>
775
- <# } #>
776
- </span>
777
- <div class="template-id-container">
778
- <h3 class="template-name"> {{{ data.items[ key ].title.rendered }}} </h3>
779
- <div class="template-actions">
780
-
781
- <#
782
-
783
- var step_slug = data.items[ key ].step_type.slug || '';
784
- var step_title = data.items[ key ].step_type.name || '';
785
- var import_btn_title = 'Import';
786
-
787
- var required_plugin_group = '';
788
- if( data.items[ key ].page_builder ) {
789
- required_plugin_group = data.items[ key ].page_builder.slug;
790
-
791
- if( data.items[ key ].page_builder.slug && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug] && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug].button_title ) {
792
- import_btn_title = CartFlowsImportVars.required_plugins[ data.items[ key ].page_builder.slug ].button_title;
793
- }
794
- }
795
- #>
796
-
797
- <# if( data.items[ key ].licence_status && 'valid' === data.items[ key ].licence_status ) { #>
798
-
799
- <# if( ! data.items[ key ].woo_required ) { #>
800
- <a data-slug="{{step_slug}}" data-title="{{step_title}}" data-flow-steps="{{ flow_steps }}" data-required-plugin-group="{{required_plugin_group}}" href="#" class="button button-primary cartflows-step-import" data-template-id="{{ data.items[ key ].id }}">{{ import_btn_title }}</a>
801
- <# } else { #>
802
- <a href='#' class='wcf-activate-wc button-primary'>Install & activate Woo</a>
803
- <# } #>
804
-
805
- <# } else if( CartFlowsImportVars._is_pro_active ) { #>
806
- <a target="_blank" href="<?php echo esc_url( admin_url( 'plugins.php?cartflows-license-popup' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate License', 'cartflows' ); ?></a>
807
- <# } else { #>
808
- <a target="_blank" href="<?php echo esc_url( CARTFLOWS_DOMAIN_URL ); ?>" class="button button-primary"><?php esc_html_e( 'Get Pro', 'cartflows' ); ?></a>
809
- <# } #>
810
- </div>
811
- </div>
812
- </div>
813
- </div>
814
- <# } #>
815
- <# } #>
816
- </script>
817
-
818
- <?php
819
- /**
820
- * TMPL - Website Unreachable
821
- */
822
- ?>
823
- <script type="text/template" id="tmpl-cartflows-website-unreachable">
824
- <div class="postbox cartflows-website-unreachable">
825
- <h2><?php esc_html_e( 'Under Maintenance..', 'cartflows' ); ?></h2>
826
- <p><?php esc_html_e( 'If you are seeing this message, most likely our servers are under routine maintenance and we will be back shortly.', 'cartflows' ); ?></p>
827
- <p><?php esc_html_e( 'In rare case, it is possible your website is having trouble connecting with ours. If you need help, please feel free to get in touch with us from our website..', 'cartflows' ); ?></p>
828
- </div>
829
- </script>
830
-
831
- <?php
832
- /**
833
- * TMPL - Filters
834
- */
835
- ?>
836
- <script type="text/template" id="tmpl-cartflows-page-builder-notice">
837
- <?php
838
- $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
839
- $page_builder = Cartflows_Helper::get_required_plugins_for_page_builder( Cartflows_Helper::get_common_setting( 'default_page_builder' ) );
840
- $title = $page_builder['title'];
841
-
842
- $plugin_string = '<a href="#" data-slug="' . esc_html( $default_page_builder ) . '" class="wcf-install-plugin">Please click here and activate ' . esc_html( $title ) . '</a>';
843
- $theme_status = '';
844
- if ( 'divi' === $default_page_builder ) {
845
-
846
- $theme_status = $page_builder['theme-status'];
847
- $plugin_status = $page_builder['plugin-status'];
848
-
849
- if ( 'deactivate' === $theme_status || 'install' === $plugin_status ) {
850
- $plugin_string = 'Please activate ' . esc_html( $title );
851
- } elseif ( ( 'deactivate' === $theme_status || 'not-installed' === $theme_status ) && 'install' === $plugin_status ) {
852
- $plugin_string = 'Please install and activate ' . esc_html( $title );
853
- }
854
- }
855
- ?>
856
- <div class="wcf-page-builder-message">
857
- <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>
858
- <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>
859
- <p>We plan to add design templates made with more page builder shortly!</p>
860
- </div>
861
- </script>
862
-
863
- <?php
864
- /**
865
- * TMPL - Filters
866
- */
867
- ?>
868
- <script type="text/template" id="tmpl-cartflows-term-filters-dropdown">
869
- <# if ( data ) { #>
870
- <select class="{{ data.args.wrapper_class }} {{ data.args.class }}">
871
- <# if ( data.args.show_all ) { #>
872
- <option value="all"> <?php esc_html_e( 'All', 'cartflows' ); ?> </option>
873
- <# } #>
874
- <# if ( CartFlowsImportVars.step_type === data.args.remote_slug ) { #>
875
- <option value=""> <?php esc_html_e( 'Select Step Type', 'cartflows' ); ?> </option>
876
- <# } #>
877
- <# var step_slug_data = []; #>
878
- <# for ( key in data.items ) { #>
879
- <option value='{{ data.items[ key ].id }}' data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</option>
880
-
881
- <# step_slug_data.push( data.items[ key ].slug ); #>
882
-
883
- <# } #>
884
- <# if( step_slug_data.indexOf("optin") === -1){ #>
885
- <option value='0' data-group='0' class="Optin (Woo)" data-slug="optin" data-title="Optin (Woo)">Optin (Woo)</option>
886
- <# } #>
887
- </select>
888
- <# } #>
889
- </script>
890
-
891
- <script type="text/template" id="tmpl-cartflows-term-filters">
892
-
893
- <# if ( data ) { #>
894
-
895
- <?php /* <# if ( CartFlowsImportVars.flow_page_builder === data.args.remote_slug || CartFlowsImportVars.step_page_builder === data.args.remote_slug ) { #> */ ?>
896
- <ul class="{{ data.args.wrapper_class }} {{ data.args.class }}">
897
-
898
- <# if ( data.args.show_all ) { #>
899
- <li>
900
- <a href="#" data-group="all"> All </a>
901
- </li>
902
- <# } #>
903
-
904
- <# for ( key in data.items ) { #>
905
- <li>
906
- <a href="#" data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</a>
907
- </li>
908
- <# } #>
909
-
910
- </ul>
911
-
912
- <?php
913
-
914
- /**
915
- <# } else { #>
916
- <select class="{{ data.args.wrapper_class }} {{ data.args.class }}">
917
-
918
- <# if ( data.args.show_all ) { #>
919
- <option value="all"> <?php _e( 'All', 'cartflows' ); ?> </option>
920
- <# } #>
921
-
922
- <# if ( CartFlowsImportVars.step_type === data.args.remote_slug ) { #>
923
- <option value=""> <?php _e( 'Select Step Type', 'cartflows' ); ?> </option>
924
- <# } #>
925
-
926
- <# for ( key in data.items ) { #>
927
- <option value='{{ data.items[ key ].id }}' data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</option>
928
- <# } #>
929
-
930
- </select>
931
- */
932
- ?>
933
-
934
- <?php /* <# } #> */ ?>
935
-
936
- <# } #>
937
- </script>
938
-
939
- <?php
940
- // Step Type.
941
- ?>
942
- <script type="text/template" id="tmpl-cartflows-step-types">
943
- <ul class="wcf-tab nav-tabs">
944
- <# if( data.items_count ) { #>
945
- <# for( key in data.items ) { #>
946
- <# console.log( data.items[ key ].id ) #>
947
- <li data-slug="{{data.items[ key ].slug}}" data-title="{{ data.items[ key ].name }}">
948
- <a href="#{{{ data.items[ key ].slug }}}">{{{ data.items[ key ].name }}}</a>
949
- </li>
950
- <# } #>
951
- <# } #>
952
- </ul>
953
- </script>
954
-
955
- <?php
956
- // Add to library button.
957
- ?>
958
- <script type="text/template" id="tmpl-templator-add-to-library">
959
- <a class="templator-add-to-library page-title-action cartflows-load-steps-library"><i class="dashicons dashicons-cloud"></i><?php esc_attr_e( 'Import from Cloud', 'cartflows' ); ?></a>
960
- </script>
961
- <?php
962
- }
963
-
964
- /**
965
- * Enqueue scripts
966
- *
967
- * @since 1.0.0
968
- *
969
- * @hook admin_enqueue_scripts
970
- * @param string $hook Current page hook.
971
- */
972
- public function scripts( $hook = '' ) {
973
-
974
- if ( ! self::is_supported_post( get_current_screen()->post_type ) ) {
975
- return;
976
- }
977
-
978
- wp_enqueue_script( 'cartflows-rest-api', CARTFLOWS_URL . 'assets/js/rest-api.js', array( 'jquery' ), CARTFLOWS_VER, true );
979
- wp_enqueue_style( 'cartflows-import', CARTFLOWS_URL . 'assets/css/import.css', null, CARTFLOWS_VER, 'all' );
980
- wp_style_add_data( 'cartflows-import', 'rtl', 'replace' );
981
- wp_enqueue_script( 'cartflows-import', CARTFLOWS_URL . 'assets/js/import.js', array( 'jquery', 'wp-util', 'cartflows-rest-api', 'updates' ), CARTFLOWS_VER, true );
982
-
983
- $installed_plugins = get_plugins();
984
- $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? 'yes' : 'no';
985
- $is_wc_activated = wcf()->is_woo_active ? 'yes' : 'no';
986
-
987
- $localize_vars = array(
988
- '_is_pro_active' => _is_cartflows_pro(),
989
- 'is_wc_installed' => $is_wc_installed,
990
- 'is_wc_activated' => $is_wc_activated,
991
-
992
- // Set API headers for the CartFlows API Calls only.
993
- 'headers' => array(),
994
-
995
- // Flow and its rest fields.
996
- 'flow' => CARTFLOWS_FLOW_POST_TYPE,
997
- 'flow_fields' => array(
998
- 'id',
999
- 'title',
1000
- 'flow_type',
1001
- 'page_builder',
1002
- 'flow_steps',
1003
- 'licence_status',
1004
- 'featured_image_url',
1005
- 'featured_media', // @required for field `featured_image_url`.
1006
- ),
1007
-
1008
- // Flow type and rest fields.
1009
- 'flow_type' => CARTFLOWS_TAXONOMY_FLOW_CATEGORY,
1010
- 'flow_type_fields' => array(
1011
- 'id',
1012
- 'name',
1013
- 'slug',
1014
- ),
1015
-
1016
- // Flow page builder and rest fields.
1017
- 'flow_page_builder' => CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER,
1018
- 'flow_page_builder_fields' => array(
1019
- 'id',
1020
- 'name',
1021
- 'slug',
1022
- ),
1023
-
1024
- // Step page builder and rest fields.
1025
- 'step_page_builder' => CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER,
1026
- 'step_page_builder_fields' => array(
1027
- 'id',
1028
- 'name',
1029
- 'slug',
1030
- ),
1031
-
1032
- // Step and its rest fields.
1033
- 'step' => CARTFLOWS_STEP_POST_TYPE,
1034
- 'step_fields' => array(
1035
- 'title',
1036
- 'featured_image_url',
1037
- 'featured_media', // @required for field `featured_image_url`.
1038
- 'id',
1039
- 'flow_type',
1040
- 'step_type',
1041
- 'page_builder',
1042
- 'licence_status',
1043
- ),
1044
-
1045
- // Step type and its rest fields.
1046
- 'step_type' => CARTFLOWS_TAXONOMY_STEP_TYPE,
1047
- 'step_type_fields' => array(
1048
- 'id',
1049
- 'name',
1050
- 'slug',
1051
- ),
1052
-
1053
- 'domain_url' => CARTFLOWS_DOMAIN_URL,
1054
- 'server_url' => CARTFLOWS_TEMPLATES_URL,
1055
- 'server_rest_url' => CARTFLOWS_TEMPLATES_URL . 'wp-json/wp/v2/',
1056
- 'site_url' => site_url(),
1057
- 'import_url' => admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&page=flow_importer' ),
1058
- 'export_url' => admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&page=flow_exporter' ),
1059
- 'admin_url' => admin_url(),
1060
- 'licence_args' => CartFlows_API::get_instance()->get_licence_args(),
1061
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
1062
- 'debug' => ( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || isset( $_GET['debug'] ) ) ? true : false, //phpcs:ignore
1063
-
1064
- 'required_plugins' => Cartflows_Helper::get_plugins_groupby_page_builders(),
1065
-
1066
- 'default_page_builder' => Cartflows_Helper::get_common_setting( 'default_page_builder' ),
1067
- );
1068
-
1069
- $localize_vars['cartflows_activate_plugin_nonce'] = wp_create_nonce( 'cartflows_activate_plugin' );
1070
-
1071
- // var_dump(Cartflows_Helper::get_common_setting( 'default_page_builder' ));
1072
- // wp_die( );
1073
- // Add thickbox.
1074
- add_thickbox();
1075
-
1076
- wp_localize_script( 'cartflows-import', 'CartFlowsImportVars', $localize_vars );
1077
- wp_localize_script( 'cartflows-rest-api', 'CartFlowsImportVars', $localize_vars );
1078
- }
1079
-
1080
- /**
1081
- * Import.
1082
- *
1083
- * @since 1.0.0
1084
- *
1085
- * @hook wp_ajax_cartflows_import_flow_step
1086
- * @return void
1087
- */
1088
- public function import_flow() {
1089
-
1090
- if ( ! current_user_can( 'manage_options' ) ) {
1091
- return;
1092
- }
1093
-
1094
- check_ajax_referer( 'cf-import-flow-step', 'security' );
1095
-
1096
- $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1097
- $template_id = isset( $_POST['template_id'] ) ? intval( $_POST['template_id'] ) : '';
1098
-
1099
- wcf()->logger->import_log( '------------------------------------' );
1100
- wcf()->logger->import_log( 'STARTED! Importing FLOW' );
1101
- wcf()->logger->import_log( '------------------------------------' );
1102
- wcf()->logger->import_log( '(✓) Creating new step from remote step [' . $template_id . '] for FLOW ' . get_the_title( $flow_id ) . ' [' . $flow_id . ']' );
1103
-
1104
- $response = CartFlows_API::get_instance()->get_template( $template_id );
1105
-
1106
- $post_content = isset( $response['data']['content']->rendered ) ? $response['data']['content']->rendered : '';
1107
- if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1108
- if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1109
- $post_content = $response['data']['divi_content'];
1110
- }
1111
- }
1112
-
1113
- if ( 'gutenberg' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1114
- if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1115
- $post_content = $response['data']['divi_content'];
1116
- }
1117
- }
1118
-
1119
- if ( false === $response['success'] ) {
1120
- wcf()->logger->import_log( '(✕) Failed to fetch remote data.' );
1121
- wp_send_json_error( $response );
1122
- }
1123
-
1124
- wcf()->logger->import_log( '(✓) Successfully getting remote step response ' . wp_json_encode( $response ) );
1125
-
1126
- $new_step_id = wp_insert_post(
1127
- array(
1128
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1129
- 'post_title' => $response['title'],
1130
- 'post_content' => $post_content,
1131
- 'post_status' => 'publish',
1132
- )
1133
- );
1134
-
1135
- if ( is_wp_error( $new_step_id ) ) {
1136
- wcf()->logger->import_log( '(✕) Failed to create new step for flow ' . $flow_id );
1137
- wp_send_json_error( $new_step_id );
1138
- }
1139
-
1140
- if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1141
- if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1142
- update_post_meta( $new_step_id, 'divi_content', $response['data']['divi_content'] );
1143
- }
1144
- }
1145
-
1146
- /* Imported Step */
1147
- update_post_meta( $new_step_id, 'cartflows_imported_step', 'yes' );
1148
-
1149
- wcf()->logger->import_log( '(✓) Created new step ' . '"' . $response['title'] . '" id ' . $new_step_id );//phpcs:ignore
1150
- // insert post meta.
1151
- update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
1152
- wcf()->logger->import_log( '(✓) Added flow ID ' . $flow_id . ' in post meta key wcf-flow-id.' );
1153
-
1154
- /**
1155
- * Import & Set type.
1156
- */
1157
- $term = isset( $response['data']['step_type'] ) ? $response['data']['step_type'] : '';
1158
-
1159
- $term_slug = '';
1160
- if ( $term ) {
1161
-
1162
- $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
1163
- $term_exist = term_exists( $term->slug, $taxonomy );
1164
-
1165
- if ( empty( $term_exist ) ) {
1166
- $terms = array(
1167
- array(
1168
- 'name' => $term->name,
1169
- 'slug' => $term->slug,
1170
- ),
1171
- );
1172
-
1173
- Cartflows_Step_Post_Type::get_instance()->add_terms( $taxonomy, $terms );
1174
- wcf()->logger->import_log( '(✓) Created new term name ' . $term->name . ' | term slug ' . $term->slug );
1175
- }
1176
-
1177
- $current_term = term_exists( $term->slug, $taxonomy );
1178
-
1179
- // Set type object.
1180
- $data = get_term( $current_term['term_id'], $taxonomy );
1181
- $term_slug = $data->slug;
1182
- $term_name = $data->name;
1183
- wp_set_object_terms( $new_step_id, $term_slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
1184
- wcf()->logger->import_log( '(✓) Assigned existing term ' . $term_name . ' to the template ' . $new_step_id );
1185
-
1186
- // Set type.
1187
- update_post_meta( $new_step_id, 'wcf-step-type', $term_slug );
1188
- wcf()->logger->import_log( '(✓) Updated term ' . $term_name . ' to the post meta wcf-step-type.' );
1189
- }
1190
-
1191
- // Set flow.
1192
- wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1193
- wcf()->logger->import_log( '(✓) Assigned flow step flow-' . $flow_id );
1194
-
1195
- /**
1196
- * Update steps for the current flow.
1197
- */
1198
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
1199
-
1200
- if ( ! is_array( $flow_steps ) ) {
1201
- $flow_steps = array();
1202
- }
1203
-
1204
- $flow_steps[] = array(
1205
- 'id' => $new_step_id,
1206
- 'title' => $response['title'],
1207
- 'type' => $term_slug,
1208
- );
1209
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1210
- wcf()->logger->import_log( '(✓) Updated flow steps post meta key \'wcf-steps\' ' . wp_json_encode( $flow_steps ) );
1211
-
1212
- // Import Post Meta.
1213
- self::import_post_meta( $new_step_id, $response );
1214
-
1215
- wcf()->logger->import_log( '(✓) Importing step "' . get_the_title( $new_step_id ) . '" [' . $new_step_id . '] for FLOW "' . get_the_title( $flow_id ) . '" [' . $flow_id . ']' );
1216
- wcf()->logger->import_log( '------------------------------------' );
1217
- wcf()->logger->import_log( 'COMPLETE! Importing FLOW' );
1218
- wcf()->logger->import_log( '------------------------------------' );
1219
-
1220
- do_action( 'cartflows_import_complete' );
1221
- wcf()->logger->import_log( '(✓) BATCH STARTED for step ' . $new_step_id . ' for Blog name \'' . get_bloginfo( 'name' ) . '\' (' . get_current_blog_id() . ')' );
1222
-
1223
- // Batch Process.
1224
- do_action( 'cartflows_after_template_import', $new_step_id, $response );
1225
-
1226
- /**
1227
- * End
1228
- */
1229
- wp_send_json_success( $new_step_id );
1230
- }
1231
-
1232
- /**
1233
- * Import Step.
1234
- *
1235
- * @since 1.0.0
1236
- * @hook wp_ajax_cartflows_step_import
1237
- *
1238
- * @return void
1239
- */
1240
- public function create_default_flow() {
1241
-
1242
- if ( ! current_user_can( 'manage_options' ) ) {
1243
- return;
1244
- }
1245
-
1246
- check_ajax_referer( 'cf-default-flow', 'security' );
1247
-
1248
- // Create post object.
1249
- $new_flow_post = array(
1250
- 'post_content' => '',
1251
- 'post_status' => 'publish',
1252
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
1253
- );
1254
-
1255
- // Insert the post into the database.
1256
- $flow_id = wp_insert_post( $new_flow_post );
1257
-
1258
- if ( is_wp_error( $flow_id ) ) {
1259
- wp_send_json_error( $flow_id->get_error_message() );
1260
- }
1261
-
1262
- $flow_steps = array();
1263
-
1264
- if ( wcf()->is_woo_active ) {
1265
- $steps_data = array(
1266
- 'sales' => array(
1267
- 'title' => __( 'Sales Landing', 'cartflows' ),
1268
- 'type' => 'landing',
1269
- ),
1270
- 'order-form' => array(
1271
- 'title' => __( 'Checkout (Woo)', 'cartflows' ),
1272
- 'type' => 'checkout',
1273
- ),
1274
- 'order-confirmation' => array(
1275
- 'title' => __( 'Thank You (Woo)', 'cartflows' ),
1276
- 'type' => 'thankyou',
1277
- ),
1278
- );
1279
-
1280
- } else {
1281
- $steps_data = array(
1282
- 'landing' => array(
1283
- 'title' => __( 'Landing', 'cartflows' ),
1284
- 'type' => 'landing',
1285
- ),
1286
- 'thankyou' => array(
1287
- 'title' => __( 'Thank You', 'cartflows' ),
1288
- 'type' => 'landing',
1289
- ),
1290
- );
1291
- }
1292
-
1293
- foreach ( $steps_data as $slug => $data ) {
1294
-
1295
- $post_content = '';
1296
- $step_type = trim( $data['type'] );
1297
-
1298
- $step_id = wp_insert_post(
1299
- array(
1300
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1301
- 'post_title' => $data['title'],
1302
- 'post_content' => $post_content,
1303
- 'post_status' => 'publish',
1304
- )
1305
- );
1306
-
1307
- if ( is_wp_error( $step_id ) ) {
1308
- wp_send_json_error( $step_id->get_error_message() );
1309
- }
1310
-
1311
- if ( $step_id ) {
1312
-
1313
- $flow_steps[] = array(
1314
- 'id' => $step_id,
1315
- 'title' => $data['title'],
1316
- 'type' => $step_type,
1317
- );
1318
-
1319
- // insert post meta.
1320
- update_post_meta( $step_id, 'wcf-flow-id', $flow_id );
1321
- update_post_meta( $step_id, 'wcf-step-type', $step_type );
1322
-
1323
- wp_set_object_terms( $step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
1324
- wp_set_object_terms( $step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1325
-
1326
- update_post_meta( $step_id, '_wp_page_template', 'cartflows-default' );
1327
- }
1328
- }
1329
-
1330
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1331
-
1332
- wp_send_json_success( $flow_id );
1333
- }
1334
-
1335
- /**
1336
- * Create Flow
1337
- *
1338
- * @return void
1339
- */
1340
- public function create_flow() {
1341
-
1342
- if ( ! current_user_can( 'manage_options' ) ) {
1343
- return;
1344
- }
1345
-
1346
- check_ajax_referer( 'cf-create-flow', 'security' );
1347
-
1348
- // Create post object.
1349
- $new_flow_post = array(
1350
- 'post_content' => '',
1351
- 'post_status' => 'publish',
1352
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
1353
- );
1354
-
1355
- // Insert the post into the database.
1356
- $flow_id = wp_insert_post( $new_flow_post );
1357
-
1358
- if ( is_wp_error( $flow_id ) ) {
1359
- wp_send_json_error( $flow_id->get_error_message() );
1360
- }
1361
-
1362
- /* Imported Flow */
1363
- update_post_meta( $flow_id, 'cartflows_imported_flow', 'yes' );
1364
-
1365
- wp_send_json_success( $flow_id );
1366
- }
1367
-
1368
- /**
1369
- * Create Step
1370
- *
1371
- * @return void
1372
- */
1373
- public function import_step() {
1374
-
1375
- if ( ! current_user_can( 'manage_options' ) ) {
1376
- return;
1377
- }
1378
-
1379
- check_ajax_referer( 'cf-step-import', 'security' );
1380
-
1381
- $template_id = isset( $_POST['template_id'] ) ? intval( $_POST['template_id'] ) : '';
1382
- $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1383
- $step_title = isset( $_POST['step_title'] ) ? sanitize_text_field( wp_unslash( $_POST['step_title'] ) ) : '';
1384
- $step_type = isset( $_POST['step_type'] ) ? sanitize_title( wp_unslash( $_POST['step_type'] ) ) : '';
1385
- $step_custom_title = isset( $_POST['step_custom_title'] ) ? sanitize_title( wp_unslash( $_POST['step_custom_title'] ) ) : $step_title;
1386
-
1387
- $cartflow_meta = Cartflows_Flow_Meta::get_instance();
1388
-
1389
- $post_id = $cartflow_meta->create_step( $flow_id, $step_type, $step_custom_title );
1390
-
1391
- wcf()->logger->import_log( '------------------------------------' );
1392
- wcf()->logger->import_log( 'STARTED! Importing STEP' );
1393
- wcf()->logger->import_log( '------------------------------------' );
1394
-
1395
- if ( empty( $template_id ) || empty( $post_id ) ) {
1396
- /* translators: %s: template ID */
1397
- $data = sprintf( __( 'Invalid template id %1$s or post id %2$s.', 'cartflows' ), $template_id, $post_id );
1398
- wcf()->logger->import_log( $data );
1399
- wp_send_json_error( $data );
1400
- }
1401
-
1402
- wcf()->logger->import_log( 'Remote Step ' . $template_id . ' for local flow "' . get_the_title( $post_id ) . '" [' . $post_id . ']' );
1403
-
1404
- $response = CartFlows_API::get_instance()->get_template( $template_id );
1405
-
1406
- if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1407
- if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1408
-
1409
- update_post_meta( $post_id, 'divi_content', $response['data']['divi_content'] );
1410
-
1411
- wp_update_post(
1412
- array(
1413
- 'ID' => $post_id,
1414
- 'post_content' => $response['data']['divi_content'],
1415
- )
1416
- );
1417
- }
1418
- }
1419
-
1420
- if ( 'gutenberg' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1421
- if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1422
-
1423
- wp_update_post(
1424
- array(
1425
- 'ID' => $post_id,
1426
- 'post_content' => $response['data']['divi_content'],
1427
- )
1428
- );
1429
- }
1430
- }
1431
-
1432
- /* Imported Step */
1433
- update_post_meta( $post_id, 'cartflows_imported_step', 'yes' );
1434
-
1435
- // Import Post Meta.
1436
- self::import_post_meta( $post_id, $response );
1437
-
1438
- do_action( 'cartflows_import_complete' );
1439
-
1440
- // Batch Process.
1441
- do_action( 'cartflows_after_template_import', $post_id, $response );
1442
-
1443
- wcf()->logger->import_log( '------------------------------------' );
1444
- wcf()->logger->import_log( 'COMPLETE! Importing Step' );
1445
- wcf()->logger->import_log( '------------------------------------' );
1446
-
1447
- wp_send_json_success( $post_id );
1448
- }
1449
-
1450
- /**
1451
- * Import Step.
1452
- *
1453
- * @since 1.0.0
1454
- * @hook wp_ajax_cartflows_step_create_blank
1455
- *
1456
- * @return void
1457
- */
1458
- public function step_create_blank() {
1459
-
1460
- if ( ! current_user_can( 'manage_options' ) ) {
1461
- return;
1462
- }
1463
-
1464
- check_ajax_referer( 'cf-step-create-blank', 'security' );
1465
-
1466
- $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1467
- $step_type = isset( $_POST['step_type'] ) ? sanitize_text_field( wp_unslash( $_POST['step_type'] ) ) : '';
1468
- $step_title = isset( $_POST['step_title'] ) ? sanitize_text_field( wp_unslash( $_POST['step_title'] ) ) : '';
1469
-
1470
- if ( empty( $flow_id ) || empty( $step_type ) ) {
1471
- /* translators: %s: flow ID */
1472
- $data = sprintf( __( 'Invalid flow id %1$s OR step type %2$s.', 'cartflows' ), $flow_id, $step_type );
1473
- wcf()->logger->import_log( $data );
1474
- wp_send_json_error( $data );
1475
- }
1476
-
1477
- wcf()->logger->import_log( '------------------------------------' );
1478
- wcf()->logger->import_log( 'STARTED! Creating Blank STEP for Flow ' . $flow_id );
1479
-
1480
- $step_type_title = str_replace( '-', ' ', $step_type );
1481
- $step_type_slug = strtolower( str_replace( '-', ' ', $step_type ) );
1482
-
1483
- $new_step_id = wp_insert_post(
1484
- array(
1485
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1486
- 'post_title' => $step_title,
1487
- 'post_content' => '',
1488
- 'post_status' => 'publish',
1489
- )
1490
- );
1491
-
1492
- // insert post meta.
1493
- update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
1494
-
1495
- $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
1496
- $term_exist = term_exists( $step_type_slug, $taxonomy );
1497
-
1498
- if ( empty( $term_exist ) ) {
1499
- $terms = array(
1500
- array(
1501
- 'name' => $step_type_title,
1502
- 'slug' => $step_type_slug,
1503
- ),
1504
- );
1505
-
1506
- Cartflows_Step_Post_Type::get_instance()->add_terms( $taxonomy, $terms );
1507
- wcf()->logger->import_log( '(✓) Created new term name ' . $step_type_title . ' | term slug ' . $step_type_slug );
1508
- }
1509
-
1510
- $current_term = term_exists( $step_type_slug, $taxonomy );
1511
-
1512
- // Set type object.
1513
- $data = get_term( $current_term['term_id'], $taxonomy );
1514
- $step_slug = $data->slug;
1515
- wp_set_object_terms( $new_step_id, $data->slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
1516
- wcf()->logger->import_log( '(✓) Assigned existing term ' . $step_type_title . ' to the template ' . $new_step_id );
1517
-
1518
- // Set Default page Layout.
1519
- update_post_meta( $new_step_id, '_wp_page_template', 'cartflows-default' );
1520
-
1521
- // Set type.
1522
- update_post_meta( $new_step_id, 'wcf-step-type', $data->slug );
1523
- wcf()->logger->import_log( '(✓) Updated term ' . $data->name . ' to the post meta wcf-step-type.' );
1524
-
1525
- // Set flow.
1526
- wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1527
- wcf()->logger->import_log( '(✓) Assigned flow step flow-' . $flow_id );
1528
-
1529
- self::get_instance()->set_step_to_flow( $flow_id, $new_step_id, $step_type_title, $step_slug );
1530
-
1531
- wcf()->logger->import_log( 'COMPLETE! Creating Blank STEP for Flow ' . $flow_id );
1532
- wcf()->logger->import_log( '------------------------------------' );
1533
-
1534
- wp_send_json_success( $new_step_id );
1535
- }
1536
-
1537
- /**
1538
- * Import Post Meta
1539
- *
1540
- * @since 1.0.0
1541
- *
1542
- * @param integer $post_id Post ID.
1543
- * @param array $response Post meta.
1544
- * @return void
1545
- */
1546
- public static function import_post_meta( $post_id, $response ) {
1547
-
1548
- $metadata = (array) $response['post_meta'];
1549
-
1550
- foreach ( $metadata as $meta_key => $meta_value ) {
1551
- $meta_value = isset( $meta_value[0] ) ? $meta_value[0] : '';
1552
-
1553
- if ( $meta_value ) {
1554
-
1555
- if ( is_serialized( $meta_value, true ) ) {
1556
- $raw_data = maybe_unserialize( stripslashes( $meta_value ) );
1557
- } elseif ( is_array( $meta_value ) ) {
1558
- $raw_data = json_decode( stripslashes( $meta_value ), true );
1559
- } else {
1560
- $raw_data = $meta_value;
1561
- }
1562
-
1563
- if ( '_elementor_data' === $meta_key ) {
1564
- if ( is_array( $raw_data ) ) {
1565
- $raw_data = wp_slash( wp_json_encode( $raw_data ) );
1566
- } else {
1567
- $raw_data = wp_slash( $raw_data );
1568
- }
1569
- }
1570
- if ( '_elementor_data' !== $meta_key && '_elementor_draft' !== $meta_key && '_fl_builder_data' !== $meta_key && '_fl_builder_draft' !== $meta_key ) {
1571
- if ( is_array( $raw_data ) ) {
1572
- wcf()->logger->import_log( '(✓) Added post meta ' . $meta_key . ' | ' . wp_json_encode( $raw_data ) );
1573
- } else {
1574
- if ( ! is_object( $raw_data ) ) {
1575
- wcf()->logger->import_log( '(✓) Added post meta ' . $meta_key . ' | ' . $raw_data );
1576
- }
1577
- }
1578
- }
1579
-
1580
- update_post_meta( $post_id, $meta_key, $raw_data );
1581
- }
1582
- }
1583
- }
1584
-
1585
- /**
1586
- * Import Template for Elementor
1587
- *
1588
- * @since 1.0.0
1589
- *
1590
- * @param integer $post_id Post ID.
1591
- * @param array $response Post meta.
1592
- * @param array $page_build_data Page build data.
1593
- * @return void
1594
- */
1595
- public static function import_template_elementor( $post_id, $response, $page_build_data ) {
1596
- if ( ! is_plugin_active( 'elementor/elementor.php' ) ) {
1597
- $data = __( 'Elementor is not activated. Please activate plugin Elementor Page Builder to import the step.', 'cartflows' );
1598
- wcf()->logger->import_log( $data );
1599
- wp_send_json_error( $data );
1600
- }
1601
-
1602
- require_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-importer-elementor.php';
1603
-
1604
- wcf()->logger->import_log( '# Started "importing page builder data" for step ' . $post_id );
1605
-
1606
- $obj = new \Elementor\TemplateLibrary\CartFlows_Importer_Elementor();
1607
- $obj->import_single_template( $post_id );
1608
-
1609
- wcf()->logger->import_log( '# Complete "importing page builder data" for step ' . $post_id );
1610
- }
1611
-
1612
- /**
1613
- * Supported post types
1614
- *
1615
- * @since 1.0.0
1616
- *
1617
- * @return array Supported post types.
1618
- */
1619
- public static function supported_post_types() {
1620
- return apply_filters(
1621
- 'cartflows_supported_post_types',
1622
- array(
1623
- CARTFLOWS_FLOW_POST_TYPE,
1624
- )
1625
- );
1626
- }
1627
-
1628
- /**
1629
- * Check supported post type
1630
- *
1631
- * @since 1.0.0
1632
- *
1633
- * @param string $post_type Post type.
1634
- * @return boolean Supported post type status.
1635
- */
1636
- public static function is_supported_post( $post_type = '' ) {
1637
-
1638
- if ( in_array( $post_type, self::supported_post_types(), true ) ) {
1639
- return true;
1640
- }
1641
-
1642
- return false;
1643
- }
1644
-
1645
- /**
1646
- * Set steps to the flow
1647
- *
1648
- * @param integer $flow_id Flow ID.
1649
- * @param integer $new_step_id New step ID.
1650
- * @param string $step_title Flow Type.
1651
- * @param string $step_slug Flow Type.
1652
- */
1653
- public function set_step_to_flow( $flow_id, $new_step_id, $step_title, $step_slug ) {
1654
- // Update steps for the current flow.
1655
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
1656
-
1657
- if ( ! is_array( $flow_steps ) ) {
1658
- $flow_steps = array();
1659
- }
1660
-
1661
- $flow_steps[] = array(
1662
- 'id' => $new_step_id,
1663
- 'title' => $step_title,
1664
- 'type' => $step_slug,
1665
- );
1666
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1667
- wcf()->logger->import_log( '(✓) Updated flow steps post meta key \'wcf-steps\' ' . wp_json_encode( $flow_steps ) );
1668
- }
1669
-
1670
- /**
1671
- * Localize variables in admin
1672
- *
1673
- * @param array $vars variables.
1674
- */
1675
- public function localize_vars( $vars ) {
1676
-
1677
- $ajax_actions = array(
1678
- 'cf_step_import',
1679
- 'cf_load_steps',
1680
- 'cf_create_flow',
1681
- 'cf_default_flow',
1682
- 'cf_step_create_blank',
1683
- 'cf_import_flow_step',
1684
- );
1685
-
1686
- foreach ( $ajax_actions as $action ) {
1687
-
1688
- $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
1689
- }
1690
-
1691
- return $vars;
1692
- }
1693
-
1694
- /**
1695
- * Ajax action to activate plugin
1696
- */
1697
- public function activate_plugin() {
1698
-
1699
- if ( ! check_ajax_referer( 'cartflows_activate_plugin', 'security', false ) ) {
1700
- wp_send_json_error( esc_html__( 'Action failed. Invalid Security Nonce.', 'cartflows' ) );
1701
- }
1702
-
1703
- if ( ! current_user_can( 'activate_plugins' ) ) {
1704
- wp_send_json_error(
1705
- array(
1706
- 'success' => false,
1707
- 'message' => __( 'User have not plugin install permissions.', 'cartflows' ),
1708
- )
1709
- );
1710
- }
1711
-
1712
- $plugin_init = isset( $_POST['plugin_init'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin_init'] ) ) : '';
1713
-
1714
- $activate = activate_plugin( $plugin_init, '', false, true );
1715
-
1716
- if ( is_wp_error( $activate ) ) {
1717
- wp_send_json_error(
1718
- array(
1719
- 'success' => false,
1720
- 'message' => $activate->get_error_message(),
1721
- 'init' => $plugin_init,
1722
- )
1723
- );
1724
- }
1725
-
1726
- wp_send_json_success(
1727
- array(
1728
- 'success' => true,
1729
- 'message' => __( 'Plugin Successfully Activated', 'cartflows' ),
1730
- 'init' => $plugin_init,
1731
- )
1732
- );
1733
- }
1734
-
1735
- }
1736
-
1737
- /**
1738
- * Initialize class object with 'get_instance()' method
1739
- */
1740
- CartFlows_Importer::get_instance();
1741
-
1742
- endif;
1
+ <?php
2
+ /**
3
+ * CartFlows Admin
4
+ *
5
+ * @package CartFlows
6
+ * @since 1.0.0
7
+ */
8
+
9
+ if ( ! class_exists( 'CartFlows_Importer' ) ) :
10
+
11
+ /**
12
+ * CartFlows Import
13
+ *
14
+ * @since 1.0.0
15
+ */
16
+ class CartFlows_Importer {
17
+
18
+ /**
19
+ * Instance
20
+ *
21
+ * @since 1.0.0
22
+ * @access private
23
+ * @var object Class object.
24
+ */
25
+ private static $instance;
26
+
27
+ /**
28
+ * Initiator
29
+ *
30
+ * @since 1.0.0
31
+ * @return object initialized object of class.
32
+ */
33
+ public static function get_instance() {
34
+ if ( ! isset( self::$instance ) ) {
35
+ self::$instance = new self();
36
+ }
37
+
38
+ return self::$instance;
39
+ }
40
+
41
+ /**
42
+ * Constructor
43
+ *
44
+ * @since 1.0.0
45
+ */
46
+ public function __construct() {
47
+ add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
48
+
49
+ add_action( 'wp_ajax_cartflows_step_import', array( $this, 'import_step' ) );
50
+ add_action( 'wp_ajax_cartflows_create_flow', array( $this, 'create_flow' ) );
51
+ add_action( 'wp_ajax_cartflows_import_flow_step', array( $this, 'import_flow' ) );
52
+ add_action( 'wp_ajax_cartflows_default_flow', array( $this, 'create_default_flow' ) );
53
+ add_action( 'wp_ajax_cartflows_step_create_blank', array( $this, 'step_create_blank' ) );
54
+
55
+ add_action( 'admin_footer', array( $this, 'js_templates' ) );
56
+ add_action( 'cartflows_import_complete', array( $this, 'clear_cache' ) );
57
+
58
+ add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
59
+
60
+ add_action( 'wp_ajax_cartflows_activate_plugin', array( $this, 'activate_plugin' ) );
61
+
62
+ add_action( 'admin_menu', array( $this, 'add_to_menus' ) );
63
+ add_action( 'admin_init', array( $this, 'export_json' ) );
64
+ add_action( 'admin_init', array( $this, 'import_json' ) );
65
+ add_filter( 'post_row_actions', array( $this, 'export_link' ), 10, 2 );
66
+ add_action( 'admin_action_cartflows_export_flow', array( $this, 'export_flow' ) );
67
+ }
68
+
69
+ /**
70
+ * Add the export link to action list for flows row actions
71
+ *
72
+ * @since 1.1.4
73
+ *
74
+ * @param array $actions Actions array.
75
+ * @param object $post Post object.
76
+ *
77
+ * @return array
78
+ */
79
+ public function export_link( $actions, $post ) {
80
+ if ( current_user_can( 'edit_posts' ) && isset( $post ) && CARTFLOWS_FLOW_POST_TYPE === $post->post_type ) {
81
+ $actions['export'] = '<a href="' . wp_nonce_url( 'admin.php?action=cartflows_export_flow&post=' . $post->ID, basename( __FILE__ ), 'flow_export_nonce' ) . '" title="' . __( 'Export this flow', 'cartflows' ) . '" rel="permalink">' . __( 'Export', 'cartflows' ) . '</a>';
82
+ }
83
+ return $actions;
84
+ }
85
+
86
+ /**
87
+ * Add menus
88
+ *
89
+ * @since 1.1.4
90
+ */
91
+ public function add_to_menus() {
92
+ add_submenu_page( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE, __( 'Flow Export', 'cartflows' ), __( 'Flow Export', 'cartflows' ), 'export', 'flow_exporter', array( $this, 'exporter_markup' ) );
93
+ add_submenu_page( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE, __( 'Flow Import', 'cartflows' ), __( 'Flow Import', 'cartflows' ), 'import', 'flow_importer', array( $this, 'importer_markup' ) );
94
+ }
95
+
96
+ /**
97
+ * Export flow with steps and its meta
98
+ *
99
+ * @since 1.1.4
100
+ */
101
+ public function export_flow() {
102
+
103
+ if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && 'cartflows_export_flow' == $_REQUEST['action'] ) ) ) {
104
+ wp_die( esc_html__( 'No post to export has been supplied!', 'cartflows' ) );
105
+ }
106
+
107
+ if ( ! isset( $_GET['flow_export_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['flow_export_nonce'] ) ), basename( __FILE__ ) ) ) {
108
+ return;
109
+ }
110
+
111
+ // Get the original post id.
112
+ $flow_id = ( isset( $_GET['post'] ) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );
113
+
114
+ $flows = array();
115
+ $flows[] = $this->get_flow_export_data( $flow_id );
116
+ $flows = apply_filters( 'cartflows_export_data', $flows );
117
+
118
+ nocache_headers();
119
+ header( 'Content-Type: application/json; charset=utf-8' );
120
+ header( 'Content-Disposition: attachment; filename=cartflows-flow-' . $flow_id . '-' . gmdate( 'm-d-Y' ) . '.json' );
121
+ header( 'Expires: 0' );
122
+
123
+ echo wp_json_encode( $flows );
124
+ exit;
125
+ }
126
+
127
+ /**
128
+ * Export flow markup
129
+ *
130
+ * @since 1.1.4
131
+ */
132
+ public function exporter_markup() {
133
+ include_once CARTFLOWS_DIR . 'includes/exporter.php';
134
+ }
135
+
136
+ /**
137
+ * Import flow markup
138
+ *
139
+ * @since 1.1.4
140
+ */
141
+ public function importer_markup() {
142
+ include_once CARTFLOWS_DIR . 'includes/importer.php';
143
+ }
144
+
145
+ /**
146
+ * Export flow
147
+ *
148
+ * @since 1.1.4
149
+ */
150
+ public function export_json() {
151
+ if ( empty( $_POST['cartflows-action'] ) || 'export' != $_POST['cartflows-action'] ) {
152
+ return;
153
+ }
154
+
155
+ if ( ! isset( $_POST['cartflows-action-nonce'] ) || empty( $_POST['cartflows-action-nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-action-nonce'] ) ), 'cartflows-action-nonce' ) ) {
156
+ return;
157
+ }
158
+
159
+ if ( ! current_user_can( 'manage_options' ) ) {
160
+ return;
161
+ }
162
+
163
+ $flows = $this->get_all_flow_export_data();
164
+ $flows = apply_filters( 'cartflows_export_data', $flows );
165
+
166
+ nocache_headers();
167
+ header( 'Content-Type: application/json; charset=utf-8' );
168
+ header( 'Content-Disposition: attachment; filename=cartflows-flow-export-' . gmdate( 'm-d-Y' ) . '.json' );
169
+ header( 'Expires: 0' );
170
+
171
+ echo wp_json_encode( $flows );
172
+ exit;
173
+ }
174
+
175
+ /**
176
+ * Get flow export data
177
+ *
178
+ * @since 1.1.4
179
+ *
180
+ * @param integer $flow_id Flow ID.
181
+ * @return array
182
+ */
183
+ public function get_flow_export_data( $flow_id ) {
184
+
185
+ $export_all = apply_filters( 'cartflows_export_all', true );
186
+
187
+ $valid_step_meta_keys = array(
188
+ '_wp_page_template',
189
+ '_thumbnail_id',
190
+ 'classic-editor-remember',
191
+ );
192
+
193
+ $new_steps = array();
194
+ $steps = get_post_meta( $flow_id, 'wcf-steps', true );
195
+ if ( $steps ) {
196
+ foreach ( $steps as $key => $step ) {
197
+
198
+ // Add step post meta.
199
+ $new_all_meta = array();
200
+ $all_meta = get_post_meta( $step['id'] );
201
+
202
+ // Add single step.
203
+ $step_data_arr = array(
204
+ 'title' => get_the_title( $step['id'] ),
205
+ 'type' => $step['type'],
206
+ 'meta' => $all_meta,
207
+ 'post_content' => '',
208
+ );
209
+
210
+ if ( $export_all ) {
211
+
212
+ $step_post_obj = get_post( $step['id'] );
213
+
214
+ $step_data_arr['post_content'] = $step_post_obj->post_content;
215
+ }
216
+
217
+ $new_steps[] = $step_data_arr;
218
+ }
219
+ }
220
+
221
+ // Add single flow.
222
+ return array(
223
+ 'title' => get_the_title( $flow_id ),
224
+ 'steps' => $new_steps,
225
+ );
226
+ }
227
+
228
+ /**
229
+ * Get all flow export data
230
+ *
231
+ * @since 1.1.4
232
+ */
233
+ public function get_all_flow_export_data() {
234
+
235
+ $query_args = array(
236
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
237
+
238
+ // Query performance optimization.
239
+ 'fields' => 'ids',
240
+ 'no_found_rows' => true,
241
+ 'posts_per_page' => -1,
242
+ );
243
+
244
+ $query = new WP_Query( $query_args );
245
+ $flows = array();
246
+ if ( $query->posts ) {
247
+ foreach ( $query->posts as $key => $post_id ) {
248
+ $flows[] = $this->get_flow_export_data( $post_id );
249
+ }
250
+ }
251
+
252
+ return $flows;
253
+ }
254
+
255
+ /**
256
+ * Import our exported file
257
+ *
258
+ * @since 1.1.4
259
+ */
260
+ public function import_json() {
261
+ if ( empty( $_POST['cartflows-action'] ) || 'import' != $_POST['cartflows-action'] ) {
262
+ return;
263
+ }
264
+
265
+ if ( ! isset( $_POST['cartflows-action-nonce'] ) || empty( $_POST['cartflows-action-nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-action-nonce'] ) ), 'cartflows-action-nonce' ) ) {
266
+ return;
267
+ }
268
+
269
+ if ( ! current_user_can( 'manage_options' ) ) {
270
+ return;
271
+ }
272
+
273
+ $filename = $_FILES['file']['name']; //phpcs:ignore
274
+ $file_info = explode( '.', $filename );
275
+ $extension = end( $file_info );
276
+
277
+ if ( 'json' != $extension ) {
278
+ wp_die( esc_html__( 'Please upload a valid .json file', 'cartflows' ) );
279
+ }
280
+
281
+ $file = $_FILES['file']['tmp_name']; //phpcs:ignore
282
+
283
+ if ( empty( $file ) ) {
284
+ wp_die( esc_html__( 'Please upload a file to import', 'cartflows' ) );
285
+ }
286
+
287
+ // Retrieve the settings from the file and convert the JSON object to an array.
288
+ $flows = json_decode( file_get_contents( $file ), true );//phpcs:ignore
289
+
290
+ $this->import_from_json_data( $flows );
291
+
292
+ add_action( 'admin_notices', array( $this, 'imported_successfully' ) );
293
+ }
294
+
295
+ /**
296
+ * Import flow from the JSON data
297
+ *
298
+ * @since x.x.x
299
+ * @param array $flows JSON array.
300
+ * @return void
301
+ */
302
+ public function import_from_json_data( $flows ) {
303
+ if ( $flows ) {
304
+
305
+ $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
306
+
307
+ foreach ( $flows as $key => $flow ) {
308
+
309
+ $flow_title = $flow['title'];
310
+ if ( post_exists( $flow['title'] ) ) {
311
+ $flow_title = $flow['title'] . ' Copy';
312
+ }
313
+
314
+ // Create post object.
315
+ $new_flow_args = apply_filters(
316
+ 'cartflows_flow_importer_args',
317
+ array(
318
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
319
+ 'post_title' => $flow_title,
320
+ 'post_status' => 'publish',
321
+ )
322
+ );
323
+
324
+ // Insert the post into the database.
325
+ $flow_id = wp_insert_post( $new_flow_args );
326
+
327
+ /**
328
+ * Fire after flow import
329
+ *
330
+ * @since x.x.x
331
+ * @param int $flow_id Flow ID.
332
+ * @param array $new_flow_args Flow post args.
333
+ * @param array $flows Flow JSON data.
334
+ */
335
+ do_action( 'cartflows_flow_imported', $flow_id, $new_flow_args, $flows );
336
+
337
+ if ( $flow['steps'] ) {
338
+ foreach ( $flow['steps'] as $key => $step ) {
339
+
340
+ $new_all_meta = array();
341
+ if ( is_array( $step['meta'] ) ) {
342
+ foreach ( $step['meta'] as $meta_key => $mvalue ) {
343
+ $new_all_meta[ $meta_key ] = maybe_unserialize( $mvalue[0] );
344
+ }
345
+ }
346
+ $new_step_args = apply_filters(
347
+ 'cartflows_step_importer_args',
348
+ array(
349
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
350
+ 'post_title' => $step['title'],
351
+ 'post_status' => 'publish',
352
+ 'meta_input' => $new_all_meta,
353
+ 'post_content' => isset( $step['post_content'] ) ? $step['post_content'] : '',
354
+ )
355
+ );
356
+
357
+ $new_step_id = wp_insert_post( $new_step_args );
358
+
359
+ /**
360
+ * Fire after step import
361
+ *
362
+ * @since x.x.x
363
+ * @param int $new_step_id step ID.
364
+ * @param int $flow_id flow ID.
365
+ * @param array $new_step_args Step post args.
366
+ * @param array $flow_steps Flow steps.
367
+ * @param array $flows All flows JSON data.
368
+ */
369
+ do_action( 'cartflows_step_imported', $new_step_id, $flow_id, $new_step_args, $flow['steps'], $flows );
370
+
371
+ // Insert post meta.
372
+ update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
373
+
374
+ $step_taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
375
+ $current_term = term_exists( $step['type'], $step_taxonomy );
376
+
377
+ // // Set type object.
378
+ $data = get_term( $current_term['term_id'], $step_taxonomy );
379
+ $step_slug = $data->slug;
380
+ wp_set_object_terms( $new_step_id, $data->slug, $step_taxonomy );
381
+
382
+ // Set type.
383
+ update_post_meta( $new_step_id, 'wcf-step-type', $data->slug );
384
+
385
+ // Set flow.
386
+ wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
387
+
388
+ self::get_instance()->set_step_to_flow( $flow_id, $new_step_id, $step['title'], $step_slug );
389
+
390
+ if ( isset( $step['post_content'] ) && ! empty( $step['post_content'] ) ) {
391
+
392
+ // Download and replace images.
393
+ $content = $this->get_content( $step['post_content'] );
394
+
395
+ // Update post content.
396
+ wp_update_post(
397
+ array(
398
+ 'ID' => $new_step_id,
399
+ 'post_content' => $content,
400
+ )
401
+ );
402
+ }
403
+
404
+ // Elementor Data.
405
+ if ( ( 'elementor' === $default_page_builder ) && class_exists( '\Elementor\Plugin' ) ) {
406
+ // Add "elementor" in import [queue].
407
+ // @todo Remove required `allow_url_fopen` support.
408
+ if ( ini_get( 'allow_url_fopen' ) && isset( $step['meta']['_elementor_data'] ) ) {
409
+ $obj = new \Elementor\TemplateLibrary\CartFlows_Importer_Elementor();
410
+ $obj->import_single_template( $new_step_id );
411
+ }
412
+ }
413
+
414
+ // Beaver Builder.
415
+ if ( ( 'beaver-builder' === $default_page_builder ) && class_exists( 'FLBuilder' ) ) {
416
+ if ( isset( $step['meta']['_fl_builder_data'] ) ) {
417
+ CartFlows_Importer_Beaver_Builder::get_instance()->import_single_post( $new_step_id );
418
+ }
419
+ }
420
+ }
421
+ }
422
+ }
423
+ }
424
+ }
425
+
426
+ /**
427
+ * Download and Replace hotlink images
428
+ *
429
+ * @since x.x.x
430
+ *
431
+ * @param string $content Mixed post content.
432
+ * @return array Hotlink image array.
433
+ */
434
+ public function get_content( $content = '' ) {
435
+
436
+ $content = stripslashes( $content );
437
+
438
+ // Extract all links.
439
+ $all_links = wp_extract_urls( $content );
440
+
441
+ // Not have any link.
442
+ if ( empty( $all_links ) ) {
443
+ return $content;
444
+ }
445
+
446
+ $link_mapping = array();
447
+ $image_links = array();
448
+ $other_links = array();
449
+
450
+ // Extract normal and image links.
451
+ foreach ( $all_links as $key => $link ) {
452
+ if ( preg_match( '/^((https?:\/\/)|(www\.))([a-z0-9-].?)+(:[0-9]+)?\/[\w\-]+\.(jpg|png|gif|jpeg)\/?$/i', $link ) ) {
453
+
454
+ // Get all image links.
455
+ // Avoid *-150x, *-300x and *-1024x images.
456
+ if (
457
+ false === strpos( $link, '-150x' ) &&
458
+ false === strpos( $link, '-300x' ) &&
459
+ false === strpos( $link, '-1024x' )
460
+ ) {
461
+ $image_links[] = $link;
462
+ }
463
+ } else {
464
+
465
+ // Collect other links.
466
+ $other_links[] = $link;
467
+ }
468
+ }
469
+
470
+ // Step 1: Download images.
471
+ if ( ! empty( $image_links ) ) {
472
+ foreach ( $image_links as $key => $image_url ) {
473
+ // Download remote image.
474
+ $image = array(
475
+ 'url' => $image_url,
476
+ 'id' => 0,
477
+ );
478
+ $downloaded_image = CartFlows_Import_Image::get_instance()->import( $image );
479
+
480
+ // Old and New image mapping links.
481
+ $link_mapping[ $image_url ] = $downloaded_image['url'];
482
+ }
483
+ }
484
+
485
+ // Step 3: Replace mapping links.
486
+ foreach ( $link_mapping as $old_url => $new_url ) {
487
+ $content = str_replace( $old_url, $new_url, $content );
488
+
489
+ // Replace the slashed URLs if any exist.
490
+ $old_url = str_replace( '/', '/\\', $old_url );
491
+ $new_url = str_replace( '/', '/\\', $new_url );
492
+ $content = str_replace( $old_url, $new_url, $content );
493
+ }
494
+
495
+ return $content;
496
+ }
497
+
498
+ /**
499
+ * Imported notice
500
+ *
501
+ * @since 1.1.4
502
+ */
503
+ public function imported_successfully() {
504
+ ?>
505
+ <div class="notice notice-success">
506
+ <p><?php esc_html_e( 'Successfully imported flows.', 'cartflows' ); ?></p>
507
+ </div>
508
+ <?php
509
+ }
510
+
511
+ /**
512
+ * Clear Cache.
513
+ *
514
+ * @since 1.0.0
515
+ */
516
+ public function clear_cache() {
517
+ // Clear 'Elementor' file cache.
518
+ if ( class_exists( '\Elementor\Plugin' ) ) {
519
+ \Elementor\Plugin::$instance->files_manager->clear_cache();
520
+ }
521
+ }
522
+
523
+ /**
524
+ * JS Templates
525
+ *
526
+ * @since 1.0.0
527
+ *
528
+ * @return void
529
+ */
530
+ public function js_templates() {
531
+
532
+ // Loading Templates.
533
+ ?>
534
+ <script type="text/template" id="tmpl-cartflows-step-loading">
535
+ <div class="template-message-block cartflows-step-loading">
536
+ <h2>
537
+ <span class="spinner"></span>
538
+ <?php esc_html_e( 'Loading Steps', 'cartflows' ); ?>
539
+ </h2>
540
+ <p class="description"><?php esc_html_e( 'Getting steps from the cloud. Please wait for the moment.', 'cartflows' ); ?></p>
541
+ </div>
542
+ </script>
543
+
544
+ <?php
545
+ // Search Templates.
546
+ ?>
547
+ <script type="text/template" id="tmpl-cartflows-searching-templates">
548
+ <div class="template-message-block cartflows-searching-templates">
549
+ <h2>
550
+ <span class="spinner"></span>
551
+ <?php esc_html_e( 'Searching Template..', 'cartflows' ); ?>
552
+ </h2>
553
+ <p class="description"><?php esc_html_e( 'Getting templates from the cloud. Please wait for the moment.', 'cartflows' ); ?></p>
554
+ </div>
555
+ </script>
556
+
557
+ <?php
558
+ // CartFlows Importing Template.
559
+ ?>
560
+ <script type="text/template" id="tmpl-cartflows-step-importing">
561
+ <div class="template-message-block cartflows-step-importing">
562
+ <h2><span class="spinner"></span> <?php esc_html_e( 'Importing..', 'cartflows' ); ?></h2>
563
+ </div>
564
+ </script>
565
+
566
+ <?php
567
+ // CartFlows Imported.
568
+ ?>
569
+ <script type="text/template" id="tmpl-cartflows-step-imported">
570
+ <div class="template-message-block cartflows-step-imported">
571
+ <h2><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Imported', 'cartflows' ); ?></h2>
572
+ <p class="description"><?php esc_html_e( 'Thanks for patience', 'cartflows' ); ?> <span class="dashicons dashicons-smiley"></span></p></div>
573
+ </script>
574
+
575
+ <?php
576
+ // No templates.
577
+ ?>
578
+ <script type="text/template" id="tmpl-cartflows-no-steps">
579
+ <div class="cartflows-no-steps">
580
+ <div class="template-message-block">
581
+ <h2><?php esc_html_e( 'Coming Soon!', 'cartflows' ); ?></h2>
582
+ <p class="description"></p>
583
+ </div>
584
+ </div>
585
+ </script>
586
+
587
+ <?php
588
+ // No templates.
589
+ ?>
590
+ <script type="text/template" id="tmpl-cartflows-no-flows">
591
+ <div class="cartflows-no-flows">
592
+ <div class="template-message-block">
593
+ <h2><?php esc_html_e( 'Coming Soon!', 'cartflows' ); ?></h2>
594
+ <p class="description"></p>
595
+ </div>
596
+ </div>
597
+ </script>
598
+
599
+ <?php
600
+ // Error handling.
601
+ ?>
602
+ <script type="text/template" id="tmpl-templator-error">
603
+ <div class="notice notice-error"><p>{{ data }}</p></div>
604
+ </script>
605
+
606
+ <?php
607
+ // Redirect to Elementor.
608
+ ?>
609
+ <script type="text/template" id="tmpl-templator-redirect-to-elementor">
610
+ <div class="template-message-block templator-redirect-to-elementor">
611
+ <h2><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Imported', 'cartflows' ); ?></h2>
612
+ <p class="description"><?php esc_html_e( 'Thanks for patience', 'cartflows' ); ?> <span class="dashicons dashicons-smiley"></span><br/><br/><?php esc_html_e( 'Redirecting to the Elementor edit window.', 'cartflows' ); ?> </p></div>
613
+ </script>
614
+
615
+ <?php
616
+ /**
617
+ * Responsive Buttons
618
+ */
619
+ ?>
620
+ <script type="text/template" id="tmpl-cartflows-responsive-view">
621
+ <span class="responsive-view">
622
+ <span class="actions">
623
+ <a class="desktop" href="#"><span data-view="desktop " class="active dashicons dashicons-desktop"></span></a>
624
+ <a class="tablet" href="#"><span data-view="tablet" class="dashicons dashicons-tablet"></span></a>
625
+ <a class="mobile" href="#"><span data-view="mobile" class="dashicons dashicons-smartphone"></span></a>
626
+ </span>
627
+ </span>
628
+ </script>
629
+
630
+ <?php
631
+ // Templates data.
632
+ ?>
633
+ <script type="text/template" id="tmpl-cartflows-flows-list">
634
+
635
+ <# console.log( data.items.length ) #>
636
+ <# console.log( data.items ) #>
637
+ <# if ( data.items.length ) { #>
638
+ <# for ( key in data.items ) { #>
639
+ <#
640
+ var flow_steps = [];
641
+ if( data.items[ key ].flow_steps ) {
642
+ flow_steps = data.items[ key ].flow_steps.map(function(value,index) {
643
+ return value['id'];
644
+ });
645
+ }
646
+ #>
647
+ <div class="inner">
648
+ <div class="template">
649
+ <span class="thumbnail site-preview cartflows-preview-flow-steps" data-flow-steps="{{ JSON.stringify( data.items[ key ].flow_steps ) }}" data-title="{{ data.items[ key ].title.rendered }}">
650
+ <div class="template-screenshot">
651
+ <# if( data.items[ key ].featured_image_url ) { #>
652
+ <img src="{{ data.items[ key ].featured_image_url }}" />
653
+ <# } else { #>
654
+ <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/400x400.jpg" />
655
+ <# } #>
656
+ </div>
657
+ <# if( data.items[ key ].flow_type && 'pro' === data.items[ key ].flow_type.slug ) { #>
658
+ <span class="wcf-flow-type pro"><?php esc_html_e( 'Pro', 'cartflows' ); ?></span>
659
+ <# } #>
660
+ <# if( data.items[ key ].woo_required ) { #>
661
+ <div class="notice notice-info" style="width: auto;">
662
+ <p class="wcf-learn-how">
663
+ Install/Activate WooCommerce to use this template.
664
+ <a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank">
665
+ <strong><?php esc_html_e( 'Learn How', 'cartflows' ); ?></strong>
666
+ <i class="dashicons dashicons-external"></i>
667
+ </a>
668
+ </p>
669
+ </div>
670
+ <# } else { #>
671
+ <a href="<?php echo CARTFLOWS_TEMPLATES_URL . 'preview/?'; ?>flow={{ data.items[ key ].id }}&title={{{ data.items[ key ].title.rendered }}}" class="preview" target="_blank">Preview <i class="dashicons dashicons-external"></i></a>
672
+ <# } #>
673
+
674
+ </span>
675
+ <div class="template-id-container">
676
+ <h3 class="template-name"> {{{ data.items[ key ].title.rendered }}} </h3>
677
+ <div class="template-actions">
678
+
679
+ <#
680
+ if( data.items[ key ].page_builder.slug ) {
681
+ required_plugin_group = data.items[ key ].page_builder.slug;
682
+ } else {
683
+ required_plugin_group = '';
684
+ }
685
+
686
+ if( data.items[ key ].page_builder.slug && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug] && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug].button_title ) {
687
+ import_btn_title = CartFlowsImportVars.required_plugins[ data.items[ key ].page_builder.slug ].button_title;
688
+ } else {
689
+ import_btn_title = 'Import';
690
+ } #>
691
+
692
+ <# if( data.items[ key ].licence_status && 'valid' === data.items[ key ].licence_status ) { #>
693
+ <# if( ! data.items[ key ].woo_required ) { #>
694
+ <a data-flow-steps="{{ flow_steps }}" data-required-plugin-group="{{required_plugin_group}}" href="#" class="button button-primary cartflows-step-import" data-template-id="{{ data.items[ key ].id }}">{{ import_btn_title }}</a>
695
+ <# } else { #>
696
+ <a href='#' class='wcf-activate-wc button-primary'>Install & activate Woo</a>
697
+ <# } #>
698
+ <# } else if( CartFlowsImportVars._is_pro_active ) { #>
699
+ <a target="_blank" href="<?php echo esc_url( admin_url( 'plugins.php?cartflows-license-popup' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate License', 'cartflows' ); ?></a>
700
+ <# } else { #>
701
+ <a target="_blank" href="<?php echo esc_url( CARTFLOWS_DOMAIN_URL ); ?>" class="button button-primary"><?php esc_html_e( 'Get Pro', 'cartflows' ); ?></a>
702
+ <# } #>
703
+ </div>
704
+ </div>
705
+ </div>
706
+ </div>
707
+ <# } #>
708
+ <# } #>
709
+ </script>
710
+
711
+ <?php
712
+ // Empty Step.
713
+ ?>
714
+ <script type="text/template" id="tmpl-cartflows-create-blank-step">
715
+ <div class="inner">
716
+ <div class="template">
717
+ <span class="thumbnail site-preview cartflows-flow-preview">
718
+ <div class="template-screenshot">
719
+ <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/start-scratch.jpg" />
720
+ </div>
721
+ <div id="wcf_create_notice" class=""><a href="https://cartflows.com/" target="_blank"></a></div>
722
+ </span>
723
+ <div class="template-id-container">
724
+ <h3 class="template-name"> Blank </h3>
725
+ <div class="template-actions">
726
+ <a href="#" class="button button-primary cartflows-step-import-blank"><?php esc_html_e( 'Create', 'cartflows' ); ?></a>
727
+ </div>
728
+ </div>
729
+ </div>
730
+ </div>
731
+ </script>
732
+
733
+ <?php
734
+ // Templates data.
735
+ ?>
736
+ <script type="text/template" id="tmpl-cartflows-steps-list">
737
+ <# if ( data.items.length ) { #>
738
+ <# for ( key in data.items ) { #>
739
+ <#
740
+ var flow_steps = [];
741
+ if( data.items[ key ].flow_steps ) {
742
+ flow_steps = data.items[ key ].flow_steps.map(function(value,index) {
743
+ return value['id'];
744
+ });
745
+ }
746
+ #>
747
+ <div class="inner">
748
+ <div class="template">
749
+ <span class="thumbnail site-preview cartflows-preview-flow-steps" data-flow-steps="{{ JSON.stringify( data.items[ key ].flow_steps ) }}" data-title="{{ data.items[ key ].title.rendered }}">
750
+ <div class="template-screenshot">
751
+ <# if( data.items[ key ].featured_image_url ) { #>
752
+ <img src="{{ data.items[ key ].featured_image_url }}" />
753
+ <# } else { #>
754
+ <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/400x400.jpg" />
755
+ <# } #>
756
+ </div>
757
+ <div id="wcf_create_notice" class=""><a href="https://cartflows.com/" target="_blank"></a></div>
758
+
759
+ <# if( data.items[ key ].woo_required ) { #>
760
+ <div class="notice notice-info" style="width: auto;">
761
+ <p class="wcf-learn-how">
762
+ Install/Activate WooCommerce to use this template.
763
+ <a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank">
764
+ <strong><?php esc_html_e( 'Learn How', 'cartflows' ); ?></strong>
765
+ <i class="dashicons dashicons-external"></i>
766
+ </a>
767
+ </p>
768
+ </div>
769
+ <# } else { #>
770
+ <a href="<?php echo CARTFLOWS_TEMPLATES_URL . 'preview/?'; ?>step={{ data.items[ key ].id }}&title={{{ data.items[ key ].title.rendered }}}" class="preview" target="_blank">Preview <i class="dashicons dashicons-external"></i></a>
771
+ <# } #>
772
+
773
+ <# if( data.items[ key ].flow_type && 'pro' === data.items[ key ].flow_type.slug ) { #>
774
+ <span class="wcf-flow-type pro"><?php esc_html_e( 'Pro', 'cartflows' ); ?></span>
775
+ <# } #>
776
+ </span>
777
+ <div class="template-id-container">
778
+ <h3 class="template-name"> {{{ data.items[ key ].title.rendered }}} </h3>
779
+ <div class="template-actions">
780
+
781
+ <#
782
+
783
+ var step_slug = data.items[ key ].step_type.slug || '';
784
+ var step_title = data.items[ key ].step_type.name || '';
785
+ var import_btn_title = 'Import';
786
+
787
+ var required_plugin_group = '';
788
+ if( data.items[ key ].page_builder ) {
789
+ required_plugin_group = data.items[ key ].page_builder.slug;
790
+
791
+ if( data.items[ key ].page_builder.slug && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug] && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug].button_title ) {
792
+ import_btn_title = CartFlowsImportVars.required_plugins[ data.items[ key ].page_builder.slug ].button_title;
793
+ }
794
+ }
795
+ #>
796
+
797
+ <# if( data.items[ key ].licence_status && 'valid' === data.items[ key ].licence_status ) { #>
798
+
799
+ <# if( ! data.items[ key ].woo_required ) { #>
800
+ <a data-slug="{{step_slug}}" data-title="{{step_title}}" data-flow-steps="{{ flow_steps }}" data-required-plugin-group="{{required_plugin_group}}" href="#" class="button button-primary cartflows-step-import" data-template-id="{{ data.items[ key ].id }}">{{ import_btn_title }}</a>
801
+ <# } else { #>
802
+ <a href='#' class='wcf-activate-wc button-primary'>Install & activate Woo</a>
803
+ <# } #>
804
+
805
+ <# } else if( CartFlowsImportVars._is_pro_active ) { #>
806
+ <a target="_blank" href="<?php echo esc_url( admin_url( 'plugins.php?cartflows-license-popup' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate License', 'cartflows' ); ?></a>
807
+ <# } else { #>
808
+ <a target="_blank" href="<?php echo esc_url( CARTFLOWS_DOMAIN_URL ); ?>" class="button button-primary"><?php esc_html_e( 'Get Pro', 'cartflows' ); ?></a>
809
+ <# } #>
810
+ </div>
811
+ </div>
812
+ </div>
813
+ </div>
814
+ <# } #>
815
+ <# } #>
816
+ </script>
817
+
818
+ <?php
819
+ /**
820
+ * TMPL - Website Unreachable
821
+ */
822
+ ?>
823
+ <script type="text/template" id="tmpl-cartflows-website-unreachable">
824
+ <div class="postbox cartflows-website-unreachable">
825
+ <h2><?php esc_html_e( 'Under Maintenance..', 'cartflows' ); ?></h2>
826
+ <p><?php esc_html_e( 'If you are seeing this message, most likely our servers are under routine maintenance and we will be back shortly.', 'cartflows' ); ?></p>
827
+ <p><?php esc_html_e( 'In rare case, it is possible your website is having trouble connecting with ours. If you need help, please feel free to get in touch with us from our website..', 'cartflows' ); ?></p>
828
+ </div>
829
+ </script>
830
+
831
+ <?php
832
+ /**
833
+ * TMPL - Filters
834
+ */
835
+ ?>
836
+ <script type="text/template" id="tmpl-cartflows-page-builder-notice">
837
+ <?php
838
+ $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
839
+ $page_builder = Cartflows_Helper::get_required_plugins_for_page_builder( Cartflows_Helper::get_common_setting( 'default_page_builder' ) );
840
+ $title = $page_builder['title'];
841
+
842
+ $plugin_string = '<a href="#" data-slug="' . esc_html( $default_page_builder ) . '" class="wcf-install-plugin">Please click here and activate ' . esc_html( $title ) . '</a>';
843
+ $theme_status = '';
844
+ if ( 'divi' === $default_page_builder ) {
845
+
846
+ $theme_status = $page_builder['theme-status'];
847
+ $plugin_status = $page_builder['plugin-status'];
848
+
849
+ if ( 'deactivate' === $theme_status || 'install' === $plugin_status ) {
850
+ $plugin_string = 'Please activate ' . esc_html( $title );
851
+ } elseif ( ( 'deactivate' === $theme_status || 'not-installed' === $theme_status ) && 'install' === $plugin_status ) {
852
+ $plugin_string = 'Please install and activate ' . esc_html( $title );
853
+ }
854
+ }
855
+ ?>
856
+ <div class="wcf-page-builder-message">
857
+ <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>
858
+ <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>
859
+ <p>We plan to add design templates made with more page builder shortly!</p>
860
+ </div>
861
+ </script>
862
+
863
+ <?php
864
+ /**
865
+ * TMPL - Filters
866
+ */
867
+ ?>
868
+ <script type="text/template" id="tmpl-cartflows-term-filters-dropdown">
869
+ <# if ( data ) { #>
870
+ <select class="{{ data.args.wrapper_class }} {{ data.args.class }}">
871
+ <# if ( data.args.show_all ) { #>
872
+ <option value="all"> <?php esc_html_e( 'All', 'cartflows' ); ?> </option>
873
+ <# } #>
874
+ <# if ( CartFlowsImportVars.step_type === data.args.remote_slug ) { #>
875
+ <option value=""> <?php esc_html_e( 'Select Step Type', 'cartflows' ); ?> </option>
876
+ <# } #>
877
+ <# var step_slug_data = []; #>
878
+ <# for ( key in data.items ) { #>
879
+ <option value='{{ data.items[ key ].id }}' data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</option>
880
+
881
+ <# step_slug_data.push( data.items[ key ].slug ); #>
882
+
883
+ <# } #>
884
+ <# if( step_slug_data.indexOf("optin") === -1){ #>
885
+ <option value='0' data-group='0' class="Optin (Woo)" data-slug="optin" data-title="Optin (Woo)">Optin (Woo)</option>
886
+ <# } #>
887
+ </select>
888
+ <# } #>
889
+ </script>
890
+
891
+ <script type="text/template" id="tmpl-cartflows-term-filters">
892
+
893
+ <# if ( data ) { #>
894
+
895
+ <?php /* <# if ( CartFlowsImportVars.flow_page_builder === data.args.remote_slug || CartFlowsImportVars.step_page_builder === data.args.remote_slug ) { #> */ ?>
896
+ <ul class="{{ data.args.wrapper_class }} {{ data.args.class }}">
897
+
898
+ <# if ( data.args.show_all ) { #>
899
+ <li>
900
+ <a href="#" data-group="all"> All </a>
901
+ </li>
902
+ <# } #>
903
+
904
+ <# for ( key in data.items ) { #>
905
+ <li>
906
+ <a href="#" data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</a>
907
+ </li>
908
+ <# } #>
909
+
910
+ </ul>
911
+
912
+ <?php
913
+
914
+ /**
915
+ <# } else { #>
916
+ <select class="{{ data.args.wrapper_class }} {{ data.args.class }}">
917
+
918
+ <# if ( data.args.show_all ) { #>
919
+ <option value="all"> <?php _e( 'All', 'cartflows' ); ?> </option>
920
+ <# } #>
921
+
922
+ <# if ( CartFlowsImportVars.step_type === data.args.remote_slug ) { #>
923
+ <option value=""> <?php _e( 'Select Step Type', 'cartflows' ); ?> </option>
924
+ <# } #>
925
+
926
+ <# for ( key in data.items ) { #>
927
+ <option value='{{ data.items[ key ].id }}' data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</option>
928
+ <# } #>
929
+
930
+ </select>
931
+ */
932
+ ?>
933
+
934
+ <?php /* <# } #> */ ?>
935
+
936
+ <# } #>
937
+ </script>
938
+
939
+ <?php
940
+ // Step Type.
941
+ ?>
942
+ <script type="text/template" id="tmpl-cartflows-step-types">
943
+ <ul class="wcf-tab nav-tabs">
944
+ <# if( data.items_count ) { #>
945
+ <# for( key in data.items ) { #>
946
+ <# console.log( data.items[ key ].id ) #>
947
+ <li data-slug="{{data.items[ key ].slug}}" data-title="{{ data.items[ key ].name }}">
948
+ <a href="#{{{ data.items[ key ].slug }}}">{{{ data.items[ key ].name }}}</a>
949
+ </li>
950
+ <# } #>
951
+ <# } #>
952
+ </ul>
953
+ </script>
954
+
955
+ <?php
956
+ // Add to library button.
957
+ ?>
958
+ <script type="text/template" id="tmpl-templator-add-to-library">
959
+ <a class="templator-add-to-library page-title-action cartflows-load-steps-library"><i class="dashicons dashicons-cloud"></i><?php esc_attr_e( 'Import from Cloud', 'cartflows' ); ?></a>
960
+ </script>
961
+ <?php
962
+ }
963
+
964
+ /**
965
+ * Enqueue scripts
966
+ *
967
+ * @since 1.0.0
968
+ *
969
+ * @hook admin_enqueue_scripts
970
+ * @param string $hook Current page hook.
971
+ */
972
+ public function scripts( $hook = '' ) {
973
+
974
+ if ( ! self::is_supported_post( get_current_screen()->post_type ) ) {
975
+ return;
976
+ }
977
+
978
+ wp_enqueue_script( 'cartflows-rest-api', CARTFLOWS_URL . 'assets/js/rest-api.js', array( 'jquery' ), CARTFLOWS_VER, true );
979
+ wp_enqueue_style( 'cartflows-import', CARTFLOWS_URL . 'assets/css/import.css', null, CARTFLOWS_VER, 'all' );
980
+ wp_style_add_data( 'cartflows-import', 'rtl', 'replace' );
981
+ wp_enqueue_script( 'cartflows-import', CARTFLOWS_URL . 'assets/js/import.js', array( 'jquery', 'wp-util', 'cartflows-rest-api', 'updates' ), CARTFLOWS_VER, true );
982
+
983
+ $installed_plugins = get_plugins();
984
+ $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? 'yes' : 'no';
985
+ $is_wc_activated = wcf()->is_woo_active ? 'yes' : 'no';
986
+
987
+ $localize_vars = array(
988
+ '_is_pro_active' => _is_cartflows_pro(),
989
+ 'is_wc_installed' => $is_wc_installed,
990
+ 'is_wc_activated' => $is_wc_activated,
991
+
992
+ // Set API headers for the CartFlows API Calls only.
993
+ 'headers' => array(),
994
+
995
+ // Flow and its rest fields.
996
+ 'flow' => CARTFLOWS_FLOW_POST_TYPE,
997
+ 'flow_fields' => array(
998
+ 'id',
999
+ 'title',
1000
+ 'flow_type',
1001
+ 'page_builder',
1002
+ 'flow_steps',
1003
+ 'licence_status',
1004
+ 'featured_image_url',
1005
+ 'featured_media', // @required for field `featured_image_url`.
1006
+ ),
1007
+
1008
+ // Flow type and rest fields.
1009
+ 'flow_type' => CARTFLOWS_TAXONOMY_FLOW_CATEGORY,
1010
+ 'flow_type_fields' => array(
1011
+ 'id',
1012
+ 'name',
1013
+ 'slug',
1014
+ ),
1015
+
1016
+ // Flow page builder and rest fields.
1017
+ 'flow_page_builder' => CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER,
1018
+ 'flow_page_builder_fields' => array(
1019
+ 'id',
1020
+ 'name',
1021
+ 'slug',
1022
+ ),
1023
+
1024
+ // Step page builder and rest fields.
1025
+ 'step_page_builder' => CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER,
1026
+ 'step_page_builder_fields' => array(
1027
+ 'id',
1028
+ 'name',
1029
+ 'slug',
1030
+ ),
1031
+
1032
+ // Step and its rest fields.
1033
+ 'step' => CARTFLOWS_STEP_POST_TYPE,
1034
+ 'step_fields' => array(
1035
+ 'title',
1036
+ 'featured_image_url',
1037
+ 'featured_media', // @required for field `featured_image_url`.
1038
+ 'id',
1039
+ 'flow_type',
1040
+ 'step_type',
1041
+ 'page_builder',
1042
+ 'licence_status',
1043
+ ),
1044
+
1045
+ // Step type and its rest fields.
1046
+ 'step_type' => CARTFLOWS_TAXONOMY_STEP_TYPE,
1047
+ 'step_type_fields' => array(
1048
+ 'id',
1049
+ 'name',
1050
+ 'slug',
1051
+ ),
1052
+
1053
+ 'domain_url' => CARTFLOWS_DOMAIN_URL,
1054
+ 'server_url' => CARTFLOWS_TEMPLATES_URL,
1055
+ 'server_rest_url' => CARTFLOWS_TEMPLATES_URL . 'wp-json/wp/v2/',
1056
+ 'site_url' => site_url(),
1057
+ 'import_url' => admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&page=flow_importer' ),
1058
+ 'export_url' => admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&page=flow_exporter' ),
1059
+ 'admin_url' => admin_url(),
1060
+ 'licence_args' => CartFlows_API::get_instance()->get_licence_args(),
1061
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
1062
+ 'debug' => ( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || isset( $_GET['debug'] ) ) ? true : false, //phpcs:ignore
1063
+
1064
+ 'required_plugins' => Cartflows_Helper::get_plugins_groupby_page_builders(),
1065
+
1066
+ 'default_page_builder' => Cartflows_Helper::get_common_setting( 'default_page_builder' ),
1067
+ );
1068
+
1069
+ $localize_vars['cartflows_activate_plugin_nonce'] = wp_create_nonce( 'cartflows_activate_plugin' );
1070
+
1071
+ // var_dump(Cartflows_Helper::get_common_setting( 'default_page_builder' ));
1072
+ // wp_die( );
1073
+ // Add thickbox.
1074
+ add_thickbox();
1075
+
1076
+ wp_localize_script( 'cartflows-import', 'CartFlowsImportVars', $localize_vars );
1077
+ wp_localize_script( 'cartflows-rest-api', 'CartFlowsImportVars', $localize_vars );
1078
+ }
1079
+
1080
+ /**
1081
+ * Import.
1082
+ *
1083
+ * @since 1.0.0
1084
+ *
1085
+ * @hook wp_ajax_cartflows_import_flow_step
1086
+ * @return void
1087
+ */
1088
+ public function import_flow() {
1089
+
1090
+ if ( ! current_user_can( 'manage_options' ) ) {
1091
+ return;
1092
+ }
1093
+
1094
+ check_ajax_referer( 'cf-import-flow-step', 'security' );
1095
+
1096
+ $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1097
+ $template_id = isset( $_POST['template_id'] ) ? intval( $_POST['template_id'] ) : '';
1098
+
1099
+ wcf()->logger->import_log( '------------------------------------' );
1100
+ wcf()->logger->import_log( 'STARTED! Importing FLOW' );
1101
+ wcf()->logger->import_log( '------------------------------------' );
1102
+ wcf()->logger->import_log( '(✓) Creating new step from remote step [' . $template_id . '] for FLOW ' . get_the_title( $flow_id ) . ' [' . $flow_id . ']' );
1103
+
1104
+ $response = CartFlows_API::get_instance()->get_template( $template_id );
1105
+
1106
+ $post_content = isset( $response['data']['content']->rendered ) ? $response['data']['content']->rendered : '';
1107
+ if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1108
+ if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1109
+ $post_content = $response['data']['divi_content'];
1110
+ }
1111
+ }
1112
+
1113
+ if ( 'gutenberg' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1114
+ if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1115
+ $post_content = $response['data']['divi_content'];
1116
+ }
1117
+ }
1118
+
1119
+ if ( false === $response['success'] ) {
1120
+ wcf()->logger->import_log( '(✕) Failed to fetch remote data.' );
1121
+ wp_send_json_error( $response );
1122
+ }
1123
+
1124
+ wcf()->logger->import_log( '(✓) Successfully getting remote step response ' . wp_json_encode( $response ) );
1125
+
1126
+ $new_step_id = wp_insert_post(
1127
+ array(
1128
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1129
+ 'post_title' => $response['title'],
1130
+ 'post_content' => $post_content,
1131
+ 'post_status' => 'publish',
1132
+ )
1133
+ );
1134
+
1135
+ if ( is_wp_error( $new_step_id ) ) {
1136
+ wcf()->logger->import_log( '(✕) Failed to create new step for flow ' . $flow_id );
1137
+ wp_send_json_error( $new_step_id );
1138
+ }
1139
+
1140
+ if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1141
+ if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1142
+ update_post_meta( $new_step_id, 'divi_content', $response['data']['divi_content'] );
1143
+ }
1144
+ }
1145
+
1146
+ /* Imported Step */
1147
+ update_post_meta( $new_step_id, 'cartflows_imported_step', 'yes' );
1148
+
1149
+ wcf()->logger->import_log( '(✓) Created new step ' . '"' . $response['title'] . '" id ' . $new_step_id );//phpcs:ignore
1150
+ // insert post meta.
1151
+ update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
1152
+ wcf()->logger->import_log( '(✓) Added flow ID ' . $flow_id . ' in post meta key wcf-flow-id.' );
1153
+
1154
+ /**
1155
+ * Import & Set type.
1156
+ */
1157
+ $term = isset( $response['data']['step_type'] ) ? $response['data']['step_type'] : '';
1158
+
1159
+ $term_slug = '';
1160
+ if ( $term ) {
1161
+
1162
+ $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
1163
+ $term_exist = term_exists( $term->slug, $taxonomy );
1164
+
1165
+ if ( empty( $term_exist ) ) {
1166
+ $terms = array(
1167
+ array(
1168
+ 'name' => $term->name,
1169
+ 'slug' => $term->slug,
1170
+ ),
1171
+ );
1172
+
1173
+ Cartflows_Step_Post_Type::get_instance()->add_terms( $taxonomy, $terms );
1174
+ wcf()->logger->import_log( '(✓) Created new term name ' . $term->name . ' | term slug ' . $term->slug );
1175
+ }
1176
+
1177
+ $current_term = term_exists( $term->slug, $taxonomy );
1178
+
1179
+ // Set type object.
1180
+ $data = get_term( $current_term['term_id'], $taxonomy );
1181
+ $term_slug = $data->slug;
1182
+ $term_name = $data->name;
1183
+ wp_set_object_terms( $new_step_id, $term_slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
1184
+ wcf()->logger->import_log( '(✓) Assigned existing term ' . $term_name . ' to the template ' . $new_step_id );
1185
+
1186
+ // Set type.
1187
+ update_post_meta( $new_step_id, 'wcf-step-type', $term_slug );
1188
+ wcf()->logger->import_log( '(✓) Updated term ' . $term_name . ' to the post meta wcf-step-type.' );
1189
+ }
1190
+
1191
+ // Set flow.
1192
+ wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1193
+ wcf()->logger->import_log( '(✓) Assigned flow step flow-' . $flow_id );
1194
+
1195
+ /**
1196
+ * Update steps for the current flow.
1197
+ */
1198
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
1199
+
1200
+ if ( ! is_array( $flow_steps ) ) {
1201
+ $flow_steps = array();
1202
+ }
1203
+
1204
+ $flow_steps[] = array(
1205
+ 'id' => $new_step_id,
1206
+ 'title' => $response['title'],
1207
+ 'type' => $term_slug,
1208
+ );
1209
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1210
+ wcf()->logger->import_log( '(✓) Updated flow steps post meta key \'wcf-steps\' ' . wp_json_encode( $flow_steps ) );
1211
+
1212
+ // Import Post Meta.
1213
+ self::import_post_meta( $new_step_id, $response );
1214
+
1215
+ wcf()->logger->import_log( '(✓) Importing step "' . get_the_title( $new_step_id ) . '" [' . $new_step_id . '] for FLOW "' . get_the_title( $flow_id ) . '" [' . $flow_id . ']' );
1216
+ wcf()->logger->import_log( '------------------------------------' );
1217
+ wcf()->logger->import_log( 'COMPLETE! Importing FLOW' );
1218
+ wcf()->logger->import_log( '------------------------------------' );
1219
+
1220
+ do_action( 'cartflows_import_complete' );
1221
+ wcf()->logger->import_log( '(✓) BATCH STARTED for step ' . $new_step_id . ' for Blog name \'' . get_bloginfo( 'name' ) . '\' (' . get_current_blog_id() . ')' );
1222
+
1223
+ // Batch Process.
1224
+ do_action( 'cartflows_after_template_import', $new_step_id, $response );
1225
+
1226
+ /**
1227
+ * End
1228
+ */
1229
+ wp_send_json_success( $new_step_id );
1230
+ }
1231
+
1232
+ /**
1233
+ * Import Step.
1234
+ *
1235
+ * @since 1.0.0
1236
+ * @hook wp_ajax_cartflows_step_import
1237
+ *
1238
+ * @return void
1239
+ */
1240
+ public function create_default_flow() {
1241
+
1242
+ if ( ! current_user_can( 'manage_options' ) ) {
1243
+ return;
1244
+ }
1245
+
1246
+ check_ajax_referer( 'cf-default-flow', 'security' );
1247
+
1248
+ // Create post object.
1249
+ $new_flow_post = array(
1250
+ 'post_content' => '',
1251
+ 'post_status' => 'publish',
1252
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
1253
+ );
1254
+
1255
+ // Insert the post into the database.
1256
+ $flow_id = wp_insert_post( $new_flow_post );
1257
+
1258
+ if ( is_wp_error( $flow_id ) ) {
1259
+ wp_send_json_error( $flow_id->get_error_message() );
1260
+ }
1261
+
1262
+ $flow_steps = array();
1263
+
1264
+ if ( wcf()->is_woo_active ) {
1265
+ $steps_data = array(
1266
+ 'sales' => array(
1267
+ 'title' => __( 'Sales Landing', 'cartflows' ),
1268
+ 'type' => 'landing',
1269
+ ),
1270
+ 'order-form' => array(
1271
+ 'title' => __( 'Checkout (Woo)', 'cartflows' ),
1272
+ 'type' => 'checkout',
1273
+ ),
1274
+ 'order-confirmation' => array(
1275
+ 'title' => __( 'Thank You (Woo)', 'cartflows' ),
1276
+ 'type' => 'thankyou',
1277
+ ),
1278
+ );
1279
+
1280
+ } else {
1281
+ $steps_data = array(
1282
+ 'landing' => array(
1283
+ 'title' => __( 'Landing', 'cartflows' ),
1284
+ 'type' => 'landing',
1285
+ ),
1286
+ 'thankyou' => array(
1287
+ 'title' => __( 'Thank You', 'cartflows' ),
1288
+ 'type' => 'landing',
1289
+ ),
1290
+ );
1291
+ }
1292
+
1293
+ foreach ( $steps_data as $slug => $data ) {
1294
+
1295
+ $post_content = '';
1296
+ $step_type = trim( $data['type'] );
1297
+
1298
+ $step_id = wp_insert_post(
1299
+ array(
1300
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1301
+ 'post_title' => $data['title'],
1302
+ 'post_content' => $post_content,
1303
+ 'post_status' => 'publish',
1304
+ )
1305
+ );
1306
+
1307
+ if ( is_wp_error( $step_id ) ) {
1308
+ wp_send_json_error( $step_id->get_error_message() );
1309
+ }
1310
+
1311
+ if ( $step_id ) {
1312
+
1313
+ $flow_steps[] = array(
1314
+ 'id' => $step_id,
1315
+ 'title' => $data['title'],
1316
+ 'type' => $step_type,
1317
+ );
1318
+
1319
+ // insert post meta.
1320
+ update_post_meta( $step_id, 'wcf-flow-id', $flow_id );
1321
+ update_post_meta( $step_id, 'wcf-step-type', $step_type );
1322
+
1323
+ wp_set_object_terms( $step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
1324
+ wp_set_object_terms( $step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1325
+
1326
+ update_post_meta( $step_id, '_wp_page_template', 'cartflows-default' );
1327
+ }
1328
+ }
1329
+
1330
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1331
+
1332
+ wp_send_json_success( $flow_id );
1333
+ }
1334
+
1335
+ /**
1336
+ * Create Flow
1337
+ *
1338
+ * @return void
1339
+ */
1340
+ public function create_flow() {
1341
+
1342
+ if ( ! current_user_can( 'manage_options' ) ) {
1343
+ return;
1344
+ }
1345
+
1346
+ check_ajax_referer( 'cf-create-flow', 'security' );
1347
+
1348
+ // Create post object.
1349
+ $new_flow_post = array(
1350
+ 'post_content' => '',
1351
+ 'post_status' => 'publish',
1352
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
1353
+ );
1354
+
1355
+ // Insert the post into the database.
1356
+ $flow_id = wp_insert_post( $new_flow_post );
1357
+
1358
+ if ( is_wp_error( $flow_id ) ) {
1359
+ wp_send_json_error( $flow_id->get_error_message() );
1360
+ }
1361
+
1362
+ /* Imported Flow */
1363
+ update_post_meta( $flow_id, 'cartflows_imported_flow', 'yes' );
1364
+
1365
+ wp_send_json_success( $flow_id );
1366
+ }
1367
+
1368
+ /**
1369
+ * Create Step
1370
+ *
1371
+ * @return void
1372
+ */
1373
+ public function import_step() {
1374
+
1375
+ if ( ! current_user_can( 'manage_options' ) ) {
1376
+ return;
1377
+ }
1378
+
1379
+ check_ajax_referer( 'cf-step-import', 'security' );
1380
+
1381
+ $template_id = isset( $_POST['template_id'] ) ? intval( $_POST['template_id'] ) : '';
1382
+ $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1383
+ $step_title = isset( $_POST['step_title'] ) ? sanitize_text_field( wp_unslash( $_POST['step_title'] ) ) : '';
1384
+ $step_type = isset( $_POST['step_type'] ) ? sanitize_title( wp_unslash( $_POST['step_type'] ) ) : '';
1385
+ $step_custom_title = isset( $_POST['step_custom_title'] ) ? sanitize_title( wp_unslash( $_POST['step_custom_title'] ) ) : $step_title;
1386
+
1387
+ $cartflow_meta = Cartflows_Flow_Meta::get_instance();
1388
+
1389
+ $post_id = $cartflow_meta->create_step( $flow_id, $step_type, $step_custom_title );
1390
+
1391
+ wcf()->logger->import_log( '------------------------------------' );
1392
+ wcf()->logger->import_log( 'STARTED! Importing STEP' );
1393
+ wcf()->logger->import_log( '------------------------------------' );
1394
+
1395
+ if ( empty( $template_id ) || empty( $post_id ) ) {
1396
+ /* translators: %s: template ID */
1397
+ $data = sprintf( __( 'Invalid template id %1$s or post id %2$s.', 'cartflows' ), $template_id, $post_id );
1398
+ wcf()->logger->import_log( $data );
1399
+ wp_send_json_error( $data );
1400
+ }
1401
+
1402
+ wcf()->logger->import_log( 'Remote Step ' . $template_id . ' for local flow "' . get_the_title( $post_id ) . '" [' . $post_id . ']' );
1403
+
1404
+ $response = CartFlows_API::get_instance()->get_template( $template_id );
1405
+
1406
+ if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1407
+ if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1408
+
1409
+ update_post_meta( $post_id, 'divi_content', $response['data']['divi_content'] );
1410
+
1411
+ wp_update_post(
1412
+ array(
1413
+ 'ID' => $post_id,
1414
+ 'post_content' => $response['data']['divi_content'],
1415
+ )
1416
+ );
1417
+ }
1418
+ }
1419
+
1420
+ if ( 'gutenberg' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1421
+ if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1422
+
1423
+ wp_update_post(
1424
+ array(
1425
+ 'ID' => $post_id,
1426
+ 'post_content' => $response['data']['divi_content'],
1427
+ )
1428
+ );
1429
+ }
1430
+ }
1431
+
1432
+ /* Imported Step */
1433
+ update_post_meta( $post_id, 'cartflows_imported_step', 'yes' );
1434
+
1435
+ // Import Post Meta.
1436
+ self::import_post_meta( $post_id, $response );
1437
+
1438
+ do_action( 'cartflows_import_complete' );
1439
+
1440
+ // Batch Process.
1441
+ do_action( 'cartflows_after_template_import', $post_id, $response );
1442
+
1443
+ wcf()->logger->import_log( '------------------------------------' );
1444
+ wcf()->logger->import_log( 'COMPLETE! Importing Step' );
1445
+ wcf()->logger->import_log( '------------------------------------' );
1446
+
1447
+ wp_send_json_success( $post_id );
1448
+ }
1449
+
1450
+ /**
1451
+ * Import Step.
1452
+ *
1453
+ * @since 1.0.0
1454
+ * @hook wp_ajax_cartflows_step_create_blank
1455
+ *
1456
+ * @return void
1457
+ */
1458
+ public function step_create_blank() {
1459
+
1460
+ if ( ! current_user_can( 'manage_options' ) ) {
1461
+ return;
1462
+ }
1463
+
1464
+ check_ajax_referer( 'cf-step-create-blank', 'security' );
1465
+
1466
+ $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1467
+ $step_type = isset( $_POST['step_type'] ) ? sanitize_text_field( wp_unslash( $_POST['step_type'] ) ) : '';
1468
+ $step_title = isset( $_POST['step_title'] ) ? sanitize_text_field( wp_unslash( $_POST['step_title'] ) ) : '';
1469
+
1470
+ if ( empty( $flow_id ) || empty( $step_type ) ) {
1471
+ /* translators: %s: flow ID */
1472
+ $data = sprintf( __( 'Invalid flow id %1$s OR step type %2$s.', 'cartflows' ), $flow_id, $step_type );
1473
+ wcf()->logger->import_log( $data );
1474
+ wp_send_json_error( $data );
1475
+ }
1476
+
1477
+ wcf()->logger->import_log( '------------------------------------' );
1478
+ wcf()->logger->import_log( 'STARTED! Creating Blank STEP for Flow ' . $flow_id );
1479
+
1480
+ $step_type_title = str_replace( '-', ' ', $step_type );
1481
+ $step_type_slug = strtolower( str_replace( '-', ' ', $step_type ) );
1482
+
1483
+ $new_step_id = wp_insert_post(
1484
+ array(
1485
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1486
+ 'post_title' => $step_title,
1487
+ 'post_content' => '',
1488
+ 'post_status' => 'publish',
1489
+ )
1490
+ );
1491
+
1492
+ // insert post meta.
1493
+ update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
1494
+
1495
+ $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
1496
+ $term_exist = term_exists( $step_type_slug, $taxonomy );
1497
+
1498
+ if ( empty( $term_exist ) ) {
1499
+ $terms = array(
1500
+ array(
1501
+ 'name' => $step_type_title,
1502
+ 'slug' => $step_type_slug,
1503
+ ),
1504
+ );
1505
+
1506
+ Cartflows_Step_Post_Type::get_instance()->add_terms( $taxonomy, $terms );
1507
+ wcf()->logger->import_log( '(✓) Created new term name ' . $step_type_title . ' | term slug ' . $step_type_slug );
1508
+ }
1509
+
1510
+ $current_term = term_exists( $step_type_slug, $taxonomy );
1511
+
1512
+ // Set type object.
1513
+ $data = get_term( $current_term['term_id'], $taxonomy );
1514
+ $step_slug = $data->slug;
1515
+ wp_set_object_terms( $new_step_id, $data->slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
1516
+ wcf()->logger->import_log( '(✓) Assigned existing term ' . $step_type_title . ' to the template ' . $new_step_id );
1517
+
1518
+ // Set Default page Layout.
1519
+ update_post_meta( $new_step_id, '_wp_page_template', 'cartflows-default' );
1520
+
1521
+ // Set type.
1522
+ update_post_meta( $new_step_id, 'wcf-step-type', $data->slug );
1523
+ wcf()->logger->import_log( '(✓) Updated term ' . $data->name . ' to the post meta wcf-step-type.' );
1524
+
1525
+ // Set flow.
1526
+ wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1527
+ wcf()->logger->import_log( '(✓) Assigned flow step flow-' . $flow_id );
1528
+
1529
+ self::get_instance()->set_step_to_flow( $flow_id, $new_step_id, $step_type_title, $step_slug );
1530
+
1531
+ wcf()->logger->import_log( 'COMPLETE! Creating Blank STEP for Flow ' . $flow_id );
1532
+ wcf()->logger->import_log( '------------------------------------' );
1533
+
1534
+ wp_send_json_success( $new_step_id );
1535
+ }
1536
+
1537
+ /**
1538
+ * Import Post Meta
1539
+ *
1540
+ * @since 1.0.0
1541
+ *
1542
+ * @param integer $post_id Post ID.
1543
+ * @param array $response Post meta.
1544
+ * @return void
1545
+ */
1546
+ public static function import_post_meta( $post_id, $response ) {
1547
+
1548
+ $metadata = (array) $response['post_meta'];
1549
+
1550
+ foreach ( $metadata as $meta_key => $meta_value ) {
1551
+ $meta_value = isset( $meta_value[0] ) ? $meta_value[0] : '';
1552
+
1553
+ if ( $meta_value ) {
1554
+
1555
+ if ( is_serialized( $meta_value, true ) ) {
1556
+ $raw_data = maybe_unserialize( stripslashes( $meta_value ) );
1557
+ } elseif ( is_array( $meta_value ) ) {
1558
+ $raw_data = json_decode( stripslashes( $meta_value ), true );
1559
+ } else {
1560
+ $raw_data = $meta_value;
1561
+ }
1562
+
1563
+ if ( '_elementor_data' === $meta_key ) {
1564
+ if ( is_array( $raw_data ) ) {
1565
+ $raw_data = wp_slash( wp_json_encode( $raw_data ) );
1566
+ } else {
1567
+ $raw_data = wp_slash( $raw_data );
1568
+ }
1569
+ }
1570
+ if ( '_elementor_data' !== $meta_key && '_elementor_draft' !== $meta_key && '_fl_builder_data' !== $meta_key && '_fl_builder_draft' !== $meta_key ) {
1571
+ if ( is_array( $raw_data ) ) {
1572
+ wcf()->logger->import_log( '(✓) Added post meta ' . $meta_key . ' | ' . wp_json_encode( $raw_data ) );
1573
+ } else {
1574
+ if ( ! is_object( $raw_data ) ) {
1575
+ wcf()->logger->import_log( '(✓) Added post meta ' . $meta_key . ' | ' . $raw_data );
1576
+ }
1577
+ }
1578
+ }
1579
+
1580
+ update_post_meta( $post_id, $meta_key, $raw_data );
1581
+ }
1582
+ }
1583
+ }
1584
+
1585
+ /**
1586
+ * Import Template for Elementor
1587
+ *
1588
+ * @since 1.0.0
1589
+ *
1590
+ * @param integer $post_id Post ID.
1591
+ * @param array $response Post meta.
1592
+ * @param array $page_build_data Page build data.
1593
+ * @return void
1594
+ */
1595
+ public static function import_template_elementor( $post_id, $response, $page_build_data ) {
1596
+ if ( ! is_plugin_active( 'elementor/elementor.php' ) ) {
1597
+ $data = __( 'Elementor is not activated. Please activate plugin Elementor Page Builder to import the step.', 'cartflows' );
1598
+ wcf()->logger->import_log( $data );
1599
+ wp_send_json_error( $data );
1600
+ }
1601
+
1602
+ require_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-importer-elementor.php';
1603
+
1604
+ wcf()->logger->import_log( '# Started "importing page builder data" for step ' . $post_id );
1605
+
1606
+ $obj = new \Elementor\TemplateLibrary\CartFlows_Importer_Elementor();
1607
+ $obj->import_single_template( $post_id );
1608
+
1609
+ wcf()->logger->import_log( '# Complete "importing page builder data" for step ' . $post_id );
1610
+ }
1611
+
1612
+ /**
1613
+ * Supported post types
1614
+ *
1615
+ * @since 1.0.0
1616
+ *
1617
+ * @return array Supported post types.
1618
+ */
1619
+ public static function supported_post_types() {
1620
+ return apply_filters(
1621
+ 'cartflows_supported_post_types',
1622
+ array(
1623
+ CARTFLOWS_FLOW_POST_TYPE,
1624
+ )
1625
+ );
1626
+ }
1627
+
1628
+ /**
1629
+ * Check supported post type
1630
+ *
1631
+ * @since 1.0.0
1632
+ *
1633
+ * @param string $post_type Post type.
1634
+ * @return boolean Supported post type status.
1635
+ */
1636
+ public static function is_supported_post( $post_type = '' ) {
1637
+
1638
+ if ( in_array( $post_type, self::supported_post_types(), true ) ) {
1639
+ return true;
1640
+ }
1641
+
1642
+ return false;
1643
+ }
1644
+
1645
+ /**
1646
+ * Set steps to the flow
1647
+ *
1648
+ * @param integer $flow_id Flow ID.
1649
+ * @param integer $new_step_id New step ID.
1650
+ * @param string $step_title Flow Type.
1651
+ * @param string $step_slug Flow Type.
1652
+ */
1653
+ public function set_step_to_flow( $flow_id, $new_step_id, $step_title, $step_slug ) {
1654
+ // Update steps for the current flow.
1655
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
1656
+
1657
+ if ( ! is_array( $flow_steps ) ) {
1658
+ $flow_steps = array();
1659
+ }
1660
+
1661
+ $flow_steps[] = array(
1662
+ 'id' => $new_step_id,
1663
+ 'title' => $step_title,
1664
+ 'type' => $step_slug,
1665
+ );
1666
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1667
+ wcf()->logger->import_log( '(✓) Updated flow steps post meta key \'wcf-steps\' ' . wp_json_encode( $flow_steps ) );
1668
+ }
1669
+
1670
+ /**
1671
+ * Localize variables in admin
1672
+ *
1673
+ * @param array $vars variables.
1674
+ */
1675
+ public function localize_vars( $vars ) {
1676
+
1677
+ $ajax_actions = array(
1678
+ 'cf_step_import',
1679
+ 'cf_load_steps',
1680
+ 'cf_create_flow',
1681
+ 'cf_default_flow',
1682
+ 'cf_step_create_blank',
1683
+ 'cf_import_flow_step',
1684
+ );
1685
+
1686
+ foreach ( $ajax_actions as $action ) {
1687
+
1688
+ $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
1689
+ }
1690
+
1691
+ return $vars;
1692
+ }
1693
+
1694
+ /**
1695
+ * Ajax action to activate plugin
1696
+ */
1697
+ public function activate_plugin() {
1698
+
1699
+ if ( ! check_ajax_referer( 'cartflows_activate_plugin', 'security', false ) ) {
1700
+ wp_send_json_error( esc_html__( 'Action failed. Invalid Security Nonce.', 'cartflows' ) );
1701
+ }
1702
+
1703
+ if ( ! current_user_can( 'activate_plugins' ) ) {
1704
+ wp_send_json_error(
1705
+ array(
1706
+ 'success' => false,
1707
+ 'message' => __( 'User have not plugin install permissions.', 'cartflows' ),
1708
+ )
1709
+ );
1710
+ }
1711
+
1712
+ $plugin_init = isset( $_POST['plugin_init'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin_init'] ) ) : '';
1713
+
1714
+ $activate = activate_plugin( $plugin_init, '', false, true );
1715
+
1716
+ if ( is_wp_error( $activate ) ) {
1717
+ wp_send_json_error(
1718
+ array(
1719
+ 'success' => false,
1720
+ 'message' => $activate->get_error_message(),
1721
+ 'init' => $plugin_init,
1722
+ )
1723
+ );
1724
+ }
1725
+
1726
+ wp_send_json_success(
1727
+ array(
1728
+ 'success' => true,
1729
+ 'message' => __( 'Plugin Successfully Activated', 'cartflows' ),
1730
+ 'init' => $plugin_init,
1731
+ )
1732
+ );
1733
+ }
1734
+
1735
+ }
1736
+
1737
+ /**
1738
+ * Initialize class object with 'get_instance()' method
1739
+ */
1740
+ CartFlows_Importer::get_instance();
1741
+
1742
+ endif;
classes/class-cartflows-loader.php CHANGED
@@ -121,6 +121,7 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
121
 
122
  add_action( 'plugins_loaded', array( $this, 'load_plugin' ), 99 );
123
  add_action( 'plugins_loaded', array( $this, 'load_cf_textdomain' ) );
 
124
  }
125
 
126
  /**
@@ -133,7 +134,7 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
133
  define( 'CARTFLOWS_BASE', plugin_basename( CARTFLOWS_FILE ) );
134
  define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
135
  define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
136
- define( 'CARTFLOWS_VER', '1.5.18' );
137
  define( 'CARTFLOWS_SLUG', 'cartflows' );
138
  define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
139
 
@@ -366,6 +367,11 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
366
  include_once CARTFLOWS_DIR . 'modules/elementor/class-cartflows-el-widgets-loader.php';
367
  }
368
 
 
 
 
 
 
369
  include_once CARTFLOWS_DIR . 'classes/class-cartflows-api.php';
370
  include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer-core.php';
371
 
121
 
122
  add_action( 'plugins_loaded', array( $this, 'load_plugin' ), 99 );
123
  add_action( 'plugins_loaded', array( $this, 'load_cf_textdomain' ) );
124
+
125
  }
126
 
127
  /**
134
  define( 'CARTFLOWS_BASE', plugin_basename( CARTFLOWS_FILE ) );
135
  define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
136
  define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
137
+ define( 'CARTFLOWS_VER', '1.5.19' );
138
  define( 'CARTFLOWS_SLUG', 'cartflows' );
139
  define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
140
 
367
  include_once CARTFLOWS_DIR . 'modules/elementor/class-cartflows-el-widgets-loader.php';
368
  }
369
 
370
+ if ( class_exists( 'FLBuilder' ) ) {
371
+
372
+ include_once CARTFLOWS_DIR . 'modules/beaver-builder/class-cartflows-bb-modules-loader.php';
373
+ }
374
+
375
  include_once CARTFLOWS_DIR . 'classes/class-cartflows-api.php';
376
  include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer-core.php';
377
 
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 ( ! isset( $_REQUEST['_wpnonce'] ) || 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 ( ! isset( $_REQUEST['_wpnonce'] ) || 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-fields.php CHANGED
@@ -1,1046 +1,1046 @@
1
- <?php
2
- /**
3
- * Meta Fields.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Class Cartflows_Meta_Fields.
10
- */
11
- class Cartflows_Meta_Fields {
12
-
13
- /**
14
- * Instance
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
-
28
- return self::$instance;
29
- }
30
-
31
- /**
32
- * Constructor
33
- */
34
- public function __construct() {
35
-
36
- /* Add Scripts */
37
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_meta_scripts' ), 20 );
38
-
39
- add_action( 'wp_ajax_wcf_json_search_coupons', array( $this, 'json_search_coupons' ) );
40
-
41
- add_action( 'wp_ajax_wcf_json_search_products_and_variations', array( $this, 'json_search_products' ) );
42
-
43
- add_action( 'wp_ajax_wcf_json_search_pages', array( $this, 'json_search_pages' ) );
44
-
45
- add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
46
- }
47
-
48
- /**
49
- * Admin meta scripts
50
- */
51
- public function admin_meta_scripts() {
52
-
53
- global $pagenow;
54
- global $post;
55
-
56
- $localize = array(
57
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
58
- 'google_fonts' => CartFlows_Font_Families::get_google_fonts(),
59
- 'system_fonts' => CartFlows_Font_Families::get_system_fonts(),
60
- 'font_weights' => array(
61
- '100' => __( 'Thin 100', 'cartflows' ),
62
- '200' => __( 'Extra-Light 200', 'cartflows' ),
63
- '300' => __( 'Light 300', 'cartflows' ),
64
- '400' => __( 'Normal 400', 'cartflows' ),
65
- '500' => __( 'Medium 500', 'cartflows' ),
66
- '600' => __( 'Semi-Bold 600', 'cartflows' ),
67
- '700' => __( 'Bold 700', 'cartflows' ),
68
- '800' => __( 'Extra-Bold 800', 'cartflows' ),
69
- '900' => __( 'Ultra-Bold 900', 'cartflows' ),
70
- ),
71
- );
72
-
73
- $localize = apply_filters( 'wcf_js_localize', $localize );
74
-
75
- $localize_script = '<!-- script to print the admin localized variables -->';
76
- $localize_script .= '<script type="text/javascript">';
77
- $localize_script .= 'var wcf = ' . wp_json_encode( $localize ) . ';';
78
- $localize_script .= '</script>';
79
-
80
- echo $localize_script;
81
-
82
- $screen = get_current_screen();
83
-
84
- if (
85
- ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) &&
86
- wcf()->utils->is_step_post_type( $screen->post_type )
87
- ) {
88
-
89
- wp_enqueue_style( 'woocommerce_admin_styles' );
90
-
91
- wp_enqueue_script( 'select2' );
92
- wp_enqueue_script( 'wc-enhanced-select' );
93
-
94
- wp_enqueue_script(
95
- 'wcf-admin-meta',
96
- CARTFLOWS_URL . 'admin/meta-assets/js/admin-edit.js',
97
- array( 'jquery', 'wp-color-picker' ),
98
- CARTFLOWS_VER,
99
- true
100
- );
101
-
102
- wp_enqueue_style( 'wcf-admin-meta', CARTFLOWS_URL . 'admin/meta-assets/css/admin-edit.css', array( 'wp-color-picker' ), CARTFLOWS_VER );
103
- wp_style_add_data( 'wcf-admin-meta', 'rtl', 'replace' );
104
-
105
- do_action( 'cartflows_admin_meta_scripts' );
106
- }
107
- }
108
-
109
- /**
110
- * Function to search products.
111
- */
112
- public function json_search_products() {
113
-
114
- check_admin_referer( 'wcf-json-search-products-and-variations', 'security' );
115
-
116
- global $wpdb;
117
-
118
- // get search term.
119
- $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
120
-
121
- if ( empty( $term ) ) {
122
- die();
123
- }
124
-
125
- // CartFlows supported product types.
126
- $supported_product_types = array( 'simple', 'variable', 'variation', 'subscription', 'variable-subscription', 'subscription_variation', 'course' );
127
-
128
- // Allowed product types.
129
- if ( isset( $_GET['allowed'] ) && ! empty( $_GET['allowed'] ) ) {
130
-
131
- $allowed_product_types = sanitize_text_field( ( wp_unslash( $_GET['allowed'] ) ) );
132
-
133
- $allowed_product_types = $this->sanitize_data_attributes( $allowed_product_types );
134
-
135
- $supported_product_types = $allowed_product_types;
136
- }
137
-
138
- // Include product types.
139
- if ( isset( $_GET['included'] ) && ! empty( $_GET['included'] ) ) {
140
-
141
- $include_product_types = sanitize_text_field( ( wp_unslash( $_GET['included'] ) ) );
142
-
143
- $include_product_types = $this->sanitize_data_attributes( $include_product_types );
144
-
145
- $supported_product_types = array_merge( $supported_product_types, $include_product_types );
146
- }
147
-
148
- // Exclude product types.
149
- if ( isset( $_GET['excluded'] ) && ! empty( $_GET['excluded'] ) ) {
150
-
151
- $excluded_product_types = sanitize_text_field( ( wp_unslash( $_GET['excluded'] ) ) );
152
-
153
- $excluded_product_types = $this->sanitize_data_attributes( $excluded_product_types );
154
-
155
- $supported_product_types = array_diff( $supported_product_types, $excluded_product_types );
156
- }
157
-
158
- // Get all products data.
159
- $data = WC_Data_Store::load( 'product' );
160
- $ids = $data->search_products( $term, '', true, false, 11 );
161
-
162
- // Get all product objects.
163
- $product_objects = array_filter( array_map( 'wc_get_product', $ids ), 'wc_products_array_filter_readable' );
164
-
165
- // Remove the product objects whose product type are not in supported array.
166
- $product_objects = array_filter(
167
- $product_objects,
168
- function ( $arr ) use ( $supported_product_types ) {
169
- return $arr && is_a( $arr, 'WC_Product' ) && in_array( $arr->get_type(), $supported_product_types, true );
170
- }
171
- );
172
-
173
- $products_found = array();
174
-
175
- foreach ( $product_objects as $product_object ) {
176
- $formatted_name = $product_object->get_formatted_name();
177
- $managing_stock = $product_object->managing_stock();
178
-
179
- if ( $managing_stock && ! empty( $_GET['display_stock'] ) ) {
180
- $stock_amount = $product_object->get_stock_quantity();
181
- /* Translators: %d stock amount */
182
- $formatted_name .= ' &ndash; ' . sprintf( __( 'Stock: %d', 'cartflows' ), wc_format_stock_quantity_for_display( $stock_amount, $product_object ) );
183
- }
184
-
185
- $products_found[ $product_object->get_id() ] = rawurldecode( $formatted_name );
186
-
187
- }
188
-
189
- wp_send_json( $products_found );
190
- }
191
-
192
- /**
193
- * Function to sanitize the product type data attribute.
194
- *
195
- * @param array $product_types product types.
196
- */
197
- public function sanitize_data_attributes( $product_types = array() ) {
198
-
199
- if ( ! is_array( $product_types ) ) {
200
- $product_types = explode( ',', $product_types );
201
- }
202
-
203
- // Sanitize the excluded types against valid product types.
204
- foreach ( $product_types as $index => $value ) {
205
- $product_types[ $index ] = strtolower( trim( $value ) );
206
- }
207
- return $product_types;
208
- }
209
-
210
- /**
211
- * Function to search coupons
212
- */
213
- public function json_search_coupons() {
214
-
215
- check_admin_referer( 'wcf-json-search-coupons', 'security' );
216
-
217
- global $wpdb;
218
-
219
- $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
220
-
221
- if ( empty( $term ) ) {
222
- die();
223
- }
224
-
225
- $posts = wp_cache_get( 'wcf_search_coupons', 'wcf_funnel_Cart' );
226
-
227
- if ( false === $posts ) {
228
- $posts = $wpdb->get_results( // phpcs:ignore
229
- $wpdb->prepare(
230
- "SELECT *
231
- FROM {$wpdb->prefix}posts
232
- WHERE post_type = %s
233
- AND post_title LIKE %s
234
- AND post_status = %s",
235
- 'shop_coupon',
236
- $wpdb->esc_like( $term ) . '%',
237
- 'publish'
238
- )
239
- );
240
- wp_cache_set( 'wcf_search_coupons', $posts, 'wcf_funnel_Cart' );
241
- }
242
-
243
- $coupons_found = array();
244
- $all_discount_types = wc_get_coupon_types();
245
-
246
- if ( $posts ) {
247
- foreach ( $posts as $post ) {
248
-
249
- $discount_type = get_post_meta( $post->ID, 'discount_type', true );
250
-
251
- if ( ! empty( $all_discount_types[ $discount_type ] ) ) {
252
- $coupons_found[ get_the_title( $post->ID ) ] = get_the_title( $post->ID ) . ' (Type: ' . $all_discount_types[ $discount_type ] . ')';
253
- }
254
- }
255
- }
256
-
257
- wp_send_json( $coupons_found );
258
- }
259
-
260
- /**
261
- * Function to search coupons
262
- */
263
- public function json_search_pages() {
264
-
265
- check_ajax_referer( 'wcf-json-search-pages', 'security' );
266
-
267
- $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
268
-
269
- if ( empty( $term ) ) {
270
- die( 'not found' );
271
- }
272
-
273
- $search_string = $term;
274
- $data = array();
275
- $result = array();
276
-
277
- add_filter( 'posts_search', array( $this, 'search_only_titles' ), 10, 2 );
278
-
279
- $query = new WP_Query(
280
- array(
281
- 's' => $search_string,
282
- 'post_type' => 'page',
283
- 'posts_per_page' => -1,
284
- )
285
- );
286
-
287
- if ( $query->have_posts() ) {
288
- while ( $query->have_posts() ) {
289
- $query->the_post();
290
- $title = get_the_title();
291
- $title .= ( 0 != $query->post->post_parent ) ? ' (' . get_the_title( $query->post->post_parent ) . ')' : '';
292
- $id = get_the_id();
293
- $data[] = array(
294
- 'id' => $id,
295
- 'text' => $title,
296
- );
297
- }
298
- }
299
-
300
- if ( is_array( $data ) && ! empty( $data ) ) {
301
- $result[] = array(
302
- 'text' => '',
303
- 'children' => $data,
304
- );
305
- }
306
-
307
- wp_reset_postdata();
308
-
309
- // return the result in json.
310
- wp_send_json( $result );
311
- }
312
-
313
- /**
314
- * Search only titles.
315
- *
316
- * @param string $search Field data.
317
- * @param object $wp_query Query.
318
- *
319
- * @return array.
320
- */
321
- public function search_only_titles( $search, $wp_query ) {
322
- if ( ! empty( $search ) && ! empty( $wp_query->query_vars['search_terms'] ) ) {
323
- global $wpdb;
324
-
325
- $q = $wp_query->query_vars;
326
- $n = ! empty( $q['exact'] ) ? '' : '%';
327
-
328
- $search = array();
329
-
330
- foreach ( (array) $q['search_terms'] as $term ) {
331
- $search[] = $wpdb->prepare( "$wpdb->posts.post_title LIKE %s", $n . $wpdb->esc_like( $term ) . $n );
332
- }
333
-
334
- if ( ! is_user_logged_in() ) {
335
- $search[] = "$wpdb->posts.post_password = ''";
336
- }
337
-
338
- $search = ' AND ' . implode( ' AND ', $search );
339
- }
340
-
341
- return $search;
342
- }
343
-
344
- /**
345
- * Get field.
346
- *
347
- * @param array $field_data Field data.
348
- * @param string $field_content Field content.
349
- *
350
- * @return string field.
351
- */
352
- public function get_field( $field_data, $field_content ) {
353
-
354
- $field_data['generated_content'] = $field_content;
355
-
356
- return $this->get_meta_field_template(
357
- 'get-field.php',
358
- $field_data
359
- );
360
- }
361
-
362
- /**
363
- * Text field.
364
- *
365
- * @param array $field_data Field data.
366
- *
367
- * @return string field.
368
- */
369
- public function get_text_field( $field_data ) {
370
-
371
- $value = $field_data['value'];
372
-
373
- $attr = '';
374
-
375
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
376
-
377
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
378
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
379
- }
380
- }
381
-
382
- $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . esc_attr( $value ) . '" ' . $attr . '>';
383
-
384
- return $this->get_field( $field_data, $field_content );
385
- }
386
-
387
- /**
388
- * Shortcode field.
389
- *
390
- * @param array $field_data Field data.
391
- *
392
- * @return string field.
393
- */
394
- public function get_shortcode_field( $field_data ) {
395
-
396
- $attr = '';
397
-
398
- $attr_fields = array(
399
- 'readonly' => 'readonly',
400
- 'onfocus' => 'this.select()',
401
- 'onmouseup' => 'return false',
402
- );
403
-
404
- if ( $attr_fields && is_array( $attr_fields ) ) {
405
-
406
- foreach ( $attr_fields as $attr_key => $attr_value ) {
407
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
408
- }
409
- }
410
-
411
- $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . $field_data['content'] . '" ' . $attr . '>';
412
-
413
- return $this->get_field( $field_data, $field_content );
414
- }
415
-
416
- /**
417
- * Display field.
418
- *
419
- * @param array $field_data Field data.
420
- *
421
- * @return string field.
422
- */
423
- public function get_display_field( $field_data ) {
424
-
425
- $field_content = $field_data['content'];
426
-
427
- return $this->get_field( $field_data, $field_content );
428
- }
429
-
430
- /**
431
- * Hr linke field.
432
- *
433
- * @param array $field_data Field data.
434
- *
435
- * @return string field.
436
- */
437
- public function get_hr_line_field( $field_data ) {
438
-
439
- $field_data = array(
440
- 'name' => 'wcf-hr-line',
441
- 'content' => '<hr>',
442
- );
443
-
444
- $field_content = $field_data['content'];
445
-
446
- return $this->get_field( $field_data, $field_content );
447
- }
448
-
449
- /**
450
- * Number field.
451
- *
452
- * @param array $field_data Field data.
453
- *
454
- * @return string field.
455
- */
456
- public function get_number_field( $field_data ) {
457
-
458
- $value = $field_data['value'];
459
-
460
- $attr = '';
461
-
462
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
463
-
464
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
465
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
466
- }
467
- }
468
-
469
- $field_content = '<input type="number" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
470
-
471
- return $this->get_field( $field_data, $field_content );
472
- }
473
-
474
- /**
475
- * Hidden field.
476
- *
477
- * @param array $field_data Field data.
478
- *
479
- * @return string field.
480
- */
481
- public function get_hidden_field( $field_data ) {
482
-
483
- $value = $field_data['value'];
484
-
485
- $attr = '';
486
-
487
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
488
-
489
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
490
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
491
- }
492
- }
493
-
494
- $field_content = '<input type="hidden" id="' . $field_data['name'] . '" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
495
-
496
- return $this->get_field( $field_data, $field_content );
497
- }
498
-
499
- /**
500
- * Text area field.
501
- *
502
- * @param array $field_data Field data.
503
- *
504
- * @return string field.
505
- */
506
- public function get_area_field( $field_data ) {
507
-
508
- $value = $field_data['value'];
509
-
510
- $attr = '';
511
-
512
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
513
-
514
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
515
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
516
- }
517
- }
518
-
519
- $field_content = '<textarea name="' . $field_data['name'] . '" rows="10" cols="50" ' . $attr . '>';
520
- $field_content .= $value;
521
- $field_content .= '</textarea>';
522
-
523
- return $this->get_field( $field_data, $field_content );
524
- }
525
-
526
- /**
527
- * Only checkbox field.
528
- *
529
- * @param array $field_data Field data.
530
- *
531
- * @return string field.
532
- */
533
- public function get_only_checkbox_field( $field_data ) {
534
-
535
- $value = $field_data['value'];
536
-
537
- $field_content = '';
538
- if ( isset( $field_data['before'] ) ) {
539
- $field_content .= '<span>' . $field_data['before'] . '</span>';
540
- }
541
- $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
542
- $field_content .= '<input type="checkbox" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . '>';
543
-
544
- if ( isset( $field_data['after'] ) ) {
545
- $field_content .= '<span>' . $field_data['after'] . '</span>';
546
- }
547
-
548
- if ( isset( $field_data['after_html'] ) ) {
549
- $field_content .= '<span>' . $field_data['after_html'] . '</span>';
550
- }
551
-
552
- return $field_content;
553
- }
554
-
555
- /**
556
- * Checkbox field.
557
- *
558
- * @param array $field_data Field data.
559
- *
560
- * @return string field.
561
- */
562
- public function get_checkbox_field( $field_data ) {
563
-
564
- $value = $field_data['value'];
565
-
566
- $field_content = '';
567
- if ( isset( $field_data['before'] ) ) {
568
- $field_content .= '<span>' . $field_data['before'] . '</span>';
569
- }
570
-
571
- $toggle_data = '';
572
- if ( isset( $field_data['toggle'] ) ) {
573
- $toggle_data .= 'toggle="' . htmlspecialchars( wp_json_encode( $field_data['toggle'] ) ) . '"'; //phpcs:ignore
574
- }
575
-
576
- $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
577
- $field_content .= '<input type="checkbox" id="' . $field_data['name'] . '" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . ' ' . $toggle_data . '>';
578
-
579
- if ( isset( $field_data['after'] ) ) {
580
- $field_content .= '<span>' . $field_data['after'] . '</span>';
581
- }
582
-
583
- return $this->get_field( $field_data, $field_content );
584
- }
585
-
586
- /**
587
- * Radio field.
588
- *
589
- * @param array $field_data Field data.
590
- *
591
- * @return string field.
592
- */
593
- public function get_radio_field( $field_data ) {
594
-
595
- $value = $field_data['value'];
596
- $field_content = '';
597
-
598
- if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
599
-
600
- foreach ( $field_data['options'] as $data_key => $data_value ) {
601
-
602
- $field_content .= '<div class="wcf-radio-option">';
603
- $field_content .= '<input type="radio" name="' . $field_data['name'] . '" value="' . $data_key . '" ' . checked( $data_key, $value, false ) . '>';
604
- $field_content .= $data_value;
605
- $field_content .= '</div>';
606
- }
607
- }
608
-
609
- return $this->get_field( $field_data, $field_content );
610
- }
611
-
612
- /**
613
- * Font family field.
614
- *
615
- * @param array $field_data Field data.
616
- *
617
- * @return string field.
618
- */
619
- public function get_font_family_field( $field_data ) {
620
-
621
- $value = $field_data['value'];
622
-
623
- $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
624
-
625
- $field_content = '<select class="wcf-field-font-family" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
626
-
627
- $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
628
-
629
- $field_content .= '<optgroup label="Other System Fonts">';
630
- foreach ( CartFlows_Font_Families::get_system_fonts() as $name => $variants ) {
631
- $field_content .= '<option value="' . esc_attr( $name ) . '" ' . selected( $name, $value, false ) . '>' . esc_attr( $name ) . '</option>';
632
- }
633
- $field_content .= '</optgroup>';
634
- $field_content .= '<optgroup label="Google">';
635
- foreach ( CartFlows_Font_Families::get_google_fonts() as $name => $single_font ) {
636
- $variants = wcf_get_prop( $single_font, '0' );
637
- $category = wcf_get_prop( $single_font, '1' );
638
- $font_value = '\'' . esc_attr( $name ) . '\', ' . esc_attr( $category );
639
- $field_content .= '<option value="' . esc_attr( $font_value ) . '" ' . selected( $font_value, $value, false ) . '>' . esc_attr( $name ) . '</option>';
640
- }
641
- $field_content .= '</optgroup>';
642
-
643
- $field_content .= '</select>';
644
-
645
- return $this->get_field( $field_data, $field_content );
646
- }
647
-
648
- /**
649
- * Font weight field.
650
- *
651
- * @param array $field_data Field data.
652
- *
653
- * @return string field.
654
- */
655
- public function get_font_weight_field( $field_data ) {
656
-
657
- $value = $field_data['value'];
658
-
659
- $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
660
-
661
- $field_content = '<select data-selected="' . esc_attr( $value ) . '" class="wcf-field-font-weight" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
662
-
663
- $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
664
-
665
- $field_content .= '</select>';
666
-
667
- return $this->get_field( $field_data, $field_content );
668
- }
669
-
670
- /**
671
- * Select field.
672
- *
673
- * @param array $field_data Field data.
674
- *
675
- * @return string field.
676
- */
677
- public function get_select_field( $field_data ) {
678
-
679
- $value = $field_data['value'];
680
- $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
681
-
682
- $field_content = '<select name="' . $field_data['name'] . '">';
683
-
684
- if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
685
-
686
- foreach ( $field_data['options'] as $data_key => $data_value ) {
687
-
688
- $disabled = '';
689
-
690
- if ( array_key_exists( $data_key, $pro_options ) ) {
691
- $disabled = 'disabled ';
692
- $data_value = $pro_options[ $data_key ];
693
- }
694
-
695
- $field_content .= '<option value="' . $data_key . '" ' . selected( $value, $data_key, false ) . ' ' . $disabled . '>' . $data_value . '</option>';
696
- }
697
- }
698
-
699
- $field_content .= '</select>';
700
-
701
- if ( isset( $field_data['after'] ) ) {
702
- $field_content .= '<span>' . $field_data['after'] . '</span>';
703
- }
704
-
705
- return $this->get_field( $field_data, $field_content );
706
- }
707
-
708
- /**
709
- * Color picker field.
710
- *
711
- * @param array $field_data Field data.
712
- *
713
- * @return string field.
714
- */
715
- public function get_color_picker_field( $field_data ) {
716
-
717
- $value = $field_data['value'];
718
-
719
- $field_data['field_type'] = 'color-picker';
720
-
721
- $field_content = '<input class="wcf-color-picker" type="text" name="' . $field_data['name'] . '" value="' . $value . '">';
722
-
723
- return $this->get_field( $field_data, $field_content );
724
- }
725
-
726
- /**
727
- * Product selection field.
728
- *
729
- * @param array $field_data Field data.
730
- *
731
- * @return string field.
732
- */
733
- public function get_product_selection_field( $field_data ) {
734
-
735
- $value = $field_data['value'];
736
- $excluded = '';
737
- $allowed = '';
738
- $included = '';
739
-
740
- if ( isset( $field_data['excluded_product_types'] ) && is_array( $field_data['excluded_product_types'] ) && ! empty( $field_data['excluded_product_types'] ) ) {
741
- $excluded = html_entity_decode( implode( ',', $field_data['excluded_product_types'] ), ENT_COMPAT, 'UTF-8' );
742
- }
743
- if ( isset( $field_data['allowed_product_types'] ) && is_array( $field_data['allowed_product_types'] ) && ! empty( $field_data['allowed_product_types'] ) ) {
744
- $allowed = html_entity_decode( implode( ',', $field_data['allowed_product_types'] ), ENT_COMPAT, 'UTF-8' );
745
- }
746
- if ( isset( $field_data['include_product_types'] ) && is_array( $field_data['include_product_types'] ) && ! empty( $field_data['allowed_product_types'] ) ) {
747
- $included = html_entity_decode( implode( ',', $field_data['include_product_types'] ), ENT_COMPAT, 'UTF-8' );
748
- }
749
-
750
- $multiple = '';
751
-
752
- if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
753
- $multiple = ' multiple="multiple"';
754
- }
755
-
756
- $allow_clear = '';
757
-
758
- if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
759
- $allow_clear = ' data-allow_clear="allow_clear"';
760
- }
761
-
762
- $field_content = '<select
763
- name="' . $field_data['name'] . '[]"
764
- class="wcf-product-search" ' . $multiple . $allow_clear . '
765
- data-placeholder="' . __( 'Search for a product&hellip;', 'cartflows' ) . '"
766
- data-action="wcf_json_search_products_and_variations"
767
- data-excluded_product_types ="' . $excluded . '"
768
- data-allowed_product_types ="' . $allowed . '"
769
- data-include_product_types ="' . $included . '">';
770
-
771
- if ( is_array( $value ) && ! empty( $value ) ) {
772
-
773
- foreach ( $value as $data_key => $product_id ) {
774
-
775
- $product = wc_get_product( $product_id );
776
-
777
- // posts.
778
- if ( ! empty( $product ) ) {
779
- $post_title = $product->get_name() . ' (#' . $product_id . ')';
780
-
781
- $field_content .= '<option value="' . $product_id . '" selected="selected" >' . $post_title . '</option>';
782
- }
783
- }
784
- }
785
- $field_content .= '</select>';
786
-
787
- return $this->get_field( $field_data, $field_content );
788
- }
789
-
790
- /**
791
- * Coupon selection field.
792
- *
793
- * @param array $field_data Field data.
794
- *
795
- * @return string field.
796
- */
797
- public function get_coupon_selection_field( $field_data ) {
798
-
799
- $value = $field_data['value'];
800
-
801
- $multiple = '';
802
-
803
- if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
804
- $multiple = ' multiple="multiple"';
805
- }
806
-
807
- $allow_clear = '';
808
-
809
- if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
810
- $allow_clear = ' data-allow_clear="allow_clear"';
811
- }
812
-
813
- $field_content = '<select
814
- name="' . $field_data['name'] . '[]"
815
- class="wc-coupon-search wcf-coupon-search" ' . $multiple . $allow_clear . '
816
- data-placeholder="' . __( 'Search for a coupon&hellip;', 'cartflows' ) . '"
817
- data-action="wcf_json_search_coupons">';
818
-
819
- if ( is_array( $value ) && ! empty( $value ) ) {
820
-
821
- $all_discount_types = wc_get_coupon_types();
822
-
823
- foreach ( $value as $coupon_title ) {
824
-
825
- $coupon = new WC_Coupon( $coupon_title );
826
-
827
- $discount_type = $coupon->get_discount_type();
828
-
829
- if ( isset( $discount_type ) && $discount_type ) {
830
- $discount_type = ' ( Type: ' . $all_discount_types[ $discount_type ] . ' )';
831
- }
832
-
833
- $field_content .= '<option value="' . $coupon_title . '" selected="selected">' . $coupon_title . $discount_type . '</option>';
834
- }
835
- }
836
-
837
- $field_content .= '</select>';
838
-
839
- return $this->get_field( $field_data, $field_content );
840
- }
841
-
842
- /**
843
- * Page selction field.
844
- *
845
- * @param array $field_data Field data.
846
- *
847
- * @return string field.
848
- */
849
- public function get_page_selection_field( $field_data ) {
850
-
851
- $value = $field_data['value'];
852
-
853
- $multiple = '';
854
-
855
- if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
856
- $multiple = 'multiple="multiple"';
857
- }
858
-
859
- $field_content = '<select
860
- name="' . $field_data['name'] . '[]"
861
- class="wcf-search-pages" ' . $multiple . '"
862
- data-action="wcf_json_search_pages">';
863
-
864
- if ( is_array( $value ) && ! empty( $value ) ) {
865
-
866
- foreach ( $value as $data_key => $data_value ) {
867
-
868
- $field_content .= '<option value="' . $data_value . '">' . get_the_title( $data_value ) . '</option>';
869
- }
870
- }
871
-
872
- $field_content .= '</select>';
873
-
874
- return $this->get_field( $field_data, $field_content );
875
- }
876
-
877
- /**
878
- * Get section field.
879
- *
880
- * @param array $field_data Field data.
881
- *
882
- * @return string field.
883
- */
884
- public function get_section( $field_data ) {
885
- $field_html = '<div class="wcf-field-row wcf-field-section">';
886
- $field_html .= '<div class="wcf-field-section-heading" colspan="2">';
887
- $field_html .= '<label>' . esc_html( $field_data['label'] ) . '</label>';
888
-
889
- if ( isset( $field_data['help'] ) ) {
890
- $field_html .= '<i class="wcf-field-heading-help dashicons dashicons-editor-help" title="' . esc_attr( $field_data['help'] ) . '"></i>';
891
- }
892
- $field_html .= '</div>';
893
- $field_html .= '</div>';
894
- return $field_html;
895
- }
896
-
897
- /**
898
- * Description field.
899
- *
900
- * @param array $field_data Field data.
901
- *
902
- * @return string field.
903
- */
904
- public function get_description_field( $field_data ) {
905
-
906
- $field_html = '<div class="wcf-field-row wcf-field-desc ' . $field_data['name'] . '">';
907
- $field_html .= '<div class="wcf-field-desc-content">';
908
- $field_html .= $field_data['content'];
909
- $field_html .= '</div>';
910
- $field_html .= '</div>';
911
-
912
- return $field_html;
913
- }
914
-
915
- /**
916
- * Product selection repeater field.
917
- *
918
- * @param array $field_data Field data.
919
- *
920
- * @return string field.
921
- */
922
- public function get_product_selection_repeater( $field_data ) {
923
-
924
- return $this->get_meta_field_template(
925
- 'get-product-selection-repeater.php',
926
- $field_data
927
- );
928
- }
929
-
930
- /**
931
- * Generate product repeater html.
932
- *
933
- * @param string $id ID.
934
- * @param string $options Options.
935
- * @param array $selected_data Discount_data.
936
- *
937
- * @return string field.
938
- */
939
- public function generate_product_repeater_html( $id, $options = '', $selected_data = '' ) {
940
-
941
- ob_start();
942
-
943
- include CARTFLOWS_DIR . 'includes/meta-fields/generate-product-repeater.php';
944
-
945
- return ob_get_clean();
946
- }
947
-
948
- /**
949
- * Image field.
950
- *
951
- * @param array $field_data Field data.
952
- *
953
- * @return string field.
954
- */
955
- public function get_image_field( $field_data ) {
956
-
957
- global $post;
958
- $value = $field_data['value'];
959
-
960
- $attr = '';
961
-
962
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
963
-
964
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
965
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
966
- }
967
- }
968
-
969
- $display_preview_box = ( isset( $value ) && '' != $value ) ? 'display:block;' : 'display:none';
970
-
971
- $field_content = '<div id="wcf-image-preview" style="' . $display_preview_box . '">';
972
-
973
- if ( isset( $value ) ) {
974
-
975
- $field_content .= '<img src="' . $field_data['value'] . '" class="saved-image" name="' . $field_data['name'] . '" width="150">';
976
- }
977
-
978
- $field_content .= '</div>';
979
-
980
- $image_data = htmlentities( serialize( get_post_meta( $post->ID, $field_data['name'] . '-obj' ) ) ); // phpcs:ignore
981
-
982
- $field_content .= '<input type="hidden" id="' . $field_data['name'] . '" class="wcf-image" name="' . $field_data['name'] . '" value="' . $value . '">'; // phpcs:ignore
983
-
984
- $field_content .= '<input type="hidden" id="' . $field_data['name'] . '-obj' . '" class="wcf-image-obj" name="' . $field_data['name'] . '-obj' . '" value="' . $image_data . '">'; // phpcs:ignore
985
-
986
- $field_content .= '<button type="button" ' . $attr . ' class="wcf-select-image button-secondary">Select Image</button>';
987
-
988
- $display_remove_button = ( isset( $value ) && '' != $value ) ? 'display:inline-block; margin-left: 5px;' : 'display:none';
989
-
990
- $field_content .= '<button type="button" class="wcf-remove-image button-secondary" style="' . $display_remove_button . '">Remove Image</button>';
991
-
992
- return $this->get_field( $field_data, $field_content );
993
- }
994
-
995
- /**
996
- * Localize variables in admin
997
- *
998
- * @param array $vars variables.
999
- */
1000
- public function localize_vars( $vars ) {
1001
-
1002
- $ajax_actions = array(
1003
- 'wcf_json_search_pages',
1004
- 'wcf_json_search_coupons',
1005
- 'wcf_json_search_products_and_variations',
1006
- );
1007
-
1008
- foreach ( $ajax_actions as $action ) {
1009
-
1010
- $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
1011
- }
1012
-
1013
- /* Add product from iframe */
1014
- $product_src = esc_url_raw(
1015
- add_query_arg(
1016
- array(
1017
- 'post_type' => 'product',
1018
- 'wcf-woo-iframe' => 'true',
1019
- ),
1020
- admin_url( 'post-new.php' )
1021
- )
1022
- );
1023
-
1024
- $vars['create_product_src'] = $product_src;
1025
- /* Add product from iframe End */
1026
-
1027
- return $vars;
1028
- }
1029
-
1030
- /**
1031
- * Get meta field template.
1032
- *
1033
- * @param string $template file name.
1034
- * @param array $field_data Field data.
1035
- *
1036
- * @return string.
1037
- */
1038
- public function get_meta_field_template( $template, $field_data ) {
1039
-
1040
- ob_start();
1041
-
1042
- include CARTFLOWS_DIR . 'includes/meta-fields/' . $template;
1043
-
1044
- return ob_get_clean();
1045
- }
1046
- }
1
+ <?php
2
+ /**
3
+ * Meta Fields.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Class Cartflows_Meta_Fields.
10
+ */
11
+ class Cartflows_Meta_Fields {
12
+
13
+ /**
14
+ * Instance
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
+
28
+ return self::$instance;
29
+ }
30
+
31
+ /**
32
+ * Constructor
33
+ */
34
+ public function __construct() {
35
+
36
+ /* Add Scripts */
37
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_meta_scripts' ), 20 );
38
+
39
+ add_action( 'wp_ajax_wcf_json_search_coupons', array( $this, 'json_search_coupons' ) );
40
+
41
+ add_action( 'wp_ajax_wcf_json_search_products_and_variations', array( $this, 'json_search_products' ) );
42
+
43
+ add_action( 'wp_ajax_wcf_json_search_pages', array( $this, 'json_search_pages' ) );
44
+
45
+ add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
46
+ }
47
+
48
+ /**
49
+ * Admin meta scripts
50
+ */
51
+ public function admin_meta_scripts() {
52
+
53
+ global $pagenow;
54
+ global $post;
55
+
56
+ $localize = array(
57
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
58
+ 'google_fonts' => CartFlows_Font_Families::get_google_fonts(),
59
+ 'system_fonts' => CartFlows_Font_Families::get_system_fonts(),
60
+ 'font_weights' => array(
61
+ '100' => __( 'Thin 100', 'cartflows' ),
62
+ '200' => __( 'Extra-Light 200', 'cartflows' ),
63
+ '300' => __( 'Light 300', 'cartflows' ),
64
+ '400' => __( 'Normal 400', 'cartflows' ),
65
+ '500' => __( 'Medium 500', 'cartflows' ),
66
+ '600' => __( 'Semi-Bold 600', 'cartflows' ),
67
+ '700' => __( 'Bold 700', 'cartflows' ),
68
+ '800' => __( 'Extra-Bold 800', 'cartflows' ),
69
+ '900' => __( 'Ultra-Bold 900', 'cartflows' ),
70
+ ),
71
+ );
72
+
73
+ $localize = apply_filters( 'wcf_js_localize', $localize );
74
+
75
+ $localize_script = '<!-- script to print the admin localized variables -->';
76
+ $localize_script .= '<script type="text/javascript">';
77
+ $localize_script .= 'var wcf = ' . wp_json_encode( $localize ) . ';';
78
+ $localize_script .= '</script>';
79
+
80
+ echo $localize_script;
81
+
82
+ $screen = get_current_screen();
83
+
84
+ if (
85
+ ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) &&
86
+ wcf()->utils->is_step_post_type( $screen->post_type )
87
+ ) {
88
+
89
+ wp_enqueue_style( 'woocommerce_admin_styles' );
90
+
91
+ wp_enqueue_script( 'select2' );
92
+ wp_enqueue_script( 'wc-enhanced-select' );
93
+
94
+ wp_enqueue_script(
95
+ 'wcf-admin-meta',
96
+ CARTFLOWS_URL . 'admin/meta-assets/js/admin-edit.js',
97
+ array( 'jquery', 'wp-color-picker' ),
98
+ CARTFLOWS_VER,
99
+ true
100
+ );
101
+
102
+ wp_enqueue_style( 'wcf-admin-meta', CARTFLOWS_URL . 'admin/meta-assets/css/admin-edit.css', array( 'wp-color-picker' ), CARTFLOWS_VER );
103
+ wp_style_add_data( 'wcf-admin-meta', 'rtl', 'replace' );
104
+
105
+ do_action( 'cartflows_admin_meta_scripts' );
106
+ }
107
+ }
108
+
109
+ /**
110
+ * Function to search products.
111
+ */
112
+ public function json_search_products() {
113
+
114
+ check_admin_referer( 'wcf-json-search-products-and-variations', 'security' );
115
+
116
+ global $wpdb;
117
+
118
+ // get search term.
119
+ $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
120
+
121
+ if ( empty( $term ) ) {
122
+ die();
123
+ }
124
+
125
+ // CartFlows supported product types.
126
+ $supported_product_types = array( 'simple', 'variable', 'variation', 'subscription', 'variable-subscription', 'subscription_variation', 'course' );
127
+
128
+ // Allowed product types.
129
+ if ( isset( $_GET['allowed'] ) && ! empty( $_GET['allowed'] ) ) {
130
+
131
+ $allowed_product_types = sanitize_text_field( ( wp_unslash( $_GET['allowed'] ) ) );
132
+
133
+ $allowed_product_types = $this->sanitize_data_attributes( $allowed_product_types );
134
+
135
+ $supported_product_types = $allowed_product_types;
136
+ }
137
+
138
+ // Include product types.
139
+ if ( isset( $_GET['included'] ) && ! empty( $_GET['included'] ) ) {
140
+
141
+ $include_product_types = sanitize_text_field( ( wp_unslash( $_GET['included'] ) ) );
142
+
143
+ $include_product_types = $this->sanitize_data_attributes( $include_product_types );
144
+
145
+ $supported_product_types = array_merge( $supported_product_types, $include_product_types );
146
+ }
147
+
148
+ // Exclude product types.
149
+ if ( isset( $_GET['excluded'] ) && ! empty( $_GET['excluded'] ) ) {
150
+
151
+ $excluded_product_types = sanitize_text_field( ( wp_unslash( $_GET['excluded'] ) ) );
152
+
153
+ $excluded_product_types = $this->sanitize_data_attributes( $excluded_product_types );
154
+
155
+ $supported_product_types = array_diff( $supported_product_types, $excluded_product_types );
156
+ }
157
+
158
+ // Get all products data.
159
+ $data = WC_Data_Store::load( 'product' );
160
+ $ids = $data->search_products( $term, '', true, false, 11 );
161
+
162
+ // Get all product objects.
163
+ $product_objects = array_filter( array_map( 'wc_get_product', $ids ), 'wc_products_array_filter_readable' );
164
+
165
+ // Remove the product objects whose product type are not in supported array.
166
+ $product_objects = array_filter(
167
+ $product_objects,
168
+ function ( $arr ) use ( $supported_product_types ) {
169
+ return $arr && is_a( $arr, 'WC_Product' ) && in_array( $arr->get_type(), $supported_product_types, true );
170
+ }
171
+ );
172
+
173
+ $products_found = array();
174
+
175
+ foreach ( $product_objects as $product_object ) {
176
+ $formatted_name = $product_object->get_formatted_name();
177
+ $managing_stock = $product_object->managing_stock();
178
+
179
+ if ( $managing_stock && ! empty( $_GET['display_stock'] ) ) {
180
+ $stock_amount = $product_object->get_stock_quantity();
181
+ /* Translators: %d stock amount */
182
+ $formatted_name .= ' &ndash; ' . sprintf( __( 'Stock: %d', 'cartflows' ), wc_format_stock_quantity_for_display( $stock_amount, $product_object ) );
183
+ }
184
+
185
+ $products_found[ $product_object->get_id() ] = rawurldecode( $formatted_name );
186
+
187
+ }
188
+
189
+ wp_send_json( $products_found );
190
+ }
191
+
192
+ /**
193
+ * Function to sanitize the product type data attribute.
194
+ *
195
+ * @param array $product_types product types.
196
+ */
197
+ public function sanitize_data_attributes( $product_types = array() ) {
198
+
199
+ if ( ! is_array( $product_types ) ) {
200
+ $product_types = explode( ',', $product_types );
201
+ }
202
+
203
+ // Sanitize the excluded types against valid product types.
204
+ foreach ( $product_types as $index => $value ) {
205
+ $product_types[ $index ] = strtolower( trim( $value ) );
206
+ }
207
+ return $product_types;
208
+ }
209
+
210
+ /**
211
+ * Function to search coupons
212
+ */
213
+ public function json_search_coupons() {
214
+
215
+ check_admin_referer( 'wcf-json-search-coupons', 'security' );
216
+
217
+ global $wpdb;
218
+
219
+ $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
220
+
221
+ if ( empty( $term ) ) {
222
+ die();
223
+ }
224
+
225
+ $posts = wp_cache_get( 'wcf_search_coupons', 'wcf_funnel_Cart' );
226
+
227
+ if ( false === $posts ) {
228
+ $posts = $wpdb->get_results( // phpcs:ignore
229
+ $wpdb->prepare(
230
+ "SELECT *
231
+ FROM {$wpdb->prefix}posts
232
+ WHERE post_type = %s
233
+ AND post_title LIKE %s
234
+ AND post_status = %s",
235
+ 'shop_coupon',
236
+ $wpdb->esc_like( $term ) . '%',
237
+ 'publish'
238
+ )
239
+ );
240
+ wp_cache_set( 'wcf_search_coupons', $posts, 'wcf_funnel_Cart' );
241
+ }
242
+
243
+ $coupons_found = array();
244
+ $all_discount_types = wc_get_coupon_types();
245
+
246
+ if ( $posts ) {
247
+ foreach ( $posts as $post ) {
248
+
249
+ $discount_type = get_post_meta( $post->ID, 'discount_type', true );
250
+
251
+ if ( ! empty( $all_discount_types[ $discount_type ] ) ) {
252
+ $coupons_found[ get_the_title( $post->ID ) ] = get_the_title( $post->ID ) . ' (Type: ' . $all_discount_types[ $discount_type ] . ')';
253
+ }
254
+ }
255
+ }
256
+
257
+ wp_send_json( $coupons_found );
258
+ }
259
+
260
+ /**
261
+ * Function to search coupons
262
+ */
263
+ public function json_search_pages() {
264
+
265
+ check_ajax_referer( 'wcf-json-search-pages', 'security' );
266
+
267
+ $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
268
+
269
+ if ( empty( $term ) ) {
270
+ die( 'not found' );
271
+ }
272
+
273
+ $search_string = $term;
274
+ $data = array();
275
+ $result = array();
276
+
277
+ add_filter( 'posts_search', array( $this, 'search_only_titles' ), 10, 2 );
278
+
279
+ $query = new WP_Query(
280
+ array(
281
+ 's' => $search_string,
282
+ 'post_type' => 'page',
283
+ 'posts_per_page' => -1,
284
+ )
285
+ );
286
+
287
+ if ( $query->have_posts() ) {
288
+ while ( $query->have_posts() ) {
289
+ $query->the_post();
290
+ $title = get_the_title();
291
+ $title .= ( 0 != $query->post->post_parent ) ? ' (' . get_the_title( $query->post->post_parent ) . ')' : '';
292
+ $id = get_the_id();
293
+ $data[] = array(
294
+ 'id' => $id,
295
+ 'text' => $title,
296
+ );
297
+ }
298
+ }
299
+
300
+ if ( is_array( $data ) && ! empty( $data ) ) {
301
+ $result[] = array(
302
+ 'text' => '',
303
+ 'children' => $data,
304
+ );
305
+ }
306
+
307
+ wp_reset_postdata();
308
+
309
+ // return the result in json.
310
+ wp_send_json( $result );
311
+ }
312
+
313
+ /**
314
+ * Search only titles.
315
+ *
316
+ * @param string $search Field data.
317
+ * @param object $wp_query Query.
318
+ *
319
+ * @return array.
320
+ */
321
+ public function search_only_titles( $search, $wp_query ) {
322
+ if ( ! empty( $search ) && ! empty( $wp_query->query_vars['search_terms'] ) ) {
323
+ global $wpdb;
324
+
325
+ $q = $wp_query->query_vars;
326
+ $n = ! empty( $q['exact'] ) ? '' : '%';
327
+
328
+ $search = array();
329
+
330
+ foreach ( (array) $q['search_terms'] as $term ) {
331
+ $search[] = $wpdb->prepare( "$wpdb->posts.post_title LIKE %s", $n . $wpdb->esc_like( $term ) . $n );
332
+ }
333
+
334
+ if ( ! is_user_logged_in() ) {
335
+ $search[] = "$wpdb->posts.post_password = ''";
336
+ }
337
+
338
+ $search = ' AND ' . implode( ' AND ', $search );
339
+ }
340
+
341
+ return $search;
342
+ }
343
+
344
+ /**
345
+ * Get field.
346
+ *
347
+ * @param array $field_data Field data.
348
+ * @param string $field_content Field content.
349
+ *
350
+ * @return string field.
351
+ */
352
+ public function get_field( $field_data, $field_content ) {
353
+
354
+ $field_data['generated_content'] = $field_content;
355
+
356
+ return $this->get_meta_field_template(
357
+ 'get-field.php',
358
+ $field_data
359
+ );
360
+ }
361
+
362
+ /**
363
+ * Text field.
364
+ *
365
+ * @param array $field_data Field data.
366
+ *
367
+ * @return string field.
368
+ */
369
+ public function get_text_field( $field_data ) {
370
+
371
+ $value = $field_data['value'];
372
+
373
+ $attr = '';
374
+
375
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
376
+
377
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
378
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
379
+ }
380
+ }
381
+
382
+ $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . esc_attr( $value ) . '" ' . $attr . '>';
383
+
384
+ return $this->get_field( $field_data, $field_content );
385
+ }
386
+
387
+ /**
388
+ * Shortcode field.
389
+ *
390
+ * @param array $field_data Field data.
391
+ *
392
+ * @return string field.
393
+ */
394
+ public function get_shortcode_field( $field_data ) {
395
+
396
+ $attr = '';
397
+
398
+ $attr_fields = array(
399
+ 'readonly' => 'readonly',
400
+ 'onfocus' => 'this.select()',
401
+ 'onmouseup' => 'return false',
402
+ );
403
+
404
+ if ( $attr_fields && is_array( $attr_fields ) ) {
405
+
406
+ foreach ( $attr_fields as $attr_key => $attr_value ) {
407
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
408
+ }
409
+ }
410
+
411
+ $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . $field_data['content'] . '" ' . $attr . '>';
412
+
413
+ return $this->get_field( $field_data, $field_content );
414
+ }
415
+
416
+ /**
417
+ * Display field.
418
+ *
419
+ * @param array $field_data Field data.
420
+ *
421
+ * @return string field.
422
+ */
423
+ public function get_display_field( $field_data ) {
424
+
425
+ $field_content = $field_data['content'];
426
+
427
+ return $this->get_field( $field_data, $field_content );
428
+ }
429
+
430
+ /**
431
+ * Hr linke field.
432
+ *
433
+ * @param array $field_data Field data.
434
+ *
435
+ * @return string field.
436
+ */
437
+ public function get_hr_line_field( $field_data ) {
438
+
439
+ $field_data = array(
440
+ 'name' => 'wcf-hr-line',
441
+ 'content' => '<hr>',
442
+ );
443
+
444
+ $field_content = $field_data['content'];
445
+
446
+ return $this->get_field( $field_data, $field_content );
447
+ }
448
+
449
+ /**
450
+ * Number field.
451
+ *
452
+ * @param array $field_data Field data.
453
+ *
454
+ * @return string field.
455
+ */
456
+ public function get_number_field( $field_data ) {
457
+
458
+ $value = $field_data['value'];
459
+
460
+ $attr = '';
461
+
462
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
463
+
464
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
465
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
466
+ }
467
+ }
468
+
469
+ $field_content = '<input type="number" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
470
+
471
+ return $this->get_field( $field_data, $field_content );
472
+ }
473
+
474
+ /**
475
+ * Hidden field.
476
+ *
477
+ * @param array $field_data Field data.
478
+ *
479
+ * @return string field.
480
+ */
481
+ public function get_hidden_field( $field_data ) {
482
+
483
+ $value = $field_data['value'];
484
+
485
+ $attr = '';
486
+
487
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
488
+
489
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
490
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
491
+ }
492
+ }
493
+
494
+ $field_content = '<input type="hidden" id="' . $field_data['name'] . '" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
495
+
496
+ return $this->get_field( $field_data, $field_content );
497
+ }
498
+
499
+ /**
500
+ * Text area field.
501
+ *
502
+ * @param array $field_data Field data.
503
+ *
504
+ * @return string field.
505
+ */
506
+ public function get_area_field( $field_data ) {
507
+
508
+ $value = $field_data['value'];
509
+
510
+ $attr = '';
511
+
512
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
513
+
514
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
515
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
516
+ }
517
+ }
518
+
519
+ $field_content = '<textarea name="' . $field_data['name'] . '" rows="10" cols="50" ' . $attr . '>';
520
+ $field_content .= $value;
521
+ $field_content .= '</textarea>';
522
+
523
+ return $this->get_field( $field_data, $field_content );
524
+ }
525
+
526
+ /**
527
+ * Only checkbox field.
528
+ *
529
+ * @param array $field_data Field data.
530
+ *
531
+ * @return string field.
532
+ */
533
+ public function get_only_checkbox_field( $field_data ) {
534
+
535
+ $value = $field_data['value'];
536
+
537
+ $field_content = '';
538
+ if ( isset( $field_data['before'] ) ) {
539
+ $field_content .= '<span>' . $field_data['before'] . '</span>';
540
+ }
541
+ $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
542
+ $field_content .= '<input type="checkbox" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . '>';
543
+
544
+ if ( isset( $field_data['after'] ) ) {
545
+ $field_content .= '<span>' . $field_data['after'] . '</span>';
546
+ }
547
+
548
+ if ( isset( $field_data['after_html'] ) ) {
549
+ $field_content .= '<span>' . $field_data['after_html'] . '</span>';
550
+ }
551
+
552
+ return $field_content;
553
+ }
554
+
555
+ /**
556
+ * Checkbox field.
557
+ *
558
+ * @param array $field_data Field data.
559
+ *
560
+ * @return string field.
561
+ */
562
+ public function get_checkbox_field( $field_data ) {
563
+
564
+ $value = $field_data['value'];
565
+
566
+ $field_content = '';
567
+ if ( isset( $field_data['before'] ) ) {
568
+ $field_content .= '<span>' . $field_data['before'] . '</span>';
569
+ }
570
+
571
+ $toggle_data = '';
572
+ if ( isset( $field_data['toggle'] ) ) {
573
+ $toggle_data .= 'toggle="' . htmlspecialchars( wp_json_encode( $field_data['toggle'] ) ) . '"'; //phpcs:ignore
574
+ }
575
+
576
+ $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
577
+ $field_content .= '<input type="checkbox" id="' . $field_data['name'] . '" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . ' ' . $toggle_data . '>';
578
+
579
+ if ( isset( $field_data['after'] ) ) {
580
+ $field_content .= '<span>' . $field_data['after'] . '</span>';
581
+ }
582
+
583
+ return $this->get_field( $field_data, $field_content );
584
+ }
585
+
586
+ /**
587
+ * Radio field.
588
+ *
589
+ * @param array $field_data Field data.
590
+ *
591
+ * @return string field.
592
+ */
593
+ public function get_radio_field( $field_data ) {
594
+
595
+ $value = $field_data['value'];
596
+ $field_content = '';
597
+
598
+ if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
599
+
600
+ foreach ( $field_data['options'] as $data_key => $data_value ) {
601
+
602
+ $field_content .= '<div class="wcf-radio-option">';
603
+ $field_content .= '<input type="radio" name="' . $field_data['name'] . '" value="' . $data_key . '" ' . checked( $data_key, $value, false ) . '>';
604
+ $field_content .= $data_value;
605
+ $field_content .= '</div>';
606
+ }
607
+ }
608
+
609
+ return $this->get_field( $field_data, $field_content );
610
+ }
611
+
612
+ /**
613
+ * Font family field.
614
+ *
615
+ * @param array $field_data Field data.
616
+ *
617
+ * @return string field.
618
+ */
619
+ public function get_font_family_field( $field_data ) {
620
+
621
+ $value = $field_data['value'];
622
+
623
+ $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
624
+
625
+ $field_content = '<select class="wcf-field-font-family" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
626
+
627
+ $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
628
+
629
+ $field_content .= '<optgroup label="Other System Fonts">';
630
+ foreach ( CartFlows_Font_Families::get_system_fonts() as $name => $variants ) {
631
+ $field_content .= '<option value="' . esc_attr( $name ) . '" ' . selected( $name, $value, false ) . '>' . esc_attr( $name ) . '</option>';
632
+ }
633
+ $field_content .= '</optgroup>';
634
+ $field_content .= '<optgroup label="Google">';
635
+ foreach ( CartFlows_Font_Families::get_google_fonts() as $name => $single_font ) {
636
+ $variants = wcf_get_prop( $single_font, '0' );
637
+ $category = wcf_get_prop( $single_font, '1' );
638
+ $font_value = '\'' . esc_attr( $name ) . '\', ' . esc_attr( $category );
639
+ $field_content .= '<option value="' . esc_attr( $font_value ) . '" ' . selected( $font_value, $value, false ) . '>' . esc_attr( $name ) . '</option>';
640
+ }
641
+ $field_content .= '</optgroup>';
642
+
643
+ $field_content .= '</select>';
644
+
645
+ return $this->get_field( $field_data, $field_content );
646
+ }
647
+
648
+ /**
649
+ * Font weight field.
650
+ *
651
+ * @param array $field_data Field data.
652
+ *
653
+ * @return string field.
654
+ */
655
+ public function get_font_weight_field( $field_data ) {
656
+
657
+ $value = $field_data['value'];
658
+
659
+ $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
660
+
661
+ $field_content = '<select data-selected="' . esc_attr( $value ) . '" class="wcf-field-font-weight" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
662
+
663
+ $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
664
+
665
+ $field_content .= '</select>';
666
+
667
+ return $this->get_field( $field_data, $field_content );
668
+ }
669
+
670
+ /**
671
+ * Select field.
672
+ *
673
+ * @param array $field_data Field data.
674
+ *
675
+ * @return string field.
676
+ */
677
+ public function get_select_field( $field_data ) {
678
+
679
+ $value = $field_data['value'];
680
+ $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
681
+
682
+ $field_content = '<select name="' . $field_data['name'] . '">';
683
+
684
+ if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
685
+
686
+ foreach ( $field_data['options'] as $data_key => $data_value ) {
687
+
688
+ $disabled = '';
689
+
690
+ if ( array_key_exists( $data_key, $pro_options ) ) {
691
+ $disabled = 'disabled ';
692
+ $data_value = $pro_options[ $data_key ];
693
+ }
694
+
695
+ $field_content .= '<option value="' . $data_key . '" ' . selected( $value, $data_key, false ) . ' ' . $disabled . '>' . $data_value . '</option>';
696
+ }
697
+ }
698
+
699
+ $field_content .= '</select>';
700
+
701
+ if ( isset( $field_data['after'] ) ) {
702
+ $field_content .= '<span>' . $field_data['after'] . '</span>';
703
+ }
704
+
705
+ return $this->get_field( $field_data, $field_content );
706
+ }
707
+
708
+ /**
709
+ * Color picker field.
710
+ *
711
+ * @param array $field_data Field data.
712
+ *
713
+ * @return string field.
714
+ */
715
+ public function get_color_picker_field( $field_data ) {
716
+
717
+ $value = $field_data['value'];
718
+
719
+ $field_data['field_type'] = 'color-picker';
720
+
721
+ $field_content = '<input class="wcf-color-picker" type="text" name="' . $field_data['name'] . '" value="' . $value . '">';
722
+
723
+ return $this->get_field( $field_data, $field_content );
724
+ }
725
+
726
+ /**
727
+ * Product selection field.
728
+ *
729
+ * @param array $field_data Field data.
730
+ *
731
+ * @return string field.
732
+ */
733
+ public function get_product_selection_field( $field_data ) {
734
+
735
+ $value = $field_data['value'];
736
+ $excluded = '';
737
+ $allowed = '';
738
+ $included = '';
739
+
740
+ if ( isset( $field_data['excluded_product_types'] ) && is_array( $field_data['excluded_product_types'] ) && ! empty( $field_data['excluded_product_types'] ) ) {
741
+ $excluded = html_entity_decode( implode( ',', $field_data['excluded_product_types'] ), ENT_COMPAT, 'UTF-8' );
742
+ }
743
+ if ( isset( $field_data['allowed_product_types'] ) && is_array( $field_data['allowed_product_types'] ) && ! empty( $field_data['allowed_product_types'] ) ) {
744
+ $allowed = html_entity_decode( implode( ',', $field_data['allowed_product_types'] ), ENT_COMPAT, 'UTF-8' );
745
+ }
746
+ if ( isset( $field_data['include_product_types'] ) && is_array( $field_data['include_product_types'] ) && ! empty( $field_data['allowed_product_types'] ) ) {
747
+ $included = html_entity_decode( implode( ',', $field_data['include_product_types'] ), ENT_COMPAT, 'UTF-8' );
748
+ }
749
+
750
+ $multiple = '';
751
+
752
+ if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
753
+ $multiple = ' multiple="multiple"';
754
+ }
755
+
756
+ $allow_clear = '';
757
+
758
+ if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
759
+ $allow_clear = ' data-allow_clear="allow_clear"';
760
+ }
761
+
762
+ $field_content = '<select
763
+ name="' . $field_data['name'] . '[]"
764
+ class="wcf-product-search" ' . $multiple . $allow_clear . '
765
+ data-placeholder="' . __( 'Search for a product&hellip;', 'cartflows' ) . '"
766
+ data-action="wcf_json_search_products_and_variations"
767
+ data-excluded_product_types ="' . $excluded . '"
768
+ data-allowed_product_types ="' . $allowed . '"
769
+ data-include_product_types ="' . $included . '">';
770
+
771
+ if ( is_array( $value ) && ! empty( $value ) ) {
772
+
773
+ foreach ( $value as $data_key => $product_id ) {
774
+
775
+ $product = wc_get_product( $product_id );
776
+
777
+ // posts.
778
+ if ( ! empty( $product ) ) {
779
+ $post_title = $product->get_name() . ' (#' . $product_id . ')';
780
+
781
+ $field_content .= '<option value="' . $product_id . '" selected="selected" >' . $post_title . '</option>';
782
+ }
783
+ }
784
+ }
785
+ $field_content .= '</select>';
786
+
787
+ return $this->get_field( $field_data, $field_content );
788
+ }
789
+
790
+ /**
791
+ * Coupon selection field.
792
+ *
793
+ * @param array $field_data Field data.
794
+ *
795
+ * @return string field.
796
+ */
797
+ public function get_coupon_selection_field( $field_data ) {
798
+
799
+ $value = $field_data['value'];
800
+
801
+ $multiple = '';
802
+
803
+ if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
804
+ $multiple = ' multiple="multiple"';
805
+ }
806
+
807
+ $allow_clear = '';
808
+
809
+ if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
810
+ $allow_clear = ' data-allow_clear="allow_clear"';
811
+ }
812
+
813
+ $field_content = '<select
814
+ name="' . $field_data['name'] . '[]"
815
+ class="wc-coupon-search wcf-coupon-search" ' . $multiple . $allow_clear . '
816
+ data-placeholder="' . __( 'Search for a coupon&hellip;', 'cartflows' ) . '"
817
+ data-action="wcf_json_search_coupons">';
818
+
819
+ if ( is_array( $value ) && ! empty( $value ) ) {
820
+
821
+ $all_discount_types = wc_get_coupon_types();
822
+
823
+ foreach ( $value as $coupon_title ) {
824
+
825
+ $coupon = new WC_Coupon( $coupon_title );
826
+
827
+ $discount_type = $coupon->get_discount_type();
828
+
829
+ if ( isset( $discount_type ) && $discount_type ) {
830
+ $discount_type = ' ( Type: ' . $all_discount_types[ $discount_type ] . ' )';
831
+ }
832
+
833
+ $field_content .= '<option value="' . $coupon_title . '" selected="selected">' . $coupon_title . $discount_type . '</option>';
834
+ }
835
+ }
836
+
837
+ $field_content .= '</select>';
838
+
839
+ return $this->get_field( $field_data, $field_content );
840
+ }
841
+
842
+ /**
843
+ * Page selction field.
844
+ *
845
+ * @param array $field_data Field data.
846
+ *
847
+ * @return string field.
848
+ */
849
+ public function get_page_selection_field( $field_data ) {
850
+
851
+ $value = $field_data['value'];
852
+
853
+ $multiple = '';
854
+
855
+ if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
856
+ $multiple = 'multiple="multiple"';
857
+ }
858
+
859
+ $field_content = '<select
860
+ name="' . $field_data['name'] . '[]"
861
+ class="wcf-search-pages" ' . $multiple . '"
862
+ data-action="wcf_json_search_pages">';
863
+
864
+ if ( is_array( $value ) && ! empty( $value ) ) {
865
+
866
+ foreach ( $value as $data_key => $data_value ) {
867
+
868
+ $field_content .= '<option value="' . $data_value . '">' . get_the_title( $data_value ) . '</option>';
869
+ }
870
+ }
871
+
872
+ $field_content .= '</select>';
873
+
874
+ return $this->get_field( $field_data, $field_content );
875
+ }
876
+
877
+ /**
878
+ * Get section field.
879
+ *
880
+ * @param array $field_data Field data.
881
+ *
882
+ * @return string field.
883
+ */
884
+ public function get_section( $field_data ) {
885
+ $field_html = '<div class="wcf-field-row wcf-field-section">';
886
+ $field_html .= '<div class="wcf-field-section-heading" colspan="2">';
887
+ $field_html .= '<label>' . esc_html( $field_data['label'] ) . '</label>';
888
+
889
+ if ( isset( $field_data['help'] ) ) {
890
+ $field_html .= '<i class="wcf-field-heading-help dashicons dashicons-editor-help" title="' . esc_attr( $field_data['help'] ) . '"></i>';
891
+ }
892
+ $field_html .= '</div>';
893
+ $field_html .= '</div>';
894
+ return $field_html;
895
+ }
896
+
897
+ /**
898
+ * Description field.
899
+ *
900
+ * @param array $field_data Field data.
901
+ *
902
+ * @return string field.
903
+ */
904
+ public function get_description_field( $field_data ) {
905
+
906
+ $field_html = '<div class="wcf-field-row wcf-field-desc ' . $field_data['name'] . '">';
907
+ $field_html .= '<div class="wcf-field-desc-content">';
908
+ $field_html .= $field_data['content'];
909
+ $field_html .= '</div>';
910
+ $field_html .= '</div>';
911
+
912
+ return $field_html;
913
+ }
914
+
915
+ /**
916
+ * Product selection repeater field.
917
+ *
918
+ * @param array $field_data Field data.
919
+ *
920
+ * @return string field.
921
+ */
922
+ public function get_product_selection_repeater( $field_data ) {
923
+
924
+ return $this->get_meta_field_template(
925
+ 'get-product-selection-repeater.php',
926
+ $field_data
927
+ );
928
+ }
929
+
930
+ /**
931
+ * Generate product repeater html.
932
+ *
933
+ * @param string $id ID.
934
+ * @param string $options Options.
935
+ * @param array $selected_data Discount_data.
936
+ *
937
+ * @return string field.
938
+ */
939
+ public function generate_product_repeater_html( $id, $options = '', $selected_data = '' ) {
940
+
941
+ ob_start();
942
+
943
+ include CARTFLOWS_DIR . 'includes/meta-fields/generate-product-repeater.php';
944
+
945
+ return ob_get_clean();
946
+ }
947
+
948
+ /**
949
+ * Image field.
950
+ *
951
+ * @param array $field_data Field data.
952
+ *
953
+ * @return string field.
954
+ */
955
+ public function get_image_field( $field_data ) {
956
+
957
+ global $post;
958
+ $value = $field_data['value'];
959
+
960
+ $attr = '';
961
+
962
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
963
+
964
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
965
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
966
+ }
967
+ }
968
+
969
+ $display_preview_box = ( isset( $value ) && '' != $value ) ? 'display:block;' : 'display:none';
970
+
971
+ $field_content = '<div id="wcf-image-preview" style="' . $display_preview_box . '">';
972
+
973
+ if ( isset( $value ) ) {
974
+
975
+ $field_content .= '<img src="' . $field_data['value'] . '" class="saved-image" name="' . $field_data['name'] . '" width="150">';
976
+ }
977
+
978
+ $field_content .= '</div>';
979
+
980
+ $image_data = htmlentities( serialize( get_post_meta( $post->ID, $field_data['name'] . '-obj' ) ) ); // phpcs:ignore
981
+
982
+ $field_content .= '<input type="hidden" id="' . $field_data['name'] . '" class="wcf-image" name="' . $field_data['name'] . '" value="' . $value . '">'; // phpcs:ignore
983
+
984
+ $field_content .= '<input type="hidden" id="' . $field_data['name'] . '-obj' . '" class="wcf-image-obj" name="' . $field_data['name'] . '-obj' . '" value="' . $image_data . '">'; // phpcs:ignore
985
+
986
+ $field_content .= '<button type="button" ' . $attr . ' class="wcf-select-image button-secondary">Select Image</button>';
987
+
988
+ $display_remove_button = ( isset( $value ) && '' != $value ) ? 'display:inline-block; margin-left: 5px;' : 'display:none';
989
+
990
+ $field_content .= '<button type="button" class="wcf-remove-image button-secondary" style="' . $display_remove_button . '">Remove Image</button>';
991
+
992
+ return $this->get_field( $field_data, $field_content );
993
+ }
994
+
995
+ /**
996
+ * Localize variables in admin
997
+ *
998
+ * @param array $vars variables.
999
+ */
1000
+ public function localize_vars( $vars ) {
1001
+
1002
+ $ajax_actions = array(
1003
+ 'wcf_json_search_pages',
1004
+ 'wcf_json_search_coupons',
1005
+ 'wcf_json_search_products_and_variations',
1006
+ );
1007
+
1008
+ foreach ( $ajax_actions as $action ) {
1009
+
1010
+ $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
1011
+ }
1012
+
1013
+ /* Add product from iframe */
1014
+ $product_src = esc_url_raw(
1015
+ add_query_arg(
1016
+ array(
1017
+ 'post_type' => 'product',
1018
+ 'wcf-woo-iframe' => 'true',
1019
+ ),
1020
+ admin_url( 'post-new.php' )
1021
+ )
1022
+ );
1023
+
1024
+ $vars['create_product_src'] = $product_src;
1025
+ /* Add product from iframe End */
1026
+
1027
+ return $vars;
1028
+ }
1029
+
1030
+ /**
1031
+ * Get meta field template.
1032
+ *
1033
+ * @param string $template file name.
1034
+ * @param array $field_data Field data.
1035
+ *
1036
+ * @return string.
1037
+ */
1038
+ public function get_meta_field_template( $template, $field_data ) {
1039
+
1040
+ ob_start();
1041
+
1042
+ include CARTFLOWS_DIR . 'includes/meta-fields/' . $template;
1043
+
1044
+ return ob_get_clean();
1045
+ }
1046
+ }
classes/class-cartflows-stats.php CHANGED
@@ -1,87 +1,87 @@
1
- <?php
2
- /**
3
- * Stats
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Stats
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Stats {
14
-
15
- /**
16
- * Member Variable
17
- *
18
- * @var object instance
19
- */
20
- private static $instance;
21
-
22
- /**
23
- * Initiator
24
- */
25
- public static function get_instance() {
26
- if ( ! isset( self::$instance ) ) {
27
- self::$instance = new self();
28
- }
29
- return self::$instance;
30
- }
31
-
32
- /**
33
- * Constructor
34
- */
35
- public function __construct() {
36
-
37
- add_action( 'wp_ajax_cartflows_fetch_stats', array( $this, 'fetch_stats' ) );
38
- }
39
-
40
- /**
41
- * Get stats.
42
- */
43
- public function fetch_stats() {
44
-
45
- check_ajax_referer( 'wcf-fetch-stats', 'security' );
46
-
47
- $filter = filter_input( INPUT_POST, 'filter', FILTER_SANITIZE_STRING );
48
-
49
- if ( ! $filter ) {
50
- $filter = 'week';
51
- }
52
-
53
- $from_date = gmdate( 'Y-m-d' );
54
- $to_date = gmdate( 'Y-m-d' );
55
- $to_date = date( 'Y-m-d H:i:s', strtotime( $to_date . '23:59:59' ) ); //phpcs:ignore
56
-
57
- switch ( $filter ) {
58
-
59
- case 'today':
60
- $from_date = date( 'Y-m-d H:i:s', strtotime( $from_date . '00:00:00' ) ); //phpcs:ignore
61
- break;
62
- case 'yesterday':
63
- $yesterday = gmdate( 'Y-m-d', strtotime( '-1 days' ) );
64
- $from_date = date( 'Y-m-d H:i:s', strtotime( $yesterday . '00:00:00' ) ); //phpcs:ignore
65
- $to_date = date( 'Y-m-d H:i:s', strtotime( $yesterday . '23:59:59' ) ); //phpcs:ignore
66
- break;
67
- case 'week':
68
- $from_date = gmdate( 'Y-m-d', strtotime( '-7 days' ) );
69
- $from_date = date( 'Y-m-d H:i:s', strtotime( $from_date . '00:00:00' ) ); //phpcs:ignore
70
- break;
71
- case 'month':
72
- $from_date = gmdate( 'Y-m-d', strtotime( '-1 months' ) );
73
- $from_date = date( 'Y-m-d H:i:s', strtotime( $from_date . '00:00:00' ) ); //phpcs:ignore
74
- break;
75
- case 'custom':
76
- $to_date = $to_date ? $to_date : gmdate( 'Y-m-d' );
77
- $from_date = $from_date ? $from_date : $to_date;
78
- break;
79
- default:
80
- }
81
- }
82
- }
83
-
84
- /**
85
- * Kicking this off by calling 'get_instance()' method
86
- */
87
- Cartflows_Stats::get_instance();
1
+ <?php
2
+ /**
3
+ * Stats
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Stats
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Stats {
14
+
15
+ /**
16
+ * Member Variable
17
+ *
18
+ * @var object instance
19
+ */
20
+ private static $instance;
21
+
22
+ /**
23
+ * Initiator
24
+ */
25
+ public static function get_instance() {
26
+ if ( ! isset( self::$instance ) ) {
27
+ self::$instance = new self();
28
+ }
29
+ return self::$instance;
30
+ }
31
+
32
+ /**
33
+ * Constructor
34
+ */
35
+ public function __construct() {
36
+
37
+ add_action( 'wp_ajax_cartflows_fetch_stats', array( $this, 'fetch_stats' ) );
38
+ }
39
+
40
+ /**
41
+ * Get stats.
42
+ */
43
+ public function fetch_stats() {
44
+
45
+ check_ajax_referer( 'wcf-fetch-stats', 'security' );
46
+
47
+ $filter = filter_input( INPUT_POST, 'filter', FILTER_SANITIZE_STRING );
48
+
49
+ if ( ! $filter ) {
50
+ $filter = 'week';
51
+ }
52
+
53
+ $from_date = gmdate( 'Y-m-d' );
54
+ $to_date = gmdate( 'Y-m-d' );
55
+ $to_date = date( 'Y-m-d H:i:s', strtotime( $to_date . '23:59:59' ) ); //phpcs:ignore
56
+
57
+ switch ( $filter ) {
58
+
59
+ case 'today':
60
+ $from_date = date( 'Y-m-d H:i:s', strtotime( $from_date . '00:00:00' ) ); //phpcs:ignore
61
+ break;
62
+ case 'yesterday':
63
+ $yesterday = gmdate( 'Y-m-d', strtotime( '-1 days' ) );
64
+ $from_date = date( 'Y-m-d H:i:s', strtotime( $yesterday . '00:00:00' ) ); //phpcs:ignore
65
+ $to_date = date( 'Y-m-d H:i:s', strtotime( $yesterday . '23:59:59' ) ); //phpcs:ignore
66
+ break;
67
+ case 'week':
68
+ $from_date = gmdate( 'Y-m-d', strtotime( '-7 days' ) );
69
+ $from_date = date( 'Y-m-d H:i:s', strtotime( $from_date . '00:00:00' ) ); //phpcs:ignore
70
+ break;
71
+ case 'month':
72
+ $from_date = gmdate( 'Y-m-d', strtotime( '-1 months' ) );
73
+ $from_date = date( 'Y-m-d H:i:s', strtotime( $from_date . '00:00:00' ) ); //phpcs:ignore
74
+ break;
75
+ case 'custom':
76
+ $to_date = $to_date ? $to_date : gmdate( 'Y-m-d' );
77
+ $from_date = $from_date ? $from_date : $to_date;
78
+ break;
79
+ default:
80
+ }
81
+ }
82
+ }
83
+
84
+ /**
85
+ * Kicking this off by calling 'get_instance()' method
86
+ */
87
+ Cartflows_Stats::get_instance();
classes/class-cartflows-step-factory.php CHANGED
@@ -1,250 +1,250 @@
1
- <?php
2
- /**
3
- * Get current step data - factory.
4
- *
5
- * @package cartflows
6
- */
7
-
8
- /**
9
- * Step factory
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Step_Factory {
14
-
15
- /**
16
- * Member Variable
17
- *
18
- * @var int step_id
19
- */
20
- private $step_id;
21
-
22
- /**
23
- * Member Variable
24
- *
25
- * @var int control_step_id
26
- */
27
- private $control_step_id;
28
-
29
- /**
30
- * Member Variable
31
- *
32
- * @var int flow_id
33
- */
34
- private $flow_id;
35
-
36
-
37
- /**
38
- * Member Variable
39
- *
40
- * @var string step_type
41
- */
42
- private $step_type;
43
-
44
- /**
45
- * Member Variable
46
- *
47
- * @var int flow_steps
48
- */
49
- private $flow_steps;
50
-
51
- /**
52
- * Member Variable
53
- *
54
- * @var int flow_steps
55
- */
56
- private $flow_steps_map;
57
-
58
- /**
59
- * Member Variable
60
- *
61
- * @var int ab_test
62
- */
63
- private $ab_test;
64
-
65
- /**
66
- * Member Variable
67
- *
68
- * @var int all_variations
69
- */
70
- private $all_variations;
71
-
72
- /**
73
- * Member Variable
74
- *
75
- * @var array show_variations
76
- */
77
- private $show_variations;
78
-
79
- /**
80
- * Member Variable
81
- *
82
- * @var int show_variation_id
83
- */
84
- private $show_variation_id;
85
-
86
- /**
87
- * Constructor
88
- *
89
- * @param int $id step id.
90
- */
91
- public function __construct( $id = null ) {
92
-
93
- if ( null !== $id ) {
94
-
95
- /* Data from step */
96
- $this->step_id = intval( $id );
97
- $this->step_type = get_post_meta( $this->step_id, 'wcf-step-type', true );
98
- /* Data from flow */
99
- $this->flow_id = get_post_meta( $this->step_id, 'wcf-flow-id', true );
100
- $this->flow_steps = get_post_meta( $this->flow_id, 'wcf-steps', true );
101
-
102
- /* If Ab test */
103
- $this->ab_test = get_post_meta( $this->step_id, 'wcf-ab-test', true );
104
- $this->control_step_id = $this->step_id;
105
-
106
- if ( $this->ab_test ) {
107
-
108
- $control_step_id = get_post_meta( $this->step_id, 'wcf-control-step', true );
109
-
110
- if ( ! empty( $control_step_id ) ) {
111
- $this->control_step_id = intval( $control_step_id );
112
- }
113
- }
114
- }
115
- }
116
-
117
- /**
118
- * Is ab test enable
119
- */
120
- public function is_ab_test_enable() {
121
-
122
- if ( $this->ab_test ) {
123
-
124
- return true;
125
- }
126
-
127
- return false;
128
- }
129
-
130
- /**
131
- * Get flow id
132
- */
133
- public function get_flow_id() {
134
- return $this->flow_id;
135
- }
136
-
137
- /**
138
- * Get step id
139
- */
140
- public function get_step_id() {
141
- return $this->step_id;
142
- }
143
-
144
- /**
145
- * Get step type
146
- */
147
- public function get_step_type() {
148
- return $this->step_type;
149
- }
150
-
151
- /**
152
- * Get control step id
153
- */
154
- public function get_current_step() {
155
- return $this->step_id;
156
- }
157
-
158
- /**
159
- * Get control step id
160
- */
161
- public function get_control_step() {
162
- return $this->control_step_id;
163
- }
164
-
165
- /**
166
- * Get flow steps
167
- */
168
- public function get_flow_steps() {
169
- return $this->flow_steps;
170
- }
171
-
172
- /**
173
- * Set flow steps map
174
- */
175
- public function set_flow_steps_map() {
176
-
177
- }
178
-
179
- /**
180
- * Check for thank you page
181
- *
182
- * @return bool
183
- */
184
- public function is_thankyou_page() {
185
-
186
- $step_type = $this->get_step_type();
187
-
188
- if ( 'thankyou' === $step_type ) {
189
-
190
- return true;
191
- }
192
-
193
- return false;
194
- }
195
-
196
- /**
197
- * Check for checkout page
198
- *
199
- * @return bool
200
- */
201
- public function is_checkout_page() {
202
-
203
- $step_type = $this->get_step_type();
204
-
205
- if ( 'checkout' === $step_type ) {
206
-
207
- return true;
208
- }
209
-
210
- return false;
211
- }
212
-
213
- /**
214
- * Get direct next step id.
215
- *
216
- * @since x.x.x
217
- *
218
- * @return bool|int
219
- */
220
- public function get_direct_next_step_id() {
221
-
222
- $next_step_id = false;
223
-
224
- if ( $this->flow_id ) {
225
-
226
- $flow_steps = $this->get_flow_steps();
227
- $control_step = $this->get_control_step();
228
-
229
- if ( is_array( $flow_steps ) ) {
230
-
231
- foreach ( $flow_steps as $index => $data ) {
232
-
233
- if ( intval( $data['id'] ) === $control_step ) {
234
-
235
- $next_step_index = $index + 1;
236
-
237
- if ( isset( $flow_steps[ $next_step_index ] ) ) {
238
-
239
- $next_step_id = intval( $flow_steps[ $next_step_index ]['id'] );
240
- }
241
-
242
- break;
243
- }
244
- }
245
- }
246
- }
247
-
248
- return $next_step_id;
249
- }
250
- }
1
+ <?php
2
+ /**
3
+ * Get current step data - factory.
4
+ *
5
+ * @package cartflows
6
+ */
7
+
8
+ /**
9
+ * Step factory
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Step_Factory {
14
+
15
+ /**
16
+ * Member Variable
17
+ *
18
+ * @var int step_id
19
+ */
20
+ private $step_id;
21
+
22
+ /**
23
+ * Member Variable
24
+ *
25
+ * @var int control_step_id
26
+ */
27
+ private $control_step_id;
28
+
29
+ /**
30
+ * Member Variable
31
+ *
32
+ * @var int flow_id
33
+ */
34
+ private $flow_id;
35
+
36
+
37
+ /**
38
+ * Member Variable
39
+ *
40
+ * @var string step_type
41
+ */
42
+ private $step_type;
43
+
44
+ /**
45
+ * Member Variable
46
+ *
47
+ * @var int flow_steps
48
+ */
49
+ private $flow_steps;
50
+
51
+ /**
52
+ * Member Variable
53
+ *
54
+ * @var int flow_steps
55
+ */
56
+ private $flow_steps_map;
57
+
58
+ /**
59
+ * Member Variable
60
+ *
61
+ * @var int ab_test
62
+ */
63
+ private $ab_test;
64
+
65
+ /**
66
+ * Member Variable
67
+ *
68
+ * @var int all_variations
69
+ */
70
+ private $all_variations;
71
+
72
+ /**
73
+ * Member Variable
74
+ *
75
+ * @var array show_variations
76
+ */
77
+ private $show_variations;
78
+
79
+ /**
80
+ * Member Variable
81
+ *
82
+ * @var int show_variation_id
83
+ */
84
+ private $show_variation_id;
85
+
86
+ /**
87
+ * Constructor
88
+ *
89
+ * @param int $id step id.
90
+ */
91
+ public function __construct( $id = null ) {
92
+
93
+ if ( null !== $id ) {
94
+
95
+ /* Data from step */
96
+ $this->step_id = intval( $id );
97
+ $this->step_type = get_post_meta( $this->step_id, 'wcf-step-type', true );
98
+ /* Data from flow */
99
+ $this->flow_id = get_post_meta( $this->step_id, 'wcf-flow-id', true );
100
+ $this->flow_steps = get_post_meta( $this->flow_id, 'wcf-steps', true );
101
+
102
+ /* If Ab test */
103
+ $this->ab_test = get_post_meta( $this->step_id, 'wcf-ab-test', true );
104
+ $this->control_step_id = $this->step_id;
105
+
106
+ if ( $this->ab_test ) {
107
+
108
+ $control_step_id = get_post_meta( $this->step_id, 'wcf-control-step', true );
109
+
110
+ if ( ! empty( $control_step_id ) ) {
111
+ $this->control_step_id = intval( $control_step_id );
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Is ab test enable
119
+ */
120
+ public function is_ab_test_enable() {
121
+
122
+ if ( $this->ab_test ) {
123
+
124
+ return true;
125
+ }
126
+
127
+ return false;
128
+ }
129
+
130
+ /**
131
+ * Get flow id
132
+ */
133
+ public function get_flow_id() {
134
+ return $this->flow_id;
135
+ }
136
+
137
+ /**
138
+ * Get step id
139
+ */
140
+ public function get_step_id() {
141
+ return $this->step_id;
142
+ }
143
+
144
+ /**
145
+ * Get step type
146
+ */
147
+ public function get_step_type() {
148
+ return $this->step_type;
149
+ }
150
+
151
+ /**
152
+ * Get control step id
153
+ */
154
+ public function get_current_step() {
155
+ return $this->step_id;
156
+ }
157
+
158
+ /**
159
+ * Get control step id
160
+ */
161
+ public function get_control_step() {
162
+ return $this->control_step_id;
163
+ }
164
+
165
+ /**
166
+ * Get flow steps
167
+ */
168
+ public function get_flow_steps() {
169
+ return $this->flow_steps;
170
+ }
171
+
172
+ /**
173
+ * Set flow steps map
174
+ */
175
+ public function set_flow_steps_map() {
176
+
177
+ }
178
+
179
+ /**
180
+ * Check for thank you page
181
+ *
182
+ * @return bool
183
+ */
184
+ public function is_thankyou_page() {
185
+
186
+ $step_type = $this->get_step_type();
187
+
188
+ if ( 'thankyou' === $step_type ) {
189
+
190
+ return true;
191
+ }
192
+
193
+ return false;
194
+ }
195
+
196
+ /**
197
+ * Check for checkout page
198
+ *
199
+ * @return bool
200
+ */
201
+ public function is_checkout_page() {
202
+
203
+ $step_type = $this->get_step_type();
204
+
205
+ if ( 'checkout' === $step_type ) {
206
+
207
+ return true;
208
+ }
209
+
210
+ return false;
211
+ }
212
+
213
+ /**
214
+ * Get direct next step id.
215
+ *
216
+ * @since x.x.x
217
+ *
218
+ * @return bool|int
219
+ */
220
+ public function get_direct_next_step_id() {
221
+
222
+ $next_step_id = false;
223
+
224
+ if ( $this->flow_id ) {
225
+
226
+ $flow_steps = $this->get_flow_steps();
227
+ $control_step = $this->get_control_step();
228
+
229
+ if ( is_array( $flow_steps ) ) {
230
+
231
+ foreach ( $flow_steps as $index => $data ) {
232
+
233
+ if ( intval( $data['id'] ) === $control_step ) {
234
+
235
+ $next_step_index = $index + 1;
236
+
237
+ if ( isset( $flow_steps[ $next_step_index ] ) ) {
238
+
239
+ $next_step_id = intval( $flow_steps[ $next_step_index ]['id'] );
240
+ }
241
+
242
+ break;
243
+ }
244
+ }
245
+ }
246
+ }
247
+
248
+ return $next_step_id;
249
+ }
250
+ }
classes/class-cartflows-update.php CHANGED
@@ -1,146 +1,146 @@
1
- <?php
2
- /**
3
- * Update Compatibility
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- if ( ! class_exists( 'Cartflows_Update' ) ) :
9
-
10
- /**
11
- * CartFlows Update initial setup
12
- *
13
- * @since 1.0.0
14
- */
15
- class Cartflows_Update {
16
-
17
- /**
18
- * Class instance.
19
- *
20
- * @access private
21
- * @var $instance Class instance.
22
- */
23
- private static $instance;
24
-
25
- /**
26
- * Initiator
27
- */
28
- public static function get_instance() {
29
- if ( ! isset( self::$instance ) ) {
30
- self::$instance = new self();
31
- }
32
- return self::$instance;
33
- }
34
-
35
- /**
36
- * Constructor
37
- */
38
- public function __construct() {
39
- add_action( 'admin_init', array( $this, 'init' ) );
40
- }
41
-
42
- /**
43
- * Init
44
- *
45
- * @since 1.0.0
46
- * @return void
47
- */
48
- public function init() {
49
-
50
- do_action( 'cartflows_update_before' );
51
-
52
- // Get auto saved version number.
53
- $saved_version = get_option( 'cartflows-version', false );
54
-
55
- // Update auto saved version number.
56
- if ( ! $saved_version ) {
57
- update_option( 'cartflows-version', CARTFLOWS_VER );
58
- return;
59
- }
60
-
61
- // If equals then return.
62
- if ( version_compare( $saved_version, CARTFLOWS_VER, '=' ) ) {
63
- return;
64
- }
65
-
66
- $this->logger_files();
67
-
68
- if ( version_compare( $saved_version, '1.1.22', '<' ) ) {
69
- update_option( 'wcf_setup_skipped', true );
70
- }
71
-
72
- if ( version_compare( $saved_version, '1.2.0', '<' ) ) {
73
-
74
- $this->changed_wp_templates();
75
- }
76
-
77
- // Update auto saved version number.
78
- update_option( 'cartflows-version', CARTFLOWS_VER );
79
-
80
- do_action( 'cartflows_update_after' );
81
- }
82
-
83
-
84
- /**
85
- * Loading logger files.
86
- *
87
- * @since 1.0.0
88
- * @return void
89
- */
90
- public function logger_files() {
91
-
92
- if ( ! defined( 'CARTFLOWS_LOG_DIR' ) ) {
93
-
94
- $upload_dir = wp_upload_dir( null, false );
95
-
96
- define( 'CARTFLOWS_LOG_DIR', $upload_dir['basedir'] . '/cartflows-logs/' );
97
- }
98
-
99
- wcf()->create_files();
100
- }
101
-
102
- /**
103
- * Init
104
- *
105
- * @since 1.0.0
106
- * @return void
107
- */
108
- public function changed_wp_templates() {
109
-
110
- global $wpdb;
111
-
112
- $query_results = $wpdb->get_results(
113
- $wpdb->prepare(
114
- "SELECT {$wpdb->posts}.ID FROM {$wpdb->posts} LEFT JOIN {$wpdb->postmeta} ON ( {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id )
115
- where {$wpdb->posts}.post_type = %s AND {$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value != %s AND {$wpdb->postmeta}.meta_value != %s",
116
- 'cartflows_step',
117
- '_wp_page_template',
118
- 'cartflows-canvas',
119
- 'cartflows-default'
120
- )
121
- ); // db call ok; no-cache ok.
122
-
123
- if ( is_array( $query_results ) && ! empty( $query_results ) ) {
124
-
125
- require_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-change-template-batch.php';
126
-
127
- wcf()->logger->log( '(✓) Update Templates BATCH Started!' );
128
-
129
- $change_template_batch = new Cartflows_Change_Template_Batch();
130
-
131
- foreach ( $query_results as $query_result ) {
132
-
133
- wcf()->logger->log( '(✓) POST ID ' . $query_result->ID );
134
- $change_template_batch->push_to_queue( $query_result->ID );
135
- }
136
-
137
- $change_template_batch->save()->dispatch();
138
- }
139
- }
140
- }
141
- /**
142
- * Kicking this off by calling 'get_instance()' method
143
- */
144
- Cartflows_Update::get_instance();
145
-
146
- endif;
1
+ <?php
2
+ /**
3
+ * Update Compatibility
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ if ( ! class_exists( 'Cartflows_Update' ) ) :
9
+
10
+ /**
11
+ * CartFlows Update initial setup
12
+ *
13
+ * @since 1.0.0
14
+ */
15
+ class Cartflows_Update {
16
+
17
+ /**
18
+ * Class instance.
19
+ *
20
+ * @access private
21
+ * @var $instance Class instance.
22
+ */
23
+ private static $instance;
24
+
25
+ /**
26
+ * Initiator
27
+ */
28
+ public static function get_instance() {
29
+ if ( ! isset( self::$instance ) ) {
30
+ self::$instance = new self();
31
+ }
32
+ return self::$instance;
33
+ }
34
+
35
+ /**
36
+ * Constructor
37
+ */
38
+ public function __construct() {
39
+ add_action( 'admin_init', array( $this, 'init' ) );
40
+ }
41
+
42
+ /**
43
+ * Init
44
+ *
45
+ * @since 1.0.0
46
+ * @return void
47
+ */
48
+ public function init() {
49
+
50
+ do_action( 'cartflows_update_before' );
51
+
52
+ // Get auto saved version number.
53
+ $saved_version = get_option( 'cartflows-version', false );
54
+
55
+ // Update auto saved version number.
56
+ if ( ! $saved_version ) {
57
+ update_option( 'cartflows-version', CARTFLOWS_VER );
58
+ return;
59
+ }
60
+
61
+ // If equals then return.
62
+ if ( version_compare( $saved_version, CARTFLOWS_VER, '=' ) ) {
63
+ return;
64
+ }
65
+
66
+ $this->logger_files();
67
+
68
+ if ( version_compare( $saved_version, '1.1.22', '<' ) ) {
69
+ update_option( 'wcf_setup_skipped', true );
70
+ }
71
+
72
+ if ( version_compare( $saved_version, '1.2.0', '<' ) ) {
73
+
74
+ $this->changed_wp_templates();
75
+ }
76
+
77
+ // Update auto saved version number.
78
+ update_option( 'cartflows-version', CARTFLOWS_VER );
79
+
80
+ do_action( 'cartflows_update_after' );
81
+ }
82
+
83
+
84
+ /**
85
+ * Loading logger files.
86
+ *
87
+ * @since 1.0.0
88
+ * @return void
89
+ */
90
+ public function logger_files() {
91
+
92
+ if ( ! defined( 'CARTFLOWS_LOG_DIR' ) ) {
93
+
94
+ $upload_dir = wp_upload_dir( null, false );
95
+
96
+ define( 'CARTFLOWS_LOG_DIR', $upload_dir['basedir'] . '/cartflows-logs/' );
97
+ }
98
+
99
+ wcf()->create_files();
100
+ }
101
+
102
+ /**
103
+ * Init
104
+ *
105
+ * @since 1.0.0
106
+ * @return void
107
+ */
108
+ public function changed_wp_templates() {
109
+
110
+ global $wpdb;
111
+
112
+ $query_results = $wpdb->get_results(
113
+ $wpdb->prepare(
114
+ "SELECT {$wpdb->posts}.ID FROM {$wpdb->posts} LEFT JOIN {$wpdb->postmeta} ON ( {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id )
115
+ where {$wpdb->posts}.post_type = %s AND {$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value != %s AND {$wpdb->postmeta}.meta_value != %s",
116
+ 'cartflows_step',
117
+ '_wp_page_template',
118
+ 'cartflows-canvas',
119
+ 'cartflows-default'
120
+ )
121
+ ); // db call ok; no-cache ok.
122
+
123
+ if ( is_array( $query_results ) && ! empty( $query_results ) ) {
124
+
125
+ require_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-change-template-batch.php';
126
+
127
+ wcf()->logger->log( '(✓) Update Templates BATCH Started!' );
128
+
129
+ $change_template_batch = new Cartflows_Change_Template_Batch();
130
+
131
+ foreach ( $query_results as $query_result ) {
132
+
133
+ wcf()->logger->log( '(✓) POST ID ' . $query_result->ID );
134
+ $change_template_batch->push_to_queue( $query_result->ID );
135
+ }
136
+
137
+ $change_template_batch->save()->dispatch();
138
+ }
139
+ }
140
+ }
141
+ /**
142
+ * Kicking this off by calling 'get_instance()' method
143
+ */
144
+ Cartflows_Update::get_instance();
145
+
146
+ endif;
classes/class-cartflows-utils.php CHANGED
@@ -1,581 +1,581 @@
1
- <?php
2
- /**
3
- * Utils.
4
- *
5
- * @package CARTFLOWS
6
- */
7
-
8
- if ( ! defined( 'ABSPATH' ) ) {
9
- exit; // Exit if accessed directly.
10
- }
11
-
12
- /**
13
- * Class Cartflows_Utils.
14
- */
15
- class Cartflows_Utils {
16
-
17
- /**
18
- * Member Variable
19
- *
20
- * @var instance
21
- */
22
- private static $instance;
23
-
24
- /**
25
- * Member Variable
26
- *
27
- * @var checkout_products
28
- */
29
- public $checkout_products = array();
30
-
31
-
32
- /**
33
- * Initiator
34
- */
35
- public static function get_instance() {
36
- if ( ! isset( self::$instance ) ) {
37
- self::$instance = new self();
38
- }
39
- return self::$instance;
40
- }
41
-
42
- /**
43
- * Constructor
44
- */
45
- public function __construct() {
46
- }
47
-
48
- /**
49
- * Get current post type
50
- *
51
- * @param string $post_type post type.
52
- * @return string
53
- */
54
- public function current_post_type( $post_type = '' ) {
55
-
56
- if ( '' === $post_type ) {
57
- $post_type = get_post_type();
58
- }
59
-
60
- return $post_type;
61
- }
62
-
63
- /**
64
- * Check if post type is of step.
65
- *
66
- * @param string $post_type post type.
67
- * @return bool
68
- */
69
- public function is_step_post_type( $post_type = '' ) {
70
-
71
- if ( $this->get_step_post_type() === $this->current_post_type( $post_type ) ) {
72
-
73
- return true;
74
- }
75
-
76
- return false;
77
- }
78
-
79
- /**
80
- * Check if post type is of flow.
81
- *
82
- * @param string $post_type post type.
83
- * @return bool
84
- */
85
- public function is_flow_post_type( $post_type = '' ) {
86
-
87
- if ( $this->get_flow_post_type() === $this->current_post_type( $post_type ) ) {
88
-
89
- return true;
90
- }
91
-
92
- return false;
93
- }
94
-
95
- /**
96
- * Get post type of step.
97
- *
98
- * @return string
99
- */
100
- public function get_step_post_type() {
101
-
102
- return CARTFLOWS_STEP_POST_TYPE;
103
- }
104
-
105
- /**
106
- * Get post type of flow.
107
- *
108
- * @return string
109
- */
110
- public function get_flow_post_type() {
111
-
112
- return CARTFLOWS_FLOW_POST_TYPE;
113
- }
114
-
115
- /**
116
- * Get flow id
117
- *
118
- * @return int
119
- */
120
- public function get_flow_id() {
121
-
122
- global $post;
123
-
124
- return get_post_meta( $post->ID, 'wcf-flow-id', true );
125
- }
126
-
127
- /**
128
- * Get flow id by step
129
- *
130
- * @param int $step_id step ID.
131
- * @return int
132
- */
133
- public function get_flow_id_from_step_id( $step_id ) {
134
-
135
- return get_post_meta( $step_id, 'wcf-flow-id', true );
136
- }
137
-
138
- /**
139
- * Get flow steps by id
140
- *
141
- * @param int $flow_id flow ID.
142
- * @return int
143
- */
144
- public function get_flow_steps( $flow_id ) {
145
-
146
- $steps = get_post_meta( $flow_id, 'wcf-steps', true );
147
-
148
- if ( is_array( $steps ) && ! empty( $steps ) ) {
149
- return $steps;
150
- }
151
-
152
- return false;
153
- }
154
-
155
- /**
156
- * Get template type of step
157
- *
158
- * @param int $step_id step ID.
159
- * @return int
160
- */
161
- public function get_step_type( $step_id ) {
162
-
163
- return get_post_meta( $step_id, 'wcf-step-type', true );
164
- }
165
-
166
- /**
167
- * Get next id for step
168
- *
169
- * @param int $flow_id flow ID.
170
- * @param int $step_id step ID.
171
- * @return bool
172
- */
173
- public function get_next_step_id( $flow_id, $step_id ) {
174
-
175
- $wcf_step_obj = wcf_get_step( $step_id );
176
- $next_step_id = $wcf_step_obj->get_direct_next_step_id();
177
-
178
- return $next_step_id;
179
- }
180
-
181
- /**
182
- * Get next id for step
183
- *
184
- * @param int $order_id order ID.
185
- * @return int
186
- */
187
- public function get_flow_id_from_order( $order_id ) {
188
-
189
- $flow_id = get_post_meta( $order_id, '_wcf_flow_id', true );
190
-
191
- return intval( $flow_id );
192
- }
193
-
194
- /**
195
- * Get checkout id for order
196
- *
197
- * @param int $order_id order ID.
198
- * @return int
199
- */
200
- public function get_checkout_id_from_order( $order_id ) {
201
-
202
- $checkout_id = get_post_meta( $order_id, '_wcf_checkout_id', true );
203
-
204
- return intval( $checkout_id );
205
- }
206
-
207
- /**
208
- * We are using this function mostly in ajax on checkout page
209
- *
210
- * @return bool
211
- */
212
- public function get_checkout_id_from_post_data() {
213
-
214
- if ( isset( $_POST['_wcf_checkout_id'] ) ) { //phpcs:ignore
215
-
216
- $checkout_id = filter_var( wp_unslash( $_POST['_wcf_checkout_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
217
-
218
- return intval( $checkout_id );
219
- }
220
-
221
- return false;
222
- }
223
-
224
- /**
225
- * We are using this function mostly in ajax on checkout page
226
- *
227
- * @return bool
228
- */
229
- public function get_flow_id_from_post_data() {
230
-
231
- if ( isset( $_POST['_wcf_flow_id'] ) ) { //phpcs:ignore
232
-
233
- $flow_id = filter_var( wp_unslash( $_POST['_wcf_flow_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
234
-
235
- return intval( $flow_id );
236
- }
237
-
238
- return false;
239
- }
240
-
241
- /**
242
- * Get optin id for order
243
- *
244
- * @param int $order_id order ID.
245
- * @return int
246
- */
247
- public function get_optin_id_from_order( $order_id ) {
248
-
249
- $optin_id = get_post_meta( $order_id, '_wcf_optin_id', true );
250
-
251
- return intval( $optin_id );
252
- }
253
-
254
- /**
255
- * We are using this function mostly in ajax on checkout page
256
- *
257
- * @return bool
258
- */
259
- public function get_optin_id_from_post_data() {
260
-
261
- if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
262
-
263
- $optin_id = filter_var( wp_unslash( $_POST['_wcf_optin_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
264
-
265
- return intval( $optin_id );
266
- }
267
-
268
- return false;
269
- }
270
-
271
- /**
272
- * Check for thank you page
273
- *
274
- * @param int $step_id step ID.
275
- * @return bool
276
- */
277
- public function check_is_thankyou_page( $step_id ) {
278
-
279
- $step_type = $this->get_step_type( $step_id );
280
-
281
- if ( 'thankyou' === $step_type ) {
282
-
283
- return true;
284
- }
285
-
286
- return false;
287
- }
288
-
289
- /**
290
- * Check for offer page
291
- *
292
- * @param int $step_id step ID.
293
- * @return bool
294
- */
295
- public function check_is_offer_page( $step_id ) {
296
-
297
- $step_type = $this->get_step_type( $step_id );
298
-
299
- if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
300
-
301
- return true;
302
- }
303
-
304
- return false;
305
- }
306
-
307
- /**
308
- * Check if loaded page requires woo.
309
- *
310
- * @return bool
311
- */
312
- public function check_is_woo_required_page() {
313
-
314
- global $post;
315
- $step_id = $post->ID;
316
- $woo_not_required_type = array( 'landing' );
317
- $step_type = $this->get_step_type( $step_id );
318
- return ( ! in_array( $step_type, $woo_not_required_type, true ) );
319
- }
320
-
321
- /**
322
- * Define constant for cache
323
- *
324
- * @return void
325
- */
326
- public function do_not_cache() {
327
-
328
- global $post;
329
-
330
- if ( ! apply_filters( 'cartflows_do_not_cache_step', true, $post->ID ) ) {
331
- return;
332
- }
333
-
334
- wcf_maybe_define_constant( 'DONOTCACHEPAGE', true );
335
- wcf_maybe_define_constant( 'DONOTCACHEOBJECT', true );
336
- wcf_maybe_define_constant( 'DONOTCACHEDB', true );
337
-
338
- nocache_headers();
339
- }
340
-
341
- /**
342
- * Get linking url
343
- *
344
- * @param array $args query args.
345
- * @return string
346
- */
347
- public function get_linking_url( $args = array() ) {
348
-
349
- $url = get_home_url();
350
-
351
- $url = add_query_arg( $args, $url );
352
-
353
- return $url;
354
- }
355
-
356
- /**
357
- * Get assets urls
358
- *
359
- * @return array
360
- * @since 1.1.6
361
- */
362
- public function get_assets_path() {
363
-
364
- $rtl = '';
365
-
366
- if ( is_rtl() ) {
367
- $rtl = '-rtl';
368
- }
369
-
370
- $file_prefix = '';
371
- $dir_name = '';
372
-
373
- $is_min = apply_filters( 'cartflows_load_min_assets', false );
374
-
375
- if ( $is_min ) {
376
- $file_prefix = '.min';
377
- $dir_name = 'min-';
378
- }
379
-
380
- $js_gen_path = CARTFLOWS_URL . 'assets/' . $dir_name . 'js/';
381
- $css_gen_path = CARTFLOWS_URL . 'assets/' . $dir_name . 'css/';
382
-
383
- return array(
384
- 'css' => $css_gen_path,
385
- 'js' => $js_gen_path,
386
- 'file_prefix' => $file_prefix,
387
- 'rtl' => $rtl,
388
- );
389
- }
390
-
391
- /**
392
- * Get assets css url
393
- *
394
- * @param string $file file name.
395
- * @return string
396
- * @since 1.1.6
397
- */
398
- public function get_css_url( $file ) {
399
-
400
- $assets_vars = wcf()->assets_vars;
401
-
402
- $url = $assets_vars['css'] . $file . $assets_vars['rtl'] . $assets_vars['file_prefix'] . '.css';
403
-
404
- return $url;
405
- }
406
-
407
- /**
408
- * Get assets js url
409
- *
410
- * @param string $file file name.
411
- * @return string
412
- * @since 1.1.6
413
- */
414
- public function get_js_url( $file ) {
415
-
416
- $assets_vars = wcf()->assets_vars;
417
-
418
- $url = $assets_vars['js'] . $file . $assets_vars['file_prefix'] . '.js';
419
-
420
- return $url;
421
- }
422
-
423
- /**
424
- * Get unique id.
425
- *
426
- * @param int $length Length.
427
- *
428
- * @return string
429
- */
430
- public function get_unique_id( $length = 8 ) {
431
-
432
- return substr( md5( microtime() ), 0, $length );
433
- }
434
-
435
- /**
436
- * Get selected checkout products and data
437
- *
438
- * @param int $checkout_id Checkout id..
439
- * @param array $saved_products Saved product.
440
- *
441
- * @return array
442
- */
443
- public function get_selected_checkout_products( $checkout_id = '', $saved_products = array() ) {
444
-
445
- if ( empty( $checkout_id ) ) {
446
-
447
- global $post;
448
-
449
- $checkout_id = $post->ID;
450
- }
451
-
452
- if ( ! isset( $this->checkout_products[ $checkout_id ] ) ) {
453
-
454
- if ( ! empty( $saved_products ) ) {
455
-
456
- $products = $saved_products;
457
- } else {
458
-
459
- $products = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-products' );
460
- }
461
-
462
- $verify_url_data = false;
463
- $default_add_to_cart = false;
464
- $default_ids = array();
465
- $default_add_to_cart = true;
466
-
467
- if ( isset( $_GET['wcf-default'] ) ) { //phpcs:ignore
468
- //phpcs:ignore WordPress.Security.NonceVerification.Recommended
469
- $default_sequence = sanitize_text_field( wp_unslash( $_GET['wcf-default'] ) );
470
- $default_ids = array_map( 'intval', explode( ',', $default_sequence ) );
471
- $verify_url_data = true;
472
- }
473
-
474
- if ( is_array( $products ) ) {
475
-
476
- foreach ( $products as $in => $data ) {
477
-
478
- if ( $verify_url_data ) {
479
-
480
- $default_add_to_cart = false;
481
- $sequence = $in + 1;
482
-
483
- if ( in_array( $sequence, $default_ids, true ) ) {
484
- $default_add_to_cart = true;
485
- }
486
- }
487
-
488
- $default_data = array(
489
- 'quantity' => 1,
490
- 'discount_type' => '',
491
- 'discount_value' => '',
492
- 'unique_id' => $this->get_unique_id(),
493
- 'add_to_cart' => $default_add_to_cart,
494
- );
495
-
496
- $products[ $in ] = wp_parse_args( $products[ $in ], $default_data );
497
- }
498
- }
499
-
500
- $this->checkout_products[ $checkout_id ] = $products;
501
- }
502
-
503
- return $this->checkout_products[ $checkout_id ];
504
- }
505
-
506
- /**
507
- * Get selected checkout products and data
508
- *
509
- * @param int $checkout_id Checkout id..
510
- * @param array $products_data Saved product.
511
- *
512
- * @return array
513
- */
514
- public function set_selcted_checkout_products( $checkout_id = '', $products_data = array() ) {
515
-
516
- if ( empty( $checkout_id ) ) {
517
-
518
- global $post;
519
-
520
- $checkout_id = $post->ID;
521
- }
522
-
523
- if ( isset( $this->checkout_products[ $checkout_id ] ) ) {
524
-
525
- $products = $this->checkout_products[ $checkout_id ];
526
- } else {
527
- $products = $this->get_selected_checkout_products( $checkout_id );
528
- }
529
-
530
- if ( is_array( $products ) && ! empty( $products_data ) ) {
531
-
532
- foreach ( $products as $in => $data ) {
533
-
534
- if ( isset( $products_data[ $in ] ) ) {
535
- $products[ $in ] = wp_parse_args( $products_data[ $in ], $products[ $in ] );
536
- }
537
- }
538
- }
539
-
540
- $this->checkout_products[ $checkout_id ] = $products;
541
-
542
- return $this->checkout_products[ $checkout_id ];
543
- }
544
-
545
- /**
546
- * Clear Installed Page Builder Cache
547
- */
548
- public function clear_cache() {
549
-
550
- // Clear 'Elementor' file cache.
551
- if ( class_exists( '\Elementor\Plugin' ) ) {
552
- Elementor\Plugin::$instance->files_manager->clear_cache();
553
- }
554
- }
555
- }
556
-
557
- /**
558
- * Get a specific property of an array without needing to check if that property exists.
559
- *
560
- * Provide a default value if you want to return a specific value if the property is not set.
561
- *
562
- * @param array $array Array from which the property's value should be retrieved.
563
- * @param string $prop Name of the property to be retrieved.
564
- * @param string $default Optional. Value that should be returned if the property is not set or empty. Defaults to null.
565
- *
566
- * @return null|string|mixed The value
567
- */
568
- function wcf_get_prop( $array, $prop, $default = null ) {
569
-
570
- if ( ! is_array( $array ) && ! ( is_object( $array ) && $array instanceof ArrayAccess ) ) {
571
- return $default;
572
- }
573
-
574
- if ( isset( $array[ $prop ] ) ) {
575
- $value = $array[ $prop ];
576
- } else {
577
- $value = '';
578
- }
579
-
580
- return empty( $value ) && null !== $default ? $default : $value;
581
- }
1
+ <?php
2
+ /**
3
+ * Utils.
4
+ *
5
+ * @package CARTFLOWS
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+
12
+ /**
13
+ * Class Cartflows_Utils.
14
+ */
15
+ class Cartflows_Utils {
16
+
17
+ /**
18
+ * Member Variable
19
+ *
20
+ * @var instance
21
+ */
22
+ private static $instance;
23
+
24
+ /**
25
+ * Member Variable
26
+ *
27
+ * @var checkout_products
28
+ */
29
+ public $checkout_products = array();
30
+
31
+
32
+ /**
33
+ * Initiator
34
+ */
35
+ public static function get_instance() {
36
+ if ( ! isset( self::$instance ) ) {
37
+ self::$instance = new self();
38
+ }
39
+ return self::$instance;
40
+ }
41
+
42
+ /**
43
+ * Constructor
44
+ */
45
+ public function __construct() {
46
+ }
47
+
48
+ /**
49
+ * Get current post type
50
+ *
51
+ * @param string $post_type post type.
52
+ * @return string
53
+ */
54
+ public function current_post_type( $post_type = '' ) {
55
+
56
+ if ( '' === $post_type ) {
57
+ $post_type = get_post_type();
58
+ }
59
+
60
+ return $post_type;
61
+ }
62
+
63
+ /**
64
+ * Check if post type is of step.
65
+ *
66
+ * @param string $post_type post type.
67
+ * @return bool
68
+ */
69
+ public function is_step_post_type( $post_type = '' ) {
70
+
71
+ if ( $this->get_step_post_type() === $this->current_post_type( $post_type ) ) {
72
+
73
+ return true;
74
+ }
75
+
76
+ return false;
77
+ }
78
+
79
+ /**
80
+ * Check if post type is of flow.
81
+ *
82
+ * @param string $post_type post type.
83
+ * @return bool
84
+ */
85
+ public function is_flow_post_type( $post_type = '' ) {
86
+
87
+ if ( $this->get_flow_post_type() === $this->current_post_type( $post_type ) ) {
88
+
89
+ return true;
90
+ }
91
+
92
+ return false;
93
+ }
94
+
95
+ /**
96
+ * Get post type of step.
97
+ *
98
+ * @return string
99
+ */
100
+ public function get_step_post_type() {
101
+
102
+ return CARTFLOWS_STEP_POST_TYPE;
103
+ }
104
+
105
+ /**
106
+ * Get post type of flow.
107
+ *
108
+ * @return string
109
+ */
110
+ public function get_flow_post_type() {
111
+
112
+ return CARTFLOWS_FLOW_POST_TYPE;
113
+ }
114
+
115
+ /**
116
+ * Get flow id
117
+ *
118
+ * @return int
119
+ */
120
+ public function get_flow_id() {
121
+
122
+ global $post;
123
+
124
+ return get_post_meta( $post->ID, 'wcf-flow-id', true );
125
+ }
126
+
127
+ /**
128
+ * Get flow id by step
129
+ *
130
+ * @param int $step_id step ID.
131
+ * @return int
132
+ */
133
+ public function get_flow_id_from_step_id( $step_id ) {
134
+
135
+ return get_post_meta( $step_id, 'wcf-flow-id', true );
136
+ }
137
+
138
+ /**
139
+ * Get flow steps by id
140
+ *
141
+ * @param int $flow_id flow ID.
142
+ * @return int
143
+ */
144
+ public function get_flow_steps( $flow_id ) {
145
+
146
+ $steps = get_post_meta( $flow_id, 'wcf-steps', true );
147
+
148
+ if ( is_array( $steps ) && ! empty( $steps ) ) {
149
+ return $steps;
150
+ }
151
+
152
+ return false;
153
+ }
154
+
155
+ /**
156
+ * Get template type of step
157
+ *
158
+ * @param int $step_id step ID.
159
+ * @return int
160
+ */
161
+ public function get_step_type( $step_id ) {
162
+
163
+ return get_post_meta( $step_id, 'wcf-step-type', true );
164
+ }
165
+
166
+ /**
167
+ * Get next id for step
168
+ *
169
+ * @param int $flow_id flow ID.
170
+ * @param int $step_id step ID.
171
+ * @return bool
172
+ */
173
+ public function get_next_step_id( $flow_id, $step_id ) {
174
+
175
+ $wcf_step_obj = wcf_get_step( $step_id );
176
+ $next_step_id = $wcf_step_obj->get_direct_next_step_id();
177
+
178
+ return $next_step_id;
179
+ }
180
+
181
+ /**
182
+ * Get next id for step
183
+ *
184
+ * @param int $order_id order ID.
185
+ * @return int
186
+ */
187
+ public function get_flow_id_from_order( $order_id ) {
188
+
189
+ $flow_id = get_post_meta( $order_id, '_wcf_flow_id', true );
190
+
191
+ return intval( $flow_id );
192
+ }
193
+
194
+ /**
195
+ * Get checkout id for order
196
+ *
197
+ * @param int $order_id order ID.
198
+ * @return int
199
+ */
200
+ public function get_checkout_id_from_order( $order_id ) {
201
+
202
+ $checkout_id = get_post_meta( $order_id, '_wcf_checkout_id', true );
203
+
204
+ return intval( $checkout_id );
205
+ }
206
+
207
+ /**
208
+ * We are using this function mostly in ajax on checkout page
209
+ *
210
+ * @return bool
211
+ */
212
+ public function get_checkout_id_from_post_data() {
213
+
214
+ if ( isset( $_POST['_wcf_checkout_id'] ) ) { //phpcs:ignore
215
+
216
+ $checkout_id = filter_var( wp_unslash( $_POST['_wcf_checkout_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
217
+
218
+ return intval( $checkout_id );
219
+ }
220
+
221
+ return false;
222
+ }
223
+
224
+ /**
225
+ * We are using this function mostly in ajax on checkout page
226
+ *
227
+ * @return bool
228
+ */
229
+ public function get_flow_id_from_post_data() {
230
+
231
+ if ( isset( $_POST['_wcf_flow_id'] ) ) { //phpcs:ignore
232
+
233
+ $flow_id = filter_var( wp_unslash( $_POST['_wcf_flow_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
234
+
235
+ return intval( $flow_id );
236
+ }
237
+
238
+ return false;
239
+ }
240
+
241
+ /**
242
+ * Get optin id for order
243
+ *
244
+ * @param int $order_id order ID.
245
+ * @return int
246
+ */
247
+ public function get_optin_id_from_order( $order_id ) {
248
+
249
+ $optin_id = get_post_meta( $order_id, '_wcf_optin_id', true );
250
+
251
+ return intval( $optin_id );
252
+ }
253
+
254
+ /**
255
+ * We are using this function mostly in ajax on checkout page
256
+ *
257
+ * @return bool
258
+ */
259
+ public function get_optin_id_from_post_data() {
260
+
261
+ if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
262
+
263
+ $optin_id = filter_var( wp_unslash( $_POST['_wcf_optin_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
264
+
265
+ return intval( $optin_id );
266
+ }
267
+
268
+ return false;
269
+ }
270
+
271
+ /**
272
+ * Check for thank you page
273
+ *
274
+ * @param int $step_id step ID.
275
+ * @return bool
276
+ */
277
+ public function check_is_thankyou_page( $step_id ) {
278
+
279
+ $step_type = $this->get_step_type( $step_id );
280
+
281
+ if ( 'thankyou' === $step_type ) {
282
+
283
+ return true;
284
+ }
285
+
286
+ return false;
287
+ }
288
+
289
+ /**
290
+ * Check for offer page
291
+ *
292
+ * @param int $step_id step ID.
293
+ * @return bool
294
+ */
295
+ public function check_is_offer_page( $step_id ) {
296
+
297
+ $step_type = $this->get_step_type( $step_id );
298
+
299
+ if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
300
+
301
+ return true;
302
+ }
303
+
304
+ return false;
305
+ }
306
+
307
+ /**
308
+ * Check if loaded page requires woo.
309
+ *
310
+ * @return bool
311
+ */
312
+ public function check_is_woo_required_page() {
313
+
314
+ global $post;
315
+ $step_id = $post->ID;
316
+ $woo_not_required_type = array( 'landing' );
317
+ $step_type = $this->get_step_type( $step_id );
318
+ return ( ! in_array( $step_type, $woo_not_required_type, true ) );
319
+ }
320
+
321
+ /**
322
+ * Define constant for cache
323
+ *
324
+ * @return void
325
+ */
326
+ public function do_not_cache() {
327
+
328
+ global $post;
329
+
330
+ if ( ! apply_filters( 'cartflows_do_not_cache_step', true, $post->ID ) ) {
331
+ return;
332
+ }
333
+
334
+ wcf_maybe_define_constant( 'DONOTCACHEPAGE', true );
335
+ wcf_maybe_define_constant( 'DONOTCACHEOBJECT', true );
336
+ wcf_maybe_define_constant( 'DONOTCACHEDB', true );
337
+
338
+ nocache_headers();
339
+ }
340
+
341
+ /**
342
+ * Get linking url
343
+ *
344
+ * @param array $args query args.
345
+ * @return string
346
+ */
347
+ public function get_linking_url( $args = array() ) {
348
+
349
+ $url = get_home_url();
350
+
351
+ $url = add_query_arg( $args, $url );
352
+
353
+ return $url;
354
+ }
355
+
356
+ /**
357
+ * Get assets urls
358
+ *
359
+ * @return array
360
+ * @since 1.1.6
361
+ */
362
+ public function get_assets_path() {
363
+
364
+ $rtl = '';
365
+
366
+ if ( is_rtl() ) {
367
+ $rtl = '-rtl';
368
+ }
369
+
370
+ $file_prefix = '';
371
+ $dir_name = '';
372
+
373
+ $is_min = apply_filters( 'cartflows_load_min_assets', false );
374
+
375
+ if ( $is_min ) {
376
+ $file_prefix = '.min';
377
+ $dir_name = 'min-';
378
+ }
379
+
380
+ $js_gen_path = CARTFLOWS_URL . 'assets/' . $dir_name . 'js/';
381
+ $css_gen_path = CARTFLOWS_URL . 'assets/' . $dir_name . 'css/';
382
+
383
+ return array(
384
+ 'css' => $css_gen_path,
385
+ 'js' => $js_gen_path,
386
+ 'file_prefix' => $file_prefix,
387
+ 'rtl' => $rtl,
388
+ );
389
+ }
390
+
391
+ /**
392
+ * Get assets css url
393
+ *
394
+ * @param string $file file name.
395
+ * @return string
396
+ * @since 1.1.6
397
+ */
398
+ public function get_css_url( $file ) {
399
+
400
+ $assets_vars = wcf()->assets_vars;
401
+
402
+ $url = $assets_vars['css'] . $file . $assets_vars['rtl'] . $assets_vars['file_prefix'] . '.css';
403
+
404
+ return $url;
405
+ }
406
+
407
+ /**
408
+ * Get assets js url
409
+ *
410
+ * @param string $file file name.
411
+ * @return string
412
+ * @since 1.1.6
413
+ */
414
+ public function get_js_url( $file ) {
415
+
416
+ $assets_vars = wcf()->assets_vars;
417
+
418
+ $url = $assets_vars['js'] . $file . $assets_vars['file_prefix'] . '.js';
419
+
420
+ return $url;
421
+ }
422
+
423
+ /**
424
+ * Get unique id.
425
+ *
426
+ * @param int $length Length.
427
+ *
428
+ * @return string
429
+ */
430
+ public function get_unique_id( $length = 8 ) {
431
+
432
+ return substr( md5( microtime() ), 0, $length );
433
+ }
434
+
435
+ /**
436
+ * Get selected checkout products and data
437
+ *
438
+ * @param int $checkout_id Checkout id..
439
+ * @param array $saved_products Saved product.
440
+ *
441
+ * @return array
442
+ */
443
+ public function get_selected_checkout_products( $checkout_id = '', $saved_products = array() ) {
444
+
445
+ if ( empty( $checkout_id ) ) {
446
+
447
+ global $post;
448
+
449
+ $checkout_id = $post->ID;
450
+ }
451
+
452
+ if ( ! isset( $this->checkout_products[ $checkout_id ] ) ) {
453
+
454
+ if ( ! empty( $saved_products ) ) {
455
+
456
+ $products = $saved_products;
457
+ } else {
458
+
459
+ $products = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-products' );
460
+ }
461
+
462
+ $verify_url_data = false;
463
+ $default_add_to_cart = false;
464
+ $default_ids = array();
465
+ $default_add_to_cart = true;
466
+
467
+ if ( isset( $_GET['wcf-default'] ) ) { //phpcs:ignore
468
+ //phpcs:ignore WordPress.Security.NonceVerification.Recommended
469
+ $default_sequence = sanitize_text_field( wp_unslash( $_GET['wcf-default'] ) );
470
+ $default_ids = array_map( 'intval', explode( ',', $default_sequence ) );
471
+ $verify_url_data = true;
472
+ }
473
+
474
+ if ( is_array( $products ) ) {
475
+
476
+ foreach ( $products as $in => $data ) {
477
+
478
+ if ( $verify_url_data ) {
479
+
480
+ $default_add_to_cart = false;
481
+ $sequence = $in + 1;
482
+
483
+ if ( in_array( $sequence, $default_ids, true ) ) {
484
+ $default_add_to_cart = true;
485
+ }
486
+ }
487
+
488
+ $default_data = array(
489
+ 'quantity' => 1,
490
+ 'discount_type' => '',
491
+ 'discount_value' => '',
492
+ 'unique_id' => $this->get_unique_id(),
493
+ 'add_to_cart' => $default_add_to_cart,
494
+ );
495
+
496
+ $products[ $in ] = wp_parse_args( $products[ $in ], $default_data );
497
+ }
498
+ }
499
+
500
+ $this->checkout_products[ $checkout_id ] = $products;
501
+ }
502
+
503
+ return $this->checkout_products[ $checkout_id ];
504
+ }
505
+
506
+ /**
507
+ * Get selected checkout products and data
508
+ *
509
+ * @param int $checkout_id Checkout id..
510
+ * @param array $products_data Saved product.
511
+ *
512
+ * @return array
513
+ */
514
+ public function set_selcted_checkout_products( $checkout_id = '', $products_data = array() ) {
515
+
516
+ if ( empty( $checkout_id ) ) {
517
+
518
+ global $post;
519
+
520
+ $checkout_id = $post->ID;
521
+ }
522
+
523
+ if ( isset( $this->checkout_products[ $checkout_id ] ) ) {
524
+
525
+ $products = $this->checkout_products[ $checkout_id ];
526
+ } else {
527
+ $products = $this->get_selected_checkout_products( $checkout_id );
528
+ }
529
+
530
+ if ( is_array( $products ) && ! empty( $products_data ) ) {
531
+
532
+ foreach ( $products as $in => $data ) {
533
+
534
+ if ( isset( $products_data[ $in ] ) ) {
535
+ $products[ $in ] = wp_parse_args( $products_data[ $in ], $products[ $in ] );
536
+ }
537
+ }
538
+ }
539
+
540
+ $this->checkout_products[ $checkout_id ] = $products;
541
+
542
+ return $this->checkout_products[ $checkout_id ];
543
+ }
544
+
545
+ /**
546
+ * Clear Installed Page Builder Cache
547
+ */
548
+ public function clear_cache() {
549
+
550
+ // Clear 'Elementor' file cache.
551
+ if ( class_exists( '\Elementor\Plugin' ) ) {
552
+ Elementor\Plugin::$instance->files_manager->clear_cache();
553
+ }
554
+ }
555
+ }
556
+
557
+ /**
558
+ * Get a specific property of an array without needing to check if that property exists.
559
+ *
560
+ * Provide a default value if you want to return a specific value if the property is not set.
561
+ *
562
+ * @param array $array Array from which the property's value should be retrieved.
563
+ * @param string $prop Name of the property to be retrieved.
564
+ * @param string $default Optional. Value that should be returned if the property is not set or empty. Defaults to null.
565
+ *
566
+ * @return null|string|mixed The value
567
+ */
568
+ function wcf_get_prop( $array, $prop, $default = null ) {
569
+
570
+ if ( ! is_array( $array ) && ! ( is_object( $array ) && $array instanceof ArrayAccess ) ) {
571
+ return $default;
572
+ }
573
+
574
+ if ( isset( $array[ $prop ] ) ) {
575
+ $value = $array[ $prop ];
576
+ } else {
577
+ $value = '';
578
+ }
579
+
580
+ return empty( $value ) && null !== $default ? $default : $value;
581
+ }
classes/class-cartflows-wizard.php CHANGED
@@ -1,751 +1,751 @@
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
-
31
- add_action( 'wp_ajax_usage_tracking_option', array( $this, 'save_usage_tracking_option' ) );
32
-
33
- add_action( 'admin_head', array( $this, 'add_mautic_form_script' ) );
34
- add_action( 'woocommerce_installed', array( $this, 'disable_woo_setup_redirect' ) );
35
-
36
- add_action( 'wp_ajax_wcf_activate_wc_plugins', array( $this, 'activate_wc_plugins' ) );
37
-
38
- add_action( 'admin_init', array( $this, 'hide_notices' ) );
39
-
40
- }
41
- }
42
-
43
-
44
- /**
45
- * Hide a notice if the GET variable is set.
46
- */
47
- public function hide_notices() {
48
-
49
- if ( ! isset( $_GET['wcf-hide-notice'] ) ) {
50
- return;
51
- }
52
-
53
- $wcf_hide_notice = filter_input( INPUT_GET, 'wcf-hide-notice', FILTER_SANITIZE_STRING );
54
- $_wcf_notice_nonce = filter_input( INPUT_GET, '_wcf_notice_nonce', FILTER_SANITIZE_STRING );
55
-
56
- if ( $wcf_hide_notice && $_wcf_notice_nonce && wp_verify_nonce( sanitize_text_field( wp_unslash( $_wcf_notice_nonce ) ), 'wcf_hide_notices_nonce' ) ) {
57
- update_option( 'wcf_setup_skipped', true );
58
- }
59
- }
60
-
61
- /**
62
- * Disable the woo redirect for new setup.
63
- */
64
- public function disable_woo_setup_redirect() {
65
-
66
- delete_transient( '_wc_activation_redirect' );
67
- }
68
-
69
- /**
70
- * Show action links on the plugin screen.
71
- *
72
- * @since 1.0.0
73
- * @return void
74
- */
75
- public function show_setup_wizard() {
76
-
77
- $screen = get_current_screen();
78
- $screen_id = $screen ? $screen->id : '';
79
- $allowed_screens = array(
80
- 'cartflows_page_cartflows_settings',
81
- 'edit-cartflows_flow',
82
- 'dashboard',
83
- 'plugins',
84
- );
85
-
86
- if ( ! in_array( $screen_id, $allowed_screens, true ) ) {
87
- return;
88
- }
89
-
90
- $status = get_option( 'wcf_setup_complete', false );
91
- $skip_setup = get_option( 'wcf_setup_skipped', false );
92
- if ( false === $status && ! $skip_setup ) { ?>
93
- <div class="notice notice-info wcf-notice">
94
- <p><b><?php esc_html_e( 'Thanks for installing and using CartFlows!', 'cartflows' ); ?></b></p>
95
- <p><?php esc_html_e( 'It is easy to use the CartFlows. Please use the setup wizard to quick start setup.', 'cartflows' ); ?></p>
96
- <p>
97
- <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>
98
- <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>
99
- </p>
100
- </div>
101
- <?php
102
- }
103
- }
104
-
105
- /**
106
- * Add admin menus/screens.
107
- */
108
- public function admin_menus() {
109
-
110
- if ( empty( $_GET['page'] ) || 'cartflow-setup' !== $_GET['page'] ) { //phpcs:ignore
111
- return;
112
- }
113
-
114
- add_dashboard_page( '', '', 'manage_options', 'cartflow-setup', '' );
115
- }
116
-
117
- /**
118
- * Show the setup wizard.
119
- */
120
- public function setup_wizard() {
121
-
122
- if ( empty( $_GET['page'] ) || 'cartflow-setup' !== $_GET['page'] ) { //phpcs:ignore
123
- return;
124
- }
125
-
126
- $this->steps = array(
127
- 'basic-config' => array(
128
- 'name' => __( 'Welcome', 'cartflows' ),
129
- 'view' => array( $this, 'welcome_step' ),
130
- 'handler' => array( $this, 'welcome_step_save' ),
131
- ),
132
- 'page-builder' => array(
133
- 'name' => __( 'Page Builder', 'cartflows' ),
134
- 'view' => array( $this, 'page_builder_step' ),
135
- ),
136
- 'checkout' => array(
137
- 'name' => __( 'Checkout', 'cartflows' ),
138
- 'view' => array( $this, 'checkout_step' ),
139
- ),
140
- 'training' => array(
141
- 'name' => __( 'Training', 'cartflows' ),
142
- 'view' => array( $this, 'training_step' ),
143
- ),
144
- 'setup-ready' => array(
145
- 'name' => __( 'Ready!', 'cartflows' ),
146
- 'view' => array( $this, 'ready_step' ),
147
- 'handler' => '',
148
- ),
149
- );
150
-
151
- $this->step = isset( $_GET['step'] ) ? sanitize_text_field( $_GET['step'] ) : current( array_keys( $this->steps ) ); //phpcs:ignore
152
-
153
- wp_enqueue_style( 'cartflows-setup', CARTFLOWS_URL . 'admin/assets/css/setup-wizard.css', array( 'dashicons' ), CARTFLOWS_VER );
154
- wp_style_add_data( 'cartflows-setup', 'rtl', 'replace' );
155
-
156
- wp_enqueue_script( 'cartflows-setup', CARTFLOWS_URL . 'admin/assets/js/setup-wizard.js', array( 'jquery', 'wp-util', 'updates' ), CARTFLOWS_VER, false );
157
-
158
- wp_localize_script( 'cartflows-setup', 'cartflows_setup_vars', self::localize_vars() );
159
-
160
- wp_enqueue_media();
161
-
162
- if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) { //phpcs:ignore
163
- call_user_func( $this->steps[ $this->step ]['handler'] );
164
- }
165
-
166
- ob_start();
167
- $this->setup_wizard_header();
168
- $this->setup_wizard_steps();
169
- $this->setup_wizard_content();
170
- $this->setup_wizard_footer();
171
- exit;
172
- }
173
-
174
- /**
175
- * Get current step slug
176
- */
177
- public function get_current_step_slug() {
178
- $keys = array_keys( $this->steps );
179
- return $keys[ array_search( $this->step, array_keys( $this->steps ), true ) ];
180
- }
181
-
182
- /**
183
- * Get previous step link
184
- */
185
- public function get_prev_step_link() {
186
- $keys = array_keys( $this->steps );
187
- return add_query_arg( 'step', $keys[ array_search( $this->step, array_keys( $this->steps ), true ) - 1 ] );
188
- }
189
-
190
- /**
191
- * Get next step link
192
- */
193
- public function get_next_step_link() {
194
- $keys = array_keys( $this->steps );
195
- return add_query_arg( 'step', $keys[ array_search( $this->step, array_keys( $this->steps ), true ) + 1 ] );
196
- }
197
-
198
- /**
199
- * Get next step link
200
- */
201
- public function get_next_step_plain_link() {
202
- $keys = array_keys( $this->steps );
203
- $step_index = array_search( $this->step, $keys, true );
204
- $step_index = ( count( $keys ) == $step_index + 1 ) ? $step_index : $step_index + 1;
205
- $step = $keys[ $step_index ];
206
- return admin_url( 'index.php?page=cartflow-setup&step=' . $step );
207
- }
208
-
209
- /**
210
- * Setup Wizard Header.
211
- */
212
- public function setup_wizard_header() {
213
- set_current_screen();
214
- ?>
215
- <html <?php language_attributes(); ?>>
216
- <html>
217
- <head>
218
- <meta name="viewport" content="width=device-width" />
219
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
220
- <title><?php esc_html_e( 'CartFlows Setup', 'cartflows' ); ?></title>
221
-
222
- <script type="text/javascript">
223
- 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();}}};
224
- var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>';
225
- var pagenow = '';
226
- </script>
227
- <?php wp_print_scripts( array( 'cartflows-setup' ) ); ?>
228
- <?php do_action( 'admin_print_styles' ); ?>
229
- <?php do_action( 'admin_head' ); ?>
230
- </head>
231
- <body class="cartflows-setup wp-core-ui cartflows-step-<?php echo esc_attr( $this->get_current_step_slug() ); ?>">
232
- <div id="cartflows-logo">
233
- <img height="40" class="wcf-logo" src="<?php echo CARTFLOWS_URL . 'assets/images/cartflows-logo.svg'; ?>" />
234
- </div>
235
- <?php
236
- }
237
-
238
- /**
239
- * Setup Wizard Footer.
240
- */
241
- public function setup_wizard_footer() {
242
-
243
- $admin_url = admin_url( 'admin.php?page=cartflows_settings' );
244
- ?>
245
- <div class="close-button-wrapper">
246
- <a href="<?php echo esc_url( $admin_url ); ?>" class="wizard-close-link" ><?php esc_html_e( 'Exit Setup Wizard', 'cartflows' ); ?></a>
247
- </div>
248
- </body>
249
- </html>
250
- <?php
251
- }
252
-
253
- /**
254
- * Output the steps.
255
- */
256
- public function setup_wizard_steps() {
257
-
258
- $ouput_steps = $this->steps;
259
- ?>
260
- <ol class="cartflows-setup-steps">
261
- <?php
262
- foreach ( $ouput_steps as $step_key => $step ) :
263
- $classes = '';
264
- $activated = false;
265
- if ( $step_key === $this->step ) {
266
- $classes = 'active';
267
- $activated = true;
268
- } elseif ( array_search( $this->step, array_keys( $this->steps ), true ) > array_search( $step_key, array_keys( $this->steps ), true ) ) {
269
- $classes = 'done';
270
- $activated = true;
271
- }
272
- ?>
273
- <li class="<?php echo esc_attr( $classes ); ?>">
274
- <span><?php echo esc_html( $step['name'] ); ?></span>
275
- </li>
276
- <?php endforeach; ?>
277
- </ol>
278
- <?php
279
- }
280
-
281
- /**
282
- * Output the content for the current step.
283
- */
284
- public function setup_wizard_content() {
285
- ?>
286
- <input type="hidden" class="wcf-redirect-link" data-redirect-link="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>" >
287
- <?php
288
-
289
- echo '<div class="cartflows-setup-content">';
290
- call_user_func( $this->steps[ $this->step ]['view'] );
291
- echo '</div>';
292
- }
293
-
294
- /**
295
- * Introduction step.
296
- */
297
- public function welcome_step() {
298
- ?>
299
- <h1><?php esc_html_e( 'Welcome to CartFlows!', 'cartflows' ); ?></h1>
300
- <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>
301
- <form method="post">
302
- <div class="cartflows-usage-tracking cartflows-setup-message">
303
- <div class="usage-tracking-wrap">
304
- <h4><?php esc_html_e( 'Let&#x27;s Build it better!', 'cartflows' ); ?> </h4>
305
- <p><?php esc_html_e( 'Get improved features and faster fixes by sharing non-sensitive data via usage tracking that shows us how CartFlows is used. No personal data is tracked or stored.', 'cartflows' ); ?>
306
- <a href="https://my.cartflows.com/usage-tracking/"> <?php esc_html_e( 'Learn More', 'cartflows' ); ?></a></p>
307
- <input type="hidden" name="cartflows-usage-tracking-option" value="no">
308
- <input type="checkbox" name="cartflows-usage-tracking-option" id="cartflows-usage-tracking-option" value="Yes" checked>
309
- <label><?php esc_html_e( 'Yes, I am in.', 'cartflows' ); ?></label>
310
- </div>
311
- </div>
312
- <div class="cartflows-setup-actions step">
313
- <div class="button-prev-wrap">
314
- </div>
315
- <div class="wcf-usage-tracking" >
316
- <input type="submit" class="uct-activate button-primary button button-large " value="<?php esc_html_e( 'Lets Go »', 'cartflows' ); ?>" name="save_step" />
317
- </div>
318
- <?php wp_nonce_field( 'cartflow-setup' ); ?>
319
- </div>
320
-
321
- </form>
322
- <?php
323
- }
324
-
325
- /**
326
- * Save Locale Settings.
327
- */
328
- public function welcome_step_save() {
329
- check_admin_referer( 'cartflow-setup' );
330
-
331
- // Update site title & tagline.
332
- $redirect_url = $this->get_next_step_link();
333
-
334
- wp_safe_redirect( esc_url_raw( $redirect_url ) );
335
- exit;
336
- }
337
-
338
- /**
339
- * Locale settings
340
- */
341
- public function page_builder_step() {
342
- ?>
343
-
344
- <h1><?php esc_html_e( 'Page Builder Setup', 'cartflows' ); ?></h1>
345
- <p class="description"><?php esc_html_e( 'Please select a page builder you would like to use with CartFlows.', 'cartflows' ); ?></p>
346
- <form method="post">
347
- <table class="cartflows-table widefat">
348
- <tr class="cartflows-row">
349
- <td class="cartflows-row-heading">
350
- <label><?php esc_html_e( 'Select Page Builder', 'cartflows' ); ?></label>
351
- </td>
352
- <td class="cartflows-row-content">
353
- <?php
354
- $installed_plugins = get_plugins();
355
- $plugins = array(
356
- array(
357
- 'title' => __( 'Elementor', 'cartflows' ),
358
- 'value' => 'elementor',
359
- 'data' => array(
360
- 'slug' => 'elementor',
361
- 'init' => 'elementor/elementor.php',
362
- 'active' => is_plugin_active( 'elementor/elementor.php' ) ? 'yes' : 'no',
363
- 'install' => isset( $installed_plugins['elementor/elementor.php'] ) ? 'yes' : 'no',
364
- ),
365
- ),
366
- array(
367
- 'title' => __( 'Beaver Builder Plugin (Lite Version)', 'cartflows' ),
368
- 'value' => 'beaver-builder',
369
- 'data' => array(
370
- 'slug' => 'beaver-builder-lite-version',
371
- 'init' => 'beaver-builder-lite-version/fl-builder.php',
372
- 'active' => is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) ? 'yes' : 'no',
373
- 'install' => isset( $installed_plugins['beaver-builder-lite-version/fl-builder.php'] ) ? 'yes' : 'no',
374
- ),
375
- ),
376
- array(
377
- 'title' => __( 'Divi', 'cartflows' ),
378
- 'value' => 'divi',
379
- 'data' => array(
380
- 'slug' => 'divi',
381
- 'init' => 'divi',
382
- 'active' => 'yes',
383
- 'install' => 'NA',
384
- ),
385
- ),
386
- array(
387
- 'title' => __( 'Gutenberg', 'cartflows' ),
388
- 'value' => 'gutenberg',
389
- 'data' => array(
390
- 'slug' => 'ultimate-addons-for-gutenberg',
391
- 'init' => 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php',
392
- 'active' => is_plugin_active( 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php' ) ? 'yes' : 'no',
393
- 'install' => isset( $installed_plugins['ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php'] ) ? 'yes' : 'no',
394
- ),
395
- ),
396
- array(
397
- 'title' => __( 'Other', 'cartflows' ),
398
- 'value' => 'other',
399
- 'data' => array(
400
- 'slug' => 'other',
401
- 'init' => false,
402
- 'active' => 'yes',
403
- 'install' => 'NA',
404
- ),
405
- ),
406
- );
407
- ?>
408
- <input type="hidden" name="save-pb-input" id="save-pb-option" value="1" />
409
- <select name="page-builder" class="page-builder-list" data-redirect-link="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>">
410
- <?php
411
- foreach ( $plugins as $key => $plugin ) {
412
- 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>';
413
- }
414
- ?>
415
- </select>
416
- </td>
417
- </tr>
418
- </table>
419
- <p><?php esc_html_e( 'While CartFlows Should work with most page builders, we offer templates for the above page builders.', 'cartflows' ); ?></p>
420
- <div class="cartflows-setup-extra-notice">
421
- <span>
422
- <?php esc_html_e( 'The following plugin will be installed and activated for you:', 'cartflows' ); ?>
423
- <a target="_blank" id="wcf-page-builder" href="https://wordpress.org/plugins/elementor/"> <?php esc_html_e( 'Elementor', 'cartflows' ); ?></a>
424
- </span>
425
-
426
- </div>
427
- <div class="cartflows-setup-actions step">
428
- <div class="button-prev-wrap">
429
- <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>
430
- </div>
431
- <div class="button-next-wrap">
432
- <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>
433
- <a href="#" class="button button-primary wcf-install-plugins"><?php esc_html_e( 'Next »', 'cartflows' ); ?></a>
434
- </div>
435
- <?php wp_nonce_field( 'cartflow-setup' ); ?>
436
- </div>
437
- </form>
438
- <?php
439
- }
440
-
441
- /**
442
- * Render checkout step.
443
- */
444
- public function checkout_step() {
445
-
446
- $installed_plugins = get_plugins();
447
- $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? 'yes' : 'no';
448
- $is_wcf_ca_installed = isset( $installed_plugins['woo-cart-abandonment-recovery/woo-cart-abandonment-recovery.php'] ) ? 'yes' : 'no';
449
- $is_active = class_exists( 'WooCommerce' ) ? 'yes' : 'no';
450
- $is_wcf_ca_active = class_exists( 'CARTFLOWS_CA_Loader' ) ? 'yes' : 'no';
451
- ?>
452
- <h1><?php esc_html_e( 'Choose a checkout', 'cartflows' ); ?></h1>
453
- <div class="cartflows-setup-message">
454
- <p>
455
- <?php esc_html_e( 'While CartFlows is designed to use WooCommerce sell digital and physical products, not all funnels need a checkout system.', 'cartflows' ); ?>
456
- </p>
457
- <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>
458
- <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>
459
- </div>
460
-
461
- <div class="cartflows-setup-extra-notice">
462
-
463
- <span>
464
- <?php esc_html_e( 'The following plugin will be installed and activated for you:', 'cartflows' ); ?>
465
- <a target="_blank" href="https://wordpress.org/plugins/woocommerce/"> <?php esc_html_e( 'WooCommerce', 'cartflows' ); ?></a>,
466
- <a target="_blank" href="https://wordpress.org/plugins/woo-cart-abandonment-recovery/"> <?php esc_html_e( 'WooCommerce Cart Abandonment Recovery', 'cartflows' ); ?></a>
467
-
468
- </span>
469
-
470
- </div>
471
-
472
- <div class="cartflows-setup-actions step">
473
- <div class="button-prev-wrap">
474
- <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>
475
- </div>
476
- <div class="button-next-wrap">
477
- <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>
478
- <a class="wcf-install-wc button-primary button button-large" name="save_step" > <?php esc_html_e( 'Yes', 'cartflows' ); ?> </a>
479
- </div>
480
- </div>
481
-
482
- <?php
483
- }
484
-
485
- /**
486
- * Save Locale Settings.
487
- */
488
- public function activate_wc_plugins() {
489
-
490
- check_ajax_referer( 'wcf-wc-plugins-activate', 'security' );
491
-
492
- $plugin_slug_arr = array(
493
- 'woocommerce/woocommerce.php' => true,
494
- 'woo-cart-abandonment-recovery/woo-cart-abandonment-recovery.php' => false,
495
- );
496
-
497
- $activate = array(
498
- 'woocommerce/woocommerce.php' => false,
499
- 'woo-cart-abandonment-recovery/woo-cart-abandonment-recovery.php' => false,
500
- );
501
-
502
- foreach ( $plugin_slug_arr as $slug => $do_silently ) {
503
-
504
- $activate[ $slug ] = activate_plugin( $slug, '', false, $do_silently );
505
- }
506
-
507
- foreach ( $activate as $slug => $data ) {
508
-
509
- if ( is_wp_error( $data ) ) {
510
- wp_send_json_error(
511
- array(
512
- 'success' => false,
513
- 'message' => $data->get_error_message(),
514
- )
515
- );
516
- }
517
- }
518
-
519
- wp_send_json_success();
520
- }
521
-
522
- /**
523
- * Save usage tracking Settings.
524
- */
525
- public function save_usage_tracking_option() {
526
-
527
- if ( ! current_user_can( 'manage_options' ) ) {
528
- return;
529
- }
530
-
531
- check_ajax_referer( 'wcf-usage-tracking-option', 'security' );
532
-
533
- $allow_usage_tracking = isset( $_POST['allow_usage_tracking'] ) && 'true' == $_POST['allow_usage_tracking'] ? 'yes' : 'no';
534
-
535
- $usage_tracking = get_site_option( 'cf_analytics_optin' );
536
-
537
- if ( ( false === $usage_tracking ) || $allow_usage_tracking !== $usage_tracking ) {
538
- update_site_option( 'cf_analytics_optin', $allow_usage_tracking );
539
- }
540
-
541
- wp_send_json_success( get_site_option( 'cf_analytics_optin' ) );
542
- }
543
-
544
-
545
- /**
546
- * Save Locale Settings.
547
- */
548
- public function page_builder_step_save() {
549
-
550
- if ( ! current_user_can( 'manage_options' ) ) {
551
- return;
552
- }
553
-
554
- check_ajax_referer( 'wcf-page-builder-step-save', 'security' );
555
-
556
- $plugin_init = isset( $_POST['plugin_init'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin_init'] ) ) : '';
557
- $save_option = ( isset( $_POST['save_builder_option'] ) && 'true' == $_POST['save_builder_option'] ) ? true : false;
558
- $plugin_slug = filter_input( INPUT_POST, 'page_builder', FILTER_SANITIZE_STRING );
559
-
560
- $do_sliently = true;
561
- if ( 'woo-cart-abandonment-recovery' === $plugin_slug ) {
562
- $do_sliently = false;
563
- }
564
-
565
- $activate = activate_plugin( $plugin_init, '', false, $do_sliently );
566
-
567
- if ( $save_option ) {
568
- $this->save_page_builder_option();
569
- }
570
-
571
- if ( is_wp_error( $activate ) ) {
572
- wp_send_json_error(
573
- array(
574
- 'success' => false,
575
- 'message' => $activate->get_error_message(),
576
- )
577
- );
578
- }
579
-
580
- wp_send_json_success(
581
- array( 'plugin' => $plugin_slug )
582
- );
583
- }
584
-
585
- /**
586
- * Save selected page builder in options database.
587
- */
588
- public function save_page_builder_option() {
589
-
590
- if ( ! current_user_can( 'manage_options' ) ) {
591
- return;
592
- }
593
-
594
- $page_builder = isset( $_POST['page_builder'] ) ? sanitize_text_field( wp_unslash( $_POST['page_builder'] ) ) : ''; //phpcs:ignore
595
-
596
- $wcf_settings = get_option( '_cartflows_common', array() );
597
-
598
- if ( false !== strpos( $page_builder, 'beaver-builder' ) ) {
599
- $page_builder = 'beaver-builder';
600
- }
601
-
602
- $wcf_settings['default_page_builder'] = $page_builder;
603
-
604
- update_option( '_cartflows_common', $wcf_settings );
605
-
606
- wp_send_json_success(
607
- array( 'plugin' => $page_builder )
608
- );
609
-
610
- }
611
-
612
- /**
613
- * Final step.
614
- */
615
- public function ready_step() {
616
-
617
- // Set setup wizard status to complete.
618
- update_option( 'wcf_setup_complete', true );
619
- ?>
620
- <h1><?php esc_html_e( 'Congratulations, You Did It!', 'cartflows' ); ?></h1>
621
-
622
- <div class="cartflows-setup-next-steps">
623
- <div class="cartflows-setup-next-steps-last">
624
-
625
- <p class="success">
626
- <?php
627
- 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' )
628
- ?>
629
- </p>
630
-
631
-
632
- <ul class="wcf-wizard-next-steps">
633
- <li class="wcf-wizard-next-step-item">
634
- <div class="wcf-wizard-next-step-description">
635
- <p class="next-step-heading">Next step</p>
636
- <h3 class="next-step-description">Create First Flow</h3>
637
- <p class="next-step-extra-info">You're ready to add flows to your website.</p>
638
- </div>
639
- <div class="wcf-wizard-next-step-action">
640
- <p class="wc-setup-actions step">
641
- <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>
642
- </p>
643
- </div>
644
- </li>
645
- </ul>
646
-
647
- </div>
648
- </div>
649
- <?php
650
- }
651
-
652
- /**
653
- * Training course step.
654
- */
655
- public function training_step() {
656
- $current_user = wp_get_current_user();
657
- ?>
658
- <h1><?php esc_html_e( 'Exclusive CartFlows Training Course Offer', 'cartflows' ); ?></h1>
659
-
660
- <div id="mauticform_wrapper_cartflowsonboarding" class="mauticform_wrapper">
661
- <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">
662
- <div class="mauticform-error" id="mauticform_cartflowsonboarding_error"></div>
663
- <div class="mauticform-message" id="mauticform_cartflowsonboarding_message"></div>
664
- <div class="mauticform-innerform">
665
- <div class="mauticform-page-wrapper mauticform-page-1" data-mautic-form-page="1">
666
- <div id="mauticform_cartflowsonboarding_enter_your_email" class="mauticform-row mauticform-email mauticform-field-1">
667
- <div class="cartflows-setup-message">
668
- <p>
669
- <?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' ); ?>
670
- <?php esc_html_e( 'Get access to this couse, for free, by entering your email below.', 'cartflows' ); ?>
671
- </p>
672
- <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">
673
- </div>
674
- <span class="mauticform-errormsg" style="display: none;"></span>
675
- </div>
676
- </div>
677
- </div>
678
-
679
- <input type="hidden" name="mauticform[formId]" id="mauticform_cartflowsonboarding_id" value="2">
680
- <input type="hidden" name="mauticform[return]" id="mauticform_cartflowsonboarding_return" value="">
681
- <input type="hidden" name="mauticform[formName]" id="mauticform_cartflowsonboarding_name" value="cartflowsonboarding">
682
- <div class="cartflows-setup-actions step">
683
- <div class="button-prev-wrap">
684
- <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>
685
- </div>
686
- <div class="button-next-wrap">
687
- <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>
688
- <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>
689
- </div>
690
- </div>
691
- </form>
692
- </div>
693
- <?php
694
- }
695
-
696
- /**
697
- * Localize variables in admin
698
- */
699
- public function localize_vars() {
700
-
701
- $vars = array();
702
-
703
- $ajax_actions = array(
704
- 'wcf_page_builder_step_save',
705
- 'wcf_wc_plugins_activate',
706
- 'wcf_usage_tracking_option',
707
- );
708
-
709
- foreach ( $ajax_actions as $action ) {
710
-
711
- $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
712
- }
713
-
714
- return $vars;
715
- }
716
-
717
- /**
718
- * Add JS script for mautic form
719
- */
720
- public function add_mautic_form_script() {
721
-
722
- if ( ! isset( $_REQUEST['page'] ) || ( isset( $_REQUEST['page'] ) && 'cartflow-setup' !== $_REQUEST['page'] ) ) { //phpcs:ignore
723
- return;
724
- }
725
- ?>
726
-
727
- <script type="text/javascript">
728
- /** This section is only needed once per page if manually copying **/
729
- if (typeof MauticSDKLoaded == 'undefined') {
730
- var MauticSDKLoaded = true;
731
- var head = document.getElementsByTagName('head')[0];
732
- var script = document.createElement('script');
733
- script.type = 'text/javascript';
734
- script.src = 'https://go.cartflows.com/media/js/mautic-form.js';
735
- script.onload = function() {
736
- MauticSDK.onLoad();
737
- };
738
- head.appendChild(script);
739
- var MauticDomain = 'https://go.cartflows.com';
740
- var MauticLang = {
741
- 'submittingMessage': "Please wait..."
742
- };
743
- }
744
- </script>
745
- <?php
746
- }
747
- }
748
-
749
- new CartFlows_Wizard();
750
-
751
- 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
+
31
+ add_action( 'wp_ajax_usage_tracking_option', array( $this, 'save_usage_tracking_option' ) );
32
+
33
+ add_action( 'admin_head', array( $this, 'add_mautic_form_script' ) );
34
+ add_action( 'woocommerce_installed', array( $this, 'disable_woo_setup_redirect' ) );
35
+
36
+ add_action( 'wp_ajax_wcf_activate_wc_plugins', array( $this, 'activate_wc_plugins' ) );
37
+
38
+ add_action( 'admin_init', array( $this, 'hide_notices' ) );
39
+
40
+ }
41
+ }
42
+
43
+
44
+ /**
45
+ * Hide a notice if the GET variable is set.
46
+ */
47
+ public function hide_notices() {
48
+
49
+ if ( ! isset( $_GET['wcf-hide-notice'] ) ) {
50
+ return;
51
+ }
52
+
53
+ $wcf_hide_notice = filter_input( INPUT_GET, 'wcf-hide-notice', FILTER_SANITIZE_STRING );
54
+ $_wcf_notice_nonce = filter_input( INPUT_GET, '_wcf_notice_nonce', FILTER_SANITIZE_STRING );
55
+
56
+ if ( $wcf_hide_notice && $_wcf_notice_nonce && wp_verify_nonce( sanitize_text_field( wp_unslash( $_wcf_notice_nonce ) ), 'wcf_hide_notices_nonce' ) ) {
57
+ update_option( 'wcf_setup_skipped', true );
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Disable the woo redirect for new setup.
63
+ */
64
+ public function disable_woo_setup_redirect() {
65
+
66
+ delete_transient( '_wc_activation_redirect' );
67
+ }
68
+
69
+ /**
70
+ * Show action links on the plugin screen.
71
+ *
72
+ * @since 1.0.0
73
+ * @return void
74
+ */
75
+ public function show_setup_wizard() {
76
+
77
+ $screen = get_current_screen();
78
+ $screen_id = $screen ? $screen->id : '';
79
+ $allowed_screens = array(
80
+ 'cartflows_page_cartflows_settings',
81
+ 'edit-cartflows_flow',
82
+ 'dashboard',
83
+ 'plugins',
84
+ );
85
+
86
+ if ( ! in_array( $screen_id, $allowed_screens, true ) ) {
87
+ return;
88
+ }
89
+
90
+ $status = get_option( 'wcf_setup_complete', false );
91
+ $skip_setup = get_option( 'wcf_setup_skipped', false );
92
+ if ( false === $status && ! $skip_setup ) { ?>
93
+ <div class="notice notice-info wcf-notice">
94
+ <p><b><?php esc_html_e( 'Thanks for installing and using CartFlows!', 'cartflows' ); ?></b></p>
95
+ <p><?php esc_html_e( 'It is easy to use the CartFlows. Please use the setup wizard to quick start setup.', 'cartflows' ); ?></p>
96
+ <p>
97
+ <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>
98
+ <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>
99
+ </p>
100
+ </div>
101
+ <?php
102
+ }
103
+ }
104
+
105
+ /**
106
+ * Add admin menus/screens.
107
+ */
108
+ public function admin_menus() {
109
+
110
+ if ( empty( $_GET['page'] ) || 'cartflow-setup' !== $_GET['page'] ) { //phpcs:ignore
111
+ return;
112
+ }
113
+
114
+ add_dashboard_page( '', '', 'manage_options', 'cartflow-setup', '' );
115
+ }
116
+
117
+ /**
118
+ * Show the setup wizard.
119
+ */
120
+ public function setup_wizard() {
121
+
122
+ if ( empty( $_GET['page'] ) || 'cartflow-setup' !== $_GET['page'] ) { //phpcs:ignore
123
+ return;
124
+ }
125
+
126
+ $this->steps = array(
127
+ 'basic-config' => array(
128
+ 'name' => __( 'Welcome', 'cartflows' ),
129
+ 'view' => array( $this, 'welcome_step' ),
130
+ 'handler' => array( $this, 'welcome_step_save' ),
131
+ ),
132
+ 'page-builder' => array(
133
+ 'name' => __( 'Page Builder', 'cartflows' ),
134
+ 'view' => array( $this, 'page_builder_step' ),
135
+ ),
136
+ 'checkout' => array(
137
+ 'name' => __( 'Checkout', 'cartflows' ),
138
+ 'view' => array( $this, 'checkout_step' ),
139
+ ),
140
+ 'training' => array(
141
+ 'name' => __( 'Training', 'cartflows' ),
142
+ 'view' => array( $this, 'training_step' ),
143
+ ),
144
+ 'setup-ready' => array(
145
+ 'name' => __( 'Ready!', 'cartflows' ),
146
+ 'view' => array( $this, 'ready_step' ),
147
+ 'handler' => '',
148
+ ),
149
+ );
150
+
151
+ $this->step = isset( $_GET['step'] ) ? sanitize_text_field( $_GET['step'] ) : current( array_keys( $this->steps ) ); //phpcs:ignore
152
+
153
+ wp_enqueue_style( 'cartflows-setup', CARTFLOWS_URL . 'admin/assets/css/setup-wizard.css', array( 'dashicons' ), CARTFLOWS_VER );
154
+ wp_style_add_data( 'cartflows-setup', 'rtl', 'replace' );
155
+
156
+ wp_enqueue_script( 'cartflows-setup', CARTFLOWS_URL . 'admin/assets/js/setup-wizard.js', array( 'jquery', 'wp-util', 'updates' ), CARTFLOWS_VER, false );
157
+
158
+ wp_localize_script( 'cartflows-setup', 'cartflows_setup_vars', self::localize_vars() );
159
+
160
+ wp_enqueue_media();
161
+
162
+ if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) { //phpcs:ignore
163
+ call_user_func( $this->steps[ $this->step ]['handler'] );
164
+ }
165
+
166
+ ob_start();
167
+ $this->setup_wizard_header();
168
+ $this->setup_wizard_steps();
169
+ $this->setup_wizard_content();
170
+ $this->setup_wizard_footer();
171
+ exit;
172
+ }
173
+
174
+ /**
175
+ * Get current step slug
176
+ */
177
+ public function get_current_step_slug() {
178
+ $keys = array_keys( $this->steps );
179
+ return $keys[ array_search( $this->step, array_keys( $this->steps ), true ) ];
180
+ }
181
+
182
+ /**
183
+ * Get previous step link
184
+ */
185
+ public function get_prev_step_link() {
186
+ $keys = array_keys( $this->steps );
187
+ return add_query_arg( 'step', $keys[ array_search( $this->step, array_keys( $this->steps ), true ) - 1 ] );
188
+ }
189
+
190
+ /**
191
+ * Get next step link
192
+ */
193
+ public function get_next_step_link() {
194
+ $keys = array_keys( $this->steps );
195
+ return add_query_arg( 'step', $keys[ array_search( $this->step, array_keys( $this->steps ), true ) + 1 ] );
196
+ }
197
+
198
+ /**
199
+ * Get next step link
200
+ */
201
+ public function get_next_step_plain_link() {
202
+ $keys = array_keys( $this->steps );
203
+ $step_index = array_search( $this->step, $keys, true );
204
+ $step_index = ( count( $keys ) == $step_index + 1 ) ? $step_index : $step_index + 1;
205
+ $step = $keys[ $step_index ];
206
+ return admin_url( 'index.php?page=cartflow-setup&step=' . $step );
207
+ }
208
+
209
+ /**
210
+ * Setup Wizard Header.
211
+ */
212
+ public function setup_wizard_header() {
213
+ set_current_screen();
214
+ ?>
215
+ <html <?php language_attributes(); ?>>
216
+ <html>
217
+ <head>
218
+ <meta name="viewport" content="width=device-width" />
219
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
220
+ <title><?php esc_html_e( 'CartFlows Setup', 'cartflows' ); ?></title>
221
+
222
+ <script type="text/javascript">
223
+ 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();}}};
224
+ var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>';
225
+ var pagenow = '';
226
+ </script>
227
+ <?php wp_print_scripts( array( 'cartflows-setup' ) ); ?>
228
+ <?php do_action( 'admin_print_styles' ); ?>
229
+ <?php do_action( 'admin_head' ); ?>
230
+ </head>
231
+ <body class="cartflows-setup wp-core-ui cartflows-step-<?php echo esc_attr( $this->get_current_step_slug() ); ?>">
232
+ <div id="cartflows-logo">
233
+ <img height="40" class="wcf-logo" src="<?php echo CARTFLOWS_URL . 'assets/images/cartflows-logo.svg'; ?>" />
234
+ </div>
235
+ <?php
236
+ }
237
+
238
+ /**
239
+ * Setup Wizard Footer.
240
+ */
241
+ public function setup_wizard_footer() {
242
+
243
+ $admin_url = admin_url( 'admin.php?page=cartflows_settings' );
244
+ ?>
245
+ <div class="close-button-wrapper">
246
+ <a href="<?php echo esc_url( $admin_url ); ?>" class="wizard-close-link" ><?php esc_html_e( 'Exit Setup Wizard', 'cartflows' ); ?></a>
247
+ </div>
248
+ </body>
249
+ </html>
250
+ <?php
251
+ }
252
+
253
+ /**
254
+ * Output the steps.
255
+ */
256
+ public function setup_wizard_steps() {
257
+
258
+ $ouput_steps = $this->steps;
259
+ ?>
260
+ <ol class="cartflows-setup-steps">
261
+ <?php
262
+ foreach ( $ouput_steps as $step_key => $step ) :
263
+ $classes = '';
264
+ $activated = false;
265
+ if ( $step_key === $this->step ) {
266
+ $classes = 'active';
267
+ $activated = true;
268
+ } elseif ( array_search( $this->step, array_keys( $this->steps ), true ) > array_search( $step_key, array_keys( $this->steps ), true ) ) {
269
+ $classes = 'done';
270
+ $activated = true;
271
+ }
272
+ ?>
273
+ <li class="<?php echo esc_attr( $classes ); ?>">
274
+ <span><?php echo esc_html( $step['name'] ); ?></span>
275
+ </li>
276
+ <?php endforeach; ?>
277
+ </ol>
278
+ <?php
279
+ }
280
+
281
+ /**
282
+ * Output the content for the current step.
283
+ */
284
+ public function setup_wizard_content() {
285
+ ?>
286
+ <input type="hidden" class="wcf-redirect-link" data-redirect-link="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>" >
287
+ <?php
288
+
289
+ echo '<div class="cartflows-setup-content">';
290
+ call_user_func( $this->steps[ $this->step ]['view'] );
291
+ echo '</div>';
292
+ }
293
+
294
+ /**
295
+ * Introduction step.
296
+ */
297
+ public function welcome_step() {
298
+ ?>
299
+ <h1><?php esc_html_e( 'Welcome to CartFlows!', 'cartflows' ); ?></h1>
300
+ <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>
301
+ <form method="post">
302
+ <div class="cartflows-usage-tracking cartflows-setup-message">
303
+ <div class="usage-tracking-wrap">
304
+ <h4><?php esc_html_e( 'Let&#x27;s Build it better!', 'cartflows' ); ?> </h4>
305
+ <p><?php esc_html_e( 'Get improved features and faster fixes by sharing non-sensitive data via usage tracking that shows us how CartFlows is used. No personal data is tracked or stored.', 'cartflows' ); ?>
306
+ <a href="https://my.cartflows.com/usage-tracking/"> <?php esc_html_e( 'Learn More', 'cartflows' ); ?></a></p>
307
+ <input type="hidden" name="cartflows-usage-tracking-option" value="no">
308
+ <input type="checkbox" name="cartflows-usage-tracking-option" id="cartflows-usage-tracking-option" value="Yes" checked>
309
+ <label><?php esc_html_e( 'Yes, I am in.', 'cartflows' ); ?></label>
310
+ </div>
311
+ </div>
312
+ <div class="cartflows-setup-actions step">
313
+ <div class="button-prev-wrap">
314
+ </div>
315
+ <div class="wcf-usage-tracking" >
316
+ <input type="submit" class="uct-activate button-primary button button-large " value="<?php esc_html_e( 'Lets Go »', 'cartflows' ); ?>" name="save_step" />
317
+ </div>
318
+ <?php wp_nonce_field( 'cartflow-setup' ); ?>
319
+ </div>
320
+
321
+ </form>
322
+ <?php
323
+ }
324
+
325
+ /**
326
+ * Save Locale Settings.
327
+ */
328
+ public function welcome_step_save() {
329
+ check_admin_referer( 'cartflow-setup' );
330
+
331
+ // Update site title & tagline.
332
+ $redirect_url = $this->get_next_step_link();
333
+
334
+ wp_safe_redirect( esc_url_raw( $redirect_url ) );
335
+ exit;
336
+ }
337
+
338
+ /**
339
+ * Locale settings
340
+ */
341
+ public function page_builder_step() {
342
+ ?>
343
+
344
+ <h1><?php esc_html_e( 'Page Builder Setup', 'cartflows' ); ?></h1>
345
+ <p class="description"><?php esc_html_e( 'Please select a page builder you would like to use with CartFlows.', 'cartflows' ); ?></p>
346
+ <form method="post">
347
+ <table class="cartflows-table widefat">
348
+ <tr class="cartflows-row">
349
+ <td class="cartflows-row-heading">
350
+ <label><?php esc_html_e( 'Select Page Builder', 'cartflows' ); ?></label>
351
+ </td>
352
+ <td class="cartflows-row-content">
353
+ <?php
354
+ $installed_plugins = get_plugins();
355
+ $plugins = array(
356
+ array(
357
+ 'title' => __( 'Elementor', 'cartflows' ),
358
+ 'value' => 'elementor',
359
+ 'data' => array(
360
+ 'slug' => 'elementor',
361
+ 'init' => 'elementor/elementor.php',
362
+ 'active' => is_plugin_active( 'elementor/elementor.php' ) ? 'yes' : 'no',
363
+ 'install' => isset( $installed_plugins['elementor/elementor.php'] ) ? 'yes' : 'no',
364
+ ),
365
+ ),
366
+ array(
367
+ 'title' => __( 'Beaver Builder Plugin (Lite Version)', 'cartflows' ),
368
+ 'value' => 'beaver-builder',
369
+ 'data' => array(
370
+ 'slug' => 'beaver-builder-lite-version',
371
+ 'init' => 'beaver-builder-lite-version/fl-builder.php',
372
+ 'active' => is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) ? 'yes' : 'no',
373
+ 'install' => isset( $installed_plugins['beaver-builder-lite-version/fl-builder.php'] ) ? 'yes' : 'no',
374
+ ),
375
+ ),
376
+ array(
377
+ 'title' => __( 'Divi', 'cartflows' ),
378
+ 'value' => 'divi',
379
+ 'data' => array(
380
+ 'slug' => 'divi',
381
+ 'init' => 'divi',
382
+ 'active' => 'yes',
383
+ 'install' => 'NA',
384
+ ),
385
+ ),
386
+ array(
387
+ 'title' => __( 'Gutenberg', 'cartflows' ),
388
+ 'value' => 'gutenberg',
389
+ 'data' => array(
390
+ 'slug' => 'ultimate-addons-for-gutenberg',
391
+ 'init' => 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php',
392
+ 'active' => is_plugin_active( 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php' ) ? 'yes' : 'no',
393
+ 'install' => isset( $installed_plugins['ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php'] ) ? 'yes' : 'no',
394
+ ),
395
+ ),
396
+ array(
397
+ 'title' => __( 'Other', 'cartflows' ),
398
+ 'value' => 'other',
399
+ 'data' => array(
400
+ 'slug' => 'other',
401
+ 'init' => false,
402
+ 'active' => 'yes',
403
+ 'install' => 'NA',
404
+ ),
405
+ ),
406
+ );
407
+ ?>
408
+ <input type="hidden" name="save-pb-input" id="save-pb-option" value="1" />
409
+ <select name="page-builder" class="page-builder-list" data-redirect-link="<?php echo esc_url_raw( $this->get_next_step_plain_link() ); ?>">
410
+ <?php
411
+ foreach ( $plugins as $key => $plugin ) {
412
+ 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>';
413
+ }
414
+ ?>
415
+ </select>
416
+ </td>
417
+ </tr>
418
+ </table>
419
+ <p><?php esc_html_e( 'While CartFlows Should work with most page builders, we offer templates for the above page builders.', 'cartflows' ); ?></p>
420
+ <div class="cartflows-setup-extra-notice">
421
+ <span>
422
+ <?php esc_html_e( 'The following plugin will be installed and activated for you:', 'cartflows' ); ?>
423
+ <a target="_blank" id="wcf-page-builder" href="https://wordpress.org/plugins/elementor/"> <?php esc_html_e( 'Elementor', 'cartflows' ); ?></a>
424
+ </span>
425
+
426
+ </div>
427
+ <div class="cartflows-setup-actions step">
428
+ <div class="button-prev-wrap">
429
+ <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>
430
+ </div>
431
+ <div class="button-next-wrap">
432
+ <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>
433
+ <a href="#" class="button button-primary wcf-install-plugins"><?php esc_html_e( 'Next »', 'cartflows' ); ?></a>
434
+ </div>
435
+ <?php wp_nonce_field( 'cartflow-setup' ); ?>
436
+ </div>
437
+ </form>
438
+ <?php
439
+ }
440
+
441
+ /**
442
+ * Render checkout step.
443
+ */
444
+ public function checkout_step() {
445
+
446
+ $installed_plugins = get_plugins();
447
+ $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? 'yes' : 'no';
448
+ $is_wcf_ca_installed = isset( $installed_plugins['woo-cart-abandonment-recovery/woo-cart-abandonment-recovery.php'] ) ? 'yes' : 'no';
449
+ $is_active = class_exists( 'WooCommerce' ) ? 'yes' : 'no';
450
+ $is_wcf_ca_active = class_exists( 'CARTFLOWS_CA_Loader' ) ? 'yes' : 'no';
451
+ ?>
452
+ <h1><?php esc_html_e( 'Choose a checkout', 'cartflows' ); ?></h1>
453
+ <div class="cartflows-setup-message">
454
+ <p>
455
+ <?php esc_html_e( 'While CartFlows is designed to use WooCommerce sell digital and physical products, not all funnels need a checkout system.', 'cartflows' ); ?>
456
+ </p>
457
+ <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>
458
+ <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>
459
+ </div>
460
+
461
+ <div class="cartflows-setup-extra-notice">
462
+
463
+ <span>
464
+ <?php esc_html_e( 'The following plugin will be installed and activated for you:', 'cartflows' ); ?>
465
+ <a target="_blank" href="https://wordpress.org/plugins/woocommerce/"> <?php esc_html_e( 'WooCommerce', 'cartflows' ); ?></a>,
466
+ <a target="_blank" href="https://wordpress.org/plugins/woo-cart-abandonment-recovery/"> <?php esc_html_e( 'WooCommerce Cart Abandonment Recovery', 'cartflows' ); ?></a>
467
+
468
+ </span>
469
+
470
+ </div>
471
+
472
+ <div class="cartflows-setup-actions step">
473
+ <div class="button-prev-wrap">
474
+ <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>
475
+ </div>
476
+ <div class="button-next-wrap">
477
+ <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>
478
+ <a class="wcf-install-wc button-primary button button-large" name="save_step" > <?php esc_html_e( 'Yes', 'cartflows' ); ?> </a>
479
+ </div>
480
+ </div>
481
+
482
+ <?php
483
+ }
484
+
485
+ /**
486
+ * Save Locale Settings.
487
+ */
488
+ public function activate_wc_plugins() {
489
+
490
+ check_ajax_referer( 'wcf-wc-plugins-activate', 'security' );
491
+
492
+ $plugin_slug_arr = array(
493
+ 'woocommerce/woocommerce.php' => true,
494
+ 'woo-cart-abandonment-recovery/woo-cart-abandonment-recovery.php' => false,
495
+ );
496
+
497
+ $activate = array(
498
+ 'woocommerce/woocommerce.php' => false,
499
+ 'woo-cart-abandonment-recovery/woo-cart-abandonment-recovery.php' => false,
500
+ );
501
+
502
+ foreach ( $plugin_slug_arr as $slug => $do_silently ) {
503
+
504
+ $activate[ $slug ] = activate_plugin( $slug, '', false, $do_silently );
505
+ }
506
+
507
+ foreach ( $activate as $slug => $data ) {
508
+
509
+ if ( is_wp_error( $data ) ) {
510
+ wp_send_json_error(
511
+ array(
512
+ 'success' => false,
513
+ 'message' => $data->get_error_message(),
514
+ )
515
+ );
516
+ }
517
+ }
518
+
519
+ wp_send_json_success();
520
+ }
521
+
522
+ /**
523
+ * Save usage tracking Settings.
524
+ */
525
+ public function save_usage_tracking_option() {
526
+
527
+ if ( ! current_user_can( 'manage_options' ) ) {
528
+ return;
529
+ }
530
+
531
+ check_ajax_referer( 'wcf-usage-tracking-option', 'security' );
532
+
533
+ $allow_usage_tracking = isset( $_POST['allow_usage_tracking'] ) && 'true' == $_POST['allow_usage_tracking'] ? 'yes' : 'no';
534
+
535
+ $usage_tracking = get_site_option( 'cf_analytics_optin' );
536
+
537
+ if ( ( false === $usage_tracking ) || $allow_usage_tracking !== $usage_tracking ) {
538
+ update_site_option( 'cf_analytics_optin', $allow_usage_tracking );
539
+ }
540
+
541
+ wp_send_json_success( get_site_option( 'cf_analytics_optin' ) );
542
+ }
543
+
544
+
545
+ /**
546
+ * Save Locale Settings.
547
+ */
548
+ public function page_builder_step_save() {
549
+
550
+ if ( ! current_user_can( 'manage_options' ) ) {
551
+ return;
552
+ }
553
+
554
+ check_ajax_referer( 'wcf-page-builder-step-save', 'security' );
555
+
556
+ $plugin_init = isset( $_POST['plugin_init'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin_init'] ) ) : '';
557
+ $save_option = ( isset( $_POST['save_builder_option'] ) && 'true' == $_POST['save_builder_option'] ) ? true : false;
558
+ $plugin_slug = filter_input( INPUT_POST, 'page_builder', FILTER_SANITIZE_STRING );
559
+
560
+ $do_sliently = true;
561
+ if ( 'woo-cart-abandonment-recovery' === $plugin_slug ) {
562
+ $do_sliently = false;
563
+ }
564
+
565
+ $activate = activate_plugin( $plugin_init, '', false, $do_sliently );
566
+
567
+ if ( $save_option ) {
568
+ $this->save_page_builder_option();
569
+ }
570
+
571
+ if ( is_wp_error( $activate ) ) {
572
+ wp_send_json_error(
573
+ array(
574
+ 'success' => false,
575
+ 'message' => $activate->get_error_message(),
576
+ )
577
+ );
578
+ }
579
+
580
+ wp_send_json_success(
581
+ array( 'plugin' => $plugin_slug )
582
+ );
583
+ }
584
+
585
+ /**
586
+ * Save selected page builder in options database.
587
+ */
588
+ public function save_page_builder_option() {
589
+
590
+ if ( ! current_user_can( 'manage_options' ) ) {
591
+ return;
592
+ }
593
+
594
+ $page_builder = isset( $_POST['page_builder'] ) ? sanitize_text_field( wp_unslash( $_POST['page_builder'] ) ) : ''; //phpcs:ignore
595
+
596
+ $wcf_settings = get_option( '_cartflows_common', array() );
597
+
598
+ if ( false !== strpos( $page_builder, 'beaver-builder' ) ) {
599
+ $page_builder = 'beaver-builder';
600
+ }
601
+
602
+ $wcf_settings['default_page_builder'] = $page_builder;
603
+
604
+ update_option( '_cartflows_common', $wcf_settings );
605
+
606
+ wp_send_json_success(
607
+ array( 'plugin' => $page_builder )
608
+ );
609
+
610
+ }
611
+
612
+ /**
613
+ * Final step.
614
+ */
615
+ public function ready_step() {
616
+
617
+ // Set setup wizard status to complete.
618
+ update_option( 'wcf_setup_complete', true );
619
+ ?>
620
+ <h1><?php esc_html_e( 'Congratulations, You Did It!', 'cartflows' ); ?></h1>
621
+
622
+ <div class="cartflows-setup-next-steps">
623
+ <div class="cartflows-setup-next-steps-last">
624
+
625
+ <p class="success">
626
+ <?php
627
+ 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' )
628
+ ?>
629
+ </p>
630
+
631
+
632
+ <ul class="wcf-wizard-next-steps">
633
+ <li class="wcf-wizard-next-step-item">
634
+ <div class="wcf-wizard-next-step-description">
635
+ <p class="next-step-heading">Next step</p>
636
+ <h3 class="next-step-description">Create First Flow</h3>
637
+ <p class="next-step-extra-info">You're ready to add flows to your website.</p>
638
+ </div>
639
+ <div class="wcf-wizard-next-step-action">
640
+ <p class="wc-setup-actions step">
641
+ <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>
642
+ </p>
643
+ </div>
644
+ </li>
645
+ </ul>
646
+
647
+ </div>
648
+ </div>
649
+ <?php
650
+ }
651
+
652
+ /**
653
+ * Training course step.
654
+ */
655
+ public function training_step() {
656
+ $current_user = wp_get_current_user();
657
+ ?>
658
+ <h1><?php esc_html_e( 'Exclusive CartFlows Training Course Offer', 'cartflows' ); ?></h1>
659
+
660
+ <div id="mauticform_wrapper_cartflowsonboarding" class="mauticform_wrapper">
661
+ <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">
662
+ <div class="mauticform-error" id="mauticform_cartflowsonboarding_error"></div>
663
+ <div class="mauticform-message" id="mauticform_cartflowsonboarding_message"></div>
664
+ <div class="mauticform-innerform">
665
+ <div class="mauticform-page-wrapper mauticform-page-1" data-mautic-form-page="1">
666
+ <div id="mauticform_cartflowsonboarding_enter_your_email" class="mauticform-row mauticform-email mauticform-field-1">
667
+ <div class="cartflows-setup-message">
668
+ <p>
669
+ <?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' ); ?>
670
+ <?php esc_html_e( 'Get access to this couse, for free, by entering your email below.', 'cartflows' ); ?>
671
+ </p>
672
+ <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">
673
+ </div>
674
+ <span class="mauticform-errormsg" style="display: none;"></span>
675
+ </div>
676
+ </div>
677
+ </div>
678
+
679
+ <input type="hidden" name="mauticform[formId]" id="mauticform_cartflowsonboarding_id" value="2">
680
+ <input type="hidden" name="mauticform[return]" id="mauticform_cartflowsonboarding_return" value="">
681
+ <input type="hidden" name="mauticform[formName]" id="mauticform_cartflowsonboarding_name" value="cartflowsonboarding">
682
+ <div class="cartflows-setup-actions step">
683
+ <div class="button-prev-wrap">
684
+ <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>
685
+ </div>
686
+ <div class="button-next-wrap">
687
+ <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>
688
+ <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>
689
+ </div>
690
+ </div>
691
+ </form>
692
+ </div>
693
+ <?php
694
+ }
695
+
696
+ /**
697
+ * Localize variables in admin
698
+ */
699
+ public function localize_vars() {
700
+
701
+ $vars = array();
702
+
703
+ $ajax_actions = array(
704
+ 'wcf_page_builder_step_save',
705
+ 'wcf_wc_plugins_activate',
706
+ 'wcf_usage_tracking_option',
707
+ );
708
+
709
+ foreach ( $ajax_actions as $action ) {
710
+
711
+ $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
712
+ }
713
+
714
+ return $vars;
715
+ }
716
+
717
+ /**
718
+ * Add JS script for mautic form
719
+ */
720
+ public function add_mautic_form_script() {
721
+
722
+ if ( ! isset( $_REQUEST['page'] ) || ( isset( $_REQUEST['page'] ) && 'cartflow-setup' !== $_REQUEST['page'] ) ) { //phpcs:ignore
723
+ return;
724
+ }
725
+ ?>
726
+
727
+ <script type="text/javascript">
728
+ /** This section is only needed once per page if manually copying **/
729
+ if (typeof MauticSDKLoaded == 'undefined') {
730
+ var MauticSDKLoaded = true;
731
+ var head = document.getElementsByTagName('head')[0];
732
+ var script = document.createElement('script');
733
+ script.type = 'text/javascript';
734
+ script.src = 'https://go.cartflows.com/media/js/mautic-form.js';
735
+ script.onload = function() {
736
+ MauticSDK.onLoad();
737
+ };
738
+ head.appendChild(script);
739
+ var MauticDomain = 'https://go.cartflows.com';
740
+ var MauticLang = {
741
+ 'submittingMessage': "Please wait..."
742
+ };
743
+ }
744
+ </script>
745
+ <?php
746
+ }
747
+ }
748
+
749
+ new CartFlows_Wizard();
750
+
751
+ endif;
includes/admin/cartflows-admin-header.php CHANGED
@@ -1,21 +1,21 @@
1
- <?php
2
- /**
3
- * CartFlows Admin Header.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- ?>
9
- <div class="wcf-menu-page-header">
10
- <div class="wcf-container wcf-flex">
11
- <div class="wcf-title">
12
- <span class="screen-reader-text"><?php echo esc_attr( CARTFLOWS_PLUGIN_NAME ); ?></span>
13
- <img class="wcf-logo" src="<?php echo esc_attr( CARTFLOWS_URL ) . 'assets/images/cartflows-logo.svg'; ?>" />
14
- </div>
15
- <div class="wcf-top-links">
16
- <?php
17
- esc_attr_e( 'Generate More Leads & More Sales', 'cartflows' );
18
- ?>
19
- </div>
20
- </div>
21
- </div>
1
+ <?php
2
+ /**
3
+ * CartFlows Admin Header.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ ?>
9
+ <div class="wcf-menu-page-header">
10
+ <div class="wcf-container wcf-flex">
11
+ <div class="wcf-title">
12
+ <span class="screen-reader-text"><?php echo esc_attr( CARTFLOWS_PLUGIN_NAME ); ?></span>
13
+ <img class="wcf-logo" src="<?php echo esc_attr( CARTFLOWS_URL ) . 'assets/images/cartflows-logo.svg'; ?>" />
14
+ </div>
15
+ <div class="wcf-top-links">
16
+ <?php
17
+ esc_attr_e( 'Generate More Leads & More Sales', 'cartflows' );
18
+ ?>
19
+ </div>
20
+ </div>
21
+ </div>
includes/admin/cartflows-admin.php CHANGED
@@ -1,35 +1,35 @@
1
- <?php
2
- /**
3
- * CARTFLOWS Admin HTML.
4
- *
5
- * @package CARTFLOWS
6
- */
7
-
8
- ?>
9
- <div class="wcf-menu-page-wrapper">
10
- <div id="wcf-menu-page">
11
- <div class="wcf-menu-page-header <?php echo esc_attr( implode( ' ', $header_wrapper_class ) ); ?>">
12
- <div class="wcf-container wcf-flex">
13
- <div class="wcf-title">
14
- <span class="screen-reader-text"><?php echo esc_attr( CARTFLOWS_PLUGIN_NAME ); ?></span>
15
- <img class="wcf-logo" src="<?php echo esc_attr( CARTFLOWS_URL ) . 'assets/images/cartflows-logo.svg'; ?>" />
16
- </div>
17
- <div class="wcf-top-links">
18
- <?php
19
- esc_attr_e( 'Generate More Leads & More Sales', 'cartflows' );
20
- ?>
21
- </div>
22
- </div>
23
- </div>
24
-
25
- <?php
26
- // Settings update message.
27
- if ( isset( $_REQUEST['message'] ) && ( 'saved' === $_REQUEST['message'] ) ) { //phpcs:ignore
28
- ?>
29
- <div id="message" class="notice notice-success is-dismissive wcf-notice"><p> <?php esc_html_e( 'Settings saved successfully.', 'cartflows' ); ?> </p></div>
30
- <?php
31
- }
32
- ?>
33
- <?php do_action( 'cartflows_render_admin_content', $menu_page_slug ); ?>
34
- </div>
35
- </div>
1
+ <?php
2
+ /**
3
+ * CARTFLOWS Admin HTML.
4
+ *
5
+ * @package CARTFLOWS
6
+ */
7
+
8
+ ?>
9
+ <div class="wcf-menu-page-wrapper">
10
+ <div id="wcf-menu-page">
11
+ <div class="wcf-menu-page-header <?php echo esc_attr( implode( ' ', $header_wrapper_class ) ); ?>">
12
+ <div class="wcf-container wcf-flex">
13
+ <div class="wcf-title">
14
+ <span class="screen-reader-text"><?php echo esc_attr( CARTFLOWS_PLUGIN_NAME ); ?></span>
15
+ <img class="wcf-logo" src="<?php echo esc_attr( CARTFLOWS_URL ) . 'assets/images/cartflows-logo.svg'; ?>" />
16
+ </div>
17
+ <div class="wcf-top-links">
18
+ <?php
19
+ esc_attr_e( 'Generate More Leads & More Sales', 'cartflows' );
20
+ ?>
21
+ </div>
22
+ </div>
23
+ </div>
24
+
25
+ <?php
26
+ // Settings update message.
27
+ if ( isset( $_REQUEST['message'] ) && ( 'saved' === $_REQUEST['message'] ) ) { //phpcs:ignore
28
+ ?>
29
+ <div id="message" class="notice notice-success is-dismissive wcf-notice"><p> <?php esc_html_e( 'Settings saved successfully.', 'cartflows' ); ?> </p></div>
30
+ <?php
31
+ }
32
+ ?>
33
+ <?php do_action( 'cartflows_render_admin_content', $menu_page_slug ); ?>
34
+ </div>
35
+ </div>
includes/admin/cartflows-general.php CHANGED
@@ -1,507 +1,507 @@
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
- $google_analytics_settings = Cartflows_Helper::get_google_analytics_settings();
15
-
16
- $facebook_settings = Cartflows_Helper::get_facebook_settings();
17
-
18
- $debug_on = ( isset( $_GET['debug'] ) ) ? sanitize_text_field( wp_unslash( $_GET['debug'] ) ) : 'false'; //phpcs:ignore
19
-
20
- $error_log = filter_input( INPUT_GET, 'cartflows-error-log', FILTER_VALIDATE_BOOLEAN );
21
- ?>
22
-
23
-
24
- <?php if ( $error_log ) : ?>
25
- <div class="wrap wcf-addon-wrap wcf-clear wcf-container">
26
- <?php Cartflows_Logger::status_logs_file(); ?>
27
- </div>
28
- <?php else : ?>
29
- <div class="wrap wcf-addon-wrap wcf-clear wcf-container">
30
- <input type="hidden" name="action" value="wcf_save_common_settings">
31
- <h1 class="screen-reader-text"><?php esc_html_e( 'General Settings', 'cartflows' ); ?></h1>
32
-
33
- <div id="poststuff">
34
- <div id="post-body" class="columns-2">
35
- <div id="post-body-content">
36
-
37
- <!-- General Settings -->
38
- <div class="general-settings-form postbox">
39
- <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
40
- <span><?php esc_html_e( 'General Settings', 'cartflows' ); ?></span>
41
- </h2>
42
- <div class="inside">
43
- <form method="post" class="wrap wcf-clear" action="" >
44
- <div class="form-wrap">
45
- <?php
46
-
47
- do_action( 'cartflows_before_settings_fields', $settings );
48
-
49
- echo Cartflows_Admin_Fields::checkobox_field(
50
- array(
51
- 'id' => 'wcf_disallow_indexing',
52
- 'name' => '_cartflows_common[disallow_indexing]',
53
- 'title' => __( 'Disallow search engines from indexing flows', 'cartflows' ),
54
- 'value' => $settings['disallow_indexing'],
55
- )
56
- );
57
-
58
- if ( wcf()->is_woo_active ) {
59
- echo Cartflows_Admin_Fields::flow_checkout_selection_field(
60
- array(
61
- 'id' => 'wcf_global_checkout',
62
- 'name' => '_cartflows_common[global_checkout]',
63
- 'title' => __( 'Global Checkout', 'cartflows' ),
64
- 'value' => $settings['global_checkout'],
65
- )
66
- );
67
- }
68
- echo Cartflows_Admin_Fields::select_field(
69
- array(
70
- 'id' => 'wcf_default_page_builder',
71
- 'name' => '_cartflows_common[default_page_builder]',
72
- 'title' => __( 'Show Templates designed with', 'cartflows' ),
73
- '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' ),
74
- 'value' => $settings['default_page_builder'],
75
- 'options' => array(
76
- 'elementor' => __( 'Elementor', 'cartflows' ),
77
- 'beaver-builder' => __( 'Beaver Builder', 'cartflows' ),
78
- 'divi' => __( 'Divi', 'cartflows' ),
79
- 'gutenberg' => __( 'Gutenberg', 'cartflows' ),
80
- 'other' => __( 'Other', 'cartflows' ),
81
- ),
82
- )
83
- );
84
-
85
- do_action( 'cartflows_after_settings_fields', $settings );
86
-
87
- ?>
88
- </div>
89
- <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
90
- <?php wp_nonce_field( 'cartflows-common-settings', 'cartflows-common-settings-nonce' ); ?>
91
- </form>
92
- </div>
93
- </div>
94
- <!-- General Settings -->
95
-
96
- <?php do_action( 'cartflows_after_general_settings' ); ?>
97
-
98
- <!-- Permalink Settings -->
99
- <div class="general-settingss-form postbox">
100
- <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
101
- <span><?php esc_html_e( 'Permalink Settings', 'cartflows' ); ?></span>
102
- </h2>
103
- <div class="inside">
104
- <form method="post" class="wrap wcf-clear" action="" >
105
- <div class="form-wrap wcf_permalink_settings">
106
- <?php
107
-
108
- echo Cartflows_Admin_Fields::radio_field(
109
- array(
110
- 'id' => 'permalink_structure',
111
- 'name' => '_cartflows_permalink[permalink_structure]',
112
- 'value' => $permalink_settings['permalink_structure'],
113
- 'options' => array(
114
- '' =>
115
- array(
116
- 'label' => __( 'Default', 'cartflows' ),
117
- 'description' => 'Default WordPress Permalink',
118
- ),
119
-
120
- '/' . CARTFLOWS_FLOW_POST_TYPE . '/%flowname%/' . CARTFLOWS_STEP_POST_TYPE =>
121
- array(
122
- 'label' => __( 'Flow and Step Slug', 'cartflows' ),
123
- 'description' => get_site_url() . '/<code>' . CARTFLOWS_FLOW_POST_TYPE . '</code>/%flowname%/<code>' . CARTFLOWS_STEP_POST_TYPE . '</code>/%stepname%/',
124
- ),
125
-
126
- '/' . CARTFLOWS_FLOW_POST_TYPE . '/%flowname%' =>
127
- array(
128
- 'label' => __( 'Flow Slug', 'cartflows' ),
129
- 'description' => get_site_url() . '/<code>' . CARTFLOWS_FLOW_POST_TYPE . '</code>/%flowname%/%stepname%/',
130
- ),
131
-
132
- '/%flowname%/' . CARTFLOWS_STEP_POST_TYPE =>
133
- array(
134
- 'label' => __( 'Step Slug', 'cartflows' ),
135
- 'description' => get_site_url() . '/%flowname%/<code>' . CARTFLOWS_STEP_POST_TYPE . '</code>/%stepname%/',
136
- ),
137
- ),
138
- )
139
- );
140
- ?>
141
- <hr/>
142
- <?php
143
-
144
- echo Cartflows_Admin_Fields::title_field(
145
- array(
146
- 'title' => __( 'Post Type Permalink Base', 'cartflows' ),
147
- )
148
- );
149
-
150
- echo Cartflows_Admin_Fields::text_field(
151
- array(
152
- 'id' => 'wcf_permalink_step_base',
153
- 'name' => '_cartflows_permalink[permalink]',
154
- 'title' => __( 'Step Base', 'cartflows' ),
155
- 'value' => $permalink_settings['permalink'],
156
- 'placeholder' => CARTFLOWS_STEP_POST_TYPE,
157
- )
158
- );
159
-
160
- echo Cartflows_Admin_Fields::text_field(
161
- array(
162
- 'id' => 'wcf_permalink_flow_base',
163
- 'name' => '_cartflows_permalink[permalink_flow_base]',
164
- 'title' => __( 'Flow Base', 'cartflows' ),
165
- 'value' => $permalink_settings['permalink_flow_base'],
166
- 'placeholder' => CARTFLOWS_FLOW_POST_TYPE,
167
- )
168
- );
169
-
170
- ?>
171
-
172
-
173
- </div>
174
- <p>
175
- <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
176
- <?php submit_button( __( 'Set Default', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'reset', false ); ?>
177
- <?php wp_nonce_field( 'cartflows-permalink-settings', 'cartflows-permalink-settings-nonce' ); ?>
178
- </p>
179
-
180
-
181
- </form>
182
- </div>
183
- </div>
184
- <!-- Permalink Settings -->
185
-
186
- <!-- Facebook Pixel Tracking -->
187
- <div class="general-settingss-form postbox">
188
- <h2 class="wcf-facebook-hndle wcf-normal-cusror ui-sortable-handle hndle">
189
-
190
- <span><?php esc_html_e( 'Facebook Pixel Settings', 'cartflows' ); ?></span>
191
- </h2>
192
-
193
- <form method="post" class="wrap wcf-clear" action="">
194
- <div class="form-wrap">
195
- <input type="hidden" name="action" value="wcf_save_facebook_pixel_settings">
196
- <div id="post-body">
197
-
198
- <div class="inside">
199
- <div class="form-wrap">
200
- <?php
201
- echo Cartflows_Admin_Fields::checkobox_field(
202
- array(
203
- 'id' => 'wcf_facebook_pixel_tracking',
204
- 'name' => '_cartflows_facebook[facebook_pixel_tracking]',
205
- 'title' => __( 'Enable Facebook Pixel Tracking', 'cartflows' ),
206
- 'value' => $facebook_settings['facebook_pixel_tracking'],
207
- )
208
- );
209
-
210
- echo "<div class='wcf-fb-pixel-wrapper'>";
211
- ?>
212
- <hr/>
213
- <?php
214
- echo Cartflows_Admin_Fields::checkobox_field(
215
- array(
216
- 'id' => 'wcf_facebook_pixel_tracking_for_site',
217
- 'name' => '_cartflows_facebook[facebook_pixel_tracking_for_site]',
218
- 'title' => __( 'Enable for the whole site', 'cartflows' ),
219
- 'value' => $facebook_settings['facebook_pixel_tracking_for_site'],
220
- )
221
- );
222
-
223
- echo Cartflows_Admin_Fields::title_field(
224
- array(
225
- 'title' => '',
226
- 'description' => __( 'If this option is unchecked, it will only apply to CartFlows steps.', 'cartflows' ),
227
- )
228
- );
229
- ?>
230
- <hr/>
231
- <?php
232
- echo Cartflows_Admin_Fields::text_field(
233
- array(
234
- 'id' => 'wcf_facebook_pixel_id',
235
- 'name' => '_cartflows_facebook[facebook_pixel_id]',
236
- 'title' => __( 'Enter Facebook pixel ID', 'cartflows' ),
237
- 'value' => $facebook_settings['facebook_pixel_id'],
238
- )
239
- );
240
-
241
-
242
- echo Cartflows_Admin_Fields::title_field(
243
- array(
244
- 'title' => __( 'Enable Events:', 'cartflows' ),
245
- )
246
- );
247
-
248
-
249
- echo Cartflows_Admin_Fields::checkobox_field(
250
- array(
251
- 'id' => 'wcf_facebook_pixel_initiate_checkout',
252
- 'name' => '_cartflows_facebook[facebook_pixel_initiate_checkout]',
253
- 'title' => __( 'Initiate Checkout', 'cartflows' ),
254
- 'value' => $facebook_settings['facebook_pixel_initiate_checkout'],
255
- )
256
- );
257
-
258
- echo Cartflows_Admin_Fields::checkobox_field(
259
- array(
260
- 'id' => 'wcf_facebook_pixel_add_payment_info',
261
- 'name' => '_cartflows_facebook[facebook_pixel_add_payment_info]',
262
- 'title' => __( 'Add Payment Info', 'cartflows' ),
263
- 'value' => $facebook_settings['facebook_pixel_add_payment_info'],
264
- )
265
- );
266
-
267
- echo Cartflows_Admin_Fields::checkobox_field(
268
- array(
269
- 'id' => 'wcf_facebook_pixel_purchase_complete',
270
- 'name' => '_cartflows_facebook[facebook_pixel_purchase_complete]',
271
- 'title' => __( 'Purchase Complete', 'cartflows' ),
272
- 'value' => $facebook_settings['facebook_pixel_purchase_complete'],
273
- )
274
- );
275
-
276
- echo '</div>';
277
-
278
- ?>
279
- </div>
280
-
281
- <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-facebook-setting-save-btn button-primary button', 'submit', false ); ?>
282
- <?php wp_nonce_field( 'cartflows-facebook-settings', 'cartflows-facebook-settings-nonce' ); ?>
283
- </div>
284
- </div>
285
- </div>
286
- </form>
287
- </div>
288
- <!-- Facebook Pixel Tracking -->
289
-
290
- <!-- Google Analytics Tracking -->
291
- <div class="general-settingss-form postbox">
292
- <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
293
- <span><?php esc_html_e( 'Google Analytics Settings', 'cartflows' ); ?></span>
294
- </h2>
295
- <div class="inside">
296
- <form method="post" class="wrap wcf-clear" action="" >
297
- <div class="form-wrap">
298
- <?php
299
-
300
- echo Cartflows_Admin_Fields::checkobox_field(
301
- array(
302
- 'id' => 'enable_google-analytics-id',
303
- 'name' => '_cartflows_google_analytics[enable_google_analytics]',
304
- 'title' => __( 'Enable Google Analytics Tracking', 'cartflows' ),
305
- 'value' => $google_analytics_settings['enable_google_analytics'],
306
- )
307
- );
308
-
309
- echo "<div class='wcf-google-analytics-wrapper'>";
310
- ?>
311
- <hr/>
312
- <?php
313
- echo Cartflows_Admin_Fields::checkobox_field(
314
- array(
315
- 'id' => 'enable_google_analytics_for_site',
316
- 'name' => '_cartflows_google_analytics[enable_google_analytics_for_site]',
317
- 'title' => __( 'Enable for the whole website', 'cartflows' ),
318
- 'value' => $google_analytics_settings['enable_google_analytics_for_site'],
319
- )
320
- );
321
-
322
- echo Cartflows_Admin_Fields::title_field(
323
- array(
324
- 'title' => '',
325
- 'description' => __( 'If this option is unchecked, it will only apply to CartFlows steps.', 'cartflows' ),
326
- )
327
- );
328
- ?>
329
- <hr/>
330
- <?php
331
- echo Cartflows_Admin_Fields::text_field(
332
- array(
333
- 'id' => 'google-analytics-id',
334
- 'name' => '_cartflows_google_analytics[google_analytics_id]',
335
- 'title' => __( 'Google Analytics ID', 'cartflows' ),
336
- 'value' => $google_analytics_settings['google_analytics_id'],
337
- 'description' => __( 'Log into your <a href="https://analytics.google.com/" target="_blank">google analytics account</a> to find your ID. eg: UA-XXXXXX-X&period;', 'cartflows' ),
338
- )
339
- );
340
-
341
- echo Cartflows_Admin_Fields::title_field(
342
- array(
343
- 'title' => __( 'Enable Events:', 'cartflows' ),
344
- )
345
- );
346
-
347
- echo Cartflows_Admin_Fields::checkobox_field(
348
- array(
349
- 'id' => 'enable_begin_checkout',
350
- 'name' => '_cartflows_google_analytics[enable_begin_checkout]',
351
- 'title' => __( 'Begin Checkout', 'cartflows' ),
352
- 'value' => $google_analytics_settings['enable_begin_checkout'],
353
- )
354
- );
355
-
356
- echo Cartflows_Admin_Fields::checkobox_field(
357
- array(
358
- 'id' => 'enable_add_to_cart',
359
- 'name' => '_cartflows_google_analytics[enable_add_to_cart]',
360
- 'title' => __( 'Add To Cart', 'cartflows' ),
361
- 'value' => $google_analytics_settings['enable_add_to_cart'],
362
- )
363
- );
364
-
365
- echo Cartflows_Admin_Fields::checkobox_field(
366
- array(
367
- 'id' => 'enable_add_payment_info',
368
- 'name' => '_cartflows_google_analytics[enable_add_payment_info]',
369
- 'title' => __( 'Add Payment Info', 'cartflows' ),
370
- 'value' => $google_analytics_settings['enable_add_payment_info'],
371
- )
372
- );
373
-
374
- echo Cartflows_Admin_Fields::checkobox_field(
375
- array(
376
- 'id' => 'enable_purchase_event',
377
- 'name' => '_cartflows_google_analytics[enable_purchase_event]',
378
- 'title' => __( 'Purchase', 'cartflows' ),
379
- 'value' => $google_analytics_settings['enable_purchase_event'],
380
- )
381
- );
382
-
383
- echo Cartflows_Admin_Fields::title_field(
384
- array(
385
- 'title' => '',
386
- 'description' => __( 'Google Analytics not working correctly? <a href="https://cartflows.com/docs/troubleshooting-google-analytics-tracking-issues/" > Click here </a> to know more. ', 'cartflows' ),
387
- )
388
- );
389
-
390
- do_action( 'cartflows_google_analytics_admin_fields', $google_analytics_settings );
391
-
392
- echo '</div>';
393
- ?>
394
-
395
-
396
- </div>
397
- <p>
398
- <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
399
- <?php wp_nonce_field( 'cartflows-google-analytics-settings', 'cartflows-google-analytics-settings-nonce' ); ?>
400
- </p>
401
-
402
-
403
- </form>
404
- </div>
405
- </div>
406
- <!-- Google Analytics Tracking -->
407
-
408
- <?php do_action( 'cartflows_register_general_settings' ); ?>
409
-
410
- </div>
411
-
412
- <!-- Right Sidebar -->
413
- <div class="postbox-container" id="postbox-container-1">
414
- <div id="side-sortables">
415
-
416
- <div class="postbox">
417
- <h2 class="hndle">
418
- <span class="dashicons dashicons-book"></span>
419
- <span><?php esc_html_e( 'Knowledge Base', 'cartflows' ); ?></span>
420
- </h2>
421
- <div class="inside">
422
- <p>
423
- <?php esc_html_e( 'Not sure how something works? Take a peek at the knowledge base and learn.', 'cartflows' ); ?>
424
- </p>
425
- <p>
426
- <a href="<?php echo esc_url( 'https://cartflows.com/docs' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Visit Knowledge Base »', 'cartflows' ); ?></a>
427
- </p>
428
- </div>
429
- </div>
430
-
431
- <div class="postbox">
432
- <h2 class="hndle">
433
- <span class="dashicons dashicons-groups"></span>
434
- <span><?php esc_html_e( 'Community', 'cartflows' ); ?></span>
435
- </h2>
436
- <div class="inside">
437
- <p>
438
- <?php esc_html_e( 'Join the community of super helpful CartFlows users. Say hello, ask questions, give feedback and help each other!', 'cartflows' ); ?>
439
- </p>
440
- <p>
441
- <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>
442
- </p>
443
- </div>
444
- </div>
445
-
446
- <div class="postbox">
447
- <h2 class="hndle">
448
- <span class="dashicons dashicons-sos"></span>
449
- <span><?php esc_html_e( 'Five Star Support', 'cartflows' ); ?></span>
450
- </h2>
451
- <div class="inside">
452
- <p>
453
- <?php esc_html_e( 'Got a question? Get in touch with CartFlows developers. We\'re happy to help!', 'cartflows' ); ?>
454
- </p>
455
- <p>
456
- <a href="<?php echo esc_url( 'https://cartflows.com/contact' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Submit a Ticket »', 'cartflows' ); ?></a>
457
- </p>
458
- </div>
459
- </div>
460
- <?php
461
- if ( 'true' == $debug_on ) {
462
- ?>
463
- <div class="postbox">
464
- <h2 class="hndle">
465
- <span class="dashicons dashicons-editor-code"></span>
466
- <span><?php esc_html_e( 'Load Minified CSS', 'cartflows' ); ?></span>
467
- </h2>
468
- <div class="inside">
469
- <form method="post" class="wrap wcf-clear" action="">
470
- <p>
471
- <?php esc_html_e( 'Load the Minified CSS from here. Just Enable it by checking the below given checkbox.', 'cartflows' ); ?>
472
- </p>
473
- <?php
474
- echo Cartflows_Admin_Fields::checkobox_field(
475
- array(
476
- 'id' => 'allow_minified_files',
477
- 'name' => '_cartflows_debug_data[allow_minified_files]',
478
- 'title' => __( 'Load minified CSS & JS Files', 'cartflows' ),
479
- 'value' => $debug_data['allow_minified_files'],
480
- )
481
- );
482
- ?>
483
- <?php submit_button( __( 'Save', 'cartflows' ), 'button-primary button', 'submit', false ); ?>
484
- <?php wp_nonce_field( 'cartflows-debug-settings', 'cartflows-debug-settings-nonce' ); ?>
485
- </form>
486
- </div>
487
- </div>
488
- <?php
489
- }
490
- ?>
491
- </div>
492
- </div>
493
- <!-- Right Sidebar -->
494
-
495
- </div>
496
- <!-- /post-body -->
497
- <br class="clear">
498
- </div>
499
- </div>
500
- <?php endif; ?>
501
-
502
- <?php
503
- /**
504
- * Loads Zapier settings admin view.
505
- */
506
- do_action( 'cartflows_after_settings' );
507
- ?>
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
+ $google_analytics_settings = Cartflows_Helper::get_google_analytics_settings();
15
+
16
+ $facebook_settings = Cartflows_Helper::get_facebook_settings();
17
+
18
+ $debug_on = ( isset( $_GET['debug'] ) ) ? sanitize_text_field( wp_unslash( $_GET['debug'] ) ) : 'false'; //phpcs:ignore
19
+
20
+ $error_log = filter_input( INPUT_GET, 'cartflows-error-log', FILTER_VALIDATE_BOOLEAN );
21
+ ?>
22
+
23
+
24
+ <?php if ( $error_log ) : ?>
25
+ <div class="wrap wcf-addon-wrap wcf-clear wcf-container">
26
+ <?php Cartflows_Logger::status_logs_file(); ?>
27
+ </div>
28
+ <?php else : ?>
29
+ <div class="wrap wcf-addon-wrap wcf-clear wcf-container">
30
+ <input type="hidden" name="action" value="wcf_save_common_settings">
31
+ <h1 class="screen-reader-text"><?php esc_html_e( 'General Settings', 'cartflows' ); ?></h1>
32
+
33
+ <div id="poststuff">
34
+ <div id="post-body" class="columns-2">
35
+ <div id="post-body-content">
36
+
37
+ <!-- General Settings -->
38
+ <div class="general-settings-form postbox">
39
+ <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
40
+ <span><?php esc_html_e( 'General Settings', 'cartflows' ); ?></span>
41
+ </h2>
42
+ <div class="inside">
43
+ <form method="post" class="wrap wcf-clear" action="" >
44
+ <div class="form-wrap">
45
+ <?php
46
+
47
+ do_action( 'cartflows_before_settings_fields', $settings );
48
+
49
+ echo Cartflows_Admin_Fields::checkobox_field(
50
+ array(
51
+ 'id' => 'wcf_disallow_indexing',
52
+ 'name' => '_cartflows_common[disallow_indexing]',
53
+ 'title' => __( 'Disallow search engines from indexing flows', 'cartflows' ),
54
+ 'value' => $settings['disallow_indexing'],
55
+ )
56
+ );
57
+
58
+ if ( wcf()->is_woo_active ) {
59
+ echo Cartflows_Admin_Fields::flow_checkout_selection_field(
60
+ array(
61
+ 'id' => 'wcf_global_checkout',
62
+ 'name' => '_cartflows_common[global_checkout]',
63
+ 'title' => __( 'Global Checkout', 'cartflows' ),
64
+ 'value' => $settings['global_checkout'],
65
+ )
66
+ );
67
+ }
68
+ echo Cartflows_Admin_Fields::select_field(
69
+ array(
70
+ 'id' => 'wcf_default_page_builder',
71
+ 'name' => '_cartflows_common[default_page_builder]',
72
+ 'title' => __( 'Show Templates designed with', 'cartflows' ),
73
+ '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' ),
74
+ 'value' => $settings['default_page_builder'],
75
+ 'options' => array(
76
+ 'elementor' => __( 'Elementor', 'cartflows' ),
77
+ 'beaver-builder' => __( 'Beaver Builder', 'cartflows' ),
78
+ 'divi' => __( 'Divi', 'cartflows' ),
79
+ 'gutenberg' => __( 'Gutenberg', 'cartflows' ),
80
+ 'other' => __( 'Other', 'cartflows' ),
81
+ ),
82
+ )
83
+ );
84
+
85
+ do_action( 'cartflows_after_settings_fields', $settings );
86
+
87
+ ?>
88
+ </div>
89
+ <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
90
+ <?php wp_nonce_field( 'cartflows-common-settings', 'cartflows-common-settings-nonce' ); ?>
91
+ </form>
92
+ </div>
93
+ </div>
94
+ <!-- General Settings -->
95
+
96
+ <?php do_action( 'cartflows_after_general_settings' ); ?>
97
+
98
+ <!-- Permalink Settings -->
99
+ <div class="general-settingss-form postbox">
100
+ <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
101
+ <span><?php esc_html_e( 'Permalink Settings', 'cartflows' ); ?></span>
102
+ </h2>
103
+ <div class="inside">
104
+ <form method="post" class="wrap wcf-clear" action="" >
105
+ <div class="form-wrap wcf_permalink_settings">
106
+ <?php
107
+
108
+ echo Cartflows_Admin_Fields::radio_field(
109
+ array(
110
+ 'id' => 'permalink_structure',
111
+ 'name' => '_cartflows_permalink[permalink_structure]',
112
+ 'value' => $permalink_settings['permalink_structure'],
113
+ 'options' => array(
114
+ '' =>
115
+ array(
116
+ 'label' => __( 'Default', 'cartflows' ),
117
+ 'description' => 'Default WordPress Permalink',
118
+ ),
119
+
120
+ '/' . CARTFLOWS_FLOW_POST_TYPE . '/%flowname%/' . CARTFLOWS_STEP_POST_TYPE =>
121
+ array(
122
+ 'label' => __( 'Flow and Step Slug', 'cartflows' ),
123
+ 'description' => get_site_url() . '/<code>' . CARTFLOWS_FLOW_POST_TYPE . '</code>/%flowname%/<code>' . CARTFLOWS_STEP_POST_TYPE . '</code>/%stepname%/',
124
+ ),
125
+
126
+ '/' . CARTFLOWS_FLOW_POST_TYPE . '/%flowname%' =>
127
+ array(
128
+ 'label' => __( 'Flow Slug', 'cartflows' ),
129
+ 'description' => get_site_url() . '/<code>' . CARTFLOWS_FLOW_POST_TYPE . '</code>/%flowname%/%stepname%/',
130
+ ),
131
+
132
+ '/%flowname%/' . CARTFLOWS_STEP_POST_TYPE =>
133
+ array(
134
+ 'label' => __( 'Step Slug', 'cartflows' ),
135
+ 'description' => get_site_url() . '/%flowname%/<code>' . CARTFLOWS_STEP_POST_TYPE . '</code>/%stepname%/',
136
+ ),
137
+ ),
138
+ )
139
+ );
140
+ ?>
141
+ <hr/>
142
+ <?php
143
+
144
+ echo Cartflows_Admin_Fields::title_field(
145
+ array(
146
+ 'title' => __( 'Post Type Permalink Base', 'cartflows' ),
147
+ )
148
+ );
149
+
150
+ echo Cartflows_Admin_Fields::text_field(
151
+ array(
152
+ 'id' => 'wcf_permalink_step_base',
153
+ 'name' => '_cartflows_permalink[permalink]',
154
+ 'title' => __( 'Step Base', 'cartflows' ),
155
+ 'value' => $permalink_settings['permalink'],
156
+ 'placeholder' => CARTFLOWS_STEP_POST_TYPE,
157
+ )
158
+ );
159
+
160
+ echo Cartflows_Admin_Fields::text_field(
161
+ array(
162
+ 'id' => 'wcf_permalink_flow_base',
163
+ 'name' => '_cartflows_permalink[permalink_flow_base]',
164
+ 'title' => __( 'Flow Base', 'cartflows' ),
165
+ 'value' => $permalink_settings['permalink_flow_base'],
166
+ 'placeholder' => CARTFLOWS_FLOW_POST_TYPE,
167
+ )
168
+ );
169
+
170
+ ?>
171
+
172
+
173
+ </div>
174
+ <p>
175
+ <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
176
+ <?php submit_button( __( 'Set Default', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'reset', false ); ?>
177
+ <?php wp_nonce_field( 'cartflows-permalink-settings', 'cartflows-permalink-settings-nonce' ); ?>
178
+ </p>
179
+
180
+
181
+ </form>
182
+ </div>
183
+ </div>
184
+ <!-- Permalink Settings -->
185
+
186
+ <!-- Facebook Pixel Tracking -->
187
+ <div class="general-settingss-form postbox">
188
+ <h2 class="wcf-facebook-hndle wcf-normal-cusror ui-sortable-handle hndle">
189
+
190
+ <span><?php esc_html_e( 'Facebook Pixel Settings', 'cartflows' ); ?></span>
191
+ </h2>
192
+
193
+ <form method="post" class="wrap wcf-clear" action="">
194
+ <div class="form-wrap">
195
+ <input type="hidden" name="action" value="wcf_save_facebook_pixel_settings">
196
+ <div id="post-body">
197
+
198
+ <div class="inside">
199
+ <div class="form-wrap">
200
+ <?php
201
+ echo Cartflows_Admin_Fields::checkobox_field(
202
+ array(
203
+ 'id' => 'wcf_facebook_pixel_tracking',
204
+ 'name' => '_cartflows_facebook[facebook_pixel_tracking]',
205
+ 'title' => __( 'Enable Facebook Pixel Tracking', 'cartflows' ),
206
+ 'value' => $facebook_settings['facebook_pixel_tracking'],
207
+ )
208
+ );
209
+
210
+ echo "<div class='wcf-fb-pixel-wrapper'>";
211
+ ?>
212
+ <hr/>
213
+ <?php
214
+ echo Cartflows_Admin_Fields::checkobox_field(
215
+ array(
216
+ 'id' => 'wcf_facebook_pixel_tracking_for_site',
217
+ 'name' => '_cartflows_facebook[facebook_pixel_tracking_for_site]',
218
+ 'title' => __( 'Enable for the whole site', 'cartflows' ),
219
+ 'value' => $facebook_settings['facebook_pixel_tracking_for_site'],
220
+ )
221
+ );
222
+
223
+ echo Cartflows_Admin_Fields::title_field(
224
+ array(
225
+ 'title' => '',
226
+ 'description' => __( 'If this option is unchecked, it will only apply to CartFlows steps.', 'cartflows' ),
227
+ )
228
+ );
229
+ ?>
230
+ <hr/>
231
+ <?php
232
+ echo Cartflows_Admin_Fields::text_field(
233
+ array(
234
+ 'id' => 'wcf_facebook_pixel_id',
235
+ 'name' => '_cartflows_facebook[facebook_pixel_id]',
236
+ 'title' => __( 'Enter Facebook pixel ID', 'cartflows' ),
237
+ 'value' => $facebook_settings['facebook_pixel_id'],
238
+ )
239
+ );
240
+
241
+
242
+ echo Cartflows_Admin_Fields::title_field(
243
+ array(
244
+ 'title' => __( 'Enable Events:', 'cartflows' ),
245
+ )
246
+ );
247
+
248
+
249
+ echo Cartflows_Admin_Fields::checkobox_field(
250
+ array(
251
+ 'id' => 'wcf_facebook_pixel_initiate_checkout',
252
+ 'name' => '_cartflows_facebook[facebook_pixel_initiate_checkout]',
253
+ 'title' => __( 'Initiate Checkout', 'cartflows' ),
254
+ 'value' => $facebook_settings['facebook_pixel_initiate_checkout'],
255
+ )
256
+ );
257
+
258
+ echo Cartflows_Admin_Fields::checkobox_field(
259
+ array(
260
+ 'id' => 'wcf_facebook_pixel_add_payment_info',
261
+ 'name' => '_cartflows_facebook[facebook_pixel_add_payment_info]',
262
+ 'title' => __( 'Add Payment Info', 'cartflows' ),
263
+ 'value' => $facebook_settings['facebook_pixel_add_payment_info'],
264
+ )
265
+ );
266
+
267
+ echo Cartflows_Admin_Fields::checkobox_field(
268
+ array(
269
+ 'id' => 'wcf_facebook_pixel_purchase_complete',
270
+ 'name' => '_cartflows_facebook[facebook_pixel_purchase_complete]',
271
+ 'title' => __( 'Purchase Complete', 'cartflows' ),
272
+ 'value' => $facebook_settings['facebook_pixel_purchase_complete'],
273
+ )
274
+ );
275
+
276
+ echo '</div>';
277
+
278
+ ?>
279
+ </div>
280
+
281
+ <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-facebook-setting-save-btn button-primary button', 'submit', false ); ?>
282
+ <?php wp_nonce_field( 'cartflows-facebook-settings', 'cartflows-facebook-settings-nonce' ); ?>
283
+ </div>
284
+ </div>
285
+ </div>
286
+ </form>
287
+ </div>
288
+ <!-- Facebook Pixel Tracking -->
289
+
290
+ <!-- Google Analytics Tracking -->
291
+ <div class="general-settingss-form postbox">
292
+ <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
293
+ <span><?php esc_html_e( 'Google Analytics Settings', 'cartflows' ); ?></span>
294
+ </h2>
295
+ <div class="inside">
296
+ <form method="post" class="wrap wcf-clear" action="" >
297
+ <div class="form-wrap">
298
+ <?php
299
+
300
+ echo Cartflows_Admin_Fields::checkobox_field(
301
+ array(
302
+ 'id' => 'enable_google-analytics-id',
303
+ 'name' => '_cartflows_google_analytics[enable_google_analytics]',
304
+ 'title' => __( 'Enable Google Analytics Tracking', 'cartflows' ),
305
+ 'value' => $google_analytics_settings['enable_google_analytics'],
306
+ )
307
+ );
308
+
309
+ echo "<div class='wcf-google-analytics-wrapper'>";
310
+ ?>
311
+ <hr/>
312
+ <?php
313
+ echo Cartflows_Admin_Fields::checkobox_field(
314
+ array(
315
+ 'id' => 'enable_google_analytics_for_site',
316
+ 'name' => '_cartflows_google_analytics[enable_google_analytics_for_site]',
317
+ 'title' => __( 'Enable for the whole website', 'cartflows' ),
318
+ 'value' => $google_analytics_settings['enable_google_analytics_for_site'],
319
+ )
320
+ );
321
+
322
+ echo Cartflows_Admin_Fields::title_field(
323
+ array(
324
+ 'title' => '',
325
+ 'description' => __( 'If this option is unchecked, it will only apply to CartFlows steps.', 'cartflows' ),
326
+ )
327
+ );
328
+ ?>
329
+ <hr/>
330
+ <?php
331
+ echo Cartflows_Admin_Fields::text_field(
332
+ array(
333
+ 'id' => 'google-analytics-id',
334
+ 'name' => '_cartflows_google_analytics[google_analytics_id]',
335
+ 'title' => __( 'Google Analytics ID', 'cartflows' ),
336
+ 'value' => $google_analytics_settings['google_analytics_id'],
337
+ 'description' => __( 'Log into your <a href="https://analytics.google.com/" target="_blank">google analytics account</a> to find your ID. eg: UA-XXXXXX-X&period;', 'cartflows' ),
338
+ )
339
+ );
340
+
341
+ echo Cartflows_Admin_Fields::title_field(
342
+ array(
343
+ 'title' => __( 'Enable Events:', 'cartflows' ),
344
+ )
345
+ );
346
+
347
+ echo Cartflows_Admin_Fields::checkobox_field(
348
+ array(
349
+ 'id' => 'enable_begin_checkout',
350
+ 'name' => '_cartflows_google_analytics[enable_begin_checkout]',
351
+ 'title' => __( 'Begin Checkout', 'cartflows' ),
352
+ 'value' => $google_analytics_settings['enable_begin_checkout'],
353
+ )
354
+ );
355
+
356
+ echo Cartflows_Admin_Fields::checkobox_field(
357
+ array(
358
+ 'id' => 'enable_add_to_cart',
359
+ 'name' => '_cartflows_google_analytics[enable_add_to_cart]',
360
+ 'title' => __( 'Add To Cart', 'cartflows' ),
361
+ 'value' => $google_analytics_settings['enable_add_to_cart'],
362
+ )
363
+ );
364
+
365
+ echo Cartflows_Admin_Fields::checkobox_field(
366
+ array(
367
+ 'id' => 'enable_add_payment_info',
368
+ 'name' => '_cartflows_google_analytics[enable_add_payment_info]',
369
+ 'title' => __( 'Add Payment Info', 'cartflows' ),
370
+ 'value' => $google_analytics_settings['enable_add_payment_info'],
371
+ )
372
+ );
373
+
374
+ echo Cartflows_Admin_Fields::checkobox_field(
375
+ array(
376
+ 'id' => 'enable_purchase_event',
377
+ 'name' => '_cartflows_google_analytics[enable_purchase_event]',
378
+ 'title' => __( 'Purchase', 'cartflows' ),
379
+ 'value' => $google_analytics_settings['enable_purchase_event'],
380
+ )
381
+ );
382
+
383
+ echo Cartflows_Admin_Fields::title_field(
384
+ array(
385
+ 'title' => '',
386
+ 'description' => __( 'Google Analytics not working correctly? <a href="https://cartflows.com/docs/troubleshooting-google-analytics-tracking-issues/" > Click here </a> to know more. ', 'cartflows' ),
387
+ )
388
+ );
389
+
390
+ do_action( 'cartflows_google_analytics_admin_fields', $google_analytics_settings );
391
+
392
+ echo '</div>';
393
+ ?>
394
+
395
+
396
+ </div>
397
+ <p>
398
+ <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
399
+ <?php wp_nonce_field( 'cartflows-google-analytics-settings', 'cartflows-google-analytics-settings-nonce' ); ?>
400
+ </p>
401
+
402
+
403
+ </form>
404
+ </div>
405
+ </div>
406
+ <!-- Google Analytics Tracking -->
407
+
408
+ <?php do_action( 'cartflows_register_general_settings' ); ?>
409
+
410
+ </div>
411
+
412
+ <!-- Right Sidebar -->
413
+ <div class="postbox-container" id="postbox-container-1">
414
+ <div id="side-sortables">
415
+
416
+ <div class="postbox">
417
+ <h2 class="hndle">
418
+ <span class="dashicons dashicons-book"></span>
419
+ <span><?php esc_html_e( 'Knowledge Base', 'cartflows' ); ?></span>
420
+ </h2>
421
+ <div class="inside">
422
+ <p>
423
+ <?php esc_html_e( 'Not sure how something works? Take a peek at the knowledge base and learn.', 'cartflows' ); ?>
424
+ </p>
425
+ <p>
426
+ <a href="<?php echo esc_url( 'https://cartflows.com/docs' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Visit Knowledge Base »', 'cartflows' ); ?></a>
427
+ </p>
428
+ </div>
429
+ </div>
430
+
431
+ <div class="postbox">
432
+ <h2 class="hndle">
433
+ <span class="dashicons dashicons-groups"></span>
434
+ <span><?php esc_html_e( 'Community', 'cartflows' ); ?></span>
435
+ </h2>
436
+ <div class="inside">
437
+ <p>
438
+ <?php esc_html_e( 'Join the community of super helpful CartFlows users. Say hello, ask questions, give feedback and help each other!', 'cartflows' ); ?>
439
+ </p>
440
+ <p>
441
+ <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>
442
+ </p>
443
+ </div>
444
+ </div>
445
+
446
+ <div class="postbox">
447
+ <h2 class="hndle">
448
+ <span class="dashicons dashicons-sos"></span>
449
+ <span><?php esc_html_e( 'Five Star Support', 'cartflows' ); ?></span>
450
+ </h2>
451
+ <div class="inside">
452
+ <p>
453
+ <?php esc_html_e( 'Got a question? Get in touch with CartFlows developers. We\'re happy to help!', 'cartflows' ); ?>
454
+ </p>
455
+ <p>
456
+ <a href="<?php echo esc_url( 'https://cartflows.com/contact' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Submit a Ticket »', 'cartflows' ); ?></a>
457
+ </p>
458
+ </div>
459
+ </div>
460
+ <?php
461
+ if ( 'true' == $debug_on ) {
462
+ ?>
463
+ <div class="postbox">
464
+ <h2 class="hndle">
465
+ <span class="dashicons dashicons-editor-code"></span>
466
+ <span><?php esc_html_e( 'Load Minified CSS', 'cartflows' ); ?></span>
467
+ </h2>
468
+ <div class="inside">
469
+ <form method="post" class="wrap wcf-clear" action="">
470
+ <p>
471
+ <?php esc_html_e( 'Load the Minified CSS from here. Just Enable it by checking the below given checkbox.', 'cartflows' ); ?>
472
+ </p>
473
+ <?php
474
+ echo Cartflows_Admin_Fields::checkobox_field(
475
+ array(
476
+ 'id' => 'allow_minified_files',
477
+ 'name' => '_cartflows_debug_data[allow_minified_files]',
478
+ 'title' => __( 'Load minified CSS & JS Files', 'cartflows' ),
479
+ 'value' => $debug_data['allow_minified_files'],
480
+ )
481
+ );
482
+ ?>
483
+ <?php submit_button( __( 'Save', 'cartflows' ), 'button-primary button', 'submit', false ); ?>
484
+ <?php wp_nonce_field( 'cartflows-debug-settings', 'cartflows-debug-settings-nonce' ); ?>
485
+ </form>
486
+ </div>
487
+ </div>
488
+ <?php
489
+ }
490
+ ?>
491
+ </div>
492
+ </div>
493
+ <!-- Right Sidebar -->
494
+
495
+ </div>
496
+ <!-- /post-body -->
497
+ <br class="clear">
498
+ </div>
499
+ </div>
500
+ <?php endif; ?>
501
+
502
+ <?php
503
+ /**
504
+ * Loads Zapier settings admin view.
505
+ */
506
+ do_action( 'cartflows_after_settings' );
507
+ ?>
includes/admin/cartflows-home.php CHANGED
@@ -1,92 +1,92 @@
1
- <?php
2
- /**
3
- * Home overview
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- ?>
9
-
10
- <div class="wrap wcf-clear wcf-container">
11
- <h1 class="screen-reader-text"><?php esc_html_e( 'Home', 'cartflows' ); ?></h1>
12
- <div id="poststuff">
13
-
14
- <div id="post-body" class="columns-2">
15
- <div id="post-body-content">
16
-
17
- <!-- Getting Started -->
18
- <div class="postbox introduction">
19
- <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
20
- <span><?php esc_html_e( 'Getting Started', 'cartflows' ); ?></span>
21
- </h2>
22
- <div class="inside">
23
- <div class="iframe-wrap">
24
- <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>
25
- </div>
26
- <p>
27
- <?php
28
- esc_attr_e( 'Modernizing WordPress eCommerce!', 'cartflows' );
29
- ?>
30
- </p>
31
- </div>
32
- </div>
33
- <!-- Getting Started -->
34
- </div>
35
-
36
- <!-- Right Sidebar -->
37
- <div class="postbox-container" id="postbox-container-1">
38
- <div id="side-sortables">
39
-
40
- <div class="postbox">
41
- <h2 class="hndle">
42
- <span class="dashicons dashicons-book"></span>
43
- <span><?php esc_html_e( 'Knowledge Base', 'cartflows' ); ?></span>
44
- </h2>
45
- <div class="inside">
46
- <p>
47
- <?php esc_html_e( 'Not sure how something works? Take a peek at the knowledge base and learn.', 'cartflows' ); ?>
48
- </p>
49
- <p>
50
- <a href="<?php echo esc_url( 'https://cartflows.com/docs' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Visit Knowledge Base »', 'cartflows' ); ?></a>
51
- </p>
52
- </div>
53
- </div>
54
-
55
- <div class="postbox">
56
- <h2 class="hndle">
57
- <span class="dashicons dashicons-groups"></span>
58
- <span><?php esc_html_e( 'Community', 'cartflows' ); ?></span>
59
- </h2>
60
- <div class="inside">
61
- <p>
62
- <?php esc_html_e( 'Join the community of super helpful CartFlows users. Say hello, ask questions, give feedback and help each other!', 'cartflows' ); ?>
63
- </p>
64
- <p>
65
- <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>
66
- </p>
67
- </div>
68
- </div>
69
-
70
- <div class="postbox">
71
- <h2 class="hndle">
72
- <span class="dashicons dashicons-sos"></span>
73
- <span><?php esc_html_e( 'Five Star Support', 'cartflows' ); ?></span>
74
- </h2>
75
- <div class="inside">
76
- <p>
77
- <?php esc_html_e( 'Got a question? Get in touch with CartFlows developers. We\'re happy to help!', 'cartflows' ); ?>
78
- </p>
79
- <p>
80
- <a href="<?php echo esc_url( 'https://cartflows.com/contact' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Submit a Ticket »', 'cartflows' ); ?></a>
81
- </p>
82
- </div>
83
- </div>
84
- </div>
85
- </div>
86
- <!-- Right Sidebar -->
87
-
88
- </div>
89
- <!-- /post-body -->
90
- <br class="clear">
91
- </div>
92
- </div>
1
+ <?php
2
+ /**
3
+ * Home overview
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ ?>
9
+
10
+ <div class="wrap wcf-clear wcf-container">
11
+ <h1 class="screen-reader-text"><?php esc_html_e( 'Home', 'cartflows' ); ?></h1>
12
+ <div id="poststuff">
13
+
14
+ <div id="post-body" class="columns-2">
15
+ <div id="post-body-content">
16
+
17
+ <!-- Getting Started -->
18
+ <div class="postbox introduction">
19
+ <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
20
+ <span><?php esc_html_e( 'Getting Started', 'cartflows' ); ?></span>
21
+ </h2>
22
+ <div class="inside">
23
+ <div class="iframe-wrap">
24
+ <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>
25
+ </div>
26
+ <p>
27
+ <?php
28
+ esc_attr_e( 'Modernizing WordPress eCommerce!', 'cartflows' );
29
+ ?>
30
+ </p>
31
+ </div>
32
+ </div>
33
+ <!-- Getting Started -->
34
+ </div>
35
+
36
+ <!-- Right Sidebar -->
37
+ <div class="postbox-container" id="postbox-container-1">
38
+ <div id="side-sortables">
39
+
40
+ <div class="postbox">
41
+ <h2 class="hndle">
42
+ <span class="dashicons dashicons-book"></span>
43
+ <span><?php esc_html_e( 'Knowledge Base', 'cartflows' ); ?></span>
44
+ </h2>
45
+ <div class="inside">
46
+ <p>
47
+ <?php esc_html_e( 'Not sure how something works? Take a peek at the knowledge base and learn.', 'cartflows' ); ?>
48
+ </p>
49
+ <p>
50
+ <a href="<?php echo esc_url( 'https://cartflows.com/docs' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Visit Knowledge Base »', 'cartflows' ); ?></a>
51
+ </p>
52
+ </div>
53
+ </div>
54
+
55
+ <div class="postbox">
56
+ <h2 class="hndle">
57
+ <span class="dashicons dashicons-groups"></span>
58
+ <span><?php esc_html_e( 'Community', 'cartflows' ); ?></span>
59
+ </h2>
60
+ <div class="inside">
61
+ <p>
62
+ <?php esc_html_e( 'Join the community of super helpful CartFlows users. Say hello, ask questions, give feedback and help each other!', 'cartflows' ); ?>
63
+ </p>
64
+ <p>
65
+ <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>
66
+ </p>
67
+ </div>
68
+ </div>
69
+
70
+ <div class="postbox">
71
+ <h2 class="hndle">
72
+ <span class="dashicons dashicons-sos"></span>
73
+ <span><?php esc_html_e( 'Five Star Support', 'cartflows' ); ?></span>
74
+ </h2>
75
+ <div class="inside">
76
+ <p>
77
+ <?php esc_html_e( 'Got a question? Get in touch with CartFlows developers. We\'re happy to help!', 'cartflows' ); ?>
78
+ </p>
79
+ <p>
80
+ <a href="<?php echo esc_url( 'https://cartflows.com/contact' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Submit a Ticket »', 'cartflows' ); ?></a>
81
+ </p>
82
+ </div>
83
+ </div>
84
+ </div>
85
+ </div>
86
+ <!-- Right Sidebar -->
87
+
88
+ </div>
89
+ <!-- /post-body -->
90
+ <br class="clear">
91
+ </div>
92
+ </div>
includes/meta-fields/generate-product-repeater.php CHANGED
@@ -1,99 +1,99 @@
1
- <?php
2
- /**
3
- * Generate product repeater.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- $hide_advance = 'wcf-hide-advance';
9
-
10
- if ( empty( $selected_data ) ) {
11
-
12
- $selected_data = array(
13
- 'quantity' => 1,
14
- 'discount_type' => '',
15
- 'discount_value' => '',
16
- 'unique_id' => '',
17
- );
18
- }
19
-
20
- ?>
21
-
22
- <div class="wcf-repeatable-row" data-key="<?php echo $id; ?>">
23
- <div class="wcf_display_advance_fields wcf-repeater-fields-head-wrap">
24
- <div class="wcf-repeatable-row-standard-fields">
25
- <div class="wcf-checkout-products-dashicon dashicons dashicons-menu"></div>
26
-
27
- <!-- Product Name -->
28
- <div class="wcf-repeatable-fields wcf-sel-product">
29
- <span class="wcf-repeatable-row-setting-field">
30
- <select name="wcf-checkout-products[<?php echo $id; ?>][product]" class="wcf-product-search" data-allow_clear="allow_clear" data-include_product_types= "braintree-subscription, braintree-variable-subscription" data-excluded_product_types = "grouped" data-placeholder="<?php echo __( 'Search for a product&hellip;', 'cartflows' ); ?>" data-action="wcf_json_search_products_and_variations"><?php echo $options; ?></select>
31
- </span>
32
-
33
- <span class="wcf-repeatable-row-actions">
34
- <a class="wcf-remove-row wcf-repeatable-remove button" data-type="product">
35
- <span class="dashicons dashicons-trash"></span>
36
- <span class="wcf-repeatable-remove-button"><?php echo __( 'Remove', 'cartflows' ); ?></span>
37
- </a>
38
- </span>
39
- </div>
40
-
41
- <div class="wcf_toggle_advance_fields"><i class="dashicons dashicons-arrow-down"></i></div>
42
- </div>
43
- </div>
44
-
45
- <div class="wcf-repeatable-row-advance-fields <?php echo $hide_advance; ?>">
46
-
47
- <!-- Qty field. -->
48
- <div class="wcf-repeatable-row-qty-field wcf-checkout-products-qty-<?php echo $id; ?>">
49
- <div class="wcf-field-row">
50
- <div class="wcf-field-row-heading">
51
- <label><?php echo __( 'Product Quantity', 'cartflows' ); ?></label>
52
- </div>
53
-
54
- <div class="wcf-field-row-content wcf-field-row-advance-content">
55
- <input type="number" class="input-text qty text" step="1" min="1" max="" name="wcf-checkout-products[<?php echo $id; ?>][quantity]" value="<?php echo $selected_data['quantity']; ?>" title="Qty" inputmode="numeric">
56
- </div>
57
- </div>
58
- </div>
59
- <!-- Qty field end -->
60
-
61
- <!-- Type field. -->
62
- <div class="wcf-repeatable-discount-type-field">
63
- <div class="wcf-field-row">
64
- <div class="wcf-field-row-heading">
65
- <label><?php echo __( 'Discount Type', 'cartflows' ); ?></label>
66
- </div>
67
-
68
- <div class="wcf-field-row-content wcf-field-row-advance-content">
69
- <select name="wcf-checkout-products[<?php echo $id; ?>][discount_type]" data-allow_clear="allow_clear" data-placeholder="<?php echo __( 'Select Discount Type', 'cartflows' ); ?>">
70
- <option value="" <?php selected( $selected_data['discount_type'], '', true ); ?>><?php echo __( 'Original', 'cartflows' ); ?></option>
71
- <option value="discount_percent" <?php selected( $selected_data['discount_type'], 'discount_percent', true ); ?>><?php echo __( 'Percentage', 'cartflows' ); ?></option>
72
- <option value="discount_price" <?php selected( $selected_data['discount_type'], 'discount_price', true ); ?>><?php echo __( 'Price', 'cartflows' ); ?></option>
73
- </select>
74
- </div>
75
- </div>
76
- </div>
77
- <!-- Type field end -->
78
-
79
- <!-- Discount field -->
80
- <div class="wcf-repeatable-row-discount-field <?php echo $hide_advance; ?> wcf-checkout-products-discount-<?php echo $id; ?>">
81
- <div class="wcf-field-row">
82
- <div class="wcf-field-row-heading">
83
- <label><?php echo __( 'Discount Value', 'cartflows' ); ?></label>
84
- <i class="wcf-field-heading-help dashicons dashicons-editor-help"></i>
85
- <span class="wcf-tooltip-text"><?php echo __( 'Discount value will apply for each quantity of product.', 'cartflows' ); ?></span>
86
- </div>
87
- <div class="wcf-field-row-content wcf-field-row-advance-content">
88
- <input type="text" class="input-text text" name="wcf-checkout-products[<?php echo $id; ?>][discount_value]" value="<?php echo $selected_data['discount_value']; ?>" title="" inputmode="numeric">
89
- </div>
90
- </div>
91
- </div>
92
-
93
- <div class="wcf-repeatable-row-unique-id-field">
94
- <input name="wcf-checkout-products[<?php echo $id; ?>][unique_id]" type="hidden" class="wcf-checkout-product-unique" value="<?php echo $selected_data['unique_id']; ?>">
95
- </div>
96
-
97
- <?php do_action( 'cartflows_repeatable_row_advance_fields', $id ); ?>
98
- </div>
99
- </div>
1
+ <?php
2
+ /**
3
+ * Generate product repeater.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ $hide_advance = 'wcf-hide-advance';
9
+
10
+ if ( empty( $selected_data ) ) {
11
+
12
+ $selected_data = array(
13
+ 'quantity' => 1,
14
+ 'discount_type' => '',
15
+ 'discount_value' => '',
16
+ 'unique_id' => '',
17
+ );
18
+ }
19
+
20
+ ?>
21
+
22
+ <div class="wcf-repeatable-row" data-key="<?php echo $id; ?>">
23
+ <div class="wcf_display_advance_fields wcf-repeater-fields-head-wrap">
24
+ <div class="wcf-repeatable-row-standard-fields">
25
+ <div class="wcf-checkout-products-dashicon dashicons dashicons-menu"></div>
26
+
27
+ <!-- Product Name -->
28
+ <div class="wcf-repeatable-fields wcf-sel-product">
29
+ <span class="wcf-repeatable-row-setting-field">
30
+ <select name="wcf-checkout-products[<?php echo $id; ?>][product]" class="wcf-product-search" data-allow_clear="allow_clear" data-include_product_types= "braintree-subscription, braintree-variable-subscription" data-excluded_product_types = "grouped" data-placeholder="<?php echo __( 'Search for a product&hellip;', 'cartflows' ); ?>" data-action="wcf_json_search_products_and_variations"><?php echo $options; ?></select>
31
+ </span>
32
+
33
+ <span class="wcf-repeatable-row-actions">
34
+ <a class="wcf-remove-row wcf-repeatable-remove button" data-type="product">
35
+ <span class="dashicons dashicons-trash"></span>
36
+ <span class="wcf-repeatable-remove-button"><?php echo __( 'Remove', 'cartflows' ); ?></span>
37
+ </a>
38
+ </span>
39
+ </div>
40
+
41
+ <div class="wcf_toggle_advance_fields"><i class="dashicons dashicons-arrow-down"></i></div>
42
+ </div>
43
+ </div>
44
+
45
+ <div class="wcf-repeatable-row-advance-fields <?php echo $hide_advance; ?>">
46
+
47
+ <!-- Qty field. -->
48
+ <div class="wcf-repeatable-row-qty-field wcf-checkout-products-qty-<?php echo $id; ?>">
49
+ <div class="wcf-field-row">
50
+ <div class="wcf-field-row-heading">
51
+ <label><?php echo __( 'Product Quantity', 'cartflows' ); ?></label>
52
+ </div>
53
+
54
+ <div class="wcf-field-row-content wcf-field-row-advance-content">
55
+ <input type="number" class="input-text qty text" step="1" min="1" max="" name="wcf-checkout-products[<?php echo $id; ?>][quantity]" value="<?php echo $selected_data['quantity']; ?>" title="Qty" inputmode="numeric">
56
+ </div>
57
+ </div>
58
+ </div>
59
+ <!-- Qty field end -->
60
+
61
+ <!-- Type field. -->
62
+ <div class="wcf-repeatable-discount-type-field">
63
+ <div class="wcf-field-row">
64
+ <div class="wcf-field-row-heading">
65
+ <label><?php echo __( 'Discount Type', 'cartflows' ); ?></label>
66
+ </div>
67
+
68
+ <div class="wcf-field-row-content wcf-field-row-advance-content">
69
+ <select name="wcf-checkout-products[<?php echo $id; ?>][discount_type]" data-allow_clear="allow_clear" data-placeholder="<?php echo __( 'Select Discount Type', 'cartflows' ); ?>">
70
+ <option value="" <?php selected( $selected_data['discount_type'], '', true ); ?>><?php echo __( 'Original', 'cartflows' ); ?></option>
71
+ <option value="discount_percent" <?php selected( $selected_data['discount_type'], 'discount_percent', true ); ?>><?php echo __( 'Percentage', 'cartflows' ); ?></option>
72
+ <option value="discount_price" <?php selected( $selected_data['discount_type'], 'discount_price', true ); ?>><?php echo __( 'Price', 'cartflows' ); ?></option>
73
+ </select>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ <!-- Type field end -->
78
+
79
+ <!-- Discount field -->
80
+ <div class="wcf-repeatable-row-discount-field <?php echo $hide_advance; ?> wcf-checkout-products-discount-<?php echo $id; ?>">
81
+ <div class="wcf-field-row">
82
+ <div class="wcf-field-row-heading">
83
+ <label><?php echo __( 'Discount Value', 'cartflows' ); ?></label>
84
+ <i class="wcf-field-heading-help dashicons dashicons-editor-help"></i>
85
+ <span class="wcf-tooltip-text"><?php echo __( 'Discount value will apply for each quantity of product.', 'cartflows' ); ?></span>
86
+ </div>
87
+ <div class="wcf-field-row-content wcf-field-row-advance-content">
88
+ <input type="text" class="input-text text" name="wcf-checkout-products[<?php echo $id; ?>][discount_value]" value="<?php echo $selected_data['discount_value']; ?>" title="" inputmode="numeric">
89
+ </div>
90
+ </div>
91
+ </div>
92
+
93
+ <div class="wcf-repeatable-row-unique-id-field">
94
+ <input name="wcf-checkout-products[<?php echo $id; ?>][unique_id]" type="hidden" class="wcf-checkout-product-unique" value="<?php echo $selected_data['unique_id']; ?>">
95
+ </div>
96
+
97
+ <?php do_action( 'cartflows_repeatable_row_advance_fields', $id ); ?>
98
+ </div>
99
+ </div>
languages/cartflows.pot CHANGED
@@ -1,2624 +1,3057 @@
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.5.18\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
- "POT-Creation-Date: 2020-09-29 10:28:48+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
- #: admin/bsf-analytics/class-bsf-analytics.php:211
28
- #. translators: %s product name
29
- msgid ""
30
- "Want to help make <strong>%1s</strong> even more awesome? Allow us to "
31
- "collect non-sensitive diagnostic data and usage information. "
32
- msgstr ""
33
-
34
- #: admin/bsf-analytics/class-bsf-analytics.php:214
35
- msgid "This will be applicable for all sites from the network."
36
- msgstr ""
37
-
38
- #: admin/bsf-analytics/class-bsf-analytics.php:238
39
- #. translators: %s usage doc link
40
- msgid " Know More."
41
- msgstr ""
42
-
43
- #: admin/bsf-analytics/class-bsf-analytics.php:246
44
- msgid "Yes! Allow it"
45
- msgstr ""
46
-
47
- #: admin/bsf-analytics/class-bsf-analytics.php:255
48
- msgid "No Thanks"
49
- msgstr ""
50
-
51
- #: admin/bsf-analytics/class-bsf-analytics.php:359
52
- msgid "Usage Tracking"
53
- msgstr ""
54
-
55
- #: admin/bsf-analytics/class-bsf-analytics.php:403
56
- #. translators: %s Product title
57
- msgid "Allow %s products to track non-sensitive usage tracking data."
58
- msgstr ""
59
-
60
- #: admin/bsf-analytics/class-bsf-analytics.php:406
61
- msgid " This will be applicable for all sites from the network."
62
- msgstr ""
63
-
64
- #: admin/bsf-analytics/class-bsf-analytics.php:411
65
- msgid "Learn More."
66
- msgstr ""
67
-
68
- #: classes/batch-process/class-cartflows-importer-elementor.php:44
69
- msgid "Invalid content."
70
- msgstr ""
71
-
72
- #: classes/batch-process/class-cartflows-importer-elementor.php:56
73
- msgid "Invalid content. Expected an array."
74
- msgstr ""
75
-
76
- #: classes/batch-process/helpers/class-wp-background-process.php:435
77
- msgid "Every %d Minutes"
78
- msgstr ""
79
-
80
- #: classes/class-cartflows-admin-fields.php:241
81
- msgid "Select"
82
- msgstr ""
83
-
84
- #: classes/class-cartflows-admin-fields.php:244
85
- msgid "No Checkout Steps"
86
- msgstr ""
87
-
88
- #: classes/class-cartflows-admin-fields.php:270
89
- #. translators: %s: link
90
- msgid ""
91
- "Be sure not to add any product in above selected Global Checkout step. "
92
- "Please read information about how to set up Global Checkout %1$shere%2$s."
93
- msgstr ""
94
-
95
- #: classes/class-cartflows-admin.php:186 includes/admin/cartflows-home.php:11
96
- msgid "Home"
97
- msgstr ""
98
-
99
- #: classes/class-cartflows-admin.php:191 classes/class-cartflows-admin.php:192
100
- #: modules/optin/classes/class-cartflows-optin-meta.php:151
101
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:140
102
- msgid "Settings"
103
- msgstr ""
104
-
105
- #: classes/class-cartflows-admin.php:480
106
- msgid "Installing and activating.."
107
- msgstr ""
108
-
109
- #: classes/class-cartflows-admin.php:481
110
- msgid "There was an error with the installation of plugin."
111
- msgstr ""
112
-
113
- #: classes/class-cartflows-admin.php:543
114
- msgid "Flows Library"
115
- msgstr ""
116
-
117
- #: classes/class-cartflows-admin.php:550
118
- #: modules/flow/view/view-remote-importer.php:26
119
- msgid "Ready Templates"
120
- msgstr ""
121
-
122
- #: classes/class-cartflows-admin.php:553
123
- #: modules/flow/view/view-remote-importer.php:29
124
- msgid "Create Your Own"
125
- msgstr ""
126
-
127
- #: classes/class-cartflows-admin.php:564
128
- #: modules/flow/view/view-remote-importer.php:41
129
- msgid "Search Sites"
130
- msgstr ""
131
-
132
- #: classes/class-cartflows-admin.php:565
133
- #: modules/flow/view/view-remote-importer.php:42
134
- msgid "Search Flow..."
135
- msgstr ""
136
-
137
- #: classes/class-cartflows-admin.php:582
138
- msgid "Design Your Flow"
139
- msgstr ""
140
-
141
- #: classes/class-cartflows-admin.php:583
142
- #: classes/class-cartflows-importer.php:665
143
- #: classes/class-cartflows-importer.php:764
144
- #: modules/flow/view/view-remote-importer.php:72
145
- msgid "Learn How"
146
- msgstr ""
147
-
148
- #: classes/class-cartflows-api.php:369
149
- msgid "Request successfully processed!"
150
- msgstr ""
151
-
152
- #: classes/class-cartflows-cloning.php:284
153
- #. translators: %s flow id
154
- msgid "Can't clone this step - %1$s. Flow - %2$s"
155
- msgstr ""
156
-
157
- #: classes/class-cartflows-cloning.php:401
158
- #. translators: %s flow id
159
- msgid "Step - %1$s cloned. Flow - %2$s"
160
- msgstr ""
161
-
162
- #: classes/class-cartflows-cloning.php:427
163
- msgid "Clone this flow"
164
- msgstr ""
165
-
166
- #: classes/class-cartflows-cloning.php:427
167
- #: modules/flow/classes/class-cartflows-flow-meta.php:824
168
- msgid "Clone"
169
- msgstr ""
170
-
171
- #: classes/class-cartflows-default-meta.php:735
172
- #: modules/optin/classes/class-cartflows-optin-meta.php:554
173
- msgid "Submit"
174
- msgstr ""
175
-
176
- #: classes/class-cartflows-flow-frontend.php:53
177
- msgid ""
178
- "Test mode is active — which displays random products for previewing. It can "
179
- "be deactivated from the flow settings in the admin dashboard."
180
- msgstr ""
181
-
182
- #: classes/class-cartflows-flow-frontend.php:58
183
- msgid "Click here to disable it"
184
- msgstr ""
185
-
186
- #: classes/class-cartflows-functions.php:567
187
- #. translators: %1$s page builder name "string"
188
- msgid ""
189
- "We have introduced %1$1s widgets for CartFlows shortcodes. Now, you can "
190
- "add/change/update design settings directly from the page builder as well."
191
- msgstr ""
192
-
193
- #: classes/class-cartflows-functions.php:568
194
- msgid "Learn More »"
195
- msgstr ""
196
-
197
- #: classes/class-cartflows-importer.php:81
198
- msgid "Export this flow"
199
- msgstr ""
200
-
201
- #: classes/class-cartflows-importer.php:81 includes/exporter.php:18
202
- msgid "Export"
203
- msgstr ""
204
-
205
- #: classes/class-cartflows-importer.php:92
206
- msgid "Flow Export"
207
- msgstr ""
208
-
209
- #: classes/class-cartflows-importer.php:93
210
- msgid "Flow Import"
211
- msgstr ""
212
-
213
- #: classes/class-cartflows-importer.php:104
214
- msgid "No post to export has been supplied!"
215
- msgstr ""
216
-
217
- #: classes/class-cartflows-importer.php:278
218
- msgid "Please upload a valid .json file"
219
- msgstr ""
220
-
221
- #: classes/class-cartflows-importer.php:284
222
- msgid "Please upload a file to import"
223
- msgstr ""
224
-
225
- #: classes/class-cartflows-importer.php:506
226
- msgid "Successfully imported flows."
227
- msgstr ""
228
-
229
- #: classes/class-cartflows-importer.php:538
230
- msgid "Loading Steps"
231
- msgstr ""
232
-
233
- #: classes/class-cartflows-importer.php:540
234
- msgid "Getting steps from the cloud. Please wait for the moment."
235
- msgstr ""
236
-
237
- #: classes/class-cartflows-importer.php:551
238
- msgid "Searching Template.."
239
- msgstr ""
240
-
241
- #: classes/class-cartflows-importer.php:553
242
- msgid "Getting templates from the cloud. Please wait for the moment."
243
- msgstr ""
244
-
245
- #: classes/class-cartflows-importer.php:562
246
- msgid "Importing.."
247
- msgstr ""
248
-
249
- #: classes/class-cartflows-importer.php:571
250
- #: classes/class-cartflows-importer.php:611
251
- msgid "Imported"
252
- msgstr ""
253
-
254
- #: classes/class-cartflows-importer.php:572
255
- #: classes/class-cartflows-importer.php:612
256
- msgid "Thanks for patience"
257
- msgstr ""
258
-
259
- #: classes/class-cartflows-importer.php:581
260
- #: classes/class-cartflows-importer.php:593
261
- msgid "Coming Soon!"
262
- msgstr ""
263
-
264
- #: classes/class-cartflows-importer.php:612
265
- msgid "Redirecting to the Elementor edit window."
266
- msgstr ""
267
-
268
- #: classes/class-cartflows-importer.php:658
269
- #: classes/class-cartflows-importer.php:774
270
- msgid "Pro"
271
- msgstr ""
272
-
273
- #: classes/class-cartflows-importer.php:699
274
- #: classes/class-cartflows-importer.php:806
275
- msgid "Activate License"
276
- msgstr ""
277
-
278
- #: classes/class-cartflows-importer.php:701
279
- #: classes/class-cartflows-importer.php:808
280
- #: modules/flow/classes/class-cartflows-flow-meta.php:503
281
- msgid "Get Pro"
282
- msgstr ""
283
-
284
- #: classes/class-cartflows-importer.php:726
285
- msgid "Create"
286
- msgstr ""
287
-
288
- #: classes/class-cartflows-importer.php:825
289
- msgid "Under Maintenance.."
290
- msgstr ""
291
-
292
- #: classes/class-cartflows-importer.php:826
293
- msgid ""
294
- "If you are seeing this message, most likely our servers are under routine "
295
- "maintenance and we will be back shortly."
296
- msgstr ""
297
-
298
- #: classes/class-cartflows-importer.php:827
299
- msgid ""
300
- "In rare case, it is possible your website is having trouble connecting with "
301
- "ours. If you need help, please feel free to get in touch with us from our "
302
- "website.."
303
- msgstr ""
304
-
305
- #: classes/class-cartflows-importer.php:857
306
- #. translators: %s: Plugin string
307
- msgid ""
308
- "%1$s to see CartFlows templates. If you prefer another page builder tool, "
309
- "you can <a href=\"%2$s\" target=\"blank\">select it here</a>."
310
- msgstr ""
311
-
312
- #: classes/class-cartflows-importer.php:872
313
- msgid "All"
314
- msgstr ""
315
-
316
- #: classes/class-cartflows-importer.php:875
317
- msgid "Select Step Type"
318
- msgstr ""
319
-
320
- #: classes/class-cartflows-importer.php:959
321
- msgid "Import from Cloud"
322
- msgstr ""
323
-
324
- #: classes/class-cartflows-importer.php:1267
325
- msgid "Sales Landing"
326
- msgstr ""
327
-
328
- #: classes/class-cartflows-importer.php:1271
329
- #: modules/flow/classes/class-cartflows-step-post-type.php:253
330
- #: modules/flow/view/meta-flow-steps.php:12
331
- msgid "Checkout (Woo)"
332
- msgstr ""
333
-
334
- #: classes/class-cartflows-importer.php:1275
335
- #: modules/flow/classes/class-cartflows-step-post-type.php:260
336
- #: modules/flow/view/meta-flow-steps.php:13
337
- msgid "Thank You (Woo)"
338
- msgstr ""
339
-
340
- #: classes/class-cartflows-importer.php:1283
341
- #: modules/flow/classes/class-cartflows-step-post-type.php:239
342
- #: modules/flow/view/meta-flow-steps.php:11
343
- msgid "Landing"
344
- msgstr ""
345
-
346
- #: classes/class-cartflows-importer.php:1287
347
- msgid "Thank You"
348
- msgstr ""
349
-
350
- #: classes/class-cartflows-importer.php:1397
351
- #. translators: %s: template ID
352
- msgid "Invalid template id %1$s or post id %2$s."
353
- msgstr ""
354
-
355
- #: classes/class-cartflows-importer.php:1472
356
- #. translators: %s: flow ID
357
- msgid "Invalid flow id %1$s OR step type %2$s."
358
- msgstr ""
359
-
360
- #: classes/class-cartflows-importer.php:1597
361
- msgid ""
362
- "Elementor is not activated. Please activate plugin Elementor Page Builder "
363
- "to import the step."
364
- msgstr ""
365
-
366
- #: classes/class-cartflows-importer.php:1700
367
- msgid "Action failed. Invalid Security Nonce."
368
- msgstr ""
369
-
370
- #: classes/class-cartflows-importer.php:1707
371
- msgid "User have not plugin install permissions."
372
- msgstr ""
373
-
374
- #: classes/class-cartflows-importer.php:1729
375
- msgid "Plugin Successfully Activated"
376
- msgstr ""
377
-
378
- #: classes/class-cartflows-learndash-compatibility.php:86
379
- msgid "None"
380
- msgstr ""
381
-
382
- #: classes/class-cartflows-learndash-compatibility.php:113
383
- #. translators: 1: anchor start, 2: anchor close
384
- msgid ""
385
- "Non-enrolled students will redirect to the selected CartFlows template. If "
386
- "you have not created any Flow already, add new Flow from %1$shere%2$s."
387
- msgstr ""
388
-
389
- #: classes/class-cartflows-learndash-compatibility.php:119
390
- msgid "Select CartFlows Template for this Course"
391
- msgstr ""
392
-
393
- #: classes/class-cartflows-loader.php:232
394
- #. translators: %s: html tags
395
- msgid ""
396
- "You are using an older version of %1$sCartFlows Pro%2$s. Please update "
397
- "%1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher."
398
- msgstr ""
399
-
400
- #: classes/class-cartflows-loader.php:509
401
- #. translators: %s: html tags
402
- msgid ""
403
- "This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & "
404
- "activated."
405
- msgstr ""
406
-
407
- #: classes/class-cartflows-loader.php:519
408
- msgid "Activate WooCommerce"
409
- msgstr ""
410
-
411
- #: classes/class-cartflows-loader.php:527
412
- msgid "Install WooCommerce"
413
- msgstr ""
414
-
415
- #: classes/class-cartflows-logger.php:161
416
- msgid "Action failed. Please refresh the page and retry."
417
- msgstr ""
418
-
419
- #: classes/class-cartflows-meta-fields.php:61
420
- msgid "Thin 100"
421
- msgstr ""
422
-
423
- #: classes/class-cartflows-meta-fields.php:62
424
- msgid "Extra-Light 200"
425
- msgstr ""
426
-
427
- #: classes/class-cartflows-meta-fields.php:63
428
- msgid "Light 300"
429
- msgstr ""
430
-
431
- #: classes/class-cartflows-meta-fields.php:64
432
- msgid "Normal 400"
433
- msgstr ""
434
-
435
- #: classes/class-cartflows-meta-fields.php:65
436
- msgid "Medium 500"
437
- msgstr ""
438
-
439
- #: classes/class-cartflows-meta-fields.php:66
440
- msgid "Semi-Bold 600"
441
- msgstr ""
442
-
443
- #: classes/class-cartflows-meta-fields.php:67
444
- msgid "Bold 700"
445
- msgstr ""
446
-
447
- #: classes/class-cartflows-meta-fields.php:68
448
- msgid "Extra-Bold 800"
449
- msgstr ""
450
-
451
- #: classes/class-cartflows-meta-fields.php:69
452
- msgid "Ultra-Bold 900"
453
- msgstr ""
454
-
455
- #: classes/class-cartflows-meta-fields.php:182
456
- #. Translators: %d stock amount
457
- msgid "Stock: %d"
458
- msgstr ""
459
-
460
- #: classes/class-cartflows-meta-fields.php:765
461
- #: includes/meta-fields/generate-product-repeater.php:30
462
- msgid "Search for a product&hellip;"
463
- msgstr ""
464
-
465
- #: classes/class-cartflows-meta-fields.php:816
466
- msgid "Search for a coupon&hellip;"
467
- msgstr ""
468
-
469
- #: classes/class-cartflows-meta.php:34
470
- msgid "Update"
471
- msgstr ""
472
-
473
- #: classes/class-cartflows-meta.php:42
474
- #: modules/flow/classes/class-cartflows-flow-meta.php:95
475
- #: modules/flow/classes/class-cartflows-flow-meta.php:763
476
- msgid "Back to edit Flow"
477
- msgstr ""
478
-
479
- #: classes/class-cartflows-meta.php:63
480
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:175
481
- #: modules/landing/classes/class-cartflows-landing-meta.php:136
482
- #: modules/optin/classes/class-cartflows-optin-meta.php:157
483
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:146
484
- msgid "Custom Script"
485
- msgstr ""
486
-
487
- #: classes/class-cartflows-meta.php:66
488
- msgid ""
489
- "Custom script lets you add your own custom script on front end of this flow "
490
- "page."
491
- msgstr ""
492
-
493
- #: classes/class-cartflows-metabox.php:59
494
- msgid "Flow Details"
495
- msgstr ""
496
-
497
- #: classes/class-cartflows-wizard.php:94
498
- msgid "Thanks for installing and using CartFlows!"
499
- msgstr ""
500
-
501
- #: classes/class-cartflows-wizard.php:95
502
- msgid ""
503
- "It is easy to use the CartFlows. Please use the setup wizard to quick start "
504
- "setup."
505
- msgstr ""
506
-
507
- #: classes/class-cartflows-wizard.php:97
508
- msgid "Start Wizard"
509
- msgstr ""
510
-
511
- #: classes/class-cartflows-wizard.php:98
512
- msgid "Skip Setup"
513
- msgstr ""
514
-
515
- #: classes/class-cartflows-wizard.php:128
516
- msgid "Welcome"
517
- msgstr ""
518
-
519
- #: classes/class-cartflows-wizard.php:133
520
- msgid "Page Builder"
521
- msgstr ""
522
-
523
- #: classes/class-cartflows-wizard.php:137
524
- msgid "Checkout"
525
- msgstr ""
526
-
527
- #: classes/class-cartflows-wizard.php:141
528
- msgid "Training"
529
- msgstr ""
530
-
531
- #: classes/class-cartflows-wizard.php:145
532
- msgid "Ready!"
533
- msgstr ""
534
-
535
- #: classes/class-cartflows-wizard.php:220
536
- msgid "CartFlows Setup"
537
- msgstr ""
538
-
539
- #: classes/class-cartflows-wizard.php:246
540
- msgid "Exit Setup Wizard"
541
- msgstr ""
542
-
543
- #: classes/class-cartflows-wizard.php:299
544
- msgid "Welcome to CartFlows!"
545
- msgstr ""
546
-
547
- #: classes/class-cartflows-wizard.php:300
548
- msgid ""
549
- "Thank you for choosing CartFlows to get more leads, increase conversions, & "
550
- "maximize profits. This short setup wizard will guide you though configuring "
551
- "CartFlows and creating your first funnel."
552
- msgstr ""
553
-
554
- #: classes/class-cartflows-wizard.php:304
555
- msgid "Let&#x27;s Build it better!"
556
- msgstr ""
557
-
558
- #: classes/class-cartflows-wizard.php:305
559
- msgid ""
560
- "Get improved features and faster fixes by sharing non-sensitive data via "
561
- "usage tracking that shows us how CartFlows is used. No personal data is "
562
- "tracked or stored."
563
- msgstr ""
564
-
565
- #: classes/class-cartflows-wizard.php:306
566
- msgid "Learn More"
567
- msgstr ""
568
-
569
- #: classes/class-cartflows-wizard.php:309
570
- msgid "Yes, I am in."
571
- msgstr ""
572
-
573
- #: classes/class-cartflows-wizard.php:316
574
- msgid "Lets Go »"
575
- msgstr ""
576
-
577
- #: classes/class-cartflows-wizard.php:344
578
- msgid "Page Builder Setup"
579
- msgstr ""
580
-
581
- #: classes/class-cartflows-wizard.php:345
582
- msgid "Please select a page builder you would like to use with CartFlows."
583
- msgstr ""
584
-
585
- #: classes/class-cartflows-wizard.php:350
586
- msgid "Select Page Builder"
587
- msgstr ""
588
-
589
- #: classes/class-cartflows-wizard.php:357
590
- #: classes/class-cartflows-wizard.php:423
591
- #: includes/admin/cartflows-general.php:76
592
- msgid "Elementor"
593
- msgstr ""
594
-
595
- #: classes/class-cartflows-wizard.php:367
596
- msgid "Beaver Builder Plugin (Lite Version)"
597
- msgstr ""
598
-
599
- #: classes/class-cartflows-wizard.php:377
600
- #: includes/admin/cartflows-general.php:78
601
- msgid "Divi"
602
- msgstr ""
603
-
604
- #: classes/class-cartflows-wizard.php:387
605
- #: includes/admin/cartflows-general.php:79
606
- msgid "Gutenberg"
607
- msgstr ""
608
-
609
- #: classes/class-cartflows-wizard.php:397
610
- #: includes/admin/cartflows-general.php:80
611
- msgid "Other"
612
- msgstr ""
613
-
614
- #: classes/class-cartflows-wizard.php:419
615
- msgid ""
616
- "While CartFlows Should work with most page builders, we offer templates for "
617
- "the above page builders."
618
- msgstr ""
619
-
620
- #: classes/class-cartflows-wizard.php:422
621
- #: classes/class-cartflows-wizard.php:464
622
- msgid "The following plugin will be installed and activated for you:"
623
- msgstr ""
624
-
625
- #: classes/class-cartflows-wizard.php:429
626
- #: classes/class-cartflows-wizard.php:474
627
- #: classes/class-cartflows-wizard.php:684
628
- msgid "« Previous"
629
- msgstr ""
630
-
631
- #: classes/class-cartflows-wizard.php:432
632
- msgid "Skip this step"
633
- msgstr ""
634
-
635
- #: classes/class-cartflows-wizard.php:433
636
- msgid "Next »"
637
- msgstr ""
638
-
639
- #: classes/class-cartflows-wizard.php:452
640
- msgid "Choose a checkout"
641
- msgstr ""
642
-
643
- #: classes/class-cartflows-wizard.php:455
644
- msgid ""
645
- "While CartFlows is designed to use WooCommerce sell digital and physical "
646
- "products, not all funnels need a checkout system."
647
- msgstr ""
648
-
649
- #: classes/class-cartflows-wizard.php:457
650
- msgid ""
651
- "Would you like to install WooCommerce to sell digital and physical products "
652
- "in your funnels?"
653
- msgstr ""
654
-
655
- #: classes/class-cartflows-wizard.php:465
656
- msgid "WooCommerce"
657
- msgstr ""
658
-
659
- #: classes/class-cartflows-wizard.php:466
660
- msgid "WooCommerce Cart Abandonment Recovery"
661
- msgstr ""
662
-
663
- #: classes/class-cartflows-wizard.php:477
664
- #: classes/class-cartflows-wizard.php:687
665
- msgid "No thanks"
666
- msgstr ""
667
-
668
- #: classes/class-cartflows-wizard.php:478
669
- msgid "Yes"
670
- msgstr ""
671
-
672
- #: classes/class-cartflows-wizard.php:620
673
- msgid "Congratulations, You Did It!"
674
- msgstr ""
675
-
676
- #: classes/class-cartflows-wizard.php:627
677
- msgid ""
678
- "CartFlows is ready to use on your website. You've successfully completed "
679
- "the setup process and all that is left for you to do is create your first "
680
- "flow."
681
- msgstr ""
682
-
683
- #: classes/class-cartflows-wizard.php:641
684
- msgid "Create a flow"
685
- msgstr ""
686
-
687
- #: classes/class-cartflows-wizard.php:658
688
- msgid "Exclusive CartFlows Training Course Offer"
689
- msgstr ""
690
-
691
- #: classes/class-cartflows-wizard.php:669
692
- msgid ""
693
- "We want you to get off to a great start using CartFlows, so we would like "
694
- "to give access to our exclusive training course."
695
- msgstr ""
696
-
697
- #: classes/class-cartflows-wizard.php:670
698
- msgid "Get access to this couse, for free, by entering your email below."
699
- msgstr ""
700
-
701
- #: classes/class-cartflows-wizard.php:672
702
- msgid "Enter Email address"
703
- msgstr ""
704
-
705
- #: classes/class-cartflows-wizard.php:688
706
- msgid "Allow"
707
- msgstr ""
708
-
709
- #: classes/lib/notices/class-astra-notices.php:125
710
- msgid "WordPress Nonce not validated."
711
- msgstr ""
712
-
713
- #: classes/logger/class-cartflows-log-handler-file.php:351
714
- #: classes/logger/class-cartflows-log-handler-file.php:371
715
- msgid "This method should not be called before plugins_loaded."
716
- msgstr ""
717
-
718
- #: classes/logger/class-cartflows-wc-logger.php:58
719
- #. translators: 1: class name 2: Cartflows_Log_Handler_Interface
720
- msgid "The provided handler %1$s does not implement %2$s."
721
- msgstr ""
722
-
723
- #: classes/logger/class-cartflows-wc-logger.php:136
724
- #. translators: 1: Cartflows_WC_Logger::log 2: level
725
- msgid "%1$s was called with an invalid level \"%2$s\"."
726
- msgstr ""
727
-
728
- #: includes/admin/cartflows-admin-header.php:17
729
- #: includes/admin/cartflows-admin.php:19
730
- msgid "Generate More Leads & More Sales"
731
- msgstr ""
732
-
733
- #: includes/admin/cartflows-admin.php:29
734
- msgid "Settings saved successfully."
735
- msgstr ""
736
-
737
- #: includes/admin/cartflows-error-log.php:36
738
- msgid "%1$s at %2$s"
739
- msgstr ""
740
-
741
- #: includes/admin/cartflows-error-log.php:41
742
- #: modules/flow/classes/class-cartflows-flow-meta.php:804
743
- #: modules/flow/classes/class-cartflows-flow-post-type.php:225
744
- msgid "View"
745
- msgstr ""
746
-
747
- #: includes/admin/cartflows-error-log.php:65
748
- msgid "Delete log"
749
- msgstr ""
750
-
751
- #: includes/admin/cartflows-error-log.php:70
752
- msgid "There are currently no logs to view."
753
- msgstr ""
754
-
755
- #: includes/admin/cartflows-general.php:31
756
- #: includes/admin/cartflows-general.php:40
757
- msgid "General Settings"
758
- msgstr ""
759
-
760
- #: includes/admin/cartflows-general.php:53
761
- msgid "Disallow search engines from indexing flows"
762
- msgstr ""
763
-
764
- #: includes/admin/cartflows-general.php:63
765
- #: modules/flow/view/view-flow-inner-step.php:52
766
- msgid "Global Checkout"
767
- msgstr ""
768
-
769
- #: includes/admin/cartflows-general.php:72
770
- msgid "Show Templates designed with"
771
- msgstr ""
772
-
773
- #: includes/admin/cartflows-general.php:73
774
- msgid ""
775
- "CartFlows offers flow templates that can be imported in one click. These "
776
- "templates are available in few different page builders. Please choose your "
777
- "preferred page builder from the list so you will only see templates that "
778
- "are made using that page builder.."
779
- msgstr ""
780
-
781
- #: includes/admin/cartflows-general.php:77
782
- msgid "Beaver Builder"
783
- msgstr ""
784
-
785
- #: includes/admin/cartflows-general.php:89
786
- #: includes/admin/cartflows-general.php:175
787
- #: includes/admin/cartflows-general.php:281
788
- #: includes/admin/cartflows-general.php:398
789
- msgid "Save Changes"
790
- msgstr ""
791
-
792
- #: includes/admin/cartflows-general.php:101
793
- msgid "Permalink Settings"
794
- msgstr ""
795
-
796
- #: includes/admin/cartflows-general.php:116
797
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:119
798
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:179
799
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:184
800
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:146
801
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:151
802
- #: modules/optin/classes/class-cartflows-optin-meta.php:447
803
- msgid "Default"
804
- msgstr ""
805
-
806
- #: includes/admin/cartflows-general.php:122
807
- msgid "Flow and Step Slug"
808
- msgstr ""
809
-
810
- #: includes/admin/cartflows-general.php:128
811
- msgid "Flow Slug"
812
- msgstr ""
813
-
814
- #: includes/admin/cartflows-general.php:134
815
- msgid "Step Slug"
816
- msgstr ""
817
-
818
- #: includes/admin/cartflows-general.php:146
819
- msgid "Post Type Permalink Base"
820
- msgstr ""
821
-
822
- #: includes/admin/cartflows-general.php:154
823
- msgid "Step Base"
824
- msgstr ""
825
-
826
- #: includes/admin/cartflows-general.php:164
827
- msgid "Flow Base"
828
- msgstr ""
829
-
830
- #: includes/admin/cartflows-general.php:176
831
- msgid "Set Default"
832
- msgstr ""
833
-
834
- #: includes/admin/cartflows-general.php:190
835
- msgid "Facebook Pixel Settings"
836
- msgstr ""
837
-
838
- #: includes/admin/cartflows-general.php:205
839
- msgid "Enable Facebook Pixel Tracking"
840
- msgstr ""
841
-
842
- #: includes/admin/cartflows-general.php:218
843
- msgid "Enable for the whole site"
844
- msgstr ""
845
-
846
- #: includes/admin/cartflows-general.php:226
847
- #: includes/admin/cartflows-general.php:325
848
- msgid "If this option is unchecked, it will only apply to CartFlows steps."
849
- msgstr ""
850
-
851
- #: includes/admin/cartflows-general.php:236
852
- msgid "Enter Facebook pixel ID"
853
- msgstr ""
854
-
855
- #: includes/admin/cartflows-general.php:244
856
- #: includes/admin/cartflows-general.php:343
857
- msgid "Enable Events:"
858
- msgstr ""
859
-
860
- #: includes/admin/cartflows-general.php:253
861
- msgid "Initiate Checkout"
862
- msgstr ""
863
-
864
- #: includes/admin/cartflows-general.php:262
865
- #: includes/admin/cartflows-general.php:369
866
- msgid "Add Payment Info"
867
- msgstr ""
868
-
869
- #: includes/admin/cartflows-general.php:271
870
- msgid "Purchase Complete"
871
- msgstr ""
872
-
873
- #: includes/admin/cartflows-general.php:293
874
- msgid "Google Analytics Settings"
875
- msgstr ""
876
-
877
- #: includes/admin/cartflows-general.php:304
878
- msgid "Enable Google Analytics Tracking"
879
- msgstr ""
880
-
881
- #: includes/admin/cartflows-general.php:317
882
- msgid "Enable for the whole website"
883
- msgstr ""
884
-
885
- #: includes/admin/cartflows-general.php:335
886
- msgid "Google Analytics ID"
887
- msgstr ""
888
-
889
- #: includes/admin/cartflows-general.php:337
890
- msgid ""
891
- "Log into your <a href=\"https://analytics.google.com/\" "
892
- "target=\"_blank\">google analytics account</a> to find your ID. eg: "
893
- "UA-XXXXXX-X&period;"
894
- msgstr ""
895
-
896
- #: includes/admin/cartflows-general.php:351
897
- msgid "Begin Checkout"
898
- msgstr ""
899
-
900
- #: includes/admin/cartflows-general.php:360
901
- msgid "Add To Cart"
902
- msgstr ""
903
-
904
- #: includes/admin/cartflows-general.php:378
905
- msgid "Purchase"
906
- msgstr ""
907
-
908
- #: includes/admin/cartflows-general.php:386
909
- msgid ""
910
- "Google Analytics not working correctly? <a "
911
- "href=\"https://cartflows.com/docs/troubleshooting-google-analytics-tracking-"
912
- "issues/\" > Click here </a> to know more. "
913
- msgstr ""
914
-
915
- #: includes/admin/cartflows-general.php:419
916
- #: includes/admin/cartflows-home.php:43
917
- msgid "Knowledge Base"
918
- msgstr ""
919
-
920
- #: includes/admin/cartflows-general.php:423
921
- #: includes/admin/cartflows-home.php:47
922
- msgid "Not sure how something works? Take a peek at the knowledge base and learn."
923
- msgstr ""
924
-
925
- #: includes/admin/cartflows-general.php:426
926
- #: includes/admin/cartflows-home.php:50
927
- msgid "Visit Knowledge Base »"
928
- msgstr ""
929
-
930
- #: includes/admin/cartflows-general.php:434
931
- #: includes/admin/cartflows-home.php:58
932
- msgid "Community"
933
- msgstr ""
934
-
935
- #: includes/admin/cartflows-general.php:438
936
- #: includes/admin/cartflows-home.php:62
937
- msgid ""
938
- "Join the community of super helpful CartFlows users. Say hello, ask "
939
- "questions, give feedback and help each other!"
940
- msgstr ""
941
-
942
- #: includes/admin/cartflows-general.php:441
943
- #: includes/admin/cartflows-home.php:65
944
- msgid "Join Our Facebook Group »"
945
- msgstr ""
946
-
947
- #: includes/admin/cartflows-general.php:449
948
- #: includes/admin/cartflows-home.php:73
949
- msgid "Five Star Support"
950
- msgstr ""
951
-
952
- #: includes/admin/cartflows-general.php:453
953
- #: includes/admin/cartflows-home.php:77
954
- msgid "Got a question? Get in touch with CartFlows developers. We're happy to help!"
955
- msgstr ""
956
-
957
- #: includes/admin/cartflows-general.php:456
958
- #: includes/admin/cartflows-home.php:80
959
- msgid "Submit a Ticket »"
960
- msgstr ""
961
-
962
- #: includes/admin/cartflows-general.php:466
963
- msgid "Load Minified CSS"
964
- msgstr ""
965
-
966
- #: includes/admin/cartflows-general.php:471
967
- msgid ""
968
- "Load the Minified CSS from here. Just Enable it by checking the below given "
969
- "checkbox."
970
- msgstr ""
971
-
972
- #: includes/admin/cartflows-general.php:478
973
- msgid "Load minified CSS & JS Files"
974
- msgstr ""
975
-
976
- #: includes/admin/cartflows-general.php:483
977
- msgid "Save"
978
- msgstr ""
979
-
980
- #: includes/admin/cartflows-home.php:20
981
- msgid "Getting Started"
982
- msgstr ""
983
-
984
- #: includes/admin/cartflows-home.php:28
985
- msgid "Modernizing WordPress eCommerce!"
986
- msgstr ""
987
-
988
- #: includes/exporter.php:12
989
- msgid "Export Flows to a JSON file"
990
- msgstr ""
991
-
992
- #: includes/exporter.php:13
993
- msgid ""
994
- "This tool allows you to generate and download a JSON file containing a list "
995
- "of all flows."
996
- msgstr ""
997
-
998
- #: includes/importer.php:12
999
- msgid "Import Flows to a JSON file"
1000
- msgstr ""
1001
-
1002
- #: includes/importer.php:13
1003
- msgid "This tool allows you to import the flows from the JSON file."
1004
- msgstr ""
1005
-
1006
- #: includes/importer.php:21
1007
- msgid "Import"
1008
- msgstr ""
1009
-
1010
- #: includes/meta-fields/generate-product-repeater.php:36
1011
- msgid "Remove"
1012
- msgstr ""
1013
-
1014
- #: includes/meta-fields/generate-product-repeater.php:51
1015
- msgid "Product Quantity"
1016
- msgstr ""
1017
-
1018
- #: includes/meta-fields/generate-product-repeater.php:65
1019
- msgid "Discount Type"
1020
- msgstr ""
1021
-
1022
- #: includes/meta-fields/generate-product-repeater.php:69
1023
- msgid "Select Discount Type"
1024
- msgstr ""
1025
-
1026
- #: includes/meta-fields/generate-product-repeater.php:70
1027
- msgid "Original"
1028
- msgstr ""
1029
-
1030
- #: includes/meta-fields/generate-product-repeater.php:71
1031
- msgid "Percentage"
1032
- msgstr ""
1033
-
1034
- #: includes/meta-fields/generate-product-repeater.php:72
1035
- msgid "Price"
1036
- msgstr ""
1037
-
1038
- #: includes/meta-fields/generate-product-repeater.php:83
1039
- msgid "Discount Value"
1040
- msgstr ""
1041
-
1042
- #: includes/meta-fields/generate-product-repeater.php:85
1043
- msgid "Discount value will apply for each quantity of product."
1044
- msgstr ""
1045
-
1046
- #: includes/meta-fields/get-product-selection-repeater.php:112
1047
- msgid "Add New Product"
1048
- msgstr ""
1049
-
1050
- #: includes/meta-fields/get-product-selection-repeater.php:113
1051
- msgid "Create Product"
1052
- msgstr ""
1053
-
1054
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:331
1055
- #: modules/optin/classes/class-cartflows-optin-markup.php:179
1056
- #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:90
1057
- msgid ""
1058
- "WooCommerce functions do not exist. If you are in an IFrame, please reload "
1059
- "it."
1060
- msgstr ""
1061
-
1062
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:332
1063
- #: modules/optin/classes/class-cartflows-optin-markup.php:180
1064
- #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:91
1065
- msgid "Click Here to Reload"
1066
- msgstr ""
1067
-
1068
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:350
1069
- msgid "Checkout ID not found"
1070
- msgstr ""
1071
-
1072
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:413
1073
- #: modules/checkout/templates/embed/checkout-template-simple.php:26
1074
- #: modules/checkout/templates/wcf-template.php:36
1075
- #: modules/optin/templates/optin-template-simple.php:25
1076
- msgid "Your cart is currently empty."
1077
- msgstr ""
1078
-
1079
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:492
1080
- #. translators: %1$1s, %2$2s Link to meta
1081
- msgid ""
1082
- "No product is selected. Please select products from the %1$1scheckout meta "
1083
- "settings%2$2s to continue."
1084
- msgstr ""
1085
-
1086
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:587
1087
- msgid "Variations Not set"
1088
- msgstr ""
1089
-
1090
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:598
1091
- msgid "This product can't be purchased"
1092
- msgstr ""
1093
-
1094
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1053
1095
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1096
1096
- msgid "Coupon Code"
1097
- msgstr ""
1098
-
1099
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1054
1100
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1105
1101
- msgid "Apply"
1102
- msgstr ""
1103
-
1104
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1242
1105
- msgid "Sorry there was a problem removing this coupon."
1106
- msgstr ""
1107
-
1108
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1245
1109
- msgid "Coupon has been removed."
1110
- msgstr ""
1111
-
1112
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1264
1113
- msgid "Sorry there was a problem removing "
1114
- msgstr ""
1115
-
1116
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1267
1117
- msgid " has been removed."
1118
- msgstr ""
1119
-
1120
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:94
1121
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:169
1122
- msgid "Checkout Settings"
1123
- msgstr ""
1124
-
1125
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:103
1126
- msgid "Checkout Layout & Design"
1127
- msgstr ""
1128
-
1129
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:139
1130
- #: modules/optin/classes/class-cartflows-optin-meta.php:139
1131
- msgid "Select Product"
1132
- msgstr ""
1133
-
1134
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:145
1135
- msgid "Product Options"
1136
- msgstr ""
1137
-
1138
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:151
1139
- msgid "Order Bump"
1140
- msgstr ""
1141
-
1142
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:157
1143
- msgid "Checkout Offer"
1144
- msgstr ""
1145
-
1146
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:163
1147
- msgid "Checkout Fields"
1148
- msgstr ""
1149
-
1150
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:186
1151
- msgid "Logo (Optional)"
1152
- msgstr ""
1153
-
1154
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:271
1155
- #. translators: %s: link
1156
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Product Options feature."
1157
- msgstr ""
1158
-
1159
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:282
1160
- #. translators: %s: link.
1161
- msgid "Update %1$sCartFlows Pro%2$s to %3$s or above for Product Options"
1162
- msgstr ""
1163
-
1164
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:310
1165
- msgid "Add this shortcode to your checkout page"
1166
- msgstr ""
1167
-
1168
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:345
1169
- #. translators: %s: link
1170
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Pre-applied Coupon."
1171
- msgstr ""
1172
-
1173
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:372
1174
- #. translators: %s: link
1175
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Checkout Offer feature"
1176
- msgstr ""
1177
-
1178
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:382
1179
- #. translators: %s: link
1180
- msgid "Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature"
1181
- msgstr ""
1182
-
1183
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:409
1184
- #. translators: %s: link
1185
- msgid "Upgrade to %1$sCartFlows Pro%2$s for animate browser tab feature"
1186
- msgstr ""
1187
-
1188
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:419
1189
- #. translators: %s: link
1190
- msgid ""
1191
- "Update to %1$sCartFlows Pro%2$s to %3$s or above for animate browser tab "
1192
- "feature"
1193
- msgstr ""
1194
-
1195
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:442
1196
- #. translators: %s: link
1197
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature."
1198
- msgstr ""
1199
-
1200
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:469
1201
- #: modules/optin/classes/class-cartflows-optin-meta.php:334
1202
- #. translators: %s: link
1203
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature."
1204
- msgstr ""
1205
-
1206
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:492
1207
- msgid "Place Order Button Text"
1208
- msgstr ""
1209
-
1210
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:496
1211
- msgid "Place order"
1212
- msgstr ""
1213
-
1214
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:498
1215
- msgid "It will change the Place Order Button text on checkout page."
1216
- msgstr ""
1217
-
1218
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:508
1219
- msgid "Enable cart editing on checkout"
1220
- msgstr ""
1221
-
1222
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:516
1223
- #. translators: %s: link
1224
- msgid "Users will able to remove products from the checkout page."
1225
- msgstr ""
1226
-
1227
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:557
1228
- msgid "Header Logo"
1229
- msgstr ""
1230
-
1231
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:565
1232
- msgid "Logo Width (In px)"
1233
- msgstr ""
1234
-
1235
- #: modules/checkout/includes/meta-views/design-checkout-metabox-markup.php:12
1236
- #: modules/landing/classes/class-cartflows-landing-meta.php:130
1237
- #: modules/optin/classes/class-cartflows-optin-meta.php:220
1238
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:244
1239
- msgid "Shortcodes"
1240
- msgstr ""
1241
-
1242
- #: modules/checkout/includes/meta-views/design-checkout-metabox-markup.php:18
1243
- msgid "Checkout Design"
1244
- msgstr ""
1245
-
1246
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:18
1247
- msgid "One Column (Available in CartFlows Pro) "
1248
- msgstr ""
1249
-
1250
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:19
1251
- msgid "Two Step (Available in CartFlows Pro) "
1252
- msgstr ""
1253
-
1254
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:25
1255
- msgid "Checkout Skin"
1256
- msgstr ""
1257
-
1258
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:29
1259
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:158
1260
- msgid "One Column"
1261
- msgstr ""
1262
-
1263
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:30
1264
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:153
1265
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:159
1266
- msgid "Two Column"
1267
- msgstr ""
1268
-
1269
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:31
1270
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:160
1271
- msgid "Two Step"
1272
- msgstr ""
1273
-
1274
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:40
1275
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:302
1276
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:177
1277
- #: modules/optin/classes/class-cartflows-optin-meta.php:410
1278
- msgid "Primary Color"
1279
- msgstr ""
1280
-
1281
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:49
1282
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:84
1283
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:130
1284
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:222
1285
- #: modules/optin/classes/class-cartflows-optin-meta.php:419
1286
- #: modules/optin/classes/class-cartflows-optin-meta.php:458
1287
- #: modules/optin/classes/class-cartflows-optin-meta.php:570
1288
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:311
1289
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:342
1290
- msgid "Font Family"
1291
- msgstr ""
1292
-
1293
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:57
1294
- msgid "Advance Options"
1295
- msgstr ""
1296
-
1297
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:69
1298
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:396
1299
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:290
1300
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:509
1301
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:602
1302
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:691
1303
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:327
1304
- msgid "Heading"
1305
- msgstr ""
1306
-
1307
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:75
1308
- msgid "Heading Color"
1309
- msgstr ""
1310
-
1311
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:93
1312
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:139
1313
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:231
1314
- #: modules/optin/classes/class-cartflows-optin-meta.php:467
1315
- #: modules/optin/classes/class-cartflows-optin-meta.php:579
1316
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:351
1317
- msgid "Font Weight"
1318
- msgstr ""
1319
-
1320
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:101
1321
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:443
1322
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:208
1323
- #: modules/optin/classes/class-cartflows-optin-meta.php:430
1324
- msgid "Input Fields"
1325
- msgstr ""
1326
-
1327
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:109
1328
- #: modules/optin/classes/class-cartflows-optin-meta.php:437
1329
- msgid "Floating Labels (Available in CartFlows Pro)"
1330
- msgstr ""
1331
-
1332
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:115
1333
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:451
1334
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:216
1335
- #: modules/optin/classes/class-cartflows-optin-meta.php:443
1336
- msgid "Style"
1337
- msgstr ""
1338
-
1339
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:120
1340
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:185
1341
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:152
1342
- #: modules/optin/classes/class-cartflows-optin-meta.php:448
1343
- msgid "Floating Labels"
1344
- msgstr ""
1345
-
1346
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:147
1347
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:239
1348
- #: modules/optin/classes/class-cartflows-optin-meta.php:475
1349
- #: modules/optin/classes/class-cartflows-optin-meta.php:587
1350
- msgid "Size"
1351
- msgstr ""
1352
-
1353
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:151
1354
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:243
1355
- #: modules/optin/classes/class-cartflows-optin-meta.php:479
1356
- #: modules/optin/classes/class-cartflows-optin-meta.php:591
1357
- msgid "Extra Small"
1358
- msgstr ""
1359
-
1360
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:152
1361
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:244
1362
- #: modules/optin/classes/class-cartflows-optin-meta.php:480
1363
- #: modules/optin/classes/class-cartflows-optin-meta.php:592
1364
- msgid "Small"
1365
- msgstr ""
1366
-
1367
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:153
1368
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:245
1369
- #: modules/optin/classes/class-cartflows-optin-meta.php:481
1370
- #: modules/optin/classes/class-cartflows-optin-meta.php:593
1371
- msgid "Medium"
1372
- msgstr ""
1373
-
1374
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:154
1375
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:246
1376
- #: modules/optin/classes/class-cartflows-optin-meta.php:482
1377
- #: modules/optin/classes/class-cartflows-optin-meta.php:594
1378
- msgid "Large"
1379
- msgstr ""
1380
-
1381
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:155
1382
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:247
1383
- #: modules/optin/classes/class-cartflows-optin-meta.php:483
1384
- #: modules/optin/classes/class-cartflows-optin-meta.php:595
1385
- msgid "Extra Large"
1386
- msgstr ""
1387
-
1388
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:156
1389
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:248
1390
- #: modules/optin/classes/class-cartflows-optin-meta.php:484
1391
- #: modules/optin/classes/class-cartflows-optin-meta.php:596
1392
- msgid "Custom"
1393
- msgstr ""
1394
-
1395
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:163
1396
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:255
1397
- #: modules/optin/classes/class-cartflows-optin-meta.php:491
1398
- #: modules/optin/classes/class-cartflows-optin-meta.php:603
1399
- msgid "Top Bottom Spacing"
1400
- msgstr ""
1401
-
1402
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:171
1403
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:263
1404
- #: modules/optin/classes/class-cartflows-optin-meta.php:499
1405
- #: modules/optin/classes/class-cartflows-optin-meta.php:611
1406
- msgid "Left Right Spacing"
1407
- msgstr ""
1408
-
1409
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:179
1410
- #: modules/optin/classes/class-cartflows-optin-meta.php:515
1411
- msgid "Text / Placeholder Color"
1412
- msgstr ""
1413
-
1414
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:187
1415
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:287
1416
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:679
1417
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:789
1418
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:995
1419
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:371
1420
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:388
1421
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:458
1422
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:426
1423
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:481
1424
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:571
1425
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:662
1426
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:751
1427
- #: modules/optin/classes/class-cartflows-optin-meta.php:523
1428
- #: modules/optin/classes/class-cartflows-optin-meta.php:648
1429
- msgid "Background Color"
1430
- msgstr ""
1431
-
1432
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:195
1433
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:303
1434
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:582
1435
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:1008
1436
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:315
1437
- #: modules/optin/classes/class-cartflows-optin-meta.php:531
1438
- #: modules/optin/classes/class-cartflows-optin-meta.php:664
1439
- msgid "Border Color"
1440
- msgstr ""
1441
-
1442
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:202
1443
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:495
1444
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:941
1445
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:251
1446
- #: modules/optin/classes/class-cartflows-optin-meta.php:507
1447
- msgid "Label Color"
1448
- msgstr ""
1449
-
1450
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:215
1451
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:626
1452
- msgid "Buttons"
1453
- msgstr ""
1454
-
1455
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:271
1456
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:364
1457
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:659
1458
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:754
1459
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:825
1460
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:358
1461
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:375
1462
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:435
1463
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:323
1464
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:372
1465
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:402
1466
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:468
1467
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:527
1468
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:558
1469
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:619
1470
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:649
1471
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:708
1472
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:738
1473
- #: modules/optin/classes/class-cartflows-optin-meta.php:632
1474
- msgid "Text Color"
1475
- msgstr ""
1476
-
1477
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:279
1478
- #: modules/optin/classes/class-cartflows-optin-meta.php:640
1479
- msgid "Text Hover Color"
1480
- msgstr ""
1481
-
1482
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:295
1483
- #: modules/optin/classes/class-cartflows-optin-meta.php:656
1484
- msgid "Background Hover Color"
1485
- msgstr ""
1486
-
1487
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:311
1488
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:771
1489
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:446
1490
- #: modules/optin/classes/class-cartflows-optin-meta.php:672
1491
- msgid "Border Hover Color"
1492
- msgstr ""
1493
-
1494
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:324
1495
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:356
1496
- msgid "Sections"
1497
- msgstr ""
1498
-
1499
- #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:330
1500
- msgid "Highlight Area Background Color"
1501
- msgstr ""
1502
-
1503
- #: modules/checkout/templates/wcf-template.php:46
1504
- msgid "Copyright &copy;"
1505
- msgstr ""
1506
-
1507
- #: modules/checkout/templates/wcf-template.php:50
1508
- msgid "All Rights Reserved"
1509
- msgstr ""
1510
-
1511
- #: modules/elementor/class-cartflows-el-widgets-loader.php:120
1512
- msgid "Cartflows"
1513
- msgstr ""
1514
-
1515
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:66
1516
- msgid "Checkout Form"
1517
- msgstr ""
1518
-
1519
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:152
1520
- msgid "One Column ( PRO )"
1521
- msgstr ""
1522
-
1523
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:154
1524
- msgid "Two Step ( PRO )"
1525
- msgstr ""
1526
-
1527
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:180
1528
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:147
1529
- msgid "Floating Labels ( PRO )"
1530
- msgstr ""
1531
-
1532
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:203
1533
- msgid "Layout"
1534
- msgstr ""
1535
-
1536
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:210
1537
- msgid "Select Layout"
1538
- msgstr ""
1539
-
1540
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:224
1541
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:465
1542
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:230
1543
- #. translators: %s admin link
1544
- msgid ""
1545
- "This feature is available in the CartFlows Pro. <a href=\"%s\" "
1546
- "target=\"_blank\" rel=\"noopener\">Upgrade Now!</a>."
1547
- msgstr ""
1548
-
1549
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:247
1550
- msgid "Other Settings"
1551
- msgstr ""
1552
-
1553
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:254
1554
- msgid "Billing Section Text"
1555
- msgstr ""
1556
-
1557
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:256
1558
- msgid "Billing Details"
1559
- msgstr ""
1560
-
1561
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:264
1562
- msgid "Shipping Section Text"
1563
- msgstr ""
1564
-
1565
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:266
1566
- msgid "Shipping Details"
1567
- msgstr ""
1568
-
1569
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:274
1570
- msgid "Order Review Text"
1571
- msgstr ""
1572
-
1573
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:276
1574
- #: woocommerce/template/checkout/form-checkout.php:56
1575
- msgid "Your order"
1576
- msgstr ""
1577
-
1578
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:294
1579
- msgid "Global"
1580
- msgstr ""
1581
-
1582
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:404
1583
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:302
1584
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:333
1585
- msgid "Color"
1586
- msgstr ""
1587
-
1588
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:507
1589
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:262
1590
- msgid "Field Background Color"
1591
- msgstr ""
1592
-
1593
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:523
1594
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:273
1595
- msgid "Input Text / Placeholder Color"
1596
- msgstr ""
1597
-
1598
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:541
1599
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:284
1600
- msgid "Border Style"
1601
- msgstr ""
1602
-
1603
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:546
1604
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:289
1605
- msgid "Inherit"
1606
- msgstr ""
1607
-
1608
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:547
1609
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:290
1610
- msgid "Solid"
1611
- msgstr ""
1612
-
1613
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:548
1614
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:291
1615
- msgid "Double"
1616
- msgstr ""
1617
-
1618
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:549
1619
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:292
1620
- msgid "Dotted"
1621
- msgstr ""
1622
-
1623
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:550
1624
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:293
1625
- msgid "Dashed"
1626
- msgstr ""
1627
-
1628
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:565
1629
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:303
1630
- msgid "Border Width"
1631
- msgstr ""
1632
-
1633
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:598
1634
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:711
1635
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:397
1636
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:326
1637
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:406
1638
- msgid "Rounded Corners"
1639
- msgstr ""
1640
-
1641
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:652
1642
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:351
1643
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:368
1644
- msgid "Normal"
1645
- msgstr ""
1646
-
1647
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:696
1648
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:389
1649
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:398
1650
- msgid "Border"
1651
- msgstr ""
1652
-
1653
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:747
1654
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:411
1655
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:428
1656
- msgid "Hover"
1657
- msgstr ""
1658
-
1659
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:818
1660
- msgid "Payment Section"
1661
- msgstr ""
1662
-
1663
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:839
1664
- msgid "Description Color"
1665
- msgstr ""
1666
-
1667
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:851
1668
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:377
1669
- msgid "Section Background Color"
1670
- msgstr ""
1671
-
1672
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:863
1673
- msgid "Information Background Color"
1674
- msgstr ""
1675
-
1676
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:877
1677
- msgid "Section Padding"
1678
- msgstr ""
1679
-
1680
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:890
1681
- msgid "Section Margin"
1682
- msgstr ""
1683
-
1684
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:902
1685
- msgid "Section Rounded Corners"
1686
- msgstr ""
1687
-
1688
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:924
1689
- msgid "Field Validation & Error Messages"
1690
- msgstr ""
1691
-
1692
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:932
1693
- msgid "Field Validation"
1694
- msgstr ""
1695
-
1696
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:953
1697
- msgid "Field Border Color"
1698
- msgstr ""
1699
-
1700
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:972
1701
- msgid "Error Messages"
1702
- msgstr ""
1703
-
1704
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:981
1705
- msgid "Error Message Color"
1706
- msgstr ""
1707
-
1708
- #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:1058
1709
- msgid ""
1710
- "No product is selected. Please select products from the checkout meta "
1711
- "settings to continue."
1712
- msgstr ""
1713
-
1714
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:70
1715
- msgid "Next Step Button"
1716
- msgstr ""
1717
-
1718
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:157
1719
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:291
1720
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:169
1721
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:156
1722
- msgid "General"
1723
- msgstr ""
1724
-
1725
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:164
1726
- msgid "Title"
1727
- msgstr ""
1728
-
1729
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:166
1730
- msgid "BUY NOW"
1731
- msgstr ""
1732
-
1733
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:176
1734
- msgid "Sub Title"
1735
- msgstr ""
1736
-
1737
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:187
1738
- msgid "Icon"
1739
- msgstr ""
1740
-
1741
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:195
1742
- msgid "Icon Position"
1743
- msgstr ""
1744
-
1745
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:199
1746
- msgid "Before Title"
1747
- msgstr ""
1748
-
1749
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:200
1750
- msgid "After Title"
1751
- msgstr ""
1752
-
1753
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:201
1754
- msgid "Before Title & Sub Title"
1755
- msgstr ""
1756
-
1757
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:202
1758
- msgid "After Title & Sub Title"
1759
- msgstr ""
1760
-
1761
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:213
1762
- msgid "Icon Vertical Alignment"
1763
- msgstr ""
1764
-
1765
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:219
1766
- msgid "Top"
1767
- msgstr ""
1768
-
1769
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:223
1770
- msgid "Middle"
1771
- msgstr ""
1772
-
1773
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:240
1774
- msgid "Icon Spacing"
1775
- msgstr ""
1776
-
1777
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:260
1778
- msgid "Icon Size"
1779
- msgstr ""
1780
-
1781
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:299
1782
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:298
1783
- msgid "Alignment"
1784
- msgstr ""
1785
-
1786
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:303
1787
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:476
1788
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:302
1789
- #: modules/optin/classes/class-cartflows-optin-meta.php:623
1790
- msgid "Left"
1791
- msgstr ""
1792
-
1793
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:307
1794
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:480
1795
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:306
1796
- #: modules/optin/classes/class-cartflows-optin-meta.php:624
1797
- msgid "Center"
1798
- msgstr ""
1799
-
1800
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:311
1801
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:484
1802
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:310
1803
- #: modules/optin/classes/class-cartflows-optin-meta.php:625
1804
- msgid "Right"
1805
- msgstr ""
1806
-
1807
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:315
1808
- msgid "Justify"
1809
- msgstr ""
1810
-
1811
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:327
1812
- msgid "Button Size"
1813
- msgstr ""
1814
-
1815
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:337
1816
- msgid "Padding"
1817
- msgstr ""
1818
-
1819
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:418
1820
- msgid "Hover Text Color"
1821
- msgstr ""
1822
-
1823
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:431
1824
- msgid "Hover Background Color"
1825
- msgstr ""
1826
-
1827
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:464
1828
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:540
1829
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:631
1830
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:720
1831
- msgid "Content"
1832
- msgstr ""
1833
-
1834
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:472
1835
- msgid "Text Alignment"
1836
- msgstr ""
1837
-
1838
- #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:525
1839
- msgid "Title and Sub Title Spacing"
1840
- msgstr ""
1841
-
1842
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:66
1843
- msgid "Optin Form"
1844
- msgstr ""
1845
-
1846
- #: modules/elementor/widgets/class-cartflows-el-optin-form.php:349
1847
- #: modules/optin/classes/class-cartflows-optin-meta.php:544
1848
- msgid "Submit Button"
1849
- msgstr ""
1850
-
1851
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:69
1852
- msgid "Order Details Form"
1853
- msgstr ""
1854
-
1855
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:163
1856
- msgid "Thank You Text"
1857
- msgstr ""
1858
-
1859
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:165
1860
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:176
1861
- #: woocommerce/template/checkout/thankyou.php:41
1862
- #: woocommerce/template/checkout/thankyou.php:86
1863
- msgid "Thank you. Your order has been received."
1864
- msgstr ""
1865
-
1866
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:173
1867
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:448
1868
- msgid "Order Overview"
1869
- msgstr ""
1870
-
1871
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:175
1872
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:187
1873
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:199
1874
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:211
1875
- msgid "Show"
1876
- msgstr ""
1877
-
1878
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:176
1879
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:188
1880
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:200
1881
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:212
1882
- msgid "Hide"
1883
- msgstr ""
1884
-
1885
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:185
1886
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:591
1887
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:284
1888
- msgid "Order Details"
1889
- msgstr ""
1890
-
1891
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:197
1892
- msgid "Billing Address"
1893
- msgstr ""
1894
-
1895
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:209
1896
- msgid "Shipping Address"
1897
- msgstr ""
1898
-
1899
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:233
1900
- msgid "Spacing"
1901
- msgstr ""
1902
-
1903
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:241
1904
- msgid "Heading Bottom Spacing"
1905
- msgstr ""
1906
-
1907
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:257
1908
- msgid "Spacing Between Sections"
1909
- msgstr ""
1910
-
1911
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:364
1912
- msgid "Sections Heading"
1913
- msgstr ""
1914
-
1915
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:393
1916
- msgid "Sections Content"
1917
- msgstr ""
1918
-
1919
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:501
1920
- msgid "Downloads"
1921
- msgstr ""
1922
-
1923
- #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:683
1924
- msgid "Customer Details"
1925
- msgstr ""
1926
-
1927
- #: modules/flow/classes/class-cartflows-flow-meta.php:265
1928
- #. translators: %s flow id
1929
- msgid "Step not deleted for flow - %s"
1930
- msgstr ""
1931
-
1932
- #: modules/flow/classes/class-cartflows-flow-meta.php:303
1933
- #. translators: %s flow id
1934
- msgid "Step deleted for flow - %s"
1935
- msgstr ""
1936
-
1937
- #: modules/flow/classes/class-cartflows-flow-meta.php:312
1938
- #. translators: %s flow id
1939
- msgid "This step can not be deleted."
1940
- msgstr ""
1941
-
1942
- #: modules/flow/classes/class-cartflows-flow-meta.php:344
1943
- #. translators: %s flow id
1944
- msgid "Steps not sorted for flow - %s"
1945
- msgstr ""
1946
-
1947
- #: modules/flow/classes/class-cartflows-flow-meta.php:380
1948
- #. translators: %s flow id
1949
- msgid "Steps sorted for flow - %s"
1950
- msgstr ""
1951
-
1952
- #: modules/flow/classes/class-cartflows-flow-meta.php:485
1953
- msgid "Analytics"
1954
- msgstr ""
1955
-
1956
- #: modules/flow/classes/class-cartflows-flow-meta.php:502
1957
- #. translators: %s: link
1958
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Analytics feature"
1959
- msgstr ""
1960
-
1961
- #: modules/flow/classes/class-cartflows-flow-meta.php:520
1962
- msgid "Flow Settings"
1963
- msgstr ""
1964
-
1965
- #: modules/flow/classes/class-cartflows-flow-meta.php:605
1966
- msgid "Enable Test Mode"
1967
- msgstr ""
1968
-
1969
- #: modules/flow/classes/class-cartflows-flow-meta.php:612
1970
- msgid ""
1971
- "If you are using WooCommerce plugin then test mode will add random products "
1972
- "in your flow, so you can preview it easily while testing."
1973
- msgstr ""
1974
-
1975
- #: modules/flow/classes/class-cartflows-flow-meta.php:732
1976
- #: modules/flow/view/meta-flow-steps.php:145
1977
- msgid "Add New Step"
1978
- msgstr ""
1979
-
1980
- #: modules/flow/classes/class-cartflows-flow-meta.php:802
1981
- #: modules/flow/classes/class-cartflows-step-post-type.php:166
1982
- msgid "View Step"
1983
- msgstr ""
1984
-
1985
- #: modules/flow/classes/class-cartflows-flow-meta.php:813
1986
- #: modules/flow/classes/class-cartflows-step-post-type.php:165
1987
- msgid "Edit Step"
1988
- msgstr ""
1989
-
1990
- #: modules/flow/classes/class-cartflows-flow-meta.php:815
1991
- msgid "Edit"
1992
- msgstr ""
1993
-
1994
- #: modules/flow/classes/class-cartflows-flow-meta.php:822
1995
- msgid "Clone Step"
1996
- msgstr ""
1997
-
1998
- #: modules/flow/classes/class-cartflows-flow-meta.php:833
1999
- msgid "Delete Step"
2000
- msgstr ""
2001
-
2002
- #: modules/flow/classes/class-cartflows-flow-meta.php:835
2003
- msgid "Delete"
2004
- msgstr ""
2005
-
2006
- #: modules/flow/classes/class-cartflows-flow-meta.php:844
2007
- #: modules/flow/classes/class-cartflows-flow-meta.php:846
2008
- msgid "A/B Test"
2009
- msgstr ""
2010
-
2011
- #: modules/flow/classes/class-cartflows-flow-post-type.php:69
2012
- msgid "Flow: "
2013
- msgstr ""
2014
-
2015
- #: modules/flow/classes/class-cartflows-flow-post-type.php:69
2016
- msgid "Name: "
2017
- msgstr ""
2018
-
2019
- #: modules/flow/classes/class-cartflows-flow-post-type.php:101
2020
- msgid "Search Flows"
2021
- msgstr ""
2022
-
2023
- #: modules/flow/classes/class-cartflows-flow-post-type.php:102
2024
- msgid "All Flows"
2025
- msgstr ""
2026
-
2027
- #: modules/flow/classes/class-cartflows-flow-post-type.php:103
2028
- msgid "Edit Flow"
2029
- msgstr ""
2030
-
2031
- #: modules/flow/classes/class-cartflows-flow-post-type.php:104
2032
- msgid "View Flow"
2033
- msgstr ""
2034
-
2035
- #: modules/flow/classes/class-cartflows-flow-post-type.php:105
2036
- #: modules/flow/classes/class-cartflows-flow-post-type.php:107
2037
- #: modules/flow/classes/class-cartflows-step-post-type.php:167
2038
- #: modules/flow/classes/class-cartflows-step-post-type.php:169
2039
- msgid "Add New"
2040
- msgstr ""
2041
-
2042
- #: modules/flow/classes/class-cartflows-flow-post-type.php:106
2043
- msgid "Update Flow"
2044
- msgstr ""
2045
-
2046
- #: modules/flow/classes/class-cartflows-flow-post-type.php:108
2047
- msgid "New Flow Name"
2048
- msgstr ""
2049
-
2050
- #: modules/flow/classes/class-cartflows-flow-post-type.php:190
2051
- msgid "Upgrade to CartFlows Pro"
2052
- msgstr ""
2053
-
2054
- #: modules/flow/classes/class-cartflows-flow-post-type.php:209
2055
- msgid "Slug"
2056
- msgstr ""
2057
-
2058
- #: modules/flow/classes/class-cartflows-flow-post-type.php:321
2059
- #: modules/flow/classes/class-cartflows-flow-post-type.php:322
2060
- msgid "Flows"
2061
- msgstr ""
2062
-
2063
- #: modules/flow/classes/class-cartflows-flow-post-type.php:344
2064
- #: modules/flow/classes/class-cartflows-flow-post-type.php:350
2065
- #: modules/flow/classes/class-cartflows-step-post-type.php:401
2066
- #: modules/flow/classes/class-cartflows-step-post-type.php:407
2067
- #. translators: %s: singular custom post type name
2068
- msgid "%s updated."
2069
- msgstr ""
2070
-
2071
- #: modules/flow/classes/class-cartflows-flow-post-type.php:346
2072
- #: modules/flow/classes/class-cartflows-step-post-type.php:403
2073
- #. translators: %s: singular custom post type name
2074
- msgid "Custom %s updated."
2075
- msgstr ""
2076
-
2077
- #: modules/flow/classes/class-cartflows-flow-post-type.php:348
2078
- #: modules/flow/classes/class-cartflows-step-post-type.php:405
2079
- #. translators: %s: singular custom post type name
2080
- msgid "Custom %s deleted."
2081
- msgstr ""
2082
-
2083
- #: modules/flow/classes/class-cartflows-flow-post-type.php:352
2084
- #: modules/flow/classes/class-cartflows-step-post-type.php:409
2085
- #. translators: %1$s: singular custom post type name ,%2$s: date and time of
2086
- #. the revision
2087
- msgid "%1$s restored to revision from %2$s"
2088
- msgstr ""
2089
-
2090
- #: modules/flow/classes/class-cartflows-flow-post-type.php:354
2091
- #: modules/flow/classes/class-cartflows-step-post-type.php:411
2092
- #. translators: %s: singular custom post type name
2093
- msgid "%s published."
2094
- msgstr ""
2095
-
2096
- #: modules/flow/classes/class-cartflows-flow-post-type.php:356
2097
- #: modules/flow/classes/class-cartflows-step-post-type.php:413
2098
- #. translators: %s: singular custom post type name
2099
- msgid "%s saved."
2100
- msgstr ""
2101
-
2102
- #: modules/flow/classes/class-cartflows-flow-post-type.php:358
2103
- #: modules/flow/classes/class-cartflows-step-post-type.php:415
2104
- #. translators: %s: singular custom post type name
2105
- msgid "%s submitted."
2106
- msgstr ""
2107
-
2108
- #: modules/flow/classes/class-cartflows-flow-post-type.php:360
2109
- #: modules/flow/classes/class-cartflows-step-post-type.php:417
2110
- #. translators: %s: singular custom post type name
2111
- msgid "%s scheduled for."
2112
- msgstr ""
2113
-
2114
- #: modules/flow/classes/class-cartflows-flow-post-type.php:362
2115
- #: modules/flow/classes/class-cartflows-step-post-type.php:419
2116
- #. translators: %s: singular custom post type name
2117
- msgid "%s draft updated."
2118
- msgstr ""
2119
-
2120
- #: modules/flow/classes/class-cartflows-flow-shortcodes.php:148
2121
- #: modules/widgets/class-cartflows-next-step.php:78
2122
- msgid "Next Step"
2123
- msgstr ""
2124
-
2125
- #: modules/flow/classes/class-cartflows-step-post-type.php:163
2126
- msgid "Search Steps"
2127
- msgstr ""
2128
-
2129
- #: modules/flow/classes/class-cartflows-step-post-type.php:164
2130
- msgid "All Steps"
2131
- msgstr ""
2132
-
2133
- #: modules/flow/classes/class-cartflows-step-post-type.php:168
2134
- msgid "Update Step"
2135
- msgstr ""
2136
-
2137
- #: modules/flow/classes/class-cartflows-step-post-type.php:170
2138
- msgid "New Step Name"
2139
- msgstr ""
2140
-
2141
- #: modules/flow/classes/class-cartflows-step-post-type.php:211
2142
- msgid "Step Type"
2143
- msgstr ""
2144
-
2145
- #: modules/flow/classes/class-cartflows-step-post-type.php:221
2146
- msgid "Step Flow"
2147
- msgstr ""
2148
-
2149
- #: modules/flow/classes/class-cartflows-step-post-type.php:246
2150
- #: modules/flow/view/meta-flow-steps.php:16
2151
- msgid "Optin (Woo)"
2152
- msgstr ""
2153
-
2154
- #: modules/flow/classes/class-cartflows-step-post-type.php:267
2155
- #: modules/flow/view/meta-flow-steps.php:14
2156
- msgid "Upsell (Woo)"
2157
- msgstr ""
2158
-
2159
- #: modules/flow/classes/class-cartflows-step-post-type.php:274
2160
- #: modules/flow/view/meta-flow-steps.php:15
2161
- msgid "Downsell (Woo)"
2162
- msgstr ""
2163
-
2164
- #: modules/flow/view/view-flow-inner-step.php:30
2165
- msgid "Control"
2166
- msgstr ""
2167
-
2168
- #: modules/flow/view/view-flow-inner-step.php:32
2169
- #. translators: %s badge count
2170
- msgid "Variation-%s"
2171
- msgstr ""
2172
-
2173
- #: modules/flow/view/view-flow-inner-step.php:44
2174
- msgid "No Product Assigned"
2175
- msgstr ""
2176
-
2177
- #: modules/flow/view/view-flow-inner-step.php:48
2178
- msgid "Global Checkout - Remove selected checkout product"
2179
- msgstr ""
2180
-
2181
- #: modules/flow/view/view-remote-importer.php:19
2182
- msgid "Steps Library"
2183
- msgstr ""
2184
-
2185
- #: modules/flow/view/view-remote-importer.php:68
2186
- msgid "Create Step"
2187
- msgstr ""
2188
-
2189
- #: modules/flow/view/view-remote-importer.php:70
2190
- msgid "You need a Cartflows Pro version to import Upsell / Downsell"
2191
- msgstr ""
2192
-
2193
- #: modules/landing/classes/class-cartflows-landing-meta.php:66
2194
- msgid "Landing Page Settings"
2195
- msgstr ""
2196
-
2197
- #: modules/landing/classes/class-cartflows-landing-meta.php:171
2198
- msgid "Next Step Link"
2199
- msgstr ""
2200
-
2201
- #: modules/optin/classes/class-cartflows-optin-markup.php:198
2202
- msgid "Please place shortcode on Optin step-type only."
2203
- msgstr ""
2204
-
2205
- #: modules/optin/classes/class-cartflows-optin-markup.php:258
2206
- msgid ""
2207
- "No product is selected. Please select a Simple, Virtual and Free product "
2208
- "from the meta settings."
2209
- msgstr ""
2210
-
2211
- #: modules/optin/classes/class-cartflows-optin-markup.php:275
2212
- msgid "Please update the selected product's price to zero (0)."
2213
- msgstr ""
2214
-
2215
- #: modules/optin/classes/class-cartflows-optin-markup.php:284
2216
- #: modules/optin/classes/class-cartflows-optin-markup.php:288
2217
- msgid "Please select a Simple, Virtual and Free product."
2218
- msgstr ""
2219
-
2220
- #: modules/optin/classes/class-cartflows-optin-meta.php:94
2221
- msgid "Optin Settings"
2222
- msgstr ""
2223
-
2224
- #: modules/optin/classes/class-cartflows-optin-meta.php:103
2225
- msgid "Optin Design"
2226
- msgstr ""
2227
-
2228
- #: modules/optin/classes/class-cartflows-optin-meta.php:145
2229
- msgid "Form Fields"
2230
- msgstr ""
2231
-
2232
- #: modules/optin/classes/class-cartflows-optin-meta.php:226
2233
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:250
2234
- msgid "Design"
2235
- msgstr ""
2236
-
2237
- #: modules/optin/classes/class-cartflows-optin-meta.php:277
2238
- msgid "Add this shortcode to your optin page"
2239
- msgstr ""
2240
-
2241
- #: modules/optin/classes/class-cartflows-optin-meta.php:302
2242
- msgid "Select Free Product"
2243
- msgstr ""
2244
-
2245
- #: modules/optin/classes/class-cartflows-optin-meta.php:303
2246
- msgid "Select Free and Virtual product only."
2247
- msgstr ""
2248
-
2249
- #: modules/optin/classes/class-cartflows-optin-meta.php:357
2250
- msgid "Pass Fields as URL Parameters"
2251
- msgstr ""
2252
-
2253
- #: modules/optin/classes/class-cartflows-optin-meta.php:360
2254
- msgid "Enable"
2255
- msgstr ""
2256
-
2257
- #: modules/optin/classes/class-cartflows-optin-meta.php:361
2258
- msgid ""
2259
- "You can pass specific fields from the form to next step as URL query "
2260
- "parameters."
2261
- msgstr ""
2262
-
2263
- #: modules/optin/classes/class-cartflows-optin-meta.php:372
2264
- msgid "Enter form field"
2265
- msgstr ""
2266
-
2267
- #: modules/optin/classes/class-cartflows-optin-meta.php:375
2268
- #: modules/optin/classes/class-cartflows-optin-meta.php:385
2269
- msgid "Enter comma seprated field name. E.g. first_name, last_name"
2270
- msgstr ""
2271
-
2272
- #: modules/optin/classes/class-cartflows-optin-meta.php:377
2273
- msgid "Fields to pass, separated by commas"
2274
- msgstr ""
2275
-
2276
- #: modules/optin/classes/class-cartflows-optin-meta.php:387
2277
- #. translators: %s: link
2278
- msgid ""
2279
- "You can pass field value as a URL parameter to the next step. %1$sClick "
2280
- "here%2$s for more information."
2281
- msgstr ""
2282
-
2283
- #: modules/optin/classes/class-cartflows-optin-meta.php:550
2284
- msgid "Button Text"
2285
- msgstr ""
2286
-
2287
- #: modules/optin/classes/class-cartflows-optin-meta.php:561
2288
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:319
2289
- msgid "Font Size"
2290
- msgstr ""
2291
-
2292
- #: modules/optin/classes/class-cartflows-optin-meta.php:619
2293
- msgid "Position"
2294
- msgstr ""
2295
-
2296
- #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:127
2297
- msgid "No completed or processing order found to show the order details form demo."
2298
- msgstr ""
2299
-
2300
- #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:131
2301
- msgid "Order not found. You cannot access this page directly."
2302
- msgstr ""
2303
-
2304
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:95
2305
- msgid "Thank You Settings"
2306
- msgstr ""
2307
-
2308
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:104
2309
- msgid "Thank You Design"
2310
- msgstr ""
2311
-
2312
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:172
2313
- msgid "Thank You Page Text"
2314
- msgstr ""
2315
-
2316
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:178
2317
- msgid "It will change the default text on thank you page."
2318
- msgstr ""
2319
-
2320
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:186
2321
- msgid "Redirect After Purchase"
2322
- msgstr ""
2323
-
2324
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:195
2325
- msgid "Redirect Link"
2326
- msgstr ""
2327
-
2328
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:199
2329
- msgid "https://"
2330
- msgstr ""
2331
-
2332
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:256
2333
- msgid "Edit Fields"
2334
- msgstr ""
2335
-
2336
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:296
2337
- msgid "Text"
2338
- msgstr ""
2339
-
2340
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:359
2341
- msgid "Advanced Options"
2342
- msgstr ""
2343
-
2344
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:369
2345
- msgid "Container Width (In px)"
2346
- msgstr ""
2347
-
2348
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:391
2349
- msgid "Enable Order Overview "
2350
- msgstr ""
2351
-
2352
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:399
2353
- msgid "Enable Order Details "
2354
- msgstr ""
2355
-
2356
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:407
2357
- msgid "Enable Billing Details "
2358
- msgstr ""
2359
-
2360
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:415
2361
- msgid "Enable Shipping Details "
2362
- msgstr ""
2363
-
2364
- #: modules/widgets/class-cartflows-next-step.php:24
2365
- msgid "CartFlows Next Step"
2366
- msgstr ""
2367
-
2368
- #: modules/widgets/class-cartflows-next-step.php:26
2369
- msgid "Next Step Widgets"
2370
- msgstr ""
2371
-
2372
- #: modules/widgets/class-cartflows-next-step.php:106
2373
- msgid "New title"
2374
- msgstr ""
2375
-
2376
- #: modules/widgets/class-cartflows-next-step.php:123
2377
- msgid "Title:"
2378
- msgstr ""
2379
-
2380
- #: modules/widgets/class-cartflows-next-step.php:127
2381
- msgid "Flow ID:"
2382
- msgstr ""
2383
-
2384
- #: modules/widgets/class-cartflows-next-step.php:131
2385
- msgid "Step ID:"
2386
- msgstr ""
2387
-
2388
- #: woocommerce/template/cart/cart-shipping.php:51
2389
- #. Translators: $s shipping destination.
2390
- msgid "Estimate for %s."
2391
- msgstr ""
2392
-
2393
- #: woocommerce/template/cart/cart-shipping.php:52
2394
- msgid "Change address"
2395
- msgstr ""
2396
-
2397
- #: woocommerce/template/cart/cart-shipping.php:54
2398
- msgid "This is only an estimate. Prices will be updated during checkout."
2399
- msgstr ""
2400
-
2401
- #: woocommerce/template/cart/cart-shipping.php:61
2402
- msgid "Enter your address to view shipping options."
2403
- msgstr ""
2404
-
2405
- #: woocommerce/template/cart/cart-shipping.php:63
2406
- msgid ""
2407
- "There are no shipping methods available. Please ensure that your address "
2408
- "has been entered correctly, or contact us if you need any help."
2409
- msgstr ""
2410
-
2411
- #: woocommerce/template/cart/cart-shipping.php:66
2412
- #. Translators: $s shipping destination.
2413
- msgid "No shipping options were found for %s."
2414
- msgstr ""
2415
-
2416
- #: woocommerce/template/cart/cart-shipping.php:67
2417
- msgid "Enter a different address"
2418
- msgstr ""
2419
-
2420
- #: woocommerce/template/checkout/form-billing.php:27
2421
- msgid "Billing &amp; Shipping"
2422
- msgstr ""
2423
-
2424
- #: woocommerce/template/checkout/form-billing.php:31
2425
- msgid "Billing details"
2426
- msgstr ""
2427
-
2428
- #: woocommerce/template/checkout/form-billing.php:59
2429
- msgid "Create an account?"
2430
- msgstr ""
2431
-
2432
- #: woocommerce/template/checkout/form-checkout.php:26
2433
- msgid "You must be logged in to checkout."
2434
- msgstr ""
2435
-
2436
- #: woocommerce/template/checkout/form-coupon.php:26
2437
- msgid "Have a coupon?"
2438
- msgstr ""
2439
-
2440
- #: woocommerce/template/checkout/form-coupon.php:26
2441
- msgid "Click here to enter your code"
2442
- msgstr ""
2443
-
2444
- #: woocommerce/template/checkout/form-coupon.php:31
2445
- msgid "If you have a coupon code, please apply it below."
2446
- msgstr ""
2447
-
2448
- #: woocommerce/template/checkout/form-coupon.php:34
2449
- msgid "Coupon code"
2450
- msgstr ""
2451
-
2452
- #: woocommerce/template/checkout/form-coupon.php:38
2453
- msgid "Apply coupon"
2454
- msgstr ""
2455
-
2456
- #: woocommerce/template/checkout/form-login.php:26
2457
- msgid "Returning customer?"
2458
- msgstr ""
2459
-
2460
- #: woocommerce/template/checkout/form-login.php:26
2461
- msgid "Click here to login"
2462
- msgstr ""
2463
-
2464
- #: woocommerce/template/checkout/form-login.php:32
2465
- msgid ""
2466
- "If you have shopped with us before, please enter your details below. If you "
2467
- "are a new customer, please proceed to the Billing &amp; Shipping section."
2468
- msgstr ""
2469
-
2470
- #: woocommerce/template/checkout/form-shipping.php:26
2471
- msgid "Ship to a different address?"
2472
- msgstr ""
2473
-
2474
- #: woocommerce/template/checkout/form-shipping.php:57
2475
- msgid "Additional information"
2476
- msgstr ""
2477
-
2478
- #: woocommerce/template/checkout/payment.php:33
2479
- msgid ""
2480
- "Sorry, it seems that there are no available payment methods for your state. "
2481
- "Please contact us if you require assistance or wish to make alternate "
2482
- "arrangements."
2483
- msgstr ""
2484
-
2485
- #: woocommerce/template/checkout/payment.php:33
2486
- msgid "Please fill in your details above to see available payment methods."
2487
- msgstr ""
2488
-
2489
- #: woocommerce/template/checkout/payment.php:42
2490
- #. translators: $1 and $2 opening and closing emphasis tags respectively
2491
- msgid ""
2492
- "Since your browser does not support JavaScript, or it is disabled, please "
2493
- "ensure you click the %1$sUpdate Totals%2$s button before placing your "
2494
- "order. You may be charged more than the amount stated above if you fail to "
2495
- "do so."
2496
- msgstr ""
2497
-
2498
- #: woocommerce/template/checkout/payment.php:44
2499
- msgid "Update totals"
2500
- msgstr ""
2501
-
2502
- #: woocommerce/template/checkout/review-order.php:26
2503
- #: woocommerce/template/order/order-details.php:57
2504
- msgid "Product"
2505
- msgstr ""
2506
-
2507
- #: woocommerce/template/checkout/review-order.php:27
2508
- #: woocommerce/template/checkout/review-order.php:107
2509
- #: woocommerce/template/order/order-details.php:58
2510
- msgid "Total"
2511
- msgstr ""
2512
-
2513
- #: woocommerce/template/checkout/review-order.php:60
2514
- msgid "Subtotal"
2515
- msgstr ""
2516
-
2517
- #: woocommerce/template/checkout/thankyou.php:30
2518
- msgid ""
2519
- "Unfortunately your order cannot be processed as the originating "
2520
- "bank/merchant has declined your transaction. Please attempt your purchase "
2521
- "again."
2522
- msgstr ""
2523
-
2524
- #: woocommerce/template/checkout/thankyou.php:33
2525
- msgid "Pay"
2526
- msgstr ""
2527
-
2528
- #: woocommerce/template/checkout/thankyou.php:35
2529
- msgid "My account"
2530
- msgstr ""
2531
-
2532
- #: woocommerce/template/checkout/thankyou.php:49
2533
- msgid "Order number:"
2534
- msgstr ""
2535
-
2536
- #: woocommerce/template/checkout/thankyou.php:54
2537
- msgid "Date:"
2538
- msgstr ""
2539
-
2540
- #: woocommerce/template/checkout/thankyou.php:60
2541
- msgid "Email:"
2542
- msgstr ""
2543
-
2544
- #: woocommerce/template/checkout/thankyou.php:67
2545
- msgid "Total:"
2546
- msgstr ""
2547
-
2548
- #: woocommerce/template/checkout/thankyou.php:74
2549
- msgid "Payment method:"
2550
- msgstr ""
2551
-
2552
- #: woocommerce/template/global/form-login.php:34
2553
- msgid "Username or email"
2554
- msgstr ""
2555
-
2556
- #: woocommerce/template/global/form-login.php:38
2557
- msgid "Password"
2558
- msgstr ""
2559
-
2560
- #: woocommerce/template/global/form-login.php:48
2561
- msgid "Login"
2562
- msgstr ""
2563
-
2564
- #: woocommerce/template/global/form-login.php:53
2565
- msgid "Remember me"
2566
- msgstr ""
2567
-
2568
- #: woocommerce/template/global/form-login.php:57
2569
- msgid "Lost your password?"
2570
- msgstr ""
2571
-
2572
- #: woocommerce/template/order/order-details.php:51
2573
- msgid "Order details"
2574
- msgstr ""
2575
-
2576
- #: woocommerce/template/order/order-details.php:99
2577
- msgid "Note:"
2578
- msgstr ""
2579
-
2580
- #. Plugin Name of the plugin/theme
2581
- msgid "CartFlows"
2582
- msgstr ""
2583
-
2584
- #. Author URI of the plugin/theme
2585
- msgid "https://cartflows.com/"
2586
- msgstr ""
2587
-
2588
- #. Description of the plugin/theme
2589
- msgid "Create beautiful checkout pages & sales flows for WooCommerce."
2590
- msgstr ""
2591
-
2592
- #. Author of the plugin/theme
2593
- msgid "CartFlows Inc"
2594
- msgstr ""
2595
-
2596
- #: modules/flow/classes/class-cartflows-flow-post-type.php:99
2597
- msgctxt "flow general name"
2598
- msgid "Flows"
2599
- msgstr ""
2600
-
2601
- #: modules/flow/classes/class-cartflows-flow-post-type.php:100
2602
- msgctxt "flow singular name"
2603
- msgid "Flow"
2604
- msgstr ""
2605
-
2606
- #: modules/flow/classes/class-cartflows-step-post-type.php:161
2607
- msgctxt "flow step general name"
2608
- msgid "Steps"
2609
- msgstr ""
2610
-
2611
- #: modules/flow/classes/class-cartflows-step-post-type.php:162
2612
- msgctxt "flow step singular name"
2613
- msgid "Step"
2614
- msgstr ""
2615
-
2616
- #: modules/flow/classes/class-cartflows-step-post-type.php:315
2617
- msgctxt "cartflows"
2618
- msgid "CartFlows — Boxed"
2619
- msgstr ""
2620
-
2621
- #: modules/flow/classes/class-cartflows-step-post-type.php:316
2622
- msgctxt "cartflows"
2623
- msgid "Template for Page Builders"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2624
  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.5.19\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
+ "POT-Creation-Date: 2020-10-13 07:00:12+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
+ #: admin/bsf-analytics/class-bsf-analytics.php:211
28
+ #. translators: %s product name
29
+ msgid ""
30
+ "Want to help make <strong>%1s</strong> even more awesome? Allow us to "
31
+ "collect non-sensitive diagnostic data and usage information. "
32
+ msgstr ""
33
+
34
+ #: admin/bsf-analytics/class-bsf-analytics.php:214
35
+ msgid "This will be applicable for all sites from the network."
36
+ msgstr ""
37
+
38
+ #: admin/bsf-analytics/class-bsf-analytics.php:238
39
+ #. translators: %s usage doc link
40
+ msgid " Know More."
41
+ msgstr ""
42
+
43
+ #: admin/bsf-analytics/class-bsf-analytics.php:246
44
+ msgid "Yes! Allow it"
45
+ msgstr ""
46
+
47
+ #: admin/bsf-analytics/class-bsf-analytics.php:255
48
+ msgid "No Thanks"
49
+ msgstr ""
50
+
51
+ #: admin/bsf-analytics/class-bsf-analytics.php:359
52
+ msgid "Usage Tracking"
53
+ msgstr ""
54
+
55
+ #: admin/bsf-analytics/class-bsf-analytics.php:403
56
+ #. translators: %s Product title
57
+ msgid "Allow %s products to track non-sensitive usage tracking data."
58
+ msgstr ""
59
+
60
+ #: admin/bsf-analytics/class-bsf-analytics.php:406
61
+ msgid " This will be applicable for all sites from the network."
62
+ msgstr ""
63
+
64
+ #: admin/bsf-analytics/class-bsf-analytics.php:411
65
+ msgid "Learn More."
66
+ msgstr ""
67
+
68
+ #: classes/batch-process/class-cartflows-importer-elementor.php:44
69
+ msgid "Invalid content."
70
+ msgstr ""
71
+
72
+ #: classes/batch-process/class-cartflows-importer-elementor.php:56
73
+ msgid "Invalid content. Expected an array."
74
+ msgstr ""
75
+
76
+ #: classes/batch-process/helpers/class-wp-background-process.php:435
77
+ msgid "Every %d Minutes"
78
+ msgstr ""
79
+
80
+ #: classes/class-cartflows-admin-fields.php:241
81
+ msgid "Select"
82
+ msgstr ""
83
+
84
+ #: classes/class-cartflows-admin-fields.php:244
85
+ msgid "No Checkout Steps"
86
+ msgstr ""
87
+
88
+ #: classes/class-cartflows-admin-fields.php:270
89
+ #. translators: %s: link
90
+ msgid ""
91
+ "Be sure not to add any product in above selected Global Checkout step. "
92
+ "Please read information about how to set up Global Checkout %1$shere%2$s."
93
+ msgstr ""
94
+
95
+ #: classes/class-cartflows-admin.php:186 includes/admin/cartflows-home.php:11
96
+ msgid "Home"
97
+ msgstr ""
98
+
99
+ #: classes/class-cartflows-admin.php:191 classes/class-cartflows-admin.php:192
100
+ #: modules/optin/classes/class-cartflows-optin-meta.php:151
101
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:140
102
+ msgid "Settings"
103
+ msgstr ""
104
+
105
+ #: classes/class-cartflows-admin.php:487
106
+ msgid "This page requires WooCommerce plugin installed and activated!"
107
+ msgstr ""
108
+
109
+ #: classes/class-cartflows-admin.php:490
110
+ msgid "Installing and activating.."
111
+ msgstr ""
112
+
113
+ #: classes/class-cartflows-admin.php:491
114
+ msgid "There was an error with the installation of plugin."
115
+ msgstr ""
116
+
117
+ #: classes/class-cartflows-admin.php:553
118
+ msgid "Flows Library"
119
+ msgstr ""
120
+
121
+ #: classes/class-cartflows-admin.php:560
122
+ #: modules/flow/view/view-remote-importer.php:26
123
+ msgid "Ready Templates"
124
+ msgstr ""
125
+
126
+ #: classes/class-cartflows-admin.php:563
127
+ #: modules/flow/view/view-remote-importer.php:29
128
+ msgid "Create Your Own"
129
+ msgstr ""
130
+
131
+ #: classes/class-cartflows-admin.php:574
132
+ #: modules/flow/view/view-remote-importer.php:41
133
+ msgid "Search Sites"
134
+ msgstr ""
135
+
136
+ #: classes/class-cartflows-admin.php:575
137
+ #: modules/flow/view/view-remote-importer.php:42
138
+ msgid "Search Flow..."
139
+ msgstr ""
140
+
141
+ #: classes/class-cartflows-admin.php:592
142
+ msgid "Design Your Flow"
143
+ msgstr ""
144
+
145
+ #: classes/class-cartflows-admin.php:593
146
+ #: classes/class-cartflows-importer.php:665
147
+ #: classes/class-cartflows-importer.php:764
148
+ #: modules/flow/view/view-remote-importer.php:72
149
+ msgid "Learn How"
150
+ msgstr ""
151
+
152
+ #: classes/class-cartflows-api.php:369
153
+ msgid "Request successfully processed!"
154
+ msgstr ""
155
+
156
+ #: classes/class-cartflows-cloning.php:284
157
+ #. translators: %s flow id
158
+ msgid "Can't clone this step - %1$s. Flow - %2$s"
159
+ msgstr ""
160
+
161
+ #: classes/class-cartflows-cloning.php:401
162
+ #. translators: %s flow id
163
+ msgid "Step - %1$s cloned. Flow - %2$s"
164
+ msgstr ""
165
+
166
+ #: classes/class-cartflows-cloning.php:427
167
+ msgid "Clone this flow"
168
+ msgstr ""
169
+
170
+ #: classes/class-cartflows-cloning.php:427
171
+ #: modules/flow/classes/class-cartflows-flow-meta.php:824
172
+ msgid "Clone"
173
+ msgstr ""
174
+
175
+ #: classes/class-cartflows-default-meta.php:735
176
+ #: modules/optin/classes/class-cartflows-optin-meta.php:554
177
+ msgid "Submit"
178
+ msgstr ""
179
+
180
+ #: classes/class-cartflows-flow-frontend.php:53
181
+ msgid ""
182
+ "Test mode is active — which displays random products for previewing. It can "
183
+ "be deactivated from the flow settings in the admin dashboard."
184
+ msgstr ""
185
+
186
+ #: classes/class-cartflows-flow-frontend.php:58
187
+ msgid "Click here to disable it"
188
+ msgstr ""
189
+
190
+ #: classes/class-cartflows-functions.php:573
191
+ #. translators: %1$s page builder name "string"
192
+ msgid ""
193
+ "We have introduced %1$1s widgets for CartFlows shortcodes. Now, you can "
194
+ "add/change/update design settings directly from the page builder as well."
195
+ msgstr ""
196
+
197
+ #: classes/class-cartflows-functions.php:574
198
+ msgid "Learn More »"
199
+ msgstr ""
200
+
201
+ #: classes/class-cartflows-importer.php:81
202
+ msgid "Export this flow"
203
+ msgstr ""
204
+
205
+ #: classes/class-cartflows-importer.php:81 includes/exporter.php:18
206
+ msgid "Export"
207
+ msgstr ""
208
+
209
+ #: classes/class-cartflows-importer.php:92
210
+ msgid "Flow Export"
211
+ msgstr ""
212
+
213
+ #: classes/class-cartflows-importer.php:93
214
+ msgid "Flow Import"
215
+ msgstr ""
216
+
217
+ #: classes/class-cartflows-importer.php:104
218
+ msgid "No post to export has been supplied!"
219
+ msgstr ""
220
+
221
+ #: classes/class-cartflows-importer.php:278
222
+ msgid "Please upload a valid .json file"
223
+ msgstr ""
224
+
225
+ #: classes/class-cartflows-importer.php:284
226
+ msgid "Please upload a file to import"
227
+ msgstr ""
228
+
229
+ #: classes/class-cartflows-importer.php:506
230
+ msgid "Successfully imported flows."
231
+ msgstr ""
232
+
233
+ #: classes/class-cartflows-importer.php:538
234
+ msgid "Loading Steps"
235
+ msgstr ""
236
+
237
+ #: classes/class-cartflows-importer.php:540
238
+ msgid "Getting steps from the cloud. Please wait for the moment."
239
+ msgstr ""
240
+
241
+ #: classes/class-cartflows-importer.php:551
242
+ msgid "Searching Template.."
243
+ msgstr ""
244
+
245
+ #: classes/class-cartflows-importer.php:553
246
+ msgid "Getting templates from the cloud. Please wait for the moment."
247
+ msgstr ""
248
+
249
+ #: classes/class-cartflows-importer.php:562
250
+ msgid "Importing.."
251
+ msgstr ""
252
+
253
+ #: classes/class-cartflows-importer.php:571
254
+ #: classes/class-cartflows-importer.php:611
255
+ msgid "Imported"
256
+ msgstr ""
257
+
258
+ #: classes/class-cartflows-importer.php:572
259
+ #: classes/class-cartflows-importer.php:612
260
+ msgid "Thanks for patience"
261
+ msgstr ""
262
+
263
+ #: classes/class-cartflows-importer.php:581
264
+ #: classes/class-cartflows-importer.php:593
265
+ msgid "Coming Soon!"
266
+ msgstr ""
267
+
268
+ #: classes/class-cartflows-importer.php:612
269
+ msgid "Redirecting to the Elementor edit window."
270
+ msgstr ""
271
+
272
+ #: classes/class-cartflows-importer.php:658
273
+ #: classes/class-cartflows-importer.php:774
274
+ msgid "Pro"
275
+ msgstr ""
276
+
277
+ #: classes/class-cartflows-importer.php:699
278
+ #: classes/class-cartflows-importer.php:806
279
+ msgid "Activate License"
280
+ msgstr ""
281
+
282
+ #: classes/class-cartflows-importer.php:701
283
+ #: classes/class-cartflows-importer.php:808
284
+ #: modules/flow/classes/class-cartflows-flow-meta.php:503
285
+ msgid "Get Pro"
286
+ msgstr ""
287
+
288
+ #: classes/class-cartflows-importer.php:726
289
+ msgid "Create"
290
+ msgstr ""
291
+
292
+ #: classes/class-cartflows-importer.php:825
293
+ msgid "Under Maintenance.."
294
+ msgstr ""
295
+
296
+ #: classes/class-cartflows-importer.php:826
297
+ msgid ""
298
+ "If you are seeing this message, most likely our servers are under routine "
299
+ "maintenance and we will be back shortly."
300
+ msgstr ""
301
+
302
+ #: classes/class-cartflows-importer.php:827
303
+ msgid ""
304
+ "In rare case, it is possible your website is having trouble connecting with "
305
+ "ours. If you need help, please feel free to get in touch with us from our "
306
+ "website.."
307
+ msgstr ""
308
+
309
+ #: classes/class-cartflows-importer.php:857
310
+ #. translators: %s: Plugin string
311
+ msgid ""
312
+ "%1$s to see CartFlows templates. If you prefer another page builder tool, "
313
+ "you can <a href=\"%2$s\" target=\"blank\">select it here</a>."
314
+ msgstr ""
315
+
316
+ #: classes/class-cartflows-importer.php:872
317
+ msgid "All"
318
+ msgstr ""
319
+
320
+ #: classes/class-cartflows-importer.php:875
321
+ msgid "Select Step Type"
322
+ msgstr ""
323
+
324
+ #: classes/class-cartflows-importer.php:959
325
+ msgid "Import from Cloud"
326
+ msgstr ""
327
+
328
+ #: classes/class-cartflows-importer.php:1267
329
+ msgid "Sales Landing"
330
+ msgstr ""
331
+
332
+ #: classes/class-cartflows-importer.php:1271
333
+ #: modules/flow/classes/class-cartflows-step-post-type.php:253
334
+ #: modules/flow/view/meta-flow-steps.php:12
335
+ msgid "Checkout (Woo)"
336
+ msgstr ""
337
+
338
+ #: classes/class-cartflows-importer.php:1275
339
+ #: modules/flow/classes/class-cartflows-step-post-type.php:260
340
+ #: modules/flow/view/meta-flow-steps.php:13
341
+ msgid "Thank You (Woo)"
342
+ msgstr ""
343
+
344
+ #: classes/class-cartflows-importer.php:1283
345
+ #: modules/flow/classes/class-cartflows-step-post-type.php:239
346
+ #: modules/flow/view/meta-flow-steps.php:11
347
+ msgid "Landing"
348
+ msgstr ""
349
+
350
+ #: classes/class-cartflows-importer.php:1287
351
+ msgid "Thank You"
352
+ msgstr ""
353
+
354
+ #: classes/class-cartflows-importer.php:1397
355
+ #. translators: %s: template ID
356
+ msgid "Invalid template id %1$s or post id %2$s."
357
+ msgstr ""
358
+
359
+ #: classes/class-cartflows-importer.php:1472
360
+ #. translators: %s: flow ID
361
+ msgid "Invalid flow id %1$s OR step type %2$s."
362
+ msgstr ""
363
+
364
+ #: classes/class-cartflows-importer.php:1597
365
+ msgid ""
366
+ "Elementor is not activated. Please activate plugin Elementor Page Builder "
367
+ "to import the step."
368
+ msgstr ""
369
+
370
+ #: classes/class-cartflows-importer.php:1700
371
+ msgid "Action failed. Invalid Security Nonce."
372
+ msgstr ""
373
+
374
+ #: classes/class-cartflows-importer.php:1707
375
+ msgid "User have not plugin install permissions."
376
+ msgstr ""
377
+
378
+ #: classes/class-cartflows-importer.php:1729
379
+ msgid "Plugin Successfully Activated"
380
+ msgstr ""
381
+
382
+ #: classes/class-cartflows-learndash-compatibility.php:86
383
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:329
384
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:521
385
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:208
386
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:237
387
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:192
388
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:338
389
+ msgid "None"
390
+ msgstr ""
391
+
392
+ #: classes/class-cartflows-learndash-compatibility.php:113
393
+ #. translators: 1: anchor start, 2: anchor close
394
+ msgid ""
395
+ "Non-enrolled students will redirect to the selected CartFlows template. If "
396
+ "you have not created any Flow already, add new Flow from %1$shere%2$s."
397
+ msgstr ""
398
+
399
+ #: classes/class-cartflows-learndash-compatibility.php:119
400
+ msgid "Select CartFlows Template for this Course"
401
+ msgstr ""
402
+
403
+ #: classes/class-cartflows-loader.php:233
404
+ #. translators: %s: html tags
405
+ msgid ""
406
+ "You are using an older version of %1$sCartFlows Pro%2$s. Please update "
407
+ "%1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher."
408
+ msgstr ""
409
+
410
+ #: classes/class-cartflows-loader.php:515
411
+ #. translators: %s: html tags
412
+ msgid ""
413
+ "This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & "
414
+ "activated."
415
+ msgstr ""
416
+
417
+ #: classes/class-cartflows-loader.php:525
418
+ msgid "Activate WooCommerce"
419
+ msgstr ""
420
+
421
+ #: classes/class-cartflows-loader.php:533
422
+ msgid "Install WooCommerce"
423
+ msgstr ""
424
+
425
+ #: classes/class-cartflows-logger.php:161
426
+ msgid "Action failed. Please refresh the page and retry."
427
+ msgstr ""
428
+
429
+ #: classes/class-cartflows-meta-fields.php:61
430
+ msgid "Thin 100"
431
+ msgstr ""
432
+
433
+ #: classes/class-cartflows-meta-fields.php:62
434
+ msgid "Extra-Light 200"
435
+ msgstr ""
436
+
437
+ #: classes/class-cartflows-meta-fields.php:63
438
+ msgid "Light 300"
439
+ msgstr ""
440
+
441
+ #: classes/class-cartflows-meta-fields.php:64
442
+ msgid "Normal 400"
443
+ msgstr ""
444
+
445
+ #: classes/class-cartflows-meta-fields.php:65
446
+ msgid "Medium 500"
447
+ msgstr ""
448
+
449
+ #: classes/class-cartflows-meta-fields.php:66
450
+ msgid "Semi-Bold 600"
451
+ msgstr ""
452
+
453
+ #: classes/class-cartflows-meta-fields.php:67
454
+ msgid "Bold 700"
455
+ msgstr ""
456
+
457
+ #: classes/class-cartflows-meta-fields.php:68
458
+ msgid "Extra-Bold 800"
459
+ msgstr ""
460
+
461
+ #: classes/class-cartflows-meta-fields.php:69
462
+ msgid "Ultra-Bold 900"
463
+ msgstr ""
464
+
465
+ #: classes/class-cartflows-meta-fields.php:182
466
+ #. Translators: %d stock amount
467
+ msgid "Stock: %d"
468
+ msgstr ""
469
+
470
+ #: classes/class-cartflows-meta-fields.php:765
471
+ #: includes/meta-fields/generate-product-repeater.php:30
472
+ msgid "Search for a product&hellip;"
473
+ msgstr ""
474
+
475
+ #: classes/class-cartflows-meta-fields.php:816
476
+ msgid "Search for a coupon&hellip;"
477
+ msgstr ""
478
+
479
+ #: classes/class-cartflows-meta.php:34
480
+ msgid "Update"
481
+ msgstr ""
482
+
483
+ #: classes/class-cartflows-meta.php:42
484
+ #: modules/flow/classes/class-cartflows-flow-meta.php:95
485
+ #: modules/flow/classes/class-cartflows-flow-meta.php:763
486
+ msgid "Back to edit Flow"
487
+ msgstr ""
488
+
489
+ #: classes/class-cartflows-meta.php:63
490
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:175
491
+ #: modules/landing/classes/class-cartflows-landing-meta.php:136
492
+ #: modules/optin/classes/class-cartflows-optin-meta.php:157
493
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:146
494
+ msgid "Custom Script"
495
+ msgstr ""
496
+
497
+ #: classes/class-cartflows-meta.php:66
498
+ msgid ""
499
+ "Custom script lets you add your own custom script on front end of this flow "
500
+ "page."
501
+ msgstr ""
502
+
503
+ #: classes/class-cartflows-metabox.php:59
504
+ msgid "Flow Details"
505
+ msgstr ""
506
+
507
+ #: classes/class-cartflows-wizard.php:94
508
+ msgid "Thanks for installing and using CartFlows!"
509
+ msgstr ""
510
+
511
+ #: classes/class-cartflows-wizard.php:95
512
+ msgid ""
513
+ "It is easy to use the CartFlows. Please use the setup wizard to quick start "
514
+ "setup."
515
+ msgstr ""
516
+
517
+ #: classes/class-cartflows-wizard.php:97
518
+ msgid "Start Wizard"
519
+ msgstr ""
520
+
521
+ #: classes/class-cartflows-wizard.php:98
522
+ msgid "Skip Setup"
523
+ msgstr ""
524
+
525
+ #: classes/class-cartflows-wizard.php:128
526
+ msgid "Welcome"
527
+ msgstr ""
528
+
529
+ #: classes/class-cartflows-wizard.php:133
530
+ msgid "Page Builder"
531
+ msgstr ""
532
+
533
+ #: classes/class-cartflows-wizard.php:137
534
+ msgid "Checkout"
535
+ msgstr ""
536
+
537
+ #: classes/class-cartflows-wizard.php:141
538
+ msgid "Training"
539
+ msgstr ""
540
+
541
+ #: classes/class-cartflows-wizard.php:145
542
+ msgid "Ready!"
543
+ msgstr ""
544
+
545
+ #: classes/class-cartflows-wizard.php:220
546
+ msgid "CartFlows Setup"
547
+ msgstr ""
548
+
549
+ #: classes/class-cartflows-wizard.php:246
550
+ msgid "Exit Setup Wizard"
551
+ msgstr ""
552
+
553
+ #: classes/class-cartflows-wizard.php:299
554
+ msgid "Welcome to CartFlows!"
555
+ msgstr ""
556
+
557
+ #: classes/class-cartflows-wizard.php:300
558
+ msgid ""
559
+ "Thank you for choosing CartFlows to get more leads, increase conversions, & "
560
+ "maximize profits. This short setup wizard will guide you though configuring "
561
+ "CartFlows and creating your first funnel."
562
+ msgstr ""
563
+
564
+ #: classes/class-cartflows-wizard.php:304
565
+ msgid "Let&#x27;s Build it better!"
566
+ msgstr ""
567
+
568
+ #: classes/class-cartflows-wizard.php:305
569
+ msgid ""
570
+ "Get improved features and faster fixes by sharing non-sensitive data via "
571
+ "usage tracking that shows us how CartFlows is used. No personal data is "
572
+ "tracked or stored."
573
+ msgstr ""
574
+
575
+ #: classes/class-cartflows-wizard.php:306
576
+ msgid "Learn More"
577
+ msgstr ""
578
+
579
+ #: classes/class-cartflows-wizard.php:309
580
+ msgid "Yes, I am in."
581
+ msgstr ""
582
+
583
+ #: classes/class-cartflows-wizard.php:316
584
+ msgid "Lets Go »"
585
+ msgstr ""
586
+
587
+ #: classes/class-cartflows-wizard.php:344
588
+ msgid "Page Builder Setup"
589
+ msgstr ""
590
+
591
+ #: classes/class-cartflows-wizard.php:345
592
+ msgid "Please select a page builder you would like to use with CartFlows."
593
+ msgstr ""
594
+
595
+ #: classes/class-cartflows-wizard.php:350
596
+ msgid "Select Page Builder"
597
+ msgstr ""
598
+
599
+ #: classes/class-cartflows-wizard.php:357
600
+ #: classes/class-cartflows-wizard.php:423
601
+ #: includes/admin/cartflows-general.php:76
602
+ msgid "Elementor"
603
+ msgstr ""
604
+
605
+ #: classes/class-cartflows-wizard.php:367
606
+ msgid "Beaver Builder Plugin (Lite Version)"
607
+ msgstr ""
608
+
609
+ #: classes/class-cartflows-wizard.php:377
610
+ #: includes/admin/cartflows-general.php:78
611
+ msgid "Divi"
612
+ msgstr ""
613
+
614
+ #: classes/class-cartflows-wizard.php:387
615
+ #: includes/admin/cartflows-general.php:79
616
+ msgid "Gutenberg"
617
+ msgstr ""
618
+
619
+ #: classes/class-cartflows-wizard.php:397
620
+ #: includes/admin/cartflows-general.php:80
621
+ msgid "Other"
622
+ msgstr ""
623
+
624
+ #: classes/class-cartflows-wizard.php:419
625
+ msgid ""
626
+ "While CartFlows Should work with most page builders, we offer templates for "
627
+ "the above page builders."
628
+ msgstr ""
629
+
630
+ #: classes/class-cartflows-wizard.php:422
631
+ #: classes/class-cartflows-wizard.php:464
632
+ msgid "The following plugin will be installed and activated for you:"
633
+ msgstr ""
634
+
635
+ #: classes/class-cartflows-wizard.php:429
636
+ #: classes/class-cartflows-wizard.php:474
637
+ #: classes/class-cartflows-wizard.php:684
638
+ msgid "« Previous"
639
+ msgstr ""
640
+
641
+ #: classes/class-cartflows-wizard.php:432
642
+ msgid "Skip this step"
643
+ msgstr ""
644
+
645
+ #: classes/class-cartflows-wizard.php:433
646
+ msgid "Next »"
647
+ msgstr ""
648
+
649
+ #: classes/class-cartflows-wizard.php:452
650
+ msgid "Choose a checkout"
651
+ msgstr ""
652
+
653
+ #: classes/class-cartflows-wizard.php:455
654
+ msgid ""
655
+ "While CartFlows is designed to use WooCommerce sell digital and physical "
656
+ "products, not all funnels need a checkout system."
657
+ msgstr ""
658
+
659
+ #: classes/class-cartflows-wizard.php:457
660
+ msgid ""
661
+ "Would you like to install WooCommerce to sell digital and physical products "
662
+ "in your funnels?"
663
+ msgstr ""
664
+
665
+ #: classes/class-cartflows-wizard.php:465
666
+ msgid "WooCommerce"
667
+ msgstr ""
668
+
669
+ #: classes/class-cartflows-wizard.php:466
670
+ msgid "WooCommerce Cart Abandonment Recovery"
671
+ msgstr ""
672
+
673
+ #: classes/class-cartflows-wizard.php:477
674
+ #: classes/class-cartflows-wizard.php:687
675
+ msgid "No thanks"
676
+ msgstr ""
677
+
678
+ #: classes/class-cartflows-wizard.php:478
679
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:110
680
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:119
681
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:128
682
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:137
683
+ msgid "Yes"
684
+ msgstr ""
685
+
686
+ #: classes/class-cartflows-wizard.php:620
687
+ msgid "Congratulations, You Did It!"
688
+ msgstr ""
689
+
690
+ #: classes/class-cartflows-wizard.php:627
691
+ msgid ""
692
+ "CartFlows is ready to use on your website. You've successfully completed "
693
+ "the setup process and all that is left for you to do is create your first "
694
+ "flow."
695
+ msgstr ""
696
+
697
+ #: classes/class-cartflows-wizard.php:641
698
+ msgid "Create a flow"
699
+ msgstr ""
700
+
701
+ #: classes/class-cartflows-wizard.php:658
702
+ msgid "Exclusive CartFlows Training Course Offer"
703
+ msgstr ""
704
+
705
+ #: classes/class-cartflows-wizard.php:669
706
+ msgid ""
707
+ "We want you to get off to a great start using CartFlows, so we would like "
708
+ "to give access to our exclusive training course."
709
+ msgstr ""
710
+
711
+ #: classes/class-cartflows-wizard.php:670
712
+ msgid "Get access to this couse, for free, by entering your email below."
713
+ msgstr ""
714
+
715
+ #: classes/class-cartflows-wizard.php:672
716
+ msgid "Enter Email address"
717
+ msgstr ""
718
+
719
+ #: classes/class-cartflows-wizard.php:688
720
+ msgid "Allow"
721
+ msgstr ""
722
+
723
+ #: classes/lib/notices/class-astra-notices.php:125
724
+ msgid "WordPress Nonce not validated."
725
+ msgstr ""
726
+
727
+ #: classes/logger/class-cartflows-log-handler-file.php:351
728
+ #: classes/logger/class-cartflows-log-handler-file.php:371
729
+ msgid "This method should not be called before plugins_loaded."
730
+ msgstr ""
731
+
732
+ #: classes/logger/class-cartflows-wc-logger.php:58
733
+ #. translators: 1: class name 2: Cartflows_Log_Handler_Interface
734
+ msgid "The provided handler %1$s does not implement %2$s."
735
+ msgstr ""
736
+
737
+ #: classes/logger/class-cartflows-wc-logger.php:136
738
+ #. translators: 1: Cartflows_WC_Logger::log 2: level
739
+ msgid "%1$s was called with an invalid level \"%2$s\"."
740
+ msgstr ""
741
+
742
+ #: includes/admin/cartflows-admin-header.php:17
743
+ #: includes/admin/cartflows-admin.php:19
744
+ msgid "Generate More Leads & More Sales"
745
+ msgstr ""
746
+
747
+ #: includes/admin/cartflows-admin.php:29
748
+ msgid "Settings saved successfully."
749
+ msgstr ""
750
+
751
+ #: includes/admin/cartflows-error-log.php:36
752
+ msgid "%1$s at %2$s"
753
+ msgstr ""
754
+
755
+ #: includes/admin/cartflows-error-log.php:41
756
+ #: modules/flow/classes/class-cartflows-flow-meta.php:804
757
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:225
758
+ msgid "View"
759
+ msgstr ""
760
+
761
+ #: includes/admin/cartflows-error-log.php:65
762
+ msgid "Delete log"
763
+ msgstr ""
764
+
765
+ #: includes/admin/cartflows-error-log.php:70
766
+ msgid "There are currently no logs to view."
767
+ msgstr ""
768
+
769
+ #: includes/admin/cartflows-general.php:31
770
+ #: includes/admin/cartflows-general.php:40
771
+ msgid "General Settings"
772
+ msgstr ""
773
+
774
+ #: includes/admin/cartflows-general.php:53
775
+ msgid "Disallow search engines from indexing flows"
776
+ msgstr ""
777
+
778
+ #: includes/admin/cartflows-general.php:63
779
+ #: modules/flow/view/view-flow-inner-step.php:52
780
+ msgid "Global Checkout"
781
+ msgstr ""
782
+
783
+ #: includes/admin/cartflows-general.php:72
784
+ msgid "Show Templates designed with"
785
+ msgstr ""
786
+
787
+ #: includes/admin/cartflows-general.php:73
788
+ msgid ""
789
+ "CartFlows offers flow templates that can be imported in one click. These "
790
+ "templates are available in few different page builders. Please choose your "
791
+ "preferred page builder from the list so you will only see templates that "
792
+ "are made using that page builder.."
793
+ msgstr ""
794
+
795
+ #: includes/admin/cartflows-general.php:77
796
+ msgid "Beaver Builder"
797
+ msgstr ""
798
+
799
+ #: includes/admin/cartflows-general.php:89
800
+ #: includes/admin/cartflows-general.php:175
801
+ #: includes/admin/cartflows-general.php:281
802
+ #: includes/admin/cartflows-general.php:398
803
+ msgid "Save Changes"
804
+ msgstr ""
805
+
806
+ #: includes/admin/cartflows-general.php:101
807
+ msgid "Permalink Settings"
808
+ msgstr ""
809
+
810
+ #: includes/admin/cartflows-general.php:116
811
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:136
812
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:141
813
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:182
814
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:81
815
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:86
816
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:119
817
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:179
818
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:184
819
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:146
820
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:151
821
+ #: modules/optin/classes/class-cartflows-optin-meta.php:447
822
+ msgid "Default"
823
+ msgstr ""
824
+
825
+ #: includes/admin/cartflows-general.php:122
826
+ msgid "Flow and Step Slug"
827
+ msgstr ""
828
+
829
+ #: includes/admin/cartflows-general.php:128
830
+ msgid "Flow Slug"
831
+ msgstr ""
832
+
833
+ #: includes/admin/cartflows-general.php:134
834
+ msgid "Step Slug"
835
+ msgstr ""
836
+
837
+ #: includes/admin/cartflows-general.php:146
838
+ msgid "Post Type Permalink Base"
839
+ msgstr ""
840
+
841
+ #: includes/admin/cartflows-general.php:154
842
+ msgid "Step Base"
843
+ msgstr ""
844
+
845
+ #: includes/admin/cartflows-general.php:164
846
+ msgid "Flow Base"
847
+ msgstr ""
848
+
849
+ #: includes/admin/cartflows-general.php:176
850
+ msgid "Set Default"
851
+ msgstr ""
852
+
853
+ #: includes/admin/cartflows-general.php:190
854
+ msgid "Facebook Pixel Settings"
855
+ msgstr ""
856
+
857
+ #: includes/admin/cartflows-general.php:205
858
+ msgid "Enable Facebook Pixel Tracking"
859
+ msgstr ""
860
+
861
+ #: includes/admin/cartflows-general.php:218
862
+ msgid "Enable for the whole site"
863
+ msgstr ""
864
+
865
+ #: includes/admin/cartflows-general.php:226
866
+ #: includes/admin/cartflows-general.php:325
867
+ msgid "If this option is unchecked, it will only apply to CartFlows steps."
868
+ msgstr ""
869
+
870
+ #: includes/admin/cartflows-general.php:236
871
+ msgid "Enter Facebook pixel ID"
872
+ msgstr ""
873
+
874
+ #: includes/admin/cartflows-general.php:244
875
+ #: includes/admin/cartflows-general.php:343
876
+ msgid "Enable Events:"
877
+ msgstr ""
878
+
879
+ #: includes/admin/cartflows-general.php:253
880
+ msgid "Initiate Checkout"
881
+ msgstr ""
882
+
883
+ #: includes/admin/cartflows-general.php:262
884
+ #: includes/admin/cartflows-general.php:369
885
+ msgid "Add Payment Info"
886
+ msgstr ""
887
+
888
+ #: includes/admin/cartflows-general.php:271
889
+ msgid "Purchase Complete"
890
+ msgstr ""
891
+
892
+ #: includes/admin/cartflows-general.php:293
893
+ msgid "Google Analytics Settings"
894
+ msgstr ""
895
+
896
+ #: includes/admin/cartflows-general.php:304
897
+ msgid "Enable Google Analytics Tracking"
898
+ msgstr ""
899
+
900
+ #: includes/admin/cartflows-general.php:317
901
+ msgid "Enable for the whole website"
902
+ msgstr ""
903
+
904
+ #: includes/admin/cartflows-general.php:335
905
+ msgid "Google Analytics ID"
906
+ msgstr ""
907
+
908
+ #: includes/admin/cartflows-general.php:337
909
+ msgid ""
910
+ "Log into your <a href=\"https://analytics.google.com/\" "
911
+ "target=\"_blank\">google analytics account</a> to find your ID. eg: "
912
+ "UA-XXXXXX-X&period;"
913
+ msgstr ""
914
+
915
+ #: includes/admin/cartflows-general.php:351
916
+ msgid "Begin Checkout"
917
+ msgstr ""
918
+
919
+ #: includes/admin/cartflows-general.php:360
920
+ msgid "Add To Cart"
921
+ msgstr ""
922
+
923
+ #: includes/admin/cartflows-general.php:378
924
+ msgid "Purchase"
925
+ msgstr ""
926
+
927
+ #: includes/admin/cartflows-general.php:386
928
+ msgid ""
929
+ "Google Analytics not working correctly? <a "
930
+ "href=\"https://cartflows.com/docs/troubleshooting-google-analytics-tracking-"
931
+ "issues/\" > Click here </a> to know more. "
932
+ msgstr ""
933
+
934
+ #: includes/admin/cartflows-general.php:419
935
+ #: includes/admin/cartflows-home.php:43
936
+ msgid "Knowledge Base"
937
+ msgstr ""
938
+
939
+ #: includes/admin/cartflows-general.php:423
940
+ #: includes/admin/cartflows-home.php:47
941
+ msgid "Not sure how something works? Take a peek at the knowledge base and learn."
942
+ msgstr ""
943
+
944
+ #: includes/admin/cartflows-general.php:426
945
+ #: includes/admin/cartflows-home.php:50
946
+ msgid "Visit Knowledge Base »"
947
+ msgstr ""
948
+
949
+ #: includes/admin/cartflows-general.php:434
950
+ #: includes/admin/cartflows-home.php:58
951
+ msgid "Community"
952
+ msgstr ""
953
+
954
+ #: includes/admin/cartflows-general.php:438
955
+ #: includes/admin/cartflows-home.php:62
956
+ msgid ""
957
+ "Join the community of super helpful CartFlows users. Say hello, ask "
958
+ "questions, give feedback and help each other!"
959
+ msgstr ""
960
+
961
+ #: includes/admin/cartflows-general.php:441
962
+ #: includes/admin/cartflows-home.php:65
963
+ msgid "Join Our Facebook Group »"
964
+ msgstr ""
965
+
966
+ #: includes/admin/cartflows-general.php:449
967
+ #: includes/admin/cartflows-home.php:73
968
+ msgid "Five Star Support"
969
+ msgstr ""
970
+
971
+ #: includes/admin/cartflows-general.php:453
972
+ #: includes/admin/cartflows-home.php:77
973
+ msgid "Got a question? Get in touch with CartFlows developers. We're happy to help!"
974
+ msgstr ""
975
+
976
+ #: includes/admin/cartflows-general.php:456
977
+ #: includes/admin/cartflows-home.php:80
978
+ msgid "Submit a Ticket »"
979
+ msgstr ""
980
+
981
+ #: includes/admin/cartflows-general.php:466
982
+ msgid "Load Minified CSS"
983
+ msgstr ""
984
+
985
+ #: includes/admin/cartflows-general.php:471
986
+ msgid ""
987
+ "Load the Minified CSS from here. Just Enable it by checking the below given "
988
+ "checkbox."
989
+ msgstr ""
990
+
991
+ #: includes/admin/cartflows-general.php:478
992
+ msgid "Load minified CSS & JS Files"
993
+ msgstr ""
994
+
995
+ #: includes/admin/cartflows-general.php:483
996
+ msgid "Save"
997
+ msgstr ""
998
+
999
+ #: includes/admin/cartflows-home.php:20
1000
+ msgid "Getting Started"
1001
+ msgstr ""
1002
+
1003
+ #: includes/admin/cartflows-home.php:28
1004
+ msgid "Modernizing WordPress eCommerce!"
1005
+ msgstr ""
1006
+
1007
+ #: includes/exporter.php:12
1008
+ msgid "Export Flows to a JSON file"
1009
+ msgstr ""
1010
+
1011
+ #: includes/exporter.php:13
1012
+ msgid ""
1013
+ "This tool allows you to generate and download a JSON file containing a list "
1014
+ "of all flows."
1015
+ msgstr ""
1016
+
1017
+ #: includes/importer.php:12
1018
+ msgid "Import Flows to a JSON file"
1019
+ msgstr ""
1020
+
1021
+ #: includes/importer.php:13
1022
+ msgid "This tool allows you to import the flows from the JSON file."
1023
+ msgstr ""
1024
+
1025
+ #: includes/importer.php:21
1026
+ msgid "Import"
1027
+ msgstr ""
1028
+
1029
+ #: includes/meta-fields/generate-product-repeater.php:36
1030
+ msgid "Remove"
1031
+ msgstr ""
1032
+
1033
+ #: includes/meta-fields/generate-product-repeater.php:51
1034
+ msgid "Product Quantity"
1035
+ msgstr ""
1036
+
1037
+ #: includes/meta-fields/generate-product-repeater.php:65
1038
+ msgid "Discount Type"
1039
+ msgstr ""
1040
+
1041
+ #: includes/meta-fields/generate-product-repeater.php:69
1042
+ msgid "Select Discount Type"
1043
+ msgstr ""
1044
+
1045
+ #: includes/meta-fields/generate-product-repeater.php:70
1046
+ msgid "Original"
1047
+ msgstr ""
1048
+
1049
+ #: includes/meta-fields/generate-product-repeater.php:71
1050
+ msgid "Percentage"
1051
+ msgstr ""
1052
+
1053
+ #: includes/meta-fields/generate-product-repeater.php:72
1054
+ msgid "Price"
1055
+ msgstr ""
1056
+
1057
+ #: includes/meta-fields/generate-product-repeater.php:83
1058
+ msgid "Discount Value"
1059
+ msgstr ""
1060
+
1061
+ #: includes/meta-fields/generate-product-repeater.php:85
1062
+ msgid "Discount value will apply for each quantity of product."
1063
+ msgstr ""
1064
+
1065
+ #: includes/meta-fields/get-product-selection-repeater.php:112
1066
+ msgid "Add New Product"
1067
+ msgstr ""
1068
+
1069
+ #: includes/meta-fields/get-product-selection-repeater.php:113
1070
+ msgid "Create Product"
1071
+ msgstr ""
1072
+
1073
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:29
1074
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:66
1075
+ msgid "Checkout Form"
1076
+ msgstr ""
1077
+
1078
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:30
1079
+ msgid "Checkout Form."
1080
+ msgstr ""
1081
+
1082
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:31
1083
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:32
1084
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:30
1085
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:31
1086
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:31
1087
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:32
1088
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:30
1089
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:31
1090
+ msgid "Cartflows Modules"
1091
+ msgstr ""
1092
+
1093
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:75
1094
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:1058
1095
+ msgid ""
1096
+ "No product is selected. Please select products from the checkout meta "
1097
+ "settings to continue."
1098
+ msgstr ""
1099
+
1100
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:109
1101
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:152
1102
+ msgid "One Column ( PRO )"
1103
+ msgstr ""
1104
+
1105
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:110
1106
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:116
1107
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:30
1108
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:153
1109
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:159
1110
+ msgid "Two Column"
1111
+ msgstr ""
1112
+
1113
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:111
1114
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:154
1115
+ msgid "Two Step ( PRO )"
1116
+ msgstr ""
1117
+
1118
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:115
1119
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:29
1120
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:158
1121
+ msgid "One Column"
1122
+ msgstr ""
1123
+
1124
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:117
1125
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:31
1126
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:160
1127
+ msgid "Two Step"
1128
+ msgstr ""
1129
+
1130
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:137
1131
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:82
1132
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:180
1133
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:147
1134
+ msgid "Floating Labels ( PRO )"
1135
+ msgstr ""
1136
+
1137
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:142
1138
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:87
1139
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:120
1140
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:185
1141
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:152
1142
+ #: modules/optin/classes/class-cartflows-optin-meta.php:448
1143
+ msgid "Floating Labels"
1144
+ msgstr ""
1145
+
1146
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:157
1147
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:128
1148
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:90
1149
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:157
1150
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:291
1151
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:169
1152
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:156
1153
+ msgid "General"
1154
+ msgstr ""
1155
+
1156
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:164
1157
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:210
1158
+ msgid "Select Layout"
1159
+ msgstr ""
1160
+
1161
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:166
1162
+ #. translators: %s: link
1163
+ msgid ""
1164
+ "The PRO layout options are available in the CartFlows Pro. %1$s Upgrade "
1165
+ "Now! %2$s"
1166
+ msgstr ""
1167
+
1168
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:178
1169
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:251
1170
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:171
1171
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:174
1172
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:102
1173
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:131
1174
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:146
1175
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:115
1176
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:451
1177
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:216
1178
+ #: modules/optin/classes/class-cartflows-optin-meta.php:443
1179
+ msgid "Style"
1180
+ msgstr ""
1181
+
1182
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:181
1183
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:105
1184
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:294
1185
+ msgid "Global"
1186
+ msgstr ""
1187
+
1188
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:185
1189
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:109
1190
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:40
1191
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:302
1192
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:177
1193
+ #: modules/optin/classes/class-cartflows-optin-meta.php:410
1194
+ msgid "Primary Color"
1195
+ msgstr ""
1196
+
1197
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:193
1198
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:221
1199
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:416
1200
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:649
1201
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:385
1202
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:268
1203
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:193
1204
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:221
1205
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:249
1206
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:317
1207
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:383
1208
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:449
1209
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:271
1210
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:364
1211
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:659
1212
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:754
1213
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:825
1214
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:358
1215
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:375
1216
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:435
1217
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:323
1218
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:372
1219
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:402
1220
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:468
1221
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:527
1222
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:558
1223
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:619
1224
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:649
1225
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:708
1226
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:738
1227
+ #: modules/optin/classes/class-cartflows-optin-meta.php:632
1228
+ msgid "Text Color"
1229
+ msgstr ""
1230
+
1231
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:207
1232
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:236
1233
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:316
1234
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:504
1235
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:446
1236
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:453
1237
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:117
1238
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:179
1239
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:324
1240
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:207
1241
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:235
1242
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:280
1243
+ msgid "Typography"
1244
+ msgstr ""
1245
+
1246
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:217
1247
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:189
1248
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:69
1249
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:396
1250
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:290
1251
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:509
1252
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:602
1253
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:691
1254
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:327
1255
+ msgid "Heading"
1256
+ msgstr ""
1257
+
1258
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:247
1259
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:127
1260
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:101
1261
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:443
1262
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:208
1263
+ #: modules/optin/classes/class-cartflows-optin-meta.php:430
1264
+ msgid "Input Fields"
1265
+ msgstr ""
1266
+
1267
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:253
1268
+ #. translators: %s: link
1269
+ msgid ""
1270
+ "The PRO style options are available in CartFlows Pro. %1$s Upgrade Now! "
1271
+ "%2$s"
1272
+ msgstr ""
1273
+
1274
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:262
1275
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:137
1276
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:202
1277
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:495
1278
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:941
1279
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:251
1280
+ #: modules/optin/classes/class-cartflows-optin-meta.php:507
1281
+ msgid "Label Color"
1282
+ msgstr ""
1283
+
1284
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:276
1285
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:151
1286
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:507
1287
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:262
1288
+ msgid "Field Background Color"
1289
+ msgstr ""
1290
+
1291
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:295
1292
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:165
1293
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:523
1294
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:273
1295
+ msgid "Input Text / Placeholder Color"
1296
+ msgstr ""
1297
+
1298
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:325
1299
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:517
1300
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:188
1301
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:334
1302
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:541
1303
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:284
1304
+ msgid "Border Style"
1305
+ msgstr ""
1306
+
1307
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:327
1308
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:519
1309
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:190
1310
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:336
1311
+ msgid ""
1312
+ "The type of border to use. Double borders must have a width of at least 3px "
1313
+ "to render properly."
1314
+ msgstr ""
1315
+
1316
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:330
1317
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:522
1318
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:193
1319
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:339
1320
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:547
1321
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:290
1322
+ msgid "Solid"
1323
+ msgstr ""
1324
+
1325
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:331
1326
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:523
1327
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:194
1328
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:340
1329
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:550
1330
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:293
1331
+ msgid "Dashed"
1332
+ msgstr ""
1333
+
1334
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:332
1335
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:524
1336
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:195
1337
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:341
1338
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:549
1339
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:292
1340
+ msgid "Dotted"
1341
+ msgstr ""
1342
+
1343
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:333
1344
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:525
1345
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:196
1346
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:342
1347
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:548
1348
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:291
1349
+ msgid "Double"
1350
+ msgstr ""
1351
+
1352
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:352
1353
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:557
1354
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:220
1355
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:367
1356
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:565
1357
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:303
1358
+ msgid "Border Width"
1359
+ msgstr ""
1360
+
1361
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:373
1362
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:580
1363
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:815
1364
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:235
1365
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:383
1366
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:195
1367
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:303
1368
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:582
1369
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:1008
1370
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:315
1371
+ #: modules/optin/classes/class-cartflows-optin-meta.php:531
1372
+ #: modules/optin/classes/class-cartflows-optin-meta.php:664
1373
+ msgid "Border Color"
1374
+ msgstr ""
1375
+
1376
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:391
1377
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:621
1378
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:727
1379
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:248
1380
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:411
1381
+ msgid "Border Radius"
1382
+ msgstr ""
1383
+
1384
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:412
1385
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:264
1386
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:215
1387
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:626
1388
+ msgid "Buttons"
1389
+ msgstr ""
1390
+
1391
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:440
1392
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:399
1393
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:282
1394
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:279
1395
+ #: modules/optin/classes/class-cartflows-optin-meta.php:640
1396
+ msgid "Text Hover Color"
1397
+ msgstr ""
1398
+
1399
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:460
1400
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:799
1401
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:413
1402
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:296
1403
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:263
1404
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:331
1405
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:397
1406
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:463
1407
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:187
1408
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:287
1409
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:679
1410
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:789
1411
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:995
1412
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:371
1413
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:388
1414
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:458
1415
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:426
1416
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:481
1417
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:571
1418
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:662
1419
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:751
1420
+ #: modules/optin/classes/class-cartflows-optin-meta.php:523
1421
+ #: modules/optin/classes/class-cartflows-optin-meta.php:648
1422
+ msgid "Background Color"
1423
+ msgstr ""
1424
+
1425
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:484
1426
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:421
1427
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:310
1428
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:295
1429
+ #: modules/optin/classes/class-cartflows-optin-meta.php:656
1430
+ msgid "Background Hover Color"
1431
+ msgstr ""
1432
+
1433
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:601
1434
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:319
1435
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:397
1436
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:311
1437
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:771
1438
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:446
1439
+ #: modules/optin/classes/class-cartflows-optin-meta.php:672
1440
+ msgid "Border Hover Color"
1441
+ msgstr ""
1442
+
1443
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:645
1444
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:818
1445
+ msgid "Payment Section"
1446
+ msgstr ""
1447
+
1448
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:663
1449
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:839
1450
+ msgid "Description Color"
1451
+ msgstr ""
1452
+
1453
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:677
1454
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:863
1455
+ msgid "Information Background Color"
1456
+ msgstr ""
1457
+
1458
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:685
1459
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:851
1460
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:377
1461
+ msgid "Section Background Color"
1462
+ msgstr ""
1463
+
1464
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:699
1465
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:877
1466
+ msgid "Section Padding"
1467
+ msgstr ""
1468
+
1469
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:713
1470
+ msgid "Margin"
1471
+ msgstr ""
1472
+
1473
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:743
1474
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:924
1475
+ msgid "Field Validation & Error Messages"
1476
+ msgstr ""
1477
+
1478
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:747
1479
+ msgid "Field Label Color"
1480
+ msgstr ""
1481
+
1482
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:763
1483
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:953
1484
+ msgid "Field Border Color"
1485
+ msgstr ""
1486
+
1487
+ #: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:783
1488
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:981
1489
+ msgid "Error Message Color"
1490
+ msgstr ""
1491
+
1492
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:28
1493
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:70
1494
+ msgid "Next Step Button"
1495
+ msgstr ""
1496
+
1497
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:29
1498
+ msgid "A simple next step button."
1499
+ msgstr ""
1500
+
1501
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:135
1502
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:296
1503
+ msgid "Text"
1504
+ msgstr ""
1505
+
1506
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:136
1507
+ #: modules/flow/classes/class-cartflows-flow-shortcodes.php:148
1508
+ #: modules/widgets/class-cartflows-next-step.php:78
1509
+ msgid "Next Step"
1510
+ msgstr ""
1511
+
1512
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:145
1513
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:187
1514
+ msgid "Icon"
1515
+ msgstr ""
1516
+
1517
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:156
1518
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:195
1519
+ msgid "Icon Position"
1520
+ msgstr ""
1521
+
1522
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:159
1523
+ msgid "Before Text"
1524
+ msgstr ""
1525
+
1526
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:160
1527
+ msgid "After Text"
1528
+ msgstr ""
1529
+
1530
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:178
1531
+ msgid "Type"
1532
+ msgstr ""
1533
+
1534
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:183
1535
+ msgid "Flat"
1536
+ msgstr ""
1537
+
1538
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:184
1539
+ msgid "Gradient"
1540
+ msgstr ""
1541
+
1542
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:185
1543
+ msgid "Transparent"
1544
+ msgstr ""
1545
+
1546
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:186
1547
+ msgid "3D"
1548
+ msgstr ""
1549
+
1550
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:196
1551
+ msgid "Border Size"
1552
+ msgstr ""
1553
+
1554
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:205
1555
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:221
1556
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:234
1557
+ msgid "Hover Styles"
1558
+ msgstr ""
1559
+
1560
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:209
1561
+ msgid "Fade Background"
1562
+ msgstr ""
1563
+
1564
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:210
1565
+ msgid "Fill Background From Top"
1566
+ msgstr ""
1567
+
1568
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:211
1569
+ msgid "Fill Background From Bottom"
1570
+ msgstr ""
1571
+
1572
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:212
1573
+ msgid "Fill Background From Left"
1574
+ msgstr ""
1575
+
1576
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:213
1577
+ msgid "Fill Background From Right"
1578
+ msgstr ""
1579
+
1580
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:214
1581
+ msgid "Fill Background Vertical"
1582
+ msgstr ""
1583
+
1584
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:215
1585
+ msgid "Fill Background Diagonal"
1586
+ msgstr ""
1587
+
1588
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:216
1589
+ msgid "Fill Background Horizontal"
1590
+ msgstr ""
1591
+
1592
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:224
1593
+ msgid "Move Down"
1594
+ msgstr ""
1595
+
1596
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:225
1597
+ msgid "Move Up"
1598
+ msgstr ""
1599
+
1600
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:226
1601
+ msgid "Move Left"
1602
+ msgstr ""
1603
+
1604
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:227
1605
+ msgid "Move Right"
1606
+ msgstr ""
1607
+
1608
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:228
1609
+ msgid "Animate Top"
1610
+ msgstr ""
1611
+
1612
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:229
1613
+ msgid "Animate Bottom"
1614
+ msgstr ""
1615
+
1616
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:238
1617
+ msgid "Appear Icon From Right"
1618
+ msgstr ""
1619
+
1620
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:239
1621
+ msgid "Appear Icon From Left"
1622
+ msgstr ""
1623
+
1624
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:240
1625
+ msgid "Appear Icon From Top"
1626
+ msgstr ""
1627
+
1628
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:241
1629
+ msgid "Appear Icon From Bottom"
1630
+ msgstr ""
1631
+
1632
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:247
1633
+ msgid "Structure"
1634
+ msgstr ""
1635
+
1636
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:251
1637
+ msgid "Width"
1638
+ msgstr ""
1639
+
1640
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:255
1641
+ msgid "Full Width"
1642
+ msgstr ""
1643
+
1644
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:256
1645
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:156
1646
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:248
1647
+ #: modules/optin/classes/class-cartflows-optin-meta.php:484
1648
+ #: modules/optin/classes/class-cartflows-optin-meta.php:596
1649
+ msgid "Custom"
1650
+ msgstr ""
1651
+
1652
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:272
1653
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:299
1654
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:298
1655
+ msgid "Alignment"
1656
+ msgstr ""
1657
+
1658
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:275
1659
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:285
1660
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:307
1661
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:480
1662
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:306
1663
+ #: modules/optin/classes/class-cartflows-optin-meta.php:624
1664
+ msgid "Center"
1665
+ msgstr ""
1666
+
1667
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:276
1668
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:286
1669
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:303
1670
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:476
1671
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:302
1672
+ #: modules/optin/classes/class-cartflows-optin-meta.php:623
1673
+ msgid "Left"
1674
+ msgstr ""
1675
+
1676
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:277
1677
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:287
1678
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:311
1679
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:484
1680
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:310
1681
+ #: modules/optin/classes/class-cartflows-optin-meta.php:625
1682
+ msgid "Right"
1683
+ msgstr ""
1684
+
1685
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:282
1686
+ msgid "Mobile Alignment"
1687
+ msgstr ""
1688
+
1689
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:292
1690
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:337
1691
+ msgid "Padding"
1692
+ msgstr ""
1693
+
1694
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:306
1695
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:435
1696
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:696
1697
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:389
1698
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:398
1699
+ msgid "Border"
1700
+ msgstr ""
1701
+
1702
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:330
1703
+ msgid "Custom Width"
1704
+ msgstr ""
1705
+
1706
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:339
1707
+ msgid "Custom Height"
1708
+ msgstr ""
1709
+
1710
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:348
1711
+ msgid "Padding Top/Bottom"
1712
+ msgstr ""
1713
+
1714
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:357
1715
+ msgid "Padding Left/Right"
1716
+ msgstr ""
1717
+
1718
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:366
1719
+ msgid "Round Corners"
1720
+ msgstr ""
1721
+
1722
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:381
1723
+ msgid "Colors"
1724
+ msgstr ""
1725
+
1726
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:432
1727
+ msgid "Apply Hover Color To"
1728
+ msgstr ""
1729
+
1730
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:436
1731
+ msgid "Background"
1732
+ msgstr ""
1733
+
1734
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:449
1735
+ msgid "Button Settings"
1736
+ msgstr ""
1737
+
1738
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:29
1739
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:66
1740
+ msgid "Optin Form"
1741
+ msgstr ""
1742
+
1743
+ #: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:30
1744
+ msgid "Optin Form."
1745
+ msgstr ""
1746
+
1747
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:28
1748
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:69
1749
+ msgid "Order Details Form"
1750
+ msgstr ""
1751
+
1752
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:29
1753
+ msgid "Order Details Form."
1754
+ msgstr ""
1755
+
1756
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:97
1757
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:163
1758
+ msgid "Thank You Text"
1759
+ msgstr ""
1760
+
1761
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:98
1762
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:165
1763
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:176
1764
+ #: woocommerce/template/checkout/thankyou.php:41
1765
+ #: woocommerce/template/checkout/thankyou.php:86
1766
+ msgid "Thank you. Your order has been received."
1767
+ msgstr ""
1768
+
1769
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:107
1770
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:173
1771
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:448
1772
+ msgid "Order Overview"
1773
+ msgstr ""
1774
+
1775
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:111
1776
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:120
1777
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:129
1778
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:138
1779
+ msgid "No"
1780
+ msgstr ""
1781
+
1782
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:116
1783
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:355
1784
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:185
1785
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:591
1786
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:284
1787
+ msgid "Order Details"
1788
+ msgstr ""
1789
+
1790
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:125
1791
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:197
1792
+ msgid "Billing Address"
1793
+ msgstr ""
1794
+
1795
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:134
1796
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:209
1797
+ msgid "Shipping Address"
1798
+ msgstr ""
1799
+
1800
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:149
1801
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:233
1802
+ msgid "Spacing"
1803
+ msgstr ""
1804
+
1805
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:153
1806
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:241
1807
+ msgid "Heading Bottom Spacing"
1808
+ msgstr ""
1809
+
1810
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:168
1811
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:257
1812
+ msgid "Spacing Between Sections"
1813
+ msgstr ""
1814
+
1815
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:217
1816
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:364
1817
+ msgid "Sections Heading"
1818
+ msgstr ""
1819
+
1820
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:245
1821
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:393
1822
+ msgid "Sections Content"
1823
+ msgstr ""
1824
+
1825
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:290
1826
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:501
1827
+ msgid "Downloads"
1828
+ msgstr ""
1829
+
1830
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:294
1831
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:359
1832
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:425
1833
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:75
1834
+ msgid "Heading Color"
1835
+ msgstr ""
1836
+
1837
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:308
1838
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:374
1839
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:440
1840
+ msgid "Heading Typography"
1841
+ msgstr ""
1842
+
1843
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:345
1844
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:411
1845
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:477
1846
+ msgid "Text Typography"
1847
+ msgstr ""
1848
+
1849
+ #: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:421
1850
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:683
1851
+ msgid "Customer Details"
1852
+ msgstr ""
1853
+
1854
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:355
1855
+ #: modules/optin/classes/class-cartflows-optin-markup.php:204
1856
+ #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:90
1857
+ msgid ""
1858
+ "WooCommerce functions do not exist. If you are in an IFrame, please reload "
1859
+ "it."
1860
+ msgstr ""
1861
+
1862
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:356
1863
+ #: modules/optin/classes/class-cartflows-optin-markup.php:205
1864
+ #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:91
1865
+ msgid "Click Here to Reload"
1866
+ msgstr ""
1867
+
1868
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:373
1869
+ msgid "Checkout ID not found"
1870
+ msgstr ""
1871
+
1872
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:376
1873
+ #. translators: %1$1s, %2$2s Link to article
1874
+ msgid ""
1875
+ "It seems that this is not the CartFlows Checkout page where you have added "
1876
+ "this shortcode. Please refer to this %1$1sarticle%2$2s to know more."
1877
+ msgstr ""
1878
+
1879
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:444
1880
+ #: modules/checkout/templates/embed/checkout-template-simple.php:26
1881
+ #: modules/checkout/templates/wcf-template.php:36
1882
+ #: modules/optin/templates/optin-template-simple.php:25
1883
+ msgid "Your cart is currently empty."
1884
+ msgstr ""
1885
+
1886
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:523
1887
+ #. translators: %1$1s, %2$2s Link to meta
1888
+ msgid ""
1889
+ "No product is selected. Please select products from the %1$1scheckout meta "
1890
+ "settings%2$2s to continue."
1891
+ msgstr ""
1892
+
1893
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:618
1894
+ msgid "Variations Not set"
1895
+ msgstr ""
1896
+
1897
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:629
1898
+ msgid "This product can't be purchased"
1899
+ msgstr ""
1900
+
1901
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1084
1902
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1127
1903
+ msgid "Coupon Code"
1904
+ msgstr ""
1905
+
1906
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1085
1907
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1136
1908
+ msgid "Apply"
1909
+ msgstr ""
1910
+
1911
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1273
1912
+ msgid "Sorry there was a problem removing this coupon."
1913
+ msgstr ""
1914
+
1915
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1276
1916
+ msgid "Coupon has been removed."
1917
+ msgstr ""
1918
+
1919
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1295
1920
+ msgid "Sorry there was a problem removing "
1921
+ msgstr ""
1922
+
1923
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1298
1924
+ msgid " has been removed."
1925
+ msgstr ""
1926
+
1927
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:94
1928
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:169
1929
+ msgid "Checkout Settings"
1930
+ msgstr ""
1931
+
1932
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:103
1933
+ msgid "Checkout Layout & Design"
1934
+ msgstr ""
1935
+
1936
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:139
1937
+ #: modules/optin/classes/class-cartflows-optin-meta.php:139
1938
+ msgid "Select Product"
1939
+ msgstr ""
1940
+
1941
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:145
1942
+ msgid "Product Options"
1943
+ msgstr ""
1944
+
1945
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:151
1946
+ msgid "Order Bump"
1947
+ msgstr ""
1948
+
1949
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:157
1950
+ msgid "Checkout Offer"
1951
+ msgstr ""
1952
+
1953
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:163
1954
+ msgid "Checkout Fields"
1955
+ msgstr ""
1956
+
1957
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:186
1958
+ msgid "Logo (Optional)"
1959
+ msgstr ""
1960
+
1961
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:271
1962
+ #. translators: %s: link
1963
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Product Options feature."
1964
+ msgstr ""
1965
+
1966
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:282
1967
+ #. translators: %s: link.
1968
+ msgid "Update %1$sCartFlows Pro%2$s to %3$s or above for Product Options"
1969
+ msgstr ""
1970
+
1971
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:310
1972
+ msgid "Add this shortcode to your checkout page"
1973
+ msgstr ""
1974
+
1975
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:345
1976
+ #. translators: %s: link
1977
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Pre-applied Coupon."
1978
+ msgstr ""
1979
+
1980
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:372
1981
+ #. translators: %s: link
1982
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Checkout Offer feature"
1983
+ msgstr ""
1984
+
1985
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:382
1986
+ #. translators: %s: link
1987
+ msgid "Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature"
1988
+ msgstr ""
1989
+
1990
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:409
1991
+ #. translators: %s: link
1992
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for animate browser tab feature"
1993
+ msgstr ""
1994
+
1995
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:419
1996
+ #. translators: %s: link
1997
+ msgid ""
1998
+ "Update to %1$sCartFlows Pro%2$s to %3$s or above for animate browser tab "
1999
+ "feature"
2000
+ msgstr ""
2001
+
2002
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:442
2003
+ #. translators: %s: link
2004
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature."
2005
+ msgstr ""
2006
+
2007
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:469
2008
+ #: modules/optin/classes/class-cartflows-optin-meta.php:334
2009
+ #. translators: %s: link
2010
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature."
2011
+ msgstr ""
2012
+
2013
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:492
2014
+ msgid "Place Order Button Text"
2015
+ msgstr ""
2016
+
2017
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:496
2018
+ msgid "Place order"
2019
+ msgstr ""
2020
+
2021
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:498
2022
+ msgid "It will change the Place Order Button text on checkout page."
2023
+ msgstr ""
2024
+
2025
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:508
2026
+ msgid "Enable cart editing on checkout"
2027
+ msgstr ""
2028
+
2029
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:516
2030
+ #. translators: %s: link
2031
+ msgid "Users will able to remove products from the checkout page."
2032
+ msgstr ""
2033
+
2034
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:557
2035
+ msgid "Header Logo"
2036
+ msgstr ""
2037
+
2038
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:565
2039
+ msgid "Logo Width (In px)"
2040
+ msgstr ""
2041
+
2042
+ #: modules/checkout/includes/meta-views/design-checkout-metabox-markup.php:12
2043
+ #: modules/landing/classes/class-cartflows-landing-meta.php:130
2044
+ #: modules/optin/classes/class-cartflows-optin-meta.php:220
2045
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:244
2046
+ msgid "Shortcodes"
2047
+ msgstr ""
2048
+
2049
+ #: modules/checkout/includes/meta-views/design-checkout-metabox-markup.php:18
2050
+ msgid "Checkout Design"
2051
+ msgstr ""
2052
+
2053
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:18
2054
+ msgid "One Column (Available in CartFlows Pro) "
2055
+ msgstr ""
2056
+
2057
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:19
2058
+ msgid "Two Step (Available in CartFlows Pro) "
2059
+ msgstr ""
2060
+
2061
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:25
2062
+ msgid "Checkout Skin"
2063
+ msgstr ""
2064
+
2065
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:49
2066
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:84
2067
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:130
2068
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:222
2069
+ #: modules/optin/classes/class-cartflows-optin-meta.php:419
2070
+ #: modules/optin/classes/class-cartflows-optin-meta.php:458
2071
+ #: modules/optin/classes/class-cartflows-optin-meta.php:570
2072
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:311
2073
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:342
2074
+ msgid "Font Family"
2075
+ msgstr ""
2076
+
2077
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:57
2078
+ msgid "Advance Options"
2079
+ msgstr ""
2080
+
2081
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:93
2082
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:139
2083
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:231
2084
+ #: modules/optin/classes/class-cartflows-optin-meta.php:467
2085
+ #: modules/optin/classes/class-cartflows-optin-meta.php:579
2086
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:351
2087
+ msgid "Font Weight"
2088
+ msgstr ""
2089
+
2090
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:109
2091
+ #: modules/optin/classes/class-cartflows-optin-meta.php:437
2092
+ msgid "Floating Labels (Available in CartFlows Pro)"
2093
+ msgstr ""
2094
+
2095
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:147
2096
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:239
2097
+ #: modules/optin/classes/class-cartflows-optin-meta.php:475
2098
+ #: modules/optin/classes/class-cartflows-optin-meta.php:587
2099
+ msgid "Size"
2100
+ msgstr ""
2101
+
2102
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:151
2103
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:243
2104
+ #: modules/optin/classes/class-cartflows-optin-meta.php:479
2105
+ #: modules/optin/classes/class-cartflows-optin-meta.php:591
2106
+ msgid "Extra Small"
2107
+ msgstr ""
2108
+
2109
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:152
2110
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:244
2111
+ #: modules/optin/classes/class-cartflows-optin-meta.php:480
2112
+ #: modules/optin/classes/class-cartflows-optin-meta.php:592
2113
+ msgid "Small"
2114
+ msgstr ""
2115
+
2116
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:153
2117
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:245
2118
+ #: modules/optin/classes/class-cartflows-optin-meta.php:481
2119
+ #: modules/optin/classes/class-cartflows-optin-meta.php:593
2120
+ msgid "Medium"
2121
+ msgstr ""
2122
+
2123
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:154
2124
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:246
2125
+ #: modules/optin/classes/class-cartflows-optin-meta.php:482
2126
+ #: modules/optin/classes/class-cartflows-optin-meta.php:594
2127
+ msgid "Large"
2128
+ msgstr ""
2129
+
2130
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:155
2131
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:247
2132
+ #: modules/optin/classes/class-cartflows-optin-meta.php:483
2133
+ #: modules/optin/classes/class-cartflows-optin-meta.php:595
2134
+ msgid "Extra Large"
2135
+ msgstr ""
2136
+
2137
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:163
2138
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:255
2139
+ #: modules/optin/classes/class-cartflows-optin-meta.php:491
2140
+ #: modules/optin/classes/class-cartflows-optin-meta.php:603
2141
+ msgid "Top Bottom Spacing"
2142
+ msgstr ""
2143
+
2144
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:171
2145
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:263
2146
+ #: modules/optin/classes/class-cartflows-optin-meta.php:499
2147
+ #: modules/optin/classes/class-cartflows-optin-meta.php:611
2148
+ msgid "Left Right Spacing"
2149
+ msgstr ""
2150
+
2151
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:179
2152
+ #: modules/optin/classes/class-cartflows-optin-meta.php:515
2153
+ msgid "Text / Placeholder Color"
2154
+ msgstr ""
2155
+
2156
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:324
2157
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:356
2158
+ msgid "Sections"
2159
+ msgstr ""
2160
+
2161
+ #: modules/checkout/includes/meta-views/design-checkout-style-tab.php:330
2162
+ msgid "Highlight Area Background Color"
2163
+ msgstr ""
2164
+
2165
+ #: modules/checkout/templates/wcf-template.php:46
2166
+ msgid "Copyright &copy;"
2167
+ msgstr ""
2168
+
2169
+ #: modules/checkout/templates/wcf-template.php:50
2170
+ msgid "All Rights Reserved"
2171
+ msgstr ""
2172
+
2173
+ #: modules/elementor/class-cartflows-el-widgets-loader.php:120
2174
+ msgid "Cartflows"
2175
+ msgstr ""
2176
+
2177
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:203
2178
+ msgid "Layout"
2179
+ msgstr ""
2180
+
2181
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:224
2182
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:465
2183
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:230
2184
+ #. translators: %s admin link
2185
+ msgid ""
2186
+ "This feature is available in the CartFlows Pro. <a href=\"%s\" "
2187
+ "target=\"_blank\" rel=\"noopener\">Upgrade Now!</a>."
2188
+ msgstr ""
2189
+
2190
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:247
2191
+ msgid "Other Settings"
2192
+ msgstr ""
2193
+
2194
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:254
2195
+ msgid "Billing Section Text"
2196
+ msgstr ""
2197
+
2198
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:256
2199
+ msgid "Billing Details"
2200
+ msgstr ""
2201
+
2202
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:264
2203
+ msgid "Shipping Section Text"
2204
+ msgstr ""
2205
+
2206
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:266
2207
+ msgid "Shipping Details"
2208
+ msgstr ""
2209
+
2210
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:274
2211
+ msgid "Order Review Text"
2212
+ msgstr ""
2213
+
2214
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:276
2215
+ #: woocommerce/template/checkout/form-checkout.php:56
2216
+ msgid "Your order"
2217
+ msgstr ""
2218
+
2219
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:404
2220
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:302
2221
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:333
2222
+ msgid "Color"
2223
+ msgstr ""
2224
+
2225
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:546
2226
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:289
2227
+ msgid "Inherit"
2228
+ msgstr ""
2229
+
2230
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:598
2231
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:711
2232
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:397
2233
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:326
2234
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:406
2235
+ msgid "Rounded Corners"
2236
+ msgstr ""
2237
+
2238
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:652
2239
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:351
2240
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:368
2241
+ msgid "Normal"
2242
+ msgstr ""
2243
+
2244
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:747
2245
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:411
2246
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:428
2247
+ msgid "Hover"
2248
+ msgstr ""
2249
+
2250
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:890
2251
+ msgid "Section Margin"
2252
+ msgstr ""
2253
+
2254
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:902
2255
+ msgid "Section Rounded Corners"
2256
+ msgstr ""
2257
+
2258
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:932
2259
+ msgid "Field Validation"
2260
+ msgstr ""
2261
+
2262
+ #: modules/elementor/widgets/class-cartflows-el-checkout-form.php:972
2263
+ msgid "Error Messages"
2264
+ msgstr ""
2265
+
2266
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:164
2267
+ msgid "Title"
2268
+ msgstr ""
2269
+
2270
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:166
2271
+ msgid "BUY NOW"
2272
+ msgstr ""
2273
+
2274
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:176
2275
+ msgid "Sub Title"
2276
+ msgstr ""
2277
+
2278
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:199
2279
+ msgid "Before Title"
2280
+ msgstr ""
2281
+
2282
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:200
2283
+ msgid "After Title"
2284
+ msgstr ""
2285
+
2286
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:201
2287
+ msgid "Before Title & Sub Title"
2288
+ msgstr ""
2289
+
2290
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:202
2291
+ msgid "After Title & Sub Title"
2292
+ msgstr ""
2293
+
2294
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:213
2295
+ msgid "Icon Vertical Alignment"
2296
+ msgstr ""
2297
+
2298
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:219
2299
+ msgid "Top"
2300
+ msgstr ""
2301
+
2302
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:223
2303
+ msgid "Middle"
2304
+ msgstr ""
2305
+
2306
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:240
2307
+ msgid "Icon Spacing"
2308
+ msgstr ""
2309
+
2310
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:260
2311
+ msgid "Icon Size"
2312
+ msgstr ""
2313
+
2314
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:315
2315
+ msgid "Justify"
2316
+ msgstr ""
2317
+
2318
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:327
2319
+ msgid "Button Size"
2320
+ msgstr ""
2321
+
2322
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:418
2323
+ msgid "Hover Text Color"
2324
+ msgstr ""
2325
+
2326
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:431
2327
+ msgid "Hover Background Color"
2328
+ msgstr ""
2329
+
2330
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:464
2331
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:540
2332
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:631
2333
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:720
2334
+ msgid "Content"
2335
+ msgstr ""
2336
+
2337
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:472
2338
+ msgid "Text Alignment"
2339
+ msgstr ""
2340
+
2341
+ #: modules/elementor/widgets/class-cartflows-el-next-step-button.php:525
2342
+ msgid "Title and Sub Title Spacing"
2343
+ msgstr ""
2344
+
2345
+ #: modules/elementor/widgets/class-cartflows-el-optin-form.php:349
2346
+ #: modules/optin/classes/class-cartflows-optin-meta.php:544
2347
+ msgid "Submit Button"
2348
+ msgstr ""
2349
+
2350
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:175
2351
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:187
2352
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:199
2353
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:211
2354
+ msgid "Show"
2355
+ msgstr ""
2356
+
2357
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:176
2358
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:188
2359
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:200
2360
+ #: modules/elementor/widgets/class-cartflows-el-order-details-form.php:212
2361
+ msgid "Hide"
2362
+ msgstr ""
2363
+
2364
+ #: modules/flow/classes/class-cartflows-flow-meta.php:265
2365
+ #. translators: %s flow id
2366
+ msgid "Step not deleted for flow - %s"
2367
+ msgstr ""
2368
+
2369
+ #: modules/flow/classes/class-cartflows-flow-meta.php:303
2370
+ #. translators: %s flow id
2371
+ msgid "Step deleted for flow - %s"
2372
+ msgstr ""
2373
+
2374
+ #: modules/flow/classes/class-cartflows-flow-meta.php:312
2375
+ #. translators: %s flow id
2376
+ msgid "This step can not be deleted."
2377
+ msgstr ""
2378
+
2379
+ #: modules/flow/classes/class-cartflows-flow-meta.php:344
2380
+ #. translators: %s flow id
2381
+ msgid "Steps not sorted for flow - %s"
2382
+ msgstr ""
2383
+
2384
+ #: modules/flow/classes/class-cartflows-flow-meta.php:380
2385
+ #. translators: %s flow id
2386
+ msgid "Steps sorted for flow - %s"
2387
+ msgstr ""
2388
+
2389
+ #: modules/flow/classes/class-cartflows-flow-meta.php:485
2390
+ msgid "Analytics"
2391
+ msgstr ""
2392
+
2393
+ #: modules/flow/classes/class-cartflows-flow-meta.php:502
2394
+ #. translators: %s: link
2395
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Analytics feature"
2396
+ msgstr ""
2397
+
2398
+ #: modules/flow/classes/class-cartflows-flow-meta.php:520
2399
+ msgid "Flow Settings"
2400
+ msgstr ""
2401
+
2402
+ #: modules/flow/classes/class-cartflows-flow-meta.php:605
2403
+ msgid "Enable Test Mode"
2404
+ msgstr ""
2405
+
2406
+ #: modules/flow/classes/class-cartflows-flow-meta.php:612
2407
+ msgid ""
2408
+ "If you are using WooCommerce plugin then test mode will add random products "
2409
+ "in your flow, so you can preview it easily while testing."
2410
+ msgstr ""
2411
+
2412
+ #: modules/flow/classes/class-cartflows-flow-meta.php:732
2413
+ #: modules/flow/view/meta-flow-steps.php:145
2414
+ msgid "Add New Step"
2415
+ msgstr ""
2416
+
2417
+ #: modules/flow/classes/class-cartflows-flow-meta.php:802
2418
+ #: modules/flow/classes/class-cartflows-step-post-type.php:166
2419
+ msgid "View Step"
2420
+ msgstr ""
2421
+
2422
+ #: modules/flow/classes/class-cartflows-flow-meta.php:813
2423
+ #: modules/flow/classes/class-cartflows-step-post-type.php:165
2424
+ msgid "Edit Step"
2425
+ msgstr ""
2426
+
2427
+ #: modules/flow/classes/class-cartflows-flow-meta.php:815
2428
+ msgid "Edit"
2429
+ msgstr ""
2430
+
2431
+ #: modules/flow/classes/class-cartflows-flow-meta.php:822
2432
+ msgid "Clone Step"
2433
+ msgstr ""
2434
+
2435
+ #: modules/flow/classes/class-cartflows-flow-meta.php:833
2436
+ msgid "Delete Step"
2437
+ msgstr ""
2438
+
2439
+ #: modules/flow/classes/class-cartflows-flow-meta.php:835
2440
+ msgid "Delete"
2441
+ msgstr ""
2442
+
2443
+ #: modules/flow/classes/class-cartflows-flow-meta.php:844
2444
+ #: modules/flow/classes/class-cartflows-flow-meta.php:846
2445
+ msgid "A/B Test"
2446
+ msgstr ""
2447
+
2448
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:69
2449
+ msgid "Flow: "
2450
+ msgstr ""
2451
+
2452
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:69
2453
+ msgid "Name: "
2454
+ msgstr ""
2455
+
2456
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:101
2457
+ msgid "Search Flows"
2458
+ msgstr ""
2459
+
2460
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:102
2461
+ msgid "All Flows"
2462
+ msgstr ""
2463
+
2464
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:103
2465
+ msgid "Edit Flow"
2466
+ msgstr ""
2467
+
2468
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:104
2469
+ msgid "View Flow"
2470
+ msgstr ""
2471
+
2472
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:105
2473
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:107
2474
+ #: modules/flow/classes/class-cartflows-step-post-type.php:167
2475
+ #: modules/flow/classes/class-cartflows-step-post-type.php:169
2476
+ msgid "Add New"
2477
+ msgstr ""
2478
+
2479
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:106
2480
+ msgid "Update Flow"
2481
+ msgstr ""
2482
+
2483
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:108
2484
+ msgid "New Flow Name"
2485
+ msgstr ""
2486
+
2487
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:190
2488
+ msgid "Upgrade to CartFlows Pro"
2489
+ msgstr ""
2490
+
2491
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:209
2492
+ msgid "Slug"
2493
+ msgstr ""
2494
+
2495
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:321
2496
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:322
2497
+ msgid "Flows"
2498
+ msgstr ""
2499
+
2500
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:344
2501
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:350
2502
+ #: modules/flow/classes/class-cartflows-step-post-type.php:401
2503
+ #: modules/flow/classes/class-cartflows-step-post-type.php:407
2504
+ #. translators: %s: singular custom post type name
2505
+ msgid "%s updated."
2506
+ msgstr ""
2507
+
2508
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:346
2509
+ #: modules/flow/classes/class-cartflows-step-post-type.php:403
2510
+ #. translators: %s: singular custom post type name
2511
+ msgid "Custom %s updated."
2512
+ msgstr ""
2513
+
2514
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:348
2515
+ #: modules/flow/classes/class-cartflows-step-post-type.php:405
2516
+ #. translators: %s: singular custom post type name
2517
+ msgid "Custom %s deleted."
2518
+ msgstr ""
2519
+
2520
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:352
2521
+ #: modules/flow/classes/class-cartflows-step-post-type.php:409
2522
+ #. translators: %1$s: singular custom post type name ,%2$s: date and time of
2523
+ #. the revision
2524
+ msgid "%1$s restored to revision from %2$s"
2525
+ msgstr ""
2526
+
2527
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:354
2528
+ #: modules/flow/classes/class-cartflows-step-post-type.php:411
2529
+ #. translators: %s: singular custom post type name
2530
+ msgid "%s published."
2531
+ msgstr ""
2532
+
2533
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:356
2534
+ #: modules/flow/classes/class-cartflows-step-post-type.php:413
2535
+ #. translators: %s: singular custom post type name
2536
+ msgid "%s saved."
2537
+ msgstr ""
2538
+
2539
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:358
2540
+ #: modules/flow/classes/class-cartflows-step-post-type.php:415
2541
+ #. translators: %s: singular custom post type name
2542
+ msgid "%s submitted."
2543
+ msgstr ""
2544
+
2545
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:360
2546
+ #: modules/flow/classes/class-cartflows-step-post-type.php:417
2547
+ #. translators: %s: singular custom post type name
2548
+ msgid "%s scheduled for."
2549
+ msgstr ""
2550
+
2551
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:362
2552
+ #: modules/flow/classes/class-cartflows-step-post-type.php:419
2553
+ #. translators: %s: singular custom post type name
2554
+ msgid "%s draft updated."
2555
+ msgstr ""
2556
+
2557
+ #: modules/flow/classes/class-cartflows-step-post-type.php:163
2558
+ msgid "Search Steps"
2559
+ msgstr ""
2560
+
2561
+ #: modules/flow/classes/class-cartflows-step-post-type.php:164
2562
+ msgid "All Steps"
2563
+ msgstr ""
2564
+
2565
+ #: modules/flow/classes/class-cartflows-step-post-type.php:168
2566
+ msgid "Update Step"
2567
+ msgstr ""
2568
+
2569
+ #: modules/flow/classes/class-cartflows-step-post-type.php:170
2570
+ msgid "New Step Name"
2571
+ msgstr ""
2572
+
2573
+ #: modules/flow/classes/class-cartflows-step-post-type.php:211
2574
+ msgid "Step Type"
2575
+ msgstr ""
2576
+
2577
+ #: modules/flow/classes/class-cartflows-step-post-type.php:221
2578
+ msgid "Step Flow"
2579
+ msgstr ""
2580
+
2581
+ #: modules/flow/classes/class-cartflows-step-post-type.php:246
2582
+ #: modules/flow/view/meta-flow-steps.php:16
2583
+ msgid "Optin (Woo)"
2584
+ msgstr ""
2585
+
2586
+ #: modules/flow/classes/class-cartflows-step-post-type.php:267
2587
+ #: modules/flow/view/meta-flow-steps.php:14
2588
+ msgid "Upsell (Woo)"
2589
+ msgstr ""
2590
+
2591
+ #: modules/flow/classes/class-cartflows-step-post-type.php:274
2592
+ #: modules/flow/view/meta-flow-steps.php:15
2593
+ msgid "Downsell (Woo)"
2594
+ msgstr ""
2595
+
2596
+ #: modules/flow/view/view-flow-inner-step.php:30
2597
+ msgid "Control"
2598
+ msgstr ""
2599
+
2600
+ #: modules/flow/view/view-flow-inner-step.php:32
2601
+ #. translators: %s badge count
2602
+ msgid "Variation-%s"
2603
+ msgstr ""
2604
+
2605
+ #: modules/flow/view/view-flow-inner-step.php:44
2606
+ msgid "No Product Assigned"
2607
+ msgstr ""
2608
+
2609
+ #: modules/flow/view/view-flow-inner-step.php:48
2610
+ msgid "Global Checkout - Remove selected checkout product"
2611
+ msgstr ""
2612
+
2613
+ #: modules/flow/view/view-remote-importer.php:19
2614
+ msgid "Steps Library"
2615
+ msgstr ""
2616
+
2617
+ #: modules/flow/view/view-remote-importer.php:68
2618
+ msgid "Create Step"
2619
+ msgstr ""
2620
+
2621
+ #: modules/flow/view/view-remote-importer.php:70
2622
+ msgid "You need a Cartflows Pro version to import Upsell / Downsell"
2623
+ msgstr ""
2624
+
2625
+ #: modules/landing/classes/class-cartflows-landing-meta.php:66
2626
+ msgid "Landing Page Settings"
2627
+ msgstr ""
2628
+
2629
+ #: modules/landing/classes/class-cartflows-landing-meta.php:171
2630
+ msgid "Next Step Link"
2631
+ msgstr ""
2632
+
2633
+ #: modules/optin/classes/class-cartflows-optin-markup.php:223
2634
+ msgid "Please place shortcode on Optin step-type only."
2635
+ msgstr ""
2636
+
2637
+ #: modules/optin/classes/class-cartflows-optin-markup.php:283
2638
+ msgid ""
2639
+ "No product is selected. Please select a Simple, Virtual and Free product "
2640
+ "from the meta settings."
2641
+ msgstr ""
2642
+
2643
+ #: modules/optin/classes/class-cartflows-optin-markup.php:300
2644
+ msgid "Please update the selected product's price to zero (0)."
2645
+ msgstr ""
2646
+
2647
+ #: modules/optin/classes/class-cartflows-optin-markup.php:309
2648
+ #: modules/optin/classes/class-cartflows-optin-markup.php:313
2649
+ msgid "Please select a Simple, Virtual and Free product."
2650
+ msgstr ""
2651
+
2652
+ #: modules/optin/classes/class-cartflows-optin-meta.php:94
2653
+ msgid "Optin Settings"
2654
+ msgstr ""
2655
+
2656
+ #: modules/optin/classes/class-cartflows-optin-meta.php:103
2657
+ msgid "Optin Design"
2658
+ msgstr ""
2659
+
2660
+ #: modules/optin/classes/class-cartflows-optin-meta.php:145
2661
+ msgid "Form Fields"
2662
+ msgstr ""
2663
+
2664
+ #: modules/optin/classes/class-cartflows-optin-meta.php:226
2665
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:250
2666
+ msgid "Design"
2667
+ msgstr ""
2668
+
2669
+ #: modules/optin/classes/class-cartflows-optin-meta.php:277
2670
+ msgid "Add this shortcode to your optin page"
2671
+ msgstr ""
2672
+
2673
+ #: modules/optin/classes/class-cartflows-optin-meta.php:302
2674
+ msgid "Select Free Product"
2675
+ msgstr ""
2676
+
2677
+ #: modules/optin/classes/class-cartflows-optin-meta.php:303
2678
+ msgid "Select Free and Virtual product only."
2679
+ msgstr ""
2680
+
2681
+ #: modules/optin/classes/class-cartflows-optin-meta.php:357
2682
+ msgid "Pass Fields as URL Parameters"
2683
+ msgstr ""
2684
+
2685
+ #: modules/optin/classes/class-cartflows-optin-meta.php:360
2686
+ msgid "Enable"
2687
+ msgstr ""
2688
+
2689
+ #: modules/optin/classes/class-cartflows-optin-meta.php:361
2690
+ msgid ""
2691
+ "You can pass specific fields from the form to next step as URL query "
2692
+ "parameters."
2693
+ msgstr ""
2694
+
2695
+ #: modules/optin/classes/class-cartflows-optin-meta.php:372
2696
+ msgid "Enter form field"
2697
+ msgstr ""
2698
+
2699
+ #: modules/optin/classes/class-cartflows-optin-meta.php:375
2700
+ #: modules/optin/classes/class-cartflows-optin-meta.php:385
2701
+ msgid "Enter comma seprated field name. E.g. first_name, last_name"
2702
+ msgstr ""
2703
+
2704
+ #: modules/optin/classes/class-cartflows-optin-meta.php:377
2705
+ msgid "Fields to pass, separated by commas"
2706
+ msgstr ""
2707
+
2708
+ #: modules/optin/classes/class-cartflows-optin-meta.php:387
2709
+ #. translators: %s: link
2710
+ msgid ""
2711
+ "You can pass field value as a URL parameter to the next step. %1$sClick "
2712
+ "here%2$s for more information."
2713
+ msgstr ""
2714
+
2715
+ #: modules/optin/classes/class-cartflows-optin-meta.php:550
2716
+ msgid "Button Text"
2717
+ msgstr ""
2718
+
2719
+ #: modules/optin/classes/class-cartflows-optin-meta.php:561
2720
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:319
2721
+ msgid "Font Size"
2722
+ msgstr ""
2723
+
2724
+ #: modules/optin/classes/class-cartflows-optin-meta.php:619
2725
+ msgid "Position"
2726
+ msgstr ""
2727
+
2728
+ #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:127
2729
+ msgid "No completed or processing order found to show the order details form demo."
2730
+ msgstr ""
2731
+
2732
+ #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:131
2733
+ msgid "Order not found. You cannot access this page directly."
2734
+ msgstr ""
2735
+
2736
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:95
2737
+ msgid "Thank You Settings"
2738
+ msgstr ""
2739
+
2740
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:104
2741
+ msgid "Thank You Design"
2742
+ msgstr ""
2743
+
2744
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:172
2745
+ msgid "Thank You Page Text"
2746
+ msgstr ""
2747
+
2748
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:178
2749
+ msgid "It will change the default text on thank you page."
2750
+ msgstr ""
2751
+
2752
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:186
2753
+ msgid "Redirect After Purchase"
2754
+ msgstr ""
2755
+
2756
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:195
2757
+ msgid "Redirect Link"
2758
+ msgstr ""
2759
+
2760
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:199
2761
+ msgid "https://"
2762
+ msgstr ""
2763
+
2764
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:256
2765
+ msgid "Edit Fields"
2766
+ msgstr ""
2767
+
2768
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:359
2769
+ msgid "Advanced Options"
2770
+ msgstr ""
2771
+
2772
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:369
2773
+ msgid "Container Width (In px)"
2774
+ msgstr ""
2775
+
2776
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:391
2777
+ msgid "Enable Order Overview "
2778
+ msgstr ""
2779
+
2780
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:399
2781
+ msgid "Enable Order Details "
2782
+ msgstr ""
2783
+
2784
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:407
2785
+ msgid "Enable Billing Details "
2786
+ msgstr ""
2787
+
2788
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:415
2789
+ msgid "Enable Shipping Details "
2790
+ msgstr ""
2791
+
2792
+ #: modules/widgets/class-cartflows-next-step.php:24
2793
+ msgid "CartFlows Next Step"
2794
+ msgstr ""
2795
+
2796
+ #: modules/widgets/class-cartflows-next-step.php:26
2797
+ msgid "Next Step Widgets"
2798
+ msgstr ""
2799
+
2800
+ #: modules/widgets/class-cartflows-next-step.php:106
2801
+ msgid "New title"
2802
+ msgstr ""
2803
+
2804
+ #: modules/widgets/class-cartflows-next-step.php:123
2805
+ msgid "Title:"
2806
+ msgstr ""
2807
+
2808
+ #: modules/widgets/class-cartflows-next-step.php:127
2809
+ msgid "Flow ID:"
2810
+ msgstr ""
2811
+
2812
+ #: modules/widgets/class-cartflows-next-step.php:131
2813
+ msgid "Step ID:"
2814
+ msgstr ""
2815
+
2816
+ #: woocommerce/template/cart/cart-shipping.php:51
2817
+ #. Translators: $s shipping destination.
2818
+ msgid "Estimate for %s."
2819
+ msgstr ""
2820
+
2821
+ #: woocommerce/template/cart/cart-shipping.php:52
2822
+ msgid "Change address"
2823
+ msgstr ""
2824
+
2825
+ #: woocommerce/template/cart/cart-shipping.php:54
2826
+ msgid "This is only an estimate. Prices will be updated during checkout."
2827
+ msgstr ""
2828
+
2829
+ #: woocommerce/template/cart/cart-shipping.php:61
2830
+ msgid "Enter your address to view shipping options."
2831
+ msgstr ""
2832
+
2833
+ #: woocommerce/template/cart/cart-shipping.php:63
2834
+ msgid ""
2835
+ "There are no shipping methods available. Please ensure that your address "
2836
+ "has been entered correctly, or contact us if you need any help."
2837
+ msgstr ""
2838
+
2839
+ #: woocommerce/template/cart/cart-shipping.php:66
2840
+ #. Translators: $s shipping destination.
2841
+ msgid "No shipping options were found for %s."
2842
+ msgstr ""
2843
+
2844
+ #: woocommerce/template/cart/cart-shipping.php:67
2845
+ msgid "Enter a different address"
2846
+ msgstr ""
2847
+
2848
+ #: woocommerce/template/checkout/form-billing.php:27
2849
+ msgid "Billing &amp; Shipping"
2850
+ msgstr ""
2851
+
2852
+ #: woocommerce/template/checkout/form-billing.php:31
2853
+ msgid "Billing details"
2854
+ msgstr ""
2855
+
2856
+ #: woocommerce/template/checkout/form-billing.php:59
2857
+ msgid "Create an account?"
2858
+ msgstr ""
2859
+
2860
+ #: woocommerce/template/checkout/form-checkout.php:26
2861
+ msgid "You must be logged in to checkout."
2862
+ msgstr ""
2863
+
2864
+ #: woocommerce/template/checkout/form-coupon.php:26
2865
+ msgid "Have a coupon?"
2866
+ msgstr ""
2867
+
2868
+ #: woocommerce/template/checkout/form-coupon.php:26
2869
+ msgid "Click here to enter your code"
2870
+ msgstr ""
2871
+
2872
+ #: woocommerce/template/checkout/form-coupon.php:31
2873
+ msgid "If you have a coupon code, please apply it below."
2874
+ msgstr ""
2875
+
2876
+ #: woocommerce/template/checkout/form-coupon.php:34
2877
+ msgid "Coupon code"
2878
+ msgstr ""
2879
+
2880
+ #: woocommerce/template/checkout/form-coupon.php:38
2881
+ msgid "Apply coupon"
2882
+ msgstr ""
2883
+
2884
+ #: woocommerce/template/checkout/form-login.php:26
2885
+ msgid "Returning customer?"
2886
+ msgstr ""
2887
+
2888
+ #: woocommerce/template/checkout/form-login.php:26
2889
+ msgid "Click here to login"
2890
+ msgstr ""
2891
+
2892
+ #: woocommerce/template/checkout/form-login.php:32
2893
+ msgid ""
2894
+ "If you have shopped with us before, please enter your details below. If you "
2895
+ "are a new customer, please proceed to the Billing &amp; Shipping section."
2896
+ msgstr ""
2897
+
2898
+ #: woocommerce/template/checkout/form-shipping.php:26
2899
+ msgid "Ship to a different address?"
2900
+ msgstr ""
2901
+
2902
+ #: woocommerce/template/checkout/form-shipping.php:57
2903
+ msgid "Additional information"
2904
+ msgstr ""
2905
+
2906
+ #: woocommerce/template/checkout/payment.php:33
2907
+ msgid ""
2908
+ "Sorry, it seems that there are no available payment methods for your state. "
2909
+ "Please contact us if you require assistance or wish to make alternate "
2910
+ "arrangements."
2911
+ msgstr ""
2912
+
2913
+ #: woocommerce/template/checkout/payment.php:33
2914
+ msgid "Please fill in your details above to see available payment methods."
2915
+ msgstr ""
2916
+
2917
+ #: woocommerce/template/checkout/payment.php:42
2918
+ #. translators: $1 and $2 opening and closing emphasis tags respectively
2919
+ msgid ""
2920
+ "Since your browser does not support JavaScript, or it is disabled, please "
2921
+ "ensure you click the %1$sUpdate Totals%2$s button before placing your "
2922
+ "order. You may be charged more than the amount stated above if you fail to "
2923
+ "do so."
2924
+ msgstr ""
2925
+
2926
+ #: woocommerce/template/checkout/payment.php:44
2927
+ msgid "Update totals"
2928
+ msgstr ""
2929
+
2930
+ #: woocommerce/template/checkout/review-order.php:26
2931
+ #: woocommerce/template/order/order-details.php:57
2932
+ msgid "Product"
2933
+ msgstr ""
2934
+
2935
+ #: woocommerce/template/checkout/review-order.php:27
2936
+ #: woocommerce/template/checkout/review-order.php:107
2937
+ #: woocommerce/template/order/order-details.php:58
2938
+ msgid "Total"
2939
+ msgstr ""
2940
+
2941
+ #: woocommerce/template/checkout/review-order.php:60
2942
+ msgid "Subtotal"
2943
+ msgstr ""
2944
+
2945
+ #: woocommerce/template/checkout/thankyou.php:30
2946
+ msgid ""
2947
+ "Unfortunately your order cannot be processed as the originating "
2948
+ "bank/merchant has declined your transaction. Please attempt your purchase "
2949
+ "again."
2950
+ msgstr ""
2951
+
2952
+ #: woocommerce/template/checkout/thankyou.php:33
2953
+ msgid "Pay"
2954
+ msgstr ""
2955
+
2956
+ #: woocommerce/template/checkout/thankyou.php:35
2957
+ msgid "My account"
2958
+ msgstr ""
2959
+
2960
+ #: woocommerce/template/checkout/thankyou.php:49
2961
+ msgid "Order number:"
2962
+ msgstr ""
2963
+
2964
+ #: woocommerce/template/checkout/thankyou.php:54
2965
+ msgid "Date:"
2966
+ msgstr ""
2967
+
2968
+ #: woocommerce/template/checkout/thankyou.php:60
2969
+ msgid "Email:"
2970
+ msgstr ""
2971
+
2972
+ #: woocommerce/template/checkout/thankyou.php:67
2973
+ msgid "Total:"
2974
+ msgstr ""
2975
+
2976
+ #: woocommerce/template/checkout/thankyou.php:74
2977
+ msgid "Payment method:"
2978
+ msgstr ""
2979
+
2980
+ #: woocommerce/template/global/form-login.php:34
2981
+ msgid "Username or email"
2982
+ msgstr ""
2983
+
2984
+ #: woocommerce/template/global/form-login.php:38
2985
+ msgid "Password"
2986
+ msgstr ""
2987
+
2988
+ #: woocommerce/template/global/form-login.php:48
2989
+ msgid "Login"
2990
+ msgstr ""
2991
+
2992
+ #: woocommerce/template/global/form-login.php:53
2993
+ msgid "Remember me"
2994
+ msgstr ""
2995
+
2996
+ #: woocommerce/template/global/form-login.php:57
2997
+ msgid "Lost your password?"
2998
+ msgstr ""
2999
+
3000
+ #: woocommerce/template/order/order-details.php:51
3001
+ msgid "Order details"
3002
+ msgstr ""
3003
+
3004
+ #: woocommerce/template/order/order-details.php:99
3005
+ msgid "Note:"
3006
+ msgstr ""
3007
+
3008
+ #. Plugin Name of the plugin/theme
3009
+ msgid "CartFlows"
3010
+ msgstr ""
3011
+
3012
+ #. Author URI of the plugin/theme
3013
+ msgid "https://cartflows.com/"
3014
+ msgstr ""
3015
+
3016
+ #. Description of the plugin/theme
3017
+ msgid "Create beautiful checkout pages & sales flows for WooCommerce."
3018
+ msgstr ""
3019
+
3020
+ #. Author of the plugin/theme
3021
+ msgid "CartFlows Inc"
3022
+ msgstr ""
3023
+
3024
+ #: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:254
3025
+ msgctxt "Width."
3026
+ msgid "Auto"
3027
+ msgstr ""
3028
+
3029
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:99
3030
+ msgctxt "flow general name"
3031
+ msgid "Flows"
3032
+ msgstr ""
3033
+
3034
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:100
3035
+ msgctxt "flow singular name"
3036
+ msgid "Flow"
3037
+ msgstr ""
3038
+
3039
+ #: modules/flow/classes/class-cartflows-step-post-type.php:161
3040
+ msgctxt "flow step general name"
3041
+ msgid "Steps"
3042
+ msgstr ""
3043
+
3044
+ #: modules/flow/classes/class-cartflows-step-post-type.php:162
3045
+ msgctxt "flow step singular name"
3046
+ msgid "Step"
3047
+ msgstr ""
3048
+
3049
+ #: modules/flow/classes/class-cartflows-step-post-type.php:315
3050
+ msgctxt "cartflows"
3051
+ msgid "CartFlows — Boxed"
3052
+ msgstr ""
3053
+
3054
+ #: modules/flow/classes/class-cartflows-step-post-type.php:316
3055
+ msgctxt "cartflows"
3056
+ msgid "Template for Page Builders"
3057
  msgstr ""
modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php ADDED
@@ -0,0 +1,834 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2
+ /**
3
+ * Checkout Form Module for Beaver Builder
4
+ *
5
+ * @package cartflows
6
+ */
7
+
8
+ /**
9
+ * Checkout Form Module for Beaver Builder
10
+ *
11
+ * @since x.x.x
12
+ */
13
+ class Cartflows_BB_Checkout_Form extends FLBuilderModule {
14
+
15
+ /**
16
+ * Constructor function for the module. You must pass the
17
+ * name, description, dir and url in an array to the parent class.
18
+ *
19
+ * @method __construct
20
+ */
21
+ public function __construct() {
22
+
23
+ $step_type = Cartflows_BB_Helper::cartflows_bb_step_type();
24
+
25
+ $is_enabled = ( 'checkout' === $step_type && wcf()->is_woo_active ) ? true : false;
26
+
27
+ parent::__construct(
28
+ array(
29
+ 'name' => __( 'Checkout Form', 'cartflows' ),
30
+ 'description' => __( 'Checkout Form.', 'cartflows' ),
31
+ 'category' => __( 'Cartflows Modules', 'cartflows' ),
32
+ 'group' => __( 'Cartflows Modules', 'cartflows' ),
33
+ 'dir' => CARTFLOWS_DIR . 'modules/beaver-builder/cartflows-bb-checkout-form/',
34
+ 'url' => CARTFLOWS_URL . 'modules/beaver-builder/cartflows-bb-checkout-form/',
35
+ 'partial_refresh' => false, // Defaults to false and can be omitted.
36
+ 'icon' => 'bb-checkout-form.svg',
37
+ 'enabled' => $is_enabled,
38
+ )
39
+ );
40
+ }
41
+
42
+ /**
43
+ * Function to get the icon for the module
44
+ *
45
+ * @method get_icons
46
+ * @param string $icon gets the icon for the module.
47
+ */
48
+ public function get_icon( $icon = '' ) {
49
+
50
+ if ( '' !== $icon && file_exists( CARTFLOWS_DIR . 'modules/beaver-builder/cartflows-bb-checkout-form/icon/' . $icon ) ) {
51
+
52
+ return fl_builder_filesystem()->file_get_contents( CARTFLOWS_DIR . 'modules/beaver-builder/cartflows-bb-checkout-form/icon/' . $icon );
53
+ }
54
+
55
+ return '';
56
+ }
57
+
58
+ /**
59
+ * Dynamic options of module and add filters.
60
+ *
61
+ * @since x.x.x
62
+ */
63
+ public function dynamic_option_filters() {
64
+
65
+ $checkout_id = get_the_id();
66
+
67
+ $flow_id = wcf()->utils->get_flow_id_from_step_id( $checkout_id );
68
+
69
+ if ( ! wcf()->flow->is_flow_testmode( $flow_id ) ) {
70
+
71
+ $products = wcf()->utils->get_selected_checkout_products( $checkout_id );
72
+
73
+ if ( is_array( $products ) && empty( $products[0]['product'] ) ) {
74
+ wc_clear_notices();
75
+ wc_add_notice( __( 'No product is selected. Please select products from the checkout meta settings to continue.', 'cartflows' ), 'error' );
76
+ }
77
+ }
78
+
79
+ if ( ! _is_cartflows_pro() ) {
80
+ add_filter(
81
+ 'cartflows_checkout_meta_wcf-checkout-layout',
82
+ function ( $value ) {
83
+
84
+ $value = 'two-column';
85
+
86
+ return $value;
87
+ },
88
+ 10,
89
+ 1
90
+ );
91
+ }
92
+
93
+ do_action( 'cartflows_bb_checkout_options_filters', $this->settings );
94
+
95
+ }
96
+
97
+ /**
98
+ * Function to get layout types.
99
+ *
100
+ * @since x.x.x
101
+ * @access public
102
+ */
103
+ public static function get_layout_types() {
104
+
105
+ $layout_options = array();
106
+
107
+ if ( ! _is_cartflows_pro() ) {
108
+ $layout_options = array(
109
+ 'one-column' => __( 'One Column ( PRO )', 'cartflows' ),
110
+ 'two-column' => __( 'Two Column', 'cartflows' ),
111
+ 'two-step' => __( 'Two Step ( PRO )', 'cartflows' ),
112
+ );
113
+ } else {
114
+ $layout_options = array(
115
+ 'one-column' => __( 'One Column', 'cartflows' ),
116
+ 'two-column' => __( 'Two Column', 'cartflows' ),
117
+ 'two-step' => __( 'Two Step', 'cartflows' ),
118
+ );
119
+ }
120
+
121
+ return $layout_options;
122
+ }
123
+
124
+ /**
125
+ * Function to get skin types.
126
+ *
127
+ * @since x.x.x
128
+ * @access public
129
+ */
130
+ public static function get_skin_types() {
131
+
132
+ $skin_options = array();
133
+
134
+ if ( ! _is_cartflows_pro() ) {
135
+ $skin_options = array(
136
+ 'default' => __( 'Default', 'cartflows' ),
137
+ 'style-one' => __( 'Floating Labels ( PRO )', 'cartflows' ),
138
+ );
139
+ } else {
140
+ $skin_options = array(
141
+ 'default' => __( 'Default', 'cartflows' ),
142
+ 'style-one' => __( 'Floating Labels', 'cartflows' ),
143
+ );
144
+ }
145
+ return $skin_options;
146
+ }
147
+
148
+ }
149
+
150
+ /**
151
+ * Register the module and its form settings.
152
+ */
153
+ FLBuilder::register_module(
154
+ 'Cartflows_BB_Checkout_Form',
155
+ array(
156
+ 'general' => array(
157
+ 'title' => __( 'General', 'cartflows' ),
158
+ 'sections' => array(
159
+ 'layout' => array(
160
+ 'title' => 'Layout',
161
+ 'fields' => array(
162
+ 'checkout_layout' => array(
163
+ 'type' => 'select',
164
+ 'label' => __( 'Select Layout', 'cartflows' ),
165
+ /* translators: %s: link */
166
+ 'description' => ! _is_cartflows_pro() ? sprintf( __( 'The PRO layout options are available in the CartFlows Pro. %1$s Upgrade Now! %2$s', 'cartflows' ), '<a href="https://cartflows.com/" target="blank" class="cartflows-bb-link">', '</a>' ) : '',
167
+ 'default' => 'two-column',
168
+ 'options' => Cartflows_BB_Checkout_Form::get_layout_types(),
169
+ 'preview' => array(
170
+ 'type' => ( ! _is_cartflows_pro() ) ? 'none' : 'refresh',
171
+ ),
172
+ ),
173
+ ),
174
+ ),
175
+ ),
176
+ ),
177
+ 'style' => array(
178
+ 'title' => __( 'Style', 'cartflows' ),
179
+ 'sections' => array(
180
+ 'global_style' => array(
181
+ 'title' => __( 'Global', 'cartflows' ),
182
+ 'fields' => array(
183
+ 'global_primary_color' => array(
184
+ 'type' => 'color',
185
+ 'label' => __( 'Primary Color', 'cartflows' ),
186
+ 'default' => '',
187
+ 'show_reset' => true,
188
+ 'connections' => array( 'color' ),
189
+ 'show_alpha' => true,
190
+ ),
191
+ 'global_text_color' => array(
192
+ 'type' => 'color',
193
+ 'label' => __( 'Text Color', 'cartflows' ),
194
+ 'default' => '',
195
+ 'show_reset' => true,
196
+ 'connections' => array( 'color' ),
197
+ 'show_alpha' => true,
198
+ 'preview' => array(
199
+ 'type' => 'css',
200
+ 'selector' => '.wcf-embed-checkout-form, .wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p',
201
+ 'property' => 'color',
202
+ 'unit' => 'px',
203
+ ),
204
+ ),
205
+ 'global_typography' => array(
206
+ 'type' => 'typography',
207
+ 'label' => __( 'Typography', 'cartflows' ),
208
+ 'responsive' => true,
209
+ 'preview' => array(
210
+ 'type' => 'css',
211
+ 'selector' => '.wcf-embed-checkout-form',
212
+ ),
213
+ ),
214
+ ),
215
+ ),
216
+ 'heading' => array(
217
+ 'title' => __( 'Heading', 'cartflows' ),
218
+ 'fields' => array(
219
+ 'heading_color' => array(
220
+ 'type' => 'color',
221
+ 'label' => __( 'Text Color', 'cartflows' ),
222
+ 'default' => '',
223
+ 'show_reset' => true,
224
+ 'connections' => array( 'color' ),
225
+ 'show_alpha' => true,
226
+ 'preview' => array(
227
+ 'type' => 'css',
228
+ 'selector' => '.wcf-embed-checkout-form .woocommerce h3, .wcf-embed-checkout-form .woocommerce h3 span, .wcf-embed-checkout-form .woocommerce-checkout #order_review_heading, .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-steps .step-name, .wcf-embed-checkout-form .woocommerce .col2-set .col-1 h3,
229
+ .wcf-embed-checkout-form .woocommerce .col2-set .col-2 h3',
230
+ 'property' => 'color',
231
+ 'unit' => 'px',
232
+ ),
233
+ ),
234
+ 'heading_typography' => array(
235
+ 'type' => 'typography',
236
+ 'label' => __( 'Typography', 'cartflows' ),
237
+ 'responsive' => true,
238
+ 'preview' => array(
239
+ 'type' => 'css',
240
+ 'selector' => '.wcf-embed-checkout-form .woocommerce h3, .wcf-embed-checkout-form .woocommerce h3 span, .wcf-embed-checkout-form .woocommerce-checkout #order_review_heading, .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-steps .step-name, .wcf-embed-checkout-form .woocommerce .col2-set .col-1 h3,
241
+ .wcf-embed-checkout-form .woocommerce .col2-set .col-2 h3',
242
+ ),
243
+ ),
244
+ ),
245
+ ),
246
+ 'input_style' => array(
247
+ 'title' => __( 'Input Fields', 'cartflows' ),
248
+ 'fields' => array(
249
+ 'input_skins' => array(
250
+ 'type' => 'select',
251
+ 'label' => __( 'Style', 'cartflows' ),
252
+ /* translators: %s: link */
253
+ 'description' => ! _is_cartflows_pro() ? sprintf( __( 'The PRO style options are available in CartFlows Pro. %1$s Upgrade Now! %2$s', 'cartflows' ), '<a href="https://cartflows.com/" target="blank" class="cartflows-bb-link">', '</a>' ) : '',
254
+ 'default' => 'default',
255
+ 'options' => Cartflows_BB_Checkout_Form::get_skin_types(),
256
+ 'preview' => array(
257
+ 'type' => ( ! _is_cartflows_pro() ) ? 'none' : 'refresh',
258
+ ),
259
+ ),
260
+ 'label_color' => array(
261
+ 'type' => 'color',
262
+ 'label' => __( 'Label Color', 'cartflows' ),
263
+ 'default' => '',
264
+ 'show_reset' => true,
265
+ 'connections' => array( 'color' ),
266
+ 'show_alpha' => true,
267
+ 'preview' => array(
268
+ 'type' => 'css',
269
+ 'selector' => '.woocommerce-checkout label, .woocommerce form p.form-row label',
270
+ 'property' => 'color',
271
+ 'unit' => 'px',
272
+ ),
273
+ ),
274
+ 'input_bgcolor' => array(
275
+ 'type' => 'color',
276
+ 'label' => __( 'Field Background Color', 'cartflows' ),
277
+ 'default' => '',
278
+ 'show_reset' => true,
279
+ 'connections' => array( 'color' ),
280
+ 'show_alpha' => true,
281
+ 'preview' => array(
282
+ 'type' => 'css',
283
+ 'selector' => '#order_review .wcf-custom-coupon-field input[type="text"],
284
+ .woocommerce form .form-row input.input-text,
285
+ .woocommerce form .form-row textarea,
286
+ .select2-container--default .select2-selection--single,
287
+ .woocommerce form .form-row select.select,
288
+ .woocommerce form .form-row select',
289
+ 'property' => 'background-color',
290
+ 'unit' => 'px',
291
+ ),
292
+ ),
293
+ 'input_color' => array(
294
+ 'type' => 'color',
295
+ 'label' => __( 'Input Text / Placeholder Color', 'cartflows' ),
296
+ 'default' => '',
297
+ 'show_reset' => true,
298
+ 'connections' => array( 'color' ),
299
+ 'show_alpha' => true,
300
+ 'preview' => array(
301
+ 'type' => 'css',
302
+ 'selector' => '#order_review .wcf-custom-coupon-field input[type="text"],
303
+ .woocommerce form .form-row input.input-text,
304
+ .woocommerce form .form-row textarea,
305
+ .select2-container--default .select2-selection--single,
306
+ .woocommerce form .form-row select,
307
+ .wcf-embed-checkout-form .woocommerce form .form-row select,
308
+ .wcf-embed-checkout-form ::placeholder,
309
+ .wcf-embed-checkout-form ::-webkit-input-placeholder',
310
+ 'property' => 'color',
311
+ 'unit' => 'px',
312
+ ),
313
+ ),
314
+ 'input_text_typography' => array(
315
+ 'type' => 'typography',
316
+ 'label' => __( 'Typography', 'cartflows' ),
317
+ 'responsive' => true,
318
+ 'preview' => array(
319
+ 'type' => 'css',
320
+ 'selector' => '.wcf-embed-checkout-form .woocommerce form .form-row input.input-text, .wcf-embed-checkout-form .woocommerce form .form-row textarea, .wcf-embed-checkout-form .select2-container--default .select2-selection--single, .wcf-embed-checkout-form .woocommerce form .form-row select.select, .wcf-embed-checkout-form .woocommerce .col2-set .col-1, .wcf-embed-checkout-form .woocommerce .col2-set .col-2, .wcf-embed-checkout-form .woocommerce form p.form-row label, .wcf-embed-checkout-form .woocommerce #payment [type="radio"]:checked + label, .wcf-embed-checkout-form .woocommerce #payment [type="radio"]:not(:checked) + label, .wcf-embed-checkout-form .woocommerce form .form-row select',
321
+ ),
322
+ ),
323
+ 'input_border_style' => array(
324
+ 'type' => 'select',
325
+ 'label' => __( 'Border Style', 'cartflows' ),
326
+ 'default' => 'solid',
327
+ 'help' => __( 'The type of border to use. Double borders must have a width of at least 3px to render properly.', 'cartflows' ),
328
+ 'options' => array(
329
+ 'none' => __( 'None', 'cartflows' ),
330
+ 'solid' => __( 'Solid', 'cartflows' ),
331
+ 'dashed' => __( 'Dashed', 'cartflows' ),
332
+ 'dotted' => __( 'Dotted', 'cartflows' ),
333
+ 'double' => __( 'Double', 'cartflows' ),
334
+ ),
335
+ 'toggle' => array(
336
+ 'solid' => array(
337
+ 'fields' => array( 'input_border_width', 'input_border_radius', 'input_border_color' ),
338
+ ),
339
+ 'dashed' => array(
340
+ 'fields' => array( 'input_border_width', 'input_border_radius', 'input_border_color' ),
341
+ ),
342
+ 'dotted' => array(
343
+ 'fields' => array( 'input_border_width', 'input_border_radius', 'input_border_color' ),
344
+ ),
345
+ 'double' => array(
346
+ 'fields' => array( 'input_border_width', 'input_border_radius', 'input_border_color' ),
347
+ ),
348
+ ),
349
+ ),
350
+ 'input_border_width' => array(
351
+ 'type' => 'unit',
352
+ 'label' => __( 'Border Width', 'cartflows' ),
353
+ 'slider' => true,
354
+ 'units' => array( 'px' ),
355
+ 'maxlength' => '3',
356
+ 'size' => '6',
357
+ 'placeholder' => '1',
358
+ 'default' => '1',
359
+ 'preview' => array(
360
+ 'type' => 'css',
361
+ 'selector' => '#order_review .wcf-custom-coupon-field input[type="text"],
362
+ .woocommerce form .form-row input.input-text,
363
+ .woocommerce form .form-row textarea,
364
+ .select2-container--default .select2-selection--single,
365
+ .woocommerce form .form-row select.select,
366
+ .woocommerce form .form-row select',
367
+ 'property' => 'border-width',
368
+ 'unit' => 'px',
369
+ ),
370
+ ),
371
+ 'input_border_color' => array(
372
+ 'type' => 'color',
373
+ 'label' => __( 'Border Color', 'cartflows' ),
374
+ 'default' => '',
375
+ 'show_reset' => true,
376
+ 'show_alpha' => true,
377
+ 'preview' => array(
378
+ 'type' => 'css',
379
+ 'selector' => '#order_review .wcf-custom-coupon-field input[type="text"],
380
+ .woocommerce form .form-row input.input-text,
381
+ .woocommerce form .form-row textarea,
382
+ .select2-container--default .select2-selection--single,
383
+ .woocommerce form .form-row select.select,
384
+ .woocommerce form .form-row select',
385
+ 'property' => 'border-color',
386
+ 'unit' => 'px',
387
+ ),
388
+ ),
389
+ 'input_border_radius' => array(
390
+ 'type' => 'unit',
391
+ 'label' => __( 'Border Radius', 'cartflows' ),
392
+ 'slider' => true,
393
+ 'units' => array( 'px' ),
394
+ 'maxlength' => '3',
395
+ 'size' => '6',
396
+ 'placeholder' => '0',
397
+ 'preview' => array(
398
+ 'type' => 'css',
399
+ 'selector' => '#order_review .wcf-custom-coupon-field input[type="text"],
400
+ .woocommerce form .form-row input.input-text,
401
+ .woocommerce form .form-row textarea,
402
+ .select2-container--default .select2-selection--single,
403
+ .woocommerce form .form-row select.select,
404
+ .woocommerce form .form-row select',
405
+ 'property' => 'border-radius',
406
+ 'unit' => 'px',
407
+ ),
408
+ ),
409
+ ),
410
+ ),
411
+ 'button_style' => array(
412
+ 'title' => __( 'Buttons', 'cartflows' ),
413
+ 'fields' => array(
414
+ 'button_text_color' => array(
415
+ 'type' => 'color',
416
+ 'label' => __( 'Text Color', 'cartflows' ),
417
+ 'default' => '',
418
+ 'show_reset' => true,
419
+ 'show_alpha' => true,
420
+ 'preview' => array(
421
+ 'type' => 'css',
422
+ 'selector' => '.woocommerce #order_review button,
423
+ .woocommerce form.woocommerce-form-login .form-row button,
424
+ .woocommerce #order_review button.wcf-btn-small,
425
+ .woocommerce-checkout form.woocommerce-form-login .button,
426
+ .woocommerce-checkout form.checkout_coupon .button,
427
+ form.checkout_coupon .button,
428
+ .wcf-embed-checkout-form-nav-btns .wcf-next-button,
429
+ .wcf-embed-checkout-form-nav-btns a.wcf-next-button,
430
+ button.wcf-pre-checkout-offer-btn',
431
+ 'property' => 'color',
432
+ 'unit' => 'px',
433
+ ),
434
+ 'preview' => array(
435
+ 'type' => 'refresh',
436
+ ),
437
+ ),
438
+ 'button_text_hover_color' => array(
439
+ 'type' => 'color',
440
+ 'label' => __( 'Text Hover Color', 'cartflows' ),
441
+ 'default' => '',
442
+ 'show_reset' => true,
443
+ 'show_alpha' => true,
444
+ 'preview' => array(
445
+ 'type' => 'css',
446
+ 'selector' => '.woocommerce-checkout form.login .button:hover,
447
+ .woocommerce-checkout form.checkout_coupon .button:hover,
448
+ .woocommerce #payment #place_order:hover,
449
+ .woocommerce #order_review button.wcf-btn-small:hover,
450
+ form.checkout_coupon .button:hover,
451
+ .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button:hover,
452
+ .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button:hover,
453
+ button.wcf-pre-checkout-offer-btn:hover',
454
+ 'property' => 'color',
455
+ 'unit' => 'px',
456
+ ),
457
+ ),
458
+ 'button_bg_color' => array(
459
+ 'type' => 'color',
460
+ 'label' => __( 'Background Color', 'cartflows' ),
461
+ 'default' => '',
462
+ 'show_reset' => true,
463
+ 'show_alpha' => true,
464
+ 'preview' => array(
465
+ 'type' => 'css',
466
+ 'selector' => '.woocommerce #order_review button,
467
+ .woocommerce form.woocommerce-form-login .form-row button,
468
+ .woocommerce #order_review button.wcf-btn-small,
469
+ .woocommerce-checkout form.woocommerce-form-login .button,
470
+ .woocommerce-checkout form.checkout_coupon .button,
471
+ form.checkout_coupon .button,
472
+ .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
473
+ .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button,
474
+ button.wcf-pre-checkout-offer-btn',
475
+ 'property' => 'background-color',
476
+ 'unit' => 'px',
477
+ ),
478
+ 'preview' => array(
479
+ 'type' => 'refresh',
480
+ ),
481
+ ),
482
+ 'button_bg_hover_color' => array(
483
+ 'type' => 'color',
484
+ 'label' => __( 'Background Hover Color', 'cartflows' ),
485
+ 'default' => '',
486
+ 'show_reset' => true,
487
+ 'show_alpha' => true,
488
+ 'preview' => array(
489
+ 'type' => 'css',
490
+ 'selector' => '.woocommerce-checkout form.login .button:hover,
491
+ .woocommerce-checkout form.checkout_coupon .button:hover,
492
+ .woocommerce #payment #place_order:hover,
493
+ .woocommerce #order_review button.wcf-btn-small:hover,
494
+ form.checkout_coupon .button:hover,
495
+ .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button:hover,
496
+ .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button:hover,
497
+ button.wcf-pre-checkout-offer-btn:hover',
498
+ 'property' => 'background-color',
499
+ 'unit' => 'px',
500
+ ),
501
+ ),
502
+ 'button_typography' => array(
503
+ 'type' => 'typography',
504
+ 'label' => __( 'Typography', 'cartflows' ),
505
+ 'responsive' => true,
506
+ 'preview' => array(
507
+ 'type' => 'css',
508
+ 'selector' => '.wcf-embed-checkout-form .woocommerce #order_review button, .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button, .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small, .wcf-embed-checkout-form .woocommerce-checkout form.woocommerce-form-login .button, .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button, .wcf-embed-checkout-form form.checkout_coupon .button, .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
509
+ body .wcf-pre-checkout-offer-wrapper #wcf-pre-checkout-offer-content button.wcf-pre-checkout-offer-btn',
510
+ ),
511
+ 'preview' => array(
512
+ 'type' => 'refresh',
513
+ ),
514
+ ),
515
+ 'button_border_style' => array(
516
+ 'type' => 'select',
517
+ 'label' => __( 'Border Style', 'cartflows' ),
518
+ 'default' => 'none',
519
+ 'help' => __( 'The type of border to use. Double borders must have a width of at least 3px to render properly.', 'cartflows' ),
520
+ 'options' => array(
521
+ 'none' => __( 'None', 'cartflows' ),
522
+ 'solid' => __( 'Solid', 'cartflows' ),
523
+ 'dashed' => __( 'Dashed', 'cartflows' ),
524
+ 'dotted' => __( 'Dotted', 'cartflows' ),
525
+ 'double' => __( 'Double', 'cartflows' ),
526
+ ),
527
+ 'toggle' => array(
528
+ 'solid' => array(
529
+ 'fields' => array( 'button_border_width', 'button_border_color', 'button_border_hover_color' ),
530
+ ),
531
+ 'dashed' => array(
532
+ 'fields' => array( 'button_border_width', 'button_border_color', 'button_border_hover_color' ),
533
+ ),
534
+ 'dotted' => array(
535
+ 'fields' => array( 'button_border_width', 'button_border_color', 'button_border_hover_color' ),
536
+ ),
537
+ 'double' => array(
538
+ 'fields' => array( 'button_border_width', 'button_border_color', 'button_border_hover_color' ),
539
+ ),
540
+ ),
541
+ 'preview' => array(
542
+ 'type' => 'css',
543
+ 'selector' => '.woocommerce #order_review button,
544
+ .woocommerce form.woocommerce-form-login .form-row button,
545
+ .woocommerce #order_review button.wcf-btn-small,
546
+ .woocommerce-checkout form.woocommerce-form-login .button,
547
+ .woocommerce-checkout form.checkout_coupon .button,
548
+ form.checkout_coupon .button,
549
+ .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
550
+ .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button,
551
+ button.wcf-pre-checkout-offer-btn',
552
+ 'property' => 'border-style',
553
+ ),
554
+ ),
555
+ 'button_border_width' => array(
556
+ 'type' => 'unit',
557
+ 'label' => __( 'Border Width', 'cartflows' ),
558
+ 'slider' => true,
559
+ 'units' => array( 'px' ),
560
+ 'maxlength' => '3',
561
+ 'size' => '6',
562
+ 'placeholder' => '1',
563
+ 'preview' => array(
564
+ 'type' => 'css',
565
+ 'selector' => '.woocommerce #order_review button,
566
+ .woocommerce form.woocommerce-form-login .form-row button,
567
+ .woocommerce #order_review button.wcf-btn-small,
568
+ .woocommerce-checkout form.woocommerce-form-login .button,
569
+ .woocommerce-checkout form.checkout_coupon .button,
570
+ form.checkout_coupon .button,
571
+ .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
572
+ .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button,
573
+ button.wcf-pre-checkout-offer-btn',
574
+ 'property' => 'border-width',
575
+ 'unit' => 'px',
576
+ ),
577
+ ),
578
+ 'button_border_color' => array(
579
+ 'type' => 'color',
580
+ 'label' => __( 'Border Color', 'cartflows' ),
581
+ 'default' => '',
582
+ 'show_reset' => true,
583
+ 'show_alpha' => true,
584
+ 'preview' => array(
585
+ 'type' => 'css',
586
+ 'selector' => '.woocommerce #order_review button,
587
+ .woocommerce form.woocommerce-form-login .form-row button,
588
+ .woocommerce #order_review button.wcf-btn-small,
589
+ .woocommerce-checkout form.woocommerce-form-login .button,
590
+ .woocommerce-checkout form.checkout_coupon .button,
591
+ form.checkout_coupon .button,
592
+ .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
593
+ .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button,
594
+ button.wcf-pre-checkout-offer-btn',
595
+ 'property' => 'border-color',
596
+ 'unit' => 'px',
597
+ ),
598
+ ),
599
+ 'button_border_hover_color' => array(
600
+ 'type' => 'color',
601
+ 'label' => __( 'Border Hover Color', 'cartflows' ),
602
+ 'default' => '',
603
+ 'show_reset' => true,
604
+ 'show_alpha' => true,
605
+ 'preview' => array(
606
+ 'type' => 'css',
607
+ 'selector' => '.woocommerce-checkout form.login .button:hover,
608
+ .woocommerce-checkout form.checkout_coupon .button:hover,
609
+ .woocommerce #payment #place_order:hover,
610
+ .woocommerce #order_review button.wcf-btn-small:hover,
611
+ form.checkout_coupon .button:hover,
612
+ .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button:hover,
613
+ .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button:hover,
614
+ button.wcf-pre-checkout-offer-btn:hover',
615
+ 'property' => 'border-color',
616
+ 'unit' => 'px',
617
+ ),
618
+ ),
619
+ 'button_border_radius' => array(
620
+ 'type' => 'unit',
621
+ 'label' => __( 'Border Radius', 'cartflows' ),
622
+ 'slider' => true,
623
+ 'units' => array( 'px' ),
624
+ 'maxlength' => '3',
625
+ 'size' => '6',
626
+ 'placeholder' => '0',
627
+ 'preview' => array(
628
+ 'type' => 'css',
629
+ 'selector' => '.woocommerce #order_review button,
630
+ .woocommerce form.woocommerce-form-login .form-row button,
631
+ .woocommerce #order_review button.wcf-btn-small,
632
+ .woocommerce-checkout form.woocommerce-form-login .button,
633
+ .woocommerce-checkout form.checkout_coupon .button,
634
+ form.checkout_coupon .button,
635
+ .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
636
+ .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button,
637
+ button.wcf-pre-checkout-offer-btn',
638
+ 'property' => 'border-radius',
639
+ 'unit' => 'px',
640
+ ),
641
+ ),
642
+ ),
643
+ ),
644
+ 'payment_style' => array(
645
+ 'title' => __( 'Payment Section', 'cartflows' ),
646
+ 'fields' => array(
647
+ 'payment_section_text_color' => array(
648
+ 'type' => 'color',
649
+ 'label' => __( 'Text Color', 'cartflows' ),
650
+ 'default' => '',
651
+ 'show_reset' => true,
652
+ 'connections' => array( 'color' ),
653
+ 'show_alpha' => true,
654
+ 'preview' => array(
655
+ 'type' => 'css',
656
+ 'selector' => '.woocommerce-checkout #payment, .woocommerce-checkout #payment label, .woocommerce-checkout #payment a',
657
+ 'property' => 'color',
658
+ 'unit' => 'px',
659
+ ),
660
+ ),
661
+ 'payment_section_desc_color' => array(
662
+ 'type' => 'color',
663
+ 'label' => __( 'Description Color', 'cartflows' ),
664
+ 'default' => '',
665
+ 'show_reset' => true,
666
+ 'connections' => array( 'color' ),
667
+ 'show_alpha' => true,
668
+ 'preview' => array(
669
+ 'type' => 'css',
670
+ 'selector' => '.woocommerce-checkout #payment div.payment_box',
671
+ 'property' => 'color',
672
+ 'unit' => 'px',
673
+ ),
674
+ ),
675
+ 'payment_info_bg_color' => array(
676
+ 'type' => 'color',
677
+ 'label' => __( 'Information Background Color', 'cartflows' ),
678
+ 'default' => '',
679
+ 'show_reset' => true,
680
+ 'connections' => array( 'color' ),
681
+ 'show_alpha' => true,
682
+ ),
683
+ 'payment_section_bg_color' => array(
684
+ 'type' => 'color',
685
+ 'label' => __( 'Section Background Color', 'cartflows' ),
686
+ 'default' => '',
687
+ 'show_reset' => true,
688
+ 'connections' => array( 'color' ),
689
+ 'show_alpha' => true,
690
+ 'preview' => array(
691
+ 'type' => 'css',
692
+ 'selector' => '.woocommerce-checkout #payment ul.payment_methods',
693
+ 'property' => 'background-color',
694
+ 'unit' => 'px',
695
+ ),
696
+ ),
697
+ 'payment_section_padding_dimension' => array(
698
+ 'type' => 'dimension',
699
+ 'label' => __( 'Section Padding', 'cartflows' ),
700
+ 'slider' => true,
701
+ 'units' => array( 'px' ),
702
+ 'responsive' => false,
703
+ 'preview' => array(
704
+ 'type' => 'css',
705
+ 'selector' => '.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods',
706
+ 'property' => 'padding',
707
+ 'unit' => 'px',
708
+ 'important' => true,
709
+ ),
710
+ ),
711
+ 'payment_section_margin_dimension' => array(
712
+ 'type' => 'dimension',
713
+ 'label' => __( 'Margin', 'cartflows' ),
714
+ 'slider' => true,
715
+ 'units' => array( 'px' ),
716
+ 'responsive' => false,
717
+ 'preview' => array(
718
+ 'type' => 'css',
719
+ 'selector' => '.wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods',
720
+ 'property' => 'margin',
721
+ 'unit' => 'px',
722
+ 'important' => true,
723
+ ),
724
+ ),
725
+ 'payment_section_border_radius' => array(
726
+ 'type' => 'unit',
727
+ 'label' => __( 'Border Radius', 'cartflows' ),
728
+ 'slider' => true,
729
+ 'units' => array( 'px' ),
730
+ 'maxlength' => '3',
731
+ 'size' => '6',
732
+ 'placeholder' => '0',
733
+ 'preview' => array(
734
+ 'type' => 'css',
735
+ 'selector' => '.woocommerce-checkout #payment ul.payment_methods',
736
+ 'property' => 'border-radius',
737
+ 'unit' => 'px',
738
+ ),
739
+ ),
740
+ ),
741
+ ),
742
+ 'error_style' => array(
743
+ 'title' => __( 'Field Validation & Error Messages', 'cartflows' ),
744
+ 'fields' => array(
745
+ 'field_label_color' => array(
746
+ 'type' => 'color',
747
+ 'label' => __( 'Field Label Color', 'cartflows' ),
748
+ 'default' => '',
749
+ 'show_reset' => true,
750
+ 'connections' => array( 'color' ),
751
+ 'show_alpha' => true,
752
+ 'preview' => array(
753
+ 'type' => 'css',
754
+ 'selector' => '.woocommerce-checkout .woocommerce-invalid label,
755
+ .wcf-embed-checkout-form .woocommerce form p.form-row.woocommerce-invalid label,
756
+ .woocommerce form .form-row.woocommerce-invalid label',
757
+ 'property' => 'color',
758
+ 'unit' => 'px',
759
+ ),
760
+ ),
761
+ 'error_field_border_color' => array(
762
+ 'type' => 'color',
763
+ 'label' => __( 'Field Border Color', 'cartflows' ),
764
+ 'default' => '',
765
+ 'show_reset' => true,
766
+ 'connections' => array( 'color' ),
767
+ 'show_alpha' => true,
768
+ 'preview' => array(
769
+ 'type' => 'css',
770
+ 'selector' => '.select2-container--default.field-required .select2-selection--single,
771
+ .woocommerce form .form-row input.input-text.field-required,
772
+ .woocommerce form .form-row textarea.input-text.field-required,
773
+ .woocommerce #order_review .input-text.field-required
774
+ .woocommerce form .form-row.woocommerce-invalid .select2-container,
775
+ .woocommerce form .form-row.woocommerce-invalid input.input-text,
776
+ .woocommerce form .form-row.woocommerce-invalid select',
777
+ 'property' => 'border-color',
778
+ 'unit' => 'px',
779
+ ),
780
+ ),
781
+ 'error_text_color' => array(
782
+ 'type' => 'color',
783
+ 'label' => __( 'Error Message Color', 'cartflows' ),
784
+ 'default' => '',
785
+ 'show_reset' => true,
786
+ 'connections' => array( 'color' ),
787
+ 'show_alpha' => true,
788
+ 'preview' => array(
789
+ 'type' => 'css',
790
+ 'selector' => '.woocommerce .woocommerce-error,
791
+ .woocommerce .woocommerce-NoticeGroup .woocommerce-error,
792
+ .woocommerce .woocommerce-notices-wrapper .woocommerce-error',
793
+ 'property' => 'color',
794
+ 'unit' => 'px',
795
+ ),
796
+ ),
797
+ 'error_bg_color' => array(
798
+ 'type' => 'color',
799
+ 'label' => __( 'Background Color', 'cartflows' ),
800
+ 'default' => '',
801
+ 'show_reset' => true,
802
+ 'connections' => array( 'color' ),
803
+ 'show_alpha' => true,
804
+ 'preview' => array(
805
+ 'type' => 'css',
806
+ 'selector' => '.woocommerce .woocommerce-error,
807
+ .woocommerce .woocommerce-NoticeGroup .woocommerce-error,
808
+ .woocommerce .woocommerce-notices-wrapper .woocommerce-error',
809
+ 'property' => 'background-color',
810
+ 'unit' => 'px',
811
+ ),
812
+ ),
813
+ 'error_border_color' => array(
814
+ 'type' => 'color',
815
+ 'label' => __( 'Border Color', 'cartflows' ),
816
+ 'default' => '',
817
+ 'show_reset' => true,
818
+ 'connections' => array( 'color' ),
819
+ 'show_alpha' => true,
820
+ 'preview' => array(
821
+ 'type' => 'css',
822
+ 'selector' => '.woocommerce .woocommerce-error,
823
+ .woocommerce .woocommerce-NoticeGroup .woocommerce-error,
824
+ .woocommerce .woocommerce-notices-wrapper .woocommerce-error',
825
+ 'property' => 'border-color',
826
+ 'unit' => 'px',
827
+ ),
828
+ ),
829
+ ),
830
+ ),
831
+ ),
832
+ ),
833
+ )
834
+ );
modules/beaver-builder/cartflows-bb-checkout-form/icon/bb-checkout-form.svg ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20pt" height="20pt" viewBox="0 0 20 20" version="1.1">
3
+ <g id="surface1">
4
+ <path style=" stroke:none;fill-rule:evenodd;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 19 20 L 1 20 C 0.453125 20 0 19.53125 0 18.964844 L 0 1.035156 C 0 0.46875 0.453125 0 1 0 L 19 0 C 19.546875 0 20 0.46875 20 1.035156 L 20 18.964844 C 20 19.53125 19.546875 20 19 20 Z M 19.332031 3.449219 L 0.667969 3.449219 L 0.667969 18.964844 C 0.667969 19.15625 0.816406 19.308594 1 19.308594 L 19 19.308594 C 19.183594 19.308594 19.332031 19.15625 19.332031 18.964844 Z M 4.332031 17.929688 L 3 17.929688 C 2.453125 17.929688 2 17.464844 2 16.898438 C 2 16.328125 2.453125 15.863281 3 15.863281 L 4.332031 15.863281 C 4.882812 15.863281 5.332031 16.328125 5.332031 16.898438 C 5.332031 17.464844 4.882812 17.929688 4.332031 17.929688 Z M 4.332031 16.550781 L 3 16.550781 C 2.816406 16.550781 2.667969 16.707031 2.667969 16.898438 C 2.667969 17.085938 2.816406 17.242188 3 17.242188 L 4.332031 17.242188 C 4.515625 17.242188 4.667969 17.085938 4.667969 16.898438 C 4.667969 16.707031 4.515625 16.550781 4.332031 16.550781 Z M 14.832031 11.859375 C 15.730469 11.867188 16.605469 12.402344 17.015625 13.207031 C 17.363281 13.882812 17.371094 14.71875 17.042969 15.402344 C 16.574219 16.371094 15.429688 16.972656 14.332031 16.753906 C 13.335938 16.558594 12.511719 15.6875 12.367188 14.675781 C 12.257812 13.890625 12.554688 13.0625 13.132812 12.523438 C 13.582031 12.105469 14.1875 11.863281 14.800781 11.859375 C 14.8125 11.859375 14.820312 11.859375 14.832031 11.859375 Z M 14.804688 12.359375 C 13.90625 12.367188 13.066406 13.050781 12.886719 13.933594 C 12.753906 14.582031 12.972656 15.289062 13.449219 15.75 C 13.996094 16.277344 14.855469 16.449219 15.570312 16.152344 C 16.203125 15.886719 16.679688 15.273438 16.769531 14.59375 C 16.882812 13.761719 16.398438 12.882812 15.628906 12.53125 C 15.367188 12.417969 15.085938 12.359375 14.804688 12.359375 Z M 15.867188 13.390625 C 15.980469 13.402344 15.996094 13.433594 16.03125 13.46875 C 16.121094 13.558594 16.117188 13.71875 16.027344 13.816406 L 14.675781 15.195312 C 14.644531 15.226562 14.632812 15.234375 14.609375 15.246094 C 14.527344 15.285156 14.417969 15.273438 14.34375 15.21875 C 14.335938 15.210938 14.332031 15.207031 14.324219 15.199219 L 13.605469 14.496094 C 13.566406 14.453125 13.558594 14.433594 13.546875 14.402344 C 13.488281 14.242188 13.636719 14.042969 13.820312 14.070312 C 13.855469 14.074219 13.890625 14.089844 13.925781 14.113281 C 13.9375 14.121094 13.945312 14.128906 13.957031 14.140625 L 14.496094 14.667969 L 15.671875 13.464844 C 15.671875 13.464844 15.769531 13.386719 15.867188 13.390625 Z M 10.332031 13.792969 L 2.332031 13.792969 C 2.152344 13.792969 2 13.636719 2 13.449219 L 2 12.070312 C 2 11.878906 2.152344 11.722656 2.332031 11.722656 L 10.332031 11.722656 C 10.515625 11.722656 10.667969 11.878906 10.667969 12.070312 L 10.667969 13.449219 C 10.667969 13.636719 10.515625 13.792969 10.332031 13.792969 Z M 10 12.414062 L 2.667969 12.414062 L 2.667969 13.101562 L 10 13.101562 Z M 11.980469 6.351562 C 11.980469 6.328125 11.988281 6.304688 11.996094 6.28125 C 12.011719 6.246094 12.035156 6.214844 12.0625 6.191406 C 12.074219 6.179688 12.089844 6.171875 12.101562 6.164062 L 14.679688 4.667969 C 14.757812 4.628906 14.753906 4.632812 14.808594 4.636719 C 14.820312 4.636719 14.828125 4.636719 14.839844 4.636719 C 14.875 4.640625 14.910156 4.652344 14.941406 4.667969 L 17.476562 6.144531 C 17.5 6.15625 17.523438 6.167969 17.542969 6.183594 C 17.566406 6.203125 17.574219 6.214844 17.589844 6.238281 C 17.601562 6.25 17.609375 6.265625 17.613281 6.28125 C 17.625 6.308594 17.632812 6.339844 17.632812 6.375 L 17.632812 9.316406 C 17.632812 9.40625 17.585938 9.484375 17.511719 9.535156 L 14.933594 11.039062 C 14.832031 11.09375 14.800781 11.082031 14.753906 11.070312 C 14.746094 11.070312 14.742188 11.066406 14.738281 11.066406 C 14.730469 11.0625 14.726562 11.0625 14.71875 11.058594 C 14.699219 11.054688 14.695312 11.050781 14.679688 11.042969 L 12.09375 9.539062 C 12.019531 9.492188 11.972656 9.414062 11.96875 9.324219 L 11.976562 6.378906 C 11.976562 6.371094 11.976562 6.363281 11.980469 6.351562 Z M 10.332031 11.035156 L 2.332031 11.035156 C 2.152344 11.035156 2 10.878906 2 10.691406 L 2 9.308594 C 2 9.121094 2.152344 8.964844 2.332031 8.964844 L 10.332031 8.964844 C 10.515625 8.964844 10.667969 9.121094 10.667969 9.308594 L 10.667969 10.691406 C 10.667969 10.878906 10.515625 11.035156 10.332031 11.035156 Z M 12.46875 9.179688 L 14.554688 10.390625 L 14.554688 7.996094 L 12.476562 6.808594 C 12.472656 7.601562 12.472656 8.390625 12.46875 9.179688 Z M 17.132812 6.8125 L 15.054688 8.015625 L 15.054688 10.390625 L 17.132812 9.175781 Z M 10 9.65625 L 2.667969 9.65625 L 2.667969 10.34375 L 10 10.34375 Z M 10.332031 8.277344 L 2.332031 8.277344 C 2.152344 8.277344 2 8.121094 2 7.929688 L 2 6.550781 C 2 6.363281 2.152344 6.207031 2.332031 6.207031 L 10.332031 6.207031 C 10.515625 6.207031 10.667969 6.363281 10.667969 6.550781 L 10.667969 7.929688 C 10.667969 8.121094 10.515625 8.277344 10.332031 8.277344 Z M 10 6.898438 L 2.667969 6.898438 L 2.667969 7.585938 L 10 7.585938 Z M 14.027344 7.121094 L 14.824219 7.574219 L 16.886719 6.378906 L 16.097656 5.921875 Z M 12.726562 6.378906 L 13.523438 6.832031 L 15.601562 5.628906 L 14.8125 5.171875 Z M 5.667969 5.515625 L 2.332031 5.515625 C 2.152344 5.515625 2 5.363281 2 5.171875 C 2 4.984375 2.152344 4.828125 2.332031 4.828125 L 5.667969 4.828125 C 5.847656 4.828125 6 4.984375 6 5.171875 C 6 5.363281 5.847656 5.515625 5.667969 5.515625 Z M 19 0.691406 L 1 0.691406 C 0.816406 0.691406 0.667969 0.84375 0.667969 1.035156 L 0.667969 2.757812 L 19.332031 2.757812 L 19.332031 1.035156 C 19.332031 0.84375 19.183594 0.691406 19 0.691406 Z M 4.332031 1.378906 C 4.515625 1.378906 4.667969 1.535156 4.667969 1.722656 C 4.667969 1.914062 4.515625 2.070312 4.332031 2.070312 C 4.148438 2.070312 4 1.914062 4 1.722656 C 4 1.535156 4.148438 1.378906 4.332031 1.378906 Z M 3 1.378906 C 3.183594 1.378906 3.332031 1.535156 3.332031 1.722656 C 3.332031 1.914062 3.183594 2.070312 3 2.070312 C 2.816406 2.070312 2.667969 1.914062 2.667969 1.722656 C 2.667969 1.535156 2.816406 1.378906 3 1.378906 Z M 1.667969 1.378906 C 1.851562 1.378906 2 1.535156 2 1.722656 C 2 1.914062 1.851562 2.070312 1.667969 2.070312 C 1.484375 2.070312 1.332031 1.914062 1.332031 1.722656 C 1.332031 1.535156 1.484375 1.378906 1.667969 1.378906 Z M 1.667969 1.378906 "/>
5
+ </g>
6
+ </svg>
modules/beaver-builder/cartflows-bb-checkout-form/includes/frontend.css.php ADDED
@@ -0,0 +1,381 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BB Checkout Form Module front-end CSS php file.
4
+ *
5
+ * @package cartflows
6
+ */
7
+
8
+ global $post;
9
+
10
+ ?>
11
+
12
+ #fl-field-checkout_layout .cartflows-bb-link,
13
+ #fl-field-input_skins .cartflows-bb-link {
14
+ color: #0086b0;
15
+ }
16
+
17
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce .woocommerce-checkout .product-name .remove:hover,
18
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:checked:before,
19
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:checked:before,
20
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-info::before,
21
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-message::before,
22
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce a,
23
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-steps .wcf-current .step-name,
24
+ body .wcf-pre-checkout-offer-wrapper .wcf-content-main-head .wcf-content-modal-title .wcf_first_name {
25
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->global_primary_color ); ?>;
26
+ }
27
+
28
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce .woocommerce-checkout .product-name .remove:hover,
29
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #payment input[type=checkbox]:focus,
30
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:focus,
31
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:focus,
32
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:not(:checked):focus,
33
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button,
34
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
35
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small,
36
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
37
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button,
38
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.login .button:hover,
39
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button:hover,
40
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #payment #place_order:hover,
41
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small:hover,
42
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
43
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-note,
44
+ body .wcf-pre-checkout-offer-wrapper #wcf-pre-checkout-offer-content button.wcf-pre-checkout-offer-btn {
45
+ border-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->global_primary_color ); ?>;
46
+ }
47
+
48
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before,
49
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button,
50
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
51
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small,
52
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
53
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button,
54
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.login .button:hover,
55
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button:hover,
56
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #payment #place_order:hover,
57
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small:hover,
58
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-steps .step-one.wcf-current:before,
59
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-steps .step-two.wcf-current:before,
60
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-steps .steps.wcf-current:before,
61
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-note,
62
+ body .wcf-pre-checkout-offer-wrapper .wcf-nav-bar-step.active .wcf-progress-nav-step,
63
+ body .wcf-pre-checkout-offer-wrapper .wcf-nav-bar-step.active .wcf-nav-bar-step-line:before,
64
+ body .wcf-pre-checkout-offer-wrapper .wcf-nav-bar-step.active .wcf-nav-bar-step-line:after {
65
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->global_primary_color ); ?>;
66
+ }
67
+
68
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-note:before {
69
+ border-top-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->global_primary_color ); ?>;
70
+ }
71
+
72
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
73
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button,
74
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form form.checkout_coupon .button,
75
+ body .wcf-pre-checkout-offer-wrapper #wcf-pre-checkout-offer-content button.wcf-pre-checkout-offer-btn {
76
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->global_primary_color ); ?>;
77
+ color: #fff;
78
+ }
79
+
80
+
81
+
82
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form,
83
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p {
84
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->global_text_color ); ?>;
85
+ }
86
+
87
+ <?php
88
+ if ( class_exists( 'FLBuilderCSS' ) ) {
89
+ FLBuilderCSS::typography_field_rule(
90
+ array(
91
+ 'settings' => $settings,
92
+ 'setting_name' => 'heading_typography',
93
+ 'selector' => ".fl-node-$id .cartflows-bb__checkout-form .wcf-embed-checkout-form",
94
+ )
95
+ );
96
+ }
97
+ ?>
98
+
99
+ .fl-node-<?php echo $id; ?> .cartflows-bb__checkout-form .wcf-embed-checkout-form .woocommerce h3,
100
+ .fl-node-<?php echo $id; ?> .cartflows-bb__checkout-form .wcf-embed-checkout-form .woocommerce h3 span,
101
+ .fl-node-<?php echo $id; ?> .cartflows-bb__checkout-form .wcf-embed-checkout-form .woocommerce-checkout #order_review_heading,
102
+ .fl-node-<?php echo $id; ?> .cartflows-bb__checkout-form .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-steps .wcf-current .step-name {
103
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->heading_color ); ?>;
104
+ }
105
+
106
+ <?php
107
+ if ( class_exists( 'FLBuilderCSS' ) ) {
108
+ FLBuilderCSS::typography_field_rule(
109
+ array(
110
+ 'settings' => $settings,
111
+ 'setting_name' => 'heading_typography',
112
+ 'selector' => ".fl-node-$id .cartflows-bb__checkout-form .wcf-embed-checkout-form .woocommerce h3,
113
+ .fl-node-$id .cartflows-bb__checkout-form .wcf-embed-checkout-form .woocommerce h3 span,
114
+ .fl-node-$id .cartflows-bb__checkout-form .wcf-embed-checkout-form .woocommerce-checkout #order_review_heading,
115
+ .fl-node-$id .cartflows-bb__checkout-form .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-steps .step-name,
116
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce .col2-set .col-1 h3,
117
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce .col2-set .col-2 h3",
118
+ )
119
+ );
120
+ }
121
+ ?>
122
+
123
+ <?php
124
+ if ( class_exists( 'FLBuilderCSS' ) ) {
125
+ FLBuilderCSS::typography_field_rule(
126
+ array(
127
+ 'settings' => $settings,
128
+ 'setting_name' => 'input_text_typography',
129
+ 'selector' => ".fl-node-$id .wcf-embed-checkout-form .woocommerce form .form-row input.input-text,
130
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce form .form-row textarea,
131
+ .fl-node-$id .wcf-embed-checkout-form .select2-container--default .select2-selection--single,
132
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce form .form-row select.select,
133
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce .col2-set .col-1,
134
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce .col2-set .col-2,
135
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce form p.form-row label,
136
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce #payment [type='radio']:checked + label,
137
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce #payment [type='radio']:not(:checked) + label,
138
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce form .form-row select",
139
+ )
140
+ );
141
+ }
142
+ ?>
143
+
144
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout label,
145
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form p.form-row label {
146
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->label_color ); ?>;
147
+ }
148
+
149
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form #order_review .wcf-custom-coupon-field input[type="text"],
150
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row input.input-text,
151
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row textarea,
152
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .select2-container--default .select2-selection--single,
153
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row select.select,
154
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row select {
155
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->input_bgcolor ); ?>;
156
+ }
157
+
158
+ .fl-node-<?php echo $id; ?> .cartflows-bb__checkout-form .wcf-embed-checkout-form #order_review .wcf-custom-coupon-field input[type="text"],
159
+ .fl-node-<?php echo $id; ?> .cartflows-bb__checkout-form .wcf-embed-checkout-form .woocommerce form .form-row input.input-text,
160
+ .fl-node-<?php echo $id; ?> .cartflows-bb__checkout-form .wcf-embed-checkout-form .woocommerce form .form-row textarea,
161
+ .fl-node-<?php echo $id; ?> .cartflows-bb__checkout-form .wcf-embed-checkout-form .select2-container--default .select2-selection--single,
162
+ .fl-node-<?php echo $id; ?> .cartflows-bb__checkout-form .wcf-embed-checkout-form .woocommerce form .form-row select,
163
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row select,
164
+ .fl-node-<?php echo $id; ?> .cartflows-bb__checkout-form .wcf-embed-checkout-form ::placeholder,
165
+ .fl-node-<?php echo $id; ?> .cartflows-bb__checkout-form .wcf-embed-checkout-form ::-webkit-input-placeholder {
166
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->input_color ); ?> !important;
167
+ }
168
+
169
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form #order_review .wcf-custom-coupon-field input[type="text"],
170
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row input.input-text,
171
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row textarea,
172
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .select2-container--default .select2-selection--single,
173
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row select.select,
174
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row select {
175
+ border-radius: <?php echo ( '' != $settings->input_border_radius ) ? $settings->input_border_radius : '0'; ?>px;
176
+ }
177
+
178
+ <?php if ( 'none' !== $settings->input_border_style ) { ?>
179
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form #order_review .wcf-custom-coupon-field input[type="text"],
180
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row input.input-text,
181
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row textarea,
182
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .select2-container--default .select2-selection--single,
183
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row select.select,
184
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row select {
185
+ border-style: <?php echo ( '' != $settings->input_border_style ) ? $settings->input_border_style : 'solid'; ?>;
186
+ border-width: <?php echo ( '' != $settings->input_border_width ) ? $settings->input_border_width : '1'; ?>px;
187
+ border-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->input_border_color ); ?>;
188
+ }
189
+
190
+ <?php } ?>
191
+
192
+ <?php
193
+ if ( class_exists( 'FLBuilderCSS' ) ) {
194
+ FLBuilderCSS::typography_field_rule(
195
+ array(
196
+ 'settings' => $settings,
197
+ 'setting_name' => 'button_typography',
198
+ 'selector' => ".fl-node-$id .wcf-embed-checkout-form .woocommerce #order_review button,
199
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
200
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small,
201
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
202
+ .fl-node-$id .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button,
203
+ .fl-node-$id .wcf-embed-checkout-form form.checkout_coupon .button,
204
+ .fl-node-$id .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
205
+ body .wcf-pre-checkout-offer-wrapper #wcf-pre-checkout-offer-content button.wcf-pre-checkout-offer-btn",
206
+ )
207
+ );
208
+ }
209
+ ?>
210
+
211
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button,
212
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
213
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small,
214
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
215
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button,
216
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form form.checkout_coupon .button,
217
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
218
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button,
219
+ body .wcf-pre-checkout-offer-wrapper #wcf-pre-checkout-offer-content button.wcf-pre-checkout-offer-btn {
220
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->button_text_color ); ?>;
221
+ }
222
+
223
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button,
224
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
225
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small,
226
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
227
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button,
228
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form form.checkout_coupon .button,
229
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
230
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button,
231
+ body .wcf-pre-checkout-offer-wrapper #wcf-pre-checkout-offer-content button.wcf-pre-checkout-offer-btn {
232
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->button_bg_color ); ?>;
233
+ }
234
+
235
+ <?php // Button text hover color. ?>
236
+
237
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.login .button:hover,
238
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button:hover,
239
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #payment #place_order:hover,
240
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small:hover,
241
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form form.checkout_coupon .button:hover,
242
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button:hover,
243
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button:hover,
244
+ body .wcf-pre-checkout-offer-wrapper #wcf-pre-checkout-offer-content button.wcf-pre-checkout-offer-btn:hover {
245
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->button_text_hover_color ); ?>;
246
+ }
247
+
248
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.login .button:hover,
249
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button:hover,
250
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #payment #place_order:hover,
251
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small:hover,
252
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form form.checkout_coupon .button:hover,
253
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button:hover,
254
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button:hover,
255
+ body .wcf-pre-checkout-offer-wrapper #wcf-pre-checkout-offer-content button.wcf-pre-checkout-offer-btn:hover {
256
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->button_bg_hover_color ); ?>;
257
+ border-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->button_border_hover_color ); ?>;
258
+ }
259
+
260
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button,
261
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
262
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small,
263
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
264
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button,
265
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form form.checkout_coupon .button,
266
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
267
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button,
268
+ body .wcf-pre-checkout-offer-wrapper #wcf-pre-checkout-offer-content button.wcf-pre-checkout-offer-btn {
269
+ border-radius: <?php echo ( '' != $settings->button_border_radius ) ? $settings->button_border_radius : '0'; ?>px;
270
+ }
271
+
272
+ <?php if ( 'none' != $settings->button_border_style ) { ?>
273
+
274
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button,
275
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
276
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small,
277
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
278
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button,
279
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form form.checkout_coupon .button,
280
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
281
+ body .wcf-pre-checkout-offer-wrapper #wcf-pre-checkout-offer-content button.wcf-pre-checkout-offer-btn {
282
+ border-style: <?php echo ( '' != $settings->button_border_style ) ? $settings->button_border_style : 'solid'; ?>;
283
+ border-width: <?php echo ( '' != $settings->button_border_width ) ? $settings->button_border_width : '0'; ?>px;
284
+ border-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->button_border_color ); ?>;
285
+ }
286
+
287
+ <?php } else { ?>
288
+
289
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button,
290
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
291
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small,
292
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
293
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button,
294
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form form.checkout_coupon .button,
295
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button,
296
+ body .wcf-pre-checkout-offer-wrapper #wcf-pre-checkout-offer-content button.wcf-pre-checkout-offer-btn {
297
+ border-width: 0px !important;
298
+ }
299
+
300
+ <?php } ?>
301
+
302
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout #payment,
303
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout #payment label,
304
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout #payment label a {
305
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->payment_section_text_color ); ?>;
306
+ }
307
+
308
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box {
309
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->payment_section_desc_color ); ?>;
310
+ }
311
+
312
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods {
313
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->payment_section_bg_color ); ?>;
314
+ }
315
+
316
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box {
317
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->payment_info_bg_color ); ?>;
318
+ }
319
+
320
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form #add_payment_method #payment div.payment_box::before,
321
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-cart #payment div.payment_box::before,
322
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box::before {
323
+ border-bottom-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->payment_info_bg_color ); ?>;
324
+ }
325
+
326
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods {
327
+ border-radius: <?php echo ( '' != $settings->payment_section_border_radius ) ? $settings->payment_section_border_radius : '0'; ?>px;
328
+ }
329
+
330
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods {
331
+ padding-top: <?php echo ( '' != $settings->payment_section_padding_dimension_top ) ? $settings->payment_section_padding_dimension_top : ''; ?>px;
332
+ padding-bottom: <?php echo ( '' != $settings->payment_section_padding_dimension_bottom ) ? $settings->payment_section_padding_dimension_bottom : ''; ?>px;
333
+ padding-left: <?php echo ( '' != $settings->payment_section_padding_dimension_left ) ? $settings->payment_section_padding_dimension_left : ''; ?>px;
334
+ padding-right: <?php echo ( '' != $settings->payment_section_padding_dimension_right ) ? $settings->payment_section_padding_dimension_right : ''; ?>px;
335
+ }
336
+
337
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods {
338
+ margin-top: <?php echo ( '' != $settings->payment_section_margin_dimension_top ) ? $settings->payment_section_margin_dimension_top : ''; ?>px;
339
+ margin-bottom: <?php echo ( '' != $settings->payment_section_margin_dimension_bottom ) ? $settings->payment_section_margin_dimension_bottom : ''; ?>px;
340
+ margin-left: <?php echo ( '' != $settings->payment_section_margin_dimension_left ) ? $settings->payment_section_margin_dimension_left : ''; ?>px;
341
+ margin-right: <?php echo ( '' != $settings->payment_section_margin_dimension_right ) ? $settings->payment_section_margin_dimension_right : ''; ?>px;
342
+ }
343
+
344
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce-checkout .woocommerce-invalid label,
345
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form p.form-row.woocommerce-invalid label,
346
+ .fl-node-<?php echo $id; ?> .woocommerce form .form-row.woocommerce-invalid label {
347
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->field_label_color ); ?>;
348
+ }
349
+
350
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,
351
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,
352
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required,
353
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required
354
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid .select2-container,
355
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid input.input-text,
356
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid select {
357
+ border-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->error_field_border_color ); ?>;
358
+ }
359
+
360
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce .woocommerce-error,
361
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error,
362
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error {
363
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->error_text_color ); ?>;
364
+ border-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->error_border_color ); ?>;
365
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->error_bg_color ); ?>;
366
+ }
367
+
368
+ .fl-node-<?php echo $id; ?> .woocommerce form .form-row.woocommerce-invalid label {
369
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->field_label_color ); ?>;
370
+ }
371
+
372
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single,
373
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required,
374
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required,
375
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required
376
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid .select2-container,
377
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid input.input-text,
378
+ .fl-node-<?php echo $id; ?> .wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid select {
379
+ border-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->error_field_border_color ); ?>;
380
+ }
381
+
modules/beaver-builder/cartflows-bb-checkout-form/includes/frontend.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Frontend view
4
+ *
5
+ * @package cartflows
6
+ */
7
+
8
+ $data_settings = array();
9
+ $checkout_id = get_the_ID();
10
+
11
+ /* Add module setting options to filters */
12
+ $module->dynamic_option_filters();
13
+
14
+ do_action( 'cartflows_bb_before_checkout_shortcode', $checkout_id );
15
+
16
+ $data_settings = apply_filters( 'cartflows_bb_checkout_settings', $data_settings );
17
+
18
+ ?>
19
+ <div class="cartflows-bb__checkout-form" data-settings-data="<?php echo htmlentities( wp_json_encode( $data_settings ) ); ?>">
20
+ <?php echo do_shortcode( '[cartflows_checkout]' ); ?>
21
+ </div>
modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php ADDED
@@ -0,0 +1,465 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2
+ /**
3
+ * Next Step button Module for Beaver Builder
4
+ *
5
+ * @package cartflows
6
+ */
7
+
8
+ /**
9
+ * Next Step button Module for Beaver Builder
10
+ *
11
+ * @since x.x.x
12
+ */
13
+ class Cartflows_BB_Next_Step extends FLBuilderModule {
14
+ /**
15
+ * Constructor function for the module. You must pass the
16
+ * name, description, dir and url in an array to the parent class.
17
+ *
18
+ * @method __construct
19
+ */
20
+ public function __construct() {
21
+
22
+ $step_type = Cartflows_BB_Helper::cartflows_bb_step_type();
23
+
24
+ $is_enabled = ( 'landing' === $step_type ) ? true : false;
25
+
26
+ parent::__construct(
27
+ array(
28
+ 'name' => __( 'Next Step Button', 'cartflows' ),
29
+ 'description' => __( 'A simple next step button.', 'cartflows' ),
30
+ 'category' => __( 'Cartflows Modules', 'cartflows' ),
31
+ 'group' => __( 'Cartflows Modules', 'cartflows' ),
32
+ 'dir' => CARTFLOWS_DIR . 'modules/beaver-builder/cartflows-bb-next-step/',
33
+ 'url' => CARTFLOWS_URL . 'modules/beaver-builder/cartflows-bb-next-step/',
34
+ 'partial_refresh' => false, // Defaults to false and can be omitted.
35
+ 'icon' => 'bb-next-step.svg',
36
+ 'enabled' => $is_enabled,
37
+ )
38
+ );
39
+ }
40
+
41
+ /**
42
+ * Function to get the icon for the module
43
+ *
44
+ * @method get_icons
45
+ * @param string $icon gets the icon for the module.
46
+ */
47
+ public function get_icon( $icon = '' ) {
48
+
49
+ if ( '' !== $icon && file_exists( CARTFLOWS_DIR . 'modules/beaver-builder/cartflows-bb-next-step/icon/' . $icon ) ) {
50
+
51
+ return fl_builder_filesystem()->file_get_contents( CARTFLOWS_DIR . 'modules/beaver-builder/cartflows-bb-next-step/icon/' . $icon );
52
+ }
53
+
54
+ return '';
55
+ }
56
+
57
+ /**
58
+ * Function that gets the class names.
59
+ *
60
+ * @method get_classname
61
+ */
62
+ public function get_classname() {
63
+ $classname = 'cartflows-bb__next-step-button-wrap cartflows-bb__next-step-button-wrap cartflows-bb__next-step-creative-button-wrap';
64
+
65
+ if ( ! empty( $this->settings->width ) ) {
66
+ $classname .= ' cartflows-bb__next-step-button-width-' . $this->settings->width;
67
+ $classname .= ' cartflows-bb__next-step-creative-button-width-' . $this->settings->width;
68
+ }
69
+ if ( ! empty( $this->settings->align ) ) {
70
+ $classname .= ' cartflows-bb__next-step-button-' . $this->settings->align;
71
+ $classname .= ' cartflows-bb__next-step-creative-button-' . $this->settings->align;
72
+ }
73
+ if ( ! empty( $this->settings->mob_align ) ) {
74
+ $classname .= ' cartflows-bb__next-step-button-reponsive-' . $this->settings->mob_align;
75
+ $classname .= ' cartflows-bb__next-step-creative-button-reponsive-' . $this->settings->mob_align;
76
+ }
77
+ if ( ! empty( $this->settings->icon ) ) {
78
+ $classname .= ' cartflows-bb__next-step-button-has-icon';
79
+ $classname .= ' cartflows-bb__next-step-creative-button-has-icon';
80
+ }
81
+
82
+ if ( empty( $this->settings->text ) ) {
83
+ $classname .= ' cartflows-bb__next-step-creative-button-icon-no-text';
84
+ }
85
+
86
+ return $classname;
87
+ }
88
+
89
+ /**
90
+ * Function that gets the button styling.
91
+ *
92
+ * @method get_button_style
93
+ */
94
+ public function get_button_style() {
95
+ $btn_style = '';
96
+
97
+ if ( ! empty( $this->settings->style ) && 'transparent' == $this->settings->style ) {
98
+ if ( isset( $this->settings->transparent_button_options ) && ! empty( $this->settings->transparent_button_options ) ) {
99
+ $btn_style .= ' cartflows-bb__next-step-' . $this->settings->transparent_button_options . '-btn';
100
+ }
101
+ }
102
+
103
+ if ( ! empty( $this->settings->style ) && 'threed' == $this->settings->style ) {
104
+ if ( isset( $this->settings->threed_button_options ) && ! empty( $this->settings->threed_button_options ) ) {
105
+ $btn_style .= ' cartflows-bb__next-step-' . $this->settings->threed_button_options . '-btn';
106
+ }
107
+ }
108
+
109
+ if ( ! empty( $this->settings->style ) && 'flat' == $this->settings->style ) {
110
+ if ( isset( $this->settings->flat_button_options ) && ! empty( $this->settings->flat_button_options ) ) {
111
+ $btn_style .= ' cartflows-bb__next-step-' . $this->settings->flat_button_options . '-btn';
112
+ }
113
+ }
114
+
115
+ return $btn_style;
116
+ }
117
+
118
+ }
119
+
120
+ /**
121
+ * Register the module and its form settings.
122
+ */
123
+ FLBuilder::register_module(
124
+ 'Cartflows_BB_Next_Step',
125
+ array(
126
+
127
+ 'general' => array(
128
+ 'title' => __( 'General', 'cartflows' ),
129
+ 'sections' => array(
130
+ 'general' => array(
131
+ 'title' => '',
132
+ 'fields' => array(
133
+ 'text' => array(
134
+ 'type' => 'text',
135
+ 'label' => __( 'Text', 'cartflows' ),
136
+ 'default' => __( 'Next Step', 'cartflows' ),
137
+ 'preview' => array(
138
+ 'type' => 'text',
139
+ 'selector' => '.fl-button-text',
140
+ ),
141
+ 'connections' => array( 'string' ),
142
+ ),
143
+ 'icon' => array(
144
+ 'type' => 'icon',
145
+ 'label' => __( 'Icon', 'cartflows' ),
146
+ 'show_remove' => true,
147
+ 'show' => array(
148
+ 'fields' => array( 'icon_position' ),
149
+ ),
150
+ 'preview' => array(
151
+ 'type' => 'refresh',
152
+ ),
153
+ ),
154
+ 'icon_position' => array(
155
+ 'type' => 'select',
156
+ 'label' => __( 'Icon Position', 'cartflows' ),
157
+ 'default' => 'before',
158
+ 'options' => array(
159
+ 'before' => __( 'Before Text', 'cartflows' ),
160
+ 'after' => __( 'After Text', 'cartflows' ),
161
+ ),
162
+ 'preview' => array(
163
+ 'type' => 'refresh',
164
+ ),
165
+ ),
166
+ ),
167
+ ),
168
+ ),
169
+ ),
170
+ 'style' => array(
171
+ 'title' => __( 'Style', 'cartflows' ),
172
+ 'sections' => array(
173
+ 'style' => array(
174
+ 'title' => __( 'Style', 'cartflows' ),
175
+ 'fields' => array(
176
+ 'style' => array(
177
+ 'type' => 'select',
178
+ 'label' => __( 'Type', 'cartflows' ),
179
+ 'default' => 'default',
180
+ 'class' => 'creative_button_styles',
181
+ 'options' => array(
182
+ 'default' => __( 'Default', 'cartflows' ),
183
+ 'flat' => __( 'Flat', 'cartflows' ),
184
+ 'gradient' => __( 'Gradient', 'cartflows' ),
185
+ 'transparent' => __( 'Transparent', 'cartflows' ),
186
+ 'threed' => __( '3D', 'cartflows' ),
187
+ ),
188
+ 'toggle' => array(
189
+ 'default' => array(
190
+ 'fields' => array( 'button_padding_dimension', 'button_border', 'border_hover_color' ),
191
+ ),
192
+ ),
193
+ ),
194
+ 'border_size' => array(
195
+ 'type' => 'unit',
196
+ 'label' => __( 'Border Size', 'cartflows' ),
197
+ 'slider' => true,
198
+ 'units' => array( 'px' ),
199
+ 'maxlength' => '3',
200
+ 'size' => '5',
201
+ 'placeholder' => '2',
202
+ ),
203
+ 'transparent_button_options' => array(
204
+ 'type' => 'select',
205
+ 'label' => __( 'Hover Styles', 'cartflows' ),
206
+ 'default' => 'transparent-fade',
207
+ 'options' => array(
208
+ 'none' => __( 'None', 'cartflows' ),
209
+ 'transparent-fade' => __( 'Fade Background', 'cartflows' ),
210
+ 'transparent-fill-top' => __( 'Fill Background From Top', 'cartflows' ),
211
+ 'transparent-fill-bottom' => __( 'Fill Background From Bottom', 'cartflows' ),
212
+ 'transparent-fill-left' => __( 'Fill Background From Left', 'cartflows' ),
213
+ 'transparent-fill-right' => __( 'Fill Background From Right', 'cartflows' ),
214
+ 'transparent-fill-center' => __( 'Fill Background Vertical', 'cartflows' ),
215
+ 'transparent-fill-diagonal' => __( 'Fill Background Diagonal', 'cartflows' ),
216
+ 'transparent-fill-horizontal' => __( 'Fill Background Horizontal', 'cartflows' ),
217
+ ),
218
+ ),
219
+ 'threed_button_options' => array(
220
+ 'type' => 'select',
221
+ 'label' => __( 'Hover Styles', 'cartflows' ),
222
+ 'default' => 'threed_down',
223
+ 'options' => array(
224
+ 'threed_down' => __( 'Move Down', 'cartflows' ),
225
+ 'threed_up' => __( 'Move Up', 'cartflows' ),
226
+ 'threed_left' => __( 'Move Left', 'cartflows' ),
227
+ 'threed_right' => __( 'Move Right', 'cartflows' ),
228
+ 'animate_top' => __( 'Animate Top', 'cartflows' ),
229
+ 'animate_bottom' => __( 'Animate Bottom', 'cartflows' ),
230
+ ),
231
+ ),
232
+ 'flat_button_options' => array(
233
+ 'type' => 'select',
234
+ 'label' => __( 'Hover Styles', 'cartflows' ),
235
+ 'default' => 'none',
236
+ 'options' => array(
237
+ 'none' => __( 'None', 'cartflows' ),
238
+ 'animate_to_left' => __( 'Appear Icon From Right', 'cartflows' ),
239
+ 'animate_to_right' => __( 'Appear Icon From Left', 'cartflows' ),
240
+ 'animate_from_top' => __( 'Appear Icon From Top', 'cartflows' ),
241
+ 'animate_from_bottom' => __( 'Appear Icon From Bottom', 'cartflows' ),
242
+ ),
243
+ ),
244
+ ),
245
+ ),
246
+ 'formatting' => array(
247
+ 'title' => __( 'Structure', 'cartflows' ),
248
+ 'fields' => array(
249
+ 'width' => array(
250
+ 'type' => 'select',
251
+ 'label' => __( 'Width', 'cartflows' ),
252
+ 'default' => 'auto',
253
+ 'options' => array(
254
+ 'auto' => _x( 'Auto', 'Width.', 'cartflows' ),
255
+ 'full' => __( 'Full Width', 'cartflows' ),
256
+ 'custom' => __( 'Custom', 'cartflows' ),
257
+ ),
258
+ 'toggle' => array(
259
+ 'auto' => array(
260
+ 'fields' => array( 'align', 'mob_align' ),
261
+ ),
262
+ 'full' => array(
263
+ 'fields' => array(),
264
+ ),
265
+ 'custom' => array(
266
+ 'fields' => array( 'align', 'mob_align', 'custom_width', 'custom_height', 'padding_top_bottom', 'padding_left_right' ),
267
+ ),
268
+ ),
269
+ ),
270
+ 'align' => array(
271
+ 'type' => 'align',
272
+ 'label' => __( 'Alignment', 'cartflows' ),
273
+ 'default' => 'center',
274
+ 'options' => array(
275
+ 'center' => __( 'Center', 'cartflows' ),
276
+ 'left' => __( 'Left', 'cartflows' ),
277
+ 'right' => __( 'Right', 'cartflows' ),
278
+ ),
279
+ ),
280
+ 'mob_align' => array(
281
+ 'type' => 'align',
282
+ 'label' => __( 'Mobile Alignment', 'cartflows' ),
283
+ 'default' => 'center',
284
+ 'options' => array(
285
+ 'center' => __( 'Center', 'cartflows' ),
286
+ 'left' => __( 'Left', 'cartflows' ),
287
+ 'right' => __( 'Right', 'cartflows' ),
288
+ ),
289
+ ),
290
+ 'button_padding_dimension' => array(
291
+ 'type' => 'dimension',
292
+ 'label' => __( 'Padding', 'cartflows' ),
293
+ 'slider' => true,
294
+ 'units' => array( 'px' ),
295
+ 'responsive' => true,
296
+ 'preview' => array(
297
+ 'type' => 'css',
298
+ 'selector' => '.cartflows-bb__next-step-creative-button-wrap a',
299
+ 'property' => 'padding',
300
+ 'unit' => 'px',
301
+ 'important' => true,
302
+ ),
303
+ ),
304
+ 'button_border' => array(
305
+ 'type' => 'border',
306
+ 'label' => __( 'Border', 'cartflows' ),
307
+ 'slider' => true,
308
+ 'units' => array( 'px' ),
309
+ 'preview' => array(
310
+ 'type' => 'css',
311
+ 'selector' => '.cartflows-bb__next-step-creative-button-wrap a',
312
+ 'property' => 'border',
313
+ 'unit' => 'px',
314
+ 'important' => true,
315
+ ),
316
+ ),
317
+ 'border_hover_color' => array(
318
+ 'type' => 'color',
319
+ 'label' => __( 'Border Hover Color', 'cartflows' ),
320
+ 'default' => '',
321
+ 'show_reset' => true,
322
+ 'connections' => array( 'color' ),
323
+ 'show_alpha' => true,
324
+ 'preview' => array(
325
+ 'type' => 'none',
326
+ ),
327
+ ),
328
+ 'custom_width' => array(
329
+ 'type' => 'unit',
330
+ 'label' => __( 'Custom Width', 'cartflows' ),
331
+ 'default' => '200',
332
+ 'maxlength' => '3',
333
+ 'size' => '4',
334
+ 'slider' => true,
335
+ 'units' => array( 'px' ),
336
+ ),
337
+ 'custom_height' => array(
338
+ 'type' => 'unit',
339
+ 'label' => __( 'Custom Height', 'cartflows' ),
340
+ 'default' => '45',
341
+ 'maxlength' => '3',
342
+ 'size' => '4',
343
+ 'slider' => true,
344
+ 'units' => array( 'px' ),
345
+ ),
346
+ 'padding_top_bottom' => array(
347
+ 'type' => 'unit',
348
+ 'label' => __( 'Padding Top/Bottom', 'cartflows' ),
349
+ 'placeholder' => '0',
350
+ 'maxlength' => '3',
351
+ 'size' => '4',
352
+ 'slider' => true,
353
+ 'units' => array( 'px' ),
354
+ ),
355
+ 'padding_left_right' => array(
356
+ 'type' => 'unit',
357
+ 'label' => __( 'Padding Left/Right', 'cartflows' ),
358
+ 'placeholder' => '0',
359
+ 'maxlength' => '3',
360
+ 'size' => '4',
361
+ 'slider' => true,
362
+ 'units' => array( 'px' ),
363
+ ),
364
+ 'border_radius' => array(
365
+ 'type' => 'unit',
366
+ 'label' => __( 'Round Corners', 'cartflows' ),
367
+ 'maxlength' => '3',
368
+ 'size' => '4',
369
+ 'slider' => true,
370
+ 'units' => array( 'px' ),
371
+ 'preview' => array(
372
+ 'type' => 'css',
373
+ 'selector' => '.cartflows-bb__next-step-creative-button-wrap a',
374
+ 'property' => 'border-radius',
375
+ 'unit' => 'px',
376
+ ),
377
+ ),
378
+ ),
379
+ ),
380
+ 'colors' => array(
381
+ 'title' => __( 'Colors', 'cartflows' ),
382
+ 'fields' => array(
383
+ 'text_color' => array(
384
+ 'type' => 'color',
385
+ 'label' => __( 'Text Color', 'cartflows' ),
386
+ 'default' => '',
387
+ 'show_reset' => true,
388
+ 'connections' => array( 'color' ),
389
+ 'show_alpha' => true,
390
+ 'preview' => array(
391
+ 'type' => 'css',
392
+ 'selector' => '.cartflows-bb__next-step-creative-button-wrap a',
393
+ 'property' => 'color',
394
+ 'unit' => 'px',
395
+ ),
396
+ ),
397
+ 'text_hover_color' => array(
398
+ 'type' => 'color',
399
+ 'label' => __( 'Text Hover Color', 'cartflows' ),
400
+ 'default' => '',
401
+ 'show_reset' => true,
402
+ 'connections' => array( 'color' ),
403
+ 'show_alpha' => true,
404
+ 'preview' => array(
405
+ 'type' => 'css',
406
+ 'selector' => '.cartflows-bb__next-step-creative-button-wrap a:hover',
407
+ 'property' => 'color',
408
+ 'unit' => 'px',
409
+ ),
410
+ ),
411
+ 'bg_color' => array(
412
+ 'type' => 'color',
413
+ 'label' => __( 'Background Color', 'cartflows' ),
414
+ 'default' => '',
415
+ 'show_reset' => true,
416
+ 'connections' => array( 'color' ),
417
+ 'show_alpha' => true,
418
+ ),
419
+ 'bg_hover_color' => array(
420
+ 'type' => 'color',
421
+ 'label' => __( 'Background Hover Color', 'cartflows' ),
422
+ 'default' => '',
423
+ 'show_reset' => true,
424
+ 'connections' => array( 'color' ),
425
+ 'show_alpha' => true,
426
+ 'preview' => array(
427
+ 'type' => 'none',
428
+ ),
429
+ ),
430
+ 'hover_attribute' => array(
431
+ 'type' => 'select',
432
+ 'label' => __( 'Apply Hover Color To', 'cartflows' ),
433
+ 'default' => 'bg',
434
+ 'options' => array(
435
+ 'border' => __( 'Border', 'cartflows' ),
436
+ 'bg' => __( 'Background', 'cartflows' ),
437
+ ),
438
+ 'width' => '75px',
439
+ ),
440
+
441
+ ),
442
+ ),
443
+ ),
444
+ ),
445
+ 'creative_typography' => array(
446
+ 'title' => __( 'Typography', 'cartflows' ),
447
+ 'sections' => array(
448
+ 'typography' => array(
449
+ 'title' => __( 'Button Settings', 'cartflows' ),
450
+ 'fields' => array(
451
+ 'button_typo' => array(
452
+ 'type' => 'typography',
453
+ 'label' => __( 'Typography', 'cartflows' ),
454
+ 'responsive' => true,
455
+ 'preview' => array(
456
+ 'type' => 'css',
457
+ 'selector' => '.cartflows-bb__next-step-creative-button',
458
+ ),
459
+ ),
460
+ ),
461
+ ),
462
+ ),
463
+ ),
464
+ )
465
+ );
modules/beaver-builder/cartflows-bb-next-step/css/frontend.css ADDED
@@ -0,0 +1,526 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cartflows-bb__next-step-creative-button-wrap a,
2
+ .cartflows-bb__next-step-creative-button-wrap a:visited {
3
+ padding: 12px 24px;
4
+ }
5
+ a.cartflows-bb__next-step-button.cartflows-bb__next-step-creative-button.cartflows-bb__next-step-creative-gradient-btn {
6
+ border: none;
7
+ }
8
+
9
+ .cartflows-bb__next-step-button-wrap a,
10
+ .cartflows-bb__next-step-button-wrap a:visited {
11
+ display: inline-block;
12
+ font-size: 16px;
13
+ line-height: 18px;
14
+ text-decoration: none;
15
+ text-shadow: none;
16
+ }
17
+ .cartflows-bb__next-step-button-wrap a * ,
18
+ .cartflows-bb__next-step-button-wrap a:visited * {
19
+ /*color: #333;*/
20
+ }
21
+ .fl-builder-content .cartflows-bb__next-step-button:hover {
22
+ text-decoration: none;
23
+ }
24
+
25
+ .fl-builder-content .cartflows-bb__next-step-button-width-full .cartflows-bb__next-step-button {
26
+ display: block;
27
+ text-align: center;
28
+ }
29
+
30
+ .cartflows-bb__next-step-button-width-custom .cartflows-bb__next-step-button {
31
+ display: inline-block;
32
+ text-align: center;
33
+ max-width: 100%;
34
+ }
35
+ .fl-builder-content .cartflows-bb__next-step-button-left {
36
+ text-align: left;
37
+ }
38
+ .fl-builder-content .cartflows-bb__next-step-button-center {
39
+ text-align: center;
40
+ }
41
+ .fl-builder-content .cartflows-bb__next-step-button-right {
42
+ text-align: right;
43
+ }
44
+
45
+ .fl-builder-content .cartflows-bb__next-step-button i,
46
+ .fl-builder-content .cartflows-bb__next-step-button i:before {
47
+ font-size: 1em;
48
+ height: 1em;
49
+ line-height: 1em;
50
+ width: 1em;
51
+ }
52
+
53
+ .cartflows-bb__next-step-button .cartflows-bb__next-step-button-icon-after {
54
+ margin-left: 8px;
55
+ margin-right: 0;
56
+ }
57
+ .cartflows-bb__next-step-button .cartflows-bb__next-step-button-icon-before {
58
+ margin-left: 0;
59
+ margin-right: 8px;
60
+ }
61
+ .cartflows-bb__next-step-button .cartflows-bb__next-step-button-icon-no-text {
62
+ margin: 0;
63
+ }
64
+ .cartflows-bb__next-step-button-has-icon .cartflows-bb__next-step-button-text {
65
+ vertical-align: middle;
66
+ }
67
+
68
+ /* Creative Button
69
+ ___________________________________________________________________________*/
70
+
71
+ .cartflows-bb__next-step-creative-button-wrap a,
72
+ .cartflows-bb__next-step-creative-button-wrap a:visited {
73
+ background: #fafafa;
74
+ border: 1px solid #ccc;
75
+ color: #333;
76
+ display: inline-block;
77
+ vertical-align: middle;
78
+ text-align: center;
79
+ overflow: hidden;
80
+ text-decoration: none;
81
+ text-shadow: none;
82
+ box-shadow: none;
83
+ position: relative;
84
+ -webkit-transition: all 200ms linear;
85
+ -moz-transition: all 200ms linear;
86
+ -ms-transition: all 200ms linear;
87
+ -o-transition: all 200ms linear;
88
+ transition: all 200ms linear;
89
+
90
+ }
91
+
92
+ .cartflows-bb__next-step-creative-button-wrap a:focus {
93
+ text-decoration: none;
94
+ text-shadow: none;
95
+ box-shadow: none;
96
+ }
97
+
98
+ .cartflows-bb__next-step-creative-button-wrap a .cartflows-bb__next-step-creative-button-text,
99
+ .cartflows-bb__next-step-creative-button-wrap a .cartflows-bb__next-step-creative-button-icon,
100
+ .cartflows-bb__next-step-creative-button-wrap a:visited .cartflows-bb__next-step-creative-button-text,
101
+ .cartflows-bb__next-step-creative-button-wrap a:visited .cartflows-bb__next-step-creative-button-icon {
102
+ -webkit-transition: all 200ms linear;
103
+ -moz-transition: all 200ms linear;
104
+ -ms-transition: all 200ms linear;
105
+ -o-transition: all 200ms linear;
106
+ transition: all 200ms linear;
107
+ }
108
+
109
+ .cartflows-bb__next-step-creative-button-wrap a:hover {
110
+ text-decoration: none;
111
+ }
112
+
113
+ .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-button-width-full .cartflows-bb__next-step-creative-button {
114
+ display: block;
115
+ text-align: center;
116
+ }
117
+ .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-button-width-custom .cartflows-bb__next-step-creative-button {
118
+ display: inline-block;
119
+ text-align: center;
120
+ max-width: 100%;
121
+ }
122
+ .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-button-left {
123
+ text-align: left;
124
+ }
125
+ .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-button-center {
126
+ text-align: center;
127
+ }
128
+ .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-button-right {
129
+ text-align: right;
130
+ }
131
+ .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-button i {
132
+ font-size: 1.3em;
133
+ height: auto;
134
+ vertical-align: middle;
135
+ width: auto;
136
+ }
137
+
138
+ .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-button .cartflows-bb__next-step-creative-button-icon-after {
139
+ margin-left: 8px;
140
+ margin-right: 0;
141
+ }
142
+ .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-button .cartflows-bb__next-step-creative-button-icon-before {
143
+ margin-right: 8px;
144
+ margin-left: 0;
145
+ }
146
+ .cartflows-bb__next-step-creative-button-wrap.cartflows-bb__next-step-creative-button-icon-no-text .cartflows-bb__next-step-creative-button i {
147
+ margin: 0;
148
+ }
149
+
150
+ .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-button-has-icon .cartflows-bb__next-step-creative-button-text {
151
+ vertical-align: middle;
152
+ }
153
+ .cartflows-bb__next-step-creative-button-wrap a,
154
+ .cartflows-bb__next-step-creative-button-wrap a:visited {
155
+ padding: 12px 24px;
156
+ }
157
+
158
+ /* Translate Button styles */
159
+
160
+ .cartflows-bb__next-step-creative-button.cartflows-bb__next-step-creative-transparent-btn {
161
+ background: transparent;
162
+ }
163
+ .cartflows-bb__next-step-creative-button.cartflows-bb__next-step-creative-transparent-btn:after {
164
+ content: '';
165
+ position: absolute;
166
+ z-index: 1;
167
+ -webkit-transition: all 200ms linear;
168
+ -moz-transition: all 200ms linear;
169
+ -ms-transition: all 200ms linear;
170
+ -o-transition: all 200ms linear;
171
+ transition: all 200ms linear;
172
+ }
173
+
174
+ /* transparent-fill-top, transparent-fill-bottom */
175
+ .cartflows-bb__next-step-transparent-fill-top-btn:after,
176
+ .cartflows-bb__next-step-transparent-fill-bottom-btn:after {
177
+ width: 100%;
178
+ height: 0;
179
+ left: 0;
180
+ }
181
+
182
+ /* transparent-fill-top */
183
+ .cartflows-bb__next-step-transparent-fill-top-btn:after {
184
+ top: 0;
185
+ }
186
+ /* transparent-fill-bottom */
187
+ .cartflows-bb__next-step-transparent-fill-bottom-btn:after {
188
+ bottom: 0;
189
+ }
190
+
191
+ /* transparent-fill-left, transparent-fill-right */
192
+ .cartflows-bb__next-step-transparent-fill-left-btn:after,
193
+ .cartflows-bb__next-step-transparent-fill-right-btn:after {
194
+ width: 0;
195
+ height: 100%;
196
+ top: 0;
197
+ }
198
+
199
+ /* transparent-fill-left */
200
+ .cartflows-bb__next-step-transparent-fill-left-btn:after {
201
+ left: 0;
202
+ }
203
+ /* transparent-fill-right */
204
+ .cartflows-bb__next-step-transparent-fill-right-btn:after {
205
+ right: 0;
206
+ }
207
+
208
+
209
+ /* transparent-fill-center */
210
+ .cartflows-bb__next-step-transparent-fill-center-btn:after{
211
+ width: 0;
212
+ height: 100%;
213
+ top: 50%;
214
+ left: 50%;
215
+ -webkit-transform: translateX(-50%) translateY(-50%);
216
+ -moz-transform: translateX(-50%) translateY(-50%);
217
+ -ms-transform: translateX(-50%) translateY(-50%);
218
+ -o-transform: translateX(-50%) translateY(-50%);
219
+ transform: translateX(-50%) translateY(-50%);
220
+ }
221
+
222
+ /* transparent-fill-diagonal, transparent-fill-horizontal */
223
+ .cartflows-bb__next-step-transparent-fill-diagonal-btn:after,
224
+ .cartflows-bb__next-step-transparent-fill-horizontal-btn:after {
225
+ width: 100%;
226
+ height: 0;
227
+ top: 50%;
228
+ left: 50%;
229
+ }
230
+
231
+ /* transparent-fill-diagonal */
232
+ .cartflows-bb__next-step-transparent-fill-diagonal-btn{
233
+ overflow: hidden;
234
+ }
235
+ .cartflows-bb__next-step-transparent-fill-diagonal-btn:after{
236
+ -webkit-transform: translateX(-50%) translateY(-50%) rotate( 45deg );
237
+ -moz-transform: translateX(-50%) translateY(-50%) rotate( 45deg );
238
+ -ms-transform: translateX(-50%) translateY(-50%) rotate( 45deg );
239
+ -o-transform: translateX(-50%) translateY(-50%) rotate( 45deg );
240
+ transform: translateX(-50%) translateY(-50%) rotate( 45deg );
241
+ }
242
+ /* transparent-fill-horizontal */
243
+ .cartflows-bb__next-step-transparent-fill-horizontal-btn:after{
244
+ -webkit-transform: translateX(-50%) translateY(-50%);
245
+ -moz-transform: translateX(-50%) translateY(-50%);
246
+ -ms-transform: translateX(-50%) translateY(-50%);
247
+ -o-transform: translateX(-50%) translateY(-50%);
248
+ transform: translateX(-50%) translateY(-50%);
249
+ }
250
+
251
+
252
+ /* 3D Button styles */
253
+ .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_down-btn,
254
+ .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_up-btn,
255
+ .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_left-btn,
256
+ .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_right-btn {
257
+ -webkit-transition: none;
258
+ -moz-transition: none;
259
+ -ms-transition: none;
260
+ -o-transition: none;
261
+ transition: none;
262
+ }
263
+
264
+ .perspective {
265
+ -webkit-perspective: 800px;
266
+ -moz-perspective: 800px;
267
+ perspective: 800px;
268
+ margin: 0;
269
+ }
270
+ .cartflows-bb__next-step-creative-button.cartflows-bb__next-step-creative-threed-btn:after {
271
+ content: '';
272
+ position: absolute;
273
+ z-index: -1;
274
+ -webkit-transition: all 200ms linear;
275
+ -moz-transition: all 200ms linear;
276
+ transition: all 200ms linear;
277
+ }
278
+
279
+ .cartflows-bb__next-step-creative-button.cartflows-bb__next-step-creative-threed-btn {
280
+ /*display: block;*/
281
+ outline: 1px solid transparent;
282
+ -webkit-transform-style: preserve-3d;
283
+ -moz-transform-style: preserve-3d;
284
+ transform-style: preserve-3d;
285
+ }
286
+
287
+ /* 3D Button styles --- Animate to top */
288
+ .cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-animate_top-btn:after {
289
+ height: 40%;
290
+ left: 0;
291
+ top: -40%;
292
+ width: 100%;
293
+ -webkit-transform-origin: 0% 100%;
294
+ -moz-transform-origin: 0% 100%;
295
+ transform-origin: 0% 100%;
296
+ -webkit-transform: rotateX(90deg);
297
+ -moz-transform: rotateX(90deg);
298
+ transform: rotateX(90deg);
299
+ }
300
+
301
+ /* 3D Button styles --- Animate to bottom */
302
+ .cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-animate_bottom-btn:after {
303
+ width: 100%;
304
+ height: 40%;
305
+ left: 0;
306
+ top: 100%;
307
+
308
+ -webkit-transform-origin: 0% 0%;
309
+ -moz-transform-origin: 0% 0%;
310
+ -ms-transform-origin: 0% 0%;
311
+ transform-origin: 0% 0%;
312
+
313
+ -webkit-transform: rotateX(-90deg);
314
+ -moz-transform: rotateX(-90deg);
315
+ -ms-transform: rotateX(-90deg);
316
+ transform: rotateX(-90deg);
317
+ }
318
+
319
+ /* 3D Button styles --- Animate to Left */
320
+ .cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-animate_left-btn:after {
321
+ width: 20%;
322
+ height: 100%;
323
+ left: -20%;
324
+ top: 0;
325
+ -webkit-transform-origin: 100% 0%;
326
+ -moz-transform-origin: 100% 0%;
327
+ -ms-transform-origin: 100% 0%;
328
+ transform-origin: 100% 0%;
329
+
330
+
331
+ -webkit-transform: rotateY(-60deg);
332
+ -moz-transform: rotateY(-60deg);
333
+ -ms-transform: rotateY(-60deg);
334
+ transform: rotateY(-60deg);
335
+ }
336
+
337
+ /* 3D Button styles --- Animate to Right */
338
+ .cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-animate_right-btn:after {
339
+ width: 20%;
340
+ height: 100%;
341
+ left: 104%;
342
+ top: 0;
343
+ -webkit-transform-origin: 0% 0%;
344
+ -moz-transform-origin: 0% 0%;
345
+ -ms-transform-origin: 0% 0%;
346
+ transform-origin: 0% 0%;
347
+
348
+ -webkit-transform: rotateY(120deg);
349
+ -moz-transform: rotateY(120deg);
350
+ -ms-transform: rotateY(120deg);
351
+ transform: rotateY(120deg);
352
+ }
353
+
354
+
355
+ /* Animate Top */
356
+ .cartflows-bb__next-step-animate_top-btn:hover{
357
+ -webkit-transform: rotateX(-15deg);
358
+ -moz-transform: rotateX(-15deg);
359
+ -ms-transform: rotateX(-15deg);
360
+ -o-transform: rotateX(-15deg);
361
+ transform: rotateX(-15deg);
362
+
363
+ }
364
+
365
+ /* Animate Bottom */
366
+ .cartflows-bb__next-step-animate_bottom-btn:hover{
367
+ -webkit-transform: rotateX(15deg);
368
+ -moz-transform: rotateX(15deg);
369
+ -ms-transform: rotateX(15deg);
370
+ -o-transform: rotateX(15deg);
371
+ transform: rotateX(15deg);
372
+
373
+ }
374
+
375
+ /* Animate Left */
376
+ .cartflows-bb__next-step-animate_left-btn:hover{
377
+ -webkit-transform: rotateY(6deg);
378
+ -moz-transform: rotateY(6deg);
379
+ -ms-transform: rotateY(6deg);
380
+ -o-transform: rotateY(6deg);
381
+ transform: rotateY(6deg);
382
+ }
383
+
384
+ /* Animate Right */
385
+ .cartflows-bb__next-step-animate_right-btn:hover{
386
+ -webkit-transform: rotateY(-6deg);
387
+ -moz-transform: rotateY(-6deg);
388
+ -ms-transform: rotateY(-6deg);
389
+ -o-transform: rotateY(-6deg);
390
+ transform: rotateY(-6deg);
391
+
392
+ }
393
+
394
+
395
+
396
+
397
+ /* Flat Button styles */
398
+
399
+ /* Common Classes */
400
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_right-btn,
401
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_left-btn,
402
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_top-btn,
403
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_bottom-btn {
404
+ overflow: hidden;
405
+ position: relative;
406
+ }
407
+
408
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_right-btn i,
409
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_left-btn i,
410
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_top-btn i,
411
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_bottom-btn i {
412
+ bottom: 0;
413
+ height: 100%;
414
+ margin: 0;
415
+ opacity: 1;
416
+ position: absolute;
417
+ right: 0;
418
+ width: 100%;
419
+ -webkit-transition: all 200ms linear;
420
+ -moz-transition: all 200ms linear;
421
+ transition: all 200ms linear;
422
+ -webkit-transform: translateY(0);
423
+ -moz-transform: translateY(0);
424
+ -o-transform: translateY(0);
425
+ -ms-transform: translateY(0);
426
+ transform: translateY(0);
427
+ }
428
+
429
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_right-btn .cartflows-bb__next-step-button-text,
430
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_left-btn .cartflows-bb__next-step-button-text,
431
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_top-btn .cartflows-bb__next-step-button-text,
432
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_bottom-btn .cartflows-bb__next-step-button-text {
433
+ display: inline-block;
434
+ width: 100%;
435
+ height: 100%;
436
+ -webkit-transition: all 200ms linear;
437
+ -moz-transition: all 200ms linear;
438
+ -ms-transition: all 200ms linear;
439
+ -o-transition: all 200ms linear;
440
+ transition: all 200ms linear;
441
+ -webkit-backface-visibility: hidden;
442
+ -moz-backface-visibility: hidden;
443
+ backface-visibility: hidden;
444
+ }
445
+
446
+ /* Making Icon position center */
447
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_right-btn i:before,
448
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_left-btn i:before,
449
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_top-btn i:before,
450
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_bottom-btn i:before {
451
+ position: absolute;
452
+ top: 50%;
453
+ left: 50%;
454
+ -webkit-transform: translateX(-50%) translateY(-50%);
455
+ -moz-transform: translateX(-50%) translateY(-50%);
456
+ -o-transform: translateX(-50%) translateY(-50%);
457
+ -ms-transform: translateX(-50%) translateY(-50%);
458
+ transform: translateX(-50%) translateY(-50%);
459
+ }
460
+
461
+ /* Common Hover Classes */
462
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_right-btn:hover i,
463
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_left-btn:hover i {
464
+ left: 0;
465
+ }
466
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_top-btn:hover i,
467
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_bottom-btn:hover i {
468
+ top: 0;
469
+ }
470
+
471
+
472
+ /* Animate Icon to the right */
473
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_right-btn i {
474
+ top: 0;
475
+ left: -100%;
476
+ }
477
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_right-btn:hover .cartflows-bb__next-step-button-text {
478
+ -webkit-transform: translateX(200%);
479
+ -moz-transform: translateX(200%);
480
+ -ms-transform: translateX(200%);
481
+ -o-transform: translateX(200%);
482
+ transform: translateX(200%);
483
+ }
484
+
485
+ /* Animate Icon to the left */
486
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_left-btn i {
487
+ top: 0;
488
+ left: 100%;
489
+ }
490
+
491
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_to_left-btn:hover .cartflows-bb__next-step-button-text {
492
+ -webkit-transform: translateX(-200%);
493
+ -moz-transform: translateX(-200%);
494
+ -ms-transform: translateX(-200%);
495
+ -o-transform: translateX(-200%);
496
+ transform: translateX(-200%);
497
+ }
498
+
499
+
500
+ /* Animate Icon From the Top */
501
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_top-btn i {
502
+ top: -100%;
503
+ left: 0;
504
+ }
505
+
506
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_top-btn:hover .cartflows-bb__next-step-button-text {
507
+ -webkit-transform: translateY(400px);
508
+ -moz-transform: translateY(400px);
509
+ -ms-transform: translateY(400px);
510
+ -o-transform: translateY(400px);
511
+ transform: translateY(400px);
512
+ }
513
+
514
+ /* Animate Icon From the Bottom */
515
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_bottom-btn i {
516
+ top: 100%;
517
+ left: 0;
518
+ }
519
+
520
+ .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_bottom-btn:hover .cartflows-bb__next-step-button-text {
521
+ -webkit-transform: translateY(-400px);
522
+ -moz-transform: translateY(-400px);
523
+ -ms-transform: translateY(-400px);
524
+ -o-transform: translateY(-400px);
525
+ transform: translateY(-400px);
526
+ }
modules/beaver-builder/cartflows-bb-next-step/icon/bb-next-step.svg ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20pt" height="20pt" viewBox="0 0 20 20" version="1.1">
3
+ <g id="surface1">
4
+ <path style=" stroke:none;fill-rule:evenodd;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 2.890625 10.398438 C 2.886719 10.386719 2.886719 10.371094 2.886719 10.355469 C 2.886719 10.324219 2.886719 10.296875 2.890625 10.265625 C 2.910156 8.449219 3.429688 6.59375 4.617188 5.203125 C 5.902344 3.695312 7.882812 2.847656 9.886719 2.839844 C 9.898438 2.839844 9.914062 2.839844 9.925781 2.839844 C 12.519531 2.851562 15.058594 4.269531 16.265625 6.632812 C 16.667969 7.417969 16.914062 8.277344 17.03125 9.148438 L 17.5 8.65625 L 17.511719 8.644531 L 17.523438 8.636719 L 17.535156 8.625 L 17.550781 8.617188 L 17.5625 8.605469 L 17.578125 8.597656 L 17.589844 8.589844 L 17.605469 8.582031 L 17.621094 8.578125 L 17.636719 8.570312 L 17.648438 8.566406 L 17.664062 8.5625 L 17.683594 8.558594 L 17.699219 8.558594 L 17.714844 8.554688 L 17.777344 8.554688 L 17.855469 8.574219 L 17.871094 8.582031 L 17.886719 8.585938 L 17.898438 8.59375 L 17.929688 8.609375 L 17.941406 8.621094 L 17.953125 8.628906 L 18 8.675781 L 18.007812 8.6875 L 18.019531 8.703125 L 18.027344 8.714844 L 18.035156 8.730469 L 18.042969 8.742188 L 18.050781 8.757812 L 18.058594 8.789062 L 18.066406 8.804688 L 18.066406 8.820312 L 18.074219 8.851562 L 18.074219 8.929688 L 18.070312 8.949219 L 18.0625 8.980469 L 18.058594 8.992188 L 18.050781 9.007812 L 18.046875 9.023438 L 18.03125 9.054688 L 18.015625 9.078125 L 18.003906 9.09375 L 17.996094 9.105469 L 17.984375 9.117188 L 17.027344 10.121094 C 17.019531 10.132812 17.007812 10.140625 16.996094 10.152344 L 16.777344 10.382812 C 18.554688 10.382812 20 11.828125 20 13.605469 C 20 15.382812 18.554688 16.824219 16.777344 16.824219 C 15 16.824219 13.558594 15.382812 13.558594 13.605469 C 13.558594 11.828125 15 10.382812 16.777344 10.382812 L 15.511719 9.179688 L 15.5 9.167969 L 15.492188 9.15625 L 15.480469 9.140625 L 15.46875 9.128906 L 15.460938 9.117188 L 15.453125 9.101562 L 15.445312 9.089844 L 15.4375 9.074219 L 15.433594 9.058594 L 15.425781 9.042969 L 15.414062 8.996094 L 15.414062 8.980469 L 15.410156 8.964844 L 15.410156 8.902344 L 15.414062 8.882812 L 15.417969 8.867188 L 15.417969 8.851562 L 15.425781 8.835938 L 15.429688 8.824219 L 15.433594 8.808594 L 15.449219 8.777344 L 15.457031 8.765625 L 15.464844 8.75 L 15.476562 8.738281 L 15.484375 8.726562 L 15.496094 8.710938 L 15.507812 8.699219 L 15.519531 8.691406 L 15.542969 8.667969 L 15.554688 8.660156 L 15.585938 8.644531 L 15.597656 8.636719 L 15.613281 8.628906 L 15.628906 8.625 L 15.644531 8.617188 L 15.675781 8.609375 L 15.691406 8.609375 L 15.707031 8.605469 L 15.722656 8.605469 L 15.738281 8.601562 L 15.753906 8.601562 L 15.769531 8.605469 L 15.785156 8.605469 L 15.800781 8.609375 L 15.820312 8.613281 L 15.832031 8.617188 L 15.863281 8.625 L 15.894531 8.640625 L 15.90625 8.648438 L 15.921875 8.65625 L 15.933594 8.664062 L 15.949219 8.675781 L 15.960938 8.683594 L 15.972656 8.695312 L 16.339844 9.046875 C 16.085938 7.511719 15.367188 6.050781 14.171875 5.035156 C 12.1875 3.355469 9.15625 3.003906 6.804688 4.277344 C 5.554688 4.957031 4.578125 6.101562 4.0625 7.4375 C 3.703125 8.371094 3.554688 9.378906 3.554688 10.382812 L 3.550781 10.398438 C 5.175781 10.566406 6.441406 11.9375 6.441406 13.605469 C 6.441406 15.382812 5 16.824219 3.222656 16.824219 C 1.445312 16.824219 0 15.382812 0 13.605469 C 0 11.9375 1.265625 10.566406 2.890625 10.398438 Z M 16.777344 11.070312 C 18.179688 11.070312 19.3125 12.207031 19.3125 13.605469 C 19.3125 15.003906 18.179688 16.140625 16.777344 16.140625 C 15.378906 16.140625 14.242188 15.003906 14.242188 13.605469 C 14.242188 12.207031 15.378906 11.070312 16.777344 11.070312 Z M 16.777344 11.070312 "/>
5
+ </g>
6
+ </svg>
modules/beaver-builder/cartflows-bb-next-step/includes/frontend.css.php ADDED
@@ -0,0 +1,574 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BB Next Step Button Module front-end CSS php file.
4
+ *
5
+ * @package BB Next Step Button Module
6
+ */
7
+
8
+ global $post;
9
+
10
+ $settings->bg_color = Cartflows_BB_Helper::cartflows_bb_colorpicker( $settings, 'bg_color', true );
11
+ $settings->bg_hover_color = Cartflows_BB_Helper::cartflows_bb_colorpicker( $settings, 'bg_hover_color', true );
12
+ $settings->text_color = Cartflows_BB_Helper::cartflows_bb_colorpicker( $settings, 'text_color' );
13
+ $settings->text_hover_color = Cartflows_BB_Helper::cartflows_bb_colorpicker( $settings, 'text_hover_color' );
14
+
15
+ // Border Size.
16
+ if ( 'transparent' == $settings->style ) {
17
+ $border_size = ( '' !== trim( $settings->border_size ) ) ? $settings->border_size : '2';
18
+ } else {
19
+ $border_size = 1;
20
+ }
21
+ // Border Color.
22
+ if ( ! empty( $settings->bg_color ) ) {
23
+ $border_color = $settings->bg_color;
24
+ }
25
+ if ( ! empty( $settings->bg_hover_color ) ) {
26
+ $border_hover_color = $settings->bg_hover_color;
27
+ }
28
+
29
+ // Old Background Gradient Setting.
30
+ if ( isset( $settings->three_d ) && $settings->three_d ) {
31
+ $settings->style = 'gradient';
32
+ }
33
+
34
+ // Background Gradient.
35
+ if ( ! empty( $settings->bg_color ) ) {
36
+ $hex_bg = Cartflows_BB_Helper::cartflows_bb_parse_color_to_hex( $settings->bg_color );
37
+ $bg_grad_start = '#' . FLBuilderColor::adjust_brightness( $hex_bg, 30, 'lighten' );
38
+ }
39
+ if ( ! empty( $settings->bg_hover_color ) ) {
40
+ $hex_hover_bg = Cartflows_BB_Helper::cartflows_bb_parse_color_to_hex( $settings->bg_hover_color );
41
+ $bg_hover_grad_start = '#' . FLBuilderColor::adjust_brightness( $hex_hover_bg, 30, 'lighten' );
42
+ }
43
+
44
+ ?>
45
+
46
+ <?php if ( 'animate_top' == $settings->threed_button_options || 'animate_bottom' == $settings->threed_button_options ) { ?>
47
+ /* 3D Fix */
48
+
49
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap.cartflows-bb__next-step-creative-button-width-auto .perspective,
50
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap.cartflows-bb__next-step-creative-button-width-custom .perspective {
51
+ display: inline-block;
52
+ max-width: 100%;
53
+ }
54
+ <?php } ?>
55
+
56
+ <?php
57
+ if ( class_exists( 'FLBuilderCSS' ) ) {
58
+ FLBuilderCSS::typography_field_rule(
59
+ array(
60
+ 'settings' => $settings,
61
+ 'setting_name' => 'button_typo',
62
+ 'selector' => ".fl-node-$id .cartflows-bb__next-step-creative-button-wrap a,.fl-node-$id .cartflows-bb__next-step-creative-button-wrap a:visited",
63
+ )
64
+ );
65
+ }
66
+ ?>
67
+
68
+ <?php if ( 'default' !== $settings->style ) { ?>
69
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a,
70
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:visited {
71
+ <?php
72
+ if ( 'custom' == $settings->width ) {
73
+ $padding_top_bottom = ( '' !== $settings->padding_top_bottom ) ? $settings->padding_top_bottom : '0';
74
+ $padding_left_right = ( '' !== $settings->padding_left_right ) ? $settings->padding_left_right : '0';
75
+ ?>
76
+
77
+ padding-top: <?php echo $padding_top_bottom; ?>px;
78
+ padding-bottom: <?php echo $padding_top_bottom; ?>px;
79
+ padding-left: <?php echo $padding_left_right; ?>px;
80
+ padding-right: <?php echo $padding_left_right; ?>px;
81
+ <?php
82
+ }
83
+
84
+ if ( '' != $settings->border_radius ) :
85
+ ?>
86
+ border-radius: <?php echo $settings->border_radius; ?>px;
87
+ -moz-border-radius: <?php echo $settings->border_radius; ?>px;
88
+ -webkit-border-radius: <?php echo $settings->border_radius; ?>px;
89
+ <?php endif; ?>
90
+ <?php if ( 'custom' == $settings->width ) : ?>
91
+ width: <?php echo $settings->custom_width; ?>px;
92
+ min-height: <?php echo $settings->custom_height; ?>px;
93
+ display: -webkit-inline-box;
94
+ display: -ms-inline-flexbox;
95
+ display: inline-flex;
96
+ -webkit-box-align: center;
97
+ -ms-flex-align: center;
98
+ align-items: center;
99
+ -webkit-box-pack: center;
100
+ -ms-flex-pack: center;
101
+ justify-content: center;
102
+ <?php endif; ?>
103
+
104
+ <?php if ( ! empty( $settings->bg_color ) ) : ?>
105
+ background: <?php echo $settings->bg_color; ?>;
106
+ border: <?php echo $border_size; ?>px solid <?php echo $border_color; ?>;
107
+ <?php
108
+ if ( 'transparent' == $settings->style ) : // Transparent.
109
+ ?>
110
+ background: none;
111
+ <?php endif; ?>
112
+
113
+ <?php if ( 'gradient' == $settings->style ) : // Gradient. ?>
114
+ background: -moz-linear-gradient(top, <?php echo $bg_grad_start; ?> 0%, <?php echo $settings->bg_color; ?> 100%); /* FF3.6+ */
115
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,<?php echo $bg_grad_start; ?>), color-stop(100%,<?php echo $settings->bg_color; ?>)); /* Chrome,Safari4+ */
116
+ background: -webkit-linear-gradient(top, <?php echo $bg_grad_start; ?> 0%,<?php echo $settings->bg_color; ?> 100%); /* Chrome10+,Safari5.1+ */
117
+ background: -o-linear-gradient(top, <?php echo $bg_grad_start; ?> 0%,<?php echo $settings->bg_color; ?> 100%); /* Opera 11.10+ */
118
+ background: -ms-linear-gradient(top, <?php echo $bg_grad_start; ?> 0%,<?php echo $settings->bg_color; ?> 100%); /* IE10+ */
119
+ background: linear-gradient(to bottom, <?php echo $bg_grad_start; ?> 0%,<?php echo $settings->bg_color; ?> 100%); /* W3C */
120
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $bg_grad_start; ?>', endColorstr='<?php echo $settings->bg_color; ?>',GradientType=0 ); /* IE6-9 */
121
+ <?php endif; ?>
122
+ <?php endif; ?>
123
+ }
124
+ <?php
125
+ } else {
126
+ ?>
127
+
128
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:hover {
129
+ border-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->border_hover_color ); ?>;
130
+ }
131
+
132
+ <?php
133
+ $padding_top_bottom = $settings->button_padding_dimension_top;
134
+ ?>
135
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a,
136
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:visited {
137
+ <?php
138
+ if ( isset( $settings->button_padding_dimension_top ) ) {
139
+ echo 'padding-top:' . $settings->button_padding_dimension_top . 'px;';
140
+ }
141
+ if ( isset( $settings->button_padding_dimension_bottom ) ) {
142
+ echo 'padding-bottom:' . $settings->button_padding_dimension_bottom . 'px;';
143
+ }
144
+ if ( isset( $settings->button_padding_dimension_left ) ) {
145
+ echo 'padding-left:' . $settings->button_padding_dimension_left . 'px;';
146
+ }
147
+ if ( isset( $settings->button_padding_dimension_right ) ) {
148
+ echo 'padding-right:' . $settings->button_padding_dimension_right . 'px;';
149
+ }
150
+ ?>
151
+ }
152
+ <?php
153
+ if ( class_exists( 'FLBuilderCSS' ) ) {
154
+ // Border - Settings.
155
+ FLBuilderCSS::border_field_rule(
156
+ array(
157
+ 'settings' => $settings,
158
+ 'setting_name' => 'button_border',
159
+ 'selector' => ".fl-node-$id .cartflows-bb__next-step-module-content.cartflows-bb__next-step-creative-button-wrap a, .fl-node-$id a.cartflows-bb__next-step-button",
160
+ )
161
+ );
162
+ }
163
+ ?>
164
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a,
165
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:visited,
166
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-button {
167
+ background: <?php echo $settings->bg_color; ?>;
168
+ }
169
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-module-content.cartflows-bb__next-step-creative-button-wrap a:hover {
170
+ <?php echo 'border-color:' . FLBuilderColor::hex_or_rgb( $settings->border_hover_color ) . ';'; ?>
171
+ }
172
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:hover {
173
+ background: <?php echo $settings->bg_hover_color; ?>;
174
+ }
175
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a,
176
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a *,
177
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:visited,
178
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:visited * {
179
+ color: <?php echo $settings->text_color; ?>;
180
+ }
181
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:hover,
182
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:hover *,
183
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-button:hover {
184
+ color: <?php echo $settings->text_hover_color; ?>;
185
+ }
186
+ <?php } ?>
187
+
188
+ <?php if ( is_array( $settings->button_typo ) ) { ?>
189
+ <?php if ( isset( $settings->button_typo['line_height'] ) && is_array( $settings->button_typo['line_height'] ) && 'custom' == $settings->width && '' != $settings->custom_height ) { ?>
190
+ html.internet-explorer .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a,
191
+ html.internet-explorer .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:visited {
192
+ line-height: <?php echo $settings->custom_height; ?>px;
193
+ }
194
+ <?php } elseif ( isset( $settings->button_typo['line_height'] ) && is_object( $settings->button_typo['line_height'] ) && 'custom' == $settings->width && '' != $settings->custom_height ) { ?>
195
+ html.internet-explorer .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a,
196
+ html.internet-explorer .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:visited {
197
+ line-height: <?php echo $settings->custom_height; ?>px;
198
+ }
199
+ <?php } ?>
200
+ <?php } elseif ( is_object( $settings->button_typo ) ) { ?>
201
+ <?php if ( isset( $settings->button_typo->line_height ) && is_object( $settings->button_typo->line_height ) && 'custom' == $settings->width && '' != $settings->custom_height ) { ?>
202
+ html.internet-explorer .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a,
203
+ html.internet-explorer .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:visited {
204
+ line-height: <?php echo $settings->custom_height; ?>px;
205
+ }
206
+ <?php } elseif ( isset( $settings->button_typo->line_height ) && is_object( $settings->button_typo->line_height ) && 'custom' == $settings->width && '' != $settings->custom_height ) { ?>
207
+ html.internet-explorer .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a,
208
+ html.internet-explorer .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:visited {
209
+ line-height: <?php echo $settings->custom_height; ?>px;
210
+ }
211
+ <?php } ?>
212
+ <?php } ?>
213
+
214
+ <?php
215
+ if ( 'custom' == $settings->width && '' != $settings->custom_height ) :
216
+ $translateText = intval( $settings->custom_height ) + ( intval( $padding_top_bottom ) * 2 ) + 50; // @codingStandardsIgnoreLine.
217
+ ?>
218
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_top-btn:hover .cartflows-bb__next-step-button-text {
219
+ -webkit-transform: translateY(<?php echo $translateText; ?>px); <?php // @codingStandardsIgnoreLine. ?>
220
+ -moz-transform: translateY(<?php echo $translateText; ?>px); <?php // @codingStandardsIgnoreLine. ?>
221
+ -ms-transform: translateY(<?php echo $translateText; ?>px); <?php // @codingStandardsIgnoreLine. ?>
222
+ -o-transform: translateY(<?php echo $translateText; ?>px); <?php // @codingStandardsIgnoreLine. ?>
223
+ transform: translateY(<?php echo $translateText; ?>px); <?php // @codingStandardsIgnoreLine. ?>
224
+ }
225
+
226
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-flat-btn.cartflows-bb__next-step-animate_from_bottom-btn:hover .cartflows-bb__next-step-button-text {
227
+ -webkit-transform: translateY(-<?php echo $translateText; ?>px); <?php // @codingStandardsIgnoreLine. ?>
228
+ -moz-transform: translateY(-<?php echo $translateText; ?>px); <?php // @codingStandardsIgnoreLine. ?>
229
+ -ms-transform: translateY(-<?php echo $translateText; ?>px); <?php // @codingStandardsIgnoreLine. ?>
230
+ -o-transform: translateY(-<?php echo $translateText; ?>px); <?php // @codingStandardsIgnoreLine. ?>
231
+ transform: translateY(-<?php echo $translateText; ?>px); <?php // @codingStandardsIgnoreLine. ?>
232
+ }
233
+ <?php endif; ?>
234
+
235
+ <?php if ( ! empty( $settings->text_color ) && 'default' !== $settings->style ) : ?>
236
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a,
237
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a *,
238
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:visited,
239
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:visited * {
240
+ color: <?php echo $settings->text_color; ?>;
241
+ }
242
+ <?php endif; ?>
243
+
244
+ <?php if ( ! empty( $settings->bg_hover_color ) ) : ?>
245
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:hover {
246
+ <?php if ( 'transparent' != $settings->style && 'gradient' != $settings->style && 'default' != $settings->style ) { ?>
247
+ background: <?php echo $settings->bg_hover_color; ?>;
248
+ <?php } ?>
249
+ <?php if ( 'default' !== $settings->style ) { ?>
250
+ border: <?php echo $border_size; ?>px solid <?php echo $border_hover_color; ?>;
251
+ <?php } ?>
252
+ <?php if ( 'gradient' == $settings->style ) : // Gradient. ?>
253
+ background: -moz-linear-gradient(top, <?php echo $bg_hover_grad_start; ?> 0%, <?php echo $settings->bg_hover_color; ?> 100%); /* FF3.6+ */
254
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,<?php echo $bg_hover_grad_start; ?>), color-stop(100%,<?php echo $settings->bg_hover_color; ?>)); /* Chrome,Safari4+ */
255
+ background: -webkit-linear-gradient(top, <?php echo $bg_hover_grad_start; ?> 0%,<?php echo $settings->bg_hover_color; ?> 100%); /* Chrome10+,Safari5.1+ */
256
+ background: -o-linear-gradient(top, <?php echo $bg_hover_grad_start; ?> 0%,<?php echo $settings->bg_hover_color; ?> 100%); /* Opera 11.10+ */
257
+ background: -ms-linear-gradient(top, <?php echo $bg_hover_grad_start; ?> 0%,<?php echo $settings->bg_hover_color; ?> 100%); /* IE10+ */
258
+ background: linear-gradient(to bottom, <?php echo $bg_hover_grad_start; ?> 0%,<?php echo $settings->bg_hover_color; ?> 100%); /* W3C */
259
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<?php echo $bg_hover_grad_start; ?>', endColorstr='<?php echo $settings->bg_hover_color; ?>',GradientType=0 ); /* IE6-9 */
260
+ <?php endif; ?>
261
+ }
262
+ <?php endif; ?>
263
+
264
+ <?php if ( ! empty( $settings->text_hover_color ) && 'default' !== $settings->style ) : ?>
265
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:hover,
266
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:hover * {
267
+ color: <?php echo $settings->text_hover_color; ?>;
268
+ }
269
+ <?php endif; ?>
270
+
271
+ <?php
272
+ // Responsive button Alignment.
273
+ if ( $global_settings->responsive_enabled ) :
274
+ ?>
275
+ @media ( max-width: <?php echo $global_settings->medium_breakpoint . 'px'; ?> ) {
276
+ <?php if ( 'default' === $settings->style ) { ?>
277
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a,
278
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:visited {
279
+ <?php
280
+ if ( isset( $settings->button_padding_dimension_top_medium ) ) {
281
+ echo 'padding-top:' . $settings->button_padding_dimension_top_medium . 'px;';
282
+ }
283
+ if ( isset( $settings->button_padding_dimension_bottom_medium ) ) {
284
+ echo 'padding-bottom:' . $settings->button_padding_dimension_bottom_medium . 'px;';
285
+ }
286
+ if ( isset( $settings->button_padding_dimension_left_medium ) ) {
287
+ echo 'padding-left:' . $settings->button_padding_dimension_left_medium . 'px;';
288
+ }
289
+ if ( isset( $settings->button_padding_dimension_right_medium ) ) {
290
+ echo 'padding-right:' . $settings->button_padding_dimension_right_medium . 'px;';
291
+ }
292
+ ?>
293
+ }
294
+ <?php } ?>
295
+ }
296
+ @media ( max-width: <?php echo $global_settings->responsive_breakpoint; ?>px ) {
297
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap.cartflows-bb__next-step-creative-button-reponsive-<?php echo $settings->mob_align; ?> {
298
+ text-align: <?php echo $settings->mob_align; ?>;
299
+ }
300
+ <?php if ( 'default' === $settings->style ) { ?>
301
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a,
302
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a:visited {
303
+ <?php
304
+ if ( isset( $settings->button_padding_dimension_top_responsive ) ) {
305
+ echo 'padding-top:' . $settings->button_padding_dimension_top_responsive . 'px;';
306
+ }
307
+ if ( isset( $settings->button_padding_dimension_bottom_responsive ) ) {
308
+ echo 'padding-bottom:' . $settings->button_padding_dimension_bottom_responsive . 'px;';
309
+ }
310
+ if ( isset( $settings->button_padding_dimension_left_responsive ) ) {
311
+ echo 'padding-left:' . $settings->button_padding_dimension_left_responsive . 'px;';
312
+ }
313
+ if ( isset( $settings->button_padding_dimension_right_responsive ) ) {
314
+ echo 'padding-right:' . $settings->button_padding_dimension_right_responsive . 'px;';
315
+ }
316
+ ?>
317
+ }
318
+ <?php } ?>
319
+ }
320
+ <?php endif; ?>
321
+
322
+ <?php /* Transparent New Style CSS*/ ?>
323
+ <?php
324
+ if ( ! empty( $settings->style ) && 'transparent' == $settings->style ) {
325
+ ?>
326
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-transparent-btn.cartflows-bb__next-step-none-btn:hover{
327
+ <?php
328
+ if ( 'none' == $settings->transparent_button_options ) {
329
+ if ( 'border' == $settings->hover_attribute ) {
330
+ ?>
331
+ border-color:<?php echo $settings->bg_hover_color; ?>;
332
+ <?php
333
+ } else {
334
+ ?>
335
+ background:<?php echo $settings->bg_hover_color; ?>;
336
+ <?php
337
+ }
338
+ } else {
339
+ ?>
340
+ background:<?php echo $settings->bg_hover_color; ?>;
341
+ <?php
342
+ }
343
+ ?>
344
+ }
345
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-transparent-btn.cartflows-bb__next-step-none-btn:hover .cartflows-bb__next-step-creative-button-icon {
346
+ <?php if ( '' != $settings->text_hover_color && 'FFFFFF' != $settings->text_hover_color && 'none' == $settings->transparent_button_options ) { ?>
347
+ color: <?php echo $settings->text_hover_color; ?>
348
+ <?php } else { ?>
349
+ color: <?php echo $settings->text_color; ?>;
350
+ <?php } ?>
351
+ }
352
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap a.cartflows-bb__next-step-creative-transparent-btn.cartflows-bb__next-step-none-btn:hover .cartflows-bb__next-step-creative-button-text {
353
+ <?php if ( '' != $settings->text_hover_color && 'FFFFFF' != $settings->text_hover_color && 'none' == $settings->transparent_button_options ) { ?>
354
+ color: <?php echo $settings->text_hover_color; ?>
355
+ <?php } else { ?>
356
+ color: <?php echo $settings->text_color; ?>;
357
+ <?php } ?>
358
+ }
359
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-transparent-btn.cartflows-bb__next-step-transparent-fade-btn:hover{
360
+ background: <?php echo $settings->bg_hover_color; ?>;
361
+ }
362
+
363
+ /*transparent-fill-top*/
364
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-transparent-btn.cartflows-bb__next-step-transparent-fill-top-btn:hover:after{
365
+ background: <?php echo $settings->bg_hover_color; ?>;
366
+ height: 100%;
367
+ }
368
+
369
+ /*transparent-fill-bottom*/
370
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-transparent-btn.cartflows-bb__next-step-transparent-fill-bottom-btn:hover:after{
371
+ background: <?php echo $settings->bg_hover_color; ?>;
372
+ height: 100%;
373
+ }
374
+
375
+ /*transparent-fill-left*/
376
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-transparent-btn.cartflows-bb__next-step-transparent-fill-left-btn:hover:after{
377
+ background: <?php echo $settings->bg_hover_color; ?>;
378
+ width: 100%;
379
+ }
380
+ /*transparent-fill-right*/
381
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-transparent-btn.cartflows-bb__next-step-transparent-fill-right-btn:hover:after{
382
+ background: <?php echo $settings->bg_hover_color; ?>;
383
+ width: 100%;
384
+ }
385
+
386
+ /*transparent-fill-center*/
387
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-transparent-btn.cartflows-bb__next-step-transparent-fill-center-btn:hover:after{
388
+ background: <?php echo $settings->bg_hover_color; ?>;
389
+ height: calc( 100% + <?php echo $border_size . 'px'; ?> );
390
+ width: calc( 100% + <?php echo $border_size . 'px'; ?> );
391
+ }
392
+
393
+ /* transparent-fill-diagonal */
394
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-transparent-btn.cartflows-bb__next-step-transparent-fill-diagonal-btn:hover:after{
395
+ background: <?php echo $settings->bg_hover_color; ?>;
396
+ height: 260%;
397
+ }
398
+
399
+ /*transparent-fill-horizontal*/
400
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-transparent-btn.cartflows-bb__next-step-transparent-fill-horizontal-btn:hover:after{
401
+ background: <?php echo $settings->bg_hover_color; ?>;
402
+ height: calc( 100% + <?php echo $border_size . 'px'; ?> );
403
+ width: calc( 100% + <?php echo $border_size . 'px'; ?> );
404
+ }
405
+
406
+
407
+
408
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-transparent-fill-diagonal-btn:hover {
409
+ background: none;
410
+ }
411
+
412
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-transparent-btn.cartflows-bb__next-step-<?php echo $settings->transparent_button_options; ?>-btn:hover .cartflows-bb__next-step-creative-button-text,
413
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-transparent-btn.cartflows-bb__next-step-<?php echo $settings->transparent_button_options; ?>-btn:hover i{
414
+ color: <?php echo $settings->text_hover_color; ?>;
415
+
416
+ position: relative;
417
+ z-index: 9;
418
+ }
419
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-<?php echo $settings->transparent_button_options; ?>-btn:hover .cartflows-bb__next-step-creative-button-icon {
420
+ color: <?php echo $settings->text_hover_color; ?>;
421
+ position: relative;
422
+ z-index: 9;
423
+ }
424
+ <?php
425
+ }
426
+ ?>
427
+
428
+ <?php /* 3D New Style CSS*/ ?>
429
+ <?php
430
+ if ( ! empty( $settings->style ) && 'threed' == $settings->style ) {
431
+ ?>
432
+ <?php /* 3D Move Down*/ ?>
433
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_down-btn {
434
+ <?php
435
+ $hex_shadow_color = Cartflows_BB_Helper::cartflows_bb_parse_color_to_hex( $settings->bg_color );
436
+
437
+ $shadow_color = '#' . FLBuilderColor::adjust_brightness( $hex_shadow_color, 10, 'darken' );
438
+ ?>
439
+ box-shadow: 0 6px <?php echo $shadow_color; ?>;
440
+ }
441
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_down-btn:hover{
442
+ <?php
443
+ $hex_hover_shadow_color = Cartflows_BB_Helper::cartflows_bb_parse_color_to_hex( $settings->bg_hover_color );
444
+
445
+ $shadow_color = '#' . FLBuilderColor::adjust_brightness( $hex_hover_shadow_color, 10, 'darken' );
446
+ ?>
447
+ top: 2px;
448
+ box-shadow: 0 4px <?php echo $shadow_color; ?>;
449
+ }
450
+
451
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_down-btn:active{
452
+ box-shadow:none!important;
453
+ -webkit-transition:all 50ms linear;
454
+ -moz-transition:all 50ms linear;
455
+ transition:all 50ms linear;
456
+ top: 6px;
457
+ }
458
+
459
+
460
+ <?php /* 3D Move Up*/ ?>
461
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_up-btn{
462
+ <?php
463
+
464
+ $hex_shadow_color = Cartflows_BB_Helper::cartflows_bb_parse_color_to_hex( $settings->bg_color );
465
+
466
+ $shadow_color = '#' . FLBuilderColor::adjust_brightness( $hex_shadow_color, 10, 'darken' );
467
+ ?>
468
+ box-shadow: 0 -6px <?php echo $shadow_color; ?>;
469
+ }
470
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_up-btn:hover{
471
+ <?php
472
+ $hex_hover_shadow_color = Cartflows_BB_Helper::cartflows_bb_parse_color_to_hex( $settings->bg_hover_color );
473
+
474
+ $shadow_color = '#' . FLBuilderColor::adjust_brightness( $hex_hover_shadow_color, 10, 'darken' );
475
+ ?>
476
+ top: -2px;
477
+ box-shadow: 0 -4px <?php echo $shadow_color; ?>;
478
+ }
479
+
480
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_up-btn:active{
481
+ box-shadow:none!important;
482
+ -webkit-transition:all 50ms linear;
483
+ -moz-transition:all 50ms linear;
484
+ transition:all 50ms linear;
485
+ top: -6px;
486
+ }
487
+
488
+ <?php /* 3D Move Left*/ ?>
489
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_left-btn{
490
+ <?php
491
+ $hex_shadow_color = Cartflows_BB_Helper::cartflows_bb_parse_color_to_hex( $settings->bg_color );
492
+
493
+ $shadow_color = '#' . FLBuilderColor::adjust_brightness( $hex_shadow_color, 10, 'darken' );
494
+ ?>
495
+ box-shadow: -6px 0 <?php echo $shadow_color; ?>;
496
+ }
497
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_left-btn:hover{
498
+ <?php
499
+ $hex_hover_shadow_color = Cartflows_BB_Helper::cartflows_bb_parse_color_to_hex( $settings->bg_hover_color );
500
+
501
+ $shadow_color = '#' . FLBuilderColor::adjust_brightness( $hex_hover_shadow_color, 10, 'darken' );
502
+ ?>
503
+ left: -2px;
504
+ box-shadow: -4px 0 <?php echo $shadow_color; ?>;
505
+ }
506
+
507
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_left-btn:active {
508
+ box-shadow:none!important;
509
+ -webkit-transition:all 50ms linear;
510
+ -moz-transition:all 50ms linear;
511
+ transition:all 50ms linear;
512
+ left: -6px;
513
+ }
514
+
515
+
516
+ <?php /* 3D Move Right*/ ?>
517
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_right-btn{
518
+ <?php
519
+ $hex_shadow_color = Cartflows_BB_Helper::cartflows_bb_parse_color_to_hex( $settings->bg_color );
520
+
521
+ $shadow_color = '#' . FLBuilderColor::adjust_brightness( $hex_shadow_color, 10, 'darken' );
522
+ ?>
523
+ box-shadow: 6px 0 <?php echo $shadow_color; ?>;
524
+ }
525
+
526
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_right-btn:hover{
527
+ <?php
528
+ $hex_hover_shadow_color = Cartflows_BB_Helper::cartflows_bb_parse_color_to_hex( $settings->bg_hover_color );
529
+
530
+ $shadow_color = '#' . FLBuilderColor::adjust_brightness( $hex_hover_shadow_color, 10, 'darken' );
531
+ ?>
532
+ left: 2px;
533
+ box-shadow: 4px 0 <?php echo $shadow_color; ?>;
534
+ }
535
+
536
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-threed_right-btn:active {
537
+ box-shadow:none!important;
538
+ -webkit-transition:all 50ms linear;
539
+ -moz-transition:all 50ms linear;
540
+ transition:all 50ms linear;
541
+ left: 6px;
542
+ }
543
+
544
+ <?php /* Animate Background Color */ ?>
545
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-<?php echo $settings->threed_button_options; ?>-btn:hover:after{
546
+ <?php
547
+ $hex_bg_color = Cartflows_BB_Helper::cartflows_bb_parse_color_to_hex( $settings->bg_hover_color );
548
+ $background_color = '#' . FLBuilderColor::adjust_brightness( $hex_bg_color, 10, 'darken' );
549
+ ?>
550
+ background: <?php echo $background_color; ?>;
551
+ }
552
+
553
+
554
+ <?php /* Text Color*/ ?>
555
+ .fl-node-<?php echo $id; ?> a.cartflows-bb__next-step-creative-threed-btn.cartflows-bb__next-step-<?php echo $settings->threed_button_options; ?>-btn:hover .cartflows-bb__next-step-creative-button-text{
556
+ color: <?php echo $settings->text_hover_color; ?>;
557
+ }
558
+
559
+ <?php /* 3D Padding for Shadow */ ?>
560
+ .fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap {
561
+ <?php if ( 'threed_down' == $settings->threed_button_options ) : ?>
562
+ padding-bottom: 6px;
563
+ <?php elseif ( 'threed_up' == $settings->threed_button_options ) : ?>
564
+ padding-top: 6px;
565
+ <?php elseif ( 'threed_left' == $settings->threed_button_options ) : ?>
566
+ padding-left: 6px;
567
+ <?php elseif ( 'threed_right' == $settings->threed_button_options ) : ?>
568
+ padding-right: 6px;
569
+ <?php endif; ?>
570
+
571
+ }
572
+ <?php
573
+ }
574
+ ?>
modules/beaver-builder/cartflows-bb-next-step/includes/frontend.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Frontend view
4
+ *
5
+ * @package next-step-button
6
+ */
7
+
8
+ ?>
9
+ <div class="<?php echo $module->get_classname(); ?>">
10
+
11
+ <?php
12
+ if ( isset( $settings->threed_button_options ) && ( 'animate_top' == $settings->threed_button_options || 'animate_bottom' == $settings->threed_button_options || 'animate_left' == $settings->threed_button_options || 'animate_right' == $settings->threed_button_options ) ) {
13
+ ?>
14
+ <p class="perspective">
15
+ <?php
16
+ }
17
+ ?>
18
+
19
+ <a href="?class=wcf-next-step" class="cartflows-bb__next-step-button cartflows-bb__next-step-button cartflows-bb__next-step-creative-button <?php echo 'cartflows-bb__next-step-creative-' . $settings->style . '-btn'; ?> <?php echo $module->get_button_style(); ?>" role="button" >
20
+ <?php
21
+ if ( ! empty( $settings->icon ) && ( 'before' == $settings->icon_position || ! isset( $settings->icon_position ) ) ) :
22
+
23
+ if ( 'flat' == $settings->style && isset( $settings->flat_button_options ) && ( 'animate_to_right' == $settings->flat_button_options || 'animate_to_left' == $settings->flat_button_options || 'animate_from_top' == $settings->flat_button_options || 'animate_from_bottom' == $settings->flat_button_options ) ) {
24
+ $add_class_to_icon = '';
25
+ } else {
26
+ $add_class_to_icon = 'cartflows-bb__next-step-creative-button-icon cartflows-bb__next-step-button-icon-before cartflows-bb__next-step-creative-button-icon-before';
27
+ }
28
+ ?>
29
+
30
+ <i class="<?php echo $add_class_to_icon; ?> fa <?php echo $settings->icon; ?>" aria-hidden="true"></i>
31
+
32
+ <?php endif; ?>
33
+ <?php if ( ! empty( $settings->text ) ) : ?>
34
+ <span class="cartflows-bb__next-step-button-text cartflows-bb__next-step-creative-button-text"><?php echo $settings->text; ?></span>
35
+ <?php endif; ?>
36
+ <?php
37
+ if ( ! empty( $settings->icon ) && 'after' == $settings->icon_position ) :
38
+ if ( 'flat' == $settings->style && isset( $settings->flat_button_options ) && ( 'animate_to_right' == $settings->flat_button_options || 'animate_to_left' == $settings->flat_button_options || 'animate_from_top' == $settings->flat_button_options || 'animate_from_bottom' == $settings->flat_button_options ) ) {
39
+ $add_class_to_icon = '';
40
+ } else {
41
+ $add_class_to_icon = 'cartflows-bb__next-step-button-icon-after cartflows-bb__next-step-creative-button-icon-after';
42
+ }
43
+ ?>
44
+ <i class="cartflows-bb__next-step-button-icon cartflows-bb__next-step-creative-button-icon <?php echo $add_class_to_icon; ?> fa <?php echo $settings->icon; ?>"></i>
45
+ <?php endif; ?>
46
+ </a>
47
+
48
+ <?php
49
+ if ( isset( $settings->threed_button_options ) && ( 'animate_top' == $settings->threed_button_options || 'animate_bottom' == $settings->threed_button_options || 'animate_left' == $settings->threed_button_options || 'animate_right' == $settings->threed_button_options ) ) {
50
+ ?>
51
+ </p>
52
+ <?php
53
+ }
54
+ ?>
55
+ </div>
modules/beaver-builder/cartflows-bb-next-step/js/settings.js ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+ FLBuilder.registerModuleHelper(
3
+ 'cartflows-bb-next-step',
4
+ {
5
+
6
+ init: function()
7
+ {
8
+ var form = $('.fl-builder-settings'),
9
+ btn_style = form.find('select[name=style]'),
10
+ transparent_button_options = form.find('select[name=transparent_button_options]'),
11
+ hover_attribute = form.find('select[name=hover_attribute]'),
12
+ btn_style_opt = form.find('select[name=flat_button_options]');
13
+
14
+
15
+ // Init validation events.
16
+ this._btn_styleChanged();
17
+ this.imgicon_postion();
18
+
19
+ // Validation events.
20
+ btn_style.on('change', $.proxy( this._btn_styleChanged, this ) );
21
+ btn_style_opt.on('change', $.proxy( this._btn_styleChanged, this ) );
22
+ transparent_button_options.on( 'change', $.proxy( this._btn_styleChanged, this ) );
23
+ hover_attribute.on( 'change', $.proxy( this._btn_styleChanged, this ) );
24
+ },
25
+
26
+ _btn_styleChanged: function()
27
+ {
28
+ var form = $('.fl-builder-settings'),
29
+ btn_style = form.find('select[name=style]').val(),
30
+ btn_style_opt = form.find('select[name=flat_button_options]').val(),
31
+ hover_attribute = form.find('select[name=hover_attribute]').val(),
32
+ transparent_button_options = form.find('select[name=transparent_button_options]').val(),
33
+ icon = form.find('input[name=icon]');
34
+
35
+ icon.rules('remove');
36
+
37
+ if(btn_style == 'flat' && btn_style_opt != 'none' ) {
38
+ icon.rules('add', { required: true });
39
+ }
40
+
41
+ if( btn_style == 'threed' ) {
42
+ form.find('#fl-field-threed_button_options').show();
43
+ form.find("#fl-field-hover_attribute").hide();
44
+ form.find('#fl-field-bg_color th label').text('Background Color');
45
+ form.find('#fl-field-bg_hover_color th label').text('Background Hover Color');
46
+ form.find("#fl-field-border_size").hide();
47
+ form.find("#fl-field-transparent_button_options").hide();
48
+ form.find('#fl-field-flat_button_options').hide();
49
+ form.find( "#fl-field-width" ).show();
50
+ } else if( btn_style == 'flat' ) {
51
+ form.find('#fl-field-flat_button_options').show();
52
+ form.find("#fl-field-hover_attribute").hide();
53
+ form.find('#fl-field-bg_color th label').text('Background Color');
54
+ form.find('#fl-field-bg_hover_color th label').text('Background Hover Color');
55
+ form.find('#fl-field-threed_button_options').hide();
56
+ form.find("#fl-field-border_size").hide();
57
+ form.find("#fl-field-transparent_button_options").hide();
58
+ form.find( "#fl-field-width" ).show();
59
+ } else if( btn_style == 'transparent' ) {
60
+ form.find("#fl-field-border_size").show();
61
+ form.find("#fl-field-transparent_button_options").show();
62
+ form.find('#fl-field-threed_button_options').hide();
63
+ form.find('#fl-field-flat_button_options').hide();
64
+ form.find('#fl-field-bg_color th label').text('Border Color');
65
+ form.find( "#fl-field-width" ).show();
66
+ if( transparent_button_options == 'none' ) {
67
+ form.find("#fl-field-hover_attribute").show();
68
+ if( hover_attribute == 'bg' ) {
69
+ form.find('#fl-field-bg_hover_color th label').text('Background Hover Color');
70
+ } else {
71
+ form.find('#fl-field-bg_hover_color th label').text('Border Hover Color');
72
+ }
73
+ } else {
74
+ form.find("#fl-field-hover_attribute").hide();
75
+ form.find('#fl-field-bg_hover_color th label').text('Background Hover Color');
76
+ }
77
+ } else if ( 'default' == btn_style ) {
78
+ form.find( "#fl-field-width" ).hide();
79
+ form.find( "#fl-field-border_radius" ).hide();
80
+ form.find( "#fl-field-border_size" ).hide();
81
+ form.find( "#fl-field-transparent_button_options" ).hide();
82
+ form.find( "#fl-field-threed_button_options" ).hide();
83
+ form.find( "#fl-field-button_gradient" ).hide();
84
+ form.find( "#fl-field-button_gradient" ).hide();
85
+ form.find( "#fl-field-hover_attribute" ).hide();
86
+ form.find('#fl-field-flat_button_options').hide();
87
+ } else {
88
+ form.find("#fl-field-hover_attribute").hide();
89
+ form.find('#fl-field-bg_color th label').text('Background Color');
90
+ form.find('#fl-field-bg_hover_color th label').text('Background Hover Color');
91
+ form.find("#fl-field-border_size").hide();
92
+ form.find("#fl-field-transparent_button_options").hide();
93
+ form.find('#fl-field-threed_button_options').hide();
94
+ form.find('#fl-field-flat_button_options').hide();
95
+ form.find( "#fl-field-width" ).show();
96
+ }
97
+
98
+ this.imgicon_postion();
99
+ },
100
+ imgicon_postion: function () {
101
+ var form = $('.fl-builder-settings'),
102
+ creative_button_styles = form.find('select[name=style]').val(),
103
+ transparent_button_options = form.find().val('select[name=transparent_button_options]'),
104
+ flat_button_options = form.find('select[name=flat_button_options]').val();
105
+
106
+ if ( creative_button_styles == 'flat' && flat_button_options != 'none' ) {
107
+ setTimeout(function(){
108
+ jQuery("#fl-field-icon_position").hide();
109
+ },100);
110
+ }else{
111
+ jQuery("#fl-field-icon_position").show();
112
+ }
113
+ },
114
+
115
+ });
116
+
117
+ })(jQuery);
modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php ADDED
@@ -0,0 +1,430 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2
+ /**
3
+ * Optin Form Module for Beaver Builder
4
+ *
5
+ * @package cartflows
6
+ */
7
+
8
+ /**
9
+ * Optin Form Module for Beaver Builder
10
+ *
11
+ * @since x.x.x
12
+ */
13
+ class Cartflows_BB_Optin_Form extends FLBuilderModule {
14
+
15
+ /**
16
+ * Constructor function for the module. You must pass the
17
+ * name, description, dir and url in an array to the parent class.
18
+ *
19
+ * @method __construct
20
+ */
21
+ public function __construct() {
22
+
23
+ $step_type = Cartflows_BB_Helper::cartflows_bb_step_type();
24
+
25
+ $is_enabled = ( 'optin' === $step_type && wcf()->is_woo_active ) ? true : false;
26
+
27
+ parent::__construct(
28
+ array(
29
+ 'name' => __( 'Optin Form', 'cartflows' ),
30
+ 'description' => __( 'Optin Form.', 'cartflows' ),
31
+ 'category' => __( 'Cartflows Modules', 'cartflows' ),
32
+ 'group' => __( 'Cartflows Modules', 'cartflows' ),
33
+ 'dir' => CARTFLOWS_DIR . 'modules/beaver-builder/cartflows-bb-optin-form/',
34
+ 'url' => CARTFLOWS_URL . 'modules/beaver-builder/cartflows-bb-optin-form/',
35
+ 'partial_refresh' => false, // Defaults to false and can be omitted.
36
+ 'icon' => 'bb-optin-form.svg',
37
+ 'enabled' => $is_enabled,
38
+ )
39
+ );
40
+ }
41
+
42
+ /**
43
+ * Function to get the icon for the module
44
+ *
45
+ * @method get_icons
46
+ * @param string $icon gets the icon for the module.
47
+ */
48
+ public function get_icon( $icon = '' ) {
49
+
50
+ if ( '' !== $icon && file_exists( CARTFLOWS_DIR . 'modules/beaver-builder/cartflows-bb-optin-form/icon/' . $icon ) ) {
51
+
52
+ return fl_builder_filesystem()->file_get_contents( CARTFLOWS_DIR . 'modules/beaver-builder/cartflows-bb-optin-form/icon/' . $icon );
53
+ }
54
+
55
+ return '';
56
+ }
57
+
58
+ /**
59
+ * Dynamic options of module and add filters.
60
+ *
61
+ * @since x.x.x
62
+ */
63
+ public function dynamic_option_filters() {
64
+
65
+ do_action( 'cartflows_bb_optin_options_filters', $this->settings );
66
+
67
+ }
68
+
69
+ /**
70
+ * Function to get skin types.
71
+ *
72
+ * @since x.x.x
73
+ * @access public
74
+ */
75
+ public static function get_skin_types() {
76
+
77
+ $skin_options = array();
78
+
79
+ if ( ! _is_cartflows_pro() ) {
80
+ $skin_options = array(
81
+ 'default' => __( 'Default', 'cartflows' ),
82
+ 'floating-labels' => __( 'Floating Labels ( PRO )', 'cartflows' ),
83
+ );
84
+ } else {
85
+ $skin_options = array(
86
+ 'default' => __( 'Default', 'cartflows' ),
87
+ 'floating-labels' => __( 'Floating Labels', 'cartflows' ),
88
+ );
89
+ }
90
+ return $skin_options;
91
+ }
92
+
93
+ }
94
+
95
+ /**
96
+ * Register the module and its form settings.
97
+ */
98
+ FLBuilder::register_module(
99
+ 'Cartflows_BB_Optin_Form',
100
+ array(
101
+ 'style' => array(
102
+ 'title' => __( 'Style', 'cartflows' ),
103
+ 'sections' => array(
104
+ 'global_style' => array(
105
+ 'title' => __( 'Global', 'cartflows' ),
106
+ 'fields' => array(
107
+ 'global_primary_color' => array(
108
+ 'type' => 'color',
109
+ 'label' => __( 'Primary Color', 'cartflows' ),
110
+ 'default' => '',
111
+ 'show_reset' => true,
112
+ 'connections' => array( 'color' ),
113
+ 'show_alpha' => true,
114
+ ),
115
+ 'global_typography' => array(
116
+ 'type' => 'typography',
117
+ 'label' => __( 'Typography', 'cartflows' ),
118
+ 'responsive' => true,
119
+ 'preview' => array(
120
+ 'type' => 'css',
121
+ 'selector' => '.wcf-optin-form .checkout.woocommerce-checkout label, .wcf-optin-form .checkout.woocommerce-checkout input, .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review .woocommerce-checkout-payment button#place_order',
122
+ ),
123
+ ),
124
+ ),
125
+ ),
126
+ 'input_style' => array(
127
+ 'title' => __( 'Input Fields', 'cartflows' ),
128
+ 'fields' => array(
129
+ 'input_skins' => array(
130
+ 'type' => 'select',
131
+ 'label' => __( 'Style', 'cartflows' ),
132
+ 'default' => 'default',
133
+ 'options' => Cartflows_BB_Optin_Form::get_skin_types(),
134
+ ),
135
+ 'label_color' => array(
136
+ 'type' => 'color',
137
+ 'label' => __( 'Label Color', 'cartflows' ),
138
+ 'default' => '',
139
+ 'show_reset' => true,
140
+ 'connections' => array( 'color' ),
141
+ 'show_alpha' => true,
142
+ 'preview' => array(
143
+ 'type' => 'css',
144
+ 'selector' => '.cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout label',
145
+ 'property' => 'color',
146
+ 'unit' => 'px',
147
+ ),
148
+ ),
149
+ 'input_bgcolor' => array(
150
+ 'type' => 'color',
151
+ 'label' => __( 'Field Background Color', 'cartflows' ),
152
+ 'default' => '',
153
+ 'show_reset' => true,
154
+ 'connections' => array( 'color' ),
155
+ 'show_alpha' => true,
156
+ 'preview' => array(
157
+ 'type' => 'css',
158
+ 'selector' => '.cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout input',
159
+ 'property' => 'background-color',
160
+ 'unit' => 'px',
161
+ ),
162
+ ),
163
+ 'input_color' => array(
164
+ 'type' => 'color',
165
+ 'label' => __( 'Input Text / Placeholder Color', 'cartflows' ),
166
+ 'default' => '',
167
+ 'show_reset' => true,
168
+ 'connections' => array( 'color' ),
169
+ 'show_alpha' => true,
170
+ 'preview' => array(
171
+ 'type' => 'css',
172
+ 'selector' => '.cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout input',
173
+ 'property' => 'color',
174
+ 'unit' => 'px',
175
+ ),
176
+ ),
177
+ 'input_text_typography' => array(
178
+ 'type' => 'typography',
179
+ 'label' => __( 'Typography', 'cartflows' ),
180
+ 'responsive' => true,
181
+ 'preview' => array(
182
+ 'type' => 'css',
183
+ 'selector' => '.cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout label, .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout input',
184
+ ),
185
+ ),
186
+ 'input_border_style' => array(
187
+ 'type' => 'select',
188
+ 'label' => __( 'Border Style', 'cartflows' ),
189
+ 'default' => 'none',
190
+ 'help' => __( 'The type of border to use. Double borders must have a width of at least 3px to render properly.', 'cartflows' ),
191
+ 'options' => array(
192
+ 'none' => __( 'None', 'cartflows' ),
193
+ 'solid' => __( 'Solid', 'cartflows' ),
194
+ 'dashed' => __( 'Dashed', 'cartflows' ),
195
+ 'dotted' => __( 'Dotted', 'cartflows' ),
196
+ 'double' => __( 'Double', 'cartflows' ),
197
+ ),
198
+ 'toggle' => array(
199
+ 'solid' => array(
200
+ 'fields' => array( 'input_border_width', 'input_border_color' ),
201
+ ),
202
+ 'dashed' => array(
203
+ 'fields' => array( 'input_border_width', 'input_border_color' ),
204
+ ),
205
+ 'dotted' => array(
206
+ 'fields' => array( 'input_border_width', 'input_border_color' ),
207
+ ),
208
+ 'double' => array(
209
+ 'fields' => array( 'input_border_width', 'input_border_color' ),
210
+ ),
211
+ ),
212
+ 'preview' => array(
213
+ 'type' => 'css',
214
+ 'selector' => '.cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout input',
215
+ 'property' => 'border-style',
216
+ ),
217
+ ),
218
+ 'input_border_width' => array(
219
+ 'type' => 'unit',
220
+ 'label' => __( 'Border Width', 'cartflows' ),
221
+ 'slider' => true,
222
+ 'units' => array( 'px' ),
223
+ 'maxlength' => '3',
224
+ 'size' => '6',
225
+ 'placeholder' => '1',
226
+ 'preview' => array(
227
+ 'type' => 'css',
228
+ 'selector' => '.cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout input',
229
+ 'property' => 'border-width',
230
+ 'unit' => 'px',
231
+ ),
232
+ ),
233
+ 'input_border_color' => array(
234
+ 'type' => 'color',
235
+ 'label' => __( 'Border Color', 'cartflows' ),
236
+ 'default' => '',
237
+ 'show_reset' => true,
238
+ 'show_alpha' => true,
239
+ 'preview' => array(
240
+ 'type' => 'css',
241
+ 'selector' => '.cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout input',
242
+ 'property' => 'border-color',
243
+ 'unit' => 'px',
244
+ ),
245
+ ),
246
+ 'input_border_radius' => array(
247
+ 'type' => 'unit',
248
+ 'label' => __( 'Border Radius', 'cartflows' ),
249
+ 'slider' => true,
250
+ 'units' => array( 'px' ),
251
+ 'maxlength' => '3',
252
+ 'size' => '6',
253
+ 'placeholder' => '0',
254
+ 'preview' => array(
255
+ 'type' => 'css',
256
+ 'selector' => '.cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout input',
257
+ 'property' => 'border-radius',
258
+ 'unit' => 'px',
259
+ ),
260
+ ),
261
+ ),
262
+ ),
263
+ 'button_style' => array(
264
+ 'title' => __( 'Buttons', 'cartflows' ),
265
+ 'fields' => array(
266
+ 'button_text_color' => array(
267
+ 'type' => 'color',
268
+ 'label' => __( 'Text Color', 'cartflows' ),
269
+ 'default' => '',
270
+ 'show_reset' => true,
271
+ 'show_alpha' => true,
272
+ 'preview' => array(
273
+ 'type' => 'css',
274
+ 'selector' => '.wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review #payment button#place_order,
275
+ .wcf-optin-form .woocommerce #order_review #payment button',
276
+ 'property' => 'color',
277
+ 'unit' => 'px',
278
+ ),
279
+ ),
280
+ 'button_text_hover_color' => array(
281
+ 'type' => 'color',
282
+ 'label' => __( 'Text Hover Color', 'cartflows' ),
283
+ 'default' => '',
284
+ 'show_reset' => true,
285
+ 'show_alpha' => true,
286
+ 'preview' => array(
287
+ 'type' => 'css',
288
+ 'selector' => '.wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review #payment button#place_order:hover,
289
+ .wcf-optin-form .woocommerce #order_review #payment button:hover',
290
+ 'property' => 'color',
291
+ 'unit' => 'px',
292
+ ),
293
+ ),
294
+ 'button_bg_color' => array(
295
+ 'type' => 'color',
296
+ 'label' => __( 'Background Color', 'cartflows' ),
297
+ 'default' => '',
298
+ 'show_reset' => true,
299
+ 'show_alpha' => true,
300
+ 'preview' => array(
301
+ 'type' => 'css',
302
+ 'selector' => '.wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review #payment button#place_order,
303
+ .wcf-optin-form .woocommerce #order_review #payment button',
304
+ 'property' => 'background-color',
305
+ 'unit' => 'px',
306
+ ),
307
+ ),
308
+ 'button_bg_hover_color' => array(
309
+ 'type' => 'color',
310
+ 'label' => __( 'Background Hover Color', 'cartflows' ),
311
+ 'default' => '',
312
+ 'show_reset' => true,
313
+ 'show_alpha' => true,
314
+ 'preview' => array(
315
+ 'type' => 'css',
316
+ 'selector' => '.wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review #payment button#place_order:hover,
317
+ .wcf-optin-form .woocommerce #order_review #payment button:hover',
318
+ 'property' => 'background-color',
319
+ 'unit' => 'px',
320
+ ),
321
+ ),
322
+ 'button_typography' => array(
323
+ 'type' => 'typography',
324
+ 'label' => __( 'Typography', 'cartflows' ),
325
+ 'responsive' => true,
326
+ 'preview' => array(
327
+ 'type' => 'css',
328
+ 'selector' => '.wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review #payment button#place_order,
329
+ .wcf-optin-form .woocommerce #order_review #payment button',
330
+ ),
331
+ ),
332
+ 'button_border_style' => array(
333
+ 'type' => 'select',
334
+ 'label' => __( 'Border Style', 'cartflows' ),
335
+ 'default' => 'none',
336
+ 'help' => __( 'The type of border to use. Double borders must have a width of at least 3px to render properly.', 'cartflows' ),
337
+ 'options' => array(
338
+ 'none' => __( 'None', 'cartflows' ),
339
+ 'solid' => __( 'Solid', 'cartflows' ),
340
+ 'dashed' => __( 'Dashed', 'cartflows' ),
341
+ 'dotted' => __( 'Dotted', 'cartflows' ),
342
+ 'double' => __( 'Double', 'cartflows' ),
343
+ ),
344
+ 'toggle' => array(
345
+ 'solid' => array(
346
+ 'fields' => array( 'button_border_width', 'button_border_color', 'button_border_hover_color' ),
347
+ ),
348
+ 'dashed' => array(
349
+ 'fields' => array( 'button_border_width', 'button_border_color', 'button_border_hover_color' ),
350
+ ),
351
+ 'dotted' => array(
352
+ 'fields' => array( 'button_border_width', 'button_border_color', 'button_border_hover_color' ),
353
+ ),
354
+ 'double' => array(
355
+ 'fields' => array( 'button_border_width', 'button_border_color', 'button_border_hover_color' ),
356
+ ),
357
+ ),
358
+ 'preview' => array(
359
+ 'type' => 'css',
360
+ 'selector' => '.wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review #payment button#place_order,
361
+ .wcf-optin-form .woocommerce #order_review #payment button',
362
+ 'property' => 'border-style',
363
+ ),
364
+ ),
365
+ 'button_border_width' => array(
366
+ 'type' => 'unit',
367
+ 'label' => __( 'Border Width', 'cartflows' ),
368
+ 'slider' => true,
369
+ 'units' => array( 'px' ),
370
+ 'maxlength' => '3',
371
+ 'size' => '6',
372
+ 'placeholder' => '1',
373
+ 'preview' => array(
374
+ 'type' => 'css',
375
+ 'selector' => '.wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review #payment button#place_order,
376
+ .wcf-optin-form .woocommerce #order_review #payment button',
377
+ 'property' => 'border-width',
378
+ 'unit' => 'px',
379
+ ),
380
+ ),
381
+ 'button_border_color' => array(
382
+ 'type' => 'color',
383
+ 'label' => __( 'Border Color', 'cartflows' ),
384
+ 'default' => '',
385
+ 'show_reset' => true,
386
+ 'show_alpha' => true,
387
+ 'preview' => array(
388
+ 'type' => 'css',
389
+ 'selector' => '.wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review #payment button#place_order,
390
+ .wcf-optin-form .woocommerce #order_review #payment button',
391
+ 'property' => 'border-color',
392
+ 'unit' => 'px',
393
+ ),
394
+ ),
395
+ 'button_border_hover_color' => array(
396
+ 'type' => 'color',
397
+ 'label' => __( 'Border Hover Color', 'cartflows' ),
398
+ 'default' => '',
399
+ 'show_reset' => true,
400
+ 'show_alpha' => true,
401
+ 'preview' => array(
402
+ 'type' => 'css',
403
+ 'selector' => '.wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review #payment button#place_order:hover,
404
+ .wcf-optin-form .woocommerce #order_review #payment button:hover',
405
+ 'property' => 'border-color',
406
+ 'unit' => 'px',
407
+ ),
408
+ ),
409
+ 'button_border_radius' => array(
410
+ 'type' => 'unit',
411
+ 'label' => __( 'Border Radius', 'cartflows' ),
412
+ 'slider' => true,
413
+ 'units' => array( 'px' ),
414
+ 'maxlength' => '3',
415
+ 'size' => '6',
416
+ 'placeholder' => '0',
417
+ 'preview' => array(
418
+ 'type' => 'css',
419
+ 'selector' => '.wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review #payment button#place_order,
420
+ .wcf-optin-form .woocommerce #order_review #payment button',
421
+ 'property' => 'border-radius',
422
+ 'unit' => 'px',
423
+ ),
424
+ ),
425
+ ),
426
+ ),
427
+ ),
428
+ ),
429
+ )
430
+ );
modules/beaver-builder/cartflows-bb-optin-form/icon/bb-optin-form.svg ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20pt" height="20pt" viewBox="0 0 20 20" version="1.1">
3
+ <g id="surface1">
4
+ <path style=" stroke:none;fill-rule:evenodd;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 17.890625 20 L 2.109375 20 C 2.035156 19.988281 1.957031 19.96875 1.902344 19.914062 C 1.847656 19.859375 1.828125 19.785156 1.816406 19.707031 L 1.816406 0.292969 C 1.832031 0.164062 1.910156 0.0429688 2.035156 0.0117188 C 2.058594 0.00390625 2.085938 0.00390625 2.109375 0 L 17.890625 0 C 17.914062 0.00390625 17.941406 0.0078125 17.964844 0.0117188 C 18.0625 0.0507812 18.148438 0.121094 18.171875 0.21875 C 18.179688 0.242188 18.179688 0.269531 18.183594 0.292969 L 18.183594 19.707031 C 18.167969 19.835938 18.089844 19.957031 17.964844 19.988281 C 17.941406 19.996094 17.914062 19.996094 17.890625 20 Z M 2.40625 0.589844 L 2.40625 19.410156 L 17.59375 19.410156 L 17.59375 0.589844 Z M 16.179688 17.722656 L 15.074219 16.617188 L 15.617188 16.078125 C 15.664062 16.03125 15.683594 15.964844 15.667969 15.898438 C 15.652344 15.832031 15.605469 15.78125 15.539062 15.761719 L 12.292969 14.679688 C 12.222656 14.65625 12.148438 14.671875 12.097656 14.726562 C 12.046875 14.777344 12.027344 14.851562 12.050781 14.921875 L 13.132812 18.167969 C 13.15625 18.230469 13.207031 18.277344 13.269531 18.292969 C 13.335938 18.308594 13.402344 18.289062 13.449219 18.242188 L 13.992188 17.703125 L 15.09375 18.804688 C 15.132812 18.84375 15.183594 18.859375 15.230469 18.859375 C 15.28125 18.859375 15.328125 18.84375 15.367188 18.804688 L 16.179688 17.992188 C 16.253906 17.917969 16.253906 17.796875 16.179688 17.722656 Z M 15.230469 18.398438 L 14.128906 17.296875 C 14.050781 17.222656 13.929688 17.222656 13.855469 17.296875 L 13.398438 17.753906 L 12.535156 15.164062 L 15.125 16.027344 L 14.667969 16.484375 C 14.59375 16.558594 14.59375 16.679688 14.667969 16.753906 L 15.773438 17.859375 Z M 14.992188 12.300781 C 15.222656 12.304688 15.429688 12.5 15.433594 12.742188 C 15.4375 13.152344 15.4375 13.5625 15.433594 13.972656 C 15.429688 14.203125 15.230469 14.410156 14.992188 14.414062 C 13.234375 14.425781 11.476562 14.425781 9.71875 14.414062 C 9.492188 14.410156 9.285156 14.214844 9.277344 13.972656 C 9.277344 13.5625 9.277344 13.152344 9.277344 12.742188 C 9.28125 12.511719 9.480469 12.304688 9.71875 12.300781 C 11.476562 12.289062 13.234375 12.289062 14.992188 12.300781 Z M 14.84375 12.890625 L 9.867188 12.890625 L 9.867188 13.828125 L 14.84375 13.828125 Z M 7.609375 12.777344 L 3.878906 12.777344 C 3.6875 12.773438 3.515625 12.609375 3.511719 12.410156 L 3.511719 8.933594 C 3.515625 8.742188 3.679688 8.570312 3.878906 8.566406 C 5.125 8.566406 6.371094 8.550781 7.613281 8.566406 C 7.804688 8.574219 7.96875 8.734375 7.972656 8.933594 L 7.972656 12.410156 C 7.96875 12.601562 7.808594 12.773438 7.609375 12.777344 Z M 7.382812 9.15625 L 4.101562 9.15625 L 4.101562 12.1875 L 7.382812 12.1875 Z M 16.207031 11.082031 L 9.761719 11.082031 C 9.730469 11.082031 9.722656 11.082031 9.695312 11.078125 C 9.445312 11.039062 9.269531 10.726562 9.394531 10.484375 C 9.460938 10.351562 9.605469 10.265625 9.761719 10.257812 L 16.207031 10.257812 C 16.21875 10.257812 16.226562 10.261719 16.238281 10.261719 C 16.265625 10.265625 16.273438 10.265625 16.300781 10.269531 C 16.582031 10.335938 16.71875 10.742188 16.496094 10.964844 C 16.421875 11.039062 16.316406 11.078125 16.207031 11.082031 Z M 16.207031 9.386719 L 9.761719 9.386719 C 9.480469 9.375 9.257812 9.054688 9.394531 8.789062 C 9.453125 8.671875 9.566406 8.589844 9.695312 8.566406 C 9.722656 8.5625 9.730469 8.5625 9.761719 8.5625 L 16.207031 8.5625 C 16.21875 8.5625 16.226562 8.5625 16.238281 8.5625 C 16.265625 8.566406 16.273438 8.566406 16.300781 8.574219 C 16.582031 8.640625 16.71875 9.046875 16.496094 9.265625 C 16.421875 9.34375 16.316406 9.382812 16.207031 9.386719 Z M 16.207031 7.691406 L 3.808594 7.691406 C 3.640625 7.671875 3.480469 7.582031 3.421875 7.425781 C 3.339844 7.207031 3.480469 6.933594 3.710938 6.878906 C 3.742188 6.871094 3.773438 6.871094 3.808594 6.867188 L 16.207031 6.867188 C 16.238281 6.871094 16.273438 6.875 16.304688 6.878906 C 16.492188 6.949219 16.640625 7.121094 16.617188 7.328125 C 16.601562 7.460938 16.515625 7.582031 16.398438 7.644531 C 16.320312 7.683594 16.292969 7.679688 16.207031 7.691406 Z M 16.207031 6.066406 L 3.808594 6.066406 C 3.671875 6.046875 3.542969 5.996094 3.46875 5.886719 C 3.355469 5.722656 3.382812 5.476562 3.535156 5.34375 C 3.609375 5.277344 3.707031 5.253906 3.808594 5.242188 L 16.207031 5.242188 C 16.238281 5.246094 16.273438 5.25 16.304688 5.253906 C 16.460938 5.3125 16.59375 5.433594 16.617188 5.601562 C 16.636719 5.769531 16.542969 5.941406 16.398438 6.019531 C 16.320312 6.058594 16.292969 6.054688 16.207031 6.066406 Z M 16.207031 4.296875 L 3.808594 4.296875 C 3.609375 4.273438 3.421875 4.144531 3.398438 3.933594 C 3.375 3.734375 3.515625 3.53125 3.710938 3.484375 C 3.742188 3.476562 3.773438 3.476562 3.808594 3.472656 L 16.207031 3.472656 C 16.238281 3.476562 16.273438 3.480469 16.304688 3.484375 C 16.398438 3.519531 16.488281 3.570312 16.546875 3.652344 C 16.679688 3.84375 16.613281 4.136719 16.398438 4.25 C 16.320312 4.292969 16.292969 4.289062 16.207031 4.296875 Z M 10.199219 2.601562 L 3.808594 2.601562 C 3.777344 2.601562 3.773438 2.601562 3.742188 2.597656 C 3.492188 2.554688 3.316406 2.242188 3.441406 2 C 3.507812 1.867188 3.652344 1.78125 3.808594 1.777344 L 10.199219 1.777344 C 10.210938 1.777344 10.222656 1.777344 10.234375 1.777344 C 10.429688 1.800781 10.597656 1.960938 10.613281 2.15625 C 10.628906 2.359375 10.472656 2.5625 10.265625 2.597656 C 10.238281 2.601562 10.230469 2.601562 10.199219 2.601562 Z M 10.199219 2.601562 "/>
5
+ </g>
6
+ </svg>
modules/beaver-builder/cartflows-bb-optin-form/includes/frontend.css.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BB Order Details Form Module front-end CSS php file.
4
+ *
5
+ * @package cartflows
6
+ */
7
+
8
+ global $post;
9
+
10
+ ?>
11
+
12
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review .woocommerce-checkout-payment button#place_order,
13
+ .fl-node-<?php echo $id; ?> .wcf-optin-form .woocommerce #order_review button {
14
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->global_primary_color ); ?>;
15
+ border-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->global_primary_color ); ?>;
16
+ }
17
+
18
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review .woocommerce-checkout-payment button#place_order:hover,
19
+ .fl-node-<?php echo $id; ?> .wcf-optin-form .woocommerce #order_review button:hover {
20
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->global_primary_color ); ?>;
21
+ border-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->global_primary_color ); ?>;
22
+ }
23
+
24
+ <?php
25
+ if ( class_exists( 'FLBuilderCSS' ) ) {
26
+ FLBuilderCSS::typography_field_rule(
27
+ array(
28
+ 'settings' => $settings,
29
+ 'setting_name' => 'global_typography',
30
+ 'selector' => ".fl-node-$id .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout label,
31
+ .fl-node-$id .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout input,
32
+ .fl-node-$id .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review .woocommerce-checkout-payment button#place_order",
33
+ )
34
+ );
35
+ }
36
+ ?>
37
+
38
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout label {
39
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->label_color ); ?>;
40
+ }
41
+
42
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout input {
43
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->input_bgcolor ); ?>;
44
+ }
45
+
46
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout input {
47
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->input_color ); ?> !important;
48
+ }
49
+
50
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout input {
51
+ border-radius: <?php echo ( '' != $settings->input_border_radius ) ? $settings->input_border_radius : '0'; ?>px;
52
+ }
53
+
54
+ <?php if ( 'none' != $settings->input_border_style ) { ?>
55
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout input {
56
+ border-style: <?php echo ( '' != $settings->input_border_style ) ? $settings->input_border_style : 'solid'; ?>;
57
+ border-width: <?php echo ( '' != $settings->input_border_width ) ? $settings->input_border_width : '0'; ?>px;
58
+ border-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->input_border_color ); ?>;
59
+ }
60
+
61
+ <?php } ?>
62
+
63
+ <?php
64
+ if ( class_exists( 'FLBuilderCSS' ) ) {
65
+ FLBuilderCSS::typography_field_rule(
66
+ array(
67
+ 'settings' => $settings,
68
+ 'setting_name' => 'input_text_typography',
69
+ 'selector' => ".fl-node-$id .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout label,
70
+ .fl-node-$id .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout input",
71
+ )
72
+ );
73
+ }
74
+ ?>
75
+
76
+ <?php
77
+ if ( class_exists( 'FLBuilderCSS' ) ) {
78
+ FLBuilderCSS::typography_field_rule(
79
+ array(
80
+ 'settings' => $settings,
81
+ 'setting_name' => 'button_typography',
82
+ 'selector' => ".fl-node-$id .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review #payment button#place_order,
83
+ .fl-node-$id .wcf-optin-form .woocommerce #order_review #payment button",
84
+ )
85
+ );
86
+ }
87
+ ?>
88
+
89
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review .woocommerce-checkout-payment button#place_order,
90
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .woocommerce #order_review button {
91
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->button_text_color ); ?>;
92
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->button_bg_color ); ?>;
93
+ }
94
+
95
+ <?php // Button text hover color. ?>
96
+
97
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review .woocommerce-checkout-payment button#place_order:hover,
98
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .woocommerce #order_review button:hover {
99
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->button_text_hover_color ); ?> !important;
100
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->button_bg_hover_color ); ?> !important;
101
+ border-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->button_border_hover_color ); ?> !important;
102
+ }
103
+
104
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review .woocommerce-checkout-payment button#place_order,
105
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .woocommerce #order_review button {
106
+ border-radius: <?php echo ( '' != $settings->button_border_radius ) ? $settings->button_border_radius : '0'; ?>px;
107
+ }
108
+
109
+ <?php if ( 'none' != $settings->button_border_style ) { ?>
110
+
111
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review .woocommerce-checkout-payment button#place_order,
112
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .woocommerce #order_review button {
113
+ border-style: <?php echo ( '' != $settings->button_border_style ) ? $settings->button_border_style : 'solid'; ?>;
114
+ border-width: <?php echo ( '' != $settings->button_border_width ) ? $settings->button_border_width : '0'; ?>px;
115
+ border-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->button_border_color ); ?>;
116
+ }
117
+
118
+ <?php } else { ?>
119
+
120
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review .woocommerce-checkout-payment button#place_order,
121
+ .fl-node-<?php echo $id; ?> .cartflows-bb__optin-form .wcf-optin-form .woocommerce #order_review button {
122
+ border-width: 0px !important;
123
+ }
124
+
125
+ <?php } ?>
modules/beaver-builder/cartflows-bb-optin-form/includes/frontend.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Frontend view
4
+ *
5
+ * @package cartflows
6
+ */
7
+
8
+ /* Add module setting options to filters */
9
+ $module->dynamic_option_filters();
10
+
11
+ $optin_id = get_the_id();
12
+
13
+ do_action( 'cartflows_bb_before_optin_shortcode', $optin_id );
14
+
15
+ ?>
16
+ <div class = "cartflows-bb__optin-form">
17
+ <?php echo do_shortcode( '[cartflows_optin]' ); ?>
18
+ </div>
modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php ADDED
@@ -0,0 +1,489 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2
+ /**
3
+ * Order details Form Module for Beaver Builder
4
+ *
5
+ * @package cartflows
6
+ */
7
+
8
+ /**
9
+ * Order details Form Module for Beaver Builder
10
+ *
11
+ * @since x.x.x
12
+ */
13
+ class Cartflows_BB_Order_Details_Form extends FLBuilderModule {
14
+ /**
15
+ * Constructor function for the module. You must pass the
16
+ * name, description, dir and url in an array to the parent class.
17
+ *
18
+ * @method __construct
19
+ */
20
+ public function __construct() {
21
+
22
+ $step_type = Cartflows_BB_Helper::cartflows_bb_step_type();
23
+
24
+ $is_enabled = ( 'thankyou' === $step_type && wcf()->is_woo_active ) ? true : false;
25
+
26
+ parent::__construct(
27
+ array(
28
+ 'name' => __( 'Order Details Form', 'cartflows' ),
29
+ 'description' => __( 'Order Details Form.', 'cartflows' ),
30
+ 'category' => __( 'Cartflows Modules', 'cartflows' ),
31
+ 'group' => __( 'Cartflows Modules', 'cartflows' ),
32
+ 'dir' => CARTFLOWS_DIR . 'modules/beaver-builder/cartflows-bb-order-details/',
33
+ 'url' => CARTFLOWS_URL . 'modules/beaver-builder/cartflows-bb-order-details/',
34
+ 'partial_refresh' => false, // Defaults to false and can be omitted.
35
+ 'icon' => 'bb-order-details.svg',
36
+ 'enabled' => $is_enabled,
37
+ )
38
+ );
39
+ }
40
+
41
+ /**
42
+ * Function to get the icon for the module
43
+ *
44
+ * @method get_icons
45
+ * @param string $icon gets the icon for the module.
46
+ */
47
+ public function get_icon( $icon = '' ) {
48
+
49
+ if ( '' !== $icon && file_exists( CARTFLOWS_DIR . 'modules/beaver-builder/cartflows-bb-order-details/icon/' . $icon ) ) {
50
+
51
+ return fl_builder_filesystem()->file_get_contents( CARTFLOWS_DIR . 'modules/beaver-builder/cartflows-bb-order-details/icon/' . $icon );
52
+ }
53
+
54
+ return '';
55
+ }
56
+
57
+ /**
58
+ * Dynamic options of module and add filters.
59
+ *
60
+ * @since x.x.x
61
+ */
62
+ public function dynamic_option_filters() {
63
+
64
+ if ( ! empty( $this->settings->thankyou_text ) ) {
65
+
66
+ add_filter(
67
+ 'cartflows_thankyou_meta_wcf-tq-text',
68
+ function( $text ) {
69
+
70
+ $text = $this->settings->thankyou_text;
71
+
72
+ return $text;
73
+ },
74
+ 10,
75
+ 1
76
+ );
77
+ }
78
+
79
+ }
80
+
81
+ }
82
+
83
+ /**
84
+ * Register the module and its form settings.
85
+ */
86
+ FLBuilder::register_module(
87
+ 'Cartflows_BB_Order_Details_Form',
88
+ array(
89
+ 'general' => array(
90
+ 'title' => __( 'General', 'cartflows' ),
91
+ 'sections' => array(
92
+ 'general' => array(
93
+ 'title' => '',
94
+ 'fields' => array(
95
+ 'thankyou_text' => array(
96
+ 'type' => 'text',
97
+ 'label' => __( 'Thank You Text', 'cartflows' ),
98
+ 'placeholder' => __( 'Thank you. Your order has been received.', 'cartflows' ),
99
+ 'preview' => array(
100
+ 'type' => 'text',
101
+ 'selector' => '.wcf-thankyou-wrap .woocommerce-order .woocommerce-thankyou-order-received',
102
+ ),
103
+ 'connections' => array( 'string' ),
104
+ ),
105
+ 'show_order_overview' => array(
106
+ 'type' => 'select',
107
+ 'label' => __( 'Order Overview', 'cartflows' ),
108
+ 'default' => 'yes',
109
+ 'options' => array(
110
+ 'yes' => __( 'Yes', 'cartflows' ),
111
+ 'no' => __( 'No', 'cartflows' ),
112
+ ),
113
+ ),
114
+ 'show_order_details' => array(
115
+ 'type' => 'select',
116
+ 'label' => __( 'Order Details', 'cartflows' ),
117
+ 'default' => 'yes',
118
+ 'options' => array(
119
+ 'yes' => __( 'Yes', 'cartflows' ),
120
+ 'no' => __( 'No', 'cartflows' ),
121
+ ),
122
+ ),
123
+ 'show_billing_address' => array(
124
+ 'type' => 'select',
125
+ 'label' => __( 'Billing Address', 'cartflows' ),
126
+ 'default' => 'yes',
127
+ 'options' => array(
128
+ 'yes' => __( 'Yes', 'cartflows' ),
129
+ 'no' => __( 'No', 'cartflows' ),
130
+ ),
131
+ ),
132
+ 'show_shipping_address' => array(
133
+ 'type' => 'select',
134
+ 'label' => __( 'Shipping Address', 'cartflows' ),
135
+ 'default' => 'yes',
136
+ 'options' => array(
137
+ 'yes' => __( 'Yes', 'cartflows' ),
138
+ 'no' => __( 'No', 'cartflows' ),
139
+ ),
140
+ ),
141
+ ),
142
+ ),
143
+ ),
144
+ ),
145
+ 'style' => array(
146
+ 'title' => __( 'Style', 'cartflows' ),
147
+ 'sections' => array(
148
+ 'spacing' => array(
149
+ 'title' => __( 'Spacing', 'cartflows' ),
150
+ 'fields' => array(
151
+ 'heading_spacing' => array(
152
+ 'type' => 'unit',
153
+ 'label' => __( 'Heading Bottom Spacing', 'cartflows' ),
154
+ 'slider' => true,
155
+ 'units' => array( 'px' ),
156
+ 'maxlength' => '50',
157
+ 'size' => '',
158
+ 'placeholder' => '',
159
+ 'preview' => array(
160
+ 'type' => 'css',
161
+ 'selector' => '.wcf-thankyou-wrap .woocommerce-order .woocommerce-thankyou-order-received',
162
+ 'property' => 'margin-bottom',
163
+ 'unit' => 'px',
164
+ ),
165
+ ),
166
+ 'sections_spacing' => array(
167
+ 'type' => 'unit',
168
+ 'label' => __( 'Spacing Between Sections', 'cartflows' ),
169
+ 'slider' => true,
170
+ 'units' => array( 'px' ),
171
+ 'maxlength' => '50',
172
+ 'size' => '',
173
+ 'placeholder' => '',
174
+ 'preview' => array(
175
+ 'type' => 'css',
176
+ 'selector' => '.woocommerce-order ul.order_details,
177
+ .woocommerce-order .woocommerce-customer-details,
178
+ .woocommerce-order .woocommerce-order-details,
179
+ .woocommerce-order .woocommerce-order-downloads,
180
+ .woocommerce-order .woocommerce-bacs-bank-details,
181
+ .woocommerce-order-details.mollie-instructions',
182
+ 'property' => 'margin-bottom',
183
+ 'unit' => 'px',
184
+ ),
185
+ ),
186
+ ),
187
+ ),
188
+ 'heading' => array(
189
+ 'title' => __( 'Heading', 'cartflows' ),
190
+ 'fields' => array(
191
+ 'heading_color' => array(
192
+ 'type' => 'color',
193
+ 'label' => __( 'Text Color', 'cartflows' ),
194
+ 'default' => '',
195
+ 'show_reset' => true,
196
+ 'connections' => array( 'color' ),
197
+ 'show_alpha' => true,
198
+ 'preview' => array(
199
+ 'type' => 'css',
200
+ 'selector' => '.woocommerce-thankyou-order-received',
201
+ 'property' => 'color',
202
+ 'unit' => 'px',
203
+ ),
204
+ ),
205
+ 'heading_typography' => array(
206
+ 'type' => 'typography',
207
+ 'label' => __( 'Typography', 'cartflows' ),
208
+ 'responsive' => true,
209
+ 'preview' => array(
210
+ 'type' => 'css',
211
+ 'selector' => '.woocommerce-thankyou-order-received',
212
+ ),
213
+ ),
214
+ ),
215
+ ),
216
+ 'sections_heading' => array(
217
+ 'title' => __( 'Sections Heading', 'cartflows' ),
218
+ 'fields' => array(
219
+ 'sections_heading_color' => array(
220
+ 'type' => 'color',
221
+ 'label' => __( 'Text Color', 'cartflows' ),
222
+ 'default' => '',
223
+ 'show_reset' => true,
224
+ 'connections' => array( 'color' ),
225
+ 'show_alpha' => true,
226
+ 'preview' => array(
227
+ 'type' => 'css',
228
+ 'selector' => '.wcf-thankyou-wrap .woocommerce-order h2',
229
+ 'property' => 'color',
230
+ 'unit' => 'px',
231
+ ),
232
+ ),
233
+ 'sections_heading_typo' => array(
234
+ 'type' => 'typography',
235
+ 'label' => __( 'Typography', 'cartflows' ),
236
+ 'responsive' => true,
237
+ 'preview' => array(
238
+ 'type' => 'css',
239
+ 'selector' => '.wcf-thankyou-wrap .woocommerce-order h2',
240
+ ),
241
+ ),
242
+ ),
243
+ ),
244
+ 'sections_content' => array(
245
+ 'title' => __( 'Sections Content', 'cartflows' ),
246
+ 'fields' => array(
247
+ 'sections_content_color' => array(
248
+ 'type' => 'color',
249
+ 'label' => __( 'Text Color', 'cartflows' ),
250
+ 'default' => '',
251
+ 'show_reset' => true,
252
+ 'connections' => array( 'color' ),
253
+ 'show_alpha' => true,
254
+ 'preview' => array(
255
+ 'type' => 'css',
256
+ 'selector' => '.woocommerce-thankyou-order-details.order_details li, .woocommerce-order-details .woocommerce-table, .woocommerce-order .woocommerce-customer-details address, .woocommerce-order-downloads table.shop_table',
257
+ 'property' => 'color',
258
+ 'unit' => 'px',
259
+ ),
260
+ ),
261
+ 'sections_bg_color' => array(
262
+ 'type' => 'color',
263
+ 'label' => __( 'Background Color', 'cartflows' ),
264
+ 'default' => '',
265
+ 'show_reset' => true,
266
+ 'connections' => array( 'color' ),
267
+ 'show_alpha' => true,
268
+ 'preview' => array(
269
+ 'type' => 'css',
270
+ 'selector' => '.woocommerce-order-overview.woocommerce-thankyou-order-details.order_details,
271
+ .woocommerce-order-details,
272
+ .woocommerce-customer-details,
273
+ .woocommerce-order-downloads',
274
+ 'property' => 'background-color',
275
+ 'unit' => 'px',
276
+ ),
277
+ ),
278
+ 'sections_content_typo' => array(
279
+ 'type' => 'typography',
280
+ 'label' => __( 'Typography', 'cartflows' ),
281
+ 'responsive' => true,
282
+ 'preview' => array(
283
+ 'type' => 'css',
284
+ 'selector' => '.woocommerce-thankyou-order-details.order_details li, .woocommerce-order-details .woocommerce-table, .woocommerce-order .woocommerce-customer-details address, .woocommerce-order-downloads table.shop_table',
285
+ ),
286
+ ),
287
+ ),
288
+ ),
289
+ 'section_downloads' => array(
290
+ 'title' => __( 'Downloads', 'cartflows' ),
291
+ 'fields' => array(
292
+ 'downloads_heading_color' => array(
293
+ 'type' => 'color',
294
+ 'label' => __( 'Heading Color', 'cartflows' ),
295
+ 'default' => '',
296
+ 'show_reset' => true,
297
+ 'connections' => array( 'color' ),
298
+ 'show_alpha' => true,
299
+ 'preview' => array(
300
+ 'type' => 'css',
301
+ 'selector' => 'h2.woocommerce-order-downloads__title, .wcf-thankyou-wrap .woocommerce-order h2.woocommerce-order-downloads__title',
302
+ 'property' => 'color',
303
+ 'unit' => 'px',
304
+ ),
305
+ ),
306
+ 'downloads_heading_typography' => array(
307
+ 'type' => 'typography',
308
+ 'label' => __( 'Heading Typography', 'cartflows' ),
309
+ 'responsive' => true,
310
+ 'preview' => array(
311
+ 'type' => 'css',
312
+ 'selector' => 'h2.woocommerce-order-downloads__title',
313
+ ),
314
+ ),
315
+ 'downloads_text_color' => array(
316
+ 'type' => 'color',
317
+ 'label' => __( 'Text Color', 'cartflows' ),
318
+ 'default' => '',
319
+ 'show_reset' => true,
320
+ 'connections' => array( 'color' ),
321
+ 'show_alpha' => true,
322
+ 'preview' => array(
323
+ 'type' => 'css',
324
+ 'selector' => '.woocommerce-order-downloads table.shop_table',
325
+ 'property' => 'color',
326
+ 'unit' => 'px',
327
+ ),
328
+ ),
329
+ 'downloads_background_color' => array(
330
+ 'type' => 'color',
331
+ 'label' => __( 'Background Color', 'cartflows' ),
332
+ 'default' => '',
333
+ 'show_reset' => true,
334
+ 'connections' => array( 'color' ),
335
+ 'show_alpha' => true,
336
+ 'preview' => array(
337
+ 'type' => 'css',
338
+ 'selector' => '.woocommerce-order-downloads',
339
+ 'property' => 'background-color',
340
+ 'unit' => 'px',
341
+ ),
342
+ ),
343
+ 'downloads_text_typography' => array(
344
+ 'type' => 'typography',
345
+ 'label' => __( 'Text Typography', 'cartflows' ),
346
+ 'responsive' => true,
347
+ 'preview' => array(
348
+ 'type' => 'css',
349
+ 'selector' => '.woocommerce-order-downloads table.shop_table',
350
+ ),
351
+ ),
352
+ ),
353
+ ),
354
+ 'section_order_details' => array(
355
+ 'title' => __( 'Order Details', 'cartflows' ),
356
+ 'fields' => array(
357
+ 'order_details_heading_color' => array(
358
+ 'type' => 'color',
359
+ 'label' => __( 'Heading Color', 'cartflows' ),
360
+ 'default' => '',
361
+ 'show_reset' => true,
362
+ 'connections' => array( 'color' ),
363
+ 'show_alpha' => true,
364
+ 'preview' => array(
365
+ 'type' => 'css',
366
+ 'selector' => '.wcf-thankyou-wrap .woocommerce-order h2.woocommerce-order-details__title,
367
+ .woocommerce-order-details .woocommerce-order-details__title',
368
+ 'property' => 'color',
369
+ 'unit' => 'px',
370
+ ),
371
+ ),
372
+ 'order_details_heading_typography' => array(
373
+ 'type' => 'typography',
374
+ 'label' => __( 'Heading Typography', 'cartflows' ),
375
+ 'responsive' => true,
376
+ 'preview' => array(
377
+ 'type' => 'css',
378
+ 'selector' => '.woocommerce-order-details .woocommerce-order-details__title',
379
+ ),
380
+ ),
381
+ 'order_details_text_color' => array(
382
+ 'type' => 'color',
383
+ 'label' => __( 'Text Color', 'cartflows' ),
384
+ 'default' => '',
385
+ 'show_reset' => true,
386
+ 'connections' => array( 'color' ),
387
+ 'show_alpha' => true,
388
+ 'preview' => array(
389
+ 'type' => 'css',
390
+ 'selector' => '.woocommerce-order .woocommerce-order-details .woocommerce-table',
391
+ 'property' => 'color',
392
+ 'unit' => 'px',
393
+ ),
394
+ ),
395
+ 'order_details_background_color' => array(
396
+ 'type' => 'color',
397
+ 'label' => __( 'Background Color', 'cartflows' ),
398
+ 'default' => '',
399
+ 'show_reset' => true,
400
+ 'connections' => array( 'color' ),
401
+ 'show_alpha' => true,
402
+ 'preview' => array(
403
+ 'type' => 'css',
404
+ 'selector' => '.woocommerce-order .woocommerce-order-details',
405
+ 'property' => 'background-color',
406
+ 'unit' => 'px',
407
+ ),
408
+ ),
409
+ 'order_details_text_typography' => array(
410
+ 'type' => 'typography',
411
+ 'label' => __( 'Text Typography', 'cartflows' ),
412
+ 'responsive' => true,
413
+ 'preview' => array(
414
+ 'type' => 'css',
415
+ 'selector' => '.woocommerce-order .woocommerce-order-details .woocommerce-table',
416
+ ),
417
+ ),
418
+ ),
419
+ ),
420
+ 'section_customer_details' => array(
421
+ 'title' => __( 'Customer Details', 'cartflows' ),
422
+ 'fields' => array(
423
+ 'customer_details_heading_color' => array(
424
+ 'type' => 'color',
425
+ 'label' => __( 'Heading Color', 'cartflows' ),
426
+ 'default' => '',
427
+ 'show_reset' => true,
428
+ 'connections' => array( 'color' ),
429
+ 'show_alpha' => true,
430
+ 'preview' => array(
431
+ 'type' => 'css',
432
+ 'selector' => '.wcf-thankyou-wrap .woocommerce-order h2.woocommerce-column__title,
433
+ .woocommerce-customer-details .woocommerce-column__title',
434
+ 'property' => 'color',
435
+ 'unit' => 'px',
436
+ ),
437
+ ),
438
+ 'customer_details_heading_typography' => array(
439
+ 'type' => 'typography',
440
+ 'label' => __( 'Heading Typography', 'cartflows' ),
441
+ 'responsive' => true,
442
+ 'preview' => array(
443
+ 'type' => 'css',
444
+ 'selector' => '.woocommerce-customer-details .woocommerce-column__title',
445
+ ),
446
+ ),
447
+ 'customer_details_text_color' => array(
448
+ 'type' => 'color',
449
+ 'label' => __( 'Text Color', 'cartflows' ),
450
+ 'default' => '',
451
+ 'show_reset' => true,
452
+ 'connections' => array( 'color' ),
453
+ 'show_alpha' => true,
454
+ 'preview' => array(
455
+ 'type' => 'css',
456
+ 'selector' => '.wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details address',
457
+ 'property' => 'color',
458
+ 'unit' => 'px',
459
+ ),
460
+ ),
461
+ 'customer_details_background_color' => array(
462
+ 'type' => 'color',
463
+ 'label' => __( 'Background Color', 'cartflows' ),
464
+ 'default' => '',
465
+ 'show_reset' => true,
466
+ 'connections' => array( 'color' ),
467
+ 'show_alpha' => true,
468
+ 'preview' => array(
469
+ 'type' => 'css',
470
+ 'selector' => '.wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details',
471
+ 'property' => 'background-color',
472
+ 'unit' => 'px',
473
+ ),
474
+ ),
475
+ 'customer_details_text_typography' => array(
476
+ 'type' => 'typography',
477
+ 'label' => __( 'Text Typography', 'cartflows' ),
478
+ 'responsive' => true,
479
+ 'preview' => array(
480
+ 'type' => 'css',
481
+ 'selector' => '.wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details address',
482
+ ),
483
+ ),
484
+ ),
485
+ ),
486
+ ),
487
+ ),
488
+ )
489
+ );
modules/beaver-builder/cartflows-bb-order-details/css/frontend.css ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSS for Order Details Form module */
2
+ .cartflows-bb__display-order-overview-no .wcf-thankyou-wrap .woocommerce-order ul.order_details,
3
+ .cartflows-bb__display-order-overview-no .wcf-thankyou-wrap .woocommerce-order .woocommerce-thankyou-order-details {
4
+ display: none;
5
+ }
6
+
7
+ .cartflows-bb__display-order-details-no .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details {
8
+ display: none;
9
+ }
10
+
11
+ .cartflows-bb__display-shipping-address-no .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details .woocommerce-column--shipping-address{
12
+ display: none;
13
+ }
14
+
15
+ .cartflows-bb__display-billing-address-no .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details .woocommerce-column--billing-address{
16
+ display: none;
17
+ }
18
+
19
+ .cartflows-bb__display-billing-address-no.cartflows-bb__display-shipping-address-no .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details {
20
+ display: none;
21
+ }
22
+
23
+ .cartflows-bb__display-billing-address-no.cartflows-bb__display-shipping-address-yes .wcf-thankyou-wrap .woocommerce-order .woocommerce-column--shipping-address {
24
+ float: left;
25
+ }
modules/beaver-builder/cartflows-bb-order-details/icon/bb-order-details.svg ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20pt" height="20pt" viewBox="0 0 20 20" version="1.1">
3
+ <g id="surface1">
4
+ <path style=" stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 18.792969 0 C 19.585938 0 20 0.539062 20 1.199219 L 20 18.800781 C 20 19.460938 19.585938 20 18.792969 20 L 1.167969 20 C 0.375 20 0 19.460938 0 18.800781 L 0 1.199219 C 0 0.539062 0.375 0 1.167969 0 Z M 18.871094 19.238281 C 19.078125 19.238281 19.246094 19.070312 19.246094 18.867188 C 19.246094 16.488281 19.246094 3.511719 19.246094 1.132812 C 19.246094 0.929688 19.078125 0.761719 18.871094 0.761719 C 16.5 0.761719 3.582031 0.761719 1.207031 0.761719 C 1 0.761719 0.835938 0.929688 0.835938 1.132812 C 0.835938 3.511719 0.835938 16.488281 0.835938 18.867188 C 0.835938 19.070312 1 19.238281 1.207031 19.238281 C 3.582031 19.238281 16.5 19.238281 18.871094 19.238281 Z M 3.859375 16.933594 L 3.273438 16.933594 C 3.050781 16.933594 2.871094 16.742188 2.871094 16.5 C 2.871094 16.261719 3.050781 16.070312 3.273438 16.070312 L 3.859375 16.070312 C 4.082031 16.070312 4.265625 16.261719 4.265625 16.5 C 4.265625 16.742188 4.082031 16.933594 3.859375 16.933594 Z M 13.039062 16.933594 L 12.453125 16.933594 C 12.230469 16.933594 12.050781 16.742188 12.050781 16.5 C 12.050781 16.261719 12.230469 16.070312 12.453125 16.070312 L 13.039062 16.070312 C 13.261719 16.070312 13.445312 16.261719 13.445312 16.5 C 13.445312 16.742188 13.261719 16.933594 13.039062 16.933594 Z M 10.929688 16.933594 L 5.226562 16.933594 C 5.003906 16.933594 4.824219 16.742188 4.824219 16.5 C 4.824219 16.261719 5.003906 16.070312 5.226562 16.070312 L 10.929688 16.070312 C 11.152344 16.070312 11.332031 16.261719 11.332031 16.5 C 11.332031 16.742188 11.152344 16.933594 10.929688 16.933594 Z M 16.726562 16.933594 L 14.777344 16.933594 C 14.554688 16.933594 14.375 16.742188 14.375 16.5 C 14.375 16.261719 14.554688 16.070312 14.777344 16.070312 L 16.726562 16.070312 C 16.949219 16.070312 17.128906 16.261719 17.128906 16.5 C 17.128906 16.742188 16.949219 16.933594 16.726562 16.933594 Z M 3.859375 15.25 L 3.273438 15.25 C 3.050781 15.25 2.871094 15.054688 2.871094 14.816406 C 2.871094 14.578125 3.050781 14.382812 3.273438 14.382812 L 3.859375 14.382812 C 4.082031 14.382812 4.265625 14.578125 4.265625 14.816406 C 4.265625 15.054688 4.082031 15.25 3.859375 15.25 Z M 13.039062 15.25 L 12.453125 15.25 C 12.230469 15.25 12.050781 15.054688 12.050781 14.816406 C 12.050781 14.578125 12.230469 14.382812 12.453125 14.382812 L 13.039062 14.382812 C 13.261719 14.382812 13.445312 14.578125 13.445312 14.816406 C 13.445312 15.054688 13.261719 15.25 13.039062 15.25 Z M 10.929688 15.25 L 5.226562 15.25 C 5.003906 15.25 4.824219 15.054688 4.824219 14.816406 C 4.824219 14.578125 5.003906 14.382812 5.226562 14.382812 L 10.929688 14.382812 C 11.152344 14.382812 11.332031 14.578125 11.332031 14.816406 C 11.332031 15.054688 11.152344 15.25 10.929688 15.25 Z M 16.726562 15.25 L 14.777344 15.25 C 14.554688 15.25 14.375 15.054688 14.375 14.816406 C 14.375 14.578125 14.554688 14.382812 14.777344 14.382812 L 16.726562 14.382812 C 16.949219 14.382812 17.128906 14.578125 17.128906 14.816406 C 17.128906 15.054688 16.949219 15.25 16.726562 15.25 Z M 3.859375 13.566406 L 3.273438 13.566406 C 3.050781 13.566406 2.871094 13.371094 2.871094 13.132812 C 2.871094 12.894531 3.050781 12.699219 3.273438 12.699219 L 3.859375 12.699219 C 4.082031 12.699219 4.265625 12.894531 4.265625 13.132812 C 4.265625 13.371094 4.082031 13.566406 3.859375 13.566406 Z M 13.039062 13.566406 L 12.453125 13.566406 C 12.230469 13.566406 12.050781 13.371094 12.050781 13.132812 C 12.050781 12.894531 12.230469 12.699219 12.453125 12.699219 L 13.039062 12.699219 C 13.261719 12.699219 13.445312 12.894531 13.445312 13.132812 C 13.445312 13.371094 13.261719 13.566406 13.039062 13.566406 Z M 10.929688 13.566406 L 5.226562 13.566406 C 5.003906 13.566406 4.824219 13.371094 4.824219 13.132812 C 4.824219 12.894531 5.003906 12.699219 5.226562 12.699219 L 10.929688 12.699219 C 11.152344 12.699219 11.332031 12.894531 11.332031 13.132812 C 11.332031 13.371094 11.152344 13.566406 10.929688 13.566406 Z M 16.726562 13.566406 L 14.777344 13.566406 C 14.554688 13.566406 14.375 13.371094 14.375 13.132812 C 14.375 12.894531 14.554688 12.699219 14.777344 12.699219 L 16.726562 12.699219 C 16.949219 12.699219 17.128906 12.894531 17.128906 13.132812 C 17.128906 13.371094 16.949219 13.566406 16.726562 13.566406 Z M 3.859375 11.882812 L 3.273438 11.882812 C 3.050781 11.882812 2.871094 11.6875 2.871094 11.449219 C 2.871094 11.210938 3.050781 11.015625 3.273438 11.015625 L 3.859375 11.015625 C 4.082031 11.015625 4.265625 11.210938 4.265625 11.449219 C 4.265625 11.6875 4.082031 11.882812 3.859375 11.882812 Z M 13.039062 11.882812 L 12.453125 11.882812 C 12.230469 11.882812 12.050781 11.6875 12.050781 11.449219 C 12.050781 11.210938 12.230469 11.015625 12.453125 11.015625 L 13.039062 11.015625 C 13.261719 11.015625 13.445312 11.210938 13.445312 11.449219 C 13.445312 11.6875 13.261719 11.882812 13.039062 11.882812 Z M 10.929688 11.882812 L 5.226562 11.882812 C 5.003906 11.882812 4.824219 11.6875 4.824219 11.449219 C 4.824219 11.210938 5.003906 11.015625 5.226562 11.015625 L 10.929688 11.015625 C 11.152344 11.015625 11.332031 11.210938 11.332031 11.449219 C 11.332031 11.6875 11.152344 11.882812 10.929688 11.882812 Z M 16.726562 11.882812 L 14.777344 11.882812 C 14.554688 11.882812 14.375 11.6875 14.375 11.449219 C 14.375 11.210938 14.554688 11.015625 14.777344 11.015625 L 16.726562 11.015625 C 16.949219 11.015625 17.128906 11.210938 17.128906 11.449219 C 17.128906 11.6875 16.949219 11.882812 16.726562 11.882812 Z M 6.949219 4.507812 C 6.953125 4.476562 6.964844 4.441406 6.980469 4.410156 C 7 4.371094 7.027344 4.339844 7.0625 4.3125 C 7.074219 4.300781 7.089844 4.289062 7.105469 4.28125 L 9.851562 2.753906 C 9.933594 2.710938 9.953125 2.710938 10.011719 2.714844 C 10.019531 2.714844 10.023438 2.714844 10.027344 2.714844 C 10.050781 2.714844 10.074219 2.71875 10.097656 2.726562 C 10.136719 2.734375 10.160156 2.746094 10.179688 2.761719 L 12.84375 4.246094 C 12.859375 4.253906 12.867188 4.257812 12.882812 4.265625 L 12.886719 4.265625 C 12.914062 4.277344 12.929688 4.289062 12.945312 4.304688 C 13.015625 4.367188 13.058594 4.457031 13.0625 4.550781 L 13.0625 7.558594 C 13.058594 7.671875 13 7.777344 12.902344 7.835938 L 10.160156 9.378906 C 10.089844 9.414062 10.066406 9.414062 10.023438 9.417969 C 10.003906 9.417969 9.984375 9.417969 9.96875 9.414062 C 9.941406 9.414062 9.917969 9.40625 9.890625 9.398438 C 9.871094 9.390625 9.867188 9.386719 9.851562 9.378906 L 7.097656 7.84375 C 7 7.785156 6.941406 7.679688 6.9375 7.566406 L 6.945312 4.554688 C 6.945312 4.539062 6.945312 4.523438 6.949219 4.507812 Z M 7.570312 7.382812 L 9.6875 8.5625 L 9.6875 6.25 L 7.574219 5.089844 C 7.574219 5.855469 7.570312 6.617188 7.570312 7.382812 Z M 12.429688 5.09375 L 10.320312 6.269531 L 10.320312 8.5625 L 12.429688 7.375 Z M 9.296875 5.3125 L 10.023438 5.710938 L 12.097656 4.554688 L 11.378906 4.152344 Z M 7.914062 4.554688 L 8.640625 4.953125 L 10.730469 3.789062 L 10.007812 3.386719 Z M 7.914062 4.554688 "/>
5
+ </g>
6
+ </svg>
modules/beaver-builder/cartflows-bb-order-details/includes/frontend.css.php ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BB Order Details Form Module front-end CSS php file.
4
+ *
5
+ * @package cartflows
6
+ */
7
+
8
+ global $post;
9
+ ?>
10
+
11
+ .fl-node-<?php echo $id; ?> .cartflows-bb__order-details-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-thankyou-order-received {
12
+ margin-bottom: <?php echo $settings->heading_spacing; ?>px;
13
+ }
14
+
15
+ .fl-node-<?php echo $id; ?> .woocommerce-order ul.order_details,
16
+ .fl-node-<?php echo $id; ?> .woocommerce-order .woocommerce-customer-details,
17
+ .fl-node-<?php echo $id; ?> .woocommerce-order .woocommerce-order-details,
18
+ .fl-node-<?php echo $id; ?> .woocommerce-order .woocommerce-order-downloads,
19
+ .fl-node-<?php echo $id; ?> .woocommerce-order .woocommerce-bacs-bank-details,
20
+ .fl-node-<?php echo $id; ?> .woocommerce-order-details.mollie-instructions {
21
+ margin-bottom: <?php echo $settings->sections_spacing; ?>px;
22
+ }
23
+
24
+ .fl-node-<?php echo $id; ?> .cartflows-bb__order-details-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-thankyou-order-received {
25
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->heading_color ); ?>;
26
+ }
27
+
28
+ <?php
29
+ if ( class_exists( 'FLBuilderCSS' ) ) {
30
+ FLBuilderCSS::typography_field_rule(
31
+ array(
32
+ 'settings' => $settings,
33
+ 'setting_name' => 'heading_typography',
34
+ 'selector' => ".fl-node-$id .cartflows-bb__order-details-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-thankyou-order-received,
35
+ .fl-node-$id .woocommerce-thankyou-order-received",
36
+ )
37
+ );
38
+ }
39
+ ?>
40
+
41
+ .fl-node-<?php echo $id; ?> .cartflows-bb__order-details-form .wcf-thankyou-wrap .woocommerce-order h2 {
42
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->sections_heading_color ); ?>;
43
+ }
44
+
45
+ <?php
46
+ if ( class_exists( 'FLBuilderCSS' ) ) {
47
+ FLBuilderCSS::typography_field_rule(
48
+ array(
49
+ 'settings' => $settings,
50
+ 'setting_name' => 'sections_heading_typo',
51
+ 'selector' => ".fl-node-$id .cartflows-bb__order-details-form .wcf-thankyou-wrap .woocommerce-order h2",
52
+ )
53
+ );
54
+ }
55
+ ?>
56
+
57
+ .fl-node-<?php echo $id; ?> .cartflows-bb__order-details-form .wcf-thankyou-wrap .woocommerce-order,
58
+ .fl-node-<?php echo $id; ?> .woocommerce-order-downloads table.shop_table {
59
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->sections_content_color ); ?>;
60
+ }
61
+
62
+ .fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-overview.woocommerce-thankyou-order-details.order_details,
63
+ .fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details,
64
+ .fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details,
65
+ .fl-node-<?php echo $id; ?> .woocommerce-order-downloads {
66
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->sections_bg_color ); ?>;
67
+ }
68
+
69
+ <?php
70
+ if ( class_exists( 'FLBuilderCSS' ) ) {
71
+ FLBuilderCSS::typography_field_rule(
72
+ array(
73
+ 'settings' => $settings,
74
+ 'setting_name' => 'sections_content_typo',
75
+ 'selector' => ".fl-node-$id .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-overview.woocommerce-thankyou-order-details.order_details li,
76
+ .fl-node-$id .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details .woocommerce-table,
77
+ .fl-node-$id .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details address,
78
+ .fl-node-$id .woocommerce-order-downloads table.shop_table",
79
+ )
80
+ );
81
+ }
82
+ ?>
83
+
84
+ <?php
85
+ // Downloads Section.
86
+ ?>
87
+ .fl-node-<?php echo $id; ?> .cartflows-bb__order-details-form .wcf-thankyou-wrap h2.woocommerce-order-downloads__title,
88
+ .fl-node-<?php echo $id; ?> .cartflows-bb__order-details-form .wcf-thankyou-wrap h2.woocommerce-order-downloads__title
89
+ {
90
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->downloads_heading_color ); ?>;
91
+ }
92
+
93
+ <?php
94
+ if ( class_exists( 'FLBuilderCSS' ) ) {
95
+ FLBuilderCSS::typography_field_rule(
96
+ array(
97
+ 'settings' => $settings,
98
+ 'setting_name' => 'downloads_heading_typography',
99
+ 'selector' => ".fl-node-$id .woocommerce-order h2.woocommerce-order-downloads__title,
100
+ .fl-node-$id .woocommerce-order .woocommerce-order-downloads h2.woocommerce-order-downloads__title",
101
+ )
102
+ );
103
+ }
104
+ ?>
105
+
106
+ .fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-downloads table.shop_table {
107
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->downloads_text_color ); ?>;
108
+ }
109
+
110
+ .fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-downloads {
111
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->downloads_background_color ); ?>;
112
+ }
113
+
114
+ <?php
115
+ if ( class_exists( 'FLBuilderCSS' ) ) {
116
+ FLBuilderCSS::typography_field_rule(
117
+ array(
118
+ 'settings' => $settings,
119
+ 'setting_name' => 'downloads_text_typography',
120
+ 'selector' => ".fl-node-$id .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-downloads table.shop_table",
121
+ )
122
+ );
123
+ }
124
+ ?>
125
+
126
+ <?php
127
+ // Order details Section.
128
+ ?>
129
+ .fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details .woocommerce-order-details__title {
130
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->order_details_heading_color ); ?>;
131
+ }
132
+
133
+ <?php
134
+ if ( class_exists( 'FLBuilderCSS' ) ) {
135
+ FLBuilderCSS::typography_field_rule(
136
+ array(
137
+ 'settings' => $settings,
138
+ 'setting_name' => 'order_details_heading_typography',
139
+ 'selector' => ".fl-node-$id .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details .woocommerce-order-details__title",
140
+ )
141
+ );
142
+ }
143
+ ?>
144
+
145
+ .fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details .woocommerce-table {
146
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->order_details_text_color ); ?>;
147
+ }
148
+
149
+ .fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details {
150
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->order_details_background_color ); ?>;
151
+ }
152
+
153
+ <?php
154
+ if ( class_exists( 'FLBuilderCSS' ) ) {
155
+ FLBuilderCSS::typography_field_rule(
156
+ array(
157
+ 'settings' => $settings,
158
+ 'setting_name' => 'order_details_text_typography',
159
+ 'selector' => ".fl-node-$id .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details .woocommerce-table",
160
+ )
161
+ );
162
+ }
163
+ ?>
164
+
165
+ <?php
166
+ // Customer details Section.
167
+ ?>
168
+ .fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details .woocommerce-column__title {
169
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->customer_details_heading_color ); ?>;
170
+ }
171
+
172
+ <?php
173
+ if ( class_exists( 'FLBuilderCSS' ) ) {
174
+ FLBuilderCSS::typography_field_rule(
175
+ array(
176
+ 'settings' => $settings,
177
+ 'setting_name' => 'customer_details_heading_typography',
178
+ 'selector' => ".fl-node-$id .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details .woocommerce-column__title",
179
+ )
180
+ );
181
+ }
182
+ ?>
183
+
184
+ .fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details address {
185
+ color: <?php echo FLBuilderColor::hex_or_rgb( $settings->customer_details_text_color ); ?>;
186
+ }
187
+
188
+ .fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details {
189
+ background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->customer_details_background_color ); ?>;
190
+ }
191
+
192
+ <?php
193
+ if ( class_exists( 'FLBuilderCSS' ) ) {
194
+ FLBuilderCSS::typography_field_rule(
195
+ array(
196
+ 'settings' => $settings,
197
+ 'setting_name' => 'customer_details_text_typography',
198
+ 'selector' => ".fl-node-$id .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details address",
199
+ )
200
+ );
201
+ }
202
+ ?>
modules/beaver-builder/cartflows-bb-order-details/includes/frontend.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Frontend view
4
+ *
5
+ * @package cartflows
6
+ */
7
+
8
+ $order_overview = $settings->show_order_overview ? $settings->show_order_overview : 'no';
9
+
10
+ $order_details = $settings->show_order_details ? $settings->show_order_details : 'no';
11
+
12
+ $shipping_address = $settings->show_shipping_address ? $settings->show_shipping_address : 'no';
13
+
14
+ $billing_address = $settings->show_billing_address ? $settings->show_billing_address : 'no';
15
+
16
+ /* Add module setting options to filters */
17
+ $module->dynamic_option_filters();
18
+
19
+ ?>
20
+ <div class = "cartflows-bb__order-details-form cartflows-bb__display-order-overview-<?php echo esc_attr( $order_overview ); ?> cartflows-bb__display-order-details-<?php echo esc_attr( $order_details ); ?> cartflows-bb__display-billing-address-<?php echo esc_attr( $billing_address ); ?> cartflows-bb__display-shipping-address-<?php echo esc_attr( $shipping_address ); ?>">
21
+ <?php echo do_shortcode( '[cartflows_order_details]' ); ?>
22
+ </div>
modules/beaver-builder/cartflows-bb-order-details/js/settings.js ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+ FLBuilder.registerModuleHelper(
3
+ 'cartflows-bb-order-details',
4
+ {
5
+ init: function() {
6
+ var form = $('.fl-builder-settings'),
7
+ order_details_field = form.find('select[name=show_order_details]');
8
+
9
+ // Init validation events.
10
+ this._toggle_orderdetails();
11
+
12
+ // Validation events.
13
+ order_details_field.on('change', $.proxy( this._toggle_orderdetails, this ) );
14
+ },
15
+
16
+ _toggle_orderdetails: function() {
17
+
18
+ var form = $('.fl-builder-settings'),
19
+ show_order_details = form.find('select[name=show_order_details]').val();
20
+
21
+ if( show_order_details == 'yes' ) {
22
+
23
+ form.find('#fl-builder-settings-section-section_order_details').show();
24
+
25
+ } else if( show_order_details == 'no' ) {
26
+
27
+ form.find('#fl-builder-settings-section-section_order_details').hide();
28
+ }
29
+ },
30
+ }
31
+ );
32
+
33
+ })(jQuery);
modules/beaver-builder/class-cartflows-bb-modules-loader.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Modules Loader
4
+ *
5
+ * @package Beaver Builder Modules
6
+ */
7
+
8
+ /**
9
+ * Initial Setup
10
+ *
11
+ * @since x.x.x
12
+ */
13
+ class Cartflows_BB_Modules_Loader {
14
+
15
+ /**
16
+ * Member Variable
17
+ *
18
+ * @var object instance
19
+ */
20
+ private static $instance;
21
+
22
+ /**
23
+ * Initiator
24
+ */
25
+ public static function get_instance() {
26
+ if ( ! isset( self::$instance ) ) {
27
+ self::$instance = new self();
28
+ }
29
+ return self::$instance;
30
+ }
31
+
32
+ /**
33
+ * Constructor function that initializes required actions and hooks
34
+ */
35
+ public function __construct() {
36
+
37
+ add_action( 'wp', array( $this, 'init' ), 8 );
38
+
39
+ }
40
+
41
+ /**
42
+ * Function that initializes init function
43
+ *
44
+ * @since x.x.x
45
+ */
46
+ public function init() {
47
+ $this->include_modules_files();
48
+ }
49
+
50
+ /**
51
+ * Returns Script array.
52
+ *
53
+ * @return array()
54
+ * @since x.x.x
55
+ */
56
+ public static function get_module_list() {
57
+
58
+ $widget_list = array(
59
+ 'cartflows-bb-next-step',
60
+ 'cartflows-bb-order-details',
61
+ 'cartflows-bb-checkout-form',
62
+ 'cartflows-bb-optin-form',
63
+ );
64
+
65
+ return $widget_list;
66
+ }
67
+
68
+ /**
69
+ * Include Widgets files
70
+ *
71
+ * Load widgets files
72
+ *
73
+ * @since x.x.x
74
+ * @access public
75
+ */
76
+ public function include_modules_files() {
77
+
78
+ global $post;
79
+
80
+ if ( ! isset( $post ) ) {
81
+ return;
82
+ }
83
+
84
+ $post_type = $post->post_type;
85
+
86
+ if ( 'cartflows_step' === $post_type && class_exists( 'FLBuilder' ) ) {
87
+
88
+ /* Required files */
89
+ require_once CARTFLOWS_DIR . 'modules/beaver-builder/classes/class-cartflows-bb-editor.php';
90
+
91
+ include_once CARTFLOWS_DIR . 'modules/beaver-builder/classes/class-cartflows-bb-helper.php';
92
+
93
+ $widget_list = $this->get_module_list();
94
+
95
+ if ( ! empty( $widget_list ) ) {
96
+ foreach ( $widget_list as $widget ) {
97
+
98
+ include_once CARTFLOWS_DIR . 'modules/beaver-builder/' . $widget . '/' . $widget . '.php';
99
+ }
100
+ }
101
+ }
102
+ }
103
+ }
104
+
105
+ /**
106
+ * Kicking this off by calling 'get_instance()' method
107
+ */
108
+ Cartflows_BB_Modules_Loader::get_instance();
modules/beaver-builder/classes/class-cartflows-bb-editor.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Beaver Builder Editor Compatibility.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Checkout Markup
10
+ *
11
+ * @since x.x.x
12
+ */
13
+ class Cartflows_BB_Editor {
14
+
15
+ /**
16
+ * Member Variable
17
+ *
18
+ * @var object instance
19
+ */
20
+ private static $instance;
21
+
22
+ /**
23
+ * Initiator
24
+ */
25
+ public static function get_instance() {
26
+
27
+ if ( ! isset( self::$instance ) ) {
28
+ self::$instance = new self();
29
+ }
30
+
31
+ return self::$instance;
32
+ }
33
+
34
+ /**
35
+ * Constructor
36
+ */
37
+ public function __construct() {
38
+ if ( class_exists( 'FLBuilderModel' ) ) {
39
+ $this->bb_editor_compatibility();
40
+ }
41
+ }
42
+
43
+ /**
44
+ * Beaver Builder editor compatibility.
45
+ */
46
+ public function bb_editor_compatibility() {
47
+
48
+ if ( FLBuilderModel::is_builder_active() ) {
49
+
50
+ $current_post_id = get_the_id();
51
+
52
+ $cf_frontend = Cartflows_Frontend::get_instance();
53
+
54
+ /* Load woo templates from plugin. */
55
+ add_filter( 'woocommerce_locate_template', array( $cf_frontend, 'override_woo_template' ), 20, 3 );
56
+
57
+ do_action( 'cartflows_bb_editor_compatibility', $current_post_id );
58
+
59
+ /* Thank you filters. */
60
+ add_filter( 'cartflows_show_demo_order_details', '__return_true' );
61
+ }
62
+ }
63
+
64
+ }
65
+
66
+ /**
67
+ * Kicking this off by calling 'get_instance()' method
68
+ */
69
+ Cartflows_BB_Editor::get_instance();
modules/beaver-builder/classes/class-cartflows-bb-helper.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Custom modules
4
+ *
5
+ * @package BB Helper
6
+ */
7
+
8
+ if ( ! class_exists( 'Cartflows_BB_Helper' ) ) {
9
+ /**
10
+ * This class initializes BB Ultiamte Addon Helper
11
+ *
12
+ * @class Cartflows_BB_Helper
13
+ */
14
+ class Cartflows_BB_Helper {
15
+
16
+ /**
17
+ * Current step type var
18
+ *
19
+ * @since x.x.x
20
+ * @var object $step_type
21
+ */
22
+ public static $step_type;
23
+
24
+ /**
25
+ * Get current post step type
26
+ *
27
+ * @since x.x.x
28
+ * @var function cartflows_bb_step_type
29
+ */
30
+ public static function cartflows_bb_step_type() {
31
+
32
+ if ( ! isset( self::$step_type ) ) {
33
+ self::$step_type = get_post_meta( get_the_id(), 'wcf-step-type', true );
34
+ }
35
+
36
+ return self::$step_type;
37
+ }
38
+
39
+ /**
40
+ * Initializes an array to replace recursive function
41
+ *
42
+ * @param var $color returns the bas values.
43
+ *
44
+ * @param array $opacity returns the replacements values.
45
+ * @param array $is_array returns the replacements values.
46
+ */
47
+ public static function cartflows_bb_hex2rgba( $color, $opacity = false, $is_array = false ) {
48
+
49
+ $default = $color;
50
+
51
+ // Return default if no color provided.
52
+ if ( empty( $color ) ) {
53
+ return $default;
54
+ }
55
+
56
+ // Sanitize $color if "#" is provided.
57
+ if ( '#' == $color[0] ) {
58
+ $color = substr( $color, 1 );
59
+ }
60
+
61
+ // Check if color has 6 or 3 characters and get values.
62
+ if ( 6 == strlen( $color ) ) {
63
+ $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );
64
+ } elseif ( 3 == strlen( $color ) ) {
65
+ $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );
66
+ } else {
67
+ return $default;
68
+ }
69
+
70
+ // Convert hexadec to rgb.
71
+ $rgb = array_map( 'hexdec', $hex );
72
+
73
+ // Check if opacity is set(rgba or rgb).
74
+ if ( false !== $opacity && '' !== $opacity ) {
75
+ if ( abs( $opacity ) > 1 ) {
76
+
77
+ $opacity = $opacity / 100;
78
+ }
79
+ $output = 'rgba(' . implode( ',', $rgb ) . ',' . $opacity . ')';
80
+ } else {
81
+ $output = 'rgb(' . implode( ',', $rgb ) . ')';
82
+ }
83
+
84
+ if ( $is_array ) {
85
+ return $rgb;
86
+ } else {
87
+
88
+ return $output;
89
+ }
90
+ }
91
+
92
+ /**
93
+ * Initializes an array to replace recursive function
94
+ *
95
+ * @param var $settings returns the bas values.
96
+ *
97
+ * @param array $name returns the replacements values.
98
+ * @param array $opc returns the replacements values.
99
+ */
100
+ public static function cartflows_bb_colorpicker( $settings, $name = '', $opc = false ) {
101
+
102
+ $hex_color = '';
103
+ $opacity = '';
104
+ $hex_color = $settings->$name;
105
+
106
+ if ( '' != $hex_color && 'r' != $hex_color[0] && 'R' != $hex_color[0] ) {
107
+
108
+ if ( true == $opc && isset( $settings->{ $name . '_opc' } ) ) {
109
+ if ( '' !== $settings->{ $name . '_opc' } ) {
110
+ $opacity = $settings->{ $name . '_opc' };
111
+ $rgba = self::cartflows_bb_hex2rgba( $hex_color, $opacity / 100 );
112
+ return $rgba;
113
+ }
114
+ }
115
+
116
+ if ( '#' != $hex_color[0] ) {
117
+
118
+ return '#' . $hex_color;
119
+ }
120
+ }
121
+
122
+ return $hex_color;
123
+
124
+ }
125
+
126
+ /**
127
+ * Provide option to parse a color code.
128
+ *
129
+ * @param var $code Returns a hex value for color from rgba or #hex color.
130
+ * @return string - hex value for the color
131
+ */
132
+ public static function cartflows_bb_parse_color_to_hex( $code = '' ) {
133
+ $color = '';
134
+ $hex = '';
135
+ if ( '' != $code ) {
136
+ if ( false !== strpos( $code, 'rgba' ) ) {
137
+ $code = ltrim( $code, 'rgba(' );
138
+ $code = rtrim( $code, ')' );
139
+ $rgb = explode( ',', $code );
140
+ $hex .= str_pad( dechex( $rgb[0] ), 2, '0', STR_PAD_LEFT );
141
+ $hex .= str_pad( dechex( $rgb[1] ), 2, '0', STR_PAD_LEFT );
142
+ $hex .= str_pad( dechex( $rgb[2] ), 2, '0', STR_PAD_LEFT );
143
+ $color = $hex;
144
+ } else {
145
+ $color = ltrim( $code, '#' );
146
+ }
147
+ }
148
+ return $color;
149
+ }
150
+ }
151
+ }
modules/checkout/classes/class-cartflows-checkout-markup.php CHANGED
@@ -84,7 +84,15 @@ class Cartflows_Checkout_Markup {
84
 
85
  add_action( 'init', array( $this, 'update_woo_actions_ajax' ), 10 );
86
 
87
- $this->elementor_editor_compatibility();
 
 
 
 
 
 
 
 
88
  }
89
 
90
  /**
@@ -146,6 +154,22 @@ class Cartflows_Checkout_Markup {
146
  );
147
  }
148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  /**
150
  * Change PayPal Express cancel URL.
151
  *
@@ -346,8 +370,15 @@ class Cartflows_Checkout_Markup {
346
  if ( empty( $checkout_id ) ) {
347
 
348
  if ( ! _is_wcf_checkout_type() ) {
349
-
350
- return '<h4>' . __( 'Checkout ID not found', 'cartflows' ) . '</h4>';
 
 
 
 
 
 
 
351
  }
352
 
353
  global $post;
84
 
85
  add_action( 'init', array( $this, 'update_woo_actions_ajax' ), 10 );
86
 
87
+ if ( class_exists( '\Elementor\Plugin' ) ) {
88
+ // Load the widgets.
89
+ $this->elementor_editor_compatibility();
90
+ }
91
+
92
+ if ( class_exists( 'FLBuilder' ) ) {
93
+ $this->bb_editor_compatibility();
94
+ }
95
+
96
  }
97
 
98
  /**
154
  );
155
  }
156
 
157
+ /**
158
+ * Function for bb editor compatibility.
159
+ */
160
+ public function bb_editor_compatibility() {
161
+
162
+ /* Add data. */
163
+ add_action(
164
+ 'cartflows_bb_editor_compatibility',
165
+ function( $post_id ) {
166
+ add_action( 'cartflows_bb_before_checkout_shortcode', array( $this, 'before_checkout_shortcode_actions' ) );
167
+ },
168
+ 10,
169
+ 1
170
+ );
171
+ }
172
+
173
  /**
174
  * Change PayPal Express cancel URL.
175
  *
370
  if ( empty( $checkout_id ) ) {
371
 
372
  if ( ! _is_wcf_checkout_type() ) {
373
+ $error_html = '<h4>' . __( 'Checkout ID not found', 'cartflows' ) . '</h4>';
374
+ $error_html .= '<p>' . sprintf(
375
+ /* translators: %1$1s, %2$2s Link to article */
376
+ __( 'It seems that this is not the CartFlows Checkout page where you have added this shortcode. Please refer to this %1$1sarticle%2$2s to know more.', 'cartflows' ),
377
+ '<a href="https://cartflows.com/docs/resolve-checkout-id-not-found-error/" target="_blank">',
378
+ '</a>'
379
+ ) . '</p>';
380
+
381
+ return $error_html;
382
  }
383
 
384
  global $post;
modules/flow/classes/class-cartflows-flow-meta.php CHANGED
@@ -1,866 +1,866 @@
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
- * For Gutenberg
30
- *
31
- * @var $is_gutenberg_editor_active
32
- */
33
- private $is_gutenberg_editor_active = false;
34
-
35
- /**
36
- * Initiator
37
- */
38
- public static function get_instance() {
39
- if ( ! isset( self::$instance ) ) {
40
- self::$instance = new self();
41
- }
42
-
43
- return self::$instance;
44
- }
45
-
46
- /**
47
- * Constructor
48
- */
49
- public function __construct() {
50
-
51
- add_action( 'admin_head', array( $this, 'menu_highlight' ) );
52
-
53
- add_action( 'admin_init', array( $this, 'admin_init_actions' ) );
54
-
55
- /* Init Metabox */
56
- add_action( 'load-post.php', array( $this, 'init_metabox' ) );
57
- add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
58
-
59
- /* Add Scripts */
60
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ), 20 );
61
-
62
- add_action( 'wp_ajax_cartflows_delete_flow_step', array( $this, 'cartflows_delete_flow_step' ) );
63
- add_action( 'wp_ajax_cartflows_reorder_flow_steps', array( $this, 'cartflows_reorder_flow_steps' ) );
64
-
65
- add_action( 'admin_notices', array( $this, 'admin_notices' ) );
66
-
67
- add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
68
-
69
- /* To check the status of gutenberg */
70
- add_action( 'enqueue_block_editor_assets', array( $this, 'set_block_editor_status' ) );
71
-
72
- /* Add back to edit flow button for gutenberg */
73
- add_action( 'admin_footer', array( $this, 'gutenberg_module_templates' ) );
74
- }
75
-
76
- /**
77
- * Display admin notices.
78
- *
79
- * @since 1.0.0
80
- *
81
- * @return void
82
- */
83
- public function admin_notices() {
84
-
85
- if ( CARTFLOWS_STEP_POST_TYPE !== get_post_type() ) {
86
- return;
87
- }
88
-
89
- $flow_id = get_post_meta( get_the_id(), 'wcf-flow-id', true );
90
- if ( $flow_id ) { ?>
91
- <div class="wcf-notice-back-edit-flow">
92
- <p>
93
- <a href="<?php echo esc_url( get_edit_post_link( $flow_id ) ); ?>" class="button button-primary button-hero wcf-header-back-button" style="text-decoration: none;">
94
- <i class="dashicons dashicons-arrow-left-alt"></i>
95
- <?php esc_html_e( 'Back to edit Flow', 'cartflows' ); ?>
96
- </a>
97
- </p>
98
- </div>
99
- <?php
100
- }
101
- }
102
-
103
- /**
104
- * Initialize admin actions.
105
- *
106
- * @since 1.0.0
107
- *
108
- * @return void
109
- */
110
- public function admin_init_actions() {
111
- add_action( 'before_delete_post', array( $this, 'step_post_sync' ) );
112
- add_action( 'wp_trash_post', array( $this, 'step_post_trash_sync' ) );
113
- add_action( 'untrashed_post', array( $this, 'step_post_untrash_sync' ) );
114
- }
115
-
116
- /**
117
- * Delete term data and steps data after deleting flow.
118
- *
119
- * @since 1.0.0
120
- * @param int $pid post id.
121
- *
122
- * @return void
123
- */
124
- public function step_post_sync( $pid ) {
125
-
126
- global $post_type;
127
-
128
- if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
129
-
130
- $steps = get_post_meta( $pid, 'wcf-steps', true );
131
-
132
- if ( $steps && is_array( $steps ) ) {
133
- foreach ( $steps as $i => $step ) {
134
- wp_delete_post( $step['id'], true );
135
- }
136
- }
137
-
138
- $term_data = term_exists( 'flow-' . $pid, CARTFLOWS_TAXONOMY_STEP_FLOW );
139
-
140
- if ( is_array( $term_data ) ) {
141
- wp_delete_term( $term_data['term_id'], CARTFLOWS_TAXONOMY_STEP_FLOW );
142
- }
143
- }
144
- }
145
-
146
- /**
147
- * Trash steps data after trashing flow.
148
- *
149
- * @since 1.0.0
150
- * @param int $pid post id.
151
- *
152
- * @return void
153
- */
154
- public function step_post_trash_sync( $pid ) {
155
-
156
- global $post_type;
157
-
158
- if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
159
-
160
- $steps = get_post_meta( $pid, 'wcf-steps', true );
161
-
162
- if ( $steps && is_array( $steps ) ) {
163
- foreach ( $steps as $i => $step ) {
164
- wp_trash_post( $step['id'] );
165
- }
166
- }
167
- }
168
- }
169
-
170
- /**
171
- * Untrash steps data after restoring flow.
172
- *
173
- * @since 1.0.0
174
- * @param int $pid post id.
175
- *
176
- * @return void
177
- */
178
- public function step_post_untrash_sync( $pid ) {
179
-
180
- global $post_type;
181
-
182
- if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
183
-
184
- $steps = get_post_meta( $pid, 'wcf-steps', true );
185
-
186
- if ( $steps && is_array( $steps ) ) {
187
- foreach ( $steps as $i => $step ) {
188
- wp_untrash_post( $step['id'] );
189
- }
190
- }
191
- }
192
- }
193
-
194
- /**
195
- * Create step for given flow.
196
- *
197
- * @param int $flow_id flow ID.
198
- * @param int $step_type step type.
199
- * @param int $step_title step title.
200
- * @since 1.0.0
201
- *
202
- * @return int
203
- */
204
- public function create_step( $flow_id, $step_type, $step_title ) {
205
-
206
- $new_step_id = wp_insert_post(
207
- array(
208
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
209
- 'post_title' => $step_title,
210
- 'post_status' => 'publish',
211
- )
212
- );
213
-
214
- if ( $new_step_id ) {
215
-
216
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
217
-
218
- if ( ! is_array( $flow_steps ) ) {
219
- $flow_steps = array();
220
- }
221
-
222
- $flow_steps[] = array(
223
- 'id' => $new_step_id,
224
- 'title' => $step_title,
225
- 'type' => $step_type,
226
- );
227
-
228
- // insert post meta.
229
- update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
230
- update_post_meta( $new_step_id, 'wcf-step-type', $step_type );
231
-
232
- wp_set_object_terms( $new_step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
233
- wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
234
- }
235
-
236
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
237
-
238
- return $new_step_id;
239
- }
240
-
241
- /**
242
- * Delete step for flow
243
- *
244
- * @since 1.0.0
245
- *
246
- * @return void
247
- */
248
- public function cartflows_delete_flow_step() {
249
-
250
- if ( ! current_user_can( 'manage_options' ) ) {
251
- return;
252
- }
253
-
254
- check_ajax_referer( 'wcf-delete-flow-step', 'security' );
255
-
256
- if ( isset( $_POST['post_id'] ) && isset( $_POST['step_id'] ) ) {
257
- $flow_id = intval( $_POST['post_id'] );
258
- $step_id = intval( $_POST['step_id'] );
259
- }
260
-
261
- $result = array(
262
- 'status' => false,
263
- 'reload' => false,
264
- /* translators: %s flow id */
265
- 'text' => sprintf( __( 'Step not deleted for flow - %s', 'cartflows' ), $flow_id ),
266
- );
267
-
268
- if ( ! $flow_id || ! $step_id ) {
269
- wp_send_json( $result );
270
- }
271
-
272
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
273
-
274
- if ( ! is_array( $flow_steps ) ) {
275
- wp_send_json( $result );
276
- }
277
-
278
- $is_ab_test = get_post_meta( $step_id, 'wcf-ab-test', true );
279
-
280
- if ( ! $is_ab_test ) {
281
-
282
- foreach ( $flow_steps as $index => $data ) {
283
-
284
- if ( intval( $data['id'] ) === $step_id ) {
285
- unset( $flow_steps[ $index ] );
286
- break;
287
- }
288
- }
289
-
290
- /* Set index order properly */
291
- $flow_steps = array_merge( $flow_steps );
292
-
293
- /* Update latest data */
294
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
295
-
296
- /* Delete step */
297
- wp_delete_post( $step_id, true );
298
-
299
- $result = array(
300
- 'status' => true,
301
- 'reload' => false,
302
- /* translators: %s flow id */
303
- 'text' => sprintf( __( 'Step deleted for flow - %s', 'cartflows' ), $flow_id ),
304
- );
305
-
306
- } else {
307
-
308
- $result = array(
309
- 'status' => false,
310
- 'reload' => false,
311
- /* translators: %s flow id */
312
- 'text' => sprintf( __( 'This step can not be deleted.', 'cartflows' ), $flow_id ),
313
- );
314
- /**
315
- Action do_action( 'cartflows_step_delete_ab_test', $step_id, $flow_id, $flow_steps );
316
- */
317
- }
318
-
319
- wp_send_json( $result );
320
- }
321
-
322
- /**
323
- * Reorder step flow
324
- *
325
- * @since 1.0.0
326
- *
327
- * @return void
328
- */
329
- public function cartflows_reorder_flow_steps() {
330
-
331
- if ( ! current_user_can( 'manage_options' ) ) {
332
- return;
333
- }
334
-
335
- check_ajax_referer( 'wcf-reorder-flow-steps', 'security' );
336
-
337
- if ( isset( $_POST['post_id'] ) && isset( $_POST['step_ids'] ) ) {
338
- $flow_id = intval( $_POST['post_id'] );
339
- $step_ids = array_map( 'intval', $_POST['step_ids'] );
340
- }
341
- $result = array(
342
- 'status' => false,
343
- /* translators: %s flow id */
344
- 'text' => sprintf( __( 'Steps not sorted for flow - %s', 'cartflows' ), $flow_id ),
345
- );
346
-
347
- if ( ! $flow_id || ! is_array( $step_ids ) ) {
348
- wp_send_json( $result );
349
- }
350
-
351
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
352
- $flow_steps_map = array();
353
-
354
- foreach ( $flow_steps as $key => $value ) {
355
- $flow_steps_map[ $value['id'] ] = $value;
356
- }
357
-
358
- $new_flow_steps = array();
359
-
360
- foreach ( $step_ids as $index => $step_id ) {
361
-
362
- $new_flow_step_data = array();
363
-
364
- if ( isset( $flow_steps_map[ $step_id ] ) ) {
365
- $new_flow_step_data = $flow_steps_map[ $step_id ];
366
- }
367
-
368
- $new_flow_step_data['id'] = intval( $step_id );
369
- $new_flow_step_data['title'] = get_the_title( $step_id );
370
- $new_flow_step_data['type'] = get_post_meta( $step_id, 'wcf-step-type', true );
371
-
372
- $new_flow_steps[] = $new_flow_step_data;
373
- }
374
-
375
- update_post_meta( $flow_id, 'wcf-steps', $new_flow_steps );
376
-
377
- $result = array(
378
- 'status' => true,
379
- /* translators: %s flow id */
380
- 'text' => sprintf( __( 'Steps sorted for flow - %s', 'cartflows' ), $flow_id ),
381
- );
382
-
383
- wp_send_json( $result );
384
- }
385
-
386
-
387
- /**
388
- * Load admin scripts
389
- *
390
- * @since 1.0.0
391
- *
392
- * @return void
393
- */
394
- public function admin_scripts() {
395
-
396
- global $pagenow;
397
- global $post;
398
-
399
- $screen = get_current_screen();
400
-
401
- if ( ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) && CARTFLOWS_FLOW_POST_TYPE == $screen->post_type ) {
402
-
403
- wp_enqueue_script(
404
- 'wcf-flow-meta',
405
- CARTFLOWS_URL . 'admin/assets/js/flow-admin-edit.js',
406
- array( 'jquery', 'jquery-ui-sortable' ),
407
- CARTFLOWS_VER,
408
- true
409
- );
410
-
411
- wp_enqueue_style( 'wcf-flow-meta', CARTFLOWS_URL . 'admin/assets/css/flow-admin-edit.css', '', CARTFLOWS_VER );
412
- wp_style_add_data( 'wcf-flow-meta', 'rtl', 'replace' );
413
- }
414
- }
415
-
416
- /**
417
- * Initialize meta box
418
- *
419
- * @since 1.0.0
420
- *
421
- * @return void
422
- */
423
- public function init_metabox() {
424
-
425
- /**
426
- * Fires after the title field.
427
- *
428
- * @param WP_Post $post Post object.
429
- */
430
- add_action( 'add_meta_boxes', array( $this, 'settings_meta_box' ) );
431
- add_action( 'edit_form_after_title', array( $this, 'setup_meta_box' ) );
432
- add_action( 'save_post', array( $this, 'save_meta_box' ) );
433
- }
434
-
435
- /**
436
- * Is first time import?
437
- *
438
- * @param integer $post_id post ID.
439
- * @return bool
440
- */
441
- public function is_flow_imported( $post_id = 0 ) {
442
-
443
- if ( 0 === $post_id ) {
444
- $post_id = get_the_ID();
445
- }
446
-
447
- $steps = get_post_meta( $post_id, 'wcf-steps', true );
448
- $choice = get_post_meta( $post_id, 'wcf-flow-choise', true );
449
-
450
- if ( empty( $steps ) && 'import' === $choice ) {
451
- return true;
452
- }
453
-
454
- return false;
455
- }
456
-
457
- /**
458
- * Setup meta box.
459
- *
460
- * @return void
461
- */
462
- public function setup_meta_box() {
463
- if ( ! Cartflows_Admin::is_flow_edit_admin() ) {
464
- return;
465
- }
466
-
467
- /**
468
- * Adding Add new step button to the top*/
469
- echo $this->add_add_new_step_button();
470
-
471
- $this->markup_meta_box();
472
-
473
- $this->add_upgrade_to_pro_metabox();
474
- }
475
-
476
-
477
- /**
478
- * Add metabox when cartflows pro is not enabled.
479
- */
480
- public function add_upgrade_to_pro_metabox() {
481
-
482
- if ( ! _is_cartflows_pro() ) {
483
- add_meta_box(
484
- 'wcf-upgrade-pro',
485
- __( 'Analytics', 'cartflows' ),
486
- array( $this, 'upgrade_to_pro' ),
487
- CARTFLOWS_FLOW_POST_TYPE,
488
- 'side',
489
- 'high'
490
- );
491
- }
492
-
493
- }
494
-
495
- /**
496
- * Show Upgrade To Pro markup.
497
- */
498
- public function upgrade_to_pro() {
499
-
500
- echo '<div>';
501
- /* translators: %s: link */
502
- 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>';
503
- echo '<p><a target="_blank" href="https://cartflows.com/" class="button button-primary">' . esc_html__( 'Get Pro', 'cartflows' ) . '</a></p>';
504
- echo '</div>';
505
-
506
- }
507
-
508
- /**
509
- * Settings meta box.
510
- *
511
- * @return void
512
- */
513
- public function settings_meta_box() {
514
-
515
- if ( CARTFLOWS_FLOW_POST_TYPE === get_post_type() ) {
516
-
517
- /* No need of sandbox will delete it later */
518
- add_meta_box(
519
- 'wcf-sandbox-settings', // Id.
520
- __( 'Flow Settings', 'cartflows' ), // Title.
521
- array( $this, 'sandbox_meta_box' ), // Callback.
522
- CARTFLOWS_FLOW_POST_TYPE, // Post_type.
523
- 'side', // Context.
524
- 'high' // Priority.
525
- );
526
-
527
- do_action( 'cartflows_add_flow_metabox' );
528
- }
529
- }
530
-
531
- /**
532
- * Metabox Markup
533
- *
534
- * @return void
535
- */
536
- public function markup_meta_box() {
537
- global $post;
538
-
539
- wp_nonce_field( 'save-nonce-flow-meta', 'nonce-flow-meta' );
540
-
541
- // Get defaults.
542
- $meta = self::get_current_post_meta( $post->ID );
543
-
544
- /**
545
- * Get options
546
- */
547
- $updated_data = array(
548
- 'steps' => $meta['wcf-steps']['default'],
549
- );
550
-
551
- do_action( 'wcf_flow_settings_markup_before', $meta );
552
- $this->page_header_tab( $updated_data );
553
- do_action( 'wcf_flow_settings_markup_after', $meta );
554
- }
555
-
556
- /**
557
- * Metabox Markup
558
- *
559
- * @param object $post Post object.
560
- * @return void
561
- */
562
- public function sandbox_meta_box( $post ) {
563
-
564
- // Get defaults.
565
- $meta = self::get_current_post_meta( $post->ID );
566
-
567
- /**
568
- * Get options
569
- */
570
- foreach ( $meta as $key => $value ) {
571
- $updated_data[ $key ] = $meta[ $key ]['default'];
572
- }
573
-
574
- do_action( 'wcf_flow_sandbox_markup_before', $meta );
575
- $this->sandbox_markup( $updated_data );
576
- do_action( 'wcf_flow_sandbox_markup_after', $meta );
577
- }
578
-
579
- /**
580
- * Page Header Tabs
581
- *
582
- * @param array $options Post meta.
583
- * @return void
584
- */
585
- public function page_header_tab( $options ) {
586
-
587
- include_once CARTFLOWS_FLOW_DIR . 'view/meta-flow-steps.php';
588
- }
589
-
590
- /**
591
- * Sandbox Markup
592
- *
593
- * @param array $options Post meta.
594
- * @return void
595
- */
596
- public function sandbox_markup( $options ) {
597
- ?>
598
- <div class="wcf-flow-sandbox-table wcf-general-metabox-wrap widefat">
599
- <div class="wcf-flow-sandbox-table-container">
600
- <?php
601
- echo wcf()->meta->get_checkbox_field(
602
- array(
603
- 'name' => 'wcf-testing',
604
- 'value' => $options['wcf-testing'],
605
- 'after' => esc_html__( 'Enable Test Mode', 'cartflows' ),
606
- )
607
- );
608
-
609
- echo wcf()->meta->get_description_field(
610
- array(
611
- 'name' => 'wcf-testing-note',
612
- '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' ),
613
- )
614
- );
615
-
616
- ?>
617
- </div>
618
- </div>
619
- <?php
620
- }
621
-
622
- /**
623
- * Keep the menu open when editing the flows.
624
- * Highlights the wanted admin (sub-) menu items for the CPT.
625
- *
626
- * @since 1.0.0
627
- */
628
- public function menu_highlight() {
629
- global $parent_file, $submenu_file, $post_type;
630
- if ( CARTFLOWS_FLOW_POST_TYPE == $post_type ) :
631
- $parent_file = CARTFLOWS_SLUG;//phpcs:ignore
632
- $submenu_file = 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE;//phpcs:ignore
633
- endif;
634
- }
635
-
636
- /**
637
- * Get metabox options
638
- *
639
- * @param int $post_id post id.
640
- * @return array
641
- */
642
- public static function get_meta_option( $post_id ) {
643
-
644
- if ( null === self::$meta_option ) {
645
- /**
646
- * Set metabox options
647
- */
648
- self::$meta_option = wcf()->options->get_flow_fields( $post_id );
649
- }
650
-
651
- return self::$meta_option;
652
- }
653
-
654
- /**
655
- * Get metabox options
656
- *
657
- * @param int $post_id post ID.
658
- * @return array
659
- */
660
- public static function get_current_post_meta( $post_id ) {
661
-
662
- $stored = get_post_meta( $post_id );
663
-
664
- $default_meta = self::get_meta_option( $post_id );
665
-
666
- // Set stored and override defaults.
667
- foreach ( $stored as $key => $value ) {
668
- if ( array_key_exists( $key, $default_meta ) ) {
669
- self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? maybe_unserialize( $stored[ $key ][0] ) : '';
670
- } else {
671
- self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : '';
672
- }
673
- }
674
-
675
- return self::get_meta_option( $post_id );
676
- }
677
-
678
- /**
679
- * Metabox Save
680
- *
681
- * @param number $post_id Post ID.
682
- * @return void
683
- */
684
- public function save_meta_box( $post_id ) {
685
-
686
- // Checks save status.
687
- $is_autosave = wp_is_post_autosave( $post_id );
688
- $is_revision = wp_is_post_revision( $post_id );
689
-
690
- $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;
691
-
692
- // Exits script depending on save status.
693
- if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
694
- return;
695
- }
696
-
697
- wcf()->options->save_flow_fields( $post_id );
698
- }
699
-
700
- /**
701
- * Localize variables in admin
702
- *
703
- * @param array $vars variables.
704
- */
705
- public function localize_vars( $vars ) {
706
-
707
- $ajax_actions = array(
708
- 'wcf_setup_default_steps',
709
- 'wcf_add_flow_step',
710
- 'wcf_delete_flow_step',
711
- 'wcf_reorder_flow_steps',
712
- 'wcf_clone_flow_step',
713
- );
714
-
715
- foreach ( $ajax_actions as $action ) {
716
-
717
- $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
718
- }
719
-
720
- return $vars;
721
- }
722
-
723
- /**
724
- * Add New Step Button
725
- *
726
- * @return string
727
- */
728
- public function add_add_new_step_button() {
729
- $add_new_btn_markup = '<style>.wrap{ position:relative;}</style>';
730
- $add_new_btn_markup .= "<div class='wcf-button-wrap'>";
731
- $add_new_btn_markup .= "<button class='wcf-trigger-popup page-title-action'>";
732
- $add_new_btn_markup .= esc_html__( 'Add New Step', 'cartflows' );
733
- $add_new_btn_markup .= '</button>';
734
- $add_new_btn_markup .= '</div>';
735
-
736
- return $add_new_btn_markup;
737
- }
738
-
739
- /**
740
- * Back to flow button gutenberg template
741
- *
742
- * @return void
743
- */
744
- public function gutenberg_module_templates() {
745
-
746
- // Exit if block editor is not enabled.
747
- if ( ! $this->is_gutenberg_editor_active ) {
748
- return;
749
- }
750
-
751
- if ( CARTFLOWS_STEP_POST_TYPE !== get_post_type() ) {
752
- return;
753
- }
754
-
755
- $flow_id = get_post_meta( get_the_id(), 'wcf-flow-id', true );
756
-
757
- if ( $flow_id ) {
758
- ?>
759
- <script id="wcf-gutenberg-back-flow-button" type="text/html">
760
- <div class="wcf-notice-back-edit-flow gutenberg-button" >
761
- <a href="<?php echo esc_url( get_edit_post_link( $flow_id ) ); ?>" class="button button-primary button-large wcf-header-back-button" style="text-decoration: none;">
762
- <i class="dashicons dashicons-arrow-left-alt"></i>
763
- <?php esc_html_e( 'Back to edit Flow', 'cartflows' ); ?>
764
- </a>
765
- </div>
766
- </script>
767
- <?php
768
- }
769
- }
770
-
771
- /**
772
- * Set status true for gutenberg.
773
- *
774
- * @return void
775
- */
776
- public function set_block_editor_status() {
777
-
778
- if ( ! current_user_can( 'manage_options' ) ) {
779
- return;
780
- }
781
-
782
- // Set gutenberg status here.
783
- $this->is_gutenberg_editor_active = true;
784
- }
785
-
786
- /**
787
- * Get step action buttons
788
- *
789
- * @param int $inner_step_id step id.
790
- * @param bool $ab_test_ui ab test.
791
- * @param array $args ab test array.
792
- * @return array.
793
- */
794
- public function get_step_action_buttons( $inner_step_id, $ab_test_ui, $args ) {
795
-
796
- $action_buttons = apply_filters(
797
- 'cartflows_step_actions',
798
- array(
799
- 'view' => array(
800
- 'link' => get_permalink( $inner_step_id ),
801
- 'class' => 'wcf-step-view wcf-action-button wp-ui-text-highlight',
802
- 'tooltip' => esc_html__( 'View Step', 'cartflows' ),
803
- 'icon' => 'dashicons-visibility',
804
- 'label' => esc_html__( 'View', 'cartflows' ),
805
- 'attr' => array(
806
- 'target' => '_blank',
807
- ),
808
- 'show' => true,
809
- ),
810
- 'edit' => array(
811
- 'link' => get_edit_post_link( $inner_step_id ),
812
- 'class' => 'wcf-step-edit wcf-action-button wp-ui-text-highlight',
813
- 'tooltip' => esc_html__( 'Edit Step', 'cartflows' ),
814
- 'icon' => 'dashicons-edit',
815
- 'label' => esc_html__( 'Edit', 'cartflows' ),
816
- 'show' => true,
817
- ),
818
- 'clone' => array(
819
- 'link' => '#',
820
- 'target' => '_blank',
821
- 'class' => 'wcf-step-clone wcf-action-button wp-ui-text-highlight',
822
- 'tooltip' => esc_html__( 'Clone Step', 'cartflows' ),
823
- 'icon' => 'dashicons-admin-page',
824
- 'label' => esc_html__( 'Clone', 'cartflows' ),
825
- 'attr' => array(
826
- 'data-id' => $inner_step_id,
827
- ),
828
- 'show' => _is_cartflows_pro() ? true : false,
829
- ),
830
- 'delete' => array(
831
- 'link' => '#',
832
- 'class' => 'wcf-step-delete wcf-action-button wp-ui-text-highlight',
833
- 'tooltip' => esc_html__( 'Delete Step', 'cartflows' ),
834
- 'icon' => 'dashicons-trash',
835
- 'label' => esc_html__( 'Delete', 'cartflows' ),
836
- 'attr' => array(
837
- 'data-id' => $inner_step_id,
838
- ),
839
- 'show' => true,
840
- ),
841
- 'ab-test' => array(
842
- 'link' => '#',
843
- 'class' => 'wcf-step-abtest wcf-action-button wp-ui-text-highlight',
844
- 'tooltip' => esc_html__( 'A/B Test', 'cartflows' ),
845
- 'icon' => 'dashicons-forms',
846
- 'label' => esc_html__( 'A/B Test', 'cartflows' ),
847
- 'show' => true,
848
- 'attr' => array(
849
- 'data-id' => $inner_step_id,
850
- ),
851
- 'show' => _is_cartflows_pro() ? true : false,
852
- ),
853
- ),
854
- $inner_step_id,
855
- $ab_test_ui,
856
- $args
857
- );
858
-
859
- return $action_buttons;
860
- }
861
- }
862
-
863
- /**
864
- * Kicking this off by calling 'get_instance()' method
865
- */
866
- 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
+ * For Gutenberg
30
+ *
31
+ * @var $is_gutenberg_editor_active
32
+ */
33
+ private $is_gutenberg_editor_active = false;
34
+
35
+ /**
36
+ * Initiator
37
+ */
38
+ public static function get_instance() {
39
+ if ( ! isset( self::$instance ) ) {
40
+ self::$instance = new self();
41
+ }
42
+
43
+ return self::$instance;
44
+ }
45
+
46
+ /**
47
+ * Constructor
48
+ */
49
+ public function __construct() {
50
+
51
+ add_action( 'admin_head', array( $this, 'menu_highlight' ) );
52
+
53
+ add_action( 'admin_init', array( $this, 'admin_init_actions' ) );
54
+
55
+ /* Init Metabox */
56
+ add_action( 'load-post.php', array( $this, 'init_metabox' ) );
57
+ add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
58
+
59
+ /* Add Scripts */
60
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ), 20 );
61
+
62
+ add_action( 'wp_ajax_cartflows_delete_flow_step', array( $this, 'cartflows_delete_flow_step' ) );
63
+ add_action( 'wp_ajax_cartflows_reorder_flow_steps', array( $this, 'cartflows_reorder_flow_steps' ) );
64
+
65
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
66
+
67
+ add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
68
+
69
+ /* To check the status of gutenberg */
70
+ add_action( 'enqueue_block_editor_assets', array( $this, 'set_block_editor_status' ) );
71
+
72
+ /* Add back to edit flow button for gutenberg */
73
+ add_action( 'admin_footer', array( $this, 'gutenberg_module_templates' ) );
74
+ }
75
+
76
+ /**
77
+ * Display admin notices.
78
+ *
79
+ * @since 1.0.0
80
+ *
81
+ * @return void
82
+ */
83
+ public function admin_notices() {
84
+
85
+ if ( CARTFLOWS_STEP_POST_TYPE !== get_post_type() ) {
86
+ return;
87
+ }
88
+
89
+ $flow_id = get_post_meta( get_the_id(), 'wcf-flow-id', true );
90
+ if ( $flow_id ) { ?>
91
+ <div class="wcf-notice-back-edit-flow">
92
+ <p>
93
+ <a href="<?php echo esc_url( get_edit_post_link( $flow_id ) ); ?>" class="button button-primary button-hero wcf-header-back-button" style="text-decoration: none;">
94
+ <i class="dashicons dashicons-arrow-left-alt"></i>
95
+ <?php esc_html_e( 'Back to edit Flow', 'cartflows' ); ?>
96
+ </a>
97
+ </p>
98
+ </div>
99
+ <?php
100
+ }
101
+ }
102
+
103
+ /**
104
+ * Initialize admin actions.
105
+ *
106
+ * @since 1.0.0
107
+ *
108
+ * @return void
109
+ */
110
+ public function admin_init_actions() {
111
+ add_action( 'before_delete_post', array( $this, 'step_post_sync' ) );
112
+ add_action( 'wp_trash_post', array( $this, 'step_post_trash_sync' ) );
113
+ add_action( 'untrashed_post', array( $this, 'step_post_untrash_sync' ) );
114
+ }
115
+
116
+ /**
117
+ * Delete term data and steps data after deleting flow.
118
+ *
119
+ * @since 1.0.0
120
+ * @param int $pid post id.
121
+ *
122
+ * @return void
123
+ */
124
+ public function step_post_sync( $pid ) {
125
+
126
+ global $post_type;
127
+
128
+ if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
129
+
130
+ $steps = get_post_meta( $pid, 'wcf-steps', true );
131
+
132
+ if ( $steps && is_array( $steps ) ) {
133
+ foreach ( $steps as $i => $step ) {
134
+ wp_delete_post( $step['id'], true );
135
+ }
136
+ }
137
+
138
+ $term_data = term_exists( 'flow-' . $pid, CARTFLOWS_TAXONOMY_STEP_FLOW );
139
+
140
+ if ( is_array( $term_data ) ) {
141
+ wp_delete_term( $term_data['term_id'], CARTFLOWS_TAXONOMY_STEP_FLOW );
142
+ }
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Trash steps data after trashing flow.
148
+ *
149
+ * @since 1.0.0
150
+ * @param int $pid post id.
151
+ *
152
+ * @return void
153
+ */
154
+ public function step_post_trash_sync( $pid ) {
155
+
156
+ global $post_type;
157
+
158
+ if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
159
+
160
+ $steps = get_post_meta( $pid, 'wcf-steps', true );
161
+
162
+ if ( $steps && is_array( $steps ) ) {
163
+ foreach ( $steps as $i => $step ) {
164
+ wp_trash_post( $step['id'] );
165
+ }
166
+ }
167
+ }
168
+ }
169
+
170
+ /**
171
+ * Untrash steps data after restoring flow.
172
+ *
173
+ * @since 1.0.0
174
+ * @param int $pid post id.
175
+ *
176
+ * @return void
177
+ */
178
+ public function step_post_untrash_sync( $pid ) {
179
+
180
+ global $post_type;
181
+
182
+ if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
183
+
184
+ $steps = get_post_meta( $pid, 'wcf-steps', true );
185
+
186
+ if ( $steps && is_array( $steps ) ) {
187
+ foreach ( $steps as $i => $step ) {
188
+ wp_untrash_post( $step['id'] );
189
+ }
190
+ }
191
+ }
192
+ }
193
+
194
+ /**
195
+ * Create step for given flow.
196
+ *
197
+ * @param int $flow_id flow ID.
198
+ * @param int $step_type step type.
199
+ * @param int $step_title step title.
200
+ * @since 1.0.0
201
+ *
202
+ * @return int
203
+ */
204
+ public function create_step( $flow_id, $step_type, $step_title ) {
205
+
206
+ $new_step_id = wp_insert_post(
207
+ array(
208
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
209
+ 'post_title' => $step_title,
210
+ 'post_status' => 'publish',
211
+ )
212
+ );
213
+
214
+ if ( $new_step_id ) {
215
+
216
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
217
+
218
+ if ( ! is_array( $flow_steps ) ) {
219
+ $flow_steps = array();
220
+ }
221
+
222
+ $flow_steps[] = array(
223
+ 'id' => $new_step_id,
224
+ 'title' => $step_title,
225
+ 'type' => $step_type,
226
+ );
227
+
228
+ // insert post meta.
229
+ update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
230
+ update_post_meta( $new_step_id, 'wcf-step-type', $step_type );
231
+
232
+ wp_set_object_terms( $new_step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
233
+ wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
234
+ }
235
+
236
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
237
+
238
+ return $new_step_id;
239
+ }
240
+
241
+ /**
242
+ * Delete step for flow
243
+ *
244
+ * @since 1.0.0
245
+ *
246
+ * @return void
247
+ */
248
+ public function cartflows_delete_flow_step() {
249
+
250
+ if ( ! current_user_can( 'manage_options' ) ) {
251
+ return;
252
+ }
253
+
254
+ check_ajax_referer( 'wcf-delete-flow-step', 'security' );
255
+
256
+ if ( isset( $_POST['post_id'] ) && isset( $_POST['step_id'] ) ) {
257
+ $flow_id = intval( $_POST['post_id'] );
258
+ $step_id = intval( $_POST['step_id'] );
259
+ }
260
+
261
+ $result = array(
262
+ 'status' => false,
263
+ 'reload' => false,
264
+ /* translators: %s flow id */
265
+ 'text' => sprintf( __( 'Step not deleted for flow - %s', 'cartflows' ), $flow_id ),
266
+ );
267
+
268
+ if ( ! $flow_id || ! $step_id ) {
269
+ wp_send_json( $result );
270
+ }
271
+
272
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
273
+
274
+ if ( ! is_array( $flow_steps ) ) {
275
+ wp_send_json( $result );
276
+ }
277
+
278
+ $is_ab_test = get_post_meta( $step_id, 'wcf-ab-test', true );
279
+
280
+ if ( ! $is_ab_test ) {
281
+
282
+ foreach ( $flow_steps as $index => $data ) {
283
+
284
+ if ( intval( $data['id'] ) === $step_id ) {
285
+ unset( $flow_steps[ $index ] );
286
+ break;
287
+ }
288
+ }
289
+
290
+ /* Set index order properly */
291
+ $flow_steps = array_merge( $flow_steps );
292
+
293
+ /* Update latest data */
294
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
295
+
296
+ /* Delete step */
297
+ wp_delete_post( $step_id, true );
298
+
299
+ $result = array(
300
+ 'status' => true,
301
+ 'reload' => false,
302
+ /* translators: %s flow id */
303
+ 'text' => sprintf( __( 'Step deleted for flow - %s', 'cartflows' ), $flow_id ),
304
+ );
305
+
306
+ } else {
307
+
308
+ $result = array(
309
+ 'status' => false,
310
+ 'reload' => false,
311
+ /* translators: %s flow id */
312
+ 'text' => sprintf( __( 'This step can not be deleted.', 'cartflows' ), $flow_id ),
313
+ );
314
+ /**
315
+ Action do_action( 'cartflows_step_delete_ab_test', $step_id, $flow_id, $flow_steps );
316
+ */
317
+ }
318
+
319
+ wp_send_json( $result );
320
+ }
321
+
322
+ /**
323
+ * Reorder step flow
324
+ *
325
+ * @since 1.0.0
326
+ *
327
+ * @return void
328
+ */
329
+ public function cartflows_reorder_flow_steps() {
330
+
331
+ if ( ! current_user_can( 'manage_options' ) ) {
332
+ return;
333
+ }
334
+
335
+ check_ajax_referer( 'wcf-reorder-flow-steps', 'security' );
336
+
337
+ if ( isset( $_POST['post_id'] ) && isset( $_POST['step_ids'] ) ) {
338
+ $flow_id = intval( $_POST['post_id'] );
339
+ $step_ids = array_map( 'intval', $_POST['step_ids'] );
340
+ }
341
+ $result = array(
342
+ 'status' => false,
343
+ /* translators: %s flow id */
344
+ 'text' => sprintf( __( 'Steps not sorted for flow - %s', 'cartflows' ), $flow_id ),
345
+ );
346
+
347
+ if ( ! $flow_id || ! is_array( $step_ids ) ) {
348
+ wp_send_json( $result );
349
+ }
350
+
351
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
352
+ $flow_steps_map = array();
353
+
354
+ foreach ( $flow_steps as $key => $value ) {
355
+ $flow_steps_map[ $value['id'] ] = $value;
356
+ }
357
+
358
+ $new_flow_steps = array();
359
+
360
+ foreach ( $step_ids as $index => $step_id ) {
361
+
362
+ $new_flow_step_data = array();
363
+
364
+ if ( isset( $flow_steps_map[ $step_id ] ) ) {
365
+ $new_flow_step_data = $flow_steps_map[ $step_id ];
366
+ }
367
+
368
+ $new_flow_step_data['id'] = intval( $step_id );
369
+ $new_flow_step_data['title'] = get_the_title( $step_id );
370
+ $new_flow_step_data['type'] = get_post_meta( $step_id, 'wcf-step-type', true );
371
+
372
+ $new_flow_steps[] = $new_flow_step_data;
373
+ }
374
+
375
+ update_post_meta( $flow_id, 'wcf-steps', $new_flow_steps );
376
+
377
+ $result = array(
378
+ 'status' => true,
379
+ /* translators: %s flow id */
380
+ 'text' => sprintf( __( 'Steps sorted for flow - %s', 'cartflows' ), $flow_id ),
381
+ );
382
+
383
+ wp_send_json( $result );
384
+ }
385
+
386
+
387
+ /**
388
+ * Load admin scripts
389
+ *
390
+ * @since 1.0.0
391
+ *
392
+ * @return void
393
+ */
394
+ public function admin_scripts() {
395
+
396
+ global $pagenow;
397
+ global $post;
398
+
399
+ $screen = get_current_screen();
400
+
401
+ if ( ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) && CARTFLOWS_FLOW_POST_TYPE == $screen->post_type ) {
402
+
403
+ wp_enqueue_script(
404
+ 'wcf-flow-meta',
405
+ CARTFLOWS_URL . 'admin/assets/js/flow-admin-edit.js',
406
+ array( 'jquery', 'jquery-ui-sortable' ),
407
+ CARTFLOWS_VER,
408
+ true
409
+ );
410
+
411
+ wp_enqueue_style( 'wcf-flow-meta', CARTFLOWS_URL . 'admin/assets/css/flow-admin-edit.css', '', CARTFLOWS_VER );
412
+ wp_style_add_data( 'wcf-flow-meta', 'rtl', 'replace' );
413
+ }
414
+ }
415
+
416
+ /**
417
+ * Initialize meta box
418
+ *
419
+ * @since 1.0.0
420
+ *
421
+ * @return void
422
+ */
423
+ public function init_metabox() {
424
+
425
+ /**
426
+ * Fires after the title field.
427
+ *
428
+ * @param WP_Post $post Post object.
429
+ */
430
+ add_action( 'add_meta_boxes', array( $this, 'settings_meta_box' ) );
431
+ add_action( 'edit_form_after_title', array( $this, 'setup_meta_box' ) );
432
+ add_action( 'save_post', array( $this, 'save_meta_box' ) );
433
+ }
434
+
435
+ /**
436
+ * Is first time import?
437
+ *
438
+ * @param integer $post_id post ID.
439
+ * @return bool
440
+ */
441
+ public function is_flow_imported( $post_id = 0 ) {
442
+
443
+ if ( 0 === $post_id ) {
444
+ $post_id = get_the_ID();
445
+ }
446
+
447
+ $steps = get_post_meta( $post_id, 'wcf-steps', true );
448
+ $choice = get_post_meta( $post_id, 'wcf-flow-choise', true );
449
+
450
+ if ( empty( $steps ) && 'import' === $choice ) {
451
+ return true;
452
+ }
453
+
454
+ return false;
455
+ }
456
+
457
+ /**
458
+ * Setup meta box.
459
+ *
460
+ * @return void
461
+ */
462
+ public function setup_meta_box() {
463
+ if ( ! Cartflows_Admin::is_flow_edit_admin() ) {
464
+ return;
465
+ }
466
+
467
+ /**
468
+ * Adding Add new step button to the top*/
469
+ echo $this->add_add_new_step_button();
470
+
471
+ $this->markup_meta_box();
472
+
473
+ $this->add_upgrade_to_pro_metabox();
474
+ }
475
+
476
+
477
+ /**
478
+ * Add metabox when cartflows pro is not enabled.
479
+ */
480
+ public function add_upgrade_to_pro_metabox() {
481
+
482
+ if ( ! _is_cartflows_pro() ) {
483
+ add_meta_box(
484
+ 'wcf-upgrade-pro',
485
+ __( 'Analytics', 'cartflows' ),
486
+ array( $this, 'upgrade_to_pro' ),
487
+ CARTFLOWS_FLOW_POST_TYPE,
488
+ 'side',
489
+ 'high'
490
+ );
491
+ }
492
+
493
+ }
494
+
495
+ /**
496
+ * Show Upgrade To Pro markup.
497
+ */
498
+ public function upgrade_to_pro() {
499
+
500
+ echo '<div>';
501
+ /* translators: %s: link */
502
+ 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>';
503
+ echo '<p><a target="_blank" href="https://cartflows.com/" class="button button-primary">' . esc_html__( 'Get Pro', 'cartflows' ) . '</a></p>';
504
+ echo '</div>';
505
+
506
+ }
507
+
508
+ /**
509
+ * Settings meta box.
510
+ *
511
+ * @return void
512
+ */
513
+ public function settings_meta_box() {
514
+
515
+ if ( CARTFLOWS_FLOW_POST_TYPE === get_post_type() ) {
516
+
517
+ /* No need of sandbox will delete it later */
518
+ add_meta_box(
519
+ 'wcf-sandbox-settings', // Id.
520
+ __( 'Flow Settings', 'cartflows' ), // Title.
521
+ array( $this, 'sandbox_meta_box' ), // Callback.
522
+ CARTFLOWS_FLOW_POST_TYPE, // Post_type.
523
+ 'side', // Context.
524
+ 'high' // Priority.
525
+ );
526
+
527
+ do_action( 'cartflows_add_flow_metabox' );
528
+ }
529
+ }
530
+
531
+ /**
532
+ * Metabox Markup
533
+ *
534
+ * @return void
535
+ */
536
+ public function markup_meta_box() {
537
+ global $post;
538
+
539
+ wp_nonce_field( 'save-nonce-flow-meta', 'nonce-flow-meta' );
540
+
541
+ // Get defaults.
542
+ $meta = self::get_current_post_meta( $post->ID );
543
+
544
+ /**
545
+ * Get options
546
+ */
547
+ $updated_data = array(
548
+ 'steps' => $meta['wcf-steps']['default'],
549
+ );
550
+
551
+ do_action( 'wcf_flow_settings_markup_before', $meta );
552
+ $this->page_header_tab( $updated_data );
553
+ do_action( 'wcf_flow_settings_markup_after', $meta );
554
+ }
555
+
556
+ /**
557
+ * Metabox Markup
558
+ *
559
+ * @param object $post Post object.
560
+ * @return void
561
+ */
562
+ public function sandbox_meta_box( $post ) {
563
+
564
+ // Get defaults.
565
+ $meta = self::get_current_post_meta( $post->ID );
566
+
567
+ /**
568
+ * Get options
569
+ */
570
+ foreach ( $meta as $key => $value ) {
571
+ $updated_data[ $key ] = $meta[ $key ]['default'];
572
+ }
573
+
574
+ do_action( 'wcf_flow_sandbox_markup_before', $meta );
575
+ $this->sandbox_markup( $updated_data );
576
+ do_action( 'wcf_flow_sandbox_markup_after', $meta );
577
+ }
578
+
579
+ /**
580
+ * Page Header Tabs
581
+ *
582
+ * @param array $options Post meta.
583
+ * @return void
584
+ */
585
+ public function page_header_tab( $options ) {
586
+
587
+ include_once CARTFLOWS_FLOW_DIR . 'view/meta-flow-steps.php';
588
+ }
589
+
590
+ /**
591
+ * Sandbox Markup
592
+ *
593
+ * @param array $options Post meta.
594
+ * @return void
595
+ */
596
+ public function sandbox_markup( $options ) {
597
+ ?>
598
+ <div class="wcf-flow-sandbox-table wcf-general-metabox-wrap widefat">
599
+ <div class="wcf-flow-sandbox-table-container">
600
+ <?php
601
+ echo wcf()->meta->get_checkbox_field(
602
+ array(
603
+ 'name' => 'wcf-testing',
604
+ 'value' => $options['wcf-testing'],
605
+ 'after' => esc_html__( 'Enable Test Mode', 'cartflows' ),
606
+ )
607
+ );
608
+
609
+ echo wcf()->meta->get_description_field(
610
+ array(
611
+ 'name' => 'wcf-testing-note',
612
+ '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' ),
613
+ )
614
+ );
615
+
616
+ ?>
617
+ </div>
618
+ </div>
619
+ <?php
620
+ }
621
+
622
+ /**
623
+ * Keep the menu open when editing the flows.
624
+ * Highlights the wanted admin (sub-) menu items for the CPT.
625
+ *
626
+ * @since 1.0.0
627
+ */
628
+ public function menu_highlight() {
629
+ global $parent_file, $submenu_file, $post_type;
630
+ if ( CARTFLOWS_FLOW_POST_TYPE == $post_type ) :
631
+ $parent_file = CARTFLOWS_SLUG;//phpcs:ignore
632
+ $submenu_file = 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE;//phpcs:ignore
633
+ endif;
634
+ }
635
+
636
+ /**
637
+ * Get metabox options
638
+ *
639
+ * @param int $post_id post id.
640
+ * @return array
641
+ */
642
+ public static function get_meta_option( $post_id ) {
643
+
644
+ if ( null === self::$meta_option ) {
645
+ /**
646
+ * Set metabox options
647
+ */
648
+ self::$meta_option = wcf()->options->get_flow_fields( $post_id );
649
+ }
650
+
651
+ return self::$meta_option;
652
+ }
653
+
654
+ /**
655
+ * Get metabox options
656
+ *
657
+ * @param int $post_id post ID.
658
+ * @return array
659
+ */
660
+ public static function get_current_post_meta( $post_id ) {
661
+
662
+ $stored = get_post_meta( $post_id );
663
+
664
+ $default_meta = self::get_meta_option( $post_id );
665
+
666
+ // Set stored and override defaults.
667
+ foreach ( $stored as $key => $value ) {
668
+ if ( array_key_exists( $key, $default_meta ) ) {
669
+ self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? maybe_unserialize( $stored[ $key ][0] ) : '';
670
+ } else {
671
+ self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : '';
672
+ }
673
+ }
674
+
675
+ return self::get_meta_option( $post_id );
676
+ }
677
+
678
+ /**
679
+ * Metabox Save
680
+ *
681
+ * @param number $post_id Post ID.
682
+ * @return void
683
+ */
684
+ public function save_meta_box( $post_id ) {
685
+
686
+ // Checks save status.
687
+ $is_autosave = wp_is_post_autosave( $post_id );
688
+ $is_revision = wp_is_post_revision( $post_id );
689
+
690
+ $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;
691
+
692
+ // Exits script depending on save status.
693
+ if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
694
+ return;
695
+ }
696
+
697
+ wcf()->options->save_flow_fields( $post_id );
698
+ }
699
+
700
+ /**
701
+ * Localize variables in admin
702
+ *
703
+ * @param array $vars variables.
704
+ */
705
+ public function localize_vars( $vars ) {
706
+
707
+ $ajax_actions = array(
708
+ 'wcf_setup_default_steps',
709
+ 'wcf_add_flow_step',
710
+ 'wcf_delete_flow_step',
711
+ 'wcf_reorder_flow_steps',
712
+ 'wcf_clone_flow_step',
713
+ );
714
+
715
+ foreach ( $ajax_actions as $action ) {
716
+
717
+ $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
718
+ }
719
+
720
+ return $vars;
721
+ }
722
+
723
+ /**
724
+ * Add New Step Button
725
+ *
726
+ * @return string
727
+ */
728
+ public function add_add_new_step_button() {
729
+ $add_new_btn_markup = '<style>.wrap{ position:relative;}</style>';
730
+ $add_new_btn_markup .= "<div class='wcf-button-wrap'>";
731
+ $add_new_btn_markup .= "<button class='wcf-trigger-popup page-title-action'>";
732
+ $add_new_btn_markup .= esc_html__( 'Add New Step', 'cartflows' );
733
+ $add_new_btn_markup .= '</button>';
734
+ $add_new_btn_markup .= '</div>';
735
+
736
+ return $add_new_btn_markup;
737
+ }
738
+
739
+ /**
740
+ * Back to flow button gutenberg template
741
+ *
742
+ * @return void
743
+ */
744
+ public function gutenberg_module_templates() {
745
+
746
+ // Exit if block editor is not enabled.
747
+ if ( ! $this->is_gutenberg_editor_active ) {
748
+ return;
749
+ }
750
+
751
+ if ( CARTFLOWS_STEP_POST_TYPE !== get_post_type() ) {
752
+ return;
753
+ }
754
+
755
+ $flow_id = get_post_meta( get_the_id(), 'wcf-flow-id', true );
756
+
757
+ if ( $flow_id ) {
758
+ ?>
759
+ <script id="wcf-gutenberg-back-flow-button" type="text/html">
760
+ <div class="wcf-notice-back-edit-flow gutenberg-button" >
761
+ <a href="<?php echo esc_url( get_edit_post_link( $flow_id ) ); ?>" class="button button-primary button-large wcf-header-back-button" style="text-decoration: none;">
762
+ <i class="dashicons dashicons-arrow-left-alt"></i>
763
+ <?php esc_html_e( 'Back to edit Flow', 'cartflows' ); ?>
764
+ </a>
765
+ </div>
766
+ </script>
767
+ <?php
768
+ }
769
+ }
770
+
771
+ /**
772
+ * Set status true for gutenberg.
773
+ *
774
+ * @return void
775
+ */
776
+ public function set_block_editor_status() {
777
+
778
+ if ( ! current_user_can( 'manage_options' ) ) {
779
+ return;
780
+ }
781
+
782
+ // Set gutenberg status here.
783
+ $this->is_gutenberg_editor_active = true;
784
+ }
785
+
786
+ /**
787
+ * Get step action buttons
788
+ *
789
+ * @param int $inner_step_id step id.
790
+ * @param bool $ab_test_ui ab test.
791
+ * @param array $args ab test array.
792
+ * @return array.
793
+ */
794
+ public function get_step_action_buttons( $inner_step_id, $ab_test_ui, $args ) {
795
+
796
+ $action_buttons = apply_filters(
797
+ 'cartflows_step_actions',
798
+ array(
799
+ 'view' => array(
800
+ 'link' => get_permalink( $inner_step_id ),
801
+ 'class' => 'wcf-step-view wcf-action-button wp-ui-text-highlight',
802
+ 'tooltip' => esc_html__( 'View Step', 'cartflows' ),
803
+ 'icon' => 'dashicons-visibility',
804
+ 'label' => esc_html__( 'View', 'cartflows' ),
805
+ 'attr' => array(
806
+ 'target' => '_blank',
807
+ ),
808
+ 'show' => true,
809
+ ),
810
+ 'edit' => array(
811
+ 'link' => get_edit_post_link( $inner_step_id ),
812
+ 'class' => 'wcf-step-edit wcf-action-button wp-ui-text-highlight',
813
+ 'tooltip' => esc_html__( 'Edit Step', 'cartflows' ),
814
+ 'icon' => 'dashicons-edit',
815
+ 'label' => esc_html__( 'Edit', 'cartflows' ),
816
+ 'show' => true,
817
+ ),
818
+ 'clone' => array(
819
+ 'link' => '#',
820
+ 'target' => '_blank',
821
+ 'class' => 'wcf-step-clone wcf-action-button wp-ui-text-highlight',
822
+ 'tooltip' => esc_html__( 'Clone Step', 'cartflows' ),
823
+ 'icon' => 'dashicons-admin-page',
824
+ 'label' => esc_html__( 'Clone', 'cartflows' ),
825
+ 'attr' => array(
826
+ 'data-id' => $inner_step_id,
827
+ ),
828
+ 'show' => _is_cartflows_pro() ? true : false,
829
+ ),
830
+ 'delete' => array(
831
+ 'link' => '#',
832
+ 'class' => 'wcf-step-delete wcf-action-button wp-ui-text-highlight',
833
+ 'tooltip' => esc_html__( 'Delete Step', 'cartflows' ),
834
+ 'icon' => 'dashicons-trash',
835
+ 'label' => esc_html__( 'Delete', 'cartflows' ),
836
+ 'attr' => array(
837
+ 'data-id' => $inner_step_id,
838
+ ),
839
+ 'show' => true,
840
+ ),
841
+ 'ab-test' => array(
842
+ 'link' => '#',
843
+ 'class' => 'wcf-step-abtest wcf-action-button wp-ui-text-highlight',
844
+ 'tooltip' => esc_html__( 'A/B Test', 'cartflows' ),
845
+ 'icon' => 'dashicons-forms',
846
+ 'label' => esc_html__( 'A/B Test', 'cartflows' ),
847
+ 'show' => true,
848
+ 'attr' => array(
849
+ 'data-id' => $inner_step_id,
850
+ ),
851
+ 'show' => _is_cartflows_pro() ? true : false,
852
+ ),
853
+ ),
854
+ $inner_step_id,
855
+ $ab_test_ui,
856
+ $args
857
+ );
858
+
859
+ return $action_buttons;
860
+ }
861
+ }
862
+
863
+ /**
864
+ * Kicking this off by calling 'get_instance()' method
865
+ */
866
+ Cartflows_Flow_Meta::get_instance();
modules/flow/classes/class-cartflows-flow-post-type.php CHANGED
@@ -1,373 +1,373 @@
1
- <?php
2
- /**
3
- * Flow post type
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Initialization
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Flow_Post_Type {
14
-
15
-
16
- /**
17
- * Member Variable
18
- *
19
- * @var instance
20
- */
21
- private static $instance;
22
-
23
- /**
24
- * Initiator
25
- */
26
- public static function get_instance() {
27
- if ( ! isset( self::$instance ) ) {
28
- self::$instance = new self();
29
- }
30
- return self::$instance;
31
- }
32
-
33
- /**
34
- * Constructor
35
- */
36
- public function __construct() {
37
-
38
- add_action( 'init', array( $this, 'flow_post_type' ) );
39
- add_action( 'admin_menu', array( $this, 'register_as_submenu' ), 100 );
40
- add_action( 'do_meta_boxes', array( $this, 'wcf_change_metabox_position' ) );
41
-
42
- add_filter( 'post_updated_messages', array( $this, 'custom_post_type_post_update_messages' ) );
43
-
44
- add_filter( 'display_post_states', array( $this, 'add_cartflows_post_state' ), 15, 1 );
45
-
46
- add_filter( 'hidden_meta_boxes', array( $this, 'display_flow_slug_meta_box' ), 10, 2 );
47
-
48
- /* View Post URL */
49
- add_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );
50
- add_filter( 'preview_post_link', array( $this, 'preview_post_link' ), 10, 2 );
51
- add_action( 'template_redirect', array( $this, 'redirect_to_step' ), 10 );
52
- }
53
-
54
- /**
55
- * Add CartFlows post status.
56
- *
57
- * @param array $post_states post data.
58
- * @return array
59
- */
60
- public function add_cartflows_post_state( $post_states ) {
61
-
62
- global $post;
63
-
64
- if ( isset( $post->post_type ) && CARTFLOWS_STEP_POST_TYPE === $post->post_type ) {
65
-
66
- $flow_id = get_post_meta( $post->ID, 'wcf-flow-id', true );
67
- $flow_title = get_the_title( $flow_id );
68
-
69
- $post_states['cartflows_step'] = '( ' . __( 'Flow: ', 'cartflows' ) . $flow_id . ' | ' . __( 'Name: ', 'cartflows' ) . $flow_title . ')';
70
-
71
- }
72
-
73
- return $post_states;
74
- }
75
-
76
- /**
77
- * Display slugdiv.
78
- *
79
- * @param array $hidden metaboxes.
80
- * @param obj $screen screen.
81
- * @return array
82
- */
83
- public function display_flow_slug_meta_box( $hidden, $screen ) {
84
- $post_type = $screen->id;
85
- if ( ! empty( $post_type ) && CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
86
- $pos = array_search( 'slugdiv', $hidden, true );
87
- unset( $hidden[ $pos ] );
88
- }
89
-
90
- return $hidden;
91
- }
92
-
93
- /**
94
- * Create custom post type
95
- */
96
- public function flow_post_type() {
97
-
98
- $labels = array(
99
- 'name' => esc_html_x( 'Flows', 'flow general name', 'cartflows' ),
100
- 'singular_name' => esc_html_x( 'Flow', 'flow singular name', 'cartflows' ),
101
- 'search_items' => esc_html__( 'Search Flows', 'cartflows' ),
102
- 'all_items' => esc_html__( 'All Flows', 'cartflows' ),
103
- 'edit_item' => esc_html__( 'Edit Flow', 'cartflows' ),
104
- 'view_item' => esc_html__( 'View Flow', 'cartflows' ),
105
- 'add_new' => esc_html__( 'Add New', 'cartflows' ),
106
- 'update_item' => esc_html__( 'Update Flow', 'cartflows' ),
107
- 'add_new_item' => esc_html__( 'Add New', 'cartflows' ),
108
- 'new_item_name' => esc_html__( 'New Flow Name', 'cartflows' ),
109
- );
110
-
111
- $args = array(
112
- 'labels' => $labels,
113
- 'show_in_menu' => false,
114
- 'public' => false, // it's not public, not own permalink.
115
- 'publicly_queryable' => true, // you should be able to query it.
116
- 'show_ui' => true,
117
- 'query_var' => true,
118
- 'can_export' => true,
119
- 'show_in_admin_bar' => true,
120
- 'exclude_from_search' => true,
121
- 'has_archive' => false, // it shouldn't have archive page.
122
- 'rewrite' => false, // it shouldn't have rewrite rules.
123
- 'supports' => array( 'title', 'thumbnail', 'slug' ),
124
- 'capability_type' => 'post',
125
- );
126
-
127
- if ( ! _is_cartflows_pro() ) {
128
-
129
- $flow_posts = get_posts(
130
- array(
131
- 'posts_per_page' => 4,
132
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
133
- 'post_status' => array( 'publish', 'pending', 'draft', 'future', 'private' ),
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
- * Add flows submenu
315
- *
316
- * @since 1.0.0
317
- */
318
- public function register_as_submenu() {
319
- add_submenu_page(
320
- CARTFLOWS_SLUG,
321
- __( 'Flows', 'cartflows' ),
322
- __( 'Flows', 'cartflows' ),
323
- 'edit_pages',
324
- 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE
325
- );
326
- }
327
-
328
- /**
329
- * Add Update messages for any custom post type
330
- *
331
- * @param array $messages Array of default messages.
332
- */
333
- public function custom_post_type_post_update_messages( $messages ) {
334
-
335
- $custom_post_type = get_post_type( get_the_ID() );
336
-
337
- if ( CARTFLOWS_FLOW_POST_TYPE == $custom_post_type ) {
338
-
339
- $obj = get_post_type_object( $custom_post_type );
340
- $singular_name = $obj->labels->singular_name;
341
- $messages[ $custom_post_type ] = array(
342
- 0 => '', // Unused. Messages start at index 1.
343
- /* translators: %s: singular custom post type name */
344
- 1 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
345
- /* translators: %s: singular custom post type name */
346
- 2 => sprintf( __( 'Custom %s updated.', 'cartflows' ), $singular_name ),
347
- /* translators: %s: singular custom post type name */
348
- 3 => sprintf( __( 'Custom %s deleted.', 'cartflows' ), $singular_name ),
349
- /* translators: %s: singular custom post type name */
350
- 4 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
351
- /* translators: %1$s: singular custom post type name ,%2$s: date and time of the revision */
352
- 5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s', 'cartflows' ), $singular_name, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, //phpcs:ignore
353
- /* translators: %s: singular custom post type name */
354
- 6 => sprintf( __( '%s published.', 'cartflows' ), $singular_name ),
355
- /* translators: %s: singular custom post type name */
356
- 7 => sprintf( __( '%s saved.', 'cartflows' ), $singular_name ),
357
- /* translators: %s: singular custom post type name */
358
- 8 => sprintf( __( '%s submitted.', 'cartflows' ), $singular_name ),
359
- /* translators: %s: singular custom post type name */
360
- 9 => sprintf( __( '%s scheduled for.', 'cartflows' ), $singular_name ),
361
- /* translators: %s: singular custom post type name */
362
- 10 => sprintf( __( '%s draft updated.', 'cartflows' ), $singular_name ),
363
- );
364
- }
365
-
366
- return $messages;
367
- }
368
- }
369
-
370
- /**
371
- * Kicking this off by calling 'get_instance()' method
372
- */
373
- Cartflows_Flow_Post_Type::get_instance();
1
+ <?php
2
+ /**
3
+ * Flow post type
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Initialization
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Flow_Post_Type {
14
+
15
+
16
+ /**
17
+ * Member Variable
18
+ *
19
+ * @var instance
20
+ */
21
+ private static $instance;
22
+
23
+ /**
24
+ * Initiator
25
+ */
26
+ public static function get_instance() {
27
+ if ( ! isset( self::$instance ) ) {
28
+ self::$instance = new self();
29
+ }
30
+ return self::$instance;
31
+ }
32
+
33
+ /**
34
+ * Constructor
35
+ */
36
+ public function __construct() {
37
+
38
+ add_action( 'init', array( $this, 'flow_post_type' ) );
39
+ add_action( 'admin_menu', array( $this, 'register_as_submenu' ), 100 );
40
+ add_action( 'do_meta_boxes', array( $this, 'wcf_change_metabox_position' ) );
41
+
42
+ add_filter( 'post_updated_messages', array( $this, 'custom_post_type_post_update_messages' ) );
43
+
44
+ add_filter( 'display_post_states', array( $this, 'add_cartflows_post_state' ), 15, 1 );
45
+
46
+ add_filter( 'hidden_meta_boxes', array( $this, 'display_flow_slug_meta_box' ), 10, 2 );
47
+
48
+ /* View Post URL */
49
+ add_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );
50
+ add_filter( 'preview_post_link', array( $this, 'preview_post_link' ), 10, 2 );
51
+ add_action( 'template_redirect', array( $this, 'redirect_to_step' ), 10 );
52
+ }
53
+
54
+ /**
55
+ * Add CartFlows post status.
56
+ *
57
+ * @param array $post_states post data.
58
+ * @return array
59
+ */
60
+ public function add_cartflows_post_state( $post_states ) {
61
+
62
+ global $post;
63
+
64
+ if ( isset( $post->post_type ) && CARTFLOWS_STEP_POST_TYPE === $post->post_type ) {
65
+
66
+ $flow_id = get_post_meta( $post->ID, 'wcf-flow-id', true );
67
+ $flow_title = get_the_title( $flow_id );
68
+
69
+ $post_states['cartflows_step'] = '( ' . __( 'Flow: ', 'cartflows' ) . $flow_id . ' | ' . __( 'Name: ', 'cartflows' ) . $flow_title . ')';
70
+
71
+ }
72
+
73
+ return $post_states;
74
+ }
75
+
76
+ /**
77
+ * Display slugdiv.
78
+ *
79
+ * @param array $hidden metaboxes.
80
+ * @param obj $screen screen.
81
+ * @return array
82
+ */
83
+ public function display_flow_slug_meta_box( $hidden, $screen ) {
84
+ $post_type = $screen->id;
85
+ if ( ! empty( $post_type ) && CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
86
+ $pos = array_search( 'slugdiv', $hidden, true );
87
+ unset( $hidden[ $pos ] );
88
+ }
89
+
90
+ return $hidden;
91
+ }
92
+
93
+ /**
94
+ * Create custom post type
95
+ */
96
+ public function flow_post_type() {
97
+
98
+ $labels = array(
99
+ 'name' => esc_html_x( 'Flows', 'flow general name', 'cartflows' ),
100
+ 'singular_name' => esc_html_x( 'Flow', 'flow singular name', 'cartflows' ),
101
+ 'search_items' => esc_html__( 'Search Flows', 'cartflows' ),
102
+ 'all_items' => esc_html__( 'All Flows', 'cartflows' ),
103
+ 'edit_item' => esc_html__( 'Edit Flow', 'cartflows' ),
104
+ 'view_item' => esc_html__( 'View Flow', 'cartflows' ),
105
+ 'add_new' => esc_html__( 'Add New', 'cartflows' ),
106
+ 'update_item' => esc_html__( 'Update Flow', 'cartflows' ),
107
+ 'add_new_item' => esc_html__( 'Add New', 'cartflows' ),
108
+ 'new_item_name' => esc_html__( 'New Flow Name', 'cartflows' ),
109
+ );
110
+
111
+ $args = array(
112
+ 'labels' => $labels,
113
+ 'show_in_menu' => false,
114
+ 'public' => false, // it's not public, not own permalink.
115
+ 'publicly_queryable' => true, // you should be able to query it.
116
+ 'show_ui' => true,
117
+ 'query_var' => true,
118
+ 'can_export' => true,
119
+ 'show_in_admin_bar' => true,
120
+ 'exclude_from_search' => true,
121
+ 'has_archive' => false, // it shouldn't have archive page.
122
+ 'rewrite' => false, // it shouldn't have rewrite rules.
123
+ 'supports' => array( 'title', 'thumbnail', 'slug' ),
124
+ 'capability_type' => 'post',
125
+ );
126
+
127
+ if ( ! _is_cartflows_pro() ) {
128
+
129
+ $flow_posts = get_posts(
130
+ array(
131
+ 'posts_per_page' => 4,
132
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
133
+ 'post_status' => array( 'publish', 'pending', 'draft', 'future', 'private' ),
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
+ * Add flows submenu
315
+ *
316
+ * @since 1.0.0
317
+ */
318
+ public function register_as_submenu() {
319
+ add_submenu_page(
320
+ CARTFLOWS_SLUG,
321
+ __( 'Flows', 'cartflows' ),
322
+ __( 'Flows', 'cartflows' ),
323
+ 'edit_pages',
324
+ 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE
325
+ );
326
+ }
327
+
328
+ /**
329
+ * Add Update messages for any custom post type
330
+ *
331
+ * @param array $messages Array of default messages.
332
+ */
333
+ public function custom_post_type_post_update_messages( $messages ) {
334
+
335
+ $custom_post_type = get_post_type( get_the_ID() );
336
+
337
+ if ( CARTFLOWS_FLOW_POST_TYPE == $custom_post_type ) {
338
+
339
+ $obj = get_post_type_object( $custom_post_type );
340
+ $singular_name = $obj->labels->singular_name;
341
+ $messages[ $custom_post_type ] = array(
342
+ 0 => '', // Unused. Messages start at index 1.
343
+ /* translators: %s: singular custom post type name */
344
+ 1 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
345
+ /* translators: %s: singular custom post type name */
346
+ 2 => sprintf( __( 'Custom %s updated.', 'cartflows' ), $singular_name ),
347
+ /* translators: %s: singular custom post type name */
348
+ 3 => sprintf( __( 'Custom %s deleted.', 'cartflows' ), $singular_name ),
349
+ /* translators: %s: singular custom post type name */
350
+ 4 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
351
+ /* translators: %1$s: singular custom post type name ,%2$s: date and time of the revision */
352
+ 5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s', 'cartflows' ), $singular_name, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, //phpcs:ignore
353
+ /* translators: %s: singular custom post type name */
354
+ 6 => sprintf( __( '%s published.', 'cartflows' ), $singular_name ),
355
+ /* translators: %s: singular custom post type name */
356
+ 7 => sprintf( __( '%s saved.', 'cartflows' ), $singular_name ),
357
+ /* translators: %s: singular custom post type name */
358
+ 8 => sprintf( __( '%s submitted.', 'cartflows' ), $singular_name ),
359
+ /* translators: %s: singular custom post type name */
360
+ 9 => sprintf( __( '%s scheduled for.', 'cartflows' ), $singular_name ),
361
+ /* translators: %s: singular custom post type name */
362
+ 10 => sprintf( __( '%s draft updated.', 'cartflows' ), $singular_name ),
363
+ );
364
+ }
365
+
366
+ return $messages;
367
+ }
368
+ }
369
+
370
+ /**
371
+ * Kicking this off by calling 'get_instance()' method
372
+ */
373
+ Cartflows_Flow_Post_Type::get_instance();
modules/flow/view/meta-flow-steps.php CHANGED
@@ -1,158 +1,158 @@
1
- <?php
2
- /**
3
- * View Flow steps
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
9
-
10
- $steps = array(
11
- 'landing' => __( 'Landing', 'cartflows' ),
12
- 'checkout' => __( 'Checkout (Woo)', 'cartflows' ),
13
- 'thankyou' => __( 'Thank You (Woo)', 'cartflows' ),
14
- 'upsell' => __( 'Upsell (Woo)', 'cartflows' ),
15
- 'downsell' => __( 'Downsell (Woo)', 'cartflows' ),
16
- 'optin' => __( 'Optin (Woo)', 'cartflows' ),
17
- );
18
- ?>
19
- <div class="wcf-flow-steps-meta-box">
20
- <div class="wcf-flow-settings">
21
- <?php do_action( 'cartflows_above_flow_steps' ); ?>
22
- <div class="wcf-flow-steps-wrap">
23
- <div class="wcf-flow-steps-container">
24
- <?php if ( is_array( $options['steps'] ) ) { ?>
25
- <?php foreach ( $options['steps'] as $index => $data ) { ?>
26
- <?php
27
- $term_slug = '';
28
- $term_name = '';
29
- $step_wrap_class = '';
30
- $has_product_assigned = true;
31
- $is_global_checkout = '';
32
- $common = '';
33
- $data_step_id = intval( $data['id'] );
34
-
35
- $control_id = $data_step_id;
36
- $note = '';
37
- $ab_test = false;
38
- $ab_test_ui = false;
39
- $ab_test_variations = array();
40
- $ab_test_archived_variations = array();
41
- $ab_test_variations_count = 0;
42
- $ab_test_args = array();
43
-
44
- if ( _is_cartflows_pro() ) {
45
-
46
- $ab_test_ui = isset( $data['ab-test-ui'] ) && $data['ab-test-ui'] ? true : false;
47
- $ab_test = isset( $data['ab-test'] ) && $data['ab-test'] ? true : false;
48
- $ab_test_variations = isset( $data['ab-test-variations'] ) ? $data['ab-test-variations'] : array();
49
- $ab_test_archived_variations = isset( $data['ab-test-archived-variations'] ) ? $data['ab-test-archived-variations'] : array();
50
- $ab_test_variations_count = count( $ab_test_variations );
51
-
52
- if ( $ab_test_variations_count < 2 ) {
53
- $ab_test_ui = false;
54
- }
55
- }
56
-
57
- $ab_test_args = array(
58
- 'control_id' => $data_step_id,
59
- 'ab_test_variations' => $ab_test_variations,
60
- 'ab_test_archived_variations' => $ab_test_archived_variations,
61
- 'ab_test_variations_count' => $ab_test_variations_count,
62
- );
63
-
64
- if ( isset( $data['type'] ) ) {
65
- $term_slug = $data['type'];
66
- $term_name = $steps[ $data['type'] ];
67
- }
68
-
69
- if ( ! _is_cartflows_pro() && ( 'upsell' === $term_slug || 'downsell' === $term_slug ) ) {
70
- $step_wrap_class .= ' invalid-step';
71
- }
72
-
73
- if ( isset( $_GET['highlight-step-id'] ) ) { //phpcs:ignore
74
-
75
- $highlight_step_id = intval( $_GET['highlight-step-id'] ); //phpcs:ignore
76
-
77
- if ( $highlight_step_id === $data_step_id ) {
78
- $step_wrap_class .= ' wcf-new-step-highlight';
79
- }
80
- }
81
-
82
- if ( 'checkout' === $term_slug ) {
83
-
84
- $common = Cartflows_Helper::get_common_settings();
85
-
86
- $is_global_checkout = (int) $common['global_checkout'];
87
-
88
- if ( $data['id'] === $is_global_checkout ) {
89
- $step_wrap_class .= ' wcf-global-checkout';
90
- }
91
- }
92
-
93
- if ( 'upsell' === $term_slug || 'downsell' === $term_slug || 'checkout' === $term_slug ) {
94
-
95
- $has_product_assigned = Cartflows_Helper::has_product_assigned( $data['id'] );
96
-
97
- if ( ( ! $has_product_assigned ) && ( $data['id'] != $is_global_checkout ) ) {
98
- $step_wrap_class .= ' wcf-no-product-step';
99
- }
100
- }
101
-
102
- if ( $ab_test_ui ) {
103
- $step_wrap_class .= apply_filters( 'cartflows_ab_test_step_wrap_class', ' wcf-ab-test' );
104
- }
105
-
106
- ?>
107
- <div class="wcf-step-wrap <?php echo $step_wrap_class; ?>" data-id="<?php echo $data['id']; ?>" data-term-slug="<?php echo esc_attr( $term_slug ); ?>">
108
- <?php
109
- do_action( 'cartflows_wcf_step_wrap_top', $data, $ab_test_ui, $ab_test, $ab_test_args );
110
- ?>
111
- <?php
112
-
113
- if ( $ab_test_ui && is_array( $ab_test_variations ) && ! empty( $ab_test_variations ) ) {
114
-
115
- $var_badge_count = 0;
116
-
117
- foreach ( $ab_test_variations as $ab_test_variation ) {
118
-
119
- $inner_step_id = $ab_test_variation['id'];
120
- $action_buttons = $this->get_step_action_buttons( $inner_step_id, $ab_test_ui, $ab_test_args );
121
-
122
- include CARTFLOWS_FLOW_DIR . 'view/view-flow-inner-step.php';
123
- }
124
- } else {
125
-
126
- $inner_step_id = $data['id'];
127
- $action_buttons = $this->get_step_action_buttons( $inner_step_id, $ab_test_ui, $ab_test_args );
128
-
129
- include CARTFLOWS_FLOW_DIR . 'view/view-flow-inner-step.php';
130
- }
131
-
132
- do_action( 'cartflows_wcf_step_wrap_bottom', $data, $ab_test_ui, $ab_test, $ab_test_args );
133
-
134
-
135
- ?>
136
- </div><!-- .wcf-step-wrap -->
137
- <?php } ?>
138
- <?php } ?>
139
- </div><!-- .wcf-flow-steps-container -->
140
- </div> <!-- .wcf-flow-steps-wrap -->
141
- <div class="wcf-flow-buttons-wrap"> <!-- .wcf-flow-buttons-wrap -->
142
- <?php do_action( 'cartflows_below_flow_steps' ); ?>
143
- <div class='wcf-add-new-step-btn-wrap'>
144
- <button class='wcf-trigger-popup button button-primary'>
145
- <?php echo esc_html__( 'Add New Step', 'cartflows' ); ?>
146
- </button>
147
- </div>
148
- </div><!-- .wcf-flow-buttons-wrap -->
149
- </div><!-- .wcf-flow-settings -->
150
-
151
- <?php
152
-
153
- require CARTFLOWS_FLOW_DIR . 'view/view-remote-importer.php';
154
-
155
- do_action( 'cartflows_after_flow_settings_meta', $data );
156
- ?>
157
- </div>
158
- <?php
1
+ <?php
2
+ /**
3
+ * View Flow steps
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
9
+
10
+ $steps = array(
11
+ 'landing' => __( 'Landing', 'cartflows' ),
12
+ 'checkout' => __( 'Checkout (Woo)', 'cartflows' ),
13
+ 'thankyou' => __( 'Thank You (Woo)', 'cartflows' ),
14
+ 'upsell' => __( 'Upsell (Woo)', 'cartflows' ),
15
+ 'downsell' => __( 'Downsell (Woo)', 'cartflows' ),
16
+ 'optin' => __( 'Optin (Woo)', 'cartflows' ),
17
+ );
18
+ ?>
19
+ <div class="wcf-flow-steps-meta-box">
20
+ <div class="wcf-flow-settings">
21
+ <?php do_action( 'cartflows_above_flow_steps' ); ?>
22
+ <div class="wcf-flow-steps-wrap">
23
+ <div class="wcf-flow-steps-container">
24
+ <?php if ( is_array( $options['steps'] ) ) { ?>
25
+ <?php foreach ( $options['steps'] as $index => $data ) { ?>
26
+ <?php
27
+ $term_slug = '';
28
+ $term_name = '';
29
+ $step_wrap_class = '';
30
+ $has_product_assigned = true;
31
+ $is_global_checkout = '';
32
+ $common = '';
33
+ $data_step_id = intval( $data['id'] );
34
+
35
+ $control_id = $data_step_id;
36
+ $note = '';
37
+ $ab_test = false;
38
+ $ab_test_ui = false;
39
+ $ab_test_variations = array();
40
+ $ab_test_archived_variations = array();
41
+ $ab_test_variations_count = 0;
42
+ $ab_test_args = array();
43
+
44
+ if ( _is_cartflows_pro() ) {
45
+
46
+ $ab_test_ui = isset( $data['ab-test-ui'] ) && $data['ab-test-ui'] ? true : false;
47
+ $ab_test = isset( $data['ab-test'] ) && $data['ab-test'] ? true : false;
48
+ $ab_test_variations = isset( $data['ab-test-variations'] ) ? $data['ab-test-variations'] : array();
49
+ $ab_test_archived_variations = isset( $data['ab-test-archived-variations'] ) ? $data['ab-test-archived-variations'] : array();
50
+ $ab_test_variations_count = count( $ab_test_variations );
51
+
52
+ if ( $ab_test_variations_count < 2 ) {
53
+ $ab_test_ui = false;
54
+ }
55
+ }
56
+
57
+ $ab_test_args = array(
58
+ 'control_id' => $data_step_id,
59
+ 'ab_test_variations' => $ab_test_variations,
60
+ 'ab_test_archived_variations' => $ab_test_archived_variations,
61
+ 'ab_test_variations_count' => $ab_test_variations_count,
62
+ );
63
+
64
+ if ( isset( $data['type'] ) ) {
65
+ $term_slug = $data['type'];
66
+ $term_name = $steps[ $data['type'] ];
67
+ }
68
+
69
+ if ( ! _is_cartflows_pro() && ( 'upsell' === $term_slug || 'downsell' === $term_slug ) ) {
70
+ $step_wrap_class .= ' invalid-step';
71
+ }
72
+
73
+ if ( isset( $_GET['highlight-step-id'] ) ) { //phpcs:ignore
74
+
75
+ $highlight_step_id = intval( $_GET['highlight-step-id'] ); //phpcs:ignore
76
+
77
+ if ( $highlight_step_id === $data_step_id ) {
78
+ $step_wrap_class .= ' wcf-new-step-highlight';
79
+ }
80
+ }
81
+
82
+ if ( 'checkout' === $term_slug ) {
83
+
84
+ $common = Cartflows_Helper::get_common_settings();
85
+
86
+ $is_global_checkout = (int) $common['global_checkout'];
87
+
88
+ if ( $data['id'] === $is_global_checkout ) {
89
+ $step_wrap_class .= ' wcf-global-checkout';
90
+ }
91
+ }
92
+
93
+ if ( 'upsell' === $term_slug || 'downsell' === $term_slug || 'checkout' === $term_slug ) {
94
+
95
+ $has_product_assigned = Cartflows_Helper::has_product_assigned( $data['id'] );
96
+
97
+ if ( ( ! $has_product_assigned ) && ( $data['id'] != $is_global_checkout ) ) {
98
+ $step_wrap_class .= ' wcf-no-product-step';
99
+ }
100
+ }
101
+
102
+ if ( $ab_test_ui ) {
103
+ $step_wrap_class .= apply_filters( 'cartflows_ab_test_step_wrap_class', ' wcf-ab-test' );
104
+ }
105
+
106
+ ?>
107
+ <div class="wcf-step-wrap <?php echo $step_wrap_class; ?>" data-id="<?php echo $data['id']; ?>" data-term-slug="<?php echo esc_attr( $term_slug ); ?>">
108
+ <?php
109
+ do_action( 'cartflows_wcf_step_wrap_top', $data, $ab_test_ui, $ab_test, $ab_test_args );
110
+ ?>
111
+ <?php
112
+
113
+ if ( $ab_test_ui && is_array( $ab_test_variations ) && ! empty( $ab_test_variations ) ) {
114
+
115
+ $var_badge_count = 0;
116
+
117
+ foreach ( $ab_test_variations as $ab_test_variation ) {
118
+
119
+ $inner_step_id = $ab_test_variation['id'];
120
+ $action_buttons = $this->get_step_action_buttons( $inner_step_id, $ab_test_ui, $ab_test_args );
121
+
122
+ include CARTFLOWS_FLOW_DIR . 'view/view-flow-inner-step.php';
123
+ }
124
+ } else {
125
+
126
+ $inner_step_id = $data['id'];
127
+ $action_buttons = $this->get_step_action_buttons( $inner_step_id, $ab_test_ui, $ab_test_args );
128
+
129
+ include CARTFLOWS_FLOW_DIR . 'view/view-flow-inner-step.php';
130
+ }
131
+
132
+ do_action( 'cartflows_wcf_step_wrap_bottom', $data, $ab_test_ui, $ab_test, $ab_test_args );
133
+
134
+
135
+ ?>
136
+ </div><!-- .wcf-step-wrap -->
137
+ <?php } ?>
138
+ <?php } ?>
139
+ </div><!-- .wcf-flow-steps-container -->
140
+ </div> <!-- .wcf-flow-steps-wrap -->
141
+ <div class="wcf-flow-buttons-wrap"> <!-- .wcf-flow-buttons-wrap -->
142
+ <?php do_action( 'cartflows_below_flow_steps' ); ?>
143
+ <div class='wcf-add-new-step-btn-wrap'>
144
+ <button class='wcf-trigger-popup button button-primary'>
145
+ <?php echo esc_html__( 'Add New Step', 'cartflows' ); ?>
146
+ </button>
147
+ </div>
148
+ </div><!-- .wcf-flow-buttons-wrap -->
149
+ </div><!-- .wcf-flow-settings -->
150
+
151
+ <?php
152
+
153
+ require CARTFLOWS_FLOW_DIR . 'view/view-remote-importer.php';
154
+
155
+ do_action( 'cartflows_after_flow_settings_meta', $data );
156
+ ?>
157
+ </div>
158
+ <?php
modules/flow/view/view-remote-importer.php CHANGED
@@ -1,78 +1,78 @@
1
- <?php
2
- /**
3
- * View Remote importer popup
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- ?>
9
- <div id="wcf-remote-step-importer" class="wcf-templates-popup-overlay">
10
- <div class="wcf-templates-popup-content">
11
- <div class="spinner"></div>
12
- <div class="wcf-templates-wrap wcf-templates-wrap-flows">
13
-
14
- <div id="wcf-remote-step-actions" class="wcf-template-header">
15
- <div class="wcf-template-logo-wrap">
16
- <span class="wcf-cartflows-logo-img">
17
- <span class="cartflows-logo-icon"></span>
18
- </span>
19
- <span class="wcf-cartflows-title"><?php esc_html_e( 'Steps Library', 'cartflows' ); ?></span>
20
- </div>
21
- <div class="wcf-tab-wrapper">
22
- <?php if ( 'other' !== $default_page_builder ) { ?>
23
- <div id="wcf-get-started-steps">
24
- <ul class="filter-links ">
25
- <li>
26
- <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>
27
- </li>
28
- <li>
29
- <a href="#" data-slug="canvas" data-title="<?php esc_html_e( 'Create Your Own', 'cartflows' ); ?>"><?php esc_html_e( 'Create Your Own', 'cartflows' ); ?></a>
30
- </li>
31
- </ul>
32
- </div>
33
- <?php } ?>
34
- </div>
35
- <div class="wcf-popup-close-wrap">
36
- <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
37
- </div>
38
- </div>
39
-
40
- <!--<div class="wcf-search-form">
41
- <label class="screen-reader-text" for="wp-filter-search-input"><?php esc_html_e( 'Search Sites', 'cartflows' ); ?> </label>
42
- <input placeholder="<?php esc_html_e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
43
- </div>-->
44
-
45
- <div id="wcf-remote-content">
46
- <?php if ( 'other' !== $default_page_builder ) { ?>
47
- <div id="wcf-ready-templates">
48
- <div id="wcf-remote-filters">
49
- <div id="wcf-page-builders"></div>
50
- <div id="wcf-categories"></div>
51
- </div>
52
- <div class="wcf-page-builder-notice"></div>
53
- <div id="wcf-remote-step-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
54
- <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
55
- </div>
56
- <?php } ?>
57
- <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
58
- <div class="inner">
59
- <div id="wcf-scratch-steps-categories">
60
- <select class="step-type-filter-links filter-links">
61
- <option value="" class="current"> Select Step Type </option>
62
-
63
- <?php foreach ( $steps as $key => $value ) { ?>
64
- <option class="<?php echo $key; ?>" data-slug="<?php echo $key; ?>" data-title="<?php echo $key; ?>"><?php echo $value; ?></option>
65
- <?php } ?>
66
- </select>
67
- </div>
68
- <a href="#" class="button button-primary cartflows-step-import-blank"><?php esc_html_e( 'Create Step', 'cartflows' ); ?></a>
69
- <?php if ( ! _is_cartflows_pro() ) { ?>
70
- <div class="wcf-template-notice"><p><?php echo esc_html__( 'You need a Cartflows Pro version to import Upsell / Downsell', 'cartflows' ); ?></p></div>
71
- <?php } ?>
72
- <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>
73
- </div>
74
- </div>
75
- </div>
76
- </div>
77
- </div>
78
- </div><!-- .wcf-templates-popup-overlay -->
1
+ <?php
2
+ /**
3
+ * View Remote importer popup
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ ?>
9
+ <div id="wcf-remote-step-importer" class="wcf-templates-popup-overlay">
10
+ <div class="wcf-templates-popup-content">
11
+ <div class="spinner"></div>
12
+ <div class="wcf-templates-wrap wcf-templates-wrap-flows">
13
+
14
+ <div id="wcf-remote-step-actions" class="wcf-template-header">
15
+ <div class="wcf-template-logo-wrap">
16
+ <span class="wcf-cartflows-logo-img">
17
+ <span class="cartflows-logo-icon"></span>
18
+ </span>
19
+ <span class="wcf-cartflows-title"><?php esc_html_e( 'Steps Library', 'cartflows' ); ?></span>
20
+ </div>
21
+ <div class="wcf-tab-wrapper">
22
+ <?php if ( 'other' !== $default_page_builder ) { ?>
23
+ <div id="wcf-get-started-steps">
24
+ <ul class="filter-links ">
25
+ <li>
26
+ <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>
27
+ </li>
28
+ <li>
29
+ <a href="#" data-slug="canvas" data-title="<?php esc_html_e( 'Create Your Own', 'cartflows' ); ?>"><?php esc_html_e( 'Create Your Own', 'cartflows' ); ?></a>
30
+ </li>
31
+ </ul>
32
+ </div>
33
+ <?php } ?>
34
+ </div>
35
+ <div class="wcf-popup-close-wrap">
36
+ <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
37
+ </div>
38
+ </div>
39
+
40
+ <!--<div class="wcf-search-form">
41
+ <label class="screen-reader-text" for="wp-filter-search-input"><?php esc_html_e( 'Search Sites', 'cartflows' ); ?> </label>
42
+ <input placeholder="<?php esc_html_e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
43
+ </div>-->
44
+
45
+ <div id="wcf-remote-content">
46
+ <?php if ( 'other' !== $default_page_builder ) { ?>
47
+ <div id="wcf-ready-templates">
48
+ <div id="wcf-remote-filters">
49
+ <div id="wcf-page-builders"></div>
50
+ <div id="wcf-categories"></div>
51
+ </div>
52
+ <div class="wcf-page-builder-notice"></div>
53
+ <div id="wcf-remote-step-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
54
+ <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
55
+ </div>
56
+ <?php } ?>
57
+ <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
58
+ <div class="inner">
59
+ <div id="wcf-scratch-steps-categories">
60
+ <select class="step-type-filter-links filter-links">
61
+ <option value="" class="current"> Select Step Type </option>
62
+
63
+ <?php foreach ( $steps as $key => $value ) { ?>
64
+ <option class="<?php echo $key; ?>" data-slug="<?php echo $key; ?>" data-title="<?php echo $key; ?>"><?php echo $value; ?></option>
65
+ <?php } ?>
66
+ </select>
67
+ </div>
68
+ <a href="#" class="button button-primary cartflows-step-import-blank"><?php esc_html_e( 'Create Step', 'cartflows' ); ?></a>
69
+ <?php if ( ! _is_cartflows_pro() ) { ?>
70
+ <div class="wcf-template-notice"><p><?php echo esc_html__( 'You need a Cartflows Pro version to import Upsell / Downsell', 'cartflows' ); ?></p></div>
71
+ <?php } ?>
72
+ <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>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </div><!-- .wcf-templates-popup-overlay -->
modules/landing/classes/class-cartflows-landing-markup.php CHANGED
@@ -1,147 +1,147 @@
1
- <?php
2
- /**
3
- * Markup
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Checkout Markup
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Landing_Markup {
14
-
15
-
16
- /**
17
- * Member Variable
18
- *
19
- * @var object instance
20
- */
21
- private static $instance;
22
-
23
- /**
24
- * Initiator
25
- */
26
- public static function get_instance() {
27
- if ( ! isset( self::$instance ) ) {
28
- self::$instance = new self();
29
- }
30
- return self::$instance;
31
- }
32
-
33
- /**
34
- * Constructor
35
- */
36
- public function __construct() {
37
-
38
- add_action( 'pre_get_posts', array( $this, 'wcf_pre_get_posts' ) );
39
- add_action( 'template_redirect', array( $this, 'template_redirect' ) );
40
-
41
- if ( is_admin() ) {
42
- add_filter( 'wp_dropdown_pages', array( $this, 'wp_dropdown_pages' ) );
43
- }
44
- }
45
-
46
- /**
47
- * Add landing pages in WordPress reading section.
48
- *
49
- * @param array $output output.
50
- */
51
- public function wp_dropdown_pages( $output ) {
52
-
53
- global $pagenow;
54
-
55
- if ( ( 'options-reading.php' === $pagenow || 'customize.php' === $pagenow ) && preg_match( '#page_on_front#', $output ) ) {
56
-
57
- $args = array(
58
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
59
- 'numberposts' => 100,
60
- 'meta_query' => array( //phpcs:ignore
61
- 'relation' => 'OR',
62
- array(
63
- 'key' => 'wcf-step-type',
64
- 'value' => 'landing',
65
- ),
66
- array(
67
- 'key' => 'wcf-step-type',
68
- 'value' => 'checkout',
69
- ),
70
- array(
71
- 'key' => 'wcf-step-type',
72
- 'value' => 'optin',
73
- ),
74
- ),
75
- );
76
-
77
- $landing_pages = get_posts( $args );
78
-
79
- if ( is_array( $landing_pages ) && ! empty( $landing_pages ) ) {
80
-
81
- $cartflows_custom_option = '';
82
-
83
- $front_page_id = get_option( 'page_on_front' );
84
-
85
- foreach ( $landing_pages as $key => $landing_page ) {
86
-
87
- $selected = selected( $front_page_id, $landing_page->ID, false );
88
-
89
- $cartflows_custom_option .= "<option value=\"{$landing_page->ID}\"{$selected}>{$landing_page->post_title} ( #{$landing_page->ID} - CartFlows )</option>";
90
- }
91
-
92
- $cartflows_custom_option .= '</select>';
93
-
94
- $output = str_replace( '</select>', $cartflows_custom_option, $output );
95
- }
96
- }
97
-
98
- return $output;
99
- }
100
-
101
- /**
102
- * Set post query.
103
- *
104
- * @param string $query post query.
105
- */
106
- public function wcf_pre_get_posts( $query ) {
107
-
108
- if ( $query->is_main_query() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
109
-
110
- $post_type = $query->get( 'post_type' );
111
-
112
- $page_id = $query->get( 'page_id' );
113
-
114
- if ( empty( $post_type ) && ! empty( $page_id ) ) {
115
- $query->set( 'post_type', get_post_type( $page_id ) );
116
- }
117
- }
118
- }
119
-
120
- /**
121
- * Redirect to homepage if landing page set as home page.
122
- */
123
- public function template_redirect() {
124
-
125
- if ( ! wcf()->utils->is_step_post_type() ) {
126
- return;
127
- }
128
-
129
- $compatibiliy = Cartflows_Compatibility::get_instance();
130
-
131
- // Do not redirect for page builder preview.
132
- if ( $compatibiliy->is_page_builder_preview() ) {
133
- return;
134
- }
135
-
136
- global $post;
137
-
138
- if ( is_singular() && ! is_front_page() && get_option( 'page_on_front' ) == $post->ID ) {
139
- wp_safe_redirect( site_url(), 301 );
140
- }
141
- }
142
- }
143
-
144
- /**
145
- * Kicking this off by calling 'get_instance()' method
146
- */
147
- Cartflows_Landing_Markup::get_instance();
1
+ <?php
2
+ /**
3
+ * Markup
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Checkout Markup
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Landing_Markup {
14
+
15
+
16
+ /**
17
+ * Member Variable
18
+ *
19
+ * @var object instance
20
+ */
21
+ private static $instance;
22
+
23
+ /**
24
+ * Initiator
25
+ */
26
+ public static function get_instance() {
27
+ if ( ! isset( self::$instance ) ) {
28
+ self::$instance = new self();
29
+ }
30
+ return self::$instance;
31
+ }
32
+
33
+ /**
34
+ * Constructor
35
+ */
36
+ public function __construct() {
37
+
38
+ add_action( 'pre_get_posts', array( $this, 'wcf_pre_get_posts' ) );
39
+ add_action( 'template_redirect', array( $this, 'template_redirect' ) );
40
+
41
+ if ( is_admin() ) {
42
+ add_filter( 'wp_dropdown_pages', array( $this, 'wp_dropdown_pages' ) );
43
+ }
44
+ }
45
+
46
+ /**
47
+ * Add landing pages in WordPress reading section.
48
+ *
49
+ * @param array $output output.
50
+ */
51
+ public function wp_dropdown_pages( $output ) {
52
+
53
+ global $pagenow;
54
+
55
+ if ( ( 'options-reading.php' === $pagenow || 'customize.php' === $pagenow ) && preg_match( '#page_on_front#', $output ) ) {
56
+
57
+ $args = array(
58
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
59
+ 'numberposts' => 100,
60
+ 'meta_query' => array( //phpcs:ignore
61
+ 'relation' => 'OR',
62
+ array(
63
+ 'key' => 'wcf-step-type',
64
+ 'value' => 'landing',
65
+ ),
66
+ array(
67
+ 'key' => 'wcf-step-type',
68
+ 'value' => 'checkout',
69
+ ),
70
+ array(
71
+ 'key' => 'wcf-step-type',
72
+ 'value' => 'optin',
73
+ ),
74
+ ),
75
+ );
76
+
77
+ $landing_pages = get_posts( $args );
78
+
79
+ if ( is_array( $landing_pages ) && ! empty( $landing_pages ) ) {
80
+
81
+ $cartflows_custom_option = '';
82
+
83
+ $front_page_id = get_option( 'page_on_front' );
84
+
85
+ foreach ( $landing_pages as $key => $landing_page ) {
86
+
87
+ $selected = selected( $front_page_id, $landing_page->ID, false );
88
+
89
+ $cartflows_custom_option .= "<option value=\"{$landing_page->ID}\"{$selected}>{$landing_page->post_title} ( #{$landing_page->ID} - CartFlows )</option>";
90
+ }
91
+
92
+ $cartflows_custom_option .= '</select>';
93
+
94
+ $output = str_replace( '</select>', $cartflows_custom_option, $output );
95
+ }
96
+ }
97
+
98
+ return $output;
99
+ }
100
+
101
+ /**
102
+ * Set post query.
103
+ *
104
+ * @param string $query post query.
105
+ */
106
+ public function wcf_pre_get_posts( $query ) {
107
+
108
+ if ( $query->is_main_query() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
109
+
110
+ $post_type = $query->get( 'post_type' );
111
+
112
+ $page_id = $query->get( 'page_id' );
113
+
114
+ if ( empty( $post_type ) && ! empty( $page_id ) ) {
115
+ $query->set( 'post_type', get_post_type( $page_id ) );
116
+ }
117
+ }
118
+ }
119
+
120
+ /**
121
+ * Redirect to homepage if landing page set as home page.
122
+ */
123
+ public function template_redirect() {
124
+
125
+ if ( ! wcf()->utils->is_step_post_type() ) {
126
+ return;
127
+ }
128
+
129
+ $compatibiliy = Cartflows_Compatibility::get_instance();
130
+
131
+ // Do not redirect for page builder preview.
132
+ if ( $compatibiliy->is_page_builder_preview() ) {
133
+ return;
134
+ }
135
+
136
+ global $post;
137
+
138
+ if ( is_singular() && ! is_front_page() && get_option( 'page_on_front' ) == $post->ID ) {
139
+ wp_safe_redirect( site_url(), 301 );
140
+ }
141
+ }
142
+ }
143
+
144
+ /**
145
+ * Kicking this off by calling 'get_instance()' method
146
+ */
147
+ Cartflows_Landing_Markup::get_instance();
modules/optin/classes/class-cartflows-optin-markup.php CHANGED
@@ -65,6 +65,8 @@ class Cartflows_Optin_Markup {
65
  add_action( 'init', array( $this, 'remove_woo_actions' ) );
66
 
67
  $this->elementor_editor_compatibility();
 
 
68
  }
69
 
70
  /**
@@ -72,7 +74,30 @@ class Cartflows_Optin_Markup {
72
  */
73
  public function elementor_editor_compatibility() {
65
  add_action( 'init', array( $this, 'remove_woo_actions' ) );
66
 
67
  $this->elementor_editor_compatibility();
68
+ $this->bb_editor_compatibility();
69
+
70
  }
71
 
72
  /**
74
  */
75
  public function elementor_editor_compatibility() {