PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.11.1
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.11.1
3.13.3 3.13.2 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 All 261 releases
wpfunnels / includes / core / widgets / bricks / Checkout.php

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

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