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

1,767 lines 63.4 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', 'bdthemes-element-pack'),
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-post-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-post-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 $this->add_group_control(
1180 Group_Control_Typography::get_type(),
1181 [
1182 'name' => 'category_typography',
1183 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1184 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-category a',
1185 ]
1186 );
1187 $this->add_group_control(
1188 Group_Control_Box_Shadow::get_type(),
1189 [
1190 'name' => 'category_shadow',
1191 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-category a',
1192 ]
1193 );
1194 $this->end_controls_tab();
1195 $this->start_controls_tab(
1196 'category_tab_hover',
1197 [
1198 'label' => esc_html__('Hover', 'ultimate-store-kit'),
1199 ]
1200 );
1201 $this->add_control(
1202 'hover_category_color',
1203 [
1204 'label' => esc_html__('Color', 'ultimate-store-kit'),
1205 'type' => Controls_Manager::COLOR,
1206 'selectors' => [
1207 '{{WRAPPER}} .usk-mentor-slider .usk-category a:hover' => 'color: {{VALUE}};',
1208 ],
1209 ]
1210 );
1211 $this->add_group_control(
1212 Group_Control_Background::get_type(),
1213 [
1214 'name' => 'hover_category_bg_color',
1215 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-category a:hover',
1216 ]
1217 );
1218 $this->add_control(
1219 'hover_category_border_color',
1220 [
1221 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1222 'type' => Controls_Manager::COLOR,
1223 'selectors' => [
1224 '{{WRAPPER}} .usk-mentor-slider .usk-category a:hover' => 'border-color: {{VALUE}};',
1225 ],
1226 'condition' => [
1227 'category_border_border!' => ''
1228 ],
1229 'separator' => 'before'
1230 ]
1231 );
1232 $this->end_controls_tab();
1233 $this->end_controls_tabs();
1234 $this->end_controls_section();
1235
1236 $this->start_controls_section(
1237 'section_style_navigation',
1238 [
1239 'label' => __('Navigation', 'ultimate-store-kit'),
1240 'tab' => Controls_Manager::TAB_STYLE,
1241 'condition' => [
1242 'show_arrows' => 'yes'
1243 ],
1244 ]
1245 );
1246
1247 $this->add_control(
1248 'nav_arrows_icon',
1249 [
1250 'label' => esc_html__('Arrows Icon', 'ultimate-store-kit'),
1251 'type' => Controls_Manager::SELECT,
1252 'default' => '0',
1253 'options' => [
1254 '0' => esc_html__('Default', 'ultimate-store-kit'),
1255 '1' => esc_html__('Style 1', 'ultimate-store-kit'),
1256 '2' => esc_html__('Style 2', 'ultimate-store-kit'),
1257 '3' => esc_html__('Style 3', 'ultimate-store-kit'),
1258 '4' => esc_html__('Style 4', 'ultimate-store-kit'),
1259 '5' => esc_html__('Style 5', 'ultimate-store-kit'),
1260 '6' => esc_html__('Style 6', 'ultimate-store-kit'),
1261 '7' => esc_html__('Style 7', 'ultimate-store-kit'),
1262 '8' => esc_html__('Style 8', 'ultimate-store-kit'),
1263 '9' => esc_html__('Style 9', 'ultimate-store-kit'),
1264 '10' => esc_html__('Style 10', 'ultimate-store-kit'),
1265 '11' => esc_html__('Style 11', 'ultimate-store-kit'),
1266 '12' => esc_html__('Style 12', 'ultimate-store-kit'),
1267 '13' => esc_html__('Style 13', 'ultimate-store-kit'),
1268 '14' => esc_html__('Style 14', 'ultimate-store-kit'),
1269 '15' => esc_html__('Style 15', 'ultimate-store-kit'),
1270 '16' => esc_html__('Style 16', 'ultimate-store-kit'),
1271 '17' => esc_html__('Style 17', 'ultimate-store-kit'),
1272 '18' => esc_html__('Style 18', 'ultimate-store-kit'),
1273 'circle-1' => esc_html__('Style 19', 'ultimate-store-kit'),
1274 'circle-2' => esc_html__('Style 20', 'ultimate-store-kit'),
1275 'circle-3' => esc_html__('Style 21', 'ultimate-store-kit'),
1276 'circle-4' => esc_html__('Style 22', 'ultimate-store-kit'),
1277 'square-1' => esc_html__('Style 23', 'ultimate-store-kit'),
1278 ],
1279 ]
1280 );
1281
1282 $this->start_controls_tabs('tabs_navigation_arrows_style');
1283
1284 $this->start_controls_tab(
1285 'tabs_nav_arrows_normal',
1286 [
1287 'label' => __('Normal', 'ultimate-store-kit'),
1288 ]
1289 );
1290
1291 $this->add_control(
1292 'arrows_color',
1293 [
1294 'label' => __('Color', 'ultimate-store-kit'),
1295 'type' => Controls_Manager::COLOR,
1296 'selectors' => [
1297 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn' => 'color: {{VALUE}}',
1298 ],
1299 ]
1300 );
1301
1302 $this->add_control(
1303 'arrows_background',
1304 [
1305 'label' => __('Background', 'ultimate-store-kit'),
1306 'type' => Controls_Manager::COLOR,
1307 'selectors' => [
1308 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn' => 'background-color: {{VALUE}}',
1309 ],
1310 ]
1311 );
1312
1313 $this->add_group_control(
1314 Group_Control_Border::get_type(),
1315 [
1316 'name' => 'nav_arrows_border',
1317 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn',
1318 ]
1319 );
1320
1321 $this->add_responsive_control(
1322 'border_radius',
1323 [
1324 'label' => __('Border Radius', 'ultimate-store-kit'),
1325 'type' => Controls_Manager::DIMENSIONS,
1326 'size_units' => ['px', '%'],
1327 'selectors' => [
1328 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1329 ],
1330 ]
1331 );
1332
1333 $this->add_responsive_control(
1334 'arrows_padding',
1335 [
1336 'label' => esc_html__('Padding', 'ultimate-store-kit'),
1337 'type' => Controls_Manager::DIMENSIONS,
1338 'size_units' => ['px', 'em', '%'],
1339 'selectors' => [
1340 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1341 ],
1342 ]
1343 );
1344
1345 $this->add_responsive_control(
1346 'arrows_margin',
1347 [
1348 'label' => esc_html__('Margin', 'ultimate-store-kit'),
1349 'type' => Controls_Manager::DIMENSIONS,
1350 'size_units' => ['px', 'em', '%'],
1351 'selectors' => [
1352 '{{WRAPPER}} .usk-mentor-slider .usk-navigation-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1353 ],
1354 ]
1355 );
1356
1357 $this->add_group_control(
1358 Group_Control_Typography::get_type(),
1359 [
1360 'name' => 'navigation_typography',
1361 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1362 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn',
1363 ]
1364 );
1365
1366 $this->add_responsive_control(
1367 'arrows_space',
1368 [
1369 'label' => __('Space Between Arrows', 'ultimate-store-kit'),
1370 'type' => Controls_Manager::SLIDER,
1371 'range' => [
1372 'px' => [
1373 'min' => 0,
1374 'max' => 100,
1375 ],
1376 ],
1377 'selectors' => [
1378 '{{WRAPPER}} .usk-mentor-slider .usk-navigation-button' => 'grid-column-gap: {{SIZE}}px;',
1379 ],
1380 ]
1381 );
1382
1383 $this->end_controls_tab();
1384
1385 $this->start_controls_tab(
1386 'tabs_nav_arrows_hover',
1387 [
1388 'label' => __('Hover', 'ultimate-store-kit'),
1389 ]
1390 );
1391
1392 $this->add_control(
1393 'arrows_hover_color',
1394 [
1395 'label' => __('Color', 'ultimate-store-kit'),
1396 'type' => Controls_Manager::COLOR,
1397 'selectors' => [
1398 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn:hover' => 'color: {{VALUE}}',
1399 ],
1400 ]
1401 );
1402
1403 $this->add_control(
1404 'arrows_hover_background',
1405 [
1406 'label' => __('Background', 'ultimate-store-kit'),
1407 'type' => Controls_Manager::COLOR,
1408 'selectors' => [
1409 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn:hover' => 'background-color: {{VALUE}}',
1410 ],
1411 ]
1412 );
1413
1414 $this->add_control(
1415 'nav_arrows_hover_border_color',
1416 [
1417 'label' => __('Border Color', 'ultimate-store-kit'),
1418 'type' => Controls_Manager::COLOR,
1419 'selectors' => [
1420 '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn:hover' => 'border-color: {{VALUE}};',
1421 ],
1422 ]
1423 );
1424
1425 $this->end_controls_tab();
1426
1427 $this->end_controls_tabs();
1428
1429 $this->end_controls_section();
1430
1431 $this->start_controls_section(
1432 'section_style_pagination',
1433 [
1434 'label' => __('Pagination', 'ultimate-store-kit'),
1435 'tab' => Controls_Manager::TAB_STYLE,
1436 'condition' => [
1437 'show_pagination' => 'yes'
1438 ],
1439 ]
1440 );
1441
1442 $this->add_control(
1443 'pagination_color',
1444 [
1445 'label' => __('Color', 'ultimate-store-kit'),
1446 'type' => Controls_Manager::COLOR,
1447 'selectors' => [
1448 '{{WRAPPER}} .usk-mentor-slider .swiper-pagination-fraction' => 'color: {{VALUE}}',
1449 ],
1450 ]
1451 );
1452
1453 $this->add_control(
1454 'pagination_active_color',
1455 [
1456 'label' => __('Active Color', 'ultimate-store-kit'),
1457 'type' => Controls_Manager::COLOR,
1458 'selectors' => [
1459 '{{WRAPPER}} .usk-mentor-slider .swiper-pagination-current' => 'color: {{VALUE}}',
1460 ],
1461 ]
1462 );
1463
1464 $this->add_group_control(
1465 Group_Control_Typography::get_type(),
1466 [
1467 'name' => 'pagination_typography',
1468 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1469 'selector' => '{{WRAPPER}} .usk-mentor-slider .swiper-pagination',
1470 ]
1471 );
1472
1473 $this->end_controls_section();
1474
1475 $this->start_controls_section(
1476 'section_style_thumbs_slide',
1477 [
1478 'label' => esc_html__('Thumbs', 'ultimate-store-kit'),
1479 'tab' => Controls_Manager::TAB_STYLE,
1480 ]
1481 );
1482
1483 $this->add_group_control(
1484 Group_Control_Background::get_type(),
1485 [
1486 'name' => 'thumbs_background',
1487 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-thumbs-slider-wrap .usk-image-wrap',
1488 ]
1489 );
1490
1491 $this->add_group_control(
1492 Group_Control_Border::get_type(),
1493 [
1494 'name' => 'thumbs_items_border',
1495 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1496 'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-thumbs-slider-wrap .usk-image-wrap',
1497 'separator' => 'before'
1498 ]
1499 );
1500
1501 $this->add_responsive_control(
1502 'thumbs_items_radius',
1503 [
1504 'label' => esc_html__('Radius', 'ultimate-store-kit'),
1505 'type' => Controls_Manager::DIMENSIONS,
1506 'size_units' => ['px'],
1507 'selectors' => [
1508 '{{WRAPPER}} .usk-mentor-slider .usk-thumbs-slider-wrap .usk-image-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
1509 ],
1510 ]
1511 );
1512
1513 $this->add_control(
1514 'thumbs_hover_heading',
1515 [
1516 'label' => esc_html__( 'Hover', 'plugin-name' ),
1517 'type' => Controls_Manager::HEADING,
1518 'separator' => 'before',
1519 ]
1520 );
1521
1522 $this->add_control(
1523 'thumbs_items_hover_border_color',
1524 [
1525 'label' => __('Border Color', 'ultimate-store-kit'),
1526 'type' => Controls_Manager::COLOR,
1527 'selectors' => [
1528 '{{WRAPPER}} .usk-mentor-slider .usk-thumbs-slider-wrap .usk-item:hover .usk-image-wrap' => 'border-color: {{VALUE}};',
1529 ],
1530 ]
1531 );
1532
1533 $this->end_controls_section();
1534
1535 }
1536
1537 public function render_image() {
1538 global $product;
1539 $settings = $this->get_settings_for_display();
1540 $product_image = wp_get_attachment_image_url(get_post_thumbnail_id(), $settings['image_size']);
1541 ?>
1542 <div class="usk-image-wrap">
1543 <img class="usk-img" src="<?php echo esc_url($product_image); ?>" alt="<?php echo esc_html(get_the_title()); ?>">
1544 </div>
1545 <?php
1546 }
1547
1548 function render_slider_header() {
1549 $settings = $this->get_settings_for_display();
1550 $this->add_render_attribute('slider', 'class', ['usk-mentor-slider']);
1551 $id = 'ultimate-store-kit-' . $this->get_id();
1552
1553 $this->add_render_attribute('slider', 'id', $id);
1554
1555 $this->add_render_attribute(
1556 [
1557 'slider' => [
1558 'data-settings' => [
1559 wp_json_encode(array_filter([
1560 "autoplay" => ("yes" == $settings["autoplay"]) ? ["delay" => $settings["autoplay_speed"]] : false,
1561 "parallax" => true,
1562 "speed" => $settings["speed"]["size"],
1563 "pauseOnHover" => ("yes" == $settings["pauseonhover"]) ? true : false,
1564 "grabCursor" => ($settings["grab_cursor"] === "yes") ? true : false,
1565 "effect" => 'fade',
1566 "fadeEffect" => ['crossFade' => true],
1567 "lazy" => true,
1568 "mousewheel" => ($settings["mousewheel"]) ? true : false,
1569 "observer" => ($settings["observer"]) ? true : false,
1570 "observeParents" => ($settings["observer"]) ? true : false,
1571 "slidesPerView" => 1,
1572 "loop" => ($settings["loop"] == "yes") ? true : false,
1573 "loopedSlides" => 4,
1574 "navigation" => [
1575 "nextEl" => "#" . $id . " .usk-button-next",
1576 "prevEl" => "#" . $id . " .usk-button-prev",
1577 ],
1578 "pagination" => [
1579 "el" => "#" . $id . " .swiper-pagination",
1580 "type" => "fraction",
1581 ],
1582 "lazy" => [
1583 "loadPrevNext" => "true",
1584 ],
1585
1586 ]))
1587 ]
1588 ]
1589 ]
1590 );
1591 ?>
1592 <div class="ultimate-store-kit">
1593 <div <?php $this->print_render_attribute_string('slider'); ?>>
1594 <div class="swiper usk-main-slider">
1595 <div class="swiper-wrapper">
1596 <?php
1597 }
1598
1599 public function render_slider_footer() {
1600 $settings = $this->get_settings_for_display();
1601 ?>
1602 </div>
1603 </div>
1604
1605 <!-- thumbsslider -->
1606 <div class="usk-thumbs-slider-wrap">
1607 <div thumbsSlider="" class="usk-thumbs-slider">
1608 <div class="swiper-wrapper">
1609 <?php $this->render_thumbs_item(); ?>
1610 </div>
1611 </div>
1612
1613 <!-- Navigation & Pagination Html -->
1614 <?php if ($settings['show_arrows'] or $settings['show_pagination']) : ?>
1615 <div class="usk-nav-pag-wrap">
1616 <?php if ($settings['show_pagination']) : ?>
1617 <div class="swiper-pagination"></div>
1618 <?php endif; ?>
1619
1620 <?php if ($settings['show_arrows']) : ?>
1621 <div class="usk-navigation-button">
1622 <div class="usk-button-next usk-nav-btn">
1623 <div class="usk-nav-text" data-title="Next">
1624 <span><?php echo esc_html_x('next', 'Fronend', 'ultimate-store-kit') ?></span>
1625 </div>
1626 <i class="usk-icon-arrow-right-<?php echo esc_html($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
1627 </div>
1628 <div class="usk-button-prev usk-nav-btn">
1629 <i class="usk-icon-arrow-left-<?php echo esc_html($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i>
1630 <div class="usk-nav-text" data-title="Prev">
1631 <span><?php echo esc_html_x('prev', 'Fronend', 'ultimate-store-kit') ?></span>
1632 </div>
1633 </div>
1634 </div>
1635 <?php endif; ?>
1636 </div>
1637 <?php endif; ?>
1638
1639 </div>
1640 <!-- thumbsslider -->
1641 </div>
1642 </div>
1643 <?php
1644 }
1645
1646 public function print_price_output($output) {
1647 $tags = [
1648 'del' => ['aria-hidden' => []],
1649 'span' => ['class' => []],
1650 'bdi' => [],
1651 'ins' => [],
1652 ];
1653
1654 if (isset($output)) {
1655 echo wp_kses($output, $tags);
1656 }
1657 }
1658
1659 public function render_loop_item() {
1660 $settings = $this->get_settings_for_display();
1661 $id = 'usk-wc-product-' . $this->get_id();
1662 $modal_id = wp_unique_id('modal-id-');
1663
1664 $this->query_product();
1665 $wp_query = $this->get_query();
1666 if ($wp_query->have_posts()) { ?>
1667 <?php while ($wp_query->have_posts()) : $wp_query->the_post();
1668 global $product;
1669 $tooltip_position = 'top';
1670
1671 $rating_count = $product->get_rating_count();
1672 $average = $product->get_average_rating();
1673 if ($settings['show_rating'] == 'yes') {
1674 $this->add_render_attribute('usk-item', 'class', ['usk-item swiper-slide', 'usk-have-rating'], true);
1675 } else {
1676 $this->add_render_attribute('usk-item', 'class', ['usk-item swiper-slide'], true);
1677 }
1678
1679 ?>
1680 <div <?php $this->print_render_attribute_string('usk-item'); ?>>
1681 <?php $this->render_image(); ?>
1682
1683 <div class="usk-badge-label-wrapper">
1684 <div class="usk-badge-label-content">
1685 <?php $this->register_global_template_badge_label(); ?>
1686 </div>
1687 </div>
1688
1689 <div class="usk-content">
1690 <div class="usk-inner-content">
1691
1692 <?php if ('yes' == $settings['show_category']) : ?>
1693 <?php printf('<div class="usk-category" data-swiper-parallax-X="-50">%1$s</div>', wc_get_product_category_list($product->get_id())); ?>
1694 <?php endif; ?>
1695
1696 <?php if ('yes' == $settings['show_title']) :
1697 printf('<%1$s class="usk-title" data-swiper-parallax-X="-100"><a href="%2$s">%3$s</a></%1$s>', $settings['title_tags'], $product->get_permalink(), $product->get_title());
1698 endif; ?>
1699
1700 <?php if ('yes' == $settings['show_excerpt']) : ?>
1701 <div class="usk-text" data-swiper-parallax-X="-150">
1702 <?php echo wp_trim_words($product->get_short_description(), $settings['excerpt_limit'], '...'); ?>
1703 </div>
1704 <?php endif; ?>
1705
1706 <?php if (('yes' == $settings['show_price'])) : ?>
1707 <div class="usk-price" data-swiper-parallax-X="-200">
1708 <?php
1709 $this->print_price_output($product->get_price_html());
1710 ?>
1711 </div>
1712 <?php endif; ?>
1713
1714 <?php if ('yes' == $settings['show_rating']) : ?>
1715 <div class="usk-rating" data-swiper-parallax-X="-250">
1716 <span><?php echo $this->register_global_template_wc_rating($average, $rating_count); ?></span>
1717 </div>
1718 <?php endif; ?>
1719
1720 </div>
1721 </div>
1722 <div class="usk-action-btn-wrap">
1723 <?php
1724 $this->register_global_template_add_to_cart($tooltip_position);
1725 $this->register_global_template_quick_view($product->get_id(), $tooltip_position);
1726 $this->register_global_template_add_to_wishlist($tooltip_position);
1727 ?>
1728 </div>
1729 </div>
1730
1731 <?php endwhile;
1732 wp_reset_postdata();
1733 } else {
1734 echo '<div class="usk-alert-warning" usk-alert>' . esc_html__('Ops! There no product to display.', 'ultimate-store-kit') . '</div>';
1735 }
1736 }
1737
1738 public function render_thumbs_item() {
1739 $settings = $this->get_settings_for_display();
1740 $this->query_product();
1741 $wp_query = $this->get_query();
1742 if ($wp_query->have_posts()) { ?>
1743 <?php while ($wp_query->have_posts()) : $wp_query->the_post();
1744 global $product;
1745
1746 ?>
1747 <div class="swiper-slide usk-item">
1748 <?php $this->render_image(); ?>
1749 </div>
1750 <?php endwhile;
1751 wp_reset_postdata();
1752 } else {
1753 echo '<div class="usk-alert-warning" usk-alert>' . esc_html__('Ops! There no product to display.', 'ultimate-store-kit') . '</div>';
1754 }
1755 }
1756
1757 public function render() {
1758 $this->render_slider_header();
1759 $this->render_loop_item();
1760 $this->render_slider_footer();
1761 }
1762 public function query_product() {
1763 $default = $this->getGroupControlQueryArgs();
1764 $this->_query = new WP_Query($default);
1765 }
1766 }
1767