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

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