PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.2.1
Easy Elements for Elementor – Addons & Website Templates v1.2.1
1.5.3 1.5.2 1.5.1 1.5.0 1.4.9 1.4.6 1.4.7 1.4.8 1.4.5 1.4.4 1.4.3 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 All 47 releases
easy-elements / widgets / pricing-table / pricing.php

pricing.php in Easy Elements for Elementor – Addons & Website Templates 1.2.1, at widgets/pricing-table/pricing.php

1,331 lines 40.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 use Elementor\Controls_Manager;
3 use Elementor\Widget_Base;
4 use Elementor\Icons_Manager;
5 use Elementor\Group_Control_Background;
6 use Elementor\Group_Control_Border;
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit;
9 }
10
11 class Easyel_Pricing_Table_Widget extends \Elementor\Widget_Base {
12
13 public function get_style_depends() {
14 $handle = 'eel-pricing-table-style';
15 $css_path = plugin_dir_path( __FILE__ ) . 'css/pricing.min.css';
16
17 if ( ! wp_style_is( $handle, 'registered' ) && file_exists( $css_path ) ) {
18 wp_register_style( $handle, plugins_url( 'css/pricing.min.css', __FILE__ ), [], defined( 'WP_DEBUG' ) && WP_DEBUG ? filemtime( $css_path ) : EASYELEMENTS_VER );
19 }
20 return [ $handle ];
21 }
22
23 public function get_name() {
24 return 'eel-pricing';
25 }
26
27 public function get_title() {
28 return __( 'Pricing Table', 'easy-elements' );
29 }
30
31 public function get_icon() {
32 return 'easyicon easyelIcon-pricing-table';
33 }
34
35 public function get_categories() {
36 return [ 'easyelements_category' ];
37 }
38 public function get_keywords() {
39 return [ 'pricing', 'pricing-table', 'table', 'text' ];
40 }
41
42 protected function register_controls() {
43 $this->start_controls_section('section_settings', [
44 'label' => __('Pricing Settings', 'easy-elements'),
45 ]);
46
47 $this->add_control('skin_style', [
48 'label' => __('Pricing Skin', 'easy-elements'),
49 'type' => Controls_Manager::SELECT,
50 'options' => [
51 'skin1' => 'Skin 01',
52 'skin2' => 'Skin 02',
53 ],
54 'default' => 'skin1',
55 ]);
56
57 $this->end_controls_section();
58
59 // Title & Price
60 $this->start_controls_section('section_title_price', [
61 'label' => __('Title & Price Settings', 'easy-elements'),
62 ]);
63 $this->add_control('title', [
64 'label' => __('Title', 'easy-elements'),
65 'type' => Controls_Manager::TEXT,
66 'default' => 'Basic Plan',
67 'dynamic' => [
68 'active' => true,
69 ],
70 ]);
71
72 $this->add_control('description', [
73 'label' => __('Description', 'easy-elements'),
74 'type' => Controls_Manager::TEXT,
75 'default' => '',
76 'dynamic' => [
77 'active' => true,
78 ],
79 ]);
80
81 // On Sale Switcher
82 $this->add_control('on_sale', [
83 'label' => __('On Sale?', 'easy-elements'),
84 'type' => Controls_Manager::SWITCHER,
85 'label_on' => __('Yes', 'easy-elements'),
86 'label_off' => __('No', 'easy-elements'),
87 'return_value' => 'yes',
88 'default' => '',
89 ]);
90
91 // Regular Price - visible only if On Sale = yes
92 $this->add_control('regular_price', [
93 'label' => __('Regular Price', 'easy-elements'),
94 'type' => Controls_Manager::TEXT,
95 'default' => '59',
96 'dynamic' => [
97 'active' => true,
98 ],
99 'condition' => [
100 'on_sale' => 'yes',
101 ],
102 ]);
103
104 // Sale Price - visible only if On Sale = yes
105 $this->add_control('sale_price', [
106 'label' => __('Sale Price', 'easy-elements'),
107 'type' => Controls_Manager::TEXT,
108 'default' => '49',
109 'dynamic' => [
110 'active' => true,
111 ],
112 'condition' => [
113 'on_sale' => 'yes',
114 ],
115 ]);
116
117 // Price (used if On Sale = no)
118 $this->add_control('price', [
119 'label' => __('Price', 'easy-elements'),
120 'type' => Controls_Manager::TEXT,
121 'default' => '59',
122 'dynamic' => [
123 'active' => true,
124 ],
125 'condition' => [
126 'on_sale!' => 'yes',
127 ],
128 ]);
129
130 $this->add_control('price_currency', [
131 'label' => __('Currency', 'easy-elements'),
132 'type' => Controls_Manager::TEXT,
133 'default' => '$',
134 'dynamic' => [
135 'active' => true,
136 ],
137 ]);
138 $this->add_control('currency_placement', [
139 'label' => __('Currency Position', 'easy-elements'),
140 'type' => \Elementor\Controls_Manager::CHOOSE,
141 'default' => 'left',
142 'options' => [
143 'left' => [
144 'title' => __('Left', 'easy-elements'),
145 'icon' => 'eicon-h-align-left',
146 ],
147 'right' => [
148 'title' => __('Right', 'easy-elements'),
149 'icon' => 'eicon-h-align-right',
150 ],
151 ],
152 'toggle' => false,
153 ]);
154 $this->add_control('price_period', [
155 'label' => __('Period', 'easy-elements'),
156 'type' => Controls_Manager::TEXT,
157 'default' => 'month',
158 'dynamic' => [
159 'active' => true,
160 ],
161 ]);
162 $this->add_control('period_separator', [
163 'label' => __('Separator', 'easy-elements'),
164 'type' => Controls_Manager::TEXT,
165 'default' => '/',
166 'dynamic' => [
167 'active' => true,
168 ],
169 ]);
170
171 $this->add_responsive_control('header_alignment', [
172 'label' => __('Alignment', 'easy-elements'),
173 'type' => \Elementor\Controls_Manager::CHOOSE,
174 'options' => [
175 'left' => [
176 'title' => __('Left', 'easy-elements'),
177 'icon' => 'eicon-text-align-left',
178 ],
179 'center' => [
180 'title' => __('Center', 'easy-elements'),
181 'icon' => 'eicon-text-align-center',
182 ],
183 'right' => [
184 'title' => __('Right', 'easy-elements'),
185 'icon' => 'eicon-text-align-right',
186 ],
187 ],
188 'default' => 'left',
189 'toggle' => true,
190 'selectors' => [
191 '{{WRAPPER}} .eel-price-title, {{WRAPPER}} .eel-price, {{WRAPPER}} .eel-subtitle-price' => 'text-align: {{VALUE}};',
192 ],
193 ]);
194
195 $this->end_controls_section();
196
197 // Features
198 $this->start_controls_section('section_features', [
199 'label' => __('Features Settings', 'easy-elements'),
200 ]);
201 $this->add_control(
202 'features_des',
203 [
204 'label' => esc_html__( 'Features Description On Top', 'easy-elements' ),
205 'type' => \Elementor\Controls_Manager::TEXTAREA,
206 'placeholder' => esc_html__( 'Enter features description', 'easy-elements' ),
207 ]
208 );
209 $this->add_control('features_list', [
210 'label' => __('Features', 'easy-elements'),
211 'type' => Controls_Manager::REPEATER,
212 'fields' => [
213 [
214 'name' => 'icon',
215 'label' => __('Icon', 'easy-elements'),
216 'type' => Controls_Manager::ICONS,
217 ],
218 [
219 'name' => 'text',
220 'label' => __('Text', 'easy-elements'),
221 'type' => Controls_Manager::TEXT,
222 'default' => '99.9% Uptime Guarantee',
223 'dynamic' => [
224 'active' => true,
225 ],
226 ],
227 ],
228 'default' => [
229 [
230 'text' => '99.9% Uptime Guarantee',
231 ],
232 [
233 'text' => 'Free SSL Certificate',
234 ],
235 [
236 'text' => '24/7 Expert Support',
237 ],
238 [
239 'text' => 'One-Click WordPress Install',
240 ],
241 [
242 'text' => 'Unlimited Bandwidth',
243 ],
244 [
245 'text' => 'SSD Storage',
246 ],
247 [
248 'text' => 'Free Daily Backups',
249 ],
250 [
251 'text' => 'Enhanced Security',
252 ],
253 ],
254 ]);
255
256 $this->add_control('feature_icon_style', [
257 'label' => __('Icon Style', 'easy-elements'),
258 'type' => Controls_Manager::SELECT,
259 'options' => [
260 'icon-only' => __('Icon Only', 'easy-elements'),
261 'icon-bg' => __('Icon with Background', 'easy-elements'),
262 'icon-border' => __('Icon with Border', 'easy-elements'),
263 ],
264 'default' => 'icon-only',
265 ]);
266
267 $this->add_group_control(
268 Group_Control_Background::get_type(),
269 [
270 'name' => 'feature_icon_bg',
271 'label' => __('Icon Background', 'easy-elements'),
272 'types' => ['classic', 'gradient'],
273 'selector' => '{{WRAPPER}} .eel-features .feature-icon.icon-bg',
274 'condition' => [
275 'feature_icon_style' => 'icon-bg',
276 ],
277 ]
278 );
279
280 $this->add_group_control(
281 Group_Control_Border::get_type(),
282 [
283 'name' => 'feature_icon_border',
284 'label' => __('Icon Border', 'easy-elements'),
285 'condition' => ['feature_icon_style' => 'icon-border'],
286 'selector' => '{{WRAPPER}} .eel-features .feature-icon.icon-border',
287 ]
288 );
289
290 $this->add_control('feature_icon_color', [
291 'label' => __('Icon Color', 'easy-elements'),
292 'type' => Controls_Manager::COLOR,
293 'condition' => [
294 'feature_icon_style!' => '',
295 ],
296 'selectors' => [
297 '{{WRAPPER}} .eel-features .feature-icon' => 'color: {{VALUE}};',
298 '{{WRAPPER}} .eel-features .feature-icon svg' => 'fill: {{VALUE}};',
299 ],
300 ]);
301
302 $this->add_control('feature_icon_size', [
303 'label' => __('Icon Size (px)', 'easy-elements'),
304 'type' => \Elementor\Controls_Manager::SLIDER,
305 'size_units' => ['px'],
306 'range' => [
307 'px' => [
308 'min' => 8,
309 'max' => 64,
310 'step' => 1,
311 ],
312 ],
313 'selectors' => [
314 '{{WRAPPER}} .eel-features svg.feature-icon' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
315 '{{WRAPPER}} .eel-features i.feature-icon' => 'font-size: {{SIZE}}{{UNIT}};',
316 ],
317 ]);
318
319 $this->add_responsive_control('feature_icon_padding', [
320 'label' => __('Icon Padding', 'easy-elements'),
321 'type' => \Elementor\Controls_Manager::DIMENSIONS,
322 'size_units' => ['px', '%', 'em'],
323 'condition' => [
324 'feature_icon_style' => ['icon-border', 'icon-bg'],
325 ],
326 'selectors' => [
327 '{{WRAPPER}} .eel-features .feature-icon.icon-border' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
328 '{{WRAPPER}} .eel-features .feature-icon.icon-bg' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
329 ],
330 ]);
331
332 $this->add_responsive_control('feature_icon_border_radius', [
333 'label' => __('Icon Border Radius', 'easy-elements'),
334 'type' => Controls_Manager::DIMENSIONS,
335 'size_units' => ['px', '%'],
336 'condition' => [
337 'feature_icon_style' => ['icon-border', 'icon-bg'],
338 ],
339 'selectors' => [
340 '{{WRAPPER}} .eel-features .feature-icon.icon-border' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
341 '{{WRAPPER}} .eel-features .feature-icon.icon-bg' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
342 ],
343 ]);
344
345 $this->add_responsive_control('feature_text_alignment', [
346 'label' => __('Alignment', 'easy-elements'),
347 'type' => \Elementor\Controls_Manager::CHOOSE,
348 'options' => [
349 'left' => [
350 'title' => __('Left', 'easy-elements'),
351 'icon' => 'eicon-text-align-left',
352 ],
353 'center' => [
354 'title' => __('Center', 'easy-elements'),
355 'icon' => 'eicon-text-align-center',
356 ],
357 'right' => [
358 'title' => __('Right', 'easy-elements'),
359 'icon' => 'eicon-text-align-right',
360 ],
361 ],
362 'default' => 'left',
363 'toggle' => true,
364 'selectors' => [
365 '{{WRAPPER}} ul.eel-features' => 'text-align: {{VALUE}};',
366 ],
367 ]);
368
369 $this->end_controls_section();
370
371 $this->start_controls_section('section_ribbon', [
372 'label' => __('Featured Settings', 'easy-elements'),
373 ]);
374 $this->add_control('is_featured', [
375 'label' => __('Featured', 'easy-elements'),
376 'type' => Controls_Manager::SWITCHER,
377 'return_value' => 'yes',
378 ]);
379 $this->add_control('ribbon_style', [
380 'label' => __('Ribbon Style', 'easy-elements'),
381 'type' => Controls_Manager::SELECT,
382 'options' => [
383 'style1' => 'Style 1',
384 'style2' => 'Style 2',
385 ],
386 'default' => 'style1',
387 ]);
388 $this->add_control('featured_tag_text', [
389 'label' => __('Featured Text', 'easy-elements'),
390 'type' => Controls_Manager::TEXT,
391 'default' => 'Featured',
392 'dynamic' => [
393 'active' => true,
394 ],
395 ]);
396 $this->add_control('ribbon_alignment', [
397 'label' => __('Alignment', 'easy-elements'),
398 'type' => Controls_Manager::SELECT,
399 'options' => [ 'left' => 'Left', 'right' => 'Right' ],
400 'default' => 'right',
401 'condition' => [
402 'ribbon_style' => 'style2',
403 ],
404 ]);
405
406 $this->add_control(
407 'featured__text_color',
408 [
409 'label' => __('Text Color', 'easy-elements'),
410 'type' => \Elementor\Controls_Manager::COLOR,
411 'selectors' => [
412 '{{WRAPPER}} .featured.style2 .eel-ribbon, {{WRAPPER}} .eel-ribbon' => 'color: {{VALUE}};',
413 ],
414 ]
415 );
416
417 $this->add_group_control(
418 Group_Control_Background::get_type(),
419 [
420 'name' => 'featured__bg',
421 'label' => __('Background', 'easy-elements'),
422 'types' => ['classic', 'gradient'],
423 'selector' => '{{WRAPPER}} .featured.style2 .eel-ribbon, {{WRAPPER}} .eel-ribbon',
424 ]
425 );
426
427 $this->add_group_control(
428 \Elementor\Group_Control_Typography::get_type(),
429 [
430 'name' => 'featured__typography',
431 'label' => __('Typography', 'easy-elements'),
432 'selector' => '{{WRAPPER}} .featured.style2 .eel-ribbon, {{WRAPPER}} .eel-ribbon',
433 ]
434 );
435
436 $this->add_responsive_control(
437 'fea_box_padding',
438 [
439 'label' => __('Padding', 'easy-elements'),
440 'type' => \Elementor\Controls_Manager::DIMENSIONS,
441 'size_units' => ['px', '%', 'em'],
442 'selectors' => [
443 '{{WRAPPER}} .eel-ribbon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
444 ],
445 'condition' => [
446 'ribbon_style' => 'style1',
447 ],
448 ]
449 );
450
451 $this->add_responsive_control(
452 'fea_box_border_radius',
453 [
454 'label' => __('Border Radius', 'easy-elements'),
455 'type' => \Elementor\Controls_Manager::DIMENSIONS,
456 'size_units' => ['px', '%'],
457 'selectors' => [
458 '{{WRAPPER}} .eel-ribbon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
459 ],
460 'condition' => [
461 'ribbon_style' => 'style1',
462 ],
463 ]
464 );
465
466 $this->end_controls_section();
467
468 // Button
469 $this->start_controls_section('section_button', [
470 'label' => __('Button Settings', 'easy-elements'),
471 ]);
472 $this->add_control('show_button', [
473 'label' => __('Show Button', 'easy-elements'),
474 'type' => Controls_Manager::SWITCHER,
475 'return_value' => 'yes',
476 'default' => 'yes',
477 ]);
478 $this->add_control('button_text', [
479 'label' => __('Text', 'easy-elements'),
480 'type' => Controls_Manager::TEXT,
481 'default' => 'Choose Plan',
482 'dynamic' => [
483 'active' => true,
484 ],
485 ]);
486
487 $this->add_control('button_subtext', [
488 'label' => __('Bottom Text', 'easy-elements'),
489 'type' => Controls_Manager::TEXT,
490 'default' => 'No credit card required!',
491 'placeholder' => __('Enter subtext below button', 'easy-elements'),
492 'dynamic' => [
493 'active' => true,
494 ],
495 ]);
496
497 $this->add_control('button_link', [
498 'label' => __('Link', 'easy-elements'),
499 'type' => Controls_Manager::URL,
500 'default' => [ 'url' => '#' ],
501 'dynamic' => [
502 'active' => true,
503 ],
504 ]);
505 $this->add_control('button_icon', [
506 'label' => __('Icon', 'easy-elements'),
507 'type' => Controls_Manager::ICONS,
508 'default' => [ 'value' => '', 'library' => 'solid' ],
509 ]);
510 $this->add_control('button_icon_position', [
511 'label' => __('Icon Position', 'easy-elements'),
512 'type' => Controls_Manager::SELECT,
513 'options' => [ 'before' => 'Before', 'after' => 'After' ],
514 'default' => 'after',
515 ]);
516 $this->add_responsive_control('button_icon_spacing', [
517 'label' => __('Icon Spacing', 'easy-elements'),
518 'type' => Controls_Manager::SLIDER,
519 'range' => [
520 'px' => ['min' => 0, 'max' => 50],
521 ],
522 'default' => [],
523 'selectors' => [
524 '{{WRAPPER}} .eel-button .eel-icon-before' => 'margin-right: {{SIZE}}{{UNIT}};',
525 '{{WRAPPER}} .eel-button .eel-icon-after' => 'margin-left: {{SIZE}}{{UNIT}};',
526 ],
527 ]);
528
529 $this->add_responsive_control('button_icon_spacing_vertical', [
530 'label' => __('Icon Vertical Spacing', 'easy-elements'),
531 'type' => \Elementor\Controls_Manager::SLIDER,
532 'range' => [
533 'px' => ['min' => 0, 'max' => 60],
534 ],
535 'selectors' => [
536 '{{WRAPPER}} .eel-button .eel-icon-before, {{WRAPPER}} .eel-button .eel-icon-after' => 'top: {{SIZE}}{{UNIT}}; position:relative;',
537 ],
538 ]);
539
540 $this->add_control('button_position', [
541 'label' => __('Button Position', 'easy-elements'),
542 'type' => Controls_Manager::SELECT,
543 'options' => [
544 'after_features' => __('After Features', 'easy-elements'),
545 'in_features' => __('Before Features', 'easy-elements'),
546 ],
547 'default' => 'after_features',
548 ]);
549
550 $this->add_responsive_control('btn_alignment', [
551 'label' => __('Alignment', 'easy-elements'),
552 'type' => \Elementor\Controls_Manager::CHOOSE,
553 'options' => [
554 'left' => [
555 'title' => __('Left', 'easy-elements'),
556 'icon' => 'eicon-text-align-left',
557 ],
558 'center' => [
559 'title' => __('Center', 'easy-elements'),
560 'icon' => 'eicon-text-align-center',
561 ],
562 'right' => [
563 'title' => __('Right', 'easy-elements'),
564 'icon' => 'eicon-text-align-right',
565 ],
566 ],
567 'default' => 'left',
568 'toggle' => true,
569 'selectors' => [
570 '{{WRAPPER}} .eel-btn-part' => 'text-align: {{VALUE}};',
571 ],
572 ]);
573
574 $this->add_control('button_full_width', [
575 'label' => __('Enable Full Button Width', 'easy-elements'),
576 'type' => \Elementor\Controls_Manager::SWITCHER,
577 'label_on' => __('Yes', 'easy-elements'),
578 'label_off' => __('No', 'easy-elements'),
579 'return_value' => 'yes',
580 'default' => '',
581 ]);
582
583 $this->end_controls_section();
584
585 // Start Style Tab Section
586 $this->start_controls_section(
587 'section_style_title_price',
588 [
589 'label' => __('Title & Price Style', 'easy-elements'),
590 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
591 ]
592 );
593
594 // Title Style
595 $this->add_control(
596 'title_heading',
597 [
598 'label' => __('Title', 'easy-elements'),
599 'type' => \Elementor\Controls_Manager::HEADING,
600 'separator' => 'before',
601 ]
602 );
603 $this->add_control(
604 'title_color',
605 [
606 'label' => __('Title Color', 'easy-elements'),
607 'type' => \Elementor\Controls_Manager::COLOR,
608 'selectors' => [
609 '{{WRAPPER}} .eel-price-title' => 'color: {{VALUE}};',
610 ],
611 ]
612 );
613 $this->add_control(
614 'title_hilight_color',
615 [
616 'label' => __('Highlight Color', 'easy-elements'),
617 'type' => \Elementor\Controls_Manager::COLOR,
618 'selectors' => [
619 '{{WRAPPER}} .eel-price-title span' => 'color: {{VALUE}};',
620 ],
621 ]
622 );
623 $this->add_group_control(
624 \Elementor\Group_Control_Typography::get_type(),
625 [
626 'name' => 'title_typography',
627 'selector' => '{{WRAPPER}} .eel-price-title',
628 ]
629 );
630
631 $this->add_responsive_control(
632 'title_margin',
633 [
634 'label' => __('Margin', 'easy-elements'),
635 'type' => \Elementor\Controls_Manager::DIMENSIONS,
636 'size_units' => ['px', 'em', '%'],
637 'selectors' => [
638 '{{WRAPPER}} .eel-price-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
639 ],
640 ]
641 );
642
643 // Title Style
644 $this->add_control(
645 'description_heading',
646 [
647 'label' => __('Description', 'easy-elements'),
648 'type' => \Elementor\Controls_Manager::HEADING,
649 'separator' => 'before',
650 ]
651 );
652
653 $this->add_control(
654 'description_color',
655 [
656 'label' => __('Description Color', 'easy-elements'),
657 'type' => \Elementor\Controls_Manager::COLOR,
658 'selectors' => [
659 '{{WRAPPER}} .eel-subtitle-price' => 'color: {{VALUE}};',
660 ],
661 ]
662 );
663 $this->add_group_control(
664 \Elementor\Group_Control_Typography::get_type(),
665 [
666 'name' => 'description_typography',
667 'selector' => '{{WRAPPER}} .eel-subtitle-price',
668 ]
669 );
670
671 $this->add_responsive_control(
672 'description_margin',
673 [
674 'label' => __('Margin', 'easy-elements'),
675 'type' => \Elementor\Controls_Manager::DIMENSIONS,
676 'size_units' => ['px', 'em', '%'],
677 'selectors' => [
678 '{{WRAPPER}} .eel-subtitle-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
679 ],
680 ]
681 );
682
683 // Regular Price Style
684 $this->add_control(
685 'price_heading',
686 [
687 'label' => __('Price', 'easy-elements'),
688 'type' => \Elementor\Controls_Manager::HEADING,
689 'separator' => 'before',
690 ]
691 );
692 $this->add_control(
693 'price_color',
694 [
695 'label' => __('Price Color', 'easy-elements'),
696 'type' => \Elementor\Controls_Manager::COLOR,
697 'selectors' => [
698 '{{WRAPPER}} .eel-price .eel-amount' => 'color: {{VALUE}};',
699 ],
700 ]
701 );
702 $this->add_group_control(
703 \Elementor\Group_Control_Typography::get_type(),
704 [
705 'name' => 'price_typography',
706 'selector' => '{{WRAPPER}} .eel-price .eel-amount',
707 ]
708 );
709
710 $this->add_responsive_control(
711 'price__margin',
712 [
713 'label' => __('Margin', 'easy-elements'),
714 'type' => \Elementor\Controls_Manager::DIMENSIONS,
715 'size_units' => ['px', 'em', '%'],
716 'selectors' => [
717 '{{WRAPPER}} .eel-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
718 ],
719 ]
720 );
721
722 // Sale Price Del Style (optional)
723 $this->add_control(
724 'sale_price_heading',
725 [
726 'label' => __('Regular (Sale) Price', 'easy-elements'),
727 'type' => \Elementor\Controls_Manager::HEADING,
728 'separator' => 'before',
729 'condition' => ['on_sale' => 'yes'],
730 ]
731 );
732 $this->add_control(
733 'regular_price_color',
734 [
735 'label' => __('Regular Price Color', 'easy-elements'),
736 'type' => \Elementor\Controls_Manager::COLOR,
737 'selectors' => [
738 '{{WRAPPER}} .eel-sale-price' => 'color: {{VALUE}};',
739 ],
740 'condition' => ['on_sale' => 'yes'],
741 ]
742 );
743 $this->add_group_control(
744 \Elementor\Group_Control_Typography::get_type(),
745 [
746 'name' => 'regular_price_typography',
747 'selector' => '{{WRAPPER}} .eel-sale-price',
748 'condition' => ['on_sale' => 'yes'],
749 ]
750 );
751
752 // Period Style
753 $this->add_control(
754 'period_heading',
755 [
756 'label' => __('Period', 'easy-elements'),
757 'type' => \Elementor\Controls_Manager::HEADING,
758 'separator' => 'before',
759 ]
760 );
761 $this->add_control(
762 'period_color',
763 [
764 'label' => __('Period Color', 'easy-elements'),
765 'type' => \Elementor\Controls_Manager::COLOR,
766 'selectors' => [
767 '{{WRAPPER}} .eel-period' => 'color: {{VALUE}};',
768 ],
769 ]
770 );
771 $this->add_group_control(
772 \Elementor\Group_Control_Typography::get_type(),
773 [
774 'name' => 'period_typography',
775 'selector' => '{{WRAPPER}} .eel-period',
776 ]
777 );
778
779 $this->add_responsive_control(
780 'period_margin',
781 [
782 'label' => __('Margin', 'easy-elements'),
783 'type' => \Elementor\Controls_Manager::DIMENSIONS,
784 'size_units' => ['px', 'em', '%'],
785 'selectors' => [
786 '{{WRAPPER}} .eel-price .eel-period' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
787 ],
788 ]
789 );
790
791 $this->add_control(
792 'currency_style_heading',
793 [
794 'label' => __('Currency Symbol', 'easy-elements'),
795 'type' => \Elementor\Controls_Manager::HEADING,
796 'separator' => 'before',
797 ]
798 );
799
800 $this->add_control(
801 'currency_symbol_color',
802 [
803 'label' => __('Color', 'easy-elements'),
804 'type' => \Elementor\Controls_Manager::COLOR,
805 'selectors' => [
806 '{{WRAPPER}} .eel-currency' => 'color: {{VALUE}};',
807 ],
808 ]
809 );
810
811 $this->add_group_control(
812 \Elementor\Group_Control_Typography::get_type(),
813 [
814 'name' => 'currency_symbol_typography',
815 'selector' => '{{WRAPPER}} .eel-currency',
816 ]
817 );
818
819 $this->add_responsive_control(
820 'currency_symbol_margin',
821 [
822 'label' => __('Currency Margin', 'easy-elements'),
823 'type' => \Elementor\Controls_Manager::DIMENSIONS,
824 'size_units' => ['px', 'em', '%'],
825 'selectors' => [
826 '{{WRAPPER}} .eel-currency' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
827 ],
828 ]
829 );
830
831 $this->add_responsive_control(
832 'currency_symbol_vertical_position',
833 [
834 'label' => __('Vertical Position', 'easy-elements'),
835 'type' => \Elementor\Controls_Manager::SLIDER,
836 'size_units' => ['px', '%'],
837 'range' => [
838 'px' => [
839 'min' => -50,
840 'max' => 50,
841 ],
842 '%' => [
843 'min' => -100,
844 'max' => 100,
845 ],
846 ],
847 'selectors' => [
848 '{{WRAPPER}} .eel-currency' => 'display: inline-block; transform: translateY({{SIZE}}{{UNIT}});',
849 ],
850 ]
851 );
852
853 $this->end_controls_section();
854
855 $this->start_controls_section(
856 'section_features_descqription_style',
857 [
858 'label' => __('Features Description', 'easy-elements'),
859 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
860 'condition' => [
861 'features_des!' => '',
862 ],
863 ]
864 );
865
866 $this->add_control(
867 'features_des__text_color',
868 [
869 'label' => __('Color', 'easy-elements'),
870 'type' => \Elementor\Controls_Manager::COLOR,
871 'selectors' => [
872 '{{WRAPPER}} .eel-features-description' => 'color: {{VALUE}};',
873 ],
874 ]
875 );
876
877 // Text typography
878 $this->add_group_control(
879 \Elementor\Group_Control_Typography::get_type(),
880 [
881 'name' => 'features_des__text__typography',
882 'selector' => '{{WRAPPER}} .eel-features-description',
883 ]
884 );
885
886 $this->add_responsive_control(
887 'features_description_margin',
888 [
889 'label' => __('Margin', 'easy-elements'),
890 'type' => \Elementor\Controls_Manager::DIMENSIONS,
891 'size_units' => ['px', 'em', '%'],
892 'selectors' => [
893 '{{WRAPPER}} .eel-features-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
894 ],
895 ]
896 );
897
898 $this->end_controls_section();
899
900 $this->start_controls_section(
901 'section_features_style',
902 [
903 'label' => __('Features Style', 'easy-elements'),
904 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
905 ]
906 );
907
908 // Text color
909 $this->add_control(
910 'features_text_color',
911 [
912 'label' => __('Color', 'easy-elements'),
913 'type' => \Elementor\Controls_Manager::COLOR,
914 'selectors' => [
915 '{{WRAPPER}} .eel-features li' => 'color: {{VALUE}};',
916 ],
917 ]
918 );
919
920 // Text typography
921 $this->add_group_control(
922 \Elementor\Group_Control_Typography::get_type(),
923 [
924 'name' => 'features_text_typography',
925 'selector' => '{{WRAPPER}} .eel-features li',
926 ]
927 );
928
929 // Features list border
930 $this->add_group_control(
931 \Elementor\Group_Control_Border::get_type(),
932 [
933 'name' => 'features_border',
934 'label' => __('Border', 'easy-elements'),
935 'selector' => '{{WRAPPER}} .eel-features li',
936 ]
937 );
938
939 // Features list padding
940 $this->add_responsive_control(
941 'features_padding',
942 [
943 'label' => __('Padding', 'easy-elements'),
944 'type' => \Elementor\Controls_Manager::DIMENSIONS,
945 'size_units' => ['px', 'em', '%'],
946 'selectors' => [
947 '{{WRAPPER}} .eel-features li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
948 ],
949 ]
950 );
951
952 // Features list margin
953 $this->add_responsive_control(
954 'features_margin',
955 [
956 'label' => __('Margin', 'easy-elements'),
957 'type' => \Elementor\Controls_Manager::DIMENSIONS,
958 'size_units' => ['px', 'em', '%'],
959 'selectors' => [
960 '{{WRAPPER}} .eel-features li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
961 ],
962 ]
963 );
964
965 $this->end_controls_section();
966
967 $this->start_controls_section(
968 'section_button_style',
969 [
970 'label' => __('Button Style', 'easy-elements'),
971 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
972 ]
973 );
974
975 $this->start_controls_tabs('button_style_tabs');
976
977 // Normal Tab
978 $this->start_controls_tab(
979 'button_style_normal',
980 [
981 'label' => __('Normal', 'easy-elements'),
982 ]
983 );
984
985 // Normal Text Color
986 $this->add_control(
987 'button_text_color',
988 [
989 'label' => __('Color', 'easy-elements'),
990 'type' => \Elementor\Controls_Manager::COLOR,
991 'selectors' => [
992 '{{WRAPPER}} .eel-button' => 'color: {{VALUE}};',
993 ],
994 ]
995 );
996
997 $this->add_control(
998 'button_icon_color',
999 [
1000 'label' => __('Icon Color', 'easy-elements'),
1001 'type' => \Elementor\Controls_Manager::COLOR,
1002 'selectors' => [
1003 '{{WRAPPER}} .eel-button .eel-icon-before, {{WRAPPER}} .eel-button .eel-icon-after' => 'color: {{VALUE}};',
1004 '{{WRAPPER}} .eel-button .eel-icon-before svg, {{WRAPPER}} .eel-button .eel-icon-after svg' => 'fill: {{VALUE}};',
1005 ],
1006 ]
1007 );
1008
1009 // Normal Background
1010 $this->add_group_control(
1011 \Elementor\Group_Control_Background::get_type(),
1012 [
1013 'name' => 'button_background',
1014 'label' => __('Background', 'easy-elements'),
1015 'types' => ['classic', 'gradient'],
1016 'selector' => '{{WRAPPER}} .eel-button',
1017 ]
1018 );
1019
1020 $this->add_group_control(
1021 \Elementor\Group_Control_Typography::get_type(),
1022 [
1023 'name' => 'button_typography',
1024 'selector' => '{{WRAPPER}} .eel-button',
1025 ]
1026 );
1027
1028 // Normal Border
1029 $this->add_group_control(
1030 \Elementor\Group_Control_Border::get_type(),
1031 [
1032 'name' => 'button_border',
1033 'label' => __('Border', 'easy-elements'),
1034 'selector' => '{{WRAPPER}} .eel-button',
1035 ]
1036 );
1037
1038 // Normal Box Shadow
1039 $this->add_group_control(
1040 \Elementor\Group_Control_Box_Shadow::get_type(),
1041 [
1042 'name' => 'button_box_shadow',
1043 'label' => __('Box Shadow', 'easy-elements'),
1044 'selector' => '{{WRAPPER}} .eel-button',
1045 ]
1046 );
1047
1048 $this->end_controls_tab();
1049
1050 // Hover Tab
1051 $this->start_controls_tab(
1052 'button_style_hover',
1053 [
1054 'label' => __('Hover', 'easy-elements'),
1055 ]
1056 );
1057
1058 // Hover Text Color
1059 $this->add_control(
1060 'button_text_color_hover',
1061 [
1062 'label' => __('Text Color', 'easy-elements'),
1063 'type' => \Elementor\Controls_Manager::COLOR,
1064 'selectors' => [
1065 '{{WRAPPER}} .eel-button:hover' => 'color: {{VALUE}};',
1066 ],
1067 ]
1068 );
1069
1070 // Hover Background
1071 $this->add_group_control(
1072 \Elementor\Group_Control_Background::get_type(),
1073 [
1074 'name' => 'button_background_hover',
1075 'label' => __('Background', 'easy-elements'),
1076 'types' => ['classic', 'gradient'],
1077 'selector' => '{{WRAPPER}} .eel-button:hover',
1078 ]
1079 );
1080
1081 // Hover Border
1082 $this->add_group_control(
1083 \Elementor\Group_Control_Border::get_type(),
1084 [
1085 'name' => 'button_border_hover',
1086 'label' => __('Border', 'easy-elements'),
1087 'selector' => '{{WRAPPER}} .eel-button:hover',
1088 ]
1089 );
1090
1091 // Hover Box Shadow
1092 $this->add_group_control(
1093 \Elementor\Group_Control_Box_Shadow::get_type(),
1094 [
1095 'name' => 'button_box_shadow_hover',
1096 'label' => __('Box Shadow', 'easy-elements'),
1097 'selector' => '{{WRAPPER}} .eel-button:hover',
1098 ]
1099 );
1100
1101 $this->end_controls_tab();
1102
1103 $this->end_controls_tabs();
1104
1105 $this->add_responsive_control(
1106 'button_border_radius',
1107 [
1108 'label' => __('Border Radius', 'easy-elements'),
1109 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1110 'size_units' => ['px', '%', 'em'],
1111 'selectors' => [
1112 '{{WRAPPER}} .eel-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1113 ],
1114 ]
1115 );
1116
1117 $this->add_responsive_control(
1118 'button_padding',
1119 [
1120 'label' => __('Padding', 'easy-elements'),
1121 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1122 'size_units' => ['px', 'em', '%'],
1123 'selectors' => [
1124 '{{WRAPPER}} .eel-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1125 ],
1126 ]
1127 );
1128
1129 $this->add_responsive_control(
1130 'button_margin',
1131 [
1132 'label' => __('Margin', 'easy-elements'),
1133 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1134 'size_units' => ['px', 'em', '%'],
1135 'selectors' => [
1136 '{{WRAPPER}} .eel-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1137 ],
1138 ]
1139 );
1140
1141 $this->end_controls_section();
1142
1143 $this->start_controls_section(
1144 'section_button_subtext_style',
1145 [
1146 'label' => __('Button Subtext Style', 'easy-elements'),
1147 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1148 ]
1149 );
1150
1151 // Text Color
1152 $this->add_control(
1153 'button_subtext_color',
1154 [
1155 'label' => __('Color', 'easy-elements'),
1156 'type' => \Elementor\Controls_Manager::COLOR,
1157 'selectors' => [
1158 '{{WRAPPER}} .eel-button-subtext' => 'color: {{VALUE}};',
1159 ],
1160 ]
1161 );
1162
1163 // Typography
1164 $this->add_group_control(
1165 \Elementor\Group_Control_Typography::get_type(),
1166 [
1167 'name' => 'button_subtext_typography',
1168 'label' => __('Typography', 'easy-elements'),
1169 'selector' => '{{WRAPPER}} .eel-button-subtext',
1170 ]
1171 );
1172
1173 $this->add_responsive_control(
1174 'button_margin_sub',
1175 [
1176 'label' => __('Margin', 'easy-elements'),
1177 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1178 'size_units' => ['px', 'em', '%'],
1179 'selectors' => [
1180 '{{WRAPPER}} .eel-button-subtext' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1181 ],
1182 ]
1183 );
1184
1185 $this->end_controls_section();
1186
1187 }
1188
1189
1190 protected function render() {
1191 $settings = $this->get_settings_for_display();
1192 $currency = $settings['price_currency'];
1193 $currency_pos = $settings['currency_placement'];
1194 $period = $settings['price_period'];
1195 $separator = $settings['period_separator'];
1196 $is_featured = $settings['is_featured'] === 'yes';
1197 $show_button = $settings['show_button'] === 'yes';
1198 $button_pos = $settings['button_position'] ?? 'after_features';
1199 $skin_style = $settings['skin_style'] ?? '';
1200
1201
1202 $render_button = function() use ( $settings ) {
1203 if ( $settings['show_button'] !== 'yes' ) {
1204 return;
1205 }
1206 $full_width_class = ( !empty($settings['button_full_width']) && $settings['button_full_width'] === 'yes' ) ? 'eel--full-btn' : '';
1207 $is_external = !empty($settings['button_link']['is_external']) && $settings['button_link']['is_external'] ? ' target="_blank"' : '';
1208 $nofollow = !empty($settings['button_link']['nofollow']) && $settings['button_link']['nofollow'] ? ' rel="nofollow"' : '';
1209 ?>
1210 <div class="eel-btn-part">
1211 <a href="<?php echo esc_url( $settings['button_link']['url'] ); ?>"
1212 <?php echo esc_attr( $is_external ); ?> <?php echo esc_attr( $nofollow ); ?>
1213 class="eel-button <?php echo esc_attr( $full_width_class ); ?>">
1214
1215 <?php if ( $settings['button_icon_position'] === 'before' && !empty($settings['button_icon']['value']) ) : ?>
1216 <span class="eel-icon eel-icon-before elementor-icon">
1217 <?php Icons_Manager::render_icon( $settings['button_icon'], [ 'aria-hidden' => 'true' ] ); ?>
1218 </span>
1219 <?php endif; ?>
1220
1221 <?php echo esc_html( $settings['button_text'] ); ?>
1222
1223 <?php if ( $settings['button_icon_position'] === 'after' && !empty($settings['button_icon']['value']) ) : ?>
1224 <span class="eel-icon eel-icon-after elementor-icon">
1225 <?php Icons_Manager::render_icon( $settings['button_icon'], [ 'aria-hidden' => 'true' ] ); ?>
1226 </span>
1227 <?php endif; ?>
1228 </a>
1229
1230 <?php if ( !empty($settings['button_subtext']) ) : ?>
1231 <div class="eel-button-subtext"><?php echo esc_html($settings['button_subtext']); ?></div>
1232 <?php endif; ?>
1233 </div>
1234 <?php
1235 };
1236
1237 ?>
1238 <div class="eel-pricing-table <?php echo $is_featured ? 'featured ' . esc_attr($settings['ribbon_style']) : ''; ?> eel--<?php echo esc_attr($skin_style); ?>">
1239 <?php if ($is_featured): ?>
1240 <div class="eel-ribbon eel-<?php echo esc_attr($settings['ribbon_alignment']); ?>">
1241 <?php echo esc_html($settings['featured_tag_text']); ?>
1242 </div>
1243 <?php endif; ?>
1244
1245 <h3 class="eel-price-title"><?php echo wp_kses_post($settings['title']); ?></h3>
1246 <div class="eel-subtitle-price"> <?php echo wp_kses_post($settings['description']); ?> </div>
1247 <div class="eel-price">
1248 <?php if ( $settings['on_sale'] === 'yes' ) : ?>
1249 <?php
1250 $regular_price = $settings['regular_price'];
1251 $sale_price = $settings['sale_price'];
1252 ?>
1253
1254 <span class="eel-old-price">
1255 <?php if ( $currency_pos === 'left' ) : ?>
1256 <span class="eel-currency"><?php echo esc_html( $currency ); ?></span><?php echo esc_html( $regular_price ); ?>
1257 <?php else : ?>
1258 <?php echo esc_html( $regular_price ); ?><span class="eel-currency"><?php echo esc_html( $currency ); ?></span>
1259 <?php endif; ?>
1260 </span>
1261
1262 <span class="eel-sale-price">
1263 <?php if ( $currency_pos === 'left' ) : ?>
1264 <span class="eel-currency"><?php echo esc_html( $currency ); ?></span><?php echo esc_html( $sale_price ); ?>
1265 <?php else : ?>
1266 <?php echo esc_html( $sale_price ); ?><span class="eel-currency"><?php echo esc_html( $currency ); ?></span>
1267 <?php endif; ?>
1268 </span>
1269
1270 <?php else : ?>
1271 <span class="eel-amount">
1272 <?php if ( $currency_pos === 'left' ) : ?>
1273 <span class="eel-currency"><?php echo esc_html( $currency ); ?></span><?php echo esc_html( $settings['price'] ); ?>
1274 <?php else : ?>
1275 <?php echo esc_html( $settings['price'] ); ?><span class="eel-currency"><?php echo esc_html( $currency ); ?></span>
1276 <?php endif; ?>
1277 </span>
1278 <?php endif; ?>
1279
1280 <span class="eel-period"><?php echo esc_html( $separator . $period ); ?></span>
1281 </div>
1282
1283
1284 <?php
1285 if ( $settings['button_position'] === 'in_features' ) {
1286 $render_button();
1287 }
1288 ?>
1289
1290 <?php if ( !empty($settings['features_des']) ) : ?>
1291 <div class="eel-features-description">
1292 <?php echo wp_kses_post($settings['features_des']); ?>
1293 </div>
1294 <?php endif; ?>
1295
1296 <ul class="eel-features">
1297 <?php foreach ( $settings['features_list'] as $feature ) : $icon_style_class = $settings['feature_icon_style']; ?>
1298 <li class="<?php echo esc_attr( $icon_style_class ); ?>">
1299 <?php
1300 $icon_style_class = 'icon-only';
1301 if ( !empty( $settings['feature_icon_style'] ) ) {
1302 $icon_style_class = $settings['feature_icon_style'];
1303 }
1304
1305 if ( !empty( $feature['icon']['value'] ) ) {
1306 Icons_Manager::render_icon( $feature['icon'], [
1307 'aria-hidden' => 'true',
1308 'class' => 'feature-icon ' . esc_attr( $icon_style_class ),
1309 ] );
1310 } else {
1311 echo '<i class="unicon-checkmark feature-icon ' . esc_attr( $icon_style_class ) . '" aria-hidden="true"></i>';
1312 }
1313 ?>
1314 <?php echo esc_html( $feature['text'] ); ?>
1315 </li>
1316 <?php endforeach; ?>
1317 </ul>
1318
1319
1320 <?php
1321 if ( $settings['button_position'] === 'after_features' ) {
1322 $render_button();
1323 }
1324 ?>
1325
1326
1327 </div>
1328 <?php
1329 }
1330 }
1331