Version Description
Download this release
Release Info
Developer | sandesh055 |
Plugin | Funnel Builder by CartFlows – Create High Converting Sales Funnels For WordPress |
Version | 1.5.20 |
Comparing to | |
See all releases |
Code changes from version 1.5.19 to 1.5.20
- admin/bsf-analytics/class-bsf-analytics-loader.php +118 -118
- admin/bsf-analytics/class-bsf-analytics.php +503 -503
- cartflows.php +2 -2
- changelog.txt +3 -0
- classes/class-cartflows-admin-fields.php +277 -277
- classes/class-cartflows-admin.php +750 -750
- classes/class-cartflows-cloning.php +469 -469
- classes/class-cartflows-default-meta.php +855 -855
- classes/class-cartflows-flow-frontend.php +214 -214
- classes/class-cartflows-frontend.php +682 -682
- classes/class-cartflows-functions.php +8 -2
- classes/class-cartflows-helper.php +815 -815
- classes/class-cartflows-importer.php +0 -2
- classes/class-cartflows-loader.php +3 -1
- classes/class-cartflows-logger.php +183 -183
- classes/class-cartflows-meta-fields.php +1046 -1046
- classes/class-cartflows-stats.php +87 -87
- classes/class-cartflows-step-factory.php +250 -250
- classes/class-cartflows-update.php +146 -146
- classes/class-cartflows-utils.php +26 -1
- classes/class-cartflows-wizard.php +751 -751
- classes/class-cartflows-woo-hooks.php +81 -81
- includes/admin/cartflows-admin-header.php +21 -21
- includes/admin/cartflows-admin.php +35 -35
- includes/admin/cartflows-general.php +507 -507
- includes/admin/cartflows-home.php +92 -92
- includes/meta-fields/generate-product-repeater.php +99 -99
- languages/cartflows.pot +3070 -3056
- modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php +2 -2
- modules/beaver-builder/cartflows-bb-checkout-form/includes/frontend.css.php +4 -4
- modules/beaver-builder/cartflows-bb-checkout-form/includes/frontend.php +21 -21
- modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php +17 -1
- modules/beaver-builder/cartflows-bb-next-step/includes/frontend.css.php +22 -0
- modules/beaver-builder/cartflows-bb-next-step/includes/frontend.php +55 -55
- modules/beaver-builder/cartflows-bb-optin-form/includes/frontend.css.php +125 -125
- modules/beaver-builder/cartflows-bb-optin-form/includes/frontend.php +18 -18
- modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php +10 -8
- modules/beaver-builder/cartflows-bb-order-details/includes/frontend.css.php +9 -5
- modules/beaver-builder/cartflows-bb-order-details/includes/frontend.php +22 -22
- modules/beaver-builder/class-cartflows-bb-modules-loader.php +108 -108
- modules/beaver-builder/classes/class-cartflows-bb-editor.php +69 -69
- modules/beaver-builder/classes/class-cartflows-bb-helper.php +151 -151
- modules/checkout/classes/class-cartflows-checkout-markup.php +45 -19
- modules/checkout/classes/class-cartflows-checkout-meta.php +619 -619
- modules/checkout/includes/meta-views/design-checkout-metabox-markup.php +52 -52
- modules/checkout/includes/meta-views/design-checkout-style-tab.php +347 -347
- modules/checkout/templates/embed/checkout-template-simple.php +0 -2
- modules/elementor/classes/class-cartflows-elementor-editor.php +112 -112
- modules/elementor/widgets/class-cartflows-el-checkout-form.php +3 -3
- modules/elementor/widgets/class-cartflows-el-next-step-button.php +21 -2
- modules/elementor/widgets/index.php +3 -3
- modules/flow/classes/class-cartflows-flow-meta.php +866 -866
- modules/flow/classes/class-cartflows-flow-post-type.php +373 -373
- modules/flow/classes/class-cartflows-permalink.php +165 -158
- modules/flow/view/meta-flow-steps.php +158 -158
- modules/flow/view/view-flow-inner-step.php +129 -129
- modules/flow/view/view-remote-importer.php +78 -78
- modules/gutenberg/assets/css/blocks/checkout-form.css +1 -0
- modules/gutenberg/assets/css/blocks/next-step-button.css +1 -0
- modules/gutenberg/assets/css/blocks/optin-form.css +1 -0
- modules/gutenberg/assets/css/blocks/order-detail-form.css +1 -0
- modules/gutenberg/classes/class-cartflows-block-config.php +528 -0
- modules/gutenberg/classes/class-cartflows-block-helper.php +672 -0
- modules/gutenberg/classes/class-cartflows-block-js.php +170 -0
- modules/gutenberg/classes/class-cartflows-block-loader.php +67 -0
- modules/gutenberg/classes/class-cartflows-gb-helper.php +661 -0
- modules/gutenberg/classes/class-cartflows-gutenberg-editor.php +129 -0
- modules/gutenberg/classes/class-cartflows-init-blocks.php +339 -0
- modules/gutenberg/dist/blocks.build.js +1 -0
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 |
+
}
|
admin/bsf-analytics/class-bsf-analytics.php
CHANGED
@@ -1,503 +1,503 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* BSF analytics class file.
|
4 |
-
*
|
5 |
-
* @version 1.0.0
|
6 |
-
*
|
7 |
-
* @package bsf-analytics
|
8 |
-
*/
|
9 |
-
|
10 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
-
exit; // Exit if accessed directly.
|
12 |
-
}
|
13 |
-
|
14 |
-
if ( ! class_exists( 'BSF_Analytics' ) ) {
|
15 |
-
|
16 |
-
/**
|
17 |
-
* BSF analytics
|
18 |
-
*/
|
19 |
-
class BSF_Analytics {
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Member Variable
|
23 |
-
*
|
24 |
-
* @var array Entities data.
|
25 |
-
*/
|
26 |
-
private $entities;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Member Variable
|
30 |
-
*
|
31 |
-
* @var string Usage tracking document URL
|
32 |
-
*/
|
33 |
-
public $usage_doc_link = 'https://store.brainstormforce.com/usage-tracking/?utm_source=wp_dashboard&utm_medium=general_settings&utm_campaign=usage_tracking';
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Setup actions, load files.
|
37 |
-
*
|
38 |
-
* @param array $args entity data for analytics.
|
39 |
-
* @param string $analytics_path directory path to analytics library.
|
40 |
-
* @param float $analytics_version analytics library version.
|
41 |
-
* @since 1.0.0
|
42 |
-
*/
|
43 |
-
public function __construct( $args, $analytics_path, $analytics_version ) {
|
44 |
-
|
45 |
-
// Bail when no analytics entities are registered.
|
46 |
-
if ( empty( $args ) ) {
|
47 |
-
return;
|
48 |
-
}
|
49 |
-
|
50 |
-
$this->entities = $args;
|
51 |
-
|
52 |
-
define( 'BSF_ANALYTICS_VERSION', $analytics_version );
|
53 |
-
define( 'BSF_ANALYTICS_URI', $this->get_analytics_url( $analytics_path ) );
|
54 |
-
|
55 |
-
add_action( 'admin_init', array( $this, 'handle_optin_optout' ) );
|
56 |
-
add_action( 'admin_notices', array( $this, 'option_notice' ) );
|
57 |
-
add_action( 'init', array( $this, 'maybe_track_analytics' ), 99 );
|
58 |
-
|
59 |
-
$this->set_actions();
|
60 |
-
|
61 |
-
add_action( 'admin_init', array( $this, 'register_usage_tracking_setting' ) );
|
62 |
-
|
63 |
-
$this->includes();
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Setup actions for admin notice style and analytics cron event.
|
68 |
-
*
|
69 |
-
* @since 1.0.4
|
70 |
-
*/
|
71 |
-
public function set_actions() {
|
72 |
-
|
73 |
-
foreach ( $this->entities as $key => $data ) {
|
74 |
-
add_action( 'astra_notice_before_markup_' . $key . '-optin-notice', array( $this, 'enqueue_assets' ) );
|
75 |
-
add_action( 'update_option_' . $key . '_analytics_optin', array( $this, 'update_analytics_option_callback' ), 10, 3 );
|
76 |
-
add_action( 'add_option_' . $key . '_analytics_optin', array( $this, 'add_analytics_option_callback' ), 10, 2 );
|
77 |
-
}
|
78 |
-
}
|
79 |
-
|
80 |
-
/**
|
81 |
-
* BSF Analytics URL
|
82 |
-
*
|
83 |
-
* @param string $analytics_path directory path to analytics library.
|
84 |
-
* @return String URL of bsf-analytics directory.
|
85 |
-
* @since 1.0.0
|
86 |
-
*/
|
87 |
-
public function get_analytics_url( $analytics_path ) {
|
88 |
-
return str_replace( WP_CONTENT_DIR, content_url(), $analytics_path );
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Get API URL for sending analytics.
|
93 |
-
*
|
94 |
-
* @return string API URL.
|
95 |
-
* @since 1.0.0
|
96 |
-
*/
|
97 |
-
private function get_api_url() {
|
98 |
-
return defined( 'BSF_API_URL' ) ? BSF_API_URL : 'https://support.brainstormforce.com/';
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Enqueue Scripts.
|
103 |
-
*
|
104 |
-
* @since 1.0.0
|
105 |
-
* @return void
|
106 |
-
*/
|
107 |
-
public function enqueue_assets() {
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Load unminified if SCRIPT_DEBUG is true.
|
111 |
-
*
|
112 |
-
* Directory and Extensions.
|
113 |
-
*/
|
114 |
-
$dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
|
115 |
-
$file_rtl = ( is_rtl() ) ? '-rtl' : '';
|
116 |
-
$css_ext = ( SCRIPT_DEBUG ) ? '.css' : '.min.css';
|
117 |
-
|
118 |
-
$css_uri = BSF_ANALYTICS_URI . '/assets/css/' . $dir_name . '/style' . $file_rtl . $css_ext;
|
119 |
-
|
120 |
-
wp_enqueue_style( 'bsf-analytics-admin-style', $css_uri, false, BSF_ANALYTICS_VERSION, 'all' );
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
* Send analytics API call.
|
125 |
-
*
|
126 |
-
* @since 1.0.0
|
127 |
-
*/
|
128 |
-
public function send() {
|
129 |
-
wp_remote_post(
|
130 |
-
$this->get_api_url() . 'wp-json/bsf-core/v1/analytics/',
|
131 |
-
array(
|
132 |
-
'body' => BSF_Analytics_Stats::instance()->get_stats(),
|
133 |
-
'timeout' => 5,
|
134 |
-
'blocking' => false,
|
135 |
-
)
|
136 |
-
);
|
137 |
-
}
|
138 |
-
|
139 |
-
/**
|
140 |
-
* Check if usage tracking is enabled.
|
141 |
-
*
|
142 |
-
* @return bool
|
143 |
-
* @since 1.0.0
|
144 |
-
*/
|
145 |
-
public function is_tracking_enabled() {
|
146 |
-
|
147 |
-
foreach ( $this->entities as $key => $data ) {
|
148 |
-
|
149 |
-
$is_enabled = get_site_option( $key . '_analytics_optin' ) === 'yes' ? true : false;
|
150 |
-
$is_enabled = $this->is_white_label_enabled( $key ) ? false : $is_enabled;
|
151 |
-
|
152 |
-
if ( apply_filters( $key . '_tracking_enabled', $is_enabled ) ) {
|
153 |
-
return true;
|
154 |
-
}
|
155 |
-
}
|
156 |
-
|
157 |
-
return false;
|
158 |
-
}
|
159 |
-
|
160 |
-
/**
|
161 |
-
* Check if WHITE label is enabled for BSF products.
|
162 |
-
*
|
163 |
-
* @param string $source source of analytics.
|
164 |
-
* @return bool
|
165 |
-
* @since 1.0.0
|
166 |
-
*/
|
167 |
-
public function is_white_label_enabled( $source ) {
|
168 |
-
|
169 |
-
$options = apply_filters( $source . '_white_label_options', array() );
|
170 |
-
$is_enabled = false;
|
171 |
-
|
172 |
-
if ( is_array( $options ) ) {
|
173 |
-
foreach ( $options as $option ) {
|
174 |
-
if ( true === $option ) {
|
175 |
-
$is_enabled = true;
|
176 |
-
break;
|
177 |
-
}
|
178 |
-
}
|
179 |
-
}
|
180 |
-
|
181 |
-
return $is_enabled;
|
182 |
-
}
|
183 |
-
|
184 |
-
/**
|
185 |
-
* Display admin notice for usage tracking.
|
186 |
-
*
|
187 |
-
* @since 1.0.0
|
188 |
-
*/
|
189 |
-
public function option_notice() {
|
190 |
-
|
191 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
192 |
-
return;
|
193 |
-
}
|
194 |
-
|
195 |
-
foreach ( $this->entities as $key => $data ) {
|
196 |
-
|
197 |
-
$time_to_display = isset( $data['time_to_display'] ) ? $data['time_to_display'] : '+24 hours';
|
198 |
-
$usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link;
|
199 |
-
|
200 |
-
// Don't display the notice if tracking is disabled or White Label is enabled for any of our plugins.
|
201 |
-
if ( false !== get_site_option( $key . '_analytics_optin', false ) || $this->is_white_label_enabled( $key ) ) {
|
202 |
-
continue;
|
203 |
-
}
|
204 |
-
|
205 |
-
// Show tracker consent notice after 24 hours from installed time.
|
206 |
-
if ( strtotime( $time_to_display, $this->get_analytics_install_time( $key ) ) > time() ) {
|
207 |
-
continue;
|
208 |
-
}
|
209 |
-
|
210 |
-
/* translators: %s product name */
|
211 |
-
$notice_string = __( 'Want to help make <strong>%1s</strong> even more awesome? Allow us to collect non-sensitive diagnostic data and usage information. ', 'cartflows' );
|
212 |
-
|
213 |
-
if ( is_multisite() ) {
|
214 |
-
$notice_string .= __( 'This will be applicable for all sites from the network.', 'cartflows' );
|
215 |
-
}
|
216 |
-
|
217 |
-
$language_dir = is_rtl() ? 'rtl' : 'ltr';
|
218 |
-
|
219 |
-
Astra_Notices::add_notice(
|
220 |
-
array(
|
221 |
-
'id' => $key . '-optin-notice',
|
222 |
-
'type' => '',
|
223 |
-
'message' => sprintf(
|
224 |
-
'<div class="notice-content">
|
225 |
-
<div class="notice-heading">
|
226 |
-
%1$s
|
227 |
-
</div>
|
228 |
-
<div class="astra-notices-container">
|
229 |
-
<a href="%2$s" class="astra-notices button-primary">
|
230 |
-
%3$s
|
231 |
-
</a>
|
232 |
-
<a href="%4$s" data-repeat-notice-after="%5$s" class="astra-notices button-secondary">
|
233 |
-
%6$s
|
234 |
-
</a>
|
235 |
-
</div>
|
236 |
-
</div>',
|
237 |
-
/* translators: %s usage doc link */
|
238 |
-
sprintf( $notice_string . '<span dir="%2s"><a href="%3s" target="_blank" rel="noreferrer noopener">%4s</a><span>', esc_html( $data['product_name'] ), $language_dir, esc_url( $usage_doc_link ), __( ' Know More.', 'cartflows' ) ),
|
239 |
-
add_query_arg(
|
240 |
-
array(
|
241 |
-
$key . '_analytics_optin' => 'yes',
|
242 |
-
$key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ),
|
243 |
-
'bsf_analytics_source' => $key,
|
244 |
-
)
|
245 |
-
),
|
246 |
-
__( 'Yes! Allow it', 'cartflows' ),
|
247 |
-
add_query_arg(
|
248 |
-
array(
|
249 |
-
$key . '_analytics_optin' => 'no',
|
250 |
-
$key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ),
|
251 |
-
'bsf_analytics_source' => $key,
|
252 |
-
)
|
253 |
-
),
|
254 |
-
MONTH_IN_SECONDS,
|
255 |
-
__( 'No Thanks', 'cartflows' )
|
256 |
-
),
|
257 |
-
'show_if' => true,
|
258 |
-
'repeat-notice-after' => false,
|
259 |
-
'priority' => 18,
|
260 |
-
'display-with-other-notices' => true,
|
261 |
-
)
|
262 |
-
);
|
263 |
-
}
|
264 |
-
}
|
265 |
-
|
266 |
-
/**
|
267 |
-
* Process usage tracking opt out.
|
268 |
-
*
|
269 |
-
* @since 1.0.0
|
270 |
-
*/
|
271 |
-
public function handle_optin_optout() {
|
272 |
-
|
273 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
274 |
-
return;
|
275 |
-
}
|
276 |
-
|
277 |
-
$source = isset( $_GET['bsf_analytics_source'] ) ? sanitize_text_field( wp_unslash( $_GET['bsf_analytics_source'] ) ) : '';
|
278 |
-
|
279 |
-
if ( ! isset( $_GET[ $source . '_analytics_nonce' ] ) ) {
|
280 |
-
return;
|
281 |
-
}
|
282 |
-
|
283 |
-
if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_nonce' ] ) ), $source . '_analytics_optin' ) ) {
|
284 |
-
return;
|
285 |
-
}
|
286 |
-
|
287 |
-
$optin_status = isset( $_GET[ $source . '_analytics_optin' ] ) ? sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_optin' ] ) ) : '';
|
288 |
-
|
289 |
-
if ( 'yes' === $optin_status ) {
|
290 |
-
$this->optin( $source );
|
291 |
-
} elseif ( 'no' === $optin_status ) {
|
292 |
-
$this->optout( $source );
|
293 |
-
}
|
294 |
-
|
295 |
-
wp_safe_redirect(
|
296 |
-
remove_query_arg(
|
297 |
-
array(
|
298 |
-
$source . '_analytics_optin',
|
299 |
-
$source . '_analytics_nonce',
|
300 |
-
'bsf_analytics_source',
|
301 |
-
)
|
302 |
-
)
|
303 |
-
);
|
304 |
-
}
|
305 |
-
|
306 |
-
/**
|
307 |
-
* Opt in to usage tracking.
|
308 |
-
*
|
309 |
-
* @param string $source source of analytics.
|
310 |
-
* @since 1.0.0
|
311 |
-
*/
|
312 |
-
private function optin( $source ) {
|
313 |
-
update_site_option( $source . '_analytics_optin', 'yes' );
|
314 |
-
}
|
315 |
-
|
316 |
-
/**
|
317 |
-
* Opt out to usage tracking.
|
318 |
-
*
|
319 |
-
* @param string $source source of analytics.
|
320 |
-
* @since 1.0.0
|
321 |
-
*/
|
322 |
-
private function optout( $source ) {
|
323 |
-
update_site_option( $source . '_analytics_optin', 'no' );
|
324 |
-
}
|
325 |
-
|
326 |
-
/**
|
327 |
-
* Load analytics stat class.
|
328 |
-
*
|
329 |
-
* @since 1.0.0
|
330 |
-
*/
|
331 |
-
private function includes() {
|
332 |
-
require_once __DIR__ . '/class-bsf-analytics-stats.php';
|
333 |
-
}
|
334 |
-
|
335 |
-
/**
|
336 |
-
* Register usage tracking option in General settings page.
|
337 |
-
*
|
338 |
-
* @since 1.0.0
|
339 |
-
*/
|
340 |
-
public function register_usage_tracking_setting() {
|
341 |
-
|
342 |
-
foreach ( $this->entities as $key => $data ) {
|
343 |
-
|
344 |
-
if ( ! apply_filters( $key . '_tracking_enabled', true ) || $this->is_white_label_enabled( $key ) ) {
|
345 |
-
return;
|
346 |
-
}
|
347 |
-
|
348 |
-
$usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link;
|
349 |
-
$author = isset( $data['author'] ) ? $data['author'] : 'Brainstorm Force';
|
350 |
-
|
351 |
-
register_setting(
|
352 |
-
'general', // Options group.
|
353 |
-
$key . '_analytics_optin', // Option name/database.
|
354 |
-
array( 'sanitize_callback' => array( $this, 'sanitize_option' ) ) // sanitize callback function.
|
355 |
-
);
|
356 |
-
|
357 |
-
add_settings_field(
|
358 |
-
$key . '-analytics-optin', // Field ID.
|
359 |
-
__( 'Usage Tracking', 'cartflows' ), // Field title.
|
360 |
-
array( $this, 'render_settings_field_html' ), // Field callback function.
|
361 |
-
'general',
|
362 |
-
'default', // Settings page slug.
|
363 |
-
array(
|
364 |
-
'type' => 'checkbox',
|
365 |
-
'title' => $author,
|
366 |
-
'name' => $key . '_analytics_optin',
|
367 |
-
'label_for' => $key . '-analytics-optin',
|
368 |
-
'id' => $key . '-analytics-optin',
|
369 |
-
'usage_doc_link' => $usage_doc_link,
|
370 |
-
)
|
371 |
-
);
|
372 |
-
}
|
373 |
-
}
|
374 |
-
|
375 |
-
/**
|
376 |
-
* Sanitize Callback Function
|
377 |
-
*
|
378 |
-
* @param bool $input Option value.
|
379 |
-
* @since 1.0.0
|
380 |
-
*/
|
381 |
-
public function sanitize_option( $input ) {
|
382 |
-
|
383 |
-
if ( ! $input || 'no' === $input ) {
|
384 |
-
return 'no';
|
385 |
-
}
|
386 |
-
|
387 |
-
return 'yes';
|
388 |
-
}
|
389 |
-
|
390 |
-
/**
|
391 |
-
* Print settings field HTML.
|
392 |
-
*
|
393 |
-
* @param array $args arguments to field.
|
394 |
-
* @since 1.0.0
|
395 |
-
*/
|
396 |
-
public function render_settings_field_html( $args ) {
|
397 |
-
?>
|
398 |
-
<fieldset>
|
399 |
-
<label for="<?php echo esc_attr( $args['label_for'] ); ?>">
|
400 |
-
<input id="<?php echo esc_attr( $args['id'] ); ?>" type="checkbox" value="1" name="<?php echo esc_attr( $args['name'] ); ?>" <?php checked( get_site_option( $args['name'], 'no' ), 'yes' ); ?>>
|
401 |
-
<?php
|
402 |
-
/* translators: %s Product title */
|
403 |
-
echo esc_html( sprintf( __( 'Allow %s products to track non-sensitive usage tracking data.', 'cartflows' ), $args['title'] ) );// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
|
404 |
-
|
405 |
-
if ( is_multisite() ) {
|
406 |
-
esc_html_e( ' This will be applicable for all sites from the network.', 'cartflows' );
|
407 |
-
}
|
408 |
-
?>
|
409 |
-
</label>
|
410 |
-
<?php
|
411 |
-
echo wp_kses_post( sprintf( '<a href="%1s" target="_blank" rel="noreferrer noopener">%2s</a>', esc_url( $args['usage_doc_link'] ), __( 'Learn More.', 'cartflows' ) ) );
|
412 |
-
?>
|
413 |
-
</fieldset>
|
414 |
-
<?php
|
415 |
-
}
|
416 |
-
|
417 |
-
/**
|
418 |
-
* Set analytics installed time in option.
|
419 |
-
*
|
420 |
-
* @param string $source source of analytics.
|
421 |
-
* @return string $time analytics installed time.
|
422 |
-
* @since 1.0.0
|
423 |
-
*/
|
424 |
-
private function get_analytics_install_time( $source ) {
|
425 |
-
|
426 |
-
$time = get_site_option( $source . '_analytics_installed_time' );
|
427 |
-
|
428 |
-
if ( ! $time ) {
|
429 |
-
$time = time();
|
430 |
-
update_site_option( $source . '_analytics_installed_time', time() );
|
431 |
-
}
|
432 |
-
|
433 |
-
return $time;
|
434 |
-
}
|
435 |
-
|
436 |
-
/**
|
437 |
-
* Schedule/unschedule cron event on updation of option.
|
438 |
-
*
|
439 |
-
* @param string $old_value old value of option.
|
440 |
-
* @param string $value value of option.
|
441 |
-
* @param string $option Option name.
|
442 |
-
* @since 1.0.0
|
443 |
-
*/
|
444 |
-
public function update_analytics_option_callback( $old_value, $value, $option ) {
|
445 |
-
if ( is_multisite() ) {
|
446 |
-
$this->add_option_to_network( $option, $value );
|
447 |
-
}
|
448 |
-
}
|
449 |
-
|
450 |
-
/**
|
451 |
-
* Analytics option add callback.
|
452 |
-
*
|
453 |
-
* @param string $option Option name.
|
454 |
-
* @param string $value value of option.
|
455 |
-
* @since 1.0.0
|
456 |
-
*/
|
457 |
-
public function add_analytics_option_callback( $option, $value ) {
|
458 |
-
if ( is_multisite() ) {
|
459 |
-
$this->add_option_to_network( $option, $value );
|
460 |
-
}
|
461 |
-
}
|
462 |
-
|
463 |
-
/**
|
464 |
-
* Send analaytics track event if tracking is enabled.
|
465 |
-
*
|
466 |
-
* @since 1.0.0
|
467 |
-
*/
|
468 |
-
public function maybe_track_analytics() {
|
469 |
-
|
470 |
-
if ( ! $this->is_tracking_enabled() ) {
|
471 |
-
return;
|
472 |
-
}
|
473 |
-
|
474 |
-
$analytics_track = get_site_transient( 'bsf_analytics_track' );
|
475 |
-
|
476 |
-
// If the last data sent is 2 days old i.e. transient is expired.
|
477 |
-
if ( ! $analytics_track ) {
|
478 |
-
$this->send();
|
479 |
-
set_site_transient( 'bsf_analytics_track', true, 2 * DAY_IN_SECONDS );
|
480 |
-
}
|
481 |
-
}
|
482 |
-
|
483 |
-
/**
|
484 |
-
* Save analytics option to network.
|
485 |
-
*
|
486 |
-
* @param string $option name of option.
|
487 |
-
* @param string $value value of option.
|
488 |
-
* @since 1.0.0
|
489 |
-
*/
|
490 |
-
public function add_option_to_network( $option, $value ) {
|
491 |
-
|
492 |
-
// If action coming from general settings page.
|
493 |
-
if ( isset( $_POST['option_page'] ) && 'general' === $_POST['option_page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
|
494 |
-
|
495 |
-
if ( get_site_option( $option ) ) {
|
496 |
-
update_site_option( $option, $value );
|
497 |
-
} else {
|
498 |
-
add_site_option( $option, $value );
|
499 |
-
}
|
500 |
-
}
|
501 |
-
}
|
502 |
-
}
|
503 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BSF analytics class file.
|
4 |
+
*
|
5 |
+
* @version 1.0.0
|
6 |
+
*
|
7 |
+
* @package bsf-analytics
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
+
exit; // Exit if accessed directly.
|
12 |
+
}
|
13 |
+
|
14 |
+
if ( ! class_exists( 'BSF_Analytics' ) ) {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* BSF analytics
|
18 |
+
*/
|
19 |
+
class BSF_Analytics {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Member Variable
|
23 |
+
*
|
24 |
+
* @var array Entities data.
|
25 |
+
*/
|
26 |
+
private $entities;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Member Variable
|
30 |
+
*
|
31 |
+
* @var string Usage tracking document URL
|
32 |
+
*/
|
33 |
+
public $usage_doc_link = 'https://store.brainstormforce.com/usage-tracking/?utm_source=wp_dashboard&utm_medium=general_settings&utm_campaign=usage_tracking';
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Setup actions, load files.
|
37 |
+
*
|
38 |
+
* @param array $args entity data for analytics.
|
39 |
+
* @param string $analytics_path directory path to analytics library.
|
40 |
+
* @param float $analytics_version analytics library version.
|
41 |
+
* @since 1.0.0
|
42 |
+
*/
|
43 |
+
public function __construct( $args, $analytics_path, $analytics_version ) {
|
44 |
+
|
45 |
+
// Bail when no analytics entities are registered.
|
46 |
+
if ( empty( $args ) ) {
|
47 |
+
return;
|
48 |
+
}
|
49 |
+
|
50 |
+
$this->entities = $args;
|
51 |
+
|
52 |
+
define( 'BSF_ANALYTICS_VERSION', $analytics_version );
|
53 |
+
define( 'BSF_ANALYTICS_URI', $this->get_analytics_url( $analytics_path ) );
|
54 |
+
|
55 |
+
add_action( 'admin_init', array( $this, 'handle_optin_optout' ) );
|
56 |
+
add_action( 'admin_notices', array( $this, 'option_notice' ) );
|
57 |
+
add_action( 'init', array( $this, 'maybe_track_analytics' ), 99 );
|
58 |
+
|
59 |
+
$this->set_actions();
|
60 |
+
|
61 |
+
add_action( 'admin_init', array( $this, 'register_usage_tracking_setting' ) );
|
62 |
+
|
63 |
+
$this->includes();
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Setup actions for admin notice style and analytics cron event.
|
68 |
+
*
|
69 |
+
* @since 1.0.4
|
70 |
+
*/
|
71 |
+
public function set_actions() {
|
72 |
+
|
73 |
+
foreach ( $this->entities as $key => $data ) {
|
74 |
+
add_action( 'astra_notice_before_markup_' . $key . '-optin-notice', array( $this, 'enqueue_assets' ) );
|
75 |
+
add_action( 'update_option_' . $key . '_analytics_optin', array( $this, 'update_analytics_option_callback' ), 10, 3 );
|
76 |
+
add_action( 'add_option_' . $key . '_analytics_optin', array( $this, 'add_analytics_option_callback' ), 10, 2 );
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* BSF Analytics URL
|
82 |
+
*
|
83 |
+
* @param string $analytics_path directory path to analytics library.
|
84 |
+
* @return String URL of bsf-analytics directory.
|
85 |
+
* @since 1.0.0
|
86 |
+
*/
|
87 |
+
public function get_analytics_url( $analytics_path ) {
|
88 |
+
return str_replace( WP_CONTENT_DIR, content_url(), $analytics_path );
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Get API URL for sending analytics.
|
93 |
+
*
|
94 |
+
* @return string API URL.
|
95 |
+
* @since 1.0.0
|
96 |
+
*/
|
97 |
+
private function get_api_url() {
|
98 |
+
return defined( 'BSF_API_URL' ) ? BSF_API_URL : 'https://support.brainstormforce.com/';
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Enqueue Scripts.
|
103 |
+
*
|
104 |
+
* @since 1.0.0
|
105 |
+
* @return void
|
106 |
+
*/
|
107 |
+
public function enqueue_assets() {
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Load unminified if SCRIPT_DEBUG is true.
|
111 |
+
*
|
112 |
+
* Directory and Extensions.
|
113 |
+
*/
|
114 |
+
$dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
|
115 |
+
$file_rtl = ( is_rtl() ) ? '-rtl' : '';
|
116 |
+
$css_ext = ( SCRIPT_DEBUG ) ? '.css' : '.min.css';
|
117 |
+
|
118 |
+
$css_uri = BSF_ANALYTICS_URI . '/assets/css/' . $dir_name . '/style' . $file_rtl . $css_ext;
|
119 |
+
|
120 |
+
wp_enqueue_style( 'bsf-analytics-admin-style', $css_uri, false, BSF_ANALYTICS_VERSION, 'all' );
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Send analytics API call.
|
125 |
+
*
|
126 |
+
* @since 1.0.0
|
127 |
+
*/
|
128 |
+
public function send() {
|
129 |
+
wp_remote_post(
|
130 |
+
$this->get_api_url() . 'wp-json/bsf-core/v1/analytics/',
|
131 |
+
array(
|
132 |
+
'body' => BSF_Analytics_Stats::instance()->get_stats(),
|
133 |
+
'timeout' => 5,
|
134 |
+
'blocking' => false,
|
135 |
+
)
|
136 |
+
);
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Check if usage tracking is enabled.
|
141 |
+
*
|
142 |
+
* @return bool
|
143 |
+
* @since 1.0.0
|
144 |
+
*/
|
145 |
+
public function is_tracking_enabled() {
|
146 |
+
|
147 |
+
foreach ( $this->entities as $key => $data ) {
|
148 |
+
|
149 |
+
$is_enabled = get_site_option( $key . '_analytics_optin' ) === 'yes' ? true : false;
|
150 |
+
$is_enabled = $this->is_white_label_enabled( $key ) ? false : $is_enabled;
|
151 |
+
|
152 |
+
if ( apply_filters( $key . '_tracking_enabled', $is_enabled ) ) {
|
153 |
+
return true;
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
return false;
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Check if WHITE label is enabled for BSF products.
|
162 |
+
*
|
163 |
+
* @param string $source source of analytics.
|
164 |
+
* @return bool
|
165 |
+
* @since 1.0.0
|
166 |
+
*/
|
167 |
+
public function is_white_label_enabled( $source ) {
|
168 |
+
|
169 |
+
$options = apply_filters( $source . '_white_label_options', array() );
|
170 |
+
$is_enabled = false;
|
171 |
+
|
172 |
+
if ( is_array( $options ) ) {
|
173 |
+
foreach ( $options as $option ) {
|
174 |
+
if ( true === $option ) {
|
175 |
+
$is_enabled = true;
|
176 |
+
break;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
return $is_enabled;
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Display admin notice for usage tracking.
|
186 |
+
*
|
187 |
+
* @since 1.0.0
|
188 |
+
*/
|
189 |
+
public function option_notice() {
|
190 |
+
|
191 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
192 |
+
return;
|
193 |
+
}
|
194 |
+
|
195 |
+
foreach ( $this->entities as $key => $data ) {
|
196 |
+
|
197 |
+
$time_to_display = isset( $data['time_to_display'] ) ? $data['time_to_display'] : '+24 hours';
|
198 |
+
$usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link;
|
199 |
+
|
200 |
+
// Don't display the notice if tracking is disabled or White Label is enabled for any of our plugins.
|
201 |
+
if ( false !== get_site_option( $key . '_analytics_optin', false ) || $this->is_white_label_enabled( $key ) ) {
|
202 |
+
continue;
|
203 |
+
}
|
204 |
+
|
205 |
+
// Show tracker consent notice after 24 hours from installed time.
|
206 |
+
if ( strtotime( $time_to_display, $this->get_analytics_install_time( $key ) ) > time() ) {
|
207 |
+
continue;
|
208 |
+
}
|
209 |
+
|
210 |
+
/* translators: %s product name */
|
211 |
+
$notice_string = __( 'Want to help make <strong>%1s</strong> even more awesome? Allow us to collect non-sensitive diagnostic data and usage information. ', 'cartflows' );
|
212 |
+
|
213 |
+
if ( is_multisite() ) {
|
214 |
+
$notice_string .= __( 'This will be applicable for all sites from the network.', 'cartflows' );
|
215 |
+
}
|
216 |
+
|
217 |
+
$language_dir = is_rtl() ? 'rtl' : 'ltr';
|
218 |
+
|
219 |
+
Astra_Notices::add_notice(
|
220 |
+
array(
|
221 |
+
'id' => $key . '-optin-notice',
|
222 |
+
'type' => '',
|
223 |
+
'message' => sprintf(
|
224 |
+
'<div class="notice-content">
|
225 |
+
<div class="notice-heading">
|
226 |
+
%1$s
|
227 |
+
</div>
|
228 |
+
<div class="astra-notices-container">
|
229 |
+
<a href="%2$s" class="astra-notices button-primary">
|
230 |
+
%3$s
|
231 |
+
</a>
|
232 |
+
<a href="%4$s" data-repeat-notice-after="%5$s" class="astra-notices button-secondary">
|
233 |
+
%6$s
|
234 |
+
</a>
|
235 |
+
</div>
|
236 |
+
</div>',
|
237 |
+
/* translators: %s usage doc link */
|
238 |
+
sprintf( $notice_string . '<span dir="%2s"><a href="%3s" target="_blank" rel="noreferrer noopener">%4s</a><span>', esc_html( $data['product_name'] ), $language_dir, esc_url( $usage_doc_link ), __( ' Know More.', 'cartflows' ) ),
|
239 |
+
add_query_arg(
|
240 |
+
array(
|
241 |
+
$key . '_analytics_optin' => 'yes',
|
242 |
+
$key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ),
|
243 |
+
'bsf_analytics_source' => $key,
|
244 |
+
)
|
245 |
+
),
|
246 |
+
__( 'Yes! Allow it', 'cartflows' ),
|
247 |
+
add_query_arg(
|
248 |
+
array(
|
249 |
+
$key . '_analytics_optin' => 'no',
|
250 |
+
$key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ),
|
251 |
+
'bsf_analytics_source' => $key,
|
252 |
+
)
|
253 |
+
),
|
254 |
+
MONTH_IN_SECONDS,
|
255 |
+
__( 'No Thanks', 'cartflows' )
|
256 |
+
),
|
257 |
+
'show_if' => true,
|
258 |
+
'repeat-notice-after' => false,
|
259 |
+
'priority' => 18,
|
260 |
+
'display-with-other-notices' => true,
|
261 |
+
)
|
262 |
+
);
|
263 |
+
}
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* Process usage tracking opt out.
|
268 |
+
*
|
269 |
+
* @since 1.0.0
|
270 |
+
*/
|
271 |
+
public function handle_optin_optout() {
|
272 |
+
|
273 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
274 |
+
return;
|
275 |
+
}
|
276 |
+
|
277 |
+
$source = isset( $_GET['bsf_analytics_source'] ) ? sanitize_text_field( wp_unslash( $_GET['bsf_analytics_source'] ) ) : '';
|
278 |
+
|
279 |
+
if ( ! isset( $_GET[ $source . '_analytics_nonce' ] ) ) {
|
280 |
+
return;
|
281 |
+
}
|
282 |
+
|
283 |
+
if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_nonce' ] ) ), $source . '_analytics_optin' ) ) {
|
284 |
+
return;
|
285 |
+
}
|
286 |
+
|
287 |
+
$optin_status = isset( $_GET[ $source . '_analytics_optin' ] ) ? sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_optin' ] ) ) : '';
|
288 |
+
|
289 |
+
if ( 'yes' === $optin_status ) {
|
290 |
+
$this->optin( $source );
|
291 |
+
} elseif ( 'no' === $optin_status ) {
|
292 |
+
$this->optout( $source );
|
293 |
+
}
|
294 |
+
|
295 |
+
wp_safe_redirect(
|
296 |
+
remove_query_arg(
|
297 |
+
array(
|
298 |
+
$source . '_analytics_optin',
|
299 |
+
$source . '_analytics_nonce',
|
300 |
+
'bsf_analytics_source',
|
301 |
+
)
|
302 |
+
)
|
303 |
+
);
|
304 |
+
}
|
305 |
+
|
306 |
+
/**
|
307 |
+
* Opt in to usage tracking.
|
308 |
+
*
|
309 |
+
* @param string $source source of analytics.
|
310 |
+
* @since 1.0.0
|
311 |
+
*/
|
312 |
+
private function optin( $source ) {
|
313 |
+
update_site_option( $source . '_analytics_optin', 'yes' );
|
314 |
+
}
|
315 |
+
|
316 |
+
/**
|
317 |
+
* Opt out to usage tracking.
|
318 |
+
*
|
319 |
+
* @param string $source source of analytics.
|
320 |
+
* @since 1.0.0
|
321 |
+
*/
|
322 |
+
private function optout( $source ) {
|
323 |
+
update_site_option( $source . '_analytics_optin', 'no' );
|
324 |
+
}
|
325 |
+
|
326 |
+
/**
|
327 |
+
* Load analytics stat class.
|
328 |
+
*
|
329 |
+
* @since 1.0.0
|
330 |
+
*/
|
331 |
+
private function includes() {
|
332 |
+
require_once __DIR__ . '/class-bsf-analytics-stats.php';
|
333 |
+
}
|
334 |
+
|
335 |
+
/**
|
336 |
+
* Register usage tracking option in General settings page.
|
337 |
+
*
|
338 |
+
* @since 1.0.0
|
339 |
+
*/
|
340 |
+
public function register_usage_tracking_setting() {
|
341 |
+
|
342 |
+
foreach ( $this->entities as $key => $data ) {
|
343 |
+
|
344 |
+
if ( ! apply_filters( $key . '_tracking_enabled', true ) || $this->is_white_label_enabled( $key ) ) {
|
345 |
+
return;
|
346 |
+
}
|
347 |
+
|
348 |
+
$usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link;
|
349 |
+
$author = isset( $data['author'] ) ? $data['author'] : 'Brainstorm Force';
|
350 |
+
|
351 |
+
register_setting(
|
352 |
+
'general', // Options group.
|
353 |
+
$key . '_analytics_optin', // Option name/database.
|
354 |
+
array( 'sanitize_callback' => array( $this, 'sanitize_option' ) ) // sanitize callback function.
|
355 |
+
);
|
356 |
+
|
357 |
+
add_settings_field(
|
358 |
+
$key . '-analytics-optin', // Field ID.
|
359 |
+
__( 'Usage Tracking', 'cartflows' ), // Field title.
|
360 |
+
array( $this, 'render_settings_field_html' ), // Field callback function.
|
361 |
+
'general',
|
362 |
+
'default', // Settings page slug.
|
363 |
+
array(
|
364 |
+
'type' => 'checkbox',
|
365 |
+
'title' => $author,
|
366 |
+
'name' => $key . '_analytics_optin',
|
367 |
+
'label_for' => $key . '-analytics-optin',
|
368 |
+
'id' => $key . '-analytics-optin',
|
369 |
+
'usage_doc_link' => $usage_doc_link,
|
370 |
+
)
|
371 |
+
);
|
372 |
+
}
|
373 |
+
}
|
374 |
+
|
375 |
+
/**
|
376 |
+
* Sanitize Callback Function
|
377 |
+
*
|
378 |
+
* @param bool $input Option value.
|
379 |
+
* @since 1.0.0
|
380 |
+
*/
|
381 |
+
public function sanitize_option( $input ) {
|
382 |
+
|
383 |
+
if ( ! $input || 'no' === $input ) {
|
384 |
+
return 'no';
|
385 |
+
}
|
386 |
+
|
387 |
+
return 'yes';
|
388 |
+
}
|
389 |
+
|
390 |
+
/**
|
391 |
+
* Print settings field HTML.
|
392 |
+
*
|
393 |
+
* @param array $args arguments to field.
|
394 |
+
* @since 1.0.0
|
395 |
+
*/
|
396 |
+
public function render_settings_field_html( $args ) {
|
397 |
+
?>
|
398 |
+
<fieldset>
|
399 |
+
<label for="<?php echo esc_attr( $args['label_for'] ); ?>">
|
400 |
+
<input id="<?php echo esc_attr( $args['id'] ); ?>" type="checkbox" value="1" name="<?php echo esc_attr( $args['name'] ); ?>" <?php checked( get_site_option( $args['name'], 'no' ), 'yes' ); ?>>
|
401 |
+
<?php
|
402 |
+
/* translators: %s Product title */
|
403 |
+
echo esc_html( sprintf( __( 'Allow %s products to track non-sensitive usage tracking data.', 'cartflows' ), $args['title'] ) );// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
|
404 |
+
|
405 |
+
if ( is_multisite() ) {
|
406 |
+
esc_html_e( ' This will be applicable for all sites from the network.', 'cartflows' );
|
407 |
+
}
|
408 |
+
?>
|
409 |
+
</label>
|
410 |
+
<?php
|
411 |
+
echo wp_kses_post( sprintf( '<a href="%1s" target="_blank" rel="noreferrer noopener">%2s</a>', esc_url( $args['usage_doc_link'] ), __( 'Learn More.', 'cartflows' ) ) );
|
412 |
+
?>
|
413 |
+
</fieldset>
|
414 |
+
<?php
|
415 |
+
}
|
416 |
+
|
417 |
+
/**
|
418 |
+
* Set analytics installed time in option.
|
419 |
+
*
|
420 |
+
* @param string $source source of analytics.
|
421 |
+
* @return string $time analytics installed time.
|
422 |
+
* @since 1.0.0
|
423 |
+
*/
|
424 |
+
private function get_analytics_install_time( $source ) {
|
425 |
+
|
426 |
+
$time = get_site_option( $source . '_analytics_installed_time' );
|
427 |
+
|
428 |
+
if ( ! $time ) {
|
429 |
+
$time = time();
|
430 |
+
update_site_option( $source . '_analytics_installed_time', time() );
|
431 |
+
}
|
432 |
+
|
433 |
+
return $time;
|
434 |
+
}
|
435 |
+
|
436 |
+
/**
|
437 |
+
* Schedule/unschedule cron event on updation of option.
|
438 |
+
*
|
439 |
+
* @param string $old_value old value of option.
|
440 |
+
* @param string $value value of option.
|
441 |
+
* @param string $option Option name.
|
442 |
+
* @since 1.0.0
|
443 |
+
*/
|
444 |
+
public function update_analytics_option_callback( $old_value, $value, $option ) {
|
445 |
+
if ( is_multisite() ) {
|
446 |
+
$this->add_option_to_network( $option, $value );
|
447 |
+
}
|
448 |
+
}
|
449 |
+
|
450 |
+
/**
|
451 |
+
* Analytics option add callback.
|
452 |
+
*
|
453 |
+
* @param string $option Option name.
|
454 |
+
* @param string $value value of option.
|
455 |
+
* @since 1.0.0
|
456 |
+
*/
|
457 |
+
public function add_analytics_option_callback( $option, $value ) {
|
458 |
+
if ( is_multisite() ) {
|
459 |
+
$this->add_option_to_network( $option, $value );
|
460 |
+
}
|
461 |
+
}
|
462 |
+
|
463 |
+
/**
|
464 |
+
* Send analaytics track event if tracking is enabled.
|
465 |
+
*
|
466 |
+
* @since 1.0.0
|
467 |
+
*/
|
468 |
+
public function maybe_track_analytics() {
|
469 |
+
|
470 |
+
if ( ! $this->is_tracking_enabled() ) {
|
471 |
+
return;
|
472 |
+
}
|
473 |
+
|
474 |
+
$analytics_track = get_site_transient( 'bsf_analytics_track' );
|
475 |
+
|
476 |
+
// If the last data sent is 2 days old i.e. transient is expired.
|
477 |
+
if ( ! $analytics_track ) {
|
478 |
+
$this->send();
|
479 |
+
set_site_transient( 'bsf_analytics_track', true, 2 * DAY_IN_SECONDS );
|
480 |
+
}
|
481 |
+
}
|
482 |
+
|
483 |
+
/**
|
484 |
+
* Save analytics option to network.
|
485 |
+
*
|
486 |
+
* @param string $option name of option.
|
487 |
+
* @param string $value value of option.
|
488 |
+
* @since 1.0.0
|
489 |
+
*/
|
490 |
+
public function add_option_to_network( $option, $value ) {
|
491 |
+
|
492 |
+
// If action coming from general settings page.
|
493 |
+
if ( isset( $_POST['option_page'] ) && 'general' === $_POST['option_page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
|
494 |
+
|
495 |
+
if ( get_site_option( $option ) ) {
|
496 |
+
update_site_option( $option, $value );
|
497 |
+
} else {
|
498 |
+
add_site_option( $option, $value );
|
499 |
+
}
|
500 |
+
}
|
501 |
+
}
|
502 |
+
}
|
503 |
+
}
|
cartflows.php
CHANGED
@@ -3,12 +3,12 @@
|
|
3 |
* Plugin Name: CartFlows
|
4 |
* Plugin URI: https://cartflows.com/
|
5 |
* Description: Create beautiful checkout pages & sales flows for WooCommerce.
|
6 |
-
* Version: 1.5.
|
7 |
* Author: CartFlows Inc
|
8 |
* Author URI: https://cartflows.com/
|
9 |
* Text Domain: cartflows
|
10 |
* WC requires at least: 3.0
|
11 |
-
* WC tested up to: 4.
|
12 |
*
|
13 |
* @package CartFlows
|
14 |
*/
|
3 |
* Plugin Name: CartFlows
|
4 |
* Plugin URI: https://cartflows.com/
|
5 |
* Description: Create beautiful checkout pages & sales flows for WooCommerce.
|
6 |
+
* Version: 1.5.20
|
7 |
* Author: CartFlows Inc
|
8 |
* Author URI: https://cartflows.com/
|
9 |
* Text Domain: cartflows
|
10 |
* WC requires at least: 3.0
|
11 |
+
* WC tested up to: 4.6.1
|
12 |
*
|
13 |
* @package CartFlows
|
14 |
*/
|
changelog.txt
CHANGED
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
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.
|
1 |
+
Version 1.5.20 - Thursday, 5th November 2020
|
2 |
+
- New: Introduced Gutenberg Blocks.
|
3 |
+
|
4 |
Version 1.5.19 - Tuesday, 13th October 2020
|
5 |
- New: Introduced Beaver Builder widgets.
|
6 |
- Fix: Facebook Pixel tracking events were not getting triggered when WooCommerce was not activated.
|
classes/class-cartflows-admin-fields.php
CHANGED
@@ -1,277 +1,277 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* CARTFLOWS Admin Fields.
|
4 |
-
*
|
5 |
-
* @package CARTFLOWS
|
6 |
-
*/
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Class Cartflows_Admin_Fields.
|
10 |
-
*/
|
11 |
-
class Cartflows_Admin_Fields {
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Title Field
|
15 |
-
*
|
16 |
-
* @param array $args Args.
|
17 |
-
* @return string
|
18 |
-
*/
|
19 |
-
public static function title_field( $args ) {
|
20 |
-
|
21 |
-
$title = $args['title'];
|
22 |
-
$description = isset( $args['description'] ) ? $args['description'] : '';
|
23 |
-
|
24 |
-
$output = '<h4 class="form-field wcf-title-field">';
|
25 |
-
$output .= '<span>' . $title . '</span>';
|
26 |
-
$output .= '</h4>';
|
27 |
-
|
28 |
-
if ( ! empty( $description ) ) {
|
29 |
-
$output .= '<div class="form-field-desc">';
|
30 |
-
$output .= '<p>' . $description . '</p>';
|
31 |
-
$output .= '</div>';
|
32 |
-
}
|
33 |
-
|
34 |
-
return $output;
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Text Field
|
39 |
-
*
|
40 |
-
* @param array $args Args.
|
41 |
-
* @return string
|
42 |
-
*/
|
43 |
-
public static function text_field( $args ) {
|
44 |
-
|
45 |
-
$id = $args['id'];
|
46 |
-
$name = $args['name'];
|
47 |
-
$title = $args['title'];
|
48 |
-
$value = $args['value'];
|
49 |
-
$description = isset( $args['description'] ) ? $args['description'] : '';
|
50 |
-
$placeholder = isset( $args['placeholder'] ) ? $args['placeholder'] : '';
|
51 |
-
|
52 |
-
$output = '<div class="form-field" id="form-field-' . $id . '">';
|
53 |
-
$output .= '<label for="' . $id . '">' . $title . '</label>';
|
54 |
-
$output .= '<input placeholder="' . $placeholder . '" type="text" name="' . $name . '" id="' . $id . '" class="placeholder placeholder-active" value="' . esc_attr( $value ) . '">';
|
55 |
-
$output .= '</div>';
|
56 |
-
|
57 |
-
if ( ! empty( $description ) ) {
|
58 |
-
$output .= '<div class="form-field-desc">';
|
59 |
-
$output .= '<p>';
|
60 |
-
$output .= $description;
|
61 |
-
$output .= '</p>';
|
62 |
-
$output .= '</div>';
|
63 |
-
}
|
64 |
-
|
65 |
-
return $output;
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* URL Field
|
70 |
-
*
|
71 |
-
* @param array $args Args.
|
72 |
-
* @return string
|
73 |
-
*/
|
74 |
-
public static function url_field( $args ) {
|
75 |
-
|
76 |
-
$id = $args['id'];
|
77 |
-
$name = $args['name'];
|
78 |
-
$title = $args['title'];
|
79 |
-
$value = $args['value'];
|
80 |
-
|
81 |
-
$output = '<div class="form-field">';
|
82 |
-
$output .= '<label for="' . $id . '">' . $title . '</label>';
|
83 |
-
$output .= '<input type="text" name="' . $name . '" id="' . $id . '" class="placeholder placeholder-active" value="' . esc_url( $value ) . '">';
|
84 |
-
$output .= '</div>';
|
85 |
-
|
86 |
-
return $output;
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Checkbox Field
|
91 |
-
*
|
92 |
-
* @param array $args Args.
|
93 |
-
* @return string
|
94 |
-
*/
|
95 |
-
public static function checkobox_field( $args ) {
|
96 |
-
|
97 |
-
$id = $args['id'];
|
98 |
-
$name = $args['name'];
|
99 |
-
$title = $args['title'];
|
100 |
-
$value = $args['value'];
|
101 |
-
|
102 |
-
$output = '<div class="form-field" id="form-field-' . $id . '">';
|
103 |
-
$output .= '<label for="' . $id . '">';
|
104 |
-
$output .= '<input type="hidden" id="wcf_hid_' . $id . '" name="' . $name . '" value="disable">';
|
105 |
-
$output .= '<input type="checkbox" id="wcf_' . $id . '" name="' . $name . '" value="enable" ' . checked( $value, 'enable', false ) . '>';
|
106 |
-
$output .= $title;
|
107 |
-
$output .= '</label>';
|
108 |
-
$output .= '</div>';
|
109 |
-
|
110 |
-
return $output;
|
111 |
-
}
|
112 |
-
|
113 |
-
/**
|
114 |
-
* Radio Field
|
115 |
-
*
|
116 |
-
* @param array $args Args.
|
117 |
-
* @return string
|
118 |
-
*/
|
119 |
-
public static function radio_field( $args ) {
|
120 |
-
|
121 |
-
$name = $args['name'];
|
122 |
-
$id = $args['id'];
|
123 |
-
$options = $args['options'];
|
124 |
-
$value = $args['value'];
|
125 |
-
|
126 |
-
$output = '';
|
127 |
-
|
128 |
-
if ( isset( $args['title'] ) ) {
|
129 |
-
$output .= '<h4 class="form-field-label">';
|
130 |
-
$output .= '<span>' . $args['title'] . '</span>';
|
131 |
-
$output .= '</h4>';
|
132 |
-
}
|
133 |
-
|
134 |
-
foreach ( $options as $type => $data ) {
|
135 |
-
|
136 |
-
$output .= '<div class="form-field">';
|
137 |
-
$output .= '<label for="' . $id . '">';
|
138 |
-
$output .= '<input type="radio" class="wcf_permalink_structure" name="' . $name . '" value="' . $type . '" ' . checked( $value, $type, false ) . '>' . $data['label'] . '</label>';
|
139 |
-
$output .= '<div class="form-field-desc">';
|
140 |
-
$output .= '<p>';
|
141 |
-
|
142 |
-
$output .= $data['description'];
|
143 |
-
|
144 |
-
$output .= '</p>';
|
145 |
-
$output .= '</div>';
|
146 |
-
$output .= '</div>';
|
147 |
-
}
|
148 |
-
|
149 |
-
return $output;
|
150 |
-
}
|
151 |
-
|
152 |
-
/**
|
153 |
-
* Select Field
|
154 |
-
*
|
155 |
-
* @since 1.1.4
|
156 |
-
*
|
157 |
-
* @param array $args Args.
|
158 |
-
* @return string
|
159 |
-
*/
|
160 |
-
public static function select_field( $args ) {
|
161 |
-
|
162 |
-
$id = $args['id'];
|
163 |
-
$name = $args['name'];
|
164 |
-
$title = $args['title'];
|
165 |
-
$description = $args['description'];
|
166 |
-
$value = $args['value'];
|
167 |
-
$options = $args['options'];
|
168 |
-
|
169 |
-
$output = '<div class="form-field" id="form-field-' . $id . '">';
|
170 |
-
|
171 |
-
$output .= '<div class="form-field-label">';
|
172 |
-
$output .= $title;
|
173 |
-
$output .= '</div>';
|
174 |
-
|
175 |
-
$output .= '<div class="form-field-data">';
|
176 |
-
$output .= '<select id="wcf_' . $id . '" name="' . $name . '">';
|
177 |
-
foreach ( $options as $option_value => $option_title ) {
|
178 |
-
$output .= '<option value="' . $option_value . '" ' . selected( $value, $option_value, false ) . '>' . $option_title . '</option>';
|
179 |
-
}
|
180 |
-
$output .= '</select>';
|
181 |
-
$output .= '</div>';
|
182 |
-
|
183 |
-
$output .= '<div class="form-field-desc">';
|
184 |
-
$output .= '<p>';
|
185 |
-
$output .= $description;
|
186 |
-
$output .= '</p>';
|
187 |
-
$output .= '</div>';
|
188 |
-
$output .= '</div>';
|
189 |
-
|
190 |
-
return $output;
|
191 |
-
}
|
192 |
-
|
193 |
-
/**
|
194 |
-
* Checkout Selection Field
|
195 |
-
*
|
196 |
-
* @param array $args Args.
|
197 |
-
* @return string
|
198 |
-
*/
|
199 |
-
public static function flow_checkout_selection_field( $args ) {
|
200 |
-
|
201 |
-
$id = $args['id'];
|
202 |
-
$name = $args['name'];
|
203 |
-
$title = $args['title'];
|
204 |
-
$value = $args['value'];
|
205 |
-
|
206 |
-
$checkout_steps = get_posts(
|
207 |
-
array(
|
208 |
-
'posts_per_page' => -1,
|
209 |
-
'post_type' => CARTFLOWS_STEP_POST_TYPE,
|
210 |
-
'post_status' => 'publish',
|
211 |
-
'orderby' => 'ID',
|
212 |
-
'order' => 'ASC',
|
213 |
-
'tax_query' => array( //phpcs:ignore
|
214 |
-
array(
|
215 |
-
'taxonomy' => CARTFLOWS_TAXONOMY_STEP_TYPE,
|
216 |
-
'field' => 'slug',
|
217 |
-
'terms' => 'checkout',
|
218 |
-
),
|
219 |
-
),
|
220 |
-
'meta_query' => array( //phpcs:ignore
|
221 |
-
array(
|
222 |
-
'key' => 'wcf-control-step',
|
223 |
-
'compare' => 'NOT EXISTS',
|
224 |
-
),
|
225 |
-
),
|
226 |
-
)
|
227 |
-
);
|
228 |
-
|
229 |
-
$output = '<div class="form-field" id="form-field-' . $id . '">';
|
230 |
-
|
231 |
-
$output .= '<div class="form-field-label">';
|
232 |
-
$output .= '<label for="' . $id . '">';
|
233 |
-
$output .= $title;
|
234 |
-
$output .= '</label>';
|
235 |
-
$output .= '</div>';
|
236 |
-
|
237 |
-
$output .= '<div class="form-field-data">';
|
238 |
-
$output .= '<select id="wcf_' . $id . '" name="' . $name . '">';
|
239 |
-
|
240 |
-
if ( ! empty( $checkout_steps ) ) {
|
241 |
-
$output .= '<option value="">' . __( 'Select', 'cartflows' ) . '</option>';
|
242 |
-
} else {
|
243 |
-
|
244 |
-
$output .= '<option value="">' . __( 'No Checkout Steps', 'cartflows' ) . '</option>';
|
245 |
-
}
|
246 |
-
|
247 |
-
foreach ( $checkout_steps as $index => $step_data ) {
|
248 |
-
|
249 |
-
$output .= '<option value="' . $step_data->ID . '" ' . selected( $value, $step_data->ID, false ) . '>' . $step_data->post_title . ' (#' . $step_data->ID . ') </option>';
|
250 |
-
}
|
251 |
-
|
252 |
-
$output .= '</select>';
|
253 |
-
$output .= '</div>';
|
254 |
-
|
255 |
-
if ( '' !== $value ) {
|
256 |
-
$output .= '<div class="form-field-actions">';
|
257 |
-
$output .= '<a href="' . get_edit_post_link( $value ) . '" target="_blank" class="" title="Edit">';
|
258 |
-
$output .= '<span class="dashicons dashicons-edit"></span>';
|
259 |
-
$output .= '<span class="">Edit</span>';
|
260 |
-
$output .= '</a>';
|
261 |
-
$output .= '<a href="' . get_permalink( $value ) . '" target="_blank" class="" title="View">';
|
262 |
-
$output .= '<span class="dashicons dashicons-visibility"></span>';
|
263 |
-
$output .= '<span class="">View</span>';
|
264 |
-
$output .= '</a>';
|
265 |
-
$output .= '</div>';
|
266 |
-
}
|
267 |
-
|
268 |
-
$output .= '<div class="form-field-desc">';
|
269 |
-
/* translators: %s: link */
|
270 |
-
$output .= '<p>' . sprintf( __( 'Be sure not to add any product in above selected Global Checkout step. Please read information about how to set up Global Checkout %1$shere%2$s.', 'cartflows' ), '<a href="https://cartflows.com/docs/global-checkout/" target="_blank">', '</a>' ) . '</p>';
|
271 |
-
$output .= '</div>';
|
272 |
-
|
273 |
-
$output .= '</div>';
|
274 |
-
|
275 |
-
return $output;
|
276 |
-
}
|
277 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* CARTFLOWS Admin Fields.
|
4 |
+
*
|
5 |
+
* @package CARTFLOWS
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class Cartflows_Admin_Fields.
|
10 |
+
*/
|
11 |
+
class Cartflows_Admin_Fields {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Title Field
|
15 |
+
*
|
16 |
+
* @param array $args Args.
|
17 |
+
* @return string
|
18 |
+
*/
|
19 |
+
public static function title_field( $args ) {
|
20 |
+
|
21 |
+
$title = $args['title'];
|
22 |
+
$description = isset( $args['description'] ) ? $args['description'] : '';
|
23 |
+
|
24 |
+
$output = '<h4 class="form-field wcf-title-field">';
|
25 |
+
$output .= '<span>' . $title . '</span>';
|
26 |
+
$output .= '</h4>';
|
27 |
+
|
28 |
+
if ( ! empty( $description ) ) {
|
29 |
+
$output .= '<div class="form-field-desc">';
|
30 |
+
$output .= '<p>' . $description . '</p>';
|
31 |
+
$output .= '</div>';
|
32 |
+
}
|
33 |
+
|
34 |
+
return $output;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Text Field
|
39 |
+
*
|
40 |
+
* @param array $args Args.
|
41 |
+
* @return string
|
42 |
+
*/
|
43 |
+
public static function text_field( $args ) {
|
44 |
+
|
45 |
+
$id = $args['id'];
|
46 |
+
$name = $args['name'];
|
47 |
+
$title = $args['title'];
|
48 |
+
$value = $args['value'];
|
49 |
+
$description = isset( $args['description'] ) ? $args['description'] : '';
|
50 |
+
$placeholder = isset( $args['placeholder'] ) ? $args['placeholder'] : '';
|
51 |
+
|
52 |
+
$output = '<div class="form-field" id="form-field-' . $id . '">';
|
53 |
+
$output .= '<label for="' . $id . '">' . $title . '</label>';
|
54 |
+
$output .= '<input placeholder="' . $placeholder . '" type="text" name="' . $name . '" id="' . $id . '" class="placeholder placeholder-active" value="' . esc_attr( $value ) . '">';
|
55 |
+
$output .= '</div>';
|
56 |
+
|
57 |
+
if ( ! empty( $description ) ) {
|
58 |
+
$output .= '<div class="form-field-desc">';
|
59 |
+
$output .= '<p>';
|
60 |
+
$output .= $description;
|
61 |
+
$output .= '</p>';
|
62 |
+
$output .= '</div>';
|
63 |
+
}
|
64 |
+
|
65 |
+
return $output;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* URL Field
|
70 |
+
*
|
71 |
+
* @param array $args Args.
|
72 |
+
* @return string
|
73 |
+
*/
|
74 |
+
public static function url_field( $args ) {
|
75 |
+
|
76 |
+
$id = $args['id'];
|
77 |
+
$name = $args['name'];
|
78 |
+
$title = $args['title'];
|
79 |
+
$value = $args['value'];
|
80 |
+
|
81 |
+
$output = '<div class="form-field">';
|
82 |
+
$output .= '<label for="' . $id . '">' . $title . '</label>';
|
83 |
+
$output .= '<input type="text" name="' . $name . '" id="' . $id . '" class="placeholder placeholder-active" value="' . esc_url( $value ) . '">';
|
84 |
+
$output .= '</div>';
|
85 |
+
|
86 |
+
return $output;
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Checkbox Field
|
91 |
+
*
|
92 |
+
* @param array $args Args.
|
93 |
+
* @return string
|
94 |
+
*/
|
95 |
+
public static function checkobox_field( $args ) {
|
96 |
+
|
97 |
+
$id = $args['id'];
|
98 |
+
$name = $args['name'];
|
99 |
+
$title = $args['title'];
|
100 |
+
$value = $args['value'];
|
101 |
+
|
102 |
+
$output = '<div class="form-field" id="form-field-' . $id . '">';
|
103 |
+
$output .= '<label for="' . $id . '">';
|
104 |
+
$output .= '<input type="hidden" id="wcf_hid_' . $id . '" name="' . $name . '" value="disable">';
|
105 |
+
$output .= '<input type="checkbox" id="wcf_' . $id . '" name="' . $name . '" value="enable" ' . checked( $value, 'enable', false ) . '>';
|
106 |
+
$output .= $title;
|
107 |
+
$output .= '</label>';
|
108 |
+
$output .= '</div>';
|
109 |
+
|
110 |
+
return $output;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Radio Field
|
115 |
+
*
|
116 |
+
* @param array $args Args.
|
117 |
+
* @return string
|
118 |
+
*/
|
119 |
+
public static function radio_field( $args ) {
|
120 |
+
|
121 |
+
$name = $args['name'];
|
122 |
+
$id = $args['id'];
|
123 |
+
$options = $args['options'];
|
124 |
+
$value = $args['value'];
|
125 |
+
|
126 |
+
$output = '';
|
127 |
+
|
128 |
+
if ( isset( $args['title'] ) ) {
|
129 |
+
$output .= '<h4 class="form-field-label">';
|
130 |
+
$output .= '<span>' . $args['title'] . '</span>';
|
131 |
+
$output .= '</h4>';
|
132 |
+
}
|
133 |
+
|
134 |
+
foreach ( $options as $type => $data ) {
|
135 |
+
|
136 |
+
$output .= '<div class="form-field">';
|
137 |
+
$output .= '<label for="' . $id . '">';
|
138 |
+
$output .= '<input type="radio" class="wcf_permalink_structure" name="' . $name . '" value="' . $type . '" ' . checked( $value, $type, false ) . '>' . $data['label'] . '</label>';
|
139 |
+
$output .= '<div class="form-field-desc">';
|
140 |
+
$output .= '<p>';
|
141 |
+
|
142 |
+
$output .= $data['description'];
|
143 |
+
|
144 |
+
$output .= '</p>';
|
145 |
+
$output .= '</div>';
|
146 |
+
$output .= '</div>';
|
147 |
+
}
|
148 |
+
|
149 |
+
return $output;
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Select Field
|
154 |
+
*
|
155 |
+
* @since 1.1.4
|
156 |
+
*
|
157 |
+
* @param array $args Args.
|
158 |
+
* @return string
|
159 |
+
*/
|
160 |
+
public static function select_field( $args ) {
|
161 |
+
|
162 |
+
$id = $args['id'];
|
163 |
+
$name = $args['name'];
|
164 |
+
$title = $args['title'];
|
165 |
+
$description = $args['description'];
|
166 |
+
$value = $args['value'];
|
167 |
+
$options = $args['options'];
|
168 |
+
|
169 |
+
$output = '<div class="form-field" id="form-field-' . $id . '">';
|
170 |
+
|
171 |
+
$output .= '<div class="form-field-label">';
|
172 |
+
$output .= $title;
|
173 |
+
$output .= '</div>';
|
174 |
+
|
175 |
+
$output .= '<div class="form-field-data">';
|
176 |
+
$output .= '<select id="wcf_' . $id . '" name="' . $name . '">';
|
177 |
+
foreach ( $options as $option_value => $option_title ) {
|
178 |
+
$output .= '<option value="' . $option_value . '" ' . selected( $value, $option_value, false ) . '>' . $option_title . '</option>';
|
179 |
+
}
|
180 |
+
$output .= '</select>';
|
181 |
+
$output .= '</div>';
|
182 |
+
|
183 |
+
$output .= '<div class="form-field-desc">';
|
184 |
+
$output .= '<p>';
|
185 |
+
$output .= $description;
|
186 |
+
$output .= '</p>';
|
187 |
+
$output .= '</div>';
|
188 |
+
$output .= '</div>';
|
189 |
+
|
190 |
+
return $output;
|
191 |
+
}
|
192 |
+
|
193 |
+
/**
|
194 |
+
* Checkout Selection Field
|
195 |
+
*
|
196 |
+
* @param array $args Args.
|
197 |
+
* @return string
|
198 |
+
*/
|
199 |
+
public static function flow_checkout_selection_field( $args ) {
|
200 |
+
|
201 |
+
$id = $args['id'];
|
202 |
+
$name = $args['name'];
|
203 |
+
$title = $args['title'];
|
204 |
+
$value = $args['value'];
|
205 |
+
|
206 |
+
$checkout_steps = get_posts(
|
207 |
+
array(
|
208 |
+
'posts_per_page' => -1,
|
209 |
+
'post_type' => CARTFLOWS_STEP_POST_TYPE,
|
210 |
+
'post_status' => 'publish',
|
211 |
+
'orderby' => 'ID',
|
212 |
+
'order' => 'ASC',
|
213 |
+
'tax_query' => array( //phpcs:ignore
|
214 |
+
array(
|
215 |
+
'taxonomy' => CARTFLOWS_TAXONOMY_STEP_TYPE,
|
216 |
+
'field' => 'slug',
|
217 |
+
'terms' => 'checkout',
|
218 |
+
),
|
219 |
+
),
|
220 |
+
'meta_query' => array( //phpcs:ignore
|
221 |
+
array(
|
222 |
+
'key' => 'wcf-control-step',
|
223 |
+
'compare' => 'NOT EXISTS',
|
224 |
+
),
|
225 |
+
),
|
226 |
+
)
|
227 |
+
);
|
228 |
+
|
229 |
+
$output = '<div class="form-field" id="form-field-' . $id . '">';
|
230 |
+
|
231 |
+
$output .= '<div class="form-field-label">';
|
232 |
+
$output .= '<label for="' . $id . '">';
|
233 |
+
$output .= $title;
|
234 |
+
$output .= '</label>';
|
235 |
+
$output .= '</div>';
|
236 |
+
|
237 |
+
$output .= '<div class="form-field-data">';
|
238 |
+
$output .= '<select id="wcf_' . $id . '" name="' . $name . '">';
|
239 |
+
|
240 |
+
if ( ! empty( $checkout_steps ) ) {
|
241 |
+
$output .= '<option value="">' . __( 'Select', 'cartflows' ) . '</option>';
|
242 |
+
} else {
|
243 |
+
|
244 |
+
$output .= '<option value="">' . __( 'No Checkout Steps', 'cartflows' ) . '</option>';
|
245 |
+
}
|
246 |
+
|
247 |
+
foreach ( $checkout_steps as $index => $step_data ) {
|
248 |
+
|
249 |
+
$output .= '<option value="' . $step_data->ID . '" ' . selected( $value, $step_data->ID, false ) . '>' . $step_data->post_title . ' (#' . $step_data->ID . ') </option>';
|
250 |
+
}
|
251 |
+
|
252 |
+
$output .= '</select>';
|
253 |
+
$output .= '</div>';
|
254 |
+
|
255 |
+
if ( '' !== $value ) {
|
256 |
+
$output .= '<div class="form-field-actions">';
|
257 |
+
$output .= '<a href="' . get_edit_post_link( $value ) . '" target="_blank" class="" title="Edit">';
|
258 |
+
$output .= '<span class="dashicons dashicons-edit"></span>';
|
259 |
+
$output .= '<span class="">Edit</span>';
|
260 |
+
$output .= '</a>';
|
261 |
+
$output .= '<a href="' . get_permalink( $value ) . '" target="_blank" class="" title="View">';
|
262 |
+
$output .= '<span class="dashicons dashicons-visibility"></span>';
|
263 |
+
$output .= '<span class="">View</span>';
|
264 |
+
$output .= '</a>';
|
265 |
+
$output .= '</div>';
|
266 |
+
}
|
267 |
+
|
268 |
+
$output .= '<div class="form-field-desc">';
|
269 |
+
/* translators: %s: link */
|
270 |
+
$output .= '<p>' . sprintf( __( 'Be sure not to add any product in above selected Global Checkout step. Please read information about how to set up Global Checkout %1$shere%2$s.', 'cartflows' ), '<a href="https://cartflows.com/docs/global-checkout/" target="_blank">', '</a>' ) . '</p>';
|
271 |
+
$output .= '</div>';
|
272 |
+
|
273 |
+
$output .= '</div>';
|
274 |
+
|
275 |
+
return $output;
|
276 |
+
}
|
277 |
+
}
|
classes/class-cartflows-admin.php
CHANGED
@@ -1,750 +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 |
-
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();
|
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-default-meta.php
CHANGED
@@ -1,855 +1,855 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Cartflow default options.
|
4 |
-
*
|
5 |
-
* @package Cartflows
|
6 |
-
*/
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Initialization
|
10 |
-
*
|
11 |
-
* @since 1.0.0
|
12 |
-
*/
|
13 |
-
class Cartflows_Default_Meta {
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Member Variable
|
19 |
-
*
|
20 |
-
* @var instance
|
21 |
-
*/
|
22 |
-
private static $instance;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Member Variable
|
26 |
-
*
|
27 |
-
* @var checkout_fields
|
28 |
-
*/
|
29 |
-
private static $checkout_fields = null;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Member Variable
|
33 |
-
*
|
34 |
-
* @var checkout_fields
|
35 |
-
*/
|
36 |
-
private static $thankyou_fields = null;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Member Variable
|
40 |
-
*
|
41 |
-
* @var flow_fields
|
42 |
-
*/
|
43 |
-
private static $flow_fields = null;
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Member Variable
|
47 |
-
*
|
48 |
-
* @var landing_fields
|
49 |
-
*/
|
50 |
-
private static $landing_fields = null;
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Member Variable
|
54 |
-
*
|
55 |
-
* @var optin_fields
|
56 |
-
*/
|
57 |
-
private static $optin_fields = null;
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Initiator
|
61 |
-
*/
|
62 |
-
public static function get_instance() {
|
63 |
-
if ( ! isset( self::$instance ) ) {
|
64 |
-
self::$instance = new self();
|
65 |
-
}
|
66 |
-
return self::$instance;
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Constructor
|
71 |
-
*/
|
72 |
-
public function __construct() {
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Checkout Default fields.
|
77 |
-
*
|
78 |
-
* @param int $post_id post id.
|
79 |
-
* @return array
|
80 |
-
*/
|
81 |
-
public function get_checkout_fields( $post_id ) {
|
82 |
-
|
83 |
-
if ( null === self::$checkout_fields ) {
|
84 |
-
self::$checkout_fields = array(
|
85 |
-
'wcf-field-google-font-url' => array(
|
86 |
-
'default' => '',
|
87 |
-
'sanitize' => 'FILTER_DEFAULT',
|
88 |
-
),
|
89 |
-
'wcf-checkout-products' => array(
|
90 |
-
'default' => array(),
|
91 |
-
'sanitize' => 'FILTER_CARTFLOWS_CHECKOUT_PRODUCTS',
|
92 |
-
),
|
93 |
-
'wcf-checkout-layout' => array(
|
94 |
-
'default' => 'two-column',
|
95 |
-
'sanitize' => 'FILTER_DEFAULT',
|
96 |
-
),
|
97 |
-
'wcf-input-font-family' => array(
|
98 |
-
'default' => '',
|
99 |
-
'sanitize' => 'FILTER_DEFAULT',
|
100 |
-
),
|
101 |
-
'wcf-input-font-weight' => array(
|
102 |
-
'default' => '',
|
103 |
-
'sanitize' => 'FILTER_DEFAULT',
|
104 |
-
),
|
105 |
-
'wcf-heading-font-family' => array(
|
106 |
-
'default' => '',
|
107 |
-
'sanitize' => 'FILTER_DEFAULT',
|
108 |
-
),
|
109 |
-
'wcf-heading-font-weight' => array(
|
110 |
-
'default' => '',
|
111 |
-
'sanitize' => 'FILTER_DEFAULT',
|
112 |
-
),
|
113 |
-
'wcf-base-font-family' => array(
|
114 |
-
'default' => '',
|
115 |
-
'sanitize' => 'FILTER_DEFAULT',
|
116 |
-
),
|
117 |
-
'wcf-advance-options-fields' => array(
|
118 |
-
'default' => '',
|
119 |
-
'sanitize' => 'FILTER_DEFAULT',
|
120 |
-
),
|
121 |
-
'wcf-remove-product-field' => array(
|
122 |
-
'default' => '',
|
123 |
-
'sanitize' => 'FILTER_DEFAULT',
|
124 |
-
),
|
125 |
-
'wcf-checkout-place-order-button-text' => array(
|
126 |
-
'default' => '',
|
127 |
-
'sanitize' => 'FILTER_SANITIZE_STRING',
|
128 |
-
),
|
129 |
-
'wcf-base-font-weight' => array(
|
130 |
-
'default' => '',
|
131 |
-
'sanitize' => 'FILTER_DEFAULT',
|
132 |
-
),
|
133 |
-
'wcf-button-font-family' => array(
|
134 |
-
'default' => '',
|
135 |
-
'sanitize' => 'FILTER_DEFAULT',
|
136 |
-
),
|
137 |
-
'wcf-button-font-weight' => array(
|
138 |
-
'default' => '',
|
139 |
-
'sanitize' => 'FILTER_DEFAULT',
|
140 |
-
),
|
141 |
-
'wcf-primary-color' => array(
|
142 |
-
'default' => '',
|
143 |
-
'sanitize' => 'FILTER_DEFAULT',
|
144 |
-
),
|
145 |
-
'wcf-heading-color' => array(
|
146 |
-
'default' => '',
|
147 |
-
'sanitize' => 'FILTER_DEFAULT',
|
148 |
-
),
|
149 |
-
'wcf-section-bg-color' => array(
|
150 |
-
'default' => '',
|
151 |
-
'sanitize' => 'FILTER_DEFAULT',
|
152 |
-
),
|
153 |
-
'wcf-hl-bg-color' => array(
|
154 |
-
'default' => '',
|
155 |
-
'sanitize' => 'FILTER_DEFAULT',
|
156 |
-
),
|
157 |
-
'wcf-field-tb-padding' => array(
|
158 |
-
'default' => '',
|
159 |
-
'sanitize' => 'FILTER_DEFAULT',
|
160 |
-
),
|
161 |
-
'wcf-field-lr-padding' => array(
|
162 |
-
'default' => '',
|
163 |
-
'sanitize' => 'FILTER_DEFAULT',
|
164 |
-
),
|
165 |
-
'wcf-fields-skins' => array(
|
166 |
-
'default' => '',
|
167 |
-
'sanitize' => 'FILTER_DEFAULT',
|
168 |
-
),
|
169 |
-
'wcf-input-field-size' => array(
|
170 |
-
'default' => '33px',
|
171 |
-
'sanitize' => 'FILTER_DEFAULT',
|
172 |
-
),
|
173 |
-
'wcf-field-color' => array(
|
174 |
-
'default' => '',
|
175 |
-
'sanitize' => 'FILTER_DEFAULT',
|
176 |
-
),
|
177 |
-
'wcf-field-bg-color' => array(
|
178 |
-
'default' => '',
|
179 |
-
'sanitize' => 'FILTER_DEFAULT',
|
180 |
-
),
|
181 |
-
'wcf-field-border-color' => array(
|
182 |
-
'default' => '',
|
183 |
-
'sanitize' => 'FILTER_DEFAULT',
|
184 |
-
),
|
185 |
-
'wcf-box-border-color' => array(
|
186 |
-
'default' => '',
|
187 |
-
'sanitize' => 'FILTER_DEFAULT',
|
188 |
-
),
|
189 |
-
'wcf-field-label-color' => array(
|
190 |
-
'default' => '',
|
191 |
-
'sanitize' => 'FILTER_DEFAULT',
|
192 |
-
),
|
193 |
-
'wcf-submit-tb-padding' => array(
|
194 |
-
'default' => '',
|
195 |
-
'sanitize' => 'FILTER_DEFAULT',
|
196 |
-
),
|
197 |
-
'wcf-submit-lr-padding' => array(
|
198 |
-
'default' => '',
|
199 |
-
'sanitize' => 'FILTER_DEFAULT',
|
200 |
-
),
|
201 |
-
'wcf-input-button-size' => array(
|
202 |
-
'default' => '33px',
|
203 |
-
'sanitize' => 'FILTER_DEFAULT',
|
204 |
-
),
|
205 |
-
'wcf-submit-color' => array(
|
206 |
-
'default' => '',
|
207 |
-
'sanitize' => 'FILTER_DEFAULT',
|
208 |
-
),
|
209 |
-
'wcf-submit-hover-color' => array(
|
210 |
-
'default' => '',
|
211 |
-
'sanitize' => 'FILTER_DEFAULT',
|
212 |
-
),
|
213 |
-
'wcf-submit-bg-color' => array(
|
214 |
-
'default' => '',
|
215 |
-
'sanitize' => 'FILTER_DEFAULT',
|
216 |
-
),
|
217 |
-
'wcf-submit-bg-hover-color' => array(
|
218 |
-
'default' => '',
|
219 |
-
'sanitize' => 'FILTER_DEFAULT',
|
220 |
-
),
|
221 |
-
'wcf-submit-border-color' => array(
|
222 |
-
'default' => '',
|
223 |
-
'sanitize' => 'FILTER_DEFAULT',
|
224 |
-
),
|
225 |
-
'wcf-submit-border-hover-color' => array(
|
226 |
-
'default' => '',
|
227 |
-
'sanitize' => 'FILTER_DEFAULT',
|
228 |
-
),
|
229 |
-
'wcf-header-logo-image' => array(
|
230 |
-
'default' => '',
|
231 |
-
'sanitize' => 'FILTER_DEFAULT',
|
232 |
-
),
|
233 |
-
'wcf-header-logo-width' => array(
|
234 |
-
'default' => '',
|
235 |
-
'sanitize' => 'FILTER_DEFAULT',
|
236 |
-
),
|
237 |
-
'wcf-custom-script' => array(
|
238 |
-
'default' => '',
|
239 |
-
'sanitize' => 'FILTER_DEFAULT',
|
240 |
-
),
|
241 |
-
);
|
242 |
-
|
243 |
-
self::$checkout_fields = apply_filters( 'cartflows_checkout_meta_options', self::$checkout_fields, $post_id );
|
244 |
-
}
|
245 |
-
|
246 |
-
return self::$checkout_fields;
|
247 |
-
}
|
248 |
-
|
249 |
-
/**
|
250 |
-
* Save Checkout Meta fields.
|
251 |
-
*
|
252 |
-
* @param int $post_id post id.
|
253 |
-
* @return void
|
254 |
-
*/
|
255 |
-
public function save_checkout_fields( $post_id ) {
|
256 |
-
|
257 |
-
$post_meta = $this->get_checkout_fields( $post_id );
|
258 |
-
|
259 |
-
$this->save_meta_fields( $post_id, $post_meta );
|
260 |
-
}
|
261 |
-
|
262 |
-
/**
|
263 |
-
* Save Landing Meta fields.
|
264 |
-
*
|
265 |
-
* @param int $post_id post id.
|
266 |
-
* @return void
|
267 |
-
*/
|
268 |
-
public function save_landing_fields( $post_id ) {
|
269 |
-
|
270 |
-
$post_meta = $this->get_landing_fields( $post_id );
|
271 |
-
|
272 |
-
$this->save_meta_fields( $post_id, $post_meta );
|
273 |
-
}
|
274 |
-
|
275 |
-
/**
|
276 |
-
* Save ThankYou Meta fields.
|
277 |
-
*
|
278 |
-
* @param int $post_id post id.
|
279 |
-
* @return void
|
280 |
-
*/
|
281 |
-
public function save_thankyou_fields( $post_id ) {
|
282 |
-
|
283 |
-
$post_meta = $this->get_thankyou_fields( $post_id );
|
284 |
-
|
285 |
-
$this->save_meta_fields( $post_id, $post_meta );
|
286 |
-
}
|
287 |
-
|
288 |
-
/**
|
289 |
-
* Flow Default fields.
|
290 |
-
*
|
291 |
-
* @param int $post_id post id.
|
292 |
-
* @return array
|
293 |
-
*/
|
294 |
-
public function get_flow_fields( $post_id ) {
|
295 |
-
|
296 |
-
if ( null === self::$flow_fields ) {
|
297 |
-
self::$flow_fields = array(
|
298 |
-
'wcf-steps' => array(
|
299 |
-
'default' => array(),
|
300 |
-
'sanitize' => 'FILTER_DEFAULT',
|
301 |
-
),
|
302 |
-
|
303 |
-
'wcf-testing' => array(
|
304 |
-
'default' => 'no',
|
305 |
-
'sanitize' => 'FILTER_DEFAULT',
|
306 |
-
),
|
307 |
-
);
|
308 |
-
}
|
309 |
-
|
310 |
-
return apply_filters( 'cartflows_flow_meta_options', self::$flow_fields );
|
311 |
-
}
|
312 |
-
|
313 |
-
/**
|
314 |
-
* Save Flow Meta fields.
|
315 |
-
*
|
316 |
-
* @param int $post_id post id.
|
317 |
-
* @return void
|
318 |
-
*/
|
319 |
-
public function save_flow_fields( $post_id ) {
|
320 |
-
|
321 |
-
$post_meta = $this->get_flow_fields( $post_id );
|
322 |
-
|
323 |
-
if ( isset( $post_meta['wcf-steps'] ) ) {
|
324 |
-
unset( $post_meta['wcf-steps'] );
|
325 |
-
}
|
326 |
-
|
327 |
-
$this->save_meta_fields( $post_id, $post_meta );
|
328 |
-
}
|
329 |
-
|
330 |
-
/**
|
331 |
-
* Save Meta fields - Common Function.
|
332 |
-
*
|
333 |
-
* @param int $post_id post id.
|
334 |
-
* @param array $post_meta options to store.
|
335 |
-
* @return void
|
336 |
-
*/
|
337 |
-
public function save_meta_fields( $post_id, $post_meta ) {
|
338 |
-
|
339 |
-
if ( ! ( $post_id && is_array( $post_meta ) ) ) {
|
340 |
-
return;
|
341 |
-
}
|
342 |
-
|
343 |
-
foreach ( $post_meta as $key => $data ) {
|
344 |
-
$meta_value = false;
|
345 |
-
|
346 |
-
// Sanitize values.
|
347 |
-
$sanitize_filter = ( isset( $data['sanitize'] ) ) ? $data['sanitize'] : 'FILTER_DEFAULT';
|
348 |
-
|
349 |
-
switch ( $sanitize_filter ) {
|
350 |
-
case 'FILTER_SANITIZE_STRING':
|
351 |
-
$meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_STRING );
|
352 |
-
break;
|
353 |
-
|
354 |
-
case 'FILTER_SANITIZE_URL':
|
355 |
-
$meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_URL );
|
356 |
-
break;
|
357 |
-
|
358 |
-
case 'FILTER_SANITIZE_NUMBER_INT':
|
359 |
-
$meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_NUMBER_INT );
|
360 |
-
break;
|
361 |
-
|
362 |
-
case 'FILTER_CARTFLOWS_ARRAY':
|
363 |
-
if ( isset( $_POST[ $key ] ) && is_array( $_POST[ $key ] ) ) { //phpcs:ignore
|
364 |
-
$meta_value = array_map( 'sanitize_text_field', wp_unslash( $_POST[ $key ] ) ); //phpcs:ignore
|
365 |
-
}
|
366 |
-
break;
|
367 |
-
|
368 |
-
case 'FILTER_CARTFLOWS_CHECKOUT_PRODUCTS':
|
369 |
-
if ( isset( $_POST[ $key ] ) && is_array( $_POST[ $key ] ) ) { //phpcs:ignore
|
370 |
-
$i = 0;
|
371 |
-
$q = 0;
|
372 |
-
|
373 |
-
foreach ( $_POST[ $key ] as $p_index => $p_data ) { // phpcs:ignore
|
374 |
-
if ( ! array_key_exists( 'product', $p_data ) ) {
|
375 |
-
continue;
|
376 |
-
}
|
377 |
-
foreach ( $p_data as $i_key => $i_value ) {
|
378 |
-
|
379 |
-
if ( is_array( $i_value ) ) {
|
380 |
-
foreach ( $i_value as $q_key => $q_value ) {
|
381 |
-
$meta_value[ $i ][ $i_key ][ $q ] = array_map( 'sanitize_text_field', $q_value );
|
382 |
-
|
383 |
-
$q++;
|
384 |
-
}
|
385 |
-
} else {
|
386 |
-
$meta_value[ $i ][ $i_key ] = sanitize_text_field( $i_value );
|
387 |
-
}
|
388 |
-
}
|
389 |
-
|
390 |
-
$i++;
|
391 |
-
}
|
392 |
-
}
|
393 |
-
break;
|
394 |
-
|
395 |
-
case 'FILTER_CARTFLOWS_IMAGES':
|
396 |
-
$meta_value = filter_input( INPUT_POST, $key, FILTER_DEFAULT );
|
397 |
-
|
398 |
-
if ( isset( $_POST[ $key . '-obj' ] )) { //phpcs:ignore
|
399 |
-
|
400 |
-
if ( ! is_serialized( $_POST[ $key . '-obj' ] ) ) { //phpcs:ignore
|
401 |
-
|
402 |
-
$image_obj = json_decode( stripcslashes( wp_unslash( $_POST[ $key . '-obj' ] ) ), true ); //phpcs:ignore
|
403 |
-
$image_url = isset( $image_obj['sizes'] ) ? $image_obj['sizes'] : array();
|
404 |
-
|
405 |
-
$image_data = array(
|
406 |
-
'id' => isset( $image_obj['id'] ) ? intval( $image_obj['id'] ) : 0,
|
407 |
-
'url' => array(
|
408 |
-
'thumbnail' => isset( $image_url['thumbnail']['url'] ) ? esc_url_raw( $image_url['thumbnail']['url'] ) : '',
|
409 |
-
'medium' => isset( $image_url['medium']['url'] ) ? esc_url_raw( $image_url['medium']['url'] ) : '',
|
410 |
-
'full' => isset( $image_url['full']['url'] ) ? esc_url_raw( $image_url['full']['url'] ) : '',
|
411 |
-
),
|
412 |
-
);
|
413 |
-
|
414 |
-
$new_meta_value = 0 !== $image_data['id'] ? $image_data : '';
|
415 |
-
update_post_meta( $post_id, $key . '-obj', $new_meta_value );
|
416 |
-
}
|
417 |
-
}
|
418 |
-
|
419 |
-
break;
|
420 |
-
|
421 |
-
default:
|
422 |
-
if ( 'FILTER_DEFAULT' === $sanitize_filter ) {
|
423 |
-
$meta_value = filter_input( INPUT_POST, $key, FILTER_DEFAULT );
|
424 |
-
} else {
|
425 |
-
$meta_value = apply_filters( 'cartflows_save_meta_field_values', $meta_value, $post_id, $key, $sanitize_filter );
|
426 |
-
}
|
427 |
-
|
428 |
-
break;
|
429 |
-
}
|
430 |
-
|
431 |
-
if ( false !== $meta_value ) {
|
432 |
-
update_post_meta( $post_id, $key, $meta_value );
|
433 |
-
} else {
|
434 |
-
delete_post_meta( $post_id, $key );
|
435 |
-
}
|
436 |
-
}
|
437 |
-
}
|
438 |
-
|
439 |
-
/**
|
440 |
-
* Get checkout meta.
|
441 |
-
*
|
442 |
-
* @param int $post_id post id.
|
443 |
-
* @param string $key options key.
|
444 |
-
* @param mix $default options default value.
|
445 |
-
* @return string
|
446 |
-
*/
|
447 |
-
public function get_flow_meta_value( $post_id, $key, $default = false ) {
|
448 |
-
|
449 |
-
$value = $this->get_save_meta( $post_id, $key );
|
450 |
-
|
451 |
-
if ( ! $value ) {
|
452 |
-
if ( $default ) {
|
453 |
-
$value = $default;
|
454 |
-
} else {
|
455 |
-
$fields = $this->get_flow_fields( $post_id );
|
456 |
-
|
457 |
-
if ( isset( $fields[ $key ]['default'] ) ) {
|
458 |
-
$value = $fields[ $key ]['default'];
|
459 |
-
}
|
460 |
-
}
|
461 |
-
}
|
462 |
-
|
463 |
-
return $value;
|
464 |
-
}
|
465 |
-
|
466 |
-
/**
|
467 |
-
* Get checkout meta.
|
468 |
-
*
|
469 |
-
* @param int $post_id post id.
|
470 |
-
* @param string $key options key.
|
471 |
-
* @param mix $default options default value.
|
472 |
-
* @return string
|
473 |
-
*/
|
474 |
-
public function get_checkout_meta_value( $post_id = 0, $key = '', $default = false ) {
|
475 |
-
|
476 |
-
$value = $this->get_save_meta( $post_id, $key );
|
477 |
-
|
478 |
-
if ( ! $value ) {
|
479 |
-
if ( false !== $default ) {
|
480 |
-
$value = $default;
|
481 |
-
} else {
|
482 |
-
$fields = $this->get_checkout_fields( $post_id );
|
483 |
-
|
484 |
-
if ( isset( $fields[ $key ]['default'] ) ) {
|
485 |
-
$value = $fields[ $key ]['default'];
|
486 |
-
}
|
487 |
-
}
|
488 |
-
}
|
489 |
-
|
490 |
-
return apply_filters( "cartflows_checkout_meta_{$key}", $value );
|
491 |
-
}
|
492 |
-
|
493 |
-
/**
|
494 |
-
* Get post meta.
|
495 |
-
*
|
496 |
-
* @param int $post_id post id.
|
497 |
-
* @param string $key options key.
|
498 |
-
* @return string
|
499 |
-
*/
|
500 |
-
public function get_save_meta( $post_id, $key ) {
|
501 |
-
|
502 |
-
return get_post_meta( $post_id, $key, true );
|
503 |
-
}
|
504 |
-
|
505 |
-
/**
|
506 |
-
* Thank You Default fields.
|
507 |
-
*
|
508 |
-
* @param int $post_id post id.
|
509 |
-
* @return array
|
510 |
-
*/
|
511 |
-
public function get_thankyou_fields( $post_id ) {
|
512 |
-
|
513 |
-
if ( null === self::$thankyou_fields ) {
|
514 |
-
self::$thankyou_fields = array(
|
515 |
-
'wcf-field-google-font-url' => array(
|
516 |
-
'default' => '',
|
517 |
-
'sanitize' => 'FILTER_DEFAULT',
|
518 |
-
),
|
519 |
-
'wcf-tq-text-color' => array(
|
520 |
-
'default' => '',
|
521 |
-
'sanitize' => 'FILTER_DEFAULT',
|
522 |
-
),
|
523 |
-
'wcf-tq-font-family' => array(
|
524 |
-
'default' => '',
|
525 |
-
'sanitize' => 'FILTER_DEFAULT',
|
526 |
-
),
|
527 |
-
'wcf-tq-font-size' => array(
|
528 |
-
'default' => '',
|
529 |
-
'sanitize' => 'FILTER_DEFAULT',
|
530 |
-
),
|
531 |
-
'wcf-tq-heading-color' => array(
|
532 |
-
'default' => '',
|
533 |
-
'sanitize' => 'FILTER_DEFAULT',
|
534 |
-
),
|
535 |
-
'wcf-tq-heading-font-family' => array(
|
536 |
-
'default' => '',
|
537 |
-
'sanitize' => 'FILTER_DEFAULT',
|
538 |
-
),
|
539 |
-
'wcf-tq-heading-font-wt' => array(
|
540 |
-
'default' => '',
|
541 |
-
'sanitize' => 'FILTER_DEFAULT',
|
542 |
-
),
|
543 |
-
'wcf-tq-container-width' => array(
|
544 |
-
'default' => '',
|
545 |
-
'sanitize' => 'FILTER_DEFAULT',
|
546 |
-
),
|
547 |
-
'wcf-tq-section-bg-color' => array(
|
548 |
-
'default' => '',
|
549 |
-
'sanitize' => 'FILTER_DEFAULT',
|
550 |
-
),
|
551 |
-
'wcf-tq-advance-options-fields' => array(
|
552 |
-
'default' => '',
|
553 |
-
'sanitize' => 'FILTER_DEFAULT',
|
554 |
-
),
|
555 |
-
'wcf-show-overview-section' => array(
|
556 |
-
'default' => 'yes',
|
557 |
-
'sanitize' => 'FILTER_DEFAULT',
|
558 |
-
),
|
559 |
-
'wcf-show-details-section' => array(
|
560 |
-
'default' => 'yes',
|
561 |
-
'sanitize' => 'FILTER_DEFAULT',
|
562 |
-
),
|
563 |
-
'wcf-show-billing-section' => array(
|
564 |
-
'default' => 'yes',
|
565 |
-
'sanitize' => 'FILTER_DEFAULT',
|
566 |
-
),
|
567 |
-
'wcf-show-shipping-section' => array(
|
568 |
-
'default' => 'yes',
|
569 |
-
'sanitize' => 'FILTER_DEFAULT',
|
570 |
-
),
|
571 |
-
'wcf-show-tq-redirect-section' => array(
|
572 |
-
'default' => '',
|
573 |
-
'sanitize' => 'FILTER_DEFAULT',
|
574 |
-
),
|
575 |
-
'wcf-tq-redirect-link' => array(
|
576 |
-
'default' => '',
|
577 |
-
'sanitize' => 'FILTER_SANITIZE_URL',
|
578 |
-
),
|
579 |
-
'wcf-tq-text' => array(
|
580 |
-
'default' => '',
|
581 |
-
'sanitize' => 'FILTER_DEFAULT',
|
582 |
-
),
|
583 |
-
'wcf-custom-script' => array(
|
584 |
-
'default' => '',
|
585 |
-
'sanitize' => 'FILTER_DEFAULT',
|
586 |
-
),
|
587 |
-
);
|
588 |
-
}
|
589 |
-
|
590 |
-
return apply_filters( 'cartflows_thankyou_meta_options', self::$thankyou_fields, $post_id );
|
591 |
-
}
|
592 |
-
|
593 |
-
/**
|
594 |
-
* Get Thank you section meta.
|
595 |
-
*
|
596 |
-
* @param int $post_id post id.
|
597 |
-
* @param string $key options key.
|
598 |
-
* @param mix $default options default value.
|
599 |
-
* @return string
|
600 |
-
*/
|
601 |
-
public function get_thankyou_meta_value( $post_id, $key, $default = false ) {
|
602 |
-
|
603 |
-
$value = $this->get_save_meta( $post_id, $key );
|
604 |
-
|
605 |
-
if ( ! $value ) {
|
606 |
-
if ( $default ) {
|
607 |
-
$value = $default;
|
608 |
-
} else {
|
609 |
-
$fields = $this->get_thankyou_fields( $post_id );
|
610 |
-
|
611 |
-
if ( isset( $fields[ $key ]['default'] ) ) {
|
612 |
-
$value = $fields[ $key ]['default'];
|
613 |
-
}
|
614 |
-
}
|
615 |
-
}
|
616 |
-
|
617 |
-
return apply_filters( "cartflows_thankyou_meta_{$key}", $value );
|
618 |
-
}
|
619 |
-
|
620 |
-
/**
|
621 |
-
* Get Landing section meta.
|
622 |
-
*
|
623 |
-
* @param int $post_id post id.
|
624 |
-
* @param string $key options key.
|
625 |
-
* @param mix $default options default value.
|
626 |
-
* @return string
|
627 |
-
*/
|
628 |
-
public function get_landing_meta_value( $post_id, $key, $default = false ) {
|
629 |
-
|
630 |
-
$value = $this->get_save_meta( $post_id, $key );
|
631 |
-
if ( ! $value ) {
|
632 |
-
if ( $default ) {
|
633 |
-
$value = $default;
|
634 |
-
} else {
|
635 |
-
$fields = $this->get_landing_fields( $post_id );
|
636 |
-
|
637 |
-
if ( isset( $fields[ $key ]['default'] ) ) {
|
638 |
-
$value = $fields[ $key ]['default'];
|
639 |
-
}
|
640 |
-
}
|
641 |
-
}
|
642 |
-
|
643 |
-
return $value;
|
644 |
-
}
|
645 |
-
|
646 |
-
/**
|
647 |
-
* Landing Default fields.
|
648 |
-
*
|
649 |
-
* @param int $post_id post id.
|
650 |
-
* @return array
|
651 |
-
*/
|
652 |
-
public function get_landing_fields( $post_id ) {
|
653 |
-
|
654 |
-
if ( null === self::$landing_fields ) {
|
655 |
-
self::$landing_fields = array(
|
656 |
-
'wcf-custom-script' => array(
|
657 |
-
'default' => '',
|
658 |
-
'sanitize' => 'FILTER_DEFAULT',
|
659 |
-
),
|
660 |
-
);
|
661 |
-
}
|
662 |
-
return apply_filters( 'cartflows_landing_meta_options', self::$landing_fields, $post_id );
|
663 |
-
}
|
664 |
-
|
665 |
-
/**
|
666 |
-
* Optin Default fields.
|
667 |
-
*
|
668 |
-
* @param int $post_id post id.
|
669 |
-
* @return array
|
670 |
-
*/
|
671 |
-
public function get_optin_fields( $post_id ) {
|
672 |
-
|
673 |
-
if ( null === self::$optin_fields ) {
|
674 |
-
self::$optin_fields = array(
|
675 |
-
|
676 |
-
'wcf-optin-product' => array(
|
677 |
-
'default' => array(),
|
678 |
-
'sanitize' => 'FILTER_CARTFLOWS_ARRAY',
|
679 |
-
),
|
680 |
-
|
681 |
-
/* Style */
|
682 |
-
'wcf-field-google-font-url' => array(
|
683 |
-
'default' => '',
|
684 |
-
'sanitize' => 'FILTER_DEFAULT',
|
685 |
-
),
|
686 |
-
'wcf-primary-color' => array(
|
687 |
-
'default' => '',
|
688 |
-
'sanitize' => 'FILTER_DEFAULT',
|
689 |
-
),
|
690 |
-
'wcf-base-font-family' => array(
|
691 |
-
'default' => '',
|
692 |
-
'sanitize' => 'FILTER_DEFAULT',
|
693 |
-
),
|
694 |
-
'wcf-input-fields-skins' => array(
|
695 |
-
'default' => '',
|
696 |
-
'sanitize' => 'FILTER_DEFAULT',
|
697 |
-
),
|
698 |
-
'wcf-input-font-family' => array(
|
699 |
-
'default' => '',
|
700 |
-
'sanitize' => 'FILTER_DEFAULT',
|
701 |
-
),
|
702 |
-
'wcf-input-font-weight' => array(
|
703 |
-
'default' => '',
|
704 |
-
'sanitize' => 'FILTER_DEFAULT',
|
705 |
-
),
|
706 |
-
'wcf-input-field-size' => array(
|
707 |
-
'default' => '33px',
|
708 |
-
'sanitize' => 'FILTER_DEFAULT',
|
709 |
-
),
|
710 |
-
'wcf-field-tb-padding' => array(
|
711 |
-
'default' => '',
|
712 |
-
'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
|
713 |
-
),
|
714 |
-
'wcf-field-lr-padding' => array(
|
715 |
-
'default' => '',
|
716 |
-
'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
|
717 |
-
),
|
718 |
-
'wcf-field-color' => array(
|
719 |
-
'default' => '',
|
720 |
-
'sanitize' => 'FILTER_DEFAULT',
|
721 |
-
),
|
722 |
-
'wcf-field-bg-color' => array(
|
723 |
-
'default' => '',
|
724 |
-
'sanitize' => 'FILTER_DEFAULT',
|
725 |
-
),
|
726 |
-
'wcf-field-border-color' => array(
|
727 |
-
'default' => '',
|
728 |
-
'sanitize' => 'FILTER_DEFAULT',
|
729 |
-
),
|
730 |
-
'wcf-field-label-color' => array(
|
731 |
-
'default' => '',
|
732 |
-
'sanitize' => 'FILTER_DEFAULT',
|
733 |
-
),
|
734 |
-
'wcf-submit-button-text' => array(
|
735 |
-
'default' => __( 'Submit', 'cartflows' ),
|
736 |
-
'sanitize' => 'FILTER_DEFAULT',
|
737 |
-
),
|
738 |
-
'wcf-submit-font-size' => array(
|
739 |
-
'default' => '',
|
740 |
-
'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
|
741 |
-
),
|
742 |
-
'wcf-button-font-family' => array(
|
743 |
-
'default' => '',
|
744 |
-
'sanitize' => 'FILTER_DEFAULT',
|
745 |
-
),
|
746 |
-
'wcf-button-font-weight' => array(
|
747 |
-
'default' => '',
|
748 |
-
'sanitize' => 'FILTER_DEFAULT',
|
749 |
-
),
|
750 |
-
'wcf-submit-button-size' => array(
|
751 |
-
'default' => '33px',
|
752 |
-
'sanitize' => 'FILTER_DEFAULT',
|
753 |
-
),
|
754 |
-
'wcf-submit-tb-padding' => array(
|
755 |
-
'default' => '',
|
756 |
-
'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
|
757 |
-
),
|
758 |
-
'wcf-submit-lr-padding' => array(
|
759 |
-
'default' => '',
|
760 |
-
'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
|
761 |
-
),
|
762 |
-
'wcf-submit-button-position' => array(
|
763 |
-
'default' => 'center',
|
764 |
-
'sanitize' => 'FILTER_DEFAULT',
|
765 |
-
),
|
766 |
-
'wcf-submit-color' => array(
|
767 |
-
'default' => '',
|
768 |
-
'sanitize' => 'FILTER_DEFAULT',
|
769 |
-
),
|
770 |
-
'wcf-submit-hover-color' => array(
|
771 |
-
'default' => '',
|
772 |
-
'sanitize' => 'FILTER_DEFAULT',
|
773 |
-
),
|
774 |
-
'wcf-submit-bg-color' => array(
|
775 |
-
'default' => '',
|
776 |
-
'sanitize' => 'FILTER_DEFAULT',
|
777 |
-
),
|
778 |
-
'wcf-submit-bg-hover-color' => array(
|
779 |
-
'default' => '',
|
780 |
-
'sanitize' => 'FILTER_DEFAULT',
|
781 |
-
),
|
782 |
-
'wcf-submit-border-color' => array(
|
783 |
-
'default' => '',
|
784 |
-
'sanitize' => 'FILTER_DEFAULT',
|
785 |
-
),
|
786 |
-
'wcf-submit-border-hover-color' => array(
|
787 |
-
'default' => '',
|
788 |
-
'sanitize' => 'FILTER_DEFAULT',
|
789 |
-
),
|
790 |
-
|
791 |
-
/* Settings */
|
792 |
-
'wcf-optin-pass-fields' => array(
|
793 |
-
'default' => '',
|
794 |
-
'sanitize' => 'FILTER_DEFAULT',
|
795 |
-
),
|
796 |
-
'wcf-optin-pass-specific-fields' => array(
|
797 |
-
'default' => 'first_name',
|
798 |
-
'sanitize' => 'FILTER_DEFAULT',
|
799 |
-
),
|
800 |
-
|
801 |
-
/* Script */
|
802 |
-
'wcf-custom-script' => array(
|
803 |
-
'default' => '',
|
804 |
-
'sanitize' => 'FILTER_DEFAULT',
|
805 |
-
),
|
806 |
-
);
|
807 |
-
}
|
808 |
-
return apply_filters( 'cartflows_optin_meta_options', self::$optin_fields, $post_id );
|
809 |
-
}
|
810 |
-
|
811 |
-
/**
|
812 |
-
* Save Optin Meta fields.
|
813 |
-
*
|
814 |
-
* @param int $post_id post id.
|
815 |
-
* @return void
|
816 |
-
*/
|
817 |
-
public function save_optin_fields( $post_id ) {
|
818 |
-
|
819 |
-
$post_meta = $this->get_optin_fields( $post_id );
|
820 |
-
|
821 |
-
$this->save_meta_fields( $post_id, $post_meta );
|
822 |
-
}
|
823 |
-
|
824 |
-
/**
|
825 |
-
* Get optin meta.
|
826 |
-
*
|
827 |
-
* @param int $post_id post id.
|
828 |
-
* @param string $key options key.
|
829 |
-
* @param mix $default options default value.
|
830 |
-
* @return string
|
831 |
-
*/
|
832 |
-
public function get_optin_meta_value( $post_id = 0, $key = '', $default = false ) {
|
833 |
-
|
834 |
-
$value = $this->get_save_meta( $post_id, $key );
|
835 |
-
|
836 |
-
if ( ! $value ) {
|
837 |
-
if ( false !== $default ) {
|
838 |
-
$value = $default;
|
839 |
-
} else {
|
840 |
-
$fields = $this->get_optin_fields( $post_id );
|
841 |
-
|
842 |
-
if ( isset( $fields[ $key ]['default'] ) ) {
|
843 |
-
$value = $fields[ $key ]['default'];
|
844 |
-
}
|
845 |
-
}
|
846 |
-
}
|
847 |
-
|
848 |
-
return apply_filters( "cartflows_optin_meta_{$key}", $value );
|
849 |
-
}
|
850 |
-
}
|
851 |
-
|
852 |
-
/**
|
853 |
-
* Kicking this off by calling 'get_instance()' method
|
854 |
-
*/
|
855 |
-
Cartflows_Default_Meta::get_instance();
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Cartflow default options.
|
4 |
+
*
|
5 |
+
* @package Cartflows
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Initialization
|
10 |
+
*
|
11 |
+
* @since 1.0.0
|
12 |
+
*/
|
13 |
+
class Cartflows_Default_Meta {
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Member Variable
|
19 |
+
*
|
20 |
+
* @var instance
|
21 |
+
*/
|
22 |
+
private static $instance;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Member Variable
|
26 |
+
*
|
27 |
+
* @var checkout_fields
|
28 |
+
*/
|
29 |
+
private static $checkout_fields = null;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Member Variable
|
33 |
+
*
|
34 |
+
* @var checkout_fields
|
35 |
+
*/
|
36 |
+
private static $thankyou_fields = null;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Member Variable
|
40 |
+
*
|
41 |
+
* @var flow_fields
|
42 |
+
*/
|
43 |
+
private static $flow_fields = null;
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Member Variable
|
47 |
+
*
|
48 |
+
* @var landing_fields
|
49 |
+
*/
|
50 |
+
private static $landing_fields = null;
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Member Variable
|
54 |
+
*
|
55 |
+
* @var optin_fields
|
56 |
+
*/
|
57 |
+
private static $optin_fields = null;
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Initiator
|
61 |
+
*/
|
62 |
+
public static function get_instance() {
|
63 |
+
if ( ! isset( self::$instance ) ) {
|
64 |
+
self::$instance = new self();
|
65 |
+
}
|
66 |
+
return self::$instance;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Constructor
|
71 |
+
*/
|
72 |
+
public function __construct() {
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Checkout Default fields.
|
77 |
+
*
|
78 |
+
* @param int $post_id post id.
|
79 |
+
* @return array
|
80 |
+
*/
|
81 |
+
public function get_checkout_fields( $post_id ) {
|
82 |
+
|
83 |
+
if ( null === self::$checkout_fields ) {
|
84 |
+
self::$checkout_fields = array(
|
85 |
+
'wcf-field-google-font-url' => array(
|
86 |
+
'default' => '',
|
87 |
+
'sanitize' => 'FILTER_DEFAULT',
|
88 |
+
),
|
89 |
+
'wcf-checkout-products' => array(
|
90 |
+
'default' => array(),
|
91 |
+
'sanitize' => 'FILTER_CARTFLOWS_CHECKOUT_PRODUCTS',
|
92 |
+
),
|
93 |
+
'wcf-checkout-layout' => array(
|
94 |
+
'default' => 'two-column',
|
95 |
+
'sanitize' => 'FILTER_DEFAULT',
|
96 |
+
),
|
97 |
+
'wcf-input-font-family' => array(
|
98 |
+
'default' => '',
|
99 |
+
'sanitize' => 'FILTER_DEFAULT',
|
100 |
+
),
|
101 |
+
'wcf-input-font-weight' => array(
|
102 |
+
'default' => '',
|
103 |
+
'sanitize' => 'FILTER_DEFAULT',
|
104 |
+
),
|
105 |
+
'wcf-heading-font-family' => array(
|
106 |
+
'default' => '',
|
107 |
+
'sanitize' => 'FILTER_DEFAULT',
|
108 |
+
),
|
109 |
+
'wcf-heading-font-weight' => array(
|
110 |
+
'default' => '',
|
111 |
+
'sanitize' => 'FILTER_DEFAULT',
|
112 |
+
),
|
113 |
+
'wcf-base-font-family' => array(
|
114 |
+
'default' => '',
|
115 |
+
'sanitize' => 'FILTER_DEFAULT',
|
116 |
+
),
|
117 |
+
'wcf-advance-options-fields' => array(
|
118 |
+
'default' => '',
|
119 |
+
'sanitize' => 'FILTER_DEFAULT',
|
120 |
+
),
|
121 |
+
'wcf-remove-product-field' => array(
|
122 |
+
'default' => '',
|
123 |
+
'sanitize' => 'FILTER_DEFAULT',
|
124 |
+
),
|
125 |
+
'wcf-checkout-place-order-button-text' => array(
|
126 |
+
'default' => '',
|
127 |
+
'sanitize' => 'FILTER_SANITIZE_STRING',
|
128 |
+
),
|
129 |
+
'wcf-base-font-weight' => array(
|
130 |
+
'default' => '',
|
131 |
+
'sanitize' => 'FILTER_DEFAULT',
|
132 |
+
),
|
133 |
+
'wcf-button-font-family' => array(
|
134 |
+
'default' => '',
|
135 |
+
'sanitize' => 'FILTER_DEFAULT',
|
136 |
+
),
|
137 |
+
'wcf-button-font-weight' => array(
|
138 |
+
'default' => '',
|
139 |
+
'sanitize' => 'FILTER_DEFAULT',
|
140 |
+
),
|
141 |
+
'wcf-primary-color' => array(
|
142 |
+
'default' => '',
|
143 |
+
'sanitize' => 'FILTER_DEFAULT',
|
144 |
+
),
|
145 |
+
'wcf-heading-color' => array(
|
146 |
+
'default' => '',
|
147 |
+
'sanitize' => 'FILTER_DEFAULT',
|
148 |
+
),
|
149 |
+
'wcf-section-bg-color' => array(
|
150 |
+
'default' => '',
|
151 |
+
'sanitize' => 'FILTER_DEFAULT',
|
152 |
+
),
|
153 |
+
'wcf-hl-bg-color' => array(
|
154 |
+
'default' => '',
|
155 |
+
'sanitize' => 'FILTER_DEFAULT',
|
156 |
+
),
|
157 |
+
'wcf-field-tb-padding' => array(
|
158 |
+
'default' => '',
|
159 |
+
'sanitize' => 'FILTER_DEFAULT',
|
160 |
+
),
|
161 |
+
'wcf-field-lr-padding' => array(
|
162 |
+
'default' => '',
|
163 |
+
'sanitize' => 'FILTER_DEFAULT',
|
164 |
+
),
|
165 |
+
'wcf-fields-skins' => array(
|
166 |
+
'default' => '',
|
167 |
+
'sanitize' => 'FILTER_DEFAULT',
|
168 |
+
),
|
169 |
+
'wcf-input-field-size' => array(
|
170 |
+
'default' => '33px',
|
171 |
+
'sanitize' => 'FILTER_DEFAULT',
|
172 |
+
),
|
173 |
+
'wcf-field-color' => array(
|
174 |
+
'default' => '',
|
175 |
+
'sanitize' => 'FILTER_DEFAULT',
|
176 |
+
),
|
177 |
+
'wcf-field-bg-color' => array(
|
178 |
+
'default' => '',
|
179 |
+
'sanitize' => 'FILTER_DEFAULT',
|
180 |
+
),
|
181 |
+
'wcf-field-border-color' => array(
|
182 |
+
'default' => '',
|
183 |
+
'sanitize' => 'FILTER_DEFAULT',
|
184 |
+
),
|
185 |
+
'wcf-box-border-color' => array(
|
186 |
+
'default' => '',
|
187 |
+
'sanitize' => 'FILTER_DEFAULT',
|
188 |
+
),
|
189 |
+
'wcf-field-label-color' => array(
|
190 |
+
'default' => '',
|
191 |
+
'sanitize' => 'FILTER_DEFAULT',
|
192 |
+
),
|
193 |
+
'wcf-submit-tb-padding' => array(
|
194 |
+
'default' => '',
|
195 |
+
'sanitize' => 'FILTER_DEFAULT',
|
196 |
+
),
|
197 |
+
'wcf-submit-lr-padding' => array(
|
198 |
+
'default' => '',
|
199 |
+
'sanitize' => 'FILTER_DEFAULT',
|
200 |
+
),
|
201 |
+
'wcf-input-button-size' => array(
|
202 |
+
'default' => '33px',
|
203 |
+
'sanitize' => 'FILTER_DEFAULT',
|
204 |
+
),
|
205 |
+
'wcf-submit-color' => array(
|
206 |
+
'default' => '',
|
207 |
+
'sanitize' => 'FILTER_DEFAULT',
|
208 |
+
),
|
209 |
+
'wcf-submit-hover-color' => array(
|
210 |
+
'default' => '',
|
211 |
+
'sanitize' => 'FILTER_DEFAULT',
|
212 |
+
),
|
213 |
+
'wcf-submit-bg-color' => array(
|
214 |
+
'default' => '',
|
215 |
+
'sanitize' => 'FILTER_DEFAULT',
|
216 |
+
),
|
217 |
+
'wcf-submit-bg-hover-color' => array(
|
218 |
+
'default' => '',
|
219 |
+
'sanitize' => 'FILTER_DEFAULT',
|
220 |
+
),
|
221 |
+
'wcf-submit-border-color' => array(
|
222 |
+
'default' => '',
|
223 |
+
'sanitize' => 'FILTER_DEFAULT',
|
224 |
+
),
|
225 |
+
'wcf-submit-border-hover-color' => array(
|
226 |
+
'default' => '',
|
227 |
+
'sanitize' => 'FILTER_DEFAULT',
|
228 |
+
),
|
229 |
+
'wcf-header-logo-image' => array(
|
230 |
+
'default' => '',
|
231 |
+
'sanitize' => 'FILTER_DEFAULT',
|
232 |
+
),
|
233 |
+
'wcf-header-logo-width' => array(
|
234 |
+
'default' => '',
|
235 |
+
'sanitize' => 'FILTER_DEFAULT',
|
236 |
+
),
|
237 |
+
'wcf-custom-script' => array(
|
238 |
+
'default' => '',
|
239 |
+
'sanitize' => 'FILTER_DEFAULT',
|
240 |
+
),
|
241 |
+
);
|
242 |
+
|
243 |
+
self::$checkout_fields = apply_filters( 'cartflows_checkout_meta_options', self::$checkout_fields, $post_id );
|
244 |
+
}
|
245 |
+
|
246 |
+
return self::$checkout_fields;
|
247 |
+
}
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Save Checkout Meta fields.
|
251 |
+
*
|
252 |
+
* @param int $post_id post id.
|
253 |
+
* @return void
|
254 |
+
*/
|
255 |
+
public function save_checkout_fields( $post_id ) {
|
256 |
+
|
257 |
+
$post_meta = $this->get_checkout_fields( $post_id );
|
258 |
+
|
259 |
+
$this->save_meta_fields( $post_id, $post_meta );
|
260 |
+
}
|
261 |
+
|
262 |
+
/**
|
263 |
+
* Save Landing Meta fields.
|
264 |
+
*
|
265 |
+
* @param int $post_id post id.
|
266 |
+
* @return void
|
267 |
+
*/
|
268 |
+
public function save_landing_fields( $post_id ) {
|
269 |
+
|
270 |
+
$post_meta = $this->get_landing_fields( $post_id );
|
271 |
+
|
272 |
+
$this->save_meta_fields( $post_id, $post_meta );
|
273 |
+
}
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Save ThankYou Meta fields.
|
277 |
+
*
|
278 |
+
* @param int $post_id post id.
|
279 |
+
* @return void
|
280 |
+
*/
|
281 |
+
public function save_thankyou_fields( $post_id ) {
|
282 |
+
|
283 |
+
$post_meta = $this->get_thankyou_fields( $post_id );
|
284 |
+
|
285 |
+
$this->save_meta_fields( $post_id, $post_meta );
|
286 |
+
}
|
287 |
+
|
288 |
+
/**
|
289 |
+
* Flow Default fields.
|
290 |
+
*
|
291 |
+
* @param int $post_id post id.
|
292 |
+
* @return array
|
293 |
+
*/
|
294 |
+
public function get_flow_fields( $post_id ) {
|
295 |
+
|
296 |
+
if ( null === self::$flow_fields ) {
|
297 |
+
self::$flow_fields = array(
|
298 |
+
'wcf-steps' => array(
|
299 |
+
'default' => array(),
|
300 |
+
'sanitize' => 'FILTER_DEFAULT',
|
301 |
+
),
|
302 |
+
|
303 |
+
'wcf-testing' => array(
|
304 |
+
'default' => 'no',
|
305 |
+
'sanitize' => 'FILTER_DEFAULT',
|
306 |
+
),
|
307 |
+
);
|
308 |
+
}
|
309 |
+
|
310 |
+
return apply_filters( 'cartflows_flow_meta_options', self::$flow_fields );
|
311 |
+
}
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Save Flow Meta fields.
|
315 |
+
*
|
316 |
+
* @param int $post_id post id.
|
317 |
+
* @return void
|
318 |
+
*/
|
319 |
+
public function save_flow_fields( $post_id ) {
|
320 |
+
|
321 |
+
$post_meta = $this->get_flow_fields( $post_id );
|
322 |
+
|
323 |
+
if ( isset( $post_meta['wcf-steps'] ) ) {
|
324 |
+
unset( $post_meta['wcf-steps'] );
|
325 |
+
}
|
326 |
+
|
327 |
+
$this->save_meta_fields( $post_id, $post_meta );
|
328 |
+
}
|
329 |
+
|
330 |
+
/**
|
331 |
+
* Save Meta fields - Common Function.
|
332 |
+
*
|
333 |
+
* @param int $post_id post id.
|
334 |
+
* @param array $post_meta options to store.
|
335 |
+
* @return void
|
336 |
+
*/
|
337 |
+
public function save_meta_fields( $post_id, $post_meta ) {
|
338 |
+
|
339 |
+
if ( ! ( $post_id && is_array( $post_meta ) ) ) {
|
340 |
+
return;
|
341 |
+
}
|
342 |
+
|
343 |
+
foreach ( $post_meta as $key => $data ) {
|
344 |
+
$meta_value = false;
|
345 |
+
|
346 |
+
// Sanitize values.
|
347 |
+
$sanitize_filter = ( isset( $data['sanitize'] ) ) ? $data['sanitize'] : 'FILTER_DEFAULT';
|
348 |
+
|
349 |
+
switch ( $sanitize_filter ) {
|
350 |
+
case 'FILTER_SANITIZE_STRING':
|
351 |
+
$meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_STRING );
|
352 |
+
break;
|
353 |
+
|
354 |
+
case 'FILTER_SANITIZE_URL':
|
355 |
+
$meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_URL );
|
356 |
+
break;
|
357 |
+
|
358 |
+
case 'FILTER_SANITIZE_NUMBER_INT':
|
359 |
+
$meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_NUMBER_INT );
|
360 |
+
break;
|
361 |
+
|
362 |
+
case 'FILTER_CARTFLOWS_ARRAY':
|
363 |
+
if ( isset( $_POST[ $key ] ) && is_array( $_POST[ $key ] ) ) { //phpcs:ignore
|
364 |
+
$meta_value = array_map( 'sanitize_text_field', wp_unslash( $_POST[ $key ] ) ); //phpcs:ignore
|
365 |
+
}
|
366 |
+
break;
|
367 |
+
|
368 |
+
case 'FILTER_CARTFLOWS_CHECKOUT_PRODUCTS':
|
369 |
+
if ( isset( $_POST[ $key ] ) && is_array( $_POST[ $key ] ) ) { //phpcs:ignore
|
370 |
+
$i = 0;
|
371 |
+
$q = 0;
|
372 |
+
|
373 |
+
foreach ( $_POST[ $key ] as $p_index => $p_data ) { // phpcs:ignore
|
374 |
+
if ( ! array_key_exists( 'product', $p_data ) ) {
|
375 |
+
continue;
|
376 |
+
}
|
377 |
+
foreach ( $p_data as $i_key => $i_value ) {
|
378 |
+
|
379 |
+
if ( is_array( $i_value ) ) {
|
380 |
+
foreach ( $i_value as $q_key => $q_value ) {
|
381 |
+
$meta_value[ $i ][ $i_key ][ $q ] = array_map( 'sanitize_text_field', $q_value );
|
382 |
+
|
383 |
+
$q++;
|
384 |
+
}
|
385 |
+
} else {
|
386 |
+
$meta_value[ $i ][ $i_key ] = sanitize_text_field( $i_value );
|
387 |
+
}
|
388 |
+
}
|
389 |
+
|
390 |
+
$i++;
|
391 |
+
}
|
392 |
+
}
|
393 |
+
break;
|
394 |
+
|
395 |
+
case 'FILTER_CARTFLOWS_IMAGES':
|
396 |
+
$meta_value = filter_input( INPUT_POST, $key, FILTER_DEFAULT );
|
397 |
+
|
398 |
+
if ( isset( $_POST[ $key . '-obj' ] )) { //phpcs:ignore
|
399 |
+
|
400 |
+
if ( ! is_serialized( $_POST[ $key . '-obj' ] ) ) { //phpcs:ignore
|
401 |
+
|
402 |
+
$image_obj = json_decode( stripcslashes( wp_unslash( $_POST[ $key . '-obj' ] ) ), true ); //phpcs:ignore
|
403 |
+
$image_url = isset( $image_obj['sizes'] ) ? $image_obj['sizes'] : array();
|
404 |
+
|
405 |
+
$image_data = array(
|
406 |
+
'id' => isset( $image_obj['id'] ) ? intval( $image_obj['id'] ) : 0,
|
407 |
+
'url' => array(
|
408 |
+
'thumbnail' => isset( $image_url['thumbnail']['url'] ) ? esc_url_raw( $image_url['thumbnail']['url'] ) : '',
|
409 |
+
'medium' => isset( $image_url['medium']['url'] ) ? esc_url_raw( $image_url['medium']['url'] ) : '',
|
410 |
+
'full' => isset( $image_url['full']['url'] ) ? esc_url_raw( $image_url['full']['url'] ) : '',
|
411 |
+
),
|
412 |
+
);
|
413 |
+
|
414 |
+
$new_meta_value = 0 !== $image_data['id'] ? $image_data : '';
|
415 |
+
update_post_meta( $post_id, $key . '-obj', $new_meta_value );
|
416 |
+
}
|
417 |
+
}
|
418 |
+
|
419 |
+
break;
|
420 |
+
|
421 |
+
default:
|
422 |
+
if ( 'FILTER_DEFAULT' === $sanitize_filter ) {
|
423 |
+
$meta_value = filter_input( INPUT_POST, $key, FILTER_DEFAULT );
|
424 |
+
} else {
|
425 |
+
$meta_value = apply_filters( 'cartflows_save_meta_field_values', $meta_value, $post_id, $key, $sanitize_filter );
|
426 |
+
}
|
427 |
+
|
428 |
+
break;
|
429 |
+
}
|
430 |
+
|
431 |
+
if ( false !== $meta_value ) {
|
432 |
+
update_post_meta( $post_id, $key, $meta_value );
|
433 |
+
} else {
|
434 |
+
delete_post_meta( $post_id, $key );
|
435 |
+
}
|
436 |
+
}
|
437 |
+
}
|
438 |
+
|
439 |
+
/**
|
440 |
+
* Get checkout meta.
|
441 |
+
*
|
442 |
+
* @param int $post_id post id.
|
443 |
+
* @param string $key options key.
|
444 |
+
* @param mix $default options default value.
|
445 |
+
* @return string
|
446 |
+
*/
|
447 |
+
public function get_flow_meta_value( $post_id, $key, $default = false ) {
|
448 |
+
|
449 |
+
$value = $this->get_save_meta( $post_id, $key );
|
450 |
+
|
451 |
+
if ( ! $value ) {
|
452 |
+
if ( $default ) {
|
453 |
+
$value = $default;
|
454 |
+
} else {
|
455 |
+
$fields = $this->get_flow_fields( $post_id );
|
456 |
+
|
457 |
+
if ( isset( $fields[ $key ]['default'] ) ) {
|
458 |
+
$value = $fields[ $key ]['default'];
|
459 |
+
}
|
460 |
+
}
|
461 |
+
}
|
462 |
+
|
463 |
+
return $value;
|
464 |
+
}
|
465 |
+
|
466 |
+
/**
|
467 |
+
* Get checkout meta.
|
468 |
+
*
|
469 |
+
* @param int $post_id post id.
|
470 |
+
* @param string $key options key.
|
471 |
+
* @param mix $default options default value.
|
472 |
+
* @return string
|
473 |
+
*/
|
474 |
+
public function get_checkout_meta_value( $post_id = 0, $key = '', $default = false ) {
|
475 |
+
|
476 |
+
$value = $this->get_save_meta( $post_id, $key );
|
477 |
+
|
478 |
+
if ( ! $value ) {
|
479 |
+
if ( false !== $default ) {
|
480 |
+
$value = $default;
|
481 |
+
} else {
|
482 |
+
$fields = $this->get_checkout_fields( $post_id );
|
483 |
+
|
484 |
+
if ( isset( $fields[ $key ]['default'] ) ) {
|
485 |
+
$value = $fields[ $key ]['default'];
|
486 |
+
}
|
487 |
+
}
|
488 |
+
}
|
489 |
+
|
490 |
+
return apply_filters( "cartflows_checkout_meta_{$key}", $value );
|
491 |
+
}
|
492 |
+
|
493 |
+
/**
|
494 |
+
* Get post meta.
|
495 |
+
*
|
496 |
+
* @param int $post_id post id.
|
497 |
+
* @param string $key options key.
|
498 |
+
* @return string
|
499 |
+
*/
|
500 |
+
public function get_save_meta( $post_id, $key ) {
|
501 |
+
|
502 |
+
return get_post_meta( $post_id, $key, true );
|
503 |
+
}
|
504 |
+
|
505 |
+
/**
|
506 |
+
* Thank You Default fields.
|
507 |
+
*
|
508 |
+
* @param int $post_id post id.
|
509 |
+
* @return array
|
510 |
+
*/
|
511 |
+
public function get_thankyou_fields( $post_id ) {
|
512 |
+
|
513 |
+
if ( null === self::$thankyou_fields ) {
|
514 |
+
self::$thankyou_fields = array(
|
515 |
+
'wcf-field-google-font-url' => array(
|
516 |
+
'default' => '',
|
517 |
+
'sanitize' => 'FILTER_DEFAULT',
|
518 |
+
),
|
519 |
+
'wcf-tq-text-color' => array(
|
520 |
+
'default' => '',
|
521 |
+
'sanitize' => 'FILTER_DEFAULT',
|
522 |
+
),
|
523 |
+
'wcf-tq-font-family' => array(
|
524 |
+
'default' => '',
|
525 |
+
'sanitize' => 'FILTER_DEFAULT',
|
526 |
+
),
|
527 |
+
'wcf-tq-font-size' => array(
|
528 |
+
'default' => '',
|
529 |
+
'sanitize' => 'FILTER_DEFAULT',
|
530 |
+
),
|
531 |
+
'wcf-tq-heading-color' => array(
|
532 |
+
'default' => '',
|
533 |
+
'sanitize' => 'FILTER_DEFAULT',
|
534 |
+
),
|
535 |
+
'wcf-tq-heading-font-family' => array(
|
536 |
+
'default' => '',
|
537 |
+
'sanitize' => 'FILTER_DEFAULT',
|
538 |
+
),
|
539 |
+
'wcf-tq-heading-font-wt' => array(
|
540 |
+
'default' => '',
|
541 |
+
'sanitize' => 'FILTER_DEFAULT',
|
542 |
+
),
|
543 |
+
'wcf-tq-container-width' => array(
|
544 |
+
'default' => '',
|
545 |
+
'sanitize' => 'FILTER_DEFAULT',
|
546 |
+
),
|
547 |
+
'wcf-tq-section-bg-color' => array(
|
548 |
+
'default' => '',
|
549 |
+
'sanitize' => 'FILTER_DEFAULT',
|
550 |
+
),
|
551 |
+
'wcf-tq-advance-options-fields' => array(
|
552 |
+
'default' => '',
|
553 |
+
'sanitize' => 'FILTER_DEFAULT',
|
554 |
+
),
|
555 |
+
'wcf-show-overview-section' => array(
|
556 |
+
'default' => 'yes',
|
557 |
+
'sanitize' => 'FILTER_DEFAULT',
|
558 |
+
),
|
559 |
+
'wcf-show-details-section' => array(
|
560 |
+
'default' => 'yes',
|
561 |
+
'sanitize' => 'FILTER_DEFAULT',
|
562 |
+
),
|
563 |
+
'wcf-show-billing-section' => array(
|
564 |
+
'default' => 'yes',
|
565 |
+
'sanitize' => 'FILTER_DEFAULT',
|
566 |
+
),
|
567 |
+
'wcf-show-shipping-section' => array(
|
568 |
+
'default' => 'yes',
|
569 |
+
'sanitize' => 'FILTER_DEFAULT',
|
570 |
+
),
|
571 |
+
'wcf-show-tq-redirect-section' => array(
|
572 |
+
'default' => '',
|
573 |
+
'sanitize' => 'FILTER_DEFAULT',
|
574 |
+
),
|
575 |
+
'wcf-tq-redirect-link' => array(
|
576 |
+
'default' => '',
|
577 |
+
'sanitize' => 'FILTER_SANITIZE_URL',
|
578 |
+
),
|
579 |
+
'wcf-tq-text' => array(
|
580 |
+
'default' => '',
|
581 |
+
'sanitize' => 'FILTER_DEFAULT',
|
582 |
+
),
|
583 |
+
'wcf-custom-script' => array(
|
584 |
+
'default' => '',
|
585 |
+
'sanitize' => 'FILTER_DEFAULT',
|
586 |
+
),
|
587 |
+
);
|
588 |
+
}
|
589 |
+
|
590 |
+
return apply_filters( 'cartflows_thankyou_meta_options', self::$thankyou_fields, $post_id );
|
591 |
+
}
|
592 |
+
|
593 |
+
/**
|
594 |
+
* Get Thank you section meta.
|
595 |
+
*
|
596 |
+
* @param int $post_id post id.
|
597 |
+
* @param string $key options key.
|
598 |
+
* @param mix $default options default value.
|
599 |
+
* @return string
|
600 |
+
*/
|
601 |
+
public function get_thankyou_meta_value( $post_id, $key, $default = false ) {
|
602 |
+
|
603 |
+
$value = $this->get_save_meta( $post_id, $key );
|
604 |
+
|
605 |
+
if ( ! $value ) {
|
606 |
+
if ( $default ) {
|
607 |
+
$value = $default;
|
608 |
+
} else {
|
609 |
+
$fields = $this->get_thankyou_fields( $post_id );
|
610 |
+
|
611 |
+
if ( isset( $fields[ $key ]['default'] ) ) {
|
612 |
+
$value = $fields[ $key ]['default'];
|
613 |
+
}
|
614 |
+
}
|
615 |
+
}
|
616 |
+
|
617 |
+
return apply_filters( "cartflows_thankyou_meta_{$key}", $value );
|
618 |
+
}
|
619 |
+
|
620 |
+
/**
|
621 |
+
* Get Landing section meta.
|
622 |
+
*
|
623 |
+
* @param int $post_id post id.
|
624 |
+
* @param string $key options key.
|
625 |
+
* @param mix $default options default value.
|
626 |
+
* @return string
|
627 |
+
*/
|
628 |
+
public function get_landing_meta_value( $post_id, $key, $default = false ) {
|
629 |
+
|
630 |
+
$value = $this->get_save_meta( $post_id, $key );
|
631 |
+
if ( ! $value ) {
|
632 |
+
if ( $default ) {
|
633 |
+
$value = $default;
|
634 |
+
} else {
|
635 |
+
$fields = $this->get_landing_fields( $post_id );
|
636 |
+
|
637 |
+
if ( isset( $fields[ $key ]['default'] ) ) {
|
638 |
+
$value = $fields[ $key ]['default'];
|
639 |
+
}
|
640 |
+
}
|
641 |
+
}
|
642 |
+
|
643 |
+
return $value;
|
644 |
+
}
|
645 |
+
|
646 |
+
/**
|
647 |
+
* Landing Default fields.
|
648 |
+
*
|
649 |
+
* @param int $post_id post id.
|
650 |
+
* @return array
|
651 |
+
*/
|
652 |
+
public function get_landing_fields( $post_id ) {
|
653 |
+
|
654 |
+
if ( null === self::$landing_fields ) {
|
655 |
+
self::$landing_fields = array(
|
656 |
+
'wcf-custom-script' => array(
|
657 |
+
'default' => '',
|
658 |
+
'sanitize' => 'FILTER_DEFAULT',
|
659 |
+
),
|
660 |
+
);
|
661 |
+
}
|
662 |
+
return apply_filters( 'cartflows_landing_meta_options', self::$landing_fields, $post_id );
|
663 |
+
}
|
664 |
+
|
665 |
+
/**
|
666 |
+
* Optin Default fields.
|
667 |
+
*
|
668 |
+
* @param int $post_id post id.
|
669 |
+
* @return array
|
670 |
+
*/
|
671 |
+
public function get_optin_fields( $post_id ) {
|
672 |
+
|
673 |
+
if ( null === self::$optin_fields ) {
|
674 |
+
self::$optin_fields = array(
|
675 |
+
|
676 |
+
'wcf-optin-product' => array(
|
677 |
+
'default' => array(),
|
678 |
+
'sanitize' => 'FILTER_CARTFLOWS_ARRAY',
|
679 |
+
),
|
680 |
+
|
681 |
+
/* Style */
|
682 |
+
'wcf-field-google-font-url' => array(
|
683 |
+
'default' => '',
|
684 |
+
'sanitize' => 'FILTER_DEFAULT',
|
685 |
+
),
|
686 |
+
'wcf-primary-color' => array(
|
687 |
+
'default' => '',
|
688 |
+
'sanitize' => 'FILTER_DEFAULT',
|
689 |
+
),
|
690 |
+
'wcf-base-font-family' => array(
|
691 |
+
'default' => '',
|
692 |
+
'sanitize' => 'FILTER_DEFAULT',
|
693 |
+
),
|
694 |
+
'wcf-input-fields-skins' => array(
|
695 |
+
'default' => '',
|
696 |
+
'sanitize' => 'FILTER_DEFAULT',
|
697 |
+
),
|
698 |
+
'wcf-input-font-family' => array(
|
699 |
+
'default' => '',
|
700 |
+
'sanitize' => 'FILTER_DEFAULT',
|
701 |
+
),
|
702 |
+
'wcf-input-font-weight' => array(
|
703 |
+
'default' => '',
|
704 |
+
'sanitize' => 'FILTER_DEFAULT',
|
705 |
+
),
|
706 |
+
'wcf-input-field-size' => array(
|
707 |
+
'default' => '33px',
|
708 |
+
'sanitize' => 'FILTER_DEFAULT',
|
709 |
+
),
|
710 |
+
'wcf-field-tb-padding' => array(
|
711 |
+
'default' => '',
|
712 |
+
'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
|
713 |
+
),
|
714 |
+
'wcf-field-lr-padding' => array(
|
715 |
+
'default' => '',
|
716 |
+
'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
|
717 |
+
),
|
718 |
+
'wcf-field-color' => array(
|
719 |
+
'default' => '',
|
720 |
+
'sanitize' => 'FILTER_DEFAULT',
|
721 |
+
),
|
722 |
+
'wcf-field-bg-color' => array(
|
723 |
+
'default' => '',
|
724 |
+
'sanitize' => 'FILTER_DEFAULT',
|
725 |
+
),
|
726 |
+
'wcf-field-border-color' => array(
|
727 |
+
'default' => '',
|
728 |
+
'sanitize' => 'FILTER_DEFAULT',
|
729 |
+
),
|
730 |
+
'wcf-field-label-color' => array(
|
731 |
+
'default' => '',
|
732 |
+
'sanitize' => 'FILTER_DEFAULT',
|
733 |
+
),
|
734 |
+
'wcf-submit-button-text' => array(
|
735 |
+
'default' => __( 'Submit', 'cartflows' ),
|
736 |
+
'sanitize' => 'FILTER_DEFAULT',
|
737 |
+
),
|
738 |
+
'wcf-submit-font-size' => array(
|
739 |
+
'default' => '',
|
740 |
+
'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
|
741 |
+
),
|
742 |
+
'wcf-button-font-family' => array(
|
743 |
+
'default' => '',
|
744 |
+
'sanitize' => 'FILTER_DEFAULT',
|
745 |
+
),
|
746 |
+
'wcf-button-font-weight' => array(
|
747 |
+
'default' => '',
|
748 |
+
'sanitize' => 'FILTER_DEFAULT',
|
749 |
+
),
|
750 |
+
'wcf-submit-button-size' => array(
|
751 |
+
'default' => '33px',
|
752 |
+
'sanitize' => 'FILTER_DEFAULT',
|
753 |
+
),
|
754 |
+
'wcf-submit-tb-padding' => array(
|
755 |
+
'default' => '',
|
756 |
+
'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
|
757 |
+
),
|
758 |
+
'wcf-submit-lr-padding' => array(
|
759 |
+
'default' => '',
|
760 |
+
'sanitize' => 'FILTER_SANITIZE_NUMBER_INT',
|
761 |
+
),
|
762 |
+
'wcf-submit-button-position' => array(
|
763 |
+
'default' => 'center',
|
764 |
+
'sanitize' => 'FILTER_DEFAULT',
|
765 |
+
),
|
766 |
+
'wcf-submit-color' => array(
|
767 |
+
'default' => '',
|
768 |
+
'sanitize' => 'FILTER_DEFAULT',
|
769 |
+
),
|
770 |
+
'wcf-submit-hover-color' => array(
|
771 |
+
'default' => '',
|
772 |
+
'sanitize' => 'FILTER_DEFAULT',
|
773 |
+
),
|
774 |
+
'wcf-submit-bg-color' => array(
|
775 |
+
'default' => '',
|
776 |
+
'sanitize' => 'FILTER_DEFAULT',
|
777 |
+
),
|
778 |
+
'wcf-submit-bg-hover-color' => array(
|
779 |
+
'default' => '',
|
780 |
+
'sanitize' => 'FILTER_DEFAULT',
|
781 |
+
),
|
782 |
+
'wcf-submit-border-color' => array(
|
783 |
+
'default' => '',
|
784 |
+
'sanitize' => 'FILTER_DEFAULT',
|
785 |
+
),
|
786 |
+
'wcf-submit-border-hover-color' => array(
|
787 |
+
'default' => '',
|
788 |
+
'sanitize' => 'FILTER_DEFAULT',
|
789 |
+
),
|
790 |
+
|
791 |
+
/* Settings */
|
792 |
+
'wcf-optin-pass-fields' => array(
|
793 |
+
'default' => '',
|
794 |
+
'sanitize' => 'FILTER_DEFAULT',
|
795 |
+
),
|
796 |
+
'wcf-optin-pass-specific-fields' => array(
|
797 |
+
'default' => 'first_name',
|
798 |
+
'sanitize' => 'FILTER_DEFAULT',
|
799 |
+
),
|
800 |
+
|
801 |
+
/* Script */
|
802 |
+
'wcf-custom-script' => array(
|
803 |
+
'default' => '',
|
804 |
+
'sanitize' => 'FILTER_DEFAULT',
|
805 |
+
),
|
806 |
+
);
|
807 |
+
}
|
808 |
+
return apply_filters( 'cartflows_optin_meta_options', self::$optin_fields, $post_id );
|
809 |
+
}
|
810 |
+
|
811 |
+
/**
|
812 |
+
* Save Optin Meta fields.
|
813 |
+
*
|
814 |
+
* @param int $post_id post id.
|
815 |
+
* @return void
|
816 |
+
*/
|
817 |
+
public function save_optin_fields( $post_id ) {
|
818 |
+
|
819 |
+
$post_meta = $this->get_optin_fields( $post_id );
|
820 |
+
|
821 |
+
$this->save_meta_fields( $post_id, $post_meta );
|
822 |
+
}
|
823 |
+
|
824 |
+
/**
|
825 |
+
* Get optin meta.
|
826 |
+
*
|
827 |
+
* @param int $post_id post id.
|
828 |
+
* @param string $key options key.
|
829 |
+
* @param mix $default options default value.
|
830 |
+
* @return string
|
831 |
+
*/
|
832 |
+
public function get_optin_meta_value( $post_id = 0, $key = '', $default = false ) {
|
833 |
+
|
834 |
+
$value = $this->get_save_meta( $post_id, $key );
|
835 |
+
|
836 |
+
if ( ! $value ) {
|
837 |
+
if ( false !== $default ) {
|
838 |
+
$value = $default;
|
839 |
+
} else {
|
840 |
+
$fields = $this->get_optin_fields( $post_id );
|
841 |
+
|
842 |
+
if ( isset( $fields[ $key ]['default'] ) ) {
|
843 |
+
$value = $fields[ $key ]['default'];
|
844 |
+
}
|
845 |
+
}
|
846 |
+
}
|
847 |
+
|
848 |
+
return apply_filters( "cartflows_optin_meta_{$key}", $value );
|
849 |
+
}
|
850 |
+
}
|
851 |
+
|
852 |
+
/**
|
853 |
+
* Kicking this off by calling 'get_instance()' method
|
854 |
+
*/
|
855 |
+
Cartflows_Default_Meta::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,682 +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 |
-
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();
|
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
@@ -402,6 +402,8 @@ function _get_wcf_thankyou_id() {
|
|
402 |
*/
|
403 |
function _is_wcf_base_offer_type() {
|
404 |
|
|
|
|
|
405 |
if ( wcf()->utils->is_step_post_type() ) {
|
406 |
|
407 |
global $post;
|
@@ -410,11 +412,11 @@ function _is_wcf_base_offer_type() {
|
|
410 |
|
411 |
if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
|
412 |
|
413 |
-
|
414 |
}
|
415 |
}
|
416 |
|
417 |
-
return
|
418 |
}
|
419 |
|
420 |
/**
|
@@ -560,6 +562,10 @@ function wcf_get_page_builder_notice() {
|
|
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 ] ) ) {
|
402 |
*/
|
403 |
function _is_wcf_base_offer_type() {
|
404 |
|
405 |
+
$result = false;
|
406 |
+
|
407 |
if ( wcf()->utils->is_step_post_type() ) {
|
408 |
|
409 |
global $post;
|
412 |
|
413 |
if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
|
414 |
|
415 |
+
$result = true;
|
416 |
}
|
417 |
}
|
418 |
|
419 |
+
return apply_filters( 'cartflows_is_offer_type', $result );
|
420 |
}
|
421 |
|
422 |
/**
|
562 |
'name' => 'Beaver Builder',
|
563 |
'doc' => 'https://cartflows.com/docs/beaver-builder-modules-of-cartflows/',
|
564 |
),
|
565 |
+
'gutenberg' => array(
|
566 |
+
'name' => 'Gutenebrg',
|
567 |
+
'doc' => 'https://cartflows.com/docs/cartflows-gutenberg-blocks/',
|
568 |
+
),
|
569 |
);
|
570 |
|
571 |
if ( isset( $page_builder_data[ $page_builder ] ) ) {
|
classes/class-cartflows-helper.php
CHANGED
@@ -1,815 +1,815 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* CARTFLOWS Helper.
|
4 |
-
*
|
5 |
-
* @package CARTFLOWS
|
6 |
-
*/
|
7 |
-
|
8 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
-
exit; // Exit if accessed directly.
|
10 |
-
}
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Class Cartflows_Helper.
|
14 |
-
*/
|
15 |
-
class Cartflows_Helper {
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Common global data
|
19 |
-
*
|
20 |
-
* @var zapier
|
21 |
-
*/
|
22 |
-
private static $common = null;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Common Debug data
|
26 |
-
*
|
27 |
-
* @var zapier
|
28 |
-
*/
|
29 |
-
private static $debug_data = null;
|
30 |
-
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Permalink settings
|
34 |
-
*
|
35 |
-
* @var permalink_setting
|
36 |
-
*/
|
37 |
-
private static $permalink_setting = null;
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Google Analytics Settings
|
41 |
-
*
|
42 |
-
* @var permalink_setting
|
43 |
-
*/
|
44 |
-
private static $google_analytics_settings = null;
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Installed Plugins
|
48 |
-
*
|
49 |
-
* @since 1.1.4
|
50 |
-
*
|
51 |
-
* @access private
|
52 |
-
* @var array Installed plugins list.
|
53 |
-
*/
|
54 |
-
private static $installed_plugins = null;
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Checkout Fields
|
58 |
-
*
|
59 |
-
* @var checkout_fields
|
60 |
-
*/
|
61 |
-
private static $checkout_fields = null;
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Facebook pixel global data
|
65 |
-
*
|
66 |
-
* @var faceboook
|
67 |
-
*/
|
68 |
-
private static $facebook = null;
|
69 |
-
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Returns an option from the database for
|
73 |
-
* the admin settings page.
|
74 |
-
*
|
75 |
-
* @param string $key The option key.
|
76 |
-
* @param mixed $default Option default value if option is not available.
|
77 |
-
* @param boolean $network_override Whether to allow the network admin setting to be overridden on subsites.
|
78 |
-
* @return string Return the option value
|
79 |
-
*/
|
80 |
-
public static function get_admin_settings_option( $key, $default = false, $network_override = false ) {
|
81 |
-
|
82 |
-
// Get the site-wide option if we're in the network admin.
|
83 |
-
if ( $network_override && is_multisite() ) {
|
84 |
-
$value = get_site_option( $key, $default );
|
85 |
-
} else {
|
86 |
-
$value = get_option( $key, $default );
|
87 |
-
}
|
88 |
-
|
89 |
-
return $value;
|
90 |
-
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Updates an option from the admin settings page.
|
94 |
-
*
|
95 |
-
* @param string $key The option key.
|
96 |
-
* @param mixed $value The value to update.
|
97 |
-
* @param bool $network Whether to allow the network admin setting to be overridden on subsites.
|
98 |
-
* @return mixed
|
99 |
-
*/
|
100 |
-
public static function update_admin_settings_option( $key, $value, $network = false ) {
|
101 |
-
|
102 |
-
// Update the site-wide option since we're in the network admin.
|
103 |
-
if ( $network && is_multisite() ) {
|
104 |
-
update_site_option( $key, $value );
|
105 |
-
} else {
|
106 |
-
update_option( $key, $value );
|
107 |
-
}
|
108 |
-
|
109 |
-
}
|
110 |
-
|
111 |
-
/**
|
112 |
-
* Get single setting
|
113 |
-
*
|
114 |
-
* @since 1.1.4
|
115 |
-
*
|
116 |
-
* @param string $key Option key.
|
117 |
-
* @param string $default Option default value if not exist.
|
118 |
-
* @return mixed
|
119 |
-
*/
|
120 |
-
public static function get_common_setting( $key = '', $default = '' ) {
|
121 |
-
$settings = self::get_common_settings();
|
122 |
-
|
123 |
-
if ( $settings && array_key_exists( $key, $settings ) ) {
|
124 |
-
return $settings[ $key ];
|
125 |
-
}
|
126 |
-
|
127 |
-
return $default;
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* Get single debug options
|
132 |
-
*
|
133 |
-
* @since 1.1.4
|
134 |
-
*
|
135 |
-
* @param string $key Option key.
|
136 |
-
* @param string $default Option default value if not exist.
|
137 |
-
* @return mixed
|
138 |
-
*/
|
139 |
-
public static function get_debug_setting( $key = '', $default = '' ) {
|
140 |
-
$debug_data = self::get_debug_settings();
|
141 |
-
|
142 |
-
if ( $debug_data && array_key_exists( $key, $debug_data ) ) {
|
143 |
-
return $debug_data[ $key ];
|
144 |
-
}
|
145 |
-
|
146 |
-
return $default;
|
147 |
-
}
|
148 |
-
|
149 |
-
/**
|
150 |
-
* Get required plugins for page builder
|
151 |
-
*
|
152 |
-
* @since 1.1.4
|
153 |
-
*
|
154 |
-
* @param string $page_builder_slug Page builder slug.
|
155 |
-
* @param string $default Default page builder.
|
156 |
-
* @return array selected page builder required plugins list.
|
157 |
-
*/
|
158 |
-
public static function get_required_plugins_for_page_builder( $page_builder_slug = '', $default = 'elementor' ) {
|
159 |
-
$plugins = self::get_plugins_groupby_page_builders();
|
160 |
-
|
161 |
-
if ( array_key_exists( $page_builder_slug, $plugins ) ) {
|
162 |
-
return $plugins[ $page_builder_slug ];
|
163 |
-
}
|
164 |
-
|
165 |
-
return $plugins[ $default ];
|
166 |
-
}
|
167 |
-
|
168 |
-
/**
|
169 |
-
* Get Plugins list by page builder.
|
170 |
-
*
|
171 |
-
* @since 1.1.4
|
172 |
-
*
|
173 |
-
* @return array Required Plugins list.
|
174 |
-
*/
|
175 |
-
public static function get_plugins_groupby_page_builders() {
|
176 |
-
|
177 |
-
$divi_status = self::get_plugin_status( 'divi-builder/divi-builder.php' );
|
178 |
-
$theme_status = 'not-installed';
|
179 |
-
if ( $divi_status ) {
|
180 |
-
if ( true === Cartflows_Compatibility::get_instance()->is_divi_theme_installed() ) {
|
181 |
-
$theme_status = 'installed';
|
182 |
-
if ( false === Cartflows_Compatibility::get_instance()->is_divi_enabled() ) {
|
183 |
-
$theme_status = 'deactivate';
|
184 |
-
$divi_status = 'activate';
|
185 |
-
} else {
|
186 |
-
$divi_status = '';
|
187 |
-
}
|
188 |
-
}
|
189 |
-
}
|
190 |
-
|
191 |
-
$plugins = array(
|
192 |
-
'elementor' => array(
|
193 |
-
'title' => 'Elementor',
|
194 |
-
'plugins' => array(
|
195 |
-
array(
|
196 |
-
'slug' => 'elementor', // For download from wp.org.
|
197 |
-
'init' => 'elementor/elementor.php',
|
198 |
-
'status' => self::get_plugin_status( 'elementor/elementor.php' ),
|
199 |
-
),
|
200 |
-
),
|
201 |
-
),
|
202 |
-
'gutenberg' => array(
|
203 |
-
'title' => 'Ultimate Addons for Gutenberg',
|
204 |
-
'plugins' => array(
|
205 |
-
array(
|
206 |
-
'slug' => 'ultimate-addons-for-gutenberg', // For download from wp.org.
|
207 |
-
'init' => 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php',
|
208 |
-
'status' => self::get_plugin_status( 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php' ),
|
209 |
-
),
|
210 |
-
),
|
211 |
-
),
|
212 |
-
'divi' => array(
|
213 |
-
'title' => 'Divi',
|
214 |
-
'theme-status' => $theme_status,
|
215 |
-
'plugin-status' => $divi_status,
|
216 |
-
'plugins' => array(
|
217 |
-
array(
|
218 |
-
'slug' => 'divi-builder', // For download from wp.org.
|
219 |
-
'init' => 'divi-builder/divi-builder.php',
|
220 |
-
'status' => $divi_status,
|
221 |
-
),
|
222 |
-
),
|
223 |
-
),
|
224 |
-
);
|
225 |
-
|
226 |
-
$plugins['beaver-builder'] = array(
|
227 |
-
'title' => 'Beaver Builder',
|
228 |
-
'plugins' => array(),
|
229 |
-
);
|
230 |
-
|
231 |
-
// Check Pro Exist.
|
232 |
-
if ( file_exists( WP_PLUGIN_DIR . '/bb-plugin/fl-builder.php' ) && ! is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) ) {
|
233 |
-
$plugins['beaver-builder']['plugins'][] = array(
|
234 |
-
'slug' => 'bb-plugin',
|
235 |
-
'init' => 'bb-plugin/fl-builder.php',
|
236 |
-
'status' => self::get_plugin_status( 'bb-plugin/fl-builder.php' ),
|
237 |
-
);
|
238 |
-
} else {
|
239 |
-
$plugins['beaver-builder']['plugins'][] = array(
|
240 |
-
'slug' => 'beaver-builder-lite-version', // For download from wp.org.
|
241 |
-
'init' => 'beaver-builder-lite-version/fl-builder.php',
|
242 |
-
'status' => self::get_plugin_status( 'beaver-builder-lite-version/fl-builder.php' ),
|
243 |
-
);
|
244 |
-
}
|
245 |
-
|
246 |
-
if ( file_exists( WP_PLUGIN_DIR . '/bb-ultimate-addon/bb-ultimate-addon.php' ) && ! is_plugin_active( 'ultimate-addons-for-beaver-builder-lite/bb-ultimate-addon.php' ) ) {
|
247 |
-
$plugins['beaver-builder']['plugins'][] = array(
|
248 |
-
'slug' => 'bb-ultimate-addon',
|
249 |
-
'init' => 'bb-ultimate-addon/bb-ultimate-addon.php',
|
250 |
-
'status' => self::get_plugin_status( 'bb-ultimate-addon/bb-ultimate-addon.php' ),
|
251 |
-
);
|
252 |
-
} else {
|
253 |
-
$plugins['beaver-builder']['plugins'][] = array(
|
254 |
-
'slug' => 'ultimate-addons-for-beaver-builder-lite', // For download from wp.org.
|
255 |
-
'init' => 'ultimate-addons-for-beaver-builder-lite/bb-ultimate-addon.php',
|
256 |
-
'status' => self::get_plugin_status( 'ultimate-addons-for-beaver-builder-lite/bb-ultimate-addon.php' ),
|
257 |
-
);
|
258 |
-
}
|
259 |
-
|
260 |
-
return $plugins;
|
261 |
-
}
|
262 |
-
|
263 |
-
/**
|
264 |
-
* Get plugin status
|
265 |
-
*
|
266 |
-
* @since 1.1.4
|
267 |
-
*
|
268 |
-
* @param string $plugin_init_file Plguin init file.
|
269 |
-
* @return mixed
|
270 |
-
*/
|
271 |
-
public static function get_plugin_status( $plugin_init_file ) {
|
272 |
-
|
273 |
-
if ( null == self::$installed_plugins ) {
|
274 |
-
self::$installed_plugins = get_plugins();
|
275 |
-
}
|
276 |
-
|
277 |
-
if ( ! isset( self::$installed_plugins[ $plugin_init_file ] ) ) {
|
278 |
-
return 'install';
|
279 |
-
} elseif ( ! is_plugin_active( $plugin_init_file ) ) {
|
280 |
-
return 'activate';
|
281 |
-
} else {
|
282 |
-
return;
|
283 |
-
}
|
284 |
-
}
|
285 |
-
|
286 |
-
/**
|
287 |
-
* Get zapier settings.
|
288 |
-
*
|
289 |
-
* @return array.
|
290 |
-
*/
|
291 |
-
public static function get_common_settings() {
|
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 );
|
307 |
-
|
308 |
-
$common = wp_parse_args( $common, $common_default );
|
309 |
-
|
310 |
-
if ( ! did_action( 'wp' ) ) {
|
311 |
-
return $common;
|
312 |
-
} else {
|
313 |
-
self::$common = $common;
|
314 |
-
}
|
315 |
-
}
|
316 |
-
|
317 |
-
return self::$common;
|
318 |
-
}
|
319 |
-
|
320 |
-
/**
|
321 |
-
* Get debug settings data.
|
322 |
-
*
|
323 |
-
* @return array.
|
324 |
-
*/
|
325 |
-
public static function get_debug_settings() {
|
326 |
-
|
327 |
-
if ( null === self::$debug_data ) {
|
328 |
-
|
329 |
-
$debug_data_default = apply_filters(
|
330 |
-
'cartflows_debug_settings_default',
|
331 |
-
array(
|
332 |
-
'allow_minified_files' => 'disable',
|
333 |
-
)
|
334 |
-
);
|
335 |
-
|
336 |
-
$debug_data = self::get_admin_settings_option( '_cartflows_debug_data', false, false );
|
337 |
-
|
338 |
-
$debug_data = wp_parse_args( $debug_data, $debug_data_default );
|
339 |
-
|
340 |
-
if ( ! did_action( 'wp' ) ) {
|
341 |
-
return $debug_data;
|
342 |
-
} else {
|
343 |
-
self::$debug_data = $debug_data;
|
344 |
-
}
|
345 |
-
}
|
346 |
-
|
347 |
-
return self::$debug_data;
|
348 |
-
}
|
349 |
-
|
350 |
-
|
351 |
-
/**
|
352 |
-
* Get debug settings data.
|
353 |
-
*
|
354 |
-
* @return array.
|
355 |
-
*/
|
356 |
-
public static function get_permalink_settings() {
|
357 |
-
|
358 |
-
if ( null === self::$permalink_setting ) {
|
359 |
-
|
360 |
-
$permalink_default = apply_filters(
|
361 |
-
'cartflows_permalink_settings_default',
|
362 |
-
array(
|
363 |
-
'permalink' => CARTFLOWS_STEP_POST_TYPE,
|
364 |
-
'permalink_flow_base' => CARTFLOWS_FLOW_POST_TYPE,
|
365 |
-
'permalink_structure' => '',
|
366 |
-
|
367 |
-
)
|
368 |
-
);
|
369 |
-
|
370 |
-
$permalink_data = self::get_admin_settings_option( '_cartflows_permalink', false, false );
|
371 |
-
|
372 |
-
$permalink_data = wp_parse_args( $permalink_data, $permalink_default );
|
373 |
-
|
374 |
-
if ( ! did_action( 'wp' ) ) {
|
375 |
-
return $permalink_data;
|
376 |
-
} else {
|
377 |
-
self::$permalink_setting = $permalink_data;
|
378 |
-
}
|
379 |
-
}
|
380 |
-
|
381 |
-
return self::$permalink_setting;
|
382 |
-
}
|
383 |
-
|
384 |
-
|
385 |
-
/**
|
386 |
-
* Get debug settings data.
|
387 |
-
*
|
388 |
-
* @return array.
|
389 |
-
*/
|
390 |
-
public static function get_google_analytics_settings() {
|
391 |
-
|
392 |
-
if ( null === self::$google_analytics_settings ) {
|
393 |
-
|
394 |
-
$google_analytics_settings_default = apply_filters(
|
395 |
-
'cartflows_google_analytics_settings_default',
|
396 |
-
array(
|
397 |
-
'enable_google_analytics' => 'disable',
|
398 |
-
'enable_google_analytics_for_site' => 'disable',
|
399 |
-
'google_analytics_id' => '',
|
400 |
-
'enable_begin_checkout' => 'disable',
|
401 |
-
'enable_add_to_cart' => 'disable',
|
402 |
-
'enable_add_payment_info' => 'disable',
|
403 |
-
'enable_purchase_event' => 'disable',
|
404 |
-
)
|
405 |
-
);
|
406 |
-
|
407 |
-
$google_analytics_settings_data = self::get_admin_settings_option( '_cartflows_google_analytics', false, true );
|
408 |
-
|
409 |
-
$google_analytics_settings_data = wp_parse_args( $google_analytics_settings_data, $google_analytics_settings_default );
|
410 |
-
|
411 |
-
if ( ! did_action( 'wp' ) ) {
|
412 |
-
return $google_analytics_settings_data;
|
413 |
-
} else {
|
414 |
-
self::$google_analytics_settings = $google_analytics_settings_data;
|
415 |
-
}
|
416 |
-
}
|
417 |
-
|
418 |
-
return self::$google_analytics_settings = $google_analytics_settings_data; //phpcs:ignore
|
419 |
-
}
|
420 |
-
|
421 |
-
/**
|
422 |
-
* Get Checkout field.
|
423 |
-
*
|
424 |
-
* @param string $key Field key.
|
425 |
-
* @param int $post_id Post id.
|
426 |
-
* @return array.
|
427 |
-
*/
|
428 |
-
public static function get_checkout_fields( $key, $post_id ) {
|
429 |
-
|
430 |
-
$saved_fields = get_post_meta( $post_id, 'wcf_fields_' . $key, true );
|
431 |
-
|
432 |
-
if ( ! $saved_fields ) {
|
433 |
-
$saved_fields = array();
|
434 |
-
}
|
435 |
-
|
436 |
-
$fields = array_filter( $saved_fields );
|
437 |
-
|
438 |
-
if ( empty( $fields ) ) {
|
439 |
-
if ( 'billing' === $key || 'shipping' === $key ) {
|
440 |
-
|
441 |
-
$fields = WC()->countries->get_address_fields( WC()->countries->get_base_country(), $key . '_' );
|
442 |
-
|
443 |
-
update_post_meta( $post_id, 'wcf_fields_' . $key, $fields );
|
444 |
-
}
|
445 |
-
}
|
446 |
-
|
447 |
-
return $fields;
|
448 |
-
}
|
449 |
-
|
450 |
-
/**
|
451 |
-
* Add Checkout field.
|
452 |
-
*
|
453 |
-
* @param string $type Field type.
|
454 |
-
* @param string $field_key Field key.
|
455 |
-
* @param array $field_data Field data.
|
456 |
-
* @param int $post_id Post id.
|
457 |
-
* @return boolean.
|
458 |
-
*/
|
459 |
-
public static function add_checkout_field( $type, $field_key, $field_data = array(), $post_id ) {
|
460 |
-
|
461 |
-
$fields = self::get_checkout_fields( $type, $post_id );
|
462 |
-
|
463 |
-
$fields[ $field_key ] = $field_data;
|
464 |
-
|
465 |
-
update_post_meta( $post_id, 'wcf_fields_' . $type, $fields );
|
466 |
-
|
467 |
-
return true;
|
468 |
-
}
|
469 |
-
|
470 |
-
/**
|
471 |
-
* Get checkout fields settings.
|
472 |
-
*
|
473 |
-
* @param string $type Field type.
|
474 |
-
* @param string $field_key Field key.
|
475 |
-
* @param int $post_id Post id.
|
476 |
-
* @return array.
|
477 |
-
*/
|
478 |
-
public static function delete_checkout_field( $type, $field_key, $post_id ) {
|
479 |
-
|
480 |
-
$fields = self::get_checkout_fields( $type, $post_id );
|
481 |
-
|
482 |
-
if ( isset( $fields[ $field_key ] ) ) {
|
483 |
-
unset( $fields[ $field_key ] );
|
484 |
-
}
|
485 |
-
|
486 |
-
update_post_meta( $post_id, 'wcf_fields_' . $type, $fields );
|
487 |
-
|
488 |
-
return true;
|
489 |
-
}
|
490 |
-
|
491 |
-
/**
|
492 |
-
* Get checkout fields settings.
|
493 |
-
*
|
494 |
-
* @return array.
|
495 |
-
*/
|
496 |
-
public static function get_checkout_fields_settings() {
|
497 |
-
|
498 |
-
if ( null === self::$checkout_fields ) {
|
499 |
-
$checkout_fields_default = array(
|
500 |
-
'enable_customization' => 'disable',
|
501 |
-
'enable_billing_fields' => 'disable',
|
502 |
-
);
|
503 |
-
|
504 |
-
$billing_fields = self::get_checkout_fields( 'billing' );
|
505 |
-
|
506 |
-
if ( is_array( $billing_fields ) && ! empty( $billing_fields ) ) {
|
507 |
-
|
508 |
-
foreach ( $billing_fields as $key => $value ) {
|
509 |
-
|
510 |
-
$checkout_fields_default[ $key ] = 'enable';
|
511 |
-
}
|
512 |
-
}
|
513 |
-
|
514 |
-
$checkout_fields = self::get_admin_settings_option( '_wcf_checkout_fields', false, false );
|
515 |
-
|
516 |
-
self::$checkout_fields = wp_parse_args( $checkout_fields, $checkout_fields_default );
|
517 |
-
}
|
518 |
-
|
519 |
-
return self::$checkout_fields;
|
520 |
-
}
|
521 |
-
|
522 |
-
/**
|
523 |
-
* Get meta options
|
524 |
-
*
|
525 |
-
* @since 1.0.0
|
526 |
-
* @param int $post_id Product ID.
|
527 |
-
* @param string $key Meta Key.
|
528 |
-
* @param string $default Default value.
|
529 |
-
* @return string Meta Value.
|
530 |
-
*/
|
531 |
-
public static function get_meta_option( $post_id, $key, $default = '' ) {
|
532 |
-
|
533 |
-
$value = get_post_meta( $post_id, $key, true );
|
534 |
-
|
535 |
-
if ( ! $value ) {
|
536 |
-
$value = $default;
|
537 |
-
}
|
538 |
-
|
539 |
-
return $value;
|
540 |
-
}
|
541 |
-
|
542 |
-
/**
|
543 |
-
* Save meta option
|
544 |
-
*
|
545 |
-
* @since 1.0.0
|
546 |
-
* @param int $post_id Product ID.
|
547 |
-
* @param array $args Arguments array.
|
548 |
-
*/
|
549 |
-
public static function save_meta_option( $post_id, $args = array() ) {
|
550 |
-
|
551 |
-
if ( is_array( $args ) && ! empty( $args ) ) {
|
552 |
-
|
553 |
-
foreach ( $args as $key => $value ) {
|
554 |
-
|
555 |
-
update_post_meta( $post_id, $key, $value );
|
556 |
-
}
|
557 |
-
}
|
558 |
-
}
|
559 |
-
|
560 |
-
/**
|
561 |
-
* Check if Elementor page builder is installed
|
562 |
-
*
|
563 |
-
* @since 1.0.0
|
564 |
-
*
|
565 |
-
* @access public
|
566 |
-
*/
|
567 |
-
public static function is_elementor_installed() {
|
568 |
-
$path = 'elementor/elementor.php';
|
569 |
-
$plugins = get_plugins();
|
570 |
-
|
571 |
-
return isset( $plugins[ $path ] );
|
572 |
-
}
|
573 |
-
|
574 |
-
/**
|
575 |
-
* Check if Step has product assigned.
|
576 |
-
*
|
577 |
-
* @since 1.0.0
|
578 |
-
* @param int $step_id step ID.
|
579 |
-
*
|
580 |
-
* @access public
|
581 |
-
*/
|
582 |
-
public static function has_product_assigned( $step_id ) {
|
583 |
-
|
584 |
-
$step_type = get_post_meta( $step_id, 'wcf-step-type', true );
|
585 |
-
|
586 |
-
$has_product_assigned = false;
|
587 |
-
|
588 |
-
if ( 'checkout' == $step_type ) {
|
589 |
-
$product = get_post_meta( $step_id, 'wcf-checkout-products', true );
|
590 |
-
|
591 |
-
if ( ! empty( $product ) && isset( $product[0]['product'] ) ) {
|
592 |
-
$has_product_assigned = true;
|
593 |
-
}
|
594 |
-
} else {
|
595 |
-
$product = get_post_meta( $step_id, 'wcf-offer-product', true );
|
596 |
-
if ( ! empty( $product ) ) {
|
597 |
-
$has_product_assigned = true;
|
598 |
-
}
|
599 |
-
}
|
600 |
-
|
601 |
-
return $has_product_assigned;
|
602 |
-
|
603 |
-
}
|
604 |
-
|
605 |
-
/**
|
606 |
-
* Get attributes for cartflows wrap.
|
607 |
-
*
|
608 |
-
* @since 1.1.4
|
609 |
-
*
|
610 |
-
* @access public
|
611 |
-
*/
|
612 |
-
public static function get_cartflows_container_atts() {
|
613 |
-
|
614 |
-
$attributes = apply_filters( 'cartflows_container_atts', array() );
|
615 |
-
$atts_string = '';
|
616 |
-
|
617 |
-
foreach ( $attributes as $key => $value ) {
|
618 |
-
|
619 |
-
if ( ! $value ) {
|
620 |
-
continue;
|
621 |
-
}
|
622 |
-
|
623 |
-
if ( true === $value ) {
|
624 |
-
$atts_string .= esc_html( $key ) . ' ';
|
625 |
-
} else {
|
626 |
-
$atts_string .= sprintf( '%s="%s" ', esc_html( $key ), esc_attr( $value ) );
|
627 |
-
}
|
628 |
-
}
|
629 |
-
|
630 |
-
return $atts_string;
|
631 |
-
}
|
632 |
-
|
633 |
-
/**
|
634 |
-
* Get facebook pixel settings.
|
635 |
-
*
|
636 |
-
* @return facebook array.
|
637 |
-
*/
|
638 |
-
public static function get_facebook_settings() {
|
639 |
-
|
640 |
-
if ( null === self::$facebook ) {
|
641 |
-
|
642 |
-
$facebook_default = array(
|
643 |
-
'facebook_pixel_id' => '',
|
644 |
-
'facebook_pixel_add_to_cart' => 'enable',
|
645 |
-
'facebook_pixel_initiate_checkout' => 'enable',
|
646 |
-
'facebook_pixel_add_payment_info' => 'enable',
|
647 |
-
'facebook_pixel_purchase_complete' => 'enable',
|
648 |
-
'facebook_pixel_tracking' => 'disable',
|
649 |
-
'facebook_pixel_tracking_for_site' => 'disable',
|
650 |
-
);
|
651 |
-
|
652 |
-
$facebook = self::get_admin_settings_option( '_cartflows_facebook', false, false );
|
653 |
-
|
654 |
-
$facebook = wp_parse_args( $facebook, $facebook_default );
|
655 |
-
|
656 |
-
self::$facebook = apply_filters( 'cartflows_facebook_settings_default', $facebook );
|
657 |
-
|
658 |
-
}
|
659 |
-
|
660 |
-
return self::$facebook;
|
661 |
-
}
|
662 |
-
|
663 |
-
|
664 |
-
/**
|
665 |
-
* Prepare response data for facebook.
|
666 |
-
*
|
667 |
-
* @param int $order_id order_id.
|
668 |
-
* @param array $offer_data offer data.
|
669 |
-
*/
|
670 |
-
public static function send_fb_response_if_enabled( $order_id, $offer_data = array() ) {
|
671 |
-
|
672 |
-
// Stop Execution if WooCommerce is not installed & don't set the cookie.
|
673 |
-
if ( ! Cartflows_Loader::get_instance()->is_woo_active ) {
|
674 |
-
return;
|
675 |
-
}
|
676 |
-
|
677 |
-
$fb_settings = self::get_facebook_settings();
|
678 |
-
if ( 'enable' === $fb_settings['facebook_pixel_tracking'] ) {
|
679 |
-
setcookie( 'wcf_order_details', wp_json_encode( self::prepare_purchase_data_fb_response( $order_id, $offer_data ) ), strtotime( '+1 year' ), '/' );
|
680 |
-
}
|
681 |
-
|
682 |
-
}
|
683 |
-
|
684 |
-
/**
|
685 |
-
* Prepare purchase response for facebook purcase event.
|
686 |
-
*
|
687 |
-
* @param integer $order_id order id.
|
688 |
-
* @param array $offer_data offer data.
|
689 |
-
* @return mixed
|
690 |
-
*/
|
691 |
-
public static function prepare_purchase_data_fb_response( $order_id, $offer_data = array() ) {
|
692 |
-
|
693 |
-
$thankyou = array();
|
694 |
-
|
695 |
-
if ( ! Cartflows_Loader::get_instance()->is_woo_active ) {
|
696 |
-
return $thankyou;
|
697 |
-
}
|
698 |
-
|
699 |
-
$thankyou['order_id'] = $order_id;
|
700 |
-
$thankyou['content_type'] = 'product';
|
701 |
-
$thankyou['currency'] = wcf()->options->get_checkout_meta_value( $order_id, '_order_currency' );
|
702 |
-
$thankyou['userAgent'] = wcf()->options->get_checkout_meta_value( $order_id, '_customer_user_agent' );
|
703 |
-
$thankyou['plugin'] = 'CartFlows';
|
704 |
-
$order = wc_get_order( $order_id );
|
705 |
-
if ( empty( $offer_data ) ) {
|
706 |
-
// Iterating through each WC_Order_Item_Product objects.
|
707 |
-
foreach ( $order->get_items() as $item_key => $item ) {
|
708 |
-
$product = $item->get_product(); // Get the WC_Product object.
|
709 |
-
$thankyou['content_ids'][] = (string) $product->get_id();
|
710 |
-
}
|
711 |
-
$thankyou['value'] = wcf()->options->get_checkout_meta_value( $order_id, '_order_total' );
|
712 |
-
} else {
|
713 |
-
$thankyou['content_ids'][] = (string) $offer_data['id'];
|
714 |
-
$thankyou['value'] = $offer_data['total'];
|
715 |
-
}
|
716 |
-
|
717 |
-
return $thankyou;
|
718 |
-
}
|
719 |
-
|
720 |
-
/**
|
721 |
-
* Prepare cart data for fb response.
|
722 |
-
*
|
723 |
-
* @return array
|
724 |
-
*/
|
725 |
-
public static function prepare_cart_data_fb_response() {
|
726 |
-
|
727 |
-
$params = array();
|
728 |
-
|
729 |
-
if ( ! Cartflows_Loader::get_instance()->is_woo_active ) {
|
730 |
-
return $params;
|
731 |
-
}
|
732 |
-
|
733 |
-
$cart_total = WC()->cart->get_cart_contents_total();
|
734 |
-
$cart_items_count = WC()->cart->get_cart_contents_count();
|
735 |
-
$items = WC()->cart->get_cart();
|
736 |
-
$product_names = '';
|
737 |
-
$category_names = '';
|
738 |
-
$cart_contents = array();
|
739 |
-
foreach ( $items as $item => $value ) {
|
740 |
-
|
741 |
-
$_product = wc_get_product( $value['product_id'] );
|
742 |
-
$params['content_ids'][] = (string) $_product->get_id();
|
743 |
-
$product_names = $product_names . ', ' . $_product->get_title();
|
744 |
-
$category_names = $category_names . ', ' . wp_strip_all_tags( wc_get_product_category_list( $_product->get_id() ) );
|
745 |
-
array_push(
|
746 |
-
$cart_contents,
|
747 |
-
array(
|
748 |
-
'id' => $_product->get_id(),
|
749 |
-
'name' => $_product->get_title(),
|
750 |
-
'quantity' => $value['quantity'],
|
751 |
-
'item_price' => $_product->get_price(),
|
752 |
-
)
|
753 |
-
);
|
754 |
-
}
|
755 |
-
|
756 |
-
$user = wp_get_current_user();
|
757 |
-
$roles = implode( ', ', $user->roles );
|
758 |
-
$params['content_name'] = substr( $product_names, 2 );
|
759 |
-
$params['categoey_name'] = substr( $category_names, 2 );
|
760 |
-
$params['user_roles'] = $roles;
|
761 |
-
$params['plugin'] = 'CartFlows';
|
762 |
-
$params['contents'] = wp_json_encode( $cart_contents );
|
763 |
-
$params['content_type'] = 'product';
|
764 |
-
$params['value'] = $cart_total;
|
765 |
-
$params['num_items'] = $cart_items_count;
|
766 |
-
$params['currency'] = get_woocommerce_currency();
|
767 |
-
$params['language'] = get_bloginfo( 'language' );
|
768 |
-
$params['userAgent'] = wp_unslash( $_SERVER['HTTP_USER_AGENT'] ); //phpcs:ignore
|
769 |
-
$params['product_catalog_id'] = '';
|
770 |
-
$params['domain'] = get_site_url();
|
771 |
-
return $params;
|
772 |
-
}
|
773 |
-
|
774 |
-
/**
|
775 |
-
* Get the image url of size.
|
776 |
-
*
|
777 |
-
* @param int $post_id post id.
|
778 |
-
* @param array $key key.
|
779 |
-
* @param string $size image size.
|
780 |
-
*
|
781 |
-
* @return array
|
782 |
-
*/
|
783 |
-
public static function get_image_url( $post_id, $key, $size = false ) {
|
784 |
-
|
785 |
-
$url = get_post_meta( $post_id, $key, true );
|
786 |
-
$img_obj = get_post_meta( $post_id, $key . '-obj', true );
|
787 |
-
if ( is_array( $img_obj ) && ! empty( $img_obj ) && false !== $size ) {
|
788 |
-
|
789 |
-
$url = ! empty( $img_obj['url'][ $size ] ) ? $img_obj['url'][ $size ] : $url;
|
790 |
-
}
|
791 |
-
|
792 |
-
return $url;
|
793 |
-
}
|
794 |
-
|
795 |
-
/**
|
796 |
-
* Create Edit page link for the widgets.
|
797 |
-
*
|
798 |
-
* @since x.x.x
|
799 |
-
* @param string $tab The Tab which has to display.
|
800 |
-
* @access public
|
801 |
-
*/
|
802 |
-
public static function get_current_page_edit_url( $tab ) {
|
803 |
-
|
804 |
-
$url = add_query_arg(
|
805 |
-
array(
|
806 |
-
'wcf-tab' => $tab,
|
807 |
-
),
|
808 |
-
get_edit_post_link()
|
809 |
-
);
|
810 |
-
|
811 |
-
return $url;
|
812 |
-
}
|
813 |
-
|
814 |
-
|
815 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* CARTFLOWS Helper.
|
4 |
+
*
|
5 |
+
* @package CARTFLOWS
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit; // Exit if accessed directly.
|
10 |
+
}
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Class Cartflows_Helper.
|
14 |
+
*/
|
15 |
+
class Cartflows_Helper {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Common global data
|
19 |
+
*
|
20 |
+
* @var zapier
|
21 |
+
*/
|
22 |
+
private static $common = null;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Common Debug data
|
26 |
+
*
|
27 |
+
* @var zapier
|
28 |
+
*/
|
29 |
+
private static $debug_data = null;
|
30 |
+
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Permalink settings
|
34 |
+
*
|
35 |
+
* @var permalink_setting
|
36 |
+
*/
|
37 |
+
private static $permalink_setting = null;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Google Analytics Settings
|
41 |
+
*
|
42 |
+
* @var permalink_setting
|
43 |
+
*/
|
44 |
+
private static $google_analytics_settings = null;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Installed Plugins
|
48 |
+
*
|
49 |
+
* @since 1.1.4
|
50 |
+
*
|
51 |
+
* @access private
|
52 |
+
* @var array Installed plugins list.
|
53 |
+
*/
|
54 |
+
private static $installed_plugins = null;
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Checkout Fields
|
58 |
+
*
|
59 |
+
* @var checkout_fields
|
60 |
+
*/
|
61 |
+
private static $checkout_fields = null;
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Facebook pixel global data
|
65 |
+
*
|
66 |
+
* @var faceboook
|
67 |
+
*/
|
68 |
+
private static $facebook = null;
|
69 |
+
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Returns an option from the database for
|
73 |
+
* the admin settings page.
|
74 |
+
*
|
75 |
+
* @param string $key The option key.
|
76 |
+
* @param mixed $default Option default value if option is not available.
|
77 |
+
* @param boolean $network_override Whether to allow the network admin setting to be overridden on subsites.
|
78 |
+
* @return string Return the option value
|
79 |
+
*/
|
80 |
+
public static function get_admin_settings_option( $key, $default = false, $network_override = false ) {
|
81 |
+
|
82 |
+
// Get the site-wide option if we're in the network admin.
|
83 |
+
if ( $network_override && is_multisite() ) {
|
84 |
+
$value = get_site_option( $key, $default );
|
85 |
+
} else {
|
86 |
+
$value = get_option( $key, $default );
|
87 |
+
}
|
88 |
+
|
89 |
+
return $value;
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Updates an option from the admin settings page.
|
94 |
+
*
|
95 |
+
* @param string $key The option key.
|
96 |
+
* @param mixed $value The value to update.
|
97 |
+
* @param bool $network Whether to allow the network admin setting to be overridden on subsites.
|
98 |
+
* @return mixed
|
99 |
+
*/
|
100 |
+
public static function update_admin_settings_option( $key, $value, $network = false ) {
|
101 |
+
|
102 |
+
// Update the site-wide option since we're in the network admin.
|
103 |
+
if ( $network && is_multisite() ) {
|
104 |
+
update_site_option( $key, $value );
|
105 |
+
} else {
|
106 |
+
update_option( $key, $value );
|
107 |
+
}
|
108 |
+
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Get single setting
|
113 |
+
*
|
114 |
+
* @since 1.1.4
|
115 |
+
*
|
116 |
+
* @param string $key Option key.
|
117 |
+
* @param string $default Option default value if not exist.
|
118 |
+
* @return mixed
|
119 |
+
*/
|
120 |
+
public static function get_common_setting( $key = '', $default = '' ) {
|
121 |
+
$settings = self::get_common_settings();
|
122 |
+
|
123 |
+
if ( $settings && array_key_exists( $key, $settings ) ) {
|
124 |
+
return $settings[ $key ];
|
125 |
+
}
|
126 |
+
|
127 |
+
return $default;
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Get single debug options
|
132 |
+
*
|
133 |
+
* @since 1.1.4
|
134 |
+
*
|
135 |
+
* @param string $key Option key.
|
136 |
+
* @param string $default Option default value if not exist.
|
137 |
+
* @return mixed
|
138 |
+
*/
|
139 |
+
public static function get_debug_setting( $key = '', $default = '' ) {
|
140 |
+
$debug_data = self::get_debug_settings();
|
141 |
+
|
142 |
+
if ( $debug_data && array_key_exists( $key, $debug_data ) ) {
|
143 |
+
return $debug_data[ $key ];
|
144 |
+
}
|
145 |
+
|
146 |
+
return $default;
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Get required plugins for page builder
|
151 |
+
*
|
152 |
+
* @since 1.1.4
|
153 |
+
*
|
154 |
+
* @param string $page_builder_slug Page builder slug.
|
155 |
+
* @param string $default Default page builder.
|
156 |
+
* @return array selected page builder required plugins list.
|
157 |
+
*/
|
158 |
+
public static function get_required_plugins_for_page_builder( $page_builder_slug = '', $default = 'elementor' ) {
|
159 |
+
$plugins = self::get_plugins_groupby_page_builders();
|
160 |
+
|
161 |
+
if ( array_key_exists( $page_builder_slug, $plugins ) ) {
|
162 |
+
return $plugins[ $page_builder_slug ];
|
163 |
+
}
|
164 |
+
|
165 |
+
return $plugins[ $default ];
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Get Plugins list by page builder.
|
170 |
+
*
|
171 |
+
* @since 1.1.4
|
172 |
+
*
|
173 |
+
* @return array Required Plugins list.
|
174 |
+
*/
|
175 |
+
public static function get_plugins_groupby_page_builders() {
|
176 |
+
|
177 |
+
$divi_status = self::get_plugin_status( 'divi-builder/divi-builder.php' );
|
178 |
+
$theme_status = 'not-installed';
|
179 |
+
if ( $divi_status ) {
|
180 |
+
if ( true === Cartflows_Compatibility::get_instance()->is_divi_theme_installed() ) {
|
181 |
+
$theme_status = 'installed';
|
182 |
+
if ( false === Cartflows_Compatibility::get_instance()->is_divi_enabled() ) {
|
183 |
+
$theme_status = 'deactivate';
|
184 |
+
$divi_status = 'activate';
|
185 |
+
} else {
|
186 |
+
$divi_status = '';
|
187 |
+
}
|
188 |
+
}
|
189 |
+
}
|
190 |
+
|
191 |
+
$plugins = array(
|
192 |
+
'elementor' => array(
|
193 |
+
'title' => 'Elementor',
|
194 |
+
'plugins' => array(
|
195 |
+
array(
|
196 |
+
'slug' => 'elementor', // For download from wp.org.
|
197 |
+
'init' => 'elementor/elementor.php',
|
198 |
+
'status' => self::get_plugin_status( 'elementor/elementor.php' ),
|
199 |
+
),
|
200 |
+
),
|
201 |
+
),
|
202 |
+
'gutenberg' => array(
|
203 |
+
'title' => 'Ultimate Addons for Gutenberg',
|
204 |
+
'plugins' => array(
|
205 |
+
array(
|
206 |
+
'slug' => 'ultimate-addons-for-gutenberg', // For download from wp.org.
|
207 |
+
'init' => 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php',
|
208 |
+
'status' => self::get_plugin_status( 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php' ),
|
209 |
+
),
|
210 |
+
),
|
211 |
+
),
|
212 |
+
'divi' => array(
|
213 |
+
'title' => 'Divi',
|
214 |
+
'theme-status' => $theme_status,
|
215 |
+
'plugin-status' => $divi_status,
|
216 |
+
'plugins' => array(
|
217 |
+
array(
|
218 |
+
'slug' => 'divi-builder', // For download from wp.org.
|
219 |
+
'init' => 'divi-builder/divi-builder.php',
|
220 |
+
'status' => $divi_status,
|
221 |
+
),
|
222 |
+
),
|
223 |
+
),
|
224 |
+
);
|
225 |
+
|
226 |
+
$plugins['beaver-builder'] = array(
|
227 |
+
'title' => 'Beaver Builder',
|
228 |
+
'plugins' => array(),
|
229 |
+
);
|
230 |
+
|
231 |
+
// Check Pro Exist.
|
232 |
+
if ( file_exists( WP_PLUGIN_DIR . '/bb-plugin/fl-builder.php' ) && ! is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) ) {
|
233 |
+
$plugins['beaver-builder']['plugins'][] = array(
|
234 |
+
'slug' => 'bb-plugin',
|
235 |
+
'init' => 'bb-plugin/fl-builder.php',
|
236 |
+
'status' => self::get_plugin_status( 'bb-plugin/fl-builder.php' ),
|
237 |
+
);
|
238 |
+
} else {
|
239 |
+
$plugins['beaver-builder']['plugins'][] = array(
|
240 |
+
'slug' => 'beaver-builder-lite-version', // For download from wp.org.
|
241 |
+
'init' => 'beaver-builder-lite-version/fl-builder.php',
|
242 |
+
'status' => self::get_plugin_status( 'beaver-builder-lite-version/fl-builder.php' ),
|
243 |
+
);
|
244 |
+
}
|
245 |
+
|
246 |
+
if ( file_exists( WP_PLUGIN_DIR . '/bb-ultimate-addon/bb-ultimate-addon.php' ) && ! is_plugin_active( 'ultimate-addons-for-beaver-builder-lite/bb-ultimate-addon.php' ) ) {
|
247 |
+
$plugins['beaver-builder']['plugins'][] = array(
|
248 |
+
'slug' => 'bb-ultimate-addon',
|
249 |
+
'init' => 'bb-ultimate-addon/bb-ultimate-addon.php',
|
250 |
+
'status' => self::get_plugin_status( 'bb-ultimate-addon/bb-ultimate-addon.php' ),
|
251 |
+
);
|
252 |
+
} else {
|
253 |
+
$plugins['beaver-builder']['plugins'][] = array(
|
254 |
+
'slug' => 'ultimate-addons-for-beaver-builder-lite', // For download from wp.org.
|
255 |
+
'init' => 'ultimate-addons-for-beaver-builder-lite/bb-ultimate-addon.php',
|
256 |
+
'status' => self::get_plugin_status( 'ultimate-addons-for-beaver-builder-lite/bb-ultimate-addon.php' ),
|
257 |
+
);
|
258 |
+
}
|
259 |
+
|
260 |
+
return $plugins;
|
261 |
+
}
|
262 |
+
|
263 |
+
/**
|
264 |
+
* Get plugin status
|
265 |
+
*
|
266 |
+
* @since 1.1.4
|
267 |
+
*
|
268 |
+
* @param string $plugin_init_file Plguin init file.
|
269 |
+
* @return mixed
|
270 |
+
*/
|
271 |
+
public static function get_plugin_status( $plugin_init_file ) {
|
272 |
+
|
273 |
+
if ( null == self::$installed_plugins ) {
|
274 |
+
self::$installed_plugins = get_plugins();
|
275 |
+
}
|
276 |
+
|
277 |
+
if ( ! isset( self::$installed_plugins[ $plugin_init_file ] ) ) {
|
278 |
+
return 'install';
|
279 |
+
} elseif ( ! is_plugin_active( $plugin_init_file ) ) {
|
280 |
+
return 'activate';
|
281 |
+
} else {
|
282 |
+
return;
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Get zapier settings.
|
288 |
+
*
|
289 |
+
* @return array.
|
290 |
+
*/
|
291 |
+
public static function get_common_settings() {
|
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 );
|
307 |
+
|
308 |
+
$common = wp_parse_args( $common, $common_default );
|
309 |
+
|
310 |
+
if ( ! did_action( 'wp' ) ) {
|
311 |
+
return $common;
|
312 |
+
} else {
|
313 |
+
self::$common = $common;
|
314 |
+
}
|
315 |
+
}
|
316 |
+
|
317 |
+
return self::$common;
|
318 |
+
}
|
319 |
+
|
320 |
+
/**
|
321 |
+
* Get debug settings data.
|
322 |
+
*
|
323 |
+
* @return array.
|
324 |
+
*/
|
325 |
+
public static function get_debug_settings() {
|
326 |
+
|
327 |
+
if ( null === self::$debug_data ) {
|
328 |
+
|
329 |
+
$debug_data_default = apply_filters(
|
330 |
+
'cartflows_debug_settings_default',
|
331 |
+
array(
|
332 |
+
'allow_minified_files' => 'disable',
|
333 |
+
)
|
334 |
+
);
|
335 |
+
|
336 |
+
$debug_data = self::get_admin_settings_option( '_cartflows_debug_data', false, false );
|
337 |
+
|
338 |
+
$debug_data = wp_parse_args( $debug_data, $debug_data_default );
|
339 |
+
|
340 |
+
if ( ! did_action( 'wp' ) ) {
|
341 |
+
return $debug_data;
|
342 |
+
} else {
|
343 |
+
self::$debug_data = $debug_data;
|
344 |
+
}
|
345 |
+
}
|
346 |
+
|
347 |
+
return self::$debug_data;
|
348 |
+
}
|
349 |
+
|
350 |
+
|
351 |
+
/**
|
352 |
+
* Get debug settings data.
|
353 |
+
*
|
354 |
+
* @return array.
|
355 |
+
*/
|
356 |
+
public static function get_permalink_settings() {
|
357 |
+
|
358 |
+
if ( null === self::$permalink_setting ) {
|
359 |
+
|
360 |
+
$permalink_default = apply_filters(
|
361 |
+
'cartflows_permalink_settings_default',
|
362 |
+
array(
|
363 |
+
'permalink' => CARTFLOWS_STEP_POST_TYPE,
|
364 |
+
'permalink_flow_base' => CARTFLOWS_FLOW_POST_TYPE,
|
365 |
+
'permalink_structure' => '',
|
366 |
+
|
367 |
+
)
|
368 |
+
);
|
369 |
+
|
370 |
+
$permalink_data = self::get_admin_settings_option( '_cartflows_permalink', false, false );
|
371 |
+
|
372 |
+
$permalink_data = wp_parse_args( $permalink_data, $permalink_default );
|
373 |
+
|
374 |
+
if ( ! did_action( 'wp' ) ) {
|
375 |
+
return $permalink_data;
|
376 |
+
} else {
|
377 |
+
self::$permalink_setting = $permalink_data;
|
378 |
+
}
|
379 |
+
}
|
380 |
+
|
381 |
+
return self::$permalink_setting;
|
382 |
+
}
|
383 |
+
|
384 |
+
|
385 |
+
/**
|
386 |
+
* Get debug settings data.
|
387 |
+
*
|
388 |
+
* @return array.
|
389 |
+
*/
|
390 |
+
public static function get_google_analytics_settings() {
|
391 |
+
|
392 |
+
if ( null === self::$google_analytics_settings ) {
|
393 |
+
|
394 |
+
$google_analytics_settings_default = apply_filters(
|
395 |
+
'cartflows_google_analytics_settings_default',
|
396 |
+
array(
|
397 |
+
'enable_google_analytics' => 'disable',
|
398 |
+
'enable_google_analytics_for_site' => 'disable',
|
399 |
+
'google_analytics_id' => '',
|
400 |
+
'enable_begin_checkout' => 'disable',
|
401 |
+
'enable_add_to_cart' => 'disable',
|
402 |
+
'enable_add_payment_info' => 'disable',
|
403 |
+
'enable_purchase_event' => 'disable',
|
404 |
+
)
|
405 |
+
);
|
406 |
+
|
407 |
+
$google_analytics_settings_data = self::get_admin_settings_option( '_cartflows_google_analytics', false, true );
|
408 |
+
|
409 |
+
$google_analytics_settings_data = wp_parse_args( $google_analytics_settings_data, $google_analytics_settings_default );
|
410 |
+
|
411 |
+
if ( ! did_action( 'wp' ) ) {
|
412 |
+
return $google_analytics_settings_data;
|
413 |
+
} else {
|
414 |
+
self::$google_analytics_settings = $google_analytics_settings_data;
|
415 |
+
}
|
416 |
+
}
|
417 |
+
|
418 |
+
return self::$google_analytics_settings = $google_analytics_settings_data; //phpcs:ignore
|
419 |
+
}
|
420 |
+
|
421 |
+
/**
|
422 |
+
* Get Checkout field.
|
423 |
+
*
|
424 |
+
* @param string $key Field key.
|
425 |
+
* @param int $post_id Post id.
|
426 |
+
* @return array.
|
427 |
+
*/
|
428 |
+
public static function get_checkout_fields( $key, $post_id ) {
|
429 |
+
|
430 |
+
$saved_fields = get_post_meta( $post_id, 'wcf_fields_' . $key, true );
|
431 |
+
|
432 |
+
if ( ! $saved_fields ) {
|
433 |
+
$saved_fields = array();
|
434 |
+
}
|
435 |
+
|
436 |
+
$fields = array_filter( $saved_fields );
|
437 |
+
|
438 |
+
if ( empty( $fields ) ) {
|
439 |
+
if ( 'billing' === $key || 'shipping' === $key ) {
|
440 |
+
|
441 |
+
$fields = WC()->countries->get_address_fields( WC()->countries->get_base_country(), $key . '_' );
|
442 |
+
|
443 |
+
update_post_meta( $post_id, 'wcf_fields_' . $key, $fields );
|
444 |
+
}
|
445 |
+
}
|
446 |
+
|
447 |
+
return $fields;
|
448 |
+
}
|
449 |
+
|
450 |
+
/**
|
451 |
+
* Add Checkout field.
|
452 |
+
*
|
453 |
+
* @param string $type Field type.
|
454 |
+
* @param string $field_key Field key.
|
455 |
+
* @param array $field_data Field data.
|
456 |
+
* @param int $post_id Post id.
|
457 |
+
* @return boolean.
|
458 |
+
*/
|
459 |
+
public static function add_checkout_field( $type, $field_key, $field_data = array(), $post_id ) {
|
460 |
+
|
461 |
+
$fields = self::get_checkout_fields( $type, $post_id );
|
462 |
+
|
463 |
+
$fields[ $field_key ] = $field_data;
|
464 |
+
|
465 |
+
update_post_meta( $post_id, 'wcf_fields_' . $type, $fields );
|
466 |
+
|
467 |
+
return true;
|
468 |
+
}
|
469 |
+
|
470 |
+
/**
|
471 |
+
* Get checkout fields settings.
|
472 |
+
*
|
473 |
+
* @param string $type Field type.
|
474 |
+
* @param string $field_key Field key.
|
475 |
+
* @param int $post_id Post id.
|
476 |
+
* @return array.
|
477 |
+
*/
|
478 |
+
public static function delete_checkout_field( $type, $field_key, $post_id ) {
|
479 |
+
|
480 |
+
$fields = self::get_checkout_fields( $type, $post_id );
|
481 |
+
|
482 |
+
if ( isset( $fields[ $field_key ] ) ) {
|
483 |
+
unset( $fields[ $field_key ] );
|
484 |
+
}
|
485 |
+
|
486 |
+
update_post_meta( $post_id, 'wcf_fields_' . $type, $fields );
|
487 |
+
|
488 |
+
return true;
|
489 |
+
}
|
490 |
+
|
491 |
+
/**
|
492 |
+
* Get checkout fields settings.
|
493 |
+
*
|
494 |
+
* @return array.
|
495 |
+
*/
|
496 |
+
public static function get_checkout_fields_settings() {
|
497 |
+
|
498 |
+
if ( null === self::$checkout_fields ) {
|
499 |
+
$checkout_fields_default = array(
|
500 |
+
'enable_customization' => 'disable',
|
501 |
+
'enable_billing_fields' => 'disable',
|
502 |
+
);
|
503 |
+
|
504 |
+
$billing_fields = self::get_checkout_fields( 'billing' );
|
505 |
+
|
506 |
+
if ( is_array( $billing_fields ) && ! empty( $billing_fields ) ) {
|
507 |
+
|
508 |
+
foreach ( $billing_fields as $key => $value ) {
|
509 |
+
|
510 |
+
$checkout_fields_default[ $key ] = 'enable';
|
511 |
+
}
|
512 |
+
}
|
513 |
+
|
514 |
+
$checkout_fields = self::get_admin_settings_option( '_wcf_checkout_fields', false, false );
|
515 |
+
|
516 |
+
self::$checkout_fields = wp_parse_args( $checkout_fields, $checkout_fields_default );
|
517 |
+
}
|
518 |
+
|
519 |
+
return self::$checkout_fields;
|
520 |
+
}
|
521 |
+
|
522 |
+
/**
|
523 |
+
* Get meta options
|
524 |
+
*
|
525 |
+
* @since 1.0.0
|
526 |
+
* @param int $post_id Product ID.
|
527 |
+
* @param string $key Meta Key.
|
528 |
+
* @param string $default Default value.
|
529 |
+
* @return string Meta Value.
|
530 |
+
*/
|
531 |
+
public static function get_meta_option( $post_id, $key, $default = '' ) {
|
532 |
+
|
533 |
+
$value = get_post_meta( $post_id, $key, true );
|
534 |
+
|
535 |
+
if ( ! $value ) {
|
536 |
+
$value = $default;
|
537 |
+
}
|
538 |
+
|
539 |
+
return $value;
|
540 |
+
}
|
541 |
+
|
542 |
+
/**
|
543 |
+
* Save meta option
|
544 |
+
*
|
545 |
+
* @since 1.0.0
|
546 |
+
* @param int $post_id Product ID.
|
547 |
+
* @param array $args Arguments array.
|
548 |
+
*/
|
549 |
+
public static function save_meta_option( $post_id, $args = array() ) {
|
550 |
+
|
551 |
+
if ( is_array( $args ) && ! empty( $args ) ) {
|
552 |
+
|
553 |
+
foreach ( $args as $key => $value ) {
|
554 |
+
|
555 |
+
update_post_meta( $post_id, $key, $value );
|
556 |
+
}
|
557 |
+
}
|
558 |
+
}
|
559 |
+
|
560 |
+
/**
|
561 |
+
* Check if Elementor page builder is installed
|
562 |
+
*
|
563 |
+
* @since 1.0.0
|
564 |
+
*
|
565 |
+
* @access public
|
566 |
+
*/
|
567 |
+
public static function is_elementor_installed() {
|
568 |
+
$path = 'elementor/elementor.php';
|
569 |
+
$plugins = get_plugins();
|
570 |
+
|
571 |
+
return isset( $plugins[ $path ] );
|
572 |
+
}
|
573 |
+
|
574 |
+
/**
|
575 |
+
* Check if Step has product assigned.
|
576 |
+
*
|
577 |
+
* @since 1.0.0
|
578 |
+
* @param int $step_id step ID.
|
579 |
+
*
|
580 |
+
* @access public
|
581 |
+
*/
|
582 |
+
public static function has_product_assigned( $step_id ) {
|
583 |
+
|
584 |
+
$step_type = get_post_meta( $step_id, 'wcf-step-type', true );
|
585 |
+
|
586 |
+
$has_product_assigned = false;
|
587 |
+
|
588 |
+
if ( 'checkout' == $step_type ) {
|
589 |
+
$product = get_post_meta( $step_id, 'wcf-checkout-products', true );
|
590 |
+
|
591 |
+
if ( ! empty( $product ) && isset( $product[0]['product'] ) ) {
|
592 |
+
$has_product_assigned = true;
|
593 |
+
}
|
594 |
+
} else {
|
595 |
+
$product = get_post_meta( $step_id, 'wcf-offer-product', true );
|
596 |
+
if ( ! empty( $product ) ) {
|
597 |
+
$has_product_assigned = true;
|
598 |
+
}
|
599 |
+
}
|
600 |
+
|
601 |
+
return $has_product_assigned;
|
602 |
+
|
603 |
+
}
|
604 |
+
|
605 |
+
/**
|
606 |
+
* Get attributes for cartflows wrap.
|
607 |
+
*
|
608 |
+
* @since 1.1.4
|
609 |
+
*
|
610 |
+
* @access public
|
611 |
+
*/
|
612 |
+
public static function get_cartflows_container_atts() {
|
613 |
+
|
614 |
+
$attributes = apply_filters( 'cartflows_container_atts', array() );
|
615 |
+
$atts_string = '';
|
616 |
+
|
617 |
+
foreach ( $attributes as $key => $value ) {
|
618 |
+
|
619 |
+
if ( ! $value ) {
|
620 |
+
continue;
|
621 |
+
}
|
622 |
+
|
623 |
+
if ( true === $value ) {
|
624 |
+
$atts_string .= esc_html( $key ) . ' ';
|
625 |
+
} else {
|
626 |
+
$atts_string .= sprintf( '%s="%s" ', esc_html( $key ), esc_attr( $value ) );
|
627 |
+
}
|
628 |
+
}
|
629 |
+
|
630 |
+
return $atts_string;
|
631 |
+
}
|
632 |
+
|
633 |
+
/**
|
634 |
+
* Get facebook pixel settings.
|
635 |
+
*
|
636 |
+
* @return facebook array.
|
637 |
+
*/
|
638 |
+
public static function get_facebook_settings() {
|
639 |
+
|
640 |
+
if ( null === self::$facebook ) {
|
641 |
+
|
642 |
+
$facebook_default = array(
|
643 |
+
'facebook_pixel_id' => '',
|
644 |
+
'facebook_pixel_add_to_cart' => 'enable',
|
645 |
+
'facebook_pixel_initiate_checkout' => 'enable',
|
646 |
+
'facebook_pixel_add_payment_info' => 'enable',
|
647 |
+
'facebook_pixel_purchase_complete' => 'enable',
|
648 |
+
'facebook_pixel_tracking' => 'disable',
|
649 |
+
'facebook_pixel_tracking_for_site' => 'disable',
|
650 |
+
);
|
651 |
+
|
652 |
+
$facebook = self::get_admin_settings_option( '_cartflows_facebook', false, false );
|
653 |
+
|
654 |
+
$facebook = wp_parse_args( $facebook, $facebook_default );
|
655 |
+
|
656 |
+
self::$facebook = apply_filters( 'cartflows_facebook_settings_default', $facebook );
|
657 |
+
|
658 |
+
}
|
659 |
+
|
660 |
+
return self::$facebook;
|
661 |
+
}
|
662 |
+
|
663 |
+
|
664 |
+
/**
|
665 |
+
* Prepare response data for facebook.
|
666 |
+
*
|
667 |
+
* @param int $order_id order_id.
|
668 |
+
* @param array $offer_data offer data.
|
669 |
+
*/
|
670 |
+
public static function send_fb_response_if_enabled( $order_id, $offer_data = array() ) {
|
671 |
+
|
672 |
+
// Stop Execution if WooCommerce is not installed & don't set the cookie.
|
673 |
+
if ( ! Cartflows_Loader::get_instance()->is_woo_active ) {
|
674 |
+
return;
|
675 |
+
}
|
676 |
+
|
677 |
+
$fb_settings = self::get_facebook_settings();
|
678 |
+
if ( 'enable' === $fb_settings['facebook_pixel_tracking'] ) {
|
679 |
+
setcookie( 'wcf_order_details', wp_json_encode( self::prepare_purchase_data_fb_response( $order_id, $offer_data ) ), strtotime( '+1 year' ), '/' );
|
680 |
+
}
|
681 |
+
|
682 |
+
}
|
683 |
+
|
684 |
+
/**
|
685 |
+
* Prepare purchase response for facebook purcase event.
|
686 |
+
*
|
687 |
+
* @param integer $order_id order id.
|
688 |
+
* @param array $offer_data offer data.
|
689 |
+
* @return mixed
|
690 |
+
*/
|
691 |
+
public static function prepare_purchase_data_fb_response( $order_id, $offer_data = array() ) {
|
692 |
+
|
693 |
+
$thankyou = array();
|
694 |
+
|
695 |
+
if ( ! Cartflows_Loader::get_instance()->is_woo_active ) {
|
696 |
+
return $thankyou;
|
697 |
+
}
|
698 |
+
|
699 |
+
$thankyou['order_id'] = $order_id;
|
700 |
+
$thankyou['content_type'] = 'product';
|
701 |
+
$thankyou['currency'] = wcf()->options->get_checkout_meta_value( $order_id, '_order_currency' );
|
702 |
+
$thankyou['userAgent'] = wcf()->options->get_checkout_meta_value( $order_id, '_customer_user_agent' );
|
703 |
+
$thankyou['plugin'] = 'CartFlows';
|
704 |
+
$order = wc_get_order( $order_id );
|
705 |
+
if ( empty( $offer_data ) ) {
|
706 |
+
// Iterating through each WC_Order_Item_Product objects.
|
707 |
+
foreach ( $order->get_items() as $item_key => $item ) {
|
708 |
+
$product = $item->get_product(); // Get the WC_Product object.
|
709 |
+
$thankyou['content_ids'][] = (string) $product->get_id();
|
710 |
+
}
|
711 |
+
$thankyou['value'] = wcf()->options->get_checkout_meta_value( $order_id, '_order_total' );
|
712 |
+
} else {
|
713 |
+
$thankyou['content_ids'][] = (string) $offer_data['id'];
|
714 |
+
$thankyou['value'] = $offer_data['total'];
|
715 |
+
}
|
716 |
+
|
717 |
+
return $thankyou;
|
718 |
+
}
|
719 |
+
|
720 |
+
/**
|
721 |
+
* Prepare cart data for fb response.
|
722 |
+
*
|
723 |
+
* @return array
|
724 |
+
*/
|
725 |
+
public static function prepare_cart_data_fb_response() {
|
726 |
+
|
727 |
+
$params = array();
|
728 |
+
|
729 |
+
if ( ! Cartflows_Loader::get_instance()->is_woo_active ) {
|
730 |
+
return $params;
|
731 |
+
}
|
732 |
+
|
733 |
+
$cart_total = WC()->cart->get_cart_contents_total();
|
734 |
+
$cart_items_count = WC()->cart->get_cart_contents_count();
|
735 |
+
$items = WC()->cart->get_cart();
|
736 |
+
$product_names = '';
|
737 |
+
$category_names = '';
|
738 |
+
$cart_contents = array();
|
739 |
+
foreach ( $items as $item => $value ) {
|
740 |
+
|
741 |
+
$_product = wc_get_product( $value['product_id'] );
|
742 |
+
$params['content_ids'][] = (string) $_product->get_id();
|
743 |
+
$product_names = $product_names . ', ' . $_product->get_title();
|
744 |
+
$category_names = $category_names . ', ' . wp_strip_all_tags( wc_get_product_category_list( $_product->get_id() ) );
|
745 |
+
array_push(
|
746 |
+
$cart_contents,
|
747 |
+
array(
|
748 |
+
'id' => $_product->get_id(),
|
749 |
+
'name' => $_product->get_title(),
|
750 |
+
'quantity' => $value['quantity'],
|
751 |
+
'item_price' => $_product->get_price(),
|
752 |
+
)
|
753 |
+
);
|
754 |
+
}
|
755 |
+
|
756 |
+
$user = wp_get_current_user();
|
757 |
+
$roles = implode( ', ', $user->roles );
|
758 |
+
$params['content_name'] = substr( $product_names, 2 );
|
759 |
+
$params['categoey_name'] = substr( $category_names, 2 );
|
760 |
+
$params['user_roles'] = $roles;
|
761 |
+
$params['plugin'] = 'CartFlows';
|
762 |
+
$params['contents'] = wp_json_encode( $cart_contents );
|
763 |
+
$params['content_type'] = 'product';
|
764 |
+
$params['value'] = $cart_total;
|
765 |
+
$params['num_items'] = $cart_items_count;
|
766 |
+
$params['currency'] = get_woocommerce_currency();
|
767 |
+
$params['language'] = get_bloginfo( 'language' );
|
768 |
+
$params['userAgent'] = wp_unslash( $_SERVER['HTTP_USER_AGENT'] ); //phpcs:ignore
|
769 |
+
$params['product_catalog_id'] = '';
|
770 |
+
$params['domain'] = get_site_url();
|
771 |
+
return $params;
|
772 |
+
}
|
773 |
+
|
774 |
+
/**
|
775 |
+
* Get the image url of size.
|
776 |
+
*
|
777 |
+
* @param int $post_id post id.
|
778 |
+
* @param array $key key.
|
779 |
+
* @param string $size image size.
|
780 |
+
*
|
781 |
+
* @return array
|
782 |
+
*/
|
783 |
+
public static function get_image_url( $post_id, $key, $size = false ) {
|
784 |
+
|
785 |
+
$url = get_post_meta( $post_id, $key, true );
|
786 |
+
$img_obj = get_post_meta( $post_id, $key . '-obj', true );
|
787 |
+
if ( is_array( $img_obj ) && ! empty( $img_obj ) && false !== $size ) {
|
788 |
+
|
789 |
+
$url = ! empty( $img_obj['url'][ $size ] ) ? $img_obj['url'][ $size ] : $url;
|
790 |
+
}
|
791 |
+
|
792 |
+
return $url;
|
793 |
+
}
|
794 |
+
|
795 |
+
/**
|
796 |
+
* Create Edit page link for the widgets.
|
797 |
+
*
|
798 |
+
* @since x.x.x
|
799 |
+
* @param string $tab The Tab which has to display.
|
800 |
+
* @access public
|
801 |
+
*/
|
802 |
+
public static function get_current_page_edit_url( $tab ) {
|
803 |
+
|
804 |
+
$url = add_query_arg(
|
805 |
+
array(
|
806 |
+
'wcf-tab' => $tab,
|
807 |
+
),
|
808 |
+
get_edit_post_link()
|
809 |
+
);
|
810 |
+
|
811 |
+
return $url;
|
812 |
+
}
|
813 |
+
|
814 |
+
|
815 |
+
}
|
classes/class-cartflows-importer.php
CHANGED
@@ -1068,8 +1068,6 @@ if ( ! class_exists( 'CartFlows_Importer' ) ) :
|
|
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 |
|
1068 |
|
1069 |
$localize_vars['cartflows_activate_plugin_nonce'] = wp_create_nonce( 'cartflows_activate_plugin' );
|
1070 |
|
|
|
|
|
1071 |
// Add thickbox.
|
1072 |
add_thickbox();
|
1073 |
|
classes/class-cartflows-loader.php
CHANGED
@@ -134,7 +134,7 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
|
|
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.
|
138 |
define( 'CARTFLOWS_SLUG', 'cartflows' );
|
139 |
define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
|
140 |
|
@@ -383,6 +383,8 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
|
|
383 |
include_once CARTFLOWS_DIR . 'classes/class-cartflows-metabox.php';
|
384 |
|
385 |
include_once CARTFLOWS_DIR . 'classes/deprecated/deprecated-hooks.php';
|
|
|
|
|
386 |
}
|
387 |
|
388 |
/**
|
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.20' );
|
138 |
define( 'CARTFLOWS_SLUG', 'cartflows' );
|
139 |
define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
|
140 |
|
383 |
include_once CARTFLOWS_DIR . 'classes/class-cartflows-metabox.php';
|
384 |
|
385 |
include_once CARTFLOWS_DIR . 'classes/deprecated/deprecated-hooks.php';
|
386 |
+
|
387 |
+
include_once CARTFLOWS_DIR . 'modules/gutenberg/classes/class-cartflows-block-loader.php';
|
388 |
}
|
389 |
|
390 |
/**
|
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 .= ' – ' . 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…', '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…', '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 .= ' – ' . 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…', '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…', '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
@@ -121,7 +121,13 @@ class Cartflows_Utils {
|
|
121 |
|
122 |
global $post;
|
123 |
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
}
|
126 |
|
127 |
/**
|
@@ -268,6 +274,25 @@ class Cartflows_Utils {
|
|
268 |
return false;
|
269 |
}
|
270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
/**
|
272 |
* Check for thank you page
|
273 |
*
|
121 |
|
122 |
global $post;
|
123 |
|
124 |
+
$post_meta = false;
|
125 |
+
|
126 |
+
if ( $post ) {
|
127 |
+
$post_meta = get_post_meta( $post->ID, 'wcf-flow-id', true );
|
128 |
+
}
|
129 |
+
|
130 |
+
return $post_meta;
|
131 |
}
|
132 |
|
133 |
/**
|
274 |
return false;
|
275 |
}
|
276 |
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Check for checkout page
|
280 |
+
*
|
281 |
+
* @param int $step_id step ID.
|
282 |
+
* @return bool
|
283 |
+
*/
|
284 |
+
public function check_is_checkout_page( $step_id ) {
|
285 |
+
|
286 |
+
$step_type = $this->get_step_type( $step_id );
|
287 |
+
|
288 |
+
if ( 'checkout' === $step_type ) {
|
289 |
+
|
290 |
+
return true;
|
291 |
+
}
|
292 |
+
|
293 |
+
return false;
|
294 |
+
}
|
295 |
+
|
296 |
/**
|
297 |
* Check for thank you page
|
298 |
*
|
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'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'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;
|
classes/class-cartflows-woo-hooks.php
CHANGED
@@ -1,81 +1,81 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Woo hooks for compatibility. Data processed for performance.
|
4 |
-
*
|
5 |
-
* @package CartFlows
|
6 |
-
*/
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Class for elementor page builder compatibility
|
10 |
-
*/
|
11 |
-
class Cartflows_Woo_Hooks {
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Member Variable
|
15 |
-
*
|
16 |
-
* @var instance
|
17 |
-
*/
|
18 |
-
private static $instance;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Member Variable
|
22 |
-
*
|
23 |
-
* @var instance
|
24 |
-
*/
|
25 |
-
public static $ajax_data = array();
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Initiator
|
29 |
-
*/
|
30 |
-
public static function get_instance() {
|
31 |
-
if ( ! isset( self::$instance ) ) {
|
32 |
-
self::$instance = new self();
|
33 |
-
}
|
34 |
-
return self::$instance;
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Constructor
|
39 |
-
*/
|
40 |
-
public function __construct() {
|
41 |
-
|
42 |
-
add_action( 'init', array( $this, 'register_wc_hooks' ), 999 );
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Rgister wc hookes for elementor preview mode
|
47 |
-
*/
|
48 |
-
public function register_wc_hooks() {
|
49 |
-
|
50 |
-
if ( isset( $_GET['wc-ajax'] ) && 'update_order_review' === $_GET['wc-ajax'] ) { //phpcs:ignore
|
51 |
-
$post_data = array();
|
52 |
-
|
53 |
-
$post_raw_data = isset( $_POST['post_data'] ) ? sanitize_text_field( wp_unslash( $_POST['post_data'] ) ) : ''; //phpcs:ignore
|
54 |
-
|
55 |
-
parse_str( $post_raw_data, $post_data );
|
56 |
-
|
57 |
-
self::$ajax_data = $post_data;
|
58 |
-
|
59 |
-
do_action( 'cartflows_woo_checkout_update_order_review_init', self::$ajax_data );
|
60 |
-
|
61 |
-
/* Woocommerce update order action */
|
62 |
-
add_action( 'woocommerce_checkout_update_order_review', array( $this, 'update_order_review_hook' ) );
|
63 |
-
}
|
64 |
-
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Update order review hook
|
69 |
-
*
|
70 |
-
* @param string $post_raw_data post data.
|
71 |
-
*/
|
72 |
-
public function update_order_review_hook( $post_raw_data ) {
|
73 |
-
|
74 |
-
do_action( 'cartflows_woo_checkout_update_order_review', self::$ajax_data );
|
75 |
-
}
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Kicking this off by calling 'get_instance()' method
|
80 |
-
*/
|
81 |
-
Cartflows_Woo_Hooks::get_instance();
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Woo hooks for compatibility. Data processed for performance.
|
4 |
+
*
|
5 |
+
* @package CartFlows
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class for elementor page builder compatibility
|
10 |
+
*/
|
11 |
+
class Cartflows_Woo_Hooks {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Member Variable
|
15 |
+
*
|
16 |
+
* @var instance
|
17 |
+
*/
|
18 |
+
private static $instance;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Member Variable
|
22 |
+
*
|
23 |
+
* @var instance
|
24 |
+
*/
|
25 |
+
public static $ajax_data = array();
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Initiator
|
29 |
+
*/
|
30 |
+
public static function get_instance() {
|
31 |
+
if ( ! isset( self::$instance ) ) {
|
32 |
+
self::$instance = new self();
|
33 |
+
}
|
34 |
+
return self::$instance;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Constructor
|
39 |
+
*/
|
40 |
+
public function __construct() {
|
41 |
+
|
42 |
+
add_action( 'init', array( $this, 'register_wc_hooks' ), 999 );
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Rgister wc hookes for elementor preview mode
|
47 |
+
*/
|
48 |
+
public function register_wc_hooks() {
|
49 |
+
|
50 |
+
if ( isset( $_GET['wc-ajax'] ) && 'update_order_review' === $_GET['wc-ajax'] ) { //phpcs:ignore
|
51 |
+
$post_data = array();
|
52 |
+
|
53 |
+
$post_raw_data = isset( $_POST['post_data'] ) ? sanitize_text_field( wp_unslash( $_POST['post_data'] ) ) : ''; //phpcs:ignore
|
54 |
+
|
55 |
+
parse_str( $post_raw_data, $post_data );
|
56 |
+
|
57 |
+
self::$ajax_data = $post_data;
|
58 |
+
|
59 |
+
do_action( 'cartflows_woo_checkout_update_order_review_init', self::$ajax_data );
|
60 |
+
|
61 |
+
/* Woocommerce update order action */
|
62 |
+
add_action( 'woocommerce_checkout_update_order_review', array( $this, 'update_order_review_hook' ) );
|
63 |
+
}
|
64 |
+
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Update order review hook
|
69 |
+
*
|
70 |
+
* @param string $post_raw_data post data.
|
71 |
+
*/
|
72 |
+
public function update_order_review_hook( $post_raw_data ) {
|
73 |
+
|
74 |
+
do_action( 'cartflows_woo_checkout_update_order_review', self::$ajax_data );
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Kicking this off by calling 'get_instance()' method
|
80 |
+
*/
|
81 |
+
Cartflows_Woo_Hooks::get_instance();
|
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.', '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.', '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…', '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…', '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,3057 +1,3071 @@
|
|
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.
|
6 |
-
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
|
7 |
-
"POT-Creation-Date: 2020-
|
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:
|
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:
|
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:
|
329 |
-
msgid "Sales Landing"
|
330 |
-
msgstr ""
|
331 |
-
|
332 |
-
#: classes/class-cartflows-importer.php:
|
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:
|
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:
|
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:
|
351 |
-
msgid "Thank You"
|
352 |
-
msgstr ""
|
353 |
-
|
354 |
-
#: classes/class-cartflows-importer.php:
|
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:
|
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:
|
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:
|
371 |
-
msgid "Action failed. Invalid Security Nonce."
|
372 |
-
msgstr ""
|
373 |
-
|
374 |
-
#: classes/class-cartflows-importer.php:
|
375 |
-
msgid "User have not plugin install permissions."
|
376 |
-
msgstr ""
|
377 |
-
|
378 |
-
#: classes/class-cartflows-importer.php:
|
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:
|
386 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
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:
|
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:
|
418 |
-
msgid "Activate WooCommerce"
|
419 |
-
msgstr ""
|
420 |
-
|
421 |
-
#: classes/class-cartflows-loader.php:
|
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…"
|
473 |
-
msgstr ""
|
474 |
-
|
475 |
-
#: classes/class-cartflows-meta-fields.php:816
|
476 |
-
msgid "Search for a coupon…"
|
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'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:
|
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."
|
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 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:
|
1084 |
-
#: modules/beaver-builder/cartflows-bb-
|
1085 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
1086 |
-
#: modules/beaver-builder/cartflows-bb-
|
1087 |
-
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:
|
1088 |
-
#: modules/beaver-builder/cartflows-bb-
|
1089 |
-
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
#: modules/
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
#: modules/
|
1108 |
-
#: modules/
|
1109 |
-
#: modules/
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
#: modules/
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
#: modules/
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
#: modules/
|
1133 |
-
#: modules/
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
#: modules/
|
1140 |
-
#: modules/
|
1141 |
-
#: modules/
|
1142 |
-
#: modules/
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
#: modules/beaver-builder/cartflows-bb-
|
1149 |
-
#: modules/
|
1150 |
-
#: modules/
|
1151 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1152 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
#: modules/beaver-builder/cartflows-bb-
|
1171 |
-
#: modules/beaver-builder/cartflows-bb-
|
1172 |
-
#: modules/beaver-builder/cartflows-bb-
|
1173 |
-
#: modules/beaver-builder/cartflows-bb-
|
1174 |
-
#: modules/beaver-builder/cartflows-bb-
|
1175 |
-
#: modules/
|
1176 |
-
#: modules/
|
1177 |
-
#: modules/
|
1178 |
-
#: modules/
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
#: modules/
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
#: modules/
|
1191 |
-
#: modules/
|
1192 |
-
#: modules/
|
1193 |
-
#: modules/
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:
|
1200 |
-
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:
|
1201 |
-
#: modules/beaver-builder/cartflows-bb-
|
1202 |
-
#: modules/beaver-builder/cartflows-bb-
|
1203 |
-
#: modules/beaver-builder/cartflows-bb-
|
1204 |
-
#: modules/beaver-builder/cartflows-bb-
|
1205 |
-
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:
|
1206 |
-
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:
|
1207 |
-
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:
|
1208 |
-
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:
|
1209 |
-
#: modules/
|
1210 |
-
#: modules/
|
1211 |
-
#: modules/
|
1212 |
-
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:
|
1213 |
-
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:
|
1214 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1215 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1216 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1217 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1218 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1219 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1220 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1221 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1222 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1223 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1224 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1225 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1226 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1227 |
-
#: modules/
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:
|
1234 |
-
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:
|
1235 |
-
#: modules/beaver-builder/cartflows-bb-
|
1236 |
-
#: modules/beaver-builder/cartflows-bb-
|
1237 |
-
#: modules/beaver-builder/cartflows-bb-
|
1238 |
-
#: modules/beaver-builder/cartflows-bb-
|
1239 |
-
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:
|
1240 |
-
#: modules/beaver-builder/cartflows-bb-
|
1241 |
-
#: modules/beaver-builder/cartflows-bb-
|
1242 |
-
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
#: modules/
|
1249 |
-
#: modules/
|
1250 |
-
#: modules/
|
1251 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1252 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1253 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1254 |
-
#: modules/
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
#: modules/
|
1261 |
-
#: modules/
|
1262 |
-
#: modules/
|
1263 |
-
#: modules/
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
"
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
#: modules/
|
1277 |
-
#: modules/
|
1278 |
-
#: modules/
|
1279 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1280 |
-
#: modules/
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
#: modules/
|
1287 |
-
#: modules/
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
#: modules/
|
1294 |
-
#: modules/
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
#: modules/beaver-builder/cartflows-bb-
|
1301 |
-
#: modules/beaver-builder/cartflows-bb-
|
1302 |
-
#: modules/
|
1303 |
-
#: modules/
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
#: modules/beaver-builder/cartflows-bb-
|
1310 |
-
#: modules/beaver-builder/cartflows-bb-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
#: modules/beaver-builder/cartflows-bb-
|
1319 |
-
#: modules/beaver-builder/cartflows-bb-
|
1320 |
-
#: modules/
|
1321 |
-
#: modules/
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
#: modules/beaver-builder/cartflows-bb-
|
1328 |
-
#: modules/beaver-builder/cartflows-bb-
|
1329 |
-
#: modules/
|
1330 |
-
#: modules/
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
#: modules/beaver-builder/cartflows-bb-
|
1337 |
-
#: modules/beaver-builder/cartflows-bb-
|
1338 |
-
#: modules/
|
1339 |
-
#: modules/
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
#: modules/beaver-builder/cartflows-bb-
|
1346 |
-
#: modules/beaver-builder/cartflows-bb-
|
1347 |
-
#: modules/
|
1348 |
-
#: modules/
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
#: modules/beaver-builder/cartflows-bb-
|
1355 |
-
#: modules/beaver-builder/cartflows-bb-
|
1356 |
-
#: modules/
|
1357 |
-
#: modules/
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:
|
1364 |
-
#: modules/beaver-builder/cartflows-bb-
|
1365 |
-
#: modules/beaver-builder/cartflows-bb-
|
1366 |
-
#: modules/
|
1367 |
-
#: modules/
|
1368 |
-
#: modules/
|
1369 |
-
#: modules/
|
1370 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1371 |
-
#: modules/
|
1372 |
-
#: modules/
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:
|
1379 |
-
#: modules/beaver-builder/cartflows-bb-
|
1380 |
-
#: modules/beaver-builder/cartflows-bb-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
#: modules/
|
1387 |
-
#: modules/
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
#: modules/beaver-builder/cartflows-bb-
|
1394 |
-
#: modules/
|
1395 |
-
#: modules/optin/
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
#: modules/beaver-builder/cartflows-bb-
|
1402 |
-
#: modules/beaver-builder/cartflows-bb-
|
1403 |
-
#: modules/beaver-builder/cartflows-bb-
|
1404 |
-
#: modules/beaver-builder/cartflows-bb-
|
1405 |
-
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:
|
1406 |
-
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:
|
1407 |
-
#: modules/
|
1408 |
-
#: modules/
|
1409 |
-
#: modules/
|
1410 |
-
#: modules/
|
1411 |
-
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:
|
1412 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1413 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1414 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1415 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1416 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1417 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1418 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1419 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1420 |
-
#: modules/
|
1421 |
-
#: modules/
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
#: modules/beaver-builder/cartflows-bb-
|
1428 |
-
#: modules/
|
1429 |
-
#: modules/optin/
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
#: modules/beaver-builder/cartflows-bb-
|
1436 |
-
#: modules/
|
1437 |
-
#: modules/
|
1438 |
-
#: modules/
|
1439 |
-
#: modules/
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
#: modules/
|
1498 |
-
msgid "
|
1499 |
-
msgstr ""
|
1500 |
-
|
1501 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
#: modules/
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
#: modules/
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
#: modules/
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
#: modules/
|
1523 |
-
msgid "
|
1524 |
-
msgstr ""
|
1525 |
-
|
1526 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
1527 |
-
msgid "
|
1528 |
-
msgstr ""
|
1529 |
-
|
1530 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
1531 |
-
msgid "
|
1532 |
-
msgstr ""
|
1533 |
-
|
1534 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
-
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
1621 |
-
|
1622 |
-
|
1623 |
-
|
1624 |
-
|
1625 |
-
|
1626 |
-
|
1627 |
-
|
1628 |
-
|
1629 |
-
|
1630 |
-
|
1631 |
-
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
#: modules/
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
#: modules/
|
1654 |
-
#: modules/
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
#: modules/
|
1662 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1663 |
-
#: modules/
|
1664 |
-
msgid "
|
1665 |
-
msgstr ""
|
1666 |
-
|
1667 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
1668 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
1669 |
-
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:
|
1670 |
-
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:
|
1671 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1672 |
-
#: modules/optin/classes/class-cartflows-optin-meta.php:
|
1673 |
-
msgid "
|
1674 |
-
msgstr ""
|
1675 |
-
|
1676 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
1677 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
1678 |
-
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:
|
1679 |
-
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:
|
1680 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1681 |
-
#: modules/optin/classes/class-cartflows-optin-meta.php:
|
1682 |
-
msgid "
|
1683 |
-
msgstr ""
|
1684 |
-
|
1685 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
#: modules/
|
1690 |
-
#: modules/
|
1691 |
-
msgid "
|
1692 |
-
msgstr ""
|
1693 |
-
|
1694 |
-
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
#: modules/
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
#: modules/
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
#: modules/
|
1740 |
-
msgid "
|
1741 |
-
msgstr ""
|
1742 |
-
|
1743 |
-
#: modules/beaver-builder/cartflows-bb-
|
1744 |
-
msgid "
|
1745 |
-
msgstr ""
|
1746 |
-
|
1747 |
-
#: modules/beaver-builder/cartflows-bb-
|
1748 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
1749 |
-
msgid "
|
1750 |
-
msgstr ""
|
1751 |
-
|
1752 |
-
#: modules/beaver-builder/cartflows-bb-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
#: modules/
|
1763 |
-
#: modules/
|
1764 |
-
#:
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:
|
1778 |
-
#: modules/
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
|
1784 |
-
|
1785 |
-
#: modules/
|
1786 |
-
#: modules/
|
1787 |
-
|
1788 |
-
|
1789 |
-
|
1790 |
-
|
1791 |
-
#: modules/
|
1792 |
-
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
#: modules/
|
1801 |
-
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:
|
1802 |
-
|
1803 |
-
|
1804 |
-
|
1805 |
-
|
1806 |
-
#: modules/
|
1807 |
-
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
-
#: modules/
|
1812 |
-
|
1813 |
-
|
1814 |
-
|
1815 |
-
|
1816 |
-
#: modules/
|
1817 |
-
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
#: modules/
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
-
|
1826 |
-
#: modules/
|
1827 |
-
|
1828 |
-
|
1829 |
-
|
1830 |
-
|
1831 |
-
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:
|
1832 |
-
#: modules/
|
1833 |
-
|
1834 |
-
|
1835 |
-
|
1836 |
-
|
1837 |
-
#: modules/
|
1838 |
-
|
1839 |
-
|
1840 |
-
|
1841 |
-
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
|
1848 |
-
|
1849 |
-
#: modules/
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
#: modules/
|
1855 |
-
#: modules/
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
|
1860 |
-
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
1866 |
-
|
1867 |
-
|
1868 |
-
|
1869 |
-
|
1870 |
-
|
1871 |
-
|
1872 |
-
#: modules/
|
1873 |
-
|
1874 |
-
|
1875 |
-
"
|
1876 |
-
|
1877 |
-
|
1878 |
-
|
1879 |
-
#: modules/
|
1880 |
-
#: modules/
|
1881 |
-
|
1882 |
-
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
1886 |
-
|
1887 |
-
|
1888 |
-
|
1889 |
-
|
1890 |
-
|
1891 |
-
|
1892 |
-
|
1893 |
-
|
1894 |
-
|
1895 |
-
|
1896 |
-
|
1897 |
-
#: modules/checkout/
|
1898 |
-
|
1899 |
-
|
1900 |
-
|
1901 |
-
|
1902 |
-
#: modules/checkout/classes/class-cartflows-checkout-markup.php:
|
1903 |
-
|
1904 |
-
|
1905 |
-
|
1906 |
-
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
|
1912 |
-
|
1913 |
-
|
1914 |
-
|
1915 |
-
|
1916 |
-
|
1917 |
-
|
1918 |
-
|
1919 |
-
|
1920 |
-
|
1921 |
-
|
1922 |
-
|
1923 |
-
#: modules/checkout/classes/class-cartflows-checkout-markup.php:
|
1924 |
-
msgid "
|
1925 |
-
msgstr ""
|
1926 |
-
|
1927 |
-
#: modules/checkout/classes/class-cartflows-checkout-
|
1928 |
-
|
1929 |
-
|
1930 |
-
|
1931 |
-
|
1932 |
-
|
1933 |
-
|
1934 |
-
|
1935 |
-
|
1936 |
-
|
1937 |
-
|
1938 |
-
|
1939 |
-
|
1940 |
-
|
1941 |
-
|
1942 |
-
|
1943 |
-
|
1944 |
-
|
1945 |
-
|
1946 |
-
|
1947 |
-
|
1948 |
-
|
1949 |
-
|
1950 |
-
|
1951 |
-
|
1952 |
-
|
1953 |
-
#: modules/
|
1954 |
-
msgid "
|
1955 |
-
msgstr ""
|
1956 |
-
|
1957 |
-
#: modules/checkout/classes/class-cartflows-checkout-meta.php:
|
1958 |
-
msgid "
|
1959 |
-
msgstr ""
|
1960 |
-
|
1961 |
-
#: modules/checkout/classes/class-cartflows-checkout-meta.php:
|
1962 |
-
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
1977 |
-
|
1978 |
-
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
|
1984 |
-
|
1985 |
-
|
1986 |
-
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
|
1997 |
-
|
1998 |
-
"
|
1999 |
-
"
|
2000 |
-
|
2001 |
-
|
2002 |
-
|
2003 |
-
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
2010 |
-
|
2011 |
-
|
2012 |
-
|
2013 |
-
|
2014 |
-
|
2015 |
-
|
2016 |
-
|
2017 |
-
|
2018 |
-
|
2019 |
-
|
2020 |
-
|
2021 |
-
|
2022 |
-
|
2023 |
-
|
2024 |
-
|
2025 |
-
|
2026 |
-
msgid "
|
2027 |
-
msgstr ""
|
2028 |
-
|
2029 |
-
#: modules/checkout/classes/class-cartflows-checkout-meta.php:
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
2035 |
-
|
2036 |
-
|
2037 |
-
|
2038 |
-
|
2039 |
-
|
2040 |
-
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
#: modules/
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
|
2061 |
-
#: modules/
|
2062 |
-
msgid "
|
2063 |
-
msgstr ""
|
2064 |
-
|
2065 |
-
#: modules/checkout/includes/meta-views/design-checkout-
|
2066 |
-
|
2067 |
-
|
2068 |
-
|
2069 |
-
#: modules/
|
2070 |
-
|
2071 |
-
|
2072 |
-
|
2073 |
-
#: modules/
|
2074 |
-
msgid "
|
2075 |
-
msgstr ""
|
2076 |
-
|
2077 |
-
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:
|
2078 |
-
msgid "
|
2079 |
-
msgstr ""
|
2080 |
-
|
2081 |
-
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:
|
2082 |
-
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:
|
2083 |
-
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:
|
2084 |
-
#: modules/
|
2085 |
-
#: modules/optin/classes/class-cartflows-optin-meta.php:
|
2086 |
-
#: modules/
|
2087 |
-
|
2088 |
-
|
2089 |
-
|
2090 |
-
|
2091 |
-
|
2092 |
-
|
2093 |
-
|
2094 |
-
|
2095 |
-
|
2096 |
-
|
2097 |
-
#: modules/
|
2098 |
-
#: modules/
|
2099 |
-
|
2100 |
-
|
2101 |
-
|
2102 |
-
#: modules/
|
2103 |
-
|
2104 |
-
|
2105 |
-
|
2106 |
-
|
2107 |
-
|
2108 |
-
|
2109 |
-
|
2110 |
-
|
2111 |
-
#: modules/
|
2112 |
-
#: modules/
|
2113 |
-
|
2114 |
-
|
2115 |
-
|
2116 |
-
|
2117 |
-
|
2118 |
-
#: modules/
|
2119 |
-
#: modules/
|
2120 |
-
|
2121 |
-
|
2122 |
-
|
2123 |
-
|
2124 |
-
|
2125 |
-
#: modules/
|
2126 |
-
#: modules/
|
2127 |
-
|
2128 |
-
|
2129 |
-
|
2130 |
-
|
2131 |
-
|
2132 |
-
#: modules/
|
2133 |
-
#: modules/
|
2134 |
-
|
2135 |
-
|
2136 |
-
|
2137 |
-
|
2138 |
-
|
2139 |
-
#: modules/
|
2140 |
-
#: modules/
|
2141 |
-
|
2142 |
-
|
2143 |
-
|
2144 |
-
|
2145 |
-
|
2146 |
-
#: modules/
|
2147 |
-
#: modules/
|
2148 |
-
|
2149 |
-
|
2150 |
-
|
2151 |
-
|
2152 |
-
|
2153 |
-
|
2154 |
-
|
2155 |
-
|
2156 |
-
#: modules/
|
2157 |
-
|
2158 |
-
|
2159 |
-
|
2160 |
-
|
2161 |
-
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:
|
2162 |
-
|
2163 |
-
|
2164 |
-
|
2165 |
-
|
2166 |
-
|
2167 |
-
|
2168 |
-
|
2169 |
-
|
2170 |
-
|
2171 |
-
|
2172 |
-
|
2173 |
-
#: modules/elementor/class-cartflows-el-
|
2174 |
-
msgid "
|
2175 |
-
msgstr ""
|
2176 |
-
|
2177 |
-
#: modules/
|
2178 |
-
msgid "
|
2179 |
-
msgstr ""
|
2180 |
-
|
2181 |
-
#: modules/
|
2182 |
-
|
2183 |
-
|
2184 |
-
|
2185 |
-
|
2186 |
-
"
|
2187 |
-
|
2188 |
-
|
2189 |
-
|
2190 |
-
#: modules/
|
2191 |
-
msgid "
|
2192 |
-
msgstr ""
|
2193 |
-
|
2194 |
-
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:
|
2195 |
-
msgid "
|
2196 |
-
msgstr ""
|
2197 |
-
|
2198 |
-
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:
|
2199 |
-
|
2200 |
-
|
2201 |
-
|
2202 |
-
|
2203 |
-
|
2204 |
-
|
2205 |
-
|
2206 |
-
|
2207 |
-
|
2208 |
-
|
2209 |
-
|
2210 |
-
|
2211 |
-
|
2212 |
-
|
2213 |
-
|
2214 |
-
|
2215 |
-
#:
|
2216 |
-
msgid "
|
2217 |
-
msgstr ""
|
2218 |
-
|
2219 |
-
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:
|
2220 |
-
|
2221 |
-
|
2222 |
-
|
2223 |
-
|
2224 |
-
|
2225 |
-
|
2226 |
-
|
2227 |
-
|
2228 |
-
|
2229 |
-
|
2230 |
-
|
2231 |
-
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:
|
2232 |
-
#:
|
2233 |
-
|
2234 |
-
|
2235 |
-
|
2236 |
-
|
2237 |
-
|
2238 |
-
#: modules/
|
2239 |
-
|
2240 |
-
|
2241 |
-
|
2242 |
-
|
2243 |
-
|
2244 |
-
|
2245 |
-
|
2246 |
-
|
2247 |
-
|
2248 |
-
|
2249 |
-
|
2250 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
2251 |
-
|
2252 |
-
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
2256 |
-
|
2257 |
-
|
2258 |
-
|
2259 |
-
|
2260 |
-
|
2261 |
-
|
2262 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
|
2267 |
-
|
2268 |
-
|
2269 |
-
|
2270 |
-
|
2271 |
-
|
2272 |
-
|
2273 |
-
|
2274 |
-
|
2275 |
-
|
2276 |
-
|
2277 |
-
|
2278 |
-
|
2279 |
-
|
2280 |
-
|
2281 |
-
|
2282 |
-
|
2283 |
-
|
2284 |
-
|
2285 |
-
|
2286 |
-
|
2287 |
-
|
2288 |
-
|
2289 |
-
|
2290 |
-
|
2291 |
-
|
2292 |
-
|
2293 |
-
|
2294 |
-
|
2295 |
-
|
2296 |
-
|
2297 |
-
|
2298 |
-
|
2299 |
-
|
2300 |
-
|
2301 |
-
|
2302 |
-
|
2303 |
-
|
2304 |
-
|
2305 |
-
|
2306 |
-
|
2307 |
-
|
2308 |
-
|
2309 |
-
|
2310 |
-
|
2311 |
-
|
2312 |
-
|
2313 |
-
|
2314 |
-
|
2315 |
-
|
2316 |
-
|
2317 |
-
|
2318 |
-
|
2319 |
-
|
2320 |
-
|
2321 |
-
|
2322 |
-
|
2323 |
-
|
2324 |
-
|
2325 |
-
|
2326 |
-
|
2327 |
-
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
2332 |
-
|
2333 |
-
|
2334 |
-
|
2335 |
-
|
2336 |
-
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
2340 |
-
|
2341 |
-
|
2342 |
-
|
2343 |
-
|
2344 |
-
|
2345 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
2346 |
-
#: modules/
|
2347 |
-
msgid "
|
2348 |
-
msgstr ""
|
2349 |
-
|
2350 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
2351 |
-
|
2352 |
-
|
2353 |
-
|
2354 |
-
|
2355 |
-
|
2356 |
-
|
2357 |
-
|
2358 |
-
#: modules/elementor/widgets/class-cartflows-el-
|
2359 |
-
#: modules/
|
2360 |
-
|
2361 |
-
|
2362 |
-
|
2363 |
-
|
2364 |
-
#: modules/
|
2365 |
-
|
2366 |
-
|
2367 |
-
|
2368 |
-
|
2369 |
-
|
2370 |
-
|
2371 |
-
|
2372 |
-
|
2373 |
-
|
2374 |
-
|
2375 |
-
|
2376 |
-
|
2377 |
-
|
2378 |
-
|
2379 |
-
|
2380 |
-
|
2381 |
-
|
2382 |
-
|
2383 |
-
|
2384 |
-
|
2385 |
-
|
2386 |
-
|
2387 |
-
|
2388 |
-
|
2389 |
-
|
2390 |
-
|
2391 |
-
|
2392 |
-
|
2393 |
-
|
2394 |
-
|
2395 |
-
|
2396 |
-
|
2397 |
-
|
2398 |
-
|
2399 |
-
msgid "
|
2400 |
-
msgstr ""
|
2401 |
-
|
2402 |
-
#: modules/flow/classes/class-cartflows-flow-meta.php:
|
2403 |
-
msgid "
|
2404 |
-
msgstr ""
|
2405 |
-
|
2406 |
-
#: modules/flow/classes/class-cartflows-flow-meta.php:
|
2407 |
-
|
2408 |
-
"
|
2409 |
-
|
2410 |
-
|
2411 |
-
|
2412 |
-
|
2413 |
-
|
2414 |
-
|
2415 |
-
|
2416 |
-
|
2417 |
-
|
2418 |
-
|
2419 |
-
|
2420 |
-
|
2421 |
-
|
2422 |
-
|
2423 |
-
|
2424 |
-
|
2425 |
-
|
2426 |
-
|
2427 |
-
|
2428 |
-
|
2429 |
-
|
2430 |
-
|
2431 |
-
#: modules/flow/classes/class-cartflows-
|
2432 |
-
msgid "
|
2433 |
-
msgstr ""
|
2434 |
-
|
2435 |
-
#: modules/flow/classes/class-cartflows-flow-meta.php:
|
2436 |
-
|
2437 |
-
|
2438 |
-
|
2439 |
-
|
2440 |
-
|
2441 |
-
|
2442 |
-
|
2443 |
-
|
2444 |
-
#: modules/flow/classes/class-cartflows-flow-meta.php:
|
2445 |
-
msgid "
|
2446 |
-
msgstr ""
|
2447 |
-
|
2448 |
-
#: modules/flow/classes/class-cartflows-flow-
|
2449 |
-
msgid "
|
2450 |
-
msgstr ""
|
2451 |
-
|
2452 |
-
#: modules/flow/classes/class-cartflows-flow-
|
2453 |
-
msgid "
|
2454 |
-
msgstr ""
|
2455 |
-
|
2456 |
-
#: modules/flow/classes/class-cartflows-flow-
|
2457 |
-
|
2458 |
-
|
2459 |
-
|
2460 |
-
|
2461 |
-
|
2462 |
-
|
2463 |
-
|
2464 |
-
|
2465 |
-
|
2466 |
-
|
2467 |
-
|
2468 |
-
|
2469 |
-
|
2470 |
-
|
2471 |
-
|
2472 |
-
|
2473 |
-
#: modules/flow/classes/class-cartflows-flow-post-type.php:
|
2474 |
-
|
2475 |
-
|
2476 |
-
|
2477 |
-
|
2478 |
-
|
2479 |
-
|
2480 |
-
|
2481 |
-
|
2482 |
-
|
2483 |
-
|
2484 |
-
|
2485 |
-
|
2486 |
-
|
2487 |
-
#: modules/flow/classes/class-cartflows-
|
2488 |
-
|
2489 |
-
|
2490 |
-
|
2491 |
-
|
2492 |
-
|
2493 |
-
|
2494 |
-
|
2495 |
-
|
2496 |
-
#: modules/flow/classes/class-cartflows-flow-post-type.php:
|
2497 |
-
msgid "
|
2498 |
-
msgstr ""
|
2499 |
-
|
2500 |
-
#: modules/flow/classes/class-cartflows-flow-post-type.php:
|
2501 |
-
|
2502 |
-
|
2503 |
-
|
2504 |
-
|
2505 |
-
msgid "
|
2506 |
-
msgstr ""
|
2507 |
-
|
2508 |
-
#: modules/flow/classes/class-cartflows-flow-post-type.php:
|
2509 |
-
#: modules/flow/classes/class-cartflows-
|
2510 |
-
|
2511 |
-
|
2512 |
-
|
2513 |
-
|
2514 |
-
#: modules/flow/classes/class-cartflows-flow-post-type.php:
|
2515 |
-
#: modules/flow/classes/class-cartflows-step-post-type.php:
|
2516 |
-
|
2517 |
-
|
2518 |
-
|
2519 |
-
|
2520 |
-
|
2521 |
-
#: modules/flow/classes/class-cartflows-
|
2522 |
-
|
2523 |
-
#.
|
2524 |
-
msgid "%
|
2525 |
-
msgstr ""
|
2526 |
-
|
2527 |
-
#: modules/flow/classes/class-cartflows-flow-post-type.php:
|
2528 |
-
#: modules/flow/classes/class-cartflows-step-post-type.php:
|
2529 |
-
#. translators: %s: singular custom post type name
|
2530 |
-
msgid "%s
|
2531 |
-
msgstr ""
|
2532 |
-
|
2533 |
-
#: modules/flow/classes/class-cartflows-flow-post-type.php:
|
2534 |
-
#: modules/flow/classes/class-cartflows-step-post-type.php:
|
2535 |
-
#. translators: %s: singular custom post type name
|
2536 |
-
|
2537 |
-
|
2538 |
-
|
2539 |
-
|
2540 |
-
#: modules/flow/classes/class-cartflows-
|
2541 |
-
|
2542 |
-
|
2543 |
-
|
2544 |
-
|
2545 |
-
|
2546 |
-
#: modules/flow/classes/class-cartflows-
|
2547 |
-
|
2548 |
-
|
2549 |
-
|
2550 |
-
|
2551 |
-
|
2552 |
-
#: modules/flow/classes/class-cartflows-
|
2553 |
-
|
2554 |
-
|
2555 |
-
|
2556 |
-
|
2557 |
-
|
2558 |
-
|
2559 |
-
|
2560 |
-
|
2561 |
-
|
2562 |
-
|
2563 |
-
|
2564 |
-
|
2565 |
-
#: modules/flow/classes/class-cartflows-step-post-type.php:
|
2566 |
-
|
2567 |
-
|
2568 |
-
|
2569 |
-
|
2570 |
-
|
2571 |
-
|
2572 |
-
|
2573 |
-
|
2574 |
-
|
2575 |
-
|
2576 |
-
|
2577 |
-
|
2578 |
-
|
2579 |
-
|
2580 |
-
|
2581 |
-
|
2582 |
-
#: modules/flow/
|
2583 |
-
msgid "
|
2584 |
-
msgstr ""
|
2585 |
-
|
2586 |
-
#: modules/flow/classes/class-cartflows-step-post-type.php:
|
2587 |
-
|
2588 |
-
|
2589 |
-
|
2590 |
-
|
2591 |
-
|
2592 |
-
|
2593 |
-
|
2594 |
-
|
2595 |
-
|
2596 |
-
|
2597 |
-
|
2598 |
-
|
2599 |
-
|
2600 |
-
#: modules/flow/view/
|
2601 |
-
|
2602 |
-
|
2603 |
-
|
2604 |
-
|
2605 |
-
#: modules/flow/view/
|
2606 |
-
msgid "
|
2607 |
-
msgstr ""
|
2608 |
-
|
2609 |
-
#: modules/flow/view/view-flow-inner-step.php:
|
2610 |
-
msgid "
|
2611 |
-
msgstr ""
|
2612 |
-
|
2613 |
-
#: modules/flow/view/view-
|
2614 |
-
|
2615 |
-
|
2616 |
-
|
2617 |
-
|
2618 |
-
|
2619 |
-
|
2620 |
-
|
2621 |
-
|
2622 |
-
|
2623 |
-
|
2624 |
-
|
2625 |
-
|
2626 |
-
|
2627 |
-
|
2628 |
-
|
2629 |
-
|
2630 |
-
|
2631 |
-
|
2632 |
-
|
2633 |
-
|
2634 |
-
|
2635 |
-
|
2636 |
-
|
2637 |
-
|
2638 |
-
|
2639 |
-
|
2640 |
-
|
2641 |
-
|
2642 |
-
|
2643 |
-
|
2644 |
-
|
2645 |
-
|
2646 |
-
|
2647 |
-
|
2648 |
-
|
2649 |
-
|
2650 |
-
|
2651 |
-
|
2652 |
-
|
2653 |
-
|
2654 |
-
|
2655 |
-
|
2656 |
-
|
2657 |
-
|
2658 |
-
|
2659 |
-
|
2660 |
-
|
2661 |
-
|
2662 |
-
|
2663 |
-
|
2664 |
-
|
2665 |
-
|
2666 |
-
|
2667 |
-
|
2668 |
-
|
2669 |
-
|
2670 |
-
|
2671 |
-
|
2672 |
-
|
2673 |
-
|
2674 |
-
|
2675 |
-
|
2676 |
-
|
2677 |
-
|
2678 |
-
|
2679 |
-
|
2680 |
-
|
2681 |
-
|
2682 |
-
|
2683 |
-
|
2684 |
-
|
2685 |
-
|
2686 |
-
|
2687 |
-
|
2688 |
-
|
2689 |
-
|
2690 |
-
|
2691 |
-
|
2692 |
-
"
|
2693 |
-
msgstr ""
|
2694 |
-
|
2695 |
-
#: modules/optin/classes/class-cartflows-optin-meta.php:
|
2696 |
-
msgid "
|
2697 |
-
msgstr ""
|
2698 |
-
|
2699 |
-
#: modules/optin/classes/class-cartflows-optin-meta.php:
|
2700 |
-
|
2701 |
-
|
2702 |
-
|
2703 |
-
|
2704 |
-
|
2705 |
-
|
2706 |
-
|
2707 |
-
|
2708 |
-
|
2709 |
-
|
2710 |
-
msgid ""
|
2711 |
-
|
2712 |
-
|
2713 |
-
|
2714 |
-
|
2715 |
-
|
2716 |
-
|
2717 |
-
|
2718 |
-
|
2719 |
-
|
2720 |
-
|
2721 |
-
|
2722 |
-
|
2723 |
-
|
2724 |
-
|
2725 |
-
|
2726 |
-
|
2727 |
-
|
2728 |
-
|
2729 |
-
|
2730 |
-
|
2731 |
-
|
2732 |
-
|
2733 |
-
|
2734 |
-
|
2735 |
-
|
2736 |
-
|
2737 |
-
|
2738 |
-
|
2739 |
-
|
2740 |
-
|
2741 |
-
|
2742 |
-
|
2743 |
-
|
2744 |
-
|
2745 |
-
|
2746 |
-
|
2747 |
-
|
2748 |
-
|
2749 |
-
|
2750 |
-
|
2751 |
-
|
2752 |
-
|
2753 |
-
|
2754 |
-
|
2755 |
-
|
2756 |
-
|
2757 |
-
|
2758 |
-
|
2759 |
-
|
2760 |
-
|
2761 |
-
|
2762 |
-
|
2763 |
-
|
2764 |
-
|
2765 |
-
|
2766 |
-
|
2767 |
-
|
2768 |
-
|
2769 |
-
|
2770 |
-
|
2771 |
-
|
2772 |
-
|
2773 |
-
|
2774 |
-
|
2775 |
-
|
2776 |
-
|
2777 |
-
|
2778 |
-
|
2779 |
-
|
2780 |
-
|
2781 |
-
|
2782 |
-
|
2783 |
-
|
2784 |
-
|
2785 |
-
|
2786 |
-
|
2787 |
-
|
2788 |
-
|
2789 |
-
|
2790 |
-
|
2791 |
-
|
2792 |
-
|
2793 |
-
|
2794 |
-
|
2795 |
-
|
2796 |
-
|
2797 |
-
|
2798 |
-
|
2799 |
-
|
2800 |
-
|
2801 |
-
|
2802 |
-
|
2803 |
-
|
2804 |
-
|
2805 |
-
|
2806 |
-
|
2807 |
-
|
2808 |
-
|
2809 |
-
|
2810 |
-
|
2811 |
-
|
2812 |
-
|
2813 |
-
|
2814 |
-
|
2815 |
-
|
2816 |
-
|
2817 |
-
|
2818 |
-
|
2819 |
-
|
2820 |
-
|
2821 |
-
|
2822 |
-
|
2823 |
-
|
2824 |
-
|
2825 |
-
|
2826 |
-
|
2827 |
-
|
2828 |
-
|
2829 |
-
|
2830 |
-
|
2831 |
-
|
2832 |
-
|
2833 |
-
|
2834 |
-
|
2835 |
-
|
2836 |
-
"
|
2837 |
-
msgstr ""
|
2838 |
-
|
2839 |
-
#: woocommerce/template/cart/cart-shipping.php:
|
2840 |
-
|
2841 |
-
|
2842 |
-
|
2843 |
-
|
2844 |
-
|
2845 |
-
|
2846 |
-
|
2847 |
-
|
2848 |
-
|
2849 |
-
|
2850 |
-
|
2851 |
-
|
2852 |
-
|
2853 |
-
|
2854 |
-
|
2855 |
-
|
2856 |
-
|
2857 |
-
|
2858 |
-
|
2859 |
-
|
2860 |
-
|
2861 |
-
|
2862 |
-
|
2863 |
-
|
2864 |
-
|
2865 |
-
|
2866 |
-
|
2867 |
-
|
2868 |
-
|
2869 |
-
|
2870 |
-
|
2871 |
-
|
2872 |
-
|
2873 |
-
|
2874 |
-
|
2875 |
-
|
2876 |
-
|
2877 |
-
|
2878 |
-
|
2879 |
-
|
2880 |
-
|
2881 |
-
|
2882 |
-
|
2883 |
-
|
2884 |
-
|
2885 |
-
|
2886 |
-
|
2887 |
-
|
2888 |
-
|
2889 |
-
|
2890 |
-
|
2891 |
-
|
2892 |
-
|
2893 |
-
|
2894 |
-
|
2895 |
-
"
|
2896 |
-
msgstr ""
|
2897 |
-
|
2898 |
-
#: woocommerce/template/checkout/form-
|
2899 |
-
msgid "
|
2900 |
-
msgstr ""
|
2901 |
-
|
2902 |
-
#: woocommerce/template/checkout/form-
|
2903 |
-
msgid "
|
2904 |
-
msgstr ""
|
2905 |
-
|
2906 |
-
#: woocommerce/template/checkout/
|
2907 |
-
msgid ""
|
2908 |
-
"
|
2909 |
-
"
|
2910 |
-
"
|
2911 |
-
|
2912 |
-
|
2913 |
-
|
2914 |
-
|
2915 |
-
|
2916 |
-
|
2917 |
-
|
2918 |
-
|
2919 |
-
|
2920 |
-
|
2921 |
-
|
2922 |
-
"
|
2923 |
-
"
|
2924 |
-
|
2925 |
-
|
2926 |
-
|
2927 |
-
|
2928 |
-
|
2929 |
-
|
2930 |
-
|
2931 |
-
#: woocommerce/template/
|
2932 |
-
|
2933 |
-
|
2934 |
-
|
2935 |
-
|
2936 |
-
|
2937 |
-
|
2938 |
-
|
2939 |
-
|
2940 |
-
|
2941 |
-
|
2942 |
-
|
2943 |
-
|
2944 |
-
|
2945 |
-
#: woocommerce/template/
|
2946 |
-
msgid ""
|
2947 |
-
|
2948 |
-
|
2949 |
-
|
2950 |
-
|
2951 |
-
|
2952 |
-
|
2953 |
-
|
2954 |
-
|
2955 |
-
|
2956 |
-
|
2957 |
-
|
2958 |
-
|
2959 |
-
|
2960 |
-
|
2961 |
-
|
2962 |
-
|
2963 |
-
|
2964 |
-
|
2965 |
-
|
2966 |
-
|
2967 |
-
|
2968 |
-
|
2969 |
-
|
2970 |
-
|
2971 |
-
|
2972 |
-
|
2973 |
-
|
2974 |
-
|
2975 |
-
|
2976 |
-
|
2977 |
-
|
2978 |
-
|
2979 |
-
|
2980 |
-
|
2981 |
-
|
2982 |
-
|
2983 |
-
|
2984 |
-
|
2985 |
-
|
2986 |
-
|
2987 |
-
|
2988 |
-
|
2989 |
-
|
2990 |
-
|
2991 |
-
|
2992 |
-
|
2993 |
-
|
2994 |
-
|
2995 |
-
|
2996 |
-
|
2997 |
-
|
2998 |
-
|
2999 |
-
|
3000 |
-
|
3001 |
-
|
3002 |
-
|
3003 |
-
|
3004 |
-
|
3005 |
-
|
3006 |
-
|
3007 |
-
|
3008 |
-
|
3009 |
-
|
3010 |
-
|
3011 |
-
|
3012 |
-
|
3013 |
-
|
3014 |
-
|
3015 |
-
|
3016 |
-
|
3017 |
-
|
3018 |
-
|
3019 |
-
|
3020 |
-
|
3021 |
-
|
3022 |
-
|
3023 |
-
|
3024 |
-
|
3025 |
-
|
3026 |
-
|
3027 |
-
|
3028 |
-
|
3029 |
-
|
3030 |
-
|
3031 |
-
msgid "
|
3032 |
-
msgstr ""
|
3033 |
-
|
3034 |
-
|
3035 |
-
|
3036 |
-
|
3037 |
-
|
3038 |
-
|
3039 |
-
|
3040 |
-
|
3041 |
-
|
3042 |
-
|
3043 |
-
|
3044 |
-
|
3045 |
-
|
3046 |
-
|
3047 |
-
|
3048 |
-
|
3049 |
-
|
3050 |
-
|
3051 |
-
|
3052 |
-
|
3053 |
-
|
3054 |
-
|
3055 |
-
|
3056 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3057 |
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.20\n"
|
6 |
+
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
|
7 |
+
"POT-Creation-Date: 2020-11-05 06:07:50+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:579
|
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:580
|
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:1265
|
329 |
+
msgid "Sales Landing"
|
330 |
+
msgstr ""
|
331 |
+
|
332 |
+
#: classes/class-cartflows-importer.php:1269
|
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:1273
|
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:1281
|
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:1285
|
351 |
+
msgid "Thank You"
|
352 |
+
msgstr ""
|
353 |
+
|
354 |
+
#: classes/class-cartflows-importer.php:1395
|
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:1470
|
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:1595
|
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:1698
|
371 |
+
msgid "Action failed. Invalid Security Nonce."
|
372 |
+
msgstr ""
|
373 |
+
|
374 |
+
#: classes/class-cartflows-importer.php:1705
|
375 |
+
msgid "User have not plugin install permissions."
|
376 |
+
msgstr ""
|
377 |
+
|
378 |
+
#: classes/class-cartflows-importer.php:1727
|
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:216
|
386 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:245
|
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:517
|
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:527
|
418 |
+
msgid "Activate WooCommerce"
|
419 |
+
msgstr ""
|
420 |
+
|
421 |
+
#: classes/class-cartflows-loader.php:535
|
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…"
|
473 |
+
msgstr ""
|
474 |
+
|
475 |
+
#: classes/class-cartflows-meta-fields.php:816
|
476 |
+
msgid "Search for a coupon…"
|
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'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:190
|
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."
|
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 |
+
#: modules/gutenberg/classes/class-cartflows-block-config.php:311
|
1076 |
+
msgid "Checkout Form"
|
1077 |
+
msgstr ""
|
1078 |
+
|
1079 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:30
|
1080 |
+
msgid "Checkout Form."
|
1081 |
+
msgstr ""
|
1082 |
+
|
1083 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:31
|
1084 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:32
|
1085 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:30
|
1086 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:31
|
1087 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:31
|
1088 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:32
|
1089 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:30
|
1090 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:31
|
1091 |
+
msgid "Cartflows Modules"
|
1092 |
+
msgstr ""
|
1093 |
+
|
1094 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:75
|
1095 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:1058
|
1096 |
+
#: modules/gutenberg/classes/class-cartflows-init-blocks.php:117
|
1097 |
+
msgid ""
|
1098 |
+
"No product is selected. Please select products from the checkout meta "
|
1099 |
+
"settings to continue."
|
1100 |
+
msgstr ""
|
1101 |
+
|
1102 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:109
|
1103 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:152
|
1104 |
+
msgid "One Column ( PRO )"
|
1105 |
+
msgstr ""
|
1106 |
+
|
1107 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:110
|
1108 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:116
|
1109 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:30
|
1110 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:153
|
1111 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:159
|
1112 |
+
msgid "Two Column"
|
1113 |
+
msgstr ""
|
1114 |
+
|
1115 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:111
|
1116 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:154
|
1117 |
+
msgid "Two Step ( PRO )"
|
1118 |
+
msgstr ""
|
1119 |
+
|
1120 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:115
|
1121 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:29
|
1122 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:158
|
1123 |
+
msgid "One Column"
|
1124 |
+
msgstr ""
|
1125 |
+
|
1126 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:117
|
1127 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:31
|
1128 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:160
|
1129 |
+
msgid "Two Step"
|
1130 |
+
msgstr ""
|
1131 |
+
|
1132 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:137
|
1133 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:82
|
1134 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:180
|
1135 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:147
|
1136 |
+
msgid "Floating Labels ( PRO )"
|
1137 |
+
msgstr ""
|
1138 |
+
|
1139 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:142
|
1140 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:87
|
1141 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:120
|
1142 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:185
|
1143 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:152
|
1144 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:448
|
1145 |
+
msgid "Floating Labels"
|
1146 |
+
msgstr ""
|
1147 |
+
|
1148 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:157
|
1149 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:128
|
1150 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:90
|
1151 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:157
|
1152 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:291
|
1153 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:169
|
1154 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:156
|
1155 |
+
msgid "General"
|
1156 |
+
msgstr ""
|
1157 |
+
|
1158 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:164
|
1159 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:210
|
1160 |
+
msgid "Select Layout"
|
1161 |
+
msgstr ""
|
1162 |
+
|
1163 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:166
|
1164 |
+
#. translators: %s: link
|
1165 |
+
msgid ""
|
1166 |
+
"The PRO layout options are available in the CartFlows Pro. %1$s Upgrade "
|
1167 |
+
"Now! %2$s"
|
1168 |
+
msgstr ""
|
1169 |
+
|
1170 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:178
|
1171 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:251
|
1172 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:179
|
1173 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:182
|
1174 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:102
|
1175 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:131
|
1176 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:146
|
1177 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:115
|
1178 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:451
|
1179 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:216
|
1180 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:443
|
1181 |
+
msgid "Style"
|
1182 |
+
msgstr ""
|
1183 |
+
|
1184 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:181
|
1185 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:105
|
1186 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:294
|
1187 |
+
msgid "Global"
|
1188 |
+
msgstr ""
|
1189 |
+
|
1190 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:185
|
1191 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:109
|
1192 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:40
|
1193 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:302
|
1194 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:177
|
1195 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:410
|
1196 |
+
msgid "Primary Color"
|
1197 |
+
msgstr ""
|
1198 |
+
|
1199 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:193
|
1200 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:221
|
1201 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:416
|
1202 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:649
|
1203 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:393
|
1204 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:268
|
1205 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:193
|
1206 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:221
|
1207 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:249
|
1208 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:319
|
1209 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:385
|
1210 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:451
|
1211 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:271
|
1212 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:364
|
1213 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:659
|
1214 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:754
|
1215 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:825
|
1216 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:358
|
1217 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:375
|
1218 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:435
|
1219 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:323
|
1220 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:372
|
1221 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:402
|
1222 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:468
|
1223 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:527
|
1224 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:558
|
1225 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:619
|
1226 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:649
|
1227 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:708
|
1228 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:738
|
1229 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:632
|
1230 |
+
msgid "Text Color"
|
1231 |
+
msgstr ""
|
1232 |
+
|
1233 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:207
|
1234 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:236
|
1235 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:316
|
1236 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:504
|
1237 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:454
|
1238 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:469
|
1239 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:117
|
1240 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:179
|
1241 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:324
|
1242 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:207
|
1243 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:235
|
1244 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:281
|
1245 |
+
msgid "Typography"
|
1246 |
+
msgstr ""
|
1247 |
+
|
1248 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:217
|
1249 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:189
|
1250 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:69
|
1251 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:396
|
1252 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:290
|
1253 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:509
|
1254 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:602
|
1255 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:691
|
1256 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:327
|
1257 |
+
msgid "Heading"
|
1258 |
+
msgstr ""
|
1259 |
+
|
1260 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:247
|
1261 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:127
|
1262 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:101
|
1263 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:443
|
1264 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:208
|
1265 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:430
|
1266 |
+
msgid "Input Fields"
|
1267 |
+
msgstr ""
|
1268 |
+
|
1269 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:253
|
1270 |
+
#. translators: %s: link
|
1271 |
+
msgid ""
|
1272 |
+
"The PRO style options are available in CartFlows Pro. %1$s Upgrade Now! "
|
1273 |
+
"%2$s"
|
1274 |
+
msgstr ""
|
1275 |
+
|
1276 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:262
|
1277 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:137
|
1278 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:202
|
1279 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:495
|
1280 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:941
|
1281 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:251
|
1282 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:507
|
1283 |
+
msgid "Label Color"
|
1284 |
+
msgstr ""
|
1285 |
+
|
1286 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:276
|
1287 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:151
|
1288 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:507
|
1289 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:262
|
1290 |
+
msgid "Field Background Color"
|
1291 |
+
msgstr ""
|
1292 |
+
|
1293 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:295
|
1294 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:165
|
1295 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:523
|
1296 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:273
|
1297 |
+
msgid "Input Text / Placeholder Color"
|
1298 |
+
msgstr ""
|
1299 |
+
|
1300 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:325
|
1301 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:517
|
1302 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:188
|
1303 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:334
|
1304 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:541
|
1305 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:284
|
1306 |
+
msgid "Border Style"
|
1307 |
+
msgstr ""
|
1308 |
+
|
1309 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:327
|
1310 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:519
|
1311 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:190
|
1312 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:336
|
1313 |
+
msgid ""
|
1314 |
+
"The type of border to use. Double borders must have a width of at least 3px "
|
1315 |
+
"to render properly."
|
1316 |
+
msgstr ""
|
1317 |
+
|
1318 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:330
|
1319 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:522
|
1320 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:193
|
1321 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:339
|
1322 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:547
|
1323 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:290
|
1324 |
+
msgid "Solid"
|
1325 |
+
msgstr ""
|
1326 |
+
|
1327 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:331
|
1328 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:523
|
1329 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:194
|
1330 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:340
|
1331 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:550
|
1332 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:293
|
1333 |
+
msgid "Dashed"
|
1334 |
+
msgstr ""
|
1335 |
+
|
1336 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:332
|
1337 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:524
|
1338 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:195
|
1339 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:341
|
1340 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:549
|
1341 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:292
|
1342 |
+
msgid "Dotted"
|
1343 |
+
msgstr ""
|
1344 |
+
|
1345 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:333
|
1346 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:525
|
1347 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:196
|
1348 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:342
|
1349 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:548
|
1350 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:291
|
1351 |
+
msgid "Double"
|
1352 |
+
msgstr ""
|
1353 |
+
|
1354 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:352
|
1355 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:557
|
1356 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:220
|
1357 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:367
|
1358 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:565
|
1359 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:303
|
1360 |
+
msgid "Border Width"
|
1361 |
+
msgstr ""
|
1362 |
+
|
1363 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:373
|
1364 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:580
|
1365 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:815
|
1366 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:235
|
1367 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:383
|
1368 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:195
|
1369 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:303
|
1370 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:582
|
1371 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:1008
|
1372 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:315
|
1373 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:531
|
1374 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:664
|
1375 |
+
msgid "Border Color"
|
1376 |
+
msgstr ""
|
1377 |
+
|
1378 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:391
|
1379 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:621
|
1380 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:727
|
1381 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:248
|
1382 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:411
|
1383 |
+
msgid "Border Radius"
|
1384 |
+
msgstr ""
|
1385 |
+
|
1386 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:412
|
1387 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:264
|
1388 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:215
|
1389 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:626
|
1390 |
+
msgid "Buttons"
|
1391 |
+
msgstr ""
|
1392 |
+
|
1393 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:440
|
1394 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:407
|
1395 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:282
|
1396 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:279
|
1397 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:640
|
1398 |
+
msgid "Text Hover Color"
|
1399 |
+
msgstr ""
|
1400 |
+
|
1401 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:460
|
1402 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:799
|
1403 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:421
|
1404 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:296
|
1405 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:264
|
1406 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:333
|
1407 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:399
|
1408 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:465
|
1409 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:187
|
1410 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:287
|
1411 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:679
|
1412 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:789
|
1413 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:995
|
1414 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:371
|
1415 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:388
|
1416 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:458
|
1417 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:426
|
1418 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:481
|
1419 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:571
|
1420 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:662
|
1421 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:751
|
1422 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:523
|
1423 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:648
|
1424 |
+
msgid "Background Color"
|
1425 |
+
msgstr ""
|
1426 |
+
|
1427 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:484
|
1428 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:429
|
1429 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:310
|
1430 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:295
|
1431 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:656
|
1432 |
+
msgid "Background Hover Color"
|
1433 |
+
msgstr ""
|
1434 |
+
|
1435 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:601
|
1436 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:327
|
1437 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:397
|
1438 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:311
|
1439 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:771
|
1440 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:448
|
1441 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:446
|
1442 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:672
|
1443 |
+
msgid "Border Hover Color"
|
1444 |
+
msgstr ""
|
1445 |
+
|
1446 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:645
|
1447 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:818
|
1448 |
+
msgid "Payment Section"
|
1449 |
+
msgstr ""
|
1450 |
+
|
1451 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:663
|
1452 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:839
|
1453 |
+
msgid "Description Color"
|
1454 |
+
msgstr ""
|
1455 |
+
|
1456 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:677
|
1457 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:863
|
1458 |
+
msgid "Information Background Color"
|
1459 |
+
msgstr ""
|
1460 |
+
|
1461 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:685
|
1462 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:851
|
1463 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:377
|
1464 |
+
msgid "Section Background Color"
|
1465 |
+
msgstr ""
|
1466 |
+
|
1467 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:699
|
1468 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:877
|
1469 |
+
msgid "Section Padding"
|
1470 |
+
msgstr ""
|
1471 |
+
|
1472 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:713
|
1473 |
+
msgid "Margin"
|
1474 |
+
msgstr ""
|
1475 |
+
|
1476 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:743
|
1477 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:924
|
1478 |
+
msgid "Field Validation & Error Messages"
|
1479 |
+
msgstr ""
|
1480 |
+
|
1481 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:747
|
1482 |
+
msgid "Field Label Color"
|
1483 |
+
msgstr ""
|
1484 |
+
|
1485 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:763
|
1486 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:953
|
1487 |
+
msgid "Field Border Color"
|
1488 |
+
msgstr ""
|
1489 |
+
|
1490 |
+
#: modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php:783
|
1491 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:981
|
1492 |
+
msgid "Error Message Color"
|
1493 |
+
msgstr ""
|
1494 |
+
|
1495 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:28
|
1496 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:70
|
1497 |
+
#: modules/gutenberg/classes/class-cartflows-block-config.php:46
|
1498 |
+
msgid "Next Step Button"
|
1499 |
+
msgstr ""
|
1500 |
+
|
1501 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:29
|
1502 |
+
msgid "A simple next step button."
|
1503 |
+
msgstr ""
|
1504 |
+
|
1505 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:135
|
1506 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:296
|
1507 |
+
msgid "Text"
|
1508 |
+
msgstr ""
|
1509 |
+
|
1510 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:136
|
1511 |
+
#: modules/flow/classes/class-cartflows-flow-shortcodes.php:148
|
1512 |
+
#: modules/widgets/class-cartflows-next-step.php:78
|
1513 |
+
msgid "Next Step"
|
1514 |
+
msgstr ""
|
1515 |
+
|
1516 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:145
|
1517 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:187
|
1518 |
+
msgid "Icon"
|
1519 |
+
msgstr ""
|
1520 |
+
|
1521 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:156
|
1522 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:195
|
1523 |
+
msgid "Icon Position"
|
1524 |
+
msgstr ""
|
1525 |
+
|
1526 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:159
|
1527 |
+
msgid "Before Text"
|
1528 |
+
msgstr ""
|
1529 |
+
|
1530 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:160
|
1531 |
+
msgid "After Text"
|
1532 |
+
msgstr ""
|
1533 |
+
|
1534 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:168
|
1535 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:240
|
1536 |
+
msgid "Icon Spacing"
|
1537 |
+
msgstr ""
|
1538 |
+
|
1539 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:186
|
1540 |
+
msgid "Type"
|
1541 |
+
msgstr ""
|
1542 |
+
|
1543 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:191
|
1544 |
+
msgid "Flat"
|
1545 |
+
msgstr ""
|
1546 |
+
|
1547 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:192
|
1548 |
+
msgid "Gradient"
|
1549 |
+
msgstr ""
|
1550 |
+
|
1551 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:193
|
1552 |
+
msgid "Transparent"
|
1553 |
+
msgstr ""
|
1554 |
+
|
1555 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:194
|
1556 |
+
msgid "3D"
|
1557 |
+
msgstr ""
|
1558 |
+
|
1559 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:204
|
1560 |
+
msgid "Border Size"
|
1561 |
+
msgstr ""
|
1562 |
+
|
1563 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:213
|
1564 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:229
|
1565 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:242
|
1566 |
+
msgid "Hover Styles"
|
1567 |
+
msgstr ""
|
1568 |
+
|
1569 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:217
|
1570 |
+
msgid "Fade Background"
|
1571 |
+
msgstr ""
|
1572 |
+
|
1573 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:218
|
1574 |
+
msgid "Fill Background From Top"
|
1575 |
+
msgstr ""
|
1576 |
+
|
1577 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:219
|
1578 |
+
msgid "Fill Background From Bottom"
|
1579 |
+
msgstr ""
|
1580 |
+
|
1581 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:220
|
1582 |
+
msgid "Fill Background From Left"
|
1583 |
+
msgstr ""
|
1584 |
+
|
1585 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:221
|
1586 |
+
msgid "Fill Background From Right"
|
1587 |
+
msgstr ""
|
1588 |
+
|
1589 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:222
|
1590 |
+
msgid "Fill Background Vertical"
|
1591 |
+
msgstr ""
|
1592 |
+
|
1593 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:223
|
1594 |
+
msgid "Fill Background Diagonal"
|
1595 |
+
msgstr ""
|
1596 |
+
|
1597 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:224
|
1598 |
+
msgid "Fill Background Horizontal"
|
1599 |
+
msgstr ""
|
1600 |
+
|
1601 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:232
|
1602 |
+
msgid "Move Down"
|
1603 |
+
msgstr ""
|
1604 |
+
|
1605 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:233
|
1606 |
+
msgid "Move Up"
|
1607 |
+
msgstr ""
|
1608 |
+
|
1609 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:234
|
1610 |
+
msgid "Move Left"
|
1611 |
+
msgstr ""
|
1612 |
+
|
1613 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:235
|
1614 |
+
msgid "Move Right"
|
1615 |
+
msgstr ""
|
1616 |
+
|
1617 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:236
|
1618 |
+
msgid "Animate Top"
|
1619 |
+
msgstr ""
|
1620 |
+
|
1621 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:237
|
1622 |
+
msgid "Animate Bottom"
|
1623 |
+
msgstr ""
|
1624 |
+
|
1625 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:246
|
1626 |
+
msgid "Appear Icon From Right"
|
1627 |
+
msgstr ""
|
1628 |
+
|
1629 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:247
|
1630 |
+
msgid "Appear Icon From Left"
|
1631 |
+
msgstr ""
|
1632 |
+
|
1633 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:248
|
1634 |
+
msgid "Appear Icon From Top"
|
1635 |
+
msgstr ""
|
1636 |
+
|
1637 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:249
|
1638 |
+
msgid "Appear Icon From Bottom"
|
1639 |
+
msgstr ""
|
1640 |
+
|
1641 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:255
|
1642 |
+
msgid "Structure"
|
1643 |
+
msgstr ""
|
1644 |
+
|
1645 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:259
|
1646 |
+
msgid "Width"
|
1647 |
+
msgstr ""
|
1648 |
+
|
1649 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:263
|
1650 |
+
msgid "Full Width"
|
1651 |
+
msgstr ""
|
1652 |
+
|
1653 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:264
|
1654 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:156
|
1655 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:248
|
1656 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:484
|
1657 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:596
|
1658 |
+
msgid "Custom"
|
1659 |
+
msgstr ""
|
1660 |
+
|
1661 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:280
|
1662 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:299
|
1663 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:298
|
1664 |
+
msgid "Alignment"
|
1665 |
+
msgstr ""
|
1666 |
+
|
1667 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:283
|
1668 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:293
|
1669 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:307
|
1670 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:499
|
1671 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:306
|
1672 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:624
|
1673 |
+
msgid "Center"
|
1674 |
+
msgstr ""
|
1675 |
+
|
1676 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:284
|
1677 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:294
|
1678 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:303
|
1679 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:495
|
1680 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:302
|
1681 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:623
|
1682 |
+
msgid "Left"
|
1683 |
+
msgstr ""
|
1684 |
+
|
1685 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:285
|
1686 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:295
|
1687 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:311
|
1688 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:503
|
1689 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:310
|
1690 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:625
|
1691 |
+
msgid "Right"
|
1692 |
+
msgstr ""
|
1693 |
+
|
1694 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:290
|
1695 |
+
msgid "Mobile Alignment"
|
1696 |
+
msgstr ""
|
1697 |
+
|
1698 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:300
|
1699 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:337
|
1700 |
+
msgid "Padding"
|
1701 |
+
msgstr ""
|
1702 |
+
|
1703 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:314
|
1704 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:443
|
1705 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:696
|
1706 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:389
|
1707 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:398
|
1708 |
+
msgid "Border"
|
1709 |
+
msgstr ""
|
1710 |
+
|
1711 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:338
|
1712 |
+
msgid "Custom Width"
|
1713 |
+
msgstr ""
|
1714 |
+
|
1715 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:347
|
1716 |
+
msgid "Custom Height"
|
1717 |
+
msgstr ""
|
1718 |
+
|
1719 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:356
|
1720 |
+
msgid "Padding Top/Bottom"
|
1721 |
+
msgstr ""
|
1722 |
+
|
1723 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:365
|
1724 |
+
msgid "Padding Left/Right"
|
1725 |
+
msgstr ""
|
1726 |
+
|
1727 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:374
|
1728 |
+
msgid "Round Corners"
|
1729 |
+
msgstr ""
|
1730 |
+
|
1731 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:389
|
1732 |
+
msgid "Colors"
|
1733 |
+
msgstr ""
|
1734 |
+
|
1735 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:440
|
1736 |
+
msgid "Apply Hover Color To"
|
1737 |
+
msgstr ""
|
1738 |
+
|
1739 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:444
|
1740 |
+
msgid "Background"
|
1741 |
+
msgstr ""
|
1742 |
+
|
1743 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:457
|
1744 |
+
msgid "Button Settings"
|
1745 |
+
msgstr ""
|
1746 |
+
|
1747 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:461
|
1748 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:260
|
1749 |
+
msgid "Icon Size"
|
1750 |
+
msgstr ""
|
1751 |
+
|
1752 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:29
|
1753 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:66
|
1754 |
+
#: modules/gutenberg/classes/class-cartflows-block-config.php:442
|
1755 |
+
msgid "Optin Form"
|
1756 |
+
msgstr ""
|
1757 |
+
|
1758 |
+
#: modules/beaver-builder/cartflows-bb-optin-form/cartflows-bb-optin-form.php:30
|
1759 |
+
msgid "Optin Form."
|
1760 |
+
msgstr ""
|
1761 |
+
|
1762 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:28
|
1763 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:69
|
1764 |
+
#: modules/gutenberg/classes/class-cartflows-block-config.php:125
|
1765 |
+
msgid "Order Details Form"
|
1766 |
+
msgstr ""
|
1767 |
+
|
1768 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:29
|
1769 |
+
msgid "Order Details Form."
|
1770 |
+
msgstr ""
|
1771 |
+
|
1772 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:97
|
1773 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:163
|
1774 |
+
msgid "Thank You Text"
|
1775 |
+
msgstr ""
|
1776 |
+
|
1777 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:98
|
1778 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:165
|
1779 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:176
|
1780 |
+
#: woocommerce/template/checkout/thankyou.php:41
|
1781 |
+
#: woocommerce/template/checkout/thankyou.php:86
|
1782 |
+
msgid "Thank you. Your order has been received."
|
1783 |
+
msgstr ""
|
1784 |
+
|
1785 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:107
|
1786 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:173
|
1787 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:448
|
1788 |
+
msgid "Order Overview"
|
1789 |
+
msgstr ""
|
1790 |
+
|
1791 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:111
|
1792 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:120
|
1793 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:129
|
1794 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:138
|
1795 |
+
msgid "No"
|
1796 |
+
msgstr ""
|
1797 |
+
|
1798 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:116
|
1799 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:357
|
1800 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:185
|
1801 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:591
|
1802 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:284
|
1803 |
+
msgid "Order Details"
|
1804 |
+
msgstr ""
|
1805 |
+
|
1806 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:125
|
1807 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:197
|
1808 |
+
msgid "Billing Address"
|
1809 |
+
msgstr ""
|
1810 |
+
|
1811 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:134
|
1812 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:209
|
1813 |
+
msgid "Shipping Address"
|
1814 |
+
msgstr ""
|
1815 |
+
|
1816 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:149
|
1817 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:233
|
1818 |
+
msgid "Spacing"
|
1819 |
+
msgstr ""
|
1820 |
+
|
1821 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:153
|
1822 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:241
|
1823 |
+
msgid "Heading Bottom Spacing"
|
1824 |
+
msgstr ""
|
1825 |
+
|
1826 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:168
|
1827 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:257
|
1828 |
+
msgid "Spacing Between Sections"
|
1829 |
+
msgstr ""
|
1830 |
+
|
1831 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:217
|
1832 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:364
|
1833 |
+
msgid "Sections Heading"
|
1834 |
+
msgstr ""
|
1835 |
+
|
1836 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:245
|
1837 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:393
|
1838 |
+
msgid "Sections Content"
|
1839 |
+
msgstr ""
|
1840 |
+
|
1841 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:292
|
1842 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:501
|
1843 |
+
msgid "Downloads"
|
1844 |
+
msgstr ""
|
1845 |
+
|
1846 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:296
|
1847 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:361
|
1848 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:427
|
1849 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:75
|
1850 |
+
msgid "Heading Color"
|
1851 |
+
msgstr ""
|
1852 |
+
|
1853 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:310
|
1854 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:376
|
1855 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:442
|
1856 |
+
msgid "Heading Typography"
|
1857 |
+
msgstr ""
|
1858 |
+
|
1859 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:347
|
1860 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:413
|
1861 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:479
|
1862 |
+
msgid "Text Typography"
|
1863 |
+
msgstr ""
|
1864 |
+
|
1865 |
+
#: modules/beaver-builder/cartflows-bb-order-details/cartflows-bb-order-details.php:423
|
1866 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:683
|
1867 |
+
msgid "Customer Details"
|
1868 |
+
msgstr ""
|
1869 |
+
|
1870 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:374
|
1871 |
+
#: modules/optin/classes/class-cartflows-optin-markup.php:214
|
1872 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-markup.php:97
|
1873 |
+
msgid ""
|
1874 |
+
"WooCommerce functions do not exist. If you are in an IFrame, please reload "
|
1875 |
+
"it."
|
1876 |
+
msgstr ""
|
1877 |
+
|
1878 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:375
|
1879 |
+
#: modules/optin/classes/class-cartflows-optin-markup.php:215
|
1880 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-markup.php:98
|
1881 |
+
msgid "Click Here to Reload"
|
1882 |
+
msgstr ""
|
1883 |
+
|
1884 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:404
|
1885 |
+
msgid "Checkout ID not found"
|
1886 |
+
msgstr ""
|
1887 |
+
|
1888 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:407
|
1889 |
+
#. translators: %1$1s, %2$2s Link to article
|
1890 |
+
msgid ""
|
1891 |
+
"It seems that this is not the CartFlows Checkout page where you have added "
|
1892 |
+
"this shortcode. Please refer to this %1$1sarticle%2$2s to know more."
|
1893 |
+
msgstr ""
|
1894 |
+
|
1895 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:475
|
1896 |
+
#: modules/checkout/templates/embed/checkout-template-simple.php:24
|
1897 |
+
#: modules/checkout/templates/wcf-template.php:36
|
1898 |
+
#: modules/optin/templates/optin-template-simple.php:25
|
1899 |
+
msgid "Your cart is currently empty."
|
1900 |
+
msgstr ""
|
1901 |
+
|
1902 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:554
|
1903 |
+
#. translators: %1$1s, %2$2s Link to meta
|
1904 |
+
msgid ""
|
1905 |
+
"No product is selected. Please select products from the %1$1scheckout meta "
|
1906 |
+
"settings%2$2s to continue."
|
1907 |
+
msgstr ""
|
1908 |
+
|
1909 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:649
|
1910 |
+
msgid "Variations Not set"
|
1911 |
+
msgstr ""
|
1912 |
+
|
1913 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:660
|
1914 |
+
msgid "This product can't be purchased"
|
1915 |
+
msgstr ""
|
1916 |
+
|
1917 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:1110
|
1918 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:1153
|
1919 |
+
msgid "Coupon Code"
|
1920 |
+
msgstr ""
|
1921 |
+
|
1922 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:1111
|
1923 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:1162
|
1924 |
+
msgid "Apply"
|
1925 |
+
msgstr ""
|
1926 |
+
|
1927 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:1299
|
1928 |
+
msgid "Sorry there was a problem removing this coupon."
|
1929 |
+
msgstr ""
|
1930 |
+
|
1931 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:1302
|
1932 |
+
msgid "Coupon has been removed."
|
1933 |
+
msgstr ""
|
1934 |
+
|
1935 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:1321
|
1936 |
+
msgid "Sorry there was a problem removing "
|
1937 |
+
msgstr ""
|
1938 |
+
|
1939 |
+
#: modules/checkout/classes/class-cartflows-checkout-markup.php:1324
|
1940 |
+
msgid " has been removed."
|
1941 |
+
msgstr ""
|
1942 |
+
|
1943 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:94
|
1944 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:169
|
1945 |
+
msgid "Checkout Settings"
|
1946 |
+
msgstr ""
|
1947 |
+
|
1948 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:103
|
1949 |
+
msgid "Checkout Layout & Design"
|
1950 |
+
msgstr ""
|
1951 |
+
|
1952 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:139
|
1953 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:139
|
1954 |
+
msgid "Select Product"
|
1955 |
+
msgstr ""
|
1956 |
+
|
1957 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:145
|
1958 |
+
msgid "Product Options"
|
1959 |
+
msgstr ""
|
1960 |
+
|
1961 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:151
|
1962 |
+
msgid "Order Bump"
|
1963 |
+
msgstr ""
|
1964 |
+
|
1965 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:157
|
1966 |
+
msgid "Checkout Offer"
|
1967 |
+
msgstr ""
|
1968 |
+
|
1969 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:163
|
1970 |
+
msgid "Checkout Fields"
|
1971 |
+
msgstr ""
|
1972 |
+
|
1973 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:186
|
1974 |
+
msgid "Logo (Optional)"
|
1975 |
+
msgstr ""
|
1976 |
+
|
1977 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:271
|
1978 |
+
#. translators: %s: link
|
1979 |
+
msgid "Upgrade to %1$sCartFlows Pro%2$s for Product Options feature."
|
1980 |
+
msgstr ""
|
1981 |
+
|
1982 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:282
|
1983 |
+
#. translators: %s: link.
|
1984 |
+
msgid "Update %1$sCartFlows Pro%2$s to %3$s or above for Product Options"
|
1985 |
+
msgstr ""
|
1986 |
+
|
1987 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:310
|
1988 |
+
msgid "Add this shortcode to your checkout page"
|
1989 |
+
msgstr ""
|
1990 |
+
|
1991 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:345
|
1992 |
+
#. translators: %s: link
|
1993 |
+
msgid "Upgrade to %1$sCartFlows Pro%2$s for Pre-applied Coupon."
|
1994 |
+
msgstr ""
|
1995 |
+
|
1996 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:372
|
1997 |
+
#. translators: %s: link
|
1998 |
+
msgid "Upgrade to %1$sCartFlows Pro%2$s for Checkout Offer feature"
|
1999 |
+
msgstr ""
|
2000 |
+
|
2001 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:382
|
2002 |
+
#. translators: %s: link
|
2003 |
+
msgid "Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature"
|
2004 |
+
msgstr ""
|
2005 |
+
|
2006 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:409
|
2007 |
+
#. translators: %s: link
|
2008 |
+
msgid "Upgrade to %1$sCartFlows Pro%2$s for animate browser tab feature"
|
2009 |
+
msgstr ""
|
2010 |
+
|
2011 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:419
|
2012 |
+
#. translators: %s: link
|
2013 |
+
msgid ""
|
2014 |
+
"Update to %1$sCartFlows Pro%2$s to %3$s or above for animate browser tab "
|
2015 |
+
"feature"
|
2016 |
+
msgstr ""
|
2017 |
+
|
2018 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:442
|
2019 |
+
#. translators: %s: link
|
2020 |
+
msgid "Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature."
|
2021 |
+
msgstr ""
|
2022 |
+
|
2023 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:469
|
2024 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:334
|
2025 |
+
#. translators: %s: link
|
2026 |
+
msgid "Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature."
|
2027 |
+
msgstr ""
|
2028 |
+
|
2029 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:492
|
2030 |
+
msgid "Place Order Button Text"
|
2031 |
+
msgstr ""
|
2032 |
+
|
2033 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:496
|
2034 |
+
msgid "Place order"
|
2035 |
+
msgstr ""
|
2036 |
+
|
2037 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:498
|
2038 |
+
msgid "It will change the Place Order Button text on checkout page."
|
2039 |
+
msgstr ""
|
2040 |
+
|
2041 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:508
|
2042 |
+
msgid "Enable cart editing on checkout"
|
2043 |
+
msgstr ""
|
2044 |
+
|
2045 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:516
|
2046 |
+
#. translators: %s: link
|
2047 |
+
msgid "Users will able to remove products from the checkout page."
|
2048 |
+
msgstr ""
|
2049 |
+
|
2050 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:557
|
2051 |
+
msgid "Header Logo"
|
2052 |
+
msgstr ""
|
2053 |
+
|
2054 |
+
#: modules/checkout/classes/class-cartflows-checkout-meta.php:565
|
2055 |
+
msgid "Logo Width (In px)"
|
2056 |
+
msgstr ""
|
2057 |
+
|
2058 |
+
#: modules/checkout/includes/meta-views/design-checkout-metabox-markup.php:12
|
2059 |
+
#: modules/landing/classes/class-cartflows-landing-meta.php:130
|
2060 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:220
|
2061 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:244
|
2062 |
+
msgid "Shortcodes"
|
2063 |
+
msgstr ""
|
2064 |
+
|
2065 |
+
#: modules/checkout/includes/meta-views/design-checkout-metabox-markup.php:18
|
2066 |
+
msgid "Checkout Design"
|
2067 |
+
msgstr ""
|
2068 |
+
|
2069 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:18
|
2070 |
+
msgid "One Column (Available in CartFlows Pro) "
|
2071 |
+
msgstr ""
|
2072 |
+
|
2073 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:19
|
2074 |
+
msgid "Two Step (Available in CartFlows Pro) "
|
2075 |
+
msgstr ""
|
2076 |
+
|
2077 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:25
|
2078 |
+
msgid "Checkout Skin"
|
2079 |
+
msgstr ""
|
2080 |
+
|
2081 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:49
|
2082 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:84
|
2083 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:130
|
2084 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:222
|
2085 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:419
|
2086 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:458
|
2087 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:570
|
2088 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:311
|
2089 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:342
|
2090 |
+
msgid "Font Family"
|
2091 |
+
msgstr ""
|
2092 |
+
|
2093 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:57
|
2094 |
+
msgid "Advance Options"
|
2095 |
+
msgstr ""
|
2096 |
+
|
2097 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:93
|
2098 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:139
|
2099 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:231
|
2100 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:467
|
2101 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:579
|
2102 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:351
|
2103 |
+
msgid "Font Weight"
|
2104 |
+
msgstr ""
|
2105 |
+
|
2106 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:109
|
2107 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:437
|
2108 |
+
msgid "Floating Labels (Available in CartFlows Pro)"
|
2109 |
+
msgstr ""
|
2110 |
+
|
2111 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:147
|
2112 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:239
|
2113 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:475
|
2114 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:587
|
2115 |
+
msgid "Size"
|
2116 |
+
msgstr ""
|
2117 |
+
|
2118 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:151
|
2119 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:243
|
2120 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:479
|
2121 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:591
|
2122 |
+
msgid "Extra Small"
|
2123 |
+
msgstr ""
|
2124 |
+
|
2125 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:152
|
2126 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:244
|
2127 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:480
|
2128 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:592
|
2129 |
+
msgid "Small"
|
2130 |
+
msgstr ""
|
2131 |
+
|
2132 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:153
|
2133 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:245
|
2134 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:481
|
2135 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:593
|
2136 |
+
msgid "Medium"
|
2137 |
+
msgstr ""
|
2138 |
+
|
2139 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:154
|
2140 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:246
|
2141 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:482
|
2142 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:594
|
2143 |
+
msgid "Large"
|
2144 |
+
msgstr ""
|
2145 |
+
|
2146 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:155
|
2147 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:247
|
2148 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:483
|
2149 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:595
|
2150 |
+
msgid "Extra Large"
|
2151 |
+
msgstr ""
|
2152 |
+
|
2153 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:163
|
2154 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:255
|
2155 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:491
|
2156 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:603
|
2157 |
+
msgid "Top Bottom Spacing"
|
2158 |
+
msgstr ""
|
2159 |
+
|
2160 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:171
|
2161 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:263
|
2162 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:499
|
2163 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:611
|
2164 |
+
msgid "Left Right Spacing"
|
2165 |
+
msgstr ""
|
2166 |
+
|
2167 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:179
|
2168 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:515
|
2169 |
+
msgid "Text / Placeholder Color"
|
2170 |
+
msgstr ""
|
2171 |
+
|
2172 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:324
|
2173 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:356
|
2174 |
+
msgid "Sections"
|
2175 |
+
msgstr ""
|
2176 |
+
|
2177 |
+
#: modules/checkout/includes/meta-views/design-checkout-style-tab.php:330
|
2178 |
+
msgid "Highlight Area Background Color"
|
2179 |
+
msgstr ""
|
2180 |
+
|
2181 |
+
#: modules/checkout/templates/wcf-template.php:46
|
2182 |
+
msgid "Copyright ©"
|
2183 |
+
msgstr ""
|
2184 |
+
|
2185 |
+
#: modules/checkout/templates/wcf-template.php:50
|
2186 |
+
msgid "All Rights Reserved"
|
2187 |
+
msgstr ""
|
2188 |
+
|
2189 |
+
#: modules/elementor/class-cartflows-el-widgets-loader.php:120
|
2190 |
+
#: modules/gutenberg/classes/class-cartflows-init-blocks.php:327
|
2191 |
+
msgid "Cartflows"
|
2192 |
+
msgstr ""
|
2193 |
+
|
2194 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:203
|
2195 |
+
msgid "Layout"
|
2196 |
+
msgstr ""
|
2197 |
+
|
2198 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:224
|
2199 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:465
|
2200 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:230
|
2201 |
+
#. translators: %s admin link
|
2202 |
+
msgid ""
|
2203 |
+
"This feature is available in the CartFlows Pro. <a href=\"%s\" "
|
2204 |
+
"target=\"_blank\" rel=\"noopener\">Upgrade Now!</a>."
|
2205 |
+
msgstr ""
|
2206 |
+
|
2207 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:247
|
2208 |
+
msgid "Other Settings"
|
2209 |
+
msgstr ""
|
2210 |
+
|
2211 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:254
|
2212 |
+
msgid "Billing Section Text"
|
2213 |
+
msgstr ""
|
2214 |
+
|
2215 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:256
|
2216 |
+
msgid "Billing Details"
|
2217 |
+
msgstr ""
|
2218 |
+
|
2219 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:264
|
2220 |
+
msgid "Shipping Section Text"
|
2221 |
+
msgstr ""
|
2222 |
+
|
2223 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:266
|
2224 |
+
msgid "Shipping Details"
|
2225 |
+
msgstr ""
|
2226 |
+
|
2227 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:274
|
2228 |
+
msgid "Order Review Text"
|
2229 |
+
msgstr ""
|
2230 |
+
|
2231 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:276
|
2232 |
+
#: woocommerce/template/checkout/form-checkout.php:56
|
2233 |
+
msgid "Your order"
|
2234 |
+
msgstr ""
|
2235 |
+
|
2236 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:404
|
2237 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:302
|
2238 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:333
|
2239 |
+
msgid "Color"
|
2240 |
+
msgstr ""
|
2241 |
+
|
2242 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:546
|
2243 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:289
|
2244 |
+
msgid "Inherit"
|
2245 |
+
msgstr ""
|
2246 |
+
|
2247 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:598
|
2248 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:711
|
2249 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:397
|
2250 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:326
|
2251 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:406
|
2252 |
+
msgid "Rounded Corners"
|
2253 |
+
msgstr ""
|
2254 |
+
|
2255 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:652
|
2256 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:351
|
2257 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:368
|
2258 |
+
msgid "Normal"
|
2259 |
+
msgstr ""
|
2260 |
+
|
2261 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:747
|
2262 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:411
|
2263 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:428
|
2264 |
+
msgid "Hover"
|
2265 |
+
msgstr ""
|
2266 |
+
|
2267 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:890
|
2268 |
+
msgid "Section Margin"
|
2269 |
+
msgstr ""
|
2270 |
+
|
2271 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:902
|
2272 |
+
msgid "Section Rounded Corners"
|
2273 |
+
msgstr ""
|
2274 |
+
|
2275 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:932
|
2276 |
+
msgid "Field Validation"
|
2277 |
+
msgstr ""
|
2278 |
+
|
2279 |
+
#: modules/elementor/widgets/class-cartflows-el-checkout-form.php:972
|
2280 |
+
msgid "Error Messages"
|
2281 |
+
msgstr ""
|
2282 |
+
|
2283 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:164
|
2284 |
+
msgid "Title"
|
2285 |
+
msgstr ""
|
2286 |
+
|
2287 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:166
|
2288 |
+
msgid "BUY NOW"
|
2289 |
+
msgstr ""
|
2290 |
+
|
2291 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:176
|
2292 |
+
msgid "Sub Title"
|
2293 |
+
msgstr ""
|
2294 |
+
|
2295 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:199
|
2296 |
+
msgid "Before Title"
|
2297 |
+
msgstr ""
|
2298 |
+
|
2299 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:200
|
2300 |
+
msgid "After Title"
|
2301 |
+
msgstr ""
|
2302 |
+
|
2303 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:201
|
2304 |
+
msgid "Before Title & Sub Title"
|
2305 |
+
msgstr ""
|
2306 |
+
|
2307 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:202
|
2308 |
+
msgid "After Title & Sub Title"
|
2309 |
+
msgstr ""
|
2310 |
+
|
2311 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:213
|
2312 |
+
msgid "Icon Vertical Alignment"
|
2313 |
+
msgstr ""
|
2314 |
+
|
2315 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:219
|
2316 |
+
msgid "Top"
|
2317 |
+
msgstr ""
|
2318 |
+
|
2319 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:223
|
2320 |
+
msgid "Middle"
|
2321 |
+
msgstr ""
|
2322 |
+
|
2323 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:315
|
2324 |
+
msgid "Justify"
|
2325 |
+
msgstr ""
|
2326 |
+
|
2327 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:327
|
2328 |
+
msgid "Button Size"
|
2329 |
+
msgstr ""
|
2330 |
+
|
2331 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:418
|
2332 |
+
msgid "Hover Text Color"
|
2333 |
+
msgstr ""
|
2334 |
+
|
2335 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:431
|
2336 |
+
msgid "Hover Background Color"
|
2337 |
+
msgstr ""
|
2338 |
+
|
2339 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:459
|
2340 |
+
msgid "Hover Animation"
|
2341 |
+
msgstr ""
|
2342 |
+
|
2343 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:483
|
2344 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:540
|
2345 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:631
|
2346 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:720
|
2347 |
+
msgid "Content"
|
2348 |
+
msgstr ""
|
2349 |
+
|
2350 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:491
|
2351 |
+
msgid "Text Alignment"
|
2352 |
+
msgstr ""
|
2353 |
+
|
2354 |
+
#: modules/elementor/widgets/class-cartflows-el-next-step-button.php:544
|
2355 |
+
msgid "Title and Sub Title Spacing"
|
2356 |
+
msgstr ""
|
2357 |
+
|
2358 |
+
#: modules/elementor/widgets/class-cartflows-el-optin-form.php:349
|
2359 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:544
|
2360 |
+
msgid "Submit Button"
|
2361 |
+
msgstr ""
|
2362 |
+
|
2363 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:175
|
2364 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:187
|
2365 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:199
|
2366 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:211
|
2367 |
+
msgid "Show"
|
2368 |
+
msgstr ""
|
2369 |
+
|
2370 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:176
|
2371 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:188
|
2372 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:200
|
2373 |
+
#: modules/elementor/widgets/class-cartflows-el-order-details-form.php:212
|
2374 |
+
msgid "Hide"
|
2375 |
+
msgstr ""
|
2376 |
+
|
2377 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:265
|
2378 |
+
#. translators: %s flow id
|
2379 |
+
msgid "Step not deleted for flow - %s"
|
2380 |
+
msgstr ""
|
2381 |
+
|
2382 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:303
|
2383 |
+
#. translators: %s flow id
|
2384 |
+
msgid "Step deleted for flow - %s"
|
2385 |
+
msgstr ""
|
2386 |
+
|
2387 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:312
|
2388 |
+
#. translators: %s flow id
|
2389 |
+
msgid "This step can not be deleted."
|
2390 |
+
msgstr ""
|
2391 |
+
|
2392 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:344
|
2393 |
+
#. translators: %s flow id
|
2394 |
+
msgid "Steps not sorted for flow - %s"
|
2395 |
+
msgstr ""
|
2396 |
+
|
2397 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:380
|
2398 |
+
#. translators: %s flow id
|
2399 |
+
msgid "Steps sorted for flow - %s"
|
2400 |
+
msgstr ""
|
2401 |
+
|
2402 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:485
|
2403 |
+
msgid "Analytics"
|
2404 |
+
msgstr ""
|
2405 |
+
|
2406 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:502
|
2407 |
+
#. translators: %s: link
|
2408 |
+
msgid "Upgrade to %1$sCartFlows Pro%2$s for Analytics feature"
|
2409 |
+
msgstr ""
|
2410 |
+
|
2411 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:520
|
2412 |
+
msgid "Flow Settings"
|
2413 |
+
msgstr ""
|
2414 |
+
|
2415 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:605
|
2416 |
+
msgid "Enable Test Mode"
|
2417 |
+
msgstr ""
|
2418 |
+
|
2419 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:612
|
2420 |
+
msgid ""
|
2421 |
+
"If you are using WooCommerce plugin then test mode will add random products "
|
2422 |
+
"in your flow, so you can preview it easily while testing."
|
2423 |
+
msgstr ""
|
2424 |
+
|
2425 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:732
|
2426 |
+
#: modules/flow/view/meta-flow-steps.php:145
|
2427 |
+
msgid "Add New Step"
|
2428 |
+
msgstr ""
|
2429 |
+
|
2430 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:802
|
2431 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:166
|
2432 |
+
msgid "View Step"
|
2433 |
+
msgstr ""
|
2434 |
+
|
2435 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:813
|
2436 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:165
|
2437 |
+
msgid "Edit Step"
|
2438 |
+
msgstr ""
|
2439 |
+
|
2440 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:815
|
2441 |
+
msgid "Edit"
|
2442 |
+
msgstr ""
|
2443 |
+
|
2444 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:822
|
2445 |
+
msgid "Clone Step"
|
2446 |
+
msgstr ""
|
2447 |
+
|
2448 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:833
|
2449 |
+
msgid "Delete Step"
|
2450 |
+
msgstr ""
|
2451 |
+
|
2452 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:835
|
2453 |
+
msgid "Delete"
|
2454 |
+
msgstr ""
|
2455 |
+
|
2456 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:844
|
2457 |
+
#: modules/flow/classes/class-cartflows-flow-meta.php:846
|
2458 |
+
msgid "A/B Test"
|
2459 |
+
msgstr ""
|
2460 |
+
|
2461 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:69
|
2462 |
+
msgid "Flow: "
|
2463 |
+
msgstr ""
|
2464 |
+
|
2465 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:69
|
2466 |
+
msgid "Name: "
|
2467 |
+
msgstr ""
|
2468 |
+
|
2469 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:101
|
2470 |
+
msgid "Search Flows"
|
2471 |
+
msgstr ""
|
2472 |
+
|
2473 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:102
|
2474 |
+
msgid "All Flows"
|
2475 |
+
msgstr ""
|
2476 |
+
|
2477 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:103
|
2478 |
+
msgid "Edit Flow"
|
2479 |
+
msgstr ""
|
2480 |
+
|
2481 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:104
|
2482 |
+
msgid "View Flow"
|
2483 |
+
msgstr ""
|
2484 |
+
|
2485 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:105
|
2486 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:107
|
2487 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:167
|
2488 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:169
|
2489 |
+
msgid "Add New"
|
2490 |
+
msgstr ""
|
2491 |
+
|
2492 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:106
|
2493 |
+
msgid "Update Flow"
|
2494 |
+
msgstr ""
|
2495 |
+
|
2496 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:108
|
2497 |
+
msgid "New Flow Name"
|
2498 |
+
msgstr ""
|
2499 |
+
|
2500 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:190
|
2501 |
+
msgid "Upgrade to CartFlows Pro"
|
2502 |
+
msgstr ""
|
2503 |
+
|
2504 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:209
|
2505 |
+
msgid "Slug"
|
2506 |
+
msgstr ""
|
2507 |
+
|
2508 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:321
|
2509 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:322
|
2510 |
+
msgid "Flows"
|
2511 |
+
msgstr ""
|
2512 |
+
|
2513 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:344
|
2514 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:350
|
2515 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:401
|
2516 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:407
|
2517 |
+
#. translators: %s: singular custom post type name
|
2518 |
+
msgid "%s updated."
|
2519 |
+
msgstr ""
|
2520 |
+
|
2521 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:346
|
2522 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:403
|
2523 |
+
#. translators: %s: singular custom post type name
|
2524 |
+
msgid "Custom %s updated."
|
2525 |
+
msgstr ""
|
2526 |
+
|
2527 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:348
|
2528 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:405
|
2529 |
+
#. translators: %s: singular custom post type name
|
2530 |
+
msgid "Custom %s deleted."
|
2531 |
+
msgstr ""
|
2532 |
+
|
2533 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:352
|
2534 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:409
|
2535 |
+
#. translators: %1$s: singular custom post type name ,%2$s: date and time of
|
2536 |
+
#. the revision
|
2537 |
+
msgid "%1$s restored to revision from %2$s"
|
2538 |
+
msgstr ""
|
2539 |
+
|
2540 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:354
|
2541 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:411
|
2542 |
+
#. translators: %s: singular custom post type name
|
2543 |
+
msgid "%s published."
|
2544 |
+
msgstr ""
|
2545 |
+
|
2546 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:356
|
2547 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:413
|
2548 |
+
#. translators: %s: singular custom post type name
|
2549 |
+
msgid "%s saved."
|
2550 |
+
msgstr ""
|
2551 |
+
|
2552 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:358
|
2553 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:415
|
2554 |
+
#. translators: %s: singular custom post type name
|
2555 |
+
msgid "%s submitted."
|
2556 |
+
msgstr ""
|
2557 |
+
|
2558 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:360
|
2559 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:417
|
2560 |
+
#. translators: %s: singular custom post type name
|
2561 |
+
msgid "%s scheduled for."
|
2562 |
+
msgstr ""
|
2563 |
+
|
2564 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:362
|
2565 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:419
|
2566 |
+
#. translators: %s: singular custom post type name
|
2567 |
+
msgid "%s draft updated."
|
2568 |
+
msgstr ""
|
2569 |
+
|
2570 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:163
|
2571 |
+
msgid "Search Steps"
|
2572 |
+
msgstr ""
|
2573 |
+
|
2574 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:164
|
2575 |
+
msgid "All Steps"
|
2576 |
+
msgstr ""
|
2577 |
+
|
2578 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:168
|
2579 |
+
msgid "Update Step"
|
2580 |
+
msgstr ""
|
2581 |
+
|
2582 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:170
|
2583 |
+
msgid "New Step Name"
|
2584 |
+
msgstr ""
|
2585 |
+
|
2586 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:211
|
2587 |
+
msgid "Step Type"
|
2588 |
+
msgstr ""
|
2589 |
+
|
2590 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:221
|
2591 |
+
msgid "Step Flow"
|
2592 |
+
msgstr ""
|
2593 |
+
|
2594 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:246
|
2595 |
+
#: modules/flow/view/meta-flow-steps.php:16
|
2596 |
+
msgid "Optin (Woo)"
|
2597 |
+
msgstr ""
|
2598 |
+
|
2599 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:267
|
2600 |
+
#: modules/flow/view/meta-flow-steps.php:14
|
2601 |
+
msgid "Upsell (Woo)"
|
2602 |
+
msgstr ""
|
2603 |
+
|
2604 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:274
|
2605 |
+
#: modules/flow/view/meta-flow-steps.php:15
|
2606 |
+
msgid "Downsell (Woo)"
|
2607 |
+
msgstr ""
|
2608 |
+
|
2609 |
+
#: modules/flow/view/view-flow-inner-step.php:30
|
2610 |
+
msgid "Control"
|
2611 |
+
msgstr ""
|
2612 |
+
|
2613 |
+
#: modules/flow/view/view-flow-inner-step.php:32
|
2614 |
+
#. translators: %s badge count
|
2615 |
+
msgid "Variation-%s"
|
2616 |
+
msgstr ""
|
2617 |
+
|
2618 |
+
#: modules/flow/view/view-flow-inner-step.php:44
|
2619 |
+
msgid "No Product Assigned"
|
2620 |
+
msgstr ""
|
2621 |
+
|
2622 |
+
#: modules/flow/view/view-flow-inner-step.php:48
|
2623 |
+
msgid "Global Checkout - Remove selected checkout product"
|
2624 |
+
msgstr ""
|
2625 |
+
|
2626 |
+
#: modules/flow/view/view-remote-importer.php:19
|
2627 |
+
msgid "Steps Library"
|
2628 |
+
msgstr ""
|
2629 |
+
|
2630 |
+
#: modules/flow/view/view-remote-importer.php:68
|
2631 |
+
msgid "Create Step"
|
2632 |
+
msgstr ""
|
2633 |
+
|
2634 |
+
#: modules/flow/view/view-remote-importer.php:70
|
2635 |
+
msgid "You need a Cartflows Pro version to import Upsell / Downsell"
|
2636 |
+
msgstr ""
|
2637 |
+
|
2638 |
+
#: modules/gutenberg/classes/class-cartflows-init-blocks.php:182
|
2639 |
+
#: modules/optin/classes/class-cartflows-optin-markup.php:307
|
2640 |
+
msgid ""
|
2641 |
+
"No product is selected. Please select a Simple, Virtual and Free product "
|
2642 |
+
"from the meta settings."
|
2643 |
+
msgstr ""
|
2644 |
+
|
2645 |
+
#: modules/landing/classes/class-cartflows-landing-meta.php:66
|
2646 |
+
msgid "Landing Page Settings"
|
2647 |
+
msgstr ""
|
2648 |
+
|
2649 |
+
#: modules/landing/classes/class-cartflows-landing-meta.php:171
|
2650 |
+
msgid "Next Step Link"
|
2651 |
+
msgstr ""
|
2652 |
+
|
2653 |
+
#: modules/optin/classes/class-cartflows-optin-markup.php:247
|
2654 |
+
msgid "Please place shortcode on Optin step-type only."
|
2655 |
+
msgstr ""
|
2656 |
+
|
2657 |
+
#: modules/optin/classes/class-cartflows-optin-markup.php:324
|
2658 |
+
msgid "Please update the selected product's price to zero (0)."
|
2659 |
+
msgstr ""
|
2660 |
+
|
2661 |
+
#: modules/optin/classes/class-cartflows-optin-markup.php:333
|
2662 |
+
#: modules/optin/classes/class-cartflows-optin-markup.php:337
|
2663 |
+
msgid "Please select a Simple, Virtual and Free product."
|
2664 |
+
msgstr ""
|
2665 |
+
|
2666 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:94
|
2667 |
+
msgid "Optin Settings"
|
2668 |
+
msgstr ""
|
2669 |
+
|
2670 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:103
|
2671 |
+
msgid "Optin Design"
|
2672 |
+
msgstr ""
|
2673 |
+
|
2674 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:145
|
2675 |
+
msgid "Form Fields"
|
2676 |
+
msgstr ""
|
2677 |
+
|
2678 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:226
|
2679 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:250
|
2680 |
+
msgid "Design"
|
2681 |
+
msgstr ""
|
2682 |
+
|
2683 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:277
|
2684 |
+
msgid "Add this shortcode to your optin page"
|
2685 |
+
msgstr ""
|
2686 |
+
|
2687 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:302
|
2688 |
+
msgid "Select Free Product"
|
2689 |
+
msgstr ""
|
2690 |
+
|
2691 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:303
|
2692 |
+
msgid "Select Free and Virtual product only."
|
2693 |
+
msgstr ""
|
2694 |
+
|
2695 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:357
|
2696 |
+
msgid "Pass Fields as URL Parameters"
|
2697 |
+
msgstr ""
|
2698 |
+
|
2699 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:360
|
2700 |
+
msgid "Enable"
|
2701 |
+
msgstr ""
|
2702 |
+
|
2703 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:361
|
2704 |
+
msgid ""
|
2705 |
+
"You can pass specific fields from the form to next step as URL query "
|
2706 |
+
"parameters."
|
2707 |
+
msgstr ""
|
2708 |
+
|
2709 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:372
|
2710 |
+
msgid "Enter form field"
|
2711 |
+
msgstr ""
|
2712 |
+
|
2713 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:375
|
2714 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:385
|
2715 |
+
msgid "Enter comma seprated field name. E.g. first_name, last_name"
|
2716 |
+
msgstr ""
|
2717 |
+
|
2718 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:377
|
2719 |
+
msgid "Fields to pass, separated by commas"
|
2720 |
+
msgstr ""
|
2721 |
+
|
2722 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:387
|
2723 |
+
#. translators: %s: link
|
2724 |
+
msgid ""
|
2725 |
+
"You can pass field value as a URL parameter to the next step. %1$sClick "
|
2726 |
+
"here%2$s for more information."
|
2727 |
+
msgstr ""
|
2728 |
+
|
2729 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:550
|
2730 |
+
msgid "Button Text"
|
2731 |
+
msgstr ""
|
2732 |
+
|
2733 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:561
|
2734 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:319
|
2735 |
+
msgid "Font Size"
|
2736 |
+
msgstr ""
|
2737 |
+
|
2738 |
+
#: modules/optin/classes/class-cartflows-optin-meta.php:619
|
2739 |
+
msgid "Position"
|
2740 |
+
msgstr ""
|
2741 |
+
|
2742 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-markup.php:132
|
2743 |
+
msgid "No completed or processing order found to show the order details form demo."
|
2744 |
+
msgstr ""
|
2745 |
+
|
2746 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-markup.php:136
|
2747 |
+
msgid "Order not found. You cannot access this page directly."
|
2748 |
+
msgstr ""
|
2749 |
+
|
2750 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:95
|
2751 |
+
msgid "Thank You Settings"
|
2752 |
+
msgstr ""
|
2753 |
+
|
2754 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:104
|
2755 |
+
msgid "Thank You Design"
|
2756 |
+
msgstr ""
|
2757 |
+
|
2758 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:172
|
2759 |
+
msgid "Thank You Page Text"
|
2760 |
+
msgstr ""
|
2761 |
+
|
2762 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:178
|
2763 |
+
msgid "It will change the default text on thank you page."
|
2764 |
+
msgstr ""
|
2765 |
+
|
2766 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:186
|
2767 |
+
msgid "Redirect After Purchase"
|
2768 |
+
msgstr ""
|
2769 |
+
|
2770 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:195
|
2771 |
+
msgid "Redirect Link"
|
2772 |
+
msgstr ""
|
2773 |
+
|
2774 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:199
|
2775 |
+
msgid "https://"
|
2776 |
+
msgstr ""
|
2777 |
+
|
2778 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:256
|
2779 |
+
msgid "Edit Fields"
|
2780 |
+
msgstr ""
|
2781 |
+
|
2782 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:359
|
2783 |
+
msgid "Advanced Options"
|
2784 |
+
msgstr ""
|
2785 |
+
|
2786 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:369
|
2787 |
+
msgid "Container Width (In px)"
|
2788 |
+
msgstr ""
|
2789 |
+
|
2790 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:391
|
2791 |
+
msgid "Enable Order Overview "
|
2792 |
+
msgstr ""
|
2793 |
+
|
2794 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:399
|
2795 |
+
msgid "Enable Order Details "
|
2796 |
+
msgstr ""
|
2797 |
+
|
2798 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:407
|
2799 |
+
msgid "Enable Billing Details "
|
2800 |
+
msgstr ""
|
2801 |
+
|
2802 |
+
#: modules/thankyou/classes/class-cartflows-thankyou-meta.php:415
|
2803 |
+
msgid "Enable Shipping Details "
|
2804 |
+
msgstr ""
|
2805 |
+
|
2806 |
+
#: modules/widgets/class-cartflows-next-step.php:24
|
2807 |
+
msgid "CartFlows Next Step"
|
2808 |
+
msgstr ""
|
2809 |
+
|
2810 |
+
#: modules/widgets/class-cartflows-next-step.php:26
|
2811 |
+
msgid "Next Step Widgets"
|
2812 |
+
msgstr ""
|
2813 |
+
|
2814 |
+
#: modules/widgets/class-cartflows-next-step.php:106
|
2815 |
+
msgid "New title"
|
2816 |
+
msgstr ""
|
2817 |
+
|
2818 |
+
#: modules/widgets/class-cartflows-next-step.php:123
|
2819 |
+
msgid "Title:"
|
2820 |
+
msgstr ""
|
2821 |
+
|
2822 |
+
#: modules/widgets/class-cartflows-next-step.php:127
|
2823 |
+
msgid "Flow ID:"
|
2824 |
+
msgstr ""
|
2825 |
+
|
2826 |
+
#: modules/widgets/class-cartflows-next-step.php:131
|
2827 |
+
msgid "Step ID:"
|
2828 |
+
msgstr ""
|
2829 |
+
|
2830 |
+
#: woocommerce/template/cart/cart-shipping.php:51
|
2831 |
+
#. Translators: $s shipping destination.
|
2832 |
+
msgid "Estimate for %s."
|
2833 |
+
msgstr ""
|
2834 |
+
|
2835 |
+
#: woocommerce/template/cart/cart-shipping.php:52
|
2836 |
+
msgid "Change address"
|
2837 |
+
msgstr ""
|
2838 |
+
|
2839 |
+
#: woocommerce/template/cart/cart-shipping.php:54
|
2840 |
+
msgid "This is only an estimate. Prices will be updated during checkout."
|
2841 |
+
msgstr ""
|
2842 |
+
|
2843 |
+
#: woocommerce/template/cart/cart-shipping.php:61
|
2844 |
+
msgid "Enter your address to view shipping options."
|
2845 |
+
msgstr ""
|
2846 |
+
|
2847 |
+
#: woocommerce/template/cart/cart-shipping.php:63
|
2848 |
+
msgid ""
|
2849 |
+
"There are no shipping methods available. Please ensure that your address "
|
2850 |
+
"has been entered correctly, or contact us if you need any help."
|
2851 |
+
msgstr ""
|
2852 |
+
|
2853 |
+
#: woocommerce/template/cart/cart-shipping.php:66
|
2854 |
+
#. Translators: $s shipping destination.
|
2855 |
+
msgid "No shipping options were found for %s."
|
2856 |
+
msgstr ""
|
2857 |
+
|
2858 |
+
#: woocommerce/template/cart/cart-shipping.php:67
|
2859 |
+
msgid "Enter a different address"
|
2860 |
+
msgstr ""
|
2861 |
+
|
2862 |
+
#: woocommerce/template/checkout/form-billing.php:27
|
2863 |
+
msgid "Billing & Shipping"
|
2864 |
+
msgstr ""
|
2865 |
+
|
2866 |
+
#: woocommerce/template/checkout/form-billing.php:31
|
2867 |
+
msgid "Billing details"
|
2868 |
+
msgstr ""
|
2869 |
+
|
2870 |
+
#: woocommerce/template/checkout/form-billing.php:59
|
2871 |
+
msgid "Create an account?"
|
2872 |
+
msgstr ""
|
2873 |
+
|
2874 |
+
#: woocommerce/template/checkout/form-checkout.php:26
|
2875 |
+
msgid "You must be logged in to checkout."
|
2876 |
+
msgstr ""
|
2877 |
+
|
2878 |
+
#: woocommerce/template/checkout/form-coupon.php:26
|
2879 |
+
msgid "Have a coupon?"
|
2880 |
+
msgstr ""
|
2881 |
+
|
2882 |
+
#: woocommerce/template/checkout/form-coupon.php:26
|
2883 |
+
msgid "Click here to enter your code"
|
2884 |
+
msgstr ""
|
2885 |
+
|
2886 |
+
#: woocommerce/template/checkout/form-coupon.php:31
|
2887 |
+
msgid "If you have a coupon code, please apply it below."
|
2888 |
+
msgstr ""
|
2889 |
+
|
2890 |
+
#: woocommerce/template/checkout/form-coupon.php:34
|
2891 |
+
msgid "Coupon code"
|
2892 |
+
msgstr ""
|
2893 |
+
|
2894 |
+
#: woocommerce/template/checkout/form-coupon.php:38
|
2895 |
+
msgid "Apply coupon"
|
2896 |
+
msgstr ""
|
2897 |
+
|
2898 |
+
#: woocommerce/template/checkout/form-login.php:26
|
2899 |
+
msgid "Returning customer?"
|
2900 |
+
msgstr ""
|
2901 |
+
|
2902 |
+
#: woocommerce/template/checkout/form-login.php:26
|
2903 |
+
msgid "Click here to login"
|
2904 |
+
msgstr ""
|
2905 |
+
|
2906 |
+
#: woocommerce/template/checkout/form-login.php:32
|
2907 |
+
msgid ""
|
2908 |
+
"If you have shopped with us before, please enter your details below. If you "
|
2909 |
+
"are a new customer, please proceed to the Billing & Shipping section."
|
2910 |
+
msgstr ""
|
2911 |
+
|
2912 |
+
#: woocommerce/template/checkout/form-shipping.php:26
|
2913 |
+
msgid "Ship to a different address?"
|
2914 |
+
msgstr ""
|
2915 |
+
|
2916 |
+
#: woocommerce/template/checkout/form-shipping.php:57
|
2917 |
+
msgid "Additional information"
|
2918 |
+
msgstr ""
|
2919 |
+
|
2920 |
+
#: woocommerce/template/checkout/payment.php:32
|
2921 |
+
msgid ""
|
2922 |
+
"Sorry, it seems that there are no available payment methods for your state. "
|
2923 |
+
"Please contact us if you require assistance or wish to make alternate "
|
2924 |
+
"arrangements."
|
2925 |
+
msgstr ""
|
2926 |
+
|
2927 |
+
#: woocommerce/template/checkout/payment.php:32
|
2928 |
+
msgid "Please fill in your details above to see available payment methods."
|
2929 |
+
msgstr ""
|
2930 |
+
|
2931 |
+
#: woocommerce/template/checkout/payment.php:41
|
2932 |
+
#. translators: $1 and $2 opening and closing emphasis tags respectively
|
2933 |
+
msgid ""
|
2934 |
+
"Since your browser does not support JavaScript, or it is disabled, please "
|
2935 |
+
"ensure you click the %1$sUpdate Totals%2$s button before placing your "
|
2936 |
+
"order. You may be charged more than the amount stated above if you fail to "
|
2937 |
+
"do so."
|
2938 |
+
msgstr ""
|
2939 |
+
|
2940 |
+
#: woocommerce/template/checkout/payment.php:43
|
2941 |
+
msgid "Update totals"
|
2942 |
+
msgstr ""
|
2943 |
+
|
2944 |
+
#: woocommerce/template/checkout/review-order.php:26
|
2945 |
+
#: woocommerce/template/order/order-details.php:57
|
2946 |
+
msgid "Product"
|
2947 |
+
msgstr ""
|
2948 |
+
|
2949 |
+
#: woocommerce/template/checkout/review-order.php:27
|
2950 |
+
#: woocommerce/template/checkout/review-order.php:107
|
2951 |
+
#: woocommerce/template/order/order-details.php:58
|
2952 |
+
msgid "Total"
|
2953 |
+
msgstr ""
|
2954 |
+
|
2955 |
+
#: woocommerce/template/checkout/review-order.php:60
|
2956 |
+
msgid "Subtotal"
|
2957 |
+
msgstr ""
|
2958 |
+
|
2959 |
+
#: woocommerce/template/checkout/thankyou.php:30
|
2960 |
+
msgid ""
|
2961 |
+
"Unfortunately your order cannot be processed as the originating "
|
2962 |
+
"bank/merchant has declined your transaction. Please attempt your purchase "
|
2963 |
+
"again."
|
2964 |
+
msgstr ""
|
2965 |
+
|
2966 |
+
#: woocommerce/template/checkout/thankyou.php:33
|
2967 |
+
msgid "Pay"
|
2968 |
+
msgstr ""
|
2969 |
+
|
2970 |
+
#: woocommerce/template/checkout/thankyou.php:35
|
2971 |
+
msgid "My account"
|
2972 |
+
msgstr ""
|
2973 |
+
|
2974 |
+
#: woocommerce/template/checkout/thankyou.php:49
|
2975 |
+
msgid "Order number:"
|
2976 |
+
msgstr ""
|
2977 |
+
|
2978 |
+
#: woocommerce/template/checkout/thankyou.php:54
|
2979 |
+
msgid "Date:"
|
2980 |
+
msgstr ""
|
2981 |
+
|
2982 |
+
#: woocommerce/template/checkout/thankyou.php:60
|
2983 |
+
msgid "Email:"
|
2984 |
+
msgstr ""
|
2985 |
+
|
2986 |
+
#: woocommerce/template/checkout/thankyou.php:67
|
2987 |
+
msgid "Total:"
|
2988 |
+
msgstr ""
|
2989 |
+
|
2990 |
+
#: woocommerce/template/checkout/thankyou.php:74
|
2991 |
+
msgid "Payment method:"
|
2992 |
+
msgstr ""
|
2993 |
+
|
2994 |
+
#: woocommerce/template/global/form-login.php:34
|
2995 |
+
msgid "Username or email"
|
2996 |
+
msgstr ""
|
2997 |
+
|
2998 |
+
#: woocommerce/template/global/form-login.php:38
|
2999 |
+
msgid "Password"
|
3000 |
+
msgstr ""
|
3001 |
+
|
3002 |
+
#: woocommerce/template/global/form-login.php:48
|
3003 |
+
msgid "Login"
|
3004 |
+
msgstr ""
|
3005 |
+
|
3006 |
+
#: woocommerce/template/global/form-login.php:53
|
3007 |
+
msgid "Remember me"
|
3008 |
+
msgstr ""
|
3009 |
+
|
3010 |
+
#: woocommerce/template/global/form-login.php:57
|
3011 |
+
msgid "Lost your password?"
|
3012 |
+
msgstr ""
|
3013 |
+
|
3014 |
+
#: woocommerce/template/order/order-details.php:51
|
3015 |
+
msgid "Order details"
|
3016 |
+
msgstr ""
|
3017 |
+
|
3018 |
+
#: woocommerce/template/order/order-details.php:99
|
3019 |
+
msgid "Note:"
|
3020 |
+
msgstr ""
|
3021 |
+
|
3022 |
+
#. Plugin Name of the plugin/theme
|
3023 |
+
msgid "CartFlows"
|
3024 |
+
msgstr ""
|
3025 |
+
|
3026 |
+
#. Author URI of the plugin/theme
|
3027 |
+
msgid "https://cartflows.com/"
|
3028 |
+
msgstr ""
|
3029 |
+
|
3030 |
+
#. Description of the plugin/theme
|
3031 |
+
msgid "Create beautiful checkout pages & sales flows for WooCommerce."
|
3032 |
+
msgstr ""
|
3033 |
+
|
3034 |
+
#. Author of the plugin/theme
|
3035 |
+
msgid "CartFlows Inc"
|
3036 |
+
msgstr ""
|
3037 |
+
|
3038 |
+
#: modules/beaver-builder/cartflows-bb-next-step/cartflows-bb-next-step.php:262
|
3039 |
+
msgctxt "Width."
|
3040 |
+
msgid "Auto"
|
3041 |
+
msgstr ""
|
3042 |
+
|
3043 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:99
|
3044 |
+
msgctxt "flow general name"
|
3045 |
+
msgid "Flows"
|
3046 |
+
msgstr ""
|
3047 |
+
|
3048 |
+
#: modules/flow/classes/class-cartflows-flow-post-type.php:100
|
3049 |
+
msgctxt "flow singular name"
|
3050 |
+
msgid "Flow"
|
3051 |
+
msgstr ""
|
3052 |
+
|
3053 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:161
|
3054 |
+
msgctxt "flow step general name"
|
3055 |
+
msgid "Steps"
|
3056 |
+
msgstr ""
|
3057 |
+
|
3058 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:162
|
3059 |
+
msgctxt "flow step singular name"
|
3060 |
+
msgid "Step"
|
3061 |
+
msgstr ""
|
3062 |
+
|
3063 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:315
|
3064 |
+
msgctxt "cartflows"
|
3065 |
+
msgid "CartFlows — Boxed"
|
3066 |
+
msgstr ""
|
3067 |
+
|
3068 |
+
#: modules/flow/classes/class-cartflows-step-post-type.php:316
|
3069 |
+
msgctxt "cartflows"
|
3070 |
+
msgid "Template for Page Builders"
|
3071 |
msgstr ""
|
modules/beaver-builder/cartflows-bb-checkout-form/cartflows-bb-checkout-form.php
CHANGED
@@ -208,7 +208,7 @@ FLBuilder::register_module(
|
|
208 |
'responsive' => true,
|
209 |
'preview' => array(
|
210 |
'type' => 'css',
|
211 |
-
'selector' => '.wcf-embed-checkout-form',
|
212 |
),
|
213 |
),
|
214 |
),
|
@@ -317,7 +317,7 @@ FLBuilder::register_module(
|
|
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(
|
208 |
'responsive' => true,
|
209 |
'preview' => array(
|
210 |
'type' => 'css',
|
211 |
+
'selector' => '.wcf-embed-checkout-form, .cartflows-bb__checkout-form .wcf-embed-checkout-form',
|
212 |
),
|
213 |
),
|
214 |
),
|
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, .wcf-embed-checkout-form .woocommerce #order_review .wcf-custom-coupon-field input[type="text"]',
|
321 |
),
|
322 |
),
|
323 |
'input_border_style' => array(
|
modules/beaver-builder/cartflows-bb-checkout-form/includes/frontend.css.php
CHANGED
@@ -89,7 +89,7 @@ if ( class_exists( 'FLBuilderCSS' ) ) {
|
|
89 |
FLBuilderCSS::typography_field_rule(
|
90 |
array(
|
91 |
'settings' => $settings,
|
92 |
-
'setting_name' => '
|
93 |
'selector' => ".fl-node-$id .cartflows-bb__checkout-form .wcf-embed-checkout-form",
|
94 |
)
|
95 |
);
|
@@ -126,8 +126,7 @@ if ( class_exists( 'FLBuilderCSS' ) ) {
|
|
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,
|
@@ -135,7 +134,8 @@ if ( class_exists( 'FLBuilderCSS' ) ) {
|
|
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 |
-
|
|
|
139 |
)
|
140 |
);
|
141 |
}
|
89 |
FLBuilderCSS::typography_field_rule(
|
90 |
array(
|
91 |
'settings' => $settings,
|
92 |
+
'setting_name' => 'global_typography',
|
93 |
'selector' => ".fl-node-$id .cartflows-bb__checkout-form .wcf-embed-checkout-form",
|
94 |
)
|
95 |
);
|
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, .fl-node-$id .wcf-embed-checkout-form .woocommerce form .form-row textarea,
|
|
|
130 |
.fl-node-$id .wcf-embed-checkout-form .select2-container--default .select2-selection--single,
|
131 |
.fl-node-$id .wcf-embed-checkout-form .woocommerce form .form-row select.select,
|
132 |
.fl-node-$id .wcf-embed-checkout-form .woocommerce .col2-set .col-1,
|
134 |
.fl-node-$id .wcf-embed-checkout-form .woocommerce form p.form-row label,
|
135 |
.fl-node-$id .wcf-embed-checkout-form .woocommerce #payment [type='radio']:checked + label,
|
136 |
.fl-node-$id .wcf-embed-checkout-form .woocommerce #payment [type='radio']:not(:checked) + label,
|
137 |
+
.fl-node-$id .wcf-embed-checkout-form .woocommerce form .form-row select,
|
138 |
+
.fl-node-$id .wcf-embed-checkout-form .woocommerce #order_review .wcf-custom-coupon-field input[type='text]",
|
139 |
)
|
140 |
);
|
141 |
}
|
modules/beaver-builder/cartflows-bb-checkout-form/includes/frontend.php
CHANGED
@@ -1,21 +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>
|
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
CHANGED
@@ -145,7 +145,7 @@ FLBuilder::register_module(
|
|
145 |
'label' => __( 'Icon', 'cartflows' ),
|
146 |
'show_remove' => true,
|
147 |
'show' => array(
|
148 |
-
'fields' => array( 'icon_position' ),
|
149 |
),
|
150 |
'preview' => array(
|
151 |
'type' => 'refresh',
|
@@ -163,6 +163,14 @@ FLBuilder::register_module(
|
|
163 |
'type' => 'refresh',
|
164 |
),
|
165 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
),
|
167 |
),
|
168 |
),
|
@@ -448,6 +456,14 @@ FLBuilder::register_module(
|
|
448 |
'typography' => array(
|
449 |
'title' => __( 'Button Settings', 'cartflows' ),
|
450 |
'fields' => array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
451 |
'button_typo' => array(
|
452 |
'type' => 'typography',
|
453 |
'label' => __( 'Typography', 'cartflows' ),
|
145 |
'label' => __( 'Icon', 'cartflows' ),
|
146 |
'show_remove' => true,
|
147 |
'show' => array(
|
148 |
+
'fields' => array( 'icon_position', 'icon_spacing', 'icon_size' ),
|
149 |
),
|
150 |
'preview' => array(
|
151 |
'type' => 'refresh',
|
163 |
'type' => 'refresh',
|
164 |
),
|
165 |
),
|
166 |
+
'icon_spacing' => array(
|
167 |
+
'type' => 'unit',
|
168 |
+
'label' => __( 'Icon Spacing', 'cartflows' ),
|
169 |
+
'slider' => true,
|
170 |
+
'units' => array( 'px' ),
|
171 |
+
'maxlength' => '30',
|
172 |
+
'size' => '5',
|
173 |
+
),
|
174 |
),
|
175 |
),
|
176 |
),
|
456 |
'typography' => array(
|
457 |
'title' => __( 'Button Settings', 'cartflows' ),
|
458 |
'fields' => array(
|
459 |
+
'icon_size' => array(
|
460 |
+
'type' => 'unit',
|
461 |
+
'label' => __( 'Icon Size', 'cartflows' ),
|
462 |
+
'slider' => true,
|
463 |
+
'units' => array( 'px' ),
|
464 |
+
'maxlength' => '30',
|
465 |
+
'size' => '5',
|
466 |
+
),
|
467 |
'button_typo' => array(
|
468 |
'type' => 'typography',
|
469 |
'label' => __( 'Typography', 'cartflows' ),
|
modules/beaver-builder/cartflows-bb-next-step/includes/frontend.css.php
CHANGED
@@ -43,6 +43,22 @@ if ( ! empty( $settings->bg_hover_color ) ) {
|
|
43 |
|
44 |
?>
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
<?php if ( 'animate_top' == $settings->threed_button_options || 'animate_bottom' == $settings->threed_button_options ) { ?>
|
47 |
/* 3D Fix */
|
48 |
|
@@ -101,6 +117,12 @@ if ( class_exists( 'FLBuilderCSS' ) ) {
|
|
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; ?>;
|
43 |
|
44 |
?>
|
45 |
|
46 |
+
<?php if ( ! empty( $settings->icon ) ) { ?>
|
47 |
+
|
48 |
+
.fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap i {
|
49 |
+
font-size: <?php echo $settings->icon_size . 'px'; ?>;
|
50 |
+
}
|
51 |
+
|
52 |
+
.fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-button .cartflows-bb__next-step-creative-button-icon-before {
|
53 |
+
margin-right: <?php echo $settings->icon_spacing . 'px'; ?>;
|
54 |
+
}
|
55 |
+
|
56 |
+
.fl-node-<?php echo $id; ?> .cartflows-bb__next-step-creative-button-wrap .cartflows-bb__next-step-creative-button .cartflows-bb__next-step-creative-button-icon-after {
|
57 |
+
margin-left: <?php echo $settings->icon_spacing . 'px'; ?>;
|
58 |
+
}
|
59 |
+
|
60 |
+
<?php } ?>
|
61 |
+
|
62 |
<?php if ( 'animate_top' == $settings->threed_button_options || 'animate_bottom' == $settings->threed_button_options ) { ?>
|
63 |
/* 3D Fix */
|
64 |
|
117 |
justify-content: center;
|
118 |
<?php endif; ?>
|
119 |
|
120 |
+
<?php
|
121 |
+
if ( 'transparent' == $settings->style ) : // Transparent.
|
122 |
+
?>
|
123 |
+
border: <?php echo $border_size; ?>px solid <?php echo $border_color; ?>;
|
124 |
+
<?php endif; ?>
|
125 |
+
|
126 |
<?php if ( ! empty( $settings->bg_color ) ) : ?>
|
127 |
background: <?php echo $settings->bg_color; ?>;
|
128 |
border: <?php echo $border_size; ?>px solid <?php echo $border_color; ?>;
|
modules/beaver-builder/cartflows-bb-next-step/includes/frontend.php
CHANGED
@@ -1,55 +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>
|
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-optin-form/includes/frontend.css.php
CHANGED
@@ -1,125 +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 } ?>
|
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
CHANGED
@@ -1,18 +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>
|
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
CHANGED
@@ -253,7 +253,8 @@ FLBuilder::register_module(
|
|
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 |
),
|
@@ -267,10 +268,10 @@ FLBuilder::register_module(
|
|
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 |
),
|
@@ -281,7 +282,8 @@ FLBuilder::register_module(
|
|
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 |
),
|
@@ -387,7 +389,7 @@ FLBuilder::register_module(
|
|
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 |
),
|
@@ -412,7 +414,7 @@ FLBuilder::register_module(
|
|
412 |
'responsive' => true,
|
413 |
'preview' => array(
|
414 |
'type' => 'css',
|
415 |
-
'selector' => '.woocommerce-order .woocommerce-order-details .woocommerce-table',
|
416 |
),
|
417 |
),
|
418 |
),
|
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 |
+
.wcf-thankyou-wrap p:not( .woocommerce-thankyou-order-received )',
|
258 |
'property' => 'color',
|
259 |
'unit' => 'px',
|
260 |
),
|
268 |
'show_alpha' => true,
|
269 |
'preview' => array(
|
270 |
'type' => 'css',
|
271 |
+
'selector' => '.wcf-thankyou-wrap .woocommerce-order-overview.woocommerce-thankyou-order-details.order_details,
|
272 |
+
.wcf-thankyou-wrap .woocommerce-order-details,
|
273 |
+
.wcf-thankyou-wrap .woocommerce-customer-details,
|
274 |
+
.wcf-thankyou-wrap .woocommerce-order-downloads',
|
275 |
'property' => 'background-color',
|
276 |
'unit' => 'px',
|
277 |
),
|
282 |
'responsive' => true,
|
283 |
'preview' => array(
|
284 |
'type' => 'css',
|
285 |
+
'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,
|
286 |
+
.wcf-thankyou-wrap p:not( .woocommerce-thankyou-order-received )',
|
287 |
),
|
288 |
),
|
289 |
),
|
389 |
'show_alpha' => true,
|
390 |
'preview' => array(
|
391 |
'type' => 'css',
|
392 |
+
'selector' => '.woocommerce-order .woocommerce-order-details .woocommerce-table, .woocommerce-order .woocommerce-order-details p.order-again',
|
393 |
'property' => 'color',
|
394 |
'unit' => 'px',
|
395 |
),
|
414 |
'responsive' => true,
|
415 |
'preview' => array(
|
416 |
'type' => 'css',
|
417 |
+
'selector' => '.woocommerce-order .woocommerce-order-details .woocommerce-table, .woocommerce-order .woocommerce-order-details p.order-again',
|
418 |
),
|
419 |
),
|
420 |
),
|
modules/beaver-builder/cartflows-bb-order-details/includes/frontend.css.php
CHANGED
@@ -55,14 +55,16 @@ if ( class_exists( 'FLBuilderCSS' ) ) {
|
|
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 |
|
@@ -75,7 +77,8 @@ if ( class_exists( 'FLBuilderCSS' ) ) {
|
|
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 |
}
|
@@ -142,7 +145,8 @@ if ( class_exists( 'FLBuilderCSS' ) ) {
|
|
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 |
|
@@ -156,7 +160,7 @@ if ( class_exists( 'FLBuilderCSS' ) ) {
|
|
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 |
}
|
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 |
+
.fl-node-<?php echo $id; ?> .cartflows-bb__order-details-form .wcf-thankyou-wrap p:not( .woocommerce-thankyou-order-received ) {
|
60 |
color: <?php echo FLBuilderColor::hex_or_rgb( $settings->sections_content_color ); ?>;
|
61 |
}
|
62 |
|
63 |
.fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-overview.woocommerce-thankyou-order-details.order_details,
|
64 |
.fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details,
|
65 |
.fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details,
|
66 |
+
.fl-node-<?php echo $id; ?> .woocommerce-order-downloads,
|
67 |
+
.fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order-downloads {
|
68 |
background-color: <?php echo FLBuilderColor::hex_or_rgb( $settings->sections_bg_color ); ?>;
|
69 |
}
|
70 |
|
77 |
'selector' => ".fl-node-$id .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-overview.woocommerce-thankyou-order-details.order_details li,
|
78 |
.fl-node-$id .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details .woocommerce-table,
|
79 |
.fl-node-$id .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details address,
|
80 |
+
.fl-node-$id .woocommerce-order-downloads table.shop_table,
|
81 |
+
.fl-node-$id .cartflows-bb__order-details-form .wcf-thankyou-wrap p:not( .woocommerce-thankyou-order-received )",
|
82 |
)
|
83 |
);
|
84 |
}
|
145 |
}
|
146 |
?>
|
147 |
|
148 |
+
.fl-node-<?php echo $id; ?> .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details .woocommerce-table,
|
149 |
+
.fl-node-<?php echo $id; ?> .woocommerce-order .woocommerce-order-details p.order-again {
|
150 |
color: <?php echo FLBuilderColor::hex_or_rgb( $settings->order_details_text_color ); ?>;
|
151 |
}
|
152 |
|
160 |
array(
|
161 |
'settings' => $settings,
|
162 |
'setting_name' => 'order_details_text_typography',
|
163 |
+
'selector' => ".fl-node-$id .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details .woocommerce-table, .fl-node-$id .woocommerce-order .woocommerce-order-details p.order-again",
|
164 |
)
|
165 |
);
|
166 |
}
|
modules/beaver-builder/cartflows-bb-order-details/includes/frontend.php
CHANGED
@@ -1,22 +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>
|
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/class-cartflows-bb-modules-loader.php
CHANGED
@@ -1,108 +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();
|
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
CHANGED
@@ -1,69 +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();
|
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
CHANGED
@@ -1,151 +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 |
-
}
|
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,6 +84,8 @@ class Cartflows_Checkout_Markup {
|
|
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();
|
@@ -92,7 +94,6 @@ class Cartflows_Checkout_Markup {
|
|
92 |
if ( class_exists( 'FLBuilder' ) ) {
|
93 |
$this->bb_editor_compatibility();
|
94 |
}
|
95 |
-
|
96 |
}
|
97 |
|
98 |
/**
|
@@ -154,6 +155,24 @@ class Cartflows_Checkout_Markup {
|
|
154 |
);
|
155 |
}
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
/**
|
158 |
* Function for bb editor compatibility.
|
159 |
*/
|
@@ -367,9 +386,21 @@ class Cartflows_Checkout_Markup {
|
|
367 |
|
368 |
$checkout_id = intval( $atts['id'] );
|
369 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 */
|
@@ -430,10 +461,10 @@ class Cartflows_Checkout_Markup {
|
|
430 |
return;
|
431 |
} else {
|
432 |
|
|
|
|
|
433 |
if ( _is_wcf_checkout_type() ) {
|
434 |
$checkout_id = $post->ID;
|
435 |
-
} else {
|
436 |
-
$checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
|
437 |
}
|
438 |
|
439 |
$global_checkout = intval( Cartflows_Helper::get_common_setting( 'global_checkout' ) );
|
@@ -652,7 +683,7 @@ class Cartflows_Checkout_Markup {
|
|
652 |
*/
|
653 |
public function shortcode_load_data() {
|
654 |
|
655 |
-
if ( _is_wcf_checkout_type()
|
656 |
|
657 |
add_action( 'wp_enqueue_scripts', array( $this, 'shortcode_scripts' ), 21 );
|
658 |
|
@@ -662,11 +693,7 @@ class Cartflows_Checkout_Markup {
|
|
662 |
|
663 |
global $post;
|
664 |
|
665 |
-
|
666 |
-
$checkout_id = $post->ID;
|
667 |
-
} else {
|
668 |
-
$checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
|
669 |
-
}
|
670 |
|
671 |
do_action( 'cartflows_checkout_before_shortcode', $checkout_id );
|
672 |
}
|
@@ -678,7 +705,6 @@ class Cartflows_Checkout_Markup {
|
|
678 |
* @return void
|
679 |
*/
|
680 |
public function before_checkout_shortcode_actions() {
|
681 |
-
|
682 |
/* Show notices if cart has errors */
|
683 |
add_action( 'woocommerce_cart_has_errors', 'woocommerce_output_all_notices' );
|
684 |
|
@@ -715,10 +741,10 @@ class Cartflows_Checkout_Markup {
|
|
715 |
|
716 |
global $post;
|
717 |
|
|
|
|
|
718 |
if ( _is_wcf_checkout_type() ) {
|
719 |
$checkout_id = $post->ID;
|
720 |
-
} else {
|
721 |
-
$checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
|
722 |
}
|
723 |
|
724 |
$flow_id = get_post_meta( $checkout_id, 'wcf-flow-id', true );
|
@@ -767,10 +793,10 @@ class Cartflows_Checkout_Markup {
|
|
767 |
|
768 |
global $post;
|
769 |
|
|
|
|
|
770 |
if ( _is_wcf_checkout_type() ) {
|
771 |
$checkout_id = $post->ID;
|
772 |
-
} else {
|
773 |
-
$checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
|
774 |
}
|
775 |
|
776 |
// Add DIVI Compatibility css if DIVI theme is enabled.
|
@@ -800,10 +826,10 @@ class Cartflows_Checkout_Markup {
|
|
800 |
|
801 |
global $post;
|
802 |
|
|
|
|
|
803 |
if ( _is_wcf_checkout_type() ) {
|
804 |
$checkout_id = $post->ID;
|
805 |
-
} else {
|
806 |
-
$checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
|
807 |
}
|
808 |
|
809 |
/*Output css variable */
|
@@ -1011,10 +1037,10 @@ class Cartflows_Checkout_Markup {
|
|
1011 |
public function enable_logo_in_header() {
|
1012 |
global $post;
|
1013 |
|
|
|
|
|
1014 |
if ( _is_wcf_checkout_type() ) {
|
1015 |
$checkout_id = $post->ID;
|
1016 |
-
} else {
|
1017 |
-
$checkout_id = _get_wcf_checkout_id_from_shortcode( $post->post_content );
|
1018 |
}
|
1019 |
|
1020 |
$header_logo_image = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-header-logo-image' );
|
84 |
|
85 |
add_action( 'init', array( $this, 'update_woo_actions_ajax' ), 10 );
|
86 |
|
87 |
+
$this->gutenberg_editor_compatibility();
|
88 |
+
|
89 |
if ( class_exists( '\Elementor\Plugin' ) ) {
|
90 |
// Load the widgets.
|
91 |
$this->elementor_editor_compatibility();
|
94 |
if ( class_exists( 'FLBuilder' ) ) {
|
95 |
$this->bb_editor_compatibility();
|
96 |
}
|
|
|
97 |
}
|
98 |
|
99 |
/**
|
155 |
);
|
156 |
}
|
157 |
|
158 |
+
/**
|
159 |
+
* Gutenburg editor compatibility.
|
160 |
+
*/
|
161 |
+
public function gutenberg_editor_compatibility() {
|
162 |
+
|
163 |
+
/* Add data */
|
164 |
+
|
165 |
+
add_action(
|
166 |
+
'cartflows_gutenberg_editor_compatibility',
|
167 |
+
function( $post_id ) {
|
168 |
+
|
169 |
+
add_action( 'cartflows_gutenberg_before_checkout_shortcode', array( $this, 'before_checkout_shortcode_actions' ) );
|
170 |
+
},
|
171 |
+
10,
|
172 |
+
2
|
173 |
+
);
|
174 |
+
}
|
175 |
+
|
176 |
/**
|
177 |
* Function for bb editor compatibility.
|
178 |
*/
|
386 |
|
387 |
$checkout_id = intval( $atts['id'] );
|
388 |
|
389 |
+
$show_checkout_demo = false;
|
390 |
+
|
391 |
+
if ( is_admin() ) {
|
392 |
+
|
393 |
+
$show_checkout_demo = apply_filters( 'cartflows_show_demo_checkout', false );
|
394 |
+
|
395 |
+
if ( $show_checkout_demo && 0 === $checkout_id && isset( $_POST['id'] ) ) { //phpcs:ignore
|
396 |
+
$checkout_id = intval( $_POST['id'] ); //phpcs:ignore
|
397 |
+
}
|
398 |
+
}
|
399 |
+
|
400 |
if ( empty( $checkout_id ) ) {
|
401 |
|
402 |
+
if ( ! _is_wcf_checkout_type() && false === $show_checkout_demo ) {
|
403 |
+
|
404 |
$error_html = '<h4>' . __( 'Checkout ID not found', 'cartflows' ) . '</h4>';
|
405 |
$error_html .= '<p>' . sprintf(
|
406 |
/* translators: %1$1s, %2$2s Link to article */
|
461 |
return;
|
462 |
} else {
|
463 |
|
464 |
+
$checkout_id = 0;
|
465 |
+
|
466 |
if ( _is_wcf_checkout_type() ) {
|
467 |
$checkout_id = $post->ID;
|
|
|
|
|
468 |
}
|
469 |
|
470 |
$global_checkout = intval( Cartflows_Helper::get_common_setting( 'global_checkout' ) );
|
683 |
*/
|
684 |
public function shortcode_load_data() {
|
685 |
|
686 |
+
if ( _is_wcf_checkout_type() ) {
|
687 |
|
688 |
add_action( 'wp_enqueue_scripts', array( $this, 'shortcode_scripts' ), 21 );
|
689 |
|
693 |
|
694 |
global $post;
|
695 |
|
696 |
+
$checkout_id = $post->ID;
|
|
|
|
|
|
|
|
|
697 |
|
698 |
do_action( 'cartflows_checkout_before_shortcode', $checkout_id );
|
699 |
}
|
705 |
* @return void
|
706 |
*/
|
707 |
public function before_checkout_shortcode_actions() {
|
|
|
708 |
/* Show notices if cart has errors */
|
709 |
add_action( 'woocommerce_cart_has_errors', 'woocommerce_output_all_notices' );
|
710 |
|
741 |
|
742 |
global $post;
|
743 |
|
744 |
+
$checkout_id = 0;
|
745 |
+
|
746 |
if ( _is_wcf_checkout_type() ) {
|
747 |
$checkout_id = $post->ID;
|
|
|
|
|
748 |
}
|
749 |
|
750 |
$flow_id = get_post_meta( $checkout_id, 'wcf-flow-id', true );
|
793 |
|
794 |
global $post;
|
795 |
|
796 |
+
$checkout_id = 0;
|
797 |
+
|
798 |
if ( _is_wcf_checkout_type() ) {
|
799 |
$checkout_id = $post->ID;
|
|
|
|
|
800 |
}
|
801 |
|
802 |
// Add DIVI Compatibility css if DIVI theme is enabled.
|
826 |
|
827 |
global $post;
|
828 |
|
829 |
+
$checkout_id = 0;
|
830 |
+
|
831 |
if ( _is_wcf_checkout_type() ) {
|
832 |
$checkout_id = $post->ID;
|
|
|
|
|
833 |
}
|
834 |
|
835 |
/*Output css variable */
|
1037 |
public function enable_logo_in_header() {
|
1038 |
global $post;
|
1039 |
|
1040 |
+
$checkout_id = 0;
|
1041 |
+
|
1042 |
if ( _is_wcf_checkout_type() ) {
|
1043 |
$checkout_id = $post->ID;
|
|
|
|
|
1044 |
}
|
1045 |
|
1046 |
$header_logo_image = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-header-logo-image' );
|
modules/checkout/classes/class-cartflows-checkout-meta.php
CHANGED
@@ -1,619 +1,619 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Checkout post meta
|
4 |
-
*
|
5 |
-
* @package CartFlows
|
6 |
-
*/
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Meta Boxes setup
|
10 |
-
*/
|
11 |
-
class Cartflows_Checkout_Meta extends Cartflows_Meta {
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Instance
|
15 |
-
*
|
16 |
-
* @var $instance
|
17 |
-
*/
|
18 |
-
private static $instance;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Meta Option
|
22 |
-
*
|
23 |
-
* @var $meta_option
|
24 |
-
*/
|
25 |
-
private static $meta_option = null;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Meta Options map key->value map,
|
29 |
-
*
|
30 |
-
* @var $meta_option_data
|
31 |
-
*/
|
32 |
-
private static $meta_option_data = array();
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Initiator
|
36 |
-
*/
|
37 |
-
public static function get_instance() {
|
38 |
-
if ( ! isset( self::$instance ) ) {
|
39 |
-
self::$instance = new self();
|
40 |
-
}
|
41 |
-
|
42 |
-
return self::$instance;
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Constructor
|
47 |
-
*/
|
48 |
-
public function __construct() {
|
49 |
-
|
50 |
-
/* Init Metabox */
|
51 |
-
add_action( 'load-post.php', array( $this, 'init_metabox' ) );
|
52 |
-
add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
|
53 |
-
}
|
54 |
-
/**
|
55 |
-
* Init Metabox
|
56 |
-
*/
|
57 |
-
public function init_metabox() {
|
58 |
-
|
59 |
-
add_action( 'add_meta_boxes', array( $this, 'setup_meta_box' ), 10, 2 );
|
60 |
-
add_action( 'save_post', array( $this, 'save_meta_box' ) );
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Setup Metabox
|
65 |
-
*
|
66 |
-
* @param string $post_type post type.
|
67 |
-
* @param object $post post object.
|
68 |
-
*/
|
69 |
-
public function setup_meta_box( $post_type, $post ) {
|
70 |
-
|
71 |
-
if ( _is_wcf_checkout_type() ) {
|
72 |
-
|
73 |
-
$stored_meta = get_post_meta( $post->ID );
|
74 |
-
$checkout_meta = self::get_meta_option( $post->ID );
|
75 |
-
|
76 |
-
// Set stored and override defaults.
|
77 |
-
foreach ( $stored_meta as $key => $value ) {
|
78 |
-
if ( array_key_exists( $key, $checkout_meta ) ) {
|
79 |
-
self::$meta_option[ $key ]['default'] = ( isset( $stored_meta[ $key ][0] ) ) ? maybe_unserialize( $stored_meta[ $key ][0] ) : '';
|
80 |
-
} else {
|
81 |
-
self::$meta_option[ $key ]['default'] = ( isset( $stored_meta[ $key ][0] ) ) ? $stored_meta[ $key ][0] : '';
|
82 |
-
}
|
83 |
-
}
|
84 |
-
|
85 |
-
// Get defaults.
|
86 |
-
$new_meta = self::get_meta_option( $post->ID );
|
87 |
-
|
88 |
-
foreach ( $new_meta as $key => $value ) {
|
89 |
-
self::$meta_option_data[ $key ] = $new_meta[ $key ]['default'];
|
90 |
-
}
|
91 |
-
|
92 |
-
add_meta_box(
|
93 |
-
'wcf-checkout-settings', // Id.
|
94 |
-
__( 'Checkout Settings', 'cartflows' ), // Title.
|
95 |
-
array( $this, 'settings_markup_metabox' ), // Callback.
|
96 |
-
$post_type, // Post_type.
|
97 |
-
'normal', // Context.
|
98 |
-
'high' // Priority.
|
99 |
-
);
|
100 |
-
|
101 |
-
add_meta_box(
|
102 |
-
'wcf-checkout-design-settings', // Id.
|
103 |
-
__( 'Checkout Layout & Design', 'cartflows' ), // Title.
|
104 |
-
array( $this, 'design_markup_metabox' ), // Callback.
|
105 |
-
$post_type, // Post_type.
|
106 |
-
'normal', // Context.
|
107 |
-
'high' // Priority.
|
108 |
-
);
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Metabox Markup
|
114 |
-
*
|
115 |
-
* @param object $post Post object.
|
116 |
-
* @return void
|
117 |
-
*/
|
118 |
-
public function settings_markup_metabox( $post ) {
|
119 |
-
|
120 |
-
wp_nonce_field( 'save-nonce-checkout-step-meta', 'nonce-checkout-step-meta' );
|
121 |
-
|
122 |
-
do_action( 'wcf_checkout_settings_markup_before' );
|
123 |
-
$this->settings_tabs_markup( self::$meta_option_data, $post->ID );
|
124 |
-
do_action( 'wcf_checkout_settings_markup_after' );
|
125 |
-
}
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Page Header Tabs
|
129 |
-
*
|
130 |
-
* @param array $options options.
|
131 |
-
* @param int $post_id post ID.
|
132 |
-
*/
|
133 |
-
public function settings_tabs_markup( $options, $post_id ) {
|
134 |
-
|
135 |
-
$active_tab = 'wcf-checkout-general';
|
136 |
-
|
137 |
-
$tab_array = array(
|
138 |
-
array(
|
139 |
-
'title' => __( 'Select Product', 'cartflows' ),
|
140 |
-
'id' => 'wcf-checkout-general',
|
141 |
-
'class' => 'wcf-checkout-general' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
142 |
-
'icon' => 'dashicons-info',
|
143 |
-
),
|
144 |
-
array(
|
145 |
-
'title' => __( 'Product Options', 'cartflows' ),
|
146 |
-
'id' => 'wcf-product-options',
|
147 |
-
'class' => 'wcf-product-options' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
148 |
-
'icon' => 'dashicons dashicons-screenoptions',
|
149 |
-
),
|
150 |
-
array(
|
151 |
-
'title' => __( 'Order Bump', 'cartflows' ),
|
152 |
-
'id' => 'wcf-product-order-bump',
|
153 |
-
'class' => 'wcf-product-order-bump' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
154 |
-
'icon' => 'dashicons-cart',
|
155 |
-
),
|
156 |
-
array(
|
157 |
-
'title' => __( 'Checkout Offer', 'cartflows' ),
|
158 |
-
'id' => 'wcf-pre-checkout-offer',
|
159 |
-
'class' => 'wcf-pre-checkout-offer' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
160 |
-
'icon' => 'dashicons-arrow-up-alt',
|
161 |
-
),
|
162 |
-
array(
|
163 |
-
'title' => __( 'Checkout Fields', 'cartflows' ),
|
164 |
-
'id' => 'wcf-checkout-custom-fields',
|
165 |
-
'class' => 'wcf-checkout-custom-fields' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
166 |
-
'icon' => 'dashicons-welcome-widgets-menus',
|
167 |
-
),
|
168 |
-
array(
|
169 |
-
'title' => __( 'Checkout Settings', 'cartflows' ),
|
170 |
-
'id' => 'wcf-checkout-custom-settings',
|
171 |
-
'class' => 'wcf-checkout-custom-settings' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
172 |
-
'icon' => 'dashicons-admin-generic',
|
173 |
-
),
|
174 |
-
array(
|
175 |
-
'title' => __( 'Custom Script', 'cartflows' ),
|
176 |
-
'id' => 'wcf-checkout-custom-script-header',
|
177 |
-
'class' => 'wcf-checkout-custom-script-header' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
178 |
-
'icon' => 'dashicons-format-aside',
|
179 |
-
),
|
180 |
-
);
|
181 |
-
|
182 |
-
$show_logo = filter_input( INPUT_GET, 'logo-tab', FILTER_VALIDATE_BOOLEAN );
|
183 |
-
|
184 |
-
if ( $show_logo ) {
|
185 |
-
$logo_tab = array(
|
186 |
-
'title' => __( 'Logo (Optional)', 'cartflows' ),
|
187 |
-
'id' => 'wcf-checkout-header',
|
188 |
-
'class' => 'wcf-checkout-header' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
189 |
-
'icon' => 'dashicons-format-image',
|
190 |
-
);
|
191 |
-
array_push( $tab_array, $logo_tab );
|
192 |
-
}
|
193 |
-
|
194 |
-
$tabs = apply_filters( 'cartflows_checkout_tabs', $tab_array, $active_tab );
|
195 |
-
|
196 |
-
?>
|
197 |
-
<div class="wcf-checkout-table wcf-metabox-wrap widefat">
|
198 |
-
<div class="wcf-table-container">
|
199 |
-
<div class="wcf-column-left">
|
200 |
-
<div class="wcf-tab-wrapper">
|
201 |
-
|
202 |
-
<?php foreach ( $tabs as $key => $tab ) { ?>
|
203 |
-
<div class="<?php echo esc_attr( $tab['class'] ); ?>" data-tab="<?php echo esc_attr( $tab['id'] ); ?>">
|
204 |
-
<span class="dashicons <?php echo esc_attr( $tab['icon'] ); ?>"></span>
|
205 |
-
<span class="wcf-tab-title"><?php echo esc_html( $tab['title'] ); ?></span>
|
206 |
-
</div>
|
207 |
-
<?php } ?>
|
208 |
-
</div>
|
209 |
-
</div>
|
210 |
-
<div class="wcf-column-right">
|
211 |
-
<?php $this->tab_general( $options, $post_id ); ?>
|
212 |
-
<?php $this->tab_product_options( $options, $post_id ); ?>
|
213 |
-
<?php $this->tab_product_bump( $options, $post_id ); ?>
|
214 |
-
<?php $this->tab_pre_checkout_offer( $options, $post_id ); ?>
|
215 |
-
<?php $this->tab_custom_fields( $options, $post_id ); ?>
|
216 |
-
<?php $this->tab_custom_settings( $options, $post_id ); ?>
|
217 |
-
<?php $this->tab_header_content( $options, $post_id ); ?>
|
218 |
-
<?php $this->tab_custom_script( $options, $post_id ); ?>
|
219 |
-
<?php do_action( 'cartflows_checkout_tabs_content', $options, $post_id ); ?>
|
220 |
-
<?php $this->right_column_footer( $options, $post_id ); ?>
|
221 |
-
</div>
|
222 |
-
</div>
|
223 |
-
</div>
|
224 |
-
|
225 |
-
<?php
|
226 |
-
}
|
227 |
-
|
228 |
-
/* Design metabox settings */
|
229 |
-
|
230 |
-
/**
|
231 |
-
* Metabox Markup
|
232 |
-
*
|
233 |
-
* @param object $post Post object.
|
234 |
-
* @return void
|
235 |
-
*/
|
236 |
-
public function design_markup_metabox( $post ) {
|
237 |
-
|
238 |
-
wp_nonce_field( 'save-nonce-checkout-step-meta', 'nonce-checkout-step-meta' );
|
239 |
-
|
240 |
-
do_action( 'wcf_checkout_design_settings_markup_before' );
|
241 |
-
$this->design_tabs_markup( self::$meta_option_data, $post->ID );
|
242 |
-
do_action( 'wcf_checkout_design_settings_markup_after' );
|
243 |
-
}
|
244 |
-
|
245 |
-
/**
|
246 |
-
* Design settings Tabs
|
247 |
-
*
|
248 |
-
* @param array $options options.
|
249 |
-
* @param int $post_id post ID.
|
250 |
-
*/
|
251 |
-
public function design_tabs_markup( $options, $post_id ) {
|
252 |
-
|
253 |
-
include CARTFLOWS_CHECKOUT_DIR . 'includes/meta-views/design-checkout-metabox-markup.php';
|
254 |
-
}
|
255 |
-
|
256 |
-
/**
|
257 |
-
* Product options tab.
|
258 |
-
*
|
259 |
-
* @param array $options options.
|
260 |
-
* @param int $post_id post ID.
|
261 |
-
*/
|
262 |
-
public function tab_product_options( $options, $post_id ) {
|
263 |
-
?>
|
264 |
-
<div class="wcf-product-options wcf-tab-content widefat">
|
265 |
-
<?php
|
266 |
-
if ( ! _is_cartflows_pro() ) {
|
267 |
-
echo wcf()->meta->get_description_field(
|
268 |
-
array(
|
269 |
-
'name' => 'wcf-upgrade-to-pro',
|
270 |
-
/* translators: %s: link */
|
271 |
-
'content' => '<i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Product Options feature.', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
272 |
-
)
|
273 |
-
);
|
274 |
-
} elseif ( _is_cartflows_pro() && _is_cartflows_pro_ver_less_than( '1.5.4' ) ) {
|
275 |
-
$version = '1.5.4';
|
276 |
-
$file_path = 'cartflows-pro/cartflows-pro.php';
|
277 |
-
$upgrade_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file_path, 'upgrade-plugin_' . $file_path );
|
278 |
-
echo wcf()->meta->get_description_field(
|
279 |
-
array(
|
280 |
-
'name' => 'wcf-upgrade-to-pro',
|
281 |
-
// translators: %s: link.
|
282 |
-
'content' => '<i>' . sprintf( esc_html__( 'Update %1$sCartFlows Pro%2$s to %3$s or above for Product Options', 'cartflows' ), '<a href="' . $upgrade_link . '" target="_blank">', '</a>', $version ) . '</i>',
|
283 |
-
)
|
284 |
-
);
|
285 |
-
}
|
286 |
-
|
287 |
-
do_action( 'cartflows_product_options_tab_content', $options, $post_id );
|
288 |
-
?>
|
289 |
-
</div>
|
290 |
-
<?php
|
291 |
-
}
|
292 |
-
|
293 |
-
/**
|
294 |
-
* Shortcodes tab
|
295 |
-
*
|
296 |
-
* @param array $options options.
|
297 |
-
* @param int $post_id post ID.
|
298 |
-
*/
|
299 |
-
public function design_tab_shortcodes( $options, $post_id ) {
|
300 |
-
?>
|
301 |
-
<div class="wcf-checkout-shortcodes wcf-tab-content widefat">
|
302 |
-
|
303 |
-
<?php
|
304 |
-
|
305 |
-
echo wcf()->meta->get_shortcode_field(
|
306 |
-
array(
|
307 |
-
'label' => 'Checkout Page',
|
308 |
-
'name' => 'wcf-checkout-shortcode',
|
309 |
-
'content' => '[cartflows_checkout]',
|
310 |
-
'help' => esc_html__( 'Add this shortcode to your checkout page', 'cartflows' ),
|
311 |
-
)
|
312 |
-
);
|
313 |
-
?>
|
314 |
-
</div>
|
315 |
-
<?php
|
316 |
-
}
|
317 |
-
|
318 |
-
/**
|
319 |
-
* General tab
|
320 |
-
*
|
321 |
-
* @param array $options options.
|
322 |
-
* @param int $post_id post ID.
|
323 |
-
*/
|
324 |
-
public function tab_general( $options, $post_id ) {
|
325 |
-
?>
|
326 |
-
<div class="wcf-checkout-general wcf-tab-content widefat">
|
327 |
-
|
328 |
-
<?php
|
329 |
-
|
330 |
-
echo wcf()->meta->get_product_selection_repeater(
|
331 |
-
array(
|
332 |
-
'name' => 'wcf-checkout-products',
|
333 |
-
'value' => $options['wcf-checkout-products'],
|
334 |
-
'allow_clear' => true,
|
335 |
-
)
|
336 |
-
);
|
337 |
-
|
338 |
-
if ( ! _is_cartflows_pro() ) {
|
339 |
-
|
340 |
-
echo wcf()->meta->get_hr_line_field( array() );
|
341 |
-
echo wcf()->meta->get_description_field(
|
342 |
-
array(
|
343 |
-
'name' => 'wcf-upgrade-to-pro',
|
344 |
-
/* translators: %s: link */
|
345 |
-
'content' => '<i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Pre-applied Coupon.', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
346 |
-
)
|
347 |
-
);
|
348 |
-
}
|
349 |
-
|
350 |
-
do_action( 'cartflows_checkout_general_tab_content', $options, $post_id );
|
351 |
-
|
352 |
-
?>
|
353 |
-
</div>
|
354 |
-
<?php
|
355 |
-
}
|
356 |
-
|
357 |
-
/**
|
358 |
-
* Pre Checkout tab
|
359 |
-
*
|
360 |
-
* @param array $options options.
|
361 |
-
* @param int $post_id post ID.
|
362 |
-
*/
|
363 |
-
public function tab_pre_checkout_offer( $options, $post_id ) {
|
364 |
-
?>
|
365 |
-
<div class="wcf-pre-checkout-offer wcf-tab-content widefat">
|
366 |
-
<?php
|
367 |
-
if ( ! _is_cartflows_pro() ) {
|
368 |
-
echo wcf()->meta->get_description_field(
|
369 |
-
array(
|
370 |
-
'name' => 'wcf-upgrade-to-pro',
|
371 |
-
/* translators: %s: link */
|
372 |
-
'content' => '<i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Checkout Offer feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
373 |
-
)
|
374 |
-
);
|
375 |
-
} elseif ( _is_cartflows_pro_ver_less_than( '1.2.0' ) ) {
|
376 |
-
|
377 |
-
$version = '1.2.0';
|
378 |
-
echo wcf()->meta->get_description_field(
|
379 |
-
array(
|
380 |
-
'name' => 'wcf-upgrade-to-pro',
|
381 |
-
/* translators: %s: link */
|
382 |
-
'content' => '<i>' . sprintf( esc_html__( 'Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>', $version ) . '</i>',
|
383 |
-
)
|
384 |
-
);
|
385 |
-
}
|
386 |
-
?>
|
387 |
-
|
388 |
-
<?php do_action( 'cartflows_pre_checkout_offer_tab_content', $options, $post_id ); ?>
|
389 |
-
</div>
|
390 |
-
<?php
|
391 |
-
}
|
392 |
-
|
393 |
-
|
394 |
-
/**
|
395 |
-
* Pre Checkout tab
|
396 |
-
*
|
397 |
-
* @param array $options options.
|
398 |
-
* @param int $post_id post ID.
|
399 |
-
*/
|
400 |
-
public function animate_title_settings( $options, $post_id ) {
|
401 |
-
|
402 |
-
echo wcf()->meta->get_hr_line_field( array() );
|
403 |
-
|
404 |
-
if ( ! _is_cartflows_pro() ) {
|
405 |
-
echo wcf()->meta->get_description_field(
|
406 |
-
array(
|
407 |
-
'name' => 'wcf-upgrade-to-pro',
|
408 |
-
/* translators: %s: link */
|
409 |
-
'content' => '<i>' . sprintf( __( 'Upgrade to %1$sCartFlows Pro%2$s for animate browser tab feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
410 |
-
)
|
411 |
-
);
|
412 |
-
} elseif ( _is_cartflows_pro_ver_less_than( '1.4.0' ) ) {
|
413 |
-
|
414 |
-
$version = '1.4.0';
|
415 |
-
echo wcf()->meta->get_description_field(
|
416 |
-
array(
|
417 |
-
'name' => 'wcf-upgrade-to-pro',
|
418 |
-
/* translators: %s: link */
|
419 |
-
'content' => '<i>' . sprintf( __( 'Update to %1$sCartFlows Pro%2$s to %3$s or above for animate browser tab feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>', $version ) . '</i>',
|
420 |
-
)
|
421 |
-
);
|
422 |
-
}
|
423 |
-
|
424 |
-
do_action( 'cartflows_animate_browser_tab_settings', $options, $post_id );
|
425 |
-
}
|
426 |
-
|
427 |
-
/**
|
428 |
-
* Product bump tab
|
429 |
-
*
|
430 |
-
* @param array $options options.
|
431 |
-
* @param int $post_id post ID.
|
432 |
-
*/
|
433 |
-
public function tab_product_bump( $options, $post_id ) {
|
434 |
-
?>
|
435 |
-
<div class="wcf-product-order-bump wcf-tab-content widefat">
|
436 |
-
<?php
|
437 |
-
if ( ! _is_cartflows_pro() ) {
|
438 |
-
echo wcf()->meta->get_description_field(
|
439 |
-
array(
|
440 |
-
'name' => 'wcf-upgrade-to-pro',
|
441 |
-
/* translators: %s: link */
|
442 |
-
'content' => '<i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature.', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
443 |
-
)
|
444 |
-
);
|
445 |
-
}
|
446 |
-
?>
|
447 |
-
|
448 |
-
<?php do_action( 'cartflows_order_bump_tab_content', $options, $post_id ); ?>
|
449 |
-
</div>
|
450 |
-
<?php
|
451 |
-
}
|
452 |
-
/**
|
453 |
-
* Tab custom fields
|
454 |
-
*
|
455 |
-
* @param array $options options.
|
456 |
-
* @param int $post_id post ID.
|
457 |
-
*/
|
458 |
-
public function tab_custom_fields( $options, $post_id ) {
|
459 |
-
?>
|
460 |
-
<div class="wcf-checkout-custom-fields wcf-tab-content widefat">
|
461 |
-
<?php
|
462 |
-
/* Custom Checkout Fields Section */
|
463 |
-
|
464 |
-
if ( ! _is_cartflows_pro() ) {
|
465 |
-
echo wcf()->meta->get_description_field(
|
466 |
-
array(
|
467 |
-
'name' => 'wcf-upgrade-to-pro',
|
468 |
-
/* translators: %s: link */
|
469 |
-
'content' => '<i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature.', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
470 |
-
)
|
471 |
-
);
|
472 |
-
}
|
473 |
-
?>
|
474 |
-
<?php do_action( 'cartflows_custom_fields_tab_content', $options, $post_id ); ?>
|
475 |
-
</div>
|
476 |
-
<?php
|
477 |
-
}
|
478 |
-
/**
|
479 |
-
* Tab custom settings
|
480 |
-
*
|
481 |
-
* @param array $options options.
|
482 |
-
* @param int $post_id post ID.
|
483 |
-
*/
|
484 |
-
public function tab_custom_settings( $options, $post_id ) {
|
485 |
-
?>
|
486 |
-
<div class="wcf-checkout-custom-settings wcf-tab-content widefat">
|
487 |
-
<div class="wcf-custom-settings-fields">
|
488 |
-
<?php
|
489 |
-
|
490 |
-
echo wcf()->meta->get_text_field(
|
491 |
-
array(
|
492 |
-
'label' => __( 'Place Order Button Text', 'cartflows' ),
|
493 |
-
'name' => 'wcf-checkout-place-order-button-text',
|
494 |
-
'value' => $options['wcf-checkout-place-order-button-text'],
|
495 |
-
'attr' => array(
|
496 |
-
'placeholder' => __( 'Place order', 'cartflows' ),
|
497 |
-
),
|
498 |
-
'help' => __( 'It will change the Place Order Button text on checkout page.', 'cartflows' ),
|
499 |
-
)
|
500 |
-
);
|
501 |
-
|
502 |
-
echo wcf()->meta->get_hr_line_field( array() );
|
503 |
-
|
504 |
-
echo wcf()->meta->get_checkbox_field(
|
505 |
-
array(
|
506 |
-
'name' => 'wcf-remove-product-field',
|
507 |
-
'value' => $options['wcf-remove-product-field'],
|
508 |
-
'after' => esc_html__( 'Enable cart editing on checkout', 'cartflows' ),
|
509 |
-
)
|
510 |
-
);
|
511 |
-
|
512 |
-
echo wcf()->meta->get_description_field(
|
513 |
-
array(
|
514 |
-
'name' => '',
|
515 |
-
/* translators: %s: link */
|
516 |
-
'content' => '<i>' . sprintf( esc_html__( 'Users will able to remove products from the checkout page.', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
517 |
-
)
|
518 |
-
);
|
519 |
-
|
520 |
-
$this->animate_title_settings( $options, $post_id );
|
521 |
-
?>
|
522 |
-
</div>
|
523 |
-
<?php do_action( 'cartflows_custom_settings_tab_content', $options, $post_id ); ?>
|
524 |
-
</div>
|
525 |
-
<?php
|
526 |
-
}
|
527 |
-
|
528 |
-
/**
|
529 |
-
* Tab style
|
530 |
-
*
|
531 |
-
* @param array $options options.
|
532 |
-
* @param int $post_id post ID.
|
533 |
-
*/
|
534 |
-
public function design_tab_style( $options, $post_id ) {
|
535 |
-
include CARTFLOWS_CHECKOUT_DIR . 'includes/meta-views/design-checkout-style-tab.php';
|
536 |
-
}
|
537 |
-
|
538 |
-
|
539 |
-
/**
|
540 |
-
* Tab Header (Used for add logo into header)
|
541 |
-
*
|
542 |
-
* @param array $options options.
|
543 |
-
* @param int $post_id post ID.
|
544 |
-
*/
|
545 |
-
public function tab_header_content( $options, $post_id ) {
|
546 |
-
?>
|
547 |
-
|
548 |
-
<div class="wcf-checkout-header wcf-tab-content widefat">
|
549 |
-
<?php
|
550 |
-
|
551 |
-
$layout_pro_option = array();
|
552 |
-
|
553 |
-
echo wcf()->meta->get_image_field(
|
554 |
-
array(
|
555 |
-
'name' => 'wcf-header-logo-image',
|
556 |
-
'value' => $options['wcf-header-logo-image'],
|
557 |
-
'label' => esc_html__( 'Header Logo', 'cartflows' ),
|
558 |
-
)
|
559 |
-
);
|
560 |
-
|
561 |
-
echo wcf()->meta->get_number_field(
|
562 |
-
array(
|
563 |
-
'name' => 'wcf-header-logo-width',
|
564 |
-
'value' => $options['wcf-header-logo-width'],
|
565 |
-
'label' => esc_html__( 'Logo Width (In px)', 'cartflows' ),
|
566 |
-
)
|
567 |
-
);
|
568 |
-
?>
|
569 |
-
<?php do_action( 'cartflows_checkout_header_tab_content', $options, $post_id ); ?>
|
570 |
-
</div>
|
571 |
-
<?php
|
572 |
-
}
|
573 |
-
/**
|
574 |
-
* Get metabox options
|
575 |
-
*
|
576 |
-
* @param int $post_id post ID.
|
577 |
-
*/
|
578 |
-
public static function get_meta_option( $post_id ) {
|
579 |
-
|
580 |
-
if ( null === self::$meta_option ) {
|
581 |
-
|
582 |
-
/**
|
583 |
-
* Set metabox options
|
584 |
-
*
|
585 |
-
* @see http://php.net/manual/en/filter.filters.sanitize.php
|
586 |
-
*/
|
587 |
-
self::$meta_option = wcf()->options->get_checkout_fields( $post_id );
|
588 |
-
}
|
589 |
-
|
590 |
-
return self::$meta_option;
|
591 |
-
}
|
592 |
-
|
593 |
-
/**
|
594 |
-
* Metabox Save
|
595 |
-
*
|
596 |
-
* @param number $post_id Post ID.
|
597 |
-
* @return void
|
598 |
-
*/
|
599 |
-
public function save_meta_box( $post_id ) {
|
600 |
-
|
601 |
-
// Checks save status.
|
602 |
-
$is_autosave = wp_is_post_autosave( $post_id );
|
603 |
-
$is_revision = wp_is_post_revision( $post_id );
|
604 |
-
|
605 |
-
$is_valid_nonce = ( isset( $_POST['nonce-checkout-step-meta'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce-checkout-step-meta'] ) ), 'save-nonce-checkout-step-meta' ) ) ? true : false;
|
606 |
-
|
607 |
-
// Exits script depending on save status.
|
608 |
-
if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
|
609 |
-
return;
|
610 |
-
}
|
611 |
-
|
612 |
-
wcf()->options->save_checkout_fields( $post_id );
|
613 |
-
}
|
614 |
-
}
|
615 |
-
|
616 |
-
/**
|
617 |
-
* Kicking this off by calling 'get_instance()' method
|
618 |
-
*/
|
619 |
-
Cartflows_Checkout_Meta::get_instance();
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Checkout post meta
|
4 |
+
*
|
5 |
+
* @package CartFlows
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Meta Boxes setup
|
10 |
+
*/
|
11 |
+
class Cartflows_Checkout_Meta extends Cartflows_Meta {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Instance
|
15 |
+
*
|
16 |
+
* @var $instance
|
17 |
+
*/
|
18 |
+
private static $instance;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Meta Option
|
22 |
+
*
|
23 |
+
* @var $meta_option
|
24 |
+
*/
|
25 |
+
private static $meta_option = null;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Meta Options map key->value map,
|
29 |
+
*
|
30 |
+
* @var $meta_option_data
|
31 |
+
*/
|
32 |
+
private static $meta_option_data = array();
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Initiator
|
36 |
+
*/
|
37 |
+
public static function get_instance() {
|
38 |
+
if ( ! isset( self::$instance ) ) {
|
39 |
+
self::$instance = new self();
|
40 |
+
}
|
41 |
+
|
42 |
+
return self::$instance;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Constructor
|
47 |
+
*/
|
48 |
+
public function __construct() {
|
49 |
+
|
50 |
+
/* Init Metabox */
|
51 |
+
add_action( 'load-post.php', array( $this, 'init_metabox' ) );
|
52 |
+
add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
|
53 |
+
}
|
54 |
+
/**
|
55 |
+
* Init Metabox
|
56 |
+
*/
|
57 |
+
public function init_metabox() {
|
58 |
+
|
59 |
+
add_action( 'add_meta_boxes', array( $this, 'setup_meta_box' ), 10, 2 );
|
60 |
+
add_action( 'save_post', array( $this, 'save_meta_box' ) );
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Setup Metabox
|
65 |
+
*
|
66 |
+
* @param string $post_type post type.
|
67 |
+
* @param object $post post object.
|
68 |
+
*/
|
69 |
+
public function setup_meta_box( $post_type, $post ) {
|
70 |
+
|
71 |
+
if ( _is_wcf_checkout_type() ) {
|
72 |
+
|
73 |
+
$stored_meta = get_post_meta( $post->ID );
|
74 |
+
$checkout_meta = self::get_meta_option( $post->ID );
|
75 |
+
|
76 |
+
// Set stored and override defaults.
|
77 |
+
foreach ( $stored_meta as $key => $value ) {
|
78 |
+
if ( array_key_exists( $key, $checkout_meta ) ) {
|
79 |
+
self::$meta_option[ $key ]['default'] = ( isset( $stored_meta[ $key ][0] ) ) ? maybe_unserialize( $stored_meta[ $key ][0] ) : '';
|
80 |
+
} else {
|
81 |
+
self::$meta_option[ $key ]['default'] = ( isset( $stored_meta[ $key ][0] ) ) ? $stored_meta[ $key ][0] : '';
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
// Get defaults.
|
86 |
+
$new_meta = self::get_meta_option( $post->ID );
|
87 |
+
|
88 |
+
foreach ( $new_meta as $key => $value ) {
|
89 |
+
self::$meta_option_data[ $key ] = $new_meta[ $key ]['default'];
|
90 |
+
}
|
91 |
+
|
92 |
+
add_meta_box(
|
93 |
+
'wcf-checkout-settings', // Id.
|
94 |
+
__( 'Checkout Settings', 'cartflows' ), // Title.
|
95 |
+
array( $this, 'settings_markup_metabox' ), // Callback.
|
96 |
+
$post_type, // Post_type.
|
97 |
+
'normal', // Context.
|
98 |
+
'high' // Priority.
|
99 |
+
);
|
100 |
+
|
101 |
+
add_meta_box(
|
102 |
+
'wcf-checkout-design-settings', // Id.
|
103 |
+
__( 'Checkout Layout & Design', 'cartflows' ), // Title.
|
104 |
+
array( $this, 'design_markup_metabox' ), // Callback.
|
105 |
+
$post_type, // Post_type.
|
106 |
+
'normal', // Context.
|
107 |
+
'high' // Priority.
|
108 |
+
);
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Metabox Markup
|
114 |
+
*
|
115 |
+
* @param object $post Post object.
|
116 |
+
* @return void
|
117 |
+
*/
|
118 |
+
public function settings_markup_metabox( $post ) {
|
119 |
+
|
120 |
+
wp_nonce_field( 'save-nonce-checkout-step-meta', 'nonce-checkout-step-meta' );
|
121 |
+
|
122 |
+
do_action( 'wcf_checkout_settings_markup_before' );
|
123 |
+
$this->settings_tabs_markup( self::$meta_option_data, $post->ID );
|
124 |
+
do_action( 'wcf_checkout_settings_markup_after' );
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Page Header Tabs
|
129 |
+
*
|
130 |
+
* @param array $options options.
|
131 |
+
* @param int $post_id post ID.
|
132 |
+
*/
|
133 |
+
public function settings_tabs_markup( $options, $post_id ) {
|
134 |
+
|
135 |
+
$active_tab = 'wcf-checkout-general';
|
136 |
+
|
137 |
+
$tab_array = array(
|
138 |
+
array(
|
139 |
+
'title' => __( 'Select Product', 'cartflows' ),
|
140 |
+
'id' => 'wcf-checkout-general',
|
141 |
+
'class' => 'wcf-checkout-general' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
142 |
+
'icon' => 'dashicons-info',
|
143 |
+
),
|
144 |
+
array(
|
145 |
+
'title' => __( 'Product Options', 'cartflows' ),
|
146 |
+
'id' => 'wcf-product-options',
|
147 |
+
'class' => 'wcf-product-options' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
148 |
+
'icon' => 'dashicons dashicons-screenoptions',
|
149 |
+
),
|
150 |
+
array(
|
151 |
+
'title' => __( 'Order Bump', 'cartflows' ),
|
152 |
+
'id' => 'wcf-product-order-bump',
|
153 |
+
'class' => 'wcf-product-order-bump' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
154 |
+
'icon' => 'dashicons-cart',
|
155 |
+
),
|
156 |
+
array(
|
157 |
+
'title' => __( 'Checkout Offer', 'cartflows' ),
|
158 |
+
'id' => 'wcf-pre-checkout-offer',
|
159 |
+
'class' => 'wcf-pre-checkout-offer' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
160 |
+
'icon' => 'dashicons-arrow-up-alt',
|
161 |
+
),
|
162 |
+
array(
|
163 |
+
'title' => __( 'Checkout Fields', 'cartflows' ),
|
164 |
+
'id' => 'wcf-checkout-custom-fields',
|
165 |
+
'class' => 'wcf-checkout-custom-fields' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
166 |
+
'icon' => 'dashicons-welcome-widgets-menus',
|
167 |
+
),
|
168 |
+
array(
|
169 |
+
'title' => __( 'Checkout Settings', 'cartflows' ),
|
170 |
+
'id' => 'wcf-checkout-custom-settings',
|
171 |
+
'class' => 'wcf-checkout-custom-settings' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
172 |
+
'icon' => 'dashicons-admin-generic',
|
173 |
+
),
|
174 |
+
array(
|
175 |
+
'title' => __( 'Custom Script', 'cartflows' ),
|
176 |
+
'id' => 'wcf-checkout-custom-script-header',
|
177 |
+
'class' => 'wcf-checkout-custom-script-header' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
178 |
+
'icon' => 'dashicons-format-aside',
|
179 |
+
),
|
180 |
+
);
|
181 |
+
|
182 |
+
$show_logo = filter_input( INPUT_GET, 'logo-tab', FILTER_VALIDATE_BOOLEAN );
|
183 |
+
|
184 |
+
if ( $show_logo ) {
|
185 |
+
$logo_tab = array(
|
186 |
+
'title' => __( 'Logo (Optional)', 'cartflows' ),
|
187 |
+
'id' => 'wcf-checkout-header',
|
188 |
+
'class' => 'wcf-checkout-header' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
189 |
+
'icon' => 'dashicons-format-image',
|
190 |
+
);
|
191 |
+
array_push( $tab_array, $logo_tab );
|
192 |
+
}
|
193 |
+
|
194 |
+
$tabs = apply_filters( 'cartflows_checkout_tabs', $tab_array, $active_tab );
|
195 |
+
|
196 |
+
?>
|
197 |
+
<div class="wcf-checkout-table wcf-metabox-wrap widefat">
|
198 |
+
<div class="wcf-table-container">
|
199 |
+
<div class="wcf-column-left">
|
200 |
+
<div class="wcf-tab-wrapper">
|
201 |
+
|
202 |
+
<?php foreach ( $tabs as $key => $tab ) { ?>
|
203 |
+
<div class="<?php echo esc_attr( $tab['class'] ); ?>" data-tab="<?php echo esc_attr( $tab['id'] ); ?>">
|
204 |
+
<span class="dashicons <?php echo esc_attr( $tab['icon'] ); ?>"></span>
|
205 |
+
<span class="wcf-tab-title"><?php echo esc_html( $tab['title'] ); ?></span>
|
206 |
+
</div>
|
207 |
+
<?php } ?>
|
208 |
+
</div>
|
209 |
+
</div>
|
210 |
+
<div class="wcf-column-right">
|
211 |
+
<?php $this->tab_general( $options, $post_id ); ?>
|
212 |
+
<?php $this->tab_product_options( $options, $post_id ); ?>
|
213 |
+
<?php $this->tab_product_bump( $options, $post_id ); ?>
|
214 |
+
<?php $this->tab_pre_checkout_offer( $options, $post_id ); ?>
|
215 |
+
<?php $this->tab_custom_fields( $options, $post_id ); ?>
|
216 |
+
<?php $this->tab_custom_settings( $options, $post_id ); ?>
|
217 |
+
<?php $this->tab_header_content( $options, $post_id ); ?>
|
218 |
+
<?php $this->tab_custom_script( $options, $post_id ); ?>
|
219 |
+
<?php do_action( 'cartflows_checkout_tabs_content', $options, $post_id ); ?>
|
220 |
+
<?php $this->right_column_footer( $options, $post_id ); ?>
|
221 |
+
</div>
|
222 |
+
</div>
|
223 |
+
</div>
|
224 |
+
|
225 |
+
<?php
|
226 |
+
}
|
227 |
+
|
228 |
+
/* Design metabox settings */
|
229 |
+
|
230 |
+
/**
|
231 |
+
* Metabox Markup
|
232 |
+
*
|
233 |
+
* @param object $post Post object.
|
234 |
+
* @return void
|
235 |
+
*/
|
236 |
+
public function design_markup_metabox( $post ) {
|
237 |
+
|
238 |
+
wp_nonce_field( 'save-nonce-checkout-step-meta', 'nonce-checkout-step-meta' );
|
239 |
+
|
240 |
+
do_action( 'wcf_checkout_design_settings_markup_before' );
|
241 |
+
$this->design_tabs_markup( self::$meta_option_data, $post->ID );
|
242 |
+
do_action( 'wcf_checkout_design_settings_markup_after' );
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Design settings Tabs
|
247 |
+
*
|
248 |
+
* @param array $options options.
|
249 |
+
* @param int $post_id post ID.
|
250 |
+
*/
|
251 |
+
public function design_tabs_markup( $options, $post_id ) {
|
252 |
+
|
253 |
+
include CARTFLOWS_CHECKOUT_DIR . 'includes/meta-views/design-checkout-metabox-markup.php';
|
254 |
+
}
|
255 |
+
|
256 |
+
/**
|
257 |
+
* Product options tab.
|
258 |
+
*
|
259 |
+
* @param array $options options.
|
260 |
+
* @param int $post_id post ID.
|
261 |
+
*/
|
262 |
+
public function tab_product_options( $options, $post_id ) {
|
263 |
+
?>
|
264 |
+
<div class="wcf-product-options wcf-tab-content widefat">
|
265 |
+
<?php
|
266 |
+
if ( ! _is_cartflows_pro() ) {
|
267 |
+
echo wcf()->meta->get_description_field(
|
268 |
+
array(
|
269 |
+
'name' => 'wcf-upgrade-to-pro',
|
270 |
+
/* translators: %s: link */
|
271 |
+
'content' => '<i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Product Options feature.', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
272 |
+
)
|
273 |
+
);
|
274 |
+
} elseif ( _is_cartflows_pro() && _is_cartflows_pro_ver_less_than( '1.5.4' ) ) {
|
275 |
+
$version = '1.5.4';
|
276 |
+
$file_path = 'cartflows-pro/cartflows-pro.php';
|
277 |
+
$upgrade_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file_path, 'upgrade-plugin_' . $file_path );
|
278 |
+
echo wcf()->meta->get_description_field(
|
279 |
+
array(
|
280 |
+
'name' => 'wcf-upgrade-to-pro',
|
281 |
+
// translators: %s: link.
|
282 |
+
'content' => '<i>' . sprintf( esc_html__( 'Update %1$sCartFlows Pro%2$s to %3$s or above for Product Options', 'cartflows' ), '<a href="' . $upgrade_link . '" target="_blank">', '</a>', $version ) . '</i>',
|
283 |
+
)
|
284 |
+
);
|
285 |
+
}
|
286 |
+
|
287 |
+
do_action( 'cartflows_product_options_tab_content', $options, $post_id );
|
288 |
+
?>
|
289 |
+
</div>
|
290 |
+
<?php
|
291 |
+
}
|
292 |
+
|
293 |
+
/**
|
294 |
+
* Shortcodes tab
|
295 |
+
*
|
296 |
+
* @param array $options options.
|
297 |
+
* @param int $post_id post ID.
|
298 |
+
*/
|
299 |
+
public function design_tab_shortcodes( $options, $post_id ) {
|
300 |
+
?>
|
301 |
+
<div class="wcf-checkout-shortcodes wcf-tab-content widefat">
|
302 |
+
|
303 |
+
<?php
|
304 |
+
|
305 |
+
echo wcf()->meta->get_shortcode_field(
|
306 |
+
array(
|
307 |
+
'label' => 'Checkout Page',
|
308 |
+
'name' => 'wcf-checkout-shortcode',
|
309 |
+
'content' => '[cartflows_checkout]',
|
310 |
+
'help' => esc_html__( 'Add this shortcode to your checkout page', 'cartflows' ),
|
311 |
+
)
|
312 |
+
);
|
313 |
+
?>
|
314 |
+
</div>
|
315 |
+
<?php
|
316 |
+
}
|
317 |
+
|
318 |
+
/**
|
319 |
+
* General tab
|
320 |
+
*
|
321 |
+
* @param array $options options.
|
322 |
+
* @param int $post_id post ID.
|
323 |
+
*/
|
324 |
+
public function tab_general( $options, $post_id ) {
|
325 |
+
?>
|
326 |
+
<div class="wcf-checkout-general wcf-tab-content widefat">
|
327 |
+
|
328 |
+
<?php
|
329 |
+
|
330 |
+
echo wcf()->meta->get_product_selection_repeater(
|
331 |
+
array(
|
332 |
+
'name' => 'wcf-checkout-products',
|
333 |
+
'value' => $options['wcf-checkout-products'],
|
334 |
+
'allow_clear' => true,
|
335 |
+
)
|
336 |
+
);
|
337 |
+
|
338 |
+
if ( ! _is_cartflows_pro() ) {
|
339 |
+
|
340 |
+
echo wcf()->meta->get_hr_line_field( array() );
|
341 |
+
echo wcf()->meta->get_description_field(
|
342 |
+
array(
|
343 |
+
'name' => 'wcf-upgrade-to-pro',
|
344 |
+
/* translators: %s: link */
|
345 |
+
'content' => '<i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Pre-applied Coupon.', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
346 |
+
)
|
347 |
+
);
|
348 |
+
}
|
349 |
+
|
350 |
+
do_action( 'cartflows_checkout_general_tab_content', $options, $post_id );
|
351 |
+
|
352 |
+
?>
|
353 |
+
</div>
|
354 |
+
<?php
|
355 |
+
}
|
356 |
+
|
357 |
+
/**
|
358 |
+
* Pre Checkout tab
|
359 |
+
*
|
360 |
+
* @param array $options options.
|
361 |
+
* @param int $post_id post ID.
|
362 |
+
*/
|
363 |
+
public function tab_pre_checkout_offer( $options, $post_id ) {
|
364 |
+
?>
|
365 |
+
<div class="wcf-pre-checkout-offer wcf-tab-content widefat">
|
366 |
+
<?php
|
367 |
+
if ( ! _is_cartflows_pro() ) {
|
368 |
+
echo wcf()->meta->get_description_field(
|
369 |
+
array(
|
370 |
+
'name' => 'wcf-upgrade-to-pro',
|
371 |
+
/* translators: %s: link */
|
372 |
+
'content' => '<i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Checkout Offer feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
373 |
+
)
|
374 |
+
);
|
375 |
+
} elseif ( _is_cartflows_pro_ver_less_than( '1.2.0' ) ) {
|
376 |
+
|
377 |
+
$version = '1.2.0';
|
378 |
+
echo wcf()->meta->get_description_field(
|
379 |
+
array(
|
380 |
+
'name' => 'wcf-upgrade-to-pro',
|
381 |
+
/* translators: %s: link */
|
382 |
+
'content' => '<i>' . sprintf( esc_html__( 'Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>', $version ) . '</i>',
|
383 |
+
)
|
384 |
+
);
|
385 |
+
}
|
386 |
+
?>
|
387 |
+
|
388 |
+
<?php do_action( 'cartflows_pre_checkout_offer_tab_content', $options, $post_id ); ?>
|
389 |
+
</div>
|
390 |
+
<?php
|
391 |
+
}
|
392 |
+
|
393 |
+
|
394 |
+
/**
|
395 |
+
* Pre Checkout tab
|
396 |
+
*
|
397 |
+
* @param array $options options.
|
398 |
+
* @param int $post_id post ID.
|
399 |
+
*/
|
400 |
+
public function animate_title_settings( $options, $post_id ) {
|
401 |
+
|
402 |
+
echo wcf()->meta->get_hr_line_field( array() );
|
403 |
+
|
404 |
+
if ( ! _is_cartflows_pro() ) {
|
405 |
+
echo wcf()->meta->get_description_field(
|
406 |
+
array(
|
407 |
+
'name' => 'wcf-upgrade-to-pro',
|
408 |
+
/* translators: %s: link */
|
409 |
+
'content' => '<i>' . sprintf( __( 'Upgrade to %1$sCartFlows Pro%2$s for animate browser tab feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
410 |
+
)
|
411 |
+
);
|
412 |
+
} elseif ( _is_cartflows_pro_ver_less_than( '1.4.0' ) ) {
|
413 |
+
|
414 |
+
$version = '1.4.0';
|
415 |
+
echo wcf()->meta->get_description_field(
|
416 |
+
array(
|
417 |
+
'name' => 'wcf-upgrade-to-pro',
|
418 |
+
/* translators: %s: link */
|
419 |
+
'content' => '<i>' . sprintf( __( 'Update to %1$sCartFlows Pro%2$s to %3$s or above for animate browser tab feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>', $version ) . '</i>',
|
420 |
+
)
|
421 |
+
);
|
422 |
+
}
|
423 |
+
|
424 |
+
do_action( 'cartflows_animate_browser_tab_settings', $options, $post_id );
|
425 |
+
}
|
426 |
+
|
427 |
+
/**
|
428 |
+
* Product bump tab
|
429 |
+
*
|
430 |
+
* @param array $options options.
|
431 |
+
* @param int $post_id post ID.
|
432 |
+
*/
|
433 |
+
public function tab_product_bump( $options, $post_id ) {
|
434 |
+
?>
|
435 |
+
<div class="wcf-product-order-bump wcf-tab-content widefat">
|
436 |
+
<?php
|
437 |
+
if ( ! _is_cartflows_pro() ) {
|
438 |
+
echo wcf()->meta->get_description_field(
|
439 |
+
array(
|
440 |
+
'name' => 'wcf-upgrade-to-pro',
|
441 |
+
/* translators: %s: link */
|
442 |
+
'content' => '<i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature.', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
443 |
+
)
|
444 |
+
);
|
445 |
+
}
|
446 |
+
?>
|
447 |
+
|
448 |
+
<?php do_action( 'cartflows_order_bump_tab_content', $options, $post_id ); ?>
|
449 |
+
</div>
|
450 |
+
<?php
|
451 |
+
}
|
452 |
+
/**
|
453 |
+
* Tab custom fields
|
454 |
+
*
|
455 |
+
* @param array $options options.
|
456 |
+
* @param int $post_id post ID.
|
457 |
+
*/
|
458 |
+
public function tab_custom_fields( $options, $post_id ) {
|
459 |
+
?>
|
460 |
+
<div class="wcf-checkout-custom-fields wcf-tab-content widefat">
|
461 |
+
<?php
|
462 |
+
/* Custom Checkout Fields Section */
|
463 |
+
|
464 |
+
if ( ! _is_cartflows_pro() ) {
|
465 |
+
echo wcf()->meta->get_description_field(
|
466 |
+
array(
|
467 |
+
'name' => 'wcf-upgrade-to-pro',
|
468 |
+
/* translators: %s: link */
|
469 |
+
'content' => '<i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature.', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
470 |
+
)
|
471 |
+
);
|
472 |
+
}
|
473 |
+
?>
|
474 |
+
<?php do_action( 'cartflows_custom_fields_tab_content', $options, $post_id ); ?>
|
475 |
+
</div>
|
476 |
+
<?php
|
477 |
+
}
|
478 |
+
/**
|
479 |
+
* Tab custom settings
|
480 |
+
*
|
481 |
+
* @param array $options options.
|
482 |
+
* @param int $post_id post ID.
|
483 |
+
*/
|
484 |
+
public function tab_custom_settings( $options, $post_id ) {
|
485 |
+
?>
|
486 |
+
<div class="wcf-checkout-custom-settings wcf-tab-content widefat">
|
487 |
+
<div class="wcf-custom-settings-fields">
|
488 |
+
<?php
|
489 |
+
|
490 |
+
echo wcf()->meta->get_text_field(
|
491 |
+
array(
|
492 |
+
'label' => __( 'Place Order Button Text', 'cartflows' ),
|
493 |
+
'name' => 'wcf-checkout-place-order-button-text',
|
494 |
+
'value' => $options['wcf-checkout-place-order-button-text'],
|
495 |
+
'attr' => array(
|
496 |
+
'placeholder' => __( 'Place order', 'cartflows' ),
|
497 |
+
),
|
498 |
+
'help' => __( 'It will change the Place Order Button text on checkout page.', 'cartflows' ),
|
499 |
+
)
|
500 |
+
);
|
501 |
+
|
502 |
+
echo wcf()->meta->get_hr_line_field( array() );
|
503 |
+
|
504 |
+
echo wcf()->meta->get_checkbox_field(
|
505 |
+
array(
|
506 |
+
'name' => 'wcf-remove-product-field',
|
507 |
+
'value' => $options['wcf-remove-product-field'],
|
508 |
+
'after' => esc_html__( 'Enable cart editing on checkout', 'cartflows' ),
|
509 |
+
)
|
510 |
+
);
|
511 |
+
|
512 |
+
echo wcf()->meta->get_description_field(
|
513 |
+
array(
|
514 |
+
'name' => '',
|
515 |
+
/* translators: %s: link */
|
516 |
+
'content' => '<i>' . sprintf( esc_html__( 'Users will able to remove products from the checkout page.', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i>',
|
517 |
+
)
|
518 |
+
);
|
519 |
+
|
520 |
+
$this->animate_title_settings( $options, $post_id );
|
521 |
+
?>
|
522 |
+
</div>
|
523 |
+
<?php do_action( 'cartflows_custom_settings_tab_content', $options, $post_id ); ?>
|
524 |
+
</div>
|
525 |
+
<?php
|
526 |
+
}
|
527 |
+
|
528 |
+
/**
|
529 |
+
* Tab style
|
530 |
+
*
|
531 |
+
* @param array $options options.
|
532 |
+
* @param int $post_id post ID.
|
533 |
+
*/
|
534 |
+
public function design_tab_style( $options, $post_id ) {
|
535 |
+
include CARTFLOWS_CHECKOUT_DIR . 'includes/meta-views/design-checkout-style-tab.php';
|
536 |
+
}
|
537 |
+
|
538 |
+
|
539 |
+
/**
|
540 |
+
* Tab Header (Used for add logo into header)
|
541 |
+
*
|
542 |
+
* @param array $options options.
|
543 |
+
* @param int $post_id post ID.
|
544 |
+
*/
|
545 |
+
public function tab_header_content( $options, $post_id ) {
|
546 |
+
?>
|
547 |
+
|
548 |
+
<div class="wcf-checkout-header wcf-tab-content widefat">
|
549 |
+
<?php
|
550 |
+
|
551 |
+
$layout_pro_option = array();
|
552 |
+
|
553 |
+
echo wcf()->meta->get_image_field(
|
554 |
+
array(
|
555 |
+
'name' => 'wcf-header-logo-image',
|
556 |
+
'value' => $options['wcf-header-logo-image'],
|
557 |
+
'label' => esc_html__( 'Header Logo', 'cartflows' ),
|
558 |
+
)
|
559 |
+
);
|
560 |
+
|
561 |
+
echo wcf()->meta->get_number_field(
|
562 |
+
array(
|
563 |
+
'name' => 'wcf-header-logo-width',
|
564 |
+
'value' => $options['wcf-header-logo-width'],
|
565 |
+
'label' => esc_html__( 'Logo Width (In px)', 'cartflows' ),
|
566 |
+
)
|
567 |
+
);
|
568 |
+
?>
|
569 |
+
<?php do_action( 'cartflows_checkout_header_tab_content', $options, $post_id ); ?>
|
570 |
+
</div>
|
571 |
+
<?php
|
572 |
+
}
|
573 |
+
/**
|
574 |
+
* Get metabox options
|
575 |
+
*
|
576 |
+
* @param int $post_id post ID.
|
577 |
+
*/
|
578 |
+
public static function get_meta_option( $post_id ) {
|
579 |
+
|
580 |
+
if ( null === self::$meta_option ) {
|
581 |
+
|
582 |
+
/**
|
583 |
+
* Set metabox options
|
584 |
+
*
|
585 |
+
* @see http://php.net/manual/en/filter.filters.sanitize.php
|
586 |
+
*/
|
587 |
+
self::$meta_option = wcf()->options->get_checkout_fields( $post_id );
|
588 |
+
}
|
589 |
+
|
590 |
+
return self::$meta_option;
|
591 |
+
}
|
592 |
+
|
593 |
+
/**
|
594 |
+
* Metabox Save
|
595 |
+
*
|
596 |
+
* @param number $post_id Post ID.
|
597 |
+
* @return void
|
598 |
+
*/
|
599 |
+
public function save_meta_box( $post_id ) {
|
600 |
+
|
601 |
+
// Checks save status.
|
602 |
+
$is_autosave = wp_is_post_autosave( $post_id );
|
603 |
+
$is_revision = wp_is_post_revision( $post_id );
|
604 |
+
|
605 |
+
$is_valid_nonce = ( isset( $_POST['nonce-checkout-step-meta'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce-checkout-step-meta'] ) ), 'save-nonce-checkout-step-meta' ) ) ? true : false;
|
606 |
+
|
607 |
+
// Exits script depending on save status.
|
608 |
+
if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
|
609 |
+
return;
|
610 |
+
}
|
611 |
+
|
612 |
+
wcf()->options->save_checkout_fields( $post_id );
|
613 |
+
}
|
614 |
+
}
|
615 |
+
|
616 |
+
/**
|
617 |
+
* Kicking this off by calling 'get_instance()' method
|
618 |
+
*/
|
619 |
+
Cartflows_Checkout_Meta::get_instance();
|
modules/checkout/includes/meta-views/design-checkout-metabox-markup.php
CHANGED
@@ -1,52 +1,52 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Checkout design metabox markup
|
4 |
-
*
|
5 |
-
* @package CartFlows
|
6 |
-
*/
|
7 |
-
|
8 |
-
$active_tab = 'wcf-checkout-style';
|
9 |
-
|
10 |
-
$tab_array = array(
|
11 |
-
array(
|
12 |
-
'title' => __( 'Shortcodes', 'cartflows' ),
|
13 |
-
'id' => 'wcf-checkout-shortcodes',
|
14 |
-
'class' => 'wcf-checkout-shortcodes' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
15 |
-
'icon' => 'dashicons-editor-code',
|
16 |
-
),
|
17 |
-
array(
|
18 |
-
'title' => __( 'Checkout Design', 'cartflows' ),
|
19 |
-
'id' => 'wcf-checkout-style',
|
20 |
-
'class' => 'wcf-checkout-style' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
21 |
-
'icon' => 'dashicons-admin-customizer',
|
22 |
-
),
|
23 |
-
);
|
24 |
-
|
25 |
-
$option_tabs = apply_filters( 'cartflows_checkout_design_settings_tabs', $tab_array, $active_tab );
|
26 |
-
|
27 |
-
?>
|
28 |
-
<div class="wcf-checkout-design-table wcf-metabox-wrap widefat">
|
29 |
-
<div class="wcf-table-container">
|
30 |
-
<?php echo wcf_get_page_builder_notice(); ?>
|
31 |
-
<div class="wcf-column-left">
|
32 |
-
<div class="wcf-tab-wrapper">
|
33 |
-
<?php foreach ( $option_tabs as $key => $option_tab ) { ?>
|
34 |
-
<div class="<?php echo esc_attr( $option_tab['class'] ); ?>" data-tab="<?php echo esc_attr( $option_tab['id'] ); ?>">
|
35 |
-
<span class="dashicons <?php echo esc_attr( $option_tab['icon'] ); ?>"></span>
|
36 |
-
<span class="wcf-tab-title"><?php echo esc_html( $option_tab['title'] ); ?></span>
|
37 |
-
</div>
|
38 |
-
<?php } ?>
|
39 |
-
</div>
|
40 |
-
</div>
|
41 |
-
<div class="wcf-column-right">
|
42 |
-
<?php
|
43 |
-
$this->design_tab_shortcodes( $options, $post_id );
|
44 |
-
$this->design_tab_style( $options, $post_id );
|
45 |
-
do_action( 'cartflows_checkout_design_tabs_content', $options, $post_id );
|
46 |
-
$this->right_column_footer( $options, $post_id );
|
47 |
-
?>
|
48 |
-
</div>
|
49 |
-
</div>
|
50 |
-
</div>
|
51 |
-
|
52 |
-
<?php
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Checkout design metabox markup
|
4 |
+
*
|
5 |
+
* @package CartFlows
|
6 |
+
*/
|
7 |
+
|
8 |
+
$active_tab = 'wcf-checkout-style';
|
9 |
+
|
10 |
+
$tab_array = array(
|
11 |
+
array(
|
12 |
+
'title' => __( 'Shortcodes', 'cartflows' ),
|
13 |
+
'id' => 'wcf-checkout-shortcodes',
|
14 |
+
'class' => 'wcf-checkout-shortcodes' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
15 |
+
'icon' => 'dashicons-editor-code',
|
16 |
+
),
|
17 |
+
array(
|
18 |
+
'title' => __( 'Checkout Design', 'cartflows' ),
|
19 |
+
'id' => 'wcf-checkout-style',
|
20 |
+
'class' => 'wcf-checkout-style' === $active_tab ? 'wcf-tab wp-ui-text-highlight active' : 'wcf-tab',
|
21 |
+
'icon' => 'dashicons-admin-customizer',
|
22 |
+
),
|
23 |
+
);
|
24 |
+
|
25 |
+
$option_tabs = apply_filters( 'cartflows_checkout_design_settings_tabs', $tab_array, $active_tab );
|
26 |
+
|
27 |
+
?>
|
28 |
+
<div class="wcf-checkout-design-table wcf-metabox-wrap widefat">
|
29 |
+
<div class="wcf-table-container">
|
30 |
+
<?php echo wcf_get_page_builder_notice(); ?>
|
31 |
+
<div class="wcf-column-left">
|
32 |
+
<div class="wcf-tab-wrapper">
|
33 |
+
<?php foreach ( $option_tabs as $key => $option_tab ) { ?>
|
34 |
+
<div class="<?php echo esc_attr( $option_tab['class'] ); ?>" data-tab="<?php echo esc_attr( $option_tab['id'] ); ?>">
|
35 |
+
<span class="dashicons <?php echo esc_attr( $option_tab['icon'] ); ?>"></span>
|
36 |
+
<span class="wcf-tab-title"><?php echo esc_html( $option_tab['title'] ); ?></span>
|
37 |
+
</div>
|
38 |
+
<?php } ?>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
<div class="wcf-column-right">
|
42 |
+
<?php
|
43 |
+
$this->design_tab_shortcodes( $options, $post_id );
|
44 |
+
$this->design_tab_style( $options, $post_id );
|
45 |
+
do_action( 'cartflows_checkout_design_tabs_content', $options, $post_id );
|
46 |
+
$this->right_column_footer( $options, $post_id );
|
47 |
+
?>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
</div>
|
51 |
+
|
52 |
+
<?php
|
modules/checkout/includes/meta-views/design-checkout-style-tab.php
CHANGED
@@ -1,347 +1,347 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Checkout style tab content.
|
4 |
-
*
|
5 |
-
* @package CartFlows
|
6 |
-
*/
|
7 |
-
|
8 |
-
?>
|
9 |
-
<div class="wcf-checkout-style wcf-tab-content widefat">
|
10 |
-
<div class="wcf-cs-fields">
|
11 |
-
<div class="wcf-cs-checkbox-field">
|
12 |
-
<?php
|
13 |
-
|
14 |
-
$layout_pro_option = array();
|
15 |
-
|
16 |
-
if ( ! _is_cartflows_pro() ) {
|
17 |
-
$layout_pro_option = array(
|
18 |
-
'one-column' => __( 'One Column (Available in CartFlows Pro) ', 'cartflows' ),
|
19 |
-
'two-step' => __( 'Two Step (Available in CartFlows Pro) ', 'cartflows' ),
|
20 |
-
);
|
21 |
-
}
|
22 |
-
|
23 |
-
echo wcf()->meta->get_select_field(
|
24 |
-
array(
|
25 |
-
'label' => __( 'Checkout Skin', 'cartflows' ),
|
26 |
-
'name' => 'wcf-checkout-layout',
|
27 |
-
'value' => $options['wcf-checkout-layout'],
|
28 |
-
'options' => array(
|
29 |
-
'one-column' => esc_html__( 'One Column', 'cartflows' ),
|
30 |
-
'two-column' => esc_html__( 'Two Column', 'cartflows' ),
|
31 |
-
'two-step' => esc_html__( 'Two Step', 'cartflows' ),
|
32 |
-
),
|
33 |
-
'pro-options' => $layout_pro_option,
|
34 |
-
|
35 |
-
)
|
36 |
-
);
|
37 |
-
|
38 |
-
echo wcf()->meta->get_color_picker_field(
|
39 |
-
array(
|
40 |
-
'label' => __( 'Primary Color', 'cartflows' ),
|
41 |
-
'name' => 'wcf-primary-color',
|
42 |
-
'value' => $options['wcf-primary-color'],
|
43 |
-
)
|
44 |
-
);
|
45 |
-
|
46 |
-
echo wcf()->meta->get_font_family_field(
|
47 |
-
array(
|
48 |
-
'for' => 'wcf-base',
|
49 |
-
'label' => esc_html__( 'Font Family', 'cartflows' ),
|
50 |
-
'name' => 'wcf-base-font-family',
|
51 |
-
'value' => $options['wcf-base-font-family'],
|
52 |
-
)
|
53 |
-
);
|
54 |
-
|
55 |
-
echo wcf()->meta->get_checkbox_field(
|
56 |
-
array(
|
57 |
-
'label' => __( 'Advance Options', 'cartflows' ),
|
58 |
-
'name' => 'wcf-advance-options-fields',
|
59 |
-
'value' => $options['wcf-advance-options-fields'],
|
60 |
-
'after' => 'Enable',
|
61 |
-
)
|
62 |
-
);
|
63 |
-
?>
|
64 |
-
</div>
|
65 |
-
<div class="wcf-cs-fields-options">
|
66 |
-
<?php
|
67 |
-
echo wcf()->meta->get_section(
|
68 |
-
array(
|
69 |
-
'label' => __( 'Heading', 'cartflows' ),
|
70 |
-
)
|
71 |
-
);
|
72 |
-
|
73 |
-
echo wcf()->meta->get_color_picker_field(
|
74 |
-
array(
|
75 |
-
'label' => __( 'Heading Color', 'cartflows' ),
|
76 |
-
'name' => 'wcf-heading-color',
|
77 |
-
'value' => $options['wcf-heading-color'],
|
78 |
-
)
|
79 |
-
);
|
80 |
-
|
81 |
-
echo wcf()->meta->get_font_family_field(
|
82 |
-
array(
|
83 |
-
'for' => 'wcf-heading',
|
84 |
-
'label' => esc_html__( 'Font Family', 'cartflows' ),
|
85 |
-
'name' => 'wcf-heading-font-family',
|
86 |
-
'value' => $options['wcf-heading-font-family'],
|
87 |
-
)
|
88 |
-
);
|
89 |
-
|
90 |
-
echo wcf()->meta->get_font_weight_field(
|
91 |
-
array(
|
92 |
-
'for' => 'wcf-heading',
|
93 |
-
'label' => esc_html__( 'Font Weight', 'cartflows' ),
|
94 |
-
'name' => 'wcf-heading-font-weight',
|
95 |
-
'value' => $options['wcf-heading-font-weight'],
|
96 |
-
)
|
97 |
-
);
|
98 |
-
|
99 |
-
echo wcf()->meta->get_section(
|
100 |
-
array(
|
101 |
-
'label' => __( 'Input Fields', 'cartflows' ),
|
102 |
-
)
|
103 |
-
);
|
104 |
-
|
105 |
-
$fields_skin_pro_option = array();
|
106 |
-
|
107 |
-
if ( ! _is_cartflows_pro() ) {
|
108 |
-
$fields_skin_pro_option = array(
|
109 |
-
'style-one' => __( 'Floating Labels (Available in CartFlows Pro)', 'cartflows' ),
|
110 |
-
);
|
111 |
-
}
|
112 |
-
|
113 |
-
echo wcf()->meta->get_select_field(
|
114 |
-
array(
|
115 |
-
'label' => __( 'Style', 'cartflows' ),
|
116 |
-
'name' => 'wcf-fields-skins',
|
117 |
-
'value' => $options['wcf-fields-skins'],
|
118 |
-
'options' => array(
|
119 |
-
'default' => esc_html__( 'Default', 'cartflows' ),
|
120 |
-
'style-one' => esc_html__( 'Floating Labels', 'cartflows' ),
|
121 |
-
),
|
122 |
-
'pro-options' => $fields_skin_pro_option,
|
123 |
-
|
124 |
-
)
|
125 |
-
);
|
126 |
-
|
127 |
-
echo wcf()->meta->get_font_family_field(
|
128 |
-
array(
|
129 |
-
'for' => 'wcf-input',
|
130 |
-
'label' => esc_html__( 'Font Family', 'cartflows' ),
|
131 |
-
'name' => 'wcf-input-font-family',
|
132 |
-
'value' => $options['wcf-input-font-family'],
|
133 |
-
)
|
134 |
-
);
|
135 |
-
|
136 |
-
echo wcf()->meta->get_font_weight_field(
|
137 |
-
array(
|
138 |
-
'for' => 'wcf-input',
|
139 |
-
'label' => esc_html__( 'Font Weight', 'cartflows' ),
|
140 |
-
'name' => 'wcf-input-font-weight',
|
141 |
-
'value' => $options['wcf-input-font-weight'],
|
142 |
-
)
|
143 |
-
);
|
144 |
-
|
145 |
-
echo wcf()->meta->get_select_field(
|
146 |
-
array(
|
147 |
-
'label' => __( 'Size', 'cartflows' ),
|
148 |
-
'name' => 'wcf-input-field-size',
|
149 |
-
'value' => $options['wcf-input-field-size'],
|
150 |
-
'options' => array(
|
151 |
-
'33px' => esc_html__( 'Extra Small', 'cartflows' ),
|
152 |
-
'38px' => esc_html__( 'Small', 'cartflows' ),
|
153 |
-
'44px' => esc_html__( 'Medium', 'cartflows' ),
|
154 |
-
'58px' => esc_html__( 'Large', 'cartflows' ),
|
155 |
-
'68px' => esc_html__( 'Extra Large', 'cartflows' ),
|
156 |
-
'custom' => esc_html__( 'Custom', 'cartflows' ),
|
157 |
-
),
|
158 |
-
)
|
159 |
-
);
|
160 |
-
|
161 |
-
echo wcf()->meta->get_number_field(
|
162 |
-
array(
|
163 |
-
'label' => __( 'Top Bottom Spacing', 'cartflows' ),
|
164 |
-
'name' => 'wcf-field-tb-padding',
|
165 |
-
'value' => $options['wcf-field-tb-padding'],
|
166 |
-
)
|
167 |
-
);
|
168 |
-
|
169 |
-
echo wcf()->meta->get_number_field(
|
170 |
-
array(
|
171 |
-
'label' => __( 'Left Right Spacing', 'cartflows' ),
|
172 |
-
'name' => 'wcf-field-lr-padding',
|
173 |
-
'value' => $options['wcf-field-lr-padding'],
|
174 |
-
)
|
175 |
-
);
|
176 |
-
|
177 |
-
echo wcf()->meta->get_color_picker_field(
|
178 |
-
array(
|
179 |
-
'label' => __( 'Text / Placeholder Color', 'cartflows' ),
|
180 |
-
'name' => 'wcf-field-color',
|
181 |
-
'value' => $options['wcf-field-color'],
|
182 |
-
)
|
183 |
-
);
|
184 |
-
|
185 |
-
echo wcf()->meta->get_color_picker_field(
|
186 |
-
array(
|
187 |
-
'label' => __( 'Background Color', 'cartflows' ),
|
188 |
-
'name' => 'wcf-field-bg-color',
|
189 |
-
'value' => $options['wcf-field-bg-color'],
|
190 |
-
)
|
191 |
-
);
|
192 |
-
|
193 |
-
echo wcf()->meta->get_color_picker_field(
|
194 |
-
array(
|
195 |
-
'label' => __( 'Border Color', 'cartflows' ),
|
196 |
-
'name' => 'wcf-field-border-color',
|
197 |
-
'value' => $options['wcf-field-border-color'],
|
198 |
-
)
|
199 |
-
);
|
200 |
-
echo wcf()->meta->get_color_picker_field(
|
201 |
-
array(
|
202 |
-
'label' => __( 'Label Color', 'cartflows' ),
|
203 |
-
'name' => 'wcf-field-label-color',
|
204 |
-
'value' => $options['wcf-field-label-color'],
|
205 |
-
)
|
206 |
-
);
|
207 |
-
|
208 |
-
?>
|
209 |
-
</div>
|
210 |
-
<div class="wcf-cs-button-options">
|
211 |
-
<?php
|
212 |
-
|
213 |
-
echo wcf()->meta->get_section(
|
214 |
-
array(
|
215 |
-
'label' => __( 'Buttons', 'cartflows' ),
|
216 |
-
)
|
217 |
-
);
|
218 |
-
|
219 |
-
echo wcf()->meta->get_font_family_field(
|
220 |
-
array(
|
221 |
-
'for' => 'wcf-button',
|
222 |
-
'label' => esc_html__( 'Font Family', 'cartflows' ),
|
223 |
-
'name' => 'wcf-button-font-family',
|
224 |
-
'value' => $options['wcf-button-font-family'],
|
225 |
-
)
|
226 |
-
);
|
227 |
-
|
228 |
-
echo wcf()->meta->get_font_weight_field(
|
229 |
-
array(
|
230 |
-
'for' => 'wcf-button',
|
231 |
-
'label' => esc_html__( 'Font Weight', 'cartflows' ),
|
232 |
-
'name' => 'wcf-button-font-weight',
|
233 |
-
'value' => $options['wcf-button-font-weight'],
|
234 |
-
)
|
235 |
-
);
|
236 |
-
|
237 |
-
echo wcf()->meta->get_select_field(
|
238 |
-
array(
|
239 |
-
'label' => __( 'Size', 'cartflows' ),
|
240 |
-
'name' => 'wcf-input-button-size',
|
241 |
-
'value' => $options['wcf-input-button-size'],
|
242 |
-
'options' => array(
|
243 |
-
'33px' => esc_html__( 'Extra Small', 'cartflows' ),
|
244 |
-
'38px' => esc_html__( 'Small', 'cartflows' ),
|
245 |
-
'44px' => esc_html__( 'Medium', 'cartflows' ),
|
246 |
-
'58px' => esc_html__( 'Large', 'cartflows' ),
|
247 |
-
'68px' => esc_html__( 'Extra Large', 'cartflows' ),
|
248 |
-
'custom' => esc_html__( 'Custom', 'cartflows' ),
|
249 |
-
),
|
250 |
-
)
|
251 |
-
);
|
252 |
-
|
253 |
-
echo wcf()->meta->get_number_field(
|
254 |
-
array(
|
255 |
-
'label' => __( 'Top Bottom Spacing', 'cartflows' ),
|
256 |
-
'name' => 'wcf-submit-tb-padding',
|
257 |
-
'value' => $options['wcf-submit-tb-padding'],
|
258 |
-
)
|
259 |
-
);
|
260 |
-
|
261 |
-
echo wcf()->meta->get_number_field(
|
262 |
-
array(
|
263 |
-
'label' => __( 'Left Right Spacing', 'cartflows' ),
|
264 |
-
'name' => 'wcf-submit-lr-padding',
|
265 |
-
'value' => $options['wcf-submit-lr-padding'],
|
266 |
-
)
|
267 |
-
);
|
268 |
-
|
269 |
-
echo wcf()->meta->get_color_picker_field(
|
270 |
-
array(
|
271 |
-
'label' => __( 'Text Color', 'cartflows' ),
|
272 |
-
'name' => 'wcf-submit-color',
|
273 |
-
'value' => $options['wcf-submit-color'],
|
274 |
-
)
|
275 |
-
);
|
276 |
-
|
277 |
-
echo wcf()->meta->get_color_picker_field(
|
278 |
-
array(
|
279 |
-
'label' => __( 'Text Hover Color', 'cartflows' ),
|
280 |
-
'name' => 'wcf-submit-hover-color',
|
281 |
-
'value' => $options['wcf-submit-hover-color'],
|
282 |
-
)
|
283 |
-
);
|
284 |
-
|
285 |
-
echo wcf()->meta->get_color_picker_field(
|
286 |
-
array(
|
287 |
-
'label' => __( 'Background Color', 'cartflows' ),
|
288 |
-
'name' => 'wcf-submit-bg-color',
|
289 |
-
'value' => $options['wcf-submit-bg-color'],
|
290 |
-
)
|
291 |
-
);
|
292 |
-
|
293 |
-
echo wcf()->meta->get_color_picker_field(
|
294 |
-
array(
|
295 |
-
'label' => __( 'Background Hover Color', 'cartflows' ),
|
296 |
-
'name' => 'wcf-submit-bg-hover-color',
|
297 |
-
'value' => $options['wcf-submit-bg-hover-color'],
|
298 |
-
)
|
299 |
-
);
|
300 |
-
|
301 |
-
echo wcf()->meta->get_color_picker_field(
|
302 |
-
array(
|
303 |
-
'label' => __( 'Border Color', 'cartflows' ),
|
304 |
-
'name' => 'wcf-submit-border-color',
|
305 |
-
'value' => $options['wcf-submit-border-color'],
|
306 |
-
)
|
307 |
-
);
|
308 |
-
|
309 |
-
echo wcf()->meta->get_color_picker_field(
|
310 |
-
array(
|
311 |
-
'label' => __( 'Border Hover Color', 'cartflows' ),
|
312 |
-
'name' => 'wcf-submit-border-hover-color',
|
313 |
-
'value' => $options['wcf-submit-border-hover-color'],
|
314 |
-
)
|
315 |
-
);
|
316 |
-
|
317 |
-
?>
|
318 |
-
</div>
|
319 |
-
<div class="wcf-cs-section-options">
|
320 |
-
<?php
|
321 |
-
|
322 |
-
echo wcf()->meta->get_section(
|
323 |
-
array(
|
324 |
-
'label' => __( 'Sections', 'cartflows' ),
|
325 |
-
)
|
326 |
-
);
|
327 |
-
|
328 |
-
echo wcf()->meta->get_color_picker_field(
|
329 |
-
array(
|
330 |
-
'label' => __( 'Highlight Area Background Color', 'cartflows' ),
|
331 |
-
'name' => 'wcf-hl-bg-color',
|
332 |
-
'value' => $options['wcf-hl-bg-color'],
|
333 |
-
)
|
334 |
-
);
|
335 |
-
|
336 |
-
echo wcf()->meta->get_hidden_field(
|
337 |
-
array(
|
338 |
-
'name' => 'wcf-field-google-font-url',
|
339 |
-
'value' => $options['wcf-field-google-font-url'],
|
340 |
-
)
|
341 |
-
);
|
342 |
-
?>
|
343 |
-
</div>
|
344 |
-
<?php do_action( 'cartflows_checkout_style_tab_content', $options, $post_id ); ?>
|
345 |
-
</div>
|
346 |
-
</div>
|
347 |
-
<?php
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Checkout style tab content.
|
4 |
+
*
|
5 |
+
* @package CartFlows
|
6 |
+
*/
|
7 |
+
|
8 |
+
?>
|
9 |
+
<div class="wcf-checkout-style wcf-tab-content widefat">
|
10 |
+
<div class="wcf-cs-fields">
|
11 |
+
<div class="wcf-cs-checkbox-field">
|
12 |
+
<?php
|
13 |
+
|
14 |
+
$layout_pro_option = array();
|
15 |
+
|
16 |
+
if ( ! _is_cartflows_pro() ) {
|
17 |
+
$layout_pro_option = array(
|
18 |
+
'one-column' => __( 'One Column (Available in CartFlows Pro) ', 'cartflows' ),
|
19 |
+
'two-step' => __( 'Two Step (Available in CartFlows Pro) ', 'cartflows' ),
|
20 |
+
);
|
21 |
+
}
|
22 |
+
|
23 |
+
echo wcf()->meta->get_select_field(
|
24 |
+
array(
|
25 |
+
'label' => __( 'Checkout Skin', 'cartflows' ),
|
26 |
+
'name' => 'wcf-checkout-layout',
|
27 |
+
'value' => $options['wcf-checkout-layout'],
|
28 |
+
'options' => array(
|
29 |
+
'one-column' => esc_html__( 'One Column', 'cartflows' ),
|
30 |
+
'two-column' => esc_html__( 'Two Column', 'cartflows' ),
|
31 |
+
'two-step' => esc_html__( 'Two Step', 'cartflows' ),
|
32 |
+
),
|
33 |
+
'pro-options' => $layout_pro_option,
|
34 |
+
|
35 |
+
)
|
36 |
+
);
|
37 |
+
|
38 |
+
echo wcf()->meta->get_color_picker_field(
|
39 |
+
array(
|
40 |
+
'label' => __( 'Primary Color', 'cartflows' ),
|
41 |
+
'name' => 'wcf-primary-color',
|
42 |
+
'value' => $options['wcf-primary-color'],
|
43 |
+
)
|
44 |
+
);
|
45 |
+
|
46 |
+
echo wcf()->meta->get_font_family_field(
|
47 |
+
array(
|
48 |
+
'for' => 'wcf-base',
|
49 |
+
'label' => esc_html__( 'Font Family', 'cartflows' ),
|
50 |
+
'name' => 'wcf-base-font-family',
|
51 |
+
'value' => $options['wcf-base-font-family'],
|
52 |
+
)
|
53 |
+
);
|
54 |
+
|
55 |
+
echo wcf()->meta->get_checkbox_field(
|
56 |
+
array(
|
57 |
+
'label' => __( 'Advance Options', 'cartflows' ),
|
58 |
+
'name' => 'wcf-advance-options-fields',
|
59 |
+
'value' => $options['wcf-advance-options-fields'],
|
60 |
+
'after' => 'Enable',
|
61 |
+
)
|
62 |
+
);
|
63 |
+
?>
|
64 |
+
</div>
|
65 |
+
<div class="wcf-cs-fields-options">
|
66 |
+
<?php
|
67 |
+
echo wcf()->meta->get_section(
|
68 |
+
array(
|
69 |
+
'label' => __( 'Heading', 'cartflows' ),
|
70 |
+
)
|
71 |
+
);
|
72 |
+
|
73 |
+
echo wcf()->meta->get_color_picker_field(
|
74 |
+
array(
|
75 |
+
'label' => __( 'Heading Color', 'cartflows' ),
|
76 |
+
'name' => 'wcf-heading-color',
|
77 |
+
'value' => $options['wcf-heading-color'],
|
78 |
+
)
|
79 |
+
);
|
80 |
+
|
81 |
+
echo wcf()->meta->get_font_family_field(
|
82 |
+
array(
|
83 |
+
'for' => 'wcf-heading',
|
84 |
+
'label' => esc_html__( 'Font Family', 'cartflows' ),
|
85 |
+
'name' => 'wcf-heading-font-family',
|
86 |
+
'value' => $options['wcf-heading-font-family'],
|
87 |
+
)
|
88 |
+
);
|
89 |
+
|
90 |
+
echo wcf()->meta->get_font_weight_field(
|
91 |
+
array(
|
92 |
+
'for' => 'wcf-heading',
|
93 |
+
'label' => esc_html__( 'Font Weight', 'cartflows' ),
|
94 |
+
'name' => 'wcf-heading-font-weight',
|
95 |
+
'value' => $options['wcf-heading-font-weight'],
|
96 |
+
)
|
97 |
+
);
|
98 |
+
|
99 |
+
echo wcf()->meta->get_section(
|
100 |
+
array(
|
101 |
+
'label' => __( 'Input Fields', 'cartflows' ),
|
102 |
+
)
|
103 |
+
);
|
104 |
+
|
105 |
+
$fields_skin_pro_option = array();
|
106 |
+
|
107 |
+
if ( ! _is_cartflows_pro() ) {
|
108 |
+
$fields_skin_pro_option = array(
|
109 |
+
'style-one' => __( 'Floating Labels (Available in CartFlows Pro)', 'cartflows' ),
|
110 |
+
);
|
111 |
+
}
|
112 |
+
|
113 |
+
echo wcf()->meta->get_select_field(
|
114 |
+
array(
|
115 |
+
'label' => __( 'Style', 'cartflows' ),
|
116 |
+
'name' => 'wcf-fields-skins',
|
117 |
+
'value' => $options['wcf-fields-skins'],
|
118 |
+
'options' => array(
|
119 |
+
'default' => esc_html__( 'Default', 'cartflows' ),
|
120 |
+
'style-one' => esc_html__( 'Floating Labels', 'cartflows' ),
|
121 |
+
),
|
122 |
+
'pro-options' => $fields_skin_pro_option,
|
123 |
+
|
124 |
+
)
|
125 |
+
);
|
126 |
+
|
127 |
+
echo wcf()->meta->get_font_family_field(
|
128 |
+
array(
|
129 |
+
'for' => 'wcf-input',
|
130 |
+
'label' => esc_html__( 'Font Family', 'cartflows' ),
|
131 |
+
'name' => 'wcf-input-font-family',
|
132 |
+
'value' => $options['wcf-input-font-family'],
|
133 |
+
)
|
134 |
+
);
|
135 |
+
|
136 |
+
echo wcf()->meta->get_font_weight_field(
|
137 |
+
array(
|
138 |
+
'for' => 'wcf-input',
|
139 |
+
'label' => esc_html__( 'Font Weight', 'cartflows' ),
|
140 |
+
'name' => 'wcf-input-font-weight',
|
141 |
+
'value' => $options['wcf-input-font-weight'],
|
142 |
+
)
|
143 |
+
);
|
144 |
+
|
145 |
+
echo wcf()->meta->get_select_field(
|
146 |
+
array(
|
147 |
+
'label' => __( 'Size', 'cartflows' ),
|
148 |
+
'name' => 'wcf-input-field-size',
|
149 |
+
'value' => $options['wcf-input-field-size'],
|
150 |
+
'options' => array(
|
151 |
+
'33px' => esc_html__( 'Extra Small', 'cartflows' ),
|
152 |
+
'38px' => esc_html__( 'Small', 'cartflows' ),
|
153 |
+
'44px' => esc_html__( 'Medium', 'cartflows' ),
|
154 |
+
'58px' => esc_html__( 'Large', 'cartflows' ),
|
155 |
+
'68px' => esc_html__( 'Extra Large', 'cartflows' ),
|
156 |
+
'custom' => esc_html__( 'Custom', 'cartflows' ),
|
157 |
+
),
|
158 |
+
)
|
159 |
+
);
|
160 |
+
|
161 |
+
echo wcf()->meta->get_number_field(
|
162 |
+
array(
|
163 |
+
'label' => __( 'Top Bottom Spacing', 'cartflows' ),
|
164 |
+
'name' => 'wcf-field-tb-padding',
|
165 |
+
'value' => $options['wcf-field-tb-padding'],
|
166 |
+
)
|
167 |
+
);
|
168 |
+
|
169 |
+
echo wcf()->meta->get_number_field(
|
170 |
+
array(
|
171 |
+
'label' => __( 'Left Right Spacing', 'cartflows' ),
|
172 |
+
'name' => 'wcf-field-lr-padding',
|
173 |
+
'value' => $options['wcf-field-lr-padding'],
|
174 |
+
)
|
175 |
+
);
|
176 |
+
|
177 |
+
echo wcf()->meta->get_color_picker_field(
|
178 |
+
array(
|
179 |
+
'label' => __( 'Text / Placeholder Color', 'cartflows' ),
|
180 |
+
'name' => 'wcf-field-color',
|
181 |
+
'value' => $options['wcf-field-color'],
|
182 |
+
)
|
183 |
+
);
|
184 |
+
|
185 |
+
echo wcf()->meta->get_color_picker_field(
|
186 |
+
array(
|
187 |
+
'label' => __( 'Background Color', 'cartflows' ),
|
188 |
+
'name' => 'wcf-field-bg-color',
|
189 |
+
'value' => $options['wcf-field-bg-color'],
|
190 |
+
)
|
191 |
+
);
|
192 |
+
|
193 |
+
echo wcf()->meta->get_color_picker_field(
|
194 |
+
array(
|
195 |
+
'label' => __( 'Border Color', 'cartflows' ),
|
196 |
+
'name' => 'wcf-field-border-color',
|
197 |
+
'value' => $options['wcf-field-border-color'],
|
198 |
+
)
|
199 |
+
);
|
200 |
+
echo wcf()->meta->get_color_picker_field(
|
201 |
+
array(
|
202 |
+
'label' => __( 'Label Color', 'cartflows' ),
|
203 |
+
'name' => 'wcf-field-label-color',
|
204 |
+
'value' => $options['wcf-field-label-color'],
|
205 |
+
)
|
206 |
+
);
|
207 |
+
|
208 |
+
?>
|
209 |
+
</div>
|
210 |
+
<div class="wcf-cs-button-options">
|
211 |
+
<?php
|
212 |
+
|
213 |
+
echo wcf()->meta->get_section(
|
214 |
+
array(
|
215 |
+
'label' => __( 'Buttons', 'cartflows' ),
|
216 |
+
)
|
217 |
+
);
|
218 |
+
|
219 |
+
echo wcf()->meta->get_font_family_field(
|
220 |
+
array(
|
221 |
+
'for' => 'wcf-button',
|
222 |
+
'label' => esc_html__( 'Font Family', 'cartflows' ),
|
223 |
+
'name' => 'wcf-button-font-family',
|
224 |
+
'value' => $options['wcf-button-font-family'],
|
225 |
+
)
|
226 |
+
);
|
227 |
+
|
228 |
+
echo wcf()->meta->get_font_weight_field(
|
229 |
+
array(
|
230 |
+
'for' => 'wcf-button',
|
231 |
+
'label' => esc_html__( 'Font Weight', 'cartflows' ),
|
232 |
+
'name' => 'wcf-button-font-weight',
|
233 |
+
'value' => $options['wcf-button-font-weight'],
|
234 |
+
)
|
235 |
+
);
|
236 |
+
|
237 |
+
echo wcf()->meta->get_select_field(
|
238 |
+
array(
|
239 |
+
'label' => __( 'Size', 'cartflows' ),
|
240 |
+
'name' => 'wcf-input-button-size',
|
241 |
+
'value' => $options['wcf-input-button-size'],
|
242 |
+
'options' => array(
|
243 |
+
'33px' => esc_html__( 'Extra Small', 'cartflows' ),
|
244 |
+
'38px' => esc_html__( 'Small', 'cartflows' ),
|
245 |
+
'44px' => esc_html__( 'Medium', 'cartflows' ),
|
246 |
+
'58px' => esc_html__( 'Large', 'cartflows' ),
|
247 |
+
'68px' => esc_html__( 'Extra Large', 'cartflows' ),
|
248 |
+
'custom' => esc_html__( 'Custom', 'cartflows' ),
|
249 |
+
),
|
250 |
+
)
|
251 |
+
);
|
252 |
+
|
253 |
+
echo wcf()->meta->get_number_field(
|
254 |
+
array(
|
255 |
+
'label' => __( 'Top Bottom Spacing', 'cartflows' ),
|
256 |
+
'name' => 'wcf-submit-tb-padding',
|
257 |
+
'value' => $options['wcf-submit-tb-padding'],
|
258 |
+
)
|
259 |
+
);
|
260 |
+
|
261 |
+
echo wcf()->meta->get_number_field(
|
262 |
+
array(
|
263 |
+
'label' => __( 'Left Right Spacing', 'cartflows' ),
|
264 |
+
'name' => 'wcf-submit-lr-padding',
|
265 |
+
'value' => $options['wcf-submit-lr-padding'],
|
266 |
+
)
|
267 |
+
);
|
268 |
+
|
269 |
+
echo wcf()->meta->get_color_picker_field(
|
270 |
+
array(
|
271 |
+
'label' => __( 'Text Color', 'cartflows' ),
|
272 |
+
'name' => 'wcf-submit-color',
|
273 |
+
'value' => $options['wcf-submit-color'],
|
274 |
+
)
|
275 |
+
);
|
276 |
+
|
277 |
+
echo wcf()->meta->get_color_picker_field(
|
278 |
+
array(
|
279 |
+
'label' => __( 'Text Hover Color', 'cartflows' ),
|
280 |
+
'name' => 'wcf-submit-hover-color',
|
281 |
+
'value' => $options['wcf-submit-hover-color'],
|
282 |
+
)
|
283 |
+
);
|
284 |
+
|
285 |
+
echo wcf()->meta->get_color_picker_field(
|
286 |
+
array(
|
287 |
+
'label' => __( 'Background Color', 'cartflows' ),
|
288 |
+
'name' => 'wcf-submit-bg-color',
|
289 |
+
'value' => $options['wcf-submit-bg-color'],
|
290 |
+
)
|
291 |
+
);
|
292 |
+
|
293 |
+
echo wcf()->meta->get_color_picker_field(
|
294 |
+
array(
|
295 |
+
'label' => __( 'Background Hover Color', 'cartflows' ),
|
296 |
+
'name' => 'wcf-submit-bg-hover-color',
|
297 |
+
'value' => $options['wcf-submit-bg-hover-color'],
|
298 |
+
)
|
299 |
+
);
|
300 |
+
|
301 |
+
echo wcf()->meta->get_color_picker_field(
|
302 |
+
array(
|
303 |
+
'label' => __( 'Border Color', 'cartflows' ),
|
304 |
+
'name' => 'wcf-submit-border-color',
|
305 |
+
'value' => $options['wcf-submit-border-color'],
|
306 |
+
)
|
307 |
+
);
|
308 |
+
|
309 |
+
echo wcf()->meta->get_color_picker_field(
|
310 |
+
array(
|
311 |
+
'label' => __( 'Border Hover Color', 'cartflows' ),
|
312 |
+
'name' => 'wcf-submit-border-hover-color',
|
313 |
+
'value' => $options['wcf-submit-border-hover-color'],
|
314 |
+
)
|
315 |
+
);
|
316 |
+
|
317 |
+
?>
|
318 |
+
</div>
|
319 |
+
<div class="wcf-cs-section-options">
|
320 |
+
<?php
|
321 |
+
|
322 |
+
echo wcf()->meta->get_section(
|
323 |
+
array(
|
324 |
+
'label' => __( 'Sections', 'cartflows' ),
|
325 |
+
)
|
326 |
+
);
|
327 |
+
|
328 |
+
echo wcf()->meta->get_color_picker_field(
|
329 |
+
array(
|
330 |
+
'label' => __( 'Highlight Area Background Color', 'cartflows' ),
|
331 |
+
'name' => 'wcf-hl-bg-color',
|
332 |
+
'value' => $options['wcf-hl-bg-color'],
|
333 |
+
)
|
334 |
+
);
|
335 |
+
|
336 |
+
echo wcf()->meta->get_hidden_field(
|
337 |
+
array(
|
338 |
+
'name' => 'wcf-field-google-font-url',
|
339 |
+
'value' => $options['wcf-field-google-font-url'],
|
340 |
+
)
|
341 |
+
);
|
342 |
+
?>
|
343 |
+
</div>
|
344 |
+
<?php do_action( 'cartflows_checkout_style_tab_content', $options, $post_id ); ?>
|
345 |
+
</div>
|
346 |
+
</div>
|
347 |
+
<?php
|
modules/checkout/templates/embed/checkout-template-simple.php
CHANGED
@@ -20,9 +20,7 @@ if (
|
|
20 |
empty( $checkout_html ) ||
|
21 |
trim( $checkout_html ) == '<div class="woocommerce"></div>'
|
22 |
) {
|
23 |
-
|
24 |
do_action( 'cartflows_checkout_cart_empty', $checkout_id );
|
25 |
-
|
26 |
echo esc_html__( 'Your cart is currently empty.', 'cartflows' );
|
27 |
} else {
|
28 |
echo $checkout_html;
|
20 |
empty( $checkout_html ) ||
|
21 |
trim( $checkout_html ) == '<div class="woocommerce"></div>'
|
22 |
) {
|
|
|
23 |
do_action( 'cartflows_checkout_cart_empty', $checkout_id );
|
|
|
24 |
echo esc_html__( 'Your cart is currently empty.', 'cartflows' );
|
25 |
} else {
|
26 |
echo $checkout_html;
|
modules/elementor/classes/class-cartflows-elementor-editor.php
CHANGED
@@ -1,112 +1,112 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Elementor Editor Compatibility.
|
4 |
-
*
|
5 |
-
* @package CartFlows
|
6 |
-
*/
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Checkout Markup
|
10 |
-
*
|
11 |
-
* @since 1.0.0
|
12 |
-
*/
|
13 |
-
class Cartflows_Elementor_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 |
-
|
39 |
-
$this->elementor_editor_compatibility();
|
40 |
-
}
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Elementor editor compatibility.
|
44 |
-
*/
|
45 |
-
public function elementor_editor_compatibility() {
|
46 |
-
|
47 |
-
if ( ! empty( $_REQUEST['action'] ) && is_admin() ) { //phpcs:ignore
|
48 |
-
|
49 |
-
$current_post_id = false;
|
50 |
-
$elementor_ajax = false;
|
51 |
-
|
52 |
-
if ( 'elementor' === $_REQUEST['action'] && isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ) { //phpcs:ignore
|
53 |
-
$current_post_id = intval( $_GET['post'] ); //phpcs:ignore
|
54 |
-
}
|
55 |
-
|
56 |
-
if ( wp_doing_ajax() && 'elementor_ajax' === $_REQUEST['action'] && isset( $_REQUEST['editor_post_id'] ) && ! empty( $_REQUEST['editor_post_id'] ) ) { //phpcs:ignore
|
57 |
-
$current_post_id = intval( $_REQUEST['editor_post_id'] ); //phpcs:ignore
|
58 |
-
$elementor_ajax = true;
|
59 |
-
}
|
60 |
-
|
61 |
-
if ( $current_post_id ) { //phpcs:ignore
|
62 |
-
|
63 |
-
$current_post_type = get_post_type( $current_post_id );
|
64 |
-
|
65 |
-
if ( wcf()->utils->is_step_post_type( $current_post_type ) ) {
|
66 |
-
|
67 |
-
$cf_frontend = Cartflows_Frontend::get_instance();
|
68 |
-
|
69 |
-
/* Load woo templates from plugin */
|
70 |
-
add_filter( 'woocommerce_locate_template', array( $cf_frontend, 'override_woo_template' ), 20, 3 );
|
71 |
-
|
72 |
-
do_action( 'cartflows_elementor_editor_compatibility', $current_post_id, $elementor_ajax );
|
73 |
-
}
|
74 |
-
}
|
75 |
-
|
76 |
-
/* Compatibility without condition, just to add actions */
|
77 |
-
if ( 'elementor' === $_REQUEST['action'] || 'elementor_ajax' === $_REQUEST['action'] ) { //phpcs:ignore
|
78 |
-
|
79 |
-
add_action( 'cartflows_elementor_before_checkout_shortcode', array( $this, 'before_checkout_shortcode_actions' ) );
|
80 |
-
add_action( 'cartflows_elementor_before_optin_shortcode', array( $this, 'before_optin_shortcode_actions' ) );
|
81 |
-
|
82 |
-
/* Thank you filters */
|
83 |
-
add_filter( 'cartflows_show_demo_order_details', '__return_true' );
|
84 |
-
}
|
85 |
-
}
|
86 |
-
}
|
87 |
-
|
88 |
-
/**
|
89 |
-
* Before checkout shortcode actions.
|
90 |
-
*
|
91 |
-
* @param int $checkout_id checkout id.
|
92 |
-
*/
|
93 |
-
public function before_checkout_shortcode_actions( $checkout_id ) {
|
94 |
-
|
95 |
-
do_action( 'cartflows_checkout_before_shortcode', $checkout_id );
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Before optin shortcode actions.
|
100 |
-
*
|
101 |
-
* @param int $checkout_id checkout id.
|
102 |
-
*/
|
103 |
-
public function before_optin_shortcode_actions( $checkout_id ) {
|
104 |
-
|
105 |
-
do_action( 'cartflows_optin_before_shortcode', $checkout_id );
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Kicking this off by calling 'get_instance()' method
|
111 |
-
*/
|
112 |
-
Cartflows_Elementor_Editor::get_instance();
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Elementor Editor Compatibility.
|
4 |
+
*
|
5 |
+
* @package CartFlows
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Checkout Markup
|
10 |
+
*
|
11 |
+
* @since 1.0.0
|
12 |
+
*/
|
13 |
+
class Cartflows_Elementor_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 |
+
|
39 |
+
$this->elementor_editor_compatibility();
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Elementor editor compatibility.
|
44 |
+
*/
|
45 |
+
public function elementor_editor_compatibility() {
|
46 |
+
|
47 |
+
if ( ! empty( $_REQUEST['action'] ) && is_admin() ) { //phpcs:ignore
|
48 |
+
|
49 |
+
$current_post_id = false;
|
50 |
+
$elementor_ajax = false;
|
51 |
+
|
52 |
+
if ( 'elementor' === $_REQUEST['action'] && isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ) { //phpcs:ignore
|
53 |
+
$current_post_id = intval( $_GET['post'] ); //phpcs:ignore
|
54 |
+
}
|
55 |
+
|
56 |
+
if ( wp_doing_ajax() && 'elementor_ajax' === $_REQUEST['action'] && isset( $_REQUEST['editor_post_id'] ) && ! empty( $_REQUEST['editor_post_id'] ) ) { //phpcs:ignore
|
57 |
+
$current_post_id = intval( $_REQUEST['editor_post_id'] ); //phpcs:ignore
|
58 |
+
$elementor_ajax = true;
|
59 |
+
}
|
60 |
+
|
61 |
+
if ( $current_post_id ) { //phpcs:ignore
|
62 |
+
|
63 |
+
$current_post_type = get_post_type( $current_post_id );
|
64 |
+
|
65 |
+
if ( wcf()->utils->is_step_post_type( $current_post_type ) ) {
|
66 |
+
|
67 |
+
$cf_frontend = Cartflows_Frontend::get_instance();
|
68 |
+
|
69 |
+
/* Load woo templates from plugin */
|
70 |
+
add_filter( 'woocommerce_locate_template', array( $cf_frontend, 'override_woo_template' ), 20, 3 );
|
71 |
+
|
72 |
+
do_action( 'cartflows_elementor_editor_compatibility', $current_post_id, $elementor_ajax );
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
/* Compatibility without condition, just to add actions */
|
77 |
+
if ( 'elementor' === $_REQUEST['action'] || 'elementor_ajax' === $_REQUEST['action'] ) { //phpcs:ignore
|
78 |
+
|
79 |
+
add_action( 'cartflows_elementor_before_checkout_shortcode', array( $this, 'before_checkout_shortcode_actions' ) );
|
80 |
+
add_action( 'cartflows_elementor_before_optin_shortcode', array( $this, 'before_optin_shortcode_actions' ) );
|
81 |
+
|
82 |
+
/* Thank you filters */
|
83 |
+
add_filter( 'cartflows_show_demo_order_details', '__return_true' );
|
84 |
+
}
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Before checkout shortcode actions.
|
90 |
+
*
|
91 |
+
* @param int $checkout_id checkout id.
|
92 |
+
*/
|
93 |
+
public function before_checkout_shortcode_actions( $checkout_id ) {
|
94 |
+
|
95 |
+
do_action( 'cartflows_checkout_before_shortcode', $checkout_id );
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Before optin shortcode actions.
|
100 |
+
*
|
101 |
+
* @param int $checkout_id checkout id.
|
102 |
+
*/
|
103 |
+
public function before_optin_shortcode_actions( $checkout_id ) {
|
104 |
+
|
105 |
+
do_action( 'cartflows_optin_before_shortcode', $checkout_id );
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Kicking this off by calling 'get_instance()' method
|
111 |
+
*/
|
112 |
+
Cartflows_Elementor_Editor::get_instance();
|
modules/elementor/widgets/class-cartflows-el-checkout-form.php
CHANGED
@@ -826,9 +826,9 @@ class Cartflows_Checkout_Form extends Widget_Base {
|
|
826 |
'type' => Controls_Manager::COLOR,
|
827 |
'default' => '',
|
828 |
'selectors' => array(
|
829 |
-
'{{WRAPPER}} .wcf-embed-checkout-form .woocommerce-checkout
|
830 |
-
{{WRAPPER}} .wcf-embed-checkout-form .woocommerce-checkout
|
831 |
-
{{WRAPPER}} .wcf-embed-checkout-form .woocommerce-checkout
|
832 |
),
|
833 |
)
|
834 |
);
|
826 |
'type' => Controls_Manager::COLOR,
|
827 |
'default' => '',
|
828 |
'selectors' => array(
|
829 |
+
'{{WRAPPER}} .wcf-embed-checkout-form .woocommerce-checkout .wc_payment_methods,
|
830 |
+
{{WRAPPER}} .wcf-embed-checkout-form .woocommerce-checkout .wc_payment_methods label,
|
831 |
+
{{WRAPPER}} .wcf-embed-checkout-form .woocommerce-checkout .wc_payment_methods label a' => 'color: {{VALUE}};',
|
832 |
),
|
833 |
)
|
834 |
);
|
modules/elementor/widgets/class-cartflows-el-next-step-button.php
CHANGED
@@ -442,6 +442,25 @@ class CartFlows_Next_Step_Button extends Widget_Base {
|
|
442 |
)
|
443 |
);
|
444 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
445 |
$this->end_controls_tab();
|
446 |
|
447 |
$this->end_controls_tabs();
|
@@ -586,7 +605,7 @@ class CartFlows_Next_Step_Button extends Widget_Base {
|
|
586 |
|
587 |
<div class="cartflows-elementor__next-step-button">
|
588 |
<div class="cartflows-elementor__next-step-button-wrap">
|
589 |
-
<a href="?class=wcf-next-step" class="cartflows-elementor__next-step-button-link elementor-button elementor-button-link elementor-size-<?php echo $button_size; ?>">
|
590 |
|
591 |
<div class="cartflows-elementor__next-step-inner-wrap">
|
592 |
|
@@ -638,7 +657,7 @@ class CartFlows_Next_Step_Button extends Widget_Base {
|
|
638 |
#>
|
639 |
<div class="cartflows-elementor__next-step-button">
|
640 |
<div class="cartflows-elementor__next-step-button-wrap">
|
641 |
-
<a href="?class=wcf-next-step" class="cartflows-elementor__next-step-button-link elementor-button elementor-button-link elementor-size-{{ settings.button_size }}">
|
642 |
<div class="cartflows-elementor__next-step-inner-wrap">
|
643 |
<# render_icon('before_title_sub_title') #>
|
644 |
<span class="cartflows-elementor__next-step-button-content-wrap">
|
442 |
)
|
443 |
);
|
444 |
|
445 |
+
$this->add_control(
|
446 |
+
'border_hover_color',
|
447 |
+
array(
|
448 |
+
'label' => __( 'Border Hover Color', 'cartflows' ),
|
449 |
+
'type' => Controls_Manager::COLOR,
|
450 |
+
'selectors' => array(
|
451 |
+
'{{WRAPPER}} a.elementor-button:hover' => 'border-color: {{VALUE}};',
|
452 |
+
),
|
453 |
+
)
|
454 |
+
);
|
455 |
+
|
456 |
+
$this->add_control(
|
457 |
+
'hover_animation',
|
458 |
+
array(
|
459 |
+
'label' => __( 'Hover Animation', 'cartflows' ),
|
460 |
+
'type' => Controls_Manager::HOVER_ANIMATION,
|
461 |
+
)
|
462 |
+
);
|
463 |
+
|
464 |
$this->end_controls_tab();
|
465 |
|
466 |
$this->end_controls_tabs();
|
605 |
|
606 |
<div class="cartflows-elementor__next-step-button">
|
607 |
<div class="cartflows-elementor__next-step-button-wrap">
|
608 |
+
<a href="?class=wcf-next-step" class="cartflows-elementor__next-step-button-link elementor-button elementor-button-link elementor-size-<?php echo $button_size; ?> elementor-animation-<?php echo $settings['hover_animation']; ?>">
|
609 |
|
610 |
<div class="cartflows-elementor__next-step-inner-wrap">
|
611 |
|
657 |
#>
|
658 |
<div class="cartflows-elementor__next-step-button">
|
659 |
<div class="cartflows-elementor__next-step-button-wrap">
|
660 |
+
<a href="?class=wcf-next-step" class="cartflows-elementor__next-step-button-link elementor-button elementor-button-link elementor-size-{{ settings.button_size }} elementor-animation-{{ settings.hover_animation }}" >
|
661 |
<div class="cartflows-elementor__next-step-inner-wrap">
|
662 |
<# render_icon('before_title_sub_title') #>
|
663 |
<span class="cartflows-elementor__next-step-button-content-wrap">
|
modules/elementor/widgets/index.php
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Silence is golden.
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Silence is golden.
|
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/classes/class-cartflows-permalink.php
CHANGED
@@ -1,158 +1,165 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Step post type.
|
4 |
-
*
|
5 |
-
* @package CartFlows
|
6 |
-
*/
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Initialization
|
10 |
-
*
|
11 |
-
* @since 1.0.0
|
12 |
-
*/
|
13 |
-
class Cartflows_Permalink {
|
14 |
-
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Member Variable
|
18 |
-
*
|
19 |
-
* @var instance
|
20 |
-
*/
|
21 |
-
private static $instance;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Initiator
|
25 |
-
*/
|
26 |
-
public static function get_instance() {
|
27 |
-
if ( ! isset( self::$instance ) ) {
|
28 |
-
self::$instance = new self();
|
29 |
-
}
|
30 |
-
return self::$instance;
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Constructor
|
35 |
-
*/
|
36 |
-
public function __construct() {
|
37 |
-
|
38 |
-
add_filter( 'post_type_link', array( $this, 'post_type_permalinks' ), 10, 3 );
|
39 |
-
add_action( 'init', array( $this, 'rewrite_step_rule' ) );
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
*
|
49 |
-
*
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
case '/cartflows_flow/%flowname
|
99 |
-
add_rewrite_rule( '^' . $cf_permalink['permalink_flow_base'] . '/([^/]*)/([
|
100 |
-
break;
|
101 |
-
|
102 |
-
case '/%flowname
|
103 |
-
add_rewrite_rule( '
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
*
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
$
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Step post type.
|
4 |
+
*
|
5 |
+
* @package CartFlows
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Initialization
|
10 |
+
*
|
11 |
+
* @since 1.0.0
|
12 |
+
*/
|
13 |
+
class Cartflows_Permalink {
|
14 |
+
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Member Variable
|
18 |
+
*
|
19 |
+
* @var instance
|
20 |
+
*/
|
21 |
+
private static $instance;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Initiator
|
25 |
+
*/
|
26 |
+
public static function get_instance() {
|
27 |
+
if ( ! isset( self::$instance ) ) {
|
28 |
+
self::$instance = new self();
|
29 |
+
}
|
30 |
+
return self::$instance;
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Constructor
|
35 |
+
*/
|
36 |
+
public function __construct() {
|
37 |
+
|
38 |
+
add_filter( 'post_type_link', array( $this, 'post_type_permalinks' ), 10, 3 );
|
39 |
+
add_action( 'init', array( $this, 'rewrite_step_rule' ) );
|
40 |
+
|
41 |
+
if ( ! is_admin() ) {
|
42 |
+
|
43 |
+
add_action( 'pre_get_posts', array( $this, 'add_cpt_post_names_to_main_query' ), 20 );
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Modify permalink
|
49 |
+
*
|
50 |
+
* @param string $post_link post link.
|
51 |
+
* @param array $post post data.
|
52 |
+
* @param string $leavename leave name.
|
53 |
+
* @return string
|
54 |
+
*/
|
55 |
+
public function post_type_permalinks( $post_link, $post, $leavename ) {
|
56 |
+
|
57 |
+
if ( isset( $post->post_type ) && CARTFLOWS_STEP_POST_TYPE == $post->post_type ) {
|
58 |
+
|
59 |
+
$flow_id = get_post_meta( $post->ID, 'wcf-flow-id', true );
|
60 |
+
$flow_name = get_post_field( 'post_name', $flow_id );
|
61 |
+
$cf_permalink = Cartflows_Helper::get_permalink_settings();
|
62 |
+
|
63 |
+
if ( isset( $cf_permalink['permalink_structure'] ) && ! empty( $cf_permalink['permalink_structure'] ) ) {
|
64 |
+
|
65 |
+
$sep = '/';
|
66 |
+
$search = array( $sep . 'cartflows_flow', $sep . '%flowname%', $sep . 'cartflows_step' );
|
67 |
+
$replace = array( $sep . $cf_permalink['permalink_flow_base'], $sep . $flow_name, $sep . $cf_permalink['permalink'] );
|
68 |
+
$post_link = str_replace( $search, $replace, $post_link );
|
69 |
+
} else {
|
70 |
+
|
71 |
+
// If elementor page preview, return post link as it is.
|
72 |
+
if ( isset( $_REQUEST['elementor-preview'] ) ) { //phpcs:ignore
|
73 |
+
return $post_link;
|
74 |
+
}
|
75 |
+
|
76 |
+
$structure = get_option( 'permalink_structure' );
|
77 |
+
|
78 |
+
if ( '/%postname%/' === $structure ) {
|
79 |
+
|
80 |
+
$post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
|
81 |
+
|
82 |
+
}
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
return $post_link;
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Reqrite rules for acrtflows step.
|
91 |
+
*/
|
92 |
+
public function rewrite_step_rule() {
|
93 |
+
|
94 |
+
$cf_permalink = Cartflows_Helper::get_permalink_settings();
|
95 |
+
|
96 |
+
if ( isset( $cf_permalink['permalink_structure'] ) ) {
|
97 |
+
switch ( $cf_permalink['permalink_structure'] ) {
|
98 |
+
case '/cartflows_flow/%flowname%/cartflows_step':
|
99 |
+
add_rewrite_rule( '^' . $cf_permalink['permalink_flow_base'] . '/([^/]*)/' . $cf_permalink['permalink'] . '/([^\/]*)/?', 'index.php?cartflows_step=$matches[2]', 'top' );
|
100 |
+
break;
|
101 |
+
|
102 |
+
case '/cartflows_flow/%flowname%':
|
103 |
+
add_rewrite_rule( '^' . $cf_permalink['permalink_flow_base'] . '/([^/]*)/([^/]*)/?', 'index.php?cartflows_step=$matches[2]', 'top' );
|
104 |
+
break;
|
105 |
+
|
106 |
+
case '/%flowname%/cartflows_step':
|
107 |
+
add_rewrite_rule( '([^/]*)/' . $cf_permalink['permalink'] . '/([^\/]*)/?', 'index.php?cartflows_step=$matches[2]', 'top' );
|
108 |
+
|
109 |
+
break;
|
110 |
+
|
111 |
+
default:
|
112 |
+
break;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Have WordPress match postname to any of our public post types.
|
120 |
+
* All of our public post types can have /post-name/ as the slug, so they need to be unique across all posts.
|
121 |
+
* By default, WordPress only accounts for posts and pages where the slug is /post-name/.
|
122 |
+
*
|
123 |
+
* @param string $query query statement.
|
124 |
+
*/
|
125 |
+
public function add_cpt_post_names_to_main_query( $query ) {
|
126 |
+
|
127 |
+
// Bail if this is not the main query.
|
128 |
+
if ( ! $query->is_main_query() ) {
|
129 |
+
return;
|
130 |
+
}
|
131 |
+
|
132 |
+
// Bail if this query doesn't match our very specific rewrite rule.
|
133 |
+
if ( ! isset( $query->query['thrive-variations'] )
|
134 |
+
&& ! isset( $query->query['page'] )
|
135 |
+
&& ! isset( $query->query_vars['page_id'] )
|
136 |
+
) {
|
137 |
+
return;
|
138 |
+
}
|
139 |
+
|
140 |
+
// Bail if we're not querying based on the post name.
|
141 |
+
if ( empty( $query->query['name'] ) && empty( $query->query_vars['page_id'] ) ) {
|
142 |
+
return;
|
143 |
+
}
|
144 |
+
|
145 |
+
// Add cartflows step post type to existing post type array.
|
146 |
+
if ( isset( $query->query_vars['post_type'] ) && is_array( $query->query_vars['post_type'] ) ) {
|
147 |
+
|
148 |
+
$post_types = $query->query_vars['post_type'];
|
149 |
+
|
150 |
+
$post_types[] = CARTFLOWS_STEP_POST_TYPE;
|
151 |
+
|
152 |
+
$query->set( 'post_type', $post_types );
|
153 |
+
|
154 |
+
} else {
|
155 |
+
|
156 |
+
// Add CPT to the list of post types WP will include when it queries based on the post name.
|
157 |
+
$query->set( 'post_type', array( 'post', 'page', CARTFLOWS_STEP_POST_TYPE ) );
|
158 |
+
}
|
159 |
+
}
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Kicking this off by calling 'get_instance()' method
|
164 |
+
*/
|
165 |
+
Cartflows_Permalink::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-flow-inner-step.php
CHANGED
@@ -1,129 +1,129 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* View flow inner step
|
4 |
-
*
|
5 |
-
* @package CartFlows
|
6 |
-
*/
|
7 |
-
|
8 |
-
$inner_step_title = get_the_title( $inner_step_id );
|
9 |
-
$note = get_post_meta( $inner_step_id, 'wcf-step-note', true );
|
10 |
-
?>
|
11 |
-
<div class="wcf-step">
|
12 |
-
<div class="wcf-step-left-content">
|
13 |
-
<span class="dashicons dashicons-menu"></span>
|
14 |
-
<span title="<?php echo esc_attr( $inner_step_title ); ?>"><?php echo wp_trim_words( $inner_step_title, 3 ); ?></span>
|
15 |
-
<?php
|
16 |
-
if ( $ab_test && ! empty( $note ) ) {
|
17 |
-
?>
|
18 |
-
<span class="dashicons dashicons-editor-help" id="wcf-tooltip">
|
19 |
-
<span class="wcf-ab-test-note-badge"><?php echo $note; ?></span>
|
20 |
-
</span>
|
21 |
-
<?php
|
22 |
-
}
|
23 |
-
|
24 |
-
|
25 |
-
?>
|
26 |
-
<?php
|
27 |
-
if ( $ab_test_ui ) {
|
28 |
-
if ( $control_id === $inner_step_id ) {
|
29 |
-
?>
|
30 |
-
<span class="wcf-step-badge wcf-abtest-control-badge"><?php esc_html_e( 'Control', 'cartflows' ); ?></span>
|
31 |
-
<?php } else { ?>
|
32 |
-
<span class="wcf-step-badge wcf-abtest-variation-badge"><?php /* translators: %s badge count */ echo esc_html( sprintf( __( 'Variation-%s', 'cartflows' ), ++$var_badge_count ) ); ?></span>
|
33 |
-
<?php
|
34 |
-
}
|
35 |
-
}
|
36 |
-
?>
|
37 |
-
|
38 |
-
<span class="wcf-flow-badge"><?php echo esc_html( $term_name ); ?></span>
|
39 |
-
|
40 |
-
<?php
|
41 |
-
|
42 |
-
if ( ( ! $has_product_assigned ) && ( $control_id !== $is_global_checkout ) ) {
|
43 |
-
?>
|
44 |
-
<span class="wcf-no-product-badge"><?php esc_html_e( 'No Product Assigned', 'cartflows' ); ?></span>
|
45 |
-
<?php
|
46 |
-
} elseif ( ( $has_product_assigned ) && ( $control_id === $is_global_checkout ) ) {
|
47 |
-
?>
|
48 |
-
<span class="wcf-global-checkout-badge wcf-error-badge"><?php esc_html_e( 'Global Checkout - Remove selected checkout product', 'cartflows' ); ?></span>
|
49 |
-
<?php
|
50 |
-
} elseif ( ( ! $has_product_assigned ) && $control_id === $is_global_checkout ) {
|
51 |
-
?>
|
52 |
-
<span class="wcf-global-checkout-badge"><?php esc_html_e( 'Global Checkout', 'cartflows' ); ?></span>
|
53 |
-
<?php
|
54 |
-
}
|
55 |
-
|
56 |
-
?>
|
57 |
-
|
58 |
-
<?php if ( $control_id === $inner_step_id ) { ?>
|
59 |
-
<input type="hidden" class="wcf-steps-hidden" name="wcf-steps[]" value="<?php echo $inner_step_id; ?>">
|
60 |
-
<?php } ?>
|
61 |
-
<?php do_action( 'cartflows_step_left_content', $inner_step_id, $term_slug ); ?>
|
62 |
-
</div>
|
63 |
-
|
64 |
-
<!-- popup for setting -->
|
65 |
-
<div id="wcf-edit-dropdown" class="wcf-edit-content" >
|
66 |
-
|
67 |
-
|
68 |
-
<?php foreach ( $action_buttons as $action_slug => $action_data ) { ?>
|
69 |
-
<?php
|
70 |
-
|
71 |
-
if ( 'view' === $action_slug || 'edit' === $action_slug ) {
|
72 |
-
continue;
|
73 |
-
}
|
74 |
-
|
75 |
-
if ( $ab_test_ui ) {
|
76 |
-
|
77 |
-
if ( 'ab-test' === $action_slug ) {
|
78 |
-
continue;
|
79 |
-
}
|
80 |
-
} else {
|
81 |
-
|
82 |
-
if ( isset( $action_data['ab-test'] ) ) {
|
83 |
-
continue;
|
84 |
-
}
|
85 |
-
}
|
86 |
-
|
87 |
-
|
88 |
-
$action_attr = ' ';
|
89 |
-
if ( isset( $action_data['attr'] ) && is_array( $action_data['attr'] ) ) {
|
90 |
-
foreach ( $action_data['attr'] as $attr_key => $attr_value ) {
|
91 |
-
$action_attr .= $attr_key . '="' . $attr_value . '"';
|
92 |
-
}
|
93 |
-
}
|
94 |
-
$style = '';
|
95 |
-
if ( ! $action_data['show'] ) {
|
96 |
-
$style = 'opacity: 0.65; cursor: not-allowed;';
|
97 |
-
$action_data['label'] .= ' ( Pro )';
|
98 |
-
$action_data['tooltip'] = 'Upgrade to Pro for this feature.';
|
99 |
-
$action_data['class'] .= ' wcf-pro';
|
100 |
-
}
|
101 |
-
?>
|
102 |
-
<a href="<?php echo $action_data['link']; ?>" style ="<?php echo $style; ?>" class="<?php echo $action_data['class']; ?>" title="<?php echo $action_data['tooltip']; ?>" <?php echo $action_attr; ?>>
|
103 |
-
<span class="dashicons <?php echo $action_data['icon']; ?>"></span>
|
104 |
-
<span class="wcf-step-act-btn-text"><?php echo $action_data['label']; ?></span>
|
105 |
-
</a>
|
106 |
-
<?php } ?>
|
107 |
-
|
108 |
-
</div>
|
109 |
-
|
110 |
-
<!-- popup for setting -->
|
111 |
-
|
112 |
-
<div class="wcf-steps-action-buttons">
|
113 |
-
<div class="wcf-basic-action-buttons">
|
114 |
-
<?php
|
115 |
-
foreach ( $action_buttons as $action_slug => $action_data ) {
|
116 |
-
if ( 'view' === $action_slug || 'edit' === $action_slug ) {
|
117 |
-
?>
|
118 |
-
<a href="<?php echo $action_data['link']; ?>" class="<?php echo $action_data['class']; ?>" title="<?php echo $action_data['tooltip']; ?>" <?php echo $action_attr; ?>>
|
119 |
-
<span class="dashicons <?php echo $action_data['icon']; ?>"></span>
|
120 |
-
<span class="wcf-step-act-btn-text"><?php echo $action_data['label']; ?></span>
|
121 |
-
</a>
|
122 |
-
<?php
|
123 |
-
}
|
124 |
-
}
|
125 |
-
?>
|
126 |
-
</div>
|
127 |
-
<div class="wcf-edit-settings"></div>
|
128 |
-
</div>
|
129 |
-
</div>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* View flow inner step
|
4 |
+
*
|
5 |
+
* @package CartFlows
|
6 |
+
*/
|
7 |
+
|
8 |
+
$inner_step_title = get_the_title( $inner_step_id );
|
9 |
+
$note = get_post_meta( $inner_step_id, 'wcf-step-note', true );
|
10 |
+
?>
|
11 |
+
<div class="wcf-step">
|
12 |
+
<div class="wcf-step-left-content">
|
13 |
+
<span class="dashicons dashicons-menu"></span>
|
14 |
+
<span title="<?php echo esc_attr( $inner_step_title ); ?>"><?php echo wp_trim_words( $inner_step_title, 3 ); ?></span>
|
15 |
+
<?php
|
16 |
+
if ( $ab_test && ! empty( $note ) ) {
|
17 |
+
?>
|
18 |
+
<span class="dashicons dashicons-editor-help" id="wcf-tooltip">
|
19 |
+
<span class="wcf-ab-test-note-badge"><?php echo $note; ?></span>
|
20 |
+
</span>
|
21 |
+
<?php
|
22 |
+
}
|
23 |
+
|
24 |
+
|
25 |
+
?>
|
26 |
+
<?php
|
27 |
+
if ( $ab_test_ui ) {
|
28 |
+
if ( $control_id === $inner_step_id ) {
|
29 |
+
?>
|
30 |
+
<span class="wcf-step-badge wcf-abtest-control-badge"><?php esc_html_e( 'Control', 'cartflows' ); ?></span>
|
31 |
+
<?php } else { ?>
|
32 |
+
<span class="wcf-step-badge wcf-abtest-variation-badge"><?php /* translators: %s badge count */ echo esc_html( sprintf( __( 'Variation-%s', 'cartflows' ), ++$var_badge_count ) ); ?></span>
|
33 |
+
<?php
|
34 |
+
}
|
35 |
+
}
|
36 |
+
?>
|
37 |
+
|
38 |
+
<span class="wcf-flow-badge"><?php echo esc_html( $term_name ); ?></span>
|
39 |
+
|
40 |
+
<?php
|
41 |
+
|
42 |
+
if ( ( ! $has_product_assigned ) && ( $control_id !== $is_global_checkout ) ) {
|
43 |
+
?>
|
44 |
+
<span class="wcf-no-product-badge"><?php esc_html_e( 'No Product Assigned', 'cartflows' ); ?></span>
|
45 |
+
<?php
|
46 |
+
} elseif ( ( $has_product_assigned ) && ( $control_id === $is_global_checkout ) ) {
|
47 |
+
?>
|
48 |
+
<span class="wcf-global-checkout-badge wcf-error-badge"><?php esc_html_e( 'Global Checkout - Remove selected checkout product', 'cartflows' ); ?></span>
|
49 |
+
<?php
|
50 |
+
} elseif ( ( ! $has_product_assigned ) && $control_id === $is_global_checkout ) {
|
51 |
+
?>
|
52 |
+
<span class="wcf-global-checkout-badge"><?php esc_html_e( 'Global Checkout', 'cartflows' ); ?></span>
|
53 |
+
<?php
|
54 |
+
}
|
55 |
+
|
56 |
+
?>
|
57 |
+
|
58 |
+
<?php if ( $control_id === $inner_step_id ) { ?>
|
59 |
+
<input type="hidden" class="wcf-steps-hidden" name="wcf-steps[]" value="<?php echo $inner_step_id; ?>">
|
60 |
+
<?php } ?>
|
61 |
+
<?php do_action( 'cartflows_step_left_content', $inner_step_id, $term_slug ); ?>
|
62 |
+
</div>
|
63 |
+
|
64 |
+
<!-- popup for setting -->
|
65 |
+
<div id="wcf-edit-dropdown" class="wcf-edit-content" >
|
66 |
+
|
67 |
+
|
68 |
+
<?php foreach ( $action_buttons as $action_slug => $action_data ) { ?>
|
69 |
+
<?php
|
70 |
+
|
71 |
+
if ( 'view' === $action_slug || 'edit' === $action_slug ) {
|
72 |
+
continue;
|
73 |
+
}
|
74 |
+
|
75 |
+
if ( $ab_test_ui ) {
|
76 |
+
|
77 |
+
if ( 'ab-test' === $action_slug ) {
|
78 |
+
continue;
|
79 |
+
}
|
80 |
+
} else {
|
81 |
+
|
82 |
+
if ( isset( $action_data['ab-test'] ) ) {
|
83 |
+
continue;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
|
88 |
+
$action_attr = ' ';
|
89 |
+
if ( isset( $action_data['attr'] ) && is_array( $action_data['attr'] ) ) {
|
90 |
+
foreach ( $action_data['attr'] as $attr_key => $attr_value ) {
|
91 |
+
$action_attr .= $attr_key . '="' . $attr_value . '"';
|
92 |
+
}
|
93 |
+
}
|
94 |
+
$style = '';
|
95 |
+
if ( ! $action_data['show'] ) {
|
96 |
+
$style = 'opacity: 0.65; cursor: not-allowed;';
|
97 |
+
$action_data['label'] .= ' ( Pro )';
|
98 |
+
$action_data['tooltip'] = 'Upgrade to Pro for this feature.';
|
99 |
+
$action_data['class'] .= ' wcf-pro';
|
100 |
+
}
|
101 |
+
?>
|
102 |
+
<a href="<?php echo $action_data['link']; ?>" style ="<?php echo $style; ?>" class="<?php echo $action_data['class']; ?>" title="<?php echo $action_data['tooltip']; ?>" <?php echo $action_attr; ?>>
|
103 |
+
<span class="dashicons <?php echo $action_data['icon']; ?>"></span>
|
104 |
+
<span class="wcf-step-act-btn-text"><?php echo $action_data['label']; ?></span>
|
105 |
+
</a>
|
106 |
+
<?php } ?>
|
107 |
+
|
108 |
+
</div>
|
109 |
+
|
110 |
+
<!-- popup for setting -->
|
111 |
+
|
112 |
+
<div class="wcf-steps-action-buttons">
|
113 |
+
<div class="wcf-basic-action-buttons">
|
114 |
+
<?php
|
115 |
+
foreach ( $action_buttons as $action_slug => $action_data ) {
|
116 |
+
if ( 'view' === $action_slug || 'edit' === $action_slug ) {
|
117 |
+
?>
|
118 |
+
<a href="<?php echo $action_data['link']; ?>" class="<?php echo $action_data['class']; ?>" title="<?php echo $action_data['tooltip']; ?>" <?php echo $action_attr; ?>>
|
119 |
+
<span class="dashicons <?php echo $action_data['icon']; ?>"></span>
|
120 |
+
<span class="wcf-step-act-btn-text"><?php echo $action_data['label']; ?></span>
|
121 |
+
</a>
|
122 |
+
<?php
|
123 |
+
}
|
124 |
+
}
|
125 |
+
?>
|
126 |
+
</div>
|
127 |
+
<div class="wcf-edit-settings"></div>
|
128 |
+
</div>
|
129 |
+
</div>
|
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/gutenberg/assets/css/blocks/checkout-form.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.wcf-gb-checkout-form{margin-bottom:25px}
|
modules/gutenberg/assets/css/blocks/next-step-button.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.wp-block-wcfb-next-step-button{margin-bottom:25px}.wp-block-wcfb-next-step-button .wpcf__next-step-button-link{display:inline-flex;text-decoration:none}.wp-block-wcfb-next-step-button .wpcf__next-step-button-link .wpcf__next-step-button-content-wrap .wpcf__next-step-button-title-wrap{display:inline-flex}.wp-block-wcfb-next-step-button .wpcf__next-step-button-link .wpcf__next-step-button-title{align-self:center}.wp-block-wcfb-next-step-button .wpcf__next-step-button-link .wpcf__next-step-button-icon{display:flex;align-self:center}
|
modules/gutenberg/assets/css/blocks/optin-form.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.wpcf__optin-form{margin-bottom:25px}
|
modules/gutenberg/assets/css/blocks/order-detail-form.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.wpcf__order-detail-form{margin-bottom:25px}.wpcf__order-detail-form .woocommerce-order-details table.shop_table,.woocommerce-order-downloads table.shop_table{background-color:unset}
|
modules/gutenberg/classes/class-cartflows-block-config.php
ADDED
@@ -0,0 +1,528 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Cartflows Config.
|
4 |
+
*
|
5 |
+
* @package Cartflows
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit; // Exit if accessed directly.
|
10 |
+
}
|
11 |
+
|
12 |
+
if ( ! class_exists( 'Cartflows_Block_Config' ) ) {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Class Cartflows_Block_Config.
|
16 |
+
*/
|
17 |
+
class Cartflows_Block_Config {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Block Attributes
|
21 |
+
*
|
22 |
+
* @var block_attributes
|
23 |
+
*/
|
24 |
+
public static $block_attributes = null;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Block Assets
|
28 |
+
*
|
29 |
+
* @var block_attributes
|
30 |
+
*/
|
31 |
+
public static $block_assets = null;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Get Widget List.
|
35 |
+
*
|
36 |
+
* @since x.x.x
|
37 |
+
*
|
38 |
+
* @return array The Widget List.
|
39 |
+
*/
|
40 |
+
public static function get_block_attributes() {
|
41 |
+
|
42 |
+
if ( null === self::$block_attributes ) {
|
43 |
+
self::$block_attributes = array(
|
44 |
+
'wcfb/next-step-button' => array(
|
45 |
+
'slug' => '',
|
46 |
+
'title' => __( 'Next Step Button', 'cartflows' ),
|
47 |
+
'description' => '',
|
48 |
+
'default' => true,
|
49 |
+
'attributes' => array(
|
50 |
+
'classMigrate' => false,
|
51 |
+
'borderStyle' => 'solid',
|
52 |
+
'align' => 'center',
|
53 |
+
'malign' => 'center',
|
54 |
+
'talign' => 'center',
|
55 |
+
'titletextTransform' => 'none',
|
56 |
+
'subtitletextTransform' => 'none',
|
57 |
+
'letterSpacing' => '',
|
58 |
+
'borderWidth' => '1',
|
59 |
+
'borderColor' => '#abb8c3',
|
60 |
+
'borderHoverColor' => '#abb8c3',
|
61 |
+
'borderRadius' => '4',
|
62 |
+
'buttonColor' => '#abb8c3',
|
63 |
+
'buttonHoverColor' => '#abb8c3',
|
64 |
+
'paddingTypeDesktop' => 'px',
|
65 |
+
'paddingTypeTablet' => 'px',
|
66 |
+
'paddingTypeMobile' => 'px',
|
67 |
+
'vPaddingDesktop' => '5',
|
68 |
+
'hPaddingDesktop' => '30',
|
69 |
+
'vPaddingTablet' => '5',
|
70 |
+
'hPaddingTablet' => '30',
|
71 |
+
'vPaddingMobile' => '5',
|
72 |
+
'hPaddingMobile' => '30',
|
73 |
+
'textAlignment' => 'center',
|
74 |
+
'textColor' => '#ffffff',
|
75 |
+
'textHoverColor' => '#ffffff',
|
76 |
+
'titleFontFamily' => '',
|
77 |
+
'titleFontSize' => '20',
|
78 |
+
'titleFontWeight' => '500',
|
79 |
+
'titleFontSizeType' => 'px',
|
80 |
+
'titleFontSizeTablet' => '',
|
81 |
+
'titleFontSizeMobile' => '',
|
82 |
+
'titleLineHeightType' => 'em',
|
83 |
+
'titleLineHeight' => '',
|
84 |
+
'titleLineHeightTablet' => '',
|
85 |
+
'titleLineHeightMobile' => '',
|
86 |
+
'subTitleFontFamily' => '',
|
87 |
+
'subTitleFontWeight' => '500',
|
88 |
+
'subTitleFontSize' => '20',
|
89 |
+
'subTitleFontSizeType' => 'px',
|
90 |
+
'subTitleFontSizeTablet' => '',
|
91 |
+
'subTitleFontSizeMobile' => '',
|
92 |
+
'subTitleLineHeightType' => 'em',
|
93 |
+
'subTitleLineHeight' => '',
|
94 |
+
'subTitleLineHeightTablet' => '',
|
95 |
+
'subTitleLineHeightMobile' => '',
|
96 |
+
'titleletterSpacing' => '',
|
97 |
+
'subtitleletterSpacing' => '',
|
98 |
+
'titleBottomSpacing' => '0',
|
99 |
+
'iconSize' => '20',
|
100 |
+
'iconSpacing' => '10',
|
101 |
+
'iconColor' => '',
|
102 |
+
'iconHoverColor' => '',
|
103 |
+
'iconPosition' => 'before_title',
|
104 |
+
'backgroundType' => 'none',
|
105 |
+
'backgroundImage' => '',
|
106 |
+
'backgroundPosition' => 'center-center',
|
107 |
+
'backgroundSize' => 'cover',
|
108 |
+
'backgroundRepeat' => 'no-repeat',
|
109 |
+
'backgroundAttachment' => 'scroll',
|
110 |
+
'backgroundColor' => '#abb8c3',
|
111 |
+
'gradientColor1' => '#abb8c3',
|
112 |
+
'gradientColor2' => '#abb8c3',
|
113 |
+
'gradientType' => 'linear',
|
114 |
+
'gradientLocation1' => '0',
|
115 |
+
'gradientLocation2' => '100',
|
116 |
+
'gradientAngle' => '0',
|
117 |
+
'gradientPosition' => 'center center',
|
118 |
+
'backgroundOpacity' => 100,
|
119 |
+
'backgroundImageColor' => '#abb8c3',
|
120 |
+
'gradientValue' => '',
|
121 |
+
),
|
122 |
+
),
|
123 |
+
'wcfb/order-detail-form' => array(
|
124 |
+
'slug' => '',
|
125 |
+
'title' => __( 'Order Details Form', 'cartflows' ),
|
126 |
+
'description' => '',
|
127 |
+
'default' => true,
|
128 |
+
'attributes' => array(
|
129 |
+
'classMigrate' => false,
|
130 |
+
'align' => 'center',
|
131 |
+
// Genaral.
|
132 |
+
'orderOverview' => true,
|
133 |
+
'orderDetails' => true,
|
134 |
+
'billingAddress' => true,
|
135 |
+
'shippingAddress' => true,
|
136 |
+
// Spacing.
|
137 |
+
'headingBottomSpacing' => '',
|
138 |
+
'sectionSpacing' => '',
|
139 |
+
// Heading.
|
140 |
+
'thanyouText' => 'center',
|
141 |
+
'headingAlignment' => 'center',
|
142 |
+
'headingColor' => '',
|
143 |
+
'headingFontFamily' => '',
|
144 |
+
'headingFontWeight' => '',
|
145 |
+
'headingFontSize' => '',
|
146 |
+
'headingFontSizeType' => 'px',
|
147 |
+
'headingFontSizeTablet' => '',
|
148 |
+
'headingFontSizeMobile' => '',
|
149 |
+
'headingLineHeightType' => 'em',
|
150 |
+
'headingLineHeight' => '',
|
151 |
+
'headingLineHeightTablet' => '',
|
152 |
+
'headingLineHeightMobile' => '',
|
153 |
+
// Sections.
|
154 |
+
'sectionHeadingColor' => '',
|
155 |
+
'sectionHeadingFontFamily' => '',
|
156 |
+
'sectionHeadingFontWeight' => '',
|
157 |
+
'sectionHeadingFontSize' => '',
|
158 |
+
'sectionHeadingFontSizeType' => 'px',
|
159 |
+
'sectionHeadingFontSizeTablet' => '',
|
160 |
+
'sectionHeadingFontSizeMobile' => '',
|
161 |
+
'sectionHeadingLineHeightType' => '',
|
162 |
+
'sectionHeadingLineHeight' => 'em',
|
163 |
+
'sectionHeadingLineHeightTablet' => '',
|
164 |
+
'sectionHeadingLineHeightMobile' => '',
|
165 |
+
'sectionContentColor' => '',
|
166 |
+
'sectionContentFontFamily' => '',
|
167 |
+
'sectionContentFontWeight' => '',
|
168 |
+
'sectionContentFontSize' => '',
|
169 |
+
'sectionContentFontSizeType' => 'px',
|
170 |
+
'sectionContentFontSizeTablet' => '',
|
171 |
+
'sectionContentFontSizeMobile' => '',
|
172 |
+
'sectionContentLineHeightType' => 'em',
|
173 |
+
'sectionContentLineHeight' => '',
|
174 |
+
'sectionContentLineHeightTablet' => '',
|
175 |
+
'sectionContentLineHeightMobile' => '',
|
176 |
+
'sectionBackgroundColor' => '',
|
177 |
+
// Order Overview.
|
178 |
+
'orderOverviewTextColor' => '',
|
179 |
+
'orderOverviewBackgroundColor' => '',
|
180 |
+
'orderOverviewFontFamily' => '',
|
181 |
+
'orderOverviewFontWeight' => '',
|
182 |
+
'orderOverviewFontSize' => '',
|
183 |
+
'orderOverviewFontSizeType' => 'px',
|
184 |
+
'orderOverviewFontSizeTablet' => '',
|
185 |
+
'orderOverviewFontSizeMobile' => '',
|
186 |
+
'orderOverviewLineHeightType' => 'em',
|
187 |
+
'orderOverviewLineHeight' => '',
|
188 |
+
'orderOverviewLineHeightTablet' => '',
|
189 |
+
'orderOverviewLineHeightMobile' => '',
|
190 |
+
// Downloads.
|
191 |
+
'downloadHeadingColor' => '',
|
192 |
+
'downloadHeadingFontFamily' => '',
|
193 |
+
'downloadHeadingFontWeight' => '',
|
194 |
+
'downloadHeadingFontSize' => '',
|
195 |
+
'downloadHeadingFontSizeType' => 'px',
|
196 |
+
'downloadHeadingFontSizeTablet' => '',
|
197 |
+
'downloadHeadingFontSizeMobile' => '',
|
198 |
+
'downloadHeadingLineHeightType' => 'em',
|
199 |
+
'downloadHeadingLineHeight' => '',
|
200 |
+
'downloadHeadingLineHeightTablet' => '',
|
201 |
+
'downloadHeadingLineHeightMobile' => '',
|
202 |
+
'downloadContentColor' => '',
|
203 |
+
'downloadContentFontFamily' => '',
|
204 |
+
'downloadContentFontWeight' => '',
|
205 |
+
'downloadContentFontSize' => '',
|
206 |
+
'downloadContentFontSizeType' => 'px',
|
207 |
+
'downloadContentFontSizeTablet' => '',
|
208 |
+
'downloadContentFontSizeMobile' => '',
|
209 |
+
'downloadContentLineHeightType' => 'em',
|
210 |
+
'downloadContentLineHeight' => '',
|
211 |
+
'downloadContentLineHeightTablet' => '',
|
212 |
+
'downloadContentLineHeightMobile' => '',
|
213 |
+
'downloadBackgroundColor' => '',
|
214 |
+
// Order Details.
|
215 |
+
'orderDetailHeadingColor' => '',
|
216 |
+
'orderDetailHeadingFontFamily' => '',
|
217 |
+
'orderDetailHeadingFontWeight' => '',
|
218 |
+
'orderDetailHeadingFontSize' => '',
|
219 |
+
'orderDetailHeadingFontSizeType' => 'px',
|
220 |
+
'orderDetailHeadingFontSizeTablet' => '',
|
221 |
+
'orderDetailHeadingFontSizeMobile' => '',
|
222 |
+
'orderDetailHeadingLineHeightType' => 'em',
|
223 |
+
'orderDetailHeadingLineHeight' => '',
|
224 |
+
'orderDetailHeadingLineHeightTablet' => '',
|
225 |
+
'orderDetailHeadingLineHeightMobile' => '',
|
226 |
+
'orderDetailContentColor' => '',
|
227 |
+
'orderDetailContentFontFamily' => '',
|
228 |
+
'orderDetailContentFontWeight' => '',
|
229 |
+
'orderDetailContentFontSize' => '',
|
230 |
+
'orderDetailContentFontSizeType' => 'px',
|
231 |
+
'orderDetailContentFontSizeTablet' => '',
|
232 |
+
'orderDetailContentFontSizeMobile' => '',
|
233 |
+
'orderDetailContentLineHeightType' => 'em',
|
234 |
+
'orderDetailContentLineHeight' => '',
|
235 |
+
'orderDetailContentLineHeightTablet' => '',
|
236 |
+
'orderDetailContentLineHeightMobile' => '',
|
237 |
+
'orderDetailBackgroundColor' => '',
|
238 |
+
// Customer Details.
|
239 |
+
'customerDetailHeadingColor' => '',
|
240 |
+
'customerDetailHeadingFontFamily' => '',
|
241 |
+
'customerDetailHeadingFontWeight' => '',
|
242 |
+
'customerDetailHeadingFontSize' => '',
|
243 |
+
'customerDetailHeadingFontSizeType' => 'px',
|
244 |
+
'customerDetailHeadingFontSizeTablet' => '',
|
245 |
+
'customerDetailHeadingFontSizeMobile' => '',
|
246 |
+
'customerDetailHeadingLineHeightType' => 'em',
|
247 |
+
'customerDetailHeadingLineHeight' => '',
|
248 |
+
'customerDetailHeadingLineHeightTablet' => '',
|
249 |
+
'customerDetailHeadingLineHeightMobile' => '',
|
250 |
+
'customerDetailContentColor' => '',
|
251 |
+
'customerDetailContentFontFamily' => '',
|
252 |
+
'customerDetailContentFontWeight' => '',
|
253 |
+
'customerDetailContentFontSize' => '',
|
254 |
+
'customerDetailContentFontSizeType' => 'px',
|
255 |
+
'customerDetailContentFontSizeTablet' => '',
|
256 |
+
'customerDetailContentFontSizeMobile' => '',
|
257 |
+
'customerDetailContentLineHeightType' => 'em',
|
258 |
+
'customerDetailContentLineHeight' => '',
|
259 |
+
'customerDetailContentLineHeightTablet' => '',
|
260 |
+
'customerDetailContentLineHeightMobile' => '',
|
261 |
+
'customerDetailBackgroundColor' => '',
|
262 |
+
'backgroundType' => 'none',
|
263 |
+
'backgroundImage' => '',
|
264 |
+
'backgroundPosition' => 'center-center',
|
265 |
+
'backgroundSize' => 'cover',
|
266 |
+
'backgroundRepeat' => 'no-repeat',
|
267 |
+
'backgroundAttachment' => 'scroll',
|
268 |
+
'backgroundColor' => '',
|
269 |
+
'backgroundOpacity' => 100,
|
270 |
+
'backgroundImageColor' => '#abb8c3',
|
271 |
+
'odbackgroundType' => 'none',
|
272 |
+
'odbackgroundImage' => '',
|
273 |
+
'odbackgroundPosition' => 'center-center',
|
274 |
+
'odbackgroundSize' => 'cover',
|
275 |
+
'odbackgroundRepeat' => 'no-repeat',
|
276 |
+
'odbackgroundAttachment' => 'scroll',
|
277 |
+
'odbackgroundColor' => '',
|
278 |
+
'odbackgroundOpacity' => 100,
|
279 |
+
'odbackgroundImageColor' => '#abb8c3',
|
280 |
+
'dbackgroundType' => 'none',
|
281 |
+
'dbackgroundImage' => '',
|
282 |
+
'dbackgroundPosition' => 'center-center',
|
283 |
+
'dbackgroundSize' => 'cover',
|
284 |
+
'dbackgroundRepeat' => 'no-repeat',
|
285 |
+
'dbackgroundAttachment' => 'scroll',
|
286 |
+
'dbackgroundColor' => '',
|
287 |
+
'dbackgroundOpacity' => 100,
|
288 |
+
'dbackgroundImageColor' => '#abb8c3',
|
289 |
+
'odetailbackgroundType' => 'none',
|
290 |
+
'odetailbackgroundImage' => '',
|
291 |
+
'odetailbackgroundPosition' => 'center-center',
|
292 |
+
'odetailbackgroundSize' => 'cover',
|
293 |
+
'odetailbackgroundRepeat' => 'no-repeat',
|
294 |
+
'odetailbackgroundAttachment' => 'scroll',
|
295 |
+
'odetailbackgroundColor' => '',
|
296 |
+
'odetailbackgroundOpacity' => 100,
|
297 |
+
'odetailbackgroundImageColor' => '#abb8c3',
|
298 |
+
'cdetailbackgroundType' => 'none',
|
299 |
+
'cdetailbackgroundImage' => '',
|
300 |
+
'cdetailbackgroundPosition' => 'center-center',
|
301 |
+
'cdetailbackgroundSize' => 'cover',
|
302 |
+
'cdetailbackgroundRepeat' => 'no-repeat',
|
303 |
+
'cdetailbackgroundAttachment' => 'scroll',
|
304 |
+
'cdetailbackgroundColor' => '',
|
305 |
+
'cdetailsbackgroundOpacity' => 100,
|
306 |
+
'cdetailsbackgroundImageColor' => '#abb8c3',
|
307 |
+
),
|
308 |
+
),
|
309 |
+
'wcfb/checkout-form' => array(
|
310 |
+
'slug' => '',
|
311 |
+
'title' => __( 'Checkout Form', 'cartflows' ),
|
312 |
+
'description' => '',
|
313 |
+
'default' => true,
|
314 |
+
'is_active' => class_exists( 'Cartflows_Checkout_Markup' ),
|
315 |
+
'attributes' => array(
|
316 |
+
'block_id' => '',
|
317 |
+
'boxShadowColor' => '',
|
318 |
+
'boxShadowHOffset' => 0,
|
319 |
+
'boxShadowVOffset' => 0,
|
320 |
+
'boxShadowBlur' => 0,
|
321 |
+
'boxShadowSpread' => 0,
|
322 |
+
'boxShadowPosition' => 'outset',
|
323 |
+
'headBgColor' => '',
|
324 |
+
'fieldHrPadding' => '',
|
325 |
+
'fieldVrPadding' => '',
|
326 |
+
'fieldBgColor' => '',
|
327 |
+
'fieldLabelColor' => '',
|
328 |
+
'fieldInputColor' => '',
|
329 |
+
'fieldBorderStyle' => 'solid',
|
330 |
+
'fieldBorderWidth' => 1,
|
331 |
+
'fieldBorderRadius' => 0,
|
332 |
+
'fieldBorderColor' => '#eeeeee',
|
333 |
+
'fieldBorderFocusColor' => '',
|
334 |
+
'buttonAlignment' => 'left',
|
335 |
+
'buttonVrPadding' => '',
|
336 |
+
'buttonHrPadding' => '',
|
337 |
+
'buttonTextColor' => '',
|
338 |
+
'buttonBgColor' => '',
|
339 |
+
'buttonTextHoverColor' => '',
|
340 |
+
'buttonBgHoverColor' => '',
|
341 |
+
'buttonBorderStyle' => 'inherit',
|
342 |
+
'buttonBorderWidth' => '',
|
343 |
+
'buttonBorderRadius' => '',
|
344 |
+
'buttonBorderColor' => '',
|
345 |
+
'buttonBorderHoverColor' => '',
|
346 |
+
'fieldSpacing' => '',
|
347 |
+
'fieldLabelSpacing' => '',
|
348 |
+
'inputFontSize' => '',
|
349 |
+
'inputFontSizeType' => 'px',
|
350 |
+
'inputFontSizeTablet' => '',
|
351 |
+
'inputFontSizeMobile' => '',
|
352 |
+
'inputFontFamily' => 'Default',
|
353 |
+
'inputFontWeight' => '',
|
354 |
+
'inputFontSubset' => '',
|
355 |
+
'inputLineHeightType' => 'px',
|
356 |
+
'inputLineHeight' => '',
|
357 |
+
'inputLineHeightTablet' => '',
|
358 |
+
'inputLineHeightMobile' => '',
|
359 |
+
'inputLoadGoogleFonts' => false,
|
360 |
+
'submitButtonText' => '',
|
361 |
+
'buttonFontSize' => '',
|
362 |
+
'buttonFontSizeType' => 'px',
|
363 |
+
'buttonFontSizeTablet' => '',
|
364 |
+
'buttonFontSizeMobile' => '',
|
365 |
+
'buttonFontFamily' => 'Default',
|
366 |
+
'buttonFontWeight' => '',
|
367 |
+
'buttonFontSubset' => '',
|
368 |
+
'buttonLineHeightType' => 'px',
|
369 |
+
'buttonLineHeight' => '',
|
370 |
+
'buttonLineHeightTablet' => '',
|
371 |
+
'buttonLineHeightMobile' => '',
|
372 |
+
'buttonLoadGoogleFonts' => false,
|
373 |
+
'errorMsgColor' => '',
|
374 |
+
'errorMsgBgColor' => '',
|
375 |
+
'errorMsgBorderColor' => '',
|
376 |
+
'msgBorderSize' => '',
|
377 |
+
'msgBorderRadius' => '',
|
378 |
+
'msgVrPadding' => 10,
|
379 |
+
'msgHrPadding' => 10,
|
380 |
+
'msgBorderRadiusType' => 'px',
|
381 |
+
'fieldBorderRadiusType' => 'px',
|
382 |
+
'buttonBorderRadiusType' => 'px',
|
383 |
+
'paymentdescriptionColor' => '',
|
384 |
+
'paymenttitleColor' => '',
|
385 |
+
'sectionbgColor' => '',
|
386 |
+
'informationbgColor' => '',
|
387 |
+
'sectionhrPadding' => '',
|
388 |
+
'sectionvrPadding' => '',
|
389 |
+
'sectionhrMargin' => '',
|
390 |
+
'sectionvrMargin' => '',
|
391 |
+
'sectionBorderRadius' => '',
|
392 |
+
'headFontSize' => '',
|
393 |
+
'headFontSizeType' => 'px',
|
394 |
+
'headFontSizeTablet' => '',
|
395 |
+
'headFontSizeMobile' => '',
|
396 |
+
'headFontFamily' => 'Default',
|
397 |
+
'headFontWeight' => '',
|
398 |
+
'headFontSubset' => '',
|
399 |
+
'headLineHeightType' => 'px',
|
400 |
+
'headLineHeight' => '',
|
401 |
+
'headLineHeightTablet' => '',
|
402 |
+
'headLineHeightMobile' => '',
|
403 |
+
'headLoadGoogleFonts' => '',
|
404 |
+
'globaltextColor' => '',
|
405 |
+
'globalbgColor' => '',
|
406 |
+
'globalFontSize' => '',
|
407 |
+
'globalFontSizeType' => 'px',
|
408 |
+
'globalFontSizeTablet' => '',
|
409 |
+
'globalFontSizeMobile' => '',
|
410 |
+
'globalFontFamily' => 'Default',
|
411 |
+
'globalFontWeight' => '',
|
412 |
+
'globalFontSubset' => '',
|
413 |
+
'globalLineHeightType' => 'px',
|
414 |
+
'globalLineHeight' => '',
|
415 |
+
'globalLineHeightTablet' => '',
|
416 |
+
'globalLineHeightMobile' => '',
|
417 |
+
'globalLoadGoogleFonts' => false,
|
418 |
+
'backgroundType' => 'color',
|
419 |
+
'backgroundImage' => '',
|
420 |
+
'backgroundPosition' => 'center-center',
|
421 |
+
'backgroundSize' => 'cover',
|
422 |
+
'backgroundRepeat' => 'no-repeat',
|
423 |
+
'backgroundAttachment' => 'scroll',
|
424 |
+
'backgroundColor' => '',
|
425 |
+
'backgroundHoverColor' => '',
|
426 |
+
'gradientColor1' => '#abb8c3',
|
427 |
+
'gradientColor2' => '#abb8c3',
|
428 |
+
'gradientType' => 'linear',
|
429 |
+
'gradientLocation1' => '0',
|
430 |
+
'gradientLocation2' => '100',
|
431 |
+
'gradientAngle' => '0',
|
432 |
+
'gradientPosition' => 'center center',
|
433 |
+
'backgroundOpacity' => 100,
|
434 |
+
'backgroundImageColor' => '#abb8c3',
|
435 |
+
'gradientValue' => '',
|
436 |
+
'errorLabelColor' => '',
|
437 |
+
'errorFieldBorderColor' => '',
|
438 |
+
),
|
439 |
+
),
|
440 |
+
'wcfb/optin-form' => array(
|
441 |
+
'slug' => '',
|
442 |
+
'title' => __( 'Optin Form', 'cartflows' ),
|
443 |
+
'description' => '',
|
444 |
+
'default' => true,
|
445 |
+
'attributes' => array(
|
446 |
+
'block_id' => '',
|
447 |
+
'classMigrate' => false,
|
448 |
+
// General.
|
449 |
+
'generalPrimaryColor' => '',
|
450 |
+
'generalFontFamily' => '',
|
451 |
+
'generalFontWeight' => '',
|
452 |
+
'generalFontSize' => '',
|
453 |
+
'generalFontSizeType' => 'px',
|
454 |
+
'generalFontSizeTablet' => '',
|
455 |
+
'generalFontSizeMobile' => '',
|
456 |
+
'generalLineHeightType' => 'em',
|
457 |
+
'generalLineHeight' => '',
|
458 |
+
'generalLineHeightTablet' => '',
|
459 |
+
'generalLineHeightMobile' => '',
|
460 |
+
// Input Fields.
|
461 |
+
'inputFieldFontFamily' => '',
|
462 |
+
'inputFieldFontWeight' => '',
|
463 |
+
'inputFieldFontSize' => '',
|
464 |
+
'inputFieldFontSizeType' => 'px',
|
465 |
+
'inputFieldFontSizeTablet' => '',
|
466 |
+
'inputFieldFontSizeMobile' => '',
|
467 |
+
'inputFieldLineHeightType' => 'em',
|
468 |
+
'inputFieldLineHeight' => '',
|
469 |
+
'inputFieldLineHeightTablet' => '',
|
470 |
+
'inputFieldLineHeightMobile' => '',
|
471 |
+
'inputFieldLabelColor' => '',
|
472 |
+
'inputFieldBackgroundColor' => '',
|
473 |
+
'inputFieldTextPlaceholderColor' => '',
|
474 |
+
'inputFieldBorderStyle' => '',
|
475 |
+
'inputFieldBorderWidth' => '',
|
476 |
+
'inputFieldBorderRadius' => '',
|
477 |
+
'inputFieldBorderColor' => '',
|
478 |
+
// Submit Button.
|
479 |
+
'submitButtonFontFamily' => '',
|
480 |
+
'submitButtonFontWeight' => '',
|
481 |
+
'submitButtonFontSize' => '',
|
482 |
+
'submitButtonFontSizeType' => 'px',
|
483 |
+
'submitButtonFontSizeTablet' => '',
|
484 |
+
'submitButtonFontSizeMobile' => '',
|
485 |
+
'submitButtonLineHeightType' => 'em',
|
486 |
+
'submitButtonLineHeight' => '',
|
487 |
+
'submitButtonLineHeightTablet' => '',
|
488 |
+
'submitButtonLineHeightMobile' => '',
|
489 |
+
'submitButtonTextColor' => '',
|
490 |
+
'submitButtonBackgroundColor' => '',
|
491 |
+
'submitButtonTextHoverColor' => '',
|
492 |
+
'submitButtonBackgroundHoverColor' => '',
|
493 |
+
'submitButtonBorderStyle' => '',
|
494 |
+
'submitButtonBorderWidth' => '',
|
495 |
+
'submitButtonBorderRadius' => '',
|
496 |
+
'submitButtonBorderColor' => '',
|
497 |
+
'submitButtonBorderHoverColor' => '',
|
498 |
+
'boxShadowColor' => '',
|
499 |
+
'boxShadowHOffset' => 0,
|
500 |
+
'boxShadowVOffset' => 0,
|
501 |
+
'boxShadowBlur' => 0,
|
502 |
+
'boxShadowSpread' => 0,
|
503 |
+
'boxShadowPosition' => 'outset',
|
504 |
+
|
505 |
+
),
|
506 |
+
),
|
507 |
+
|
508 |
+
);
|
509 |
+
}
|
510 |
+
return self::$block_attributes;
|
511 |
+
}
|
512 |
+
|
513 |
+
/**
|
514 |
+
* Get Block Assets.
|
515 |
+
*
|
516 |
+
* @since x.x.x
|
517 |
+
*
|
518 |
+
* @return array The Asset List.
|
519 |
+
*/
|
520 |
+
public static function get_block_assets() {
|
521 |
+
|
522 |
+
if ( null === self::$block_assets ) {
|
523 |
+
self::$block_assets = array();
|
524 |
+
}
|
525 |
+
return self::$block_assets;
|
526 |
+
}
|
527 |
+
}
|
528 |
+
}
|
modules/gutenberg/classes/class-cartflows-block-helper.php
ADDED
@@ -0,0 +1,672 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Cartflows Block Helper.
|
4 |
+
*
|
5 |
+
* @package Cartflows
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit; // Exit if accessed directly.
|
10 |
+
}
|
11 |
+
|
12 |
+
if ( ! class_exists( 'Cartflows_Block_Helper' ) ) {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Class Cartflows_Block_Helper.
|
16 |
+
*/
|
17 |
+
class Cartflows_Block_Helper {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Get Next Step Button CSS
|
21 |
+
*
|
22 |
+
* @since x.x.x
|
23 |
+
* @param array $attr The block attributes.
|
24 |
+
* @param string $id The selector ID.
|
25 |
+
* @return array The Widget List.
|
26 |
+
*/
|
27 |
+
public static function get_next_step_button_css( $attr, $id ) {
|
28 |
+
|
29 |
+
$defaults = Cartflows_Gb_Helper::$block_list['wcfb/next-step-button']['attributes'];
|
30 |
+
|
31 |
+
$attr = array_merge( $defaults, (array) $attr );
|
32 |
+
|
33 |
+
$bg_type = ( isset( $attr['backgroundType'] ) ) ? $attr['backgroundType'] : 'none';
|
34 |
+
$overlay_type = ( isset( $attr['overlayType'] ) ) ? $attr['overlayType'] : 'none';
|
35 |
+
|
36 |
+
$m_selectors = array();
|
37 |
+
$t_selectors = array();
|
38 |
+
|
39 |
+
$selectors = array(
|
40 |
+
|
41 |
+
' .wpcf__next-step-button-wrap' => array(
|
42 |
+
'text-align' => $attr['align'],
|
43 |
+
),
|
44 |
+
' .wpcf__next-step-button-link' => array(
|
45 |
+
'text-align' => $attr['textAlignment'],
|
46 |
+
'color' => $attr['textColor'],
|
47 |
+
'background-color' => $attr['backgroundColor'],
|
48 |
+
'border-style' => $attr['borderStyle'],
|
49 |
+
'border-color' => $attr['borderColor'],
|
50 |
+
'border-width' => Cartflows_Gb_Helper::get_css_value( $attr['borderWidth'], 'px' ),
|
51 |
+
'border-radius' => Cartflows_Gb_Helper::get_css_value( $attr['borderRadius'], 'px' ),
|
52 |
+
'padding-top' => Cartflows_Gb_Helper::get_css_value( $attr['vPaddingDesktop'], $attr['paddingTypeDesktop'] ),
|
53 |
+
'padding-bottom' => Cartflows_Gb_Helper::get_css_value( $attr['vPaddingDesktop'], $attr['paddingTypeDesktop'] ),
|
54 |
+
'padding-left' => Cartflows_Gb_Helper::get_css_value( $attr['hPaddingDesktop'], $attr['paddingTypeDesktop'] ),
|
55 |
+
'padding-right' => Cartflows_Gb_Helper::get_css_value( $attr['hPaddingDesktop'], $attr['paddingTypeDesktop'] ),
|
56 |
+
),
|
57 |
+
' .wpcf__next-step-button-link:hover' => array(
|
58 |
+
'background-color' => $attr['buttonHoverColor'],
|
59 |
+
'color' => $attr['textHoverColor'],
|
60 |
+
'border-color' => $attr['borderHoverColor'],
|
61 |
+
),
|
62 |
+
' .wpcf__next-step-button-link .wpcf__next-step-button-content-wrap .wpcf__next-step-button-title-wrap' => array(
|
63 |
+
'text-transform' => $attr['titletextTransform'],
|
64 |
+
'letter-spacing' => Cartflows_Gb_Helper::get_css_value( $attr['titleletterSpacing'], 'px' ),
|
65 |
+
),
|
66 |
+
' .wpcf__next-step-button-link .wpcf__next-step-button-content-wrap .wpcf__next-step-button-sub-title' => array(
|
67 |
+
'margin-top' => Cartflows_Gb_Helper::get_css_value( $attr['titleBottomSpacing'], 'px' ),
|
68 |
+
'text-transform' => $attr['subtitletextTransform'],
|
69 |
+
'letter-spacing' => Cartflows_Gb_Helper::get_css_value( $attr['subtitleletterSpacing'], 'px' ),
|
70 |
+
),
|
71 |
+
' .wpcf__next-step-button-icon svg' => array(
|
72 |
+
'width' => Cartflows_Gb_Helper::get_css_value( $attr['iconSize'], 'px' ),
|
73 |
+
'height' => Cartflows_Gb_Helper::get_css_value( $attr['iconSize'], 'px' ),
|
74 |
+
'fill' => $attr['iconColor'],
|
75 |
+
),
|
76 |
+
' .wpcf__next-step-button-link:hover .wpcf__next-step-button-icon svg' => array(
|
77 |
+
'fill' => $attr['iconHoverColor'],
|
78 |
+
),
|
79 |
+
);
|
80 |
+
if ( 'full' === $attr['align'] ) {
|
81 |
+
$selectors[' a.wpcf__next-step-button-link'] = array(
|
82 |
+
'width' => '100%',
|
83 |
+
'justify-content' => 'center',
|
84 |
+
);
|
85 |
+
}
|
86 |
+
if ( 'color' == $bg_type ) {
|
87 |
+
$selectors[' .wpcf__next-step-button-link'] = array(
|
88 |
+
'opacity' => ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : '',
|
89 |
+
);
|
90 |
+
}
|
91 |
+
|
92 |
+
if ( 'gradient' == $bg_type ) {
|
93 |
+
$selectors[' .wpcf__next-step-button-link'] = array(
|
94 |
+
'border-style' => $attr['borderStyle'],
|
95 |
+
'border-color' => $attr['borderColor'],
|
96 |
+
'border-width' => Cartflows_Gb_Helper::get_css_value( $attr['borderWidth'], 'px' ),
|
97 |
+
'border-radius' => Cartflows_Gb_Helper::get_css_value( $attr['borderRadius'], 'px' ),
|
98 |
+
'padding-top' => Cartflows_Gb_Helper::get_css_value( $attr['vPaddingDesktop'], $attr['paddingTypeDesktop'] ),
|
99 |
+
'padding-bottom' => Cartflows_Gb_Helper::get_css_value( $attr['vPaddingDesktop'], $attr['paddingTypeDesktop'] ),
|
100 |
+
'padding-left' => Cartflows_Gb_Helper::get_css_value( $attr['hPaddingDesktop'], $attr['paddingTypeDesktop'] ),
|
101 |
+
'padding-right' => Cartflows_Gb_Helper::get_css_value( $attr['hPaddingDesktop'], $attr['paddingTypeDesktop'] ),
|
102 |
+
'color' => $attr['textColor'],
|
103 |
+
);
|
104 |
+
}
|
105 |
+
|
106 |
+
$position = str_replace( '-', ' ', $attr['backgroundPosition'] );
|
107 |
+
|
108 |
+
if ( 'image' == $bg_type ) {
|
109 |
+
$selectors[' .wpcf__next-step-button-link'] = array(
|
110 |
+
'opacity' => ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : 0,
|
111 |
+
'background-color' => $attr['backgroundImageColor'],
|
112 |
+
'border-style' => $attr['borderStyle'],
|
113 |
+
'border-color' => $attr['borderColor'],
|
114 |
+
'border-width' => Cartflows_Gb_Helper::get_css_value( $attr['borderWidth'], 'px' ),
|
115 |
+
'border-radius' => Cartflows_Gb_Helper::get_css_value( $attr['borderRadius'], 'px' ),
|
116 |
+
'padding-top' => Cartflows_Gb_Helper::get_css_value( $attr['vPaddingDesktop'], $attr['paddingTypeDesktop'] ),
|
117 |
+
'padding-bottom' => Cartflows_Gb_Helper::get_css_value( $attr['vPaddingDesktop'], $attr['paddingTypeDesktop'] ),
|
118 |
+
'padding-left' => Cartflows_Gb_Helper::get_css_value( $attr['hPaddingDesktop'], $attr['paddingTypeDesktop'] ),
|
119 |
+
'padding-right' => Cartflows_Gb_Helper::get_css_value( $attr['hPaddingDesktop'], $attr['paddingTypeDesktop'] ),
|
120 |
+
'color' => $attr['textColor'],
|
121 |
+
'background-image' => ( isset( $attr['backgroundImage'] ) && isset( $attr['backgroundImage']['url'] ) ) ? "url('" . $attr['backgroundImage']['url'] . "' )" : null,
|
122 |
+
'background-position' => $position,
|
123 |
+
'background-attachment' => $attr['backgroundAttachment'],
|
124 |
+
'background-repeat' => $attr['backgroundRepeat'],
|
125 |
+
'background-size' => $attr['backgroundSize'],
|
126 |
+
);
|
127 |
+
} elseif ( 'gradient' === $bg_type ) {
|
128 |
+
|
129 |
+
$selectors[' .wpcf__next-step-button-link']['background-color'] = 'transparent';
|
130 |
+
$selectors[' .wpcf__next-step-button-link']['opacity'] = ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : '';
|
131 |
+
if ( $attr['gradientValue'] ) {
|
132 |
+
$selectors[' .wpcf__next-step-button-link']['background-image'] = $attr['gradientValue'];
|
133 |
+
|
134 |
+
} else {
|
135 |
+
if ( 'linear' === $attr['gradientType'] ) {
|
136 |
+
|
137 |
+
$selectors[' .wpcf__next-step-button-link']['background-image'] = "linear-gradient(${ $attr['gradientAngle'] }deg, ${ $attr['gradientColor1'] } ${ $attr['gradientLocation1'] }%, ${ $attr['gradientColor2'] } ${ $attr['gradientLocation2'] }%)";
|
138 |
+
} else {
|
139 |
+
|
140 |
+
$selectors[' .wpcf__next-step-button-link']['background-image'] = "radial-gradient( at ${ $attr['gradientPosition'] }, ${ $attr['gradientColor1'] } ${ $attr['gradientLocation1'] }%, ${ $attr['gradientColor2'] } ${ $attr['gradientLocation2'] }%)";
|
141 |
+
}
|
142 |
+
}
|
143 |
+
}
|
144 |
+
|
145 |
+
$margin_type = ( 'after_title' === $attr['iconPosition'] || 'after_title_sub_title' === $attr['iconPosition'] ) ? 'margin-left' : 'margin-right';
|
146 |
+
|
147 |
+
$selectors[' .wpcf__next-step-button-icon svg'][ $margin_type ] = Cartflows_Gb_Helper::get_css_value( $attr['iconSpacing'], 'px' );
|
148 |
+
|
149 |
+
$t_selectors = array(
|
150 |
+
' .wpcf__next-step-button-wrap' => array(
|
151 |
+
'text-align' => $attr['talign'],
|
152 |
+
),
|
153 |
+
' .wpcf__next-step-button-link' => array(
|
154 |
+
'padding-top' => Cartflows_Gb_Helper::get_css_value( $attr['vPaddingTablet'], $attr['paddingTypeTablet'] ),
|
155 |
+
'padding-bottom' => Cartflows_Gb_Helper::get_css_value( $attr['vPaddingTablet'], $attr['paddingTypeTablet'] ),
|
156 |
+
'padding-left' => Cartflows_Gb_Helper::get_css_value( $attr['hPaddingTablet'], $attr['paddingTypeTablet'] ),
|
157 |
+
'padding-right' => Cartflows_Gb_Helper::get_css_value( $attr['hPaddingTablet'], $attr['paddingTypeTablet'] ),
|
158 |
+
),
|
159 |
+
);
|
160 |
+
|
161 |
+
$m_selectors = array(
|
162 |
+
' .wpcf__next-step-button-wrap' => array(
|
163 |
+
'text-align' => $attr['malign'],
|
164 |
+
),
|
165 |
+
' .wpcf__next-step-button-link' => array(
|
166 |
+
'padding-top' => Cartflows_Gb_Helper::get_css_value( $attr['vPaddingMobile'], $attr['paddingTypeMobile'] ),
|
167 |
+
'padding-bottom' => Cartflows_Gb_Helper::get_css_value( $attr['vPaddingMobile'], $attr['paddingTypeMobile'] ),
|
168 |
+
'padding-left' => Cartflows_Gb_Helper::get_css_value( $attr['hPaddingMobile'], $attr['paddingTypeMobile'] ),
|
169 |
+
'padding-right' => Cartflows_Gb_Helper::get_css_value( $attr['hPaddingMobile'], $attr['paddingTypeMobile'] ),
|
170 |
+
),
|
171 |
+
);
|
172 |
+
|
173 |
+
$combined_selectors = array(
|
174 |
+
'desktop' => $selectors,
|
175 |
+
'tablet' => $t_selectors,
|
176 |
+
'mobile' => $m_selectors,
|
177 |
+
);
|
178 |
+
|
179 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'title', ' .wpcf__next-step-button-link .wpcf__next-step-button-content-wrap .wpcf__next-step-button-title-wrap', $combined_selectors );
|
180 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'subTitle', ' .wpcf__next-step-button-link .wpcf__next-step-button-content-wrap .wpcf__next-step-button-sub-title', $combined_selectors );
|
181 |
+
|
182 |
+
return Cartflows_Gb_Helper::generate_all_css( $combined_selectors, ' .cf-block-' . $id );
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Get Order Detail Form Block CSS
|
187 |
+
*
|
188 |
+
* @since x.x.x
|
189 |
+
* @param array $attr The block attributes.
|
190 |
+
* @param string $id The selector ID.
|
191 |
+
* @return array The Widget List.
|
192 |
+
*/
|
193 |
+
public static function get_order_detail_form_css( $attr, $id ) {
|
194 |
+
|
195 |
+
$defaults = Cartflows_Gb_Helper::$block_list['wcfb/order-detail-form']['attributes'];
|
196 |
+
$bg_type = ( isset( $attr['backgroundType'] ) ) ? $attr['backgroundType'] : 'none';
|
197 |
+
$overlay_type = ( isset( $attr['overlayType'] ) ) ? $attr['overlayType'] : 'none';
|
198 |
+
|
199 |
+
$attr = array_merge( $defaults, $attr );
|
200 |
+
|
201 |
+
$t_selectors = array();
|
202 |
+
$m_selectors = array();
|
203 |
+
$selectors = array();
|
204 |
+
|
205 |
+
$order_overview = ( $attr['orderOverview'] ) ? 'block' : 'none';
|
206 |
+
$order_details = ( $attr['orderDetails'] ) ? 'block' : 'none';
|
207 |
+
$billing_address = ( $attr['billingAddress'] ) ? 'block' : 'none';
|
208 |
+
$shipping_address = ( $attr['shippingAddress'] ) ? 'block' : 'none';
|
209 |
+
$shipping_address_position = ( $attr['billingAddress'] ) ? 'right' : 'left';
|
210 |
+
$customer_details = ( $attr['billingAddress'] || $attr['shippingAddress'] ) ? 'block' : 'none';
|
211 |
+
|
212 |
+
$selectors = array(
|
213 |
+
// Genaral.
|
214 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order ul.order_details' => array(
|
215 |
+
'display' => $order_overview,
|
216 |
+
),
|
217 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order section.woocommerce-order-details' => array(
|
218 |
+
'display' => $order_details,
|
219 |
+
),
|
220 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details .woocommerce-column--billing-address' => array(
|
221 |
+
'display' => $billing_address,
|
222 |
+
),
|
223 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details .woocommerce-column--shipping-address' => array(
|
224 |
+
'display' => $shipping_address,
|
225 |
+
'float' => $shipping_address_position,
|
226 |
+
),
|
227 |
+
// Spacing.
|
228 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order p.woocommerce-thankyou-order-received' => array(
|
229 |
+
'margin-bottom' => Cartflows_Gb_Helper::get_css_value( $attr['headingBottomSpacing'], 'px' ),
|
230 |
+
),
|
231 |
+
' .wpcf__order-detail-form .woocommerce-order ul.order_details, .wpcf__order-detail-form .woocommerce-order .woocommerce-customer-details, .wpcf__order-detail-form .woocommerce-order .woocommerce-order-details, .wpcf__order-detail-form .woocommerce-order .woocommerce-order-downloads, .wpcf__order-detail-form .woocommerce-order .woocommerce-bacs-bank-details, .wpcf__order-detail-form .woocommerce-order-details.mollie-instructions' => array(
|
232 |
+
'margin-bottom' => Cartflows_Gb_Helper::get_css_value( $attr['sectionSpacing'], 'px' ),
|
233 |
+
),
|
234 |
+
// Heading.
|
235 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-thankyou-order-received' => array(
|
236 |
+
'text-align' => $attr['headingAlignment'],
|
237 |
+
'color' => $attr['headingColor'],
|
238 |
+
),
|
239 |
+
// Sections.
|
240 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order h2' => array(
|
241 |
+
'color' => $attr['sectionHeadingColor'],
|
242 |
+
),
|
243 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order, .wpcf__order-detail-form .woocommerce-order-downloads table.shop_table' => array(
|
244 |
+
'color' => $attr['sectionContentColor'],
|
245 |
+
),
|
246 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-overview.woocommerce-thankyou-order-details.order_details, .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details, .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details, .wpcf__order-detail-form .woocommerce-order-downloads' => array(
|
247 |
+
'background-color' => $attr['sectionBackgroundColor'],
|
248 |
+
),
|
249 |
+
// Order Overview.
|
250 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-overview.woocommerce-thankyou-order-details.order_details' => array(
|
251 |
+
'color' => $attr['orderOverviewTextColor'],
|
252 |
+
'background-color' => $attr['orderOverviewBackgroundColor'],
|
253 |
+
),
|
254 |
+
// Downloads.
|
255 |
+
' .wpcf__order-detail-form .woocommerce-order h2.woocommerce-order-downloads__title, .wpcf__order-detail-form .woocommerce-order .woocommerce-order-downloads h2.woocommerce-order-downloads__title' => array(
|
256 |
+
'color' => $attr['downloadHeadingColor'],
|
257 |
+
),
|
258 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-downloads table.shop_table' => array(
|
259 |
+
'color' => $attr['downloadContentColor'],
|
260 |
+
),
|
261 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-downloads' => array(
|
262 |
+
'background-color' => $attr['downloadBackgroundColor'],
|
263 |
+
),
|
264 |
+
// Order Details.
|
265 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details .woocommerce-order-details__title' => array(
|
266 |
+
'color' => $attr['orderDetailHeadingColor'],
|
267 |
+
),
|
268 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details .woocommerce-table' => array(
|
269 |
+
'color' => $attr['orderDetailContentColor'],
|
270 |
+
),
|
271 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details' => array(
|
272 |
+
'background-color' => $attr['orderDetailBackgroundColor'],
|
273 |
+
),
|
274 |
+
// Customer Details.
|
275 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details .woocommerce-column__title' => array(
|
276 |
+
'color' => $attr['customerDetailHeadingColor'],
|
277 |
+
),
|
278 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details address' => array(
|
279 |
+
'color' => $attr['customerDetailContentColor'],
|
280 |
+
),
|
281 |
+
' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details' => array(
|
282 |
+
'background-color' => $attr['customerDetailBackgroundColor'],
|
283 |
+
'display' => $customer_details,
|
284 |
+
),
|
285 |
+
|
286 |
+
);
|
287 |
+
|
288 |
+
$selectors[' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-overview.woocommerce-thankyou-order-details.order_details, .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details, .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details, .wpcf__order-detail-form .woocommerce-order-downloads'] = array(
|
289 |
+
'opacity' => ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : '',
|
290 |
+
'background-color' => $attr['backgroundColor'],
|
291 |
+
);
|
292 |
+
|
293 |
+
$position = str_replace( '-', ' ', $attr['backgroundPosition'] );
|
294 |
+
|
295 |
+
if ( 'image' == $bg_type ) {
|
296 |
+
$selectors[' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-overview.woocommerce-thankyou-order-details.order_details, .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details, .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details, .wpcf__order-detail-form .woocommerce-order-downloads'] = array(
|
297 |
+
'opacity' => ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : 0,
|
298 |
+
'background-color' => $attr['backgroundImageColor'],
|
299 |
+
'background-image' => ( isset( $attr['backgroundImage'] ) && isset( $attr['backgroundImage']['url'] ) ) ? "url('" . $attr['backgroundImage']['url'] . "' )" : null,
|
300 |
+
'background-position' => $position,
|
301 |
+
'background-attachment' => $attr['backgroundAttachment'],
|
302 |
+
'background-repeat' => $attr['backgroundRepeat'],
|
303 |
+
'background-size' => $attr['backgroundSize'],
|
304 |
+
);
|
305 |
+
}
|
306 |
+
// Order review.
|
307 |
+
$selectors[' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-overview.woocommerce-thankyou-order-details.order_details'] = array(
|
308 |
+
'opacity' => ( isset( $attr['odbackgroundOpacity'] ) && '' !== $attr['odbackgroundOpacity'] ) ? $attr['odbackgroundOpacity'] / 100 : 0.79,
|
309 |
+
'background-color' => $attr['odbackgroundColor'],
|
310 |
+
);
|
311 |
+
|
312 |
+
$position = str_replace( '-', ' ', $attr['backgroundPosition'] );
|
313 |
+
|
314 |
+
if ( 'image' == $attr['odbackgroundType'] ) {
|
315 |
+
$selectors[' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-overview.woocommerce-thankyou-order-details.order_details'] = array(
|
316 |
+
'opacity' => ( isset( $attr['odbackgroundOpacity'] ) && '' !== $attr['odbackgroundOpacity'] ) ? $attr['odbackgroundOpacity'] / 100 : 0,
|
317 |
+
'background-color' => $attr['odbackgroundImageColor'],
|
318 |
+
'background-image' => ( isset( $attr['odbackgroundImage'] ) && isset( $attr['odbackgroundImage']['url'] ) ) ? "url('" . $attr['odbackgroundImage']['url'] . "' )" : null,
|
319 |
+
'background-position' => $position,
|
320 |
+
'background-attachment' => $attr['odbackgroundAttachment'],
|
321 |
+
'background-repeat' => $attr['odbackgroundRepeat'],
|
322 |
+
'background-size' => $attr['odbackgroundSize'],
|
323 |
+
);
|
324 |
+
}
|
325 |
+
// Downloads.
|
326 |
+
$selectors[' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-downloads'] = array(
|
327 |
+
'opacity' => ( isset( $attr['dbackgroundOpacity'] ) && '' !== $attr['dbackgroundOpacity'] ) ? $attr['dbackgroundOpacity'] / 100 : 0.79,
|
328 |
+
'background-color' => $attr['dbackgroundType'],
|
329 |
+
);
|
330 |
+
|
331 |
+
$dposition = str_replace( '-', ' ', $attr['dbackgroundPosition'] );
|
332 |
+
|
333 |
+
if ( 'image' == $attr['dbackgroundType'] ) {
|
334 |
+
$selectors[' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-downloads'] = array(
|
335 |
+
'opacity' => ( isset( $attr['dbackgroundOpacity'] ) && '' !== $attr['dbackgroundOpacity'] ) ? $attr['dbackgroundOpacity'] / 100 : 0,
|
336 |
+
'background-color' => $attr['dbackgroundImageColor'],
|
337 |
+
'background-image' => ( isset( $attr['dbackgroundImage'] ) && isset( $attr['dbackgroundImage']['url'] ) ) ? "url('" . $attr['dbackgroundImage']['url'] . "' )" : null,
|
338 |
+
'background-position' => $dposition,
|
339 |
+
'background-attachment' => $attr['dbackgroundAttachment'],
|
340 |
+
'background-repeat' => $attr['dbackgroundRepeat'],
|
341 |
+
'background-size' => $attr['dbackgroundSize'],
|
342 |
+
);
|
343 |
+
}
|
344 |
+
// Order details.
|
345 |
+
$selectors[' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details'] = array(
|
346 |
+
'opacity' => ( isset( $attr['odetailbackgroundOpacity'] ) && '' !== $attr['odetailbackgroundOpacity'] ) ? $attr['odetailbackgroundOpacity'] / 100 : 0.79,
|
347 |
+
'background-color' => $attr['odetailbackgroundColor'],
|
348 |
+
);
|
349 |
+
|
350 |
+
$odetailposition = str_replace( '-', ' ', $attr['odetailbackgroundPosition'] );
|
351 |
+
|
352 |
+
if ( 'image' == $attr['odetailbackgroundType'] ) {
|
353 |
+
$selectors[' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details'] = array(
|
354 |
+
'opacity' => ( isset( $attr['odetailbackgroundOpacity'] ) && '' !== $attr['odetailbackgroundOpacity'] ) ? $attr['odetailbackgroundOpacity'] / 100 : 0,
|
355 |
+
'background-color' => $attr['odetailbackgroundImageColor'],
|
356 |
+
'background-image' => ( isset( $attr['odetailbackgroundImage'] ) && isset( $attr['odetailbackgroundImage']['url'] ) ) ? "url('" . $attr['odetailbackgroundImage']['url'] . "' )" : null,
|
357 |
+
'background-position' => $odetailposition,
|
358 |
+
'background-attachment' => $attr['odetailbackgroundAttachment'],
|
359 |
+
'background-repeat' => $attr['odetailbackgroundRepeat'],
|
360 |
+
'background-size' => $attr['odetailbackgroundSize'],
|
361 |
+
);
|
362 |
+
}
|
363 |
+
// Customer details.
|
364 |
+
$selectors[' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details'] = array(
|
365 |
+
'opacity' => ( isset( $attr['cdetailsbackgroundOpacity'] ) && '' !== $attr['cdetailsbackgroundOpacity'] ) ? $attr['cdetailsbackgroundOpacity'] / 100 : 0.79,
|
366 |
+
'background-color' => $attr['cdetailbackgroundColor'],
|
367 |
+
);
|
368 |
+
|
369 |
+
$cdetailposition = str_replace( '-', ' ', $attr['cdetailbackgroundPosition'] );
|
370 |
+
|
371 |
+
if ( 'image' == $attr['cdetailbackgroundType'] ) {
|
372 |
+
$selectors[' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details'] = array(
|
373 |
+
'opacity' => ( isset( $attr['cdetailsbackgroundOpacity'] ) && '' !== $attr['cdetailsbackgroundOpacity'] ) ? $attr['cdetailsbackgroundOpacity'] / 100 : 0,
|
374 |
+
'background-color' => $attr['cdetailsbackgroundImageColor'],
|
375 |
+
'background-image' => ( isset( $attr['cdetailbackgroundImage'] ) && isset( $attr['cdetailbackgroundImage']['url'] ) ) ? "url('" . $attr['cdetailbackgroundImage']['url'] . "' )" : null,
|
376 |
+
'background-position' => $cdetailposition,
|
377 |
+
'background-attachment' => $attr['cdetailbackgroundAttachment'],
|
378 |
+
'background-repeat' => $attr['cdetailbackgroundRepeat'],
|
379 |
+
'background-size' => $attr['cdetailbackgroundSize'],
|
380 |
+
);
|
381 |
+
}
|
382 |
+
|
383 |
+
$combined_selectors = array(
|
384 |
+
'desktop' => $selectors,
|
385 |
+
'tablet' => $t_selectors,
|
386 |
+
'mobile' => $m_selectors,
|
387 |
+
);
|
388 |
+
|
389 |
+
// Heading.
|
390 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'heading', ' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-thankyou-order-received', $combined_selectors );
|
391 |
+
// Sections.
|
392 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'sectionHeading', ' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order h2', $combined_selectors );
|
393 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'sectionContent', ' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-overview.woocommerce-thankyou-order-details.order_details li, .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order p, .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details .woocommerce-table, .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details address, .wpcf__order-detail-form .woocommerce-order-downloads table.shop_table', $combined_selectors );
|
394 |
+
// Order Overview.
|
395 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'orderOverview', ' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-overview.woocommerce-thankyou-order-details.order_details li', $combined_selectors );
|
396 |
+
// Downloads.
|
397 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'downloadHeading', ' .wpcf__order-detail-form .woocommerce-order h2.woocommerce-order-downloads__title, .wpcf__order-detail-form .woocommerce-order .woocommerce-order-downloads h2.woocommerce-order-downloads__title', $combined_selectors );
|
398 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'downloadContent', ' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-downloads table.shop_table', $combined_selectors );
|
399 |
+
// Order Details.
|
400 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'orderDetailHeading', ' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details .woocommerce-order-details__title', $combined_selectors );
|
401 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'orderDetailContent', ' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-order-details .woocommerce-table', $combined_selectors );
|
402 |
+
// Customer Details.
|
403 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'customerDetailHeading', ' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details .woocommerce-column__title', $combined_selectors );
|
404 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'customerDetailContent', ' .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details address, .wpcf__order-detail-form .wcf-thankyou-wrap .woocommerce-order .woocommerce-customer-details address p', $combined_selectors );
|
405 |
+
|
406 |
+
return Cartflows_Gb_Helper::generate_all_css( $combined_selectors, ' .cf-block-' . $id );
|
407 |
+
}
|
408 |
+
|
409 |
+
/**
|
410 |
+
* Get Checkout form CSS
|
411 |
+
*
|
412 |
+
* @since x.x.x
|
413 |
+
* @param array $attr The block attributes.
|
414 |
+
* @param string $id The selector ID.
|
415 |
+
* @return array The Widget List.
|
416 |
+
*/
|
417 |
+
public static function get_checkout_form_css( $attr, $id ) {
|
418 |
+
|
419 |
+
$defaults = Cartflows_Gb_Helper::$block_list['wcfb/checkout-form']['attributes'];
|
420 |
+
|
421 |
+
$attr = array_merge( $defaults, (array) $attr );
|
422 |
+
|
423 |
+
$bg_type = ( isset( $attr['backgroundType'] ) ) ? $attr['backgroundType'] : 'none';
|
424 |
+
$overlay_type = ( isset( $attr['overlayType'] ) ) ? $attr['overlayType'] : 'none';
|
425 |
+
|
426 |
+
$box_shadow_position_css = $attr['boxShadowPosition'];
|
427 |
+
|
428 |
+
if ( 'outset' === $attr['boxShadowPosition'] ) {
|
429 |
+
$box_shadow_position_css = '';
|
430 |
+
}
|
431 |
+
|
432 |
+
$m_selectors = array();
|
433 |
+
$t_selectors = array();
|
434 |
+
|
435 |
+
$selectors = array(
|
436 |
+
' .wcf-embed-checkout-form .woocommerce h3, .wcf-embed-checkout-form .woocommerce-checkout #order_review_heading, .wcf-embed-checkout-form .woocommerce h3, .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-steps .wcf-current .step-name' => array(
|
437 |
+
'color' => $attr['headBgColor'],
|
438 |
+
),
|
439 |
+
' .wcf-embed-checkout-form .woocommerce #order_review button, .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button, .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button' => array(
|
440 |
+
'color' => $attr['buttonTextColor'],
|
441 |
+
'border-style' => $attr['buttonBorderStyle'],
|
442 |
+
'border-width' => Cartflows_Gb_Helper::get_css_value( $attr['buttonBorderWidth'], 'px' ),
|
443 |
+
'border-color' => $attr['buttonBorderColor'],
|
444 |
+
'border-radius' => Cartflows_Gb_Helper::get_css_value( $attr['buttonBorderRadius'], 'px' ),
|
445 |
+
'background-color' => $attr['buttonBgColor'],
|
446 |
+
),
|
447 |
+
' .wcf-embed-checkout-form .woocommerce #payment #place_order:hover' => array(
|
448 |
+
'color' => $attr['buttonTextHoverColor'],
|
449 |
+
'border-color' => $attr['buttonBorderHoverColor'],
|
450 |
+
'background-color' => $attr['buttonBgHoverColor'],
|
451 |
+
),
|
452 |
+
' .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small:hover' => array(
|
453 |
+
'color' => $attr['buttonTextHoverColor'],
|
454 |
+
'border-color' => $attr['buttonBorderHoverColor'],
|
455 |
+
'background-color' => $attr['buttonBgHoverColor'],
|
456 |
+
),
|
457 |
+
' .wcf-embed-checkout-form .woocommerce-checkout #payment ul.payment_methods' => array(
|
458 |
+
'background-color' => $attr['sectionbgColor'],
|
459 |
+
'padding-top' => Cartflows_Gb_Helper::get_css_value( $attr['sectionhrPadding'], 'px' ),
|
460 |
+
'padding-right' => Cartflows_Gb_Helper::get_css_value( $attr['sectionvrPadding'], 'px' ),
|
461 |
+
'padding-bottom' => Cartflows_Gb_Helper::get_css_value( $attr['sectionhrPadding'], 'px' ),
|
462 |
+
'padding-left' => Cartflows_Gb_Helper::get_css_value( $attr['sectionvrPadding'], 'px' ),
|
463 |
+
'margin-top' => Cartflows_Gb_Helper::get_css_value( $attr['sectionhrMargin'], 'px' ),
|
464 |
+
'margin-right' => Cartflows_Gb_Helper::get_css_value( $attr['sectionvrMargin'], 'px' ),
|
465 |
+
'margin-bottom' => Cartflows_Gb_Helper::get_css_value( $attr['sectionhrMargin'], 'px' ),
|
466 |
+
'margin-left' => Cartflows_Gb_Helper::get_css_value( $attr['sectionvrMargin'], 'px' ),
|
467 |
+
'border-radius' => Cartflows_Gb_Helper::get_css_value( $attr['sectionBorderRadius'], 'px' ),
|
468 |
+
),
|
469 |
+
' .wcf-embed-checkout-form .woocommerce-checkout #payment label a, .wcf-embed-checkout-form .woocommerce-checkout #payment label' => array(
|
470 |
+
'color' => $attr['paymenttitleColor'],
|
471 |
+
),
|
472 |
+
' .wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p' => array(
|
473 |
+
'color' => $attr['paymentdescriptionColor'],
|
474 |
+
),
|
475 |
+
' .wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box' => array(
|
476 |
+
'background-color' => $attr['informationbgColor'],
|
477 |
+
'color' => $attr['paymentdescriptionColor'],
|
478 |
+
),
|
479 |
+
' .wcf-embed-checkout-form .woocommerce-checkout #payment div.payment_box::before' => array(
|
480 |
+
'border-bottom-color' => $attr['informationbgColor'],
|
481 |
+
),
|
482 |
+
' .wcf-embed-checkout-form .woocommerce form p.form-row label' => array(
|
483 |
+
'color' => $attr['fieldLabelColor'],
|
484 |
+
),
|
485 |
+
' .wcf-embed-checkout-form .woocommerce form .form-row input.input-text, .wcf-embed-checkout-form .woocommerce form .form-row select, .wcf-embed-checkout-form .woocommerce form .form-row textarea, .wcf-embed-checkout-form .select2-container--default .select2-selection--single, .wcf-embed-checkout-form #order_review .wcf-custom-coupon-field input[type="text"], .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 form .form-row select' => array(
|
486 |
+
'background-color' => $attr['fieldBgColor'],
|
487 |
+
'border-radius' => Cartflows_Gb_Helper::get_css_value( $attr['fieldBorderRadius'], 'px' ),
|
488 |
+
'border-color' => $attr['fieldBorderColor'],
|
489 |
+
'border-style' => $attr['fieldBorderStyle'],
|
490 |
+
'border-width' => Cartflows_Gb_Helper::get_css_value( $attr['fieldBorderWidth'], 'px' ),
|
491 |
+
),
|
492 |
+
' .wcf-embed-checkout-form .woocommerce form .form-row input.input-text, .wcf-embed-checkout-form .woocommerce form .form-row textarea, span#select2-shipping_country-container, span#select2-billing_country-container, .wcf-embed-checkout-form #order_review .wcf-custom-coupon-field input[type="text"], .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, .wcf-embed-checkout-form .woocommerce form .form-row select, .wcf-embed-checkout-form ::placeholder, .wcf-embed-checkout-form ::-webkit-input-placeholder, span#select2-shipping_state-container, span#select2-billing_state-container' => array(
|
493 |
+
'color' => $attr['fieldInputColor'],
|
494 |
+
),
|
495 |
+
' .woocommerce-NoticeGroup.woocommerce-NoticeGroup-checkout li, .wcf-embed-checkout-form .woocommerce .wcf-custom-coupon-field .woocommerce-error li' => array(
|
496 |
+
'color' => $attr['errorMsgColor'],
|
497 |
+
),
|
498 |
+
' .wcf-embed-checkout-form .woocommerce .woocommerce-NoticeGroup .woocommerce-error, .wcf-embed-checkout-form .woocommerce .woocommerce-notices-wrapper .woocommerce-error' => array(
|
499 |
+
'background-color' => $attr['errorMsgBgColor'],
|
500 |
+
'border-radius' => Cartflows_Gb_Helper::get_css_value( $attr['msgBorderRadius'], 'px' ),
|
501 |
+
'border-color' => $attr['errorMsgBorderColor'],
|
502 |
+
'padding-top' => Cartflows_Gb_Helper::get_css_value( $attr['msgHrPadding'], 'px' ),
|
503 |
+
'padding-right' => Cartflows_Gb_Helper::get_css_value( $attr['msgVrPadding'], 'px' ),
|
504 |
+
'padding-bottom' => Cartflows_Gb_Helper::get_css_value( $attr['msgHrPadding'], 'px' ),
|
505 |
+
'padding-left' => Cartflows_Gb_Helper::get_css_value( $attr['msgVrPadding'], 'px' ),
|
506 |
+
'border-width' => Cartflows_Gb_Helper::get_css_value( $attr['msgBorderSize'], 'px' ),
|
507 |
+
),
|
508 |
+
' .wcf-embed-checkout-form .woocommerce #payment input[type=radio]:checked:before, .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 .woocommerce-checkout form.login .button:hover, .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button:hover, .wcf-embed-checkout-form .woocommerce #payment #place_order:hover, .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small:hover, .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-steps .step-one.wcf-current:before, .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-steps .step-two.wcf-current:before, .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-steps .steps.wcf-current:before, .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-note, body .wcf-pre-checkout-offer-wrapper .wcf-nav-bar-step.active .wcf-progress-nav-step, body .wcf-pre-checkout-offer-wrapper .wcf-nav-bar-step.active .wcf-nav-bar-step-line:before, body .wcf-pre-checkout-offer-wrapper .wcf-nav-bar-step.active .wcf-nav-bar-step-line:after' => array(
|
509 |
+
'background-color' => $attr['globalbgColor'],
|
510 |
+
),
|
511 |
+
' .wcf-embed-checkout-form-two-step .wcf-embed-checkout-form-note:before' => array(
|
512 |
+
'border-top-color' => $attr['globalbgColor'],
|
513 |
+
),
|
514 |
+
' .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns .wcf-next-button, .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button, .wcf-embed-checkout-form form.checkout_coupon .button, body .wcf-pre-checkout-offer-wrapper #wcf-pre-checkout-offer-content button.wcf-pre-checkout-offer-btn' => array(
|
515 |
+
'background-color' => $attr['globalbgColor'],
|
516 |
+
),
|
517 |
+
' .wcf-embed-checkout-form , .wcf-embed-checkout-form #payment .woocommerce-privacy-policy-text p' => array(
|
518 |
+
'color' => $attr['globaltextColor'],
|
519 |
+
),
|
520 |
+
' .woocommerce form .form-row.woocommerce-invalid label' => array(
|
521 |
+
'color' => $attr['errorLabelColor'],
|
522 |
+
),
|
523 |
+
' .wcf-embed-checkout-form .select2-container--default.field-required .select2-selection--single, .wcf-embed-checkout-form .woocommerce form .form-row input.input-text.field-required, .wcf-embed-checkout-form .woocommerce form .form-row textarea.input-text.field-required, .wcf-embed-checkout-form .woocommerce #order_review .input-text.field-required .wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid .select2-container, .wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid input.input-text, .wcf-embed-checkout-form .woocommerce form .form-row.woocommerce-invalid select' => array(
|
524 |
+
'border-color' => $attr['errorFieldBorderColor'],
|
525 |
+
),
|
526 |
+
);
|
527 |
+
if ( 'color' == $bg_type ) {
|
528 |
+
$selectors[' .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 a.wcf-next-button'] = array(
|
529 |
+
'opacity' => ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : 0.79,
|
530 |
+
'box-shadow' => Cartflows_Gb_Helper::get_css_value( $attr['boxShadowHOffset'], 'px' ) . ' ' . Cartflows_Gb_Helper::get_css_value( $attr['boxShadowVOffset'], 'px' ) . ' ' . Cartflows_Gb_Helper::get_css_value( $attr['boxShadowBlur'], 'px' ) . ' ' . Cartflows_Gb_Helper::get_css_value( $attr['boxShadowSpread'], 'px' ) . ' ' . $attr['boxShadowColor'] . ' ' . $box_shadow_position_css,
|
531 |
+
'background-color' => $attr['backgroundColor'],
|
532 |
+
);
|
533 |
+
$selectors[' .wcf-embed-checkout-form .woocommerce #order_review button:hover, .wcf-embed-checkout-form .woocommerce form.woocommerce-form-login .form-row button:hover, .wcf-embed-checkout-form .woocommerce #order_review button.wcf-btn-small:hover, .wcf-embed-checkout-form .woocommerce-checkout form.woocommerce-form-login .button:hover, .wcf-embed-checkout-form .woocommerce-checkout form.checkout_coupon .button:hover, .wcf-embed-checkout-form form.checkout_coupon .button:hover, .wcf-embed-checkout-form-two-step .woocommerce .wcf-embed-checkout-form-nav-btns a.wcf-next-button:hover, .wcf-embed-checkout-form .woocommerce #payment #place_order:hover'] = array(
|
534 |
+
'background-color' => $attr['backgroundHoverColor'],
|
535 |
+
);
|
536 |
+
}
|
537 |
+
|
538 |
+
if ( 'gradient' == $bg_type ) {
|
539 |
+
$selectors[' .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 a.wcf-next-button'] = array(
|
540 |
+
'box-shadow' => Cartflows_Gb_Helper::get_css_value( $attr['boxShadowHOffset'], 'px' ) . ' ' . Cartflows_Gb_Helper::get_css_value( $attr['boxShadowVOffset'], 'px' ) . ' ' . Cartflows_Gb_Helper::get_css_value( $attr['boxShadowBlur'], 'px' ) . ' ' . Cartflows_Gb_Helper::get_css_value( $attr['boxShadowSpread'], 'px' ) . ' ' . $attr['boxShadowColor'] . ' ' . $box_shadow_position_css,
|
541 |
+
);
|
542 |
+
}
|
543 |
+
|
544 |
+
$position = str_replace( '-', ' ', $attr['backgroundPosition'] );
|
545 |
+
|
546 |
+
if ( 'image' == $bg_type ) {
|
547 |
+
$selectors[' .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 a.wcf-next-button'] = array(
|
548 |
+
'opacity' => ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : 0,
|
549 |
+
'background-color' => $attr['backgroundImageColor'],
|
550 |
+
'background-image' => ( isset( $attr['backgroundImage'] ) && isset( $attr['backgroundImage']['url'] ) ) ? "url('" . $attr['backgroundImage']['url'] . "' )" : null,
|
551 |
+
'background-position' => $position,
|
552 |
+
'background-attachment' => $attr['backgroundAttachment'],
|
553 |
+
'background-repeat' => $attr['backgroundRepeat'],
|
554 |
+
'background-size' => $attr['backgroundSize'],
|
555 |
+
'box-shadow' => Cartflows_Gb_Helper::get_css_value( $attr['boxShadowHOffset'], 'px' ) . ' ' . Cartflows_Gb_Helper::get_css_value( $attr['boxShadowVOffset'], 'px' ) . ' ' . Cartflows_Gb_Helper::get_css_value( $attr['boxShadowBlur'], 'px' ) . ' ' . Cartflows_Gb_Helper::get_css_value( $attr['boxShadowSpread'], 'px' ) . ' ' . $attr['boxShadowColor'] . ' ' . $box_shadow_position_css,
|
556 |
+
);
|
557 |
+
} elseif ( 'gradient' === $bg_type ) {
|
558 |
+
|
559 |
+
$selectors[' .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 a.wcf-next-button']['background-color'] = 'transparent';
|
560 |
+
$selectors[' .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 a.wcf-next-button']['opacity'] = ( isset( $attr['backgroundOpacity'] ) && '' !== $attr['backgroundOpacity'] ) ? $attr['backgroundOpacity'] / 100 : 0;
|
561 |
+
if ( $attr['gradientValue'] ) {
|
562 |
+
$selectors[' .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 a.wcf-next-button']['background-image'] = $attr['gradientValue'];
|
563 |
+
|
564 |
+
} else {
|
565 |
+
if ( 'linear' === $attr['gradientType'] ) {
|
566 |
+
|
567 |
+
$selectors[' .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 a.wcf-next-button']['background-image'] = "linear-gradient(${ $attr['gradientAngle'] }deg, ${ $attr['gradientColor1'] } ${ $attr['gradientLocation1'] }%, ${ $attr['gradientColor2'] } ${ $attr['gradientLocation2'] }%)";
|
568 |
+
} else {
|
569 |
+
|
570 |
+
$selectors[' .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 a.wcf-next-button']['background-image'] = "radial-gradient( at ${ $attr['gradientPosition'] }, ${ $attr['gradientColor1'] } ${ $attr['gradientLocation1'] }%, ${ $attr['gradientColor2'] } ${ $attr['gradientLocation2'] }%)";
|
571 |
+
}
|
572 |
+
}
|
573 |
+
}
|
574 |
+
|
575 |
+
$combined_selectors = array(
|
576 |
+
'desktop' => $selectors,
|
577 |
+
'tablet' => $t_selectors,
|
578 |
+
'mobile' => $m_selectors,
|
579 |
+
);
|
580 |
+
|
581 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'global', ' .wcf-embed-checkout-form .woocommerce', $combined_selectors );
|
582 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'head', ' .wcf-embed-checkout-form .woocommerce h3, .wcf-embed-checkout-form .woocommerce-checkout #order_review_heading, .wcf-embed-checkout-form .woocommerce h3, .wcf-embed-checkout-form .woocommerce h3 span', $combined_selectors );
|
583 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'button', ' .wcf-embed-checkout-form .woocommerce #order_review button', $combined_selectors );
|
584 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'input', ' .wcf-embed-checkout-form .woocommerce form p.form-row label, .wcf-embed-checkout-form .woocommerce form .form-row input.input-text, .wcf-embed-checkout-form .woocommerce form .form-row textarea, .wcf-embed-checkout-form .woocommerce form .form-row select#billing_country, .wcf-embed-checkout-form .woocommerce form .form-row select#billing_state, span#select2-billing_country-container, .wcf-embed-checkout-form .select2-container--default .select2-selection--single .select2-selection__rendered, .wcf-embed-checkout-form #order_review .wcf-custom-coupon-field input[type="text"], .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, .wcf-embed-checkout-form .woocommerce form .form-row select, .wcf-embed-checkout-form ::placeholder, .wcf-embed-checkout-form ::-webkit-input-placeholder, .wcf-embed-checkout-form .woocommerce #payment [type="radio"]:checked + label, .wcf-embed-checkout-form .woocommerce #payment [type="radio"]:not(:checked) + label', $combined_selectors );
|
585 |
+
|
586 |
+
return Cartflows_Gb_Helper::generate_all_css( $combined_selectors, ' .cf-block-' . $id );
|
587 |
+
}
|
588 |
+
|
589 |
+
/**
|
590 |
+
* Get Optin Form Block CSS
|
591 |
+
*
|
592 |
+
* @since x.x.x
|
593 |
+
* @param array $attr The block attributes.
|
594 |
+
* @param string $id The selector ID.
|
595 |
+
* @return array The Widget List.
|
596 |
+
*/
|
597 |
+
public static function get_optin_form_css( $attr, $id ) {
|
598 |
+
|
599 |
+
$defaults = Cartflows_Gb_Helper::$block_list['wcfb/optin-form']['attributes'];
|
600 |
+
|
601 |
+
$attr = array_merge( $defaults, $attr );
|
602 |
+
|
603 |
+
$t_selectors = array();
|
604 |
+
$m_selectors = array();
|
605 |
+
$selectors = array();
|
606 |
+
|
607 |
+
$box_shadow_position_css = $attr['boxShadowPosition'];
|
608 |
+
|
609 |
+
if ( 'outset' === $attr['boxShadowPosition'] ) {
|
610 |
+
$box_shadow_position_css = '';
|
611 |
+
}
|
612 |
+
|
613 |
+
$selectors = array(
|
614 |
+
// General.
|
615 |
+
' .wcf-optin-form .checkout.woocommerce-checkout #order_review .woocommerce-checkout-payment button#place_order' => array(
|
616 |
+
'background-color' => $attr['generalPrimaryColor'],
|
617 |
+
'border-color' => $attr['generalPrimaryColor'],
|
618 |
+
),
|
619 |
+
|
620 |
+
// Input Fields.
|
621 |
+
' .wcf-optin-form .checkout.woocommerce-checkout label' => array(
|
622 |
+
'color' => $attr['inputFieldLabelColor'],
|
623 |
+
),
|
624 |
+
' .wcf-optin-form .checkout.woocommerce-checkout span input.input-text' => array(
|
625 |
+
'color' => $attr['inputFieldTextPlaceholderColor'],
|
626 |
+
'background-color' => $attr['inputFieldBackgroundColor'],
|
627 |
+
'border-style' => $attr['inputFieldBorderStyle'],
|
628 |
+
'border-width' => Cartflows_Gb_Helper::get_css_value( $attr['inputFieldBorderWidth'], 'px' ),
|
629 |
+
'border-radius' => Cartflows_Gb_Helper::get_css_value( $attr['inputFieldBorderRadius'], 'px' ),
|
630 |
+
'border-color' => $attr['inputFieldBorderColor'],
|
631 |
+
),
|
632 |
+
|
633 |
+
// Submit Button.
|
634 |
+
' .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review .woocommerce-checkout-payment button#place_order' => array(
|
635 |
+
'color' => $attr['submitButtonTextColor'],
|
636 |
+
'background-color' => $attr['submitButtonBackgroundColor'],
|
637 |
+
'border-style' => $attr['submitButtonBorderStyle'],
|
638 |
+
'border-width' => Cartflows_Gb_Helper::get_css_value( $attr['submitButtonBorderWidth'], 'px' ),
|
639 |
+
'border-radius' => Cartflows_Gb_Helper::get_css_value( $attr['submitButtonBorderRadius'], 'px' ),
|
640 |
+
'border-color' => $attr['submitButtonBorderColor'],
|
641 |
+
'box-shadow' => Cartflows_Gb_Helper::get_css_value( $attr['boxShadowHOffset'], 'px' ) . ' ' . Cartflows_Gb_Helper::get_css_value( $attr['boxShadowVOffset'], 'px' ) . ' ' . Cartflows_Gb_Helper::get_css_value( $attr['boxShadowBlur'], 'px' ) . ' ' . Cartflows_Gb_Helper::get_css_value( $attr['boxShadowSpread'], 'px' ) . ' ' . $attr['boxShadowColor'] . ' ' . $box_shadow_position_css,
|
642 |
+
),
|
643 |
+
' .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review .woocommerce-checkout-payment button#place_order:hover' => array(
|
644 |
+
'color' => $attr['submitButtonTextHoverColor'],
|
645 |
+
'background-color' => $attr['submitButtonBackgroundHoverColor'],
|
646 |
+
'border-color' => $attr['submitButtonBorderHoverColor'],
|
647 |
+
),
|
648 |
+
|
649 |
+
);
|
650 |
+
|
651 |
+
$combined_selectors = array(
|
652 |
+
'desktop' => $selectors,
|
653 |
+
'tablet' => $t_selectors,
|
654 |
+
'mobile' => $m_selectors,
|
655 |
+
);
|
656 |
+
|
657 |
+
// General.
|
658 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'general', ' .wcf-optin-form .checkout.woocommerce-checkout label, .wcf-optin-form .checkout.woocommerce-checkout span input.input-text, .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review .woocommerce-checkout-payment button#place_order', $combined_selectors );
|
659 |
+
|
660 |
+
// Input Fields.
|
661 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'inputField', ' .wcf-optin-form .checkout.woocommerce-checkout label, .wcf-optin-form .checkout.woocommerce-checkout span input.input-text', $combined_selectors );
|
662 |
+
|
663 |
+
// Submit Button.
|
664 |
+
$combined_selectors = Cartflows_Gb_Helper::get_typography_css( $attr, 'submitButton', ' .wcf-optin-form .checkout.woocommerce-checkout .wcf-order-wrap #order_review .woocommerce-checkout-payment button#place_order', $combined_selectors );
|
665 |
+
|
666 |
+
return Cartflows_Gb_Helper::generate_all_css( $combined_selectors, ' .cf-block-' . $id );
|
667 |
+
}
|
668 |
+
|
669 |
+
|
670 |
+
|
671 |
+
}
|
672 |
+
}
|
modules/gutenberg/classes/class-cartflows-block-js.php
ADDED
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Cartflows Block Js.
|
4 |
+
*
|
5 |
+
* @package Cartflows
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit; // Exit if accessed directly.
|
10 |
+
}
|
11 |
+
|
12 |
+
if ( ! class_exists( 'Cartflows_Block_JS' ) ) {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Class Cartflows_Block_JS.
|
16 |
+
*/
|
17 |
+
class Cartflows_Block_JS {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Adds Google fonts for Next Step Button.
|
21 |
+
*
|
22 |
+
* @since x.x.x
|
23 |
+
* @param array $attr the blocks attr.
|
24 |
+
*/
|
25 |
+
public static function blocks_next_step_button_gfont( $attr ) {
|
26 |
+
|
27 |
+
$title_load_google_font = isset( $attr['titleLoadGoogleFonts'] ) ? $attr['titleLoadGoogleFonts'] : '';
|
28 |
+
$title_font_family = isset( $attr['titleFontFamily'] ) ? $attr['titleFontFamily'] : '';
|
29 |
+
$title_font_weight = isset( $attr['titleFontWeight'] ) ? $attr['titleFontWeight'] : '';
|
30 |
+
$title_font_subset = isset( $attr['titleFontSubset'] ) ? $attr['titleFontSubset'] : '';
|
31 |
+
|
32 |
+
$sub_title_load_google_font = isset( $attr['subTitleLoadGoogleFonts'] ) ? $attr['subTitleLoadGoogleFonts'] : '';
|
33 |
+
$sub_title_font_family = isset( $attr['subTitleFontFamily'] ) ? $attr['subTitleFontFamily'] : '';
|
34 |
+
$sub_title_font_weight = isset( $attr['subTitleFontWeight'] ) ? $attr['subTitleFontWeight'] : '';
|
35 |
+
$sub_title_font_subset = isset( $attr['subTitleFontSubset'] ) ? $attr['subTitleFontSubset'] : '';
|
36 |
+
|
37 |
+
Cartflows_Gb_Helper::blocks_google_font( $title_load_google_font, $title_font_family, $title_font_weight, $title_font_subset );
|
38 |
+
Cartflows_Gb_Helper::blocks_google_font( $sub_title_load_google_font, $sub_title_font_family, $sub_title_font_weight, $sub_title_font_subset );
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Adds Google fonts for Order Detail Form block.
|
43 |
+
*
|
44 |
+
* @since x.x.x
|
45 |
+
* @param array $attr the blocks attr.
|
46 |
+
*/
|
47 |
+
public static function blocks_order_detail_form_gfont( $attr ) {
|
48 |
+
|
49 |
+
$heading_load_google_font = isset( $attr['headingLoadGoogleFonts'] ) ? $attr['headingLoadGoogleFonts'] : '';
|
50 |
+
$heading_font_family = isset( $attr['headingFontFamily'] ) ? $attr['headingFontFamily'] : '';
|
51 |
+
$heading_font_weight = isset( $attr['headingFontWeight'] ) ? $attr['headingFontWeight'] : '';
|
52 |
+
$heading_font_subset = isset( $attr['headingFontSubset'] ) ? $attr['headingFontSubset'] : '';
|
53 |
+
|
54 |
+
$section_heading_load_google_font = isset( $attr['sectionHeadingLoadGoogleFonts'] ) ? $attr['sectionHeadingLoadGoogleFonts'] : '';
|
55 |
+
$section_heading_font_family = isset( $attr['sectionHeadingFontFamily'] ) ? $attr['sectionHeadingFontFamily'] : '';
|
56 |
+
$section_heading_font_weight = isset( $attr['sectionHeadingFontWeight'] ) ? $attr['sectionHeadingFontWeight'] : '';
|
57 |
+
$section_heading_font_subset = isset( $attr['sectionHeadingFontSubset'] ) ? $attr['sectionHeadingFontSubset'] : '';
|
58 |
+
|
59 |
+
$section_content_load_google_font = isset( $attr['sectionContentLoadGoogleFonts'] ) ? $attr['sectionContentLoadGoogleFonts'] : '';
|
60 |
+
$section_content_font_family = isset( $attr['sectionContentFontFamily'] ) ? $attr['sectionContentFontFamily'] : '';
|
61 |
+
$section_content_font_weight = isset( $attr['sectionContentFontWeight'] ) ? $attr['sectionContentFontWeight'] : '';
|
62 |
+
$section_content_font_subset = isset( $attr['sectionContentFontSubset'] ) ? $attr['sectionContentFontSubset'] : '';
|
63 |
+
|
64 |
+
$order_overview_load_google_font = isset( $attr['orderOverviewLoadGoogleFonts'] ) ? $attr['orderOverviewLoadGoogleFonts'] : '';
|
65 |
+
$order_overview_font_family = isset( $attr['orderOverviewFontFamily'] ) ? $attr['orderOverviewFontFamily'] : '';
|
66 |
+
$order_overview_font_weight = isset( $attr['orderOverviewFontWeight'] ) ? $attr['orderOverviewFontWeight'] : '';
|
67 |
+
$order_overview_font_subset = isset( $attr['orderOverviewFontSubset'] ) ? $attr['orderOverviewFontSubset'] : '';
|
68 |
+
|
69 |
+
$download_heading_load_google_font = isset( $attr['downloadHeadingLoadGoogleFonts'] ) ? $attr['downloadHeadingLoadGoogleFonts'] : '';
|
70 |
+
$download_heading_font_family = isset( $attr['downloadHeadingFontFamily'] ) ? $attr['downloadHeadingFontFamily'] : '';
|
71 |
+
$download_heading_font_weight = isset( $attr['downloadHeadingFontWeight'] ) ? $attr['downloadHeadingFontWeight'] : '';
|
72 |
+
$download_heading_font_subset = isset( $attr['downloadHeadingFontSubset'] ) ? $attr['downloadHeadingFontSubset'] : '';
|
73 |
+
|
74 |
+
$download_content_load_google_font = isset( $attr['downloadContentLoadGoogleFonts'] ) ? $attr['downloadContentLoadGoogleFonts'] : '';
|
75 |
+
$download_content_font_family = isset( $attr['downloadContentFontFamily'] ) ? $attr['downloadContentFontFamily'] : '';
|
76 |
+
$download_content_font_weight = isset( $attr['downloadContentFontWeight'] ) ? $attr['downloadContentFontWeight'] : '';
|
77 |
+
$download_content_font_subset = isset( $attr['downloadContentFontSubset'] ) ? $attr['downloadContentFontSubset'] : '';
|
78 |
+
|
79 |
+
$order_detail_heading_load_google_font = isset( $attr['orderDetailHeadingLoadGoogleFonts'] ) ? $attr['orderDetailHeadingLoadGoogleFonts'] : '';
|
80 |
+
$order_detail_heading_font_family = isset( $attr['orderDetailHeadingFontFamily'] ) ? $attr['orderDetailHeadingFontFamily'] : '';
|
81 |
+
$order_detail_heading_font_weight = isset( $attr['orderDetailHeadingFontWeight'] ) ? $attr['orderDetailHeadingFontWeight'] : '';
|
82 |
+
$order_detail_heading_font_subset = isset( $attr['orderDetailHeadingFontSubset'] ) ? $attr['orderDetailHeadingFontSubset'] : '';
|
83 |
+
|
84 |
+
$order_detail_content_load_google_font = isset( $attr['orderDetailContentLoadGoogleFonts'] ) ? $attr['orderDetailContentLoadGoogleFonts'] : '';
|
85 |
+
$order_detail_content_font_family = isset( $attr['orderDetailContentFontFamily'] ) ? $attr['orderDetailContentFontFamily'] : '';
|
86 |
+
$order_detail_content_font_weight = isset( $attr['orderDetailContentFontWeight'] ) ? $attr['orderDetailContentFontWeight'] : '';
|
87 |
+
$order_detail_content_font_subset = isset( $attr['orderDetailContentFontSubset'] ) ? $attr['orderDetailContentFontSubset'] : '';
|
88 |
+
|
89 |
+
$customer_detail_heading_load_google_font = isset( $attr['customerDetailHeadingLoadGoogleFonts'] ) ? $attr['customerDetailHeadingLoadGoogleFonts'] : '';
|
90 |
+
$customer_detail_heading_font_family = isset( $attr['customerDetailHeadingFontFamily'] ) ? $attr['customerDetailHeadingFontFamily'] : '';
|
91 |
+
$customer_detail_heading_font_weight = isset( $attr['customerDetailHeadingFontWeight'] ) ? $attr['customerDetailHeadingFontWeight'] : '';
|
92 |
+
$customer_detail_heading_font_subset = isset( $attr['customerDetailHeadingFontSubset'] ) ? $attr['customerDetailHeadingFontSubset'] : '';
|
93 |
+
|
94 |
+
$customer_detail_content_load_google_font = isset( $attr['customerDetailContentLoadGoogleFonts'] ) ? $attr['customerDetailContentLoadGoogleFonts'] : '';
|
95 |
+
$customer_detail_content_font_family = isset( $attr['customerDetailContentFontFamily'] ) ? $attr['customerDetailContentFontFamily'] : '';
|
96 |
+
$customer_detail_content_font_weight = isset( $attr['customerDetailContentFontWeight'] ) ? $attr['customerDetailContentFontWeight'] : '';
|
97 |
+
$customer_detail_content_font_subset = isset( $attr['customerDetailContentFontSubset'] ) ? $attr['customerDetailContentFontSubset'] : '';
|
98 |
+
|
99 |
+
Cartflows_Gb_Helper::blocks_google_font( $heading_load_google_font, $heading_font_family, $heading_font_weight, $heading_font_subset );
|
100 |
+
Cartflows_Gb_Helper::blocks_google_font( $section_heading_load_google_font, $section_heading_font_family, $section_heading_font_weight, $section_heading_font_subset );
|
101 |
+
Cartflows_Gb_Helper::blocks_google_font( $section_content_load_google_font, $section_content_font_family, $section_content_font_weight, $section_content_font_subset );
|
102 |
+
Cartflows_Gb_Helper::blocks_google_font( $order_overview_load_google_font, $order_overview_font_family, $order_overview_font_weight, $order_overview_font_subset );
|
103 |
+
Cartflows_Gb_Helper::blocks_google_font( $download_heading_load_google_font, $download_heading_font_family, $download_heading_font_weight, $download_heading_font_subset );
|
104 |
+
Cartflows_Gb_Helper::blocks_google_font( $download_content_load_google_font, $download_content_font_family, $download_content_font_weight, $download_content_font_subset );
|
105 |
+
Cartflows_Gb_Helper::blocks_google_font( $order_detail_heading_load_google_font, $order_detail_heading_font_family, $order_detail_heading_font_weight, $order_detail_heading_font_subset );
|
106 |
+
Cartflows_Gb_Helper::blocks_google_font( $order_detail_content_load_google_font, $order_detail_content_font_family, $order_detail_content_font_weight, $order_detail_content_font_subset );
|
107 |
+
Cartflows_Gb_Helper::blocks_google_font( $customer_detail_heading_load_google_font, $customer_detail_heading_font_family, $customer_detail_heading_font_weight, $customer_detail_heading_font_subset );
|
108 |
+
Cartflows_Gb_Helper::blocks_google_font( $customer_detail_content_load_google_font, $customer_detail_content_font_family, $customer_detail_content_font_weight, $customer_detail_content_font_subset );
|
109 |
+
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Adds Google fonts for checkout form.
|
114 |
+
*
|
115 |
+
* @since x.x.x
|
116 |
+
* @param array $attr the blocks attr.
|
117 |
+
*/
|
118 |
+
public static function blocks_checkout_form_gfont( $attr ) {
|
119 |
+
|
120 |
+
$head_load_google_font = isset( $attr['headLoadGoogleFonts'] ) ? $attr['headLoadGoogleFonts'] : '';
|
121 |
+
$head_font_family = isset( $attr['headFontFamily'] ) ? $attr['headFontFamily'] : '';
|
122 |
+
$head_font_weight = isset( $attr['headFontWeight'] ) ? $attr['headFontWeight'] : '';
|
123 |
+
$head_font_subset = isset( $attr['headFontSubset'] ) ? $attr['headFontSubset'] : '';
|
124 |
+
|
125 |
+
$input_load_google_font = isset( $attr['inputLoadGoogleFonts'] ) ? $attr['inputLoadGoogleFonts'] : '';
|
126 |
+
$input_font_family = isset( $attr['inputFontFamily'] ) ? $attr['inputFontFamily'] : '';
|
127 |
+
$input_font_weight = isset( $attr['inputFontWeight'] ) ? $attr['inputFontWeight'] : '';
|
128 |
+
$input_font_subset = isset( $attr['inputFontSubset'] ) ? $attr['inputFontSubset'] : '';
|
129 |
+
|
130 |
+
$button_load_google_font = isset( $attr['buttonLoadGoogleFonts'] ) ? $attr['buttonLoadGoogleFonts'] : '';
|
131 |
+
$button_font_family = isset( $attr['buttonFontFamily'] ) ? $attr['buttonFontFamily'] : '';
|
132 |
+
$button_font_weight = isset( $attr['buttonFontWeight'] ) ? $attr['buttonFontWeight'] : '';
|
133 |
+
$button_font_subset = isset( $attr['buttonFontSubset'] ) ? $attr['buttonFontSubset'] : '';
|
134 |
+
|
135 |
+
$global_load_google_font = isset( $attr['globalLoadGoogleFonts'] ) ? $attr['globalLoadGoogleFonts'] : '';
|
136 |
+
$global_font_family = isset( $attr['globalFontFamily'] ) ? $attr['globalFontFamily'] : '';
|
137 |
+
$global_font_weight = isset( $attr['globalFontWeight'] ) ? $attr['globalFontWeight'] : '';
|
138 |
+
$global_font_subset = isset( $attr['globalFontSubset'] ) ? $attr['globalFontSubset'] : '';
|
139 |
+
|
140 |
+
Cartflows_Gb_Helper::blocks_google_font( $global_load_google_font, $global_font_family, $global_font_weight, $global_font_subset );
|
141 |
+
Cartflows_Gb_Helper::blocks_google_font( $head_load_google_font, $head_font_family, $head_font_weight, $head_font_subset );
|
142 |
+
Cartflows_Gb_Helper::blocks_google_font( $button_load_google_font, $button_font_family, $button_font_weight, $button_font_subset );
|
143 |
+
Cartflows_Gb_Helper::blocks_google_font( $input_load_google_font, $input_font_family, $input_font_weight, $input_font_subset );
|
144 |
+
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Adds Google fonts for Optin Form block.
|
149 |
+
*
|
150 |
+
* @since x.x.x
|
151 |
+
* @param array $attr the blocks attr.
|
152 |
+
*/
|
153 |
+
public static function blocks_optin_form_gfont( $attr ) {
|
154 |
+
|
155 |
+
$general_load_google_font = isset( $attr['generalLoadGoogleFonts'] ) ? $attr['generalLoadGoogleFonts'] : '';
|
156 |
+
$general_font_family = isset( $attr['generalFontFamily'] ) ? $attr['generalFontFamily'] : '';
|
157 |
+
$general_font_weight = isset( $attr['generalFontWeight'] ) ? $attr['generalFontWeight'] : '';
|
158 |
+
$general_font_subset = isset( $attr['generalFontSubset'] ) ? $attr['generalFontSubset'] : '';
|
159 |
+
|
160 |
+
$submit_button_load_google_font = isset( $attr['submitButtonLoadGoogleFonts'] ) ? $attr['submitButtonLoadGoogleFonts'] : '';
|
161 |
+
$submit_button_font_family = isset( $attr['submitButtonFontFamily'] ) ? $attr['submitButtonFontFamily'] : '';
|
162 |
+
$submit_button_font_weight = isset( $attr['submitButtonFontWeight'] ) ? $attr['submitButtonFontWeight'] : '';
|
163 |
+
$submit_button_font_subset = isset( $attr['submitButtonFontSubset'] ) ? $attr['submitButtonFontSubset'] : '';
|
164 |
+
|
165 |
+
Cartflows_Gb_Helper::blocks_google_font( $general_load_google_font, $general_font_family, $general_font_weight, $general_font_subset );
|
166 |
+
Cartflows_Gb_Helper::blocks_google_font( $submit_button_load_google_font, $submit_button_font_family, $submit_button_font_weight, $submit_button_font_subset );
|
167 |
+
|
168 |
+
}
|
169 |
+
}
|
170 |
+
}
|
modules/gutenberg/classes/class-cartflows-block-loader.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Cartflows Blocks Loader.
|
4 |
+
*
|
5 |
+
* @package Cartflows
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit; // Exit if accessed directly.
|
10 |
+
}
|
11 |
+
|
12 |
+
if ( ! class_exists( 'Cartflows_Block_Loader' ) ) {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Class Cartflows_Block_Loader.
|
16 |
+
*/
|
17 |
+
final class Cartflows_Block_Loader {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Member Variable
|
21 |
+
*
|
22 |
+
* @var instance
|
23 |
+
*/
|
24 |
+
private static $instance;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Initiator
|
28 |
+
*/
|
29 |
+
public static function get_instance() {
|
30 |
+
if ( ! isset( self::$instance ) ) {
|
31 |
+
self::$instance = new self();
|
32 |
+
}
|
33 |
+
return self::$instance;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Constructor
|
38 |
+
*/
|
39 |
+
public function __construct() {
|
40 |
+
|
41 |
+
define( 'CF_TABLET_BREAKPOINT', '976' );
|
42 |
+
define( 'CF_MOBILE_BREAKPOINT', '767' );
|
43 |
+
|
44 |
+
$this->load_plugin();
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Loads plugin files.
|
49 |
+
*
|
50 |
+
* @since x.x.x
|
51 |
+
*
|
52 |
+
* @return void
|
53 |
+
*/
|
54 |
+
public function load_plugin() {
|
55 |
+
require_once CARTFLOWS_DIR . 'modules/gutenberg/classes/class-cartflows-gb-helper.php';
|
56 |
+
require_once CARTFLOWS_DIR . 'modules/gutenberg/classes/class-cartflows-gutenberg-editor.php';
|
57 |
+
require_once CARTFLOWS_DIR . 'modules/gutenberg/classes/class-cartflows-init-blocks.php';
|
58 |
+
if ( wcf()->is_woo_active ) {
|
59 |
+
require_once CARTFLOWS_DIR . 'modules/gutenberg/dist/blocks/order-detail-form/class-wcfb-order-detail-form.php';
|
60 |
+
require_once CARTFLOWS_DIR . 'modules/gutenberg/dist/blocks/checkout-form/class-wcfb-checkout-form.php';
|
61 |
+
require_once CARTFLOWS_DIR . 'modules/gutenberg/dist/blocks/optin-form/class-wcfb-optin-form.php';
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
+
Cartflows_Block_Loader::get_instance();
|
66 |
+
}
|
67 |
+
|
modules/gutenberg/classes/class-cartflows-gb-helper.php
ADDED
@@ -0,0 +1,661 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Cartflows Gb Helper.
|
4 |
+
*
|
5 |
+
* @package Cartflows
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit; // Exit if accessed directly.
|
10 |
+
}
|
11 |
+
|
12 |
+
if ( ! class_exists( 'Cartflows_Gb_Helper' ) ) {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Class Cartflows_Gb_Helper.
|
16 |
+
*/
|
17 |
+
final class Cartflows_Gb_Helper {
|
18 |
+
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Member Variable
|
22 |
+
*
|
23 |
+
* @since x.x.x
|
24 |
+
* @var instance
|
25 |
+
*/
|
26 |
+
private static $instance;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Member Variable
|
30 |
+
*
|
31 |
+
* @since x.x.x
|
32 |
+
* @var instance
|
33 |
+
*/
|
34 |
+
public static $block_list;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Current Block List
|
38 |
+
*
|
39 |
+
* @since x.x.x
|
40 |
+
* @var current_block_list
|
41 |
+
*/
|
42 |
+
public static $current_block_list = array();
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Page Blocks Variable
|
46 |
+
*
|
47 |
+
* @since x.x.x
|
48 |
+
* @var instance
|
49 |
+
*/
|
50 |
+
public static $page_blocks;
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Stylesheet
|
54 |
+
*
|
55 |
+
* @since x.x.x
|
56 |
+
* @var stylesheet
|
57 |
+
*/
|
58 |
+
public static $stylesheet;
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Script
|
62 |
+
*
|
63 |
+
* @since x.x.x
|
64 |
+
* @var script
|
65 |
+
*/
|
66 |
+
public static $script;
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Cartflows Block Flag
|
70 |
+
*
|
71 |
+
* @since x.x.x
|
72 |
+
* @var cf_flag
|
73 |
+
*/
|
74 |
+
public static $cf_flag = false;
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Google fonts to enqueue
|
78 |
+
*
|
79 |
+
* @var array
|
80 |
+
*/
|
81 |
+
public static $gfonts = array();
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Initiator
|
85 |
+
*
|
86 |
+
* @since x.x.x
|
87 |
+
*/
|
88 |
+
public static function get_instance() {
|
89 |
+
if ( ! isset( self::$instance ) ) {
|
90 |
+
self::$instance = new self();
|
91 |
+
}
|
92 |
+
return self::$instance;
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Constructor
|
97 |
+
*/
|
98 |
+
public function __construct() {
|
99 |
+
require CARTFLOWS_DIR . 'modules/gutenberg/classes/class-cartflows-block-config.php';
|
100 |
+
require CARTFLOWS_DIR . 'modules/gutenberg/classes/class-cartflows-block-helper.php';
|
101 |
+
require CARTFLOWS_DIR . 'modules/gutenberg/classes/class-cartflows-block-js.php';
|
102 |
+
|
103 |
+
self::$block_list = Cartflows_Block_Config::get_block_attributes();
|
104 |
+
|
105 |
+
add_action( 'wp', array( $this, 'wp_actions' ), 10 );
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* WP Actions.
|
110 |
+
*/
|
111 |
+
public function wp_actions() {
|
112 |
+
|
113 |
+
if ( wcf()->utils->is_step_post_type() ) {
|
114 |
+
|
115 |
+
$this->generate_assets();
|
116 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'block_assets' ), 10 );
|
117 |
+
add_action( 'wp_head', array( $this, 'frontend_gfonts' ), 120 );
|
118 |
+
add_action( 'wp_head', array( $this, 'print_stylesheet' ), 80 );
|
119 |
+
add_action( 'wp_footer', array( $this, 'print_script' ), 1000 );
|
120 |
+
}
|
121 |
+
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Load the front end Google Fonts.
|
126 |
+
*/
|
127 |
+
public function frontend_gfonts() {
|
128 |
+
|
129 |
+
if ( empty( self::$gfonts ) ) {
|
130 |
+
return;
|
131 |
+
}
|
132 |
+
$show_google_fonts = apply_filters( 'cf_blocks_show_google_fonts', true );
|
133 |
+
if ( ! $show_google_fonts ) {
|
134 |
+
return;
|
135 |
+
}
|
136 |
+
$link = '';
|
137 |
+
$subsets = array();
|
138 |
+
foreach ( self::$gfonts as $key => $gfont_values ) {
|
139 |
+
if ( ! empty( $link ) ) {
|
140 |
+
$link .= '%7C'; // Append a new font to the string.
|
141 |
+
}
|
142 |
+
$link .= $gfont_values['fontfamily'];
|
143 |
+
if ( ! empty( $gfont_values['fontvariants'] ) ) {
|
144 |
+
$link .= ':';
|
145 |
+
$link .= implode( ',', $gfont_values['fontvariants'] );
|
146 |
+
}
|
147 |
+
if ( ! empty( $gfont_values['fontsubsets'] ) ) {
|
148 |
+
foreach ( $gfont_values['fontsubsets'] as $subset ) {
|
149 |
+
if ( ! in_array( $subset, $subsets, true ) ) {
|
150 |
+
array_push( $subsets, $subset );
|
151 |
+
}
|
152 |
+
}
|
153 |
+
}
|
154 |
+
}
|
155 |
+
if ( ! empty( $subsets ) ) {
|
156 |
+
$link .= '&subset=' . implode( ',', $subsets );
|
157 |
+
}
|
158 |
+
|
159 |
+
if ( isset( $link ) && ! empty( $link ) ) {
|
160 |
+
echo '<link id="cf_show_google_fonts" href="//fonts.googleapis.com/css?family=' . esc_attr( str_replace( '|', '%7C', $link ) ) . '" rel="stylesheet">'; //phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Print the Script in footer.
|
166 |
+
*/
|
167 |
+
public function print_script() {
|
168 |
+
|
169 |
+
if ( is_null( self::$script ) || '' === self::$script ) {
|
170 |
+
return;
|
171 |
+
}
|
172 |
+
|
173 |
+
ob_start();
|
174 |
+
?>
|
175 |
+
<script type="text/javascript" id="cf-script-frontend"><?php echo self::$script; //phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?></script>
|
176 |
+
<?php
|
177 |
+
ob_end_flush();
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Print the Stylesheet in header.
|
182 |
+
*/
|
183 |
+
public function print_stylesheet() {
|
184 |
+
|
185 |
+
if ( is_null( self::$stylesheet ) || '' === self::$stylesheet ) {
|
186 |
+
return;
|
187 |
+
}
|
188 |
+
|
189 |
+
ob_start();
|
190 |
+
?>
|
191 |
+
<style id="cf-style-frontend"><?php echo self::$stylesheet; //phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?></style>
|
192 |
+
<?php
|
193 |
+
ob_end_flush();
|
194 |
+
}
|
195 |
+
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Generates stylesheet and appends in head tag.
|
199 |
+
*
|
200 |
+
* @since x.x.x
|
201 |
+
*/
|
202 |
+
public function generate_assets() {
|
203 |
+
|
204 |
+
$this_post = array();
|
205 |
+
|
206 |
+
global $post;
|
207 |
+
$this_post = $post;
|
208 |
+
|
209 |
+
if ( ! is_object( $this_post ) ) {
|
210 |
+
return;
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Filters the post to build stylesheet for.
|
215 |
+
*
|
216 |
+
* @param \WP_Post $this_post The global post.
|
217 |
+
*/
|
218 |
+
$this_post = apply_filters( 'cf_post_for_stylesheet', $this_post );
|
219 |
+
|
220 |
+
$this->get_generated_stylesheet( $this_post );
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* Generates stylesheet in loop.
|
225 |
+
*
|
226 |
+
* @param object $this_post Current Post Object.
|
227 |
+
* @since x.x.x
|
228 |
+
*/
|
229 |
+
public function get_generated_stylesheet( $this_post ) {
|
230 |
+
|
231 |
+
if ( is_object( $this_post ) && isset( $this_post->ID ) && has_blocks( $this_post->ID ) && isset( $this_post->post_content ) ) {
|
232 |
+
|
233 |
+
$blocks = $this->parse( $this_post->post_content );
|
234 |
+
|
235 |
+
self::$page_blocks = $blocks;
|
236 |
+
|
237 |
+
if ( ! is_array( $blocks ) || empty( $blocks ) ) {
|
238 |
+
return;
|
239 |
+
}
|
240 |
+
|
241 |
+
$assets = $this->get_assets( $blocks );
|
242 |
+
|
243 |
+
self::$stylesheet .= $assets['css'];
|
244 |
+
self::$script .= $assets['js'];
|
245 |
+
}
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Enqueue Gutenberg block assets for both frontend + backend.
|
250 |
+
*
|
251 |
+
* @since x.x.x
|
252 |
+
*/
|
253 |
+
public function block_assets() {
|
254 |
+
|
255 |
+
$block_list_for_assets = self::$current_block_list;
|
256 |
+
|
257 |
+
$blocks = Cartflows_Block_Config::get_block_attributes();
|
258 |
+
|
259 |
+
foreach ( $block_list_for_assets as $key => $curr_block_name ) {
|
260 |
+
|
261 |
+
$js_assets = ( isset( $blocks[ $curr_block_name ]['js_assets'] ) ) ? $blocks[ $curr_block_name ]['js_assets'] : array();
|
262 |
+
|
263 |
+
$css_assets = ( isset( $blocks[ $curr_block_name ]['css_assets'] ) ) ? $blocks[ $curr_block_name ]['css_assets'] : array();
|
264 |
+
|
265 |
+
foreach ( $js_assets as $asset_handle => $val ) {
|
266 |
+
// Scripts.
|
267 |
+
wp_enqueue_script( $val );
|
268 |
+
}
|
269 |
+
|
270 |
+
foreach ( $css_assets as $asset_handle => $val ) {
|
271 |
+
// Styles.
|
272 |
+
wp_enqueue_style( $val );
|
273 |
+
}
|
274 |
+
}
|
275 |
+
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Parse Guten Block.
|
280 |
+
*
|
281 |
+
* @param string $content the content string.
|
282 |
+
* @since x.x.x
|
283 |
+
*/
|
284 |
+
public function parse( $content ) {
|
285 |
+
|
286 |
+
global $wp_version;
|
287 |
+
|
288 |
+
return ( version_compare( $wp_version, '5', '>=' ) ) ? parse_blocks( $content ) : gutenberg_parse_blocks( $content );
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* Generates stylesheet for reusable blocks.
|
293 |
+
*
|
294 |
+
* @param array $blocks Blocks array.
|
295 |
+
* @since x.x.x
|
296 |
+
*/
|
297 |
+
public function get_assets( $blocks ) {
|
298 |
+
|
299 |
+
$desktop = '';
|
300 |
+
$tablet = '';
|
301 |
+
$mobile = '';
|
302 |
+
|
303 |
+
$tab_styling_css = '';
|
304 |
+
$mob_styling_css = '';
|
305 |
+
|
306 |
+
$js = '';
|
307 |
+
|
308 |
+
foreach ( $blocks as $i => $block ) {
|
309 |
+
|
310 |
+
if ( is_array( $block ) ) {
|
311 |
+
|
312 |
+
if ( '' === $block['blockName'] ) {
|
313 |
+
continue;
|
314 |
+
}
|
315 |
+
if ( 'core/block' === $block['blockName'] ) {
|
316 |
+
$id = ( isset( $block['attrs']['ref'] ) ) ? $block['attrs']['ref'] : 0;
|
317 |
+
|
318 |
+
if ( $id ) {
|
319 |
+
$content = get_post_field( 'post_content', $id );
|
320 |
+
|
321 |
+
$reusable_blocks = $this->parse( $content );
|
322 |
+
|
323 |
+
$assets = $this->get_assets( $reusable_blocks );
|
324 |
+
|
325 |
+
self::$stylesheet .= $assets['css'];
|
326 |
+
self::$script .= $assets['js'];
|
327 |
+
|
328 |
+
}
|
329 |
+
} else {
|
330 |
+
|
331 |
+
$block_assets = $this->get_block_css_and_js( $block );
|
332 |
+
// Get CSS for the Block.
|
333 |
+
$css = $block_assets['css'];
|
334 |
+
|
335 |
+
if ( isset( $css['desktop'] ) ) {
|
336 |
+
$desktop .= $css['desktop'];
|
337 |
+
$tablet .= $css['tablet'];
|
338 |
+
$mobile .= $css['mobile'];
|
339 |
+
}
|
340 |
+
|
341 |
+
$js .= $block_assets['js'];
|
342 |
+
}
|
343 |
+
}
|
344 |
+
}
|
345 |
+
|
346 |
+
if ( ! empty( $tablet ) ) {
|
347 |
+
$tab_styling_css .= '@media only screen and (max-width: ' . CF_TABLET_BREAKPOINT . 'px) {';
|
348 |
+
$tab_styling_css .= $tablet;
|
349 |
+
$tab_styling_css .= '}';
|
350 |
+
}
|
351 |
+
|
352 |
+
if ( ! empty( $mobile ) ) {
|
353 |
+
$mob_styling_css .= '@media only screen and (max-width: ' . CF_MOBILE_BREAKPOINT . 'px) {';
|
354 |
+
$mob_styling_css .= $mobile;
|
355 |
+
$mob_styling_css .= '}';
|
356 |
+
}
|
357 |
+
|
358 |
+
return array(
|
359 |
+
'css' => $desktop . $tab_styling_css . $mob_styling_css,
|
360 |
+
'js' => $js,
|
361 |
+
);
|
362 |
+
}
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Get Typography Dynamic CSS.
|
366 |
+
*
|
367 |
+
* @param array $attr The Attribute array.
|
368 |
+
* @param string $slug The field slug.
|
369 |
+
* @param string $selector The selector array.
|
370 |
+
* @param array $combined_selectors The combined selector array.
|
371 |
+
* @since x.x.x
|
372 |
+
* @return bool|string
|
373 |
+
*/
|
374 |
+
public static function get_typography_css( $attr, $slug, $selector, $combined_selectors ) {
|
375 |
+
|
376 |
+
$typo_css_desktop = array();
|
377 |
+
$typo_css_tablet = array();
|
378 |
+
$typo_css_mobile = array();
|
379 |
+
|
380 |
+
$already_selectors_desktop = ( isset( $combined_selectors['desktop'][ $selector ] ) ) ? $combined_selectors['desktop'][ $selector ] : array();
|
381 |
+
$already_selectors_tablet = ( isset( $combined_selectors['tablet'][ $selector ] ) ) ? $combined_selectors['tablet'][ $selector ] : array();
|
382 |
+
$already_selectors_mobile = ( isset( $combined_selectors['mobile'][ $selector ] ) ) ? $combined_selectors['mobile'][ $selector ] : array();
|
383 |
+
|
384 |
+
$family_slug = ( '' === $slug ) ? 'fontFamily' : $slug . 'FontFamily';
|
385 |
+
$weight_slug = ( '' === $slug ) ? 'fontWeight' : $slug . 'FontWeight';
|
386 |
+
|
387 |
+
$l_ht_slug = ( '' === $slug ) ? 'lineHeight' : $slug . 'LineHeight';
|
388 |
+
$f_sz_slug = ( '' === $slug ) ? 'fontSize' : $slug . 'FontSize';
|
389 |
+
$l_ht_type_slug = ( '' === $slug ) ? 'lineHeightType' : $slug . 'LineHeightType';
|
390 |
+
$f_sz_type_slug = ( '' === $slug ) ? 'fontSizeType' : $slug . 'FontSizeType';
|
391 |
+
|
392 |
+
$typo_css_desktop[ $selector ] = array(
|
393 |
+
'font-family' => $attr[ $family_slug ],
|
394 |
+
'font-weight' => $attr[ $weight_slug ],
|
395 |
+
'font-size' => ( isset( $attr[ $f_sz_slug ] ) ) ? self::get_css_value( $attr[ $f_sz_slug ], $attr[ $f_sz_type_slug ] ) : '',
|
396 |
+
'line-height' => ( isset( $attr[ $l_ht_slug ] ) ) ? self::get_css_value( $attr[ $l_ht_slug ], $attr[ $l_ht_type_slug ] ) : '',
|
397 |
+
);
|
398 |
+
|
399 |
+
$typo_css_desktop[ $selector ] = array_merge(
|
400 |
+
$typo_css_desktop[ $selector ],
|
401 |
+
$already_selectors_desktop
|
402 |
+
);
|
403 |
+
|
404 |
+
$typo_css_tablet[ $selector ] = array(
|
405 |
+
'font-size' => ( isset( $attr[ $f_sz_slug . 'Tablet' ] ) ) ? self::get_css_value( $attr[ $f_sz_slug . 'Tablet' ], $attr[ $f_sz_type_slug ] ) : '',
|
406 |
+
'line-height' => ( isset( $attr[ $l_ht_slug . 'Tablet' ] ) ) ? self::get_css_value( $attr[ $l_ht_slug . 'Tablet' ], $attr[ $l_ht_type_slug ] ) : '',
|
407 |
+
);
|
408 |
+
|
409 |
+
$typo_css_tablet[ $selector ] = array_merge(
|
410 |
+
$typo_css_tablet[ $selector ],
|
411 |
+
$already_selectors_tablet
|
412 |
+
);
|
413 |
+
|
414 |
+
$typo_css_mobile[ $selector ] = array(
|
415 |
+
'font-size' => ( isset( $attr[ $f_sz_slug . 'Mobile' ] ) ) ? self::get_css_value( $attr[ $f_sz_slug . 'Mobile' ], $attr[ $f_sz_type_slug ] ) : '',
|
416 |
+
'line-height' => ( isset( $attr[ $l_ht_slug . 'Mobile' ] ) ) ? self::get_css_value( $attr[ $l_ht_slug . 'Mobile' ], $attr[ $l_ht_type_slug ] ) : '',
|
417 |
+
);
|
418 |
+
|
419 |
+
$typo_css_mobile[ $selector ] = array_merge(
|
420 |
+
$typo_css_mobile[ $selector ],
|
421 |
+
$already_selectors_mobile
|
422 |
+
);
|
423 |
+
|
424 |
+
return array(
|
425 |
+
'desktop' => array_merge(
|
426 |
+
$combined_selectors['desktop'],
|
427 |
+
$typo_css_desktop
|
428 |
+
),
|
429 |
+
'tablet' => array_merge(
|
430 |
+
$combined_selectors['tablet'],
|
431 |
+
$typo_css_tablet
|
432 |
+
),
|
433 |
+
'mobile' => array_merge(
|
434 |
+
$combined_selectors['mobile'],
|
435 |
+
$typo_css_mobile
|
436 |
+
),
|
437 |
+
);
|
438 |
+
}
|
439 |
+
|
440 |
+
/**
|
441 |
+
* Get CSS value
|
442 |
+
*
|
443 |
+
* Syntax:
|
444 |
+
*
|
445 |
+
* get_css_value( VALUE, UNIT );
|
446 |
+
*
|
447 |
+
* E.g.
|
448 |
+
*
|
449 |
+
* get_css_value( VALUE, 'em' );
|
450 |
+
*
|
451 |
+
* @param string $value CSS value.
|
452 |
+
* @param string $unit CSS unit.
|
453 |
+
* @since x.x.x
|
454 |
+
*/
|
455 |
+
public static function get_css_value( $value = '', $unit = '' ) {
|
456 |
+
|
457 |
+
$css_val = '';
|
458 |
+
|
459 |
+
if ( '' !== $value ) {
|
460 |
+
$css_val = esc_attr( $value ) . $unit;
|
461 |
+
}
|
462 |
+
|
463 |
+
return $css_val;
|
464 |
+
}
|
465 |
+
|
466 |
+
/**
|
467 |
+
* Parse CSS into correct CSS syntax.
|
468 |
+
*
|
469 |
+
* @param array $combined_selectors The combined selector array.
|
470 |
+
* @param string $id The selector ID.
|
471 |
+
* @since x.x.x
|
472 |
+
*/
|
473 |
+
public static function generate_all_css( $combined_selectors, $id ) {
|
474 |
+
|
475 |
+
return array(
|
476 |
+
'desktop' => self::generate_css( $combined_selectors['desktop'], $id ),
|
477 |
+
'tablet' => self::generate_css( $combined_selectors['tablet'], $id ),
|
478 |
+
'mobile' => self::generate_css( $combined_selectors['mobile'], $id ),
|
479 |
+
);
|
480 |
+
}
|
481 |
+
|
482 |
+
/**
|
483 |
+
* Parse CSS into correct CSS syntax.
|
484 |
+
*
|
485 |
+
* @param array $selectors The block selectors.
|
486 |
+
* @param string $id The selector ID.
|
487 |
+
* @since x.x.x
|
488 |
+
*/
|
489 |
+
public static function generate_css( $selectors, $id ) {
|
490 |
+
$styling_css = '';
|
491 |
+
|
492 |
+
if ( ! empty( $selectors ) ) {
|
493 |
+
foreach ( $selectors as $key => $value ) {
|
494 |
+
|
495 |
+
$css = '';
|
496 |
+
|
497 |
+
foreach ( $value as $j => $val ) {
|
498 |
+
|
499 |
+
if ( 'font-family' === $j && 'Default' === $val ) {
|
500 |
+
continue;
|
501 |
+
}
|
502 |
+
|
503 |
+
if ( ! empty( $val ) || 0 === $val ) {
|
504 |
+
if ( 'font-family' === $j ) {
|
505 |
+
$css .= $j . ': "' . $val . '";';
|
506 |
+
} else {
|
507 |
+
$css .= $j . ': ' . $val . ';';
|
508 |
+
}
|
509 |
+
}
|
510 |
+
}
|
511 |
+
|
512 |
+
if ( ! empty( $css ) ) {
|
513 |
+
$styling_css .= $id;
|
514 |
+
$styling_css .= $key . '{';
|
515 |
+
$styling_css .= $css . '}';
|
516 |
+
}
|
517 |
+
}
|
518 |
+
}
|
519 |
+
|
520 |
+
return $styling_css;
|
521 |
+
}
|
522 |
+
|
523 |
+
/**
|
524 |
+
* Adds Google fonts all blocks.
|
525 |
+
*
|
526 |
+
* @param array $load_google_font the blocks attr.
|
527 |
+
* @param array $font_family the blocks attr.
|
528 |
+
* @param array $font_weight the blocks attr.
|
529 |
+
* @param array $font_subset the blocks attr.
|
530 |
+
*/
|
531 |
+
public static function blocks_google_font( $load_google_font, $font_family, $font_weight, $font_subset ) {
|
532 |
+
|
533 |
+
if ( true === $load_google_font ) {
|
534 |
+
if ( ! array_key_exists( $font_family, self::$gfonts ) ) {
|
535 |
+
$add_font = array(
|
536 |
+
'fontfamily' => $font_family,
|
537 |
+
'fontvariants' => ( isset( $font_weight ) && ! empty( $font_weight ) ? array( $font_weight ) : array() ),
|
538 |
+
'fontsubsets' => ( isset( $font_subset ) && ! empty( $font_subset ) ? array( $font_subset ) : array() ),
|
539 |
+
);
|
540 |
+
self::$gfonts[ $font_family ] = $add_font;
|
541 |
+
} else {
|
542 |
+
if ( isset( $font_weight ) && ! empty( $font_weight ) && ! in_array( $font_weight, self::$gfonts[ $font_family ]['fontvariants'], true ) ) {
|
543 |
+
array_push( self::$gfonts[ $font_family ]['fontvariants'], $font_weight );
|
544 |
+
}
|
545 |
+
if ( isset( $font_subset ) && ! empty( $font_subset ) && ! in_array( $font_subset, self::$gfonts[ $font_family ]['fontsubsets'], true ) ) {
|
546 |
+
array_push( self::$gfonts[ $font_family ]['fontsubsets'], $font_subset );
|
547 |
+
}
|
548 |
+
}
|
549 |
+
}
|
550 |
+
}
|
551 |
+
|
552 |
+
|
553 |
+
/**
|
554 |
+
* Generates CSS recurrsively.
|
555 |
+
*
|
556 |
+
* @param object $block The block object.
|
557 |
+
* @since x.x.x
|
558 |
+
*/
|
559 |
+
public function get_block_css_and_js( $block ) {
|
560 |
+
|
561 |
+
$block = (array) $block;
|
562 |
+
|
563 |
+
$name = $block['blockName'];
|
564 |
+
$css = array();
|
565 |
+
$js = '';
|
566 |
+
$block_id = '';
|
567 |
+
|
568 |
+
if ( isset( $name ) ) {
|
569 |
+
|
570 |
+
if ( isset( $block['attrs'] ) && is_array( $block['attrs'] ) ) {
|
571 |
+
$blockattr = $block['attrs'];
|
572 |
+
if ( isset( $blockattr['block_id'] ) ) {
|
573 |
+
$block_id = $blockattr['block_id'];
|
574 |
+
}
|
575 |
+
}
|
576 |
+
|
577 |
+
self::$current_block_list[] = $name;
|
578 |
+
|
579 |
+
if ( strpos( $name, 'wcfb/' ) !== false ) {
|
580 |
+
self::$cf_flag = true;
|
581 |
+
}
|
582 |
+
|
583 |
+
switch ( $name ) {
|
584 |
+
case 'wcfb/next-step-button':
|
585 |
+
$css = Cartflows_Block_Helper::get_next_step_button_css( $blockattr, $block_id );
|
586 |
+
Cartflows_Block_JS::blocks_next_step_button_gfont( $blockattr );
|
587 |
+
break;
|
588 |
+
|
589 |
+
case 'wcfb/order-detail-form':
|
590 |
+
$css = Cartflows_Block_Helper::get_order_detail_form_css( $blockattr, $block_id );
|
591 |
+
Cartflows_Block_JS::blocks_order_detail_form_gfont( $blockattr );
|
592 |
+
break;
|
593 |
+
|
594 |
+
case 'wcfb/checkout-form':
|
595 |
+
$css = Cartflows_Block_Helper::get_checkout_form_css( $blockattr, $block_id );
|
596 |
+
Cartflows_Block_JS::blocks_checkout_form_gfont( $blockattr );
|
597 |
+
break;
|
598 |
+
|
599 |
+
case 'wcfb/optin-form':
|
600 |
+
$css = Cartflows_Block_Helper::get_optin_form_css( $blockattr, $block_id );
|
601 |
+
Cartflows_Block_JS::blocks_optin_form_gfont( $blockattr );
|
602 |
+
break;
|
603 |
+
|
604 |
+
default:
|
605 |
+
// Nothing to do here.
|
606 |
+
break;
|
607 |
+
}
|
608 |
+
|
609 |
+
if ( isset( $block['innerBlocks'] ) ) {
|
610 |
+
foreach ( $block['innerBlocks'] as $j => $inner_block ) {
|
611 |
+
if ( 'core/block' === $inner_block['blockName'] ) {
|
612 |
+
$id = ( isset( $inner_block['attrs']['ref'] ) ) ? $inner_block['attrs']['ref'] : 0;
|
613 |
+
|
614 |
+
if ( $id ) {
|
615 |
+
$content = get_post_field( 'post_content', $id );
|
616 |
+
|
617 |
+
$reusable_blocks = $this->parse( $content );
|
618 |
+
|
619 |
+
$assets = $this->get_assets( $reusable_blocks );
|
620 |
+
|
621 |
+
self::$stylesheet .= $assets['css'];
|
622 |
+
self::$script .= $assets['js'];
|
623 |
+
}
|
624 |
+
} else {
|
625 |
+
// Get CSS for the Block.
|
626 |
+
$inner_assets = $this->get_block_css_and_js( $inner_block );
|
627 |
+
$inner_block_css = $inner_assets['css'];
|
628 |
+
|
629 |
+
$css_desktop = ( isset( $css['desktop'] ) ? $css['desktop'] : '' );
|
630 |
+
$css_tablet = ( isset( $css['tablet'] ) ? $css['tablet'] : '' );
|
631 |
+
$css_mobile = ( isset( $css['mobile'] ) ? $css['mobile'] : '' );
|
632 |
+
|
633 |
+
if ( isset( $inner_block_css['desktop'] ) ) {
|
634 |
+
$css['desktop'] = $css_desktop . $inner_block_css['desktop'];
|
635 |
+
$css['tablet'] = $css_tablet . $inner_block_css['tablet'];
|
636 |
+
$css['mobile'] = $css_mobile . $inner_block_css['mobile'];
|
637 |
+
}
|
638 |
+
|
639 |
+
$js .= $inner_assets['js'];
|
640 |
+
}
|
641 |
+
}
|
642 |
+
}
|
643 |
+
|
644 |
+
self::$current_block_list = array_unique( self::$current_block_list );
|
645 |
+
}
|
646 |
+
|
647 |
+
return array(
|
648 |
+
'css' => $css,
|
649 |
+
'js' => $js,
|
650 |
+
);
|
651 |
+
|
652 |
+
}
|
653 |
+
|
654 |
+
|
655 |
+
}
|
656 |
+
/**
|
657 |
+
* Prepare if class 'Cartflows_Gb_Helper' exist.
|
658 |
+
* Kicking this off by calling 'get_instance()' method
|
659 |
+
*/
|
660 |
+
Cartflows_Gb_Helper::get_instance();
|
661 |
+
}
|
modules/gutenberg/classes/class-cartflows-gutenberg-editor.php
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Gutenburg Editor Compatibility.
|
4 |
+
*
|
5 |
+
* @package CartFlows
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Checkout Markup
|
10 |
+
*
|
11 |
+
* @since x.x.x
|
12 |
+
*/
|
13 |
+
class Cartflows_Gutenberg_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 |
+
|
39 |
+
add_action( 'admin_init', array( $this, 'gutenberg_editor_compatibility' ) );
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Gutenburg editor compatibility.
|
44 |
+
*/
|
45 |
+
public function gutenberg_editor_compatibility() {
|
46 |
+
|
47 |
+
if ( is_admin() && isset( $_REQUEST['action'] ) ) { //phpcs:ignore
|
48 |
+
|
49 |
+
$current_post_id = false;
|
50 |
+
|
51 |
+
if ( 'edit' === $_REQUEST['action'] && isset( $_GET['post'] ) ) { //phpcs:ignore
|
52 |
+
$current_post_id = intval( $_GET['post'] ); //phpcs:ignore
|
53 |
+
} elseif ( isset( $_REQUEST['cartflows_gb'] ) && isset( $_POST['id'] ) ){ //phpcs:ignore
|
54 |
+
$current_post_id = intval( $_POST['id'] ); //phpcs:ignore
|
55 |
+
}
|
56 |
+
|
57 |
+
if ( $current_post_id ) {
|
58 |
+
|
59 |
+
$current_post_type = get_post_type( $current_post_id );
|
60 |
+
|
61 |
+
if ( wcf()->utils->is_step_post_type( $current_post_type ) ) {
|
62 |
+
|
63 |
+
if ( wcf()->is_woo_active ) {
|
64 |
+
|
65 |
+
$this->maybe_init_cart();
|
66 |
+
|
67 |
+
/* Load woo templates from plugin */
|
68 |
+
$cf_frontend = Cartflows_Frontend::get_instance();
|
69 |
+
add_filter( 'woocommerce_locate_template', array( $cf_frontend, 'override_woo_template' ), 20, 3 );
|
70 |
+
|
71 |
+
add_action( 'cartflows_gutenberg_before_checkout_shortcode', array( $this, 'before_gb_checkout_shortcode_actions' ) );
|
72 |
+
|
73 |
+
add_action( 'cartflows_gutenberg_before_optin_shortcode', array( $this, 'before_gb_optin_shortcode_actions' ) );
|
74 |
+
}
|
75 |
+
|
76 |
+
do_action( 'cartflows_gutenberg_editor_compatibility', $current_post_id );
|
77 |
+
}
|
78 |
+
}
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Before checkout shortcode actions.
|
85 |
+
*/
|
86 |
+
public function maybe_init_cart() {
|
87 |
+
|
88 |
+
wc()->frontend_includes();
|
89 |
+
|
90 |
+
$has_cart = is_a( WC()->cart, 'WC_Cart' );
|
91 |
+
|
92 |
+
if ( ! $has_cart ) {
|
93 |
+
$session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' );
|
94 |
+
WC()->session = new $session_class();
|
95 |
+
WC()->session->init();
|
96 |
+
WC()->cart = new \WC_Cart();
|
97 |
+
WC()->customer = new \WC_Customer( get_current_user_id(), true );
|
98 |
+
|
99 |
+
}
|
100 |
+
|
101 |
+
/* For preview */
|
102 |
+
add_filter( 'woocommerce_checkout_redirect_empty_cart', '__return_false' );
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Before checkout shortcode actions.
|
107 |
+
*
|
108 |
+
* @param int $checkout_id checkout id.
|
109 |
+
*/
|
110 |
+
public function before_gb_checkout_shortcode_actions( $checkout_id ) {
|
111 |
+
|
112 |
+
do_action( 'cartflows_checkout_before_shortcode', $checkout_id );
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Before optin shortcode actions.
|
117 |
+
*
|
118 |
+
* @param int $checkout_id checkout id.
|
119 |
+
*/
|
120 |
+
public function before_gb_optin_shortcode_actions( $checkout_id ) {
|
121 |
+
|
122 |
+
do_action( 'cartflows_optin_before_shortcode', $checkout_id );
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Kicking this off by calling 'get_instance()' method
|
128 |
+
*/
|
129 |
+
Cartflows_Gutenberg_Editor::get_instance();
|
modules/gutenberg/classes/class-cartflows-init-blocks.php
ADDED
@@ -0,0 +1,339 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Cartflows Blocks Initializer
|
4 |
+
*
|
5 |
+
* Enqueue CSS/JS of all the blocks.
|
6 |
+
*
|
7 |
+
* @since x.x.x
|
8 |
+
* @package Cartflows
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
+
exit; // Exit if accessed directly.
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Cartflows_Init_Blocks.
|
17 |
+
*
|
18 |
+
* @package Cartflows
|
19 |
+
*/
|
20 |
+
class Cartflows_Init_Blocks {
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Member Variable
|
24 |
+
*
|
25 |
+
* @var instance
|
26 |
+
*/
|
27 |
+
private static $instance;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Initiator
|
31 |
+
*/
|
32 |
+
public static function get_instance() {
|
33 |
+
if ( ! isset( self::$instance ) ) {
|
34 |
+
self::$instance = new self();
|
35 |
+
}
|
36 |
+
return self::$instance;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Constructor
|
41 |
+
*/
|
42 |
+
public function __construct() {
|
43 |
+
|
44 |
+
// Hook: Frontend assets.
|
45 |
+
add_action( 'enqueue_block_assets', array( $this, 'block_assets' ) );
|
46 |
+
|
47 |
+
// Hook: Editor assets.
|
48 |
+
add_action( 'enqueue_block_editor_assets', array( $this, 'editor_assets' ) );
|
49 |
+
|
50 |
+
add_filter( 'block_categories', array( $this, 'register_block_category' ), 10, 2 );
|
51 |
+
|
52 |
+
add_action( 'wp_ajax_wpcf_order_detail_form_shortcode', array( $this, 'order_detail_form_shortcode' ) );
|
53 |
+
add_action( 'wp_ajax_wpcf_order_checkout_form_shortcode', array( $this, 'order_checkout_form_shortcode' ) );
|
54 |
+
add_action( 'wp_ajax_wpcf_optin_form_shortcode', array( $this, 'optin_form_shortcode' ) );
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Renders the Order Detail Form shortcode.
|
59 |
+
*
|
60 |
+
* @since x.x.x
|
61 |
+
*/
|
62 |
+
public function order_detail_form_shortcode() {
|
63 |
+
|
64 |
+
check_ajax_referer( 'wpcf_ajax_nonce', 'nonce' );
|
65 |
+
|
66 |
+
add_filter(
|
67 |
+
'cartflows_show_demo_order_details',
|
68 |
+
function() {
|
69 |
+
return true;
|
70 |
+
}
|
71 |
+
);
|
72 |
+
|
73 |
+
if ( ! empty( $_POST['thanyouText'] ) ) {
|
74 |
+
|
75 |
+
add_filter(
|
76 |
+
'cartflows_thankyou_meta_wcf-tq-text',
|
77 |
+
function( $text ) {
|
78 |
+
check_ajax_referer( 'wpcf_ajax_nonce', 'nonce' );
|
79 |
+
|
80 |
+
$text = isset( $_POST['thanyouText'] ) ? sanitize_text_field( wp_unslash( $_POST['thanyouText'] ) ) : '';
|
81 |
+
|
82 |
+
return $text;
|
83 |
+
},
|
84 |
+
10,
|
85 |
+
1
|
86 |
+
);
|
87 |
+
}
|
88 |
+
|
89 |
+
$data['html'] = do_shortcode( '[cartflows_order_details]' );
|
90 |
+
|
91 |
+
wp_send_json_success( $data );
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Renders the Order Checkout Form shortcode.
|
96 |
+
*
|
97 |
+
* @since x.x.x
|
98 |
+
*/
|
99 |
+
public function order_checkout_form_shortcode() {
|
100 |
+
check_ajax_referer( 'wpcf_ajax_nonce', 'nonce' );
|
101 |
+
|
102 |
+
add_filter(
|
103 |
+
'cartflows_show_demo_checkout',
|
104 |
+
function() {
|
105 |
+
return true;
|
106 |
+
}
|
107 |
+
);
|
108 |
+
|
109 |
+
if( isset( $_POST['id'] ) ){ //phpcs:ignore
|
110 |
+
$checkout_id = intval( $_POST['id'] ); //phpcs:ignore
|
111 |
+
}
|
112 |
+
|
113 |
+
$products = wcf()->utils->get_selected_checkout_products( $checkout_id );
|
114 |
+
|
115 |
+
if ( ! is_array( $products ) || empty( $products[0]['product'] ) ) {
|
116 |
+
wc_clear_notices();
|
117 |
+
wc_add_notice( __( 'No product is selected. Please select products from the checkout meta settings to continue.', 'cartflows' ), 'error' );
|
118 |
+
}
|
119 |
+
|
120 |
+
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form' );
|
121 |
+
|
122 |
+
add_action( 'woocommerce_checkout_order_review', array( Cartflows_Checkout_Markup::get_instance(), 'display_custom_coupon_field' ) );
|
123 |
+
|
124 |
+
$attributes['layout'] = isset( $_POST['layout'] ) ? sanitize_title( wp_unslash( $_POST['layout'] ) ) : '';
|
125 |
+
$attributes['obposition'] = isset( $_POST['obposition'] ) ? sanitize_title( wp_unslash( $_POST['obposition'] ) ) : '';
|
126 |
+
$attributes['orderBumpSkin'] = isset( $_POST['orderBumpSkin'] ) ? sanitize_title( wp_unslash( $_POST['orderBumpSkin'] ) ) : '';
|
127 |
+
$attributes['orderBumpCheckboxArrow'] = isset( $_POST['orderBumpCheckboxArrow'] ) ? sanitize_title( wp_unslash( $_POST['orderBumpCheckboxArrow'] ) ) : '';
|
128 |
+
$attributes['orderBumpCheckboxArrowAnimation'] = isset( $_POST['orderBumpCheckboxArrowAnimation'] ) ? sanitize_title( wp_unslash( $_POST['orderBumpCheckboxArrowAnimation'] ) ) : '';
|
129 |
+
$attributes['sectionposition'] = isset( $_POST['sectionposition'] ) ? sanitize_title( wp_unslash( $_POST['sectionposition'] ) ) : '';
|
130 |
+
$attributes['productOptionsSkin'] = isset( $_POST['productOptionsSkin'] ) ? sanitize_title( wp_unslash( $_POST['productOptionsSkin'] ) ) : '';
|
131 |
+
$attributes['productOptionsImages'] = isset( $_POST['productOptionsImages'] ) ? sanitize_title( wp_unslash( $_POST['productOptionsImages'] ) ) : '';
|
132 |
+
$attributes['productOptionsSectionTitleText'] = isset( $_POST['productOptionsSectionTitleText'] ) ? sanitize_text_field( wp_unslash( $_POST['productOptionsSectionTitleText'] ) ) : '';
|
133 |
+
$attributes['PreSkipText'] = isset( $_POST['PreSkipText'] ) ? sanitize_title( wp_unslash( $_POST['PreSkipText'] ) ) : '';
|
134 |
+
$attributes['PreOrderText'] = isset( $_POST['PreOrderText'] ) ? sanitize_title( wp_unslash( $_POST['PreOrderText'] ) ) : '';
|
135 |
+
$attributes['PreProductTitleText'] = isset( $_POST['PreProductTitleText'] ) ? sanitize_title( wp_unslash( $_POST['PreProductTitleText'] ) ) : '';
|
136 |
+
$attributes['preSubTitleText'] = isset( $_POST['preSubTitleText'] ) ? sanitize_title( wp_unslash( $_POST['preSubTitleText'] ) ) : '';
|
137 |
+
$attributes['preTitleText'] = isset( $_POST['preTitleText'] ) ? sanitize_title( wp_unslash( $_POST['preTitleText'] ) ) : '';
|
138 |
+
$attributes['PreProductDescText'] = isset( $_POST['PreProductDescText'] ) ? sanitize_title( wp_unslash( $_POST['PreProductDescText'] ) ) : '';
|
139 |
+
$attributes['orderBumpCheckboxLabel'] = isset( $_POST['orderBumpCheckboxLabel'] ) ? sanitize_text_field( wp_unslash( $_POST['orderBumpCheckboxLabel'] ) ) : '';
|
140 |
+
$attributes['orderBumpHighlightText'] = isset( $_POST['orderBumpHighlightText'] ) ? sanitize_text_field( wp_unslash( $_POST['orderBumpHighlightText'] ) ) : '';
|
141 |
+
$attributes['orderBumpCheckboxProductDescription'] = isset( $_POST['orderBumpCheckboxProductDescription'] ) ? sanitize_text_field( wp_unslash( $_POST['orderBumpCheckboxProductDescription'] ) ) : '';
|
142 |
+
$attributes['inputSkins'] = isset( $_POST['inputSkins'] ) ? sanitize_title( wp_unslash( $_POST['inputSkins'] ) ) : '';
|
143 |
+
$attributes['enableNote'] = isset( $_POST['enableNote'] ) ? sanitize_title( wp_unslash( $_POST['enableNote'] ) ) : '';
|
144 |
+
$attributes['noteText'] = isset( $_POST['noteText'] ) ? sanitize_text_field( wp_unslash( $_POST['noteText'] ) ) : '';
|
145 |
+
$attributes['stepOneTitleText'] = isset( $_POST['stepOneTitleText'] ) ? sanitize_text_field( wp_unslash( $_POST['stepOneTitleText'] ) ) : '';
|
146 |
+
$attributes['stepOneSubTitleText'] = isset( $_POST['stepOneSubTitleText'] ) ? sanitize_text_field( wp_unslash( $_POST['stepOneSubTitleText'] ) ) : '';
|
147 |
+
$attributes['stepTwoTitleText'] = isset( $_POST['stepTwoTitleText'] ) ? sanitize_text_field( wp_unslash( $_POST['stepTwoTitleText'] ) ) : '';
|
148 |
+
$attributes['stepTwoSubTitleText'] = isset( $_POST['stepTwoSubTitleText'] ) ? sanitize_text_field( wp_unslash( $_POST['stepTwoSubTitleText'] ) ) : '';
|
149 |
+
$attributes['offerButtonTitleText'] = isset( $_POST['offerButtonTitleText'] ) ? sanitize_text_field( wp_unslash( $_POST['offerButtonTitleText'] ) ) : '';
|
150 |
+
$attributes['offerButtonSubTitleText'] = isset( $_POST['offerButtonSubTitleText'] ) ? sanitize_text_field( wp_unslash( $_POST['offerButtonSubTitleText'] ) ) : '';
|
151 |
+
|
152 |
+
do_action( 'cartflows_gutenberg_checkout_options_filters', $attributes );
|
153 |
+
|
154 |
+
$data['html'] = do_shortcode( '[cartflows_checkout]' );
|
155 |
+
|
156 |
+
wp_send_json_success( $data );
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Renders the Optin Form shortcode.
|
161 |
+
*
|
162 |
+
* @since x.x.x
|
163 |
+
*/
|
164 |
+
public function optin_form_shortcode() {
|
165 |
+
|
166 |
+
check_ajax_referer( 'wpcf_ajax_nonce', 'nonce' );
|
167 |
+
|
168 |
+
add_filter(
|
169 |
+
'cartflows_show_demo_optin_form',
|
170 |
+
function() {
|
171 |
+
return true;
|
172 |
+
}
|
173 |
+
);
|
174 |
+
|
175 |
+
if( isset( $_POST['id'] ) ){ //phpcs:ignore
|
176 |
+
$optin_id = intval( $_POST['id'] ); //phpcs:ignore
|
177 |
+
}
|
178 |
+
|
179 |
+
$products = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-product' );
|
180 |
+
if ( is_array( $products ) && count( $products ) < 1 ) {
|
181 |
+
wc_clear_notices();
|
182 |
+
wc_add_notice( __( 'No product is selected. Please select a Simple, Virtual and Free product from the meta settings.', 'cartflows' ), 'error' );
|
183 |
+
}
|
184 |
+
|
185 |
+
add_filter( 'woocommerce_cart_needs_payment', '__return_false' );
|
186 |
+
add_filter( 'woocommerce_enable_order_notes_field', '__return_false' );
|
187 |
+
add_filter( 'woocommerce_cart_needs_shipping_address', '__return_false' );
|
188 |
+
|
189 |
+
$data['html'] = do_shortcode( '[cartflows_optin]' );
|
190 |
+
$data['buttonText'] = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-text' );
|
191 |
+
wp_send_json_success( $data );
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Enqueue Gutenberg block assets for both frontend + backend.
|
196 |
+
*
|
197 |
+
* @since x.x.x
|
198 |
+
*/
|
199 |
+
public function block_assets() {
|
200 |
+
|
201 |
+
global $post;
|
202 |
+
|
203 |
+
if ( $post && CARTFLOWS_STEP_POST_TYPE === $post->post_type ) {
|
204 |
+
|
205 |
+
// Register block styles for both frontend + backend.
|
206 |
+
wp_enqueue_style(
|
207 |
+
'CF_block-cartflows-style-css', // Handle.
|
208 |
+
CARTFLOWS_URL . 'modules/gutenberg/dist/blocks.style.build.css',
|
209 |
+
is_admin() ? array( 'wp-editor' ) : null, // Dependency to include the CSS after it.
|
210 |
+
CARTFLOWS_VER // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time.
|
211 |
+
);
|
212 |
+
}
|
213 |
+
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Enqueue assets for both backend.
|
218 |
+
*
|
219 |
+
* @since x.x.x
|
220 |
+
*/
|
221 |
+
public function editor_assets() {
|
222 |
+
|
223 |
+
$post_id = isset( $_GET['post'] ) ? intval( $_GET['post'] ) : 0; //phpcs:ignore
|
224 |
+
$post_type = get_post_type( $post_id );
|
225 |
+
|
226 |
+
if ( CARTFLOWS_STEP_POST_TYPE === $post_type ) {
|
227 |
+
|
228 |
+
$wpcf_ajax_nonce = wp_create_nonce( 'wpcf_ajax_nonce' );
|
229 |
+
$step_type = wcf()->utils->get_step_type( $post_id );
|
230 |
+
$show_checkout_pro_opt = apply_filters( 'cartflows_show_checkout_pro_opt', false );
|
231 |
+
|
232 |
+
if ( 'optin' === $step_type ) {
|
233 |
+
wp_enqueue_style( 'wcf-optin-template', wcf()->utils->get_css_url( 'optin-template' ), '', CARTFLOWS_VER );
|
234 |
+
}
|
235 |
+
if ( 'checkout' === $step_type ) {
|
236 |
+
wp_enqueue_style( 'wcf-checkout-template', wcf()->utils->get_css_url( 'checkout-template' ), '', CARTFLOWS_VER );
|
237 |
+
}
|
238 |
+
|
239 |
+
// Register block editor script for backend.
|
240 |
+
wp_register_script(
|
241 |
+
'CF_block-cartflows-block-js', // Handle.
|
242 |
+
CARTFLOWS_URL . 'modules/gutenberg/dist/blocks.build.js',
|
243 |
+
array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ), // Dependencies, defined above.
|
244 |
+
CARTFLOWS_VER, // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: filemtime — Gets file modification time.
|
245 |
+
true // Enqueue the script in the footer.
|
246 |
+
);
|
247 |
+
|
248 |
+
// Register block editor styles for backend.
|
249 |
+
wp_register_style(
|
250 |
+
'CF_block-cartflows-block-editor-css', // Handle.
|
251 |
+
CARTFLOWS_URL . 'modules/gutenberg/dist/blocks.editor.build.css',
|
252 |
+
array( 'wp-edit-blocks' ), // Dependency to include the CSS after it.
|
253 |
+
CARTFLOWS_VER // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time.
|
254 |
+
);
|
255 |
+
|
256 |
+
// Common Editor style.
|
257 |
+
wp_enqueue_style(
|
258 |
+
'CF_block-common-editor-css', // Handle.
|
259 |
+
CARTFLOWS_URL . 'modules/gutenberg/dist/blocks.commoneditorstyle.build.css',
|
260 |
+
array( 'wp-edit-blocks' ), // Dependency to include the CSS after it.
|
261 |
+
CARTFLOWS_VER // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time.
|
262 |
+
);
|
263 |
+
|
264 |
+
// Enqueue frontend CSS in editor.
|
265 |
+
wp_enqueue_style( 'CF_block-cartflows-frotend-style', CARTFLOWS_URL . 'assets/css/frontend.css', array(), CARTFLOWS_VER );
|
266 |
+
|
267 |
+
// WP Localized globals. Use dynamic PHP stuff in JavaScript via `cartflowsGlobal` object.
|
268 |
+
wp_localize_script(
|
269 |
+
'CF_block-cartflows-block-js',
|
270 |
+
'cf_blocks_info', // Array containing dynamic data for a JS Global.
|
271 |
+
array(
|
272 |
+
'pluginDirPath' => plugin_dir_path( __DIR__ ),
|
273 |
+
'pluginDirUrl' => plugin_dir_url( __DIR__ ),
|
274 |
+
'category' => 'cartflows',
|
275 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
276 |
+
'wpcf_ajax_nonce' => $wpcf_ajax_nonce,
|
277 |
+
'blocks' => Cartflows_Block_Config::get_block_attributes(),
|
278 |
+
'tablet_breakpoint' => CF_TABLET_BREAKPOINT,
|
279 |
+
'mobile_breakpoint' => CF_MOBILE_BREAKPOINT,
|
280 |
+
'show_checkout_pro_opt' => $show_checkout_pro_opt,
|
281 |
+
'ID' => $post_id,
|
282 |
+
'step_type' => $step_type,
|
283 |
+
'is_cartflows_pro_install' => _is_cartflows_pro(),
|
284 |
+
'is_woo_active' => wcf()->is_woo_active,
|
285 |
+
// Add more data here that you want to access from `cartflowsGlobal` object.
|
286 |
+
)
|
287 |
+
);
|
288 |
+
|
289 |
+
/**
|
290 |
+
* Register Gutenberg block on server-side.
|
291 |
+
*
|
292 |
+
* Register the block on server-side to ensure that the block
|
293 |
+
* scripts and styles for both frontend and backend are
|
294 |
+
* enqueued when the editor loads.
|
295 |
+
*
|
296 |
+
* @link https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type#enqueuing-block-scripts
|
297 |
+
* @since x.x.x
|
298 |
+
*/
|
299 |
+
register_block_type(
|
300 |
+
'wcfb/next-step-button',
|
301 |
+
array(
|
302 |
+
// Enqueue blocks.build.js in the editor only.
|
303 |
+
'editor_script' => 'CF_block-cartflows-block-js',
|
304 |
+
// Enqueue blocks.editor.build.css in the editor only.
|
305 |
+
'style' => 'CF_block-cartflows-block-editor-css',
|
306 |
+
// Enqueue blocks.commoneditorstyle.build.css in the editor only.
|
307 |
+
'editor_style' => 'CF_block-common-editor-css',
|
308 |
+
)
|
309 |
+
);
|
310 |
+
|
311 |
+
}
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Gutenberg block category for WCFB.
|
316 |
+
*
|
317 |
+
* @param array $categories Block categories.
|
318 |
+
* @param object $post Post object.
|
319 |
+
* @since x.x.x
|
320 |
+
*/
|
321 |
+
public function register_block_category( $categories, $post ) {
|
322 |
+
return array_merge(
|
323 |
+
$categories,
|
324 |
+
array(
|
325 |
+
array(
|
326 |
+
'slug' => 'cartflows',
|
327 |
+
'title' => __( 'Cartflows', 'cartflows' ),
|
328 |
+
),
|
329 |
+
)
|
330 |
+
);
|
331 |
+
}
|
332 |
+
|
333 |
+
}
|
334 |
+
|
335 |
+
/**
|
336 |
+
* Prepare if class 'Cartflows_Init_Blocks' exist.
|
337 |
+
* Kicking this off by calling 'get_instance()' method
|
338 |
+
*/
|
339 |
+
Cartflows_Init_Blocks::get_instance();
|
modules/gutenberg/dist/blocks.build.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){function t(r){if(a[r])return a[r].exports;var n=a[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var a={};t.m=e,t.c=a,t.d=function(e,a,r){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=70)}([function(e,t){function a(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function n(e){if(u===setTimeout)return setTimeout(e,0);if((u===a||!u)&&setTimeout)return u=setTimeout,setTimeout(e,0);try{return u(e,0)}catch(t){try{return u.call(null,e,0)}catch(t){return u.call(this,e,0)}}}function l(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function c(){f&&m&&(f=!1,m.length?v=m.concat(v):p=-1,v.length&&o())}function o(){if(!f){var e=n(c);f=!0;for(var t=v.length;t;){for(m=v,v=[];++p<t;)m&&m[p].run();p=-1,t=v.length}m=null,f=!1,l(e)}}function i(e,t){this.fun=e,this.array=t}function s(){}var u,d,h=e.exports={};!function(){try{u="function"===typeof setTimeout?setTimeout:a}catch(e){u=a}try{d="function"===typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var m,v=[],f=!1,p=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)t[a-1]=arguments[a];v.push(new i(e,t)),1!==v.length||f||n(o)},i.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=s,h.addListener=s,h.once=s,h.off=s,h.removeListener=s,h.removeAllListeners=s,h.emit=s,h.prependListener=s,h.prependOnceListener=s,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(e,t,a){"use strict";(function(t){"production"===t.env.NODE_ENV?e.exports=a(165):e.exports=a(166)}).call(t,a(0))},function(e,t,a){(function(t){if("production"!==t.env.NODE_ENV){var r=a(58);e.exports=a(183)(r.isElement,!0)}else e.exports=a(184)()}).call(t,a(0))},function(e,t,a){var r=a(40),n="object"==typeof self&&self&&self.Object===Object&&self,l=r||n||Function("return this")();e.exports=l},function(e,t){var a=Array.isArray;e.exports=a},function(e,t,a){"use strict";var r=wp.element.createElement,n={simple_block:r("svg",{width:20,height:20},r("path",{fill:"#4a00e0",d:"M20 18.008h-20v-16.016h20v16.016zM1.172 16.836h17.656v-13.672h-17.656v13.672z"}),r("path",{fill:"#4a00e0",d:"M7.617 4.604h4.766v1.172h-4.766v-1.172z"}),r("path",{fill:"#4a00e0",d:"M8.998 14.385h-6.237v-6.238h6.238v6.238zM3.932 13.213h3.894v-3.894h-3.894v3.894z"}),r("path",{fill:"#4a00e0",d:"M17.24 11.852h-6.237v-3.705h6.238v3.705zM12.174 10.68h3.894v-1.361h-3.894v1.361z"}),r("path",{fill:"#4a00e0",d:"M11.588 13.024h5.066v1.172h-5.066v-1.172z"})),top_margin:r("svg",{width:20,height:20},r("path",{fill:"#999",d:"M17 1c1.103 0 2 0.897 2 2v14c0 1.103-0.897 2-2 2h-14c-1.103 0-2-0.897-2-2v-14c0-1.103 0.897-2 2-2h14zM17 0h-14c-1.657 0-3 1.343-3 3v14c0 1.657 1.343 3 3 3h14c1.657 0 3-1.343 3-3v-14c0-1.657-1.343-3-3-3v0z"}),r("path",{fill:"#575E67",d:"M17 0.984h-14c-1.103 0-2 0.897-2 2v0.797h18v-0.797c0-1.103-0.897-2-2-2z"})),bottom_margin:r("svg",{width:20,height:20},r("path",{fill:"#999",d:"M17 1c1.103 0 2 0.897 2 2v14c0 1.103-0.897 2-2 2h-14c-1.103 0-2-0.897-2-2v-14c0-1.103 0.897-2 2-2h14zM17 0h-14c-1.657 0-3 1.343-3 3v14c0 1.656 1.343 3 3 3h14c1.657 0 3-1.343 3-3v-14c0-1.657-1.343-3-3-3v0z"}),r("path",{fill:"#575E67",d:"M3 19.016h14c1.103 0 2-0.896 2-2v-0.797h-18v0.797c0 1.103 0.897 2 2 2z"})),left_margin:r("svg",{width:20,height:20},r("path",{fill:"#999",d:"M17 0.999c1.103 0 2 0.897 2 2v14c0 1.103-0.897 2-2 2h-14c-1.103 0-2-0.897-2-2v-14c0-1.103 0.897-2 2-2h14zM17-0.001h-14c-1.656 0-3 1.343-3 3v14c0 1.657 1.343 3 3 3h14c1.657 0 3-1.343 3-3v-14c0-1.657-1.343-3-3-3v0z"}),r("path",{fill:"#575E67",d:"M0.984 2.999v14c0 1.103 0.896 2 2 2h0.797v-18h-0.797c-1.104 0-2 0.897-2 2z"})),right_margin:r("svg",{width:20,height:20},r("path",{fill:"#999",d:"M17 0.999c1.103 0 2 0.897 2 2v14c0 1.103-0.897 2-2 2h-14c-1.103 0-2-0.897-2-2v-14c0-1.103 0.897-2 2-2h14zM17-0.001h-14c-1.657 0-3 1.343-3 3v14c0 1.657 1.343 3 3 3h14c1.656 0 3-1.343 3-3v-14c0-1.657-1.343-3-3-3v0z"}),r("path",{fill:"#575E67",d:"M19.015 16.999v-14c0-1.103-0.896-2-2-2h-0.797v18h0.797c1.104 0 2-0.896 2-2z"})),vertical_spacing:r("svg",{width:20,height:20},r("path",{fill:"#999",d:"M17 0.999c1.103 0 2 0.897 2 2v14c0 1.103-0.897 2-2 2h-14c-1.103 0-2-0.897-2-2v-14c0-1.103 0.897-2 2-2h14zM17-0.001h-14c-1.657 0-3 1.343-3 3v14c0 1.657 1.343 3 3 3h14c1.657 0 3-1.343 3-3v-14c0-1.656-1.343-3-3-3v0z"}),r("path",{fill:"#575E67",d:"M17 0.983h-14c-1.103 0-2 0.896-2 2v0.797h18v-0.797c0-1.103-0.896-2-2-2z"}),r("path",{fill:"#575E67",d:"M3 19.031h14c1.103 0 2-0.896 2-2v-0.797h-18v0.797c0 1.104 0.896 2 2 2z"})),horizontal_spacing:r("svg",{width:20,height:20},r("path",{fill:"#999",d:"M17 0.999c1.103 0 2 0.897 2 2v14c0 1.103-0.897 2-2 2h-14c-1.103 0-2-0.897-2-2v-14c0-1.103 0.897-2 2-2h14zM17-0.001h-14c-1.657 0-3 1.343-3 3v14c0 1.657 1.343 3 3 3h14c1.656 0 3-1.343 3-3v-14c0-1.657-1.343-3-3-3v0z"}),r("path",{fill:"#575E67",d:"M19.016 16.999v-14c0-1.103-0.896-2-2-2h-0.797v18h0.797c1.103 0 2-0.896 2-2z"}),r("path",{fill:"#575E67",d:"M0.968 2.999v14c0 1.103 0.896 2 2 2h0.797v-18h-0.797c-1.104 0-2 0.897-2 2z"})),order_detail:r("svg",{width:20,height:20,viewBox:"0 0 32 32"},r("path",{fill:"#f16334",d:"M30.067 0c1.273 0 1.933 0.861 1.933 1.919v28.163c0 1.058-0.66 1.918-1.933 1.918h-28.196c-1.273 0-1.871-0.86-1.871-1.918v-28.163c0-1.058 0.598-1.919 1.871-1.919h28.196zM30.195 30.784c0.331 0 0.6-0.268 0.6-0.6 0-3.806 0-24.563 0-28.369 0-0.331-0.269-0.6-0.6-0.6-3.797 0-24.464 0-28.261 0-0.331 0-0.6 0.268-0.6 0.6 0 3.806 0 24.563 0 28.369 0 0.331 0.268 0.6 0.6 0.6 3.797 0 24.464 0 28.261 0zM6.177 27.095h-0.94c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h0.94c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM20.865 27.095h-0.94c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h0.94c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM17.487 27.095h-9.121c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h9.121c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM26.763 27.095h-3.118c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h3.118c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM6.177 24.401h-0.94c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h0.94c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM20.865 24.401h-0.94c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h0.94c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM17.487 24.401h-9.121c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h9.121c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM26.763 24.401h-3.118c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h3.118c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM6.177 21.706h-0.94c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h0.94c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM20.865 21.706h-0.94c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h0.94c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM17.487 21.706h-9.121c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h9.121c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM26.763 21.706h-3.118c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h3.118c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM6.177 19.011h-0.94c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h0.94c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM20.865 19.011h-0.94c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h0.94c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM17.487 19.011h-9.121c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h9.121c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM26.763 19.011h-3.118c-0.356 0-0.645-0.31-0.645-0.693s0.289-0.693 0.645-0.693h3.118c0.356 0 0.645 0.31 0.645 0.693s-0.289 0.693-0.645 0.693zM11.12 7.213c0.006-0.053 0.022-0.106 0.049-0.157 0.032-0.061 0.076-0.115 0.129-0.158 0.023-0.019 0.048-0.034 0.073-0.049l4.389-2.443c0.131-0.068 0.163-0.068 0.261-0.064 0.008 0 0.016 0 0.025 0 0.037 0.003 0.073 0.009 0.108 0.018 0.064 0.014 0.105 0.034 0.136 0.057l4.257 2.379c0.026 0.008 0.043 0.017 0.067 0.029l0.001 0.001c0.045 0.018 0.074 0.040 0.098 0.064 0.112 0.095 0.181 0.24 0.187 0.391v4.816c-0.007 0.181-0.101 0.345-0.258 0.441l-4.389 2.466c-0.11 0.056-0.147 0.059-0.216 0.064-0.030 0.002-0.061 0.001-0.090-0.004-0.041-0.004-0.081-0.013-0.12-0.028-0.031-0.012-0.038-0.017-0.068-0.032l-4.401-2.455c-0.156-0.095-0.253-0.259-0.26-0.443l0.012-4.817c0.001-0.026 0.004-0.051 0.009-0.076zM12.112 11.811l3.388 1.89v-3.702l-3.379-1.854c-0.003 1.222-0.006 2.445-0.009 3.667zM19.889 8.151l-3.377 1.88v3.667l3.377-1.898v-3.649zM14.873 8.5l1.163 0.638 3.321-1.849-1.152-0.644-3.331 1.854zM12.663 7.287l1.162 0.638 3.341-1.86-1.152-0.644-3.352 1.866z"})),next_step:r("svg",{width:20,height:20,viewBox:"0 0 32 32"},r("path",{fill:"#f16334",d:"M4.622 16.64c-2.595 0.267-4.622 2.462-4.622 5.127 0 2.845 2.31 5.154 5.154 5.154s5.154-2.31 5.154-5.154c0-2.666-2.029-4.862-4.625-5.128l0.004-0.026c0.002-1.609 0.238-3.219 0.814-4.714 0.822-2.136 2.388-3.97 4.387-5.055 3.761-2.040 8.61-1.478 11.786 1.212 1.915 1.622 3.066 3.96 3.47 6.416l-0.588-0.56-0.019-0.017-0.020-0.016-0.021-0.015-0.021-0.014-0.022-0.013-0.023-0.012-0.023-0.011-0.024-0.010-0.024-0.009-0.025-0.008-0.025-0.007-0.025-0.005-0.025-0.004-0.026-0.003-0.026-0.002-0.026-0-0.026 0.001-0.026 0.002-0.025 0.003-0.025 0.005-0.025 0.006-0.025 0.007-0.024 0.008-0.024 0.009-0.023 0.011-0.023 0.012-0.022 0.013-0.022 0.014-0.021 0.015-0.020 0.016-0.019 0.017-0.019 0.018-0.018 0.019-0.017 0.019-0.016 0.020-0.015 0.021-0.014 0.022-0.013 0.022-0.012 0.023-0.011 0.023-0.009 0.024-0.008 0.024-0.007 0.025-0.006 0.025-0.005 0.025-0.003 0.026-0.002 0.026-0.001 0.026 0 0.026 0.002 0.026 0.003 0.026 0.004 0.025 0.005 0.025 0.006 0.025 0.008 0.025 0.009 0.024 0.010 0.024 0.011 0.023 0.012 0.023 0.013 0.022 0.014 0.021 0.016 0.021 0.016 0.020 0.017 0.019 2.043 1.946c-2.845 0-5.154 2.31-5.154 5.154s2.309 5.154 5.154 5.154c2.845 0 5.154-2.31 5.154-5.154s-2.31-5.154-5.154-5.154l0.35-0.367c0.020-0.018 0.036-0.035 0.049-0.052l1.546-1.625 0.016-0.020 0.015-0.021 0.014-0.021 0.013-0.022 0.012-0.023 0.011-0.023 0.010-0.024 0.009-0.024 0.008-0.025 0.006-0.025 0.005-0.025 0.004-0.025 0.003-0.026 0.002-0.026 0-0.026-0.001-0.026-0.002-0.026-0.003-0.026-0.005-0.025-0.006-0.025-0.007-0.025-0.008-0.024-0.009-0.024-0.011-0.023-0.012-0.023-0.013-0.022-0.014-0.022-0.015-0.021-0.016-0.020-0.017-0.020-0.018-0.019-0.019-0.018-0.020-0.017-0.020-0.016-0.021-0.015-0.022-0.014-0.022-0.013-0.023-0.012-0.024-0.010-0.024-0.010-0.024-0.008-0.025-0.007-0.025-0.006-0.025-0.005-0.026-0.003-0.026-0.002-0.026-0.001-0.026 0-0.026 0.001-0.026 0.003-0.026 0.004-0.025 0.005-0.025 0.006-0.025 0.008-0.024 0.009-0.024 0.010-0.023 0.011-0.023 0.012-0.022 0.013-0.021 0.014-0.021 0.015-0.020 0.016-0.019 0.017-0.018 0.018-0.751 0.788c-0.187-1.399-0.583-2.774-1.223-4.028-1.931-3.783-5.997-6.052-10.146-6.068-0.022 0-0.043 0-0.065 0-3.204 0.014-6.372 1.37-8.426 3.779-1.9 2.227-2.737 5.196-2.768 8.104-0 0.046-0.001 0.093-0.001 0.139 0 0.027 0 0.051 0.001 0.074zM26.846 17.711c2.239 0 4.057 1.818 4.057 4.057s-1.818 4.057-4.057 4.057c-2.239 0-4.057-1.818-4.057-4.057s1.818-4.057 4.057-4.057z"})),checkout_form:r("svg",{width:20,height:20,viewBox:"0 0 32 32"},r("path",{fill:"#f16334",d:"M30.4 32h-28.8c-0.877-0.001-1.599-0.748-1.6-1.655v-28.69c0.001-0.908 0.723-1.654 1.6-1.655h28.8c0.877 0.001 1.599 0.748 1.6 1.655v28.69c-0.001 0.908-0.723 1.654-1.6 1.655zM30.933 5.517h-29.867v24.828c0 0.303 0.241 0.551 0.533 0.552h28.8c0.292-0 0.533-0.249 0.533-0.552v-24.828zM6.933 28.69h-2.133c-0.878 0-1.6-0.747-1.6-1.655s0.722-1.655 1.6-1.655h2.133c0.878 0 1.6 0.747 1.6 1.655s-0.722 1.655-1.6 1.655zM6.933 26.483h-2.133c-0.293 0-0.533 0.249-0.533 0.552s0.241 0.552 0.533 0.552h2.133c0.293 0 0.533-0.249 0.533-0.552s-0.241-0.552-0.533-0.552zM23.732 18.975c1.439 0.014 2.838 0.871 3.496 2.154 0.554 1.081 0.57 2.421 0.043 3.514-0.749 1.554-2.584 2.512-4.336 2.165-1.594-0.316-2.917-1.71-3.144-3.326-0.176-1.255 0.295-2.583 1.223-3.446 0.717-0.668 1.687-1.051 2.668-1.060 0.017-0 0.034-0 0.051 0zM23.686 19.775c-1.438 0.014-2.781 1.107-3.070 2.518-0.212 1.037 0.139 2.17 0.901 2.905 0.875 0.844 2.255 1.12 3.399 0.644 1.012-0.421 1.771-1.404 1.917-2.492 0.178-1.331-0.596-2.739-1.829-3.297-0.413-0.187-0.864-0.28-1.318-0.278zM25.386 21.426c0.184 0.016 0.21 0.066 0.263 0.122 0.142 0.147 0.141 0.402-0.002 0.558l-2.163 2.207c-0.053 0.051-0.072 0.060-0.108 0.079-0.134 0.066-0.304 0.050-0.423-0.043-0.016-0.012-0.019-0.016-0.034-0.029l-1.147-1.124c-0.065-0.067-0.078-0.098-0.097-0.153-0.090-0.254 0.148-0.571 0.436-0.529 0.060 0.009 0.118 0.032 0.169 0.066 0.019 0.013 0.036 0.028 0.053 0.044l0.861 0.844 1.883-1.922c0 0 0.158-0.124 0.31-0.119zM16.533 22.069h-12.8c-0.293 0-0.533-0.249-0.533-0.552v-2.207c0-0.303 0.241-0.552 0.533-0.552h12.8c0.293 0 0.533 0.249 0.533 0.552v2.207c0 0.303-0.241 0.552-0.533 0.552zM16 19.862h-11.733v1.104h11.733v-1.104zM19.167 10.164c0.003-0.038 0.012-0.077 0.028-0.115 0.024-0.055 0.060-0.105 0.105-0.144 0.019-0.017 0.041-0.031 0.062-0.045l4.126-2.39c0.126-0.068 0.115-0.057 0.207-0.054 0.015-0 0.030 0.001 0.045 0.001 0.058 0.007 0.114 0.024 0.166 0.053l4.056 2.359c0.038 0.017 0.073 0.039 0.104 0.065 0.038 0.029 0.054 0.051 0.077 0.084 0.015 0.023 0.028 0.046 0.037 0.071 0.020 0.045 0.031 0.095 0.033 0.146v4.71c-0.006 0.141-0.078 0.269-0.198 0.345l-4.126 2.412c-0.16 0.085-0.207 0.063-0.287 0.045-0.007-0.002-0.015-0.003-0.022-0.006-0.011-0.003-0.022-0.006-0.033-0.011-0.028-0.010-0.034-0.015-0.061-0.029l-4.137-2.401c-0.119-0.076-0.194-0.204-0.199-0.347l0.011-4.712c0.001-0.014 0.002-0.028 0.004-0.042zM16.533 17.655h-12.8c-0.293 0-0.533-0.249-0.533-0.552v-2.207c0-0.303 0.241-0.552 0.533-0.552h12.8c0.293 0 0.533 0.249 0.533 0.552v2.207c0 0.303-0.241 0.552-0.533 0.552zM19.953 14.689l3.337 1.936v-3.83l-3.328-1.9c-0.003 1.265-0.006 2.529-0.009 3.794zM27.415 10.901l-3.326 1.927v3.795l3.326-1.945v-3.777zM16 15.448h-11.733v1.104h11.733v-1.104zM16.533 13.241h-12.8c-0.293 0-0.533-0.249-0.533-0.552v-2.207c0-0.303 0.241-0.552 0.533-0.552h12.8c0.293 0 0.533 0.249 0.533 0.552v2.207c0 0.303-0.241 0.552-0.533 0.552zM16 11.034h-11.733v1.104h11.733v-1.104zM22.443 11.391l1.274 0.727 3.301-1.912-1.262-0.734-3.313 1.919zM20.366 10.205l1.274 0.727 3.32-1.923-1.262-0.734-3.332 1.93zM9.067 8.828h-5.333c-0.293 0-0.533-0.249-0.533-0.552s0.241-0.552 0.533-0.552h5.333c0.293 0 0.533 0.249 0.533 0.552s-0.241 0.552-0.533 0.552zM30.4 1.103h-28.8c-0.292 0-0.533 0.249-0.533 0.552v2.759h29.867v-2.759c-0-0.303-0.241-0.551-0.533-0.552zM6.933 2.207c0.294 0 0.533 0.247 0.533 0.552s-0.239 0.552-0.533 0.552c-0.294 0-0.533-0.247-0.533-0.552s0.239-0.552 0.533-0.552zM4.8 2.207c0.294 0 0.533 0.247 0.533 0.552s-0.239 0.552-0.533 0.552-0.533-0.247-0.533-0.552c0-0.304 0.239-0.552 0.533-0.552zM2.667 2.207c0.294 0 0.533 0.247 0.533 0.552s-0.239 0.552-0.533 0.552c-0.294 0-0.533-0.247-0.533-0.552s0.239-0.552 0.533-0.552z"})),optin_form:r("svg",{width:20,height:20,viewBox:"0 0 32 32"},r("path",{fill:"#f16334",d:"M28.622 32h-25.244c-0.124-0.016-0.248-0.052-0.333-0.138-0.087-0.087-0.122-0.209-0.138-0.333v-31.058c0.027-0.207 0.148-0.401 0.349-0.455 0.040-0.011 0.081-0.011 0.122-0.016h25.244c0.041 0.005 0.081 0.011 0.122 0.016 0.155 0.064 0.291 0.176 0.333 0.333 0.011 0.040 0.011 0.081 0.016 0.122v31.058c-0.027 0.207-0.148 0.401-0.349 0.455-0.040 0.011-0.081 0.011-0.122 0.016zM3.849 0.943v30.115h24.302v-30.115h-24.302zM25.885 28.356l-1.766-1.766 0.866-0.866c0.075-0.075 0.106-0.184 0.081-0.287s-0.1-0.187-0.201-0.22l-5.196-1.732c-0.11-0.037-0.231-0.008-0.313 0.074s-0.111 0.203-0.074 0.313l1.732 5.196c0.034 0.101 0.117 0.177 0.22 0.201s0.212-0.006 0.287-0.081l0.866-0.866 1.766 1.766c0.060 0.060 0.138 0.090 0.216 0.090s0.157-0.030 0.216-0.090l1.299-1.299c0.12-0.12 0.12-0.313 0-0.433zM24.369 29.439l-1.766-1.766c-0.12-0.12-0.314-0.12-0.433 0l-0.732 0.732-1.382-4.145 4.145 1.382-0.732 0.732c-0.119 0.119-0.12 0.313 0 0.433l1.766 1.766-0.866 0.866zM23.987 19.68c0.368 0.007 0.699 0.321 0.707 0.706 0.004 0.657 0.004 1.315 0 1.973-0.007 0.369-0.322 0.699-0.706 0.706-2.811 0.019-5.623 0.019-8.434 0-0.367-0.007-0.699-0.321-0.706-0.706-0.004-0.658-0.004-1.315 0-1.973 0.007-0.369 0.321-0.699 0.706-0.706 2.811-0.017 5.623-0.017 8.434 0zM23.751 20.622h-7.962v1.501h7.962v-1.501zM12.172 20.441h-5.967c-0.307-0.004-0.58-0.269-0.584-0.584v-5.565c0.004-0.305 0.264-0.58 0.584-0.584 1.993 0 3.986-0.025 5.979 0 0.303 0.012 0.568 0.27 0.572 0.584v5.565c-0.004 0.306-0.263 0.58-0.584 0.584zM11.814 14.65h-5.25v4.848h5.25v-4.848zM25.93 17.734h-10.314c-0.046-0.002-0.058-0.001-0.103-0.008-0.403-0.064-0.682-0.564-0.485-0.951 0.109-0.215 0.341-0.351 0.588-0.36h10.314c0.017 0.001 0.035 0.001 0.052 0.002 0.046 0.005 0.057 0.005 0.102 0.016 0.446 0.107 0.664 0.756 0.313 1.108-0.122 0.122-0.292 0.186-0.467 0.193zM25.93 15.020h-10.314c-0.448-0.018-0.806-0.532-0.588-0.959 0.094-0.185 0.28-0.32 0.485-0.352 0.046-0.007 0.057-0.006 0.103-0.008h10.314c0.017 0.001 0.035 0.001 0.052 0.002 0.046 0.005 0.057 0.005 0.102 0.016 0.446 0.107 0.664 0.756 0.313 1.108-0.122 0.122-0.292 0.186-0.467 0.193zM25.93 12.305h-19.838c-0.266-0.032-0.521-0.172-0.617-0.426-0.133-0.351 0.094-0.785 0.459-0.875 0.052-0.013 0.105-0.013 0.158-0.019h19.838c0.053 0.006 0.105 0.013 0.158 0.019 0.298 0.113 0.537 0.387 0.497 0.72-0.026 0.213-0.161 0.406-0.348 0.505-0.127 0.067-0.168 0.059-0.307 0.076zM25.93 9.704h-19.838c-0.214-0.026-0.422-0.11-0.543-0.285-0.182-0.264-0.137-0.654 0.105-0.869 0.119-0.105 0.277-0.146 0.438-0.166h19.838c0.053 0.006 0.105 0.013 0.158 0.019 0.251 0.095 0.464 0.291 0.497 0.561 0.032 0.266-0.114 0.54-0.348 0.664-0.127 0.067-0.168 0.059-0.307 0.076zM25.93 6.877h-19.838c-0.316-0.038-0.615-0.247-0.655-0.58-0.039-0.32 0.186-0.643 0.497-0.72 0.052-0.013 0.105-0.013 0.158-0.019h19.838c0.053 0.006 0.105 0.013 0.158 0.019 0.152 0.057 0.295 0.135 0.385 0.266 0.211 0.306 0.106 0.779-0.236 0.959-0.127 0.066-0.168 0.059-0.307 0.076zM16.321 4.162h-10.229c-0.046-0.002-0.058-0.001-0.103-0.008-0.403-0.064-0.682-0.564-0.485-0.951 0.109-0.214 0.341-0.351 0.588-0.36h10.229c0.017 0.001 0.034 0.001 0.052 0.002 0.314 0.037 0.581 0.294 0.606 0.606 0.026 0.326-0.225 0.651-0.554 0.703-0.046 0.007-0.057 0.006-0.103 0.008z"})),logo:r("svg",{width:20,height:20,viewBox:"0 0 32 32"},r("path",{fill:"none",stroke:"#f16334",d:"M30.597 16c0 8.062-6.535 14.597-14.597 14.597s-14.597-6.535-14.597-14.597c0-8.062 6.535-14.597 14.597-14.597s14.597 6.535 14.597 14.597z"}),r("path",{fill:"#f16334",stroke:"#f16334",d:"M16.338 21.101c-0.751 0-1.358 0.607-1.358 1.358s0.607 1.36 1.358 1.36c0.753 0 1.36-0.61 1.36-1.36-0-0.75-0.607-1.357-1.36-1.357zM12.26 21.101c-0.75 0-1.36 0.607-1.36 1.358s0.609 1.36 1.36 1.36c0.751 0 1.361-0.61 1.361-1.36 0-0.75-0.61-1.357-1.361-1.357zM23.819 8.182c-0.078 0.726-0.412 1.373-0.906 1.855-0.551 0.538-1.305 0.867-2.134 0.867h-0.681c-0.186 0-0.339 0.15-0.339 0.339v1.021h2.72c0 1.502-1.217 2.719-2.72 2.719v1.36c0 1.776-1.136 3.286-2.719 3.845-0.22 0.077-0.448 0.141-0.681 0.176-0.221 0.041-0.447 0.061-0.68 0.061h-3.419c-0.23 0-0.458-0.020-0.68-0.061-0.233-0.035-0.461-0.099-0.679-0.176-1.583-0.558-2.719-2.069-2.719-3.845 0-2.020 1.47-3.699 3.398-4.025 0.223-0.036 0.45-0.055 0.68-0.055h3.748v2.719h-3.748c-0.749 0-1.36 0.611-1.36 1.36s0.61 1.36 1.36 1.36h3.419c0.749 0 1.36-0.611 1.36-1.36v-5.1c0-0.861 0.355-1.636 0.927-2.194 0.551-0.535 1.305-0.866 2.132-0.866h3.721z"}))};t.a=n},function(e,t,a){var r,n;!function(){"use strict";function a(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var n=typeof r;if("string"===n||"number"===n)e.push(r);else if(Array.isArray(r)&&r.length){var c=a.apply(null,r);c&&e.push(c)}else if("object"===n)for(var o in r)l.call(r,o)&&r[o]&&e.push(o)}}return e.join(" ")}var l={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(a.default=a,e.exports=a):(r=[],void 0!==(n=function(){return a}.apply(t,r))&&(e.exports=n))}()},function(e,t,a){function r(e,t){var a=l(e,t);return n(a)?a:void 0}var n=a(90),l=a(96);e.exports=r},function(e,t,a){"use strict";(function(t){function r(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){if("production"!==t.env.NODE_ENV)throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}}"production"===t.env.NODE_ENV?(r(),e.exports=a(174)):e.exports=a(177)}).call(t,a(0))},function(e,t,a){function r(e){return null==e?void 0===e?i:o:s&&s in Object(e)?l(e):c(e)}var n=a(18),l=a(92),c=a(93),o="[object Null]",i="[object Undefined]",s=n?n.toStringTag:void 0;e.exports=r},function(e,t){function a(e){return null!=e&&"object"==typeof e}e.exports=a},function(e,t,a){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var n=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var a,o,i=r(e),s=1;s<arguments.length;s++){a=Object(arguments[s]);for(var u in a)l.call(a,u)&&(i[u]=a[u]);if(n){o=n(a);for(var d=0;d<o.length;d++)c.call(a,o[d])&&(i[o[d]]=a[o[d]])}}return i}},function(e,t,a){"use strict";function r(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return Object(n.a)(t)}var n=a(56);t.a=r},function(e,t,a){"use strict";function r(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",n="",l="",c="";"tablet"==r?n=cf_blocks_info.tablet_breakpoint:"mobile"==r&&(n=cf_blocks_info.mobile_breakpoint);for(var o in e){var i=e[o],s="";for(var u in i){var d=!0;"string"===typeof i[u]&&0===i[u].length&&(d=!1),"font-family"===u&&"undefined"!=typeof i[u]&&"Default"===i[u]||"undefined"!=typeof i[u]&&d&&(s+="font-family"===u?u+": '"+i[u]+"';":u+": "+i[u]+";")}0!==s.length&&(l+=t,l+=o+"{",l+=s,l+="}")}return a&&"undefined"!==typeof l&&0!==l.length&&(c+="@media only screen and (max-width: "+n+"px) {",c+=l,c+="}"),a?c:l}t.a=r},function(e,t,a){"use strict";function r(e,t){var a="";return"undefined"!=typeof e&&(a+=e+t),a}t.a=r},function(e,t,a){"use strict";function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function c(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=a(76),i=a(186),s=(a(187),a(188)),u=(a.n(s),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e}),d=function(){function e(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),h=wp.i18n.__,m=wp.components,v=m.Button,f=m.Dashicon,p=wp.element,g=p.Component,b=p.Fragment,y=function(e){function t(){n(this,t);var e=l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onAdvancedControlClick=e.onAdvancedControlClick.bind(e),e.onAdvancedControlReset=e.onAdvancedControlReset.bind(e),e}return c(t,e),d(t,[{key:"onAdvancedControlClick",value:function(){var e=!0,t=h("Hide Advanced");null!==this.state&&!0===this.state.showAdvancedControls&&(e=!1,t=h("Advanced")),this.setState({showAdvancedControls:e,showAdvancedControlsLabel:t})}},{key:"onAdvancedControlReset",value:function(){var e=this.props.setAttributes;e(r({},this.props.fontFamily.label,"")),e(r({},this.props.fontWeight.label,"")),e(r({},this.props.fontSubset.label,"")),e(r({},this.props.fontSize.label,"")),e(r({},this.props.fontSizeType.label,"px")),e(r({},this.props.fontSizeMobile.label,"")),e(r({},this.props.fontSizeTablet.label,"")),e(r({},this.props.lineHeight.label,"")),e(r({},this.props.lineHeightType.label,"em")),e(r({},this.props.lineHeightMobile.label,"")),e(r({},this.props.lineHeightTablet.label,"")),e(r({},this.props.loadGoogleFonts.label,!1))}},{key:"render",value:function(){var e=void 0,t=void 0,a=void 0,r=void 0,n=void 0,l=void 0,c=void 0,s=this.props,d=s.disableFontFamily,m=s.disableFontSize,p=s.disableLineHeight,g=s.disableAdvancedOptions,y=void 0!==g&&g;return!0!==d&&(a=React.createElement(o.a,this.props)),!0!==p&&(t=React.createElement(i.a,u({type:this.props.lineHeightType,typeLabel:this.props.lineHeightType.label,sizeMobile:this.props.lineHeightMobile,sizeMobileLabel:this.props.lineHeightMobile.label,sizeTablet:this.props.lineHeightTablet,sizeTabletLabel:this.props.lineHeightTablet.label,size:this.props.lineHeight,sizeLabel:this.props.lineHeight.label,sizeMobileText:h("Line Height"),sizeTabletText:h("Line Height"),sizeText:h("Line Height"),steps:.1},this.props))),!0!==m&&(e=React.createElement(i.a,u({type:this.props.fontSizeType,typeLabel:this.props.fontSizeType.label,sizeMobile:this.props.fontSizeMobile,sizeMobileLabel:this.props.fontSizeMobile.label,sizeTablet:this.props.fontSizeTablet,sizeTabletLabel:this.props.fontSizeTablet.label,size:this.props.fontSize,sizeLabel:this.props.fontSize.label,sizeMobileText:this.props.fontSizeLabel?this.props.fontSizeLabel:h("Font Size"),sizeTabletText:this.props.fontSizeLabel?this.props.fontSizeLabel:h("Font Size"),sizeText:this.props.fontSizeLabel?this.props.fontSizeLabel:h("Font Size"),steps:.1},this.props))),!0!==d&&!0!==m?(r=React.createElement(v,{className:"cf-size-btn cf-typography-control-btn",isSmall:!0,"aria-pressed":null!==this.state,onClick:this.onAdvancedControlClick},React.createElement(f,{icon:"admin-tools"})),c=React.createElement(v,{className:"cf-size-btn cf-typography-reset-btn",isSmall:!0,"aria-pressed":null!==this.state,onClick:this.onAdvancedControlReset},React.createElement(f,{icon:"image-rotate"}))):l=React.createElement(b,null,e,a,t),null!==this.state&&!0===this.state.showAdvancedControls&&(l=React.createElement("div",{className:"cf-typography-advanced"},e,a,t)),!0!==d&&!0!==m&&(n=React.createElement("div",{className:"cf-typography-option-actions"},React.createElement("span",null,this.props.label),r,c)),React.createElement("div",{className:"cf-typography-options"},!y&&React.createElement(b,null,n,l))}}]),t}(g);t.a=y},function(e,t,a){function r(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var r=e[t];this.set(r[0],r[1])}}var n=a(80),l=a(81),c=a(82),o=a(83),i=a(84);r.prototype.clear=n,r.prototype.delete=l,r.prototype.get=c,r.prototype.has=o,r.prototype.set=i,e.exports=r},function(e,t,a){function r(e,t){for(var a=e.length;a--;)if(n(e[a][0],t))return a;return-1}var n=a(38);e.exports=r},function(e,t,a){var r=a(3),n=r.Symbol;e.exports=n},function(e,t,a){var r=a(7),n=r(Object,"create");e.exports=n},function(e,t,a){function r(e,t){var a=e.__data__;return n(t)?a["string"==typeof t?"string":"hash"]:a.map}var n=a(105);e.exports=r},function(e,t,a){function r(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-l?"-0":t}var n=a(30),l=1/0;e.exports=r},function(e,t,a){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=a(2),o=a.n(c),i=a(189),s=a.n(i),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},d=function(){function e(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}();if(void 0===h)var h=[];var m=wp.element.Component,v={inactive:"inactive",active:"active",loading:"loading"},f=function(){},p=function(e){function t(e){r(this,t);var a=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.state={status:void 0},a.handleLoading=function(){a.setState({status:v.loading})},a.addFont=function(e){h.includes(e)||h.push(e)},a.handleActive=function(){a.setState({status:v.active})},a.handleInactive=function(){a.setState({status:v.inactive})},a.loadFonts=function(){h.includes(a.props.config.google.families[0])||(s.a.load(u({},a.props.config,{loading:a.handleLoading,active:a.handleActive,inactive:a.handleInactive})),a.addFont(a.props.config.google.families[0]))},a}return l(t,e),d(t,[{key:"componentDidMount",value:function(){this.loadFonts()}},{key:"componentDidUpdate",value:function(e,t){var a=this.props,r=a.onStatus,n=a.config;t.status!==this.state.status&&r(this.state.status),e.config!==n&&this.loadFonts()}},{key:"render",value:function(){return this.props.children||null}}]),t}(m);p.propTypes={config:o.a.object.isRequired,children:o.a.element,onStatus:o.a.func.isRequired},p.defaultProps={onStatus:f},t.a=p},function(e,t,a){var r=a(7),n=a(3),l=r(n,"Map");e.exports=l},function(e,t){function a(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=a},function(e,t,a){function r(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var r=e[t];this.set(r[0],r[1])}}var n=a(97),l=a(104),c=a(106),o=a(107),i=a(108);r.prototype.clear=n,r.prototype.delete=l,r.prototype.get=c,r.prototype.has=o,r.prototype.set=i,e.exports=r},function(e,t,a){function r(e){return c(e)?n(e):l(e)}var n=a(126),l=a(133),c=a(28);e.exports=r},function(e,t){function a(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}var r=9007199254740991;e.exports=a},function(e,t,a){function r(e){return null!=e&&l(e.length)&&!n(e)}var n=a(39),l=a(27);e.exports=r},function(e,t,a){function r(e,t){if(n(e))return!1;var a=typeof e;return!("number"!=a&&"symbol"!=a&&"boolean"!=a&&null!=e&&!l(e))||(o.test(e)||!c.test(e)||null!=t&&e in Object(t))}var n=a(4),l=a(30),c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=r},function(e,t,a){function r(e){return"symbol"==typeof e||l(e)&&n(e)==c}var n=a(9),l=a(10),c="[object Symbol]";e.exports=r},function(e,t,a){"use strict";(function(t){function r(e,a,r,i,s){if("production"!==t.env.NODE_ENV)for(var u in e)if(o(e,u)){var d;try{if("function"!==typeof e[u]){var h=Error((i||"React class")+": "+r+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.");throw h.name="Invariant Violation",h}d=e[u](a,u,i,r,null,l)}catch(e){d=e}if(!d||d instanceof Error||n((i||"React class")+": type specification of "+r+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in c)){c[d.message]=!0;var m=s?s():"";n("Failed "+r+" type: "+d.message+(null!=m?m:""))}}}var n=function(){};if("production"!==t.env.NODE_ENV){var l=a(32),c={},o=Function.call.bind(Object.prototype.hasOwnProperty);n=function(e){var t="Warning: "+e;"undefined"!==typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}r.resetWarningCache=function(){"production"!==t.env.NODE_ENV&&(c={})},e.exports=r}).call(t,a(0))},function(e,t,a){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,a){"use strict";(function(e){function r(e,t,a){var r=[],n=Object(i.a)(e,r,a);return r.length<2?a:n+t(r)}a.d(t,"a",function(){return v}),a.d(t,"b",function(){return k}),a.d(t,"c",function(){return C}),a.d(t,"d",function(){return x});var n=a(167),l=a.n(n),c=a(1),o=(a.n(c),a(54)),i=a(170),s=a(56),u=a(55),d=a(12),h=Object(c.createContext)("undefined"!==typeof HTMLElement?Object(o.a)():null),m=Object(c.createContext)({}),v=h.Provider,f=function(e){var t=function(t,a){return Object(c.createElement)(h.Consumer,null,function(r){return e(t,r,a)})};return Object(c.forwardRef)(t)},p=function(e){return e.replace(/\$/g,"-")},g="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",b="__EMOTION_LABEL_PLEASE_DO_NOT_USE__",y=Object.prototype.hasOwnProperty,w=function(t,a,r,n){var l=null===r?a.css:a.css(r);"string"===typeof l&&void 0!==t.registered[l]&&(l=t.registered[l]);var o=a[g],u=[l],d="";"string"===typeof a.className?d=Object(i.a)(t.registered,u,a.className):null!=a.className&&(d=a.className+" ");var h=Object(s.a)(u);if("production"!==e.env.NODE_ENV&&-1===h.name.indexOf("-")){var m=a[b];m&&(h=Object(s.a)([h,"label:"+m+";"]))}Object(i.b)(t,h,"string"===typeof o);d+=t.key+"-"+h.name;var v={};for(var f in a)!y.call(a,f)||"css"===f||f===g||"production"!==e.env.NODE_ENV&&f===b||(v[f]=a[f]);return v.ref=n,v.className=d,Object(c.createElement)(o,v)},z=f(function(e,t,a){return"function"===typeof e.css?Object(c.createElement)(m.Consumer,null,function(r){return w(t,e,r,a)}):w(t,e,null,a)});"production"!==e.env.NODE_ENV&&(z.displayName="EmotionCssPropInternal");var C=function(t,a){var r=arguments;if(null==a||!y.call(a,"css"))return c.createElement.apply(void 0,r);if("production"!==e.env.NODE_ENV&&"string"===typeof a.css&&-1!==a.css.indexOf(":"))throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/css' like this: css`"+a.css+"`");var n=r.length,l=new Array(n);l[0]=z;var o={};for(var i in a)y.call(a,i)&&(o[i]=a[i]);if(o[g]=t,"production"!==e.env.NODE_ENV){var s=new Error;if(s.stack){var u=s.stack.match(/at (?:Object\.|)jsx.*\n\s+at ([A-Z][A-Za-z$]+) /);u||(u=s.stack.match(/.*\n([A-Z][A-Za-z$]+)@/)),u&&(o[b]=p(u[1]))}}l[1]=o;for(var d=2;d<n;d++)l[d]=r[d];return c.createElement.apply(null,l)},x=(c.Component,function(){var e=d.a.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}),M=function e(t){for(var a=t.length,r=0,n="";r<a;r++){var l=t[r];if(null!=l){var c=void 0;switch(typeof l){case"boolean":break;case"object":if(Array.isArray(l))c=e(l);else{c="";for(var o in l)l[o]&&o&&(c&&(c+=" "),c+=o)}break;default:c=l}c&&(n&&(n+=" "),n+=c)}}return n},k=f(function(t,a){return Object(c.createElement)(m.Consumer,null,function(n){var l=!1,c=function(){if(l&&"production"!==e.env.NODE_ENV)throw new Error("css can only be used during render");for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var c=Object(s.a)(r,a.registered);return Object(i.b)(a,c,!1),a.key+"-"+c.name},o=function(){if(l&&"production"!==e.env.NODE_ENV)throw new Error("cx can only be used during render");for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return r(a.registered,c,M(n))},u={css:c,cx:o,theme:n},d=t.children(u);return l=!0,d})})}).call(t,a(0))},function(e,t,a){"use strict";function r(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function n(e,t,a){var n=[a];if(t&&e)for(var l in t)t.hasOwnProperty(l)&&t[l]&&n.push(""+r(e,l));return n.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}function l(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function c(e){return l(e)?window.pageYOffset:e.scrollTop}function o(e,t){if(l(e))return void window.scrollTo(0,t);e.scrollTop=t}function i(e){var t=getComputedStyle(e),a="absolute"===t.position,r=/(auto|scroll)/,n=document.documentElement;if("fixed"===t.position)return n;for(var l=e;l=l.parentElement;)if(t=getComputedStyle(l),(!a||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return l;return n}function s(e,t,a,r){return a*((e=e/r-1)*e*e+1)+t}function u(e,t,a,r){function n(){d+=u;var t=s(d,l,i,a);o(e,t),d<a?window.requestAnimationFrame(n):r(e)}void 0===a&&(a=200),void 0===r&&(r=f);var l=c(e),i=t-l,u=10,d=0;n()}function d(e,t){var a=e.getBoundingClientRect(),r=t.getBoundingClientRect(),n=t.offsetHeight/3;r.bottom+n>a.bottom?o(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+n,e.scrollHeight)):r.top-n<a.top&&o(e,Math.max(t.offsetTop-n,0))}function h(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function m(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}function v(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}a.d(t,"a",function(){return i}),a.d(t,"b",function(){return c}),a.d(t,"c",function(){return u}),a.d(t,"d",function(){return v}),a.d(t,"e",function(){return p}),a.d(t,"f",function(){return d}),a.d(t,"g",function(){return h}),a.d(t,"h",function(){return n}),a.d(t,"i",function(){return m}),a.d(t,"j",function(){return l}),a.d(t,"k",function(){return f}),a.d(t,"l",function(){return o});var f=function(){},p=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===typeof e&&null!==e?[e]:[]}},function(e,t,a){function r(e,t){return(o(e)?n:c)(e,l(t,3))}var n=a(36),l=a(77),c=a(157),o=a(4);e.exports=r},function(e,t){function a(e,t){for(var a=-1,r=null==e?0:e.length,n=Array(r);++a<r;)n[a]=t(e[a],a,e);return n}e.exports=a},function(e,t,a){function r(e){var t=this.__data__=new n(e);this.size=t.size}var n=a(16),l=a(85),c=a(86),o=a(87),i=a(88),s=a(89);r.prototype.clear=l,r.prototype.delete=c,r.prototype.get=o,r.prototype.has=i,r.prototype.set=s,e.exports=r},function(e,t){function a(e,t){return e===t||e!==e&&t!==t}e.exports=a},function(e,t,a){function r(e){if(!l(e))return!1;var t=n(e);return t==o||t==i||t==c||t==s}var n=a(9),l=a(24),c="[object AsyncFunction]",o="[object Function]",i="[object GeneratorFunction]",s="[object Proxy]";e.exports=r},function(e,t,a){(function(t){var a="object"==typeof t&&t&&t.Object===Object&&t;e.exports=a}).call(t,a(91))},function(e,t){function a(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var r=Function.prototype,n=r.toString;e.exports=a},function(e,t,a){function r(e,t,a,c,o){return e===t||(null==e||null==t||!l(e)&&!l(t)?e!==e&&t!==t:n(e,t,a,c,r,o))}var n=a(109),l=a(10);e.exports=r},function(e,t,a){function r(e,t,a,r,s,u){var d=a&o,h=e.length,m=t.length;if(h!=m&&!(d&&m>h))return!1;var v=u.get(e);if(v&&u.get(t))return v==t;var f=-1,p=!0,g=a&i?new n:void 0;for(u.set(e,t),u.set(t,e);++f<h;){var b=e[f],y=t[f];if(r)var w=d?r(y,b,f,t,e,u):r(b,y,f,e,t,u);if(void 0!==w){if(w)continue;p=!1;break}if(g){if(!l(t,function(e,t){if(!c(g,t)&&(b===e||s(b,e,a,r,u)))return g.push(t)})){p=!1;break}}else if(b!==y&&!s(b,y,a,r,u)){p=!1;break}}return u.delete(e),u.delete(t),p}var n=a(110),l=a(113),c=a(114),o=1,i=2;e.exports=r},function(e,t,a){var r=a(128),n=a(10),l=Object.prototype,c=l.hasOwnProperty,o=l.propertyIsEnumerable,i=r(function(){return arguments}())?r:function(e){return n(e)&&c.call(e,"callee")&&!o.call(e,"callee")};e.exports=i},function(e,t,a){(function(e){var r=a(3),n=a(129),l="object"==typeof t&&t&&!t.nodeType&&t,c=l&&"object"==typeof e&&e&&!e.nodeType&&e,o=c&&c.exports===l,i=o?r.Buffer:void 0,s=i?i.isBuffer:void 0,u=s||n;e.exports=u}).call(t,a(46)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){function a(e,t){var a=typeof e;return!!(t=null==t?r:t)&&("number"==a||"symbol"!=a&&n.test(e))&&e>-1&&e%1==0&&e<t}var r=9007199254740991,n=/^(?:0|[1-9]\d*)$/;e.exports=a},function(e,t,a){var r=a(130),n=a(131),l=a(132),c=l&&l.isTypedArray,o=c?n(c):r;e.exports=o},function(e,t,a){function r(e){return e===e&&!n(e)}var n=a(24);e.exports=r},function(e,t){function a(e,t){return function(a){return null!=a&&(a[e]===t&&(void 0!==t||e in Object(a)))}}e.exports=a},function(e,t,a){function r(e,t){t=n(t,e);for(var a=0,r=t.length;null!=e&&a<r;)e=e[l(t[a++])];return a&&a==r?e:void 0}var n=a(52),l=a(21);e.exports=r},function(e,t,a){function r(e,t){return n(e)?e:l(e,t)?[e]:c(o(e))}var n=a(4),l=a(29),c=a(145),o=a(148);e.exports=r},function(e,t,a){"use strict";function r(e,t){if(e.length!==t.length)return!1;for(var a=0;a<e.length;a++)if(e[a]!==t[a])return!1;return!0}function n(e,t){function a(){for(var a=[],r=0;r<arguments.length;r++)a[r]=arguments[r];return o&&n===this&&t(a,c)?l:(l=e.apply(this,a),o=!0,n=this,c=a,l)}void 0===t&&(t=r);var n,l,c=[],o=!1;return a}t.a=n},function(e,t,a){"use strict";(function(e){function r(e){e&&c.current.insert(e+"}")}var n=a(55),l=a(168),c=(a(169),{current:null}),o=function(e,t,a,n,l,o,i,s,u,d){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return c.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===s)return t+"/*|*/";break;case 3:switch(s){case 102:case 112:return c.current.insert(a[0]+t),"";default:return t+(0===d?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(r)}},i=function(t){void 0===t&&(t={});var a,r=t.key||"css";void 0!==t.prefix&&(a={prefix:t.prefix});var i=new l.a(a);if("production"!==e.env.NODE_ENV&&/[^a-z-]/.test(r))throw new Error('Emotion key must only contain lower case alphabetical characters and - but "'+r+'" was passed');var s,u={};s=t.container||document.head;var d=document.querySelectorAll("style[data-emotion-"+r+"]");Array.prototype.forEach.call(d,function(e){e.getAttribute("data-emotion-"+r).split(" ").forEach(function(e){u[e]=!0}),e.parentNode!==s&&s.appendChild(e)});var h;if(i.use(t.stylisPlugins)(o),h=function(t,a,r,n){var l=a.name;if(c.current=r,"production"!==e.env.NODE_ENV&&void 0!==a.map){var o=a.map;c.current={insert:function(e){r.insert(e+o)}}}i(t,a.styles),n&&(f.inserted[l]=!0)},"production"!==e.env.NODE_ENV){var m=/\/\*/g,v=/\*\//g;i.use(function(e,t){switch(e){case-1:for(;m.test(t);){v.lastIndex=m.lastIndex;{if(!v.test(t))throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');m.lastIndex=v.lastIndex}}m.lastIndex=0}}),i.use(function(e,t,a){switch(e){case-1:var r=t.match(/(:first|:nth|:nth-last)-child/g);r&&!0!==f.compat&&r.forEach(function(e){var a=new RegExp(e+".*\\/\\* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason \\*\\/"),r=a.test(t);e&&!r&&console.error('The pseudo class "'+e+'" is potentially unsafe when doing server-side rendering. Try changing it to "'+e.split("-child")[0]+'-of-type".')})}})}var f={key:r,sheet:new n.a({key:r,container:s,nonce:t.nonce,speedy:t.speedy}),nonce:t.nonce,inserted:u,registered:{},insert:h};return f};t.a=i}).call(t,a(0))},function(e,t,a){"use strict";(function(e){function r(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function n(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}a.d(t,"a",function(){return l});var l=function(){function t(t){this.isSpeedy=void 0===t.speedy?"production"===e.env.NODE_ENV:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.before=null}var a=t.prototype;return a.insert=function(t){if(this.ctr%(this.isSpeedy?65e3:1)===0){var a,l=n(this);a=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(l,a),this.tags.push(l)}var c=this.tags[this.tags.length-1];if(this.isSpeedy){var o=r(c);try{var i=105===t.charCodeAt(1)&&64===t.charCodeAt(0);o.insertRule(t,i?0:o.cssRules.length)}catch(a){"production"!==e.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'+t+'"',a)}}else c.appendChild(document.createTextNode(t));this.ctr++},a.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},t}()}).call(t,a(0))},function(e,t,a){"use strict";(function(e){function r(t,a,l,c){if(null==l)return"";if(void 0!==l.__emotion_styles){if("production"!==e.env.NODE_ENV&&"NO_COMPONENT_SELECTOR"===l.toString())throw new Error("Component selectors can only be used in conjunction with babel-plugin-emotion.");return l}switch(typeof l){case"boolean":return"";case"object":if(1===l.anim)return k={name:l.name,styles:l.styles,next:k},l.name;if(void 0!==l.styles){var o=l.next;if(void 0!==o)for(;void 0!==o;)k={name:o.name,styles:o.styles,next:k},o=o.next;var i=l.styles+";";return"production"!==e.env.NODE_ENV&&void 0!==l.map&&(i+=l.map),i}return n(t,a,l);case"function":if(void 0!==t){var s=k,u=l(t);return k=s,r(t,a,u,c)}"production"!==e.env.NODE_ENV&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==e.env.NODE_ENV){var h=[],m=l.replace(d,function(e,t,a){var r="animation"+h.length;return h.push("const "+r+" = keyframes`"+a.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+r+"}"});h.length&&console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(h,["`"+m+"`"]).join("\n")+"\n\nYou should wrap it with `css` like this:\n\ncss`"+m+"`")}}if(null==a)return l;var v=a[l];return"production"!==e.env.NODE_ENV&&c&&x&&void 0!==v&&(console.error("Interpolating a className from css`` is not recommended and will cause problems with composition.\nInterpolating a className from css`` will be completely unsupported in a future major version of Emotion"),x=!1),void 0===v||c?l:v}function n(t,a,n){var l="";if(Array.isArray(n))for(var c=0;c<n.length;c++)l+=r(t,a,n[c],!1);else for(var o in n){var i=n[o];if("object"!==typeof i)null!=a&&void 0!==a[i]?l+=o+"{"+a[i]+"}":m(i)&&(l+=v(o)+":"+f(o,i)+";");else{if("NO_COMPONENT_SELECTOR"===o&&"production"!==e.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with babel-plugin-emotion.");if(!Array.isArray(i)||"string"!==typeof i[0]||null!=a&&void 0!==a[i[0]]){var u=r(t,a,i,!1);switch(o){case"animation":case"animationName":l+=v(o)+":"+u+";";break;default:"production"!==e.env.NODE_ENV&&"undefined"===o&&console.error(s),l+=o+"{"+u+"}"}}else for(var d=0;d<i.length;d++)m(i[d])&&(l+=v(o)+":"+f(o,i[d])+";")}}return l}a.d(t,"a",function(){return H});var l=a(171),c=a(172),o=a(173),i="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",s="You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).",u=/[A-Z]|^ms/g,d=/_EMO_([^_]+?)_([^]*?)_EMO_/g,h=function(e){return 45===e.charCodeAt(1)},m=function(e){return null!=e&&"boolean"!==typeof e},v=Object(o.a)(function(e){return h(e)?e:e.replace(u,"-$&").toLowerCase()}),f=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(d,function(e,t,a){return k={name:t,styles:a,next:k},t})}return 1===c.a[e]||h(e)||"number"!==typeof t||0===t?t:t+"px"};if("production"!==e.env.NODE_ENV){var p=/(attr|calc|counters?|url)\(/,g=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],b=f,y=/^-ms-/,w=/-(.)/g,z={};f=function(e,t){"content"===e&&("string"!==typeof t||-1===g.indexOf(t)&&!p.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+t+"\"'`");var a=b(e,t);return""===a||h(e)||-1===e.indexOf("-")||void 0!==z[e]||(z[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+e.replace(y,"ms-").replace(w,function(e,t){return t.toUpperCase()})+"?")),a}}var C,x=!0,M=/label:\s*([^\s;\n{]+)\s*;/g;"production"!==e.env.NODE_ENV&&(C=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var k,H=function(t,a,n){if(1===t.length&&"object"===typeof t[0]&&null!==t[0]&&void 0!==t[0].styles)return t[0];var c=!0,o="";k=void 0;var s=t[0];null==s||void 0===s.raw?(c=!1,o+=r(n,a,s,!1)):("production"!==e.env.NODE_ENV&&void 0===s[0]&&console.error(i),o+=s[0]);for(var u=1;u<t.length;u++)o+=r(n,a,t[u],46===o.charCodeAt(o.length-1)),c&&("production"!==e.env.NODE_ENV&&void 0===s[u]&&console.error(i),o+=s[u]);var d;"production"!==e.env.NODE_ENV&&(o=o.replace(C,function(e){return d=e,""})),M.lastIndex=0;for(var h,m="";null!==(h=M.exec(o));)m+="-"+h[1];var v=Object(l.a)(o)+m;return"production"!==e.env.NODE_ENV?{name:v,styles:o,map:d,next:k,toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}}:{name:v,styles:o,next:k}}}).call(t,a(0))},function(e,t,a){"use strict";(function(t){"production"===t.env.NODE_ENV?e.exports=a(175):e.exports=a(176)}).call(t,a(0))},function(e,t,a){"use strict";(function(t){"production"===t.env.NODE_ENV?e.exports=a(181):e.exports=a(182)}).call(t,a(0))},function(e,t,a){"use strict";(function(e){function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},r.apply(this,arguments)}function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function l(e){var t=e.maxHeight,a=e.menuEl,r=e.minHeight,n=e.placement,l=e.shouldScroll,c=e.isFixedPosition,o=e.theme,i=o.spacing,s=Object(E.a)(a),u={placement:"bottom",maxHeight:t};if(!a||!a.offsetParent)return u;var d=s.getBoundingClientRect(),h=d.height,m=a.getBoundingClientRect(),v=m.bottom,f=m.height,p=m.top,g=a.offsetParent.getBoundingClientRect(),b=g.top,y=window.innerHeight,w=Object(E.b)(s),z=parseInt(getComputedStyle(a).marginBottom,10),C=parseInt(getComputedStyle(a).marginTop,10),x=b-C,M=y-p,k=x+w,H=h-w-p,S=v-y+w+z,L=w+p-C;switch(n){case"auto":case"bottom":if(M>=f)return{placement:"bottom",maxHeight:t};if(H>=f&&!c)return l&&Object(E.c)(s,S,160),{placement:"bottom",maxHeight:t};if(!c&&H>=r||c&&M>=r){l&&Object(E.c)(s,S,160);return{placement:"bottom",maxHeight:c?M-z:H-z}}if("auto"===n||c){var V=t,B=c?x:k;return B>=r&&(V=Math.min(B-z-i.controlHeight,t)),{placement:"top",maxHeight:V}}if("bottom"===n)return Object(E.l)(s,S),{placement:"bottom",maxHeight:t};break;case"top":if(x>=f)return{placement:"top",maxHeight:t};if(k>=f&&!c)return l&&Object(E.c)(s,L,160),{placement:"top",maxHeight:t};if(!c&&k>=r||c&&x>=r){var T=t;return(!c&&k>=r||c&&x>=r)&&(T=c?x-C:k-C),l&&Object(E.c)(s,L,160),{placement:"top",maxHeight:T}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'+n+'".')}return u}function c(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}function o(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var a,r,n,l=X(e),c=X(t);if(l&&c){if((r=e.length)!=t.length)return!1;for(a=r;0!==a--;)if(!o(e[a],t[a]))return!1;return!0}if(l!=c)return!1;var i=e instanceof Date,s=t instanceof Date;if(i!=s)return!1;if(i&&s)return e.getTime()==t.getTime();var u=e instanceof RegExp,d=t instanceof RegExp;if(u!=d)return!1;if(u&&d)return e.toString()==t.toString();var h=Y(e);if((r=h.length)!==Y(t).length)return!1;for(a=r;0!==a--;)if(!q.call(t,h[a]))return!1;for(a=r;0!==a--;)if(("_owner"!==(n=h[a])||!e.$$typeof)&&!o(e[n],t[n]))return!1;return!0}return e!==e&&t!==t}function i(e,t){try{return o(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i))return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}}function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},s.apply(this,arguments)}function u(){var e=d(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"]);return u=function(){return e},e}function d(e,t){return t||(t=e.slice(0)),e.raw=t,e}function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},h.apply(this,arguments)}function m(e,t){if(null==e)return{};var a,r,n={},l=Object.keys(e);for(r=0;r<l.length;r++)a=l[r],t.indexOf(a)>=0||(n[a]=e[a]);return n}function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},v.apply(this,arguments)}function f(e,t){if(null==e)return{};var a,r,n={},l=Object.keys(e);for(r=0;r<l.length;r++)a=l[r],t.indexOf(a)>=0||(n[a]=e[a]);return n}function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},p.apply(this,arguments)}function g(){return g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},g.apply(this,arguments)}function b(e,t){if(null==e)return{};var a,r,n={},l=Object.keys(e);for(r=0;r<l.length;r++)a=l[r],t.indexOf(a)>=0||(n[a]=e[a]);return n}function y(){return y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},y.apply(this,arguments)}function w(e){var t=e.children,a=e.innerProps;return Object(H.c)("div",a,t||Object(H.c)(ne,{size:14}))}function z(){return z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},z.apply(this,arguments)}function C(){return C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},C.apply(this,arguments)}function x(){return x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},x.apply(this,arguments)}function M(){return M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},M.apply(this,arguments)}a.d(t,"a",function(){return I}),a.d(t,"b",function(){return J}),a.d(t,"c",function(){return ge}),a.d(t,"d",function(){return se}),a.d(t,"e",function(){return oe}),a.d(t,"f",function(){return ze}),a.d(t,"g",function(){return de}),a.d(t,"h",function(){return ye}),a.d(t,"i",function(){return xe}),a.d(t,"j",function(){return ee}),a.d(t,"k",function(){return j}),a.d(t,"l",function(){return P}),a.d(t,"m",function(){return ve}),a.d(t,"n",function(){return _}),a.d(t,"o",function(){return Z}),a.d(t,"p",function(){return He}),a.d(t,"q",function(){return Se}),a.d(t,"r",function(){return Le}),a.d(t,"s",function(){return D}),a.d(t,"t",function(){return Ae}),a.d(t,"u",function(){return _e}),a.d(t,"v",function(){return Oe}),a.d(t,"w",function(){return K}),a.d(t,"x",function(){return Ne}),a.d(t,"y",function(){return i});var k=a(1),H=(a.n(k),a(33)),S=a(8),L=(a.n(S),a(2)),V=a.n(L),E=a(34),B=a(12),T=a(60),A=a.n(T),R=function(e){return"auto"===e?"bottom":e},_=function(e){var t,a=e.placement,r=e.theme,n=r.borderRadius,l=r.spacing,o=r.colors;return t={label:"menu"},t[c(a)]="100%",t.backgroundColor=o.neutral0,t.borderRadius=n,t.boxShadow="0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",t.marginBottom=l.menuGutter,t.marginTop=l.menuGutter,t.position="absolute",t.width="100%",t.zIndex=1,t},I=function(e){function t(){for(var t,a=arguments.length,n=new Array(a),c=0;c<a;c++)n[c]=arguments[c];return t=e.call.apply(e,[this].concat(n))||this,t.state={maxHeight:t.props.maxMenuHeight,placement:null},t.getPlacement=function(e){var a=t.props,r=a.minMenuHeight,n=a.maxMenuHeight,c=a.menuPlacement,o=a.menuPosition,i=a.menuShouldScrollIntoView,s=a.theme,u=t.context.getPortalPlacement;if(e){var d="fixed"===o,h=i&&!d,m=l({maxHeight:n,menuEl:e,minHeight:r,placement:c,shouldScroll:h,isFixedPosition:d,theme:s});u&&u(m),t.setState(m)}},t.getUpdatedProps=function(){var e=t.props.menuPlacement,a=t.state.placement||R(e);return r({},t.props,{placement:a,maxHeight:t.state.maxHeight})},t}return n(t,e),t.prototype.render=function(){return(0,this.props.children)({ref:this.getPlacement,placerProps:this.getUpdatedProps()})},t}(k.Component);I.contextTypes={getPortalPlacement:V.a.func};var O=function(e){var t=e.children,a=e.className,n=e.cx,l=e.getStyles,c=e.innerRef,o=e.innerProps;return Object(H.c)("div",r({css:l("menu",e),className:n({menu:!0},a)},o,{ref:c}),t)},P=function(e){var t=e.maxHeight,a=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:a,paddingTop:a,position:"relative",WebkitOverflowScrolling:"touch"}},F=function(e){var t=e.children,a=e.className,r=e.cx,n=e.getStyles,l=e.isMulti,c=e.innerRef;return Object(H.c)("div",{css:n("menuList",e),className:r({"menu-list":!0,"menu-list--is-multi":l},a),ref:c},t)},N=function(e){var t=e.theme,a=t.spacing.baseUnit;return{color:t.colors.neutral40,padding:2*a+"px "+3*a+"px",textAlign:"center"}},D=N,j=N,G=function(e){var t=e.children,a=e.className,n=e.cx,l=e.getStyles,c=e.innerProps;return Object(H.c)("div",r({css:l("noOptionsMessage",e),className:n({"menu-notice":!0,"menu-notice--no-options":!0},a)},c),t)};G.defaultProps={children:"No options"};var W=function(e){var t=e.children,a=e.className,n=e.cx,l=e.getStyles,c=e.innerProps;return Object(H.c)("div",r({css:l("loadingMessage",e),className:n({"menu-notice":!0,"menu-notice--loading":!0},a)},c),t)};W.defaultProps={children:"Loading..."};var Z=function(e){var t=e.rect,a=e.offset,r=e.position;return{left:t.left,position:r,top:a,width:t.width,zIndex:1}},U=function(e){function t(){for(var t,a=arguments.length,r=new Array(a),n=0;n<a;n++)r[n]=arguments[n];return t=e.call.apply(e,[this].concat(r))||this,t.state={placement:null},t.getPortalPlacement=function(e){var a=e.placement;a!==R(t.props.menuPlacement)&&t.setState({placement:a})},t}n(t,e);var a=t.prototype;return a.getChildContext=function(){return{getPortalPlacement:this.getPortalPlacement}},a.render=function(){var e=this.props,t=e.appendTo,a=e.children,r=e.controlElement,n=e.menuPlacement,l=e.menuPosition,c=e.getStyles,o="fixed"===l;if(!t&&!o||!r)return null;var i=this.state.placement||R(n),s=Object(E.g)(r),u=o?0:window.pageYOffset,d=s[i]+u,h={offset:d,position:l,rect:s},m=Object(H.c)("div",{css:c("menuPortal",h)},a);return t?Object(S.createPortal)(m,t):m},t}(k.Component);U.childContextTypes={getPortalPlacement:V.a.func};var X=Array.isArray,Y=Object.keys,q=Object.prototype.hasOwnProperty,J=function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},Q=function(e){var t=e.children,a=e.className,r=e.cx,n=e.getStyles,l=e.innerProps,c=e.isDisabled,o=e.isRtl;return Object(H.c)("div",s({css:n("container",e),className:r({"--is-disabled":c,"--is-rtl":o},a)},l),t)},K=function(e){var t=e.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:t.baseUnit/2+"px "+2*t.baseUnit+"px",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}},$=function(e){var t=e.children,a=e.className,r=e.cx,n=e.isMulti,l=e.getStyles,c=e.hasValue;return Object(H.c)("div",{css:l("valueContainer",e),className:r({"value-container":!0,"value-container--is-multi":n,"value-container--has-value":c},a)},t)},ee=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},te=function(e){var t=e.children,a=e.className,r=e.cx,n=e.getStyles;return Object(H.c)("div",{css:n("indicatorsContainer",e),className:r({indicators:!0},a)},t)},ae="production"===e.env.NODE_ENV?{name:"19bqh2r",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;"}:{name:"19bqh2r",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBa0JJIiwiZmlsZSI6ImluZGljYXRvcnMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBAZmxvd1xuLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyB0eXBlIE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3gsIGtleWZyYW1lcyB9IGZyb20gJ0BlbW90aW9uL2NvcmUnO1xuXG5pbXBvcnQgdHlwZSB7IENvbW1vblByb3BzLCBUaGVtZSB9IGZyb20gJy4uL3R5cGVzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHsgc2l6ZSwgLi4ucHJvcHMgfTogeyBzaXplOiBudW1iZXIgfSkgPT4gKFxuICA8c3ZnXG4gICAgaGVpZ2h0PXtzaXplfVxuICAgIHdpZHRoPXtzaXplfVxuICAgIHZpZXdCb3g9XCIwIDAgMjAgMjBcIlxuICAgIGFyaWEtaGlkZGVuPVwidHJ1ZVwiXG4gICAgZm9jdXNhYmxlPVwiZmFsc2VcIlxuICAgIGNzcz17e1xuICAgICAgZGlzcGxheTogJ2lubGluZS1ibG9jaycsXG4gICAgICBmaWxsOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGxpbmVIZWlnaHQ6IDEsXG4gICAgICBzdHJva2U6ICdjdXJyZW50Q29sb3InLFxuICAgICAgc3Ryb2tlV2lkdGg6IDAsXG4gICAgfX1cbiAgICB7Li4ucHJvcHN9XG4gIC8+XG4pO1xuXG5leHBvcnQgY29uc3QgQ3Jvc3NJY29uID0gKHByb3BzOiBhbnkpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxL
|