PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.3.7
Easy Elements for Elementor – Addons & Website Templates v1.3.7
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.3.7, at widgets/pricing-table/pricing.php

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