PluginProbe
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder / 51.1.86
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder v51.1.86
51.1.86 51.1.84 51.1.85 51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 All 40 releases
← All changes | includes/widgets/Pricing_Table/Pricing_Table.php +2751 -0 51.1.2 → 51.1.86 View file →
@@ -1,0 +1,2751 @@
1 +<?php
2 +
3 +namespace King_Addons;
4 +
5 +use Elementor\Controls_Manager;
6 +use Elementor\Widget_Base;
7 +use Elementor\Group_Control_Typography;
8 +use Elementor\Group_Control_Background;
9 +use Elementor\Group_Control_Box_Shadow;
10 +use Elementor\Repeater;
11 +
12 +if (!defined('ABSPATH')) {
13 + exit; // Exit if accessed directly.
14 +}
15 +
16 +
17 +
18 +class Pricing_Table extends Widget_Base
19 +{
20 +
21 +
22 + public function get_name(): string
23 + {
24 + return 'king-addons-pricing-table';
25 + }
26 +
27 + public function get_title(): string
28 + {
29 + return esc_html__('Pricing Table', 'king-addons');
30 + }
31 +
32 + public function get_icon(): string
33 + {
34 + return 'king-addons-icon king-addons-pricing-table';
35 + }
36 +
37 + public function get_style_depends(): array
38 + {
39 + return [KING_ADDONS_ASSETS_UNIQUE_KEY . '-pricing-table-style', KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-button'];
40 + }
41 +
42 + public function get_categories(): array
43 + {
44 + return ['king-addons'];
45 + }
46 +
47 + public function get_keywords(): array
48 + {
49 + return ['price', 'pricing', 'table', 'pricing table', 'features', 'features table',
50 + 'king addons', 'king', 'addons', 'kingaddons', 'king-addons'];
51 + }
52 +
53 + public function get_custom_help_url()
54 + {
55 + return 'mailto:[email protected]?subject=Bug Report - King Addons&body=Please describe the issue';
56 + }
57 +
58 + public function add_repeater_args_feature_tooltip(): array
59 + {
60 + return [
61 + 'label' => sprintf(__('Show Tooltip %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'),
62 + 'type' => Controls_Manager::SWITCHER,
63 + 'classes' => 'king-addons-pro-control'
64 + ];
65 + }
66 +
67 + public function add_repeater_args_feature_tooltip_text(): array
68 + {
69 + return [
70 + 'type' => Controls_Manager::HIDDEN,
71 + 'default' => ''
72 + ];
73 + }
74 +
75 + public function add_repeater_args_feature_tooltip_show_icon(): array
76 + {
77 + return [
78 + 'type' => Controls_Manager::HIDDEN,
79 + 'default' => ''
80 + ];
81 + }
82 +
83 + public function add_control_stack_feature_tooltip_section()
84 + {
85 + }
86 +
87 + public function add_controls_group_feature_even_bg()
88 + {
89 + $this->add_control(
90 + 'feature_even_bg',
91 + [
92 + 'label' => sprintf(__('Enable Even Color %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'),
93 + 'type' => Controls_Manager::SWITCHER,
94 + 'classes' => 'king-addons-pro-control no-distance'
95 + ]
96 + );
97 + }
98 +
99 + protected function register_controls()
100 + {
101 + $this->start_controls_section(
102 + 'section_pricing_items',
103 + [
104 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Price Table', 'king-addons'),
105 + ]
106 + );
107 +
108 + if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
109 + $this->add_control(
110 + 'pricing_table_pro_notice',
111 + [
112 + 'type' => Controls_Manager::RAW_HTML,
113 + 'raw' => 'Feature Item Tooltip and Even/Odd Feature Item Background Color options are available in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-pricing-table-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>',
114 + 'content_classes' => 'king-addons-pro-notice',
115 + ]
116 + );
117 + }
118 +
119 + $repeater = new Repeater();
120 +
121 + $repeater->add_control(
122 + 'type_select',
123 + [
124 + 'label' => esc_html__('Type', 'king-addons'),
125 + 'type' => Controls_Manager::SELECT,
126 + 'default' => 'heading',
127 + 'options' => [
128 + 'heading' => esc_html__('Heading', 'king-addons'),
129 + 'price' => esc_html__('Price', 'king-addons'),
130 + 'feature' => esc_html__('Feature', 'king-addons'),
131 + 'text' => esc_html__('Text', 'king-addons'),
132 + 'button' => esc_html__('Button', 'king-addons'),
133 + 'divider' => esc_html__('Divider', 'king-addons'),
134 + ],
135 + 'separator' => 'after',
136 + ]
137 + );
138 +
139 + $repeater->add_control(
140 + 'heading_title',
141 + [
142 + 'label' => esc_html__('Title', 'king-addons'),
143 + 'type' => Controls_Manager::TEXT,
144 + 'dynamic' => [
145 + 'active' => true,
146 + ],
147 + 'default' => 'Title',
148 + 'condition' => [
149 + 'type_select' => 'heading',
150 + ],
151 + ]
152 + );
153 +
154 + $repeater->add_control(
155 + 'heading_sub_title',
156 + [
157 + 'label' => esc_html__('Sub Title', 'king-addons'),
158 + 'type' => Controls_Manager::TEXT,
159 + 'dynamic' => [
160 + 'active' => true,
161 + ],
162 + 'default' => 'Subtitle text',
163 + 'condition' => [
164 + 'type_select' => 'heading',
165 + ],
166 + ]
167 + );
168 +
169 + $repeater->add_control(
170 + 'heading_icon_type',
171 + [
172 + 'label' => esc_html__('Icon Type', 'king-addons'),
173 + 'type' => Controls_Manager::SELECT,
174 + 'default' => 'icon',
175 + 'options' => [
176 + 'none' => esc_html__('None', 'king-addons'),
177 + 'icon' => esc_html__('Icon', 'king-addons'),
178 + 'image' => esc_html__('Image', 'king-addons'),
179 + ],
180 + 'condition' => [
181 + 'type_select' => 'heading',
182 + ],
183 +
184 + ]
185 + );
186 +
187 + $repeater->add_control(
188 + 'heading_image',
189 + [
190 + 'label' => esc_html__('Image', 'king-addons'),
191 + 'type' => Controls_Manager::MEDIA,
192 + 'dynamic' => [
193 + 'active' => true,
194 + ],
195 + 'condition' => [
196 + 'type_select' => 'heading',
197 + 'heading_icon_type' => 'image',
198 + ],
199 + ]
200 + );
201 +
202 + $repeater->add_control(
203 + 'text',
204 + [
205 + 'label' => '',
206 + 'type' => Controls_Manager::TEXTAREA,
207 + 'dynamic' => [
208 + 'active' => true,
209 + ],
210 + 'default' => 'Text Element',
211 + 'condition' => [
212 + 'type_select' => 'text',
213 + ],
214 + ]
215 + );
216 +
217 + $repeater->add_control(
218 + 'price',
219 + [
220 + 'label' => esc_html__('Price', 'king-addons'),
221 + 'type' => Controls_Manager::TEXT,
222 + 'dynamic' => [
223 + 'active' => true,
224 + ],
225 + 'default' => '39',
226 + 'condition' => [
227 + 'type_select' => 'price',
228 + ],
229 + ]
230 + );
231 +
232 + $repeater->add_control(
233 + 'sub_price',
234 + [
235 + 'label' => esc_html__('Sub Price', 'king-addons'),
236 + 'type' => Controls_Manager::TEXT,
237 + 'dynamic' => [
238 + 'active' => true,
239 + ],
240 + 'default' => '99',
241 + 'condition' => [
242 + 'type_select' => 'price',
243 + ],
244 + ]
245 + );
246 +
247 + $repeater->add_control(
248 + 'currency_symbol',
249 + [
250 + 'label' => esc_html__('Currency Symbol', 'king-addons'),
251 + 'type' => Controls_Manager::SELECT,
252 + 'options' => [
253 + '' => esc_html__('None', 'king-addons'),
254 + 'dollar' => '&#36; ' . _x('Dollar', 'Currency Symbol', 'king-addons'),
255 + 'euro' => '&#128; ' . _x('Euro', 'Currency Symbol', 'king-addons'),
256 + 'pound' => '&#163; ' . _x('Pound Sterling', 'Currency Symbol', 'king-addons'),
257 + 'ruble' => '&#8381; ' . _x('Ruble', 'Currency Symbol', 'king-addons'),
258 + 'peso' => '&#8369; ' . _x('Peso', 'Currency Symbol', 'king-addons'),
259 + 'krona' => 'kr ' . _x('Krona', 'Currency Symbol', 'king-addons'),
260 + 'lira' => '&#8356; ' . _x('Lira', 'Currency Symbol', 'king-addons'),
261 + 'franc' => '&#8355; ' . _x('Franc', 'Currency Symbol', 'king-addons'),
262 + 'baht' => '&#3647; ' . _x('Baht', 'Currency Symbol', 'king-addons'),
263 + 'shekel' => '&#8362; ' . _x('Shekel', 'Currency Symbol', 'king-addons'),
264 + 'won' => '&#8361; ' . _x('Won', 'Currency Symbol', 'king-addons'),
265 + 'yen' => '&#165; ' . _x('Yen/Yuan', 'Currency Symbol', 'king-addons'),
266 + 'guilder' => '&fnof; ' . _x('Guilder', 'Currency Symbol', 'king-addons'),
267 + 'peseta' => '&#8359 ' . _x('Peseta', 'Currency Symbol', 'king-addons'),
268 + 'real' => 'R$ ' . _x('Real', 'Currency Symbol', 'king-addons'),
269 + 'rupee' => '&#8360; ' . _x('Rupee', 'Currency Symbol', 'king-addons'),
270 + 'indian_rupee' => '&#8377; ' . _x('Rupee (Indian)', 'Currency Symbol', 'king-addons'),
271 + 'custom' => esc_html__('Custom', 'king-addons'),
272 + ],
273 + 'default' => 'dollar',
274 + 'condition' => [
275 + 'type_select' => 'price',
276 + ],
277 + ]
278 + );
279 +
280 + $repeater->add_control(
281 + 'currency',
282 + [
283 + 'label' => esc_html__('Currency', 'king-addons'),
284 + 'type' => Controls_Manager::TEXT,
285 + 'dynamic' => [
286 + 'active' => true,
287 + ],
288 + 'default' => '$',
289 + 'condition' => [
290 + 'type_select' => 'price',
291 + 'currency_symbol' => 'custom',
292 + ],
293 + ]
294 + );
295 +
296 + $repeater->add_control(
297 + 'sale',
298 + [
299 + 'label' => esc_html__('Sale', 'king-addons'),
300 + 'type' => Controls_Manager::SWITCHER,
301 + 'condition' => [
302 + 'type_select' => 'price',
303 + ],
304 + ]
305 + );
306 +
307 + $repeater->add_control(
308 + 'old_price',
309 + [
310 + 'label' => esc_html__('Old Price', 'king-addons'),
311 + 'type' => Controls_Manager::TEXT,
312 + 'dynamic' => [
313 + 'active' => true,
314 + ],
315 + 'default' => '29',
316 + 'condition' => [
317 + 'type_select' => 'price',
318 + 'sale' => 'yes',
319 + ],
320 + ]
321 + );
322 +
323 + $repeater->add_control(
324 + 'period',
325 + [
326 + 'label' => esc_html__('Period', 'king-addons'),
327 + 'type' => Controls_Manager::TEXT,
328 + 'dynamic' => [
329 + 'active' => true,
330 + ],
331 + 'default' => '/Year',
332 + 'condition' => [
333 + 'type_select' => 'price',
334 + ],
335 + ]
336 + );
337 +
338 + $repeater->add_control(
339 + 'feature_text',
340 + [
341 + 'label' => esc_html__('Text', 'king-addons'),
342 + 'type' => Controls_Manager::TEXT,
343 + 'dynamic' => [
344 + 'active' => true,
345 + ],
346 + 'default' => 'Feature',
347 + 'condition' => [
348 + 'type_select' => 'feature',
349 + ],
350 + ]
351 + );
352 +
353 + $repeater->add_control(
354 + 'feature_icon_color',
355 + [
356 + 'label' => esc_html__('Icon Color', 'king-addons'),
357 + 'type' => Controls_Manager::COLOR,
358 + 'default' => 'rgba(84,89,95,1)',
359 + 'selectors' => [
360 + '{{WRAPPER}} {{CURRENT_ITEM}} .king-addons-pricing-table-feature-icon' => 'color: {{VALUE}};',
361 + ],
362 + 'condition' => [
363 + 'type_select' => 'feature',
364 + ],
365 + ]
366 + );
367 +
368 + $repeater->add_control(
369 + 'btn_text',
370 + [
371 + 'label' => esc_html__('Button Text', 'king-addons'),
372 + 'type' => Controls_Manager::TEXT,
373 + 'dynamic' => [
374 + 'active' => true,
375 + ],
376 + 'default' => 'Button',
377 + 'condition' => [
378 + 'type_select' => 'button',
379 + ],
380 + ]
381 + );
382 +
383 + $repeater->add_control(
384 + 'btn_id',
385 + [
386 + 'label' => esc_html__('Button ID', 'king-addons'),
387 + 'type' => Controls_Manager::TEXT,
388 + 'dynamic' => [
389 + 'active' => true,
390 + ],
391 + 'placeholder' => 'button-id',
392 + 'condition' => [
393 + 'type_select' => 'button',
394 + ],
395 + ]
396 + );
397 +
398 + $repeater->add_control(
399 + 'btn_url',
400 + [
401 + 'type' => Controls_Manager::URL,
402 + 'dynamic' => [
403 + 'active' => true,
404 + ],
405 + 'placeholder' => esc_html__('https://example.com', 'king-addons'),
406 + 'show_label' => false,
407 + 'condition' => [
408 + 'type_select' => 'button',
409 + ],
410 + ]
411 + );
412 +
413 + $repeater->add_control(
414 + 'select_icon',
415 + [
416 + 'label' => esc_html__('Select Icon', 'king-addons'),
417 + 'type' => Controls_Manager::ICONS,
418 + 'skin' => 'inline',
419 + 'label_block' => false,
420 + 'conditions' => [
421 + 'relation' => 'or',
422 + 'terms' => [
423 + [
424 + 'name' => 'type_select',
425 + 'operator' => '=',
426 + 'value' => 'feature',
427 + ],
428 + [
429 + 'name' => 'type_select',
430 + 'operator' => '=',
431 + 'value' => 'button',
432 + ],
433 + [
434 + 'relation' => 'and',
435 + 'terms' => [
436 + [
437 + 'name' => 'type_select',
438 + 'operator' => '=',
439 + 'value' => 'heading',
440 + ],
441 + [
442 + 'name' => 'heading_icon_type',
443 + 'operator' => '=',
444 + 'value' => 'icon',
445 + ],
446 + ],
447 + ],
448 + ],
449 + ],
450 + ]
451 + );
452 +
453 + $repeater->add_control(
454 + 'btn_icon_position',
455 + [
456 + 'label' => esc_html__('Icon Position', 'king-addons'),
457 + 'type' => Controls_Manager::SELECT,
458 + 'default' => 'after',
459 + 'options' => [
460 + 'before' => esc_html__('Before', 'king-addons'),
461 + 'after' => esc_html__('After', 'king-addons'),
462 + ],
463 + 'condition' => [
464 + 'type_select' => 'button',
465 + ],
466 +
467 + ]
468 + );
469 +
470 + $repeater->add_control(
471 + 'feature_linethrough',
472 + [
473 + 'label' => esc_html__('Line Through', 'king-addons'),
474 + 'type' => Controls_Manager::SWITCHER,
475 + 'condition' => [
476 + 'type_select' => 'feature',
477 + ],
478 + ]
479 + );
480 +
481 + $repeater->add_control(
482 + 'feature_linethrough_text_color',
483 + [
484 + 'label' => esc_html__('Text Color', 'king-addons'),
485 + 'type' => Controls_Manager::COLOR,
486 + 'default' => '#222222',
487 + 'selectors' => [
488 + '{{WRAPPER}} {{CURRENT_ITEM}} span.king-addons-pricing-table-ftext-line-yes span' => 'color: {{VALUE}};',
489 + ],
490 + 'condition' => [
491 + 'type_select' => 'feature',
492 + 'feature_linethrough' => 'yes',
493 + ],
494 + ]
495 + );
496 +
497 + $repeater->add_control(
498 + 'feature_linethrough_color',
499 + [
500 + 'label' => esc_html__('Line Color', 'king-addons'),
501 + 'type' => Controls_Manager::COLOR,
502 + 'default' => '#222222',
503 + 'selectors' => [
504 + '{{WRAPPER}} {{CURRENT_ITEM}} span.king-addons-pricing-table-ftext-line-yes' => 'color: {{VALUE}};',
505 + ],
506 + 'condition' => [
507 + 'type_select' => 'feature',
508 + 'feature_linethrough' => 'yes',
509 + ],
510 + ]
511 + );
512 +
513 + $repeater->add_control('feature_tooltip', $this->add_repeater_args_feature_tooltip());
514 +
515 + $repeater->add_control('feature_tooltip_show_icon', $this->add_repeater_args_feature_tooltip_show_icon());
516 +
517 + $repeater->add_control('feature_tooltip_text', $this->add_repeater_args_feature_tooltip_text());
518 +
519 + $repeater->add_control(
520 + 'divider_style',
521 + [
522 + 'label' => esc_html__('Style', 'king-addons'),
523 + 'type' => Controls_Manager::SELECT,
524 + 'options' => [
525 + 'solid' => esc_html__('Solid', 'king-addons'),
526 + 'double' => esc_html__('Double', 'king-addons'),
527 + 'dotted' => esc_html__('Dotted', 'king-addons'),
528 + 'dashed' => esc_html__('Dashed', 'king-addons'),
529 + 'groove' => esc_html__('Groove', 'king-addons'),
530 + ],
531 + 'default' => 'dashed',
532 + 'selectors' => [
533 + '{{WRAPPER}} .king-addons-pricing-table-divider' => 'border-top-style: {{VALUE}};',
534 + ],
535 + 'condition' => [
536 + 'type_select' => 'divider',
537 + ],
538 + ]
539 + );
540 +
541 + $repeater->add_control(
542 + 'divider_bg_color',
543 + [
544 + 'label' => esc_html__('Background Color', 'king-addons'),
545 + 'type' => Controls_Manager::COLOR,
546 + 'default' => '#f7f7f7',
547 + 'selectors' => [
548 + '{{WRAPPER}} {{CURRENT_ITEM}}' => 'background-color: {{VALUE}};',
549 + ],
550 + 'condition' => [
551 + 'type_select' => 'divider',
552 + ],
553 + ]
554 + );
555 +
556 + $repeater->add_control(
557 + 'divider_color',
558 + [
559 + 'label' => esc_html__('Color', 'king-addons'),
560 + 'type' => Controls_Manager::COLOR,
561 + 'default' => '#222222',
562 + 'selectors' => [
563 + '{{WRAPPER}} {{CURRENT_ITEM}} .king-addons-pricing-table-divider' => 'border-top-color: {{VALUE}};',
564 + ],
565 + 'condition' => [
566 + 'type_select' => 'divider',
567 + ],
568 + ]
569 + );
570 +
571 + $repeater->add_responsive_control(
572 + 'divider_width',
573 + [
574 + 'label' => esc_html__('Width', 'king-addons'),
575 + 'type' => Controls_Manager::SLIDER,
576 + 'size_units' => ['px', '%'],
577 + 'range' => [
578 + 'px' => [
579 + 'min' => 5,
580 + 'max' => 300,
581 + ],
582 + '%' => [
583 + 'min' => 0,
584 + 'max' => 100,
585 + ],
586 + ],
587 + 'default' => [
588 + 'unit' => 'px',
589 + 'size' => 60,
590 + ],
591 + 'selectors' => [
592 + '{{WRAPPER}} {{CURRENT_ITEM}} .king-addons-pricing-table-divider' => 'width: {{SIZE}}{{UNIT}};',
593 + ],
594 + 'condition' => [
595 + 'type_select' => 'divider',
596 + ],
597 + ]
598 + );
599 +
600 + $repeater->add_responsive_control(
601 + 'divider_height',
602 + [
603 + 'label' => esc_html__('Height', 'king-addons'),
604 + 'type' => Controls_Manager::SLIDER,
605 + 'size_units' => ['px'],
606 + 'range' => [
607 + 'px' => [
608 + 'min' => 1,
609 + 'max' => 10,
610 + ],
611 + ],
612 + 'default' => [
613 + 'unit' => 'px',
614 + 'size' => 1,
615 + ],
616 + 'selectors' => [
617 + '{{WRAPPER}} {{CURRENT_ITEM}} .king-addons-pricing-table-divider' => 'border-top-width: {{SIZE}}{{UNIT}};',
618 + ],
619 + 'condition' => [
620 + 'type_select' => 'divider',
621 + ],
622 + ]
623 + );
624 +
625 + $this->add_control(
626 + 'pricing_items',
627 + [
628 + 'type' => Controls_Manager::REPEATER,
629 + 'fields' => $repeater->get_controls(),
630 + 'default' => [
631 + [
632 + 'type_select' => 'heading',
633 + 'select_icon' => ['value' => 'far fa-star', 'library' => 'fa-regular'],
634 + ],
635 + [
636 + 'type_select' => 'price',
637 + ],
638 + [
639 + 'type_select' => 'feature',
640 + 'feature_text' => 'Feature 1',
641 + 'feature_linethrough' => 'yes',
642 + 'feature_icon_color' => '#7a7a7a',
643 + 'feature_linethrough_text_color' => '#7a7a7a',
644 + 'feature_linethrough_color' => '#7a7a7a',
645 + 'select_icon' => ['value' => 'fas fa-check', 'library' => 'fa-solid'],
646 + ],
647 + [
648 + 'type_select' => 'feature',
649 + 'feature_text' => 'Feature 2',
650 + 'feature_icon_color' => 'rgba(84,89,95,1)',
651 + 'select_icon' => ['value' => 'fas fa-check', 'library' => 'fa-solid'],
652 + ],
653 + [
654 + 'type_select' => 'feature',
655 + 'feature_text' => 'Feature 3',
656 + 'feature_icon_color' => '#6DD400',
657 + 'select_icon' => ['value' => 'fas fa-check', 'library' => 'fa-solid'],
658 + ],
659 + [
660 + 'type_select' => 'feature',
661 + 'feature_text' => 'Feature 4',
662 + 'feature_icon_color' => '#6DD400',
663 + 'select_icon' => ['value' => 'fas fa-check', 'library' => 'fa-solid'],
664 + ],
665 + [
666 + 'type_select' => 'feature',
667 + 'feature_text' => 'Feature 5',
668 + 'feature_icon_color' => '#6DD400',
669 + 'select_icon' => ['value' => 'fas fa-check', 'library' => 'fa-solid'],
670 + ],
671 + [
672 + 'type_select' => 'button',
673 + 'select_icon' => '',
674 + ],
675 + [
676 + 'type_select' => 'text',
677 + ],
678 + ],
679 + 'title_field' => '<# if( "feature" === type_select ) { #> Feature - {{ feature_text }} <# }
680 + else if( "heading" === type_select ) { #> Heading - {{ heading_title }} <# }
681 + else if( "price" === type_select ) { #> Price - {{ price }} <# }
682 + else if( "text" === type_select ) { #> Text - {{ text }} <# }
683 + else if( "button" === type_select ) { #> Button - {{ btn_text }} <# }
684 + else if( "divider" === type_select ) { #> Divider - {{ divider_style }} <# }
685 + else {#> {{ type_select }} <# } #>',
686 + ]
687 + );
688 +
689 + $this->end_controls_section();
690 +
691 + $this->start_controls_section(
692 + 'section_badge',
693 + [
694 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Badge', 'king-addons'),
695 + 'type' => Controls_Manager::SECTION,
696 + ]
697 + );
698 +
699 + $this->add_control(
700 + 'badge_style',
701 + [
702 + 'type' => Controls_Manager::SELECT,
703 + 'label' => esc_html__('Style', 'king-addons'),
704 + 'default' => 'corner',
705 + 'options' => [
706 + 'none' => esc_html__('None', 'king-addons'),
707 + 'corner' => esc_html__('Corner', 'king-addons'),
708 + 'circle' => esc_html__('circle', 'king-addons'),
709 + 'flag' => esc_html__('Flag', 'king-addons'),
710 + ],
711 + ]
712 + );
713 +
714 + $this->add_control(
715 + 'badge_title',
716 + [
717 + 'label' => esc_html__(' Title', 'king-addons'),
718 + 'type' => Controls_Manager::TEXT,
719 + 'dynamic' => [
720 + 'active' => true,
721 + ],
722 + 'default' => 'Sale',
723 + 'condition' => [
724 + 'badge_style!' => 'none',
725 + ],
726 + ]
727 + );
728 +
729 + $this->add_control(
730 + 'badge_hr_position',
731 + [
732 + 'label' => esc_html__('Horizontal Position', 'king-addons'),
733 + 'type' => Controls_Manager::CHOOSE,
734 + 'label_block' => false,
735 + 'default' => 'right',
736 + 'options' => [
737 + 'left' => [
738 + 'title' => esc_html__('Left', 'king-addons'),
739 + 'icon' => 'eicon-h-align-left',
740 + ],
741 + 'right' => [
742 + 'title' => esc_html__('Right', 'king-addons'),
743 + 'icon' => 'eicon-h-align-right',
744 + ]
745 + ],
746 + 'condition' => [
747 + 'badge_style!' => 'none',
748 + ],
749 + ]
750 + );
751 +
752 + $this->add_responsive_control(
753 + 'badge_circle_size',
754 + [
755 + 'label' => esc_html__('Size', 'king-addons'),
756 + 'type' => Controls_Manager::SLIDER,
757 + 'size_units' => ['px'],
758 + 'range' => [
759 + 'px' => [
760 + 'min' => 0,
761 + 'max' => 100,
762 + ],
763 + ],
764 + 'default' => [
765 + 'unit' => 'px',
766 + 'size' => 60,
767 + ],
768 + 'selectors' => [
769 + '{{WRAPPER}} .king-addons-pricing-table-badge-circle .king-addons-pricing-table-badge-inner' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};',
770 + ],
771 + 'condition' => [
772 + 'badge_style' => 'circle',
773 + 'badge_style!' => 'none',
774 + ],
775 + ]
776 + );
777 +
778 + $this->add_responsive_control(
779 + 'badge_circle_top_distance',
780 + [
781 + 'label' => esc_html__('Top Distance', 'king-addons'),
782 + 'type' => Controls_Manager::SLIDER,
783 + 'size_units' => ['%'],
784 + 'range' => [
785 + '%' => [
786 + 'min' => -50,
787 + 'max' => 50,
788 + ],
789 + ],
790 + 'default' => [
791 + 'unit' => '%',
792 + 'size' => 40,
793 + ],
794 + 'selectors' => [
795 + '{{WRAPPER}} .king-addons-pricing-table-badge-circle' => 'transform: translateX({{badge_circle_side_distance.SIZE}}%) translateY({{SIZE}}%);',
796 + ],
797 + 'condition' => [
798 + 'badge_style' => 'circle',
799 + 'badge_style!' => 'none',
800 + ],
801 + ]
802 + );
803 +
804 + $this->add_responsive_control(
805 + 'badge_circle_side_distance',
806 + [
807 + 'label' => esc_html__('Side Distance', 'king-addons'),
808 + 'type' => Controls_Manager::SLIDER,
809 + 'size_units' => ['%'],
810 + 'range' => [
811 + '%' => [
812 + 'min' => -50,
813 + 'max' => 50,
814 + ],
815 + ],
816 + 'default' => [
817 + 'unit' => '%',
818 + 'size' => 40,
819 + ],
820 + 'selectors' => [
821 + '{{WRAPPER}} .king-addons-pricing-table-badge-circle' => 'transform: translateX({{SIZE}}%) translateY({{badge_circle_top_distance.SIZE}}%);',
822 + ],
823 + 'condition' => [
824 + 'badge_style' => 'circle',
825 + 'badge_style!' => 'none',
826 + ],
827 + ]
828 + );
829 +
830 + $this->add_responsive_control(
831 + 'badge_distance',
832 + [
833 + 'label' => esc_html__('Distance', 'king-addons'),
834 + 'type' => Controls_Manager::SLIDER,
835 + 'size_units' => ['px'],
836 + 'range' => [
837 + 'px' => [
838 + 'min' => 0,
839 + 'max' => 80,
840 + ],
841 + ],
842 + 'default' => [
843 + 'unit' => 'px',
844 + 'size' => 25,
845 + ],
846 + 'selectors' => [
847 + '{{WRAPPER}} .king-addons-pricing-table-badge-corner .king-addons-pricing-table-badge-inner' => 'margin-top: {{SIZE}}{{UNIT}}; transform: translateY(-50%) translateX(-50%) translateX({{SIZE}}{{UNIT}}) rotate(-45deg);',
848 + '{{WRAPPER}} .king-addons-pricing-table-badge-flag' => 'top: {{SIZE}}{{UNIT}};',
849 + ],
850 + 'condition' => [
851 + 'badge_style!' => ['none', 'circle'],
852 + ],
853 + ]
854 + );
855 +
856 + $this->end_controls_section();
857 +
858 + $this->start_controls_section(
859 + 'pr_table_section_hv_animation',
860 + [
861 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Hover Animation', 'king-addons'),
862 + 'tab' => Controls_Manager::SECTION,
863 + ]
864 + );
865 +
866 + $this->add_control(
867 + 'hv_animation',
868 + [
869 + 'type' => Controls_Manager::SELECT,
870 + 'label' => esc_html__('Effect', 'king-addons'),
871 + 'default' => 'none',
872 + 'options' => [
873 + 'none' => esc_html__('None', 'king-addons'),
874 + 'slide' => esc_html__('Slide', 'king-addons'),
875 + 'bounce' => esc_html__('Bounce', 'king-addons'),
876 + ],
877 + 'prefix_class' => 'king-addons-pricing-table-animation-',
878 + ]
879 + );
880 +
881 + $this->add_control(
882 + 'hv_animation_duration',
883 + [
884 + 'label' => esc_html__('Animation Duration (ms)', 'king-addons'),
885 + 'type' => Controls_Manager::NUMBER,
886 + 'default' => 200,
887 + 'min' => 0,
888 + 'step' => 50,
889 + 'selectors' => [
890 + '{{WRAPPER}}.king-addons-pricing-table-animation-slide' => 'transition-duration: {{VALUE}}ms;',
891 + '{{WRAPPER}}.king-addons-pricing-table-animation-bounce' => 'animation-duration: {{VALUE}}ms;',
892 + '{{WRAPPER}}.king-addons-pricing-table-animation-zoom' => 'transition-duration: {{VALUE}}ms;',
893 + ],
894 +
895 + ]
896 + );
897 +
898 + $this->end_controls_section();
899 +
900 + Core::renderProFeaturesSection($this, '', Controls_Manager::RAW_HTML, 'pricing-table', [
901 + 'Tooltip Popup',
902 + 'List Item Advanced Tooltip',
903 + 'List Item Even/Odd Background Color',
904 + 'Advanced Button Animations',
905 + ]);
906 +
907 + $this->start_controls_section(
908 + 'pr_table_section_style_heading',
909 + [
910 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Heading', 'king-addons'),
911 + 'tab' => Controls_Manager::TAB_STYLE,
912 + ]
913 + );
914 +
915 + $this->add_group_control(
916 + Group_Control_Background::get_type(),
917 + [
918 + 'name' => 'heading_bg_color',
919 + 'types' => ['classic', 'gradient'],
920 + 'fields_options' => [
921 + 'color' => [
922 + 'default' => '#f7f7f7',
923 + ],
924 + 'background' => [
925 + 'default' => 'classic',
926 + ]
927 + ],
928 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-heading'
929 + ]
930 + );
931 +
932 + $this->add_responsive_control(
933 + 'heading_section_padding',
934 + [
935 + 'label' => esc_html__('Padding', 'king-addons'),
936 + 'type' => Controls_Manager::DIMENSIONS,
937 + 'default' => [
938 + 'top' => 25,
939 + 'right' => 20,
940 + 'bottom' => 25,
941 + 'left' => 20,
942 + ],
943 + 'size_units' => ['px',],
944 + 'selectors' => [
945 + '{{WRAPPER}} .king-addons-pricing-table-heading' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
946 + ],
947 + 'separator' => 'before'
948 + ]
949 + );
950 +
951 + $this->add_control(
952 + 'title_section',
953 + [
954 + 'label' => esc_html__('Title', 'king-addons'),
955 + 'type' => Controls_Manager::HEADING,
956 + 'separator' => 'before',
957 + ]
958 + );
959 +
960 + $this->add_control(
961 + 'heading_title_color',
962 + [
963 + 'label' => esc_html__('Color', 'king-addons'),
964 + 'type' => Controls_Manager::COLOR,
965 + 'default' => '#2d2d2d',
966 + 'selectors' => [
967 + '{{WRAPPER}} .king-addons-pricing-table-title' => 'color: {{VALUE}};',
968 + ],
969 + ]
970 + );
971 +
972 + $this->add_group_control(
973 + Group_Control_Typography::get_type(),
974 + [
975 + 'name' => 'heading_title_typography',
976 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-title',
977 + ]
978 + );
979 +
980 + $this->add_control(
981 + 'heading_title_distance',
982 + [
983 + 'label' => esc_html__('Distance', 'king-addons'),
984 + 'type' => Controls_Manager::SLIDER,
985 + 'size_units' => ['px'],
986 + 'range' => [
987 + 'px' => [
988 + 'min' => 0,
989 + 'max' => 50,
990 + ],
991 + ],
992 + 'default' => [
993 + 'unit' => 'px',
994 + 'size' => 0,
995 + ],
996 + 'selectors' => [
997 + '{{WRAPPER}} .king-addons-pricing-table-title' => 'margin: 0 0 {{SIZE}}{{UNIT}};',
998 + ],
999 + ]
1000 + );
1001 +
1002 + $this->add_control(
1003 + 'sub_title_section',
1004 + [
1005 + 'label' => esc_html__('Sub Title', 'king-addons'),
1006 + 'type' => Controls_Manager::HEADING,
1007 + 'separator' => 'before',
1008 + ]
1009 + );
1010 +
1011 + $this->add_control(
1012 + 'heading_sub_title_color',
1013 + [
1014 + 'label' => esc_html__('Color', 'king-addons'),
1015 + 'type' => Controls_Manager::COLOR,
1016 + 'default' => '#919191',
1017 + 'selectors' => [
1018 + '{{WRAPPER}} .king-addons-pricing-table-sub-title' => 'color: {{VALUE}};',
1019 + ],
1020 + ]
1021 + );
1022 +
1023 + $this->add_group_control(
1024 + Group_Control_Typography::get_type(),
1025 + [
1026 + 'name' => 'heading_sub_title_typography',
1027 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-sub-title',
1028 + ]
1029 + );
1030 +
1031 + $this->add_control(
1032 + 'icon_section',
1033 + [
1034 + 'label' => esc_html__('Icon / Image', 'king-addons'),
1035 + 'type' => Controls_Manager::HEADING,
1036 + 'separator' => 'before',
1037 + ]
1038 + );
1039 +
1040 + $this->add_control(
1041 + 'heading_icon_color',
1042 + [
1043 + 'label' => esc_html__('Color', 'king-addons'),
1044 + 'type' => Controls_Manager::COLOR,
1045 + 'default' => '#5B03FF',
1046 + 'selectors' => [
1047 + '{{WRAPPER}} .king-addons-pricing-table-icon' => 'color: {{VALUE}};',
1048 + ],
1049 + ]
1050 + );
1051 +
1052 + $this->add_control(
1053 + 'heading_icon_position',
1054 + [
1055 + 'label' => esc_html__('Icon Position', 'king-addons'),
1056 + 'type' => Controls_Manager::CHOOSE,
1057 + 'label_block' => false,
1058 + 'default' => 'center',
1059 + 'options' => [
1060 + 'left' => [
1061 + 'title' => esc_html__('Left', 'king-addons'),
1062 + 'icon' => 'eicon-h-align-left',
1063 + ],
1064 + 'center' => [
1065 + 'title' => esc_html__('Center', 'king-addons'),
1066 + 'icon' => 'eicon-h-align-center',
1067 + ],
1068 + 'right' => [
1069 + 'title' => esc_html__('Right', 'king-addons'),
1070 + 'icon' => 'eicon-h-align-right',
1071 + ]
1072 + ],
1073 + 'prefix_class' => 'king-addons-pricing-table-heading-',
1074 + ]
1075 + );
1076 +
1077 + $this->add_responsive_control(
1078 + 'heading_icon_size',
1079 + [
1080 + 'label' => esc_html__('Size', 'king-addons'),
1081 + 'type' => Controls_Manager::SLIDER,
1082 + 'size_units' => ['px', '%'],
1083 + 'range' => [
1084 + 'px' => [
1085 + 'min' => 10,
1086 + 'max' => 500,
1087 + ],
1088 + ],
1089 + 'default' => [
1090 + 'unit' => 'px',
1091 + 'size' => 35,
1092 + ],
1093 + 'selectors' => [
1094 + '{{WRAPPER}} .king-addons-pricing-table-icon i' => 'font-size: {{SIZE}}{{UNIT}};',
1095 + '{{WRAPPER}} .king-addons-pricing-table-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
1096 + '{{WRAPPER}} .king-addons-pricing-table-icon img' => 'max-width: {{SIZE}}{{UNIT}};',
1097 + ],
1098 + ]
1099 + );
1100 +
1101 + $this->add_control(
1102 + 'heading_icon_distance',
1103 + [
1104 + 'label' => esc_html__('Distance', 'king-addons'),
1105 + 'type' => Controls_Manager::SLIDER,
1106 + 'size_units' => ['px'],
1107 + 'range' => [
1108 + 'px' => [
1109 + 'min' => 0,
1110 + 'max' => 50,
1111 + ],
1112 + ],
1113 + 'default' => [
1114 + 'unit' => 'px',
1115 + 'size' => 12,
1116 + ],
1117 + 'selectors' => [
1118 + '{{WRAPPER}}.king-addons-pricing-table-heading-left .king-addons-pricing-table-icon' => 'margin-right: {{SIZE}}{{UNIT}};',
1119 + '{{WRAPPER}}.king-addons-pricing-table-heading-center .king-addons-pricing-table-icon' => 'margin-bottom: {{SIZE}}{{UNIT}};',
1120 + '{{WRAPPER}}.king-addons-pricing-table-heading-right .king-addons-pricing-table-icon' => 'margin-left: {{SIZE}}{{UNIT}};',
1121 + ],
1122 + ]
1123 + );
1124 +
1125 + $this->end_controls_section();
1126 +
1127 + $this->start_controls_section(
1128 + 'pr_table_section_style_price',
1129 + [
1130 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Price', 'king-addons'),
1131 + 'tab' => Controls_Manager::TAB_STYLE,
1132 + ]
1133 + );
1134 +
1135 + $this->add_group_control(
1136 + Group_Control_Background::get_type(),
1137 + [
1138 + 'name' => 'price_wrap_bg_color',
1139 + 'types' => ['classic', 'gradient'],
1140 + 'fields_options' => [
1141 + 'color' => [
1142 + 'default' => '#5B03FF',
1143 + ],
1144 + 'background' => [
1145 + 'default' => 'classic',
1146 + ]
1147 + ],
1148 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-price'
1149 + ]
1150 + );
1151 +
1152 + $this->add_responsive_control(
1153 + 'price_wrap_padding',
1154 + [
1155 + 'label' => esc_html__('Padding', 'king-addons'),
1156 + 'type' => Controls_Manager::DIMENSIONS,
1157 + 'size_units' => ['px'],
1158 + 'default' => [
1159 + 'top' => 40,
1160 + 'right' => 20,
1161 + 'bottom' => 30,
1162 + 'left' => 20,
1163 + ],
1164 + 'selectors' => [
1165 + '{{WRAPPER}} .king-addons-pricing-table-price' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1166 + ],
1167 + 'separator' => 'before'
1168 + ]
1169 + );
1170 +
1171 + $this->add_control(
1172 + 'price_section',
1173 + [
1174 + 'label' => esc_html__('Price', 'king-addons'),
1175 + 'type' => Controls_Manager::HEADING,
1176 + 'separator' => 'before',
1177 + ]
1178 + );
1179 +
1180 + $this->add_control(
1181 + 'price_color',
1182 + [
1183 + 'label' => esc_html__('Color', 'king-addons'),
1184 + 'type' => Controls_Manager::COLOR,
1185 + 'default' => '#ffffff',
1186 + 'selectors' => [
1187 + '{{WRAPPER}} .king-addons-pricing-table-price' => 'color: {{VALUE}};',
1188 + ],
1189 + ]
1190 + );
1191 +
1192 + $this->add_group_control(
1193 + Group_Control_Typography::get_type(),
1194 + [
1195 + 'name' => 'price_typography',
1196 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-price',
1197 + ]
1198 + );
1199 +
1200 + $this->add_control(
1201 + 'sub_price_section',
1202 + [
1203 + 'label' => esc_html__('Sub Price', 'king-addons'),
1204 + 'type' => Controls_Manager::HEADING,
1205 + 'separator' => 'before',
1206 + ]
1207 + );
1208 +
1209 + $this->add_responsive_control(
1210 + 'sub_price_size',
1211 + [
1212 + 'label' => esc_html__('Size', 'king-addons'),
1213 + 'type' => Controls_Manager::SLIDER,
1214 + 'size_units' => ['px'],
1215 + 'range' => [
1216 + 'px' => [
1217 + 'min' => 0,
1218 + 'max' => 100,
1219 + ],
1220 + ],
1221 + 'default' => [
1222 + 'unit' => 'px',
1223 + 'size' => 19,
1224 + ],
1225 + 'selectors' => [
1226 + '{{WRAPPER}} .king-addons-pricing-table-sub-price' => 'font-size: {{SIZE}}{{UNIT}};',
1227 + ],
1228 + ]
1229 + );
1230 +
1231 + $this->add_control(
1232 + 'sub_price_vr_position',
1233 + [
1234 + 'label' => esc_html__('Vertical Position', 'king-addons'),
1235 + 'type' => Controls_Manager::CHOOSE,
1236 + 'label_block' => false,
1237 + 'options' => [
1238 + 'top' => [
1239 + 'title' => esc_html__('Top', 'king-addons'),
1240 + 'icon' => 'eicon-v-align-top',
1241 + ],
1242 + 'middle' => [
1243 + 'title' => esc_html__('Middle', 'king-addons'),
1244 + 'icon' => 'eicon-v-align-middle',
1245 + ],
1246 + 'bottom' => [
1247 + 'title' => esc_html__('Bottom', 'king-addons'),
1248 + 'icon' => 'eicon-v-align-bottom',
1249 + ],
1250 + ],
1251 + 'default' => 'top',
1252 + 'selectors_dictionary' => [
1253 + 'top' => 'flex-start',
1254 + 'middle' => 'center',
1255 + 'bottom' => 'flex-end',
1256 + ],
1257 + 'selectors' => [
1258 + '{{WRAPPER}} .king-addons-pricing-table-sub-price' => '-webkit-align-self: {{VALUE}}; align-self: {{VALUE}};',
1259 + ],
1260 + ]
1261 + );
1262 +
1263 + $this->add_control(
1264 + 'currency_section',
1265 + [
1266 + 'label' => esc_html__('Currency Symbol', 'king-addons'),
1267 + 'type' => Controls_Manager::HEADING,
1268 + 'separator' => 'before',
1269 + ]
1270 + );
1271 +
1272 + $this->add_responsive_control(
1273 + 'currency_size',
1274 + [
1275 + 'label' => esc_html__('Size', 'king-addons'),
1276 + 'type' => Controls_Manager::SLIDER,
1277 + 'size_units' => ['px'],
1278 + 'range' => [
1279 + 'px' => [
1280 + 'min' => 0,
1281 + 'max' => 100,
1282 + ],
1283 + ],
1284 + 'default' => [
1285 + 'unit' => 'px',
1286 + 'size' => 24,
1287 + ],
1288 + 'selectors' => [
1289 + '{{WRAPPER}} .king-addons-pricing-table-currency' => 'font-size: {{SIZE}}{{UNIT}};',
1290 + ],
1291 + ]
1292 + );
1293 +
1294 + $this->add_control(
1295 + 'currency_hr_position',
1296 + [
1297 + 'label' => esc_html__('Alignment', 'king-addons'),
1298 + 'type' => Controls_Manager::CHOOSE,
1299 + 'label_block' => false,
1300 + 'default' => 'before',
1301 + 'options' => [
1302 + 'before' => [
1303 + 'title' => esc_html__('Before', 'king-addons'),
1304 + 'icon' => 'eicon-h-align-left',
1305 + ],
1306 + 'after' => [
1307 + 'title' => esc_html__('After', 'king-addons'),
1308 + 'icon' => 'eicon-h-align-right',
1309 + ],
1310 + ],
1311 + ]
1312 + );
1313 +
1314 + $this->add_control(
1315 + 'currency_vr_position',
1316 + [
1317 + 'label' => esc_html__('Vertical Position', 'king-addons'),
1318 + 'type' => Controls_Manager::CHOOSE,
1319 + 'label_block' => false,
1320 + 'options' => [
1321 + 'top' => [
1322 + 'title' => esc_html__('Top', 'king-addons'),
1323 + 'icon' => 'eicon-v-align-top',
1324 + ],
1325 + 'middle' => [
1326 + 'title' => esc_html__('Middle', 'king-addons'),
1327 + 'icon' => 'eicon-v-align-middle',
1328 + ],
1329 + 'bottom' => [
1330 + 'title' => esc_html__('Bottom', 'king-addons'),
1331 + 'icon' => 'eicon-v-align-bottom',
1332 + ],
1333 + ],
1334 + 'default' => 'top',
1335 + 'selectors_dictionary' => [
1336 + 'top' => 'flex-start',
1337 + 'middle' => 'center',
1338 + 'bottom' => 'flex-end',
1339 + ],
1340 + 'selectors' => [
1341 + '{{WRAPPER}} .king-addons-pricing-table-currency' => '-webkit-align-self: {{VALUE}}; align-self: {{VALUE}};',
1342 + ],
1343 + ]
1344 + );
1345 +
1346 + $this->add_control(
1347 + 'old_price_section',
1348 + [
1349 + 'label' => esc_html__('Old Price', 'king-addons'),
1350 + 'type' => Controls_Manager::HEADING,
1351 + 'separator' => 'before',
1352 + ]
1353 + );
1354 +
1355 + $this->add_control(
1356 + 'old_price_color',
1357 + [
1358 + 'label' => esc_html__('Color', 'king-addons'),
1359 + 'type' => Controls_Manager::COLOR,
1360 + 'default' => '#ffffff',
1361 + 'selectors' => [
1362 + '{{WRAPPER}} .king-addons-pricing-table-old-price' => 'color: {{VALUE}};',
1363 + ],
1364 + ]
1365 + );
1366 +
1367 + $this->add_responsive_control(
1368 + 'old_price_size',
1369 + [
1370 + 'label' => esc_html__('Size', 'king-addons'),
1371 + 'type' => Controls_Manager::SLIDER,
1372 + 'size_units' => ['px'],
1373 + 'range' => [
1374 + 'px' => [
1375 + 'min' => 0,
1376 + 'max' => 100,
1377 + ],
1378 + ],
1379 + 'default' => [
1380 + 'unit' => 'px',
1381 + 'size' => 20,
1382 + ],
1383 + 'selectors' => [
1384 + '{{WRAPPER}} .king-addons-pricing-table-old-price' => 'font-size: {{SIZE}}{{UNIT}};',
1385 + ],
1386 + ]
1387 + );
1388 +
1389 + $this->add_control(
1390 + 'old_price_vr_position',
1391 + [
1392 + 'label' => esc_html__('Vertical Position', 'king-addons'),
1393 + 'type' => Controls_Manager::CHOOSE,
1394 + 'label_block' => false,
1395 + 'options' => [
1396 + 'top' => [
1397 + 'title' => esc_html__('Top', 'king-addons'),
1398 + 'icon' => 'eicon-v-align-top',
1399 + ],
1400 + 'middle' => [
1401 + 'title' => esc_html__('Middle', 'king-addons'),
1402 + 'icon' => 'eicon-v-align-middle',
1403 + ],
1404 + 'bottom' => [
1405 + 'title' => esc_html__('Bottom', 'king-addons'),
1406 + 'icon' => 'eicon-v-align-bottom',
1407 + ],
1408 + ],
1409 + 'default' => 'middle',
1410 + 'selectors_dictionary' => [
1411 + 'top' => 'flex-start',
1412 + 'middle' => 'center',
1413 + 'bottom' => 'flex-end',
1414 + ],
1415 + 'selectors' => [
1416 + '{{WRAPPER}} .king-addons-pricing-table-old-price' => '-webkit-align-self: {{VALUE}}; align-self: {{VALUE}};',
1417 + ],
1418 + ]
1419 + );
1420 +
1421 + $this->add_control(
1422 + 'period_section',
1423 + [
1424 + 'label' => esc_html__('Period', 'king-addons'),
1425 + 'type' => Controls_Manager::HEADING,
1426 + 'separator' => 'before',
1427 + ]
1428 + );
1429 +
1430 + $this->add_control(
1431 + 'period_color',
1432 + [
1433 + 'label' => esc_html__('Color', 'king-addons'),
1434 + 'type' => Controls_Manager::COLOR,
1435 + 'default' => '#ffffff',
1436 + 'selectors' => [
1437 + '{{WRAPPER}} .king-addons-pricing-table-period' => 'color: {{VALUE}};',
1438 + ],
1439 + ]
1440 + );
1441 +
1442 + $this->add_group_control(
1443 + Group_Control_Typography::get_type(),
1444 + [
1445 + 'name' => 'period_typography',
1446 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-period',
1447 + ]
1448 + );
1449 +
1450 + $this->add_control(
1451 + 'period_hr_position',
1452 + [
1453 + 'label' => esc_html__('Position', 'king-addons'),
1454 + 'type' => Controls_Manager::SELECT,
1455 + 'label_block' => false,
1456 + 'options' => [
1457 + 'below' => esc_html__('Below', 'king-addons'),
1458 + 'beside' => esc_html__('Beside', 'king-addons'),
1459 + ],
1460 + 'default' => 'below',
1461 + ]
1462 + );
1463 +
1464 + $this->end_controls_section();
1465 +
1466 + $this->start_controls_section(
1467 + 'pr_table_section_style_features',
1468 + [
1469 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Features', 'king-addons'),
1470 + 'tab' => Controls_Manager::TAB_STYLE,
1471 + ]
1472 + );
1473 +
1474 + $this->add_control(
1475 + 'feature_bg_color',
1476 + [
1477 + 'label' => esc_html__('Background Color', 'king-addons'),
1478 + 'type' => Controls_Manager::COLOR,
1479 + 'default' => '#f7f7f7',
1480 + 'selectors' => [
1481 + '{{WRAPPER}} .king-addons-pricing-table section' => 'background-color: {{VALUE}};',
1482 + ],
1483 + ]
1484 + );
1485 +
1486 + $this->add_controls_group_feature_even_bg();
1487 +
1488 + $this->add_responsive_control(
1489 + 'feature_section_padding',
1490 + [
1491 + 'label' => esc_html__('Padding', 'king-addons'),
1492 + 'type' => Controls_Manager::DIMENSIONS,
1493 + 'default' => [
1494 + 'top' => 15,
1495 + 'right' => 15,
1496 + 'bottom' => 15,
1497 + 'left' => 15,
1498 + ],
1499 + 'size_units' => ['px',],
1500 + 'selectors' => [
1501 + '{{WRAPPER}} .king-addons-pricing-table-feature-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1502 + ],
1503 + 'separator' => 'before',
1504 + ]
1505 + );
1506 +
1507 + $this->add_control(
1508 + 'feature_section_top_distance',
1509 + [
1510 + 'label' => esc_html__('List Top Distance', 'king-addons'),
1511 + 'type' => Controls_Manager::SLIDER,
1512 + 'size_units' => ['px'],
1513 + 'range' => [
1514 + 'px' => [
1515 + 'min' => 0,
1516 + 'max' => 50,
1517 + ],
1518 + ],
1519 + 'default' => [
1520 + 'unit' => 'px',
1521 + 'size' => 0,
1522 + ],
1523 + 'selectors' => [
1524 + '{{WRAPPER}} .king-addons-pricing-table-feature:first-of-type' => 'padding-top: {{SIZE}}{{UNIT}};',
1525 + ],
1526 + ]
1527 + );
1528 +
1529 + $this->add_control(
1530 + 'feature_section_bot_distance',
1531 + [
1532 + 'label' => esc_html__('List Bottom Distance', 'king-addons'),
1533 + 'type' => Controls_Manager::SLIDER,
1534 + 'size_units' => ['px'],
1535 + 'range' => [
1536 + 'px' => [
1537 + 'min' => 0,
1538 + 'max' => 50,
1539 + ],
1540 + ],
1541 + 'default' => [
1542 + 'unit' => 'px',
1543 + 'size' => 0,
1544 + ],
1545 + 'selectors' => [
1546 + '{{WRAPPER}} .king-addons-pricing-table-feature:last-of-type' => 'padding-bottom: {{SIZE}}{{UNIT}};',
1547 + ],
1548 + ]
1549 + );
1550 +
1551 + $this->add_control(
1552 + 'feature_color',
1553 + [
1554 + 'label' => esc_html__('Color', 'king-addons'),
1555 + 'type' => Controls_Manager::COLOR,
1556 + 'default' => '#54595f',
1557 + 'separator' => 'before',
1558 + 'selectors' => [
1559 + '{{WRAPPER}} .king-addons-pricing-table-feature span > span' => 'color: {{VALUE}};',
1560 + ],
1561 + ]
1562 + );
1563 +
1564 + $this->add_group_control(
1565 + Group_Control_Typography::get_type(),
1566 + [
1567 + 'name' => 'feature_typography',
1568 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-feature',
1569 + ]
1570 + );
1571 +
1572 + $this->add_responsive_control(
1573 + 'feature_align',
1574 + [
1575 + 'label' => esc_html__('Alignment', 'king-addons'),
1576 + 'type' => Controls_Manager::CHOOSE,
1577 + 'label_block' => false,
1578 + 'default' => 'center',
1579 + 'options' => [
1580 + 'flex-start' => [
1581 + 'title' => esc_html__('Left', 'king-addons'),
1582 + 'icon' => 'eicon-text-align-left',
1583 + ],
1584 + 'center' => [
1585 + 'title' => esc_html__('Center', 'king-addons'),
1586 + 'icon' => 'eicon-text-align-center',
1587 + ],
1588 + 'flex-end' => [
1589 + 'title' => esc_html__('Right', 'king-addons'),
1590 + 'icon' => 'eicon-text-align-right',
1591 + ],
1592 + ],
1593 + 'selectors_dictionary' => [
1594 + 'flex-start' => 'justify-content: flex-start; text-align: left;',
1595 + 'center' => 'justify-content: center; text-align: center;',
1596 + 'flex-end' => 'justify-content: flex-end; text-align: right;',
1597 + ],
1598 + 'selectors' => [
1599 + '{{WRAPPER}} .king-addons-pricing-table-feature-inner' => '{{VALUE}}',
1600 + ],
1601 + ]
1602 + );
1603 +
1604 + $this->add_responsive_control(
1605 + 'feature_width',
1606 + [
1607 + 'label' => esc_html__('Width', 'king-addons'),
1608 + 'type' => Controls_Manager::SLIDER,
1609 + 'range' => [
1610 + '%' => [
1611 + 'min' => 10,
1612 + 'max' => 100,
1613 + ],
1614 + 'px' => [
1615 + 'min' => 100,
1616 + 'max' => 1000,
1617 + ],
1618 + ],
1619 + 'size_units' => ['%', 'px'],
1620 + 'default' => [
1621 + 'unit' => 'px',
1622 + 'size' => 357,
1623 + ],
1624 + 'selectors' => [
1625 + '{{WRAPPER}} .king-addons-pricing-table-feature-inner' => 'max-width: {{SIZE}}{{UNIT}};',
1626 + ],
1627 + ]
1628 + );
1629 +
1630 + $this->add_control(
1631 + 'feature_icon_section',
1632 + [
1633 + 'label' => esc_html__('Icon', 'king-addons'),
1634 + 'type' => Controls_Manager::HEADING,
1635 + 'separator' => 'before',
1636 + ]
1637 + );
1638 +
1639 + $this->add_responsive_control(
1640 + 'feature_icon_size',
1641 + [
1642 + 'label' => esc_html__('Size', 'king-addons'),
1643 + 'type' => Controls_Manager::SLIDER,
1644 + 'size_units' => ['px'],
1645 + 'range' => [
1646 + 'px' => [
1647 + 'min' => 5,
1648 + 'max' => 30,
1649 + ],
1650 + ],
1651 + 'default' => [
1652 + 'unit' => 'px',
1653 + 'size' => 14,
1654 + ],
1655 + 'selectors' => [
1656 + '{{WRAPPER}} .king-addons-pricing-table-feature-icon' => 'font-size: {{SIZE}}{{UNIT}};',
1657 + ],
1658 + ]
1659 + );
1660 +
1661 + $this->add_control_stack_feature_tooltip_section();
1662 +
1663 + $this->add_control(
1664 + 'feature_divider',
1665 + [
1666 + 'label' => esc_html__('Divider', 'king-addons'),
1667 + 'type' => Controls_Manager::SWITCHER,
1668 + 'default' => 'yes',
1669 + 'label_off' => esc_html__('Off', 'king-addons'),
1670 + 'label_on' => esc_html__('On', 'king-addons'),
1671 + 'separator' => 'before',
1672 + ]
1673 + );
1674 +
1675 + $this->add_control(
1676 + 'feature_divider_color',
1677 + [
1678 + 'label' => esc_html__('Color', 'king-addons'),
1679 + 'type' => Controls_Manager::COLOR,
1680 + 'default' => '#d6d6d6',
1681 + 'selectors' => [
1682 + '{{WRAPPER}} .king-addons-pricing-table-feature:after' => 'border-bottom-color: {{VALUE}};',
1683 + ],
1684 + 'condition' => [
1685 + 'feature_divider' => 'yes',
1686 + ],
1687 + ]
1688 + );
1689 +
1690 + $this->add_control(
1691 + 'feature_divider_type',
1692 + [
1693 + 'label' => esc_html__('Style', 'king-addons'),
1694 + 'type' => Controls_Manager::SELECT,
1695 + 'options' => [
1696 + 'solid' => esc_html__('Solid', 'king-addons'),
1697 + 'double' => esc_html__('Double', 'king-addons'),
1698 + 'dotted' => esc_html__('Dotted', 'king-addons'),
1699 + 'dashed' => esc_html__('Dashed', 'king-addons'),
1700 + 'groove' => esc_html__('Groove', 'king-addons'),
1701 + ],
1702 + 'default' => 'dashed',
1703 + 'selectors' => [
1704 + '{{WRAPPER}} .king-addons-pricing-table-feature:after' => 'border-bottom-style: {{VALUE}};',
1705 + ],
1706 + 'condition' => [
1707 + 'feature_divider' => 'yes',
1708 + ],
1709 + ]
1710 + );
1711 +
1712 + $this->add_control(
1713 + 'feature_divider_weight',
1714 + [
1715 + 'label' => esc_html__('Weight', 'king-addons'),
1716 + 'type' => Controls_Manager::SLIDER,
1717 + 'size_units' => ['px'],
1718 + 'range' => [
1719 + 'px' => [
1720 + 'min' => 1,
1721 + 'max' => 5,
1722 + ],
1723 + ],
1724 + 'default' => [
1725 + 'size' => 1,
1726 + ],
1727 + 'selectors' => [
1728 + '{{WRAPPER}} .king-addons-pricing-table-feature:after' => 'border-bottom-width: {{SIZE}}{{UNIT}};',
1729 + ],
1730 + 'condition' => [
1731 + 'feature_divider' => 'yes',
1732 + ],
1733 + ]
1734 + );
1735 +
1736 + $this->add_control(
1737 + 'feature_divider_width',
1738 + [
1739 + 'label' => esc_html__('Width', 'king-addons'),
1740 + 'type' => Controls_Manager::SLIDER,
1741 + 'size_units' => ['%', 'px'],
1742 + 'range' => [
1743 + 'px' => [
1744 + 'min' => 0,
1745 + 'max' => 1000,
1746 + ],
1747 + '%' => [
1748 + 'min' => 1,
1749 + 'max' => 100,
1750 + ],
1751 + ],
1752 + 'default' => [
1753 + 'unit' => '%',
1754 + 'size' => 45,
1755 + ],
1756 + 'selectors' => [
1757 + '{{WRAPPER}} .king-addons-pricing-table-feature:after' => 'max-width: {{SIZE}}{{UNIT}};',
1758 + ],
1759 + 'condition' => [
1760 + 'feature_divider' => 'yes',
1761 + ],
1762 + ]
1763 + );
1764 +
1765 + $this->end_controls_section();
1766 +
1767 + $this->start_controls_section(
1768 + 'pr_table_section_style_btn',
1769 + [
1770 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Button', 'king-addons'),
1771 + 'tab' => Controls_Manager::TAB_STYLE,
1772 + ]
1773 + );
1774 +
1775 + $this->add_group_control(
1776 + Group_Control_Background::get_type(),
1777 + [
1778 + 'name' => 'btn_section_bg_color',
1779 + 'types' => ['classic', 'gradient'],
1780 + 'fields_options' => [
1781 + 'color' => [
1782 + 'default' => '#f7f7f7',
1783 + ],
1784 + 'background' => [
1785 + 'default' => 'classic',
1786 + ]
1787 + ],
1788 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-button'
1789 + ]
1790 + );
1791 +
1792 + $this->add_control(
1793 + 'btn_section_padding',
1794 + [
1795 + 'label' => esc_html__('Section Padding', 'king-addons'),
1796 + 'type' => Controls_Manager::DIMENSIONS,
1797 + 'default' => [
1798 + 'top' => 30,
1799 + 'right' => 0,
1800 + 'bottom' => 10,
1801 + 'left' => 0,
1802 + ],
1803 + 'size_units' => ['px'],
1804 + 'selectors' => [
1805 + '{{WRAPPER}} .king-addons-pricing-table-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1806 + ],
1807 + 'separator' => 'before',
1808 + ]
1809 + );
1810 +
1811 + $this->add_control(
1812 + 'btn_section_padding_divider',
1813 + [
1814 + 'type' => Controls_Manager::DIVIDER,
1815 + 'style' => 'thick',
1816 + ]
1817 + );
1818 +
1819 + $this->start_controls_tabs('tabs_btn_style');
1820 +
1821 + $this->start_controls_tab(
1822 + 'tab_btn_normal',
1823 + [
1824 + 'label' => esc_html__('Normal', 'king-addons'),
1825 + ]
1826 + );
1827 +
1828 + $this->add_group_control(
1829 + Group_Control_Background::get_type(),
1830 + [
1831 + 'name' => 'btn_bg_color',
1832 + 'types' => ['classic', 'gradient'],
1833 + 'fields_options' => [
1834 + 'color' => [
1835 + 'default' => '#000000',
1836 + ],
1837 + 'background' => [
1838 + 'default' => 'classic',
1839 + ]
1840 + ],
1841 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-btn'
1842 + ]
1843 + );
1844 +
1845 + $this->add_control(
1846 + 'btn_color',
1847 + [
1848 + 'label' => esc_html__('Color', 'king-addons'),
1849 + 'type' => Controls_Manager::COLOR,
1850 + 'default' => '#ffffff',
1851 + 'selectors' => [
1852 + '{{WRAPPER}} .king-addons-pricing-table-btn' => 'color: {{VALUE}}',
1853 + ],
1854 + ]
1855 + );
1856 +
1857 + $this->add_control(
1858 + 'btn_border_color',
1859 + [
1860 + 'label' => esc_html__('Border Color', 'king-addons'),
1861 + 'type' => Controls_Manager::COLOR,
1862 + 'default' => '#ffffff',
1863 + 'selectors' => [
1864 + '{{WRAPPER}} .king-addons-pricing-table-btn' => 'border-color: {{VALUE}}',
1865 + ],
1866 + ]
1867 + );
1868 +
1869 + $this->add_group_control(
1870 + Group_Control_Box_Shadow::get_type(),
1871 + [
1872 + 'name' => 'btn_box_shadow',
1873 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-btn',
1874 + ]
1875 + );
1876 +
1877 + $this->end_controls_tab();
1878 +
1879 + $this->start_controls_tab(
1880 + 'tab_btn_hover',
1881 + [
1882 + 'label' => esc_html__('Hover', 'king-addons'),
1883 + ]
1884 + );
1885 +
1886 + $this->add_group_control(
1887 + Group_Control_Background::get_type(),
1888 + [
1889 + 'name' => 'btn_hover_bg_color',
1890 + 'types' => ['classic', 'gradient'],
1891 + 'fields_options' => [
1892 + 'color' => [
1893 + 'default' => '#5b03ff',
1894 + ],
1895 + 'background' => [
1896 + 'default' => 'classic',
1897 + ]
1898 + ],
1899 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-btn.king-addons-button-none:hover, {{WRAPPER}} .king-addons-pricing-table-btn:before, {{WRAPPER}} .king-addons-pricing-table-btn:after'
1900 + ]
1901 + );
1902 +
1903 + $this->add_control(
1904 + 'btn_hover_color',
1905 + [
1906 + 'label' => esc_html__('Color', 'king-addons'),
1907 + 'type' => Controls_Manager::COLOR,
1908 + 'default' => '#ffffff',
1909 + 'selectors' => [
1910 + '{{WRAPPER}} .king-addons-pricing-table-btn:hover' => 'color: {{VALUE}}',
1911 + ],
1912 + ]
1913 + );
1914 +
1915 + $this->add_control(
1916 + 'btn_hover_border_color',
1917 + [
1918 + 'label' => esc_html__('Border Color', 'king-addons'),
1919 + 'type' => Controls_Manager::COLOR,
1920 + 'default' => '#ffffff',
1921 + 'selectors' => [
1922 + '{{WRAPPER}} .king-addons-pricing-table-btn:hover' => 'border-color: {{VALUE}}',
1923 + ],
1924 + ]
1925 + );
1926 +
1927 + $this->add_group_control(
1928 + Group_Control_Box_Shadow::get_type(),
1929 + [
1930 + 'name' => 'btn_hover_box_shadow',
1931 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-btn:hover',
1932 + ]
1933 + );
1934 +
1935 + $this->end_controls_tab();
1936 +
1937 + $this->end_controls_tabs();
1938 +
1939 + $this->add_control(
1940 + 'btn_section_anim_divider',
1941 + [
1942 + 'type' => Controls_Manager::DIVIDER,
1943 + 'style' => 'thick',
1944 + ]
1945 + );
1946 +
1947 + $this->add_control(
1948 + 'btn_animation',
1949 + [
1950 + 'label' => esc_html__('Select Animation', 'king-addons'),
1951 + 'type' => 'king-addons-button-animations',
1952 + 'default' => 'king-addons-button-sweep-to-top',
1953 + ]
1954 + );
1955 +
1956 + $this->add_control(
1957 + 'btn_transition_duration',
1958 + [
1959 + 'label' => esc_html__('Transition Duration (ms)', 'king-addons'),
1960 + 'type' => Controls_Manager::NUMBER,
1961 + 'default' => 300,
1962 + 'min' => 0,
1963 + 'step' => 50,
1964 + 'selectors' => [
1965 + '{{WRAPPER}} .king-addons-pricing-table-btn' => 'transition-duration: {{VALUE}}ms',
1966 + '{{WRAPPER}} .king-addons-pricing-table-btn:before' => 'transition-duration: {{VALUE}}ms',
1967 + '{{WRAPPER}} .king-addons-pricing-table-btn:after' => 'transition-duration: {{VALUE}}ms',
1968 + ],
1969 + ]
1970 + );
1971 +
1972 + $this->add_control(
1973 + 'btn_animation_height',
1974 + [
1975 + 'label' => esc_html__('Animation Height', 'king-addons'),
1976 + 'type' => Controls_Manager::SLIDER,
1977 + 'range' => [
1978 + '%' => [
1979 + 'min' => 0,
1980 + 'max' => 100,
1981 + ],
1982 + 'px' => [
1983 + 'min' => 0,
1984 + 'max' => 10,
1985 + ],
1986 + ],
1987 + 'size_units' => ['px'],
1988 + 'default' => [
1989 + 'unit' => 'px',
1990 + 'size' => 3,
1991 + ],
1992 + 'selectors' => [
1993 + '{{WRAPPER}} [class*="king-addons-button-underline"]:before' => 'height: {{SIZE}}{{UNIT}};',
1994 + '{{WRAPPER}} [class*="king-addons-button-overline"]:before' => 'height: {{SIZE}}{{UNIT}};',
1995 + ],
1996 + 'render_type' => 'template',
1997 + 'condition' => [
1998 + 'btn_animation' => [
1999 + 'king-addons-button-underline-from-left',
2000 + 'king-addons-button-underline-from-center',
2001 + 'king-addons-button-underline-from-right',
2002 + 'king-addons-button-underline-reveal',
2003 + 'king-addons-button-overline-reveal',
2004 + 'king-addons-button-overline-from-left',
2005 + 'king-addons-button-overline-from-center',
2006 + 'king-addons-button-overline-from-right'
2007 + ]
2008 + ],
2009 + ]
2010 + );
2011 +
2012 + if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
2013 + $this->add_control(
2014 + 'team_member_pro_notice_2',
2015 + [
2016 + 'type' => Controls_Manager::RAW_HTML,
2017 + 'raw' => 'Advanced button animations are available in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-pricing-table-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>',
2018 + 'content_classes' => 'king-addons-pro-notice',
2019 + ]
2020 + );
2021 + }
2022 +
2023 + $this->add_control(
2024 + 'btn_typography_divider',
2025 + [
2026 + 'type' => Controls_Manager::DIVIDER,
2027 + 'style' => 'thick',
2028 + ]
2029 + );
2030 +
2031 + $this->add_group_control(
2032 + Group_Control_Typography::get_type(),
2033 + [
2034 + 'name' => 'btn_typography',
2035 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-btn',
2036 + 'separator' => 'before',
2037 + ]
2038 + );
2039 +
2040 + $this->add_responsive_control(
2041 + 'btn_padding',
2042 + [
2043 + 'label' => esc_html__('Padding', 'king-addons'),
2044 + 'type' => Controls_Manager::DIMENSIONS,
2045 + 'size_units' => ['px'],
2046 + 'default' => [
2047 + 'top' => 10,
2048 + 'right' => 40,
2049 + 'bottom' => 10,
2050 + 'left' => 40,
2051 + ],
2052 + 'selectors' => [
2053 + '{{WRAPPER}} .king-addons-pricing-table-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2054 + ],
2055 + 'separator' => 'before',
2056 + ]
2057 + );
2058 +
2059 + $this->add_control(
2060 + 'btn_border_type',
2061 + [
2062 + 'label' => esc_html__('Border Type', 'king-addons'),
2063 + 'type' => Controls_Manager::SELECT,
2064 + 'options' => [
2065 + 'none' => esc_html__('None', 'king-addons'),
2066 + 'solid' => esc_html__('Solid', 'king-addons'),
2067 + 'double' => esc_html__('Double', 'king-addons'),
2068 + 'dotted' => esc_html__('Dotted', 'king-addons'),
2069 + 'dashed' => esc_html__('Dashed', 'king-addons'),
2070 + 'groove' => esc_html__('Groove', 'king-addons'),
2071 + ],
2072 + 'default' => 'none',
2073 + 'selectors' => [
2074 + '{{WRAPPER}} .king-addons-pricing-table-btn' => 'border-style: {{VALUE}};',
2075 + ],
2076 + 'separator' => 'before',
2077 + ]
2078 + );
2079 +
2080 + $this->add_responsive_control(
2081 + 'btn_border_width',
2082 + [
2083 + 'label' => esc_html__('Border Width', 'king-addons'),
2084 + 'type' => Controls_Manager::DIMENSIONS,
2085 + 'size_units' => ['px'],
2086 + 'default' => [
2087 + 'top' => 1,
2088 + 'right' => 1,
2089 + 'bottom' => 1,
2090 + 'left' => 1,
2091 + ],
2092 + 'selectors' => [
2093 + '{{WRAPPER}} .king-addons-pricing-table-btn' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2094 + ],
2095 + 'condition' => [
2096 + 'btn_border_type!' => 'none',
2097 + ],
2098 + ]
2099 + );
2100 +
2101 + $this->add_responsive_control(
2102 + 'btn_border_radius',
2103 + [
2104 + 'label' => esc_html__('Border Radius', 'king-addons'),
2105 + 'type' => Controls_Manager::DIMENSIONS,
2106 + 'size_units' => ['px', '%'],
2107 + 'default' => [
2108 + 'top' => 2,
2109 + 'right' => 2,
2110 + 'bottom' => 2,
2111 + 'left' => 2,
2112 + ],
2113 + 'selectors' => [
2114 + '{{WRAPPER}} .king-addons-pricing-table-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2115 + ],
2116 + 'separator' => 'before',
2117 + ]
2118 + );
2119 +
2120 + $this->end_controls_section();
2121 +
2122 + $this->start_controls_section(
2123 + 'pr_table_section_style_text',
2124 + [
2125 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Text', 'king-addons'),
2126 + 'tab' => Controls_Manager::TAB_STYLE,
2127 + ]
2128 + );
2129 +
2130 + $this->add_group_control(
2131 + Group_Control_Background::get_type(),
2132 + [
2133 + 'name' => 'text_section_bg_color',
2134 + 'types' => ['classic', 'gradient'],
2135 + 'fields_options' => [
2136 + 'color' => [
2137 + 'default' => '#f7f7f7',
2138 + ],
2139 + 'background' => [
2140 + 'default' => 'classic',
2141 + ]
2142 + ],
2143 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-text'
2144 + ]
2145 + );
2146 +
2147 + $this->add_control(
2148 + 'text_section_padding',
2149 + [
2150 + 'label' => esc_html__('Padding', 'king-addons'),
2151 + 'type' => Controls_Manager::DIMENSIONS,
2152 + 'default' => [
2153 + 'top' => 5,
2154 + 'right' => 70,
2155 + 'bottom' => 30,
2156 + 'left' => 70,
2157 + ],
2158 + 'size_units' => ['px'],
2159 + 'selectors' => [
2160 + '{{WRAPPER}} .king-addons-pricing-table-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2161 + ],
2162 + 'separator' => 'before'
2163 + ]
2164 + );
2165 +
2166 + $this->add_control(
2167 + 'text_color',
2168 + [
2169 + 'type' => Controls_Manager::COLOR,
2170 + 'label' => esc_html__('Color', 'king-addons'),
2171 + 'default' => '#a5a5a5',
2172 + 'selectors' => [
2173 + '{{WRAPPER}} .king-addons-pricing-table-text' => 'color: {{VALUE}};',
2174 + ],
2175 + 'separator' => 'before'
2176 + ]
2177 + );
2178 +
2179 + $this->add_group_control(
2180 + Group_Control_Typography::get_type(),
2181 + [
2182 + 'name' => 'text_typography',
2183 + 'label' => esc_html__('Typography', 'king-addons'),
2184 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-text'
2185 + ]
2186 + );
2187 +
2188 + $this->add_control(
2189 + 'text_align',
2190 + [
2191 + 'label' => esc_html__('Alignment', 'king-addons'),
2192 + 'type' => Controls_Manager::CHOOSE,
2193 + 'label_block' => false,
2194 + 'default' => 'center',
2195 + 'options' => [
2196 + 'left' => [
2197 + 'title' => esc_html__('Left', 'king-addons'),
2198 + 'icon' => 'eicon-text-align-left',
2199 + ],
2200 + 'center' => [
2201 + 'title' => esc_html__('Center', 'king-addons'),
2202 + 'icon' => 'eicon-text-align-center',
2203 + ],
2204 + 'right' => [
2205 + 'title' => esc_html__('Right', 'king-addons'),
2206 + 'icon' => 'eicon-text-align-right',
2207 + ],
2208 + ],
2209 + 'selectors' => [
2210 + '{{WRAPPER}} .king-addons-pricing-table-text' => 'text-align: {{VALUE}};',
2211 + ],
2212 + ]
2213 + );
2214 +
2215 +
2216 + $this->end_controls_section();
2217 +
2218 + $this->start_controls_section(
2219 + 'pr_table_section_style_badge',
2220 + [
2221 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Badge', 'king-addons'),
2222 + 'tab' => Controls_Manager::TAB_STYLE,
2223 + ]
2224 + );
2225 +
2226 + $this->add_control(
2227 + 'badge_text_color',
2228 + [
2229 + 'type' => Controls_Manager::COLOR,
2230 + 'label' => esc_html__('Color', 'king-addons'),
2231 + 'default' => '#ffffff',
2232 + 'selectors' => [
2233 + '{{WRAPPER}} .king-addons-pricing-table-badge-inner' => 'color: {{VALUE}};',
2234 + ],
2235 + ]
2236 + );
2237 +
2238 + $this->add_control(
2239 + 'badge_bg_color',
2240 + [
2241 + 'type' => Controls_Manager::COLOR,
2242 + 'label' => esc_html__('Background Color', 'king-addons'),
2243 + 'default' => '#e83d17',
2244 + 'selectors' => [
2245 + '{{WRAPPER}} .king-addons-pricing-table-badge-inner' => 'background-color: {{VALUE}};',
2246 + '{{WRAPPER}} .king-addons-pricing-table-badge-flag:before' => ' border-top-color: {{VALUE}};',
2247 + ],
2248 + 'separator' => 'after',
2249 + ]
2250 + );
2251 +
2252 + $this->add_group_control(
2253 + Group_Control_Typography::get_type(),
2254 + [
2255 + 'name' => 'badge_typography',
2256 + 'label' => esc_html__('Typography', 'king-addons'),
2257 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-badge-inner'
2258 + ]
2259 + );
2260 +
2261 + $this->add_group_control(
2262 + Group_Control_Box_Shadow::get_type(),
2263 + [
2264 + 'name' => 'badge_box_shadow',
2265 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table-badge-inner'
2266 + ]
2267 + );
2268 +
2269 + $this->add_responsive_control(
2270 + 'badge_padding',
2271 + [
2272 + 'label' => esc_html__('Padding', 'king-addons'),
2273 + 'type' => Controls_Manager::DIMENSIONS,
2274 + 'default' => [
2275 + 'top' => 0,
2276 + 'right' => 10,
2277 + 'bottom' => 0,
2278 + 'left' => 10,
2279 + ],
2280 + 'size_units' => ['px'],
2281 + 'selectors' => [
2282 + '{{WRAPPER}} .king-addons-pricing-table-badge .king-addons-pricing-table-badge-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2283 + ],
2284 + 'separator' => 'before',
2285 + ]
2286 + );
2287 +
2288 + $this->end_controls_section();
2289 +
2290 + $this->start_controls_section(
2291 + 'section_style_wrapper',
2292 + [
2293 + 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Wrapper', 'king-addons'),
2294 + 'tab' => Controls_Manager::TAB_STYLE,
2295 + ]
2296 + );
2297 +
2298 + $this->start_controls_tabs('tabs_wrapper_style');
2299 +
2300 + $this->start_controls_tab(
2301 + 'tab_wrapper_normal',
2302 + [
2303 + 'label' => esc_html__('Normal', 'king-addons'),
2304 + ]
2305 + );
2306 +
2307 + $this->add_group_control(
2308 + Group_Control_Background::get_type(),
2309 + [
2310 + 'name' => 'wrapper_bg_color',
2311 + 'types' => ['classic', 'gradient'],
2312 + 'fields_options' => [
2313 + 'color' => [
2314 + 'default' => '#f7f7f7',
2315 + ],
2316 + 'background' => [
2317 + 'default' => 'classic',
2318 + ]
2319 + ],
2320 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table'
2321 + ]
2322 + );
2323 +
2324 + $this->add_control(
2325 + 'wrapper_border_color',
2326 + [
2327 + 'label' => esc_html__('Border Color', 'king-addons'),
2328 + 'type' => Controls_Manager::COLOR,
2329 + 'default' => '#E8E8E8',
2330 + 'selectors' => [
2331 + '{{WRAPPER}} .king-addons-pricing-table' => 'border-color: {{VALUE}}',
2332 + ],
2333 + ]
2334 + );
2335 +
2336 + $this->add_group_control(
2337 + Group_Control_Box_Shadow::get_type(),
2338 + [
2339 + 'name' => 'wrapper_box_shadow',
2340 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table',
2341 + ]
2342 + );
2343 +
2344 + $this->end_controls_tab();
2345 +
2346 + $this->start_controls_tab(
2347 + 'tab_wrapper_hover',
2348 + [
2349 + 'label' => esc_html__('Hover', 'king-addons'),
2350 + ]
2351 + );
2352 +
2353 + $this->add_group_control(
2354 + Group_Control_Background::get_type(),
2355 + [
2356 + 'name' => 'wrapper_bg_hover_color',
2357 + 'types' => ['classic', 'gradient'],
2358 + 'fields_options' => [
2359 + 'color' => [
2360 + 'default' => '#f7f7f7',
2361 + ],
2362 + 'background' => [
2363 + 'default' => 'classic',
2364 + ]
2365 + ],
2366 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table:hover'
2367 + ]
2368 + );
2369 +
2370 + $this->add_control(
2371 + 'wrapper_hover_border_color',
2372 + [
2373 + 'label' => esc_html__('Border Color', 'king-addons'),
2374 + 'type' => Controls_Manager::COLOR,
2375 + 'default' => '#E8E8E8',
2376 + 'selectors' => [
2377 + '{{WRAPPER}} .king-addons-pricing-table:hover' => 'border-color: {{VALUE}}',
2378 + ],
2379 + ]
2380 + );
2381 +
2382 + $this->add_group_control(
2383 + Group_Control_Box_Shadow::get_type(),
2384 + [
2385 + 'name' => 'wrapper_hover_box_shadow',
2386 + 'selector' => '{{WRAPPER}} .king-addons-pricing-table:hover',
2387 + ]
2388 + );
2389 +
2390 + $this->end_controls_tab();
2391 +
2392 + $this->end_controls_tabs();
2393 +
2394 + $this->add_control(
2395 + 'wrapper_transition_duration',
2396 + [
2397 + 'label' => esc_html__('Transition Duration', 'king-addons'),
2398 + 'type' => Controls_Manager::NUMBER,
2399 + 'default' => 0.1,
2400 + 'min' => 0,
2401 + 'max' => 5,
2402 + 'step' => 0.1,
2403 + 'selectors' => [
2404 + '{{WRAPPER}} .king-addons-pricing-table' => 'transition-duration: {{VALUE}}s',
2405 + ],
2406 + 'separator' => 'before'
2407 + ]
2408 + );
2409 +
2410 + $this->add_control(
2411 + 'wrapper_padding',
2412 + [
2413 + 'label' => esc_html__('Padding', 'king-addons'),
2414 + 'type' => Controls_Manager::DIMENSIONS,
2415 + 'default' => [
2416 + 'top' => 0,
2417 + 'right' => 0,
2418 + 'bottom' => 0,
2419 + 'left' => 0,
2420 + ],
2421 + 'size_units' => ['px',],
2422 + 'selectors' => [
2423 + '{{WRAPPER}} .king-addons-pricing-table' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2424 + ],
2425 + 'separator' => 'before',
2426 + ]
2427 + );
2428 +
2429 + $this->add_control(
2430 + 'wrapper_border_type',
2431 + [
2432 + 'label' => esc_html__('Border Type', 'king-addons'),
2433 + 'type' => Controls_Manager::SELECT,
2434 + 'options' => [
2435 + 'none' => esc_html__('None', 'king-addons'),
2436 + 'solid' => esc_html__('Solid', 'king-addons'),
2437 + 'double' => esc_html__('Double', 'king-addons'),
2438 + 'dotted' => esc_html__('Dotted', 'king-addons'),
2439 + 'dashed' => esc_html__('Dashed', 'king-addons'),
2440 + 'groove' => esc_html__('Groove', 'king-addons'),
2441 + ],
2442 + 'default' => 'none',
2443 + 'selectors' => [
2444 + '{{WRAPPER}} .king-addons-pricing-table' => 'border-style: {{VALUE}};',
2445 + ],
2446 + 'separator' => 'before'
2447 + ]
2448 + );
2449 +
2450 + $this->add_responsive_control(
2451 + 'wrapper_border_width',
2452 + [
2453 + 'label' => esc_html__('Border Width', 'king-addons'),
2454 + 'type' => Controls_Manager::DIMENSIONS,
2455 + 'size_units' => ['px'],
2456 + 'default' => [
2457 + 'top' => 1,
2458 + 'right' => 1,
2459 + 'bottom' => 1,
2460 + 'left' => 1,
2461 + ],
2462 + 'selectors' => [
2463 + '{{WRAPPER}} .king-addons-pricing-table' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2464 + ],
2465 + 'condition' => [
2466 + 'wrapper_border_type!' => 'none',
2467 + ],
2468 + ]
2469 + );
2470 +
2471 + $this->add_responsive_control(
2472 + 'wrapper_border_radius',
2473 + [
2474 + 'label' => esc_html__('Border Radius', 'king-addons'),
2475 + 'type' => Controls_Manager::SLIDER,
2476 + 'size_units' => ['px'],
2477 + 'range' => [
2478 + 'px' => [
2479 + 'min' => 0,
2480 + 'max' => 50,
2481 + ],
2482 + ],
2483 + 'default' => [
2484 + 'top' => 0,
2485 + 'right' => 0,
2486 + 'bottom' => 0,
2487 + 'left' => 0,
2488 + ],
2489 + 'selectors' => [
2490 + '{{WRAPPER}} .king-addons-pricing-table' => 'border-radius: calc({{SIZE}}{{UNIT}} + 2px);',
2491 + '{{WRAPPER}} .king-addons-pricing-table-item-first' => 'border-top-left-radius: {{SIZE}}{{UNIT}}; border-top-right-radius: {{SIZE}}{{UNIT}};',
2492 + '{{WRAPPER}} .king-addons-pricing-table-item-last' => 'border-bottom-left-radius: {{SIZE}}{{UNIT}}; border-bottom-right-radius: {{SIZE}}{{UNIT}};',
2493 + ],
2494 + 'separator' => 'before'
2495 + ]
2496 + );
2497 +
2498 +
2499 +
2500 +
2501 +$this->end_controls_section();
2502 +
2503 +
2504 +
2505 + }
2506 +
2507 + private function get_currency_symbol($symbol_name): string
2508 + {
2509 + $symbols = [
2510 + 'dollar' => '&#36;',
2511 + 'euro' => '&#128;',
2512 + 'pound' => '&#163;',
2513 + 'ruble' => '&#8381;',
2514 + 'peso' => '&#8369;',
2515 + 'krona' => 'kr',
2516 + 'lira' => '&#8356;',
2517 + 'franc' => '&#8355;',
2518 + 'shekel' => '&#8362;',
2519 + 'baht' => '&#3647;',
2520 + 'won' => '&#8361;',
2521 + 'yen' => '&#165;',
2522 + 'guilder' => '&fnof;',
2523 + 'peseta' => '&#8359',
2524 + 'real' => 'R$',
2525 + 'rupee' => '&#8360;',
2526 + 'indian_rupee' => '&#8377;',
2527 + ];
2528 + return $symbols[$symbol_name] ?? '';
2529 + }
2530 +
2531 + protected function render()
2532 + {
2533 + $settings = Core::displaySettings($this);
2534 + if (empty($settings['pricing_items'])) {
2535 + return;
2536 + }
2537 + ?>
2538 + <div class="king-addons-pricing-table">
2539 + <?php
2540 + $item_count = 0;
2541 + foreach ($settings['pricing_items'] as $key => $item) :
2542 + // Disable premium tooltip if Freemius is not active
2543 + if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
2544 + $item['feature_tooltip'] = '';
2545 + $item['feature_tooltip_text'] = '';
2546 + }
2547 +
2548 + // Figure out item’s “first” or “last” CSS class
2549 + $item_class = '';
2550 + if (0 === $key) {
2551 + $item_class = ' king-addons-pricing-table-item-first';
2552 + } elseif ($key === count($settings['pricing_items']) - 1) {
2553 + $item_class = ' king-addons-pricing-table-item-last';
2554 + }
2555 +
2556 + $full_css_class = 'elementor-repeater-item-' . esc_attr($item['_id']) .
2557 + ' king-addons-pricing-table-item king-addons-pricing-table-' .
2558 + esc_attr($item['type_select'] . $item_class);
2559 +
2560 + // Render FEATURE items separately (since they have different HTML structure)
2561 + if ($item['type_select'] === 'feature') : ?>
2562 + <section class="<?php echo $full_css_class; ?>">
2563 + <div class="king-addons-pricing-table-feature-inner">
2564 + <?php if (!empty($item['select_icon']['value'])) : ?>
2565 + <i class="king-addons-pricing-table-feature-icon <?php echo esc_attr($item['select_icon']['value']); ?>"></i>
2566 + <?php endif; ?>
2567 + <span class="king-addons-pricing-table-feature-text king-addons-pricing-table-ftext-line-<?php echo esc_attr($item['feature_linethrough']); ?>">
2568 + <span>
2569 + <?php
2570 + // Feature text
2571 + echo wp_kses_post($item['feature_text']);
2572 + // Optional tooltip icon
2573 + if ('yes' === $item['feature_tooltip'] && 'yes' === $item['feature_tooltip_show_icon']) {
2574 + echo '&nbsp;&nbsp;<i class="far fa-question-circle"></i>';
2575 + }
2576 + ?>
2577 + </span>
2578 + </span>
2579 + <?php
2580 + // Actual tooltip text box
2581 + if ('yes' === $item['feature_tooltip'] && !empty($item['feature_tooltip_text'])) : ?>
2582 + <div class="king-addons-pricing-table-feature-tooltip">
2583 + <?php echo wp_kses_post($item['feature_tooltip_text']); ?>
2584 + </div>
2585 + <?php endif; ?>
2586 + </div>
2587 + </section>
2588 + <?php
2589 + else :
2590 + // Otherwise handle (heading, price, text, button, divider) in one block:
2591 + ?>
2592 + <div class="<?php echo esc_attr($full_css_class); ?>">
2593 + <?php
2594 + switch ($item['type_select']) {
2595 + case 'heading': // -----------------------------------------
2596 + ?>
2597 + <div class="king-addons-pricing-table-heading-inner">
2598 + <?php if ($item['heading_icon_type'] === 'icon' && !empty($item['select_icon']['value'])) : ?>
2599 + <div class="king-addons-pricing-table-icon">
2600 + <i class="<?php echo esc_attr($item['select_icon']['value']); ?>"></i>
2601 + </div>
2602 + <?php elseif ($item['heading_icon_type'] === 'image' && !empty($item['heading_image']['url'])) : ?>
2603 + <div class="king-addons-pricing-table-icon">
2604 + <img src="<?php echo esc_attr($item['heading_image']['url']); ?>"
2605 + alt="<?php echo esc_attr($item['heading_image']['alt'] ?? ''); ?>">
2606 + </div>
2607 + <?php endif; ?>
2608 +
2609 + <?php if (!empty($item['heading_title']) || !empty($item['heading_sub_title'])) : ?>
2610 + <div class="king-addons-pricing-table-title-wrap">
2611 + <?php if (!empty($item['heading_title'])) : ?>
2612 + <h3 class="king-addons-pricing-table-title">
2613 + <?php echo wp_kses_post($item['heading_title']); ?>
2614 + </h3>
2615 + <?php endif; ?>
2616 + <?php if (!empty($item['heading_sub_title'])) : ?>
2617 + <span class="king-addons-pricing-table-sub-title">
2618 + <?php echo wp_kses_post($item['heading_sub_title']); ?>
2619 + </span>
2620 + <?php endif; ?>
2621 + </div>
2622 + <?php endif; ?>
2623 + </div>
2624 + <?php
2625 + break;
2626 +
2627 + case 'price': // -------------------------------------------
2628 + ?>
2629 + <div class="king-addons-pricing-table-price-inner">
2630 + <?php if ('yes' === $item['sale'] && !empty($item['old_price'])) : ?>
2631 + <span class="king-addons-pricing-table-old-price">
2632 + <?php echo esc_html($item['old_price']); ?>
2633 + </span>
2634 + <?php endif; ?>
2635 +
2636 + <?php
2637 + // Currency "before"
2638 + if ('none' !== $item['currency_symbol'] && 'custom' !== $item['currency_symbol'] && 'before' === $settings['currency_hr_position']) {
2639 + echo '<span class="king-addons-pricing-table-currency">' . esc_html($this->get_currency_symbol($item['currency_symbol'])) . '</span>';
2640 + } elseif ('custom' === $item['currency_symbol'] && !empty($item['currency']) && 'before' === $settings['currency_hr_position']) {
2641 + echo '<span class="king-addons-pricing-table-currency">' . esc_html($item['currency']) . '</span>';
2642 + }
2643 +
2644 + // Main price and sub-price
2645 + if (!empty($item['price'])) {
2646 + echo '<span class="king-addons-pricing-table-main-price">' . esc_html($item['price']) . '</span>';
2647 + }
2648 + if (!empty($item['sub_price'])) {
2649 + echo '<span class="king-addons-pricing-table-sub-price">' . esc_html($item['sub_price']) . '</span>';
2650 + }
2651 +
2652 + // Currency "after"
2653 + if ('none' !== $item['currency_symbol'] && 'custom' !== $item['currency_symbol'] && 'after' === $settings['currency_hr_position']) {
2654 + echo '<span class="king-addons-pricing-table-currency">' . esc_html($this->get_currency_symbol($item['currency_symbol'])) . '</span>';
2655 + } elseif ('custom' === $item['currency_symbol'] && !empty($item['currency']) && 'after' === $settings['currency_hr_position']) {
2656 + echo '<span class="king-addons-pricing-table-currency">' . esc_html($item['currency']) . '</span>';
2657 + }
2658 +
2659 + // Period “beside”
2660 + if (!empty($item['period']) && 'beside' === $settings['period_hr_position']) {
2661 + echo '<div class="king-addons-pricing-table-period">' . esc_html($item['period']) . '</div>';
2662 + }
2663 + ?>
2664 + </div>
2665 + <?php
2666 + // Period “below”
2667 + if (!empty($item['period']) && 'below' === $settings['period_hr_position']) {
2668 + echo '<div class="king-addons-pricing-table-period">' . esc_html($item['period']) . '</div>';
2669 + }
2670 + break;
2671 +
2672 + case 'text': // --------------------------------------------
2673 + if (!empty($item['text'])) {
2674 + echo wp_kses_post($item['text']);
2675 + }
2676 + break;
2677 +
2678 + case 'button': // ------------------------------------------
2679 + if (!empty($item['btn_text']) || !empty($item['select_icon']['value'])) {
2680 + // Build link attributes
2681 + $attr_name = 'btn_attribute' . $item_count;
2682 + if (!empty($item['btn_url']['url'])) {
2683 + $this->add_render_attribute($attr_name, 'href', esc_url($item['btn_url']['url']));
2684 +
2685 + if ($item['btn_url']['is_external']) {
2686 + $this->add_render_attribute($attr_name, 'target', '_blank');
2687 + $this->add_render_attribute($attr_name, 'rel', 'noopener noreferrer');
2688 + }
2689 + if ($item['btn_url']['nofollow']) {
2690 + $this->add_render_attribute($attr_name, 'rel', 'nofollow', true);
2691 + }
2692 + }
2693 + if (!empty($item['btn_id'])) {
2694 + $this->add_render_attribute($attr_name, 'id', esc_html($item['btn_id']));
2695 + }
2696 + ?>
2697 + <a class="king-addons-pricing-table-btn king-addons-button-effect <?php echo esc_attr(sanitize_html_class((string) (Core::displaySettings($this)['btn_animation'] ?? ''))); ?>"
2698 + <?php echo $this->get_render_attribute_string($attr_name); ?>>
2699 + <span>
2700 + <?php
2701 + if (!empty($item['select_icon']['value']) && $item['btn_icon_position'] === 'before') {
2702 + echo '<i class="' . esc_attr($item['select_icon']['value']) . '"></i>';
2703 + }
2704 + echo esc_html($item['btn_text']);
2705 + if (!empty($item['select_icon']['value']) && $item['btn_icon_position'] === 'after') {
2706 + echo '<i class="' . esc_attr($item['select_icon']['value']) . '"></i>';
2707 + }
2708 + ?>
2709 + </span>
2710 + </a>
2711 + <?php
2712 + }
2713 + break;
2714 +
2715 + case 'divider': // -----------------------------------------
2716 + echo '<div class="king-addons-pricing-table-divider"></div>';
2717 + break;
2718 + } // end switch
2719 + ?>
2720 + </div>
2721 + <?php
2722 + endif; // End if feature / else
2723 + $item_count++;
2724 + endforeach;
2725 +
2726 + // Badge
2727 + if ($settings['badge_style'] !== 'none' && !empty($settings['badge_title'])) :
2728 + $this->add_render_attribute(
2729 + 'king-addons-pricing-table-badge-attr',
2730 + 'class',
2731 + 'king-addons-pricing-table-badge king-addons-pricing-table-badge-' . esc_attr($settings['badge_style'])
2732 + );
2733 + if (!empty($settings['badge_hr_position'])) {
2734 + $this->add_render_attribute(
2735 + 'king-addons-pricing-table-badge-attr',
2736 + 'class',
2737 + 'king-addons-pricing-table-badge-' . esc_attr($settings['badge_hr_position'])
2738 + );
2739 + }
2740 + ?>
2741 + <div <?php echo $this->get_render_attribute_string('king-addons-pricing-table-badge-attr'); ?>>
2742 + <div class="king-addons-pricing-table-badge-inner">
2743 + <?php echo esc_html($settings['badge_title']); ?>
2744 + </div>
2745 + </div>
2746 + <?php endif; ?>
2747 + </div>
2748 + <?php
2749 + }
2750 +
2751 +}