PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.11.1
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.11.1
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / includes / core / widgets / elementor / elements / checkout-widget.php

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

3,508 lines 145.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Checkout widgets
4 *
5 * @package
6 */
7 namespace WPFunnels\Widgets\Elementor;
8
9 use Elementor\Controls_Manager;
10 use Elementor\Group_Control_Background;
11 use Elementor\Group_Control_Border;
12 use Elementor\Group_Control_Box_Shadow;
13 use Elementor\Group_Control_Typography;
14 use Elementor\Widget_Base;
15 use WPFunnels\Wpfnl_functions;
16 use Elementor\Controls_Stack;
17 use WPFunnels\Modules\Frontend\Checkout\Wpfnl_Order_Bump_Rules;
18
19
20 if (!defined('ABSPATH')) {
21 exit;
22 } // Exit if accessed directly
23
24
25 /**
26 * Funnel sell accept button
27 *
28 * @since 1.0.0
29 */
30 class Checkout_Form extends Widget_Base
31 {
32
33 /**
34 * Register the widget controls.
35 *
36 * Adds different input fields to allow the user to change and Wpvrize the widget settings.
37 *
38 * @since 1.0.0
39 *
40 * @access protected
41 */
42 // public $hide_section_settings;
43 // $hide_section_settings = \WPFunnels\Wpfnl_functions::get_checkout_section_heading_settings( 'order' , get_the_ID() );
44
45 public function __construct( $data = [], $args = null ) {
46 parent::__construct( $data, $args );
47 add_action( 'woocommerce_checkout_update_order_review', array( $this, 'apply_place_order_filter_on_ajax_update' ) );
48 }
49
50 /**
51 * Fired during WooCommerce AJAX checkout update (update_order_review).
52 * Reads Place Order settings from post_meta and applies the button filter
53 * so the button is customized even during payment section re-renders.
54 *
55 * @param string $post_data URL-encoded post data string from the AJAX request.
56 */
57 public function apply_place_order_filter_on_ajax_update( $post_data ) {
58 $parsed = array();
59 wp_parse_str( $post_data, $parsed );
60 $checkout_id = isset( $parsed['_wpfunnels_checkout_id'] ) ? intval( $parsed['_wpfunnels_checkout_id'] ) : 0;
61 if ( ! $checkout_id ) {
62 $checkout_id = intval( \WPFunnels\Wpfnl_functions::get_checkout_id_from_post_data() );
63 }
64 if ( ! $checkout_id ) {
65 $checkout_id = intval( \WPFunnels\Wpfnl_functions::get_checkout_id_from_post( $_POST ) );
66 }
67 if ( ! $checkout_id ) {
68 return;
69 }
70 $settings = get_post_meta( $checkout_id, '_wpfnl_place_order_settings', true );
71 if ( empty( $settings ) || ! is_array( $settings ) ) {
72 return;
73 }
74 $place_order_filter = $this->get_place_order_button_filter( $settings );
75 add_filter( 'woocommerce_order_button_html', $place_order_filter );
76
77 $below_text = isset( $settings['placeOrderBelowText'] ) ? $settings['placeOrderBelowText'] : '';
78 if ( ! empty( $below_text ) ) {
79 add_action( 'woocommerce_review_order_after_submit', function() use ( $below_text ) {
80 echo '<div class="wpfnl-below-place-order-btn">' . wp_kses_post( $below_text ) . '</div>';
81 } );
82 }
83 }
84
85 /**
86 * Build and return the woocommerce_order_button_html filter closure.
87 *
88 * @param array $settings Widget settings / post meta array.
89 * @return \Closure
90 */
91 protected function get_place_order_button_filter( $settings ) {
92 $btn_text = isset( $settings['place_order_btn_text'] ) && '' !== $settings['place_order_btn_text'] ? $settings['place_order_btn_text'] : ( isset( $settings['placeOrderBtnText'] ) && '' !== $settings['placeOrderBtnText'] ? $settings['placeOrderBtnText'] : 'Place Order' );
93 $sub_text = isset( $settings['place_order_sub_text'] ) ? $settings['place_order_sub_text'] : ( isset( $settings['placeOrderSubText'] ) ? $settings['placeOrderSubText'] : '' );
94 $enable_icon = isset( $settings['place_order_enable_icon'] ) ? ( 'yes' === $settings['place_order_enable_icon'] ) : ( isset( $settings['placeOrderEnableIcon'] ) ? (bool) $settings['placeOrderEnableIcon'] : false );
95 $icon_style = isset( $settings['place_order_icon_style'] ) ? $settings['place_order_icon_style'] : ( isset( $settings['placeOrderIconStyle'] ) ? $settings['placeOrderIconStyle'] : 'lock1' );
96 $enable_price = isset( $settings['place_order_enable_price'] ) ? ( 'yes' === $settings['place_order_enable_price'] ) : ( isset( $settings['placeOrderEnablePrice'] ) ? (bool) $settings['placeOrderEnablePrice'] : false );
97
98 $icon_svgs = array(
99 'lock1' => '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" data-name="Layer 1" id="Layer_1" viewBox="0 0 128 128"><defs><style>.cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:8px;}</style></defs><title/><path class="cls-1" d="M40,53V35A24,24,0,0,1,64,11h0A24,24,0,0,1,88,35V45a8,8,0,0,1-8,8H36a8,8,0,0,0-8,8v46a8,8,0,0,0,8,8H92a8,8,0,0,0,8-8"/><path class="cls-1" d="M80,53H92a8,8,0,0,1,8,8v46"/><circle cx="64" cy="82" r="8"/></svg>',
100 'lock2' => '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 32 32"><g id="Layer_11" fill="currentColor" data-name="Layer 11"><path d="m24 11.57h-.53v-3.1a7.47 7.47 0 1 0 -14.94 0v3.1h-.53a4 4 0 0 0 -4 4v11.43a4 4 0 0 0 4 4h16a4 4 0 0 0 4-4v-11.43a4 4 0 0 0 -4-4zm-13.47-3.1a5.47 5.47 0 1 1 10.94 0v3.1h-10.94zm15.47 18.53a2 2 0 0 1 -2 2h-16a2 2 0 0 1 -2-2v-11.43a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"/><path d="m16 17.926a1.948 1.948 0 0 0 -1.354 3.348v2.371a1 1 0 0 0 1 1h.708a1 1 0 0 0 1-1v-2.371a1.948 1.948 0 0 0 -1.354-3.348z"/></g></svg>',
101 'cart1' => '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" id="Layer_1" enable-background="new 0 0 64 64" height="512" viewBox="0 0 64 64" width="512"><g><g><path d="m25.308 61.679c-3.514 0-6.373-2.859-6.373-6.373s2.859-6.372 6.373-6.372 6.373 2.858 6.373 6.372-2.859 6.373-6.373 6.373zm0-8.745c-1.308 0-2.373 1.064-2.373 2.372 0 1.309 1.064 2.373 2.373 2.373s2.373-1.064 2.373-2.373c0-1.308-1.064-2.372-2.373-2.372z"/><path d="m47.462 61.679c-3.514 0-6.372-2.859-6.372-6.373s2.858-6.372 6.372-6.372 6.373 2.858 6.373 6.372-2.86 6.373-6.373 6.373zm0-8.745c-1.308 0-2.372 1.064-2.372 2.372 0 1.309 1.064 2.373 2.372 2.373 1.309 0 2.373-1.064 2.373-2.373 0-1.308-1.065-2.372-2.373-2.372z"/></g><path d="m52.128 43.994h-31.419c-3.057 0-5.668-2.081-6.35-5.061l-6.521-28.477c-.086-.376-.346-.698-.696-.86l-5.409-2.507c-1.252-.58-1.797-2.066-1.217-3.319.58-1.252 2.067-1.797 3.319-1.217l5.409 2.507c1.743.807 3.04 2.407 3.468 4.28l6.521 28.479c.158.692.765 1.176 1.476 1.176h31.419c.708 0 1.314-.481 1.476-1.171l5.07-21.813c.145-.62-.119-1.071-.288-1.284-.17-.214-.55-.572-1.186-.572h-37c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5h37c1.999 0 3.857.897 5.101 2.462s1.696 3.579 1.244 5.526l-5.071 21.814c-.691 2.965-3.3 5.037-6.346 5.037z"/></g></svg>',
102 'checkout' => '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" xmlns:svg="http://www.w3.org/2000/svg" version="1.1" id="svg2001" xml:space="preserve" width="682.66669" height="682.66669" viewBox="0 0 682.66669 682.66669"><defs id="defs2005"><clipPath clipPathUnits="userSpaceOnUse" id="clipPath2015"><path d="M 0,512 H 512 V 0 H 0 Z" id="path2013"/></clipPath></defs><g id="g2007" transform="matrix(1.3333333,0,0,-1.3333333,0,682.66667)"><g id="g2009"><g id="g2011" clip-path="url(#clipPath2015)"><g id="g2017" transform="translate(106,406)"><path d="M 0,0 H 391 L 331,-210 H 60" style="fill:none;stroke:currentColor;stroke-width:30;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" id="path2019"/></g><g id="g2021" transform="translate(256,76)"><path d="m 0,0 c 0,-16.568 -13.432,-30 -30,-30 -16.568,0 -30,13.432 -30,30 0,16.568 13.432,30 30,30 C -13.432,30 0,16.568 0,0 Z" style="fill:none;stroke:currentColor;stroke-width:30;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" id="path2023"/></g><g id="g2025" transform="translate(407,76)"><path d="m 0,0 c 0,-16.568 -13.432,-30 -30,-30 -16.568,0 -30,13.432 -30,30 0,16.568 13.432,30 30,30 C -13.432,30 0,16.568 0,0 Z" style="fill:none;stroke:currentColor;stroke-width:30;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" id="path2027"/></g><g id="g2029" transform="translate(437,136)"><path d="m 0,0 h -252.459 c -22.301,0 -36.806,23.469 -26.833,43.417 L -271,60" style="fill:none;stroke:currentColor;stroke-width:30;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" id="path2031"/></g><g id="g2033" transform="translate(15,466)"><path d="M 0,0 H 73.861 C 99.402,-89.409 151,-270 151,-270" style="fill:none;stroke:currentColor;stroke-width:30;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1" id="path2035"/></g></g></g></g></svg>',
103 'arrow1' => '<svg width="24" height="24 xmlns="http://www.w3.org/2000/svg" fill="none" height="100" viewBox="0 0 100 100" width="100"><path clip-rule="evenodd" d="m51.2204 22.0537c1.6271-1.6272 4.2653-1.6272 5.8925 0l25 25c1.6272 1.6272 1.6272 4.2654 0 5.8926l-25 25c-1.6272 1.6271-4.2654 1.6271-5.8925 0-1.6272-1.6272-1.6272-4.2654 0-5.8926l17.887-17.8871h-48.2741c-2.3012 0-4.1667-1.8654-4.1667-4.1666s1.8655-4.1667 4.1667-4.1667h48.2741l-17.887-17.887c-1.6272-1.6272-1.6272-4.2654 0-5.8926z" fill="currentColor" fill-rule="evenodd"/></svg>',
104 'arrow2' => '<svg fill="currentColor" width="24" height="24" xmlns="http://www.w3.org/2000/svg" height="512" viewBox="0 0 24 24" width="512"><g id="_19" data-name="19"><path d="m12 19a1 1 0 0 1 -.71-1.71l5.3-5.29-5.3-5.29a1 1 0 0 1 1.41-1.41l6 6a1 1 0 0 1 0 1.41l-6 6a1 1 0 0 1 -.7.29z"/><path d="m6 19a1 1 0 0 1 -.71-1.71l5.3-5.29-5.3-5.29a1 1 0 0 1 1.42-1.42l6 6a1 1 0 0 1 0 1.41l-6 6a1 1 0 0 1 -.71.3z"/></g></svg>',
105 'arrow3' => '<svg fill="currentColor" width="24" height="24" xmlns="http://www.w3.org/2000/svg" height="512" viewBox="0 0 24 24" width="512"><g id="_15" data-name="15"><path d="m9 19a1 1 0 0 1 -.71-1.71l5.3-5.29-5.3-5.29a1 1 0 0 1 1.42-1.42l6 6a1 1 0 0 1 0 1.41l-6 6a1 1 0 0 1 -.71.3z"/></g></svg>',
106 );
107
108 return function( $button_html ) use ( $btn_text, $sub_text, $enable_icon, $icon_style, $enable_price, $icon_svgs ) {
109 $icon_html = '';
110 if ( $enable_icon ) {
111 $icon_svg = isset( $icon_svgs[ $icon_style ] ) ? $icon_svgs[ $icon_style ] : $icon_svgs['lock1'];
112 $icon_html = '<span class="wpfnl-place-order-icon">' . $icon_svg . '</span>';
113 }
114
115 $price_html = '';
116 if ( $enable_price && function_exists( 'WC' ) && is_object( WC()->cart ) ) {
117 $price_html = ' <span class="wpfnl-place-order-price">' . WC()->cart->get_total() . '</span>';
118 }
119
120 $sub_text_html = '';
121 if ( ! empty( $sub_text ) ) {
122 $sub_text_html = '<span class="wpfnl-place-order-sub-text">' . esc_html( $sub_text ) . '</span>';
123 }
124
125 $label = esc_html( $btn_text );
126 return '<button type="submit" class="button alt" name="woocommerce_checkout_place_order" id="place_order" value="' . $label . '" data-value="' . $label . '">'
127 . $icon_html
128 . '<span class="wpfnl-place-order-text">' . $label . '</span>'
129 . $price_html
130 . $sub_text_html
131 . '</button>';
132 };
133 }
134
135 protected function init_controls() {
136 if ( version_compare(ELEMENTOR_VERSION, '3.1.0', '>=') ) {
137 $this->register_controls();
138 } else {
139 $this->_register_controls();
140 }
141 }
142
143 /**
144 * Retrieve the widget name.
145 *
146 * @return string Widget name.
147 * @since 1.0.0
148 *
149 * @access public
150 */
151 public function get_name()
152 {
153 return 'wpfnl-checkout';
154 }
155
156 /**
157 * Retrieve the widget title.
158 *
159 * @return string Widget title.
160 * @since 1.0.0
161 *
162 * @access public
163 */
164 public function get_title()
165 {
166 return __('Checkout', 'wpfnl');
167 }
168
169 /**
170 * Retrieve the widget icon.
171 *
172 * @return string Widget icon.
173 * @since 1.0.0
174 *
175 * @access public
176 *order-bump-settings
177 */
178 public function get_icon()
179 {
180 return 'icon-wpfnl checkout-icon';
181 }
182
183 /**
184 * Retrieve the list of categories the widget belongs to.
185 *
186 * Used to determine where to display the widget in the editor.
187 *
188 * Note that currently Elementor supports only one category.
189 * When multiple categories passed, Elementor uses the first one.
190 *
191 * @return array Widget categories.
192 * @since 1.0.0
193 *
194 * @access public
195 */
196 public function get_categories()
197 {
198 return ['wp-funnel'];
199 }
200
201 /**
202 * Retrieve the list of scripts the widget depended on.
203 *
204 * Used to set scripts dependencies required to run the widget.
205 *
206 * @return array Widget scripts dependencies.
207 * @since 1.0.0
208 *
209 * @access public
210 */
211 public function get_script_depends()
212 {
213 return ['wpfnl-checkout-widget'];
214 }
215
216 /**
217 * Get all funnel steps
218 *
219 * @since 1.0.0
220 *
221 * @access protected
222 */
223 protected function get_steps_array($type = 'upsell')
224 {
225 $options = $this->get_prev_next_link_options();
226 $response = [];
227
228 if (isset($options[$type])) {
229 $prime_data = $options[$type];
230 foreach ($prime_data as $data) {
231 $response[$data['id']] = $data['title'];
232 }
233 }
234 return $response;
235 }
236
237 public function get_prev_next_link_options()
238 {
239 $associate_funnel_id = get_post_meta(get_the_ID(), '_funnel_id', true);
240 $steps_array = [
241 'upsell' => 'Upsell',
242 'downsell' => 'Downsell',
243 'thankyou' => 'Thankyou'
244 ];
245 $option_group = [];
246 foreach ($steps_array as $key => $value) {
247 $args = [
248 'posts_per_page' => -1,
249 'orderby' => 'date',
250 'order' => 'DESC',
251 'post_type' => WPFNL_STEPS_POST_TYPE,
252 'post_status' => 'publish',
253 'post__not_in' => [$this->get_id()],
254 'meta_query' => [
255 'relation' => 'AND',
256 [
257 'key' => '_step_type',
258 'value' => $key,
259 'compare' => '=',
260 ],
261 [
262 'key' => '_funnel_id',
263 'value' => $associate_funnel_id,
264 'compare' => '=',
265 ],
266 ],
267 ];
268 $query = new \WP_Query($args);
269 $steps = $query->posts;
270 if ($steps) {
271 foreach ($steps as $s) {
272 $option_group[$key][] = [
273 'id' => $s->ID,
274 'title' => $s->post_title,
275 ];
276 }
277 }
278 }
279 return $option_group;
280 }
281
282 /**
283 * Get all WC products
284 *
285 * @since 1.0.0
286 *
287 * @access protected
288 */
289 protected function get_products_array()
290 {
291 $products = [];
292 $ids = wc_get_products(['return' => 'ids', 'limit' => -1]);
293 if( !empty($ids) ){
294 foreach ($ids as $id) {
295 $title = get_the_title($id);
296 $products[$id] = $title ? $title : '';
297 }
298 }
299
300 return $products;
301 }
302
303 /**
304 * Order Bump Settings
305 *
306 * @since 1.0.0
307 *
308 * @access protected
309 */
310 protected function order_bump_primary_settings()
311 {
312 $default = [
313 ];
314
315 $settings = get_post_meta(get_the_ID(), 'order-bump-settings', true);
316
317 if ($settings) {
318 return $settings;
319 }
320
321 return $default;
322 }
323
324
325 /**
326 * Get layout types
327 *
328 * @return array
329 */
330 private function get_layout_types() {
331 $layouts = array(
332 'wpfnl-col-1' => __('1 Column Checkout', 'wpfnl'),
333 'wpfnl-col-2' => __('2 Column Checkout', 'wpfnl'),
334 'wpfnl-2-step' => __('2 Step Checkout', 'wpfnl'),
335 // 'wpfnl-multistep' => __('Multistep Checkout', 'wpfnl'),
336 'wpfnl-modern-multistep' => __('Modern Multistep Checkout', 'wpfnl'),
337 'wpfnl-express-checkout' => __('Express Checkout', 'wpfnl'),
338 'wpfnl-modern-checkout' => __('Modern Checkout', 'wpfnl'),
339 'wpfnl-modern-one-column' => __('Modern One Column Checkout', 'wpfnl'),
340 );
341 return $layouts;
342 }
343
344
345 /**
346 * Register cart controls controls.
347 *
348 * @since 1.0.0
349 * @access protected
350 */
351 protected function _register_controls()
352 {
353 $this->start_controls_section(
354 'section_content',
355 [
356 'label' => __('Layout Selection', 'wpfnl'),
357 ]
358 );
359
360 $this->add_control(
361 'checkout_layout',
362 [
363 'label' => __('Select Layout', 'wpfnl'),
364 'type' => \Elementor\Controls_Manager::SELECT,
365 'default' => 'wpfnl-col-2',
366 'label_block' => true,
367 'options' => $this->get_layout_types(),
368 ]
369 );
370
371 $this->add_control(
372 'checkout_floating_label',
373 [
374 'label' => __('Floating Label', 'wpfnl'),
375 'type' => \Elementor\Controls_Manager::SELECT,
376 'default' => '',
377 'label_block' => true,
378 'options' => array(
379 '' => __('Select option', 'wpfnl'),
380 'floating-label' => __('Floating Label', 'wpfnl'),
381 ),
382 'separator' => 'after'
383 ]
384 );
385
386 if ( ! Wpfnl_functions::is_wpfnl_pro_activated() ) {
387
388 $this->add_control(
389 'layout_upgrade_pro',
390 array(
391 'type' => Controls_Manager::RAW_HTML,
392 'raw' => sprintf( __( 'This is a pro feature. <a href="https://getwpfunnels.com/pricing/" target="_blank" rel="noopener">Upgrade Now!</a>.', 'wpfnl' )),
393 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
394 'condition' => array(
395 'checkout_layout' => ['wpfnl-multistep', 'wpfnl-express-checkout', 'wpfnl-2-step'],
396 ),
397 )
398 );
399 }
400
401 $this->end_controls_section();
402
403 $this->register_order_bump_controls();
404 $this->register_place_order_controls();
405
406 $this->register_billing_style_controls();
407 $this->register_shipping_style_controls();
408 $this->register_your_order_style_controls();
409 $this->register_payment_section_style_controls();
410 $this->register_coupon_style_controls();
411 $this->register_error_style_controls();
412 $this->register_multistep_style_controls();
413 }
414
415
416 /**
417 * Register cart controls controls.
418 *
419 * @since x.x.x
420 * @access protected
421 */
422 protected function register_controls()
423 {
424 $this->start_controls_section(
425 'section_content',
426 [
427 'label' => __('Layout Selection', 'wpfnl'),
428 ]
429 );
430
431 $this->add_control(
432 'checkout_layout',
433 [
434 'label' => __('Select Layout', 'wpfnl'),
435 'type' => \Elementor\Controls_Manager::SELECT,
436 'default' => 'wpfnl-col-2',
437 'label_block' => true,
438 'options' => $this->get_layout_types(),
439 ]
440 );
441
442 $this->add_control(
443 'checkout_floating_label',
444 [
445 'label' => __('Floating Label', 'wpfnl'),
446 'type' => \Elementor\Controls_Manager::SELECT,
447 'default' => '',
448 'label_block' => true,
449 'options' => array(
450 '' => __('Select option', 'wpfnl'),
451 'floating-label' => __('Floating Label', 'wpfnl'),
452 ),
453 'separator' => 'after'
454 ]
455 );
456
457 if ( ! Wpfnl_functions::is_wpfnl_pro_activated() ) {
458
459 $this->add_control(
460 'layout_upgrade_pro',
461 array(
462 'type' => Controls_Manager::RAW_HTML,
463 'raw' => sprintf( __( 'This is a pro feature. <a href="https://getwpfunnels.com/pricing/" target="_blank" rel="noopener">Upgrade Now!</a>.', 'wpfnl' ) ),
464 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning',
465 'condition' => array(
466 'checkout_layout' => ['wpfnl-multistep', 'wpfnl-express-checkout', 'wpfnl-2-step'],
467 ),
468 )
469 );
470 }
471
472 $this->end_controls_section();
473
474 $this->register_order_bump_controls();
475 $this->register_place_order_controls();
476
477 $this->register_billing_style_controls();
478 $this->register_shipping_style_controls();
479 $this->register_your_order_style_controls();
480 $this->register_payment_section_style_controls();
481 $this->register_coupon_style_controls();
482 $this->register_error_style_controls();
483 $this->register_multistep_style_controls();
484 }
485
486
487 /**
488 * Register Place Order Button Controls.
489 *
490 * @since x.x.x
491 * @access protected
492 */
493 protected function register_place_order_controls()
494 {
495 $this->start_controls_section(
496 'section_place_order',
497 [
498 'label' => __( 'Checkout Button', 'wpfnl' ),
499 ]
500 );
501
502 $this->add_control(
503 'place_order_btn_text',
504 [
505 'label' => __( 'Button Text', 'wpfnl' ),
506 'type' => Controls_Manager::TEXT,
507 'default' => __( 'Place Order', 'wpfnl' ),
508 'label_block' => true,
509 ]
510 );
511
512 $this->add_control(
513 'place_order_sub_text',
514 [
515 'label' => __( 'Button Sub Text', 'wpfnl' ),
516 'type' => Controls_Manager::TEXT,
517 'default' => '',
518 'label_block' => true,
519 ]
520 );
521
522 $this->add_control(
523 'place_order_enable_icon',
524 [
525 'label' => __( 'Enable Icon', 'wpfnl' ),
526 'type' => Controls_Manager::SWITCHER,
527 'default' => '',
528 ]
529 );
530
531 $this->add_control(
532 'place_order_icon_style',
533 [
534 'label' => __( 'Icon Style', 'wpfnl' ),
535 'type' => Controls_Manager::SELECT,
536 'default' => 'lock1',
537 'label_block' => true,
538 'options' => [
539 'lock1' => __( 'Lock (Filled)', 'wpfnl' ),
540 'lock2' => __( 'Lock (Outlined)', 'wpfnl' ),
541 'cart1' => __( 'Shopping Cart', 'wpfnl' ),
542 'checkout' => __( 'Checkmark', 'wpfnl' ),
543 'arrow1' => __( 'Arrow Right', 'wpfnl' ),
544 'arrow2' => __( 'Arrow Chevron', 'wpfnl' ),
545 'arrow3' => __( 'Arrow Down', 'wpfnl' ),
546 ],
547 'condition' => [
548 'place_order_enable_icon' => 'yes',
549 ],
550 ]
551 );
552
553 $this->add_control(
554 'place_order_enable_price',
555 [
556 'label' => __( 'Show Cart Total on Button', 'wpfnl' ),
557 'type' => Controls_Manager::SWITCHER,
558 'default' => '',
559 ]
560 );
561
562 $this->add_control(
563 'place_order_below_text',
564 [
565 'label' => __( 'Text Below Button', 'wpfnl' ),
566 'type' => Controls_Manager::WYSIWYG,
567 'default' => '',
568 'label_block' => true,
569 ]
570 );
571
572 $this->end_controls_section();
573 }
574
575 /**
576 * Register Order Bump Controls as a dedicated section.
577 *
578 * @since x.x.x
579 * @access protected
580 */
581 protected function register_order_bump_controls()
582 {
583 $ob_settings = $this->order_bump_primary_settings();
584 if ( empty( $ob_settings ) ) {
585 return;
586 }
587
588 $this->start_controls_section(
589 'section_order_bump',
590 [
591 'label' => __( 'Order Bump', 'wpfnl' ),
592 ]
593 );
594
595 $this->ob_register_control();
596
597 $this->end_controls_section();
598 }
599
600 private function ob_register_control(){
601 $ob_settings = $this->order_bump_primary_settings();
602 if( count($ob_settings) > 0 ){
603 foreach( $ob_settings as $key=>$settings ){
604 $key = (int) $key;
605 $index = ((int)($key) + 1);
606
607 $this->add_control(
608 'order_bump_'.$key,
609 [
610 'label' => sprintf( __("Enable Order bump %s", "wpfnl"),$index ), // phpcs:ignore
611 'type' => \Elementor\Controls_Manager::SELECT,
612 'default' => $settings['isEnabled'] ? 'yes' : 'no',
613 'options' => [
614 'yes' => __('Yes', 'wpfnl'),
615 'no' => __('No', 'wpfnl'),
616 ],
617 ]
618 );
619
620 $this->add_control(
621 'order_bump_position_'.$key,
622 [
623 'label' => sprintf( __( "Order bump %s Position", "wpfnl"), $index ), // phpcs:ignore
624 'type' => \Elementor\Controls_Manager::SELECT,
625 'default' => $ob_settings[$key]['position'],
626 'options' => [
627 'before-order' => __('Before Order Details', 'wpfnl'),
628 'after-order' => __('After Order Details', 'wpfnl'),
629 'before-checkout' => __('Before Checkout Details', 'wpfnl'),
630 'after-customer-details' => __('After Customer Details', 'wpfnl'),
631 'after-payment' => __('After Payment Options', 'wpfnl'),
632 'before-payment' => __('Before Payment Options', 'wpfnl'),
633 'popup' => __('Pop-up offer', 'wpfnl'),
634 ],
635 'label_block' => true,
636 'condition' => [
637 'order_bump_'.$key => 'yes',
638 ]
639 ]
640 );
641
642 }
643 }
644 }
645
646 /**
647 * Register Multistep style Controls.
648 *
649 * @since x.x.x
650 * @access protected
651 */
652 protected function register_multistep_style_controls()
653 {
654 $this->start_controls_section(
655 'section_multistep_style_fields',
656 [
657 'label' => __('Multistep Section', 'wpfnl'),
658 'tab' => Controls_Manager::TAB_STYLE,
659 'condition' => [
660 'checkout_layout' => ['wpfnl-multistep', 'wpfnl-express-checkout', 'wpfnl-2-step'],
661 ],
662 ]
663 );
664
665
666 // ----start step title style-----
667 $this->add_control(
668 'step_title_heading',
669 [
670 'label' => __('Step Title', 'wpfnl'),
671 'type' => Controls_Manager::HEADING,
672 'label_block' => true,
673 ]
674 );
675
676 $this->add_control(
677 'step_title_color',
678 [
679 'label' => __('Color', 'wpfnl'),
680 'type' => Controls_Manager::COLOR,
681 'default' => '#363B4E',
682 'selectors' => [
683 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li .step-title' => 'color: {{VALUE}};'
684 ],
685
686
687 ]
688 );
689
690 $this->add_group_control(
691 Group_Control_Typography::get_type(),
692 [
693 'name' => 'step_title_typography',
694 'label' => 'Typography',
695 'selector' => '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li .step-title',
696 ]
697 );
698
699 // ----start active step style-----
700 $this->add_control(
701 'hr2',
702 [
703 'type' => \Elementor\Controls_Manager::DIVIDER,
704 ]
705 );
706
707 $this->add_control(
708 'multistep_checkout_state',
709 [
710 'label' => __('Step State', 'wpfnl'),
711 'type' => Controls_Manager::HEADING,
712 'label_block' => true,
713 ]
714 );
715
716 $this->add_group_control(
717 \Elementor\Group_Control_Box_Shadow::get_type(),
718 [
719 'name' => 'step_box_shadow',
720 'label' => __( 'Box Shadow', 'wpfnl' ),
721 'selector' => '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li .step-icon',
722 ]
723 );
724
725 //----start normal tab style---
726 $this->start_controls_tabs('multistep_checkout_tab');
727 $this->start_controls_tab(
728 'multistep_checkout_normal',
729 [
730 'label' => __('Normal', 'wpfnl'),
731 ]
732 );
733
734 $this->add_control(
735 'step_normal_line_color',
736 [
737 'label' => __('Line Color', 'wpfnl'),
738 'type' => Controls_Manager::COLOR,
739 'default' => '#eee',
740 'selectors' => [
741 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard:before' => 'background-color: {{VALUE}};',
742 ],
743 ]
744 );
745
746 $this->add_control(
747 'step_normal_box_bgcolor',
748 [
749 'label' => __('Box Background Color', 'wpfnl'),
750 'type' => Controls_Manager::COLOR,
751 'default' => '#e8e8ed',
752 'selectors' => [
753 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li .step-icon' => 'background-color: {{VALUE}};',
754 ],
755 ]
756 );
757
758 $this->add_control(
759 'step_normal_icon_color',
760 [
761 'label' => __('Icon Color', 'wpfnl'),
762 'type' => Controls_Manager::COLOR,
763 'default' => '#6E42D3',
764 'selectors' => [
765 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li .step-icon svg path' => 'fill: {{VALUE}};',
766 ],
767 ]
768 );
769
770 $this->add_control(
771 'step_normal_box_border_style',
772 [
773 'label' => __('Border Style', 'wpfnl'),
774 'type' => Controls_Manager::SELECT,
775 'label_block' => false,
776 'default' => 'solid',
777 'options' => [
778 'inherit' => __('None', 'wpfnl'),
779 'solid' => __('Solid', 'wpfnl'),
780 'double' => __('Double', 'wpfnl'),
781 'dotted' => __('Dotted', 'wpfnl'),
782 'dashed' => __('Dashed', 'wpfnl'),
783 ],
784 'selectors' => [
785 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li .step-icon' => 'border-style: {{VALUE}};',
786 ],
787 ]
788 );
789
790 $this->add_control(
791 'step_normal_box_border_size',
792 [
793 'label' => __('Border Width', 'wpfnl'),
794 'type' => Controls_Manager::DIMENSIONS,
795 'size_units' => ['px'],
796 'selectors' => [
797 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li .step-icon' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
798 ],
799 'condition' => [
800 'step_normal_box_border_style!' => 'inherit',
801 ]
802 ]
803 );
804
805 $this->add_control(
806 'step_normal_box_border_color',
807 [
808 'label' => __('Border Color', 'wpfnl'),
809 'type' => Controls_Manager::COLOR,
810 'default' => '#ffffff',
811 'selectors' => [
812 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li .step-icon' => 'border-color: {{VALUE}};',
813 ],
814 'condition' => [
815 'step_normal_box_border_style!' => 'inherit',
816 ]
817
818 ]
819 );
820
821 $this->end_controls_tab();
822 //----end normal tab style---
823
824 //----active/completed tab style---
825 $this->start_controls_tab(
826 'multistep_checkout_active',
827 [
828 'label' => __('Active / Completed', 'wpfnl'),
829 ]
830 );
831
832 $this->add_control(
833 'step_active_line_color',
834 [
835 'label' => __('Line Color', 'wpfnl'),
836 'type' => Controls_Manager::COLOR,
837 'default' => '#6E42D3',
838 'selectors' => [
839 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard > li.completed:before,
840 {{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard > li.current:before' => 'background-color: {{VALUE}};',
841 ],
842 ]
843 );
844
845 $this->add_control(
846 'step_active_box_bgcolor',
847 [
848 'label' => __('Box Background Color', 'wpfnl'),
849 'type' => Controls_Manager::COLOR,
850 'default' => '#6E42D3',
851 'selectors' => [
852 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon,
853 {{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon' => 'background-color: {{VALUE}};',
854 ],
855 ]
856 );
857
858 $this->add_control(
859 'step_active_icon_color',
860 [
861 'label' => __('Icon Color', 'wpfnl'),
862 'type' => Controls_Manager::COLOR,
863 'default' => '#ffffff',
864 'selectors' => [
865 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon svg path,
866 {{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon svg path' => 'fill: {{VALUE}};',
867 ],
868 ]
869 );
870
871 $this->add_control(
872 'step_active_box_border_style',
873 [
874 'label' => __('Border Style', 'wpfnl'),
875 'type' => Controls_Manager::SELECT,
876 'label_block' => false,
877 'default' => 'solid',
878 'options' => [
879 'inherit' => __('None', 'wpfnl'),
880 'solid' => __('Solid', 'wpfnl'),
881 'double' => __('Double', 'wpfnl'),
882 'dotted' => __('Dotted', 'wpfnl'),
883 'dashed' => __('Dashed', 'wpfnl'),
884 ],
885 'selectors' => [
886 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon,
887 {{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon' => 'border-style: {{VALUE}};',
888 ],
889 ]
890 );
891
892 $this->add_control(
893 'step_active_box_border_size',
894 [
895 'label' => __('Border Width', 'wpfnl'),
896 'type' => Controls_Manager::DIMENSIONS,
897 'size_units' => ['px'],
898 'selectors' => [
899 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon,
900 {{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
901 ],
902 'condition' => [
903 'step_active_box_border_style!' => 'inherit',
904 ]
905 ]
906 );
907
908 $this->add_control(
909 'step_active_box_border_color',
910 [
911 'label' => __('Border Color', 'wpfnl'),
912 'type' => Controls_Manager::COLOR,
913 'default' => '#6E42D3',
914 'selectors' => [
915 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li.completed .step-icon,
916 {{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-wizard li.current .step-icon' => 'border-color: {{VALUE}};',
917 ],
918 'condition' => [
919 'step_active_box_border_style!' => 'inherit',
920 ]
921
922 ]
923 );
924
925 $this->end_controls_tab();
926 $this->end_controls_tabs();
927 // ----end active step style-----
928
929
930 // ----start navigation button style-----
931 $this->add_control(
932 'hr3',
933 [
934 'type' => \Elementor\Controls_Manager::DIVIDER,
935 ]
936 );
937
938 $this->add_control(
939 'step_navigation_btn',
940 [
941 'label' => __('Navigation Button', 'wpfnl'),
942 'type' => Controls_Manager::HEADING,
943 'label_block' => true,
944 ]
945 );
946
947 //----start normal tab style---
948 $this->start_controls_tabs('step_navigation_btn_tab');
949 $this->start_controls_tab(
950 'step_navigation_btn_normal',
951 [
952 'label' => __('Normal', 'wpfnl'),
953 ]
954 );
955
956 $this->add_control(
957 'step_navigation_btn_color',
958 [
959 'label' => __('Color', 'wpfnl'),
960 'type' => Controls_Manager::COLOR,
961 'default' => '',
962 'selectors' => [
963 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-navigation button[type=button]' => 'color: {{VALUE}}!important;',
964 ],
965 ]
966 );
967
968 $this->add_control(
969 'step_navigation_btn_bgcolor',
970 [
971 'label' => __('Background Color', 'wpfnl'),
972 'type' => Controls_Manager::COLOR,
973 'default' => '',
974 'selectors' => [
975 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-navigation button[type=button]' => 'background-color: {{VALUE}}!important;',
976 ],
977 ]
978 );
979
980 $this->end_controls_tab();
981 //----end normal tab style---
982
983 //----hover tab style---
984 $this->start_controls_tab(
985 'step_navigation_btn_hover',
986 [
987 'label' => __('Hover', 'wpfnl'),
988 ]
989 );
990
991 $this->add_control(
992 'step_navigation_btn_hover_color',
993 [
994 'label' => __('Color', 'wpfnl'),
995 'type' => Controls_Manager::COLOR,
996 'default' => '',
997 'selectors' => [
998 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-navigation button[type=button]:not(:disabled):hover' => 'color: {{VALUE}}!important;',
999 ],
1000 ]
1001 );
1002
1003 $this->add_control(
1004 'step_navigation_btn_hover_bgcolor',
1005 [
1006 'label' => __('Background Color', 'wpfnl'),
1007 'type' => Controls_Manager::COLOR,
1008 'default' => '',
1009 'selectors' => [
1010 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-navigation button[type=button]:not(:disabled):hover' => 'background-color: {{VALUE}}!important;',
1011 ],
1012 ]
1013 );
1014
1015 $this->end_controls_tab();
1016 $this->end_controls_tabs();
1017 // ----end hover step style-----
1018
1019 $this->add_group_control(
1020 Group_Control_Typography::get_type(),
1021 [
1022 'name' => 'step_navigation_btn_typography',
1023 'label' => 'Typography',
1024 'selector' => '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-navigation button[type=button]',
1025 ]
1026 );
1027
1028 $this->add_responsive_control(
1029 'step_navigation_btn_padding',
1030 [
1031 'label' => __('Padding', 'wpfnl'),
1032 'type' => Controls_Manager::DIMENSIONS,
1033 'size_units' => ['px', 'em', '%'],
1034 'selectors' => [
1035 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-navigation button[type=button]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1036 ],
1037 ]
1038 );
1039
1040 $this->add_responsive_control(
1041 'step_navigation_btn_radius',
1042 [
1043 'label' => __('Radius', 'wpfnl'),
1044 'type' => Controls_Manager::DIMENSIONS,
1045 'size_units' => ['px', 'em', '%'],
1046 'selectors' => [
1047 '{{WRAPPER}} .wpfnl-multistep .wpfnl-multistep-navigation button[type=button]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1048 ],
1049 ]
1050 );
1051
1052 $this->end_controls_section();
1053 }
1054
1055 /**
1056 * Register Sections error Controls.
1057 *
1058 * @since x.x.x
1059 * @access protected
1060 */
1061 protected function register_error_style_controls()
1062 {
1063 $this->start_controls_section(
1064 'section_error_style_fields',
1065 [
1066 'label' => __('Field Validation & Error Messages', 'wpfnl'),
1067 'tab' => Controls_Manager::TAB_STYLE,
1068 ]
1069 );
1070
1071 $this->add_control(
1072 'error_fields_text',
1073 [
1074 'label' => __('Field Validation', 'wpfnl'),
1075 'type' => Controls_Manager::HEADING,
1076 'label_block' => true,
1077 ]
1078 );
1079
1080 $this->add_control(
1081 'error_label_color',
1082 [
1083 'label' => __('Label Color', 'wpfnl'),
1084 'type' => Controls_Manager::COLOR,
1085 'default' => '',
1086 'selectors' => [
1087 '{{WRAPPER}} .woocommerce form .form-row.woocommerce-invalid label' => 'color: {{VALUE}};',
1088 ],
1089 ]
1090 );
1091
1092 $this->add_control(
1093 'error_field_border_color',
1094 [
1095 'label' => __('Field Border Color', 'wpfnl'),
1096 'type' => Controls_Manager::COLOR,
1097 'selectors' => [
1098 '{{WRAPPER}} .wpfunnels-checkout-form .select2-container--default.field-required .select2-selection--single,
1099 {{WRAPPER}} form .form-row input.input-text.field-required,
1100 {{WRAPPER}} form .form-row textarea.input-text.field-required,
1101 {{WRAPPER}} #order_review .input-text.field-required
1102 {{WRAPPER}} form .form-row.woocommerce-invalid .select2-container,
1103 {{WRAPPER}} form .form-row.woocommerce-invalid input.input-text,
1104 {{WRAPPER}} form .form-row.woocommerce-invalid select' => 'border-color: {{VALUE}};',
1105
1106 ],
1107 'separator' => 'after',
1108 ]
1109 );
1110
1111 $this->add_control(
1112 'error_fields_section',
1113 [
1114 'label' => __('Error Messages', 'wpfnl'),
1115 'type' => Controls_Manager::HEADING,
1116 'label_block' => true,
1117 ]
1118 );
1119
1120 $this->add_control(
1121 'error_text_color',
1122 [
1123 'label' => __('Error Message Color', 'wpfnl'),
1124 'type' => Controls_Manager::COLOR,
1125 'default' => '',
1126 'selectors' => [
1127 '{{WRAPPER}} .woocommerce-error,
1128 {{WRAPPER}} .woocommerce-NoticeGroup .woocommerce-error,
1129 {{WRAPPER}} .woocommerce-notices-wrapper .woocommerce-error' => 'color: {{VALUE}};',
1130 ],
1131 ]
1132 );
1133
1134 $this->add_control(
1135 'error_bg_color',
1136 [
1137 'label' => __('Background Color', 'wpfnl'),
1138 'type' => Controls_Manager::COLOR,
1139 'selectors' => [
1140 '{{WRAPPER}} .woocommerce-error,
1141 {{WRAPPER}} .woocommerce-NoticeGroup .woocommerce-error,
1142 {{WRAPPER}} .woocommerce-notices-wrapper .woocommerce-error' => 'background-color: {{VALUE}};',
1143 ],
1144 ]
1145 );
1146
1147 $this->add_control(
1148 'error_border_color',
1149 [
1150 'label' => __('Border Color', 'wpfnl'),
1151 'type' => Controls_Manager::COLOR,
1152 'selectors' => [
1153 '{{WRAPPER}} .woocommerce-error,
1154 {{WRAPPER}} .woocommerce-NoticeGroup .woocommerce-error,
1155 {{WRAPPER}} .woocommerce-notices-wrapper .woocommerce-error' => 'border-color: {{VALUE}};',
1156 '{{WRAPPER}} .woocommerce-error::before' => 'color: {{VALUE}};',
1157
1158 ],
1159 ]
1160 );
1161
1162 $this->end_controls_section();
1163 }
1164
1165 /**
1166 * Register Sections Style Controls.
1167 *
1168 * @since x.x.x
1169 * @access protected
1170 */
1171 protected function register_payment_section_style_controls()
1172 {
1173 $this->start_controls_section(
1174 'section_payment_style_fields',
1175 [
1176 'label' => __('Payment Section', 'wpfnl'),
1177 'tab' => Controls_Manager::TAB_STYLE,
1178 ]
1179 );
1180
1181 $this->add_control(
1182 'payment_section_text_color',
1183 [
1184 'label' => __('Text Color', 'wpfnl'),
1185 'type' => Controls_Manager::COLOR,
1186 'default' => '',
1187 'selectors' => [
1188 '{{WRAPPER}} .wpfnl-checkout #payment .place-order,
1189 {{WRAPPER}} .wpfnl-checkout #payment .place-order p' => 'color: {{VALUE}};',
1190 ],
1191 ]
1192 );
1193
1194 $this->add_control(
1195 'payment_section_link_color',
1196 [
1197 'label' => __('Link Color', 'wpfnl'),
1198 'type' => Controls_Manager::COLOR,
1199 'default' => '',
1200 'selectors' => [
1201 '{{WRAPPER}} .wpfnl-checkout #payment .place-order a' => 'color: {{VALUE}};',
1202 ],
1203 ]
1204 );
1205
1206 $this->add_control(
1207 'payment_section_bg_color',
1208 [
1209 'label' => __('Background Color', 'wpfnl'),
1210 'type' => Controls_Manager::COLOR,
1211 'selectors' => [
1212 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment' => 'background-color: {{VALUE}};',
1213 ],
1214 ]
1215 );
1216
1217 $this->add_group_control(
1218 Group_Control_Typography::get_type(),
1219 [
1220 'name' => 'payment_section_typography',
1221 'label' => 'Typography',
1222 'selector' => '{{WRAPPER}} .wpfnl-checkout #payment .place-order,
1223 {{WRAPPER}} .wpfnl-checkout #payment .place-order p',
1224 ]
1225 );
1226
1227 $this->add_responsive_control(
1228 'payment_section_radius',
1229 [
1230 'label' => __('Radius', 'wpfnl'),
1231 'type' => Controls_Manager::DIMENSIONS,
1232 'size_units' => ['px', 'em', '%'],
1233 'selectors' => [
1234 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1235 ],
1236 'separator' => 'after',
1237 ]
1238 );
1239
1240 // ----Payment Method style-----
1241 $this->add_control(
1242 'payment_method_heading_style',
1243 [
1244 'label' => __('Payment Method Style', 'wpfnl'),
1245 'type' => Controls_Manager::HEADING,
1246 'label_block' => true,
1247 ]
1248 );
1249
1250 $this->add_group_control(
1251 Group_Control_Typography::get_type(),
1252 [
1253 'name' => 'payment_method_typography',
1254 'label' => 'Typography',
1255 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods li,
1256 {{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1257 ]
1258 );
1259
1260 $this->add_control(
1261 'payment_method_color',
1262 [
1263 'label' => __('Color', 'wpfnl'),
1264 'type' => Controls_Manager::COLOR,
1265 'default' => '',
1266 'selectors' => [
1267 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods li' => 'color: {{VALUE}};',
1268 ],
1269 ]
1270 );
1271
1272 $this->add_control(
1273 'payment_method_bg_color',
1274 [
1275 'label' => __('Background Color', 'wpfnl'),
1276 'type' => Controls_Manager::COLOR,
1277 'selectors' => [
1278 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods' => 'background-color: {{VALUE}};',
1279 ],
1280 'separator' => 'after'
1281
1282 ]
1283 );
1284
1285 $this->add_control(
1286 'payment_method_radio_default_color',
1287 [
1288 'label' => __('Radio Button Default Color', 'wpfnl'),
1289 'type' => Controls_Manager::COLOR,
1290 'default' => '',
1291 'selectors' => [
1292 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > label:before,
1293 {{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > label:before' => 'border-color: {{VALUE}};',
1294 ],
1295 ]
1296 );
1297
1298 $this->add_control(
1299 'payment_method_radio_color',
1300 [
1301 'label' => __('Radio Button Active Color', 'wpfnl'),
1302 'type' => Controls_Manager::COLOR,
1303 'default' => '',
1304 'selectors' => [
1305 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > input[type=radio]:checked + label:before,
1306 {{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > input[type=radio]:checked + label:before' => 'border-color: {{VALUE}};',
1307
1308 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods > li > input[type=radio]:checked + label:after,
1309 {{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods > li > input[type=radio]:checked + label:after' => 'background-color: {{VALUE}};',
1310 ],
1311 'separator' => 'after'
1312 ]
1313 );
1314
1315 $this->add_control(
1316 'saved_payment_checkbox_default_color',
1317 [
1318 'label' => __('Checkbox Default Color', 'wpfnl'),
1319 'type' => Controls_Manager::COLOR,
1320 'default' => '',
1321 'selectors' => [
1322 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods-saveNew > label:before,
1323 {{WRAPPER}} .wpfnl-checkout #mailpoet_woocommerce_checkout_optin_field #mailpoet_woocommerce_checkout_optin' => 'border-color: {{VALUE}};',
1324 ],
1325 ]
1326 );
1327
1328 $this->add_control(
1329 'saved_payment_checkbox_color',
1330 [
1331 'label' => __('Checkbox Active Color', 'wpfnl'),
1332 'type' => Controls_Manager::COLOR,
1333 'default' => '',
1334 'selectors' => [
1335 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods-saveNew > input[type=checkbox]:checked + label:before,
1336 {{WRAPPER}} .wpfnl-checkout #mailpoet_woocommerce_checkout_optin_field #mailpoet_woocommerce_checkout_optin:checked' => 'background-color: {{VALUE}}; border-color: {{VALUE}};',
1337 ],
1338 ]
1339 );
1340
1341 $this->add_control(
1342 'saved_payment_checkbox_tic_color',
1343 [
1344 'label' => __('Checkbox Tic Sign Color', 'wpfnl'),
1345 'type' => Controls_Manager::COLOR,
1346 'default' => '',
1347 'selectors' => [
1348 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment .woocommerce-SavedPaymentMethods-saveNew > label:after' => 'border-color: {{VALUE}};',
1349 ],
1350 'separator' => 'after'
1351 ]
1352 );
1353
1354
1355 $this->add_control(
1356 'payment_method_border_style',
1357 [
1358 'label' => __('Border Style', 'wpfnl'),
1359 'type' => Controls_Manager::SELECT,
1360 'label_block' => false,
1361 'default' => '',
1362 'options' => [
1363 '' => __('Inherit', 'wpfnl'),
1364 'solid' => __('Solid', 'wpfnl'),
1365 'double' => __('Double', 'wpfnl'),
1366 'dotted' => __('Dotted', 'wpfnl'),
1367 'dashed' => __('Dashed', 'wpfnl'),
1368 ],
1369 'selectors' => [
1370 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods' => 'border-style: {{VALUE}};',
1371 ],
1372 ]
1373 );
1374
1375 $this->add_control(
1376 'payment_method_border_size',
1377 [
1378 'label' => __('Border Width', 'wpfnl'),
1379 'type' => Controls_Manager::DIMENSIONS,
1380 'size_units' => ['px'],
1381 'selectors' => [
1382 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1383 ],
1384 ]
1385 );
1386
1387 $this->add_control(
1388 'payment_method_border_color',
1389 [
1390 'label' => __('Border Color', 'wpfnl'),
1391 'type' => Controls_Manager::COLOR,
1392 'selectors' => [
1393 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods' => 'border-color: {{VALUE}};',
1394 ],
1395
1396 ]
1397 );
1398
1399 $this->add_responsive_control(
1400 'payment_method_radius',
1401 [
1402 'label' => __('Radius', 'wpfnl'),
1403 'type' => Controls_Manager::DIMENSIONS,
1404 'size_units' => ['px', 'em', '%'],
1405 'selectors' => [
1406 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1407 ],
1408 ]
1409 );
1410
1411 $this->add_responsive_control(
1412 'payment_method_padding',
1413 [
1414 'label' => __('Padding', 'wpfnl'),
1415 'type' => Controls_Manager::DIMENSIONS,
1416 'size_units' => ['px', 'em', '%'],
1417 'selectors' => [
1418 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1419 ],
1420 ]
1421 );
1422
1423 $this->add_responsive_control(
1424 'payment_method_margin',
1425 [
1426 'label' => __('Margin', 'wpfnl'),
1427 'type' => Controls_Manager::DIMENSIONS,
1428 'size_units' => ['px', 'em', '%'],
1429 'selectors' => [
1430 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment ul.payment_methods' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1431 ],
1432 'separator' => 'after',
1433 ]
1434 );
1435
1436 // ----Payment Box style-----
1437 $this->add_control(
1438 'payment_box_heading_style',
1439 [
1440 'label' => __('Payment Box Style', 'wpfnl'),
1441 'type' => Controls_Manager::HEADING,
1442 'label_block' => true,
1443 ]
1444 );
1445
1446 $this->add_control(
1447 'payment_box_txt_color',
1448 [
1449 'label' => __('Text Color', 'wpfnl'),
1450 'type' => Controls_Manager::COLOR,
1451 'default' => '',
1452 'selectors' => [
1453 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment div.payment_box' => 'color: {{VALUE}};',
1454 ],
1455 ]
1456 );
1457
1458 $this->add_control(
1459 'payment_box_bg_color',
1460 [
1461 'label' => __('Background Color', 'wpfnl'),
1462 'type' => Controls_Manager::COLOR,
1463 'selectors' => [
1464 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment div.payment_box' => 'background-color: {{VALUE}};',
1465 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment div.payment_box:before' => 'border-bottom-color: {{VALUE}};',
1466 ],
1467
1468 ]
1469 );
1470 $this->add_group_control(
1471 Group_Control_Typography::get_type(),
1472 [
1473 'name' => 'payment_box_typography',
1474 'label' => 'Typography',
1475 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment div.payment_box',
1476 ]
1477 );
1478 $this->add_responsive_control(
1479 'payment_box_radius',
1480 [
1481 'label' => __('Radius', 'wpfnl'),
1482 'type' => Controls_Manager::DIMENSIONS,
1483 'size_units' => ['px', 'em', '%'],
1484 'selectors' => [
1485 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment div.payment_box' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1486 ],
1487 ]
1488 );
1489
1490 $this->add_responsive_control(
1491 'payment_box_padding',
1492 [
1493 'label' => __('Padding', 'wpfnl'),
1494 'type' => Controls_Manager::DIMENSIONS,
1495 'size_units' => ['px', 'em', '%'],
1496 'selectors' => [
1497 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment div.payment_box' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1498 ],
1499 ]
1500 );
1501
1502 $this->add_responsive_control(
1503 'payment_box_margin',
1504 [
1505 'label' => __('Margin', 'wpfnl'),
1506 'type' => Controls_Manager::DIMENSIONS,
1507 'size_units' => ['px', 'em', '%'],
1508 'selectors' => [
1509 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #payment div.payment_box' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1510 ],
1511 'separator' => 'after',
1512 ]
1513 );
1514
1515
1516 // ----Order Button style-----
1517 $this->add_control(
1518 'order_button_heading_style',
1519 [
1520 'label' => __('Order Button Style', 'wpfnl'),
1521 'type' => Controls_Manager::HEADING,
1522 'label_block' => true,
1523 ]
1524 );
1525
1526 $this->add_group_control(
1527 Group_Control_Typography::get_type(),
1528 [
1529 'name' => 'order_button_typography',
1530 'label' => 'Typography',
1531 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce #payment #place_order',
1532 ]
1533 );
1534
1535 $this->start_controls_tabs('order_button_tab');
1536 $this->start_controls_tab(
1537 'order_button_normal',
1538 [
1539 'label' => __('Normal', 'wpfnl'),
1540 ]
1541 );
1542
1543 $this->add_control(
1544 'order_button_color',
1545 [
1546 'label' => __('Color', 'wpfnl'),
1547 'type' => Controls_Manager::COLOR,
1548 'default' => '',
1549 'selectors' => [
1550 '{{WRAPPER}} .wpfnl-checkout .woocommerce #payment #place_order' => 'color: {{VALUE}};',
1551 ],
1552 ]
1553 );
1554
1555 $this->add_control(
1556 'order_button_bg_color',
1557 [
1558 'label' => __('Background Color', 'wpfnl'),
1559 'type' => Controls_Manager::COLOR,
1560 'selectors' => [
1561 '{{WRAPPER}} .wpfnl-checkout .woocommerce #payment #place_order' => 'background-color: {{VALUE}};',
1562 ],
1563
1564 ]
1565 );
1566
1567 $this->add_group_control(
1568 Group_Control_Box_Shadow::get_type(),
1569 [
1570 'name' => 'order_button_box_shadow',
1571 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce #payment #place_order',
1572 ]
1573 );
1574 $this->end_controls_tab();
1575
1576 //----hover style---
1577 $this->start_controls_tab(
1578 'order_button_button_hover',
1579 [
1580 'label' => __('Hover', 'wpfnl'),
1581 ]
1582 );
1583
1584 $this->add_control(
1585 'order_button_color_hover',
1586 [
1587 'label' => __('Color', 'wpfnl'),
1588 'type' => Controls_Manager::COLOR,
1589 'default' => '',
1590 'selectors' => [
1591 '{{WRAPPER}} .wpfnl-checkout .woocommerce #payment #place_order:hover' => 'color: {{VALUE}};',
1592 ],
1593 ]
1594 );
1595
1596 $this->add_control(
1597 'order_button_bg_color_hover',
1598 [
1599 'label' => __('Background Color', 'wpfnl'),
1600 'type' => Controls_Manager::COLOR,
1601 'selectors' => [
1602 '{{WRAPPER}} .wpfnl-checkout .woocommerce #payment #place_order:hover' => 'background-color: {{VALUE}};',
1603 ],
1604 ]
1605 );
1606
1607 $this->add_group_control(
1608 Group_Control_Box_Shadow::get_type(),
1609 [
1610 'name' => 'order_button_box_shadow_hover',
1611 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce #payment #place_order:hover',
1612 ]
1613 );
1614 $this->end_controls_tab();
1615 $this->end_controls_tabs();
1616 //-----------------------
1617
1618 $this->add_responsive_control(
1619 'order_button_radius',
1620 [
1621 'label' => __('Radius', 'wpfnl'),
1622 'type' => Controls_Manager::DIMENSIONS,
1623 'size_units' => ['px', 'em', '%'],
1624 'selectors' => [
1625 '{{WRAPPER}} .wpfnl-checkout .woocommerce #payment #place_order' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1626 ],
1627 'separator' => 'before',
1628 ]
1629 );
1630
1631 $this->add_responsive_control(
1632 'order_button_padding',
1633 [
1634 'label' => __('Padding', 'wpfnl'),
1635 'type' => Controls_Manager::DIMENSIONS,
1636 'size_units' => ['px', 'em', '%'],
1637 'selectors' => [
1638 '{{WRAPPER}} .wpfnl-checkout .woocommerce #payment #place_order' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1639 ],
1640 ]
1641 );
1642
1643 $this->add_responsive_control(
1644 'order_button_margin',
1645 [
1646 'label' => __('Margin', 'wpfnl'),
1647 'type' => Controls_Manager::DIMENSIONS,
1648 'size_units' => ['px', 'em', '%'],
1649 'selectors' => [
1650 '{{WRAPPER}} .wpfnl-checkout .woocommerce #payment #place_order' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1651 ],
1652 'separator' => 'after',
1653 ]
1654 );
1655
1656 $this->end_controls_section();
1657 }
1658
1659 /**
1660 * Register General Style Controls.
1661 *
1662 * @since x.x.x
1663 * @access protected
1664 */
1665 protected function register_global_style_controls()
1666 {
1667 $this->start_controls_section(
1668 'section_general_style_fields',
1669 [
1670 'label' => __('Global', 'wpfnl'),
1671 'tab' => Controls_Manager::TAB_STYLE,
1672 ]
1673 );
1674
1675 $this->add_control(
1676 'global_primary_color',
1677 [
1678 'label' => __('Primary Color', 'wpfnl'),
1679 'type' => Controls_Manager::COLOR,
1680 'default' => '',
1681 'selectors' => [
1682 '{{WRAPPER}} .woocommerce-checkout .product-name .remove:hover,
1683 {{WRAPPER}} #payment input[type=checkbox]:checked:before,
1684 {{WRAPPER}} .woocommerce-shipping-fields [type="checkbox"]:checked:before,
1685 {{WRAPPER}} -info::before,
1686 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-message::before,
1687 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce a,
1688 {{WRAPPER}} .wpfunnels-checkout-form-two-step .wpfunnels-checkout-form-steps .wpfunnels-current .step-name,
1689 body .wpfunnels-pre-checkout-offer-wrapper .wpfunnels-content-main-head .wpfunnels-content-modal-title .wpfunnels_first_name' => 'color: {{VALUE}};',
1690
1691 '{{WRAPPER}} .wpfunnels-checkout-form .woocommerce .woocommerce-checkout .product-name .remove:hover,
1692 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #payment input[type=checkbox]:focus,
1693 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce .woocommerce-shipping-fields [type="checkbox"]:focus,
1694 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #payment input[type=radio]:checked:focus,
1695 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #payment input[type=radio]:not(:checked):focus,
1696 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button,
1697 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
1698 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button.wpfunnels-btn-small,
1699 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
1700 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.checkout_coupon .button,
1701 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.login .button:hover,
1702 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.checkout_coupon .button:hover,
1703 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #payment #place_order:hover,
1704 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button.wpfunnels-btn-small:hover,
1705 {{WRAPPER}} .wpfunnels-checkout-form-two-step .woocommerce .wpfunnels-checkout-form-nav-btns .wpfunnels-next-button,
1706 {{WRAPPER}} .wpfunnels-checkout-form-two-step .wpfunnels-checkout-form-note,
1707 body .wpfunnels-pre-checkout-offer-wrapper #wpfunnels-pre-checkout-offer-content button.wpfunnels-pre-checkout-offer-btn' => 'border-color: {{VALUE}};',
1708
1709 '{{WRAPPER}} .wpfunnels-checkout-form .woocommerce #payment input[type=radio]:checked:before,
1710 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button,
1711 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
1712 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button.wpfunnels-btn-small,
1713 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
1714 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.checkout_coupon .button,
1715 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.login .button:hover,
1716 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.checkout_coupon .button:hover,
1717 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #payment #place_order:hover,
1718 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button.wpfunnels-btn-small:hover,
1719 {{WRAPPER}} .wpfunnels-checkout-form-two-step .wpfunnels-checkout-form-steps .step-one.wpfunnels-current:before,
1720 {{WRAPPER}} .wpfunnels-checkout-form-two-step .wpfunnels-checkout-form-steps .step-two.wpfunnels-current:before,
1721 {{WRAPPER}} .wpfunnels-checkout-form-two-step .wpfunnels-checkout-form-steps .steps.wpfunnels-current:before,
1722 {{WRAPPER}} .wpfunnels-checkout-form-two-step .wpfunnels-checkout-form-note,
1723 body .wpfunnels-pre-checkout-offer-wrapper .wpfunnels-nav-bar-step.active .wpfunnels-progress-nav-step,
1724 body .wpfunnels-pre-checkout-offer-wrapper .wpfunnels-nav-bar-step.active .wpfunnels-nav-bar-step-line:before,
1725 body .wpfunnels-pre-checkout-offer-wrapper .wpfunnels-nav-bar-step.active .wpfunnels-nav-bar-step-line:after' => 'background-color: {{VALUE}};',
1726
1727 '{{WRAPPER}} .wpfunnels-checkout-form-two-step .wpfunnels-checkout-form-note:before' => 'border-top-color: {{VALUE}};',
1728
1729 '{{WRAPPER}} .wpfunnels-checkout-form-two-step .woocommerce .wpfunnels-checkout-form-nav-btns .wpfunnels-next-button,
1730 {{WRAPPER}} .wpfunnels-checkout-form-two-step .woocommerce .wpfunnels-checkout-form-nav-btns a.wpfunnels-next-button,
1731 {{WRAPPER}} .wpfunnels-checkout-form form.checkout_coupon .button,
1732 body .wpfunnels-pre-checkout-offer-wrapper #wpfunnels-pre-checkout-offer-content button.wpfunnels-pre-checkout-offer-btn' => 'background-color: {{VALUE}}; color: #fff;',
1733 ],
1734 ]
1735 );
1736
1737 $this->add_control(
1738 'global_text_color',
1739 [
1740 'label' => __('Text Color', 'wpfnl'),
1741 'type' => Controls_Manager::COLOR,
1742 'default' => '',
1743 'selectors' => [
1744 '{{WRAPPER}} .wpfunnels-checkout-form,
1745 {{WRAPPER}} .wpfunnels-checkout-form #payment .woocommerce-privacy-policy-text p' => 'color: {{VALUE}};',
1746 ],
1747 ]
1748 );
1749
1750 $this->add_group_control(
1751 Group_Control_Typography::get_type(),
1752 [
1753 'name' => 'global_typography',
1754 'label' => 'Typography',
1755 'selector' => '{{WRAPPER}} .wpfunnels-checkout-form',
1756 ]
1757 );
1758
1759 $this->end_controls_section();
1760 }
1761
1762 /**
1763 * Register Button Style Controls.
1764 *
1765 * @since x.x.x
1766 * @access protected
1767 */
1768 protected function register_button_style_controls()
1769 {
1770 $this->start_controls_section(
1771 'button_section',
1772 [
1773 'label' => __('Buttons', 'wpfnl'),
1774 'tab' => Controls_Manager::TAB_STYLE,
1775 ]
1776 );
1777
1778 $this->add_group_control(
1779 Group_Control_Typography::get_type(),
1780 [
1781 'name' => 'buttons_typography',
1782 'label' => 'Typography',
1783 'selector' => '{{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button,
1784 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
1785 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button.wpfnl-btn-small,
1786 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
1787 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.checkout_coupon .button,
1788 {{WRAPPER}} .wpfunnels-checkout-form form.checkout_coupon .button,
1789 {{WRAPPER}} .wpfunnels-checkout-form-two-step .woocommerce .wpfunnels-checkout-form-nav-btns .wpfnl-next-button,
1790 body .wpfnl-pre-checkout-offer-wrapper #wpfnl-pre-checkout-offer-content button.wpfnl-pre-checkout-offer-btn',
1791 ]
1792 );
1793
1794 $this->start_controls_tabs('tabs_button_style');
1795
1796 $this->start_controls_tab(
1797 'tab_button_normal',
1798 [
1799 'label' => __('Normal', 'wpfnl'),
1800 ]
1801 );
1802
1803 $this->add_control(
1804 'button_text_color',
1805 [
1806 'label' => __('Text Color', 'wpfnl'),
1807 'type' => Controls_Manager::COLOR,
1808 'default' => '',
1809 'selectors' => [
1810 '{{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button,
1811 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
1812 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button.wpfnl-btn-small,
1813 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
1814 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.checkout_coupon .button,
1815 {{WRAPPER}} .wpfunnels-checkout-form form.checkout_coupon .button,
1816 {{WRAPPER}} .wpfunnels-checkout-form-two-step .woocommerce .wpfunnels-checkout-form-nav-btns .wpfnl-next-button,
1817 body .wpfnl-pre-checkout-offer-wrapper #wpfnl-pre-checkout-offer-content button.wpfnl-pre-checkout-offer-btn' => 'color: {{VALUE}};',
1818 ],
1819 ]
1820 );
1821
1822 $this->add_group_control(
1823 Group_Control_Background::get_type(),
1824 [
1825 'name' => 'btn_background_color',
1826 'label' => __('Background Color', 'wpfnl'),
1827 'types' => ['classic', 'gradient'],
1828 'selector' => '{{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button,
1829 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
1830 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button.wpfnl-btn-small,
1831 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
1832 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.checkout_coupon .button,
1833 {{WRAPPER}} .wpfunnels-checkout-form form.checkout_coupon .button,
1834 {{WRAPPER}} .wpfunnels-checkout-form-two-step .woocommerce .wpfunnels-checkout-form-nav-btns .wpfnl-next-button,
1835 body .wpfnl-pre-checkout-offer-wrapper #wpfnl-pre-checkout-offer-content button.wpfnl-pre-checkout-offer-btn',
1836 ]
1837 );
1838
1839 $this->add_group_control(
1840 Group_Control_Border::get_type(),
1841 [
1842 'name' => 'btn_border',
1843 'label' => __('Border', 'wpfnl'),
1844 'selector' => '{{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button,
1845 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
1846 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button.wpfnl-btn-small,
1847 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
1848 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.checkout_coupon .button,
1849 {{WRAPPER}} .wpfunnels-checkout-form form.checkout_coupon .button,
1850 {{WRAPPER}} .wpfunnels-checkout-form-two-step .woocommerce .wpfunnels-checkout-form-nav-btns .wpfnl-next-button,
1851 body .wpfnl-pre-checkout-offer-wrapper #wpfnl-pre-checkout-offer-content button.wpfnl-pre-checkout-offer-btn',
1852 ]
1853 );
1854
1855 $this->add_responsive_control(
1856 'btn_border_radius',
1857 [
1858 'label' => __('Rounded Corners', 'wpfnl'),
1859 'type' => Controls_Manager::DIMENSIONS,
1860 'size_units' => ['px', '%'],
1861 'selectors' => [
1862 '{{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button,
1863 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
1864 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button.wpfnl-btn-small,
1865 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
1866 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.checkout_coupon .button,
1867 {{WRAPPER}} .wpfunnels-checkout-form form.checkout_coupon .button,
1868 {{WRAPPER}} .wpfunnels-checkout-form-two-step .woocommerce .wpfunnels-checkout-form-nav-btns .wpfnl-next-button,
1869 body .wpfnl-pre-checkout-offer-wrapper #wpfnl-pre-checkout-offer-content button.wpfnl-pre-checkout-offer-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1870 ],
1871 ]
1872 );
1873
1874 $this->add_group_control(
1875 Group_Control_Box_Shadow::get_type(),
1876 [
1877 'name' => 'button_box_shadow',
1878 'selector' => '{{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button,
1879 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce form.woocommerce-form-login .form-row button,
1880 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button.wpfnl-btn-small,
1881 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.woocommerce-form-login .button,
1882 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.checkout_coupon .button,
1883 {{WRAPPER}} .wpfunnels-checkout-form form.checkout_coupon .button,
1884 {{WRAPPER}} .wpfunnels-checkout-form-two-step .woocommerce .wpfunnels-checkout-form-nav-btns .wpfnl-next-button,
1885 body .wpfnl-pre-checkout-offer-wrapper #wpfnl-pre-checkout-offer-content button.wpfnl-pre-checkout-offer-btn',
1886 ]
1887 );
1888
1889 $this->end_controls_tab();
1890
1891 $this->start_controls_tab(
1892 'tab_button_hover',
1893 [
1894 'label' => __('Hover', 'wpfnl'),
1895 ]
1896 );
1897
1898 $this->add_control(
1899 'btn_hover_color',
1900 [
1901 'label' => __('Text Color', 'wpfnl'),
1902 'type' => Controls_Manager::COLOR,
1903 'selectors' => [
1904 '{{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.login .button:hover,
1905 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.checkout_coupon .button:hover,
1906 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #payment #place_order:hover,
1907 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button.wpfnl-btn-small:hover,
1908 {{WRAPPER}} .wpfunnels-checkout-form form.checkout_coupon .button:hover,
1909 {{WRAPPER}} .wpfunnels-checkout-form-two-step .woocommerce .wpfunnels-checkout-form-nav-btns .wpfnl-next-button:hover,
1910 body .wpfnl-pre-checkout-offer-wrapper #wpfnl-pre-checkout-offer-content button.wpfnl-pre-checkout-offer-btn' => 'color: {{VALUE}};',
1911 ],
1912 ]
1913 );
1914
1915 $this->add_control(
1916 'button_hover_border_color',
1917 [
1918 'label' => __('Border Hover Color', 'wpfnl'),
1919 'type' => Controls_Manager::COLOR,
1920 'selectors' => [
1921 '{{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.login .button:hover,
1922 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.checkout_coupon .button:hover,
1923 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #payment #place_order:hover,
1924 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button.wpfnl-btn-small:hover,
1925 {{WRAPPER}} .wpfunnels-checkout-form form.checkout_coupon .button:hover,
1926 {{WRAPPER}} .wpfunnels-checkout-form-two-step .woocommerce .wpfunnels-checkout-form-nav-btns .wpfnl-next-button:hover,
1927 body .wpfnl-pre-checkout-offer-wrapper #wpfnl-pre-checkout-offer-content button.wpfnl-pre-checkout-offer-btn' => 'border-color: {{VALUE}};',
1928 ],
1929 ]
1930 );
1931
1932 $this->add_group_control(
1933 Group_Control_Background::get_type(),
1934 [
1935 'name' => 'button_background_hover_color',
1936 'label' => __('Background Color', 'wpfnl'),
1937 'types' => ['classic', 'gradient'],
1938 'selector' => '{{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.login .button:hover,
1939 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce-checkout form.checkout_coupon .button:hover,
1940 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #payment #place_order:hover,
1941 {{WRAPPER}} .wpfunnels-checkout-form .woocommerce #order_review button.wpfnl-btn-small:hover,
1942 {{WRAPPER}} .wpfunnels-checkout-form form.checkout_coupon .button:hover,
1943 {{WRAPPER}} .wpfunnels-checkout-form-two-step .woocommerce .wpfunnels-checkout-form-nav-btns .wpfnl-next-button:hover,
1944 body .wpfnl-pre-checkout-offer-wrapper #wpfnl-pre-checkout-offer-content button.wpfnl-pre-checkout-offer-btn',
1945 ]
1946 );
1947
1948 $this->end_controls_tab();
1949
1950 $this->end_controls_tabs();
1951
1952 $this->end_controls_section();
1953 }
1954
1955 /**
1956 * Function to get skin types.
1957 *
1958 * @since x.x.x
1959 * @access protected
1960 */
1961 protected function get_skin_types()
1962 {
1963 $skin_options = [];
1964
1965 $skin_options = [
1966 'default' => __('Default', 'wpfnl'),
1967 'style-one' => __('Floating Labels', 'wpfnl'),
1968 ];
1969
1970 return $skin_options;
1971 }
1972
1973 /**
1974 * Register Billing Fields Style Controls.
1975 *
1976 * @since x.x.x
1977 * @access protected
1978 */
1979 protected function register_billing_style_controls()
1980 {
1981 $this->start_controls_section(
1982 'billing_input_section',
1983 [
1984 'label' => __('Billing Section', 'wpfnl'),
1985 'tab' => Controls_Manager::TAB_STYLE,
1986 ]
1987 );
1988
1989 // ----headding style-----
1990 $this->add_control(
1991 'billing_heading_style',
1992 [
1993 'label' => __('Heading Style', 'wpfnl'),
1994 'type' => Controls_Manager::HEADING,
1995 'label_block' => true,
1996 ]
1997 );
1998
1999 $this->add_control(
2000 'billing_heading_text_color',
2001 [
2002 'label' => __('Color', 'wpfnl'),
2003 'type' => Controls_Manager::COLOR,
2004 'default' => '',
2005 'selectors' => [
2006 '{{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields h3,
2007 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields h3 span' => 'color: {{VALUE}};'
2008 ],
2009 ]
2010 );
2011
2012 $this->add_group_control(
2013 Group_Control_Typography::get_type(),
2014 [
2015 'name' => 'billing_heading_typography',
2016 'label' => 'Typography',
2017 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields h3,
2018 {{WRAPPER}} .woocommerce.woocommerce-checkout #customer_details .woocommerce-billing-fields h3,
2019 {{WRAPPER}} .woocommerce-page.woocommerce-checkout #customer_details .woocommerce-billing-fields h3',
2020 ]
2021 );
2022
2023 $this->add_responsive_control(
2024 'billing_heading_margin',
2025 [
2026 'label' => __('Margin', 'wpfnl'),
2027 'type' => Controls_Manager::DIMENSIONS,
2028 'size_units' => ['px', '%', 'em'],
2029 'selectors' => [
2030 '{{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields h3' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2031 ],
2032 ]
2033 );
2034
2035 $this->add_responsive_control(
2036 'billing_heading_padding',
2037 [
2038 'label' => __('Padding', 'wpfnl'),
2039 'type' => Controls_Manager::DIMENSIONS,
2040 'size_units' => ['px', '%', 'em'],
2041 'selectors' => [
2042 '{{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields h3' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2043 ],
2044 'separator' => 'after',
2045 ]
2046 );
2047 //-----end heading style-----
2048
2049
2050 // -----label style------
2051 $this->add_control(
2052 'billing_label_style',
2053 [
2054 'label' => __('Label Style', 'wpfnl'),
2055 'type' => Controls_Manager::HEADING,
2056 'label_block' => true,
2057 ]
2058 );
2059
2060 $this->add_control(
2061 'billing_label_color',
2062 [
2063 'label' => __('Color', 'wpfnl'),
2064 'type' => Controls_Manager::COLOR,
2065 'default' => '',
2066 'selectors' => [
2067 '{{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields p.form-row label' => 'color: {{VALUE}};'
2068 ],
2069 ]
2070 );
2071
2072 $this->add_group_control(
2073 Group_Control_Typography::get_type(),
2074 [
2075 'name' => 'billing_label_typography',
2076 'label' => 'Typography',
2077 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields p.form-row label',
2078 ]
2079 );
2080
2081 $this->add_responsive_control(
2082 'billing_label_margin',
2083 [
2084 'label' => __('Margin', 'wpfnl'),
2085 'type' => Controls_Manager::DIMENSIONS,
2086 'size_units' => ['px', '%', 'em'],
2087 'selectors' => [
2088 '{{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields p.form-row label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2089 ],
2090 'separator' => 'after',
2091 ]
2092 );
2093 //-----end label style-----
2094
2095
2096 // -----input field style------
2097 $this->add_control(
2098 'billing_input_field_style',
2099 [
2100 'label' => __('Input Field Style', 'wpfnl'),
2101 'type' => Controls_Manager::HEADING,
2102 'label_block' => true,
2103 ]
2104 );
2105
2106 $this->add_control(
2107 'billing_input_color',
2108 [
2109 'label' => __('Text Color', 'wpfnl'),
2110 'type' => Controls_Manager::COLOR,
2111 'selectors' => [
2112 '{{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row input.input-text,
2113 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row textarea,
2114 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .select2-container--default .select2-selection--single,
2115 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .select2-container--default .select2-selection--single .select2-selection__rendered,
2116 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row select,
2117 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields ::placeholder,
2118 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields ::-webkit-input-placeholder' => 'color: {{VALUE}} !important;',
2119 ],
2120 ]
2121 );
2122
2123 $this->add_group_control(
2124 Group_Control_Typography::get_type(),
2125 [
2126 'name' => 'billing_input_text_typography',
2127 'label' => 'Typography',
2128 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row input.input-text,
2129 {{WRAPPER}} .wpfnl-checkout .woocommerce-account-fields .form-row input.input-text,
2130 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row textarea,
2131 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .select2-container--default .select2-selection--single,
2132 {{WRAPPER}} .woocommerce-billing-fields .select2-container--default .select2-selection--single .select2-selection__rendered,
2133 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row select.select,
2134 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row select,
2135 {{WRAPPER}} .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_billing .form-row:not(.create-account) input.input-text:not(#billing_address_2, #shipping_address_2),
2136 {{WRAPPER}} .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_billing .form-row:not(.create-account) textarea',
2137 ]
2138 );
2139
2140 $this->add_control(
2141 'billing_input_bgcolor',
2142 [
2143 'label' => __('Background Color', 'wpfnl'),
2144 'type' => Controls_Manager::COLOR,
2145 'selectors' => [
2146 '{{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row input.input-text,
2147 {{WRAPPER}} .wpfnl-checkout .woocommerce-account-fields .form-row input.input-text,
2148 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row textarea,
2149 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .select2-container--default .select2-selection--single,
2150 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row select.select,
2151 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row select,
2152 {{WRAPPER}} .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_billing .form-row:not(.create-account) > label' => 'background-color: {{VALUE}};',
2153 ],
2154 ]
2155 );
2156
2157
2158 $this->add_control(
2159 'billing_input_border_style',
2160 [
2161 'label' => __('Border Style', 'wpfnl'),
2162 'type' => Controls_Manager::SELECT,
2163 'label_block' => false,
2164 'default' => '',
2165 'options' => [
2166 '' => __('Inherit', 'wpfnl'),
2167 'solid' => __('Solid', 'wpfnl'),
2168 'double' => __('Double', 'wpfnl'),
2169 'dotted' => __('Dotted', 'wpfnl'),
2170 'dashed' => __('Dashed', 'wpfnl'),
2171 ],
2172 'selectors' => [
2173 '{{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row input.input-text,
2174 {{WRAPPER}} .wpfnl-checkout .woocommerce-account-fields .form-row input.input-text,
2175 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row textarea,
2176 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .select2-container--default .select2-selection--single,
2177 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row select.select,
2178 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row select' => 'border-style: {{VALUE}};',
2179 ],
2180 ]
2181 );
2182 $this->add_control(
2183 'billing_input_border_size',
2184 [
2185 'label' => __('Border Width', 'wpfnl'),
2186 'type' => Controls_Manager::DIMENSIONS,
2187 'size_units' => ['px'],
2188 'selectors' => [
2189 '{{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row input.input-text,
2190 {{WRAPPER}} .wpfnl-checkout .woocommerce-account-fields .form-row input.input-text,
2191 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row textarea,
2192 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .select2-container--default .select2-selection--single,
2193 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row select.select,
2194 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .form-row select' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2195 ],
2196 ]
2197 );
2198
2199 $this->add_control(
2200 'billing_input_border_color',
2201 [
2202 'label' => __('Border Color', 'wpfnl'),
2203 'type' => Controls_Manager::COLOR,
2204 'selectors' => [
2205 '{{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields .form-row input.input-text,
2206 {{WRAPPER}} .wpfnl-checkout .woocommerce-account-fields .form-row input.input-text,
2207 {{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields .form-row textarea,
2208 {{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields .select2-container--default .select2-selection--single,
2209 {{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields .form-row select.select,
2210 {{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .select2-container--focus .select2-selection,
2211 {{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields .form-row select' => 'border-color: {{VALUE}}!important;',
2212 ],
2213 ]
2214 );
2215
2216 $this->add_responsive_control(
2217 'billing_input_radius',
2218 [
2219 'label' => __('Radius', 'wpfnl'),
2220 'type' => Controls_Manager::DIMENSIONS,
2221 'size_units' => ['px', 'em', '%'],
2222 'selectors' => [
2223 '{{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields .form-row input.input-text,
2224 {{WRAPPER}} .wpfnl-checkout .woocommerce-account-fields .form-row input.input-text,
2225 {{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields .form-row textarea,
2226 {{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields .select2-container--default .select2-selection--single,
2227 {{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields select.select,
2228 {{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields .form-row select' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2229 ],
2230 ]
2231 );
2232
2233 $this->add_responsive_control(
2234 'billing_input_padding',
2235 [
2236 'label' => __('Padding', 'wpfnl'),
2237 'type' => Controls_Manager::DIMENSIONS,
2238 'size_units' => ['px', '%', 'em'],
2239 'selectors' => [
2240 '{{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields .form-row input.input-text,
2241 {{WRAPPER}} .wpfnl-checkout .woocommerce-account-fields .form-row input.input-text,
2242 {{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields .form-row textarea,
2243 {{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields select.select,
2244 {{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields .form-row select,
2245 {{WRAPPER}} .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_billing .form-row:not(.create-account) input.input-text:not(#billing_address_2, #shipping_address_2),
2246 {{WRAPPER}} .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_billing .form-row:not(.create-account) textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2247
2248 '{{WRAPPER}} .wpfnl-checkout .woocommerce-billing-fields .select2-container .select2-selection--single .select2-selection__rendered' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;',
2249 ],
2250
2251 ]
2252 );
2253
2254 $this->add_responsive_control(
2255 'billing_input_margin',
2256 [
2257 'label' => __('Margin', 'wpfnl'),
2258 'type' => Controls_Manager::DIMENSIONS,
2259 'size_units' => ['px', '%', 'em'],
2260 'selectors' => [
2261 '{{WRAPPER}} .wpfnl-checkout form .woocommerce-billing-fields p.form-row:not(#billing_address_1_field),
2262 {{WRAPPER}} .wpfnl-checkout .woocommerce-account-fields .form-row' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2263 ],
2264
2265 ]
2266 );
2267
2268 $this->end_controls_section();
2269 }
2270
2271 /**
2272 * Register Shipping Fields Style Controls.
2273 *
2274 * @since x.x.x
2275 * @access protected
2276 */
2277 protected function register_shipping_style_controls()
2278 {
2279 $this->start_controls_section(
2280 'shipping_input_section',
2281 [
2282 'label' => __('Additional Info / Shipping Section', 'wpfnl'),
2283 'tab' => Controls_Manager::TAB_STYLE,
2284 ]
2285 );
2286
2287 // ----headding style-----
2288 $this->add_control(
2289 'shipping_heading_style',
2290 [
2291 'label' => __('Heading Style', 'wpfnl'),
2292 'type' => Controls_Manager::HEADING,
2293 'label_block' => true,
2294 ]
2295 );
2296
2297 $this->add_control(
2298 'shipping_heading_text_color',
2299 [
2300 'label' => __('Color', 'wpfnl'),
2301 'type' => Controls_Manager::COLOR,
2302 'default' => '',
2303 'selectors' => [
2304 '{{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields #ship-to-different-address label.woocommerce-form__label,
2305 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields > h3' => 'color: {{VALUE}};'
2306 ],
2307 ]
2308 );
2309
2310 $this->add_group_control(
2311 Group_Control_Typography::get_type(),
2312 [
2313 'name' => 'shipping_heading_typography',
2314 'label' => 'Typography',
2315 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields #ship-to-different-address span,
2316 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields > h3'
2317 ]
2318 );
2319
2320 $this->add_responsive_control(
2321 'shipping_heading_margin',
2322 [
2323 'label' => __('Margin', 'wpfnl'),
2324 'type' => Controls_Manager::DIMENSIONS,
2325 'size_units' => ['px', '%', 'em'],
2326 'selectors' => [
2327 '{{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields #ship-to-different-address,
2328 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields > h3' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2329 ],
2330 ]
2331 );
2332
2333 $this->add_responsive_control(
2334 'shipping_heading_padding',
2335 [
2336 'label' => __('Padding', 'wpfnl'),
2337 'type' => Controls_Manager::DIMENSIONS,
2338 'size_units' => ['px', '%', 'em'],
2339 'selectors' => [
2340 '{{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields #ship-to-different-address,
2341 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields > h3' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2342 ],
2343 'separator' => 'after',
2344 ]
2345 );
2346 //-----end heading style-----
2347
2348
2349 // -----label style------
2350 $this->add_control(
2351 'shipping_label_style',
2352 [
2353 'label' => __('Label Style', 'wpfnl'),
2354 'type' => Controls_Manager::HEADING,
2355 'label_block' => true,
2356 ]
2357 );
2358
2359 $this->add_control(
2360 'shipping_label_color',
2361 [
2362 'label' => __('Color', 'wpfnl'),
2363 'type' => Controls_Manager::COLOR,
2364 'default' => '',
2365 'selectors' => [
2366 '{{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields p.form-row label,
2367 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields p.form-row label' => 'color: {{VALUE}};'
2368 ],
2369 ]
2370 );
2371
2372 $this->add_group_control(
2373 Group_Control_Typography::get_type(),
2374 [
2375 'name' => 'shipping_label_typography',
2376 'label' => 'Typography',
2377 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields p.form-row label,
2378 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields p.form-row label',
2379 ]
2380 );
2381
2382 $this->add_responsive_control(
2383 'shipping_label_margin',
2384 [
2385 'label' => __('Margin', 'wpfnl'),
2386 'type' => Controls_Manager::DIMENSIONS,
2387 'size_units' => ['px', '%', 'em'],
2388 'selectors' => [
2389 '{{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields p.form-row label,
2390 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields p.form-row label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2391 ],
2392 'separator' => 'after',
2393 ]
2394 );
2395 //-----end label style-----
2396
2397
2398 // -----input field style------
2399 $this->add_control(
2400 'shipping_input_field_style',
2401 [
2402 'label' => __('Input Field Style', 'wpfnl'),
2403 'type' => Controls_Manager::HEADING,
2404 'label_block' => true,
2405 ]
2406 );
2407
2408 $this->add_control(
2409 'shipping_input_color',
2410 [
2411 'label' => __('Text Color', 'wpfnl'),
2412 'type' => Controls_Manager::COLOR,
2413 'selectors' => [
2414 '{{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row input.input-text,
2415 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields .form-row textarea,
2416 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single,
2417 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single .select2-selection__rendered,
2418 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row select,
2419 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields ::placeholder,
2420 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields ::-webkit-input-placeholder,
2421 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields ::placeholder,
2422 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields ::-webkit-input-placeholder' => 'color: {{VALUE}} !important;',
2423 ],
2424 ]
2425 );
2426
2427 $this->add_group_control(
2428 Group_Control_Typography::get_type(),
2429 [
2430 'name' => 'shipping_input_text_typography',
2431 'label' => 'Typography',
2432 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row input.input-text,
2433 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields .form-row textarea,
2434 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single,
2435 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single .select2-selection__rendered,
2436 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row select.select,
2437 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row select,
2438 {{WRAPPER}} .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) input.input-text:not(#billing_address_2, #shipping_address_2),
2439 {{WRAPPER}} .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) textarea',
2440 ]
2441 );
2442
2443 $this->add_control(
2444 'shipping_input_bgcolor',
2445 [
2446 'label' => __('Background Color', 'wpfnl'),
2447 'type' => Controls_Manager::COLOR,
2448 'selectors' => [
2449 '{{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row input.input-text,
2450 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields .form-row textarea,
2451 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single,
2452 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row select.select,
2453 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row select,
2454 {{WRAPPER}} .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) > label' => 'background-color: {{VALUE}};',
2455 ],
2456 ]
2457 );
2458
2459
2460 $this->add_control(
2461 'shipping_input_border_style',
2462 [
2463 'label' => __('Border Style', 'wpfnl'),
2464 'type' => Controls_Manager::SELECT,
2465 'label_block' => false,
2466 'default' => '',
2467 'options' => [
2468 '' => __('Inherit', 'wpfnl'),
2469 'solid' => __('Solid', 'wpfnl'),
2470 'double' => __('Double', 'wpfnl'),
2471 'dotted' => __('Dotted', 'wpfnl'),
2472 'dashed' => __('Dashed', 'wpfnl'),
2473 ],
2474 'selectors' => [
2475 '{{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row input.input-text,
2476 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields .form-row textarea,
2477 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single,
2478 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row select.select,
2479 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row select' => 'border-style: {{VALUE}};',
2480 ],
2481 ]
2482 );
2483 $this->add_control(
2484 'shipping_input_border_size',
2485 [
2486 'label' => __('Border Width', 'wpfnl'),
2487 'type' => Controls_Manager::DIMENSIONS,
2488 'size_units' => ['px'],
2489 'selectors' => [
2490 '{{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row input.input-text,
2491 {{WRAPPER}} .wpfnl-checkout .woocommerce-additional-fields .form-row textarea,
2492 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .select2-container--default .select2-selection--single,
2493 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row select.select,
2494 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .form-row select' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2495 ],
2496 ]
2497 );
2498
2499 $this->add_control(
2500 'shipping_input_border_color',
2501 [
2502 'label' => __('Border Color', 'wpfnl'),
2503 'type' => Controls_Manager::COLOR,
2504 'selectors' => [
2505 '{{WRAPPER}} .wpfnl-checkout form .woocommerce-shipping-fields .form-row input.input-text,
2506 {{WRAPPER}} .wpfnl-checkout form .woocommerce-additional-fields .form-row textarea,
2507 {{WRAPPER}} .wpfnl-checkout form .woocommerce-shipping-fields .select2-container--default .select2-selection--single,
2508 {{WRAPPER}} .wpfnl-checkout form .woocommerce-shipping-fields .form-row select.select,
2509 {{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .select2-container--focus .select2-selection,
2510 {{WRAPPER}} .wpfnl-checkout form .woocommerce-shipping-fields .form-row select' => 'border-color: {{VALUE}};',
2511 ],
2512 ]
2513 );
2514
2515
2516 $this->add_responsive_control(
2517 'shipping_input_radius',
2518 [
2519 'label' => __('Radius', 'wpfnl'),
2520 'type' => Controls_Manager::DIMENSIONS,
2521 'size_units' => ['px', 'em', '%'],
2522 'selectors' => [
2523 '{{WRAPPER}} .wpfnl-checkout form .woocommerce-shipping-fields .form-row input.input-text,
2524 {{WRAPPER}} .wpfnl-checkout form .woocommerce-additional-fields .form-row textarea,
2525 {{WRAPPER}} .wpfnl-checkout form .woocommerce-shipping-fields .select2-container--default .select2-selection--single,
2526 {{WRAPPER}} .wpfnl-checkout form .woocommerce-shipping-fields select.select,
2527 {{WRAPPER}} .wpfnl-checkout form .woocommerce-shipping-fields .form-row select' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2528 ],
2529 ]
2530 );
2531
2532 $this->add_responsive_control(
2533 'shipping_input_padding',
2534 [
2535 'label' => __('Padding', 'wpfnl'),
2536 'type' => Controls_Manager::DIMENSIONS,
2537 'size_units' => ['px', '%', 'em'],
2538 'selectors' => [
2539 '{{WRAPPER}} .wpfnl-checkout form .woocommerce-shipping-fields .form-row input.input-text,
2540 {{WRAPPER}} .wpfnl-checkout form .woocommerce-additional-fields .form-row textarea,
2541 {{WRAPPER}} .wpfnl-checkout form .woocommerce-shipping-fields select.select,
2542 {{WRAPPER}} .wpfnl-checkout form .woocommerce-shipping-fields .form-row select,
2543 {{WRAPPER}} .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) input.input-text:not(#billing_address_2, #shipping_address_2),
2544 {{WRAPPER}} .wpfnl-checkout.floating-label #customer_details #wpfnl_checkout_shipping .form-row:not(.create-account) textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2545
2546 '{{WRAPPER}} .wpfnl-checkout .woocommerce-shipping-fields .select2-container .select2-selection--single .select2-selection__rendered' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;',
2547 ],
2548
2549 ]
2550 );
2551
2552 $this->add_responsive_control(
2553 'shipping_input_margin',
2554 [
2555 'label' => __('Margin', 'wpfnl'),
2556 'type' => Controls_Manager::DIMENSIONS,
2557 'size_units' => ['px', '%', 'em'],
2558 'selectors' => [
2559 '{{WRAPPER}} .wpfnl-checkout form .woocommerce-shipping-fields p.form-row:not(#shipping_address_1_field)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2560 ],
2561
2562 ]
2563 );
2564
2565 $this->end_controls_section();
2566 }
2567
2568
2569 /**
2570 * Register Order Table Style Controls.
2571 *
2572 * @since x.x.x
2573 * @access protected
2574 */
2575 protected function register_your_order_style_controls()
2576 {
2577 $this->start_controls_section(
2578 'your_order_section',
2579 [
2580 'label' => __('Order Table Section', 'wpfnl'),
2581 'tab' => Controls_Manager::TAB_STYLE,
2582 ]
2583 );
2584
2585 // ----headding style-----
2586 $this->add_control(
2587 'order_heading_style',
2588 [
2589 'label' => __('Heading Style', 'wpfnl'),
2590 'type' => Controls_Manager::HEADING,
2591 'label_block' => true,
2592 ]
2593 );
2594
2595 $this->add_control(
2596 'order_heading_color',
2597 [
2598 'label' => __('Color', 'wpfnl'),
2599 'type' => Controls_Manager::COLOR,
2600 'default' => '',
2601 'selectors' => [
2602 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #order_review_heading' => 'color: {{VALUE}};'
2603 ],
2604 ]
2605 );
2606
2607 $this->add_group_control(
2608 Group_Control_Typography::get_type(),
2609 [
2610 'name' => 'order_heading_typography',
2611 'label' => 'Typography',
2612 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #order_review_heading',
2613 ]
2614 );
2615
2616 $this->add_responsive_control(
2617 'order_heading_margin',
2618 [
2619 'label' => __('Margin', 'wpfnl'),
2620 'type' => Controls_Manager::DIMENSIONS,
2621 'size_units' => ['px', '%', 'em'],
2622 'selectors' => [
2623 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #order_review_heading' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important',
2624 ],
2625 ]
2626 );
2627
2628 $this->add_responsive_control(
2629 'order_heading_padding',
2630 [
2631 'label' => __('Padding', 'wpfnl'),
2632 'type' => Controls_Manager::DIMENSIONS,
2633 'size_units' => ['px', '%', 'em'],
2634 'selectors' => [
2635 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout #order_review_heading' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important',
2636 ],
2637 'separator' => 'after',
2638 ]
2639 );
2640 //-----end heading style-----
2641
2642 // ----order table style-----
2643 $this->add_control(
2644 'order_table_style',
2645 [
2646 'label' => __('Table Style', 'wpfnl'),
2647 'type' => Controls_Manager::HEADING,
2648 'label_block' => true,
2649 ]
2650 );
2651
2652 $this->add_control(
2653 'your_order_text_color',
2654 [
2655 'label' => __('Color', 'wpfnl'),
2656 'type' => Controls_Manager::COLOR,
2657 'default' => '',
2658 'selectors' => [
2659 '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout table.woocommerce-checkout-review-order-table td,
2660 {{WRAPPER}} .wpfnl-checkout .woocommerce-checkout table.woocommerce-checkout-review-order-table th' => 'color: {{VALUE}};'
2661 ],
2662 ]
2663 );
2664
2665 $this->add_group_control(
2666 Group_Control_Typography::get_type(),
2667 [
2668 'name' => 'your_order_text_typography',
2669 'label' => 'Typography',
2670 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce-checkout table.woocommerce-checkout-review-order-table td,
2671 {{WRAPPER}} .wpfnl-checkout .woocommerce-checkout table.woocommerce-checkout-review-order-table th',
2672 ]
2673 );
2674
2675 $this->add_control(
2676 'order_table_border_style',
2677 [
2678 'label' => __('Border Style', 'wpfnl'),
2679 'type' => Controls_Manager::SELECT,
2680 'label_block' => false,
2681 'default' => '',
2682 'options' => [
2683 '' => __('Inherit', 'wpfnl'),
2684 'solid' => __('Solid', 'wpfnl'),
2685 'double' => __('Double', 'wpfnl'),
2686 'dotted' => __('Dotted', 'wpfnl'),
2687 'dashed' => __('Dashed', 'wpfnl'),
2688 ],
2689
2690 'selectors' => [
2691 '{{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table' => 'border-style: {{VALUE}}!important;',
2692 '{{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table thead th,
2693 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table thead td,
2694 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tbody th,
2695 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tbody td,
2696 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tfoot td,
2697 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tfoot th' => 'border-left-style: {{VALUE}}!important; border-top-style: {{VALUE}}!important;',
2698 ],
2699 ]
2700 );
2701
2702 $this->add_control(
2703 'order_table_border_size',
2704 [
2705 'label' => __('Border Width', 'wpfnl'),
2706 'type' => Controls_Manager::DIMENSIONS,
2707 'size_units' => ['px'],
2708 'selectors' => [
2709 '{{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important; border-top: none!important;',
2710
2711 '{{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table thead th,
2712 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table thead td,
2713 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tbody th,
2714 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tbody td,
2715 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tfoot td,
2716 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tfoot th' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;',
2717
2718 '{{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table thead th:first-child,
2719 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table thead td:first-child,
2720 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tbody th:first-child,
2721 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tbody td:first-child,
2722 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tfoot td:first-child,
2723 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tfoot th:first-child' => 'border-left: none!important;',
2724
2725 ],
2726 ]
2727 );
2728
2729 $this->add_control(
2730 'order_table_border_color',
2731 [
2732 'label' => __('Border Color', 'wpfnl'),
2733 'type' => Controls_Manager::COLOR,
2734 'selectors' => [
2735 '{{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table' => 'border-color: {{VALUE}}!important;',
2736 '{{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table thead th,
2737 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table thead td,
2738 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tbody th,
2739 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tbody td,
2740 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tfoot td,
2741 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tfoot th' => 'border-left-color: {{VALUE}}!important; border-top-color: {{VALUE}}!important;',
2742 ],
2743
2744 ]
2745 );
2746
2747 $this->add_responsive_control(
2748 'order_table_radius',
2749 [
2750 'label' => __('Radius', 'wpfnl'),
2751 'type' => Controls_Manager::DIMENSIONS,
2752 'size_units' => ['px', 'em', '%'],
2753 'selectors' => [
2754 '{{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2755 ],
2756 ]
2757 );
2758
2759 $this->add_responsive_control(
2760 'order_table_cell_padding',
2761 [
2762 'label' => __('Cell Padding', 'wpfnl'),
2763 'type' => Controls_Manager::DIMENSIONS,
2764 'size_units' => ['px', '%', 'em'],
2765 'selectors' => [
2766 '{{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table thead th,
2767 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table thead td,
2768 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tbody th,
2769 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tbody td,
2770 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tfoot td,
2771 {{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table tfoot th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;',
2772 ],
2773
2774 ]
2775 );
2776
2777 $this->add_responsive_control(
2778 'order_table_margin',
2779 [
2780 'label' => __('Margin', 'wpfnl'),
2781 'type' => Controls_Manager::DIMENSIONS,
2782 'size_units' => ['px', '%', 'em'],
2783 'selectors' => [
2784 '{{WRAPPER}} .wpfnl-checkout .woocommerce table.shop_table' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;',
2785 ],
2786
2787 ]
2788 );
2789
2790 $this->end_controls_section();
2791 }
2792
2793
2794 /**
2795 * Register Coupon Field Style Controls.
2796 *
2797 * @since x.x.x
2798 * @access protected
2799 */
2800 protected function register_coupon_style_controls()
2801 {
2802 $this->start_controls_section(
2803 'coupon_section',
2804 [
2805 'label' => __('Coupon Section', 'wpfnl'),
2806 'tab' => Controls_Manager::TAB_STYLE,
2807 ]
2808 );
2809
2810 // ----toggle area style-----
2811 $this->add_control(
2812 'coupon_toggle_area_style',
2813 [
2814 'label' => __('Coupon Toggle Area Style', 'wpfnl'),
2815 'type' => Controls_Manager::HEADING,
2816 'label_block' => true,
2817 ]
2818 );
2819
2820 $this->add_control(
2821 'coupon_toggle_color',
2822 [
2823 'label' => __('Text Color', 'wpfnl'),
2824 'type' => Controls_Manager::COLOR,
2825 'selectors' => [
2826 '{{WRAPPER}} .wpfnl-checkout .woocommerce-form-coupon-toggle .woocommerce-info' => 'color: {{VALUE}};',
2827 ],
2828 ]
2829 );
2830
2831 $this->add_control(
2832 'coupon_toggle_link_color',
2833 [
2834 'label' => __('Link Color', 'wpfnl'),
2835 'type' => Controls_Manager::COLOR,
2836 'selectors' => [
2837 '{{WRAPPER}} .wpfnl-checkout .woocommerce-form-coupon-toggle .woocommerce-info a' => 'color: {{VALUE}};',
2838 ],
2839 ]
2840 );
2841
2842 $this->add_control(
2843 'coupon_toggle_bgcolor',
2844 [
2845 'label' => __('Background Color', 'wpfnl'),
2846 'type' => Controls_Manager::COLOR,
2847 'selectors' => [
2848 '{{WRAPPER}} .wpfnl-checkout .woocommerce-form-coupon-toggle .woocommerce-info' => 'background-color: {{VALUE}};',
2849 ],
2850 ]
2851 );
2852
2853 $this->add_group_control(
2854 Group_Control_Typography::get_type(),
2855 [
2856 'name' => 'coupon_toggle_typography',
2857 'label' => 'Typography',
2858 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce-form-coupon-toggle .woocommerce-info',
2859 ]
2860 );
2861
2862 $this->add_control(
2863 'coupon_toggle_border_style',
2864 [
2865 'label' => __('Border Style', 'wpfnl'),
2866 'type' => Controls_Manager::SELECT,
2867 'label_block' => false,
2868 'default' => '',
2869 'options' => [
2870 '' => __('Inherit', 'wpfnl'),
2871 'solid' => __('Solid', 'wpfnl'),
2872 'double' => __('Double', 'wpfnl'),
2873 'dotted' => __('Dotted', 'wpfnl'),
2874 'dashed' => __('Dashed', 'wpfnl'),
2875 ],
2876 'selectors' => [
2877 '{{WRAPPER}} .wpfnl-checkout .woocommerce-form-coupon-toggle .woocommerce-info' => 'border-style: {{VALUE}};',
2878 ],
2879 ]
2880 );
2881
2882 $this->add_control(
2883 'coupon_toggle_border_size',
2884 [
2885 'label' => __('Border Width', 'wpfnl'),
2886 'type' => Controls_Manager::DIMENSIONS,
2887 'size_units' => ['px'],
2888 'selectors' => [
2889 '{{WRAPPER}} .wpfnl-checkout .woocommerce-form-coupon-toggle .woocommerce-info' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2890 ],
2891 'condition' => [
2892 'coupon_toggle_border_style!' => '',
2893 ]
2894 ]
2895 );
2896
2897 $this->add_control(
2898 'coupon_toggle_border_color',
2899 [
2900 'label' => __('Border Color', 'wpfnl'),
2901 'type' => Controls_Manager::COLOR,
2902 'selectors' => [
2903 '{{WRAPPER}} .wpfnl-checkout .woocommerce-form-coupon-toggle .woocommerce-info' => 'border-color: {{VALUE}};',
2904 '{{WRAPPER}} .wpfnl-checkout .woocommerce-form-coupon-toggle .woocommerce-info::before' => 'color: {{VALUE}};',
2905 ],
2906 'condition' => [
2907 'coupon_toggle_border_style!' => '',
2908 ]
2909 ]
2910 );
2911
2912
2913 $this->add_responsive_control(
2914 'coupon_toggle_radius',
2915 [
2916 'label' => __('Radius', 'wpfnl'),
2917 'type' => Controls_Manager::DIMENSIONS,
2918 'size_units' => ['px', 'em', '%'],
2919 'selectors' => [
2920 '{{WRAPPER}} .wpfnl-checkout .woocommerce-form-coupon-toggle .woocommerce-info' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2921 ],
2922 ]
2923 );
2924
2925 $this->add_responsive_control(
2926 'coupon_toggle_padding',
2927 [
2928 'label' => __('Padding', 'wpfnl'),
2929 'type' => Controls_Manager::DIMENSIONS,
2930 'size_units' => ['px', '%', 'em'],
2931 'selectors' => [
2932 '{{WRAPPER}} .wpfnl-checkout .woocommerce-form-coupon-toggle .woocommerce-info' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2933
2934 '{{WRAPPER}} .wpfnl-checkout .woocommerce-form-coupon-toggle .woocommerce-info::before' => 'top: {{TOP}}{{UNIT}};',
2935 ],
2936
2937 ]
2938 );
2939
2940 $this->add_responsive_control(
2941 'coupon_toggle_margin',
2942 [
2943 'label' => __('Margin', 'wpfnl'),
2944 'type' => Controls_Manager::DIMENSIONS,
2945 'size_units' => ['px', '%', 'em'],
2946 'selectors' => [
2947 '{{WRAPPER}} .wpfnl-checkout .woocommerce-form-coupon-toggle .woocommerce-info' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2948 ],
2949 'separator' => 'after'
2950
2951 ]
2952 );
2953
2954
2955 // ----coupon form box style-----
2956 $this->add_control(
2957 'coupon_form_box_style',
2958 [
2959 'label' => __('Coupon Form Box Style', 'wpfnl'),
2960 'type' => Controls_Manager::HEADING,
2961 'label_block' => true,
2962 ]
2963 );
2964
2965 $this->add_control(
2966 'coupon_form_box_color',
2967 [
2968 'label' => __('Text Color', 'wpfnl'),
2969 'type' => Controls_Manager::COLOR,
2970 'selectors' => [
2971 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon p' => 'color: {{VALUE}};',
2972 ],
2973 ]
2974 );
2975
2976 $this->add_control(
2977 'coupon_form_box_bgcolor',
2978 [
2979 'label' => __('Background Color', 'wpfnl'),
2980 'type' => Controls_Manager::COLOR,
2981 'selectors' => [
2982 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon' => 'background-color: {{VALUE}};',
2983 ],
2984 ]
2985 );
2986
2987 $this->add_group_control(
2988 Group_Control_Typography::get_type(),
2989 [
2990 'name' => 'coupon_form_box_typography',
2991 'label' => 'Typography',
2992 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon p',
2993 ]
2994 );
2995
2996 $this->add_control(
2997 'coupon_form_box_border_style',
2998 [
2999 'label' => __('Border Style', 'wpfnl'),
3000 'type' => Controls_Manager::SELECT,
3001 'label_block' => false,
3002 'default' => '',
3003 'options' => [
3004 '' => __('Inherit', 'wpfnl'),
3005 'solid' => __('Solid', 'wpfnl'),
3006 'double' => __('Double', 'wpfnl'),
3007 'dotted' => __('Dotted', 'wpfnl'),
3008 'dashed' => __('Dashed', 'wpfnl'),
3009 ],
3010 'selectors' => [
3011 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon' => 'border-style: {{VALUE}};',
3012 ],
3013 ]
3014 );
3015
3016 $this->add_control(
3017 'coupon_form_box_border_size',
3018 [
3019 'label' => __('Border Width', 'wpfnl'),
3020 'type' => Controls_Manager::DIMENSIONS,
3021 'size_units' => ['px'],
3022 'selectors' => [
3023 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3024 ],
3025 'condition' => [
3026 'coupon_form_box_border_style!' => '',
3027 ]
3028 ]
3029 );
3030
3031 $this->add_control(
3032 'coupon_form_box_border_color',
3033 [
3034 'label' => __('Border Color', 'wpfnl'),
3035 'type' => Controls_Manager::COLOR,
3036 'selectors' => [
3037 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon' => 'border-color: {{VALUE}};',
3038 ],
3039 'condition' => [
3040 'coupon_form_box_border_style!' => '',
3041 ]
3042 ]
3043 );
3044
3045 $this->add_responsive_control(
3046 'coupon_form_box_radius',
3047 [
3048 'label' => __('Radius', 'wpfnl'),
3049 'type' => Controls_Manager::DIMENSIONS,
3050 'size_units' => ['px', 'em', '%'],
3051 'selectors' => [
3052 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3053 ],
3054 ]
3055 );
3056
3057 $this->add_responsive_control(
3058 'coupon_form_box_padding',
3059 [
3060 'label' => __('Padding', 'wpfnl'),
3061 'type' => Controls_Manager::DIMENSIONS,
3062 'size_units' => ['px', '%', 'em'],
3063 'selectors' => [
3064 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3065 ],
3066
3067 ]
3068 );
3069
3070 $this->add_responsive_control(
3071 'coupon_form_box_margin',
3072 [
3073 'label' => __('Margin', 'wpfnl'),
3074 'type' => Controls_Manager::DIMENSIONS,
3075 'size_units' => ['px', '%', 'em'],
3076 'selectors' => [
3077 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3078 ],
3079 'separator' => 'after'
3080 ]
3081 );
3082
3083 // ----coupon input field style-----
3084 $this->add_control(
3085 'coupon_input_field_style',
3086 [
3087 'label' => __('Coupon Input field Style', 'wpfnl'),
3088 'type' => Controls_Manager::HEADING,
3089 'label_block' => true,
3090 ]
3091 );
3092
3093 $this->add_control(
3094 'coupon_input_field_color',
3095 [
3096 'label' => __('Color', 'wpfnl'),
3097 'type' => Controls_Manager::COLOR,
3098 'selectors' => [
3099 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text,
3100 {{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon ::placeholder,
3101 {{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon ::-webkit-input-placeholder' => 'color: {{VALUE}};',
3102 ],
3103 ]
3104 );
3105
3106 $this->add_control(
3107 'coupon_input_field_bgcolor',
3108 [
3109 'label' => __('Background Color', 'wpfnl'),
3110 'type' => Controls_Manager::COLOR,
3111 'selectors' => [
3112 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text' => 'background-color: {{VALUE}};',
3113 ],
3114 ]
3115 );
3116
3117 $this->add_group_control(
3118 Group_Control_Typography::get_type(),
3119 [
3120 'name' => 'coupon_input_field_typography',
3121 'label' => 'Typography',
3122 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text',
3123 ]
3124 );
3125
3126 $this->add_control(
3127 'coupon_input_field_border_style',
3128 [
3129 'label' => __('Border Style', 'wpfnl'),
3130 'type' => Controls_Manager::SELECT,
3131 'label_block' => false,
3132 'default' => '',
3133 'options' => [
3134 '' => __('Inherit', 'wpfnl'),
3135 'solid' => __('Solid', 'wpfnl'),
3136 'double' => __('Double', 'wpfnl'),
3137 'dotted' => __('Dotted', 'wpfnl'),
3138 'dashed' => __('Dashed', 'wpfnl'),
3139 ],
3140 'selectors' => [
3141 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text' => 'border-style: {{VALUE}};',
3142 ],
3143 ]
3144 );
3145
3146 $this->add_control(
3147 'coupon_input_field_border_size',
3148 [
3149 'label' => __('Border Width', 'wpfnl'),
3150 'type' => Controls_Manager::DIMENSIONS,
3151 'size_units' => ['px'],
3152 'selectors' => [
3153 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;',
3154 ],
3155 'condition' => [
3156 'coupon_input_field_border_style!' => '',
3157 ]
3158 ]
3159 );
3160
3161 $this->add_control(
3162 'coupon_input_field_border_color',
3163 [
3164 'label' => __('Border Color', 'wpfnl'),
3165 'type' => Controls_Manager::COLOR,
3166 'selectors' => [
3167 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text' => 'border-color: {{VALUE}};',
3168 ],
3169 'condition' => [
3170 'coupon_input_field_border_style!' => '',
3171 ]
3172 ]
3173 );
3174
3175
3176 $this->add_responsive_control(
3177 'coupon_input_field_radius',
3178 [
3179 'label' => __('Radius', 'wpfnl'),
3180 'type' => Controls_Manager::DIMENSIONS,
3181 'size_units' => ['px', 'em', '%'],
3182 'selectors' => [
3183 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3184 ],
3185 ]
3186 );
3187
3188 $this->add_responsive_control(
3189 'coupon_input_field_padding',
3190 [
3191 'label' => __('Padding', 'wpfnl'),
3192 'type' => Controls_Manager::DIMENSIONS,
3193 'size_units' => ['px', '%', 'em'],
3194 'selectors' => [
3195 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon .input-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}!important;',
3196 ],
3197 'separator' => 'after'
3198 ]
3199 );
3200
3201
3202 // ----Coupon Button style-----
3203 $this->add_control(
3204 'coupon_button_style',
3205 [
3206 'label' => __('Coupon Button Style', 'wpfnl'),
3207 'type' => Controls_Manager::HEADING,
3208 'label_block' => true,
3209 ]
3210 );
3211
3212 $this->add_group_control(
3213 Group_Control_Typography::get_type(),
3214 [
3215 'name' => 'coupon_button_typography',
3216 'label' => 'Typography',
3217 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button',
3218 ]
3219 );
3220
3221 $this->start_controls_tabs('coupon_button_tab');
3222 $this->start_controls_tab(
3223 'coupon_button_normal',
3224 [
3225 'label' => __('Normal', 'wpfnl'),
3226 ]
3227 );
3228
3229 $this->add_control(
3230 'coupon_button_color',
3231 [
3232 'label' => __('Color', 'wpfnl'),
3233 'type' => Controls_Manager::COLOR,
3234 'default' => '',
3235 'selectors' => [
3236 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button' => 'color: {{VALUE}};',
3237 ],
3238 ]
3239 );
3240
3241 $this->add_control(
3242 'coupon_button_bg_color',
3243 [
3244 'label' => __('Background Color', 'wpfnl'),
3245 'type' => Controls_Manager::COLOR,
3246 'selectors' => [
3247 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button' => 'background-color: {{VALUE}};',
3248 ],
3249
3250 ]
3251 );
3252
3253 $this->add_group_control(
3254 Group_Control_Box_Shadow::get_type(),
3255 [
3256 'name' => 'coupon_button_box_shadow',
3257 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button',
3258 ]
3259 );
3260 $this->end_controls_tab();
3261
3262 //----hover style---
3263 $this->start_controls_tab(
3264 'coupon_button_button_hover',
3265 [
3266 'label' => __('Hover', 'wpfnl'),
3267 ]
3268 );
3269
3270 $this->add_control(
3271 'coupon_button_color_hover',
3272 [
3273 'label' => __('Color', 'wpfnl'),
3274 'type' => Controls_Manager::COLOR,
3275 'default' => '',
3276 'selectors' => [
3277 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button:hover' => 'color: {{VALUE}};',
3278 ],
3279 ]
3280 );
3281
3282 $this->add_control(
3283 'coupon_button_bg_color_hover',
3284 [
3285 'label' => __('Background Color', 'wpfnl'),
3286 'type' => Controls_Manager::COLOR,
3287 'selectors' => [
3288 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button:hover' => 'background-color: {{VALUE}};',
3289 ],
3290 ]
3291 );
3292
3293 $this->add_group_control(
3294 Group_Control_Box_Shadow::get_type(),
3295 [
3296 'name' => 'coupon_button_box_shadow_hover',
3297 'selector' => '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button:hover',
3298 ]
3299 );
3300 $this->end_controls_tab();
3301 $this->end_controls_tabs();
3302 //-----------------------
3303
3304 $this->add_responsive_control(
3305 'coupon_button_radius',
3306 [
3307 'label' => __('Radius', 'wpfnl'),
3308 'type' => Controls_Manager::DIMENSIONS,
3309 'size_units' => ['px', 'em', '%'],
3310 'selectors' => [
3311 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3312 ],
3313 'separator' => 'before',
3314 ]
3315 );
3316
3317 $this->add_responsive_control(
3318 'coupon_button_padding',
3319 [
3320 'label' => __('Padding', 'wpfnl'),
3321 'type' => Controls_Manager::DIMENSIONS,
3322 'size_units' => ['px', 'em', '%'],
3323 'selectors' => [
3324 '{{WRAPPER}} .wpfnl-checkout .woocommerce form.woocommerce-form-coupon button.button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3325 ],
3326 ]
3327 );
3328
3329
3330 $this->end_controls_section();
3331 }
3332
3333
3334 /**
3335 * Render the widget output on the frontend.
3336 *
3337 * Written in PHP and used to generate the final HTML.
3338 *
3339 * @since 1.0.0
3340 *
3341 * @access protected
3342 */
3343 protected function render()
3344 {
3345
3346 $settings = $this->get_settings_for_display();
3347
3348 $checkout = WC()->checkout();
3349 if( wp_doing_ajax() && isset($_REQUEST['action']) && 'elementor_ajax' === $_REQUEST['action'] ) {
3350 $checkout_id = absint( $_REQUEST['editor_post_id'] );
3351 } else {
3352 $checkout_id = get_the_ID();
3353 }
3354
3355 //===Coupon Enabler===//
3356 $coupon_enabler = get_post_meta(get_the_ID(), '_wpfnl_checkout_coupon', true);
3357 if ( $coupon_enabler != 'yes' ) {
3358 remove_action('woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10);
3359 }
3360
3361 $checkout_layout = isset($settings['checkout_layout']) ? $settings['checkout_layout'] : 'two-column';
3362
3363 //-----floating label class-----
3364 $floating_label = isset($settings['checkout_floating_label']) ? $settings['checkout_floating_label'] : '';
3365
3366 /**
3367 * Check if pro is activated or not
3368 */
3369 if( !Wpfnl_functions::is_wpfnl_pro_activated() && ('wpfnl-multistep' === $checkout_layout || 'wpfnl-express-checkout' === $checkout_layout) ) {
3370 $checkout_layout = 'wpfnl-col-2';
3371 }
3372
3373 if( PHP_SESSION_DISABLED == session_status() ) {
3374 session_start();
3375 }
3376 $_SESSION[ 'checkout_layout' ] = $checkout_layout;
3377
3378 /**
3379 * Check if pro is activated and wpfnl-express-checkout selected
3380 */
3381 if( Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-express-checkout' === $checkout_layout ) {
3382 $checkout_layout .= ' wpfnl-multistep';
3383 }
3384
3385 /**
3386 * Check if pro is activated and wpfnl-express-checkout selected
3387 */
3388 if( Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-2-step' === $checkout_layout ) {
3389 $checkout_layout .= ' wpfnl-multistep';
3390 }
3391
3392 // Add shared modern checkout class for both modern layouts
3393 if( 'wpfnl-modern-one-column' === $checkout_layout || 'wpfnl-modern-checkout' === $checkout_layout ) {
3394 if( false === strpos( $checkout_layout, 'wpfnl-modern-checkout' ) ) {
3395 $checkout_layout .= ' wpfnl-modern-checkout';
3396 }
3397 }
3398
3399 /**
3400 * Check wpfnl-modern-multistep selected
3401 */
3402 if('wpfnl-modern-multistep' === $checkout_layout ) {
3403 $checkout_layout .= ' wpfnl-modern-checkout';
3404 }
3405
3406
3407 query_posts('post_type="checkout"');
3408
3409 // Persist layout and floating label so the shortcode / template picks them up.
3410 update_post_meta( $checkout_id, '_wpfnl_checkout_layout', isset( $settings['checkout_layout'] ) ? $settings['checkout_layout'] : 'wpfnl-col-2' );
3411 update_post_meta( $checkout_id, '_wpfnl_floating_label', $floating_label );
3412
3413 // Persist Place Order settings for WooCommerce AJAX checkout updates.
3414 $place_order_meta = array(
3415 'placeOrderBtnText' => isset( $settings['place_order_btn_text'] ) ? $settings['place_order_btn_text'] : 'Place Order',
3416 'placeOrderSubText' => isset( $settings['place_order_sub_text'] ) ? $settings['place_order_sub_text'] : '',
3417 'placeOrderEnableIcon' => isset( $settings['place_order_enable_icon'] ) ? ( 'yes' === $settings['place_order_enable_icon'] ) : false,
3418 'placeOrderIconStyle' => isset( $settings['place_order_icon_style'] ) ? $settings['place_order_icon_style'] : 'lock1',
3419 'placeOrderEnablePrice'=> isset( $settings['place_order_enable_price'] ) ? ( 'yes' === $settings['place_order_enable_price'] ) : false,
3420 'placeOrderBelowText' => isset( $settings['place_order_below_text'] ) ? $settings['place_order_below_text'] : '',
3421 );
3422 update_post_meta( $checkout_id, '_wpfnl_place_order_settings', $place_order_meta );
3423
3424 $place_order_filter = $this->get_place_order_button_filter( $settings );
3425 add_filter( 'woocommerce_order_button_html', $place_order_filter );
3426
3427 $below_text = isset( $settings['place_order_below_text'] ) ? $settings['place_order_below_text'] : '';
3428 $below_btn_filter = null;
3429 if ( ! empty( $below_text ) ) {
3430 $below_btn_filter = function() use ( $below_text ) {
3431 echo '<div class="wpfnl-below-place-order-btn">' . wp_kses_post( $below_text ) . '</div>';
3432 };
3433 add_action( 'woocommerce_review_order_after_submit', $below_btn_filter );
3434 }
3435
3436 do_action( 'wpfunnels/before_elementor_checkout_form', $settings );
3437 do_action( 'wpfunnels/before_checkout_form', $checkout_id );
3438 ?>
3439 <div class="wpfnl-checkout <?php echo esc_attr( $checkout_layout . ' ' . $floating_label ); ?>">
3440
3441 <?php echo do_shortcode('[woocommerce_checkout]'); ?>
3442
3443 <!-- when checkout layout Express Checkout selected then show -->
3444 <?php if( Wpfnl_functions::is_wpfnl_pro_activated() && 'wpfnl-express-checkout' === $settings['checkout_layout'] ){
3445 ?>
3446 <?php } ?>
3447 </div>
3448 <?php
3449
3450 remove_filter( 'woocommerce_order_button_html', $place_order_filter );
3451 if ( null !== $below_btn_filter ) {
3452 remove_action( 'woocommerce_review_order_after_submit', $below_btn_filter );
3453 }
3454 }
3455
3456 public function render_popup_in_editor()
3457 {
3458 if (\Elementor\Plugin::$instance->editor->is_edit_mode()) {
3459
3460 add_action('woocommerce_before_checkout_form', [$this, 'render_order_bump'], 10);
3461 }
3462 }
3463
3464 /**
3465 * Render order bump data with hooks.
3466 *
3467 * @since 1.0.0
3468 *
3469 * @access protected
3470 */
3471 public function render_order_bump()
3472 {
3473
3474
3475 $step_id = get_the_ID();
3476 $order_bump = get_post_meta($step_id, 'order-bump', true);
3477 $order_bump_settings = get_post_meta($step_id, 'order-bump-settings', true);
3478 foreach( $order_bump_settings as $key=>$ob_settings ){
3479 if ( $ob_settings['isEnabled'] && isset($ob_settings['product']) && $ob_settings['product'] != '' ) {
3480 // Check conditional rules before displaying
3481 if ( Wpfnl_Order_Bump_Rules::should_display_order_bump( $ob_settings ) ) {
3482 $this->render_order_bump_template($ob_settings);
3483 }
3484 }
3485 }
3486
3487
3488 }
3489
3490 public function render_order_bump_template($settings)
3491 {
3492 if (!empty($settings['selectedStyle'])) {
3493
3494 if ($settings['position'] == 'popup') {
3495 if (\Elementor\Plugin::$instance->editor->is_edit_mode()) {
3496 echo '<h5 style="margin-bottom: 15px;"><strong>' . __('To see the pop-up offer in action, please preview or view the page.', 'wpfnl') . '</strong></h5>';
3497 } else {
3498 require_once WPFNL_DIR . 'public/modules/checkout/templates-style/order-bump-template-' . $settings['selectedStyle'] . '.php';
3499 }
3500
3501 } else {
3502 require_once WPFNL_DIR . 'public/modules/checkout/templates-style/order-bump-template-' . $settings['selectedStyle'] . '.php';
3503 }
3504 }
3505 }
3506
3507 }
3508