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

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

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