PluginProbe
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder / 2.0.5
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder v2.0.5
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 / mentor-slider / widgets / mentor-slider.php

mentor-slider.php in Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder 2.0.5, at modules/mentor-slider/widgets/mentor-slider.php

1,780 lines 64.0 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\MentorSlider\Widgets;
4
5
6 use Elementor\Controls_Manager;
7 use UltimateStoreKit\Base\Module_Base;
8 use Elementor\Group_Control_Border;
9 use Elementor\Group_Control_Background;
10 use Elementor\Group_Control_Box_Shadow;
11 use Elementor\Group_Control_Image_Size;
12 use Elementor\Group_Control_Text_Shadow;
13 use Elementor\Group_Control_Text_Stroke;
14 use Elementor\Group_Control_Typography;
15 use UltimateStoreKit\traits\Global_Widget_Controls;
16 use UltimateStoreKit\traits\Global_Widget_Template;
17 use UltimateStoreKit\Includes\Controls\GroupQuery\Group_Control_Query;
18 use WP_Query;
19
20 if (!defined('ABSPATH')) {
21 exit;
22 }
23
24 // Exit if accessed directly
25
26 class Mentor_Slider extends Module_Base {
27 use Global_Widget_Controls;
28 use Global_Widget_Template;
29 use Group_Control_Query;
30
31 /**
32 * @var \WP_Query
33 */
34 private $_query = null;
35 public function get_name() {
36 return 'usk-mentor-slider';
37 }
38
39 public function get_title() {
40 return esc_html__('Mentor Slider', 'ultimate-store-kit');
41 }
42
43 public function get_icon() {
44 return 'usk-widget-icon usk-icon-mentor-slider usk-new';
45 }
46
47 public function get_categories() {
48 return ['ultimate-store-kit'];
49 }
50
51 public function get_keywords() {
52 return ['product', 'product-grid', 'table', 'wc'];
53 }
54
55 public function get_script_depends() {
56 return ['micromodal'];
57 }
58
59 public function get_style_depends() {
60 if ($this->usk_is_edit_mode()) {
61 return ['usk-all-styles'];
62 } else {
63 return ['usk-font', 'usk-mentor-slider'];
64 }
65 }
66
67 public function get_query() {
68 return $this->_query;
69 }
70 protected function register_controls() {
71 $this->start_controls_section(
72 'section_woocommerce_layout',
73 [
74 'label' => esc_html__('Layout', 'ultimate-store-kit'),
75 ]
76 );
77 $this->add_responsive_control(
78 'items_height',
79 [
80 'label' => esc_html__('Item Height', 'ultimate-store-kit'),
81 'type' => Controls_Manager::SLIDER,
82 'range' => [
83 'px' => [
84 'min' => 100,
85 'max' => 1000,
86 ],
87 'vh' => [
88 'min' => 10,
89 'max' => 100,
90 ],
91 ],
92 'default' => [
93 'unit' => 'vh',
94 ],
95 'size_units' => [ 'px', 'vh', 'em' ],
96 'selectors' => [
97 '{{WRAPPER}} .usk-main-slider' => 'height: {{SIZE}}{{UNIT}}',
98 ],
99 ]
100 );
101
102 $this->add_group_control(
103 Group_Control_Image_Size::get_type(),
104 [
105 'name' => 'image',
106 'label' => esc_html__('Image Size', 'ultimate-store-kit'),
107 'exclude' => ['custom'],
108 'default' => 'full',
109 ]
110 );
111
112 $this->add_control(
113 'show_arrows',
114 [
115 'label' => esc_html__('Show Arrows', 'ultimate-store-kit'),
116 'type' => Controls_Manager::SWITCHER,
117 'default' => 'yes',
118 'separator' => 'before'
119 ]
120 );
121
122 $this->add_control(
123 'show_pagination',
124 [
125 'label' => esc_html__('Show Pagination', 'ultimate-store-kit'),
126 'type' => Controls_Manager::SWITCHER,
127 'default' => 'yes',
128 ]
129 );
130
131 $this->end_controls_section();
132
133 //Query
134 $this->start_controls_section(
135 'section_post_query_builder',
136 [
137 'label' => __('Query', 'ultimate-store-kit'),
138 'tab' => Controls_Manager::TAB_CONTENT,
139 ]
140 );
141 $this->register_query_builder_controls();
142 $this->end_controls_section();
143
144 //Additional
145 $this->start_controls_section(
146 'section_woocommerce_additional',
147 [
148 'label' => esc_html__('Additional', 'ultimate-store-kit'),
149 ]
150 );
151 $this->start_controls_tabs(
152 'tabs_show_hide_content'
153 );
154 $this->start_controls_tab(
155 'show_content_tab',
156 [
157 'label' => esc_html__('Content', 'ultimate-store-kit'),
158 ]
159 );
160 $this->add_control(
161 'show_title',
162 [
163 'label' => esc_html__('Title', 'ultimate-store-kit'),
164 'type' => Controls_Manager::SWITCHER,
165 'default' => 'yes'
166 ]
167 );
168 $this->add_control(
169 'title_tags',
170 [
171 'label' => esc_html__('Title HTML Tag', 'ultimate-store-kit'),
172 'type' => Controls_Manager::SELECT,
173 'default' => 'h3',
174 'options' => ultimate_store_kit_title_tags(),
175 ]
176 );
177
178 $this->add_control(
179 'show_rating',
180 [
181 'label' => esc_html__('Rating', 'ultimate-store-kit'),
182 'type' => Controls_Manager::SWITCHER,
183 'default' => 'yes',
184 'separator' => 'before'
185 ]
186 );
187 $this->add_control(
188 'hide_customer_review',
189 [
190 'label' => esc_html__('Hide Review Text', 'ultimate-store-kit'),
191 'type' => Controls_Manager::SWITCHER,
192 'label_on' => esc_html__('Yes', 'product-grid'),
193 'label_off' => esc_html__('No', 'product-grid'),
194 // 'return_value' => 'yes',
195 'default' => 'yes',
196 'condition' => [
197 'show_rating' => 'yes',
198 ],
199 'selectors' => [
200 '{{WRAPPER}} .usk-mentor-slider .usk-rating .woocommerce-review-link' => 'display:none',
201 ],
202 ]
203 );
204 // $this->add_control(
205 // 'show_button',
206 // [
207 // 'label' => esc_html__('Button', 'ultimate-store-kit'),
208 // 'type' => Controls_Manager::SWITCHER,
209 // 'default' => 'yes'
210 // ]
211 // );
212 $this->add_control(
213 'show_price',
214 [
215 'label' => esc_html__('Price', 'ultimate-store-kit'),
216 'type' => Controls_Manager::SWITCHER,
217 'default' => 'yes',
218 ]
219 );
220
221 $this->add_control(
222 'show_category',
223 [
224 'label' => esc_html__('Category', 'ultimate-store-kit'),
225 'type' => Controls_Manager::SWITCHER,
226 'default' => 'yes',
227 ]
228 );
229
230 $this->add_control(
231 'show_excerpt',
232 [
233 'label' => esc_html__('Text', 'ultimate-store-kit'),
234 'type' => Controls_Manager::SWITCHER,
235 'default' => 'yes',
236 'separator' => 'before',
237 ]
238 );
239 $this->add_control(
240 'excerpt_limit',
241 [
242 'label' => esc_html__('Text Limit', 'ultimate-store-kit'),
243 'type' => Controls_Manager::NUMBER,
244 'default' => 15,
245 'condition' => [
246 'show_excerpt' => 'yes',
247 ],
248 ]
249 );
250
251 $this->end_controls_tab();
252 $this->start_controls_tab(
253 'show_sale_badge_tab',
254 [
255 'label' => esc_html__('Badge', 'ultimate-store-kit'),
256 ]
257 );
258 $this->add_control(
259 'show_sale_badge',
260 [
261 'label' => esc_html__('Sale', 'ultimate-store-kit'),
262 'type' => Controls_Manager::SWITCHER,
263 'default' => 'yes',
264 ]
265 );
266 $this->add_control(
267 'show_discount_badge',
268 [
269 'label' => esc_html__('Percentage', 'ultimate-store-kit'),
270 'type' => Controls_Manager::SWITCHER,
271 'default' => 'yes',
272 ]
273 );
274 $this->add_control(
275 'show_stock_status',
276 [
277 'label' => esc_html__('Stock Status', 'ultimate-store-kit'),
278 'type' => Controls_Manager::SWITCHER,
279 'default' => 'yes',
280 ]
281 );
282 $this->add_control(
283 'show_trending_badge',
284 [
285 'label' => esc_html__('Trending', 'ultimate-store-kit'),
286 'type' => Controls_Manager::SWITCHER,
287 'default' => 'yes',
288 ]
289 );
290 $this->add_control(
291 'show_new_badge',
292 [
293 'label' => esc_html__('New', 'ultimate-store-kit'),
294 'type' => Controls_Manager::SWITCHER,
295 'default' => 'yes',
296 ]
297 );
298 $this->add_control(
299 'newness_days',
300 [
301 'label' => esc_html__('Newness Days', 'ultimate-store-kit'),
302 'type' => Controls_Manager::NUMBER,
303 'default' => 30,
304 'condition' => [
305 'show_new_badge' => 'yes',
306 ],
307 ]
308 );
309 $this->end_controls_tab();
310
311 $this->start_controls_tab(
312 'show_action_btn_tab',
313 [
314 'label' => esc_html__('Action btn', 'ultimate-store-kit'),
315 ]
316 );
317 $this->add_control(
318 'show_cart',
319 [
320 'label' => esc_html__('Add to Cart', 'ultimate-store-kit'),
321 'type' => Controls_Manager::SWITCHER,
322 'default' => 'yes',
323 ]
324 );
325
326 $this->add_control(
327 'show_wishlist',
328 [
329 'label' => esc_html__('Wishlist', 'ultimate-store-kit'),
330 'type' => Controls_Manager::SWITCHER,
331 'label_on' => esc_html__('Show', 'ultimate-store-kit'),
332 'label_off' => esc_html__('Hide', 'ultimate-store-kit'),
333 'return_value' => 'yes',
334 'default' => 'yes',
335 ]
336 );
337 $this->add_control(
338 'show_quick_view',
339 [
340 'label' => esc_html__('Quick View', 'ultimate-store-kit'),
341 'type' => Controls_Manager::SWITCHER,
342 'default' => 'yes',
343 ]
344 );
345
346 $this->end_controls_tab();
347 $this->end_controls_tabs();
348 $this->end_controls_section();
349
350 /**
351 * Slider settings
352 */
353 $this->start_controls_section(
354 'section_carousel_settings',
355 [
356 'label' => __('Slider Settings', 'ultimate-store-kit'),
357 ]
358 );
359
360 $this->add_control(
361 'autoplay',
362 [
363 'label' => __('Autoplay', 'ultimate-store-kit'),
364 'type' => Controls_Manager::SWITCHER,
365 'default' => 'yes',
366
367 ]
368 );
369
370 $this->add_control(
371 'autoplay_speed',
372 [
373 'label' => esc_html__('Autoplay Speed', 'ultimate-store-kit'),
374 'type' => Controls_Manager::NUMBER,
375 'default' => 5000,
376 'condition' => [
377 'autoplay' => 'yes',
378 ],
379 ]
380 );
381
382 $this->add_control(
383 'pauseonhover',
384 [
385 'label' => esc_html__('Pause on Hover', 'ultimate-store-kit'),
386 'type' => Controls_Manager::SWITCHER,
387 ]
388 );
389
390 $this->add_control(
391 'grab_cursor',
392 [
393 'label' => __('Grab Cursor', 'ultimate-store-kit'),
394 'type' => Controls_Manager::SWITCHER,
395 ]
396 );
397
398 $this->add_control(
399 'loop',
400 [
401 'label' => __('Loop', 'ultimate-store-kit'),
402 'type' => Controls_Manager::SWITCHER,
403 'default' => 'yes',
404
405 ]
406 );
407
408 $this->add_control(
409 'mousewheel',
410 [
411 'label' => __('Mousewheel', 'ultimate-store-kit'),
412 'type' => Controls_Manager::SWITCHER,
413 // 'default' => 'yes',
414
415 ]
416 );
417
418
419 $this->add_control(
420 'speed',
421 [
422 'label' => __('Animation Speed (ms)', 'ultimate-store-kit'),
423 'type' => Controls_Manager::SLIDER,
424 'default' => [
425 'size' => 800,
426 ],
427 'range' => [
428 'px' => [
429 'min' => 100,
430 'max' => 5000,
431 'step' => 50,
432 ],
433 ],
434 ]
435 );
436
437 $this->add_control(
438 'observer',
439 [
440 'label' => __('Observer', 'ultimate-store-kit'),
441 'description' => __('When you use carousel in any hidden place (in tabs, accordion etc) keep it yes.', 'ultimate-store-kit'),
442 'type' => Controls_Manager::SWITCHER,
443 ]
444 );
445
446 $this->end_controls_section();
447
448 /**
449 * Start Style Controls
450 */
451 $this->start_controls_section(
452 'section_style_items',
453 [
454 'label' => esc_html__('Slider', 'ultimate-store-kit'),
455 'tab' => Controls_Manager::TAB_STYLE,
456 ]
457 );
458
459 $this->add_group_control(
460 Group_Control_Background::get_type(),
461 [
462 'name' => 'slider_items_background',
463 'label' => esc_html__('Background', 'ultimate-store-kit'),
464 'types' => ['classic', 'gradient'],
465 'selector' => '{{WRAPPER}} .usk-mentor-slider',
466 ]
467 );
468
469 $this->add_group_control(
470 Group_Control_Border::get_type(),
471 [
472 'name' => 'slider_items_border',
473 'label' => __( 'Border', 'ultimate-store-kit' ),
474 // 'fields_options' => [
475 // 'border' => [
476 // 'default' => 'solid',
477 // ],
478 // 'width' => [
479 // 'default' => [
480 // 'top' => '1',
481 // 'right' => '1',
482 // 'bottom' => '1',
483 // 'left' => '1',
484 // 'isLinked' => false,
485 // ],
486 // ],
487 // 'color' => [
488 // 'default' => '#5bb300',
489 // ],
490 // ],
491 'selector' => '{{WRAPPER}} .usk-mentor-slider',
492 ]
493 );
494
495 $this->add_responsive_control(
496 'slider_items_radius',
497 [
498 'label' => esc_html__('Radius', 'ultimate-store-kit'),
499 'type' => Controls_Manager::DIMENSIONS,
500 'size_units' => ['px'],
501 'selectors' => [
502 '{{WRAPPER}} .usk-mentor-slider' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
503 ],
504 ]
505 );
506 $this->add_responsive_control(
507 'slider_items_padding',
508 [
509 'label' => esc_html__('Padding', 'ultimate-store-kit'),
510 'type' => Controls_Manager::DIMENSIONS,
511 'size_units' => [
512 'px', 'em', '%'
513 ],
514 'selectors' => [
515 '{{WRAPPER}} .usk-mentor-slider' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
516 ],
517 ]
518 );
519
520 $this->add_responsive_control(
521 'content_item_padding',
522 [
523 'label' => esc_html__('Content Padding', 'ultimate-store-kit'),
524 'type' => Controls_Manager::DIMENSIONS,
525 'size_units' => [
526 'px', 'em', '%'
527 ],
528 'selectors' => [
529 '{{WRAPPER}} .usk-mentor-slider .usk-inner-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
530 ],
531 ]
532 );
533
534 $this->end_controls_section();
535
536
537 $this->start_controls_section(
538 'section_style_image',
539 [
540 'label' => esc_html__('Images', 'ultimate-store-kit'),
541 'tab' => Controls_Manager::TAB_STYLE,
542 ]
543 );
544
545 $this->add_group_control(
546 Group_Control_Background::get_type(),
547 [
548 'name' => 'image_background',
549 'label' => esc_html__('Background', 'ultimate-store-kit'),
550 'types' => ['classic', 'gradient'],
551 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-image-wrap',
552 ]
553 );
554
555 $this->add_group_control(
556 Group_Control_Border::get_type(),
557 [
558 'name' => 'image_border',
559 'label' => __( 'Border', 'ultimate-store-kit' ),
560 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-image-wrap',
561 ]
562 );
563
564 $this->add_responsive_control(
565 'image_radius',
566 [
567 'label' => esc_html__('Radius', 'ultimate-store-kit'),
568 'type' => Controls_Manager::DIMENSIONS,
569 'size_units' => ['px'],
570 'selectors' => [
571 '{{WRAPPER}} .usk-mentor-slider .usk-image-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
572 ],
573 ]
574 );
575
576
577 $this->end_controls_section();
578
579 $this->start_controls_section(
580 'section_style_title',
581 [
582 'label' => esc_html__('Title', 'ultimate-store-kit'),
583 'tab' => Controls_Manager::TAB_STYLE,
584 'condition' => [
585 'show_title' => 'yes'
586 ]
587 ]
588 );
589
590 $this->add_control(
591 'title_color',
592 [
593 'label' => esc_html__('Color', 'ultimate-store-kit'),
594 'type' => Controls_Manager::COLOR,
595 'selectors' => [
596 '{{WRAPPER}} .usk-main-slider .usk-title a' => 'color: {{VALUE}}',
597 ],
598 ]
599 );
600
601 $this->add_control(
602 'hover_title_color',
603 [
604 'label' => esc_html__('Hover Color', 'ultimate-store-kit'),
605 'type' => Controls_Manager::COLOR,
606 'selectors' => [
607 '{{WRAPPER}} .usk-main-slider .usk-title a:hover' => 'color: {{VALUE}};',
608 ],
609 ]
610 );
611
612 $this->add_responsive_control(
613 'title_margin',
614 [
615 'label' => esc_html__('Margin', 'ultimate-store-kit'),
616 'type' => Controls_Manager::DIMENSIONS,
617 'size_units' => ['px', '%'],
618 'selectors' => [
619 '{{WRAPPER}} .usk-main-slider .usk-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
620 ],
621 ]
622 );
623
624 $this->add_group_control(
625 Group_Control_Typography::get_type(),
626 [
627 'name' => 'title_typography',
628 'label' => esc_html__('Typography', 'ultimate-store-kit'),
629 'selector' => '{{WRAPPER}} .usk-main-slider .usk-title',
630 ]
631 );
632
633 $this->add_group_control(
634 Group_Control_Text_Shadow::get_type(),
635 [
636 'name' => 'title_text_shadow',
637 'selector' => '{{WRAPPER}} .usk-main-slider .usk-title',
638 ]
639 );
640
641 $this->add_group_control(
642 Group_Control_Text_Stroke::get_type(),
643 [
644 'name' => 'title_text_stroke',
645 'selector' => '{{WRAPPER}} .usk-main-slider .usk-title a',
646 ]
647 );
648
649 $this->end_controls_section();
650
651 $this->start_controls_section(
652 'section_style_text',
653 [
654 'label' => esc_html__('Text', 'ultimate-store-kit'),
655 'tab' => Controls_Manager::TAB_STYLE,
656 ]
657 );
658
659 $this->add_control(
660 'text_color',
661 [
662 'label' => esc_html__('Color', 'ultimate-store-kit'),
663 'type' => Controls_Manager::COLOR,
664 'selectors' => [
665 '{{WRAPPER}} .usk-main-slider .usk-text' => 'color: {{VALUE}}',
666 ],
667 ]
668 );
669
670 $this->add_responsive_control(
671 'text_margin',
672 [
673 'label' => esc_html__('Margin', 'ultimate-store-kit'),
674 'type' => Controls_Manager::DIMENSIONS,
675 'size_units' => ['px', '%'],
676 'selectors' => [
677 '{{WRAPPER}} .usk-main-slider .usk-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
678 ],
679 ]
680 );
681
682 $this->add_group_control(
683 Group_Control_Typography::get_type(),
684 [
685 'name' => 'text_typography',
686 'label' => esc_html__('Typography', 'ultimate-store-kit'),
687 'selector' => '{{WRAPPER}} .usk-main-slider .usk-text',
688 ]
689 );
690
691
692 $this->end_controls_section();
693
694 $this->start_controls_section(
695 'section_style_price',
696 [
697 'label' => esc_html__('Price', 'ultimate-store-kit'),
698 'tab' => Controls_Manager::TAB_STYLE,
699 'condition' => [
700 'show_price' => 'yes',
701 ],
702 ]
703 );
704 $this->add_control(
705 'regular_price_color',
706 [
707 'label' => esc_html__('Regular Color', 'ultimate-store-kit'),
708 'type' => Controls_Manager::COLOR,
709 'selectors' => [
710 '{{WRAPPER}} .' . $this->get_name() . ' .usk-price del .woocommerce-Price-amount.amount' => 'color: {{VALUE}};',
711 '{{WRAPPER}} .' . $this->get_name() . ' .usk-item .usk-content .usk-price del' => 'color: {{VALUE}};',
712 ],
713
714 ]
715 );
716 $this->add_control(
717 'sale_price_color',
718 [
719 'label' => esc_html__('Sale Color', 'ultimate-store-kit'),
720 'type' => Controls_Manager::COLOR,
721 'selectors' => [
722 '{{WRAPPER}} .' . $this->get_name() . ' .usk-price' => 'color: {{VALUE}}',
723 '{{WRAPPER}} .' . $this->get_name() . ' .usk-price ins span' => 'color: {{VALUE}}',
724 '{{WRAPPER}} .' . $this->get_name() . ' .usk-price .woocommerce-Price-amount.amount' => 'color: {{VALUE}}',
725 '{{WRAPPER}} .' . $this->get_name() . ' .usk-price > .woocommerce-Price-amount.amount bdi' => 'color: {{VALUE}}',
726 ],
727 ]
728 );
729 $this->add_group_control(
730 Group_Control_Typography::get_type(),
731 [
732 'name' => 'sale_price_typography',
733 'label' => esc_html__('Typography', 'ultimate-store-kit'),
734 'selector' => '
735 {{WRAPPER}} .' . $this->get_name() . ' .usk-item .usk-price',
736 ]
737 );
738
739 $this->end_controls_section();
740
741 $this->start_controls_section(
742 'section_style_rating',
743 [
744 'label' => esc_html__('Rating', 'ultimate-store-kit'),
745 'tab' => Controls_Manager::TAB_STYLE,
746 'condition' => [
747 'show_rating' => 'yes',
748 ],
749 ]
750 );
751
752 $this->add_control(
753 'rating_color',
754 [
755 'label' => esc_html__('Color', 'ultimate-store-kit'),
756 'type' => Controls_Manager::COLOR,
757 'default' => '#e7e7e7',
758 'selectors' => [
759 '{{WRAPPER}} .' . $this->get_name() . ' .usk-rating .star-rating::before' => 'color: {{VALUE}};',
760 ],
761 ]
762 );
763
764 $this->add_control(
765 'active_rating_color',
766 [
767 'label' => esc_html__('Active Color', 'ultimate-store-kit'),
768 'type' => Controls_Manager::COLOR,
769 'default' => '#FFCC00',
770 'selectors' => [
771 '{{WRAPPER}} .' . $this->get_name() . ' .usk-rating .star-rating span::before' => 'color: {{VALUE}};',
772 ],
773 ]
774 );
775
776 $this->add_responsive_control(
777 'rating_margin',
778 [
779 'label' => esc_html__('Margin', 'ultimate-store-kit'),
780 'type' => Controls_Manager::DIMENSIONS,
781 'size_units' => ['px', '%', 'em'],
782 'selectors' => [
783 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-rating' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
784 ],
785 ]
786 );
787
788 $this->end_controls_section();
789
790 //Badge Global
791 $this->register_global_controls_badge();
792
793 $this->start_controls_section(
794 'style_action_btn',
795 [
796 'label' => esc_html__('Action Button', 'ultimate-store-kit'),
797 'tab' => Controls_Manager::TAB_STYLE,
798 ]
799 );
800
801 $this->add_control(
802 'action_button_color',
803 [
804 'label' => esc_html__('Color', 'ultimate-store-kit'),
805 'type' => Controls_Manager::COLOR,
806 'selectors' => [
807 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a i' => 'color: {{VALUE}}',
808 ],
809 ]
810 );
811
812 $this->add_control(
813 'action_button_bg',
814 [
815 'label' => esc_html__('Background', 'ultimate-store-kit'),
816 'type' => Controls_Manager::COLOR,
817 'selectors' => [
818 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a' => 'background: {{VALUE}}',
819 ],
820 ]
821 );
822 $this->add_control(
823 'heading_action_button_hover',
824 [
825 'label' => esc_html__('Hover', 'ultimate-store-kit'),
826 'type' => Controls_Manager::HEADING,
827 'separator' => 'before',
828 ]
829 );
830 $this->add_control(
831 'action_button_color_hover',
832 [
833 'label' => esc_html__('Color', 'ultimate-store-kit'),
834 'type' => Controls_Manager::COLOR,
835 'selectors' => [
836 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a:hover i' => 'color: {{VALUE}}',
837 ],
838 ]
839 );
840 $this->add_control(
841 'action_button_bg_hover',
842 [
843 'label' => esc_html__('Background', 'ultimate-store-kit'),
844 'type' => Controls_Manager::COLOR,
845 'selectors' => [
846 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a:hover' => 'background: {{VALUE}}',
847 ],
848 ]
849 );
850
851 $this->add_group_control(
852 Group_Control_Border::get_type(),
853 [
854 'name' => 'action_btn_border',
855 'label' => esc_html__('Border', 'ultimate-store-kit'),
856 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a',
857 ]
858 );
859 $this->add_responsive_control(
860 'action_btn_radius',
861 [
862 'label' => esc_html__('Radius', 'ultimate-store-kit'),
863 'type' => Controls_Manager::DIMENSIONS,
864 'size_units' => ['px', '%', 'em'],
865 'selectors' => [
866 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
867 ],
868 ]
869 );
870 $this->add_responsive_control(
871 'action_btn_padding',
872 [
873 'label' => esc_html__('Padding', 'ultimate-store-kit'),
874 'type' => Controls_Manager::DIMENSIONS,
875 'size_units' => ['px', '%', 'em'],
876 'selectors' => [
877 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
878 ],
879 ]
880 );
881 $this->add_responsive_control(
882 'action_btn_margin',
883 [
884 'label' => esc_html__('Margin', 'ultimate-store-kit'),
885 'type' => Controls_Manager::DIMENSIONS,
886 'size_units' => ['px', '%', 'em'],
887 'selectors' => [
888 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
889 ],
890 ]
891 );
892
893 $this->add_control(
894 'font_family',
895 [
896 'label' => esc_html__('Tooltip Font', 'font family'),
897 'type' => Controls_Manager::FONT,
898 'default' => "'Open Sans', sans-serif",
899 'selectors' => [
900 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a' => 'font-family: {{VALUE}}',
901 ],
902 ]
903 );
904
905 $this->add_control(
906 'action_btn_separator',
907 [
908 'label' => esc_html__('Button Separator', 'ultimate-store-kit'),
909 'show_label' => false,
910 'label_block' => false,
911 'type' => Controls_Manager::HEADING,
912 'separator' => 'before',
913 ]
914 );
915 $this->start_controls_tabs(
916 'action_btn_tabs'
917 );
918 $this->start_controls_tab(
919 'wishlist_tab',
920 [
921 'label' => esc_html__('Wishlist', 'ultimate-store-kit'),
922 'condition' => [
923 'show_wishlist' => 'yes'
924 ]
925 ]
926 );
927 $this->add_control(
928 'wishlist_normal_color',
929 [
930 'label' => esc_html__('Color', 'ultimate-store-kit'),
931 'type' => Controls_Manager::COLOR,
932 'selectors' => [
933 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-wishlist' => 'color: {{VALUE}}',
934 ],
935 ]
936 );
937 $this->add_control(
938 'wishlist_icon_bg',
939 [
940 'label' => esc_html__('Background', 'ultimate-store-kit'),
941 'type' => Controls_Manager::COLOR,
942 'selectors' => [
943 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-wishlist' => 'background: {{VALUE}}',
944 ],
945 ]
946 );
947 $this->add_control(
948 'heading_wishlist_hover',
949 [
950 'label' => esc_html__('Hover', 'ultimate-store-kit'),
951 'type' => Controls_Manager::HEADING,
952 'separator' => 'before',
953 ]
954 );
955 $this->add_control(
956 'wishlist_hover_color',
957 [
958 'label' => esc_html__('Color', 'ultimate-store-kit'),
959 'type' => Controls_Manager::COLOR,
960 'selectors' => [
961 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-wishlist:hover' => 'color: {{VALUE}}',
962 ],
963 ]
964 );
965 $this->add_control(
966 'wishlist_icon_hover_bg',
967 [
968 'label' => esc_html__('Background', 'ultimate-store-kit'),
969 'type' => Controls_Manager::COLOR,
970 'selectors' => [
971 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-wishlist:hover' => 'background: {{VALUE}}',
972 ],
973 ]
974 );
975
976 $this->end_controls_tab();
977 $this->start_controls_tab(
978 'quickview_tab',
979 [
980 'label' => esc_html__('Quickview', 'ultimate-store-kit'),
981 'condition' => [
982 'show_quick_view' => 'yes'
983 ]
984 ]
985 );
986 $this->add_control(
987 'quickview_color',
988 [
989 'label' => esc_html__('Color', 'ultimate-store-kit'),
990 'type' => Controls_Manager::COLOR,
991 'selectors' => [
992 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-view' => 'color: {{VALUE}}',
993 ],
994 ]
995 );
996 $this->add_control(
997 'quickview_icon_bg',
998 [
999 'label' => esc_html__('Background', 'ultimate-store-kit'),
1000 'type' => Controls_Manager::COLOR,
1001 'selectors' => [
1002 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-view' => 'background: {{VALUE}}',
1003 ],
1004 ]
1005 );
1006 $this->add_control(
1007 'heading_quickview_hover',
1008 [
1009 'label' => esc_html__('Hover', 'ultimate-store-kit'),
1010 'type' => Controls_Manager::HEADING,
1011 'separator' => 'before',
1012 ]
1013 );
1014 $this->add_control(
1015 'quickview_color_hover',
1016 [
1017 'label' => esc_html__('Color', 'ultimate-store-kit'),
1018 'type' => Controls_Manager::COLOR,
1019 'selectors' => [
1020 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-view:hover' => 'color: {{VALUE}}',
1021 ],
1022 ]
1023 );
1024 $this->add_control(
1025 'quickview_icon_bg_hover',
1026 [
1027 'label' => esc_html__('Background', 'ultimate-store-kit'),
1028 'type' => Controls_Manager::COLOR,
1029 'selectors' => [
1030 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-view:hover' => 'background: {{VALUE}}',
1031 ],
1032 ]
1033 );
1034 $this->end_controls_tab();
1035 if (($this->get_name() !== 'usk-shiny-grid') && ($this->get_name() !== 'usk-shiny-carousel')) {
1036 $this->start_controls_tab(
1037 'add_to_cart_tab',
1038 [
1039 'label' => esc_html__('Cart', 'ultimate-store-kit'),
1040 'condition' => [
1041 'show_cart' => 'yes'
1042 ]
1043 ]
1044 );
1045 $this->add_control(
1046 'cart_color',
1047 [
1048 'label' => esc_html__('Color', 'ultimate-store-kit'),
1049 'type' => Controls_Manager::COLOR,
1050 'selectors' => [
1051 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-cart' => 'color: {{VALUE}}',
1052 ],
1053 ]
1054 );
1055 $this->add_control(
1056 'cart_icon_bg',
1057 [
1058 'label' => esc_html__('Background', 'ultimate-store-kit'),
1059 'type' => Controls_Manager::COLOR,
1060 'selectors' => [
1061 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-cart' => 'background: {{VALUE}}',
1062 ],
1063 ]
1064 );
1065 $this->add_control(
1066 'heading_cart_hover',
1067 [
1068 'label' => esc_html__('Hover', 'ultimate-store-kit'),
1069 'type' => Controls_Manager::HEADING,
1070 'separator' => 'before',
1071 ]
1072 );
1073 $this->add_control(
1074 'cart_color_hover',
1075 [
1076 'label' => esc_html__('Color', 'ultimate-store-kit'),
1077 'type' => Controls_Manager::COLOR,
1078 'selectors' => [
1079 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-cart:hover' => 'color: {{VALUE}}',
1080 ],
1081 ]
1082 );
1083 $this->add_control(
1084 'cart_icon_bg_hover',
1085 [
1086 'label' => esc_html__('Background', 'ultimate-store-kit'),
1087 'type' => Controls_Manager::COLOR,
1088 'selectors' => [
1089 '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-cart:hover' => 'background: {{VALUE}}',
1090 ],
1091 ]
1092 );
1093 }
1094 $this->end_controls_tab();
1095 $this->end_controls_tabs();
1096 $this->end_controls_section();
1097
1098 $this->start_controls_section(
1099 'section_style_category',
1100 [
1101 'label' => esc_html__('Category', 'ultimate-store-kit'),
1102 'tab' => Controls_Manager::TAB_STYLE,
1103 'condition' => [
1104 'show_category' => 'yes',
1105 ],
1106 ]
1107 );
1108 $this->start_controls_tabs(
1109 'category_tabs'
1110 );
1111 $this->start_controls_tab(
1112 'category_tab_normal',
1113 [
1114 'label' => esc_html__('Normal', 'ultimate-store-kit'),
1115 ]
1116 );
1117 $this->add_control(
1118 'category_color',
1119 [
1120 'label' => esc_html__('Color', 'ultimate-store-kit'),
1121 'type' => Controls_Manager::COLOR,
1122 'selectors' => [
1123 '{{WRAPPER}} .usk-mentor-slider .usk-category a' => 'color: {{VALUE}};',
1124 ],
1125 ]
1126 );
1127 $this->add_group_control(
1128 Group_Control_Background::get_type(),
1129 [
1130 'name' => 'category_bg_color',
1131 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-category a',
1132 ]
1133 );
1134 $this->add_group_control(
1135 Group_Control_Border::get_type(),
1136 [
1137 'name' => 'category_border',
1138 'label' => __('Border', 'elementor'),
1139 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-category a',
1140 'separator' => 'before'
1141 ]
1142 );
1143 $this->add_responsive_control(
1144 'category_radius',
1145 [
1146 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
1147 'type' => Controls_Manager::DIMENSIONS,
1148 'size_units' => ['px', '%', 'em'],
1149 'selectors' => [
1150 '{{WRAPPER}} .usk-mentor-slider .usk-category a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1151 ],
1152 ]
1153 );
1154 $this->add_responsive_control(
1155 'category_padding',
1156 [
1157 'label' => esc_html__('Padding', 'ultimate-store-kit'),
1158 'type' => Controls_Manager::DIMENSIONS,
1159 'size_units' => ['px', '%'],
1160 'selectors' => [
1161 '{{WRAPPER}} .usk-mentor-slider .usk-category a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1162 ],
1163 ]
1164 );
1165 $this->add_responsive_control(
1166 'category_margin',
1167 [
1168 'label' => esc_html__('Margin', 'ultimate-store-kit'),
1169 'type' => Controls_Manager::DIMENSIONS,
1170 'size_units' => ['px', '%'],
1171 'selectors' => [
1172 '{{WRAPPER}} .usk-mentor-slider .usk-category' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1173 ],
1174 ]
1175 );
1176
1177 $this->add_responsive_control(
1178 'category_space_between',
1179 [
1180 'label' => esc_html__('Space Between', 'ultimate-store-kit'),
1181 'type' => Controls_Manager::SLIDER,
1182 'size_units' => ['px', 'em', '%'],
1183 'selectors' => [
1184 '{{WRAPPER}} .usk-mentor-slider .usk-category' => 'gap: {{SIZE}}{{UNIT}};',
1185 ],
1186 ]
1187 );
1188 $this->add_group_control(
1189 Group_Control_Typography::get_type(),
1190 [
1191 'name' => 'category_typography',
1192 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1193 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-category a',
1194 ]
1195 );
1196 $this->add_group_control(
1197 Group_Control_Box_Shadow::get_type(),
1198 [
1199 'name' => 'category_shadow',
1200 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-category a',
1201 ]
1202 );
1203 $this->end_controls_tab();
1204 $this->start_controls_tab(
1205 'category_tab_hover',
1206 [
1207 'label' => esc_html__('Hover', 'ultimate-store-kit'),
1208 ]
1209 );
1210 $this->add_control(
1211 'hover_category_color',
1212 [
1213 'label' => esc_html__('Color', 'ultimate-store-kit'),
1214 'type' => Controls_Manager::COLOR,
1215 'selectors' => [
1216 '{{WRAPPER}} .usk-mentor-slider .usk-category a:hover' => 'color: {{VALUE}};',
1217 ],
1218 ]
1219 );
1220 $this->add_group_control(
1221 Group_Control_Background::get_type(),
1222 [
1223 'name' => 'hover_category_bg_color',
1224 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-category a:hover',
1225 ]
1226 );
1227 $this->add_control(
1228 'hover_category_border_color',
1229 [
1230 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1231 'type' => Controls_Manager::COLOR,
1232 'selectors' => [
1233 '{{WRAPPER}} .usk-mentor-slider .usk-category a:hover' => 'border-color: {{VALUE}};',
1234 ],
1235 'condition' => [
1236 'category_border_border!' => ''
1237 ],
1238 'separator' => 'before'
1239 ]
1240 );
1241 $this->end_controls_tab();
1242 $this->end_controls_tabs();
1243 $this->end_controls_section();
1244
1245 $this->start_controls_section(
1246 'section_style_navigation',
1247 [
1248 'label' => __('Navigation', 'ultimate-store-kit'),
1249 'tab' => Controls_Manager::TAB_STYLE,
1250 'condition' => [
1251 'show_arrows' => 'yes'
1252 ],
1253 ]
1254 );
1255
1256 $this->add_control(
1257 'nav_arrows_icon',
1258 [
1259 'label' => esc_html__('Arrows Icon', 'ultimate-store-kit'),
1260 'type' => Controls_Manager::SELECT,
1261 'default' => '0',
1262 'options' => [
1263 '0' => esc_html__('Default', 'ultimate-store-kit'),
1264 '1' => esc_html__('Style 1', 'ultimate-store-kit'),
1265 '2' => esc_html__('Style 2', 'ultimate-store-kit'),
1266 '3' => esc_html__('Style 3', 'ultimate-store-kit'),
1267 '4' => esc_html__('Style 4', 'ultimate-store-kit'),
1268 '5' => esc_html__('Style 5', 'ultimate-store-kit'),
1269 '6' => esc_html__('Style 6', 'ultimate-store-kit'),
1270 '7' => esc_html__('Style 7', 'ultimate-store-kit'),
1271 '8' => esc_html__('Style 8', 'ultimate-store-kit'),
1272 '9' => esc_html__('Style 9', 'ultimate-store-kit'),
1273 '10' => esc_html__('Style 10', 'ultimate-store-kit'),
1274 '11' => esc_html__('Style 11', 'ultimate-store-kit'),
1275 '12' => esc_html__('Style 12', 'ultimate-store-kit'),
1276 '13' => esc_html__('Style 13', 'ultimate-store-kit'),
1277 '14' => esc_html__('Style 14', 'ultimate-store-kit'),
1278 '15' => esc_html__('Style 15', 'ultimate-store-kit'),
1279 '16' => esc_html__('Style 16', 'ultimate-store-kit'),
1280 '17' => esc_html__('Style 17', 'ultimate-store-kit'),
1281 '18' => esc_html__('Style 18', 'ultimate-store-kit'),
1282 'circle-1' => esc_html__('Style 19', 'ultimate-store-kit'),
1283 'circle-2' => esc_html__('Style 20', 'ultimate-store-kit'),
1284 'circle-3' => esc_html__('Style 21', 'ultimate-store-kit'),
1285 'circle-4' => esc_html__('Style 22', 'ultimate-store-kit'),
1286 'square-1' => esc_html__('Style 23', 'ultimate-store-kit'),
1287 ],
1288 ]
1289 );
1290
1291 $this->start_controls_tabs('tabs_navigation_arrows_style');
1292
1293 $this->start_controls_tab(
1294 'tabs_nav_arrows_normal',
1295 [
1296 'label' => __('Normal', 'ultimate-store-kit'),
1297 ]
1298 );
1299
1300 $this->add_control(
1301 'arrows_color',
1302 [
1303 'label' => __('Color', 'ultimate-store-kit'),
1304 'type' => Controls_Manager::COLOR,
1305 'selectors' => [
1306 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn' => 'color: {{VALUE}}',
1307 ],
1308 ]
1309 );
1310
1311 $this->add_control(
1312 'arrows_background',
1313 [
1314 'label' => __('Background', 'ultimate-store-kit'),
1315 'type' => Controls_Manager::COLOR,
1316 'selectors' => [
1317 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn' => 'background-color: {{VALUE}}',
1318 ],
1319 ]
1320 );
1321
1322 $this->add_group_control(
1323 Group_Control_Border::get_type(),
1324 [
1325 'name' => 'nav_arrows_border',
1326 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn',
1327 ]
1328 );
1329
1330 $this->add_responsive_control(
1331 'border_radius',
1332 [
1333 'label' => __('Border Radius', 'ultimate-store-kit'),
1334 'type' => Controls_Manager::DIMENSIONS,
1335 'size_units' => ['px', '%'],
1336 'selectors' => [
1337 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1338 ],
1339 ]
1340 );
1341
1342 $this->add_responsive_control(
1343 'arrows_padding',
1344 [
1345 'label' => esc_html__('Padding', 'ultimate-store-kit'),
1346 'type' => Controls_Manager::DIMENSIONS,
1347 'size_units' => ['px', 'em', '%'],
1348 'selectors' => [
1349 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1350 ],
1351 ]
1352 );
1353
1354 $this->add_responsive_control(
1355 'arrows_margin',
1356 [
1357 'label' => esc_html__('Margin', 'ultimate-store-kit'),
1358 'type' => Controls_Manager::DIMENSIONS,
1359 'size_units' => ['px', 'em', '%'],
1360 'selectors' => [
1361 '{{WRAPPER}} .usk-mentor-slider .usk-navigation-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1362 ],
1363 ]
1364 );
1365
1366 $this->add_group_control(
1367 Group_Control_Typography::get_type(),
1368 [
1369 'name' => 'navigation_typography',
1370 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1371 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn',
1372 ]
1373 );
1374
1375 $this->add_responsive_control(
1376 'arrows_space',
1377 [
1378 'label' => __('Space Between Arrows', 'ultimate-store-kit'),
1379 'type' => Controls_Manager::SLIDER,
1380 'range' => [
1381 'px' => [
1382 'min' => 0,
1383 'max' => 100,
1384 ],
1385 ],
1386 'selectors' => [
1387 '{{WRAPPER}} .usk-mentor-slider .usk-navigation-button' => 'grid-column-gap: {{SIZE}}px;',
1388 ],
1389 ]
1390 );
1391
1392 $this->end_controls_tab();
1393
1394 $this->start_controls_tab(
1395 'tabs_nav_arrows_hover',
1396 [
1397 'label' => __('Hover', 'ultimate-store-kit'),
1398 ]
1399 );
1400
1401 $this->add_control(
1402 'arrows_hover_color',
1403 [
1404 'label' => __('Color', 'ultimate-store-kit'),
1405 'type' => Controls_Manager::COLOR,
1406 'selectors' => [
1407 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn:hover' => 'color: {{VALUE}}',
1408 ],
1409 ]
1410 );
1411
1412 $this->add_control(
1413 'arrows_hover_background',
1414 [
1415 'label' => __('Background', 'ultimate-store-kit'),
1416 'type' => Controls_Manager::COLOR,
1417 'selectors' => [
1418 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn:hover' => 'background-color: {{VALUE}}',
1419 ],
1420 ]
1421 );
1422
1423 $this->add_control(
1424 'nav_arrows_hover_border_color',
1425 [
1426 'label' => __('Border Color', 'ultimate-store-kit'),
1427 'type' => Controls_Manager::COLOR,
1428 'selectors' => [
1429 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn:hover' => 'border-color: {{VALUE}};',
1430 ],
1431 ]
1432 );
1433
1434 $this->end_controls_tab();
1435
1436 $this->end_controls_tabs();
1437
1438 $this->end_controls_section();
1439
1440 $this->start_controls_section(
1441 'section_style_pagination',
1442 [
1443 'label' => __('Pagination', 'ultimate-store-kit'),
1444 'tab' => Controls_Manager::TAB_STYLE,
1445 'condition' => [
1446 'show_pagination' => 'yes'
1447 ],
1448 ]
1449 );
1450
1451 $this->add_control(
1452 'pagination_color',
1453 [
1454 'label' => __('Color', 'ultimate-store-kit'),
1455 'type' => Controls_Manager::COLOR,
1456 'selectors' => [
1457 '{{WRAPPER}} .usk-mentor-slider .swiper-pagination-fraction' => 'color: {{VALUE}}',
1458 ],
1459 ]
1460 );
1461
1462 $this->add_control(
1463 'pagination_active_color',
1464 [
1465 'label' => __('Active Color', 'ultimate-store-kit'),
1466 'type' => Controls_Manager::COLOR,
1467 'selectors' => [
1468 '{{WRAPPER}} .usk-mentor-slider .swiper-pagination-current' => 'color: {{VALUE}}',
1469 ],
1470 ]
1471 );
1472
1473 $this->add_group_control(
1474 Group_Control_Typography::get_type(),
1475 [
1476 'name' => 'pagination_typography',
1477 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1478 'selector' => '{{WRAPPER}} .usk-mentor-slider .swiper-pagination',
1479 ]
1480 );
1481
1482 $this->end_controls_section();
1483
1484 $this->start_controls_section(
1485 'section_style_thumbs_slide',
1486 [
1487 'label' => esc_html__('Thumbs', 'ultimate-store-kit'),
1488 'tab' => Controls_Manager::TAB_STYLE,
1489 ]
1490 );
1491
1492 $this->add_group_control(
1493 Group_Control_Background::get_type(),
1494 [
1495 'name' => 'thumbs_background',
1496 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-thumbs-slider-wrap .usk-image-wrap',
1497 ]
1498 );
1499
1500 $this->add_group_control(
1501 Group_Control_Border::get_type(),
1502 [
1503 'name' => 'thumbs_items_border',
1504 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1505 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-thumbs-slider-wrap .usk-image-wrap',
1506 'separator' => 'before'
1507 ]
1508 );
1509
1510 $this->add_responsive_control(
1511 'thumbs_items_radius',
1512 [
1513 'label' => esc_html__('Radius', 'ultimate-store-kit'),
1514 'type' => Controls_Manager::DIMENSIONS,
1515 'size_units' => ['px'],
1516 'selectors' => [
1517 '{{WRAPPER}} .usk-mentor-slider .usk-thumbs-slider-wrap .usk-image-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
1518 ],
1519 ]
1520 );
1521
1522 $this->add_control(
1523 'thumbs_hover_heading',
1524 [
1525 'label' => esc_html__( 'Hover', 'plugin-name' ),
1526 'type' => Controls_Manager::HEADING,
1527 'separator' => 'before',
1528 ]
1529 );
1530
1531 $this->add_control(
1532 'thumbs_items_hover_border_color',
1533 [
1534 'label' => __('Border Color', 'ultimate-store-kit'),
1535 'type' => Controls_Manager::COLOR,
1536 'selectors' => [
1537 '{{WRAPPER}} .usk-mentor-slider .usk-thumbs-slider-wrap .usk-item:hover .usk-image-wrap' => 'border-color: {{VALUE}};',
1538 ],
1539 ]
1540 );
1541
1542 $this->end_controls_section();
1543
1544 }
1545
1546 public function render_image() {
1547 global $product;
1548 $settings = $this->get_settings_for_display();
1549 $product_image = wp_get_attachment_image_url(get_post_thumbnail_id(), $settings['image_size']);
1550 ?>
1551 <div class="usk-image-wrap">
1552 <img class="usk-img" src="<?php echo esc_url($product_image); ?>" alt="<?php echo esc_html(get_the_title()); ?>">
1553 </div>
1554 <?php
1555 }
1556
1557 function render_slider_header() {
1558 $settings = $this->get_settings_for_display();
1559 $this->add_render_attribute('slider', 'class', ['usk-mentor-slider']);
1560 $id = 'ultimate-store-kit-' . $this->get_id();
1561
1562 $this->add_render_attribute('slider', 'id', $id);
1563
1564 $this->add_render_attribute(
1565 [
1566 'slider' => [
1567 'data-settings' => [
1568 wp_json_encode(array_filter([
1569 "autoplay" => ("yes" == $settings["autoplay"]) ? ["delay" => $settings["autoplay_speed"]] : false,
1570 "parallax" => true,
1571 "speed" => $settings["speed"]["size"],
1572 "pauseOnHover" => ("yes" == $settings["pauseonhover"]) ? true : false,
1573 "grabCursor" => ($settings["grab_cursor"] === "yes") ? true : false,
1574 "effect" => 'fade',
1575 "fadeEffect" => ['crossFade' => true],
1576 "lazy" => true,
1577 "mousewheel" => ($settings["mousewheel"]) ? true : false,
1578 "observer" => ($settings["observer"]) ? true : false,
1579 "observeParents" => ($settings["observer"]) ? true : false,
1580 "slidesPerView" => 1,
1581 "loop" => ($settings["loop"] == "yes") ? true : false,
1582 "loopedSlides" => 4,
1583 "navigation" => [
1584 "nextEl" => "#" . $id . " .usk-button-next",
1585 "prevEl" => "#" . $id . " .usk-button-prev",
1586 ],
1587 "pagination" => [
1588 "el" => "#" . $id . " .swiper-pagination",
1589 "type" => "fraction",
1590 ],
1591 "lazy" => [
1592 "loadPrevNext" => "true",
1593 ],
1594
1595 ]))
1596 ]
1597 ]
1598 ]
1599 );
1600 ?>
1601 <div class="ultimate-store-kit">
1602 <div <?php $this->print_render_attribute_string('slider'); ?>>
1603 <div class="swiper usk-main-slider">
1604 <div class="swiper-wrapper">
1605 <?php
1606 }
1607
1608 public function render_slider_footer() {
1609 $settings = $this->get_settings_for_display();
1610 ?>
1611 </div>
1612 </div>
1613
1614 <!-- thumbsslider -->
1615 <div class="usk-thumbs-slider-wrap">
1616 <div thumbsSlider="" class="usk-thumbs-slider swiper">
1617 <div class="swiper-wrapper">
1618 <?php $this->render_thumbs_item(); ?>
1619 </div>
1620 </div>
1621
1622 <!-- Navigation & Pagination Html -->
1623 <?php if ($settings['show_arrows'] or $settings['show_pagination']) : ?>
1624 <div class="usk-nav-pag-wrap">
1625 <?php if ($settings['show_pagination']) : ?>
1626 <div class="swiper-pagination"></div>
1627 <?php endif; ?>
1628
1629 <?php if ($settings['show_arrows']) : ?>
1630 <div class="usk-navigation-button">
1631 <div class="usk-button-next usk-nav-btn">
1632 <div class="usk-nav-text" data-title="Next">
1633 <span><?php echo esc_html_x('next', 'Fronend', 'ultimate-store-kit') ?></span>
1634 </div>
1635 <i class="usk-icon-arrow-right-<?php echo esc_html($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
1636 </div>
1637 <div class="usk-button-prev usk-nav-btn">
1638 <i class="usk-icon-arrow-left-<?php echo esc_html($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
1639 <div class="usk-nav-text" data-title="Prev">
1640 <span><?php echo esc_html_x('prev', 'Fronend', 'ultimate-store-kit') ?></span>
1641 </div>
1642 </div>
1643 </div>
1644 <?php endif; ?>
1645 </div>
1646 <?php endif; ?>
1647
1648 </div>
1649 <!-- thumbsslider -->
1650 </div>
1651 </div>
1652 <?php
1653 }
1654
1655 public function print_price_output($output) {
1656 $tags = [
1657 'del' => ['aria-hidden' => []],
1658 'span' => ['class' => []],
1659 'bdi' => [],
1660 'ins' => [],
1661 ];
1662
1663 if (isset($output)) {
1664 echo wp_kses($output, $tags);
1665 }
1666 }
1667
1668 public function render_loop_item() {
1669 $settings = $this->get_settings_for_display();
1670 $id = 'usk-wc-product-' . $this->get_id();
1671 $modal_id = wp_unique_id('modal-id-');
1672
1673 $this->query_product();
1674 $wp_query = $this->get_query();
1675 if ($wp_query->have_posts()) { ?>
1676 <?php while ($wp_query->have_posts()) : $wp_query->the_post();
1677 global $product;
1678 $tooltip_position = 'right';
1679
1680 $rating_count = $product->get_rating_count();
1681 $average = $product->get_average_rating();
1682 if ($settings['show_rating'] == 'yes') {
1683 $this->add_render_attribute('usk-item', 'class', ['usk-item swiper-slide', 'usk-have-rating'], true);
1684 } else {
1685 $this->add_render_attribute('usk-item', 'class', ['usk-item swiper-slide'], true);
1686 }
1687
1688 ?>
1689 <div <?php $this->print_render_attribute_string('usk-item'); ?>>
1690 <?php $this->render_image(); ?>
1691
1692 <div class="usk-badge-label-wrapper">
1693 <div class="usk-badge-label-content usk-flex">
1694 <?php $this->register_global_template_badge_label(); ?>
1695 </div>
1696 </div>
1697
1698 <div class="usk-content">
1699 <div class="usk-inner-content">
1700
1701 <?php if ('yes' == $settings['show_category']) : ?>
1702 <?php printf('<div class="usk-category" data-swiper-parallax-X="-50">%1$s</div>', wp_kses_post(wc_get_product_category_list($product->get_id(), ' '))); ?>
1703 <?php endif; ?>
1704
1705 <?php if ('yes' == $settings['show_title']) :
1706 printf('<%1$s class="usk-title" data-swiper-parallax-X="-100"><a href="%2$s">%3$s</a></%1$s>', esc_attr($settings['title_tags']), esc_url($product->get_permalink()), esc_html($product->get_title()));
1707 endif; ?>
1708
1709 <?php if ('yes' == $settings['show_excerpt']) : ?>
1710 <div class="usk-text" data-swiper-parallax-X="-150">
1711 <?php echo wp_kses_post(wp_trim_words($product->get_short_description(), $settings['excerpt_limit'], '...')); ?>
1712 </div>
1713 <?php endif; ?>
1714
1715 <?php if (('yes' == $settings['show_price'])) : ?>
1716 <div class="usk-price" data-swiper-parallax-X="-200">
1717 <?php
1718 $this->print_price_output($product->get_price_html());
1719 ?>
1720 </div>
1721 <?php endif; ?>
1722
1723 <?php if ('yes' == $settings['show_rating']) : ?>
1724 <div class="usk-rating" data-swiper-parallax-X="-250">
1725 <span><?php echo wp_kses_post($this->register_global_template_wc_rating($average, $rating_count)); ?></span>
1726 </div>
1727 <?php endif; ?>
1728
1729 </div>
1730 </div>
1731 <div class="usk-action-btn-wrap">
1732 <div>
1733 <?php $this->register_global_template_add_to_cart($tooltip_position); ?>
1734 </div>
1735 <div>
1736 <?php $this->register_global_template_quick_view($product->get_id(), $tooltip_position); ?>
1737 </div>
1738 <div>
1739 <?php $this->register_global_template_add_to_wishlist($tooltip_position); ?>
1740 </div>
1741 </div>
1742 </div>
1743
1744 <?php endwhile;
1745 wp_reset_postdata();
1746 } else {
1747 echo '<div class="usk-alert-warning" usk-alert>' . esc_html__('Ops! There no product to display.', 'ultimate-store-kit') . '</div>';
1748 }
1749 }
1750
1751 public function render_thumbs_item() {
1752 $settings = $this->get_settings_for_display();
1753 $this->query_product();
1754 $wp_query = $this->get_query();
1755 if ($wp_query->have_posts()) { ?>
1756 <?php while ($wp_query->have_posts()) : $wp_query->the_post();
1757 global $product;
1758
1759 ?>
1760 <div class="swiper-slide usk-item">
1761 <?php $this->render_image(); ?>
1762 </div>
1763 <?php endwhile;
1764 wp_reset_postdata();
1765 } else {
1766 echo '<div class="usk-alert-warning" usk-alert>' . esc_html__('Ops! There no product to display.', 'ultimate-store-kit') . '</div>';
1767 }
1768 }
1769
1770 public function render() {
1771 $this->render_slider_header();
1772 $this->render_loop_item();
1773 $this->render_slider_footer();
1774 }
1775 public function query_product() {
1776 $default = $this->getGroupControlQueryArgs();
1777 $this->_query = new WP_Query($default);
1778 }
1779 }
1780