PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.12.2
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.12.2
3.13.4 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 All 262 releases
wpfunnels / includes / core / widgets / oxygen / elements / checkout / class-checkout.php

class-checkout.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.12.2, at includes/core/widgets/oxygen/elements/checkout/class-checkout.php

808 lines 34.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Checkout
4 *
5 * @package
6 */
7 namespace WPFunnels\Widgets\Oxygen;
8
9 use WPFunnels\Wpfnl_functions;
10
11 /**
12 * Class Checkout
13 *
14 * @package WPFunnels\Widgets\Oxygen
15 */
16 class Checkout extends Elements {
17
18 function init() {
19 // Do some initial things here.
20 }
21
22 function afterInit() {
23 // Do things after init, like remove apply params button and remove the add button.
24 $this->removeApplyParamsButton();
25 // $this->removeAddButton();
26 }
27
28 function name() {
29 return 'WPF Checkout';
30 }
31
32 function slug() {
33 return "wpf-checkout";
34 }
35
36 function icon() {
37 return plugin_dir_url(__FILE__) . 'icon/checkout.svg';
38 }
39
40 // function button_place() {
41 // // return "interactive";
42 // }
43
44 function button_priority() {
45 // return 9;
46 }
47
48
49 function render( $options, $defaults, $content ) {
50 if( !Wpfnl_functions::check_if_this_is_step_type( 'checkout' ) ) {
51 echo __( 'Sorry, Please place the element in WPFunnels Checkout page','wpfnl' );
52 }
53 else {
54 $step_id = isset( $_GET[ 'post_id' ] ) ? $_GET[ 'post_id' ] : get_the_ID();
55 $checkout_layout = isset( $options[ 'layout' ] ) ? $options[ 'layout' ] : '';
56
57 update_post_meta( $step_id, '_wpfnl_checkout_layout', $checkout_layout );
58
59 add_filter( 'woocommerce_locate_template', array( $this, 'wpfunnels_woocommerce_locate_template' ), 20, 3 );
60 do_action( 'wpfunnels/before_checkout_form', $step_id );
61
62 if( PHP_SESSION_DISABLED == session_status() ) {
63 session_start();
64 }
65 $_SESSION[ 'checkout_layout' ] = $checkout_layout;
66
67 if( \WPFunnels\Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-express-checkout' === $checkout_layout ) {
68 $checkout_layout .= ' wpfnl-multistep';
69 }
70
71 if( \WPFunnels\Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-2-step' === $checkout_layout ) {
72 $checkout_layout .= ' wpfnl-multistep';
73 }
74
75 // Add shared modern checkout class for both modern layouts
76 if( 'wpfnl-modern-one-column' === $checkout_layout || 'wpfnl-modern-checkout' === $checkout_layout ) {
77 if( false === strpos( $checkout_layout, 'wpfnl-modern-checkout' ) ) {
78 $checkout_layout .= ' wpfnl-modern-checkout';
79 }
80 }
81
82 //-----floating label class-----
83 $floating_label = isset($options['checkout_floating_label']) ? $options['checkout_floating_label'] : '';
84
85 $html = '<div class="wpfnl-checkout ' . $checkout_layout .' '. $floating_label .'" >';
86 $html .= do_shortcode( '[woocommerce_checkout]' );
87 $html .= '</div>';
88
89 echo $html;
90 }
91 }
92 public static function wpfunnels_woocommerce_locate_template($template, $template_name, $template_path)
93 {
94 /***
95 * Fires when change the wc template
96 *
97 * @since 2.8.21
98 */
99 if( apply_filters( 'wpfunnels/maybe_locate_template', true ) ){
100 global $woocommerce;
101 $_template = $template;
102 $plugin_path = WPFNL_DIR . '/woocommerce/templates/';
103
104 if (file_exists($plugin_path . $template_name)) {
105 $template = $plugin_path . $template_name;
106 }
107
108 if ( ! $template ) {
109 $template = $_template;
110 }
111 }
112 return $template;
113 }
114
115 /**
116 * Register widget controls.
117 *
118 * @since 2.8.2
119 */
120 public function controls() {
121 $this->configure_layout_section();
122 $this->configure_billing_section();
123 $this->configure_shipping_section();
124 $this->configure_order_section_style();
125 $this->configure_table_style();
126 $this->configure_payment_section_style();
127 $this->configure_order_button_style();
128 $this->configure_coupon_section_style();
129 $this->configure_multistep_style();
130 }
131
132 /**
133 * Configure the layout section settings for the checkout page.
134 *
135 * @since 2.8.2
136 */
137 private function configure_layout_section() {
138 // Add a control section for layout settings
139 $layout = $this->addControlSection(
140 'optin_layout',
141 __('Layout', 'wpfnl'),
142 'assets/icon.png',
143 $this
144 );
145
146 // Add a dropdown option control for selecting layout
147 $layout->addOptionControl(
148 array(
149 'type' => 'dropdown',
150 'name' => __('Layout', 'wpfnl'),
151 'slug' => 'layout',
152 'default' => 'wpfnl-col-2'
153 )
154 )->setValue(
155 array(
156 'wpfnl-col-1' => __('1 Column Checkout', 'wpfnl'),
157 'wpfnl-col-2' => __('2 Column Checkout', 'wpfnl'),
158 'wpfnl-2-step' => __('2 Step Checkout', 'wpfnl'),
159 'wpfnl-multistep' => __('Multistep Checkout', 'wpfnl'),
160 'wpfnl-express-checkout' => __('Express Checkout', 'wpfnl'),
161 'wpfnl-modern-checkout' => __('Modern Checkout', 'wpfnl'),
162 'wpfnl-modern-one-column' => __('Modern One Column Checkout', 'wpfnl'),
163 )
164 )->rebuildElementOnChange();
165
166 // Add a dropdown option control for floating label selection
167 $layout->addOptionControl(
168 array(
169 'type' => 'dropdown',
170 'name' => __('Floating Label', 'wpfnl'),
171 'slug' => 'checkout_floating_label',
172 'default' => ''
173 )
174 )->setValue(
175 array(
176 '' => __('Select option', 'wpfnl'),
177 'floating-label' => __('Floating Label', 'wpfnl'),
178 )
179 )->rebuildElementOnChange();
180 }
181
182 /**
183 * Configure the billing section styles for the checkout page.
184 *
185 * @since 2.8.2
186 */
187 private function configure_billing_section() {
188 // Configure Billing Header Style
189 $this->configure_header_style(
190 'billing_header',
191 __('Billing Heading', 'wpfnl'),
192 '.wpfnl-checkout .woocommerce-billing-fields > h3'
193 );
194
195 // Configure Billing Label Style
196 $this->configure_label_and_input_style(
197 'billing_label',
198 __('Billing Input Label', 'wpfnl'),
199 '.wpfnl-checkout .woocommerce-billing-fields p.form-row label',
200 'Label Margin'
201 );
202
203 // Configure Billing Input Style
204 $this->configure_label_and_input_style(
205 'billing_inputs',
206 __('Billing Input Field', 'wpfnl'),
207 '.wpfnl-checkout .woocommerce-billing-fields .form-row input.input-text, .wpfnl-checkout .woocommerce-billing-fields .form-row textarea, .wpfnl-checkout .woocommerce-billing-fields .select2-container--default .select2-selection--single, .wpfnl-checkout .woocommerce-billing-fields .form-row select, .wpfnl-checkout .woocommerce-billing-fields ::placeholder, .wpfnl-checkout .woocommerce-billing-fields ::-webkit-input-placeholder, .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_billing .form-row:not(.create-account) input.input-text:not(#billing_address_2, #shipping_address_2), .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_billing .form-row:not(.create-account) textarea',
208 'Input Margin'
209 );
210 }
211
212 /**
213 * Configure the header style for a specific section on the checkout page.
214 *
215 * @param string $sectionId The ID of the section.
216 * @param string $sectionTitle The title of the section.
217 * @param string $selector The CSS selector for the section.
218 *
219 * @since 2.8.2
220 */
221 private function configure_header_style($sectionId, $sectionTitle, $selector) {
222 $section = $this->addControlSection($sectionId, $sectionTitle, 'assets/icon.png', $this);
223 $section->typographySection(__('Heading Typography', 'wpfnl'), $selector, $this);
224 $this->configure_common_style($section, $selector, 'Heading Border');
225 }
226
227 /**
228 * Configure the label and input style for a specific section on the checkout page.
229 *
230 * @param string $sectionId The ID of the section.
231 * @param string $sectionTitle The title of the section.
232 * @param string $selector The CSS selector for the section.
233 * @param string $marginControlName The name of the margin control.
234 *
235 * @since 2.8.2
236 */
237 private function configure_label_and_input_style($sectionId, $sectionTitle, $selector, $marginControlName) {
238 $section = $this->addControlSection($sectionId, $sectionTitle, 'assets/icon.png', $this);
239 $section->addPreset('margin', "{$sectionId}_margin", __($marginControlName, 'wpfnl'), $selector)->whiteList();
240 $section->typographySection(__('Label Typography', 'wpfnl'), $selector, $this);
241 $this->configure_common_style($section, $selector, 'Input Border');
242 }
243
244 /**
245 * Configure common style settings for a specific section on the checkout page.
246 *
247 * @param object $section The section to configure.
248 * @param string $selector The CSS selector for the section.
249 * @param string $borderSectionTitle The title for the border section.
250 *
251 * @since 2.8.2
252 */
253 private function configure_common_style($section, $selector, $borderSectionTitle) {
254 $section->addPreset('padding', "{$section->id}_padding", __('Padding', 'wpfnl'), $selector)->whiteList();
255 $section->addStyleControls([
256 [
257 'name' => __('Background Color', 'wpfnl'),
258 'selector' => $selector,
259 'property' => 'background-color',
260 ],
261 ]);
262 $section->borderSection($borderSectionTitle, $selector, $this);
263 }
264
265 /**
266 * Configure the styling for the shipping section on the checkout page.
267 *
268 * @since 2.8.2
269 */
270 private function configure_shipping_section() {
271 // Configure Shipping Header Style
272 $this->configure_header_style(
273 'shipping_header',
274 __('Shipping Heading', 'wpfnl'),
275 '.wpfnl-checkout .woocommerce-shipping-fields #ship-to-different-address span, .wpfnl-checkout .woocommerce-additional-fields > h3'
276 );
277
278 // Configure Shipping Label Style
279 $this->configure_label_and_input_style(
280 'shipping_label',
281 __('Shipping Input Label', 'wpfnl'),
282 '.wpfnl-checkout .woocommerce-shipping-fields p.form-row label, .wpfnl-checkout .woocommerce-additional-fields p.form-row label',
283 'Label Margin'
284 );
285
286 // Configure Shipping Input Style
287 $this->configure_label_and_input_style(
288 'shipping_inputs',
289 __('Shipping Input Field', 'wpfnl'),
290 '.wpfnl-checkout .woocommerce-shipping-fields .form-row input.input-text, .wpfnl-checkout .woocommerce-additional-fields .form-row textarea, .wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single, .wpfnl-checkout .woocommerce-shipping-fields .form-row select, .wpfnl-checkout .woocommerce-shipping-fields ::placeholder, .wpfnl-checkout .woocommerce-shipping-fields ::-webkit-input-placeholder, .wpfnl-checkout .woocommerce-additional-fields ::placeholder, .wpfnl-checkout .woocommerce-additional-fields ::-webkit-input-placeholder, .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) input.input-text:not(#billing_address_2, #shipping_address_2), .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) textarea',
291 'Input Margin'
292 );
293 }
294
295 /**
296 * Configure the styling for the order section heading on the checkout page.
297 *
298 * @since 2.8.2
299 */
300 private function configure_order_section_style() {
301 // Add Control Section for Order Header
302 $order_header = $this->addControlSection('order_header', __('Order Heading','wpfnl'), 'assets/icon.png', $this);
303
304 // Selector for Order Header
305 $order_header_selector = '.wpfnl-checkout .woocommerce-checkout #order_review_heading';
306
307 // Configure Typography for Order Header
308 $order_header->typographySection(
309 __('Heading Typography','wpfnl'),
310 $order_header_selector,
311 $this
312 );
313
314 // Configure Padding Preset for Order Header
315 $order_header->addPreset(
316 'padding',
317 'order_header_padding',
318 __('Padding','wpfnl'),
319 $order_header_selector
320 )->whiteList();
321
322 // Configure Margin Preset for Order Header
323 $order_header->addPreset(
324 'margin',
325 'order_header_margin',
326 __('Margin','wpfnl'),
327 $order_header_selector
328 )->whiteList();
329
330 // Configure Background Color Style for Order Header
331 $order_header->addStyleControls([
332 [
333 'name' => __('Background Color','wpfnl'),
334 'selector' => $order_header_selector,
335 'property' => 'background-color',
336 ],
337 ]);
338
339 // Configure Border Section for Order Header
340 $order_header->borderSection(
341 __('Heading Border','wpfnl'),
342 $order_header_selector,
343 $this
344 );
345 }
346
347 /**
348 * Configure the styling for the order table on the checkout page.
349 *
350 * @since 2.8.2
351 */
352 private function configure_table_style() {
353 // Add Control Section for Order Table.
354 $order_table_section = $this->addControlSection('order_table_section', __('Order Table','wpfnl'), 'assets/icon.png', $this);
355
356 // Selector for Order Table cells
357 $order_table = '.wpfnl-checkout .woocommerce-checkout table.woocommerce-checkout-review-order-table td, .wpfnl-checkout .woocommerce-checkout table.woocommerce-checkout-review-order-table th';
358
359 // Configure Margin Preset for Order Table.
360 $order_table_section->addPreset(
361 'margin',
362 'order_table_margin',
363 __('Table Margin','wpfnl'),
364 '.wpfnl-checkout .woocommerce table.shop_table'
365 )->whiteList();
366
367 // Configure Padding Preset for Order Table Cells.
368 $order_table_section->addPreset(
369 'padding',
370 'order_tbl_cell_padding',
371 __('Cell Padding','wpfnl'),
372 '.wpfnl-checkout .woocommerce table.shop_table thead th, .wpfnl-checkout .woocommerce table.shop_table thead td, .wpfnl-checkout .woocommerce table.shop_table tbody th, .wpfnl-checkout .woocommerce table.shop_table tbody td, .wpfnl-checkout .woocommerce table.shop_table tfoot td, .wpfnl-checkout .woocommerce table.shop_table tfoot th'
373 )->whiteList();
374
375 // Configure Background Color Style for Order Table.
376 $order_table_section->addStyleControls([
377 [
378 'name' => __('Background Color','wpfnl'),
379 'selector' => '.wpfnl-checkout .woocommerce table.shop_table',
380 'property' => 'background-color',
381 ],
382 ]);
383
384 // Configure Typography for Order Table Cells.
385 $order_table_section->typographySection(
386 __('Table Typography','wpfnl'),
387 $order_table,
388 $this
389 );
390
391 // Configure Border Section for Order Table.
392 $order_table_section->borderSection(
393 __('Table Border','wpfnl'),
394 '.wpfnl-checkout .woocommerce table.shop_table',
395 $this
396 );
397 }
398
399 /**
400 * Configure the styling for the payment section on the checkout page.
401 *
402 * @since 2.8.2
403 */
404 private function configure_payment_section_style() {
405 // Add Control Section for Payment Section.
406 $payment_section = $this->addControlSection('payment_section', __('Payment Section', 'wpfnl'), 'assets/icon.png', $this);
407
408 // Configure Background Color Style for Payment Section.
409 $payment_section->addStyleControls([
410 [
411 'name' => __('Payment Section Background Color', 'wpfnl'),
412 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment',
413 'property' => 'background-color',
414 ],
415 ]);
416
417 // Configure Link Color Style for Payment Section.
418 $payment_section->addStyleControls([
419 [
420 'name' => __('Payment Section Link Color', 'wpfnl'),
421 'selector' => '.wpfnl-checkout #payment .place-order a, .wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > label a, .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > label a',
422 'property' => 'color',
423 ],
424 ]);
425
426 // Configure Typography for Payment Section.
427 $payment_section->typographySection(
428 __('Payment Section Typography', 'wpfnl'),
429 '.wpfnl-checkout #payment .place-order p, .woocommerce-terms-and-conditions-wrapper .woocommerce-form__label-for-checkbox .woocommerce-terms-and-conditions-checkbox-text',
430 $this
431 );
432
433 // Configure Border Section for Payment Section.
434 $payment_section->borderSection(
435 __('Payment Section Border', 'wpfnl'),
436 '.wpfnl-checkout .woocommerce-checkout #payment',
437 $this
438 );
439
440 // Add Style Controls for Payment Method Typography.
441 $payment_section->typographySection(
442 __('Payment Method Typography', 'wpfnl'),
443 '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > label, .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > label',
444 $this
445 );
446
447 // Configure Border Section for Payment Method.
448 $payment_section->borderSection(
449 __('Payment Method Border', 'wpfnl'),
450 '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li, .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li',
451 $this
452 );
453
454 // Add Preset for Payment Method Padding.
455 $payment_section->addPreset(
456 'padding',
457 'payment_method_padding',
458 __('Payment Method Padding', 'wpfnl'),
459 '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li, .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li'
460 )->whiteList();
461
462 // Add Style Controls for Payment Method Tooltip.
463 $payment_section->addStyleControls([
464 [
465 'name' => __('Payment Method Tooltip Background Color', 'wpfnl'),
466 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
467 'property' => 'background-color',
468 ],
469 [
470 'name' => __('Payment Method Tooltip Border Color', 'wpfnl'),
471 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box:before',
472 'property' => 'border-bottom-color',
473 ],
474 ]);
475
476 // Add Preset for Payment Method Tooltip Padding.
477 $payment_section->addPreset(
478 'padding',
479 'payment_method_tooltip_padding',
480 __('Payment Method Tooltip Padding', 'wpfnl'),
481 '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box'
482 )->whiteList();
483
484 // Add Style Controls for Payment Method Radio Button and Checkbox.
485 $payment_section->addStyleControls([
486 [
487 'name' => __('Radio Button Default Color', 'wpfnl'),
488 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > label:before, .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > label:before',
489 'property' => 'border-color',
490 ],
491 [
492 'name' => __('Radio Button Active Color', 'wpfnl'),
493 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > input[type=radio]:checked + label:before, .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > input[type=radio]:checked + label:before',
494 'property' => 'border-color',
495 ],
496 [
497 'name' => __('Radio Button Active Background Color', 'wpfnl'),
498 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > input[type=radio]:checked + label:after, .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > input[type=radio]:checked + label:after',
499 'property' => 'background-color',
500 ],
501 [
502 'name' => __('Checkbox Default Color', 'wpfnl'),
503 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods-saveNew > label:before, .wpfnl-checkout #mailpoet_woocommerce_checkout_optin_field #mailpoet_woocommerce_checkout_optin',
504 'property' => 'border-color',
505 ],
506 [
507 'name' => __('Checkbox Active Color', 'wpfnl'),
508 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods-saveNew > input[type=checkbox]:checked + label:before, .wpfnl-checkout #mailpoet_woocommerce_checkout_optin_field #mailpoet_woocommerce_checkout_optin:checked',
509 'property' => 'border-color',
510 ],
511 [
512 'name' => __('Checkbox Active Background Color', 'wpfnl'),
513 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods-saveNew > input[type=checkbox]:checked + label:before, .wpfnl-checkout #mailpoet_woocommerce_checkout_optin_field #mailpoet_woocommerce_checkout_optin:checked',
514 'property' => 'background-color',
515 ],
516 [
517 'name' => __('Checkbox Tic Sign Color', 'wpfnl'),
518 'selector' => '.wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods-saveNew > label:after',
519 'property' => 'border-color',
520 ],
521 ]);
522
523 // Configure Typography for Payment Method Tooltip.
524 $payment_section->typographySection(
525 __('Payment Method Tooltip Typography', 'wpfnl'),
526 '.wpfnl-checkout .woocommerce-checkout #payment div.payment_box, .wpfnl-checkout .woocommerce-checkout #payment div.payment_box p',
527 $this
528 );
529 }
530
531 /**
532 * Configure the styling for the order button on the checkout page.
533 *
534 * @since 2.8.2
535 */
536 private function configure_order_button_style() {
537 // Add Control Section for Order Button Section.
538 $order_btn_section = $this->addControlSection('order_btn_section', __('Order Button Section', 'wpfnl'), 'assets/icon.png', $this);
539 $order_btn = '.wpfnl-checkout .woocommerce #payment #place_order';
540
541 // Configure Padding for Order Button.
542 $order_btn_section->addPreset('padding', 'order_btn_padding', __('Padding', 'wpfnl'), $order_btn)->whiteList();
543
544 // Configure Margin for Order Button.
545 $order_btn_section->addPreset('margin', 'order_btn_margin', __('Margin', 'wpfnl'), $order_btn)->whiteList();
546
547 // Configure Typography for Order Button.
548 $order_btn_section->typographySection(__('Typography', 'wpfnl'), $order_btn, $this);
549
550 // Configure Background Color for Order Button.
551 $order_btn_section->addStyleControls([
552 [
553 'name' => __('Background Color', 'wpfnl'),
554 'selector' => $order_btn,
555 'property' => 'background-color',
556 ],
557 ]);
558
559 // Configure Background Hover Color for Order Button.
560 $order_btn_section->addStyleControls([
561 [
562 'name' => __('Background Hover Color', 'wpfnl'),
563 'selector' => $order_btn . ':hover',
564 'property' => 'background-color',
565 ],
566 ]);
567
568 // Configure Text Hover Color for Order Button.
569 $order_btn_section->addStyleControls([
570 [
571 'name' => __('Text Hover Color', 'wpfnl'),
572 'selector' => $order_btn . ':hover',
573 'property' => 'color',
574 ],
575 ]);
576
577 // Configure Border Section for Order Button.
578 $order_btn_section->borderSection(__('Border', 'wpfnl'), $order_btn, $this);
579 }
580
581 /**
582 * Configure the styling for the coupon section on the checkout page.
583 *
584 * @since 2.8.2
585 */
586 private function configure_coupon_section_style() {
587 // Add Control Section for Coupon Section.
588 $coupon_section = $this->addControlSection('coupon_section', __('Coupon Section', 'wpfnl'), 'assets/icon.png', $this);
589 $coupon_toggle_box = '.wpfnl-checkout .woocommerce-form-coupon-toggle .woocommerce-info';
590
591 // Configure Padding for Coupon Toggle Box.
592 $coupon_section->addPreset('padding', 'coupon_toggle_box_padding', __('Coupon Toggle Box Padding', 'wpfnl'), $coupon_toggle_box)->whiteList();
593
594 // Configure Margin for Coupon Toggle Box.
595 $coupon_section->addPreset('margin', 'coupon_toggle_box_margin', __('Coupon Toggle Box Margin', 'wpfnl'), $coupon_toggle_box)->whiteList();
596
597 // Configure Background Color for Coupon Toggle Box.
598 $coupon_section->addStyleControls([
599 [
600 'name' => __('Coupon Toggle Box Background Color', 'wpfnl'),
601 'selector' => $coupon_toggle_box,
602 'property' => 'background-color',
603 ],
604 ]);
605
606 // Configure Link Color for Coupon Toggle Box.
607 $coupon_section->addStyleControls([
608 [
609 'name' => __('Coupon Toggle Box Link Color', 'wpfnl'),
610 'selector' => $coupon_toggle_box . ' a',
611 'property' => 'color',
612 ],
613 ]);
614
615 // Configure Typography for Coupon Toggle Box.
616 $coupon_section->typographySection(__('Coupon Toggle Box Typography', 'wpfnl'), $coupon_toggle_box, $this);
617
618 // Configure Border Section for Coupon Toggle Box.
619 $coupon_section->borderSection(__('Coupon Toggle Box Border', 'wpfnl'), $coupon_toggle_box, $this);
620
621 // Configure Coupon Form Style.
622 $coupon_form = '.wpfnl-checkout .checkout_coupon.woocommerce-form-coupon';
623
624 // Configure Padding for Coupon Form.
625 $coupon_section->addPreset('padding', 'coupon_form_padding', __('Coupon Form Padding', 'wpfnl'), $coupon_form)->whiteList();
626
627 // Configure Margin for Coupon Form.
628 $coupon_section->addPreset('margin', 'coupon_form_margin', __('Coupon Form Margin', 'wpfnl'), $coupon_form)->whiteList();
629
630 // Configure Background Color for Coupon Form.
631 $coupon_section->addStyleControls([
632 [
633 'name' => __('Coupon Form Background Color', 'wpfnl'),
634 'selector' => $coupon_form,
635 'property' => 'background-color',
636 ],
637 ]);
638
639 // Configure Typography for Coupon Form.
640 $coupon_section->typographySection(__('Coupon Form Typography', 'wpfnl'), $coupon_form . ' p:not(.form-row)', $this);
641
642 // Configure Border Section for Coupon Form.
643 $coupon_section->borderSection(__('Coupon Form Border', 'wpfnl'), $coupon_form, $this);
644
645 // Configure Coupon Input Field Style.
646 $coupon_input_field = '.wpfnl-checkout .checkout_coupon.woocommerce-form-coupon input.input-text';
647
648 // Configure Typography for Coupon Input Field.
649 $coupon_section->typographySection(__('Coupon Form Input Field Typography', 'wpfnl'), $coupon_input_field, $this);
650
651 // Configure Background Color for Coupon Input Field.
652 $coupon_section->addStyleControls([
653 [
654 'name' => __('Coupon Form Input Field Background Color', 'wpfnl'),
655 'selector' => $coupon_input_field,
656 'property' => 'background-color',
657 ],
658 ]);
659
660 // Configure Border Section for Coupon Input Field.
661 $coupon_section->borderSection(__('Coupon Form Input Field Border', 'wpfnl'), $coupon_input_field, $this);
662
663 // Configure Padding for Coupon Input Field.
664 $coupon_section->addPreset('padding', 'coupon_input_field_padding', __('Coupon Form Input Field Padding', 'wpfnl'), $coupon_input_field)->whiteList();
665
666 // Configure Coupon Button Style.
667 $coupon_btn = '.wpfnl-checkout .checkout_coupon.woocommerce-form-coupon button[type=submit]';
668
669 // Configure Padding for Coupon Button.
670 $coupon_section->addPreset('padding', 'coupon_btn_padding', __('Coupon Button Padding', 'wpfnl'), $coupon_btn)->whiteList();
671
672 // Configure Background Color for Coupon Button.
673 $coupon_section->addStyleControls([
674 [
675 'name' => __('Coupon Button Background Color', 'wpfnl'),
676 'selector' => $coupon_btn,
677 'property' => 'background-color',
678 ],
679 ]);
680
681 // Configure Hover Background Color for Coupon Button.
682 $coupon_section->addStyleControls([
683 [
684 'name' => __('Coupon Button Hover Background Color', 'wpfnl'),
685 'selector' => $coupon_btn . ':hover',
686 'property' => 'background-color',
687 ],
688 ]);
689
690 // Configure Hover Text Color for Coupon Button.
691 $coupon_section->addStyleControls([
692 [
693 'name' => __('Coupon Button Hover Text Color', 'wpfnl'),
694 'selector' => $coupon_btn . ':hover',
695 'property' => 'color',
696 ],
697 ]);
698
699 // Configure Typography for Coupon Button.
700 $coupon_section->typographySection(__('Coupon Button Typography', 'wpfnl'), $coupon_btn, $this);
701
702 // Configure Border Section for Coupon Button
703 $coupon_section->borderSection(__('Coupon Button Border', 'wpfnl'), $coupon_btn, $this);
704 }
705
706 /**
707 * Configure the styling for the multistep section on the checkout page.
708 *
709 * @since 2.8.2
710 */
711 private function configure_multistep_style() {
712 // Add Control Section for Multistep Section
713 $multistep_section = $this->addControlSection('multistep_section', __('Multistep Section', 'wpfnl'), 'assets/icon.png', $this);
714 $step_title = '.wpfnl-multistep .wpfnl-multistep-wizard li .step-title';
715
716 // Configure Typography for Step Title
717 $multistep_section->typographySection(__('Step Title Typography', 'wpfnl'), $step_title, $this);
718
719 // Configure Step Line Colors
720 $multistep_section->addStyleControls([
721 [
722 'name' => __('Step Normal Line Color', 'wpfnl'),
723 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard:before',
724 'property' => 'background-color',
725 ],
726 [
727 'name' => __('Step Active/Completed Line Color', 'wpfnl'),
728 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard > li.completed:before, .wpfnl-multistep .wpfnl-multistep-wizard > li.current:before',
729 'property' => 'background-color',
730 ],
731 ]);
732
733 // Configure Step Box Background Colors
734 $multistep_section->addStyleControls([
735 [
736 'name' => __('Step Box Normal Background Color', 'wpfnl'),
737 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-icon',
738 'property' => 'background-color',
739 ],
740 [
741 'name' => __('Step Box Active/Completed Background Color', 'wpfnl'),
742 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon, .wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon',
743 'property' => 'background-color',
744 ],
745 ]);
746
747 // Configure Step Box Icon Colors
748 $multistep_section->addStyleControls([
749 [
750 'name' => __('Step Box Icon Normal Color', 'wpfnl'),
751 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li .step-icon svg path',
752 'property' => 'fill',
753 ],
754 [
755 'name' => __('Step Box Icon Active/Completed Color', 'wpfnl'),
756 'selector' => '.wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon svg path, .wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon svg path',
757 'property' => 'fill',
758 ],
759 ]);
760
761 // Configure Step Box Borders
762 $multistep_section->borderSection(__('Step Box Border', 'wpfnl'), '.wpfnl-multistep .wpfnl-multistep-wizard li .step-icon', $this);
763 $multistep_section->borderSection(__('Step Box Active/Completed Border', 'wpfnl'), '.wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon, .wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon', $this);
764
765 // Add Control Section for Multistep Navigation
766 $multistep_section_navigation = $this->addControlSection('multistep_section_navigation', __('Multistep Navigation', 'wpfnl'), 'assets/icon.png', $this);
767 $multistep_nav = '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]';
768
769 // Configure Typography for Navigation Button
770 $multistep_section_navigation->typographySection(__('Navigation Button Typography', 'wpfnl'), $multistep_nav, $this);
771
772 // Configure Border Section for Navigation Button
773 $multistep_section_navigation->borderSection(__('Navigation Button Border', 'wpfnl'), $multistep_nav, $this);
774
775 // Configure Padding for Navigation Button
776 $multistep_section_navigation->addPreset('padding', 'multistep_nav_padding', __('Navigation Button Padding', 'wpfnl'), $multistep_nav)->whiteList();
777
778 // Configure Navigation Button Background Colors
779 $multistep_section_navigation->addStyleControls([
780 [
781 'name' => __('Navigation Button Background Color', 'wpfnl'),
782 'selector' => $multistep_nav,
783 'property' => 'background-color',
784 ],
785 [
786 'name' => __('Navigation Button Hover Background Color', 'wpfnl'),
787 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]:not(:disabled):hover',
788 'property' => 'background-color',
789 ],
790 ]);
791
792 // Configure Navigation Button Text and Border Colors on Hover
793 $multistep_section_navigation->addStyleControls([
794 [
795 'name' => __('Navigation Button Hover Color', 'wpfnl'),
796 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]:not(:disabled):hover',
797 'property' => 'color',
798 ],
799 [
800 'name' => __('Navigation Button Hover Border Color', 'wpfnl'),
801 'selector' => '.wpfnl-multistep .wpfnl-multistep-navigation button[type=button]:not(:disabled):hover',
802 'property' => 'border-color',
803 ],
804 ]);
805 }
806
807 function defaultCSS() {}
808 }