PluginProbe
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder / 3.0.4
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder v3.0.4
3.1.4 3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.0.7 3.0.5 3.0.4 3.0.3 3.0.2 trunk 1.5.0 1.5.1 1.5.2 1.6.1 1.6.2 1.6.3 1.6.4 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 All 93 releases
ultimate-store-kit / modules / image-hotspot / widgets / image-hotspot.php

image-hotspot.php in Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder 3.0.4, at modules/image-hotspot/widgets/image-hotspot.php

2,727 lines 118.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace UltimateStoreKit\Modules\ImageHotspot\Widgets;
4
5 use Elementor\Controls_Manager;
6 use Elementor\Group_Control_Background;
7 use Elementor\Group_Control_Border;
8 use Elementor\Group_Control_Box_Shadow;
9 use Elementor\Group_Control_Css_Filter;
10 use Elementor\Group_Control_Image_Size;
11 use Elementor\Group_Control_Text_Shadow;
12 use Elementor\Group_Control_Text_Stroke;
13 use Elementor\Group_Control_Typography;
14 use Elementor\Icons_Manager;
15 use Elementor\Repeater;
16 // use Elementor\Utils;]
17 use UltimateStoreKit\Base\Module_Base;
18 use UltimateStoreKit\Includes\Controls\GroupQuery\Group_Control_Query;
19 use UltimateStoreKit\traits\Global_Widget_Controls;
20 use UltimateStoreKit\traits\Global_Widget_Template;
21 use UltimateStoreKit\Classes\Utils;
22 use WP_Query;
23
24 if (!defined('ABSPATH')) {
25 exit;
26 }
27
28 // Exit if accessed directly
29
30 class Image_Hotspot extends Module_Base {
31 use Global_Widget_Controls;
32 use Global_Widget_Template;
33 use Group_Control_Query;
34
35 /**
36 * @var \WP_Query
37 */
38 private $_query = null;
39 public function get_name() {
40 return 'usk-image-hotspot';
41 }
42
43 public function get_title() {
44 return esc_html__('Image Hotspot', 'ultimate-store-kit');
45 }
46
47 public function get_icon() {
48 return 'usk-widget-icon usk-icon-image-hotspot usk-new';
49 }
50
51 public function get_categories() {
52 return ['ultimate-store-kit'];
53 }
54
55 public function get_keywords() {
56 return ['product', 'image hotspot', 'hotspot', 'wc', 'carousel', 'slider'];
57 }
58
59 public function get_style_depends() {
60 if ($this->usk_is_edit_mode()) {
61 return ['swiper', 'usk-all-styles'];
62 } else {
63 return ['swiper', 'usk-font', 'usk-image-hotspot', 'tippy'];
64 }
65 }
66
67 public function get_script_depends() {
68 if ($this->usk_is_edit_mode()) {
69 return ['swiper', 'micromodal', 'popper', 'tippyjs', 'usk-site'];
70 } else {
71 return ['swiper', 'micromodal', 'popper', 'tippyjs', 'usk-image-hotspot'];
72 }
73 }
74
75 public function get_custom_help_url() {
76 return 'https://youtu.be/7vrY1aY5mMw';
77 }
78
79 public function get_query() {
80 return $this->_query;
81 }
82 public function has_widget_inner_wrapper(): bool {
83 return ! \Elementor\Plugin::$instance->experiments->is_feature_active('e_optimized_markup');
84 }
85 protected function register_controls() {
86 $this->start_controls_section(
87 'section_woocommerce_layout',
88 [
89 'label' => esc_html__('Image Hotspot', 'ultimate-store-kit'),
90 ]
91 );
92
93 $this->add_control(
94 'image_hotspot_layout',
95 [
96 'label' => esc_html__('Layout', 'ultimate-store-kit') . BDTUSK_PC,
97 'type' => Controls_Manager::SELECT,
98 'default' => 'tooltip',
99 'options' => [
100 'slider' => esc_html__('Slider', 'ultimate-store-kit'),
101 'tooltip' => esc_html__('Tooltip', 'ultimate-store-kit'),
102 ],
103 'classes' => BDTUSK_IS_PC,
104 ]
105 );
106
107 $this->add_control(
108 'hotspot_image',
109 [
110 'label' => __('Image', 'ultimate-store-kit'),
111 'type' => Controls_Manager::MEDIA,
112 'dynamic' => ['active' => true],
113 'default' => [
114 'url' => \Elementor\Utils::get_placeholder_image_src(),
115 ],
116 ]
117 );
118 $this->add_group_control(
119 Group_Control_Image_Size::get_type(),
120 [
121 'name' => 'image_resolution',
122 'default' => 'full',
123 ]
124 );
125 $this->add_control(
126 'hotspot_type',
127 [
128 'label' => __('Hotspot Type', 'ultimate-store-kit'),
129 'type' => Controls_Manager::CHOOSE,
130 'default' => 'image',
131 'options' => [
132 'image' => [
133 'title' => __('Image', 'ultimate-store-kit'),
134 'icon' => 'eicon-image',
135 ],
136 'icon' => [
137 'title' => __('Icon', 'ultimate-store-kit'),
138 'icon' => 'eicon-plus',
139 ],
140 ],
141 'toggle' => false,
142 ]
143 );
144 $this->add_control(
145 'hotspot_icon',
146 [
147 'label' => __('Icon', 'ultimate-store-kit'),
148 'type' => Controls_Manager::ICONS,
149 'condition' => [
150 'hotspot_type' => 'icon',
151 ],
152 'skin' => 'inline',
153 'label_block' => false,
154 ]
155 );
156
157 $this->add_control(
158 'slider_position',
159 [
160 'label' => esc_html__('Slider Position', 'ultimate-store-kit'),
161 'type' => Controls_Manager::CHOOSE,
162 'options' => [
163 'left' => [
164 'title' => esc_html__('Left', 'ultimate-store-kit'),
165 'icon' => 'eicon-h-align-left',
166 ],
167 'right' => [
168 'title' => esc_html__('Right', 'ultimate-store-kit'),
169 'icon' => 'eicon-h-align-right',
170 ],
171 ],
172 'default' => 'right',
173 'toggle' => false,
174 'condition' => [
175 'image_hotspot_layout' => 'slider',
176 ],
177 'prefix_class' => 'usk-image-hotspot-slider-',
178 'render_type' => 'template',
179 ]
180 );
181
182 /**
183 * Swiper Effects
184 */
185 $this->add_control(
186 'swiper_effect',
187 [
188 'label' => esc_html__('Slider Effect', 'ultimate-store-kit'),
189 'type' => Controls_Manager::SELECT,
190 'default' => 'slide',
191 'options' => [
192 'slide' => esc_html__('Slide', 'ultimate-store-kit'),
193 'fade' => esc_html__('Fade', 'ultimate-store-kit'),
194 'cube' => esc_html__('Cube', 'ultimate-store-kit'),
195 'flip' => esc_html__('Flip', 'ultimate-store-kit'),
196 ],
197 'condition' => [
198 'image_hotspot_layout' => 'slider',
199 ],
200 ]
201 );
202
203 /**
204 * Product Item Text Alignment
205 */
206 $this->add_responsive_control(
207 'product_item_text_align',
208 [
209 'label' => esc_html__('Text Alignment', 'ultimate-store-kit') . BDTUSK_NC,
210 'type' => Controls_Manager::CHOOSE,
211 'options' => [
212 'left' => [
213 'title' => esc_html__('Left', 'ultimate-store-kit'),
214 'icon' => 'eicon-text-align-left',
215 ],
216 'center' => [
217 'title' => esc_html__('Center', 'ultimate-store-kit'),
218 'icon' => 'eicon-text-align-center',
219 ],
220 'right' => [
221 'title' => esc_html__('Right', 'ultimate-store-kit'),
222 'icon' => 'eicon-text-align-right',
223 ],
224 ],
225 'selectors' => [
226 '.tippy-box[data-theme^=bdt-tippy-image-hotspot-] .usk-content-inner, {{WRAPPER}} .usk-grid-carousel .usk-content-inner' => 'text-align: {{VALUE}};',
227 '.tippy-box[data-theme^=bdt-tippy-image-hotspot-] .usk-rating, {{WRAPPER}} .usk-grid-carousel .usk-rating' => 'justify-content: {{VALUE}};',
228 ],
229 ]
230 );
231
232 $this->end_controls_section();
233
234 //Query
235 $this->start_controls_section(
236 'section_post_query_builder',
237 [
238 'label' => __('Query', 'ultimate-store-kit'),
239 'tab' => Controls_Manager::TAB_CONTENT,
240 ]
241 );
242 $this->register_query_builder_controls();
243 $this->update_control(
244 'product_limit',
245 [
246 'default' => 3,
247 ]
248 );
249 $this->end_controls_section();
250
251 $this->register_global_controls_additional();
252
253 $this->start_controls_section(
254 'section_marker_image',
255 [
256 'label' => __('Hotspot Settings', 'ultimate-store-kit'),
257 ]
258 );
259
260 $repeater = new Repeater();
261
262 $repeater->add_responsive_control(
263 'marker_x_position',
264 [
265 'label' => esc_html__('X Postion', 'ultimate-store-kit'),
266 'type' => Controls_Manager::SLIDER,
267 'range' => [
268 '%' => [
269 'min' => 0,
270 'max' => 100,
271 ],
272 ],
273 'selectors' => [
274 '{{WRAPPER}} .usk-image-hotspot-thumbs {{CURRENT_ITEM}}.usk-thumbs-item' => 'left: {{SIZE}}%;',
275 ],
276 ]
277 );
278
279 $repeater->add_responsive_control(
280 'marker_y_position',
281 [
282 'label' => esc_html__('Y Postion', 'ultimate-store-kit'),
283 'type' => Controls_Manager::SLIDER,
284 'range' => [
285 '%' => [
286 'min' => 0,
287 'max' => 100,
288 ],
289 ],
290 'selectors' => [
291 '{{WRAPPER}} .usk-image-hotspot-thumbs {{CURRENT_ITEM}}.usk-thumbs-item' => 'top: {{SIZE}}%;',
292 ],
293 ]
294 );
295
296 $repeater->add_control(
297 'advanced_option_toggle',
298 [
299 'label' => __('Hotspot Style', 'ultimate-store-kit'),
300 'type' => Controls_Manager::POPOVER_TOGGLE,
301 'label_off' => __('None', 'ultimate-store-kit'),
302 'label_on' => __('Custom', 'ultimate-store-kit'),
303 'return_value' => 'yes',
304 ]
305 );
306
307 $repeater->start_popover();
308
309 $repeater->add_control(
310 'repeater_marker_color',
311 [
312 'label' => esc_html__('Color', 'ultimate-store-kit'),
313 'type' => Controls_Manager::COLOR,
314 'selectors' => [
315 '{{WRAPPER}} .usk-image-hotspot-thumbs {{CURRENT_ITEM}} .usk-thumbs-box i' => 'color: {{VALUE}};',
316 '{{WRAPPER}} .usk-image-hotspot-thumbs {{CURRENT_ITEM}} .usk-thumbs-box svg' => 'fill: {{VALUE}};',
317 ],
318 'render_type' => 'ui',
319 'condition' => [
320 'advanced_option_toggle' => 'yes',
321 ],
322 ]
323 );
324
325 $repeater->add_group_control(
326 Group_Control_Background::get_type(),
327 [
328 'name' => 'repeater_marker_background',
329 'selector' => '{{WRAPPER}} .usk-image-hotspot-thumbs {{CURRENT_ITEM}} .usk-thumbs-box',
330 'render_type' => 'ui',
331 'condition' => [
332 'advanced_option_toggle' => 'yes',
333 ],
334 ]
335 );
336
337 $repeater->end_popover();
338
339 $this->add_control(
340 'markers',
341 [
342 'label' => esc_html__('Hotspot Items', 'ultimate-store-kit'),
343 'type' => Controls_Manager::REPEATER,
344 'fields' => $repeater->get_controls(),
345 'default' => [
346 [
347 'marker_x_position' => [
348 'size' => 50,
349 'unit' => '%',
350 ],
351 'marker_y_position' => [
352 'size' => 75,
353 'unit' => '%',
354 ],
355 ],
356 [
357 'marker_x_position' => [
358 'size' => 20,
359 'unit' => '%',
360 ],
361 'marker_y_position' => [
362 'size' => 30,
363 'unit' => '%',
364 ],
365 ],
366 [
367 'marker_x_position' => [
368 'size' => 65,
369 'unit' => '%',
370 ],
371 'marker_y_position' => [
372 'size' => 20,
373 'unit' => '%',
374 ],
375 ],
376 ],
377 ]
378 );
379
380 $this->end_controls_section();
381
382 $this->start_controls_section(
383 'section_tooltip_settings',
384 [
385 'label' => __('Tooltip Settings', 'ultimate-store-kit'),
386 'condition' => [
387 'image_hotspot_layout' => 'tooltip',
388 ],
389 ]
390 );
391
392 $this->add_control(
393 'marker_tooltip_animation',
394 [
395 'label' => esc_html__('Animation', 'ultimate-store-kit'),
396 'type' => Controls_Manager::SELECT,
397 'default' => 'shift-toward',
398 'options' => [
399 'shift-away' => esc_html__('Shift-Away', 'ultimate-store-kit'),
400 'shift-toward' => esc_html__('Shift-Toward', 'ultimate-store-kit'),
401 'fade' => esc_html__('Fade', 'ultimate-store-kit'),
402 'scale' => esc_html__('Scale', 'ultimate-store-kit'),
403 'perspective' => esc_html__('Perspective', 'ultimate-store-kit'),
404 ],
405 'render_type' => 'template',
406 ]
407 );
408 $this->add_control(
409 'marker_tooltip_placement',
410 [
411 'label' => esc_html__('Placement', 'ultimate-store-kit'),
412 'type' => Controls_Manager::SELECT,
413 'default' => 'top',
414 'options' => [
415 'top-start' => esc_html__('Top Left', 'ultimate-store-kit'),
416 'top' => esc_html__('Top', 'ultimate-store-kit'),
417 'top-end' => esc_html__('Top Right', 'ultimate-store-kit'),
418 'bottom-start' => esc_html__('Bottom Left', 'ultimate-store-kit'),
419 'bottom' => esc_html__('Bottom', 'ultimate-store-kit'),
420 'bottom-end' => esc_html__('Bottom Right', 'ultimate-store-kit'),
421 'left' => esc_html__('Left', 'ultimate-store-kit'),
422 'right' => esc_html__('Right', 'ultimate-store-kit'),
423 ],
424 'render_type' => 'template',
425 ]
426 );
427
428 $this->add_control(
429 'marker_tooltip_x_offset',
430 [
431 'label' => esc_html__('Offset', 'ultimate-store-kit'),
432 'type' => Controls_Manager::SLIDER,
433 'default' => [
434 'size' => 0,
435 ],
436 ]
437 );
438
439 $this->add_control(
440 'marker_tooltip_y_offset',
441 [
442 'label' => esc_html__('Distance', 'ultimate-store-kit'),
443 'type' => Controls_Manager::SLIDER,
444 'default' => [
445 'size' => 0,
446 ],
447 ]
448 );
449
450 $this->add_control(
451 'marker_tooltip_arrow',
452 [
453 'label' => esc_html__('Arrow', 'ultimate-store-kit'),
454 'type' => Controls_Manager::SWITCHER,
455 ]
456 );
457
458 $this->add_control(
459 'marker_tooltip_trigger',
460 [
461 'label' => __('Trigger on Click', 'ultimate-store-kit'),
462 'description' => __('Don\'t set yes when you set lightbox image with marker.', 'ultimate-store-kit'),
463 'type' => Controls_Manager::SWITCHER,
464 ]
465 );
466
467 $this->end_controls_section();
468
469 /**
470 * Style
471 */
472 $this->start_controls_section(
473 'section_style_image_hotspot',
474 [
475 'label' => esc_html__('Image Hotspot', 'ultimate-store-kit'),
476 'tab' => Controls_Manager::TAB_STYLE,
477 ]
478 );
479 $this->start_controls_tabs('tabs_image_hotspot_style');
480 $this->start_controls_tab(
481 'tab_image_hotspot_normal',
482 [
483 'label' => esc_html__('Normal', 'ultimate-store-kit'),
484 ]
485 );
486 $this->add_control(
487 'hotspot_icon_color',
488 [
489 'label' => esc_html__('Icon Color', 'ultimate-store-kit'),
490 'type' => Controls_Manager::COLOR,
491 'selectors' => [
492 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box i' => 'color: {{VALUE}};',
493 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box svg' => 'fill: {{VALUE}};',
494 ],
495 'condition' => [
496 'hotspot_type' => 'icon',
497 ],
498 ]
499 );
500 $this->add_group_control(
501 Group_Control_Background::get_type(),
502 [
503 'name' => 'hotspot_background',
504 'label' => esc_html__('Background', 'ultimate-store-kit'),
505 'types' => ['classic', 'gradient'],
506 'exclude' => [
507 'image',
508 ],
509 'selector' => '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box',
510 ]
511 );
512 $this->add_group_control(
513 Group_Control_Border::get_type(),
514 [
515 'name' => 'hotspot_border',
516 'label' => esc_html__('Border', 'ultimate-store-kit'),
517 'selector' => '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box',
518 'separator' => 'before',
519 ]
520 );
521 $this->add_responsive_control(
522 'hotspot_border_radius',
523 [
524 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
525 'type' => Controls_Manager::DIMENSIONS,
526 'size_units' => ['px', '%'],
527 'selectors' => [
528 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
529 ],
530 ]
531 );
532 $this->add_responsive_control(
533 'hotspot_size',
534 [
535 'label' => esc_html__('Size', 'ultimate-store-kit'),
536 'type' => Controls_Manager::SLIDER,
537 'size_units' => ['px', '%'],
538 'selectors' => [
539 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important;',
540 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item:after' => 'width: calc(24px + {{SIZE}}{{UNIT}}); height: calc(24px + {{SIZE}}{{UNIT}});',
541 ],
542 ]
543 );
544 $this->add_responsive_control(
545 'hotspot_icon_size',
546 [
547 'label' => esc_html__('Icon Size', 'ultimate-store-kit'),
548 'type' => Controls_Manager::SLIDER,
549 'size_units' => ['px'],
550 'range' => [
551 'px' => [
552 'min' => 0,
553 'max' => 50,
554 ],
555 ],
556 'selectors' => [
557 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box' => 'font-size: {{SIZE}}px;',
558 ],
559 'condition' => [
560 'hotspot_type' => 'icon',
561 ],
562 ]
563 );
564 $this->add_control(
565 'hotspot_pulse_color',
566 [
567 'label' => esc_html__('Shadow Pulse Color', 'ultimate-store-kit'),
568 'type' => Controls_Manager::COLOR,
569 'selectors' => [
570 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item:after' => 'background-color: {{VALUE}};',
571 ],
572 'separator' => 'before',
573 ]
574 );
575 $this->add_responsive_control(
576 'hotspot_pulse_size',
577 [
578 'label' => esc_html__('Shadow Pulse Size', 'ultimate-store-kit'),
579 'type' => Controls_Manager::SLIDER,
580 'size_units' => ['px'],
581 'range' => [
582 'px' => [
583 'min' => 30,
584 'max' => 100,
585 ],
586 ],
587 'selectors' => [
588 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item:after' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important;',
589 ],
590 ]
591 );
592 $this->end_controls_tab();
593 $this->start_controls_tab(
594 'tab_image_hotspot_hover',
595 [
596 'label' => esc_html__('Hover', 'ultimate-store-kit'),
597 ]
598 );
599 $this->add_control(
600 'hotspot_icon_color_hover',
601 [
602 'label' => esc_html__('Icon Color', 'ultimate-store-kit'),
603 'type' => Controls_Manager::COLOR,
604 'selectors' => [
605 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box:hover i' => 'color: {{VALUE}};',
606 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box:hover svg' => 'fill: {{VALUE}};',
607 ],
608 'condition' => [
609 'hotspot_type' => 'icon',
610 ],
611 ]
612 );
613 $this->add_group_control(
614 Group_Control_Background::get_type(),
615 [
616 'name' => 'hotspot_background_hover',
617 'label' => esc_html__('Background', 'ultimate-store-kit'),
618 'types' => ['classic', 'gradient'],
619 'exclude' => [
620 'image',
621 ],
622 'selector' => '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box:hover',
623 ]
624 );
625 $this->add_control(
626 'hotspot_border_color_hover',
627 [
628 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
629 'type' => Controls_Manager::COLOR,
630 'selectors' => [
631 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box:hover' => 'border-color: {{VALUE}};',
632 ],
633 'condition' => [
634 'hotspot_border_border!' => '',
635 ],
636 ]
637 );
638 $this->add_control(
639 'hotspot_pulse_color_hover',
640 [
641 'label' => esc_html__('Shadow Pulse Color', 'ultimate-store-kit'),
642 'type' => Controls_Manager::COLOR,
643 'selectors' => [
644 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item:hover:after' => 'background-color: {{VALUE}};',
645 ],
646 'separator' => 'before',
647 ]
648 );
649 $this->end_controls_tab();
650 $this->start_controls_tab(
651 'tab_image_hotspot_active',
652 [
653 'label' => esc_html__('Active', 'ultimate-store-kit'),
654 'condition' => [
655 'image_hotspot_layout' => 'slider',
656 ],
657 ]
658 );
659 $this->add_control(
660 'hotspot_icon_color_active',
661 [
662 'label' => esc_html__('Icon Color', 'ultimate-store-kit'),
663 'type' => Controls_Manager::COLOR,
664 'selectors' => [
665 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item.swiper-slide-thumb-active .usk-thumbs-box i' => 'color: {{VALUE}};',
666 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item.swiper-slide-thumb-active .usk-thumbs-box svg' => 'fill: {{VALUE}};',
667 ],
668 'condition' => [
669 'hotspot_type' => 'icon',
670 'image_hotspot_layout' => 'slider',
671 ],
672 ]
673 );
674 $this->add_group_control(
675 Group_Control_Background::get_type(),
676 [
677 'name' => 'hotspot_background_active',
678 'label' => esc_html__('Background', 'ultimate-store-kit'),
679 'types' => ['classic', 'gradient'],
680 'exclude' => [
681 'image',
682 ],
683 'selector' => '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item.swiper-slide-thumb-active .usk-thumbs-box',
684 'condition' => [
685 'image_hotspot_layout' => 'slider',
686 ],
687 ]
688 );
689 $this->add_control(
690 'hotspot_border_color_active',
691 [
692 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
693 'type' => Controls_Manager::COLOR,
694 'selectors' => [
695 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item.swiper-slide-thumb-active .usk-thumbs-box' => 'border-color: {{VALUE}};',
696 ],
697 'condition' => [
698 'hotspot_border_border!' => '',
699 'image_hotspot_layout' => 'slider',
700 ],
701 ]
702 );
703 $this->add_control(
704 'hotspot_pulse_color_active',
705 [
706 'label' => esc_html__('Shadow Pulse Color', 'ultimate-store-kit'),
707 'type' => Controls_Manager::COLOR,
708 'selectors' => [
709 '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item.swiper-slide-thumb-active:after' => 'background-color: {{VALUE}};',
710 ],
711 'separator' => 'before',
712 'condition' => [
713 'image_hotspot_layout' => 'slider',
714 ],
715 ]
716 );
717 $this->end_controls_tab();
718 $this->end_controls_tabs();
719 $this->end_controls_section();
720
721 /**
722 * Layout Slider Style Start
723 */
724 $this->start_controls_section(
725 'section_style_item',
726 [
727 'label' => esc_html__('Product Items', 'ultimate-store-kit'),
728 'tab' => Controls_Manager::TAB_STYLE,
729 ]
730 );
731
732 $this->add_responsive_control(
733 'hotspot_gap',
734 [
735 'label' => esc_html__('Gap', 'ultimate-store-kit'),
736 'type' => Controls_Manager::SLIDER,
737 'selectors' => [
738 '{{WRAPPER}} .usk-image-hotspot' => 'gap: {{SIZE}}{{UNIT}};',
739 '(desktop){{WRAPPER}}.usk-image-hotspot-slider-left .usk-image-hotspot-main' => 'margin-left: {{SIZE}}{{UNIT}};',
740 '(desktop){{WRAPPER}}.usk-image-hotspot-slider-right .usk-image-hotspot-main' => 'margin-right: {{SIZE}}{{UNIT}};',
741 '(mobile){{WRAPPER}}.usk-image-hotspot-slider-left .usk-image-hotspot-main' => 'margin-left: auto;',
742 '(mobile){{WRAPPER}}.usk-image-hotspot-slider-right .usk-image-hotspot-main' => 'margin-right: auto;',
743 ],
744 'condition' => [
745 'image_hotspot_layout' => 'slider',
746 ],
747 ]
748 );
749 $this->start_controls_tabs('item_tabs');
750 $this->start_controls_tab(
751 'item_tab_normal',
752 [
753 'label' => esc_html__('Normal', 'ultimate-store-kit'),
754 ]
755 );
756 $this->add_group_control(
757 Group_Control_Background::get_type(),
758 [
759 'name' => 'item_background',
760 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-item, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .tippy-content .usk-item',
761 ]
762 );
763
764 $this->add_group_control(
765 Group_Control_Border::get_type(),
766 [
767 'name' => 'item_border',
768 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-item, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .tippy-content .usk-item',
769 'separator' => 'before',
770 ]
771 );
772
773 $this->add_responsive_control(
774 'item_border_radius',
775 [
776 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
777 'type' => Controls_Manager::DIMENSIONS,
778 'size_units' => ['px', '%', 'em'],
779 'selectors' => [
780 '{{WRAPPER}} .' . $this->get_name() . ' .usk-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
781 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .tippy-content .usk-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
782 ],
783 ]
784 );
785
786 $this->add_responsive_control(
787 'item_padding',
788 [
789 'label' => esc_html__('Padding', 'ultimate-store-kit'),
790 'type' => Controls_Manager::DIMENSIONS,
791 'size_units' => ['px', '%', 'em'],
792 'selectors' => [
793 '{{WRAPPER}} .' . $this->get_name() . ' .usk-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
794 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .tippy-content .usk-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
795 ],
796 ]
797 );
798
799 $this->add_responsive_control(
800 'item_width',
801 [
802 'label' => esc_html__('Width', 'ultimate-store-kit'),
803 'type' => Controls_Manager::SLIDER,
804 'size_units' => ['px', '%'],
805 'range' => [
806 '%' => [
807 'min' => 10,
808 'max' => 100,
809 ],
810 'px' => [
811 'min' => 100,
812 'max' => 500,
813 ],
814 ],
815 'selectors' => [
816 '{{WRAPPER}} .' . $this->get_name() . ' .usk-image-hotspot-main' => 'width: {{SIZE}}{{UNIT}}; min-width: {{SIZE}}{{UNIT}};',
817 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"]' => 'max-width: {{SIZE}}{{UNIT}} !important;',
818 ],
819 ]
820 );
821
822 $this->end_controls_tab();
823
824 $this->start_controls_tab(
825 'item_tab_hover',
826 [
827 'label' => esc_html__('Hover', 'ultimate-store-kit'),
828 ]
829 );
830
831 $this->add_group_control(
832 Group_Control_Background::get_type(),
833 [
834 'name' => 'item_hover_background',
835 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .tippy-content .usk-item:hover',
836 ]
837 );
838
839 $this->add_control(
840 'item_hover_border_color',
841 [
842 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
843 'type' => Controls_Manager::COLOR,
844 'selectors' => [
845 '{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover' => 'border-color: {{VALUE}}',
846 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .tippy-content .usk-item:hover' => 'border-color: {{VALUE}}',
847 ],
848 'condition' => [
849 'item_border_border!' => '',
850 ],
851 ]
852 );
853
854 $this->end_controls_tab();
855 $this->end_controls_tabs();
856 $this->end_controls_section();
857
858 $this->start_controls_section(
859 'section_style_image',
860 [
861 'label' => esc_html__('Image', 'ultimate-store-kit'),
862 'tab' => Controls_Manager::TAB_STYLE,
863 ]
864 );
865 $this->start_controls_tabs(
866 'style_tabs_image'
867 );
868 $this->start_controls_tab(
869 'image_normal',
870 [
871 'label' => esc_html__('Normal', 'ultimate-store-kit'),
872 ]
873 );
874 $this->add_group_control(
875 Group_Control_Background::get_type(),
876 [
877 'name' => 'image_background',
878 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-image, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-image',
879 ]
880 );
881 $this->add_group_control(
882 Group_Control_Border::get_type(),
883 [
884 'name' => 'image_border',
885 'label' => esc_html__('Image Border', 'ultimate-store-kit'),
886 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-image, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-image',
887 'separator' => 'before',
888 ]
889 );
890
891 $this->add_responsive_control(
892 'image_border_radius',
893 [
894 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
895 'type' => Controls_Manager::DIMENSIONS,
896 'size_units' => ['px', '%'],
897 'selectors' => [
898 '{{WRAPPER}} .' . $this->get_name() . ' .usk-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
899 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
900 ],
901 ]
902 );
903
904 $this->add_responsive_control(
905 'image_padding',
906 [
907 'label' => esc_html__('Padding', 'ultimate-store-kit'),
908 'type' => Controls_Manager::DIMENSIONS,
909 'size_units' => ['px', '%'],
910 'selectors' => [
911 '{{WRAPPER}} .' . $this->get_name() . ' .usk-image' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
912 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-image' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
913 ],
914 ]
915 );
916
917 $this->end_controls_tab();
918 $this->start_controls_tab(
919 'image_hover',
920 [
921 'label' => esc_html__('Hover', 'ultimate-store-kit'),
922 ]
923 );
924 $this->add_group_control(
925 Group_Control_Background::get_type(),
926 [
927 'name' => 'image_hover_background',
928 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover .usk-image, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-item:hover .usk-image',
929 ]
930 );
931 $this->add_group_control(
932 Group_Control_Border::get_type(),
933 [
934 'name' => 'image_hover_border',
935 'label' => esc_html__('Image Border', 'ultimate-store-kit'),
936 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover .usk-image, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-item:hover .usk-image',
937 'separator' => 'before',
938 ]
939 );
940 $this->add_responsive_control(
941 'image_hover_border_radius',
942 [
943 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
944 'type' => Controls_Manager::DIMENSIONS,
945 'size_units' => ['px', '%'],
946 'selectors' => [
947 '{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover .usk-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
948 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-item:hover .usk-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
949 ],
950 ]
951 );
952 $this->end_controls_tab();
953 $this->end_controls_tabs();
954 $this->end_controls_section();
955
956 $this->start_controls_section(
957 'section_style_content',
958 [
959 'label' => esc_html__('Content', 'ultimate-store-kit'),
960 'tab' => Controls_Manager::TAB_STYLE,
961 ]
962 );
963 $this->start_controls_tabs('tabs_content_style');
964 $this->start_controls_tab(
965 'tab_content_normal',
966 [
967 'label' => esc_html__('Normal', 'ultimate-store-kit'),
968 ]
969 );
970 $this->add_group_control(
971 Group_Control_Background::get_type(),
972 [
973 'name' => 'content_background',
974 'label' => esc_html__('Background', 'ultimate-store-kit'),
975 'types' => ['classic', 'gradient'],
976 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-content, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-content',
977 ]
978 );
979
980 $this->add_group_control(
981 Group_Control_Border::get_type(),
982 [
983 'name' => 'content_border',
984 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
985 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-content, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-content',
986 'separator' => 'before',
987 ]
988 );
989
990 $this->add_responsive_control(
991 'content_radius',
992 [
993 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
994 'type' => Controls_Manager::DIMENSIONS,
995 'size_units' => ['px', '%'],
996 'selectors' => [
997 '{{WRAPPER}} .' . $this->get_name() . ' .usk-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
998 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
999 ],
1000 ]
1001 );
1002
1003 $this->add_responsive_control(
1004 'content_padding',
1005 [
1006 'label' => esc_html__('Padding', 'ultimate-store-kit'),
1007 'type' => Controls_Manager::DIMENSIONS,
1008 'size_units' => ['px', 'em', '%'],
1009 'selectors' => [
1010 '{{WRAPPER}} .' . $this->get_name() . ' .usk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1011 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1012 ],
1013 ]
1014 );
1015 $this->end_controls_tab();
1016 $this->start_controls_tab(
1017 'tab_content_hover',
1018 [
1019 'label' => esc_html__('Hover', 'ultimate-store-kit'),
1020 ]
1021 );
1022 $this->add_group_control(
1023 Group_Control_Background::get_type(),
1024 [
1025 'name' => 'content_hover_background',
1026 'label' => esc_html__('Background', 'ultimate-store-kit'),
1027 'types' => ['classic', 'gradient'],
1028 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover .usk-content, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item:hover .usk-content',
1029 ]
1030 );
1031 $this->add_control(
1032 'content_hover_border_color',
1033 [
1034 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1035 'type' => Controls_Manager::COLOR,
1036 'condition' => [
1037 'content_border_border!' => '',
1038 ],
1039 'selectors' => [
1040 '{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover .usk-content' => 'border-color: {{VALUE}};',
1041 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item:hover .usk-content' => 'border-color: {{VALUE}};',
1042 ],
1043 ]
1044 );
1045 $this->end_controls_tab();
1046 $this->end_controls_tabs();
1047 $this->end_controls_section();
1048
1049 $this->start_controls_section(
1050 'section_style_title',
1051 [
1052 'label' => esc_html__('Title', 'ultimate-store-kit'),
1053 'tab' => Controls_Manager::TAB_STYLE,
1054 ]
1055 );
1056
1057 $this->add_control(
1058 'title_color',
1059 [
1060 'label' => esc_html__('Color', 'ultimate-store-kit'),
1061 'type' => Controls_Manager::COLOR,
1062 'selectors' => [
1063 '{{WRAPPER}} .' . $this->get_name() . ' .usk-title' => 'color: {{VALUE}}',
1064 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-title' => 'color: {{VALUE}}',
1065 ],
1066 ]
1067 );
1068
1069 $this->add_control(
1070 'hover_title_color',
1071 [
1072 'label' => esc_html__('Hover Color', 'ultimate-store-kit'),
1073 'type' => Controls_Manager::COLOR,
1074 'selectors' => [
1075 '{{WRAPPER}} .' . $this->get_name() . ' .usk-title:hover' => 'color: {{VALUE}};',
1076 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-title:hover' => 'color: {{VALUE}};',
1077 ],
1078 ]
1079 );
1080
1081 $this->add_responsive_control(
1082 'title_margin',
1083 [
1084 'label' => esc_html__('Margin', 'ultimate-store-kit'),
1085 'type' => Controls_Manager::DIMENSIONS,
1086 'size_units' => ['px', '%'],
1087 'selectors' => [
1088 '{{WRAPPER}} .' . $this->get_name() . ' .usk-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1089 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1090 ],
1091 ]
1092 );
1093
1094 $this->add_group_control(
1095 Group_Control_Typography::get_type(),
1096 [
1097 'name' => 'title_typography',
1098 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1099 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-title .title, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-title .title',
1100 ]
1101 );
1102
1103 $this->end_controls_section();
1104
1105 $this->start_controls_section(
1106 'section_style_category',
1107 [
1108 'label' => esc_html__('Category', 'ultimate-store-kit'),
1109 'tab' => Controls_Manager::TAB_STYLE,
1110 'condition' => [
1111 'show_category' => 'yes',
1112 ],
1113 ]
1114 );
1115 $this->start_controls_tabs(
1116 'category_tabs'
1117 );
1118 $this->start_controls_tab(
1119 'category_tab_normal',
1120 [
1121 'label' => esc_html__('Normal', 'ultimate-store-kit'),
1122 ]
1123 );
1124 $this->add_control(
1125 'category_color',
1126 [
1127 'label' => esc_html__('Color', 'ultimate-store-kit'),
1128 'type' => Controls_Manager::COLOR,
1129 'selectors' => [
1130 '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a' => 'color: {{VALUE}};',
1131 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a' => 'color: {{VALUE}};',
1132 ],
1133 ]
1134 );
1135 $this->add_group_control(
1136 Group_Control_Background::get_type(),
1137 [
1138 'name' => 'category_bg_color',
1139 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a',
1140 ]
1141 );
1142 $this->add_group_control(
1143 Group_Control_Border::get_type(),
1144 [
1145 'name' => 'category_border',
1146 'label' => esc_html__('Border', 'ultimate-store-kit'),
1147 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a',
1148 'separator' => 'before'
1149 ]
1150 );
1151 $this->add_responsive_control(
1152 'category_radius',
1153 [
1154 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
1155 'type' => Controls_Manager::DIMENSIONS,
1156 'size_units' => ['px', '%', 'em'],
1157 'selectors' => [
1158 '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1159 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1160 ],
1161 ]
1162 );
1163 $this->add_responsive_control(
1164 'category_padding',
1165 [
1166 'label' => esc_html__('Padding', 'ultimate-store-kit'),
1167 'type' => Controls_Manager::DIMENSIONS,
1168 'size_units' => ['px', '%'],
1169 'selectors' => [
1170 '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1171 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1172 ],
1173 ]
1174 );
1175 $this->add_responsive_control(
1176 'category_margin',
1177 [
1178 'label' => esc_html__('Margin', 'ultimate-store-kit'),
1179 'type' => Controls_Manager::DIMENSIONS,
1180 'size_units' => ['px', '%'],
1181 'selectors' => [
1182 '{{WRAPPER}} .' . $this->get_name() . ' .usk-category' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1183 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1184 ],
1185 ]
1186 );
1187
1188 $this->add_responsive_control(
1189 'category_space_between',
1190 [
1191 'label' => esc_html__('Space Between', 'ultimate-store-kit'),
1192 'type' => Controls_Manager::SLIDER,
1193 'size_units' => ['px', 'em', '%'],
1194 'selectors' => [
1195 '{{WRAPPER}} .' . $this->get_name() . ' .usk-category' => 'gap: {{SIZE}}{{UNIT}};',
1196 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category' => 'gap: {{SIZE}}{{UNIT}};',
1197 ],
1198 ]
1199 );
1200 $this->add_group_control(
1201 Group_Control_Typography::get_type(),
1202 [
1203 'name' => 'category_typography',
1204 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1205 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a',
1206 ]
1207 );
1208 $this->add_group_control(
1209 Group_Control_Box_Shadow::get_type(),
1210 [
1211 'name' => 'category_shadow',
1212 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a',
1213 ]
1214 );
1215 $this->end_controls_tab();
1216 $this->start_controls_tab(
1217 'category_tab_hover',
1218 [
1219 'label' => esc_html__('Hover', 'ultimate-store-kit'),
1220 ]
1221 );
1222 $this->add_control(
1223 'hover_category_color',
1224 [
1225 'label' => esc_html__('Color', 'ultimate-store-kit'),
1226 'type' => Controls_Manager::COLOR,
1227 'selectors' => [
1228 '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a:hover' => 'color: {{VALUE}};',
1229 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a:hover' => 'color: {{VALUE}};',
1230 ],
1231 ]
1232 );
1233 $this->add_group_control(
1234 Group_Control_Background::get_type(),
1235 [
1236 'name' => 'hover_category_bg_color',
1237 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a:hover, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a:hover',
1238 ]
1239 );
1240 $this->add_control(
1241 'hover_category_border_color',
1242 [
1243 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1244 'type' => Controls_Manager::COLOR,
1245 'selectors' => [
1246 '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a:hover' => 'border-color: {{VALUE}};',
1247 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a:hover' => 'border-color: {{VALUE}};',
1248 ],
1249 'condition' => [
1250 'category_border_border!' => ''
1251 ],
1252 'separator' => 'before'
1253 ]
1254 );
1255 $this->end_controls_tab();
1256 $this->end_controls_tabs();
1257 $this->end_controls_section();
1258
1259 $this->start_controls_section(
1260 'section_style_price',
1261 [
1262 'label' => esc_html__('Price', 'ultimate-store-kit'),
1263 'tab' => Controls_Manager::TAB_STYLE,
1264 'condition' => [
1265 'show_price' => 'yes',
1266 ],
1267 ]
1268 );
1269 $this->add_control(
1270 'regular_price_color',
1271 [
1272 'label' => esc_html__('Regular Color', 'ultimate-store-kit'),
1273 'type' => Controls_Manager::COLOR,
1274 'selectors' => [
1275 '{{WRAPPER}} .' . $this->get_name() . ' .usk-price del .woocommerce-Price-amount.amount' => 'color: {{VALUE}};',
1276 '{{WRAPPER}} .' . $this->get_name() . ' .usk-price del' => 'color: {{VALUE}};',
1277 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price del .woocommerce-Price-amount.amount' => 'color: {{VALUE}};',
1278 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price del' => 'color: {{VALUE}};',
1279 ],
1280
1281 ]
1282 );
1283 $this->add_control(
1284 'sale_price_color',
1285 [
1286 'label' => esc_html__('Sale Color', 'ultimate-store-kit'),
1287 'type' => Controls_Manager::COLOR,
1288 'selectors' => [
1289 '{{WRAPPER}} .' . $this->get_name() . ' .usk-price' => 'color: {{VALUE}}',
1290 '{{WRAPPER}} .' . $this->get_name() . ' .usk-price ins span' => 'color: {{VALUE}}',
1291 '{{WRAPPER}} .' . $this->get_name() . ' .usk-price .woocommerce-Price-amount.amount' => 'color: {{VALUE}}',
1292 '{{WRAPPER}} .' . $this->get_name() . ' .usk-price > .woocommerce-Price-amount.amount bdi' => 'color: {{VALUE}}',
1293 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price' => 'color: {{VALUE}}',
1294 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price ins span' => 'color: {{VALUE}}',
1295 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price .woocommerce-Price-amount.amount' => 'color: {{VALUE}}',
1296 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price > .woocommerce-Price-amount.amount bdi' => 'color: {{VALUE}}',
1297 ],
1298 ]
1299 );
1300
1301 $this->add_responsive_control(
1302 'price_margin',
1303 [
1304 'label' => esc_html__('Margin', 'ultimate-store-kit'),
1305 'type' => Controls_Manager::DIMENSIONS,
1306 'size_units' => ['px', '%'],
1307 'selectors' => [
1308 '{{WRAPPER}} .' . $this->get_name() . ' .usk-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1309 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1310 ],
1311 ]
1312 );
1313
1314 $this->add_group_control(
1315 Group_Control_Typography::get_type(),
1316 [
1317 'name' => 'sale_price_typography',
1318 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1319 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-price, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price',
1320 ]
1321 );
1322
1323 $this->end_controls_section();
1324
1325 $this->start_controls_section(
1326 'section_style_rating',
1327 [
1328 'label' => esc_html__('Rating', 'ultimate-store-kit'),
1329 'tab' => Controls_Manager::TAB_STYLE,
1330 'condition' => [
1331 'show_rating' => 'yes',
1332 ],
1333 ]
1334 );
1335 $this->add_control(
1336 'rating_color',
1337 [
1338 'label' => esc_html__('Color', 'ultimate-store-kit'),
1339 'type' => Controls_Manager::COLOR,
1340 'default' => '#e7e7e7',
1341 'selectors' => [
1342 '{{WRAPPER}} .' . $this->get_name() . ' .usk-rating .star-rating::before' => 'color: {{VALUE}};',
1343 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-rating .star-rating::before' => 'color: {{VALUE}};',
1344 ],
1345 ]
1346 );
1347
1348 $this->add_control(
1349 'active_rating_color',
1350 [
1351 'label' => esc_html__('Active Color', 'ultimate-store-kit'),
1352 'type' => Controls_Manager::COLOR,
1353 'default' => '#FFCC00',
1354 'selectors' => [
1355 '{{WRAPPER}} .' . $this->get_name() . ' .usk-rating .star-rating span::before' => 'color: {{VALUE}};',
1356 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-rating .star-rating span::before' => 'color: {{VALUE}};',
1357 ],
1358 ]
1359 );
1360
1361 $this->end_controls_section();
1362
1363 $this->start_controls_section(
1364 'badge',
1365 [
1366 'label' => esc_html__('Badge', 'ultimate-store-kit'),
1367 'tab' => Controls_Manager::TAB_STYLE,
1368 'conditions' => [
1369 'relation' => 'or',
1370 'terms' => [
1371 [
1372 'name' => 'show_sale_badge',
1373 'value' => 'yes'
1374 ],
1375 [
1376 'name' => 'show_discount_badge',
1377 'value' => 'yes'
1378 ],
1379 [
1380 'name' => 'show_stock_status',
1381 'value' => 'yes'
1382 ],
1383 [
1384 'name' => 'show_trending_badge',
1385 'value' => 'yes'
1386 ],
1387 [
1388 'name' => 'show_new_badge',
1389 'value' => 'yes'
1390 ]
1391 ]
1392 ]
1393 ]
1394 );
1395 $this->add_group_control(
1396 Group_Control_Border::get_type(),
1397 [
1398 'name' => 'badge_border',
1399 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-badge-label-content > div .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-badge-label-content > div .usk-badge',
1400 ]
1401 );
1402 $this->add_responsive_control(
1403 'badge_radius',
1404 [
1405 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
1406 'type' => Controls_Manager::DIMENSIONS,
1407 'size_units' => ['px', '%', 'em'],
1408 'selectors' => [
1409 '{{WRAPPER}} .' . $this->get_name() . ' .usk-badge-label-content > div .usk-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1410 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-badge-label-content > div .usk-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1411 ],
1412 ]
1413 );
1414 $this->add_responsive_control(
1415 'badge_padding',
1416 [
1417 'label' => esc_html__('Padding', 'ultimate-store-kit'),
1418 'type' => Controls_Manager::DIMENSIONS,
1419 'size_units' => ['px', '%', 'em'],
1420 'selectors' => [
1421 '{{WRAPPER}} .' . $this->get_name() . ' .usk-badge-label-content > div .usk-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1422 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-badge-label-content > div .usk-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1423 ],
1424 ]
1425 );
1426 $this->add_responsive_control(
1427 'badge_margin',
1428 [
1429 'label' => esc_html__('Margin', 'ultimate-store-kit'),
1430 'type' => Controls_Manager::DIMENSIONS,
1431 'size_units' => ['px', '%', 'em'],
1432 'selectors' => [
1433 '{{WRAPPER}} .' . $this->get_name() . ' .usk-badge-label-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1434 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-badge-label-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1435 ],
1436 ]
1437 );
1438
1439 $this->add_responsive_control(
1440 'badge_spacing',
1441 [
1442 'label' => esc_html__('Space Between', 'ultimate-store-kit'),
1443 'type' => Controls_Manager::SLIDER,
1444 'default' => [
1445 'unit' => 'px',
1446 'size' => 10,
1447 ],
1448 'selectors' => [
1449 '{{WRAPPER}} .' . $this->get_name() . ' .usk-badge-label-content' => 'gap: {{SIZE}}{{UNIT}};',
1450 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-badge-label-content' => 'gap: {{SIZE}}{{UNIT}};',
1451 ],
1452 ]
1453 );
1454 $this->add_group_control(
1455 Group_Control_Typography::get_type(),
1456 [
1457 'name' => 'badge_typography',
1458 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1459 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-badge-label-content > div .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-badge-label-content > div .usk-badge',
1460 ]
1461 );
1462 $this->start_controls_tabs(
1463 'label_badge_tabs'
1464 );
1465 $this->start_controls_tab(
1466 'sale_badge_tab',
1467 [
1468 'label' => esc_html__('Sale', 'ultimate-store-kit'),
1469 'condition' => [
1470 'show_sale_badge' => 'yes',
1471 ]
1472 ]
1473 );
1474 $this->add_control(
1475 'sale_badge_color',
1476 [
1477 'label' => esc_html__('Color', 'ultimate-store-kit'),
1478 'type' => Controls_Manager::COLOR,
1479 'selectors' => [
1480 '{{WRAPPER}} .' . $this->get_name() . ' .usk-sale-badge .usk-badge' => 'color: {{VALUE}}',
1481 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-sale-badge .usk-badge' => 'color: {{VALUE}}',
1482 ],
1483 'condition' => [
1484 'show_sale_badge' => 'yes',
1485 ]
1486 ]
1487 );
1488
1489 $this->add_group_control(
1490 Group_Control_Background::get_type(),
1491 [
1492 'name' => 'sale_badge_bg',
1493 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-sale-badge .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-sale-badge .usk-badge',
1494 'condition' => [
1495 'show_sale_badge' => 'yes',
1496 ]
1497 ]
1498 );
1499
1500 $this->add_control(
1501 'sale_badge_border_color',
1502 [
1503 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1504 'type' => Controls_Manager::COLOR,
1505 'selectors' => [
1506 '{{WRAPPER}} .' . $this->get_name() . ' .usk-sale-badge .usk-badge' => 'border-color: {{VALUE}} !important;',
1507 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-sale-badge .usk-badge' => 'border-color: {{VALUE}} !important;',
1508 ],
1509 'condition' => [
1510 'show_sale_badge' => 'yes',
1511 'badge_border_border!' => '',
1512 ]
1513 ]
1514 );
1515 $this->end_controls_tab();
1516 $this->start_controls_tab(
1517 'discount_badge_tab',
1518 [
1519 'label' => esc_html__('Discount', 'ultimate-store-kit'),
1520 'condition' => [
1521 'show_discount_badge' => 'yes',
1522 ],
1523 ]
1524 );
1525 $this->add_control(
1526 'discount_badge_color',
1527 [
1528 'label' => esc_html__('Color', 'ultimate-store-kit'),
1529 'type' => Controls_Manager::COLOR,
1530 'selectors' => [
1531 '{{WRAPPER}} .' . $this->get_name() . ' .usk-percantage-badge .usk-badge' => 'color: {{VALUE}}',
1532 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-percantage-badge .usk-badge' => 'color: {{VALUE}}',
1533 ],
1534 'condition' => [
1535 'show_discount_badge' => 'yes',
1536 ],
1537 ]
1538 );
1539
1540 $this->add_group_control(
1541 Group_Control_Background::get_type(),
1542 [
1543 'name' => 'discount_badge_bg',
1544 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-percantage-badge .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-percantage-badge .usk-badge',
1545 'condition' => [
1546 'show_discount_badge' => 'yes',
1547 ],
1548 ]
1549 );
1550
1551 $this->add_control(
1552 'discount_badge_border_color',
1553 [
1554 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1555 'type' => Controls_Manager::COLOR,
1556 'selectors' => [
1557 '{{WRAPPER}} .' . $this->get_name() . ' .usk-percantage-badge .usk-badge' => 'border-color: {{VALUE}} !important;',
1558 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-percantage-badge .usk-badge' => 'border-color: {{VALUE}} !important;',
1559 ],
1560 'condition' => [
1561 'show_discount_badge' => 'yes',
1562 'badge_border_border!' => '',
1563 ],
1564 ]
1565 );
1566 $this->end_controls_tab();
1567 $this->start_controls_tab(
1568 'stock_badge_tab',
1569 [
1570 'label' => esc_html__('Stock', 'ultimate-store-kit'),
1571 'condition' => [
1572 'show_stock_status' => 'yes',
1573 ],
1574 ]
1575 );
1576 $this->add_control(
1577 'stock_badge_color',
1578 [
1579 'label' => esc_html__('Color', 'ultimate-store-kit'),
1580 'type' => Controls_Manager::COLOR,
1581 'selectors' => [
1582 '{{WRAPPER}} .' . $this->get_name() . ' .usk-stock-status-badge .usk-badge' => 'color: {{VALUE}}',
1583 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-stock-status-badge .usk-badge' => 'color: {{VALUE}}',
1584 ],
1585 'condition' => [
1586 'show_stock_status' => 'yes',
1587 ],
1588 ]
1589 );
1590 $this->add_group_control(
1591 Group_Control_Background::get_type(),
1592 [
1593 'name' => 'stock_badge_bg',
1594 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-stock-status-badge .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-stock-status-badge .usk-badge',
1595 'condition' => [
1596 'show_stock_status' => 'yes',
1597 ],
1598 ]
1599 );
1600
1601 $this->add_control(
1602 'stock_badge_border_color',
1603 [
1604 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1605 'type' => Controls_Manager::COLOR,
1606 'selectors' => [
1607 '{{WRAPPER}} .' . $this->get_name() . ' .usk-stock-status-badge .usk-badge' => 'border-color: {{VALUE}} !important;',
1608 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-stock-status-badge .usk-badge' => 'border-color: {{VALUE}} !important;',
1609 ],
1610 'condition' => [
1611 'show_stock_status' => 'yes',
1612 'badge_border_border!' => '',
1613 ],
1614 ]
1615 );
1616 $this->end_controls_tab();
1617 $this->start_controls_tab(
1618 'trending_badge_tab',
1619 [
1620 'label' => esc_html__('Trending', 'ultimate-store-kit'),
1621 'condition' => [
1622 'show_trending_badge' => 'yes',
1623 ],
1624 ]
1625 );
1626 $this->add_control(
1627 'trending_badge_color',
1628 [
1629 'label' => esc_html__('Color', 'ultimate-store-kit'),
1630 'type' => Controls_Manager::COLOR,
1631 'selectors' => [
1632 '{{WRAPPER}} .' . $this->get_name() . ' .usk-trending-badge .usk-badge' => 'color: {{VALUE}}',
1633 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-trending-badge .usk-badge' => 'color: {{VALUE}}',
1634 ],
1635 'condition' => [
1636 'show_trending_badge' => 'yes',
1637 ],
1638 ]
1639 );
1640 $this->add_group_control(
1641 Group_Control_Background::get_type(),
1642 [
1643 'name' => 'trending_badge_bg',
1644 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-trending-badge .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-trending-badge .usk-badge',
1645 'condition' => [
1646 'show_trending_badge' => 'yes',
1647 ],
1648 ]
1649 );
1650
1651 $this->add_control(
1652 'trending_badge_border_color',
1653 [
1654 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1655 'type' => Controls_Manager::COLOR,
1656 'selectors' => [
1657 '{{WRAPPER}} .' . $this->get_name() . ' .usk-trending-badge .usk-badge' => 'border-color: {{VALUE}} !important;',
1658 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-trending-badge .usk-badge' => 'border-color: {{VALUE}} !important;',
1659 ],
1660 'condition' => [
1661 'show_trending_badge' => 'yes',
1662 'badge_border_border!' => '',
1663 ],
1664 ]
1665 );
1666 $this->end_controls_tab();
1667 $this->start_controls_tab(
1668 'new_badge_tab',
1669 [
1670 'label' => esc_html__('New', 'ultimate-store-kit'),
1671 'condition' => [
1672 'show_new_badge' => 'yes',
1673 ],
1674 ]
1675 );
1676 $this->add_control(
1677 'new_badge_color',
1678 [
1679 'label' => esc_html__('Color', 'ultimate-store-kit'),
1680 'type' => Controls_Manager::COLOR,
1681 'selectors' => [
1682 '{{WRAPPER}} .' . $this->get_name() . ' .usk-new-badge .usk-badge' => 'color: {{VALUE}}',
1683 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-new-badge .usk-badge' => 'color: {{VALUE}}',
1684 ],
1685 'condition' => [
1686 'show_new_badge' => 'yes',
1687 ],
1688 ]
1689 );
1690
1691 $this->add_group_control(
1692 Group_Control_Background::get_type(),
1693 [
1694 'name' => 'new_badge_bg',
1695 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-new-badge .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-new-badge .usk-badge',
1696 'condition' => [
1697 'show_new_badge' => 'yes',
1698 ],
1699 ]
1700 );
1701
1702 $this->add_control(
1703 'new_badge_border_color',
1704 [
1705 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1706 'type' => Controls_Manager::COLOR,
1707 'selectors' => [
1708 '{{WRAPPER}} .' . $this->get_name() . ' .usk-new-badge .usk-badge' => 'border-color: {{VALUE}} !important;',
1709 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-new-badge .usk-badge' => 'border-color: {{VALUE}} !important;',
1710 ],
1711 'condition' => [
1712 'show_new_badge' => 'yes',
1713 'badge_border_border!' => '',
1714 ],
1715 ]
1716 );
1717 $this->end_controls_tab();
1718 $this->end_controls_tabs();
1719 $this->end_controls_section();
1720
1721 $this->start_controls_section(
1722 'section_style_button',
1723 [
1724 'label' => esc_html__('Add to Cart', 'ultimate-store-kit'),
1725 'tab' => Controls_Manager::TAB_STYLE,
1726 'condition' => [
1727 'show_cart' => 'yes',
1728 ],
1729 ]
1730 );
1731
1732 $this->start_controls_tabs('tabs_button_style');
1733
1734 $this->start_controls_tab(
1735 'tab_button_normal',
1736 [
1737 'label' => esc_html__('Normal', 'ultimate-store-kit'),
1738 ]
1739 );
1740
1741 $this->add_control(
1742 'button_text_color',
1743 [
1744 'label' => esc_html__('Color', 'ultimate-store-kit'),
1745 'type' => Controls_Manager::COLOR,
1746 'default' => '',
1747 'selectors' => [
1748 '{{WRAPPER}} .' . $this->get_name() . ' .usk-button' => 'color: {{VALUE}};',
1749 '{{WRAPPER}} .' . $this->get_name() . ' .added_to_cart' => 'color: {{VALUE}};',
1750 '{{WRAPPER}} .' . $this->get_name() . ' .usk-button.loading::after' => 'border-color: {{VALUE}}',
1751 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button' => 'color: {{VALUE}};',
1752 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart' => 'color: {{VALUE}};',
1753 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button.loading::after' => 'border-color: {{VALUE}}'
1754 ],
1755 ]
1756 );
1757
1758 $this->add_group_control(
1759 Group_Control_Background::get_type(),
1760 [
1761 'name' => 'btn_background_color',
1762 'label' => esc_html__('Background', 'ultimate-store-kit'),
1763 'types' => ['classic', 'gradient'],
1764 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-button, {{WRAPPER}} .' . $this->get_name() . ' .added_to_cart, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart',
1765 ]
1766 );
1767
1768 $this->add_group_control(
1769 Group_Control_Border::get_type(),
1770 [
1771 'name' => 'btn_border',
1772 'label' => esc_html__('Border', 'ultimate-store-kit'),
1773 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-button, {{WRAPPER}} .' . $this->get_name() . ' .added_to_cart, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart',
1774 'separator' => 'before',
1775 ]
1776 );
1777
1778 $this->add_responsive_control(
1779 'btn_border_radius',
1780 [
1781 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
1782 'type' => Controls_Manager::DIMENSIONS,
1783 'size_units' => ['px', '%'],
1784 'selectors' => [
1785 '{{WRAPPER}} .' . $this->get_name() . ' .usk-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1786 '{{WRAPPER}} .' . $this->get_name() . ' .added_to_cart' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1787 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1788 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1789 ],
1790 ]
1791 );
1792
1793 $this->add_responsive_control(
1794 'button_width',
1795 [
1796 'label' => esc_html__('Width(%)', 'ultimate-store-kit'),
1797 'type' => Controls_Manager::SLIDER,
1798 'range' => [
1799 'px' => [
1800 'min' => 10,
1801 'max' => 100,
1802 ]
1803 ],
1804 'selectors' => [
1805 '{{WRAPPER}} .' . $this->get_name() . '' => '--btn-width: {{SIZE}}%;',
1806 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"]' => '--btn-width: {{SIZE}}% !important;',
1807 ],
1808 ]
1809 );
1810
1811 $this->add_responsive_control(
1812 'button_height',
1813 [
1814 'label' => esc_html__('Height(px)', 'ultimate-store-kit'),
1815 'type' => Controls_Manager::SLIDER,
1816 'range' => [
1817 'px' => [
1818 'min' => 10,
1819 'max' => 100,
1820 ]
1821 ],
1822 'selectors' => [
1823 '{{WRAPPER}} .' . $this->get_name() . ' .usk-button, {{WRAPPER}} .' . $this->get_name() . ' .added_to_cart' => 'height: {{SIZE}}px; line-height: {{SIZE}}px;',
1824 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart' => 'height: {{SIZE}}px; line-height: {{SIZE}}px;',
1825 ],
1826 ]
1827 );
1828
1829 $this->add_group_control(
1830 Group_Control_Typography::get_type(),
1831 [
1832 'name' => 'button_typography',
1833 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-button, {{WRAPPER}} .' . $this->get_name() . ' .added_to_cart, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart',
1834 ]
1835 );
1836 $this->end_controls_tab();
1837
1838 $this->start_controls_tab(
1839 'tab_button_hover',
1840 [
1841 'label' => esc_html__('Hover', 'ultimate-store-kit'),
1842 ]
1843 );
1844
1845 $this->add_control(
1846 'hover_color',
1847 [
1848 'label' => esc_html__('Color', 'ultimate-store-kit'),
1849 'type' => Controls_Manager::COLOR,
1850 'selectors' => [
1851 '{{WRAPPER}} .' . $this->get_name() . ' .usk-button:hover' => 'color: {{VALUE}};',
1852 '{{WRAPPER}} .' . $this->get_name() . ' .added_to_cart:hover' => 'color: {{VALUE}};',
1853 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button:hover' => 'color: {{VALUE}};',
1854 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart:hover' => 'color: {{VALUE}};',
1855 ],
1856 ]
1857 );
1858
1859 $this->add_group_control(
1860 Group_Control_Background::get_type(),
1861 [
1862 'name' => 'btn_hover_bg',
1863 'label' => esc_html__('Background', 'ultimate-store-kit'),
1864 'types' => ['classic', 'gradient'],
1865 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-button:hover, {{WRAPPER}} .' . $this->get_name() . ' .added_to_cart:hover, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button:hover, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart:hover',
1866 ]
1867 );
1868
1869 $this->add_control(
1870 'button_hover_border_color',
1871 [
1872 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1873 'type' => Controls_Manager::COLOR,
1874 'condition' => [
1875 'btn_border_border!' => '',
1876 ],
1877 'selectors' => [
1878 '{{WRAPPER}} .' . $this->get_name() . ' .usk-button:hover' => 'border-color: {{VALUE}};',
1879 '{{WRAPPER}} .' . $this->get_name() . ' .added_to_cart:hover' => 'border-color: {{VALUE}};',
1880 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button:hover' => 'border-color: {{VALUE}};',
1881 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart:hover' => 'border-color: {{VALUE}};',
1882 ],
1883 ]
1884 );
1885 $this->end_controls_tab();
1886 $this->end_controls_tabs();
1887 $this->end_controls_section();
1888
1889 $this->start_controls_section(
1890 'style_action_btn',
1891 [
1892 'label' => esc_html__('Action Button', 'ultimate-store-kit'),
1893 'tab' => Controls_Manager::TAB_STYLE,
1894 'conditions' => [
1895 'relation' => 'or',
1896 'terms' => [
1897 [
1898 'name' => 'show_cart',
1899 'value' => 'yes'
1900 ],
1901 [
1902 'name' => 'show_wishlist',
1903 'value' => 'yes'
1904 ],
1905 [
1906 'name' => 'show_quick_view',
1907 'value' => 'yes'
1908 ],
1909 [
1910 'name' => 'show_compare',
1911 'value' => 'yes'
1912 ]
1913 ]
1914 ]
1915 ]
1916 );
1917 $this->add_group_control(
1918 Group_Control_Border::get_type(),
1919 [
1920 'name' => 'action_btn_border',
1921 'label' => esc_html__('Border', 'ultimate-store-kit'),
1922 'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping a, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping a',
1923 'separator' => 'before'
1924 ]
1925 );
1926 $this->add_responsive_control(
1927 'action_btn_radius',
1928 [
1929 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
1930 'type' => Controls_Manager::DIMENSIONS,
1931 'size_units' => ['px', '%', 'em'],
1932 'selectors' => [
1933 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1934 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1935 ],
1936 ]
1937 );
1938 $this->add_responsive_control(
1939 'action_btn_padding',
1940 [
1941 'label' => esc_html__('Padding', 'ultimate-store-kit'),
1942 'type' => Controls_Manager::DIMENSIONS,
1943 'size_units' => ['px', '%', 'em'],
1944 'selectors' => [
1945 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1946 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1947 ],
1948 ]
1949 );
1950 $this->add_responsive_control(
1951 'action_btn_margin',
1952 [
1953 'label' => esc_html__('Margin', 'ultimate-store-kit'),
1954 'type' => Controls_Manager::DIMENSIONS,
1955 'size_units' => ['px', '%', 'em'],
1956 'selectors' => [
1957 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1958 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1959 ],
1960 ]
1961 );
1962 $this->add_responsive_control(
1963 'action_btn_size',
1964 [
1965 'label' => __('Icon Size', 'ultimate-store-kit'),
1966 'type' => Controls_Manager::SLIDER,
1967 'size_units' => ['px'],
1968 'range' => [
1969 'px' => [
1970 'min' => 0,
1971 'max' => 50,
1972 'step' => 1,
1973 ]
1974 ],
1975 'selectors' => [
1976 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping a .icon' => 'font-size: {{SIZE}}{{UNIT}};',
1977 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping a .icon' => 'font-size: {{SIZE}}{{UNIT}};',
1978 ],
1979 ]
1980 );
1981 $this->add_control(
1982 'font_family',
1983 [
1984 'label' => esc_html__('Tooltip Font', 'ultimate-store-kit'),
1985 'type' => Controls_Manager::FONT,
1986 'selectors' => [
1987 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping a' => 'font-family: {{VALUE}}',
1988 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping a' => 'font-family: {{VALUE}}',
1989 ],
1990 ]
1991 );
1992 $this->start_controls_tabs(
1993 'action_btn_tabs'
1994 );
1995 $this->start_controls_tab(
1996 'wishlist_tab',
1997 [
1998 'label' => esc_html__('Wishlist', 'ultimate-store-kit'),
1999 'condition' => [
2000 'show_wishlist' => 'yes'
2001 ]
2002 ]
2003 );
2004 $this->add_control(
2005 'wishlist_normal_color',
2006 [
2007 'label' => esc_html__('Color', 'ultimate-store-kit'),
2008 'type' => Controls_Manager::COLOR,
2009 'selectors' => [
2010 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist' => 'color: {{VALUE}}',
2011 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist' => 'color: {{VALUE}}',
2012 ],
2013 ]
2014 );
2015 $this->add_control(
2016 'wishlist_icon_bg',
2017 [
2018 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
2019 'type' => Controls_Manager::COLOR,
2020 'selectors' => [
2021 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist' => 'background: {{VALUE}}',
2022 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist' => 'background: {{VALUE}}',
2023 ],
2024 ]
2025 );
2026
2027 $this->add_control(
2028 'wishlist_border_color',
2029 [
2030 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
2031 'type' => Controls_Manager::COLOR,
2032 'selectors' => [
2033 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist' => 'border-color: {{VALUE}} !important;',
2034 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist' => 'border-color: {{VALUE}} !important;',
2035 ],
2036 'condition' => [
2037 'action_btn_border_border!' => ''
2038 ]
2039 ]
2040 );
2041 $this->add_control(
2042 'heading_wishlist_hover',
2043 [
2044 'label' => esc_html__('Hover', 'ultimate-store-kit'),
2045 'type' => Controls_Manager::HEADING,
2046 'separator' => 'before',
2047 ]
2048 );
2049 $this->add_control(
2050 'wishlist_hover_color',
2051 [
2052 'label' => esc_html__('Color', 'ultimate-store-kit'),
2053 'type' => Controls_Manager::COLOR,
2054 'selectors' => [
2055 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist:hover' => 'color: {{VALUE}}',
2056 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist:hover' => 'color: {{VALUE}}',
2057 ],
2058 ]
2059 );
2060 $this->add_control(
2061 'wishlist_icon_hover_bg',
2062 [
2063 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
2064 'type' => Controls_Manager::COLOR,
2065 'selectors' => [
2066 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist:hover' => 'background: {{VALUE}}',
2067 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist:hover' => 'background: {{VALUE}}',
2068 ],
2069 ]
2070 );
2071
2072 $this->add_control(
2073 'wishlist_border_hover_color',
2074 [
2075 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
2076 'type' => Controls_Manager::COLOR,
2077 'selectors' => [
2078 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist:hover' => 'border-color: {{VALUE}} !important;',
2079 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist:hover' => 'border-color: {{VALUE}} !important;',
2080 ],
2081 'condition' => [
2082 'action_btn_border_border!' => ''
2083 ]
2084 ]
2085 );
2086
2087 $this->add_control(
2088 'heading_wishlist_active',
2089 [
2090 'label' => esc_html__('Active', 'ultimate-store-kit'),
2091 'type' => Controls_Manager::HEADING,
2092 'separator' => 'before',
2093 ]
2094 );
2095 $this->add_control(
2096 'wishlist_active_color',
2097 [
2098 'label' => esc_html__('Color', 'ultimate-store-kit'),
2099 'type' => Controls_Manager::COLOR,
2100 'selectors' => [
2101 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist.usk-active' => 'color: {{VALUE}}',
2102 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist.usk-active' => 'color: {{VALUE}}',
2103 ],
2104 ]
2105 );
2106 $this->add_control(
2107 'wishlist_active_bg',
2108 [
2109 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
2110 'type' => Controls_Manager::COLOR,
2111 'selectors' => [
2112 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist.usk-active' => 'background: {{VALUE}}',
2113 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist.usk-active' => 'background: {{VALUE}}',
2114 ],
2115 ]
2116 );
2117 $this->add_control(
2118 'wishlist_active_border_color',
2119 [
2120 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
2121 'type' => Controls_Manager::COLOR,
2122 'selectors' => [
2123 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist.usk-active' => 'border-color: {{VALUE}} !important;',
2124 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist.usk-active' => 'border-color: {{VALUE}} !important;',
2125 ],
2126 'condition' => [
2127 'action_btn_border_border!' => ''
2128 ]
2129 ]
2130 );
2131 $this->end_controls_tab();
2132 $this->start_controls_tab(
2133 'compare_tab',
2134 [
2135 'label' => esc_html__('Compare', 'ultimate-store-kit'),
2136 'condition' => [
2137 'show_compare' => 'yes'
2138 ]
2139 ]
2140 );
2141 $this->add_control(
2142 'compare_color',
2143 [
2144 'label' => esc_html__('Color', 'ultimate-store-kit'),
2145 'type' => Controls_Manager::COLOR,
2146 'selectors' => [
2147 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare' => 'color: {{VALUE}}',
2148 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare' => 'color: {{VALUE}}',
2149 ],
2150 ]
2151 );
2152 $this->add_control(
2153 'compare_icon_bg',
2154 [
2155 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
2156 'type' => Controls_Manager::COLOR,
2157 'selectors' => [
2158 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare' => 'background: {{VALUE}}',
2159 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare' => 'background: {{VALUE}}',
2160 ],
2161 ]
2162 );
2163 $this->add_control(
2164 'compare_border_color',
2165 [
2166 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
2167 'type' => Controls_Manager::COLOR,
2168 'selectors' => [
2169 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare' => 'border-color: {{VALUE}} !important;',
2170 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare' => 'border-color: {{VALUE}} !important;',
2171 ],
2172 'condition' => [
2173 'action_btn_border_border!' => ''
2174 ]
2175 ]
2176 );
2177 $this->add_control(
2178 'heading_compare_hover',
2179 [
2180 'label' => esc_html__('Hover', 'ultimate-store-kit'),
2181 'type' => Controls_Manager::HEADING,
2182 'separator' => 'before',
2183 ]
2184 );
2185 $this->add_control(
2186 'compare_color_hover',
2187 [
2188 'label' => esc_html__('Color', 'ultimate-store-kit'),
2189 'type' => Controls_Manager::COLOR,
2190 'selectors' => [
2191 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare:hover' => 'color: {{VALUE}}',
2192 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare:hover' => 'color: {{VALUE}}',
2193 ],
2194 ]
2195 );
2196 $this->add_control(
2197 'compare_icon_bg_hover',
2198 [
2199 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
2200 'type' => Controls_Manager::COLOR,
2201 'selectors' => [
2202 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare:hover' => 'background: {{VALUE}}',
2203 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare:hover' => 'background: {{VALUE}}',
2204 ],
2205 ]
2206 );
2207 $this->add_control(
2208 'compare_border_hover_color',
2209 [
2210 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
2211 'type' => Controls_Manager::COLOR,
2212 'selectors' => [
2213 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare:hover' => 'border-color: {{VALUE}} !important;',
2214 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare:hover' => 'border-color: {{VALUE}} !important;',
2215 ],
2216 'condition' => [
2217 'action_btn_border_border!' => ''
2218 ]
2219 ]
2220 );
2221 $this->add_control(
2222 'heading_compare_active',
2223 [
2224 'label' => esc_html__('Active', 'ultimate-store-kit'),
2225 'type' => Controls_Manager::HEADING,
2226 'separator' => 'before',
2227 ]
2228 );
2229 $this->add_control(
2230 'compare_color_active',
2231 [
2232 'label' => esc_html__('Color', 'ultimate-store-kit'),
2233 'type' => Controls_Manager::COLOR,
2234 'selectors' => [
2235 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare.usk-active' => 'color: {{VALUE}}',
2236 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare.usk-active' => 'color: {{VALUE}}',
2237 ],
2238 ]
2239 );
2240 $this->add_control(
2241 'compare_icon_bg_active',
2242 [
2243 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
2244 'type' => Controls_Manager::COLOR,
2245 'selectors' => [
2246 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare.usk-active' => 'background: {{VALUE}}',
2247 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare.usk-active' => 'background: {{VALUE}}',
2248 ],
2249 ]
2250 );
2251 $this->add_control(
2252 'compare_border_active_color',
2253 [
2254 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
2255 'type' => Controls_Manager::COLOR,
2256 'selectors' => [
2257 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare.usk-active' => 'border-color: {{VALUE}} !important;',
2258 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare.usk-active' => 'border-color: {{VALUE}} !important;',
2259 ],
2260 'condition' => [
2261 'action_btn_border_border!' => ''
2262 ]
2263 ]
2264 );
2265 $this->end_controls_tab();
2266 $this->start_controls_tab(
2267 'quickview_tab',
2268 [
2269 'label' => esc_html__('Quickview', 'ultimate-store-kit'),
2270 'condition' => [
2271 'show_quick_view' => 'yes'
2272 ]
2273 ]
2274 );
2275 $this->add_control(
2276 'quickview_color',
2277 [
2278 'label' => esc_html__('Color', 'ultimate-store-kit'),
2279 'type' => Controls_Manager::COLOR,
2280 'selectors' => [
2281 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-quickview' => 'color: {{VALUE}}',
2282 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-quickview' => 'color: {{VALUE}}',
2283 ],
2284 ]
2285 );
2286 $this->add_control(
2287 'quickview_icon_bg',
2288 [
2289 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
2290 'type' => Controls_Manager::COLOR,
2291 'selectors' => [
2292 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-quickview' => 'background: {{VALUE}}',
2293 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-quickview' => 'background: {{VALUE}}',
2294 ],
2295 ]
2296 );
2297 $this->add_control(
2298 'quickview_border_color',
2299 [
2300 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
2301 'type' => Controls_Manager::COLOR,
2302 'selectors' => [
2303 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-quickview' => 'border-color: {{VALUE}} !important;',
2304 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-quickview' => 'border-color: {{VALUE}} !important;',
2305 ],
2306 'condition' => [
2307 'action_btn_border_border!' => ''
2308 ]
2309 ]
2310 );
2311 $this->add_control(
2312 'heading_quickview_hover',
2313 [
2314 'label' => esc_html__('Hover', 'ultimate-store-kit'),
2315 'type' => Controls_Manager::HEADING,
2316 'separator' => 'before',
2317 ]
2318 );
2319 $this->add_control(
2320 'quickview_color_hover',
2321 [
2322 'label' => esc_html__('Color', 'ultimate-store-kit'),
2323 'type' => Controls_Manager::COLOR,
2324 'selectors' => [
2325 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-quickview:hover' => 'color: {{VALUE}}',
2326 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-quickview:hover' => 'color: {{VALUE}}',
2327 ],
2328 ]
2329 );
2330 $this->add_control(
2331 'quickview_icon_bg_hover',
2332 [
2333 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
2334 'type' => Controls_Manager::COLOR,
2335 'selectors' => [
2336 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-quickview:hover' => 'background: {{VALUE}}',
2337 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-quickview:hover' => 'background: {{VALUE}}',
2338 ],
2339 ]
2340 );
2341 $this->add_control(
2342 'quickview_border_hover_color',
2343 [
2344 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
2345 'type' => Controls_Manager::COLOR,
2346 'selectors' => [
2347 '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-quickview:hover' => 'border-color: {{VALUE}} !important;',
2348 '.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-quickview:hover' => 'border-color: {{VALUE}} !important;',
2349 ],
2350 'condition' => [
2351 'action_btn_border_border!' => ''
2352 ]
2353 ]
2354 );
2355 $this->end_controls_tab();
2356 $this->end_controls_tabs();
2357 $this->end_controls_section();
2358 }
2359
2360 public function render_add_to_cart() {
2361 global $product;
2362 $settings = $this->get_settings_for_display();
2363 if ('yes' == $settings['show_cart']) : ?>
2364 <?php if ($product) {
2365 $defaults = [
2366 'quantity' => 1,
2367 'class' => implode(
2368 ' ',
2369 array_filter(
2370 [
2371 'usk-button',
2372 'product_type_' . $product->get_type(),
2373 $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',
2374 $product->supports('ajax_add_to_cart') && $product->is_purchasable() && $product->is_in_stock() ? 'ajax_add_to_cart' : '',
2375 ]
2376 )
2377 ),
2378 'attributes' => [
2379 'data-product_id' => $product->get_id(),
2380 'data-product_sku' => $product->get_sku(),
2381 'aria-label' => $product->add_to_cart_description(),
2382 'rel' => 'nofollow',
2383 ],
2384 ];
2385 $args = apply_filters('woocommerce_loop_add_to_cart_args', wp_parse_args($defaults), $product);
2386 if (isset($args['attributes']['aria-label'])) {
2387 $args['attributes']['aria-label'] = wp_strip_all_tags($args['attributes']['aria-label']);
2388 }
2389 echo wp_kses_post(apply_filters(
2390 'woocommerce_loop_add_to_cart_link', // WPCS: XSS ok.
2391 sprintf(
2392 '<a href="%s" data-quantity="%s" class="%s" %s>%s <i class="button-icon usk-icon-arrow-right-8"></i></a>',
2393 esc_url($product->add_to_cart_url()),
2394 esc_attr(isset($args['quantity']) ? $args['quantity'] : 1),
2395 esc_attr(isset($args['class']) ? $args['class'] : 'button'),
2396 isset($args['attributes']) ? wc_implode_html_attributes($args['attributes']) : '',
2397 esc_html($product->add_to_cart_text())
2398 ),
2399 $product,
2400 $args
2401 ));
2402 }; ?>
2403 <?php endif;
2404 }
2405
2406 public function render_image() {
2407 global $product;
2408 $tooltip_position = 'left';
2409 $settings = $this->get_settings_for_display();
2410
2411 $thumbnail_size = $settings['thumbnail_size'];
2412
2413 $gallery_thumbs = $product->get_gallery_image_ids();
2414 $product_image = wp_get_attachment_image_url(get_post_thumbnail_id(), $thumbnail_size);
2415
2416 // if product image is empty, use placeholder
2417 if (empty($product_image)) {
2418 $product_image = wc_placeholder_img_src('full');
2419 }
2420
2421 if ($gallery_thumbs) {
2422 foreach ($gallery_thumbs as $key => $gallery_thumb) {
2423 if ($key == 0) :
2424 $gallery_image_link = wp_get_attachment_image_url($gallery_thumb, $thumbnail_size);
2425 endif;
2426 }
2427 } else {
2428 $gallery_image_link = wp_get_attachment_image_url(get_post_thumbnail_id(), $thumbnail_size);
2429 }
2430 ?>
2431 <div class="usk-image">
2432 <a href="<?php echo esc_url(get_permalink()); ?>">
2433 <img class="img image-default" src="<?php echo esc_url($product_image); ?>" alt="<?php echo esc_html(get_the_title()); ?>">
2434 <img class="img image-hover" src="<?php echo esc_url($gallery_image_link); ?>" alt="<?php echo esc_html(get_the_title()); ?>">
2435 </a>
2436 <?php $this->render_add_to_cart(); ?>
2437 <div class="usk-shoping">
2438 <?php $this->register_global_template_add_to_wishlist($tooltip_position, $settings); ?>
2439 <?php $this->register_global_template_add_to_compare($tooltip_position, $settings); ?>
2440 <?php $this->register_global_template_quick_view($product->get_id(), $tooltip_position, $settings); ?>
2441 </div>
2442 <div class="usk-badge-label-wrapper">
2443 <div class="usk-badge-label-content usk-flex usk-flex-column">
2444 <?php $this->register_global_template_badge_label($settings); ?>
2445 </div>
2446 </div>
2447 </div>
2448 <?php
2449 }
2450
2451 public function render_slider_header() {
2452 $settings = $this->get_settings_for_display();
2453 $this->add_render_attribute('image-hotspot', 'class', ['usk-image-hotspot usk-grid-carousel']);
2454 $id = 'image-hotspot-' . $this->get_id();
2455
2456 $this->add_render_attribute('image-hotspot', 'id', $id);
2457
2458 $this->add_render_attribute(
2459 [
2460 'image-hotspot' => [
2461 'data-settings' => [
2462 wp_json_encode(array_filter([
2463 'id' => $id,
2464 "slidesPerView" => isset($settings['product_limit']) ? $settings['product_limit'] : 3,
2465 "watchSlidesProgress" => true,
2466 "sliderEffect" => isset($settings["swiper_effect"]) ? $settings["swiper_effect"] : 'slide',
2467 "image_hotspot_layout" => isset($settings['image_hotspot_layout']) ? $settings['image_hotspot_layout'] : 'slider',
2468 ])),
2469 ],
2470 ],
2471 ]
2472 );
2473 ?>
2474 <div class="ultimate-store-kit">
2475 <div <?php $this->print_render_attribute_string('image-hotspot'); ?>>
2476 <?php if ($settings['image_hotspot_layout'] == 'slider') : ?>
2477 <div class="swiper usk-image-hotspot-main">
2478 <div class="swiper-wrapper">
2479 <?php endif;
2480 }
2481
2482 public function render_slider_footer() {
2483 $settings = $this->get_settings_for_display();
2484
2485 if ($settings['image_hotspot_layout'] == 'slider') {
2486 $this->add_render_attribute('thumbs', 'class', 'usk-image-hotspot-thumbs swiper');
2487 } else {
2488 $this->add_render_attribute('thumbs', 'class', 'usk-image-hotspot-thumbs');
2489 }
2490
2491 ?>
2492 <?php if ($settings['image_hotspot_layout'] == 'slider') : ?>
2493 </div>
2494 </div>
2495 <?php endif; ?>
2496
2497 <!-- thumbsslider -->
2498 <div thumbsSlider="" <?php $this->print_render_attribute_string('thumbs'); ?>>
2499 <?php
2500 $image_size = $settings['image_resolution_size'];
2501 $placeholder_image_src = \Elementor\Utils::get_placeholder_image_src();
2502 $image_src = wp_get_attachment_image_src($settings['hotspot_image']['id'], $image_size);
2503 if (! $image_src) {
2504 printf('<img src="%1$s" alt="%2$s">', esc_url($placeholder_image_src), esc_html(get_the_title()));
2505 } else {
2506 print(wp_get_attachment_image(
2507 $settings['hotspot_image']['id'],
2508 $image_size,
2509 false,
2510 [
2511
2512 'alt' => esc_html(get_the_title())
2513 ]
2514 ));
2515 }
2516 ?>
2517 <div class="swiper-wrapper">
2518 <?php $this->render_thumbs_item(); ?>
2519 </div>
2520 </div>
2521 <!-- thumbsslider -->
2522 </div>
2523 </div>
2524 <?php
2525 }
2526
2527 public function print_price_output($output) {
2528 $tags = [
2529 'del' => ['aria-hidden' => []],
2530 'span' => ['class' => []],
2531 'bdi' => [],
2532 'ins' => [],
2533 ];
2534
2535 if (isset($output)) {
2536 echo wp_kses($output, $tags);
2537 }
2538 }
2539
2540 public function render_product_content() {
2541 $settings = $this->get_settings_for_display();
2542
2543 global $product;
2544 $rating_count = $product->get_rating_count();
2545 $average = $product->get_average_rating();
2546 $have_rating = ('yes' === $settings['show_rating']) ? 'usk-have-rating' : '';
2547 $categories = str_replace(',', '', wc_get_product_category_list($product->get_id()));
2548
2549 ?>
2550 <div class="swiper-slide usk-item <?php echo esc_attr($have_rating); ?>">
2551 <div class="usk-item-box">
2552 <?php $this->render_image(); ?>
2553 <div class="usk-content">
2554 <div class="usk-content-inner">
2555 <?php if ('yes' == $settings['show_category']) : ?>
2556 <div class="usk-category">
2557 <?php echo wp_kses_post(wc_get_product_category_list($product->get_id(), ' ')); ?>
2558 </div>
2559 <?php endif; ?>
2560 <?php if ('yes' == $settings['show_title']) : ?>
2561 <?php printf(
2562 '<a href="%2$s" class="usk-title"><%1$s class="title">%3$s</%1$s></a>',
2563 esc_attr(Utils::get_valid_html_tag($settings['title_tags'])),
2564 esc_url($product->get_permalink()),
2565 esc_html($product->get_title())
2566 ); ?>
2567 <?php endif; ?>
2568 <?php if ('yes' == $settings['show_price']) : ?>
2569 <div class="usk-price">
2570 <?php $this->print_price_output($product->get_price_html()); ?>
2571 </div>
2572 <?php endif; ?>
2573 <?php if ('yes' == $settings['show_rating']) : ?>
2574 <div class="usk-rating">
2575 <span><?php echo wp_kses_post($this->register_global_template_wc_rating($average, $rating_count)); ?></span>
2576 </div>
2577 <?php endif; ?>
2578 </div>
2579 </div>
2580 </div>
2581 </div>
2582
2583 <?php
2584 }
2585
2586 public function render_tooltip_product_content() {
2587 ob_start();
2588 $html = '';
2589 $this->render_product_content();
2590 $html .= ob_get_clean();
2591 return $html;
2592 }
2593
2594 public function render_loop_item() {
2595 $settings = $this->get_settings_for_display();
2596
2597 $this->query_product();
2598 $wp_query = $this->get_query();
2599
2600 if ($wp_query->have_posts()) { ?>
2601 <?php while ($wp_query->have_posts()) : $wp_query->the_post();
2602
2603
2604 ?>
2605 <?php $this->render_product_content(); ?>
2606 <?php endwhile;
2607 wp_reset_postdata();
2608 } else {
2609 echo '<div class="usk-alert-warning" usk-alert>' . esc_html__('Ops! There no product to display.', 'ultimate-store-kit') . '</div>';
2610 }
2611 }
2612
2613 public function render_thumbs_image() {
2614 global $product;
2615 $settings = $this->get_settings_for_display();
2616 $product_image = wp_get_attachment_image_url(get_post_thumbnail_id(), $settings['thumbnail_size']);
2617
2618 // if product image is empty, use placeholder
2619 if (empty($product_image)) {
2620 $product_image = wc_placeholder_img_src('full');
2621 }
2622 ?>
2623 <div class="usk-image-wrap">
2624 <img class="usk-img" src="<?php echo esc_url($product_image); ?>" alt="<?php echo esc_html(get_the_title()); ?>">
2625 </div>
2626 <?php
2627 }
2628
2629 public function render_thumbs_item() {
2630 $settings = $this->get_settings_for_display();
2631
2632 $hotspots = $settings['markers']; // Retrieve hotspots
2633 $unique_ids = []; // Initialize an array to store unique IDs
2634 if ($hotspots) {
2635 foreach ($hotspots as $hotspot) {
2636 $unique_ids[] = $hotspot['_id']; // Collect unique IDs
2637 }
2638 }
2639
2640 $this->query_product();
2641 $wp_query = $this->get_query();
2642
2643 if ($wp_query->have_posts()) {
2644 $index = 0;
2645
2646 while ($wp_query->have_posts()): $wp_query->the_post();
2647 global $product;
2648
2649
2650 $unique_id_class = isset($unique_ids[$index]) ? esc_attr($unique_ids[$index]) : '';
2651
2652 if ($settings['image_hotspot_layout'] == 'tooltip') {
2653 $marker_title = $this->render_tooltip_product_content();
2654
2655 $this->add_render_attribute('marker', 'class', 'usk-thumbs-item elementor-repeater-item-' . esc_attr($unique_id_class), true);
2656
2657 $this->add_render_attribute('marker', 'data-tippy-content', $marker_title, true);
2658
2659 $this->add_render_attribute('marker', 'class', 'bdt-tippy-tooltip');
2660 $this->add_render_attribute('marker', 'data-tippy', '', true);
2661
2662 if ($settings['marker_tooltip_animation']) {
2663 $this->add_render_attribute('marker', 'data-tippy-animation', $settings['marker_tooltip_animation'], true);
2664 }
2665
2666 if ($settings['marker_tooltip_x_offset']['size'] or $settings['marker_tooltip_y_offset']['size']) {
2667 $this->add_render_attribute('marker', 'data-tippy-offset', '[' . $settings['marker_tooltip_x_offset']['size'] . ',' . $settings['marker_tooltip_y_offset']['size'] . ']', true);
2668 }
2669
2670 if ('yes' == $settings['marker_tooltip_arrow']) {
2671 $this->add_render_attribute('marker', 'data-tippy-arrow', 'true', true);
2672 } else {
2673 $this->add_render_attribute('marker', 'data-tippy-arrow', 'false', true);
2674 }
2675
2676 if ('yes' == $settings['marker_tooltip_trigger']) {
2677 $this->add_render_attribute('marker', 'data-tippy-trigger', 'click', true);
2678 }
2679
2680 if ($settings['marker_tooltip_placement']) {
2681 $this->add_render_attribute('marker', 'data-tippy-placement', $settings['marker_tooltip_placement'], true);
2682 }
2683 } else {
2684 $this->add_render_attribute('marker', 'class', 'swiper-slide usk-thumbs-item elementor-repeater-item-' . esc_attr($unique_id_class), true);
2685 }
2686
2687 ?>
2688 <div <?php echo $this->get_render_attribute_string('marker'); ?>>
2689 <div class="usk-thumbs-box">
2690 <?php if ($settings['hotspot_type'] == 'image') : ?>
2691 <?php $this->render_thumbs_image(); ?>
2692 <?php else : ?>
2693 <?php if ($settings['hotspot_icon']['value']) : ?>
2694 <?php Icons_Manager::render_icon($settings['hotspot_icon'], ['aria-hidden' => 'true']); ?>
2695 <?php else : ?>
2696 <i class="usk-icon-plus-2" aria-hidden="true"></i>
2697 <?php endif; ?>
2698 <?php endif; ?>
2699 </div>
2700 </div>
2701 <?php
2702 $index++;
2703 endwhile;
2704
2705 wp_reset_postdata();
2706 } else {
2707 echo '<div class="usk-alert-warning" usk-alert>' . esc_html__('Ops! There no product to display.', 'ultimate-store-kit') . '</div>';
2708 }
2709 }
2710
2711 public function render() {
2712 $settings = $this->get_settings_for_display();
2713
2714 $this->render_slider_header();
2715
2716 if ($settings['image_hotspot_layout'] == 'slider') {
2717 $this->render_loop_item();
2718 }
2719
2720 $this->render_slider_footer();
2721 }
2722 public function query_product() {
2723 $default = $this->getGroupControlQueryArgs();
2724 $this->_query = new WP_Query($default);
2725 }
2726 }
2727