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

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

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