PluginProbe
Borderless – Addons and Templates for Elementor / trunk
Borderless – Addons and Templates for Elementor vtrunk
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 All 78 releases
borderless / modules / elementor / widgets / pricing-table.php

pricing-table.php in Borderless – Addons and Templates for Elementor trunk, at modules/elementor/widgets/pricing-table.php

1,465 lines 47.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Borderless\Widgets;
3
4 use Elementor\Widget_Base;
5 use Elementor\Controls_Manager;
6 use Elementor\Repeater;
7 use Elementor\Icons_Manager;
8 use Elementor\Group_Control_Typography;
9 use Elementor\Group_Control_Background;
10 use Elementor\Group_Control_Border;
11 use Elementor\Group_Control_Box_Shadow;
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit; // Exit if accessed directly.
15 }
16
17 class Pricing_Table extends Widget_Base {
18
19 // Widget Name
20 public function get_name() {
21 return 'borderless_pricing_table';
22 }
23
24 // Widget Title
25 public function get_title() {
26 return esc_html__( 'Pricing Table', 'borderless' );
27 }
28
29 // Widget Icon
30 public function get_icon() {
31 return 'eicon-price-table';
32 }
33
34 // Widget Categories
35 public function get_categories() {
36 return [ 'borderless' ];
37 }
38
39 // Widget Style Dependencies
40 public function get_style_depends() {
41 return [ 'elementor-widget-pricing-table' ];
42 }
43
44 protected function register_controls() {
45
46 // HEADER (Content Tab) - Header settings
47 $this->start_controls_section(
48 'borderless_elementor_pricing_table_section_header',
49 [
50 'label' => esc_html__( 'Header', 'borderless' ),
51 'tab' => Controls_Manager::TAB_CONTENT,
52 ]
53 );
54 $this->add_control(
55 'borderless_elementor_pricing_table_title',
56 [
57 'label' => esc_html__( 'Title', 'borderless' ),
58 'type' => Controls_Manager::TEXT,
59 'default' => esc_html__( 'Basic Plan', 'borderless' ),
60 'dynamic' => [ 'active' => true ],
61 ]
62 );
63 $this->add_control(
64 'borderless_elementor_pricing_table_subtitle',
65 [
66 'label' => esc_html__( 'Subtitle', 'borderless' ),
67 'type' => Controls_Manager::TEXT,
68 'default' => esc_html__( 'Best for startups', 'borderless' ),
69 'dynamic' => [ 'active' => true ],
70 ]
71 );
72 $this->add_control(
73 'borderless_elementor_pricing_table_media_type',
74 [
75 'label' => esc_html__( 'Media Type', 'borderless' ),
76 'type' => Controls_Manager::CHOOSE,
77 'options' => [
78 'icon' => [
79 'title' => esc_html__( 'Icon', 'borderless' ),
80 'icon' => 'eicon-star',
81 ],
82 'image' => [
83 'title' => esc_html__( 'Image', 'borderless' ),
84 'icon' => 'eicon-image',
85 ],
86 ],
87 'default' => 'icon',
88 'toggle' => false,
89 ]
90 );
91 $this->add_control(
92 'borderless_elementor_pricing_table_icon',
93 [
94 'label' => esc_html__( 'Icon', 'borderless' ),
95 'type' => Controls_Manager::ICONS,
96 'default' => [
97 'value' => 'fas fa-star',
98 'library' => 'fa-solid',
99 ],
100 'condition' => [
101 'borderless_elementor_pricing_table_media_type' => 'icon',
102 ],
103 ]
104 );
105 $this->add_control(
106 'borderless_elementor_pricing_table_image',
107 [
108 'label' => esc_html__( 'Image', 'borderless' ),
109 'type' => Controls_Manager::MEDIA,
110 'default' => [
111 'url' => \Elementor\Utils::get_placeholder_image_src(),
112 ],
113 'condition' => [
114 'borderless_elementor_pricing_table_media_type' => 'image',
115 ],
116 ]
117 );
118 $this->add_control(
119 'borderless_elementor_pricing_table_icon_position',
120 [
121 'label' => esc_html__( 'Media Position', 'borderless' ),
122 'type' => Controls_Manager::SELECT,
123 'options' => [
124 'before_title' => esc_html__( 'Before Title', 'borderless' ),
125 'after_title' => esc_html__( 'After Title', 'borderless' ),
126 ],
127 'default' => 'before_title',
128 ]
129 );
130 $this->end_controls_section();
131
132 // PRICING (Content Tab) - Pricing settings
133 $this->start_controls_section(
134 'borderless_elementor_pricing_table_section_price',
135 [
136 'label' => esc_html__( 'Pricing', 'borderless' ),
137 'tab' => Controls_Manager::TAB_CONTENT,
138 ]
139 );
140 $this->add_control(
141 'borderless_elementor_pricing_table_price',
142 [
143 'label' => esc_html__( 'Price', 'borderless' ),
144 'type' => Controls_Manager::TEXT,
145 'default' => esc_html__( '49', 'borderless' ),
146 'dynamic' => [ 'active' => true ],
147 ]
148 );
149 $this->add_control(
150 'borderless_elementor_pricing_table_currency',
151 [
152 'label' => esc_html__( 'Currency Symbol', 'borderless' ),
153 'type' => Controls_Manager::TEXT,
154 'default' => esc_html__( '$', 'borderless' ),
155 'dynamic' => [ 'active' => true ],
156 ]
157 );
158 $this->add_control(
159 'borderless_elementor_pricing_table_period',
160 [
161 'label' => esc_html__( 'Price Period', 'borderless' ),
162 'type' => Controls_Manager::TEXT,
163 'default' => esc_html__( '/month', 'borderless' ),
164 'dynamic' => [ 'active' => true ],
165 ]
166 );
167 $this->add_control(
168 'borderless_elementor_pricing_table_on_sale',
169 [
170 'label' => esc_html__( 'On Sale?', 'borderless' ),
171 'type' => Controls_Manager::SWITCHER,
172 'label_on' => esc_html__( 'Yes', 'borderless' ),
173 'label_off' => esc_html__( 'No', 'borderless' ),
174 'return_value' => 'yes',
175 'default' => 'no',
176 ]
177 );
178 $this->add_control(
179 'borderless_elementor_pricing_table_sale_price',
180 [
181 'label' => esc_html__( 'Sale Price', 'borderless' ),
182 'type' => Controls_Manager::TEXT,
183 'default' => esc_html__( '39', 'borderless' ),
184 'condition' => [
185 'borderless_elementor_pricing_table_on_sale' => 'yes',
186 ],
187 'dynamic' => [ 'active' => true ],
188 ]
189 );
190 $this->end_controls_section();
191
192 // FEATURES (Content Tab) - Features list settings
193 $this->start_controls_section(
194 'borderless_elementor_pricing_table_section_features',
195 [
196 'label' => esc_html__( 'Features', 'borderless' ),
197 'tab' => Controls_Manager::TAB_CONTENT,
198 ]
199 );
200 $this->add_control(
201 'borderless_elementor_pricing_table_features_title',
202 [
203 'label' => esc_html__( 'Title', 'borderless' ),
204 'type' => Controls_Manager::TEXT,
205 'default' => esc_html__( 'Features', 'borderless' ),
206 ]
207 );
208 $repeater = new Repeater();
209 $repeater->add_control(
210 'borderless_elementor_pricing_table_feature_text',
211 [
212 'label' => esc_html__( 'Feature', 'borderless' ),
213 'type' => Controls_Manager::TEXT,
214 'default' => esc_html__( 'Feature', 'borderless' ),
215 'dynamic' => [ 'active' => true ],
216 ]
217 );
218 $repeater->add_control(
219 'borderless_elementor_pricing_table_feature_icon',
220 [
221 'label' => esc_html__( 'Feature Icon', 'borderless' ),
222 'type' => Controls_Manager::ICONS,
223 'default' => [
224 'value' => 'fas fa-check',
225 'library' => 'fa-solid',
226 ],
227 ]
228 );
229 $repeater->add_control(
230 'borderless_elementor_pricing_table_feature_tooltip',
231 [
232 'label' => esc_html__( 'Enable Tooltip', 'borderless' ),
233 'type' => Controls_Manager::SWITCHER,
234 'label_on' => esc_html__( 'Yes', 'borderless' ),
235 'label_off' => esc_html__( 'No', 'borderless' ),
236 'return_value' => 'yes',
237 'default' => 'no',
238 ]
239 );
240 $repeater->add_control(
241 'borderless_elementor_pricing_table_feature_tooltip_text',
242 [
243 'label' => esc_html__( 'Tooltip Text', 'borderless' ),
244 'type' => Controls_Manager::TEXTAREA,
245 'default' => esc_html__( 'More details about this feature', 'borderless' ),
246 'condition' => [
247 'borderless_elementor_pricing_table_feature_tooltip' => 'yes',
248 ],
249 ]
250 );
251 $this->add_control(
252 'borderless_elementor_pricing_table_features_list',
253 [
254 'label' => esc_html__( 'Features List', 'borderless' ),
255 'type' => Controls_Manager::REPEATER,
256 'fields' => $repeater->get_controls(),
257 'default' => [
258 [ 'borderless_elementor_pricing_table_feature_text' => esc_html__( 'Responsive Design', 'borderless' ) ],
259 [ 'borderless_elementor_pricing_table_feature_text' => esc_html__( 'Unlimited Bandwidth', 'borderless' ) ],
260 [ 'borderless_elementor_pricing_table_feature_text' => esc_html__( '24/7 Support', 'borderless' ) ],
261 ],
262 'title_field' => '{{{ borderless_elementor_pricing_table_feature_text }}}',
263 ]
264 );
265 $this->end_controls_section();
266
267 // DESCRIPTION (Content Tab) - Description settings
268 $this->start_controls_section(
269 'borderless_elementor_pricing_table_section_description',
270 [
271 'label' => esc_html__( 'Description', 'borderless' ),
272 'tab' => Controls_Manager::TAB_CONTENT,
273 ]
274 );
275 $this->add_control(
276 'borderless_elementor_pricing_table_description_enable',
277 [
278 'label' => esc_html__( 'Show Description', 'borderless' ),
279 'type' => Controls_Manager::SWITCHER,
280 'label_on' => esc_html__( 'Yes', 'borderless' ),
281 'label_off' => esc_html__( 'No', 'borderless' ),
282 'return_value' => 'yes',
283 'default' => 'yes',
284 ]
285 );
286 $this->add_control(
287 'borderless_elementor_pricing_table_description',
288 [
289 'label' => esc_html__( 'Description Text', 'borderless' ),
290 'type' => Controls_Manager::WYSIWYG,
291 'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'borderless' ),
292 'condition' => [
293 'borderless_elementor_pricing_table_description_enable' => 'yes',
294 ],
295 ]
296 );
297 $this->end_controls_section();
298
299 // RIBBON / BADGE (Content Tab) - Ribbon settings
300 $this->start_controls_section(
301 'borderless_elementor_pricing_table_section_ribbon',
302 [
303 'label' => esc_html__( 'Ribbon / Badge', 'borderless' ),
304 'tab' => Controls_Manager::TAB_CONTENT,
305 ]
306 );
307 $this->add_control(
308 'borderless_elementor_pricing_table_featured',
309 [
310 'label' => esc_html__( 'Show Ribbon / Badge', 'borderless' ),
311 'type' => Controls_Manager::SWITCHER,
312 'label_on' => esc_html__( 'Yes', 'borderless' ),
313 'label_off' => esc_html__( 'No', 'borderless' ),
314 'return_value' => 'yes',
315 'default' => 'no',
316 ]
317 );
318 $this->add_control(
319 'borderless_elementor_pricing_table_ribbon_text',
320 [
321 'label' => esc_html__( 'Ribbon Text', 'borderless' ),
322 'type' => Controls_Manager::TEXT,
323 'default' => esc_html__( 'Featured', 'borderless' ),
324 'condition' => [
325 'borderless_elementor_pricing_table_featured' => 'yes',
326 ],
327 ]
328 );
329 $this->end_controls_section();
330
331 // BUTTON (Content Tab) - Button settings
332 $this->start_controls_section(
333 'borderless_elementor_pricing_table_section_button',
334 [
335 'label' => esc_html__( 'Button', 'borderless' ),
336 'tab' => Controls_Manager::TAB_CONTENT,
337 ]
338 );
339 $this->add_control(
340 'borderless_elementor_pricing_table_button_text',
341 [
342 'label' => esc_html__( 'Button Text', 'borderless' ),
343 'type' => Controls_Manager::TEXT,
344 'default' => esc_html__( 'Buy Now', 'borderless' ),
345 'dynamic' => [ 'active' => true ],
346 ]
347 );
348 $this->add_control(
349 'borderless_elementor_pricing_table_button_link',
350 [
351 'label' => esc_html__( 'Button Link', 'borderless' ),
352 'type' => Controls_Manager::URL,
353 'default' => [
354 'url' => '#',
355 ],
356 ]
357 );
358 $this->add_control(
359 'borderless_elementor_pricing_table_button_icon',
360 [
361 'label' => esc_html__( 'Button Icon', 'borderless' ),
362 'type' => Controls_Manager::ICONS,
363 'default' => [
364 'value' => 'fas fa-arrow-right',
365 'library' => 'fa-solid',
366 ],
367 ]
368 );
369 $this->add_control(
370 'borderless_elementor_pricing_table_button_icon_alignment',
371 [
372 'label' => esc_html__( 'Button Icon Alignment', 'borderless' ),
373 'type' => Controls_Manager::SELECT,
374 'options' => [
375 'left' => esc_html__( 'Before Text', 'borderless' ),
376 'right' => esc_html__( 'After Text', 'borderless' ),
377 ],
378 'default' => 'right',
379 ]
380 );
381 $this->end_controls_section();
382
383 // BLOCKS ORDER (Content Tab) - Blocks order settings
384 $this->start_controls_section(
385 'borderless_elementor_pricing_table_section_blocks_order',
386 [
387 'label' => esc_html__( 'Blocks Order', 'borderless' ),
388 'tab' => Controls_Manager::TAB_CONTENT,
389 ]
390 );
391 $this->add_control(
392 'borderless_elementor_pricing_table_header_order',
393 [
394 'label' => esc_html__( 'Header Order', 'borderless' ),
395 'type' => Controls_Manager::NUMBER,
396 'default' => 1,
397 ]
398 );
399 $this->add_control(
400 'borderless_elementor_pricing_table_price_order',
401 [
402 'label' => esc_html__( 'Pricing Order', 'borderless' ),
403 'type' => Controls_Manager::NUMBER,
404 'default' => 2,
405 ]
406 );
407 $this->add_control(
408 'borderless_elementor_pricing_table_features_order',
409 [
410 'label' => esc_html__( 'Features Order', 'borderless' ),
411 'type' => Controls_Manager::NUMBER,
412 'default' => 3,
413 ]
414 );
415 $this->add_control(
416 'borderless_elementor_pricing_table_description_order',
417 [
418 'label' => esc_html__( 'Description Order', 'borderless' ),
419 'type' => Controls_Manager::NUMBER,
420 'default' => 4,
421 ]
422 );
423 $this->add_control(
424 'borderless_elementor_pricing_table_button_order',
425 [
426 'label' => esc_html__( 'Button Order', 'borderless' ),
427 'type' => Controls_Manager::NUMBER,
428 'default' => 5,
429 ]
430 );
431 $this->end_controls_section();
432
433 // CONTAINER (Style Tab) - Container style settings
434 $this->start_controls_section(
435 'borderless_elementor_pricing_table_container_style',
436 [
437 'label' => esc_html__( 'Container', 'borderless' ),
438 'tab' => Controls_Manager::TAB_STYLE,
439 ]
440 );
441 $this->add_group_control(
442 Group_Control_Background::get_type(),
443 [
444 'name' => 'borderless_elementor_pricing_table_container_background',
445 'label' => esc_html__( 'Background', 'borderless' ),
446 'types' => [ 'classic', 'gradient' ],
447 'selector' => '{{WRAPPER}} .borderless-pricing-table',
448 ]
449 );
450 $this->add_group_control(
451 Group_Control_Border::get_type(),
452 [
453 'name' => 'borderless_elementor_pricing_table_container_border',
454 'label' => esc_html__( 'Border', 'borderless' ),
455 'selector' => '{{WRAPPER}} .borderless-pricing-table',
456 'default' => [
457 'width' => [
458 'top' => '1',
459 'right' => '1',
460 'bottom' => '1',
461 'left' => '1',
462 ],
463 'style' => 'solid',
464 'color' => '#eaeaea',
465 ],
466 ]
467 );
468 $this->add_responsive_control(
469 'borderless_elementor_pricing_table_container_border_radius',
470 [
471 'label' => esc_html__( 'Border Radius', 'borderless' ),
472 'type' => Controls_Manager::DIMENSIONS,
473 'size_units' => [ 'px', '%' ],
474 'default' => [
475 'top' => '4',
476 'right' => '4',
477 'bottom' => '4',
478 'left' => '4',
479 'unit' => 'px',
480 ],
481 'selectors' => [
482 '{{WRAPPER}} .borderless-pricing-table' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
483 ],
484 ]
485 );
486 $this->add_responsive_control(
487 'borderless_elementor_pricing_table_container_padding',
488 [
489 'label' => esc_html__( 'Padding', 'borderless' ),
490 'type' => Controls_Manager::DIMENSIONS,
491 'size_units' => [ 'px', 'em', '%' ],
492 'selectors' => [
493 '{{WRAPPER}} .borderless-pricing-table' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
494 ],
495 ]
496 );
497 $this->add_group_control(
498 Group_Control_Box_Shadow::get_type(),
499 [
500 'name' => 'borderless_elementor_pricing_table_container_box_shadow',
501 'label' => esc_html__( 'Box Shadow', 'borderless' ),
502 'selector' => '{{WRAPPER}} .borderless-pricing-table',
503 ]
504 );
505 $this->end_controls_section();
506
507 // HEADER (Style Tab) - Header style settings
508 $this->start_controls_section(
509 'borderless_elementor_pricing_table_header_style',
510 [
511 'label' => esc_html__( 'Header', 'borderless' ),
512 'tab' => Controls_Manager::TAB_STYLE,
513 ]
514 );
515 $this->add_responsive_control(
516 'borderless_elementor_pricing_table_header_position',
517 [
518 'label' => esc_html__( 'Position', 'borderless' ),
519 'type' => Controls_Manager::CHOOSE,
520 'default' => 'left',
521 'options' => [
522 'left' => [
523 'title' => esc_html__( 'Left', 'borderless' ),
524 'icon' => 'eicon-h-align-left',
525 ],
526 'center' => [
527 'title' => esc_html__( 'Center', 'borderless' ),
528 'icon' => 'eicon-h-align-center',
529 ],
530 'right' => [
531 'title' => esc_html__( 'Right', 'borderless' ),
532 'icon' => 'eicon-h-align-right',
533 ],
534 ],
535 'selectors' => [
536 '{{WRAPPER}} .pricing-header' => 'text-align: {{VALUE}};',
537 ],
538 ]
539 );
540 $this->add_control(
541 'borderless_elementor_pricing_table_header_title_color',
542 [
543 'label' => esc_html__( 'Title Color', 'borderless' ),
544 'type' => Controls_Manager::COLOR,
545 'default' => '#333333',
546 'selectors' => [
547 '{{WRAPPER}} .pricing-title' => 'color: {{VALUE}};',
548 ],
549 ]
550 );
551 $this->add_group_control(
552 Group_Control_Typography::get_type(),
553 [
554 'name' => 'borderless_elementor_pricing_table_header_title_typography',
555 'label' => esc_html__( 'Title Typography', 'borderless' ),
556 'selector' => '{{WRAPPER}} .pricing-title',
557 ]
558 );
559 $this->add_control(
560 'borderless_elementor_pricing_table_header_subtitle_color',
561 [
562 'label' => esc_html__( 'Subtitle Color', 'borderless' ),
563 'type' => Controls_Manager::COLOR,
564 'default' => '#777777',
565 'selectors' => [
566 '{{WRAPPER}} .pricing-subtitle' => 'color: {{VALUE}};',
567 ],
568 ]
569 );
570 $this->add_group_control(
571 Group_Control_Typography::get_type(),
572 [
573 'name' => 'borderless_elementor_pricing_table_header_subtitle_typography',
574 'label' => esc_html__( 'Subtitle Typography', 'borderless' ),
575 'selector' => '{{WRAPPER}} .pricing-subtitle',
576 ]
577 );
578 $this->add_responsive_control(
579 'borderless_elementor_pricing_table_header_icon_size',
580 [
581 'label' => esc_html__( 'Icon Size', 'borderless' ),
582 'type' => Controls_Manager::SLIDER,
583 'range' => [
584 'px' => [
585 'min' => 6,
586 'max' => 200,
587 ],
588 ],
589 'default' => [
590 'size' => 40,
591 'unit' => 'px',
592 ],
593 'selectors' => [
594 '{{WRAPPER}} .pricing-header .pricing-media i' => 'font-size: {{SIZE}}{{UNIT}};',
595 '{{WRAPPER}} .pricing-header .pricing-media svg' => 'width: {{SIZE}}{{UNIT}};',
596 ],
597 'condition' => [
598 'borderless_elementor_pricing_table_media_type' => 'icon',
599 ],
600 ]
601 );
602 $this->add_control(
603 'borderless_elementor_pricing_table_header_icon_color',
604 [
605 'label' => esc_html__( 'Icon Color', 'borderless' ),
606 'type' => Controls_Manager::COLOR,
607 'default' => '#333333',
608 'selectors' => [
609 '{{WRAPPER}} .pricing-header .pricing-media i' => 'color: {{VALUE}};',
610 '{{WRAPPER}} .pricing-header .pricing-media svg' => 'fill: {{VALUE}};',
611 ],
612 'condition' => [
613 'borderless_elementor_pricing_table_media_type' => 'icon',
614 ],
615 ]
616 );
617 $this->add_responsive_control(
618 'borderless_elementor_pricing_table_header_padding',
619 [
620 'label' => esc_html__( 'Padding', 'borderless' ),
621 'type' => Controls_Manager::DIMENSIONS,
622 'size_units' => [ 'px', 'em', '%' ],
623 'selectors' => [
624 '{{WRAPPER}} .pricing-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
625 ],
626 ]
627 );
628 $this->end_controls_section();
629
630 // PRICING (Style Tab) - Pricing style settings with new grouping
631 $this->start_controls_section(
632 'borderless_elementor_pricing_table_price_style',
633 [
634 'label' => esc_html__( 'Pricing', 'borderless' ),
635 'tab' => Controls_Manager::TAB_STYLE,
636 ]
637 );
638 $this->add_responsive_control(
639 'borderless_elementor_pricing_table_price_position',
640 [
641 'label' => esc_html__( 'Position', 'borderless' ),
642 'type' => Controls_Manager::CHOOSE,
643 'default' => 'flex-start',
644 'options' => [
645 'flex-start' => [
646 'title' => esc_html__( 'Left', 'borderless' ),
647 'icon' => 'eicon-h-align-left',
648 ],
649 'center' => [
650 'title' => esc_html__( 'Center', 'borderless' ),
651 'icon' => 'eicon-h-align-center',
652 ],
653 'flex-end' => [
654 'title' => esc_html__( 'Right', 'borderless' ),
655 'icon' => 'eicon-h-align-right',
656 ],
657 ],
658 'selectors' => [
659 '{{WRAPPER}} .pricing-price' => 'justify-content: {{VALUE}};',
660 ],
661 ]
662 );
663 $this->add_responsive_control(
664 'borderless_elementor_pricing_table_price_padding',
665 [
666 'label' => esc_html__( 'Padding', 'borderless' ),
667 'type' => Controls_Manager::DIMENSIONS,
668 'size_units' => [ 'px', 'em', '%' ],
669 'selectors' => [
670 '{{WRAPPER}} .pricing-price' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
671 ],
672 ]
673 );
674 // Group: Currency Symbol
675 $this->add_control(
676 'borderless_elementor_pricing_table_currency_symbol_heading',
677 [
678 'label' => esc_html__( 'Currency Symbol', 'borderless' ),
679 'type' => Controls_Manager::HEADING,
680 'separator' => 'after',
681 ]
682 );
683 $this->add_control(
684 'borderless_elementor_pricing_table_currency_symbol_color',
685 [
686 'label' => esc_html__( 'Color', 'borderless' ),
687 'type' => Controls_Manager::COLOR,
688 'default' => '#e74c3c',
689 'selectors' => [
690 '{{WRAPPER}} .pricing-price .sale-price .currency-symbol' => 'color: {{VALUE}};',
691 ],
692 ]
693 );
694 $this->add_group_control(
695 Group_Control_Typography::get_type(),
696 [
697 'name' => 'borderless_elementor_pricing_table_currency_symbol_typography',
698 'label' => esc_html__( 'Typography', 'borderless' ),
699 'selector' => '{{WRAPPER}} .pricing-price .sale-price .currency-symbol',
700 ]
701 );
702 // Group: Price
703 $this->add_control(
704 'borderless_elementor_pricing_table_price_heading',
705 [
706 'label' => esc_html__( 'Price', 'borderless' ),
707 'type' => Controls_Manager::HEADING,
708 'separator' => 'before',
709 ]
710 );
711 $this->add_control(
712 'borderless_elementor_pricing_table_price_color',
713 [
714 'label' => esc_html__( 'Color', 'borderless' ),
715 'type' => Controls_Manager::COLOR,
716 'default' => '#e74c3c',
717 'selectors' => [
718 '{{WRAPPER}} .pricing-price .sale-price .price-value' => 'color: {{VALUE}};',
719 ],
720 ]
721 );
722 $this->add_group_control(
723 Group_Control_Typography::get_type(),
724 [
725 'name' => 'borderless_elementor_pricing_table_price_typography',
726 'label' => esc_html__( 'Typography', 'borderless' ),
727 'selector' => '{{WRAPPER}} .pricing-price .sale-price .price-value',
728 ]
729 );
730 // Group: Sales Price
731 $this->add_control(
732 'borderless_elementor_pricing_table_price_sales_price_heading',
733 [
734 'label' => esc_html__( 'Sales Price', 'borderless' ),
735 'type' => Controls_Manager::HEADING,
736 'separator' => 'before',
737 ]
738 );
739 $this->add_control(
740 'borderless_elementor_pricing_table_sales_price_color',
741 [
742 'label' => esc_html__( 'Color', 'borderless' ),
743 'type' => Controls_Manager::COLOR,
744 'default' => '#333333',
745 'selectors' => [
746 '{{WRAPPER}} .pricing-price .original-price .currency-symbol,
747 {{WRAPPER}} .pricing-price .price:not(.sale-price) .currency-symbol,
748 {{WRAPPER}} .pricing-price .original-price,
749 {{WRAPPER}} .pricing-price .original-price .price-value,
750 {{WRAPPER}} .pricing-price .price:not(.sale-price) .price-value' => 'color: {{VALUE}};',
751 ],
752 ]
753 );
754 $this->add_group_control(
755 Group_Control_Typography::get_type(),
756 [
757 'name' => 'borderless_elementor_pricing_table_sales_price_typography',
758 'label' => esc_html__( 'Typography', 'borderless' ),
759 'selector' => '{{WRAPPER}} .pricing-price .original-price .currency-symbol, {{WRAPPER}} .pricing-price .original-price .price-value, {{WRAPPER}} .pricing-price .price:not(.sale-price) .currency-symbol, {{WRAPPER}} .pricing-price .price:not(.sale-price) .price-value',
760 ]
761 );
762 // Group: Period
763 $this->add_control(
764 'borderless_elementor_pricing_table_price_period_heading',
765 [
766 'label' => esc_html__( 'Period', 'borderless' ),
767 'type' => Controls_Manager::HEADING,
768 'separator' => 'before',
769 ]
770 );
771 $this->add_control(
772 'borderless_elementor_pricing_table_price_period_color',
773 [
774 'label' => esc_html__( 'Color', 'borderless' ),
775 'type' => Controls_Manager::COLOR,
776 'default' => '#999999',
777 'selectors' => [
778 '{{WRAPPER}} .price-period' => 'color: {{VALUE}};',
779 ],
780 ]
781 );
782 $this->add_group_control(
783 Group_Control_Typography::get_type(),
784 [
785 'name' => 'borderless_elementor_pricing_table_price_period_typography',
786 'label' => esc_html__( 'Typography', 'borderless' ),
787 'selector' => '{{WRAPPER}} .price-period',
788 ]
789 );
790 $this->end_controls_section();
791
792 // FEATURES (Style Tab) - Features style settings
793 $this->start_controls_section(
794 'borderless_elementor_pricing_table_features_style',
795 [
796 'label' => esc_html__( 'Features', 'borderless' ),
797 'tab' => Controls_Manager::TAB_STYLE,
798 ]
799 );
800 $this->add_responsive_control(
801 'borderless_elementor_pricing_table_features_position',
802 [
803 'label' => esc_html__( 'Position', 'borderless' ),
804 'type' => Controls_Manager::CHOOSE,
805 'default' => 'left',
806 'options' => [
807 'left' => [
808 'title' => esc_html__( 'Left', 'borderless' ),
809 'icon' => 'eicon-h-align-left',
810 ],
811 'center' => [
812 'title' => esc_html__( 'Center', 'borderless' ),
813 'icon' => 'eicon-h-align-center',
814 ],
815 'right' => [
816 'title' => esc_html__( 'Right', 'borderless' ),
817 'icon' => 'eicon-h-align-right',
818 ],
819 ],
820 'selectors' => [
821 '{{WRAPPER}} .pricing-features' => 'text-align: {{VALUE}};',
822 '{{WRAPPER}} .pricing-features ul li' => 'justify-content: {{VALUE}};',
823 ],
824 ]
825 );
826 $this->add_control(
827 'borderless_elementor_pricing_table_features_text_color',
828 [
829 'label' => esc_html__( 'Features Text Color', 'borderless' ),
830 'type' => Controls_Manager::COLOR,
831 'default' => '#555555',
832 'selectors' => [
833 '{{WRAPPER}} .pricing-features ul li' => 'color: {{VALUE}};',
834 ],
835 ]
836 );
837 $this->add_group_control(
838 Group_Control_Typography::get_type(),
839 [
840 'name' => 'borderless_elementor_pricing_table_features_typography',
841 'label' => esc_html__( 'Features Typography', 'borderless' ),
842 'selector' => '{{WRAPPER}} .pricing-features ul li',
843 ]
844 );
845 $this->add_group_control(
846 Group_Control_Typography::get_type(),
847 [
848 'name' => 'borderless_elementor_pricing_table_features_title_typography',
849 'label' => esc_html__( 'Title Typography', 'borderless' ),
850 'selector' => '{{WRAPPER}} .features-title',
851 ]
852 );
853 $this->add_responsive_control(
854 'borderless_elementor_pricing_table_features_icon_spacing',
855 [
856 'label' => esc_html__( 'Icon Spacing', 'borderless' ),
857 'type' => Controls_Manager::SLIDER,
858 'range' => [
859 'px' => [
860 'min' => 0,
861 'max' => 50,
862 ],
863 ],
864 'default' => [
865 'size' => 8,
866 'unit' => 'px',
867 ],
868 'selectors' => [
869 '{{WRAPPER}} .pricing-features ul li i' => 'margin-right: {{SIZE}}{{UNIT}};',
870 '{{WRAPPER}} .pricing-features ul li svg' => 'margin-right: {{SIZE}}{{UNIT}};',
871 ],
872 ]
873 );
874 $this->add_responsive_control(
875 'borderless_elementor_pricing_table_features_icon_size',
876 [
877 'label' => esc_html__( 'Icon Size', 'borderless' ),
878 'type' => Controls_Manager::SLIDER,
879 'range' => [
880 'px' => [
881 'min' => 6,
882 'max' => 100,
883 ],
884 ],
885 'default' => [
886 'size' => 18,
887 'unit' => 'px',
888 ],
889 'selectors' => [
890 '{{WRAPPER}} .pricing-features ul li i' => 'font-size: {{SIZE}}{{UNIT}};',
891 '{{WRAPPER}} .pricing-features ul li svg' => 'width: {{SIZE}}{{UNIT}};',
892 ],
893 ]
894 );
895 $this->add_responsive_control(
896 'borderless_elementor_pricing_table_features_items_gap',
897 [
898 'label' => esc_html__( 'Gap Between Items', 'borderless' ),
899 'type' => Controls_Manager::SLIDER,
900 'range' => [
901 'px' => [
902 'min' => 0,
903 'max' => 50,
904 ],
905 ],
906 'default' => [
907 'size' => 10,
908 'unit' => 'px',
909 ],
910 'selectors' => [
911 '{{WRAPPER}} .pricing-features ul li' => 'margin-bottom: {{SIZE}}{{UNIT}};',
912 ],
913 'condition' => [
914 'borderless_elementor_pricing_table_features_divider' => '',
915 ],
916 ]
917 );
918 $this->add_control(
919 'borderless_elementor_pricing_table_features_divider',
920 [
921 'label' => esc_html__( 'Show Item Dividers', 'borderless' ),
922 'type' => Controls_Manager::SWITCHER,
923 'label_on' => esc_html__( 'Yes', 'borderless' ),
924 'label_off' => esc_html__( 'No', 'borderless' ),
925 'return_value' => 'yes',
926 'default' => 'no',
927 ]
928 );
929 $this->add_responsive_control(
930 'borderless_elementor_pricing_table_features_divider_thickness',
931 [
932 'label' => esc_html__( 'Divider Thickness', 'borderless' ),
933 'type' => Controls_Manager::SLIDER,
934 'range' => [
935 'px' => [
936 'min' => 0,
937 'max' => 10,
938 ],
939 ],
940 'default' => [
941 'size' => 1,
942 'unit' => 'px',
943 ],
944 'condition' => [
945 'borderless_elementor_pricing_table_features_divider' => 'yes',
946 ],
947 'selectors' => [
948 '{{WRAPPER}} .pricing-features ul li:not(:last-child)' => 'border-bottom-style: solid; border-bottom-width: {{SIZE}}{{UNIT}};',
949 ],
950 ]
951 );
952 $this->add_responsive_control(
953 'borderless_elementor_pricing_table_features_divider_gap',
954 [
955 'label' => esc_html__( 'Divider Gap', 'borderless' ),
956 'type' => Controls_Manager::SLIDER,
957 'range' => [
958 'px' => [
959 'min' => 0,
960 'max' => 50,
961 ],
962 ],
963 'default' => [
964 'size' => 10,
965 'unit' => 'px',
966 ],
967 'selectors' => [
968 '{{WRAPPER}} .pricing-features ul li:not(:last-child)' => 'padding-bottom: {{SIZE}}{{UNIT}};',
969 '{{WRAPPER}} .pricing-features ul li:not(:first-child)' => 'padding-top: {{SIZE}}{{UNIT}};',
970 ],
971 'condition' => [
972 'borderless_elementor_pricing_table_features_divider' => 'yes',
973 ],
974 ]
975 );
976 $this->add_control(
977 'borderless_elementor_pricing_table_features_divider_color',
978 [
979 'label' => esc_html__( 'Divider Color', 'borderless' ),
980 'type' => Controls_Manager::COLOR,
981 'default' => '#eaeaea',
982 'condition' => [
983 'borderless_elementor_pricing_table_features_divider' => 'yes',
984 ],
985 'selectors' => [
986 '{{WRAPPER}} .pricing-features ul li:not(:last-child)' => 'border-bottom-color: {{VALUE}};',
987 ],
988 ]
989 );
990 $this->add_responsive_control(
991 'borderless_elementor_pricing_table_features_padding',
992 [
993 'label' => esc_html__( 'Padding', 'borderless' ),
994 'type' => Controls_Manager::DIMENSIONS,
995 'size_units' => [ 'px', 'em', '%' ],
996 'selectors' => [
997 '{{WRAPPER}} .pricing-features' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
998 ],
999 ]
1000 );
1001 $this->end_controls_section();
1002
1003 // DESCRIPTION (Style Tab) - Description style settings
1004 $this->start_controls_section(
1005 'borderless_elementor_pricing_table_description_style',
1006 [
1007 'label' => esc_html__( 'Description', 'borderless' ),
1008 'tab' => Controls_Manager::TAB_STYLE,
1009 ]
1010 );
1011 $this->add_responsive_control(
1012 'borderless_elementor_pricing_table_description_position',
1013 [
1014 'label' => esc_html__( 'Position', 'borderless' ),
1015 'type' => Controls_Manager::CHOOSE,
1016 'default' => 'left',
1017 'options' => [
1018 'left' => [
1019 'title' => esc_html__( 'Left', 'borderless' ),
1020 'icon' => 'eicon-h-align-left',
1021 ],
1022 'center' => [
1023 'title' => esc_html__( 'Center', 'borderless' ),
1024 'icon' => 'eicon-h-align-center',
1025 ],
1026 'right' => [
1027 'title' => esc_html__( 'Right', 'borderless' ),
1028 'icon' => 'eicon-h-align-right',
1029 ],
1030 ],
1031 'selectors' => [
1032 '{{WRAPPER}} .pricing-description' => 'text-align: {{VALUE}};',
1033 ],
1034 ]
1035 );
1036 $this->add_control(
1037 'borderless_elementor_pricing_table_description_color',
1038 [
1039 'label' => esc_html__( 'Color', 'borderless' ),
1040 'type' => Controls_Manager::COLOR,
1041 'default' => '#555555',
1042 'selectors' => [
1043 '{{WRAPPER}} .pricing-description' => 'color: {{VALUE}};',
1044 ],
1045 ]
1046 );
1047 $this->add_group_control(
1048 Group_Control_Typography::get_type(),
1049 [
1050 'name' => 'borderless_elementor_pricing_table_description_typography',
1051 'label' => esc_html__( 'Typography', 'borderless' ),
1052 'selector' => '{{WRAPPER}} .pricing-description',
1053 ]
1054 );
1055 $this->add_responsive_control(
1056 'borderless_elementor_pricing_table_description_padding',
1057 [
1058 'label' => esc_html__( 'Padding', 'borderless' ),
1059 'type' => Controls_Manager::DIMENSIONS,
1060 'size_units' => [ 'px', 'em', '%' ],
1061 'default' => [
1062 'top' => 0,
1063 'right' => 0,
1064 'bottom' => 0,
1065 'left' => 0,
1066 'isLinked' => false,
1067 ],
1068 'selectors' => [
1069 '{{WRAPPER}} .pricing-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1070 ],
1071 ]
1072 );
1073 $this->end_controls_section();
1074
1075 // BUTTON (Style Tab) - Button style settings
1076 $this->start_controls_section(
1077 'borderless_elementor_pricing_table_button_style',
1078 [
1079 'label' => esc_html__( 'Button', 'borderless' ),
1080 'tab' => Controls_Manager::TAB_STYLE,
1081 ]
1082 );
1083 $this->add_responsive_control(
1084 'borderless_elementor_pricing_table_button_position',
1085 [
1086 'label' => esc_html__( 'Position', 'borderless' ),
1087 'type' => Controls_Manager::CHOOSE,
1088 'default' => 'left',
1089 'options' => [
1090 'left' => [
1091 'title' => esc_html__( 'Left', 'borderless' ),
1092 'icon' => 'eicon-h-align-left',
1093 ],
1094 'center' => [
1095 'title' => esc_html__( 'Center', 'borderless' ),
1096 'icon' => 'eicon-h-align-center',
1097 ],
1098 'right' => [
1099 'title' => esc_html__( 'Right', 'borderless' ),
1100 'icon' => 'eicon-h-align-right',
1101 ],
1102 ],
1103 'selectors' => [
1104 '{{WRAPPER}} .pricing-footer' => 'text-align: {{VALUE}};',
1105 ],
1106 ]
1107 );
1108 $this->add_group_control(
1109 Group_Control_Typography::get_type(),
1110 [
1111 'name' => 'borderless_elementor_pricing_table_button_typography',
1112 'label' => esc_html__( 'Typography', 'borderless' ),
1113 'selector' => '{{WRAPPER}} .pricing-button',
1114 ]
1115 );
1116 $this->add_group_control(
1117 \Elementor\Group_Control_Text_Shadow::get_type(),
1118 [
1119 'name' => 'borderless_elementor_pricing_table_button_text_shadow',
1120 'label' => __( 'Text Shadow', 'borderless' ),
1121 'selector' => '{{WRAPPER}} .pricing-button',
1122 ]
1123 );
1124 $this->start_controls_tabs( 'borderless_elementor_pricing_table_button_color_tabs' );
1125
1126 // Tab Normal
1127 $this->start_controls_tab(
1128 'borderless_elementor_pricing_table_button_normal',
1129 [
1130 'label' => esc_html__( 'Normal', 'borderless' ),
1131 ]
1132 );
1133 $this->add_control(
1134 'borderless_elementor_pricing_table_button_text_color',
1135 [
1136 'label' => esc_html__( 'Text Color', 'borderless' ),
1137 'type' => Controls_Manager::COLOR,
1138 'default' => '#ffffff',
1139 'selectors' => [
1140 '{{WRAPPER}} .pricing-button' => 'color: {{VALUE}};',
1141 '{{WRAPPER}} .button-icon' => 'fill: {{VALUE}};',
1142 ],
1143 ]
1144 );
1145 $this->add_control(
1146 'borderless_elementor_pricing_table_button_background_color',
1147 [
1148 'label' => esc_html__( 'Background Color', 'borderless' ),
1149 'type' => Controls_Manager::COLOR,
1150 'default' => '#000000',
1151 'selectors' => [
1152 '{{WRAPPER}} .pricing-button' => 'background-color: {{VALUE}};',
1153 ],
1154 ]
1155 );
1156 $this->end_controls_tab();
1157
1158 // Tab Hover
1159 $this->start_controls_tab(
1160 'borderless_elementor_pricing_table_button_hover',
1161 [
1162 'label' => esc_html__( 'Hover', 'borderless' ),
1163 ]
1164 );
1165 $this->add_control(
1166 'borderless_elementor_pricing_table_button_text_color_hover',
1167 [
1168 'label' => esc_html__( 'Text Color', 'borderless' ),
1169 'type' => Controls_Manager::COLOR,
1170 'default' => '#ffffff',
1171 'selectors' => [
1172 '{{WRAPPER}} .pricing-button:hover' => 'color: {{VALUE}};',
1173 '{{WRAPPER}} .pricing-button:hover .button-icon' => 'fill: {{VALUE}};',
1174 ],
1175 ]
1176 );
1177 $this->add_control(
1178 'borderless_elementor_pricing_table_button_background_color_hover',
1179 [
1180 'label' => esc_html__( 'Background Color', 'borderless' ),
1181 'type' => Controls_Manager::COLOR,
1182 'default' => '#000000',
1183 'selectors' => [
1184 '{{WRAPPER}} .pricing-button:hover' => 'background-color: {{VALUE}};',
1185 ],
1186 ]
1187 );
1188 $this->add_control(
1189 'borderless_elementor_pricing_table_button_border_color_hover',
1190 [
1191 'label' => esc_html__( 'Border Color', 'borderless' ),
1192 'type' => Controls_Manager::COLOR,
1193 'default' => '#cccccc',
1194 'selectors' => [
1195 '{{WRAPPER}} .pricing-button:hover' => 'border-color: {{VALUE}};',
1196 ],
1197 ]
1198 );
1199 $this->end_controls_tab();
1200
1201 $this->end_controls_tabs();
1202
1203 $this->add_group_control(
1204 Group_Control_Border::get_type(),
1205 [
1206 'name' => 'borderless_elementor_pricing_table_button_border',
1207 'label' => esc_html__( 'Border', 'borderless' ),
1208 'selector' => '{{WRAPPER}} .pricing-button',
1209 ]
1210 );
1211 $this->add_responsive_control(
1212 'borderless_elementor_pricing_table_button_border_radius',
1213 [
1214 'label' => esc_html__( 'Border Radius', 'borderless' ),
1215 'type' => Controls_Manager::SLIDER,
1216 'size_units' => [ 'px', '%' ],
1217 'default' => [
1218 'size' => 6,
1219 'unit' => 'px',
1220 ],
1221 'selectors' => [
1222 '{{WRAPPER}} .pricing-button' => 'border-radius: {{SIZE}}{{UNIT}};',
1223 ],
1224 ]
1225 );
1226 $this->add_responsive_control(
1227 'borderless_elementor_pricing_table_button_padding',
1228 [
1229 'label' => esc_html__( 'Padding', 'borderless' ),
1230 'type' => Controls_Manager::DIMENSIONS,
1231 'size_units' => [ 'px', 'em', '%' ],
1232 'default' => [
1233 'top' => 10,
1234 'right' => 24,
1235 'bottom' => 10,
1236 'left' => 24,
1237 'isLinked' => false,
1238 ],
1239 'selectors' => [
1240 '{{WRAPPER}} .pricing-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1241 ],
1242 ]
1243 );
1244 $this->add_responsive_control(
1245 'borderless_elementor_pricing_table_button_margin',
1246 [
1247 'label' => esc_html__( 'Margin', 'borderless' ),
1248 'type' => Controls_Manager::DIMENSIONS,
1249 'size_units' => [ 'px', 'em', '%' ],
1250 'selectors' => [
1251 '{{WRAPPER}} .pricing-footer' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1252 ],
1253 ]
1254 );
1255 $this->add_responsive_control(
1256 'borderless_elementor_pricing_table_button_icon_size',
1257 [
1258 'label' => esc_html__( 'Icon Size', 'borderless' ),
1259 'type' => Controls_Manager::SLIDER,
1260 'range' => [
1261 'px' => [
1262 'min' => 10,
1263 'max' => 100,
1264 ],
1265 ],
1266 'default' => [
1267 'size' => 16,
1268 'unit' => 'px',
1269 ],
1270 'selectors' => [
1271 '{{WRAPPER}} .button-icon' => 'width: {{SIZE}}{{UNIT}}; height: auto;',
1272 ],
1273 ]
1274 );
1275 $this->add_control(
1276 'borderless_elementor_pricing_table_button_full_width',
1277 [
1278 'label' => esc_html__( 'Stretch Button', 'borderless' ),
1279 'type' => Controls_Manager::SWITCHER,
1280 'label_on' => esc_html__( 'Yes', 'borderless' ),
1281 'label_off' => esc_html__( 'No', 'borderless' ),
1282 'return_value' => 'yes',
1283 'default' => 'yes',
1284 ]
1285 );
1286 $this->end_controls_section();
1287
1288 // RIBBON / BADGE (Style Tab) - Ribbon style settings
1289 $this->start_controls_section(
1290 'borderless_elementor_pricing_table_ribbon_style',
1291 [
1292 'label' => esc_html__( 'Ribbon / Badge', 'borderless' ),
1293 'tab' => Controls_Manager::TAB_STYLE,
1294 ]
1295 );
1296 $this->add_control(
1297 'borderless_elementor_pricing_table_ribbon_text_color',
1298 [
1299 'label' => esc_html__( 'Text Color', 'borderless' ),
1300 'type' => Controls_Manager::COLOR,
1301 'default' => '#ffffff',
1302 'selectors' => [
1303 '{{WRAPPER}} .pricing-ribbon' => 'color: {{VALUE}};',
1304 ],
1305 ]
1306 );
1307 $this->add_control(
1308 'borderless_elementor_pricing_table_ribbon_background_color',
1309 [
1310 'label' => esc_html__( 'Background Color', 'borderless' ),
1311 'type' => Controls_Manager::COLOR,
1312 'default' => '#e74c3c',
1313 'selectors' => [
1314 '{{WRAPPER}} .pricing-ribbon' => 'background-color: {{VALUE}};',
1315 ],
1316 ]
1317 );
1318 $this->add_group_control(
1319 Group_Control_Typography::get_type(),
1320 [
1321 'name' => 'borderless_elementor_pricing_table_ribbon_typography',
1322 'label' => esc_html__( 'Typography', 'borderless' ),
1323 'selector' => '{{WRAPPER}} .pricing-ribbon',
1324 ]
1325 );
1326 $this->end_controls_section();
1327 }
1328
1329 protected function render() {
1330 $settings = $this->get_settings_for_display();
1331
1332 // Build Pricing HTML based on sale enabled or not
1333 if ( 'yes' === $settings['borderless_elementor_pricing_table_on_sale'] && ! empty( $settings['borderless_elementor_pricing_table_sale_price'] ) ) {
1334 $price_html = '<div class="original-price"><span class="currency-symbol">' . esc_html( $settings['borderless_elementor_pricing_table_currency'] ) . '</span><span class="price-value">' . esc_html( $settings['borderless_elementor_pricing_table_price'] ) . '</span></div>';
1335 $price_html .= '<span class="sale-price"><span class="currency-symbol">' . esc_html( $settings['borderless_elementor_pricing_table_currency'] ) . '</span><span class="price-value">' . esc_html( $settings['borderless_elementor_pricing_table_sale_price'] ) . '</span></span>';
1336 } else {
1337 $price_html = '<span class="price"><span class="currency-symbol">' . esc_html( $settings['borderless_elementor_pricing_table_currency'] ) . '</span><span class="price-value">' . esc_html( $settings['borderless_elementor_pricing_table_price'] ) . '</span></span>';
1338 }
1339 $price_block_html = '<div class="pricing-price">' . $price_html . '<span class="price-period">' . esc_html( $settings['borderless_elementor_pricing_table_period'] ) . '</span></div>';
1340
1341 // Build Header HTML
1342 $header_html = '<div class="pricing-header">';
1343 if ( 'before_title' === $settings['borderless_elementor_pricing_table_icon_position'] ) {
1344 $header_html .= '<div class="pricing-media">';
1345 if ( 'icon' === $settings['borderless_elementor_pricing_table_media_type'] ) {
1346 ob_start();
1347 Icons_Manager::render_icon( $settings['borderless_elementor_pricing_table_icon'], [ 'aria-hidden' => 'true' ] );
1348 $header_html .= ob_get_clean();
1349 } else {
1350 $header_html .= '<img src="' . esc_url( $settings['borderless_elementor_pricing_table_image']['url'] ) . '" alt="">';
1351 }
1352 $header_html .= '</div>';
1353 }
1354 $header_html .= '<h2 class="pricing-title">' . esc_html( $settings['borderless_elementor_pricing_table_title'] ) . '</h2>';
1355 if ( ! empty( $settings['borderless_elementor_pricing_table_subtitle'] ) ) {
1356 $header_html .= '<span class="pricing-subtitle">' . esc_html( $settings['borderless_elementor_pricing_table_subtitle'] ) . '</span>';
1357 }
1358 if ( 'after_title' === $settings['borderless_elementor_pricing_table_icon_position'] ) {
1359 $header_html .= '<div class="pricing-media">';
1360 if ( 'icon' === $settings['borderless_elementor_pricing_table_media_type'] ) {
1361 ob_start();
1362 Icons_Manager::render_icon( $settings['borderless_elementor_pricing_table_icon'], [ 'aria-hidden' => 'true' ] );
1363 $header_html .= ob_get_clean();
1364 } else {
1365 $header_html .= '<img src="' . esc_url( $settings['borderless_elementor_pricing_table_image']['url'] ) . '" alt="">';
1366 }
1367 $header_html .= '</div>';
1368 }
1369 $header_html .= '</div>';
1370
1371 // Build Features HTML
1372 $features_html = '<div class="pricing-features">';
1373 $features_html .= '<h3 class="features-title">' . esc_html( $settings['borderless_elementor_pricing_table_features_title'] ) . '</h3>';
1374 $features_html .= '<ul>';
1375 if ( ! empty( $settings['borderless_elementor_pricing_table_features_list'] ) ) {
1376 foreach ( $settings['borderless_elementor_pricing_table_features_list'] as $item ) {
1377 $tooltip = '';
1378 if ( 'yes' === $item['borderless_elementor_pricing_table_feature_tooltip'] && ! empty( $item['borderless_elementor_pricing_table_feature_tooltip_text'] ) ) {
1379 $tooltip = ' title="' . esc_attr( $item['borderless_elementor_pricing_table_feature_tooltip_text'] ) . '"';
1380 }
1381 $features_html .= '<li' . $tooltip . '>';
1382 ob_start();
1383 Icons_Manager::render_icon( $item['borderless_elementor_pricing_table_feature_icon'], [ 'aria-hidden' => 'true' ] );
1384 $features_html .= ob_get_clean();
1385 $features_html .= ' ' . esc_html( $item['borderless_elementor_pricing_table_feature_text'] );
1386 $features_html .= '</li>';
1387 }
1388 }
1389 $features_html .= '</ul></div>';
1390
1391 // Build Button HTML
1392 $button_html = '<div class="pricing-footer">';
1393 $button_class = 'pricing-button';
1394 if ( 'yes' === $settings['borderless_elementor_pricing_table_button_full_width'] ) {
1395 $button_class .= ' full-width-button';
1396 }
1397 $button_html .= '<a href="' . esc_url( $settings['borderless_elementor_pricing_table_button_link']['url'] ) . '" class="' . esc_attr( $button_class ) . '">';
1398 $button_html .= '<span class="button-content" style="display: inline-flex; align-items: center;">';
1399 if ( 'left' === $settings['borderless_elementor_pricing_table_button_icon_alignment'] ) {
1400 $button_html .= '<span class="button-icon" style="margin-right: 8px;">';
1401 ob_start();
1402 Icons_Manager::render_icon( $settings['borderless_elementor_pricing_table_button_icon'], [ 'aria-hidden' => 'true' ] );
1403 $button_html .= ob_get_clean();
1404 $button_html .= '</span>';
1405 }
1406 $button_html .= '<span class="button-text">' . esc_html( $settings['borderless_elementor_pricing_table_button_text'] ) . '</span>';
1407 if ( 'right' === $settings['borderless_elementor_pricing_table_button_icon_alignment'] ) {
1408 $button_html .= '<span class="button-icon" style="margin-left: 8px;">';
1409 ob_start();
1410 Icons_Manager::render_icon( $settings['borderless_elementor_pricing_table_button_icon'], [ 'aria-hidden' => 'true' ] );
1411 $button_html .= ob_get_clean();
1412 $button_html .= '</span>';
1413 }
1414 $button_html .= '</span></a></div>';
1415
1416 // Assemble Blocks based on user defined order
1417 $blocks = [
1418 [
1419 'order' => $settings['borderless_elementor_pricing_table_header_order'],
1420 'html' => $header_html,
1421 ],
1422 [
1423 'order' => $settings['borderless_elementor_pricing_table_price_order'],
1424 'html' => $price_block_html,
1425 ],
1426 [
1427 'order' => $settings['borderless_elementor_pricing_table_features_order'],
1428 'html' => $features_html,
1429 ],
1430 ];
1431
1432 if ( 'yes' === $settings['borderless_elementor_pricing_table_description_enable'] ) {
1433 $description_html = '<div class="pricing-description">' . wp_kses_post( $settings['borderless_elementor_pricing_table_description'] ) . '</div>';
1434 $blocks[] = [
1435 'order' => $settings['borderless_elementor_pricing_table_description_order'],
1436 'html' => $description_html,
1437 ];
1438 }
1439
1440 $blocks[] = [
1441 'order' => $settings['borderless_elementor_pricing_table_button_order'],
1442 'html' => $button_html,
1443 ];
1444
1445 usort( $blocks, function( $a, $b ) {
1446 return $a['order'] - $b['order'];
1447 });
1448
1449 $ribbon_class = '';
1450 if ( 'yes' === $settings['borderless_elementor_pricing_table_featured'] ) {
1451 $ribbon_class = ' pricing-featured ' . esc_attr( $settings['borderless_elementor_pricing_table_ribbon_style'] );
1452 }
1453
1454 echo '<div class="borderless-pricing-table' . $ribbon_class . '" style="text-align: left;">';
1455 foreach ( $blocks as $block ) {
1456 echo $block['html'];
1457 }
1458 if ( 'yes' === $settings['borderless_elementor_pricing_table_featured'] ) {
1459 echo '<div class="pricing-ribbon">' . esc_html( $settings['borderless_elementor_pricing_table_ribbon_text'] ) . '</div>';
1460 }
1461 echo '</div>';
1462 }
1463 }
1464 ?>
1465