PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.3
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.3
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.13.3, at includes/core/widgets/bricks/Checkout.php

2,608 lines 85.9 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 'property' => 'font',
685 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .shipping-field-title',
686 ]
687 ],
688 ];
689 $this->controls['shipping_heading_margin'] = [
690 'group' => 'wpfunnels_checkout_shipping_style',
691 'label' => esc_html__( 'Margin', 'wpfnl' ),
692 'type' => 'spacing',
693 'css' => [
694 [
695 'property' => 'margin',
696 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields #ship-to-different-address',
697 ],
698 [
699 'property' => 'margin',
700 'selector' => '.wpfnl-checkout .woocommerce-additional-fields > h3',
701 ],
702 [
703 'property' => 'margin',
704 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .shipping-field-title',
705 ],
706 ],
707 ];
708 $this->controls['shipping_heading_padding'] = [
709 'group' => 'wpfunnels_checkout_shipping_style',
710 'label' => esc_html__( 'Padding', 'wpfnl' ),
711 'type' => 'spacing',
712 'css' => [
713 [
714 'property' => 'padding',
715 'selector' => '.wpfnl-checkout .woocommerce-additional-fields > h3',
716 ],
717 [
718 'property' => 'padding',
719 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields #ship-to-different-address',
720 ],
721 [
722 'property' => 'padding',
723 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .shipping-field-title',
724 ],
725 ],
726 ];
727
728
729 // ----label style------
730 $this->controls['shipping_label_style'] = [
731 'group' => 'wpfunnels_checkout_shipping_style',
732 'label' => esc_html__( 'Label Style', 'wpfnl' ),
733 'type' => 'separator',
734 ];
735 $this->controls['shipping_label_typography'] = [
736 'group' => 'wpfunnels_checkout_shipping_style',
737 'label' => esc_html__( 'Typography', 'wpfnl' ),
738 'type' => 'typography',
739 'css' => [
740 [
741 'property' => 'font',
742 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields p.form-row label',
743 ],
744 [
745 'property' => 'font',
746 'selector' => '.wpfnl-checkout .woocommerce-additional-fields p.form-row label',
747 ],
748 ],
749 ];
750 $this->controls['shipping_label_margin'] = [
751 'group' => 'wpfunnels_checkout_shipping_style',
752 'label' => esc_html__( 'Margin', 'wpfnl' ),
753 'type' => 'spacing',
754 'css' => [
755 [
756 'property' => 'margin',
757 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields p.form-row label',
758 ],
759 [
760 'property' => 'margin',
761 'selector' => '.wpfnl-checkout .woocommerce-additional-fields p.form-row label',
762 ],
763 ],
764 ];
765 // ----end label style------
766
767
768 // ----input field style------
769 $this->controls['shipping_input_field_style'] = [
770 'group' => 'wpfunnels_checkout_shipping_style',
771 'label' => esc_html__( 'Input Field Style', 'wpfnl' ),
772 'type' => 'separator',
773 ];
774 $this->controls['shipping_input_text_typography'] = [
775 'group' => 'wpfunnels_checkout_shipping_style',
776 'label' => esc_html__( 'Typography', 'wpfnl' ),
777 'type' => 'typography',
778 'css' => [
779 [
780 'property' => 'font',
781 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row input.input-text',
782 ],
783 [
784 'property' => 'font',
785 'selector' => '.wpfnl-checkout .woocommerce-additional-fields .form-row textarea',
786 ],
787 [
788 'property' => 'font',
789 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single',
790 ],
791 [
792 'property' => 'font',
793 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single .select2-selection__rendered',
794 ],
795 [
796 'property' => 'font',
797 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row select.select',
798 ],
799 [
800 'property' => 'font',
801 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row select',
802 ],
803 [
804 'property' => 'font',
805 '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)',
806 ],
807 [
808 'property' => 'font',
809 'selector' => '.wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) textarea',
810 ],
811 ],
812 ];
813 $this->controls['shipping_input_bgcolor'] = [
814 'group' => 'wpfunnels_checkout_shipping_style',
815 'label' => esc_html__( 'Background Color', 'wpfnl' ),
816 'type' => 'color',
817 'default' => '',
818 'css' => [
819 [
820 'property' => 'background-color',
821 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row input.input-text',
822 ],
823 [
824 'property' => 'background-color',
825 'selector' => '.wpfnl-checkout .woocommerce-additional-fields .form-row textarea',
826 ],
827 [
828 'property' => 'background-color',
829 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single',
830 ],
831 [
832 'property' => 'background-color',
833 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row select.select',
834 ],
835 [
836 'property' => 'background-color',
837 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row select',
838 ],
839 [
840 'property' => 'background-color',
841 'selector' => '.wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) > label',
842 ],
843 ],
844 ];
845 $this->controls['shipping_input_border_style'] = [
846 'group' => 'wpfunnels_checkout_shipping_style',
847 'label' => esc_html__( 'Border', 'wpfnl' ),
848 'type' => 'border',
849 'css' => [
850 [
851 'property' => 'border',
852 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row input.input-text',
853 ],
854 [
855 'property' => 'border',
856 'selector' => '.wpfnl-checkout .woocommerce-additional-fields .form-row textarea',
857 ],
858 [
859 'property' => 'border',
860 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single',
861 ],
862 [
863 'property' => 'border',
864 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row select.select',
865 ],
866 [
867 'property' => 'border',
868 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .form-row select',
869 ],
870 ],
871 ];
872 $this->controls['shipping_input_padding'] = [
873 'group' => 'wpfunnels_checkout_shipping_style',
874 'label' => esc_html__( 'Padding', 'wpfnl' ),
875 'type' => 'spacing',
876 'css' => [
877 [
878 'property' => 'padding',
879 'selector' => '.wpfnl-checkout form .woocommerce-shipping-fields .form-row input.input-text',
880 ],
881 [
882 'property' => 'padding',
883 'selector' => '.wpfnl-checkout form .woocommerce-additional-fields .form-row textarea',
884 ],
885 [
886 'property' => 'padding',
887 'selector' => '.wpfnl-checkout form .woocommerce-shipping-fields select.select',
888 ],
889 [
890 'property' => 'padding',
891 'selector' => '.wpfnl-checkout form .woocommerce-shipping-fields .form-row select',
892 ],
893 [
894 'property' => 'padding',
895 '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)',
896 ],
897 [
898 'property' => 'padding',
899 'selector' => '.wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) textarea',
900 ],
901 [
902 'property' => 'padding',
903 'selector' => '.wpfnl-checkout .woocommerce-shipping-fields .select2-container .select2-selection--single .select2-selection__rendered',
904 ],
905 ],
906 ];
907 $this->controls['shipping_input_margin'] = [
908 'group' => 'wpfunnels_checkout_shipping_style',
909 'label' => esc_html__( 'Margin', 'wpfnl' ),
910 'type' => 'spacing',
911 'css' => [
912 [
913 'property' => 'margin',
914 'selector' => '.wpfnl-checkout form .woocommerce-shipping-fields p.form-row:not(#shipping_address_1_field)',
915 ],
916 ],
917 ];
918 // ----end input field style------
919
920 }
921
922
923 /**
924 * Register Order table Style Controls.
925 *
926 * @since 3.1.0
927 * @access public
928 */
929 public function register_order_tbl_style_controls(){
930 $this->controls['order_heading_style'] = [
931 'group' => 'wpfunnels_checkout_order_tbl_style',
932 'label' => esc_html__( 'Heading Style', 'wpfnl' ),
933 'type' => 'separator',
934 ];
935 $this->controls['order_heading_typography'] = [
936 'group' => 'wpfunnels_checkout_order_tbl_style',
937 'label' => esc_html__( 'Typography', 'wpfnl' ),
938 'type' => 'typography',
939 'css' => [
940 [
941 'property' => 'font',
942 'selector' => '.wpfnl-checkout .woocommerce-checkout #order_review_heading',
943 ],
944 ],
945 ];
946 $this->controls['order_heading_margin'] = [
947 'group' => 'wpfunnels_checkout_order_tbl_style',
948 'label' => esc_html__( 'Margin', 'wpfnl' ),
949 'type' => 'spacing',
950 'css' => [
951 [
952 'property' => 'margin',
953 'selector' => '.wpfnl-checkout .woocommerce-checkout #order_review_heading',
954 ],
955 ],
956 ];
957 $this->controls['order_heading_padding'] = [
958 'group' => 'wpfunnels_checkout_order_tbl_style',
959 'label' => esc_html__( 'Padding', 'wpfnl' ),
960 'type' => 'spacing',
961 'css' => [
962 [
963 'property' => 'padding',
964 'selector' => '.wpfnl-checkout .woocommerce-checkout #order_review_heading',
965 ],
966 ],
967 ];
968 // ----order table heading style------
969
970 // ----order table style------
971 $this->controls['order_table_style'] = [
972 'group' => 'wpfunnels_checkout_order_tbl_style',
973 'label' => esc_html__( 'Table Style', 'wpfnl' ),
974 'type' => 'separator',
975 ];
976 $this->controls['your_order_text_typography'] = [
977 'group' => 'wpfunnels_checkout_order_tbl_style',
978 'label' => esc_html__( 'Typography', 'wpfnl' ),
979 'type' => 'typography',
980 'css' => [
981 [
982 'property' => 'font',
983 'selector' => '.wpfnl-checkout .woocommerce-checkout table.woocommerce-checkout-review-order-table td',
984 ],
985 [
986 'property' => 'font',
987 'selector' => '.wpfnl-checkout .woocommerce-checkout table.woocommerce-checkout-review-order-table th',
988 ],
989 ],
990 ];
991 $this->controls['order_table_border_color'] = [
992 'group' => 'wpfunnels_checkout_order_tbl_style',
993 'label' => esc_html__( 'Border Color', 'wpfnl' ),
994 'type' => 'color',
995 'css' => [
996 [
997 'property' => 'border-color',
998 'selector' => '.wpfnl-checkout .woocommerce table.shop_table',
999 ],
1000 [
1001 'property' => 'border-color',
1002 'selector' => '.wpfnl-checkout .woocommerce table.shop_table thead th',
1003 ],
1004 [
1005 'property' => 'border-color',
1006 'selector' => '.wpfnl-checkout .woocommerce table.shop_table thead td',
1007 ],
1008 [
1009 'property' => 'border-color',
1010 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tbody th',
1011 ],
1012 [
1013 'property' => 'border-color',
1014 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tbody td',
1015 ],
1016 [
1017 'property' => 'border-color',
1018 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tfoot td',
1019 ],
1020 [
1021 'property' => 'border-color',
1022 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tfoot th',
1023 ],
1024 ],
1025 ];
1026 $this->controls['order_table_radius'] = [
1027 'group' => 'wpfunnels_checkout_order_tbl_style',
1028 'label' => esc_html__( 'Border Radius', 'wpfnl' ),
1029 'type' => 'border',
1030 'css' => [
1031 [
1032 'property' => 'border-radius',
1033 'selector' => '.wpfnl-checkout .woocommerce table.shop_table',
1034 ]
1035 ],
1036 'exclude' => [
1037 'width',
1038 'style',
1039 'color',
1040 ],
1041
1042 ];
1043 $this->controls['order_table_cell_padding'] = [
1044 'group' => 'wpfunnels_checkout_order_tbl_style',
1045 'label' => esc_html__( 'Padding', 'wpfnl' ),
1046 'type' => 'spacing',
1047 'css' => [
1048 [
1049 'property' => 'padding',
1050 'selector' => '.wpfnl-checkout .woocommerce table.shop_table thead th',
1051 ],
1052 [
1053 'property' => 'padding',
1054 'selector' => '.wpfnl-checkout .woocommerce table.shop_table thead td',
1055 ],
1056 [
1057 'property' => 'padding',
1058 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tbody th',
1059 ],
1060 [
1061 'property' => 'padding',
1062 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tbody td',
1063 ],
1064 [
1065 'property' => 'padding',
1066 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tfoot td',
1067 ],
1068 [
1069 'property' => 'padding',
1070 'selector' => '.wpfnl-checkout .woocommerce table.shop_table tfoot th',
1071 ],
1072 ],
1073 ];
1074 $this->controls['order_table_margin'] = [
1075 'group' => 'wpfunnels_checkout_order_tbl_style',
1076 'label' => esc_html__( 'Margin', 'wpfnl' ),
1077 'type' => 'spacing',
1078 'css' => [
1079 [
1080 'property' => 'margin',
1081 'selector' => '.wpfnl-checkout .woocommerce table.shop_table',
1082 ],
1083
1084 ],
1085 ];
1086 // ----end order table style------
1087
1088 }
1089
1090
1091 /**
1092 * Register Payment Section Style Controls.
1093 *
1094 * @since 3.1.0
1095 * @access public
1096 */
1097 public function register_payment_section_style_controls(){
1098 $this->controls['payment_section_text_color'] = [
1099 'group' => 'wpfunnels_checkout_payment_style',
1100 'label' => esc_html__( 'Text Color', 'wpfnl' ),
1101 'type' => 'color',
1102 'css' => [
1103 [
1104 'property' => 'color',
1105 'selector' => '.wpfnl-checkout #payment .place-order',
1106 ],
1107 [
1108 'property' => 'color',
1109 'selector' => '.wpfnl-checkout #payment .place-order p',
1110 ],
1111 ],
1112 ];
1113 $this->controls['payment_section_link_color'] = [
1114 'group' => 'wpfunnels_checkout_payment_style',
1115 'label' => esc_html__( 'Link Color', 'wpfnl' ),
1116 'type' => 'color',
1117 'css' => [
1118 [
1119 'property' => 'color',
1120 'selector' => '.wpfnl-checkout #payment .place-order a',
1121 ],
1122 ],
1123 ];
1124 $this->controls['payment_section_bg_color'] = [
1125 'group' => 'wpfunnels_checkout_payment_style',
1126 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1127 'type' => 'color',
1128 'css' => [
1129 [
1130 'property' => 'background-color',
1131 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment',
1132 ],
1133 ],
1134 ];
1135 $this->controls['payment_section_typography'] = [
1136 'group' => 'wpfunnels_checkout_payment_style',
1137 'label' => esc_html__( 'Typography', 'wpfnl' ),
1138 'type' => 'typography',
1139 'css' => [
1140 [
1141 'property' => 'font',
1142 'selector' => '.wpfnl-checkout #payment .place-order',
1143 ],
1144 [
1145 'property' => 'font',
1146 'selector' => '.wpfnl-checkout #payment .place-order p',
1147 ],
1148 ],
1149 ];
1150 $this->controls['payment_section_radius'] = [
1151 'group' => 'wpfunnels_checkout_payment_style',
1152 'label' => esc_html__( 'Border Radius', 'wpfnl' ),
1153 'type' => 'border',
1154 'css' => [
1155 [
1156 'property' => 'border-radius',
1157 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment',
1158 ]
1159 ],
1160 'exclude' => [
1161 'width',
1162 'style',
1163 'color',
1164 ],
1165
1166 ];
1167 // ----end payment section global style------
1168
1169
1170 // ----payment method style------
1171 $this->controls['payment_method_heading_style'] = [
1172 'group' => 'wpfunnels_checkout_payment_style',
1173 'label' => esc_html__( 'Payment Method Style', 'wpfnl' ),
1174 'type' => 'separator',
1175 ];
1176 $this->controls['payment_method_typography'] = [
1177 'group' => 'wpfunnels_checkout_payment_style',
1178 'label' => esc_html__( 'Typography', 'wpfnl' ),
1179 'type' => 'typography',
1180 'css' => [
1181 [
1182 'property' => 'font',
1183 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods li',
1184 ],
1185 [
1186 'property' => 'font',
1187 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1188 ],
1189 ],
1190 ];
1191 $this->controls['payment_method_bg_color'] = [
1192 'group' => 'wpfunnels_checkout_payment_style',
1193 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1194 'type' => 'color',
1195 'css' => [
1196 [
1197 'property' => 'background-color',
1198 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods',
1199 ],
1200 ],
1201 ];
1202
1203 $this->controls['radio_button_separator'] = [
1204 'group' => 'wpfunnels_checkout_payment_style',
1205 'type' => 'separator',
1206 ];
1207
1208 $this->controls['payment_method_radio_default_color'] = [
1209 'group' => 'wpfunnels_checkout_payment_style',
1210 'label' => esc_html__( 'Radio Button Default Color', 'wpfnl' ),
1211 'type' => 'color',
1212 'css' => [
1213 [
1214 'property' => 'border-color',
1215 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > label:before',
1216 ],
1217 [
1218 'property' => 'border-color',
1219 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > label:before',
1220 ],
1221 ],
1222 ];
1223 $this->controls['payment_method_radio_color'] = [
1224 'group' => 'wpfunnels_checkout_payment_style',
1225 'label' => esc_html__( 'Radio Button Active Color', 'wpfnl' ),
1226 'type' => 'color',
1227 'css' => [
1228 [
1229 'property' => 'border-color',
1230 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > input[type=radio]:checked + label:before',
1231 ],
1232 [
1233 'property' => 'border-color',
1234 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > input[type=radio]:checked + label:before',
1235 ],
1236 [
1237 'property' => 'background-color',
1238 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > input[type=radio]:checked + label:after',
1239 ],
1240 [
1241 'property' => 'background-color',
1242 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > input[type=radio]:checked + label:after',
1243 ],
1244 ],
1245 ];
1246
1247 $this->controls['saved_payment_checkbox_separator'] = [
1248 'group' => 'wpfunnels_checkout_payment_style',
1249 'type' => 'separator',
1250 ];
1251
1252 $this->controls['saved_payment_checkbox_default_color'] = [
1253 'group' => 'wpfunnels_checkout_payment_style',
1254 'label' => esc_html__( 'Checkbox Default Color', 'wpfnl' ),
1255 'type' => 'color',
1256 'css' => [
1257 [
1258 'property' => 'border-color',
1259 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods-saveNew > label:before',
1260 ],
1261 [
1262 'property' => 'border-color',
1263 'selector' => '.wpfnl-checkout #mailpoet_woocommerce_checkout_optin_field #mailpoet_woocommerce_checkout_optin',
1264 ],
1265 ],
1266 ];
1267 $this->controls['saved_payment_checkbox_color'] = [
1268 'group' => 'wpfunnels_checkout_payment_style',
1269 'label' => esc_html__( 'Checkbox Active Color', 'wpfnl' ),
1270 'type' => 'color',
1271 'css' => [
1272 [
1273 'property' => 'background-color',
1274 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods-saveNew > input[type=checkbox]:checked + label:before',
1275 ],
1276 [
1277 'property' => 'background-color',
1278 'selector' => '.wpfnl-checkout #mailpoet_woocommerce_checkout_optin_field #mailpoet_woocommerce_checkout_optin:checked',
1279 ],
1280 ],
1281 ];
1282 $this->controls['saved_payment_checkbox_tic_color'] = [
1283 'group' => 'wpfunnels_checkout_payment_style',
1284 'label' => esc_html__( 'Checkbox Tic Sign Color', 'wpfnl' ),
1285 'type' => 'color',
1286 'css' => [
1287 [
1288 'property' => 'border-color',
1289 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods-saveNew > label:after',
1290 ],
1291 ],
1292 ];
1293
1294 $this->controls['payment_method_border_separator'] = [
1295 'group' => 'wpfunnels_checkout_payment_style',
1296 'type' => 'separator',
1297 ];
1298
1299 $this->controls['payment_method_border'] = [
1300 'group' => 'wpfunnels_checkout_payment_style',
1301 'label' => esc_html__( 'Border', 'wpfnl' ),
1302 'type' => 'border',
1303 'css' => [
1304 [
1305 'property' => 'border-radius',
1306 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods',
1307 ]
1308 ],
1309 ];
1310 $this->controls['payment_method_padding'] = [
1311 'group' => 'wpfunnels_checkout_payment_style',
1312 'label' => esc_html__( 'Padding', 'wpfnl' ),
1313 'type' => 'spacing',
1314 'css' => [
1315 [
1316 'property' => 'padding',
1317 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods',
1318 ],
1319
1320 ],
1321 ];
1322 $this->controls['payment_method_margin'] = [
1323 'group' => 'wpfunnels_checkout_payment_style',
1324 'label' => esc_html__( 'Margin', 'wpfnl' ),
1325 'type' => 'spacing',
1326 'css' => [
1327 [
1328 'property' => 'margin',
1329 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods',
1330 ],
1331
1332 ],
1333 ];
1334 // ----end payment method style------
1335
1336
1337 // ----payment box style------
1338 $this->controls['payment_box_heading_style'] = [
1339 'group' => 'wpfunnels_checkout_payment_style',
1340 'label' => esc_html__( 'Payment Box Style', 'wpfnl' ),
1341 'type' => 'separator',
1342 ];
1343 $this->controls['payment_box_txt_color'] = [
1344 'group' => 'wpfunnels_checkout_payment_style',
1345 'label' => esc_html__( 'Text Color', 'wpfnl' ),
1346 'type' => 'color',
1347 'css' => [
1348 [
1349 'property' => 'color',
1350 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1351 ],
1352 ],
1353 ];
1354 $this->controls['payment_box_bg_color'] = [
1355 'group' => 'wpfunnels_checkout_payment_style',
1356 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1357 'type' => 'color',
1358 'css' => [
1359 [
1360 'property' => 'background-color',
1361 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1362 ],
1363 [
1364 'property' => 'border-bottom-color',
1365 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box:before',
1366 ],
1367 ],
1368 ];
1369 $this->controls['payment_box_typography'] = [
1370 'group' => 'wpfunnels_checkout_payment_style',
1371 'label' => esc_html__( 'Typography', 'wpfnl' ),
1372 'type' => 'typography',
1373 'css' => [
1374 [
1375 'property' => 'font',
1376 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1377 ]
1378 ],
1379 ];
1380 $this->controls['payment_box_radius'] = [
1381 'group' => 'wpfunnels_checkout_payment_style',
1382 'label' => esc_html__( 'Radius', 'wpfnl' ),
1383 'type' => 'border',
1384 'css' => [
1385 [
1386 'property' => 'border-radius',
1387 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1388 ]
1389 ],
1390 'exclude' => [
1391 'width',
1392 'style',
1393 'color',
1394 ],
1395
1396 ];
1397 $this->controls['payment_box_padding'] = [
1398 'group' => 'wpfunnels_checkout_payment_style',
1399 'label' => esc_html__( 'Padding', 'wpfnl' ),
1400 'type' => 'spacing',
1401 'css' => [
1402 [
1403 'property' => 'padding',
1404 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1405 ],
1406
1407 ],
1408 ];
1409 $this->controls['payment_box_margin'] = [
1410 'group' => 'wpfunnels_checkout_payment_style',
1411 'label' => esc_html__( 'Margin', 'wpfnl' ),
1412 'type' => 'spacing',
1413 'css' => [
1414 [
1415 'property' => 'margin',
1416 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1417 ],
1418
1419 ],
1420 ];
1421 // ----end payment box style------
1422
1423 }
1424
1425
1426 /**
1427 * Register Order Button Style Controls.
1428 *
1429 * @since 3.1.0
1430 * @access public
1431 */
1432 public function register_order_btn_style_controls(){
1433 $this->controls['order_button_typography'] = [
1434 'group' => 'wpfunnels_checkout_order_btn_style',
1435 'label' => esc_html__( 'Typography', 'wpfnl' ),
1436 'type' => 'typography',
1437 'css' => [
1438 [
1439 'property' => 'font',
1440 'selector' => '.wpfnl-checkout .woocommerce #payment #place_order',
1441 ],
1442 ],
1443 ];
1444 $this->controls['order_button_bg_color'] = [
1445 'group' => 'wpfunnels_checkout_order_btn_style',
1446 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1447 'type' => 'color',
1448 'css' => [
1449 [
1450 'property' => 'background-color',
1451 'selector' => '.wpfnl-checkout .woocommerce #payment #place_order',
1452 ],
1453 ],
1454 ];
1455 $this->controls['order_button_shadow'] = [
1456 'group' => 'wpfunnels_checkout_order_btn_style',
1457 'label' => esc_html__( 'Box Shadow', 'wpfnl' ),
1458 'type' => 'box-shadow',
1459 'css' => [
1460 [
1461 'property' => 'box-shadow',
1462 'selector' => '.wpfnl-checkout .woocommerce #payment #place_order',
1463 ],
1464 ],
1465 'inline' => true,
1466 'small' => true,
1467 ];
1468
1469 // $this->controls['order_button_hover_style'] = [
1470 // 'group' => 'wpfunnels_checkout_order_btn_style',
1471 // 'label' => esc_html__( 'Button Hover Style', 'wpfnl' ),
1472 // 'type' => 'separator',
1473 // ];
1474
1475 // $this->controls['order_button_radius_separator'] = [
1476 // 'group' => 'wpfunnels_checkout_order_btn_style',
1477 // 'type' => 'separator',
1478 // ];
1479
1480 $this->controls['order_button_radius'] = [
1481 'group' => 'wpfunnels_checkout_order_btn_style',
1482 'label' => esc_html__( 'Border Radius', 'wpfnl' ),
1483 'type' => 'border',
1484 'css' => [
1485 [
1486 'property' => 'border-radius',
1487 'selector' => '.wpfnl-checkout .woocommerce #payment #place_order',
1488 ]
1489 ],
1490 ];
1491 $this->controls['order_button_padding'] = [
1492 'group' => 'wpfunnels_checkout_order_btn_style',
1493 'label' => esc_html__( 'Padding', 'wpfnl' ),
1494 'type' => 'spacing',
1495 'css' => [
1496 [
1497 'property' => 'padding',
1498 'selector' => '.wpfnl-checkout .woocommerce #payment #place_order',
1499 ],
1500
1501 ],
1502 ];
1503 $this->controls['order_button_margin'] = [
1504 'group' => 'wpfunnels_checkout_order_btn_style',
1505 'label' => esc_html__( 'Margin', 'wpfnl' ),
1506 'type' => 'spacing',
1507 'css' => [
1508 [
1509 'property' => 'margin',
1510 'selector' => '.wpfnl-checkout .woocommerce #payment #place_order',
1511 ],
1512
1513 ],
1514 ];
1515 }
1516
1517
1518 /**
1519 * Register Coupon Form Style Controls.
1520 *
1521 * @since 3.1.0
1522 * @access public
1523 */
1524 public function register_coupon_form_style_controls(){
1525 $this->controls['coupon_toggle_area_style'] = [
1526 'group' => 'wpfunnels_checkout_coupon_style',
1527 'label' => esc_html__( 'Coupon Toggle Area', 'wpfnl' ),
1528 'type' => 'separator',
1529 ];
1530 $this->controls['coupon_toggle_color'] = [
1531 'group' => 'wpfunnels_checkout_coupon_style',
1532 'label' => esc_html__( 'Text Color', 'wpfnl' ),
1533 'type' => 'color',
1534 'css' => [
1535 [
1536 'property' => 'color',
1537 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner__content',
1538 ],
1539 ],
1540 ];
1541 $this->controls['coupon_toggle_link_color'] = [
1542 'group' => 'wpfunnels_checkout_coupon_style',
1543 'label' => esc_html__( 'Link Color', 'wpfnl' ),
1544 'type' => 'color',
1545 'css' => [
1546 [
1547 'property' => 'color',
1548 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner__content a',
1549 ],
1550 ],
1551 ];
1552 $this->controls['coupon_toggle_bgcolor'] = [
1553 'group' => 'wpfunnels_checkout_coupon_style',
1554 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1555 'type' => 'color',
1556 'css' => [
1557 [
1558 'property' => 'background-color',
1559 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner',
1560 ],
1561 ],
1562 ];
1563 $this->controls['coupon_toggle_typography'] = [
1564 'group' => 'wpfunnels_checkout_coupon_style',
1565 'label' => esc_html__( 'Typography', 'wpfnl' ),
1566 'type' => 'typography',
1567 'css' => [
1568 [
1569 'property' => 'font',
1570 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner__content',
1571 ],
1572 ],
1573 ];
1574 $this->controls['coupon_toggle_border'] = [
1575 'group' => 'wpfunnels_checkout_coupon_style',
1576 'label' => esc_html__( 'Border', 'wpfnl' ),
1577 'type' => 'border',
1578 'css' => [
1579 [
1580 'property' => 'border',
1581 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner',
1582 ]
1583 ],
1584 ];
1585 $this->controls['coupon_toggle_padding'] = [
1586 'group' => 'wpfunnels_checkout_coupon_style',
1587 'label' => esc_html__( 'Padding', 'wpfnl' ),
1588 'type' => 'spacing',
1589 'css' => [
1590 [
1591 'property' => 'padding',
1592 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner',
1593 ],
1594 ],
1595 ];
1596 $this->controls['coupon_toggle_margin'] = [
1597 'group' => 'wpfunnels_checkout_coupon_style',
1598 'label' => esc_html__( 'Margin', 'wpfnl' ),
1599 'type' => 'spacing',
1600 'css' => [
1601 [
1602 'property' => 'margin',
1603 'selector' => '.wpfnl-checkout .woocommerce-form-coupon-toggle .wc-block-components-notice-banner',
1604 ],
1605
1606 ],
1607 ];
1608
1609 $this->controls['coupon_form_box_style'] = [
1610 'group' => 'wpfunnels_checkout_coupon_style',
1611 'label' => esc_html__( 'Coupon Form Box', 'wpfnl' ),
1612 'type' => 'separator',
1613 ];
1614
1615 $this->controls['coupon_form_box_color'] = [
1616 'group' => 'wpfunnels_checkout_coupon_style',
1617 'label' => esc_html__( 'Text Color', 'wpfnl' ),
1618 'type' => 'color',
1619 'css' => [
1620 [
1621 'property' => 'color',
1622 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon p',
1623 ],
1624 ],
1625 ];
1626 $this->controls['coupon_form_box_bgcolor'] = [
1627 'group' => 'wpfunnels_checkout_coupon_style',
1628 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1629 'type' => 'color',
1630 'css' => [
1631 [
1632 'property' => 'background-color',
1633 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon',
1634 ],
1635 ],
1636 ];
1637 $this->controls['coupon_form_box_typography'] = [
1638 'group' => 'wpfunnels_checkout_coupon_style',
1639 'label' => esc_html__( 'Typography', 'wpfnl' ),
1640 'type' => 'typography',
1641 'css' => [
1642 [
1643 'property' => 'font',
1644 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon p',
1645 ],
1646 ],
1647 ];
1648 $this->controls['coupon_form_box_border'] = [
1649 'group' => 'wpfunnels_checkout_coupon_style',
1650 'label' => esc_html__( 'Border', 'wpfnl' ),
1651 'type' => 'border',
1652 'css' => [
1653 [
1654 'property' => 'border',
1655 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon',
1656 ]
1657 ],
1658 ];
1659 $this->controls['coupon_form_box_padding'] = [
1660 'group' => 'wpfunnels_checkout_coupon_style',
1661 'label' => esc_html__( 'Padding', 'wpfnl' ),
1662 'type' => 'spacing',
1663 'css' => [
1664 [
1665 'property' => 'padding',
1666 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon',
1667 ],
1668 ],
1669 ];
1670 $this->controls['coupon_form_box_margin'] = [
1671 'group' => 'wpfunnels_checkout_coupon_style',
1672 'label' => esc_html__( 'Margin', 'wpfnl' ),
1673 'type' => 'spacing',
1674 'css' => [
1675 [
1676 'property' => 'margin',
1677 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon',
1678 ],
1679
1680 ],
1681 ];
1682
1683 $this->controls['coupon_input_field_style'] = [
1684 'group' => 'wpfunnels_checkout_coupon_style',
1685 'label' => esc_html__( 'Coupon Input field', 'wpfnl' ),
1686 'type' => 'separator',
1687 ];
1688
1689 $this->controls['coupon_input_field_color'] = [
1690 'group' => 'wpfunnels_checkout_coupon_style',
1691 'label' => esc_html__( 'Color', 'wpfnl' ),
1692 'type' => 'color',
1693 'css' => [
1694 [
1695 'property' => 'color',
1696 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text',
1697 ],
1698 [
1699 'property' => 'color',
1700 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon ::placeholder',
1701 ],
1702 [
1703 'property' => 'color',
1704 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon ::-webkit-input-placeholder',
1705 ],
1706 ],
1707 ];
1708 $this->controls['coupon_input_field_bgcolor'] = [
1709 'group' => 'wpfunnels_checkout_coupon_style',
1710 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1711 'type' => 'color',
1712 'css' => [
1713 [
1714 'property' => 'background-color',
1715 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text',
1716 ],
1717 ],
1718 ];
1719 $this->controls['coupon_input_field_typography'] = [
1720 'group' => 'wpfunnels_checkout_coupon_style',
1721 'label' => esc_html__( 'Typography', 'wpfnl' ),
1722 'type' => 'typography',
1723 'css' => [
1724 [
1725 'property' => 'font',
1726 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text',
1727 ],
1728 ],
1729 ];
1730 $this->controls['coupon_input_field_border'] = [
1731 'group' => 'wpfunnels_checkout_coupon_style',
1732 'label' => esc_html__( 'Border', 'wpfnl' ),
1733 'type' => 'border',
1734 'css' => [
1735 [
1736 'property' => 'border',
1737 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text',
1738 ]
1739 ],
1740 ];
1741 $this->controls['coupon_input_field_padding'] = [
1742 'group' => 'wpfunnels_checkout_coupon_style',
1743 'label' => esc_html__( 'Padding', 'wpfnl' ),
1744 'type' => 'spacing',
1745 'css' => [
1746 [
1747 'property' => 'padding',
1748 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text',
1749 ],
1750 ],
1751 ];
1752
1753 $this->controls['coupon_button_style'] = [
1754 'group' => 'wpfunnels_checkout_coupon_style',
1755 'label' => esc_html__( 'Coupon Button', 'wpfnl' ),
1756 'type' => 'separator',
1757 ];
1758
1759 $this->controls['coupon_button_typography'] = [
1760 'group' => 'wpfunnels_checkout_coupon_style',
1761 'label' => esc_html__( 'Typography', 'wpfnl' ),
1762 'type' => 'typography',
1763 'css' => [
1764 [
1765 'property' => 'font',
1766 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button',
1767 ],
1768 ],
1769 ];
1770 $this->controls['coupon_button_bg_color'] = [
1771 'group' => 'wpfunnels_checkout_coupon_style',
1772 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1773 'type' => 'color',
1774 'css' => [
1775 [
1776 'property' => 'background-color',
1777 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button',
1778 ],
1779 ],
1780 ];
1781 $this->controls['coupon_button_box_shadow'] = [
1782 'group' => 'wpfunnels_checkout_coupon_style',
1783 'label' => esc_html__( 'Box Shadow', 'wpfnl' ),
1784 'type' => 'box-shadow',
1785 'css' => [
1786 [
1787 'property' => 'box-shadow',
1788 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button',
1789 ],
1790 ],
1791 'inline' => true,
1792 'small' => true,
1793 ];
1794 $this->controls['coupon_button_radius'] = [
1795 'group' => 'wpfunnels_checkout_coupon_style',
1796 'label' => esc_html__( 'Border Radius', 'wpfnl' ),
1797 'type' => 'border',
1798 'css' => [
1799 [
1800 'property' => 'border-radius',
1801 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button',
1802 ]
1803 ],
1804 'exclude' => [
1805 'width',
1806 'style',
1807 'color',
1808 ],
1809 ];
1810 $this->controls['coupon_button_padding'] = [
1811 'group' => 'wpfunnels_checkout_coupon_style',
1812 'label' => esc_html__( 'Padding', 'wpfnl' ),
1813 'type' => 'spacing',
1814 'css' => [
1815 [
1816 'property' => 'padding',
1817 'selector' => '.wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button',
1818 ],
1819 ],
1820 ];
1821
1822 }
1823
1824
1825 /**
1826 * Register Form valiation info Style Controls.
1827 *
1828 * @since 3.1.0
1829 * @access public
1830 */
1831 public function register_error_style_controls(){
1832 $this->controls['error_fields_text'] = [
1833 'group' => 'wpfunnels_checkout_error_style',
1834 'label' => esc_html__( 'Field Validation', 'wpfnl' ),
1835 'type' => 'separator',
1836 ];
1837
1838 $this->controls['error_label_color'] = [
1839 'group' => 'wpfunnels_checkout_error_style',
1840 'label' => esc_html__( 'Label Color', 'wpfnl' ),
1841 'type' => 'color',
1842 'css' => [
1843 [
1844 'property' => 'color',
1845 'selector' => '.woocommerce form .form-row.woocommerce-invalid label',
1846 ],
1847 ],
1848 ];
1849 $this->controls['error_field_border_color'] = [
1850 'group' => 'wpfunnels_checkout_error_style',
1851 'label' => esc_html__( 'Field Border Color', 'wpfnl' ),
1852 'type' => 'color',
1853 'css' => [
1854 [
1855 'property' => 'border-color',
1856 'selector' => '.wpfunnels-checkout-form .select2-container--default.field-required .select2-selection--single',
1857 ],
1858 [
1859 'property' => 'border-color',
1860 'selector' => 'form .form-row input.input-text.field-required',
1861 ],
1862 [
1863 'property' => 'border-color',
1864 'selector' => 'form .form-row textarea.input-text.field-required',
1865 ],
1866 [
1867 'property' => 'border-color',
1868 'selector' => '#order_review .input-text.field-required',
1869 ],
1870 [
1871 'property' => 'border-color',
1872 'selector' => 'form .form-row.woocommerce-invalid .select2-container',
1873 ],
1874 [
1875 'property' => 'border-color',
1876 'selector' => 'form .form-row.woocommerce-invalid input.input-text',
1877 ],
1878 [
1879 'property' => 'border-color',
1880 'selector' => 'form .form-row.woocommerce-invalid select',
1881 ],
1882 ],
1883 ];
1884
1885 $this->controls['error_fields_section'] = [
1886 'group' => 'wpfunnels_checkout_error_style',
1887 'label' => esc_html__( 'Error Messages', 'wpfnl' ),
1888 'type' => 'separator',
1889 ];
1890
1891 $this->controls['error_text_color'] = [
1892 'group' => 'wpfunnels_checkout_error_style',
1893 'label' => esc_html__( 'Error Message Color', 'wpfnl' ),
1894 'type' => 'color',
1895 'css' => [
1896 [
1897 'property' => 'color',
1898 'selector' => '.woocommerce-error',
1899 ],
1900 [
1901 'property' => 'color',
1902 'selector' => '.woocommerce-NoticeGroup .woocommerce-error',
1903 ],
1904 [
1905 'property' => 'color',
1906 'selector' => '.woocommerce-notices-wrapper .woocommerce-error',
1907 ],
1908 ],
1909 ];
1910
1911 $this->controls['error_bg_color'] = [
1912 'group' => 'wpfunnels_checkout_error_style',
1913 'label' => esc_html__( 'Background Color', 'wpfnl' ),
1914 'type' => 'color',
1915 'css' => [
1916 [
1917 'property' => 'color',
1918 'selector' => '.woocommerce-error',
1919 ],
1920 [
1921 'property' => 'color',
1922 'selector' => '.woocommerce-NoticeGroup .woocommerce-error',
1923 ],
1924 [
1925 'property' => 'color',
1926 'selector' => '.woocommerce-NoticeGroup .wc-block-components-notice-banner.is-error',
1927 ],
1928 [
1929 'property' => 'color',
1930 'selector' => '.woocommerce-notices-wrapper .woocommerce-error',
1931 ],
1932 ],
1933 ];
1934
1935 $this->controls['error_border_color'] = [
1936 'group' => 'wpfunnels_checkout_error_style',
1937 'label' => esc_html__( 'Border Color', 'wpfnl' ),
1938 'type' => 'color',
1939 'css' => [
1940 [
1941 'property' => 'border-color',
1942 'selector' => '.woocommerce-error',
1943 ],
1944 [
1945 'property' => 'border-color',
1946 'selector' => '.woocommerce-NoticeGroup .woocommerce-error',
1947 ],
1948 [
1949 'property' => 'border-color',
1950 'selector' => '.woocommerce-NoticeGroup .wc-block-components-notice-banner.is-error',
1951 ],
1952 [
1953 'property' => 'border-color',
1954 'selector' => '.woocommerce-notices-wrapper .woocommerce-error',
1955 ],
1956 [
1957 'property' => 'color',
1958 'selector' => '.woocommerce-error::before',
1959 ],
1960 [
1961 'property' => 'background-color',
1962 'selector' => '.wc-block-components-notice-banner.is-error>svg',
1963 ],
1964 ],
1965 ];
1966 }
1967
1968
1969 /**
1970 * Register Multistep Style Controls.
1971 *
1972 * @since 3.1.0
1973 * @access public
1974 */
1975 public function register_multistep_style_controls(){
1976 $this->controls['step_title_heading'] = [
1977 'group' => 'wpfunnels_checkout_multistep_style',
1978 'label' => esc_html__( 'Step Title', 'wpfnl' ),
1979 'type' => 'separator',
1980 ];
1981
1982 $this->controls['step_title_color'] = [
1983 'group' => 'wpfunnels_checkout_multistep_style',
1984 'label' => esc_html__( 'Color', 'wpfnl' ),
1985 'type' => 'color',
1986 'default' => '#363B4E',
1987 'css' => [
1988 [
1989 'property' => 'color',
1990 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-title',
1991 ],
1992 ],
1993 ];
1994 $this->controls['step_title_typography'] = [
1995 'group' => 'wpfunnels_checkout_multistep_style',
1996 'label' => esc_html__( 'Typography', 'wpfnl' ),
1997 'type' => 'typography',
1998 'css' => [
1999 [
2000 'property' => 'font',
2001 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-title',
2002 ],
2003 ],
2004 ];
2005
2006 $this->controls['multistep_checkout_state'] = [
2007 'group' => 'wpfunnels_checkout_multistep_style',
2008 'label' => esc_html__( 'Step Default State', 'wpfnl' ),
2009 'type' => 'separator',
2010 ];
2011
2012 $this->controls['step_box_shadow'] = [
2013 'group' => 'wpfunnels_checkout_multistep_style',
2014 'label' => esc_html__( 'Box Shadow', 'wpfnl' ),
2015 'type' => 'box-shadow',
2016 'css' => [
2017 [
2018 'property' => 'box-shadow',
2019 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-icon',
2020 ],
2021 ],
2022 'inline' => true,
2023 'small' => true,
2024 ];
2025 $this->controls['step_normal_line_color'] = [
2026 'group' => 'wpfunnels_checkout_multistep_style',
2027 'label' => esc_html__( 'Line Color', 'wpfnl' ),
2028 'type' => 'color',
2029 'default' => '#eee',
2030 'css' => [
2031 [
2032 'property' => 'background-color',
2033 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard:before',
2034 ],
2035 ],
2036 ];
2037 $this->controls['step_normal_box_bgcolor'] = [
2038 'group' => 'wpfunnels_checkout_multistep_style',
2039 'label' => esc_html__( 'Box Background Color', 'wpfnl' ),
2040 'type' => 'color',
2041 'default' => '#e8e8ed',
2042 'css' => [
2043 [
2044 'property' => 'background-color',
2045 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-icon',
2046 ],
2047 ],
2048 ];
2049 $this->controls['step_normal_icon_color'] = [
2050 'group' => 'wpfunnels_checkout_multistep_style',
2051 'label' => esc_html__( 'Icon Color', 'wpfnl' ),
2052 'type' => 'color',
2053 'default' => '#6E42D3',
2054 'css' => [
2055 [
2056 'property' => 'fill',
2057 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-icon svg path',
2058 ],
2059 ],
2060 ];
2061 $this->controls['step_normal_box_border_style'] = [
2062 'group' => 'wpfunnels_checkout_multistep_style',
2063 'label' => esc_html__( 'Border', 'wpfnl' ),
2064 'type' => 'border',
2065 'css' => [
2066 [
2067 'property' => 'border',
2068 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-icon',
2069 ],
2070 ],
2071 'exclude' => [
2072 'radius'
2073 ],
2074 ];
2075
2076 $this->controls['multistep_checkout_active'] = [
2077 'group' => 'wpfunnels_checkout_multistep_style',
2078 'label' => esc_html__( 'Step Active / Completed State', 'wpfnl' ),
2079 'type' => 'separator',
2080 ];
2081
2082 $this->controls['step_active_line_color'] = [
2083 'group' => 'wpfunnels_checkout_multistep_style',
2084 'label' => esc_html__( 'Line Color', 'wpfnl' ),
2085 'type' => 'color',
2086 'default' => '#6E42D3',
2087 'css' => [
2088 [
2089 'property' => 'background-color',
2090 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard > li.completed:before',
2091 ],
2092 [
2093 'property' => 'background-color',
2094 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard > li.current:before',
2095 ],
2096 ],
2097 ];
2098 $this->controls['step_active_box_bgcolor'] = [
2099 'group' => 'wpfunnels_checkout_multistep_style',
2100 'label' => esc_html__( 'Box Background Color', 'wpfnl' ),
2101 'type' => 'color',
2102 'default' => '#6E42D3',
2103 'css' => [
2104 [
2105 'property' => 'background-color',
2106 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon',
2107 ],
2108 [
2109 'property' => 'background-color',
2110 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon',
2111 ],
2112 ],
2113 ];
2114 $this->controls['step_active_icon_color'] = [
2115 'group' => 'wpfunnels_checkout_multistep_style',
2116 'label' => esc_html__( 'Icon Color', 'wpfnl' ),
2117 'type' => 'color',
2118 'default' => '#ffffff',
2119 'css' => [
2120 [
2121 'property' => 'fill',
2122 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon svg path',
2123 ],
2124 [
2125 'property' => 'fill',
2126 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon svg path',
2127 ],
2128 ],
2129 ];
2130 $this->controls['step_active_box_border_style'] = [
2131 'group' => 'wpfunnels_checkout_multistep_style',
2132 'label' => esc_html__( 'Border', 'wpfnl' ),
2133 'type' => 'border',
2134 'css' => [
2135 [
2136 'property' => 'border',
2137 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon',
2138 ],
2139 [
2140 'property' => 'border',
2141 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon',
2142 ],
2143 ],
2144 'exclude' => [
2145 'radius'
2146 ],
2147 ];
2148
2149 $this->controls['step_navigation_btn'] = [
2150 'group' => 'wpfunnels_checkout_multistep_style',
2151 'label' => esc_html__( 'Navigation Button', 'wpfnl' ),
2152 'type' => 'separator',
2153 ];
2154
2155 $this->controls['step_navigation_btn_color'] = [
2156 'group' => 'wpfunnels_checkout_multistep_style',
2157 'label' => esc_html__( 'Color', 'wpfnl' ),
2158 'type' => 'color',
2159 'css' => [
2160 [
2161 'property' => 'color',
2162 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]',
2163 ],
2164 ],
2165 ];
2166 $this->controls['step_navigation_btn_bgcolor'] = [
2167 'group' => 'wpfunnels_checkout_multistep_style',
2168 'label' => esc_html__( 'Background Color', 'wpfnl' ),
2169 'type' => 'color',
2170 'css' => [
2171 [
2172 'property' => 'background-color',
2173 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]',
2174 ],
2175 ],
2176 ];
2177 $this->controls['step_navigation_btn_typography'] = [
2178 'group' => 'wpfunnels_checkout_multistep_style',
2179 'label' => esc_html__( 'Typography', 'wpfnl' ),
2180 'type' => 'typography',
2181 'css' => [
2182 [
2183 'property' => 'font',
2184 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]',
2185 ],
2186 ],
2187 ];
2188 $this->controls['step_navigation_btn_radius'] = [
2189 'group' => 'wpfunnels_checkout_multistep_style',
2190 'label' => esc_html__( 'Border Radius', 'wpfnl' ),
2191 'type' => 'border',
2192 'css' => [
2193 [
2194 'property' => 'border-radius',
2195 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]',
2196 ]
2197 ],
2198 'exclude' => [
2199 'width',
2200 'style',
2201 'color',
2202 ]
2203 ];
2204 $this->controls['step_navigation_btn_padding'] = [
2205 'group' => 'wpfunnels_checkout_multistep_style',
2206 'label' => esc_html__( 'Padding', 'wpfnl' ),
2207 'type' => 'spacing',
2208 'css' => [
2209 [
2210 'property' => 'padding',
2211 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]',
2212 ],
2213 ],
2214 ];
2215
2216 $this->controls['step_navigation_btn_hover'] = [
2217 'group' => 'wpfunnels_checkout_multistep_style',
2218 'label' => esc_html__( 'Navigation Button Hover', 'wpfnl' ),
2219 'type' => 'separator',
2220 ];
2221
2222 $this->controls['step_navigation_btn_hover_color'] = [
2223 'group' => 'wpfunnels_checkout_multistep_style',
2224 'label' => esc_html__( 'Color', 'wpfnl' ),
2225 'type' => 'color',
2226 'css' => [
2227 [
2228 'property' => 'color',
2229 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]:not(:disabled):hover',
2230 ],
2231 ],
2232 ];
2233 $this->controls['step_navigation_btn_hover_bgcolor'] = [
2234 'group' => 'wpfunnels_checkout_multistep_style',
2235 'label' => esc_html__( 'Background Color', 'wpfnl' ),
2236 'type' => 'color',
2237 'css' => [
2238 [
2239 'property' => 'background-color',
2240 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]:not(:disabled):hover',
2241 ],
2242 ],
2243 ];
2244
2245 }
2246
2247
2248 /**
2249 * Set builder control groups
2250 *
2251 * @since 3.1.0
2252 * @access public
2253 */
2254 public function set_control_groups()
2255 {
2256 $this->control_groups['wpfunnels_checkout_content'] = [
2257 'title' => esc_html__('Funnel Checkout', 'wpfnl'), // Localized control group title
2258 'tab' => 'content', // Set to either "content" or "style"
2259 ];
2260
2261 $this->control_groups['wpfunnels_checkout_billing_style'] = [
2262 'title' => esc_html__('Billing Section', 'wpfnl'),
2263 'tab' => 'style', // Set to either "content" or "style"
2264 ];
2265
2266 $this->control_groups['wpfunnels_checkout_shipping_style'] = [
2267 'title' => esc_html__('Additional Info / Shipping Section', 'wpfnl'),
2268 'tab' => 'style', // Set to either "content" or "style"
2269 ];
2270
2271 $this->control_groups['wpfunnels_checkout_order_tbl_style'] = [
2272 'title' => esc_html__('Order Table Section', 'wpfnl'),
2273 'tab' => 'style', // Set to either "content" or "style"
2274 ];
2275
2276 $this->control_groups['wpfunnels_checkout_payment_style'] = [
2277 'title' => esc_html__('Payment Section', 'wpfnl'),
2278 'tab' => 'style', // Set to either "content" or "style"
2279 ];
2280
2281 $this->control_groups['wpfunnels_checkout_order_btn_style'] = [
2282 'title' => esc_html__('Order button', 'wpfnl'),
2283 'tab' => 'style', // Set to either "content" or "style"
2284 ];
2285
2286 $this->control_groups['wpfunnels_checkout_coupon_style'] = [
2287 'title' => esc_html__('Coupon Section', 'wpfnl'),
2288 'tab' => 'style', // Set to either "content" or "style"
2289 ];
2290
2291 $this->control_groups['wpfunnels_checkout_error_style'] = [
2292 'title' => esc_html__('Field Validation & Error Messages', 'wpfnl'),
2293 'tab' => 'style', // Set to either "content" or "style"
2294 ];
2295
2296 $this->control_groups['wpfunnels_checkout_multistep_style'] = [
2297 'title' => esc_html__('Multistep Section', 'wpfnl'),
2298 'tab' => 'style', // Set to either "content" or "style"
2299 'required' => [ 'checkout_layout', '=', [ 'wpfnl-2-step', 'wpfnl-multistep', 'wpfnl-express-checkout' ] ],
2300 ];
2301 }
2302
2303
2304 /**
2305 * Set builder controls
2306 *
2307 * @since 3.1.0
2308 */
2309 public function set_controls(){
2310 $this->checkout_content_control();
2311 // $this->ob_register_control();
2312
2313 //---------style controls---------
2314 $this->register_billing_style_controls();
2315 $this->register_shipping_style_controls();
2316 $this->register_order_tbl_style_controls();
2317 $this->register_payment_section_style_controls();
2318 $this->register_order_btn_style_controls();
2319 $this->register_coupon_form_style_controls();
2320 $this->register_error_style_controls();
2321 $this->register_multistep_style_controls();
2322
2323 }
2324
2325
2326 /**
2327 * Render the widget output on the frontend.
2328 *
2329 * Written in PHP and used to generate the final HTML.
2330 *
2331 * @since 3.1.0
2332 *
2333 * @access public
2334 */
2335 public function render(){
2336 // We need the form element ID to recover the element settings on form submit
2337 $this->set_attribute( '_root', 'data-element-id', $this->id );
2338
2339 $settings = $this->settings;
2340
2341 // ---- Display Conditions ----------------------------------------
2342 $display_condition = ! empty( $settings['display_condition_type'] ) ? $settings['display_condition_type'] : 'none';
2343
2344 if ( $display_condition === 'user_state' ) {
2345 $hide_logged_in = ! empty( $settings['hide_from_logged_in'] );
2346 $hide_logged_out = ! empty( $settings['hide_from_logged_out'] );
2347
2348 if ( $hide_logged_in && is_user_logged_in() ) {
2349 return;
2350 }
2351 if ( $hide_logged_out && ! is_user_logged_in() ) {
2352 return;
2353 }
2354
2355 } elseif ( $display_condition === 'user_role' ) {
2356 $hide_for_user_role = ! empty( $settings['hide_for_user_role'] ) ? $settings['hide_for_user_role'] : 'none';
2357
2358 if ( $hide_for_user_role !== 'none' && is_user_logged_in() ) {
2359 $user = wp_get_current_user();
2360 if ( in_array( $hide_for_user_role, $user->roles ) ) {
2361 return;
2362 }
2363 }
2364
2365 } elseif ( $display_condition === 'day' ) {
2366 $disable_on_days = ! empty( $settings['disable_on_days'] ) ? $settings['disable_on_days'] : [];
2367
2368 if ( ! empty( $disable_on_days ) && is_array( $disable_on_days ) ) {
2369 $current_day = strtolower( date( 'l' ) ); // e.g., 'monday'
2370 if ( in_array( $current_day, $disable_on_days ) ) {
2371 return;
2372 }
2373 }
2374
2375 } elseif ( $display_condition === 'browser' ) {
2376 $hide_on_browser = ! empty( $settings['hide_on_browser'] ) ? $settings['hide_on_browser'] : 'none';
2377
2378 if ( $hide_on_browser !== 'none' ) {
2379 $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
2380 $current_browser = '';
2381
2382 if ( strpos( $user_agent, 'edg' ) !== false ) {
2383 $current_browser = 'edge';
2384 } elseif ( strpos( $user_agent, 'opr' ) !== false || strpos( $user_agent, 'opera' ) !== false ) {
2385 $current_browser = 'opera_mini';
2386 } elseif ( strpos( $user_agent, 'chrome' ) !== false ) {
2387 $current_browser = 'chrome';
2388 } elseif ( strpos( $user_agent, 'safari' ) !== false ) {
2389 $current_browser = 'safari';
2390 } elseif ( strpos( $user_agent, 'firefox' ) !== false ) {
2391 $current_browser = 'mozilla';
2392 }
2393
2394 if ( $current_browser === $hide_on_browser ) {
2395 return;
2396 }
2397 }
2398
2399 } elseif ( $display_condition === 'operating_system' ) {
2400 $hide_on_os = ! empty( $settings['hide_on_os'] ) ? $settings['hide_on_os'] : 'none';
2401
2402 if ( $hide_on_os !== 'none' ) {
2403 $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
2404 $current_os = '';
2405
2406 if ( strpos( $user_agent, 'windows' ) !== false || strpos( $user_agent, 'win32' ) !== false || strpos( $user_agent, 'win64' ) !== false ) {
2407 $current_os = 'windows';
2408 } elseif ( strpos( $user_agent, 'macintosh' ) !== false || strpos( $user_agent, 'mac os x' ) !== false ) {
2409 $current_os = 'macos';
2410 } elseif ( strpos( $user_agent, 'linux' ) !== false && strpos( $user_agent, 'android' ) === false ) {
2411 $current_os = 'linux';
2412 } elseif ( strpos( $user_agent, 'android' ) !== false ) {
2413 $current_os = 'android';
2414 } elseif ( strpos( $user_agent, 'iphone' ) !== false || strpos( $user_agent, 'ipad' ) !== false || strpos( $user_agent, 'ipod' ) !== false ) {
2415 $current_os = 'ios';
2416 } elseif ( strpos( $user_agent, 'sunos' ) !== false ) {
2417 $current_os = 'sunos';
2418 } elseif ( strpos( $user_agent, 'openbsd' ) !== false ) {
2419 $current_os = 'openbsd';
2420 }
2421
2422 if ( $current_os === $hide_on_os ) {
2423 return;
2424 }
2425 }
2426 }
2427 // ---- End Display Conditions ------------------------------------
2428
2429 $checkout = WC()->checkout();
2430 $checkout_id = $this->post_id;
2431
2432 //----Start Coupon Enabler----//
2433 $coupon_enabler = get_post_meta($this->post_id, '_wpfnl_checkout_coupon', true);
2434 if ( 'no' === $coupon_enabler ) {
2435 remove_action('woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10);
2436 }
2437 //----End Coupon Enabler----//
2438
2439 $checkout_layout = isset($settings['checkout_layout']) ? $settings['checkout_layout'] : 'two-column';
2440 $floating_label = isset($settings['checkout_floating_label']) ? $settings['checkout_floating_label'] : '';
2441
2442 if( PHP_SESSION_DISABLED == session_status() ) {
2443 session_start();
2444 }
2445 $_SESSION[ 'checkout_layout' ] = $checkout_layout;
2446
2447 /**
2448 * Check if pro is activated or not
2449 */
2450 if( !Wpfnl_functions::is_wpfnl_pro_activated() && ('wpfnl-multistep' === $checkout_layout || 'wpfnl-express-checkout' === $checkout_layout) ) {
2451 $checkout_layout = 'wpfnl-col-2';
2452 }
2453
2454 /**
2455 * Check if pro is activated and wpfnl-express-checkout selected
2456 */
2457 if( Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-express-checkout' === $checkout_layout ) {
2458 $checkout_layout .= ' wpfnl-multistep';
2459 }
2460
2461 /**
2462 * Check if pro is activated and wpfnl-express-checkout selected
2463 */
2464 if( Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-2-step' === $checkout_layout ) {
2465 $checkout_layout .= ' wpfnl-multistep';
2466 }
2467
2468 // Add shared modern checkout class for both modern layouts
2469 if( 'wpfnl-modern-one-column' === $checkout_layout || 'wpfnl-modern-checkout' === $checkout_layout ) {
2470 if( false === strpos( $checkout_layout, 'wpfnl-modern-checkout' ) ) {
2471 $checkout_layout .= ' wpfnl-modern-checkout';
2472 }
2473 }
2474
2475 /**
2476 * Check if pro is activated and wpfnl-modern-multistep selected
2477 */
2478 if('wpfnl-modern-multistep' === $checkout_layout ) {
2479 $checkout_layout .= ' wpfnl-modern-checkout';
2480 }
2481
2482 // Add responsive classes
2483 if ( ! empty( $settings['hide_on_desktop'] ) ) {
2484 $checkout_layout .= ' wpfnl-hide-desktop';
2485 }
2486 if ( ! empty( $settings['hide_on_tablet'] ) ) {
2487 $checkout_layout .= ' wpfnl-hide-tablet';
2488 }
2489 if ( ! empty( $settings['hide_on_mobile'] ) ) {
2490 $checkout_layout .= ' wpfnl-hide-mobile';
2491 }
2492
2493 // Add animation class
2494 $animation = ! empty( $settings['entrance_animation'] ) ? $settings['entrance_animation'] : '';
2495 if ( $animation ) {
2496 $checkout_layout .= ' wpfnl-animation ' . esc_attr( $animation );
2497 }
2498
2499 query_posts('post_type="checkout"');
2500
2501 // load woo templates from wpf plugin
2502 $frontend = Wpfnl::get_instance()->frontend;
2503 add_filter('woocommerce_locate_template', array($frontend, 'wpfunnels_woocommerce_locate_template'), 20, 3);
2504
2505
2506 $ob_settings = $this->get_order_bump_settings_for_preview($checkout_id);
2507 do_action('wpfunnels/bricks_render_order_bump', $checkout_id, $ob_settings);
2508
2509 do_action( 'wpfunnels/before_bricks_checkout_form', $settings );
2510 do_action( 'wpfunnels/before_checkout_form', $checkout_id );
2511
2512 ?>
2513 <div <?php echo $this->render_attributes( '_root' ); ?> >
2514 <div class="wpfnl-checkout <?php echo $checkout_layout .' '. $floating_label ?>">
2515
2516 <?php echo do_shortcode('[woocommerce_checkout]'); ?>
2517
2518 <!-- when checkout layout Express Checkout selected then show -->
2519 <?php if( Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-express-checkout' === $settings['checkout_layout'] ){
2520 ?>
2521 <?php } ?>
2522 </div>
2523 </div>
2524 <?php
2525 }
2526
2527
2528 /**
2529 * Get order bump settings for preview
2530 *
2531 * @param $post_id
2532 * @param $widget_settings
2533 *
2534 * @return mixed
2535 *
2536 * @since 2.0.4
2537 */
2538 private function get_order_bump_settings_for_preview( $post_id ) {
2539 $order_bump_settings = get_post_meta( $post_id, 'order-bump-settings', true );
2540 return $order_bump_settings;
2541 }
2542
2543 /**
2544 * Replace ob settings with widget data
2545 *
2546 * @param $order_bump_settings
2547 * @param $widget_settings
2548 *
2549 * @return mixed
2550 *
2551 * @since 2.0.4
2552 */
2553 private function replace_ob_settings_with_widget_data( $order_bump_settings, $widget_settings ) {
2554 foreach( $order_bump_settings as $key=>$settings ){
2555 $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'];
2556 $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'];
2557 $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'];
2558 $order_bump_settings[$key]['position'] = isset( $widget_settings['order_bump_position_'.$key] ) ? $widget_settings['order_bump_position_'.$key] : $order_bump_settings[$key]['position'];
2559 $order_bump_settings[$key]['selectedStyle'] = isset( $widget_settings['order_bump_layout_'.$key] ) ? $widget_settings['order_bump_layout_'.$key] : $order_bump_settings[$key]['selectedStyle'];
2560 $order_bump_settings[$key]['productImage'] = isset( $widget_settings['order_bump_image_'.$key] ) ? $widget_settings['order_bump_image_'.$key] : $order_bump_settings[$key]['productImage'];
2561 $order_bump_settings[$key]['isEnabled'] = isset( $widget_settings['order_bump_'.$key] ) ? $widget_settings['order_bump_'.$key] : $order_bump_settings[$key]['isEnabled'];
2562 }
2563 return $order_bump_settings;
2564 }
2565
2566
2567
2568 /**
2569 * Render order bump data with hooks.
2570 *
2571 * @since 1.0.0
2572 *
2573 * @access protected
2574 */
2575 public function render_order_bump()
2576 {
2577 $step_id = $this->post_id;
2578 $order_bump = get_post_meta($step_id, 'order-bump', true);
2579 $order_bump_settings = get_post_meta($step_id, 'order-bump-settings', true);
2580 foreach( $order_bump_settings as $key=>$ob_settings ){
2581 if ( $ob_settings['isEnabled'] && isset($ob_settings['product']) && $ob_settings['product'] != '' ) {
2582 // Check conditional rules before displaying
2583 if ( Wpfnl_Order_Bump_Rules::should_display_order_bump( $ob_settings ) ) {
2584 $this->render_order_bump_template($ob_settings);
2585 }
2586 }
2587 }
2588 }
2589
2590 public function render_order_bump_template($settings)
2591 {
2592 if (!empty($settings['selectedStyle'])) {
2593
2594 if ($settings['position'] == 'popup') {
2595 if (\Elementor\Plugin::$instance->editor->is_edit_mode()) {
2596 echo '<h5 style="margin-bottom: 15px;"><strong>' . __('To see the pop-up offer in action, please preview or view the page.', 'wpfnl') . '</strong></h5>';
2597 } else {
2598 require_once WPFNL_DIR . 'public/modules/checkout/templates-style/order-bump-template-' . $settings['selectedStyle'] . '.php';
2599 }
2600
2601 } else {
2602 require_once WPFNL_DIR . 'public/modules/checkout/templates-style/order-bump-template-' . $settings['selectedStyle'] . '.php';
2603 }
2604 }
2605 }
2606
2607 }
2608