PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.1
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.1
3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 2.8.17 2.8.18 All 259 releases
wpfunnels / includes / core / widgets / bricks / Checkout.php

Checkout.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.13.1, at includes/core/widgets/bricks/Checkout.php

2,596 lines 85.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Namespace declaration for the Checkout class.
4 * This class is part of the WPFunnels\Widgets\Bricks namespace.
5 *
6 * @package WPFunnels\Widgets\Bricks
7 */
8 namespace WPFunnels\Widgets\Bricks;
9
10 require_once get_template_directory() . '/includes/elements/base.php';
11
12 use \Bricks\Element;
13 use WPFunnels\Wpfnl_functions;
14 use WPFunnels\Traits\SingletonTrait;
15 use WPFunnels\Wpfnl;
16 use WPFunnels\Modules\Frontend\Checkout\Wpfnl_Order_Bump_Rules;
17
18
19 if (! defined('ABSPATH')) {
20 exit;
21 } // Exit if accessed directly
22
23
24 /**
25 * Class Checkout
26 *
27 * Represents a checkout element.
28 *
29 */
30 class Checkout extends Element
31 {
32
33 // Element properties
34 public $category = 'wpfunnels'; // Use predefined element category 'general'
35 public $name = 'wpfnl_checkout'; // Make sure to prefix your elements
36 public $icon = 'fa-solid fa-cart-shopping'; // Themify icon font class
37 public $scripts = []; // Script(s) run when element is rendered on frontend or updated in builder
38
39
40 /**
41 * Return localised element label
42 *
43 * @return string
44 * @since 3.1.0
45 */
46 public function get_label()
47 {
48 return esc_html__('Checkout', 'wpfnl');
49 }
50
51 /**
52 * Get WordPress user roles for display condition control.
53 *
54 * @return array
55 * @since 3.1.0
56 */
57 protected function get_wp_user_roles()
58 {
59 $roles = [ 'none' => esc_html__( 'None', 'wpfnl' ) ];
60
61 if ( ! function_exists( 'get_editable_roles' ) ) {
62 require_once ABSPATH . 'wp-admin/includes/user.php';
63 }
64
65 foreach ( get_editable_roles() as $role_key => $role_info ) {
66 $roles[ $role_key ] = $role_info['name'];
67 }
68
69 return $roles;
70 }
71
72 /**
73 * Get layout types
74 *
75 * @return array
76 */
77 private function get_layout_types() {
78 $layouts = array(
79 'wpfnl-col-1' => __('1 Column Checkout', 'wpfnl'),
80 'wpfnl-col-2' => __('2 Column Checkout', 'wpfnl'),
81 'wpfnl-2-step' => __('2 Step Checkout', 'wpfnl'),
82 // 'wpfnl-multistep' => __('Multistep Checkout', 'wpfnl'),
83 'wpfnl-modern-multistep' => __('Modern Multistep Checkout', 'wpfnl'),
84 'wpfnl-express-checkout' => __('Express Checkout', 'wpfnl'),
85 'wpfnl-modern-checkout' => __('Modern Checkout', 'wpfnl'),
86 'wpfnl-modern-one-column' => __('Modern One Column Checkout', 'wpfnl'),
87 );
88 return $layouts;
89 }
90
91
92 /**
93 * Order Bump Settings
94 *
95 * @since 3.1.0
96 *
97 * @access public
98 */
99 public function order_bump_primary_settings()
100 {
101 $default = [
102 ];
103
104 $settings = get_post_meta($this->post_id, 'order-bump-settings', true);
105
106 if ($settings) {
107 return $settings;
108 }
109
110 return $default;
111 }
112
113
114 /**
115 * Controls the checkout content for the Checkout widget.
116 *
117 * @since 3.1.0
118 *
119 * @access public
120 */
121 public function checkout_content_control() {
122 // Group: Checkout Content
123 $this->controls['checkout_layout'] = [
124 'tab' => 'content',
125 'group' => 'wpfunnels_checkout_content',
126 'label' => esc_html__( 'Select Layout', 'wpfnl' ),
127 'type' => 'select',
128 'options' => $this->get_layout_types(),
129 'inline' => false,
130 'default' => 'wpfnl-col-2',
131 ];
132
133 if ( ! Wpfnl_functions::is_wpfnl_pro_activated() ) {
134 $this->controls['layout_upgrade_pro'] = [
135 'tab' => 'content',
136 'group' => 'wpfunnels_checkout_content',
137 'content' => sprintf( __( 'This is a pro feature. <a href="https://getwpfunnels.com/pricing/" target="_blank" rel="noopener">Upgrade Now!</a>.', 'wpfnl' ) ),
138 'type' => 'info',
139 'required' => [ 'checkout_layout', '=', [ 'wpfnl-2-step', 'wpfnl-multistep', 'wpfnl-express-checkout' ] ],
140 ];
141
142 }
143
144 $this->controls['checkout_floating_label'] = [
145 'tab' => 'content',
146 'group' => 'wpfunnels_checkout_content',
147 'label' => esc_html__( 'Floating Label', 'wpfnl' ),
148 'type' => 'select',
149 'options' => [
150 '' => __('Select option', 'wpfnl'),
151 'floating-label' => __('Floating Label', 'wpfnl'),
152 ],
153 'inline' => true,
154 ];
155
156 // Responsive Display
157 $this->controls['responsiveSeparator'] = [
158 'tab' => 'content',
159 'group' => 'wpfunnels_checkout_content',
160 'label' => esc_html__( 'Responsive Display', 'wpfnl' ),
161 'type' => 'separator',
162 ];
163
164 $this->controls['hide_on_desktop'] = [
165 'tab' => 'content',
166 'group' => 'wpfunnels_checkout_content',
167 'label' => esc_html__( 'Hide on Desktop (≥ 1200px)', 'wpfnl' ),
168 'type' => 'checkbox',
169 'default' => false,
170 'description' => esc_html__( 'Hide checkout on desktop devices (window width >= 1200px)', 'wpfnl' ),
171 ];
172
173 $this->controls['hide_on_tablet'] = [
174 'tab' => 'content',
175 'group' => 'wpfunnels_checkout_content',
176 'label' => esc_html__( 'Hide on Tablet (768px – 1199px)', 'wpfnl' ),
177 'type' => 'checkbox',
178 'default' => false,
179 'description' => esc_html__( 'Hide checkout on tablet devices (window width 768px - 1199px)', 'wpfnl' ),
180 ];
181
182 $this->controls['hide_on_mobile'] = [
183 'tab' => 'content',
184 'group' => 'wpfunnels_checkout_content',
185 'label' => esc_html__( 'Hide on Mobile (≤ 767px)', 'wpfnl' ),
186 'type' => 'checkbox',
187 'default' => false,
188 'description' => esc_html__( 'Hide checkout on mobile devices (window width <= 767px)', 'wpfnl' ),
189 ];
190
191 // Display Conditions
192 $this->controls['displayConditionSeparator'] = [
193 'tab' => 'content',
194 'group' => 'wpfunnels_checkout_content',
195 'label' => esc_html__( 'Display Conditions', 'wpfnl' ),
196 'type' => 'separator',
197 ];
198
199 $this->controls['display_condition_type'] = [
200 'tab' => 'content',
201 'group' => 'wpfunnels_checkout_content',
202 'label' => esc_html__( 'Display Condition', 'wpfnl' ),
203 'type' => 'select',
204 'options' => [
205 'none' => esc_html__( 'None', 'wpfnl' ),
206 'user_state' => esc_html__( 'User State', 'wpfnl' ),
207 'user_role' => esc_html__( 'User Role', 'wpfnl' ),
208 'browser' => esc_html__( 'Browser', 'wpfnl' ),
209 'operating_system' => esc_html__( 'Operating System', 'wpfnl' ),
210 'day' => esc_html__( 'Day', 'wpfnl' ),
211 ],
212 'inline' => false,
213 'default' => 'none',
214 ];
215
216 // User State
217 $this->controls['hide_from_logged_in'] = [
218 'tab' => 'content',
219 'group' => 'wpfunnels_checkout_content',
220 'label' => esc_html__( 'Hide From Logged In User', 'wpfnl' ),
221 'type' => 'checkbox',
222 'default' => false,
223 'required' => [ 'display_condition_type', '=', 'user_state' ],
224 ];
225
226 $this->controls['hide_from_logged_out'] = [
227 'tab' => 'content',
228 'group' => 'wpfunnels_checkout_content',
229 'label' => esc_html__( 'Hide From Logged Out User', 'wpfnl' ),
230 'type' => 'checkbox',
231 'default' => false,
232 'required' => [ 'display_condition_type', '=', 'user_state' ],
233 ];
234
235 // User Role
236 $this->controls['hide_for_user_role'] = [
237 'tab' => 'content',
238 'group' => 'wpfunnels_checkout_content',
239 'label' => esc_html__( 'Hide For User Role', 'wpfnl' ),
240 'type' => 'select',
241 'options' => $this->get_wp_user_roles(),
242 'default' => 'none',
243 'required' => [ 'display_condition_type', '=', 'user_role' ],
244 ];
245
246 // Browser
247 $this->controls['hide_on_browser'] = [
248 'tab' => 'content',
249 'group' => 'wpfunnels_checkout_content',
250 'label' => esc_html__( 'Hide On Browser', 'wpfnl' ),
251 'type' => 'select',
252 'options' => [
253 'none' => esc_html__( 'None', 'wpfnl' ),
254 'mozilla' => esc_html__( 'Mozilla Firefox', 'wpfnl' ),
255 'chrome' => esc_html__( 'Google Chrome', 'wpfnl' ),
256 'opera_mini' => esc_html__( 'Opera Mini', 'wpfnl' ),
257 'safari' => esc_html__( 'Safari', 'wpfnl' ),
258 'edge' => esc_html__( 'Microsoft Edge', 'wpfnl' ),
259 ],
260 'default' => 'none',
261 'required' => [ 'display_condition_type', '=', 'browser' ],
262 ];
263
264 // Operating System
265 $this->controls['hide_on_os'] = [
266 'tab' => 'content',
267 'group' => 'wpfunnels_checkout_content',
268 'label' => esc_html__( 'Hide On Operating System', 'wpfnl' ),
269 'type' => 'select',
270 'options' => [
271 'none' => esc_html__( 'None', 'wpfnl' ),
272 'ios' => esc_html__( 'iOS', 'wpfnl' ),
273 'android' => esc_html__( 'Android', 'wpfnl' ),
274 'windows' => esc_html__( 'Windows', 'wpfnl' ),
275 'macos' => esc_html__( 'MacOS', 'wpfnl' ),
276 'linux' => esc_html__( 'Linux', 'wpfnl' ),
277 'sunos' => esc_html__( 'SunOS', 'wpfnl' ),
278 'openbsd' => esc_html__( 'OpenBSD', 'wpfnl' ),
279 ],
280 'default' => 'none',
281 'required' => [ 'display_condition_type', '=', 'operating_system' ],
282 ];
283
284 // Day
285 $this->controls['disable_on_days'] = [
286 'tab' => 'content',
287 'group' => 'wpfunnels_checkout_content',
288 'label' => esc_html__( 'Select Days You Want To Disable', 'wpfnl' ),
289 'type' => 'select',
290 'multiple' => true,
291 'options' => [
292 'monday' => esc_html__( 'Monday', 'wpfnl' ),
293 'tuesday' => esc_html__( 'Tuesday', 'wpfnl' ),
294 'wednesday' => esc_html__( 'Wednesday', 'wpfnl' ),
295 'thursday' => esc_html__( 'Thursday', 'wpfnl' ),
296 'friday' => esc_html__( 'Friday', 'wpfnl' ),
297 'saturday' => esc_html__( 'Saturday', 'wpfnl' ),
298 'sunday' => esc_html__( 'Sunday', 'wpfnl' ),
299 ],
300 'default' => [],
301 'required' => [ 'display_condition_type', '=', 'day' ],
302 ];
303
304 // Animation
305 $this->controls['animationSeparator'] = [
306 'tab' => 'content',
307 'group' => 'wpfunnels_checkout_content',
308 'label' => esc_html__( 'Animation', 'wpfnl' ),
309 'type' => 'separator',
310 ];
311
312 $this->controls['entrance_animation'] = [
313 'tab' => 'content',
314 'group' => 'wpfunnels_checkout_content',
315 'label' => esc_html__( 'Entrance Animation', 'wpfnl' ),
316 'type' => 'select',
317 'options' => [
318 '' => esc_html__( 'None', 'wpfnl' ),
319 'fadeIn' => esc_html__( 'Fade In', 'wpfnl' ),
320 'fadeInUp' => esc_html__( 'Fade In Up', 'wpfnl' ),
321 'fadeInDown' => esc_html__( 'Fade In Down', 'wpfnl' ),
322 'fadeInLeft' => esc_html__( 'Fade In Left', 'wpfnl' ),
323 'fadeInRight'=> esc_html__( 'Fade In Right', 'wpfnl' ),
324 'zoomIn' => esc_html__( 'Zoom In', 'wpfnl' ),
325 'zoomInUp' => esc_html__( 'Zoom In Up', 'wpfnl' ),
326 'bounceIn' => esc_html__( 'Bounce In', 'wpfnl' ),
327 'bounceInUp' => esc_html__( 'Bounce In Up', 'wpfnl' ),
328 'slideInUp' => esc_html__( 'Slide In Up', 'wpfnl' ),
329 'slideInLeft'=> esc_html__( 'Slide In Left', 'wpfnl' ),
330 'slideInRight'=> esc_html__( 'Slide In Right', 'wpfnl' ),
331 'flipInX' => esc_html__( 'Flip In X', 'wpfnl' ),
332 'flipInY' => esc_html__( 'Flip In Y', 'wpfnl' ),
333 'pulse' => esc_html__( 'Pulse', 'wpfnl' ),
334 'tada' => esc_html__( 'Tada', 'wpfnl' ),
335 'wobble' => esc_html__( 'Wobble', 'wpfnl' ),
336 ],
337 'inline' => false,
338 'placeholder' => esc_html__( 'None', 'wpfnl' ),
339 'default' => '',
340 'description' => esc_html__( 'Animation plays when the checkout enters the viewport on the live page.', 'wpfnl' ),
341 ];
342
343 }
344
345
346 /**
347 * Registers the ob control.
348 *
349 * @since 3.1.0
350 *
351 * @access public
352 */
353 public function ob_register_control(){
354 $ob_settings = $this->order_bump_primary_settings();
355 if( count($ob_settings) > 0 ){
356 foreach( $ob_settings as $key=>$settings ){
357 $key = (int) $key;
358 $index = ((int)($key) + 1);
359
360 // Group: Checkout Content
361 $this->controls['order_bump_'.$key] = [
362 'tab' => 'content',
363 'group' => 'wpfunnels_checkout_content',
364 'label' => sprintf( __("Enable Order bump %s", "wpfnl"),$index ),
365 'type' => 'select',
366 'options' => [
367 'yes' => __('Yes', 'wpfnl'),
368 'no' => __('No', 'wpfnl'),
369 ],
370 'inline' => false,
371 'default' => $settings['isEnabled'] ? 'yes' : 'no',
372 ];
373
374 $this->controls['order_bump_position_'.$key] = [
375 'tab' => 'content',
376 'group' => 'wpfunnels_checkout_content',
377 'label' => sprintf( __( "Order bump %s Position", "wpfnl"), $index ),
378 'type' => 'select',
379 'options' => [
380 'before-order' => __('Before Order Details', 'wpfnl'),
381 'after-order' => __('After Order Details', 'wpfnl'),
382 'before-checkout' => __('Before Checkout Details', 'wpfnl'),
383 'after-customer-details' => __('After Customer Details', 'wpfnl'),
384 'after-payment' => __('After Payment Options', 'wpfnl'),
385 'before-payment' => __('Before Payment Options', 'wpfnl'),
386 'popup' => __('Pop-up offer', 'wpfnl'),
387 ],
388 'inline' => false,
389 'default' => $ob_settings[$key]['position'],
390 'required' => [ 'order_bump_'.$key, '=', 'yes' ],
391 ];
392 }
393 }
394 }
395
396
397 /**
398 * Register Billing Fields Style Controls.
399 *
400 * @since 3.1.0
401 * @access public
402 */
403 public function register_billing_style_controls(){
404 $this->controls['billing_heading_style'] = [
405 'group' => 'wpfunnels_checkout_billing_style',
406 'label' => esc_html__( 'Heading Style', 'wpfnl' ),
407 'type' => 'separator',
408 ];
409 $this->controls['billing_heading_typography'] = [
410 'group' => 'wpfunnels_checkout_billing_style',
411 'label' => esc_html__( 'Typography', 'wpfnl' ),
412 'type' => 'typography',
413 'css' => [
414 [
415 'property' => 'font',
416 'selector' => '.wpfnl-checkout .woocommerce-billing-fields h3',
417 ],
418 [
419 'property' => 'font',
420 'selector' => '.woocommerce.woocommerce-checkout #customer_details .woocommerce-billing-fields h3',
421 ],
422 [
423 'property' => 'font',
424 'selector' => '.woocommerce-page.woocommerce-checkout #customer_details .woocommerce-billing-fields h3',
425 ]
426 ],
427 ];
428 $this->controls['billing_heading_margin'] = [
429 'group' => 'wpfunnels_checkout_billing_style',
430 'label' => esc_html__( 'Margin', 'wpfnl' ),
431 'type' => 'spacing',
432 'css' => [
433 [
434 'property' => 'margin',
435 'selector' => '.wpfnl-checkout .woocommerce-billing-fields h3',
436 ],
437 ],
438 ];
439 $this->controls['billing_heading_padding'] = [
440 'group' => 'wpfunnels_checkout_billing_style',
441 'label' => esc_html__( 'Padding', 'wpfnl' ),
442 'type' => 'spacing',
443 'css' => [
444 [
445 'property' => 'padding',
446 'selector' => '.wpfnl-checkout .woocommerce-billing-fields h3',
447 ],
448 ],
449 ];
450
451
452 // ----label style------
453 $this->controls['billing_label_style'] = [
454 'group' => 'wpfunnels_checkout_billing_style',
455 'label' => esc_html__( 'Label Style', 'wpfnl' ),
456 'type' => 'separator',
457 ];
458 $this->controls['billing_label_typography'] = [
459 'group' => 'wpfunnels_checkout_billing_style',
460 'label' => esc_html__( 'Typography', 'wpfnl' ),
461 'type' => 'typography',
462 'css' => [
463 [
464 'property' => 'font',
465 'selector' => '.wpfnl-checkout .woocommerce-billing-fields p.form-row label',
466 ],
467 ],
468 ];
469 $this->controls['billing_label_margin'] = [
470 'group' => 'wpfunnels_checkout_billing_style',
471 'label' => esc_html__( 'Margin', 'wpfnl' ),
472 'type' => 'spacing',
473 'css' => [
474 [
475 'property' => 'margin',
476 'selector' => '.wpfnl-checkout .woocommerce-billing-fields p.form-row label',
477 ],
478 ],
479 ];
480 // ----end label style------
481
482
483 // ----input field style------
484 $this->controls['billing_input_field_style'] = [
485 'group' => 'wpfunnels_checkout_billing_style',
486 'label' => esc_html__( 'Input Field Style', 'wpfnl' ),
487 'type' => 'separator',
488 ];
489 $this->controls['billing_input_text_typography'] = [
490 'group' => 'wpfunnels_checkout_billing_style',
491 'label' => esc_html__( 'Typography', 'wpfnl' ),
492 'type' => 'typography',
493 'css' => [
494 [
495 'property' => 'font',
496 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .form-row input.input-text',
497 ],
498 [
499 'property' => 'font',
500 'selector' => '.wpfnl-checkout .woocommerce-account-fields .form-row input.input-text',
501 ],
502 [
503 'property' => 'font',
504 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .form-row textarea',
505 ],
506 [
507 'property' => 'font',
508 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .select2-container--default .select2-selection--single',
509 ],
510 [
511 'property' => 'font',
512 'selector' => '.woocommerce-billing-fields .select2-container--default .select2-selection--single .select2-selection__rendered',
513 ],
514 [
515 'property' => 'font',
516 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .form-row select.select',
517 ],
518 [
519 'property' => 'font',
520 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .form-row select',
521 ],
522 [
523 'property' => 'font',
524 'selector' => '.wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_billing .form-row:not(.create-account) input.input-text:not(#billing_address_2, #shipping_address_2)',
525 ],
526 [
527 'property' => 'font',
528 'selector' => '.wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_billing .form-row:not(.create-account) textarea',
529 ],
530 ],
531 ];
532 $this->controls['billing_input_bgcolor'] = [
533 'group' => 'wpfunnels_checkout_billing_style',
534 'label' => esc_html__( 'Background Color', 'wpfnl' ),
535 'type' => 'color',
536 'default' => '',
537 'css' => [
538 [
539 'property' => 'background-color',
540 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .form-row input.input-text',
541 ],
542 [
543 'property' => 'background-color',
544 'selector' => '.wpfnl-checkout .woocommerce-account-fields .form-row input.input-text',
545 ],
546 [
547 'property' => 'background-color',
548 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .form-row textarea',
549 ],
550 [
551 'property' => 'background-color',
552 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .select2-container--default .select2-selection--single',
553 ],
554 [
555 'property' => 'background-color',
556 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .form-row select.select',
557 ],
558 [
559 'property' => 'background-color',
560 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .form-row select',
561 ],
562 [
563 'property' => 'background-color',
564 'selector' => '.wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_billing .form-row:not(.create-account) > label',
565 ],
566 ],
567 ];
568 $this->controls['billing_input_border_style'] = [
569 'group' => 'wpfunnels_checkout_billing_style',
570 'label' => esc_html__( 'Border', 'wpfnl' ),
571 'type' => 'border',
572 'css' => [
573 [
574 'property' => 'border',
575 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .form-row input.input-text',
576 ],
577 [
578 'property' => 'border',
579 'selector' => '.wpfnl-checkout .woocommerce-account-fields .form-row input.input-text',
580 ],
581 [
582 'property' => 'border',
583 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .form-row textarea',
584 ],
585 [
586 'property' => 'border',
587 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .select2-container--default .select2-selection--single',
588 ],
589 [
590 'property' => 'border',
591 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .form-row select.select',
592 ],
593 [
594 'property' => 'border',
595 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .form-row select',
596 ],
597 ],
598 ];
599 $this->controls['billing_input_padding'] = [
600 'group' => 'wpfunnels_checkout_billing_style',
601 'label' => esc_html__( 'Padding', 'wpfnl' ),
602 'type' => 'spacing',
603 'css' => [
604 [
605 'property' => 'padding',
606 'selector' => '.wpfnl-checkout form .woocommerce-billing-fields .form-row input.input-text',
607 ],
608 [
609 'property' => 'padding',
610 'selector' => '.wpfnl-checkout .woocommerce-account-fields .form-row input.input-text',
611 ],
612 [
613 'property' => 'padding',
614 'selector' => '.wpfnl-checkout form .woocommerce-billing-fields .form-row textarea',
615 ],
616 [
617 'property' => 'padding',
618 'selector' => '.wpfnl-checkout form .woocommerce-billing-fields select.select',
619 ],
620 [
621 'property' => 'padding',
622 'selector' => '.wpfnl-checkout form .woocommerce-billing-fields .form-row select',
623 ],
624 [
625 'property' => 'padding',
626 'selector' => '.wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_billing .form-row:not(.create-account) input.input-text:not(#billing_address_2, #shipping_address_2)',
627 ],
628 [
629 'property' => 'padding',
630 'selector' => '.wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_billing .form-row:not(.create-account) textarea',
631 ],
632 [
633 'property' => 'padding',
634 'selector' => '.wpfnl-checkout .woocommerce-billing-fields .select2-container .select2-selection--single .select2-selection__rendered',
635 ],
636 ],
637 ];
638 $this->controls['billing_input_margin'] = [
639 'group' => 'wpfunnels_checkout_billing_style',
640 'label' => esc_html__( 'Margin', 'wpfnl' ),
641 'type' => 'spacing',
642 'css' => [
643 [
644 'property' => 'margin',
645 'selector' => '.wpfnl-checkout form .woocommerce-billing-fields p.form-row:not(#billing_address_1_field)',
646 ],
647 [
648 'property' => 'margin',
649 'selector' => '.wpfnl-checkout .woocommerce-account-fields .form-row',
650 ],
651 ],
652 ];
653 // ----end input field style------
654
655 }
656
657
658 /**
659 * Register Shipping Fields Style Controls.
660 *
661 * @since 3.1.0
662 * @access public
663 */
664 public function register_shipping_style_controls(){
665 $this->controls['shipping_heading_style'] = [
666 'group' => 'wpfunnels_checkout_shipping_style',
667 'label' => esc_html__( 'Heading Style', 'wpfnl' ),
668 'type' => 'separator',
669 ];
670 $this->controls['shipping_heading_typography'] = [
671 'group' => 'wpfunnels_checkout_shipping_style',
672 'label' => esc_html__( 'Typography', 'wpfnl' ),
673 'type' => 'typography',
674 'css' => [
675 [
676 'property' => 'font',
677 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields #ship-to-different-address span',
678 ],
679 [
680 'property' => 'font',
681 'selector' => '.wpfnl-checkout .woocommerce-additional-fields > h3',
682 ]
683 ],
684 ];
685 $this->controls['shipping_heading_margin'] = [
686 'group' => 'wpfunnels_checkout_shipping_style',
687 'label' => esc_html__( 'Margin', 'wpfnl' ),
688 'type' => 'spacing',
689 'css' => [
690 [
691 'property' => 'margin',
692 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields #ship-to-different-address',
693 ],
694 [
695 'property' => 'margin',
696 'selector' => '.wpfnl-checkout .woocommerce-additional-fields > h3',
697 ],
698 ],
699 ];
700 $this->controls['shipping_heading_padding'] = [
701 'group' => 'wpfunnels_checkout_shipping_style',
702 'label' => esc_html__( 'Padding', 'wpfnl' ),
703 'type' => 'spacing',
704 'css' => [
705 [
706 'property' => 'padding',
707 'selector' => '.wpfnl-checkout .woocommerce-additional-fields > h3',
708 ],
709 [
710 'property' => 'padding',
711 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields #ship-to-different-address',
712 ],
713 ],
714 ];
715
716
717 // ----label style------
718 $this->controls['shipping_label_style'] = [
719 'group' => 'wpfunnels_checkout_shipping_style',
720 'label' => esc_html__( 'Label Style', 'wpfnl' ),
721 'type' => 'separator',
722 ];
723 $this->controls['shipping_label_typography'] = [
724 'group' => 'wpfunnels_checkout_shipping_style',
725 'label' => esc_html__( 'Typography', 'wpfnl' ),
726 'type' => 'typography',
727 'css' => [
728 [
729 'property' => 'font',
730 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields p.form-row label',
731 ],
732 [
733 'property' => 'font',
734 'selector' => '.wpfnl-checkout .woocommerce-additional-fields p.form-row label',
735 ],
736 ],
737 ];
738 $this->controls['shipping_label_margin'] = [
739 'group' => 'wpfunnels_checkout_shipping_style',
740 'label' => esc_html__( 'Margin', 'wpfnl' ),
741 'type' => 'spacing',
742 'css' => [
743 [
744 'property' => 'margin',
745 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields p.form-row label',
746 ],
747 [
748 'property' => 'margin',
749 'selector' => '.wpfnl-checkout .woocommerce-additional-fields p.form-row label',
750 ],
751 ],
752 ];
753 // ----end label style------
754
755
756 // ----input field style------
757 $this->controls['shipping_input_field_style'] = [
758 'group' => 'wpfunnels_checkout_shipping_style',
759 'label' => esc_html__( 'Input Field Style', 'wpfnl' ),
760 'type' => 'separator',
761 ];
762 $this->controls['shipping_input_text_typography'] = [
763 'group' => 'wpfunnels_checkout_shipping_style',
764 'label' => esc_html__( 'Typography', 'wpfnl' ),
765 'type' => 'typography',
766 'css' => [
767 [
768 'property' => 'font',
769 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row input.input-text',
770 ],
771 [
772 'property' => 'font',
773 'selector' => '.wpfnl-checkout .woocommerce-additional-fields .form-row textarea',
774 ],
775 [
776 'property' => 'font',
777 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single',
778 ],
779 [
780 'property' => 'font',
781 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single .select2-selection__rendered',
782 ],
783 [
784 'property' => 'font',
785 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row select.select',
786 ],
787 [
788 'property' => 'font',
789 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row select',
790 ],
791 [
792 'property' => 'font',
793 'selector' => '.wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) input.input-text:not(#billing_address_2, #shipping_address_2)',
794 ],
795 [
796 'property' => 'font',
797 'selector' => '.wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) textarea',
798 ],
799 ],
800 ];
801 $this->controls['shipping_input_bgcolor'] = [
802 'group' => 'wpfunnels_checkout_shipping_style',
803 'label' => esc_html__( 'Background Color', 'wpfnl' ),
804 'type' => 'color',
805 'default' => '',
806 'css' => [
807 [
808 'property' => 'background-color',
809 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row input.input-text',
810 ],
811 [
812 'property' => 'background-color',
813 'selector' => '.wpfnl-checkout .woocommerce-additional-fields .form-row textarea',
814 ],
815 [
816 'property' => 'background-color',
817 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single',
818 ],
819 [
820 'property' => 'background-color',
821 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row select.select',
822 ],
823 [
824 'property' => 'background-color',
825 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row select',
826 ],
827 [
828 'property' => 'background-color',
829 'selector' => '.wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) > label',
830 ],
831 ],
832 ];
833 $this->controls['shipping_input_border_style'] = [
834 'group' => 'wpfunnels_checkout_shipping_style',
835 'label' => esc_html__( 'Border', 'wpfnl' ),
836 'type' => 'border',
837 'css' => [
838 [
839 'property' => 'border',
840 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row input.input-text',
841 ],
842 [
843 'property' => 'border',
844 'selector' => '.wpfnl-checkout .woocommerce-additional-fields .form-row textarea',
845 ],
846 [
847 'property' => 'border',
848 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single',
849 ],
850 [
851 'property' => 'border',
852 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row select.select',
853 ],
854 [
855 'property' => 'border',
856 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row select',
857 ],
858 ],
859 ];
860 $this->controls['shipping_input_padding'] = [
861 'group' => 'wpfunnels_checkout_shipping_style',
862 'label' => esc_html__( 'Padding', 'wpfnl' ),
863 'type' => 'spacing',
864 'css' => [
865 [
866 'property' => 'padding',
867 'selector' => '.wpfnl-checkout form .woocommerce-shipping-fields .form-row input.input-text',
868 ],
869 [
870 'property' => 'padding',
871 'selector' => '.wpfnl-checkout form .woocommerce-additional-fields .form-row textarea',
872 ],
873 [
874 'property' => 'padding',
875 'selector' => '.wpfnl-checkout form .woocommerce-shipping-fields select.select',
876 ],
877 [
878 'property' => 'padding',
879 'selector' => '.wpfnl-checkout form .woocommerce-shipping-fields .form-row select',
880 ],
881 [
882 'property' => 'padding',
883 'selector' => '.wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) input.input-text:not(#billing_address_2, #shipping_address_2)',
884 ],
885 [
886 'property' => 'padding',
887 'selector' => '.wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) textarea',
888 ],
889 [
890 'property' => 'padding',
891 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .select2-container .select2-selection--single .select2-selection__rendered',
892 ],
893 ],
894 ];
895 $this->controls['shipping_input_margin'] = [
896 'group' => 'wpfunnels_checkout_shipping_style',
897 'label' => esc_html__( 'Margin', 'wpfnl' ),
898 'type' => 'spacing',
899 'css' => [
900 [
901 'property' => 'margin',
902 'selector' => '.wpfnl-checkout form .woocommerce-shipping-fields p.form-row:not(#shipping_address_1_field)',
903 ],
904 ],
905 ];
906 // ----end input field style------
907
908 }
909
910
911 /**
912 * Register Order table Style Controls.
913 *
914 * @since 3.1.0
915 * @access public
916 */
917 public function register_order_tbl_style_controls(){
918 $this->controls['order_heading_style'] = [
919 'group' => 'wpfunnels_checkout_order_tbl_style',
920 'label' => esc_html__( 'Heading Style', 'wpfnl' ),
921 'type' => 'separator',
922 ];
923 $this->controls['order_heading_typography'] = [
924 'group' => 'wpfunnels_checkout_order_tbl_style',
925 'label' => esc_html__( 'Typography', 'wpfnl' ),
926 'type' => 'typography',
927 'css' => [
928 [
929 'property' => 'font',
930 'selector' => '.wpfnl-checkout .woocommerce-checkout #order_review_heading',
931 ],
932 ],
933 ];
934 $this->controls['order_heading_margin'] = [
935 'group' => 'wpfunnels_checkout_order_tbl_style',
936 'label' => esc_html__( 'Margin', 'wpfnl' ),
937 'type' => 'spacing',
938 'css' => [
939 [
940 'property' => 'margin',
941 'selector' => '.wpfnl-checkout .woocommerce-checkout #order_review_heading',
942 ],
943 ],
944 ];
945 $this->controls['order_heading_padding'] = [
946 'group' => 'wpfunnels_checkout_order_tbl_style',
947 'label' => esc_html__( 'Padding', 'wpfnl' ),
948 'type' => 'spacing',
949 'css' => [
950 [
951 'property' => 'padding',
952 'selector' => '.wpfnl-checkout .woocommerce-checkout #order_review_heading',
953 ],
954 ],
955 ];
956 // ----order table heading style------
957
958 // ----order table style------
959 $this->controls['order_table_style'] = [
960 'group' => 'wpfunnels_checkout_order_tbl_style',
961 'label' => esc_html__( 'Table Style', 'wpfnl' ),
962 'type' => 'separator',
963 ];
964 $this->controls['your_order_text_typography'] = [
965 'group' => 'wpfunnels_checkout_order_tbl_style',
966 'label' => esc_html__( 'Typography', 'wpfnl' ),
967 'type' => 'typography',
968 'css' => [
969 [
970 'property' => 'font',
971 'selector' => '.wpfnl-checkout .woocommerce-checkout table.woocommerce-checkout-review-order-table td',
972 ],
973 [
974 'property' => 'font',
975 'selector' => '.wpfnl-checkout .woocommerce-checkout table.woocommerce-checkout-review-order-table th',
976 ],
977 ],
978 ];
979 $this->controls['order_table_border_color'] = [
980 'group' => 'wpfunnels_checkout_order_tbl_style',
981 'label' => esc_html__( 'Border Color', 'wpfnl' ),
982 'type' => 'color',
983 'css' => [
984 [
985 'property' => 'border-color',
986 'selector' => '.wpfnl-checkout .woocommerce table.shop_table',
987 ],
988 [
989 'property' => 'border-color',
990 'selector' => '.wpfnl-checkout .woocommerce table.shop_table thead th',
991 ],
992 [
993 'property' => 'border-color',
994 'selector' => '.wpfnl-checkout .woocommerce table.shop_table thead td',
995 ],
996 [
997 'property' => 'border-color',
998 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tbody th',
999 ],
1000 [
1001 'property' => 'border-color',
1002 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tbody td',
1003 ],
1004 [
1005 'property' => 'border-color',
1006 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tfoot td',
1007 ],
1008 [
1009 'property' => 'border-color',
1010 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tfoot th',
1011 ],
1012 ],
1013 ];
1014 $this->controls['order_table_radius'] = [
1015 'group' => 'wpfunnels_checkout_order_tbl_style',
1016 'label' => esc_html__( 'Border Radius', 'wpfnl' ),
1017 'type' => 'border',
1018 'css' => [
1019 [
1020 'property' => 'border-radius',
1021 'selector' => '.wpfnl-checkout .woocommerce table.shop_table',
1022 ]
1023 ],
1024 'exclude' => [
1025 'width',
1026 'style',
1027 'color',
1028 ],
1029
1030 ];
1031 $this->controls['order_table_cell_padding'] = [
1032 'group' => 'wpfunnels_checkout_order_tbl_style',
1033 'label' => esc_html__( 'Padding', 'wpfnl' ),
1034 'type' => 'spacing',
1035 'css' => [
1036 [
1037 'property' => 'padding',
1038 'selector' => '.wpfnl-checkout .woocommerce table.shop_table thead th',
1039 ],
1040 [
1041 'property' => 'padding',
1042 'selector' => '.wpfnl-checkout .woocommerce table.shop_table thead td',
1043 ],
1044 [
1045 'property' => 'padding',
1046 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tbody th',
1047 ],
1048 [
1049 'property' => 'padding',
1050 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tbody td',
1051 ],
1052 [
1053 'property' => 'padding',
1054 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tfoot td',
1055 ],
1056 [
1057 'property' => 'padding',
1058 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tfoot th',
1059 ],
1060 ],
1061 ];
1062 $this->controls['order_table_margin'] = [
1063 'group' => 'wpfunnels_checkout_order_tbl_style',
1064 'label' => esc_html__( 'Margin', 'wpfnl' ),
1065 'type' => 'spacing',
1066 'css' => [
1067 [
1068 'property' => 'margin',
1069 'selector' => '.wpfnl-checkout .woocommerce table.shop_table',
1070 ],
1071
1072 ],
1073 ];
1074 // ----end order table style------
1075
1076 }
1077
1078
1079 /**
1080 * Register Payment Section Style Controls.
1081 *
1082 * @since 3.1.0
1083 * @access public
1084 */
1085 public function register_payment_section_style_controls(){
1086 $this->controls['payment_section_text_color'] = [
1087 'group' => 'wpfunnels_checkout_payment_style',
1088 'label' => esc_html__( 'Text Color', 'wpfnl' ),
1089 'type' => 'color',
1090 'css' => [
1091 [
1092 'property' => 'color',
1093 'selector' => '.wpfnl-checkout #payment .place-order',
1094 ],
1095 [
1096 'property' => 'color',
1097 'selector' => '.wpfnl-checkout #payment .place-order p',
1098 ],
1099 ],
1100 ];
1101 $this->controls['payment_section_link_color'] = [
1102 'group' => 'wpfunnels_checkout_payment_style',
1103 'label' => esc_html__( 'Link Color', 'wpfnl' ),
1104 'type' => 'color',
1105 'css' => [
1106 [
1107 'property' => 'color',
1108 'selector' => '.wpfnl-checkout #payment .place-order a',
1109 ],
1110 ],
1111 ];
1112 $this->controls['payment_section_bg_color'] = [
1113 'group' => 'wpfunnels_checkout_payment_style',
1114 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1115 'type' => 'color',
1116 'css' => [
1117 [
1118 'property' => 'background-color',
1119 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment',
1120 ],
1121 ],
1122 ];
1123 $this->controls['payment_section_typography'] = [
1124 'group' => 'wpfunnels_checkout_payment_style',
1125 'label' => esc_html__( 'Typography', 'wpfnl' ),
1126 'type' => 'typography',
1127 'css' => [
1128 [
1129 'property' => 'font',
1130 'selector' => '.wpfnl-checkout #payment .place-order',
1131 ],
1132 [
1133 'property' => 'font',
1134 'selector' => '.wpfnl-checkout #payment .place-order p',
1135 ],
1136 ],
1137 ];
1138 $this->controls['payment_section_radius'] = [
1139 'group' => 'wpfunnels_checkout_payment_style',
1140 'label' => esc_html__( 'Border Radius', 'wpfnl' ),
1141 'type' => 'border',
1142 'css' => [
1143 [
1144 'property' => 'border-radius',
1145 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment',
1146 ]
1147 ],
1148 'exclude' => [
1149 'width',
1150 'style',
1151 'color',
1152 ],
1153
1154 ];
1155 // ----end payment section global style------
1156
1157
1158 // ----payment method style------
1159 $this->controls['payment_method_heading_style'] = [
1160 'group' => 'wpfunnels_checkout_payment_style',
1161 'label' => esc_html__( 'Payment Method Style', 'wpfnl' ),
1162 'type' => 'separator',
1163 ];
1164 $this->controls['payment_method_typography'] = [
1165 'group' => 'wpfunnels_checkout_payment_style',
1166 'label' => esc_html__( 'Typography', 'wpfnl' ),
1167 'type' => 'typography',
1168 'css' => [
1169 [
1170 'property' => 'font',
1171 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods li',
1172 ],
1173 [
1174 'property' => 'font',
1175 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1176 ],
1177 ],
1178 ];
1179 $this->controls['payment_method_bg_color'] = [
1180 'group' => 'wpfunnels_checkout_payment_style',
1181 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1182 'type' => 'color',
1183 'css' => [
1184 [
1185 'property' => 'background-color',
1186 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods',
1187 ],
1188 ],
1189 ];
1190
1191 $this->controls['radio_button_separator'] = [
1192 'group' => 'wpfunnels_checkout_payment_style',
1193 'type' => 'separator',
1194 ];
1195
1196 $this->controls['payment_method_radio_default_color'] = [
1197 'group' => 'wpfunnels_checkout_payment_style',
1198 'label' => esc_html__( 'Radio Button Default Color', 'wpfnl' ),
1199 'type' => 'color',
1200 'css' => [
1201 [
1202 'property' => 'border-color',
1203 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > label:before',
1204 ],
1205 [
1206 'property' => 'border-color',
1207 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > label:before',
1208 ],
1209 ],
1210 ];
1211 $this->controls['payment_method_radio_color'] = [
1212 'group' => 'wpfunnels_checkout_payment_style',
1213 'label' => esc_html__( 'Radio Button Active Color', 'wpfnl' ),
1214 'type' => 'color',
1215 'css' => [
1216 [
1217 'property' => 'border-color',
1218 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > input[type=radio]:checked + label:before',
1219 ],
1220 [
1221 'property' => 'border-color',
1222 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > input[type=radio]:checked + label:before',
1223 ],
1224 [
1225 'property' => 'background-color',
1226 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > input[type=radio]:checked + label:after',
1227 ],
1228 [
1229 'property' => 'background-color',
1230 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > input[type=radio]:checked + label:after',
1231 ],
1232 ],
1233 ];
1234
1235 $this->controls['saved_payment_checkbox_separator'] = [
1236 'group' => 'wpfunnels_checkout_payment_style',
1237 'type' => 'separator',
1238 ];
1239
1240 $this->controls['saved_payment_checkbox_default_color'] = [
1241 'group' => 'wpfunnels_checkout_payment_style',
1242 'label' => esc_html__( 'Checkbox Default Color', 'wpfnl' ),
1243 'type' => 'color',
1244 'css' => [
1245 [
1246 'property' => 'border-color',
1247 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods-saveNew > label:before',
1248 ],
1249 [
1250 'property' => 'border-color',
1251 'selector' => '.wpfnl-checkout #mailpoet_woocommerce_checkout_optin_field #mailpoet_woocommerce_checkout_optin',
1252 ],
1253 ],
1254 ];
1255 $this->controls['saved_payment_checkbox_color'] = [
1256 'group' => 'wpfunnels_checkout_payment_style',
1257 'label' => esc_html__( 'Checkbox Active Color', 'wpfnl' ),
1258 'type' => 'color',
1259 'css' => [
1260 [
1261 'property' => 'background-color',
1262 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods-saveNew > input[type=checkbox]:checked + label:before',
1263 ],
1264 [
1265 'property' => 'background-color',
1266 'selector' => '.wpfnl-checkout #mailpoet_woocommerce_checkout_optin_field #mailpoet_woocommerce_checkout_optin:checked',
1267 ],
1268 ],
1269 ];
1270 $this->controls['saved_payment_checkbox_tic_color'] = [
1271 'group' => 'wpfunnels_checkout_payment_style',
1272 'label' => esc_html__( 'Checkbox Tic Sign Color', 'wpfnl' ),
1273 'type' => 'color',
1274 'css' => [
1275 [
1276 'property' => 'border-color',
1277 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods-saveNew > label:after',
1278 ],
1279 ],
1280 ];
1281
1282 $this->controls['payment_method_border_separator'] = [
1283 'group' => 'wpfunnels_checkout_payment_style',
1284 'type' => 'separator',
1285 ];
1286
1287 $this->controls['payment_method_border'] = [
1288 'group' => 'wpfunnels_checkout_payment_style',
1289 'label' => esc_html__( 'Border', 'wpfnl' ),
1290 'type' => 'border',
1291 'css' => [
1292 [
1293 'property' => 'border-radius',
1294 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods',
1295 ]
1296 ],
1297 ];
1298 $this->controls['payment_method_padding'] = [
1299 'group' => 'wpfunnels_checkout_payment_style',
1300 'label' => esc_html__( 'Padding', 'wpfnl' ),
1301 'type' => 'spacing',
1302 'css' => [
1303 [
1304 'property' => 'padding',
1305 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods',
1306 ],
1307
1308 ],
1309 ];
1310 $this->controls['payment_method_margin'] = [
1311 'group' => 'wpfunnels_checkout_payment_style',
1312 'label' => esc_html__( 'Margin', 'wpfnl' ),
1313 'type' => 'spacing',
1314 'css' => [
1315 [
1316 'property' => 'margin',
1317 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods',
1318 ],
1319
1320 ],
1321 ];
1322 // ----end payment method style------
1323
1324
1325 // ----payment box style------
1326 $this->controls['payment_box_heading_style'] = [
1327 'group' => 'wpfunnels_checkout_payment_style',
1328 'label' => esc_html__( 'Payment Box Style', 'wpfnl' ),
1329 'type' => 'separator',
1330 ];
1331 $this->controls['payment_box_txt_color'] = [
1332 'group' => 'wpfunnels_checkout_payment_style',
1333 'label' => esc_html__( 'Text Color', 'wpfnl' ),
1334 'type' => 'color',
1335 'css' => [
1336 [
1337 'property' => 'color',
1338 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1339 ],
1340 ],
1341 ];
1342 $this->controls['payment_box_bg_color'] = [
1343 'group' => 'wpfunnels_checkout_payment_style',
1344 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1345 'type' => 'color',
1346 'css' => [
1347 [
1348 'property' => 'background-color',
1349 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1350 ],
1351 [
1352 'property' => 'border-bottom-color',
1353 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box:before',
1354 ],
1355 ],
1356 ];
1357 $this->controls['payment_box_typography'] = [
1358 'group' => 'wpfunnels_checkout_payment_style',
1359 'label' => esc_html__( 'Typography', 'wpfnl' ),
1360 'type' => 'typography',
1361 'css' => [
1362 [
1363 'property' => 'font',
1364 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1365 ]
1366 ],
1367 ];
1368 $this->controls['payment_box_radius'] = [
1369 'group' => 'wpfunnels_checkout_payment_style',
1370 'label' => esc_html__( 'Radius', 'wpfnl' ),
1371 'type' => 'border',
1372 'css' => [
1373 [
1374 'property' => 'border-radius',
1375 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1376 ]
1377 ],
1378 'exclude' => [
1379 'width',
1380 'style',
1381 'color',
1382 ],
1383
1384 ];
1385 $this->controls['payment_box_padding'] = [
1386 'group' => 'wpfunnels_checkout_payment_style',
1387 'label' => esc_html__( 'Padding', 'wpfnl' ),
1388 'type' => 'spacing',
1389 'css' => [
1390 [
1391 'property' => 'padding',
1392 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1393 ],
1394
1395 ],
1396 ];
1397 $this->controls['payment_box_margin'] = [
1398 'group' => 'wpfunnels_checkout_payment_style',
1399 'label' => esc_html__( 'Margin', 'wpfnl' ),
1400 'type' => 'spacing',
1401 'css' => [
1402 [
1403 'property' => 'margin',
1404 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1405 ],
1406
1407 ],
1408 ];
1409 // ----end payment box style------
1410
1411 }
1412
1413
1414 /**
1415 * Register Order Button Style Controls.
1416 *
1417 * @since 3.1.0
1418 * @access public
1419 */
1420 public function register_order_btn_style_controls(){
1421 $this->controls['order_button_typography'] = [
1422 'group' => 'wpfunnels_checkout_order_btn_style',
1423 'label' => esc_html__( 'Typography', 'wpfnl' ),
1424 'type' => 'typography',
1425 'css' => [
1426 [
1427 'property' => 'font',
1428 'selector' => '.wpfnl-checkout .woocommerce #payment #place_order',
1429 ],
1430 ],
1431 ];
1432 $this->controls['order_button_bg_color'] = [
1433 'group' => 'wpfunnels_checkout_order_btn_style',
1434 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1435 'type' => 'color',
1436 'css' => [
1437 [
1438 'property' => 'background-color',
1439 'selector' => '.wpfnl-checkout .woocommerce #payment #place_order',
1440 ],
1441 ],
1442 ];
1443 $this->controls['order_button_shadow'] = [
1444 'group' => 'wpfunnels_checkout_order_btn_style',
1445 'label' => esc_html__( 'Box Shadow', 'wpfnl' ),
1446 'type' => 'box-shadow',
1447 'css' => [
1448 [
1449 'property' => 'box-shadow',
1450 'selector' => '.wpfnl-checkout .woocommerce #payment #place_order',
1451 ],
1452 ],
1453 'inline' => true,
1454 'small' => true,
1455 ];
1456
1457 // $this->controls['order_button_hover_style'] = [
1458 // 'group' => 'wpfunnels_checkout_order_btn_style',
1459 // 'label' => esc_html__( 'Button Hover Style', 'wpfnl' ),
1460 // 'type' => 'separator',
1461 // ];
1462
1463 // $this->controls['order_button_radius_separator'] = [
1464 // 'group' => 'wpfunnels_checkout_order_btn_style',
1465 // 'type' => 'separator',
1466 // ];
1467
1468 $this->controls['order_button_radius'] = [
1469 'group' => 'wpfunnels_checkout_order_btn_style',
1470 'label' => esc_html__( 'Border Radius', 'wpfnl' ),
1471 'type' => 'border',
1472 'css' => [
1473 [
1474 'property' => 'border-radius',
1475 'selector' => '.wpfnl-checkout .woocommerce #payment #place_order',
1476 ]
1477 ],
1478 ];
1479 $this->controls['order_button_padding'] = [
1480 'group' => 'wpfunnels_checkout_order_btn_style',
1481 'label' => esc_html__( 'Padding', 'wpfnl' ),
1482 'type' => 'spacing',
1483 'css' => [
1484 [
1485 'property' => 'padding',
1486 'selector' => '.wpfnl-checkout .woocommerce #payment #place_order',
1487 ],
1488
1489 ],
1490 ];
1491 $this->controls['order_button_margin'] = [
1492 'group' => 'wpfunnels_checkout_order_btn_style',
1493 'label' => esc_html__( 'Margin', 'wpfnl' ),
1494 'type' => 'spacing',
1495 'css' => [
1496 [
1497 'property' => 'margin',
1498 'selector' => '.wpfnl-checkout .woocommerce #payment #place_order',
1499 ],
1500
1501 ],
1502 ];
1503 }
1504
1505
1506 /**
1507 * Register Coupon Form Style Controls.
1508 *
1509 * @since 3.1.0
1510 * @access public
1511 */
1512 public function register_coupon_form_style_controls(){
1513 $this->controls['coupon_toggle_area_style'] = [
1514 'group' => 'wpfunnels_checkout_coupon_style',
1515 'label' => esc_html__( 'Coupon Toggle Area', 'wpfnl' ),
1516 'type' => 'separator',
1517 ];
1518 $this->controls['coupon_toggle_color'] = [
1519 'group' => 'wpfunnels_checkout_coupon_style',
1520 'label' => esc_html__( 'Text Color', 'wpfnl' ),
1521 'type' => 'color',
1522 'css' => [
1523 [
1524 'property' => 'color',
1525 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner__content',
1526 ],
1527 ],
1528 ];
1529 $this->controls['coupon_toggle_link_color'] = [
1530 'group' => 'wpfunnels_checkout_coupon_style',
1531 'label' => esc_html__( 'Link Color', 'wpfnl' ),
1532 'type' => 'color',
1533 'css' => [
1534 [
1535 'property' => 'color',
1536 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner__content a',
1537 ],
1538 ],
1539 ];
1540 $this->controls['coupon_toggle_bgcolor'] = [
1541 'group' => 'wpfunnels_checkout_coupon_style',
1542 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1543 'type' => 'color',
1544 'css' => [
1545 [
1546 'property' => 'background-color',
1547 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner',
1548 ],
1549 ],
1550 ];
1551 $this->controls['coupon_toggle_typography'] = [
1552 'group' => 'wpfunnels_checkout_coupon_style',
1553 'label' => esc_html__( 'Typography', 'wpfnl' ),
1554 'type' => 'typography',
1555 'css' => [
1556 [
1557 'property' => 'font',
1558 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner__content',
1559 ],
1560 ],
1561 ];
1562 $this->controls['coupon_toggle_border'] = [
1563 'group' => 'wpfunnels_checkout_coupon_style',
1564 'label' => esc_html__( 'Border', 'wpfnl' ),
1565 'type' => 'border',
1566 'css' => [
1567 [
1568 'property' => 'border',
1569 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner',
1570 ]
1571 ],
1572 ];
1573 $this->controls['coupon_toggle_padding'] = [
1574 'group' => 'wpfunnels_checkout_coupon_style',
1575 'label' => esc_html__( 'Padding', 'wpfnl' ),
1576 'type' => 'spacing',
1577 'css' => [
1578 [
1579 'property' => 'padding',
1580 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner',
1581 ],
1582 ],
1583 ];
1584 $this->controls['coupon_toggle_margin'] = [
1585 'group' => 'wpfunnels_checkout_coupon_style',
1586 'label' => esc_html__( 'Margin', 'wpfnl' ),
1587 'type' => 'spacing',
1588 'css' => [
1589 [
1590 'property' => 'margin',
1591 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner',
1592 ],
1593
1594 ],
1595 ];
1596
1597 $this->controls['coupon_form_box_style'] = [
1598 'group' => 'wpfunnels_checkout_coupon_style',
1599 'label' => esc_html__( 'Coupon Form Box', 'wpfnl' ),
1600 'type' => 'separator',
1601 ];
1602
1603 $this->controls['coupon_form_box_color'] = [
1604 'group' => 'wpfunnels_checkout_coupon_style',
1605 'label' => esc_html__( 'Text Color', 'wpfnl' ),
1606 'type' => 'color',
1607 'css' => [
1608 [
1609 'property' => 'color',
1610 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon p',
1611 ],
1612 ],
1613 ];
1614 $this->controls['coupon_form_box_bgcolor'] = [
1615 'group' => 'wpfunnels_checkout_coupon_style',
1616 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1617 'type' => 'color',
1618 'css' => [
1619 [
1620 'property' => 'background-color',
1621 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon',
1622 ],
1623 ],
1624 ];
1625 $this->controls['coupon_form_box_typography'] = [
1626 'group' => 'wpfunnels_checkout_coupon_style',
1627 'label' => esc_html__( 'Typography', 'wpfnl' ),
1628 'type' => 'typography',
1629 'css' => [
1630 [
1631 'property' => 'font',
1632 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon p',
1633 ],
1634 ],
1635 ];
1636 $this->controls['coupon_form_box_border'] = [
1637 'group' => 'wpfunnels_checkout_coupon_style',
1638 'label' => esc_html__( 'Border', 'wpfnl' ),
1639 'type' => 'border',
1640 'css' => [
1641 [
1642 'property' => 'border',
1643 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon',
1644 ]
1645 ],
1646 ];
1647 $this->controls['coupon_form_box_padding'] = [
1648 'group' => 'wpfunnels_checkout_coupon_style',
1649 'label' => esc_html__( 'Padding', 'wpfnl' ),
1650 'type' => 'spacing',
1651 'css' => [
1652 [
1653 'property' => 'padding',
1654 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon',
1655 ],
1656 ],
1657 ];
1658 $this->controls['coupon_form_box_margin'] = [
1659 'group' => 'wpfunnels_checkout_coupon_style',
1660 'label' => esc_html__( 'Margin', 'wpfnl' ),
1661 'type' => 'spacing',
1662 'css' => [
1663 [
1664 'property' => 'margin',
1665 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon',
1666 ],
1667
1668 ],
1669 ];
1670
1671 $this->controls['coupon_input_field_style'] = [
1672 'group' => 'wpfunnels_checkout_coupon_style',
1673 'label' => esc_html__( 'Coupon Input field', 'wpfnl' ),
1674 'type' => 'separator',
1675 ];
1676
1677 $this->controls['coupon_input_field_color'] = [
1678 'group' => 'wpfunnels_checkout_coupon_style',
1679 'label' => esc_html__( 'Color', 'wpfnl' ),
1680 'type' => 'color',
1681 'css' => [
1682 [
1683 'property' => 'color',
1684 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text',
1685 ],
1686 [
1687 'property' => 'color',
1688 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon ::placeholder',
1689 ],
1690 [
1691 'property' => 'color',
1692 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon ::-webkit-input-placeholder',
1693 ],
1694 ],
1695 ];
1696 $this->controls['coupon_input_field_bgcolor'] = [
1697 'group' => 'wpfunnels_checkout_coupon_style',
1698 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1699 'type' => 'color',
1700 'css' => [
1701 [
1702 'property' => 'background-color',
1703 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text',
1704 ],
1705 ],
1706 ];
1707 $this->controls['coupon_input_field_typography'] = [
1708 'group' => 'wpfunnels_checkout_coupon_style',
1709 'label' => esc_html__( 'Typography', 'wpfnl' ),
1710 'type' => 'typography',
1711 'css' => [
1712 [
1713 'property' => 'font',
1714 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text',
1715 ],
1716 ],
1717 ];
1718 $this->controls['coupon_input_field_border'] = [
1719 'group' => 'wpfunnels_checkout_coupon_style',
1720 'label' => esc_html__( 'Border', 'wpfnl' ),
1721 'type' => 'border',
1722 'css' => [
1723 [
1724 'property' => 'border',
1725 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text',
1726 ]
1727 ],
1728 ];
1729 $this->controls['coupon_input_field_padding'] = [
1730 'group' => 'wpfunnels_checkout_coupon_style',
1731 'label' => esc_html__( 'Padding', 'wpfnl' ),
1732 'type' => 'spacing',
1733 'css' => [
1734 [
1735 'property' => 'padding',
1736 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text',
1737 ],
1738 ],
1739 ];
1740
1741 $this->controls['coupon_button_style'] = [
1742 'group' => 'wpfunnels_checkout_coupon_style',
1743 'label' => esc_html__( 'Coupon Button', 'wpfnl' ),
1744 'type' => 'separator',
1745 ];
1746
1747 $this->controls['coupon_button_typography'] = [
1748 'group' => 'wpfunnels_checkout_coupon_style',
1749 'label' => esc_html__( 'Typography', 'wpfnl' ),
1750 'type' => 'typography',
1751 'css' => [
1752 [
1753 'property' => 'font',
1754 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button',
1755 ],
1756 ],
1757 ];
1758 $this->controls['coupon_button_bg_color'] = [
1759 'group' => 'wpfunnels_checkout_coupon_style',
1760 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1761 'type' => 'color',
1762 'css' => [
1763 [
1764 'property' => 'background-color',
1765 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button',
1766 ],
1767 ],
1768 ];
1769 $this->controls['coupon_button_box_shadow'] = [
1770 'group' => 'wpfunnels_checkout_coupon_style',
1771 'label' => esc_html__( 'Box Shadow', 'wpfnl' ),
1772 'type' => 'box-shadow',
1773 'css' => [
1774 [
1775 'property' => 'box-shadow',
1776 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button',
1777 ],
1778 ],
1779 'inline' => true,
1780 'small' => true,
1781 ];
1782 $this->controls['coupon_button_radius'] = [
1783 'group' => 'wpfunnels_checkout_coupon_style',
1784 'label' => esc_html__( 'Border Radius', 'wpfnl' ),
1785 'type' => 'border',
1786 'css' => [
1787 [
1788 'property' => 'border-radius',
1789 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button',
1790 ]
1791 ],
1792 'exclude' => [
1793 'width',
1794 'style',
1795 'color',
1796 ],
1797 ];
1798 $this->controls['coupon_button_padding'] = [
1799 'group' => 'wpfunnels_checkout_coupon_style',
1800 'label' => esc_html__( 'Padding', 'wpfnl' ),
1801 'type' => 'spacing',
1802 'css' => [
1803 [
1804 'property' => 'padding',
1805 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button',
1806 ],
1807 ],
1808 ];
1809
1810 }
1811
1812
1813 /**
1814 * Register Form valiation info Style Controls.
1815 *
1816 * @since 3.1.0
1817 * @access public
1818 */
1819 public function register_error_style_controls(){
1820 $this->controls['error_fields_text'] = [
1821 'group' => 'wpfunnels_checkout_error_style',
1822 'label' => esc_html__( 'Field Validation', 'wpfnl' ),
1823 'type' => 'separator',
1824 ];
1825
1826 $this->controls['error_label_color'] = [
1827 'group' => 'wpfunnels_checkout_error_style',
1828 'label' => esc_html__( 'Label Color', 'wpfnl' ),
1829 'type' => 'color',
1830 'css' => [
1831 [
1832 'property' => 'color',
1833 'selector' => '.woocommerce form .form-row.woocommerce-invalid label',
1834 ],
1835 ],
1836 ];
1837 $this->controls['error_field_border_color'] = [
1838 'group' => 'wpfunnels_checkout_error_style',
1839 'label' => esc_html__( 'Field Border Color', 'wpfnl' ),
1840 'type' => 'color',
1841 'css' => [
1842 [
1843 'property' => 'border-color',
1844 'selector' => '.wpfunnels-checkout-form .select2-container--default.field-required .select2-selection--single',
1845 ],
1846 [
1847 'property' => 'border-color',
1848 'selector' => 'form .form-row input.input-text.field-required',
1849 ],
1850 [
1851 'property' => 'border-color',
1852 'selector' => 'form .form-row textarea.input-text.field-required',
1853 ],
1854 [
1855 'property' => 'border-color',
1856 'selector' => '#order_review .input-text.field-required',
1857 ],
1858 [
1859 'property' => 'border-color',
1860 'selector' => 'form .form-row.woocommerce-invalid .select2-container',
1861 ],
1862 [
1863 'property' => 'border-color',
1864 'selector' => 'form .form-row.woocommerce-invalid input.input-text',
1865 ],
1866 [
1867 'property' => 'border-color',
1868 'selector' => 'form .form-row.woocommerce-invalid select',
1869 ],
1870 ],
1871 ];
1872
1873 $this->controls['error_fields_section'] = [
1874 'group' => 'wpfunnels_checkout_error_style',
1875 'label' => esc_html__( 'Error Messages', 'wpfnl' ),
1876 'type' => 'separator',
1877 ];
1878
1879 $this->controls['error_text_color'] = [
1880 'group' => 'wpfunnels_checkout_error_style',
1881 'label' => esc_html__( 'Error Message Color', 'wpfnl' ),
1882 'type' => 'color',
1883 'css' => [
1884 [
1885 'property' => 'color',
1886 'selector' => '.woocommerce-error',
1887 ],
1888 [
1889 'property' => 'color',
1890 'selector' => '.woocommerce-NoticeGroup .woocommerce-error',
1891 ],
1892 [
1893 'property' => 'color',
1894 'selector' => '.woocommerce-notices-wrapper .woocommerce-error',
1895 ],
1896 ],
1897 ];
1898
1899 $this->controls['error_bg_color'] = [
1900 'group' => 'wpfunnels_checkout_error_style',
1901 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1902 'type' => 'color',
1903 'css' => [
1904 [
1905 'property' => 'color',
1906 'selector' => '.woocommerce-error',
1907 ],
1908 [
1909 'property' => 'color',
1910 'selector' => '.woocommerce-NoticeGroup .woocommerce-error',
1911 ],
1912 [
1913 'property' => 'color',
1914 'selector' => '.woocommerce-NoticeGroup .wc-block-components-notice-banner.is-error',
1915 ],
1916 [
1917 'property' => 'color',
1918 'selector' => '.woocommerce-notices-wrapper .woocommerce-error',
1919 ],
1920 ],
1921 ];
1922
1923 $this->controls['error_border_color'] = [
1924 'group' => 'wpfunnels_checkout_error_style',
1925 'label' => esc_html__( 'Border Color', 'wpfnl' ),
1926 'type' => 'color',
1927 'css' => [
1928 [
1929 'property' => 'border-color',
1930 'selector' => '.woocommerce-error',
1931 ],
1932 [
1933 'property' => 'border-color',
1934 'selector' => '.woocommerce-NoticeGroup .woocommerce-error',
1935 ],
1936 [
1937 'property' => 'border-color',
1938 'selector' => '.woocommerce-NoticeGroup .wc-block-components-notice-banner.is-error',
1939 ],
1940 [
1941 'property' => 'border-color',
1942 'selector' => '.woocommerce-notices-wrapper .woocommerce-error',
1943 ],
1944 [
1945 'property' => 'color',
1946 'selector' => '.woocommerce-error::before',
1947 ],
1948 [
1949 'property' => 'background-color',
1950 'selector' => '.wc-block-components-notice-banner.is-error>svg',
1951 ],
1952 ],
1953 ];
1954 }
1955
1956
1957 /**
1958 * Register Multistep Style Controls.
1959 *
1960 * @since 3.1.0
1961 * @access public
1962 */
1963 public function register_multistep_style_controls(){
1964 $this->controls['step_title_heading'] = [
1965 'group' => 'wpfunnels_checkout_multistep_style',
1966 'label' => esc_html__( 'Step Title', 'wpfnl' ),
1967 'type' => 'separator',
1968 ];
1969
1970 $this->controls['step_title_color'] = [
1971 'group' => 'wpfunnels_checkout_multistep_style',
1972 'label' => esc_html__( 'Color', 'wpfnl' ),
1973 'type' => 'color',
1974 'default' => '#363B4E',
1975 'css' => [
1976 [
1977 'property' => 'color',
1978 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-title',
1979 ],
1980 ],
1981 ];
1982 $this->controls['step_title_typography'] = [
1983 'group' => 'wpfunnels_checkout_multistep_style',
1984 'label' => esc_html__( 'Typography', 'wpfnl' ),
1985 'type' => 'typography',
1986 'css' => [
1987 [
1988 'property' => 'font',
1989 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-title',
1990 ],
1991 ],
1992 ];
1993
1994 $this->controls['multistep_checkout_state'] = [
1995 'group' => 'wpfunnels_checkout_multistep_style',
1996 'label' => esc_html__( 'Step Default State', 'wpfnl' ),
1997 'type' => 'separator',
1998 ];
1999
2000 $this->controls['step_box_shadow'] = [
2001 'group' => 'wpfunnels_checkout_multistep_style',
2002 'label' => esc_html__( 'Box Shadow', 'wpfnl' ),
2003 'type' => 'box-shadow',
2004 'css' => [
2005 [
2006 'property' => 'box-shadow',
2007 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-icon',
2008 ],
2009 ],
2010 'inline' => true,
2011 'small' => true,
2012 ];
2013 $this->controls['step_normal_line_color'] = [
2014 'group' => 'wpfunnels_checkout_multistep_style',
2015 'label' => esc_html__( 'Line Color', 'wpfnl' ),
2016 'type' => 'color',
2017 'default' => '#eee',
2018 'css' => [
2019 [
2020 'property' => 'background-color',
2021 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard:before',
2022 ],
2023 ],
2024 ];
2025 $this->controls['step_normal_box_bgcolor'] = [
2026 'group' => 'wpfunnels_checkout_multistep_style',
2027 'label' => esc_html__( 'Box Background Color', 'wpfnl' ),
2028 'type' => 'color',
2029 'default' => '#e8e8ed',
2030 'css' => [
2031 [
2032 'property' => 'background-color',
2033 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-icon',
2034 ],
2035 ],
2036 ];
2037 $this->controls['step_normal_icon_color'] = [
2038 'group' => 'wpfunnels_checkout_multistep_style',
2039 'label' => esc_html__( 'Icon Color', 'wpfnl' ),
2040 'type' => 'color',
2041 'default' => '#6E42D3',
2042 'css' => [
2043 [
2044 'property' => 'fill',
2045 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-icon svg path',
2046 ],
2047 ],
2048 ];
2049 $this->controls['step_normal_box_border_style'] = [
2050 'group' => 'wpfunnels_checkout_multistep_style',
2051 'label' => esc_html__( 'Border', 'wpfnl' ),
2052 'type' => 'border',
2053 'css' => [
2054 [
2055 'property' => 'border',
2056 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-icon',
2057 ],
2058 ],
2059 'exclude' => [
2060 'radius'
2061 ],
2062 ];
2063
2064 $this->controls['multistep_checkout_active'] = [
2065 'group' => 'wpfunnels_checkout_multistep_style',
2066 'label' => esc_html__( 'Step Active / Completed State', 'wpfnl' ),
2067 'type' => 'separator',
2068 ];
2069
2070 $this->controls['step_active_line_color'] = [
2071 'group' => 'wpfunnels_checkout_multistep_style',
2072 'label' => esc_html__( 'Line Color', 'wpfnl' ),
2073 'type' => 'color',
2074 'default' => '#6E42D3',
2075 'css' => [
2076 [
2077 'property' => 'background-color',
2078 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard > li.completed:before',
2079 ],
2080 [
2081 'property' => 'background-color',
2082 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard > li.current:before',
2083 ],
2084 ],
2085 ];
2086 $this->controls['step_active_box_bgcolor'] = [
2087 'group' => 'wpfunnels_checkout_multistep_style',
2088 'label' => esc_html__( 'Box Background Color', 'wpfnl' ),
2089 'type' => 'color',
2090 'default' => '#6E42D3',
2091 'css' => [
2092 [
2093 'property' => 'background-color',
2094 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon',
2095 ],
2096 [
2097 'property' => 'background-color',
2098 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon',
2099 ],
2100 ],
2101 ];
2102 $this->controls['step_active_icon_color'] = [
2103 'group' => 'wpfunnels_checkout_multistep_style',
2104 'label' => esc_html__( 'Icon Color', 'wpfnl' ),
2105 'type' => 'color',
2106 'default' => '#ffffff',
2107 'css' => [
2108 [
2109 'property' => 'fill',
2110 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon svg path',
2111 ],
2112 [
2113 'property' => 'fill',
2114 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon svg path',
2115 ],
2116 ],
2117 ];
2118 $this->controls['step_active_box_border_style'] = [
2119 'group' => 'wpfunnels_checkout_multistep_style',
2120 'label' => esc_html__( 'Border', 'wpfnl' ),
2121 'type' => 'border',
2122 'css' => [
2123 [
2124 'property' => 'border',
2125 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon',
2126 ],
2127 [
2128 'property' => 'border',
2129 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon',
2130 ],
2131 ],
2132 'exclude' => [
2133 'radius'
2134 ],
2135 ];
2136
2137 $this->controls['step_navigation_btn'] = [
2138 'group' => 'wpfunnels_checkout_multistep_style',
2139 'label' => esc_html__( 'Navigation Button', 'wpfnl' ),
2140 'type' => 'separator',
2141 ];
2142
2143 $this->controls['step_navigation_btn_color'] = [
2144 'group' => 'wpfunnels_checkout_multistep_style',
2145 'label' => esc_html__( 'Color', 'wpfnl' ),
2146 'type' => 'color',
2147 'css' => [
2148 [
2149 'property' => 'color',
2150 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]',
2151 ],
2152 ],
2153 ];
2154 $this->controls['step_navigation_btn_bgcolor'] = [
2155 'group' => 'wpfunnels_checkout_multistep_style',
2156 'label' => esc_html__( 'Background Color', 'wpfnl' ),
2157 'type' => 'color',
2158 'css' => [
2159 [
2160 'property' => 'background-color',
2161 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]',
2162 ],
2163 ],
2164 ];
2165 $this->controls['step_navigation_btn_typography'] = [
2166 'group' => 'wpfunnels_checkout_multistep_style',
2167 'label' => esc_html__( 'Typography', 'wpfnl' ),
2168 'type' => 'typography',
2169 'css' => [
2170 [
2171 'property' => 'font',
2172 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]',
2173 ],
2174 ],
2175 ];
2176 $this->controls['step_navigation_btn_radius'] = [
2177 'group' => 'wpfunnels_checkout_multistep_style',
2178 'label' => esc_html__( 'Border Radius', 'wpfnl' ),
2179 'type' => 'border',
2180 'css' => [
2181 [
2182 'property' => 'border-radius',
2183 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]',
2184 ]
2185 ],
2186 'exclude' => [
2187 'width',
2188 'style',
2189 'color',
2190 ]
2191 ];
2192 $this->controls['step_navigation_btn_padding'] = [
2193 'group' => 'wpfunnels_checkout_multistep_style',
2194 'label' => esc_html__( 'Padding', 'wpfnl' ),
2195 'type' => 'spacing',
2196 'css' => [
2197 [
2198 'property' => 'padding',
2199 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]',
2200 ],
2201 ],
2202 ];
2203
2204 $this->controls['step_navigation_btn_hover'] = [
2205 'group' => 'wpfunnels_checkout_multistep_style',
2206 'label' => esc_html__( 'Navigation Button Hover', 'wpfnl' ),
2207 'type' => 'separator',
2208 ];
2209
2210 $this->controls['step_navigation_btn_hover_color'] = [
2211 'group' => 'wpfunnels_checkout_multistep_style',
2212 'label' => esc_html__( 'Color', 'wpfnl' ),
2213 'type' => 'color',
2214 'css' => [
2215 [
2216 'property' => 'color',
2217 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]:not(:disabled):hover',
2218 ],
2219 ],
2220 ];
2221 $this->controls['step_navigation_btn_hover_bgcolor'] = [
2222 'group' => 'wpfunnels_checkout_multistep_style',
2223 'label' => esc_html__( 'Background Color', 'wpfnl' ),
2224 'type' => 'color',
2225 'css' => [
2226 [
2227 'property' => 'background-color',
2228 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]:not(:disabled):hover',
2229 ],
2230 ],
2231 ];
2232
2233 }
2234
2235
2236 /**
2237 * Set builder control groups
2238 *
2239 * @since 3.1.0
2240 * @access public
2241 */
2242 public function set_control_groups()
2243 {
2244 $this->control_groups['wpfunnels_checkout_content'] = [
2245 'title' => esc_html__('Funnel Checkout', 'wpfnl'), // Localized control group title
2246 'tab' => 'content', // Set to either "content" or "style"
2247 ];
2248
2249 $this->control_groups['wpfunnels_checkout_billing_style'] = [
2250 'title' => esc_html__('Billing Section', 'wpfnl'),
2251 'tab' => 'style', // Set to either "content" or "style"
2252 ];
2253
2254 $this->control_groups['wpfunnels_checkout_shipping_style'] = [
2255 'title' => esc_html__('Additional Info / Shipping Section', 'wpfnl'),
2256 'tab' => 'style', // Set to either "content" or "style"
2257 ];
2258
2259 $this->control_groups['wpfunnels_checkout_order_tbl_style'] = [
2260 'title' => esc_html__('Order Table Section', 'wpfnl'),
2261 'tab' => 'style', // Set to either "content" or "style"
2262 ];
2263
2264 $this->control_groups['wpfunnels_checkout_payment_style'] = [
2265 'title' => esc_html__('Payment Section', 'wpfnl'),
2266 'tab' => 'style', // Set to either "content" or "style"
2267 ];
2268
2269 $this->control_groups['wpfunnels_checkout_order_btn_style'] = [
2270 'title' => esc_html__('Order button', 'wpfnl'),
2271 'tab' => 'style', // Set to either "content" or "style"
2272 ];
2273
2274 $this->control_groups['wpfunnels_checkout_coupon_style'] = [
2275 'title' => esc_html__('Coupon Section', 'wpfnl'),
2276 'tab' => 'style', // Set to either "content" or "style"
2277 ];
2278
2279 $this->control_groups['wpfunnels_checkout_error_style'] = [
2280 'title' => esc_html__('Field Validation & Error Messages', 'wpfnl'),
2281 'tab' => 'style', // Set to either "content" or "style"
2282 ];
2283
2284 $this->control_groups['wpfunnels_checkout_multistep_style'] = [
2285 'title' => esc_html__('Multistep Section', 'wpfnl'),
2286 'tab' => 'style', // Set to either "content" or "style"
2287 'required' => [ 'checkout_layout', '=', [ 'wpfnl-2-step', 'wpfnl-multistep', 'wpfnl-express-checkout' ] ],
2288 ];
2289 }
2290
2291
2292 /**
2293 * Set builder controls
2294 *
2295 * @since 3.1.0
2296 */
2297 public function set_controls(){
2298 $this->checkout_content_control();
2299 // $this->ob_register_control();
2300
2301 //---------style controls---------
2302 $this->register_billing_style_controls();
2303 $this->register_shipping_style_controls();
2304 $this->register_order_tbl_style_controls();
2305 $this->register_payment_section_style_controls();
2306 $this->register_order_btn_style_controls();
2307 $this->register_coupon_form_style_controls();
2308 $this->register_error_style_controls();
2309 $this->register_multistep_style_controls();
2310
2311 }
2312
2313
2314 /**
2315 * Render the widget output on the frontend.
2316 *
2317 * Written in PHP and used to generate the final HTML.
2318 *
2319 * @since 3.1.0
2320 *
2321 * @access public
2322 */
2323 public function render(){
2324 // We need the form element ID to recover the element settings on form submit
2325 $this->set_attribute( '_root', 'data-element-id', $this->id );
2326
2327 $settings = $this->settings;
2328
2329 // ---- Display Conditions ----------------------------------------
2330 $display_condition = ! empty( $settings['display_condition_type'] ) ? $settings['display_condition_type'] : 'none';
2331
2332 if ( $display_condition === 'user_state' ) {
2333 $hide_logged_in = ! empty( $settings['hide_from_logged_in'] );
2334 $hide_logged_out = ! empty( $settings['hide_from_logged_out'] );
2335
2336 if ( $hide_logged_in && is_user_logged_in() ) {
2337 return;
2338 }
2339 if ( $hide_logged_out && ! is_user_logged_in() ) {
2340 return;
2341 }
2342
2343 } elseif ( $display_condition === 'user_role' ) {
2344 $hide_for_user_role = ! empty( $settings['hide_for_user_role'] ) ? $settings['hide_for_user_role'] : 'none';
2345
2346 if ( $hide_for_user_role !== 'none' && is_user_logged_in() ) {
2347 $user = wp_get_current_user();
2348 if ( in_array( $hide_for_user_role, $user->roles ) ) {
2349 return;
2350 }
2351 }
2352
2353 } elseif ( $display_condition === 'day' ) {
2354 $disable_on_days = ! empty( $settings['disable_on_days'] ) ? $settings['disable_on_days'] : [];
2355
2356 if ( ! empty( $disable_on_days ) && is_array( $disable_on_days ) ) {
2357 $current_day = strtolower( date( 'l' ) ); // e.g., 'monday'
2358 if ( in_array( $current_day, $disable_on_days ) ) {
2359 return;
2360 }
2361 }
2362
2363 } elseif ( $display_condition === 'browser' ) {
2364 $hide_on_browser = ! empty( $settings['hide_on_browser'] ) ? $settings['hide_on_browser'] : 'none';
2365
2366 if ( $hide_on_browser !== 'none' ) {
2367 $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
2368 $current_browser = '';
2369
2370 if ( strpos( $user_agent, 'edg' ) !== false ) {
2371 $current_browser = 'edge';
2372 } elseif ( strpos( $user_agent, 'opr' ) !== false || strpos( $user_agent, 'opera' ) !== false ) {
2373 $current_browser = 'opera_mini';
2374 } elseif ( strpos( $user_agent, 'chrome' ) !== false ) {
2375 $current_browser = 'chrome';
2376 } elseif ( strpos( $user_agent, 'safari' ) !== false ) {
2377 $current_browser = 'safari';
2378 } elseif ( strpos( $user_agent, 'firefox' ) !== false ) {
2379 $current_browser = 'mozilla';
2380 }
2381
2382 if ( $current_browser === $hide_on_browser ) {
2383 return;
2384 }
2385 }
2386
2387 } elseif ( $display_condition === 'operating_system' ) {
2388 $hide_on_os = ! empty( $settings['hide_on_os'] ) ? $settings['hide_on_os'] : 'none';
2389
2390 if ( $hide_on_os !== 'none' ) {
2391 $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
2392 $current_os = '';
2393
2394 if ( strpos( $user_agent, 'windows' ) !== false || strpos( $user_agent, 'win32' ) !== false || strpos( $user_agent, 'win64' ) !== false ) {
2395 $current_os = 'windows';
2396 } elseif ( strpos( $user_agent, 'macintosh' ) !== false || strpos( $user_agent, 'mac os x' ) !== false ) {
2397 $current_os = 'macos';
2398 } elseif ( strpos( $user_agent, 'linux' ) !== false && strpos( $user_agent, 'android' ) === false ) {
2399 $current_os = 'linux';
2400 } elseif ( strpos( $user_agent, 'android' ) !== false ) {
2401 $current_os = 'android';
2402 } elseif ( strpos( $user_agent, 'iphone' ) !== false || strpos( $user_agent, 'ipad' ) !== false || strpos( $user_agent, 'ipod' ) !== false ) {
2403 $current_os = 'ios';
2404 } elseif ( strpos( $user_agent, 'sunos' ) !== false ) {
2405 $current_os = 'sunos';
2406 } elseif ( strpos( $user_agent, 'openbsd' ) !== false ) {
2407 $current_os = 'openbsd';
2408 }
2409
2410 if ( $current_os === $hide_on_os ) {
2411 return;
2412 }
2413 }
2414 }
2415 // ---- End Display Conditions ------------------------------------
2416
2417 $checkout = WC()->checkout();
2418 $checkout_id = $this->post_id;
2419
2420 //----Start Coupon Enabler----//
2421 $coupon_enabler = get_post_meta($this->post_id, '_wpfnl_checkout_coupon', true);
2422 if ( 'no' === $coupon_enabler ) {
2423 remove_action('woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10);
2424 }
2425 //----End Coupon Enabler----//
2426
2427 $checkout_layout = isset($settings['checkout_layout']) ? $settings['checkout_layout'] : 'two-column';
2428 $floating_label = isset($settings['checkout_floating_label']) ? $settings['checkout_floating_label'] : '';
2429
2430 if( PHP_SESSION_DISABLED == session_status() ) {
2431 session_start();
2432 }
2433 $_SESSION[ 'checkout_layout' ] = $checkout_layout;
2434
2435 /**
2436 * Check if pro is activated or not
2437 */
2438 if( !Wpfnl_functions::is_wpfnl_pro_activated() && ('wpfnl-multistep' === $checkout_layout || 'wpfnl-express-checkout' === $checkout_layout) ) {
2439 $checkout_layout = 'wpfnl-col-2';
2440 }
2441
2442 /**
2443 * Check if pro is activated and wpfnl-express-checkout selected
2444 */
2445 if( Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-express-checkout' === $checkout_layout ) {
2446 $checkout_layout .= ' wpfnl-multistep';
2447 }
2448
2449 /**
2450 * Check if pro is activated and wpfnl-express-checkout selected
2451 */
2452 if( Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-2-step' === $checkout_layout ) {
2453 $checkout_layout .= ' wpfnl-multistep';
2454 }
2455
2456 // Add shared modern checkout class for both modern layouts
2457 if( 'wpfnl-modern-one-column' === $checkout_layout || 'wpfnl-modern-checkout' === $checkout_layout ) {
2458 if( false === strpos( $checkout_layout, 'wpfnl-modern-checkout' ) ) {
2459 $checkout_layout .= ' wpfnl-modern-checkout';
2460 }
2461 }
2462
2463 /**
2464 * Check if pro is activated and wpfnl-modern-multistep selected
2465 */
2466 if('wpfnl-modern-multistep' === $checkout_layout ) {
2467 $checkout_layout .= ' wpfnl-modern-checkout';
2468 }
2469
2470 // Add responsive classes
2471 if ( ! empty( $settings['hide_on_desktop'] ) ) {
2472 $checkout_layout .= ' wpfnl-hide-desktop';
2473 }
2474 if ( ! empty( $settings['hide_on_tablet'] ) ) {
2475 $checkout_layout .= ' wpfnl-hide-tablet';
2476 }
2477 if ( ! empty( $settings['hide_on_mobile'] ) ) {
2478 $checkout_layout .= ' wpfnl-hide-mobile';
2479 }
2480
2481 // Add animation class
2482 $animation = ! empty( $settings['entrance_animation'] ) ? $settings['entrance_animation'] : '';
2483 if ( $animation ) {
2484 $checkout_layout .= ' wpfnl-animation ' . esc_attr( $animation );
2485 }
2486
2487 query_posts('post_type="checkout"');
2488
2489 // load woo templates from wpf plugin
2490 $frontend = Wpfnl::get_instance()->frontend;
2491 add_filter('woocommerce_locate_template', array($frontend, 'wpfunnels_woocommerce_locate_template'), 20, 3);
2492
2493
2494 $ob_settings = $this->get_order_bump_settings_for_preview($checkout_id);
2495 do_action('wpfunnels/bricks_render_order_bump', $checkout_id, $ob_settings);
2496
2497 do_action( 'wpfunnels/before_bricks_checkout_form', $settings );
2498 do_action( 'wpfunnels/before_checkout_form', $checkout_id );
2499
2500 ?>
2501 <div <?php echo $this->render_attributes( '_root' ); ?> >
2502 <div class="wpfnl-checkout <?php echo $checkout_layout .' '. $floating_label ?>">
2503
2504 <?php echo do_shortcode('[woocommerce_checkout]'); ?>
2505
2506 <!-- when checkout layout Express Checkout selected then show -->
2507 <?php if( Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-express-checkout' === $settings['checkout_layout'] ){
2508 ?>
2509 <?php } ?>
2510 </div>
2511 </div>
2512 <?php
2513 }
2514
2515
2516 /**
2517 * Get order bump settings for preview
2518 *
2519 * @param $post_id
2520 * @param $widget_settings
2521 *
2522 * @return mixed
2523 *
2524 * @since 2.0.4
2525 */
2526 private function get_order_bump_settings_for_preview( $post_id ) {
2527 $order_bump_settings = get_post_meta( $post_id, 'order-bump-settings', true );
2528 return $order_bump_settings;
2529 }
2530
2531 /**
2532 * Replace ob settings with widget data
2533 *
2534 * @param $order_bump_settings
2535 * @param $widget_settings
2536 *
2537 * @return mixed
2538 *
2539 * @since 2.0.4
2540 */
2541 private function replace_ob_settings_with_widget_data( $order_bump_settings, $widget_settings ) {
2542 foreach( $order_bump_settings as $key=>$settings ){
2543 $order_bump_settings[$key]['checkBoxLabel'] = isset( $widget_settings['order_bump_checkbox_label_'.$key] ) ? $widget_settings['order_bump_checkbox_label_'.$key] : $order_bump_settings[$key]['checkBoxLabel'];
2544 $order_bump_settings[$key]['highLightText'] = isset( $widget_settings['order_bump_product_detail_header_'.$key] ) ? $widget_settings['order_bump_product_detail_header_'.$key] : $order_bump_settings[$key]['highLightText'];
2545 $order_bump_settings[$key]['productDescriptionText'] = isset( $widget_settings['order_bump_product_detail_'.$key] ) ? $widget_settings['order_bump_product_detail_'.$key] : $order_bump_settings[$key]['productDescriptionText'];
2546 $order_bump_settings[$key]['position'] = isset( $widget_settings['order_bump_position_'.$key] ) ? $widget_settings['order_bump_position_'.$key] : $order_bump_settings[$key]['position'];
2547 $order_bump_settings[$key]['selectedStyle'] = isset( $widget_settings['order_bump_layout_'.$key] ) ? $widget_settings['order_bump_layout_'.$key] : $order_bump_settings[$key]['selectedStyle'];
2548 $order_bump_settings[$key]['productImage'] = isset( $widget_settings['order_bump_image_'.$key] ) ? $widget_settings['order_bump_image_'.$key] : $order_bump_settings[$key]['productImage'];
2549 $order_bump_settings[$key]['isEnabled'] = isset( $widget_settings['order_bump_'.$key] ) ? $widget_settings['order_bump_'.$key] : $order_bump_settings[$key]['isEnabled'];
2550 }
2551 return $order_bump_settings;
2552 }
2553
2554
2555
2556 /**
2557 * Render order bump data with hooks.
2558 *
2559 * @since 1.0.0
2560 *
2561 * @access protected
2562 */
2563 public function render_order_bump()
2564 {
2565 $step_id = $this->post_id;
2566 $order_bump = get_post_meta($step_id, 'order-bump', true);
2567 $order_bump_settings = get_post_meta($step_id, 'order-bump-settings', true);
2568 foreach( $order_bump_settings as $key=>$ob_settings ){
2569 if ( $ob_settings['isEnabled'] && isset($ob_settings['product']) && $ob_settings['product'] != '' ) {
2570 // Check conditional rules before displaying
2571 if ( Wpfnl_Order_Bump_Rules::should_display_order_bump( $ob_settings ) ) {
2572 $this->render_order_bump_template($ob_settings);
2573 }
2574 }
2575 }
2576 }
2577
2578 public function render_order_bump_template($settings)
2579 {
2580 if (!empty($settings['selectedStyle'])) {
2581
2582 if ($settings['position'] == 'popup') {
2583 if (\Elementor\Plugin::$instance->editor->is_edit_mode()) {
2584 echo '<h5 style="margin-bottom: 15px;"><strong>' . __('To see the pop-up offer in action, please preview or view the page.', 'wpfnl') . '</strong></h5>';
2585 } else {
2586 require_once WPFNL_DIR . 'public/modules/checkout/templates-style/order-bump-template-' . $settings['selectedStyle'] . '.php';
2587 }
2588
2589 } else {
2590 require_once WPFNL_DIR . 'public/modules/checkout/templates-style/order-bump-template-' . $settings['selectedStyle'] . '.php';
2591 }
2592 }
2593 }
2594
2595 }
2596