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

1,329 lines 41.7 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 .feature-icon svg' => 'fill: {{VALUE}};',
297 ],
298 ]);
299
300 $this->add_control('feature_icon_size', [
301 'label' => __('Icon Size (px)', 'easy-elements'),
302 'type' => \Elementor\Controls_Manager::SLIDER,
303 'size_units' => ['px'],
304 'range' => [
305 'px' => [
306 'min' => 8,
307 'max' => 64,
308 'step' => 1,
309 ],
310 ],
311 'selectors' => [
312 '{{WRAPPER}} .eel-features svg.feature-icon' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
313 '{{WRAPPER}} .eel-features i.feature-icon' => 'font-size: {{SIZE}}{{UNIT}};',
314 ],
315 ]);
316
317 $this->add_responsive_control('feature_icon_padding', [
318 'label' => __('Icon Padding', 'easy-elements'),
319 'type' => \Elementor\Controls_Manager::DIMENSIONS,
320 'size_units' => ['px', '%', 'em'],
321 'condition' => [
322 'feature_icon_style' => ['icon-border', 'icon-bg'],
323 ],
324 'selectors' => [
325 '{{WRAPPER}} .eel-features .feature-icon.icon-border' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
326 '{{WRAPPER}} .eel-features .feature-icon.icon-bg' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
327 ],
328 ]);
329
330 $this->add_responsive_control('feature_icon_border_radius', [
331 'label' => __('Icon Border Radius', 'easy-elements'),
332 'type' => Controls_Manager::DIMENSIONS,
333 'size_units' => ['px', '%'],
334 'condition' => [
335 'feature_icon_style' => ['icon-border', 'icon-bg'],
336 ],
337 'selectors' => [
338 '{{WRAPPER}} .eel-features .feature-icon.icon-border' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
339 '{{WRAPPER}} .eel-features .feature-icon.icon-bg' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
340 ],
341 ]);
342
343 $this->add_responsive_control('feature_text_alignment', [
344 'label' => __('Alignment', 'easy-elements'),
345 'type' => \Elementor\Controls_Manager::CHOOSE,
346 'options' => [
347 'left' => [
348 'title' => __('Left', 'easy-elements'),
349 'icon' => 'eicon-text-align-left',
350 ],
351 'center' => [
352 'title' => __('Center', 'easy-elements'),
353 'icon' => 'eicon-text-align-center',
354 ],
355 'right' => [
356 'title' => __('Right', 'easy-elements'),
357 'icon' => 'eicon-text-align-right',
358 ],
359 ],
360 'default' => 'left',
361 'toggle' => true,
362 'selectors' => [
363 '{{WRAPPER}} ul.eel-features' => 'text-align: {{VALUE}};',
364 ],
365 ]);
366
367 $this->end_controls_section();
368
369 $this->start_controls_section('section_ribbon', [
370 'label' => __('Featured Settings', 'easy-elements'),
371 ]);
372 $this->add_control('is_featured', [
373 'label' => __('Featured', 'easy-elements'),
374 'type' => Controls_Manager::SWITCHER,
375 'return_value' => 'yes',
376 ]);
377 $this->add_control('ribbon_style', [
378 'label' => __('Ribbon Style', 'easy-elements'),
379 'type' => Controls_Manager::SELECT,
380 'options' => [
381 'style1' => 'Style 1',
382 'style2' => 'Style 2',
383 ],
384 'default' => 'style1',
385 ]);
386 $this->add_control('featured_tag_text', [
387 'label' => __('Featured Text', 'easy-elements'),
388 'type' => Controls_Manager::TEXT,
389 'default' => 'Featured',
390 'dynamic' => [
391 'active' => true,
392 ],
393 ]);
394 $this->add_control('ribbon_alignment', [
395 'label' => __('Alignment', 'easy-elements'),
396 'type' => Controls_Manager::SELECT,
397 'options' => [ 'left' => 'Left', 'right' => 'Right' ],
398 'default' => 'right',
399 'condition' => [
400 'ribbon_style' => 'style2',
401 ],
402 ]);
403
404 $this->add_control(
405 'featured__text_color',
406 [
407 'label' => __('Text Color', 'easy-elements'),
408 'type' => \Elementor\Controls_Manager::COLOR,
409 'selectors' => [
410 '{{WRAPPER}} .featured.style2 .eel-ribbon, {{WRAPPER}} .eel-ribbon' => 'color: {{VALUE}};',
411 ],
412 ]
413 );
414
415 $this->add_group_control(
416 Group_Control_Background::get_type(),
417 [
418 'name' => 'featured__bg',
419 'label' => __('Background', 'easy-elements'),
420 'types' => ['classic', 'gradient'],
421 'selector' => '{{WRAPPER}} .featured.style2 .eel-ribbon, {{WRAPPER}} .eel-ribbon',
422 ]
423 );
424
425 $this->add_group_control(
426 \Elementor\Group_Control_Typography::get_type(),
427 [
428 'name' => 'featured__typography',
429 'label' => __('Typography', 'easy-elements'),
430 'selector' => '{{WRAPPER}} .featured.style2 .eel-ribbon, {{WRAPPER}} .eel-ribbon',
431 ]
432 );
433
434 $this->add_responsive_control(
435 'fea_box_padding',
436 [
437 'label' => __('Padding', 'easy-elements'),
438 'type' => \Elementor\Controls_Manager::DIMENSIONS,
439 'size_units' => ['px', '%', 'em'],
440 'selectors' => [
441 '{{WRAPPER}} .eel-ribbon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
442 ],
443 'condition' => [
444 'ribbon_style' => 'style1',
445 ],
446 ]
447 );
448
449 $this->add_responsive_control(
450 'fea_box_border_radius',
451 [
452 'label' => __('Border Radius', 'easy-elements'),
453 'type' => \Elementor\Controls_Manager::DIMENSIONS,
454 'size_units' => ['px', '%'],
455 'selectors' => [
456 '{{WRAPPER}} .eel-ribbon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
457 ],
458 'condition' => [
459 'ribbon_style' => 'style1',
460 ],
461 ]
462 );
463
464 $this->end_controls_section();
465
466 // Button
467 $this->start_controls_section('section_button', [
468 'label' => __('Button Settings', 'easy-elements'),
469 ]);
470 $this->add_control('show_button', [
471 'label' => __('Show Button', 'easy-elements'),
472 'type' => Controls_Manager::SWITCHER,
473 'return_value' => 'yes',
474 'default' => 'yes',
475 ]);
476 $this->add_control('button_text', [
477 'label' => __('Text', 'easy-elements'),
478 'type' => Controls_Manager::TEXT,
479 'default' => 'Choose Plan',
480 'dynamic' => [
481 'active' => true,
482 ],
483 ]);
484
485 $this->add_control('button_subtext', [
486 'label' => __('Bottom Text', 'easy-elements'),
487 'type' => Controls_Manager::TEXT,
488 'default' => 'No credit card required!',
489 'placeholder' => __('Enter subtext below button', 'easy-elements'),
490 'dynamic' => [
491 'active' => true,
492 ],
493 ]);
494
495 $this->add_control('button_link', [
496 'label' => __('Link', 'easy-elements'),
497 'type' => Controls_Manager::URL,
498 'default' => [ 'url' => '#' ],
499 'dynamic' => [
500 'active' => true,
501 ],
502 ]);
503 $this->add_control('button_icon', [
504 'label' => __('Icon', 'easy-elements'),
505 'type' => Controls_Manager::ICONS,
506 'default' => [ 'value' => '', 'library' => 'solid' ],
507 ]);
508 $this->add_control('button_icon_position', [
509 'label' => __('Icon Position', 'easy-elements'),
510 'type' => Controls_Manager::SELECT,
511 'options' => [ 'before' => 'Before', 'after' => 'After' ],
512 'default' => 'after',
513 ]);
514 $this->add_responsive_control('button_icon_spacing', [
515 'label' => __('Icon Spacing', 'easy-elements'),
516 'type' => Controls_Manager::SLIDER,
517 'range' => [
518 'px' => ['min' => 0, 'max' => 50],
519 ],
520 'default' => [],
521 'selectors' => [
522 '{{WRAPPER}} .eel-button .eel-icon-before' => 'margin-right: {{SIZE}}{{UNIT}};',
523 '{{WRAPPER}} .eel-button .eel-icon-after' => 'margin-left: {{SIZE}}{{UNIT}};',
524 ],
525 ]);
526
527 $this->add_responsive_control('button_icon_spacing_vertical', [
528 'label' => __('Icon Vertical Spacing', 'easy-elements'),
529 'type' => \Elementor\Controls_Manager::SLIDER,
530 'range' => [
531 'px' => ['min' => 0, 'max' => 60],
532 ],
533 'selectors' => [
534 '{{WRAPPER}} .eel-button .eel-icon-before, {{WRAPPER}} .eel-button .eel-icon-after' => 'top: {{SIZE}}{{UNIT}}; position:relative;',
535 ],
536 ]);
537
538 $this->add_control('button_position', [
539 'label' => __('Button Position', 'easy-elements'),
540 'type' => Controls_Manager::SELECT,
541 'options' => [
542 'after_features' => __('After Features', 'easy-elements'),
543 'in_features' => __('Before Features', 'easy-elements'),
544 ],
545 'default' => 'after_features',
546 ]);
547
548 $this->add_responsive_control('btn_alignment', [
549 'label' => __('Alignment', 'easy-elements'),
550 'type' => \Elementor\Controls_Manager::CHOOSE,
551 'options' => [
552 'left' => [
553 'title' => __('Left', 'easy-elements'),
554 'icon' => 'eicon-text-align-left',
555 ],
556 'center' => [
557 'title' => __('Center', 'easy-elements'),
558 'icon' => 'eicon-text-align-center',
559 ],
560 'right' => [
561 'title' => __('Right', 'easy-elements'),
562 'icon' => 'eicon-text-align-right',
563 ],
564 ],
565 'default' => 'left',
566 'toggle' => true,
567 'selectors' => [
568 '{{WRAPPER}} .eel-btn-part' => 'text-align: {{VALUE}};',
569 ],
570 ]);
571
572 $this->add_control('button_full_width', [
573 'label' => __('Enable Full Button Width', 'easy-elements'),
574 'type' => \Elementor\Controls_Manager::SWITCHER,
575 'label_on' => __('Yes', 'easy-elements'),
576 'label_off' => __('No', 'easy-elements'),
577 'return_value' => 'yes',
578 'default' => '',
579 ]);
580
581 $this->end_controls_section();
582
583 // Start Style Tab Section
584 $this->start_controls_section(
585 'section_style_title_price',
586 [
587 'label' => __('Title & Price Style', 'easy-elements'),
588 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
589 ]
590 );
591
592 // Title Style
593 $this->add_control(
594 'title_heading',
595 [
596 'label' => __('Title', 'easy-elements'),
597 'type' => \Elementor\Controls_Manager::HEADING,
598 'separator' => 'before',
599 ]
600 );
601 $this->add_control(
602 'title_color',
603 [
604 'label' => __('Title Color', 'easy-elements'),
605 'type' => \Elementor\Controls_Manager::COLOR,
606 'selectors' => [
607 '{{WRAPPER}} .eel-price-title' => 'color: {{VALUE}};',
608 ],
609 ]
610 );
611 $this->add_control(
612 'title_hilight_color',
613 [
614 'label' => __('Highlight Color', 'easy-elements'),
615 'type' => \Elementor\Controls_Manager::COLOR,
616 'selectors' => [
617 '{{WRAPPER}} .eel-price-title span' => 'color: {{VALUE}};',
618 ],
619 ]
620 );
621 $this->add_group_control(
622 \Elementor\Group_Control_Typography::get_type(),
623 [
624 'name' => 'title_typography',
625 'selector' => '{{WRAPPER}} .eel-price-title',
626 ]
627 );
628
629 $this->add_responsive_control(
630 'title_margin',
631 [
632 'label' => __('Margin', 'easy-elements'),
633 'type' => \Elementor\Controls_Manager::DIMENSIONS,
634 'size_units' => ['px', 'em', '%'],
635 'selectors' => [
636 '{{WRAPPER}} .eel-price-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
637 ],
638 ]
639 );
640
641 // Title Style
642 $this->add_control(
643 'description_heading',
644 [
645 'label' => __('Description', 'easy-elements'),
646 'type' => \Elementor\Controls_Manager::HEADING,
647 'separator' => 'before',
648 ]
649 );
650
651 $this->add_control(
652 'description_color',
653 [
654 'label' => __('Description Color', 'easy-elements'),
655 'type' => \Elementor\Controls_Manager::COLOR,
656 'selectors' => [
657 '{{WRAPPER}} .eel-subtitle-price' => 'color: {{VALUE}};',
658 ],
659 ]
660 );
661 $this->add_group_control(
662 \Elementor\Group_Control_Typography::get_type(),
663 [
664 'name' => 'description_typography',
665 'selector' => '{{WRAPPER}} .eel-subtitle-price',
666 ]
667 );
668
669 $this->add_responsive_control(
670 'description_margin',
671 [
672 'label' => __('Margin', 'easy-elements'),
673 'type' => \Elementor\Controls_Manager::DIMENSIONS,
674 'size_units' => ['px', 'em', '%'],
675 'selectors' => [
676 '{{WRAPPER}} .eel-subtitle-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
677 ],
678 ]
679 );
680
681 // Regular Price Style
682 $this->add_control(
683 'price_heading',
684 [
685 'label' => __('Price', 'easy-elements'),
686 'type' => \Elementor\Controls_Manager::HEADING,
687 'separator' => 'before',
688 ]
689 );
690 $this->add_control(
691 'price_color',
692 [
693 'label' => __('Price Color', 'easy-elements'),
694 'type' => \Elementor\Controls_Manager::COLOR,
695 'selectors' => [
696 '{{WRAPPER}} .eel-price .eel-amount' => 'color: {{VALUE}};',
697 ],
698 ]
699 );
700 $this->add_group_control(
701 \Elementor\Group_Control_Typography::get_type(),
702 [
703 'name' => 'price_typography',
704 'selector' => '{{WRAPPER}} .eel-price .eel-amount',
705 ]
706 );
707
708 $this->add_responsive_control(
709 'price__margin',
710 [
711 'label' => __('Margin', 'easy-elements'),
712 'type' => \Elementor\Controls_Manager::DIMENSIONS,
713 'size_units' => ['px', 'em', '%'],
714 'selectors' => [
715 '{{WRAPPER}} .eel-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
716 ],
717 ]
718 );
719
720 // Sale Price Del Style (optional)
721 $this->add_control(
722 'sale_price_heading',
723 [
724 'label' => __('Regular (Sale) Price', 'easy-elements'),
725 'type' => \Elementor\Controls_Manager::HEADING,
726 'separator' => 'before',
727 'condition' => ['on_sale' => 'yes'],
728 ]
729 );
730 $this->add_control(
731 'regular_price_color',
732 [
733 'label' => __('Regular Price Color', 'easy-elements'),
734 'type' => \Elementor\Controls_Manager::COLOR,
735 'selectors' => [
736 '{{WRAPPER}} .eel-sale-price' => 'color: {{VALUE}};',
737 ],
738 'condition' => ['on_sale' => 'yes'],
739 ]
740 );
741 $this->add_group_control(
742 \Elementor\Group_Control_Typography::get_type(),
743 [
744 'name' => 'regular_price_typography',
745 'selector' => '{{WRAPPER}} .eel-sale-price',
746 'condition' => ['on_sale' => 'yes'],
747 ]
748 );
749
750 // Period Style
751 $this->add_control(
752 'period_heading',
753 [
754 'label' => __('Period', 'easy-elements'),
755 'type' => \Elementor\Controls_Manager::HEADING,
756 'separator' => 'before',
757 ]
758 );
759 $this->add_control(
760 'period_color',
761 [
762 'label' => __('Period Color', 'easy-elements'),
763 'type' => \Elementor\Controls_Manager::COLOR,
764 'selectors' => [
765 '{{WRAPPER}} .eel-period' => 'color: {{VALUE}};',
766 ],
767 ]
768 );
769 $this->add_group_control(
770 \Elementor\Group_Control_Typography::get_type(),
771 [
772 'name' => 'period_typography',
773 'selector' => '{{WRAPPER}} .eel-period',
774 ]
775 );
776
777 $this->add_responsive_control(
778 'period_margin',
779 [
780 'label' => __('Margin', 'easy-elements'),
781 'type' => \Elementor\Controls_Manager::DIMENSIONS,
782 'size_units' => ['px', 'em', '%'],
783 'selectors' => [
784 '{{WRAPPER}} .eel-price .eel-period' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
785 ],
786 ]
787 );
788
789 $this->add_control(
790 'currency_style_heading',
791 [
792 'label' => __('Currency Symbol', 'easy-elements'),
793 'type' => \Elementor\Controls_Manager::HEADING,
794 'separator' => 'before',
795 ]
796 );
797
798 $this->add_control(
799 'currency_symbol_color',
800 [
801 'label' => __('Color', 'easy-elements'),
802 'type' => \Elementor\Controls_Manager::COLOR,
803 'selectors' => [
804 '{{WRAPPER}} .eel-currency' => 'color: {{VALUE}};',
805 ],
806 ]
807 );
808
809 $this->add_group_control(
810 \Elementor\Group_Control_Typography::get_type(),
811 [
812 'name' => 'currency_symbol_typography',
813 'selector' => '{{WRAPPER}} .eel-currency',
814 ]
815 );
816
817 $this->add_responsive_control(
818 'currency_symbol_margin',
819 [
820 'label' => __('Currency Margin', 'easy-elements'),
821 'type' => \Elementor\Controls_Manager::DIMENSIONS,
822 'size_units' => ['px', 'em', '%'],
823 'selectors' => [
824 '{{WRAPPER}} .eel-currency' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
825 ],
826 ]
827 );
828
829 $this->add_responsive_control(
830 'currency_symbol_vertical_position',
831 [
832 'label' => __('Vertical Position', 'easy-elements'),
833 'type' => \Elementor\Controls_Manager::SLIDER,
834 'size_units' => ['px', '%'],
835 'range' => [
836 'px' => [
837 'min' => -50,
838 'max' => 50,
839 ],
840 '%' => [
841 'min' => -100,
842 'max' => 100,
843 ],
844 ],
845 'selectors' => [
846 '{{WRAPPER}} .eel-currency' => 'display: inline-block; transform: translateY({{SIZE}}{{UNIT}});',
847 ],
848 ]
849 );
850
851 $this->end_controls_section();
852
853 $this->start_controls_section(
854 'section_features_descqription_style',
855 [
856 'label' => __('Features Description', 'easy-elements'),
857 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
858 'condition' => [
859 'features_des!' => '',
860 ],
861 ]
862 );
863
864 $this->add_control(
865 'features_des__text_color',
866 [
867 'label' => __('Color', 'easy-elements'),
868 'type' => \Elementor\Controls_Manager::COLOR,
869 'selectors' => [
870 '{{WRAPPER}} .eel-features-description' => 'color: {{VALUE}};',
871 ],
872 ]
873 );
874
875 // Text typography
876 $this->add_group_control(
877 \Elementor\Group_Control_Typography::get_type(),
878 [
879 'name' => 'features_des__text__typography',
880 'selector' => '{{WRAPPER}} .eel-features-description',
881 ]
882 );
883
884 $this->add_responsive_control(
885 'features_description_margin',
886 [
887 'label' => __('Margin', 'easy-elements'),
888 'type' => \Elementor\Controls_Manager::DIMENSIONS,
889 'size_units' => ['px', 'em', '%'],
890 'selectors' => [
891 '{{WRAPPER}} .eel-features-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
892 ],
893 ]
894 );
895
896 $this->end_controls_section();
897
898 $this->start_controls_section(
899 'section_features_style',
900 [
901 'label' => __('Features Style', 'easy-elements'),
902 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
903 ]
904 );
905
906 // Text color
907 $this->add_control(
908 'features_text_color',
909 [
910 'label' => __('Color', 'easy-elements'),
911 'type' => \Elementor\Controls_Manager::COLOR,
912 'selectors' => [
913 '{{WRAPPER}} .eel-features li' => 'color: {{VALUE}};',
914 ],
915 ]
916 );
917
918 // Text typography
919 $this->add_group_control(
920 \Elementor\Group_Control_Typography::get_type(),
921 [
922 'name' => 'features_text_typography',
923 'selector' => '{{WRAPPER}} .eel-features li',
924 ]
925 );
926
927 // Features list border
928 $this->add_group_control(
929 \Elementor\Group_Control_Border::get_type(),
930 [
931 'name' => 'features_border',
932 'label' => __('Border', 'easy-elements'),
933 'selector' => '{{WRAPPER}} .eel-features li',
934 ]
935 );
936
937 // Features list padding
938 $this->add_responsive_control(
939 'features_padding',
940 [
941 'label' => __('Padding', 'easy-elements'),
942 'type' => \Elementor\Controls_Manager::DIMENSIONS,
943 'size_units' => ['px', 'em', '%'],
944 'selectors' => [
945 '{{WRAPPER}} .eel-features li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
946 ],
947 ]
948 );
949
950 // Features list margin
951 $this->add_responsive_control(
952 'features_margin',
953 [
954 'label' => __('Margin', 'easy-elements'),
955 'type' => \Elementor\Controls_Manager::DIMENSIONS,
956 'size_units' => ['px', 'em', '%'],
957 'selectors' => [
958 '{{WRAPPER}} .eel-features li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
959 ],
960 ]
961 );
962
963 $this->end_controls_section();
964
965 $this->start_controls_section(
966 'section_button_style',
967 [
968 'label' => __('Button Style', 'easy-elements'),
969 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
970 ]
971 );
972
973 $this->start_controls_tabs('button_style_tabs');
974
975 // Normal Tab
976 $this->start_controls_tab(
977 'button_style_normal',
978 [
979 'label' => __('Normal', 'easy-elements'),
980 ]
981 );
982
983 // Normal Text Color
984 $this->add_control(
985 'button_text_color',
986 [
987 'label' => __('Color', 'easy-elements'),
988 'type' => \Elementor\Controls_Manager::COLOR,
989 'selectors' => [
990 '{{WRAPPER}} .eel-button' => 'color: {{VALUE}};',
991 ],
992 ]
993 );
994
995 $this->add_control(
996 'button_icon_color',
997 [
998 'label' => __('Icon Color', 'easy-elements'),
999 'type' => \Elementor\Controls_Manager::COLOR,
1000 'selectors' => [
1001 '{{WRAPPER}} .eel-button .eel-icon-before, {{WRAPPER}} .eel-button .eel-icon-after' => 'color: {{VALUE}};',
1002 '{{WRAPPER}} .eel-button .eel-icon-before svg, {{WRAPPER}} .eel-button .eel-icon-after svg' => 'fill: {{VALUE}};',
1003 ],
1004 ]
1005 );
1006
1007 // Normal Background
1008 $this->add_group_control(
1009 \Elementor\Group_Control_Background::get_type(),
1010 [
1011 'name' => 'button_background',
1012 'label' => __('Background', 'easy-elements'),
1013 'types' => ['classic', 'gradient'],
1014 'selector' => '{{WRAPPER}} .eel-button',
1015 ]
1016 );
1017
1018 $this->add_group_control(
1019 \Elementor\Group_Control_Typography::get_type(),
1020 [
1021 'name' => 'button_typography',
1022 'selector' => '{{WRAPPER}} .eel-button',
1023 ]
1024 );
1025
1026 // Normal Border
1027 $this->add_group_control(
1028 \Elementor\Group_Control_Border::get_type(),
1029 [
1030 'name' => 'button_border',
1031 'label' => __('Border', 'easy-elements'),
1032 'selector' => '{{WRAPPER}} .eel-button',
1033 ]
1034 );
1035
1036 // Normal Box Shadow
1037 $this->add_group_control(
1038 \Elementor\Group_Control_Box_Shadow::get_type(),
1039 [
1040 'name' => 'button_box_shadow',
1041 'label' => __('Box Shadow', 'easy-elements'),
1042 'selector' => '{{WRAPPER}} .eel-button',
1043 ]
1044 );
1045
1046 $this->end_controls_tab();
1047
1048 // Hover Tab
1049 $this->start_controls_tab(
1050 'button_style_hover',
1051 [
1052 'label' => __('Hover', 'easy-elements'),
1053 ]
1054 );
1055
1056 // Hover Text Color
1057 $this->add_control(
1058 'button_text_color_hover',
1059 [
1060 'label' => __('Text Color', 'easy-elements'),
1061 'type' => \Elementor\Controls_Manager::COLOR,
1062 'selectors' => [
1063 '{{WRAPPER}} .eel-button:hover' => 'color: {{VALUE}};',
1064 ],
1065 ]
1066 );
1067
1068 // Hover Background
1069 $this->add_group_control(
1070 \Elementor\Group_Control_Background::get_type(),
1071 [
1072 'name' => 'button_background_hover',
1073 'label' => __('Background', 'easy-elements'),
1074 'types' => ['classic', 'gradient'],
1075 'selector' => '{{WRAPPER}} .eel-button:hover',
1076 ]
1077 );
1078
1079 // Hover Border
1080 $this->add_group_control(
1081 \Elementor\Group_Control_Border::get_type(),
1082 [
1083 'name' => 'button_border_hover',
1084 'label' => __('Border', 'easy-elements'),
1085 'selector' => '{{WRAPPER}} .eel-button:hover',
1086 ]
1087 );
1088
1089 // Hover Box Shadow
1090 $this->add_group_control(
1091 \Elementor\Group_Control_Box_Shadow::get_type(),
1092 [
1093 'name' => 'button_box_shadow_hover',
1094 'label' => __('Box Shadow', 'easy-elements'),
1095 'selector' => '{{WRAPPER}} .eel-button:hover',
1096 ]
1097 );
1098
1099 $this->end_controls_tab();
1100
1101 $this->end_controls_tabs();
1102
1103 $this->add_responsive_control(
1104 'button_border_radius',
1105 [
1106 'label' => __('Border Radius', 'easy-elements'),
1107 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1108 'size_units' => ['px', '%', 'em'],
1109 'selectors' => [
1110 '{{WRAPPER}} .eel-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1111 ],
1112 ]
1113 );
1114
1115 $this->add_responsive_control(
1116 'button_padding',
1117 [
1118 'label' => __('Padding', 'easy-elements'),
1119 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1120 'size_units' => ['px', 'em', '%'],
1121 'selectors' => [
1122 '{{WRAPPER}} .eel-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1123 ],
1124 ]
1125 );
1126
1127 $this->add_responsive_control(
1128 'button_margin',
1129 [
1130 'label' => __('Margin', 'easy-elements'),
1131 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1132 'size_units' => ['px', 'em', '%'],
1133 'selectors' => [
1134 '{{WRAPPER}} .eel-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1135 ],
1136 ]
1137 );
1138
1139 $this->end_controls_section();
1140
1141 $this->start_controls_section(
1142 'section_button_subtext_style',
1143 [
1144 'label' => __('Button Subtext Style', 'easy-elements'),
1145 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
1146 ]
1147 );
1148
1149 // Text Color
1150 $this->add_control(
1151 'button_subtext_color',
1152 [
1153 'label' => __('Color', 'easy-elements'),
1154 'type' => \Elementor\Controls_Manager::COLOR,
1155 'selectors' => [
1156 '{{WRAPPER}} .eel-button-subtext' => 'color: {{VALUE}};',
1157 ],
1158 ]
1159 );
1160
1161 // Typography
1162 $this->add_group_control(
1163 \Elementor\Group_Control_Typography::get_type(),
1164 [
1165 'name' => 'button_subtext_typography',
1166 'label' => __('Typography', 'easy-elements'),
1167 'selector' => '{{WRAPPER}} .eel-button-subtext',
1168 ]
1169 );
1170
1171 $this->add_responsive_control(
1172 'button_margin_sub',
1173 [
1174 'label' => __('Margin', 'easy-elements'),
1175 'type' => \Elementor\Controls_Manager::DIMENSIONS,
1176 'size_units' => ['px', 'em', '%'],
1177 'selectors' => [
1178 '{{WRAPPER}} .eel-button-subtext' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1179 ],
1180 ]
1181 );
1182
1183 $this->end_controls_section();
1184
1185 }
1186
1187
1188 protected function render() {
1189 $settings = $this->get_settings_for_display();
1190 $currency = $settings['price_currency'];
1191 $currency_pos = $settings['currency_placement'];
1192 $period = $settings['price_period'];
1193 $separator = $settings['period_separator'];
1194 $is_featured = $settings['is_featured'] === 'yes';
1195 $show_button = $settings['show_button'] === 'yes';
1196 $button_pos = $settings['button_position'] ?? 'after_features';
1197 $skin_style = $settings['skin_style'] ?? '';
1198
1199
1200 $render_button = function() use ( $settings ) {
1201 if ( $settings['show_button'] !== 'yes' ) {
1202 return;
1203 }
1204 $full_width_class = ( !empty($settings['button_full_width']) && $settings['button_full_width'] === 'yes' ) ? 'eel--full-btn' : '';
1205 $is_external = !empty($settings['button_link']['is_external']) && $settings['button_link']['is_external'] ? ' target="_blank"' : '';
1206 $nofollow = !empty($settings['button_link']['nofollow']) && $settings['button_link']['nofollow'] ? ' rel="nofollow"' : '';
1207 ?>
1208 <div class="eel-btn-part">
1209 <a href="<?php echo esc_url( $settings['button_link']['url'] ); ?>"
1210 <?php echo esc_attr( $is_external ); ?> <?php echo esc_attr( $nofollow ); ?>
1211 class="eel-button <?php echo esc_attr( $full_width_class ); ?>">
1212
1213 <?php if ( $settings['button_icon_position'] === 'before' && !empty($settings['button_icon']['value']) ) : ?>
1214 <span class="eel-icon eel-icon-before elementor-icon">
1215 <?php Icons_Manager::render_icon( $settings['button_icon'], [ 'aria-hidden' => 'true' ] ); ?>
1216 </span>
1217 <?php endif; ?>
1218
1219 <?php echo esc_html( $settings['button_text'] ); ?>
1220
1221 <?php if ( $settings['button_icon_position'] === 'after' && !empty($settings['button_icon']['value']) ) : ?>
1222 <span class="eel-icon eel-icon-after elementor-icon">
1223 <?php Icons_Manager::render_icon( $settings['button_icon'], [ 'aria-hidden' => 'true' ] ); ?>
1224 </span>
1225 <?php endif; ?>
1226 </a>
1227
1228 <?php if ( !empty($settings['button_subtext']) ) : ?>
1229 <div class="eel-button-subtext"><?php echo esc_html($settings['button_subtext']); ?></div>
1230 <?php endif; ?>
1231 </div>
1232 <?php
1233 };
1234
1235 ?>
1236 <div class="eel-pricing-table <?php echo $is_featured ? 'featured ' . esc_attr($settings['ribbon_style']) : ''; ?> eel--<?php echo esc_attr($skin_style); ?>">
1237 <?php if ($is_featured): ?>
1238 <div class="eel-ribbon eel-<?php echo esc_attr($settings['ribbon_alignment']); ?>">
1239 <?php echo esc_html($settings['featured_tag_text']); ?>
1240 </div>
1241 <?php endif; ?>
1242
1243 <h3 class="eel-price-title"><?php echo wp_kses_post($settings['title']); ?></h3>
1244 <div class="eel-subtitle-price"> <?php echo wp_kses_post($settings['description']); ?> </div>
1245 <div class="eel-price">
1246 <?php if ( $settings['on_sale'] === 'yes' ) : ?>
1247 <?php
1248 $regular_price = $settings['regular_price'];
1249 $sale_price = $settings['sale_price'];
1250 ?>
1251
1252 <span class="eel-old-price">
1253 <?php if ( $currency_pos === 'left' ) : ?>
1254 <span class="eel-currency"><?php echo esc_html( $currency ); ?></span><?php echo esc_html( $regular_price ); ?>
1255 <?php else : ?>
1256 <?php echo esc_html( $regular_price ); ?><span class="eel-currency"><?php echo esc_html( $currency ); ?></span>
1257 <?php endif; ?>
1258 </span>
1259
1260 <span class="eel-sale-price">
1261 <?php if ( $currency_pos === 'left' ) : ?>
1262 <span class="eel-currency"><?php echo esc_html( $currency ); ?></span><?php echo esc_html( $sale_price ); ?>
1263 <?php else : ?>
1264 <?php echo esc_html( $sale_price ); ?><span class="eel-currency"><?php echo esc_html( $currency ); ?></span>
1265 <?php endif; ?>
1266 </span>
1267
1268 <?php else : ?>
1269 <span class="eel-amount">
1270 <?php if ( $currency_pos === 'left' ) : ?>
1271 <span class="eel-currency"><?php echo esc_html( $currency ); ?></span><?php echo esc_html( $settings['price'] ); ?>
1272 <?php else : ?>
1273 <?php echo esc_html( $settings['price'] ); ?><span class="eel-currency"><?php echo esc_html( $currency ); ?></span>
1274 <?php endif; ?>
1275 </span>
1276 <?php endif; ?>
1277
1278 <span class="eel-period"><?php echo esc_html( $separator . $period ); ?></span>
1279 </div>
1280
1281
1282 <?php
1283 if ( $settings['button_position'] === 'in_features' ) {
1284 $render_button();
1285 }
1286 ?>
1287
1288 <?php if ( !empty($settings['features_des']) ) : ?>
1289 <div class="eel-features-description">
1290 <?php echo wp_kses_post($settings['features_des']); ?>
1291 </div>
1292 <?php endif; ?>
1293
1294 <ul class="eel-features">
1295 <?php foreach ( $settings['features_list'] as $feature ) : $icon_style_class = $settings['feature_icon_style']; ?>
1296 <li class="<?php echo esc_attr( $icon_style_class ); ?>">
1297 <?php
1298 $icon_style_class = 'icon-only';
1299 if ( !empty( $settings['feature_icon_style'] ) ) {
1300 $icon_style_class = $settings['feature_icon_style'];
1301 }
1302
1303 if ( !empty( $feature['icon']['value'] ) ) {
1304 Icons_Manager::render_icon( $feature['icon'], [
1305 'aria-hidden' => 'true',
1306 'class' => 'feature-icon ' . esc_attr( $icon_style_class ),
1307 ] );
1308 } else {
1309 echo '<i class="unicon-checkmark feature-icon ' . esc_attr( $icon_style_class ) . '" aria-hidden="true"></i>';
1310 }
1311 ?>
1312 <?php echo esc_html( $feature['text'] ); ?>
1313 </li>
1314 <?php endforeach; ?>
1315 </ul>
1316
1317
1318 <?php
1319 if ( $settings['button_position'] === 'after_features' ) {
1320 $render_button();
1321 }
1322 ?>
1323
1324
1325 </div>
1326 <?php
1327 }
1328 }
1329