PluginProbe
Enter Addons – Ultimate Template Builder for Elementor / trunk
Enter Addons – Ultimate Template Builder for Elementor vtrunk
trunk 2.2.10 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4
enteraddons / widgets / coupon_code / Coupon_Code.php

Coupon_Code.php in Enter Addons – Ultimate Template Builder for Elementor trunk, at widgets/coupon_code/Coupon_Code.php

840 lines 31.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Enteraddons\Widgets\Coupon_Code;
3
4 use Elementor\Widget_Base;
5 use Elementor\Controls_Manager;
6 use Elementor\Scheme_Color;
7 use Elementor\Scheme_Typography;
8 use Elementor\Group_Control_Typography;
9 use Elementor\Group_Control_Box_Shadow;
10 use Elementor\Group_Control_Background;
11 use Elementor\Group_Control_Border;
12
13 // Exit if accessed directly
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit;
16 }
17
18 /**
19 *
20 * Enteraddons elementor widget.
21 *
22 * @since 1.0
23 *
24 */
25
26 class Coupon_Code extends Widget_Base {
27
28 public function get_name() {
29 return 'enteraddons-coupon-code';
30 }
31
32 public function get_title() {
33 return esc_html__( 'Coupon Code Card', 'enteraddons' );
34 }
35
36 public function get_icon() {
37 return 'entera entera-coupon-code';
38 }
39
40 public function get_categories() {
41 return ['enteraddons-elements-category'];
42 }
43
44 protected function register_controls() {
45
46 $repeater = new \Elementor\Repeater();
47
48 // ---------------------------------------- Coupon Code Card content ------------------------------
49 $this->start_controls_section(
50 'enteraddons_coupon_code_content',
51 [
52 'label' => esc_html__( 'Coupon Code Content', 'enteraddons' ),
53 ]
54 );
55
56 $this->add_control(
57 'code_card_style',
58 [
59 'label' => esc_html__( 'Style', 'enteraddons' ),
60 'type' => \Elementor\Controls_Manager::SELECT,
61 'default' => 'style-1',
62 'options' => [
63 'style-1' => esc_html__( 'Style 1', 'enteraddons' ),
64 'style-2' => esc_html__( 'Style 2', 'enteraddons' ),
65 'style-3' => esc_html__( 'Style 3', 'enteraddons' ),
66 'style-4' => esc_html__( 'Style 4', 'enteraddons' )
67 ],
68 ]
69 );
70
71 $this->add_control(
72 'coupon_code',
73 [
74 'label' => esc_html__( 'Coupon Code', 'enteraddons' ),
75 'type' => \Elementor\Controls_Manager::TEXT,
76 'dynamic' => [
77 'active' => true,
78 ],
79 'label_block' => true,
80 'default' => esc_html__( 'EAFFRE70', 'enteraddons' )
81 ]
82 );
83 $this->add_control(
84 'btn_text',
85 [
86 'label' => esc_html__( 'Copy Button Text', 'enteraddons' ),
87 'type' => \Elementor\Controls_Manager::TEXT,
88 'dynamic' => [
89 'active' => true,
90 ],
91 'label_block' => true,
92 'default' => esc_html__( 'COPY CODE', 'enteraddons' )
93 ]
94 );
95 $this->add_control(
96 'copied_text',
97 [
98 'label' => esc_html__( 'Copied Text', 'enteraddons' ),
99 'type' => \Elementor\Controls_Manager::TEXT,
100 'dynamic' => [
101 'active' => true,
102 ],
103 'label_block' => true,
104 'default' => esc_html__( 'COPIED', 'enteraddons' )
105 ]
106 );
107 $this->add_control(
108 'icon',
109 [
110 'label' => esc_html__( 'Icon', 'enteraddons' ),
111 'type' => \Elementor\Controls_Manager::ICONS,
112 'default' => [
113 'value' => 'fas fa-cut',
114 'library' => 'solid',
115 ],
116 ]
117 );
118 $this->end_controls_section(); // End content
119
120 /**
121 * Style Tab
122 * ------------------------------ Coupon Code Card Wrapper Style ------------------------------
123 *
124 */
125 $this->start_controls_section(
126 'enteraddons_coupon_code_card_style_settings', [
127 'label' => esc_html__( 'Wrapper Style Settings', 'enteraddons' ),
128 'tab' => Controls_Manager::TAB_STYLE,
129 ]
130 );
131
132 $this->start_controls_tabs( 'tab_coupon_code_card' );
133
134 // Controls tab For Normal
135 $this->start_controls_tab(
136 'wrap_normal',
137 [
138 'label' => esc_html__( 'Normal', 'enteraddons' ),
139 ]
140 );
141
142 $this->add_responsive_control(
143 'wrap_alignment',
144 [
145 'label' => esc_html__( 'Content Alignment', 'enteraddons' ),
146 'type' => \Elementor\Controls_Manager::CHOOSE,
147 'condition' => [ 'code_card_style!' => 'style-3'],
148 'options' => [
149 'flex-start' => [
150 'title' => esc_html__( 'Left', 'enteraddons' ),
151 'icon' => 'eicon-text-align-left',
152 ],
153 'center' => [
154 'title' => esc_html__( 'Center', 'enteraddons' ),
155 'icon' => 'eicon-text-align-center',
156 ],
157 'flex-end' => [
158 'title' => esc_html__( 'Right', 'enteraddons' ),
159 'icon' => 'eicon-text-align-right',
160 ],
161 ],
162 'default' => 'center',
163 'toggle' => true,
164 'selectors' => [
165 '{{WRAPPER}} .ea-ccc-style-4 .ea-coupon--code' => 'justify-content: {{VALUE}} !important',
166 '{{WRAPPER}} .ea-coupon-code-inner' => 'justify-content: {{VALUE}} !important'
167 ],
168 ]
169 );
170
171 $this->add_responsive_control(
172 'wrap_margin',
173 [
174 'label' => esc_html__( 'Margin', 'enteraddons' ),
175 'type' => Controls_Manager::DIMENSIONS,
176 'devices' => [ 'desktop', 'tablet', 'mobile' ],
177 'size_units' => [ 'px', '%', 'em' ],
178 'selectors' => [
179 '{{WRAPPER}} .ea-coupon-code-inner' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
180 ],
181 ]
182 );
183 $this->add_responsive_control(
184 'wrap_padding',
185 [
186 'label' => esc_html__( 'Padding', 'enteraddons' ),
187 'type' => Controls_Manager::DIMENSIONS,
188 'devices' => [ 'desktop', 'tablet', 'mobile' ],
189 'size_units' => [ 'px', '%', 'em' ],
190 'selectors' => [
191 '{{WRAPPER}} .ea-coupon-code-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
192 ],
193 ]
194 );
195 $this->add_group_control(
196 \Elementor\Group_Control_Border::get_type(),
197 [
198 'name' => 'wrap_border',
199 'label' => esc_html__( 'Border', 'enteraddons' ),
200 'selector' => '{{WRAPPER}} .ea-coupon-code-inner',
201 ]
202 );
203 $this->add_responsive_control(
204 'wrap_radius',
205 [
206 'label' => esc_html__( 'Border Radius', 'enteraddons' ),
207 'type' => Controls_Manager::DIMENSIONS,
208 'devices' => [ 'desktop', 'tablet', 'mobile' ],
209 'size_units' => [ 'px', '%', 'em' ],
210 'selectors' => [
211 '{{WRAPPER}} .ea-coupon-code-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
212 ],
213 ]
214 );
215 $this->add_group_control(
216 \Elementor\Group_Control_Box_Shadow::get_type(),
217 [
218 'name' => 'wrap_shadow',
219 'label' => esc_html__( 'Box Shadow', 'enteraddons' ),
220 'selector' => '{{WRAPPER}} .ea-coupon-code-inner',
221 ]
222 );
223 $this->add_group_control(
224 \Elementor\Group_Control_Background::get_type(),
225 [
226 'name' => 'wrap_background',
227 'label' => esc_html__( 'Background', 'enteraddons' ),
228 'types' => [ 'classic', 'gradient' ],
229 'selector' => '{{WRAPPER}} .ea-coupon-code-inner',
230 ]
231 );
232
233 $this->end_controls_tab(); // End Controls tab
234
235 // Controls tab For Hover
236 $this->start_controls_tab(
237 'wrap_hover',
238 [
239 'label' => esc_html__( 'Hover', 'enteraddons' ),
240 ]
241 );
242 $this->add_group_control(
243 \Elementor\Group_Control_Border::get_type(),
244 [
245 'name' => 'item_hover_border',
246 'label' => esc_html__( 'Border', 'enteraddons' ),
247 'selector' => '{{WRAPPER}} .ea-coupon-code-inner:hover',
248 ]
249 );
250 $this->add_responsive_control(
251 'item_hover_radius',
252 [
253 'label' => esc_html__( 'Border Radius', 'enteraddons' ),
254 'type' => Controls_Manager::DIMENSIONS,
255 'devices' => [ 'desktop', 'tablet', 'mobile' ],
256 'size_units' => [ 'px', '%', 'em' ],
257 'selectors' => [
258 '{{WRAPPER}} .ea-coupon-code-inner:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
259 ],
260 ]
261 );
262 $this->add_group_control(
263 \Elementor\Group_Control_Box_Shadow::get_type(),
264 [
265 'name' => 'item_hover_shadow',
266 'label' => esc_html__( 'Box Shadow', 'enteraddons' ),
267 'selector' => '{{WRAPPER}} .ea-coupon-code-inner:hover',
268 ]
269 );
270 $this->add_group_control(
271 \Elementor\Group_Control_Background::get_type(),
272 [
273 'name' => 'item_hover_background',
274 'label' => esc_html__( 'Background', 'enteraddons' ),
275 'types' => [ 'classic', 'gradient' ],
276 'selector' => '{{WRAPPER}} .ea-coupon-code-inner:hover',
277 ]
278 );
279
280
281 $this->end_controls_tab(); // End Controls tab
282
283 $this->end_controls_tabs(); // end controls tabs section
284
285 $this->end_controls_section();
286
287 /**
288 * Style Tab
289 * ------------------------------ Settings ------------------------------
290 *
291 */
292 $this->start_controls_section(
293 'enteraddons_coupon_code_settings', [
294 'label' => esc_html__( 'Coupon Code Box', 'enteraddons' ),
295 'tab' => Controls_Manager::TAB_STYLE,
296 'condition' => ['code_card_style' => [ 'style-1', 'style-2', 'style-3' ] ]
297 ]
298 );
299
300 $this->start_controls_tabs( 'tab_coupon_code_area' );
301
302 // Controls tab For Normal
303 $this->start_controls_tab(
304 'coupon_code_area_normal',
305 [
306 'label' => esc_html__( 'Normal', 'enteraddons' ),
307 ]
308 );
309 $this->add_responsive_control(
310 'code_area_alignment',
311 [
312 'label' => esc_html__( 'Content Alignment', 'enteraddons' ),
313 'type' => \Elementor\Controls_Manager::CHOOSE,
314 'options' => [
315 'start' => [
316 'title' => esc_html__( 'Left', 'enteraddons' ),
317 'icon' => 'eicon-text-align-left',
318 ],
319 'center' => [
320 'title' => esc_html__( 'Center', 'enteraddons' ),
321 'icon' => 'eicon-text-align-center',
322 ],
323 'end' => [
324 'title' => esc_html__( 'Right', 'enteraddons' ),
325 'icon' => 'eicon-text-align-right',
326 ],
327 ],
328 'default' => 'center',
329 'toggle' => true,
330 'selectors' => [
331 '{{WRAPPER}} .ea-coupon-code-inner .ea-coupon-code' => 'justify-content: {{VALUE}} !important',
332 ],
333 ]
334 );
335 $this->add_control(
336 'code_text_color',
337 [
338 'label' => esc_html__( 'Text Color', 'enteraddons' ),
339 'type' => \Elementor\Controls_Manager::COLOR,
340 'selectors' => [
341 '{{WRAPPER}} .ea-coupon-code-inner .ea-coupon-code' => 'color: {{VALUE}}',
342 ],
343 ]
344 );
345 $this->add_group_control(
346 \Elementor\Group_Control_Typography::get_type(),
347 [
348 'name' => 'code_text_typography',
349 'label' => esc_html__( 'Typography', 'enteraddons' ),
350 'selector' => '{{WRAPPER}} .ea-coupon-code-inner .ea-coupon-code',
351 ]
352 );
353 $this->add_responsive_control(
354 'code_box_width',
355 [
356 'label' => esc_html__( 'Width', 'enteraddons' ),
357 'type' => Controls_Manager::SLIDER,
358 'size_units' => [ 'px', '%' ],
359 'range' => [
360 'px' => [
361 'min' => 0,
362 'max' => 1000,
363 'step' => 1,
364 ],
365 '%' => [
366 'min' => 0,
367 'max' => 100,
368 ],
369 ],
370 'default' => [
371 'unit' => '%',
372 'size' => '',
373 ],
374 'selectors' => [
375 '{{WRAPPER}} .ea-coupon-code-inner .ea-coupon-code' => 'width: {{SIZE}}{{UNIT}} !important;',
376 ],
377 ]
378 );
379 $this->add_responsive_control(
380 'code_box_height',
381 [
382 'label' => esc_html__( 'Height', 'enteraddons' ),
383 'type' => Controls_Manager::SLIDER,
384 'size_units' => [ 'px', '%' ],
385 'range' => [
386 'px' => [
387 'min' => 0,
388 'max' => 1000,
389 'step' => 1,
390 ],
391 '%' => [
392 'min' => 0,
393 'max' => 100,
394 ],
395 ],
396 'default' => [
397 'unit' => '%',
398 'size' => '',
399 ],
400 'selectors' => [
401 '{{WRAPPER}} .ea-coupon-code-inner .ea-coupon-code' => 'height: {{SIZE}}{{UNIT}};',
402 ],
403 ]
404 );
405 $this->add_responsive_control(
406 'code_box_margin',
407 [
408 'label' => esc_html__( 'Margin', 'enteraddons' ),
409 'type' => Controls_Manager::DIMENSIONS,
410 'devices' => [ 'desktop', 'tablet', 'mobile' ],
411 'size_units' => [ 'px', '%', 'em' ],
412 'selectors' => [
413 '{{WRAPPER}} .ea-coupon-code-inner .ea-coupon-code' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
414 ],
415 ]
416 );
417 $this->add_responsive_control(
418 'code_box_padding',
419 [
420 'label' => esc_html__( 'Padding', 'enteraddons' ),
421 'type' => Controls_Manager::DIMENSIONS,
422 'devices' => [ 'desktop', 'tablet', 'mobile' ],
423 'size_units' => [ 'px', '%', 'em' ],
424 'selectors' => [
425 '{{WRAPPER}} .ea-coupon-code-inner .ea-coupon-code' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
426 ],
427 ]
428 );
429 $this->add_group_control(
430 \Elementor\Group_Control_Border::get_type(),
431 [
432 'name' => 'code_box_border',
433 'label' => esc_html__( 'Border', 'enteraddons' ),
434 'selector' => '{{WRAPPER}} .ea-coupon-code-inner .ea-coupon-code',
435 ]
436 );
437 $this->add_responsive_control(
438 'code_box_radius',
439 [
440 'label' => esc_html__( 'Border Radius', 'enteraddons' ),
441 'type' => Controls_Manager::DIMENSIONS,
442 'devices' => [ 'desktop', 'tablet', 'mobile' ],
443 'size_units' => [ 'px', '%', 'em' ],
444 'selectors' => [
445 '{{WRAPPER}} .ea-coupon-code-inner .ea-coupon-code' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
446 ],
447 ]
448 );
449 $this->add_group_control(
450 \Elementor\Group_Control_Box_Shadow::get_type(),
451 [
452 'name' => 'code_box_shadow',
453 'label' => esc_html__( 'Box Shadow', 'enteraddons' ),
454 'selector' => '{{WRAPPER}} .ea-coupon-code-inner .ea-coupon-code',
455 ]
456 );
457 $this->add_group_control(
458 \Elementor\Group_Control_Background::get_type(),
459 [
460 'name' => 'code_box_background',
461 'label' => esc_html__( 'Background', 'enteraddons' ),
462 'types' => [ 'classic', 'gradient' ],
463 'selector' => '{{WRAPPER}} .ea-coupon-code-inner .ea-coupon-code',
464 ]
465 );
466 $this->end_controls_tab(); // End Controls tab
467
468 // Controls tab For Hover
469 $this->start_controls_tab(
470 'code_box_hover',
471 [
472 'label' => esc_html__( 'Hover', 'enteraddons' ),
473 ]
474 );
475 $this->add_control(
476 'code_box_text_hover_color',
477 [
478 'label' => esc_html__( 'Title Hover Color', 'enteraddons' ),
479 'type' => \Elementor\Controls_Manager::COLOR,
480 'selectors' => [
481 '{{WRAPPER}} .ea-coupon-code-inner .ea-coupon-code:hover' => 'color: {{VALUE}}',
482 ],
483 ]
484 );
485 $this->add_group_control(
486 \Elementor\Group_Control_Background::get_type(),
487 [
488 'name' => 'code_box_hover_background',
489 'label' => esc_html__( 'Background', 'enteraddons' ),
490 'types' => [ 'classic', 'gradient' ],
491 'selector' => '{{WRAPPER}} .ea-coupon-code-inner .ea-coupon-code:hover',
492 ]
493 );
494 $this->end_controls_tab(); // End Controls tab
495
496 $this->end_controls_tabs(); // end controls tabs section
497
498 $this->end_controls_section();
499
500 /**
501 * Style Tab
502 * ------------------------------ Settings ------------------------------
503 *
504 */
505 $this->start_controls_section(
506 'enteraddons_copy_btn_settings', [
507 'label' => esc_html__( 'Copy Button', 'enteraddons' ),
508 'tab' => Controls_Manager::TAB_STYLE,
509 'condition' => ['code_card_style' => [ 'style-1', 'style-2', 'style-3' ] ]
510 ]
511 );
512
513 $this->start_controls_tabs( 'tab_copy_btn_area' );
514
515 // Controls tab For Normal
516 $this->start_controls_tab(
517 'copy_btn_normal',
518 [
519 'label' => esc_html__( 'Normal', 'enteraddons' ),
520 ]
521 );
522 $this->add_responsive_control(
523 'copy_btn_alignment',
524 [
525 'label' => esc_html__( 'Content Alignment', 'enteraddons' ),
526 'type' => \Elementor\Controls_Manager::CHOOSE,
527 'options' => [
528 'start' => [
529 'title' => esc_html__( 'Left', 'enteraddons' ),
530 'icon' => 'eicon-text-align-left',
531 ],
532 'center' => [
533 'title' => esc_html__( 'Center', 'enteraddons' ),
534 'icon' => 'eicon-text-align-center',
535 ],
536 'end' => [
537 'title' => esc_html__( 'Right', 'enteraddons' ),
538 'icon' => 'eicon-text-align-right',
539 ],
540 ],
541 'default' => 'center',
542 'toggle' => true,
543 'selectors' => [
544 '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb' => 'justify-content: {{VALUE}} !important',
545 ],
546 ]
547 );
548 $this->add_control(
549 'copy_btn_text_color',
550 [
551 'label' => esc_html__( 'Text Color', 'enteraddons' ),
552 'type' => \Elementor\Controls_Manager::COLOR,
553 'selectors' => [
554 '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb' => 'color: {{VALUE}}',
555 ],
556 ]
557 );
558 $this->add_group_control(
559 \Elementor\Group_Control_Typography::get_type(),
560 [
561 'name' => 'copy_btn_text_typography',
562 'label' => esc_html__( 'Typography', 'enteraddons' ),
563 'selector' => '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb',
564 ]
565 );
566 $this->add_responsive_control(
567 'copy_btn_width',
568 [
569 'label' => esc_html__( 'Width', 'enteraddons' ),
570 'type' => Controls_Manager::SLIDER,
571 'size_units' => [ 'px', '%' ],
572 'range' => [
573 'px' => [
574 'min' => 0,
575 'max' => 1000,
576 'step' => 1,
577 ],
578 '%' => [
579 'min' => 0,
580 'max' => 100,
581 ],
582 ],
583 'default' => [
584 'unit' => '%',
585 'size' => '',
586 ],
587 'selectors' => [
588 '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb' => 'width: {{SIZE}}{{UNIT}} !important;',
589 ],
590 ]
591 );
592 $this->add_responsive_control(
593 'copy_btn_height',
594 [
595 'label' => esc_html__( 'Height', 'enteraddons' ),
596 'type' => Controls_Manager::SLIDER,
597 'size_units' => [ 'px', '%' ],
598 'range' => [
599 'px' => [
600 'min' => 0,
601 'max' => 1000,
602 'step' => 1,
603 ],
604 '%' => [
605 'min' => 0,
606 'max' => 100,
607 ],
608 ],
609 'default' => [
610 'unit' => '%',
611 'size' => '',
612 ],
613 'selectors' => [
614 '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb' => 'height: {{SIZE}}{{UNIT}};',
615 ],
616 ]
617 );
618 $this->add_responsive_control(
619 'copy_btn_margin',
620 [
621 'label' => esc_html__( 'Margin', 'enteraddons' ),
622 'type' => Controls_Manager::DIMENSIONS,
623 'devices' => [ 'desktop', 'tablet', 'mobile' ],
624 'size_units' => [ 'px', '%', 'em' ],
625 'selectors' => [
626 '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
627 ],
628 ]
629 );
630 $this->add_responsive_control(
631 'copy_btn_padding',
632 [
633 'label' => esc_html__( 'Padding', 'enteraddons' ),
634 'type' => Controls_Manager::DIMENSIONS,
635 'devices' => [ 'desktop', 'tablet', 'mobile' ],
636 'size_units' => [ 'px', '%', 'em' ],
637 'selectors' => [
638 '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
639 ],
640 ]
641 );
642 $this->add_group_control(
643 \Elementor\Group_Control_Border::get_type(),
644 [
645 'name' => 'copy_btn_border',
646 'label' => esc_html__( 'Border', 'enteraddons' ),
647 'selector' => '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb',
648 ]
649 );
650 $this->add_responsive_control(
651 'copy_btn_radius',
652 [
653 'label' => esc_html__( 'Border Radius', 'enteraddons' ),
654 'type' => Controls_Manager::DIMENSIONS,
655 'devices' => [ 'desktop', 'tablet', 'mobile' ],
656 'size_units' => [ 'px', '%', 'em' ],
657 'selectors' => [
658 '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
659 ],
660 ]
661 );
662 $this->add_group_control(
663 \Elementor\Group_Control_Box_Shadow::get_type(),
664 [
665 'name' => 'copy_btn_shadow',
666 'label' => esc_html__( 'Box Shadow', 'enteraddons' ),
667 'selector' => '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb',
668 ]
669 );
670 $this->add_group_control(
671 \Elementor\Group_Control_Background::get_type(),
672 [
673 'name' => 'copy_btn_background',
674 'label' => esc_html__( 'Background', 'enteraddons' ),
675 'types' => [ 'classic', 'gradient' ],
676 'selector' => '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb',
677 ]
678 );
679 $this->end_controls_tab(); // End Controls tab
680
681 // Controls tab For Hover
682 $this->start_controls_tab(
683 'copy_btn_hover',
684 [
685 'label' => esc_html__( 'Hover', 'enteraddons' ),
686 ]
687 );
688 $this->add_control(
689 'copy_btn_text_hover_color',
690 [
691 'label' => esc_html__( 'Text Hover Color', 'enteraddons' ),
692 'type' => \Elementor\Controls_Manager::COLOR,
693 'selectors' => [
694 '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb:hover' => 'color: {{VALUE}}',
695 ],
696 ]
697 );
698 $this->add_group_control(
699 \Elementor\Group_Control_Border::get_type(),
700 [
701 'name' => 'copy_btn_hover_border',
702 'label' => esc_html__( 'Border', 'enteraddons' ),
703 'selector' => '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb:hover',
704 ]
705 );
706 $this->add_group_control(
707 \Elementor\Group_Control_Background::get_type(),
708 [
709 'name' => 'copy_btn_hover_background',
710 'label' => esc_html__( 'Background', 'enteraddons' ),
711 'types' => [ 'classic', 'gradient' ],
712 'selector' => '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb:hover',
713 ]
714 );
715 $this->end_controls_tab(); // End Controls tab
716
717 $this->end_controls_tabs(); // end controls tabs section
718
719 $this->end_controls_section();
720
721
722
723 /**
724 * Style Tab
725 * ------------------------------ Icon Style Settings ------------------------------
726 *
727 */
728 $this->start_controls_section(
729 'enteraddons_coupon_code_card_icon_settings', [
730 'label' => esc_html__( 'Icon', 'enteraddons' ),
731 'tab' => Controls_Manager::TAB_STYLE,
732 ]
733 );
734 $this->start_controls_tabs( 'tab_icon_card_icon' );
735 // Controls tab For Normal
736 $this->start_controls_tab(
737 'icon_normal',
738 [
739 'label' => esc_html__( 'Normal', 'enteraddons' ),
740 ]
741 );
742 $this->add_control(
743 'icon_color',
744 [
745 'label' => esc_html__( 'Icon Color', 'enteraddons' ),
746 'type' => \Elementor\Controls_Manager::COLOR,
747 'selectors' => [
748 '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb-icon' => 'color: {{VALUE}}',
749 ],
750 ]
751 );
752 $this->add_responsive_control(
753 'icon_size',
754 [
755 'label' => esc_html__( 'Icon Size', 'enteraddons' ),
756 'type' => Controls_Manager::SLIDER,
757 'size_units' => [ 'px', '%' ],
758 'range' => [
759 'px' => [
760 'min' => 0,
761 'max' => 1000,
762 'step' => 1,
763 ],
764 '%' => [
765 'min' => 0,
766 'max' => 100,
767 ],
768 ],
769 'default' => [
770 'unit' => '%',
771 'size' => '',
772 ],
773 'selectors' => [
774 '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb-icon i' => 'font-size: {{SIZE}}{{UNIT}};',
775 '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb-icon img' => 'width: {{SIZE}}{{UNIT}};',
776 ],
777 ]
778 );
779 $this->add_responsive_control(
780 'copy_btn_icon_margin',
781 [
782 'label' => esc_html__( 'Margin', 'enteraddons' ),
783 'type' => Controls_Manager::DIMENSIONS,
784 'devices' => [ 'desktop', 'tablet', 'mobile' ],
785 'size_units' => [ 'px', '%', 'em' ],
786 'selectors' => [
787 '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
788 ],
789 ]
790 );
791 $this->end_controls_tab(); // End Controls tab
792
793 // Controls tab For Hover
794 $this->start_controls_tab(
795 'icon_hover',
796 [
797 'label' => esc_html__( 'Hover', 'enteraddons' ),
798 ]
799 );
800 $this->add_control(
801 'icon_hover_color',
802 [
803 'label' => esc_html__( 'Icon Color', 'enteraddons' ),
804 'type' => \Elementor\Controls_Manager::COLOR,
805 'selectors' => [
806 '{{WRAPPER}} .ea-ccc-style-4 .ea-coupon-code-inner:hover .ea-ccb-icon' => 'color: {{VALUE}}',
807 '{{WRAPPER}} .ea-coupon-code-inner .ea-ccb:hover .ea-ccb-icon' => 'color: {{VALUE}}',
808 ],
809 ]
810 );
811
812 $this->end_controls_tab(); // End Controls tab
813
814 $this->end_controls_tabs(); // end controls tabs section
815 $this->end_controls_section();
816
817 }
818
819 protected function render() {
820
821 // get settings
822 $settings = $this->get_settings_for_display();
823
824 // Icon card template render
825 $obj = new \Enteraddons\Widgets\Coupon_Code\Coupon_Code_Template();
826 $obj::setDisplaySettings( $settings );
827 $obj->renderTemplate();
828 }
829
830 public function get_script_depends() {
831 return [ 'enteraddons-main'];
832 }
833
834 public function get_style_depends() {
835 return [ 'enteraddons-global-style', 'fontawesome' ];
836 }
837
838
839 }
840