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

product-table.php in Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder 1.5.2, at modules/product-table/widgets/product-table.php

2,527 lines 94.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace UltimateStoreKit\Modules\ProductTable\Widgets;
4
5 use Elementor\Controls_Manager;
6 use Elementor\Group_Control_Border;
7 use Elementor\Group_Control_Box_Shadow;
8 use Elementor\Group_Control_Typography;
9 use UltimateStoreKit\Base\Module_Base;
10 use UltimateStoreKit\Traits\Global_Widget_Template;
11 use UltimateStoreKit\Includes\Controls\GroupQuery\Group_Control_Query;
12 use UltimateStoreKit\Traits\Global_Widget_Controls;
13 use WP_Query;
14
15 if (!defined('ABSPATH')) {
16 exit;
17 }
18
19 // Exit if accessed directly
20
21 class Product_Table extends Module_Base {
22 use Global_Widget_Controls;
23 use Global_Widget_Template;
24 use Group_Control_Query;
25 // use Global_Widget_Template;
26
27 public function get_name() {
28 return 'usk-product-table';
29 }
30
31 public function get_title() {
32 return esc_html__('Product Table', 'ultimate-store-kit');
33 }
34
35 public function get_icon() {
36 return 'usk-widget-icon usk-icon-product-table';
37 }
38
39 public function get_categories() {
40 return ['ultimate-store-kit'];
41 }
42
43 public function get_keywords() {
44 return ['product', 'product-table', 'table', 'wc'];
45 }
46
47 public function get_script_depends() {
48 return ['datatables', 'micromodal'];
49 }
50
51 public function get_style_depends() {
52 if ($this->usk_is_edit_mode()) {
53 return ['usk-all-styles'];
54 } else {
55 return ['ultimate-store-kit-font', 'datatables', 'usk-product-table'];
56 }
57 }
58 public function get_query() {
59 return $this->_query;
60 }
61 protected function register_controls() {
62
63 $this->start_controls_section(
64 'section_woocommerce_layout',
65 [
66 'label' => esc_html__('Layout', 'ultimate-store-kit'),
67 ]
68 );
69
70 // $this->add_control(
71 // 'hide_header',
72 // [
73 // 'label' => esc_html__('Hide Header', 'ultimate-store-kit'),
74 // 'type' => Controls_Manager::SWITCHER,
75 // 'default' => 'no',
76 // 'return' => 'yes',
77 // ]
78 // );
79
80 $this->add_control(
81 'table_header_alignment',
82 [
83 'label' => esc_html__('Header Alignment', 'ultimate-store-kit'),
84 'type' => Controls_Manager::CHOOSE,
85 'options' => [
86 'left' => [
87 'title' => esc_html__('Left', 'ultimate-store-kit'),
88 'icon' => 'eicon-h-align-left',
89 ],
90 'center' => [
91 'title' => esc_html__('Center', 'ultimate-store-kit'),
92 'icon' => 'eicon-h-align-center',
93 ],
94 'right' => [
95 'title' => esc_html__('Right', 'ultimate-store-kit'),
96 'icon' => 'eicon-h-align-right',
97 ],
98 ],
99 'selectors' => [
100 '{{WRAPPER}} .usk-wc-products table th' => 'text-align: {{VALUE}}',
101 ],
102 ]
103 );
104
105 $this->add_control(
106 'table_data_alignment',
107 [
108 'label' => esc_html__('Data Alignment', 'ultimate-store-kit'),
109 'type' => Controls_Manager::CHOOSE,
110 'options' => [
111 'left' => [
112 'title' => esc_html__('Left', 'ultimate-store-kit'),
113 'icon' => 'eicon-h-align-left',
114 ],
115 'center' => [
116 'title' => esc_html__('Center', 'ultimate-store-kit'),
117 'icon' => 'eicon-h-align-center',
118 ],
119 'right' => [
120 'title' => esc_html__('Right', 'ultimate-store-kit'),
121 'icon' => 'eicon-h-align-right',
122 ],
123 ],
124 'selectors' => [
125 '{{WRAPPER}} .usk-wc-products table td' => 'text-align: {{VALUE}}',
126 ],
127 ]
128 );
129
130 $this->add_control(
131 'hash_top_offset',
132 [
133 'label' => esc_html__('Top Offset ', 'ultimate-store-kit'),
134 'type' => Controls_Manager::SLIDER,
135 'size_units' => ['px', ''],
136 'range' => [
137 'px' => [
138 'min' => 1,
139 'max' => 1000,
140 'step' => 5,
141 ],
142
143 ],
144 'default' => [
145 'unit' => 'px',
146 'size' => 70,
147 ],
148 'condition' => [
149 'active_hash' => 'yes',
150 'show_filter_bar' => 'yes',
151 ],
152 ]
153 );
154
155 $this->add_control(
156 'hash_scrollspy_time',
157 [
158 'label' => esc_html__('Scrollspy Time', 'ultimate-store-kit'),
159 'type' => Controls_Manager::SLIDER,
160 'size_units' => ['ms', ''],
161 'range' => [
162 'px' => [
163 'min' => 500,
164 'max' => 5000,
165 'step' => 1000,
166 ],
167 ],
168 'default' => [
169 'unit' => 'px',
170 'size' => 1000,
171 ],
172 'condition' => [
173 'active_hash' => 'yes',
174 'show_filter_bar' => 'yes',
175 ],
176 ]
177 );
178 $this->add_control(
179 'show_pagination',
180 [
181 'label' => esc_html__('Paginatioin', 'ultimate-store-kit'),
182 'type' => Controls_Manager::SWITCHER,
183 ]
184 );
185
186 $this->end_controls_section();
187 $this->start_controls_section(
188 'section_post_query_builder',
189 [
190 'label' => __('Query', 'ultimate-store-kit'),
191 'tab' => Controls_Manager::TAB_CONTENT,
192 ]
193 );
194 $this->register_query_builder_controls();
195 $this->register_controls_wc_additional();
196 $this->add_control(
197 'orderColumn',
198 [
199 'label' => esc_html__('Order by', 'ultimate-store-kit'),
200 'type' => Controls_Manager::SELECT,
201 'separator' => 'before',
202 'default' => 'default',
203 'options' => [
204 'default' => esc_html__('Default', 'ultimate-store-kit'),
205 'title' => esc_html__('Title', 'ultimate-store-kit'),
206 'description' => esc_html__('Description', 'ultimate-store-kit'),
207 'categories' => esc_html__('Categories', 'ultimate-store-kit'),
208 'price' => esc_html__('Price', 'ultimate-store-kit'),
209 ],
210 ]
211 );
212
213 $this->add_control(
214 'orderColumnQry',
215 [
216 'label' => esc_html__('Order', 'ultimate-store-kit'),
217 'type' => Controls_Manager::SELECT,
218 'default' => 'desc',
219 'options' => [
220 'desc' => esc_html__('Descending', 'ultimate-store-kit'),
221 'asc' => esc_html__('Ascending', 'ultimate-store-kit'),
222 ],
223 ]
224 );
225 $this->end_controls_section();
226
227
228 $this->start_controls_section(
229 'section_woocommerce_additional',
230 [
231 'label' => esc_html__('Additional', 'ultimate-store-kit'),
232 ]
233 );
234
235 $this->add_control(
236 'show_change_length',
237 [
238 'label' => esc_html__('Show Change Length', 'ultimate-store-kit'),
239 'type' => Controls_Manager::SWITCHER,
240 'default' => 'yes',
241 ]
242 );
243
244 $this->add_control(
245 'show_searching',
246 [
247 'label' => esc_html__('Search', 'ultimate-store-kit'),
248 'type' => Controls_Manager::SWITCHER,
249 'default' => 'no',
250 ]
251 );
252
253 $this->add_control(
254 'show_ordering',
255 [
256 'label' => esc_html__('Ordering', 'ultimate-store-kit'),
257 'type' => Controls_Manager::SWITCHER,
258 'default' => 'yes',
259 'separator' => 'after',
260 // 'condition' => [
261 // 'hide_header!' => 'yes'
262 // ],
263 ]
264 );
265
266 $this->add_control(
267 'show_thumb',
268 [
269 'label' => esc_html__('Show Thumbnail', 'ultimate-store-kit'),
270 'type' => Controls_Manager::SWITCHER,
271 'default' => 'yes',
272 ]
273 );
274
275 $this->add_control(
276 'open_thumb_in_lightbox',
277 [
278 'label' => esc_html__('Open Thumb in Lightbox', 'ultimate-store-kit'),
279 'type' => Controls_Manager::SWITCHER,
280 ]
281 );
282
283 $this->add_control(
284 'show_title',
285 [
286 'label' => esc_html__('Title', 'ultimate-store-kit'),
287 'type' => Controls_Manager::SWITCHER,
288 'default' => 'yes',
289 ]
290 );
291
292 $this->add_control(
293 'title_tags',
294 [
295 'label' => __('Title HTML Tag', 'ultimate-store-kit'),
296 'type' => Controls_Manager::SELECT,
297 'default' => 'h2',
298 'options' => ultimate_store_kit_title_tags(),
299 'condition' => [
300 'show_title' => 'yes'
301 ]
302 ]
303 );
304
305 $this->add_control(
306 'show_description',
307 [
308 'label' => esc_html__('Description', 'ultimate-store-kit'),
309 'type' => Controls_Manager::SWITCHER,
310 'default' => 'yes',
311 ]
312 );
313
314 $this->add_control(
315 'description_limit',
316 [
317 'label' => esc_html__('Description Limit', 'ultimate-store-kit'),
318 'type' => Controls_Manager::NUMBER,
319 'default' => 10,
320 'condition' => [
321 'show_description' => 'yes'
322 ]
323 ]
324 );
325
326 $this->add_control(
327 'show_rating',
328 [
329 'label' => esc_html__('Rating', 'ultimate-store-kit'),
330 'type' => Controls_Manager::SWITCHER,
331 'default' => 'yes',
332 ]
333 );
334
335 $this->add_control(
336 'show_price',
337 [
338 'label' => esc_html__('Price', 'ultimate-store-kit'),
339 'type' => Controls_Manager::SWITCHER,
340 'default' => 'yes',
341 ]
342 );
343
344 $this->add_control(
345 'show_categories',
346 [
347 'label' => esc_html__('Categories', 'ultimate-store-kit'),
348 'type' => Controls_Manager::SWITCHER,
349 ]
350 );
351
352 $this->add_control(
353 'show_tags',
354 [
355 'label' => esc_html__('Tags', 'ultimate-store-kit'),
356 'type' => Controls_Manager::SWITCHER,
357 ]
358 );
359
360 $this->add_control(
361 'show_quantity',
362 [
363 'label' => esc_html__('Quantity', 'ultimate-store-kit'),
364 'type' => Controls_Manager::SWITCHER,
365 ]
366 );
367
368 $this->add_control(
369 'show_cart',
370 [
371 'label' => esc_html__('Add to Cart', 'ultimate-store-kit'),
372 'type' => Controls_Manager::SWITCHER,
373 'default' => 'yes',
374 ]
375 );
376
377 $this->add_control(
378 'show_quick_view',
379 [
380 'label' => esc_html__('Quick View', 'ultimate-store-kit'),
381 'type' => Controls_Manager::SWITCHER,
382 ]
383 );
384 $this->add_control(
385 'show_info',
386 [
387 'label' => esc_html__('Footer Info', 'ultimate-store-kit'),
388 'type' => Controls_Manager::SWITCHER,
389 ]
390 );
391 $this->add_control(
392 'show_hide_options_separator',
393 [
394 'label' => esc_html__('S H O W /H I D E', 'ultimate-store-kit'),
395 'type' => Controls_Manager::HEADING,
396 'separator' => 'before'
397 ]
398 );
399 $this->add_control(
400 'thumbs_hide_on',
401 [
402 'label' => __('Thumbs hide on', 'ultimate-post-kit'),
403 'type' => Controls_Manager::SELECT2,
404 'multiple' => true,
405 'label_block' => true,
406 'options' => [
407 'desktop' => __('Desktop', 'ultimate-post-kit'),
408 'tablet' => __('Tablet', 'ultimate-post-kit'),
409 'mobile' => __('Mobile', 'ultimate-post-kit'),
410 ],
411 'condition' => [
412 'show_thumb' => 'yes'
413 ]
414 ]
415 );
416 $this->add_control(
417 'title_hide_on',
418 [
419 'label' => __('Title hide on', 'ultimate-post-kit'),
420 'type' => Controls_Manager::SELECT2,
421 'multiple' => true,
422 'label_block' => true,
423 'options' => [
424 'desktop' => __('Desktop', 'ultimate-post-kit'),
425 'tablet' => __('Tablet', 'ultimate-post-kit'),
426 'mobile' => __('Mobile', 'ultimate-post-kit'),
427 ],
428 'condition' => [
429 'show_title' => 'yes'
430 ]
431 ]
432 );
433 $this->add_control(
434 'description_hide_on',
435 [
436 'label' => __('Description hide on', 'ultimate-post-kit'),
437 'type' => Controls_Manager::SELECT2,
438 'multiple' => true,
439 'label_block' => true,
440 'options' => [
441 'desktop' => __('Desktop', 'ultimate-post-kit'),
442 'tablet' => __('Tablet', 'ultimate-post-kit'),
443 'mobile' => __('Mobile', 'ultimate-post-kit'),
444 ],
445 'condition' => [
446 'show_description' => 'yes'
447 ]
448 ]
449 );
450 $this->add_control(
451 'categories_hide_on',
452 [
453 'label' => __('Categories hide on', 'ultimate-post-kit'),
454 'type' => Controls_Manager::SELECT2,
455 'multiple' => true,
456 'label_block' => true,
457 'options' => [
458 'desktop' => __('Desktop', 'ultimate-post-kit'),
459 'tablet' => __('Tablet', 'ultimate-post-kit'),
460 'mobile' => __('Mobile', 'ultimate-post-kit'),
461 ],
462 'condition' => [
463 'show_categories' => 'yes'
464 ]
465 ]
466 );
467 $this->add_control(
468 'tags_hide_on',
469 [
470 'label' => __('Tags hide on', 'ultimate-post-kit'),
471 'type' => Controls_Manager::SELECT2,
472 'multiple' => true,
473 'label_block' => true,
474 'options' => [
475 'desktop' => __('Desktop', 'ultimate-post-kit'),
476 'tablet' => __('Tablet', 'ultimate-post-kit'),
477 'mobile' => __('Mobile', 'ultimate-post-kit'),
478 ],
479 'condition' => [
480 'show_tags' => 'yes'
481 ]
482 ]
483 );
484 $this->add_control(
485 'rating_hide_on',
486 [
487 'label' => __('Rating hide on', 'ultimate-post-kit'),
488 'type' => Controls_Manager::SELECT2,
489 'multiple' => true,
490 'label_block' => true,
491 'options' => [
492 'desktop' => __('Desktop', 'ultimate-post-kit'),
493 'tablet' => __('Tablet', 'ultimate-post-kit'),
494 'mobile' => __('Mobile', 'ultimate-post-kit'),
495 ],
496 'condition' => [
497 'show_rating' => 'yes'
498 ]
499 ]
500 );
501 $this->add_control(
502 'price_hide_on',
503 [
504 'label' => __('Price hide on', 'ultimate-post-kit'),
505 'type' => Controls_Manager::SELECT2,
506 'multiple' => true,
507 'label_block' => true,
508 'options' => [
509 'desktop' => __('Desktop', 'ultimate-post-kit'),
510 'tablet' => __('Tablet', 'ultimate-post-kit'),
511 'mobile' => __('Mobile', 'ultimate-post-kit'),
512 ],
513 'condition' => [
514 'show_categories' => 'yes'
515 ]
516 ]
517 );
518 $this->add_control(
519 'quick_view_hide_on',
520 [
521 'label' => __('Quick View hide on', 'ultimate-post-kit'),
522 'type' => Controls_Manager::SELECT2,
523 'multiple' => true,
524 'label_block' => true,
525 'options' => [
526 'desktop' => __('Desktop', 'ultimate-post-kit'),
527 'tablet' => __('Tablet', 'ultimate-post-kit'),
528 'mobile' => __('Mobile', 'ultimate-post-kit'),
529 ],
530 'condition' => [
531 'show_quick_view' => 'yes'
532 ]
533 ]
534 );
535 $this->add_control(
536 'quantity_hide_on',
537 [
538 'label' => __('Quantity hide on', 'ultimate-post-kit'),
539 'type' => Controls_Manager::SELECT2,
540 'multiple' => true,
541 'label_block' => true,
542 'options' => [
543 'desktop' => __('Desktop', 'ultimate-post-kit'),
544 'tablet' => __('Tablet', 'ultimate-post-kit'),
545 'mobile' => __('Mobile', 'ultimate-post-kit'),
546 ],
547 'condition' => [
548 'show_quantity' => 'yes'
549 ]
550 ]
551 );
552 $this->add_control(
553 'cart_hide_on',
554 [
555 'label' => __('Add to Cart hide on', 'ultimate-post-kit'),
556 'type' => Controls_Manager::SELECT2,
557 'multiple' => true,
558 'label_block' => true,
559 'options' => [
560 'desktop' => __('Desktop', 'ultimate-post-kit'),
561 'tablet' => __('Tablet', 'ultimate-post-kit'),
562 'mobile' => __('Mobile', 'ultimate-post-kit'),
563 ],
564 'condition' => [
565 'show_cart' => 'yes'
566 ]
567 ]
568 );
569 $this->end_controls_section();
570
571 $this->start_controls_section(
572 'section_style_table',
573 [
574 'label' => esc_html__('Table', 'ultimate-store-kit'),
575 'tab' => Controls_Manager::TAB_STYLE,
576 ]
577 );
578
579 $this->start_controls_tabs('tabs_table_style');
580
581 $this->start_controls_tab(
582 'tab_table_normal',
583 [
584 'label' => esc_html__('Normal', 'ultimate-store-kit'),
585 ]
586 );
587
588 $this->add_group_control(
589 Group_Control_Typography::get_type(),
590 [
591 'name' => 'table_header_typography',
592 'label' => esc_html__('Header Typography', 'ultimate-store-kit'),
593 //'scheme' => Schemes\Typography::TYPOGRAPHY_4,
594 'selector' => '{{WRAPPER}} .usk-wc-products table th',
595 // 'condition' => [
596 // 'hide_header!' => 'yes'
597 // ],
598 ]
599 );
600
601 $this->add_control(
602 'table_heading_background',
603 [
604 'label' => esc_html__('Heading Background', 'ultimate-store-kit'),
605 'type' => Controls_Manager::COLOR,
606 'selectors' => [
607 '{{WRAPPER}} .usk-wc-products table th' => 'background-color: {{VALUE}};',
608 ],
609 // 'condition' => [
610 // 'hide_header!' => 'yes'
611 // ],
612 ]
613 );
614
615 $this->add_control(
616 'table_heading_color',
617 [
618 'label' => esc_html__('Heading Color', 'ultimate-store-kit'),
619 'type' => Controls_Manager::COLOR,
620 'selectors' => [
621 '{{WRAPPER}} .usk-wc-products table th' => 'color: {{VALUE}};',
622 ],
623 // 'condition' => [
624 // 'hide_header!' => 'yes'
625 // ],
626 ]
627 );
628
629 $this->add_control(
630 'cell_border_color',
631 [
632 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
633 'type' => Controls_Manager::COLOR,
634 'selectors' => [
635 '{{WRAPPER}} .usk-wc-products table td' => 'border-color: {{VALUE}};',
636 '{{WRAPPER}} .usk-wc-products table th' => 'border-color: {{VALUE}};',
637 '{{WRAPPER}} .usk-wc-products table.dataTable.no-footer' => 'border-color: {{VALUE}};',
638 ],
639 'condition' => [
640 'cell_border' => 'yes',
641 ],
642 ]
643 );
644
645 $this->add_control(
646 'table_odd_row_background',
647 [
648 'label' => esc_html__('Odd Row Background', 'ultimate-store-kit'),
649 'type' => Controls_Manager::COLOR,
650 'selectors' => [
651 '{{WRAPPER}} .usk-wc-products table.dataTable.stripe tbody tr.odd' => 'background-color: {{VALUE}};',
652 ],
653 'condition' => [
654 'stripe' => 'yes',
655 ],
656 ]
657 );
658
659 $this->add_control(
660 'table_even_row_background',
661 [
662 'label' => esc_html__('Even Row Background', 'ultimate-store-kit'),
663 'type' => Controls_Manager::COLOR,
664 'selectors' => [
665 '{{WRAPPER}} .usk-wc-products table.dataTable.stripe tbody tr.even' => 'background-color: {{VALUE}};',
666 ],
667 'condition' => [
668 'stripe' => 'yes',
669 ],
670 ]
671 );
672
673 $this->add_control(
674 'cell_border',
675 [
676 'label' => esc_html__('Cell Border', 'ultimate-store-kit'),
677 'type' => Controls_Manager::SWITCHER,
678 ]
679 );
680
681 $this->add_control(
682 'stripe',
683 [
684 'label' => esc_html__('stripe', 'ultimate-store-kit'),
685 'type' => Controls_Manager::SWITCHER,
686 'default' => 'yes',
687 ]
688 );
689
690 $this->add_control(
691 'hover_effect',
692 [
693 'label' => esc_html__('Hover Effect', 'ultimate-store-kit'),
694 'type' => Controls_Manager::SWITCHER,
695 ]
696 );
697
698 $this->add_responsive_control(
699 'table_cell_padding',
700 [
701 'label' => esc_html__('Cell Padding', 'ultimate-store-kit'),
702 'type' => Controls_Manager::DIMENSIONS,
703 'size_units' => ['px', 'em', '%'],
704 'selectors' => [
705 '{{WRAPPER}} .usk-wc-products table.usk-wc-product td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
706 ],
707 'separator' => 'before',
708 ]
709 );
710
711 // $this->add_control(
712 // 'sorting_style',
713 // [
714 // 'label' => esc_html__('Sorting Style', 'ultimate-store-kit'),
715 // 'type' => Controls_Manager::HEADING,
716 // 'separator' => 'before',
717 // ]
718 // );
719
720 // $this->add_control(
721 // 'sorting_color',
722 // [
723 // 'label' => esc_html__('Color', 'ultimate-store-kit'),
724 // 'type' => Controls_Manager::COLOR,
725 // 'selectors' => [
726 // '{{WRAPPER}} .usk-wc-products.usk-wc-products-table table.dataTable thead th:before, {{WRAPPER}} .usk-wc-products.usk-wc-products-table table.dataTable thead th:after' => 'color: {{VALUE}};',
727 // ],
728 // ]
729 // );
730
731 $this->end_controls_tab();
732
733 $this->start_controls_tab(
734 'tab_table_hover',
735 [
736 'label' => esc_html__('Hover', 'ultimate-store-kit'),
737 ]
738 );
739
740 $this->add_control(
741 'table_odd_row_hover_background',
742 [
743 'label' => esc_html__('Odd Row Background', 'ultimate-store-kit'),
744 'type' => Controls_Manager::COLOR,
745 'selectors' => [
746 '{{WRAPPER}} .usk-wc-products table.dataTable.stripe tbody tr:hover' => 'background-color: {{VALUE}};',
747 ],
748 'condition' => [
749 'stripe' => 'yes',
750 ],
751 ]
752 );
753
754 $this->end_controls_tab();
755
756 $this->end_controls_tabs();
757
758 $this->end_controls_section();
759
760 $this->start_controls_section(
761 'section_search_field_style',
762 [
763 'label' => esc_html__('Search Field', 'ultimate-store-kit'),
764 'tab' => Controls_Manager::TAB_STYLE,
765 'condition' => [
766 'show_searching' => 'yes'
767 ]
768 ]
769 );
770
771 $this->start_controls_tabs('tabs_search_field_style');
772
773 $this->start_controls_tab(
774 'tab_search_field_normal',
775 [
776 'label' => esc_html__('Normal', 'ultimate-store-kit'),
777 ]
778 );
779
780 $this->add_control(
781 'search_field_text_color',
782 [
783 'label' => esc_html__('Text Color', 'ultimate-store-kit'),
784 'type' => Controls_Manager::COLOR,
785 'selectors' => [
786 '{{WRAPPER}} .usk-wc-products input[type*="search"]' => 'color: {{VALUE}};',
787 ],
788 ]
789 );
790
791 $this->add_control(
792 'search_field_background_color',
793 [
794 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
795 'type' => Controls_Manager::COLOR,
796 'selectors' => [
797 '{{WRAPPER}} .usk-wc-products input[type*="search"]' => 'background-color: {{VALUE}};',
798 ],
799 ]
800 );
801
802 $this->add_group_control(
803 Group_Control_Border::get_type(),
804 [
805 'name' => 'search_field_border',
806 'label' => esc_html__('Border', 'ultimate-store-kit'),
807 'placeholder' => '1px',
808 'default' => '1px',
809 'selector' => '{{WRAPPER}} .usk-wc-products input[type*="search"], {{WRAPPER}} .usk-wc-products select',
810 'separator' => 'before',
811 ]
812 );
813
814 $this->add_control(
815 'search_field_border_radius',
816 [
817 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
818 'type' => Controls_Manager::DIMENSIONS,
819 'size_units' => ['px', '%'],
820 'selectors' => [
821 '{{WRAPPER}} .usk-wc-products input[type*="search"]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
822 ],
823 ]
824 );
825
826 $this->add_responsive_control(
827 'search_field_padding',
828 [
829 'label' => esc_html__('Padding', 'ultimate-store-kit'),
830 'type' => Controls_Manager::DIMENSIONS,
831 'size_units' => ['px', 'em', '%'],
832 'selectors' => [
833 '{{WRAPPER}} .usk-wc-products input[type*="search"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; height: auto;',
834 ],
835 ]
836 );
837
838 $this->add_control(
839 'search_text_color',
840 [
841 'label' => esc_html__('Label Color', 'ultimate-store-kit'),
842 'type' => Controls_Manager::COLOR,
843 'selectors' => [
844 '{{WRAPPER}} .usk-wc-products .dataTables_filter label' => 'color: {{VALUE}};',
845 ],
846 ]
847 );
848
849 $this->add_responsive_control(
850 'search_spacing',
851 [
852 'label' => esc_html__('Bottom Spacing', 'ultimate-store-kit'),
853 'type' => Controls_Manager::SLIDER,
854 'selectors' => [
855 '{{WRAPPER}} .dataTables_filter' => 'margin-bottom: {{SIZE}}px;',
856 ],
857 ]
858 );
859
860 $this->add_group_control(
861 Group_Control_Typography::get_type(),
862 [
863 'name' => 'search_text_typography',
864 'label' => esc_html__('Label Typography', 'ultimate-store-kit'),
865 'selector' => '{{WRAPPER}} .usk-wc-products .dataTables_filter label',
866 'separator' => 'before',
867 ]
868 );
869
870 $this->end_controls_tab();
871
872 $this->start_controls_tab(
873 'tab_search_field_focus',
874 [
875 'label' => esc_html__('Focus', 'ultimate-store-kit'),
876 ]
877 );
878
879 $this->add_control(
880 'search_field_focus_text_color',
881 [
882 'label' => esc_html__('Text Color', 'ultimate-store-kit'),
883 'type' => Controls_Manager::COLOR,
884 'selectors' => [
885 '{{WRAPPER}} .usk-wc-products input[type*="search"]:focus' => 'color: {{VALUE}};',
886 ],
887 ]
888 );
889
890 $this->add_control(
891 'search_field_focus_background_color',
892 [
893 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
894 'type' => Controls_Manager::COLOR,
895 'selectors' => [
896 '{{WRAPPER}} .usk-wc-products input[type*="search"]:focus' => 'background-color: {{VALUE}};',
897 ],
898 ]
899 );
900
901 $this->add_control(
902 'search_field_focus_border_color',
903 [
904 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
905 'type' => Controls_Manager::COLOR,
906 'selectors' => [
907 '{{WRAPPER}} .usk-wc-products input[type*="search"]:focus' => 'border-color: {{VALUE}};',
908 ],
909 ]
910 );
911
912 $this->add_control(
913 'search_field_focus_border_width',
914 [
915 'label' => __('Border Width', 'ultimate-store-kit'),
916 'type' => Controls_Manager::SLIDER,
917 'default' => [
918 'size' => 1,
919 ],
920 'range' => [
921 'px' => [
922 'min' => 1,
923 'max' => 20,
924 ],
925 ],
926 'selectors' => [
927 '{{WRAPPER}} .usk-wc-products input[type*="search"]:focus' => 'border-width: {{SIZE}}{{UNIT}};',
928 ],
929 ]
930 );
931
932 $this->add_control(
933 'search_field_focus_border_radius',
934 [
935 'label' => __('Border Radius', 'ultimate-store-kit'),
936 'type' => Controls_Manager::SLIDER,
937 'default' => [
938 'size' => 1,
939 ],
940 'range' => [
941 'px' => [
942 'min' => 1,
943 'max' => 20,
944 ],
945 ],
946 'selectors' => [
947 '{{WRAPPER}} .usk-wc-products input[type*="search"]:focus' => 'border-radius: {{SIZE}}{{UNIT}};',
948 ],
949 ]
950 );
951
952 $this->end_controls_tab();
953
954 $this->end_controls_tabs();
955
956 $this->end_controls_section();
957
958 $this->start_controls_section(
959 'section_select_field_style',
960 [
961 'label' => esc_html__('Select Field', 'ultimate-store-kit'),
962 'tab' => Controls_Manager::TAB_STYLE,
963 'condition' => [
964 'show_info' => 'yes'
965 ]
966 ]
967 );
968
969 $this->start_controls_tabs('tabs_select_field_style');
970
971 $this->start_controls_tab(
972 'tab_select_field_normal',
973 [
974 'label' => esc_html__('Normal', 'ultimate-store-kit'),
975 ]
976 );
977
978 $this->add_control(
979 'select_field_text_color',
980 [
981 'label' => esc_html__('Number Color', 'ultimate-store-kit'),
982 'type' => Controls_Manager::COLOR,
983 'selectors' => [
984 '{{WRAPPER}} .usk-wc-products select' => 'color: {{VALUE}};',
985 ],
986 ]
987 );
988 $this->add_control(
989 'select_text_color',
990 [
991 'label' => esc_html__('Label Color', 'ultimate-store-kit'),
992 'type' => Controls_Manager::COLOR,
993 'selectors' => [
994 '{{WRAPPER}} .usk-wc-products .dataTables_length label' => 'color: {{VALUE}};',
995 ],
996 ]
997 );
998
999 $this->add_control(
1000 'select_field_background_color',
1001 [
1002 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
1003 'type' => Controls_Manager::COLOR,
1004 'selectors' => [
1005 '{{WRAPPER}} .usk-wc-products select' => 'background-color: {{VALUE}};',
1006 ],
1007 ]
1008 );
1009
1010 $this->add_group_control(
1011 Group_Control_Border::get_type(),
1012 [
1013 'name' => 'select_field_border',
1014 'label' => esc_html__('Border', 'ultimate-store-kit'),
1015 'placeholder' => '1px',
1016 'default' => '1px',
1017 'selector' => '{{WRAPPER}} .usk-wc-products select',
1018 'separator' => 'before',
1019 ]
1020 );
1021
1022 $this->add_control(
1023 'select_field_border_radius',
1024 [
1025 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
1026 'type' => Controls_Manager::DIMENSIONS,
1027 'size_units' => ['px', '%'],
1028 'selectors' => [
1029 '{{WRAPPER}} .usk-wc-products select' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1030 ],
1031 ]
1032 );
1033
1034 $this->add_responsive_control(
1035 'select_field_padding',
1036 [
1037 'label' => esc_html__('Padding', 'ultimate-store-kit'),
1038 'type' => Controls_Manager::DIMENSIONS,
1039 'size_units' => ['px', 'em', '%'],
1040 'selectors' => [
1041 '{{WRAPPER}} .usk-wc-products select' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1042 ],
1043 ]
1044 );
1045
1046 $this->add_group_control(
1047 Group_Control_Typography::get_type(),
1048 [
1049 'name' => 'select_text_typography',
1050 'label' => esc_html__('Text Typography', 'ultimate-store-kit'),
1051 //'scheme' => Schemes\Typography::TYPOGRAPHY_4,
1052 'selector' => '{{WRAPPER}} .usk-wc-products .dataTables_length label',
1053 'separator' => 'before',
1054 ]
1055 );
1056
1057 $this->end_controls_tab();
1058
1059 $this->start_controls_tab(
1060 'tab_select_field_focus',
1061 [
1062 'label' => esc_html__('Focus', 'ultimate-store-kit'),
1063 ]
1064 );
1065
1066 $this->add_control(
1067 'select_field_hover_border_color',
1068 [
1069 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1070 'type' => Controls_Manager::COLOR,
1071 'condition' => [
1072 'select_field_border_border!' => '',
1073 ],
1074 'selectors' => [
1075 '{{WRAPPER}} .usk-wc-products select:focus' => 'border-color: {{VALUE}};',
1076 ],
1077 ]
1078 );
1079
1080 $this->end_controls_tab();
1081
1082 $this->end_controls_tabs();
1083
1084 $this->end_controls_section();
1085
1086 $this->start_controls_section(
1087 'section_style_image',
1088 [
1089 'label' => esc_html__('Image', 'ultimate-store-kit'),
1090 'tab' => Controls_Manager::TAB_STYLE,
1091 'condition' => [
1092 'show_thumb' => 'yes'
1093 ]
1094 ]
1095 );
1096
1097 $this->add_group_control(
1098 Group_Control_Border::get_type(),
1099 [
1100 'name' => 'image_border',
1101 'label' => esc_html__('Image Border', 'ultimate-store-kit'),
1102 'selector' => '{{WRAPPER}} .usk-wc-products .usk-wc-product-image img',
1103 ]
1104 );
1105
1106 $this->add_responsive_control(
1107 'image_border_radius',
1108 [
1109 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
1110 'type' => Controls_Manager::DIMENSIONS,
1111 'size_units' => ['px', '%'],
1112 'selectors' => [
1113 '{{WRAPPER}} .usk-wc-products .usk-wc-product-image img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1114 ],
1115 ]
1116 );
1117
1118 $this->add_group_control(
1119 Group_Control_Box_Shadow::get_type(),
1120 [
1121 'name' => 'image_shadow',
1122 'exclude' => [
1123 'shadow_position',
1124 ],
1125 'selector' => '{{WRAPPER}} .usk-wc-products .usk-wc-product-image img',
1126 ]
1127 );
1128
1129 $this->end_controls_section();
1130
1131 $this->start_controls_section(
1132 'section_style_title',
1133 [
1134 'label' => esc_html__('Title', 'ultimate-store-kit'),
1135 'tab' => Controls_Manager::TAB_STYLE,
1136 'condition' => [
1137 'show_title' => 'yes',
1138 ],
1139 ]
1140 );
1141
1142 $this->add_control(
1143 'title_color',
1144 [
1145 'label' => esc_html__('Color', 'ultimate-store-kit'),
1146 'type' => Controls_Manager::COLOR,
1147 'selectors' => [
1148 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-title .usk-wc-product-title a' => 'color: {{VALUE}};',
1149 ],
1150 ]
1151 );
1152
1153 $this->add_control(
1154 'hover_title_color',
1155 [
1156 'label' => esc_html__('Hover Color', 'ultimate-store-kit'),
1157 'type' => Controls_Manager::COLOR,
1158 'selectors' => [
1159 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-title .usk-wc-product-title a:hover' => 'color: {{VALUE}};',
1160 ],
1161 ]
1162 );
1163
1164 // $this->add_responsive_control(
1165 // 'title_margin',
1166 // [
1167 // 'label' => esc_html__('Margin', 'ultimate-store-kit'),
1168 // 'type' => Controls_Manager::DIMENSIONS,
1169 // 'size_units' => ['px', '%'],
1170 // 'selectors' => [
1171 // '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-title .usk-wc-product-title a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1172 // ],
1173 // ]
1174 // );
1175
1176 $this->add_group_control(
1177 Group_Control_Typography::get_type(),
1178 [
1179 'name' => 'title_typography',
1180 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1181 //'scheme' => Schemes\Typography::TYPOGRAPHY_4,
1182 'selector' => '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-title .usk-wc-product-title a',
1183 ]
1184 );
1185
1186 $this->end_controls_section();
1187
1188 $this->start_controls_section(
1189 'section_style_description',
1190 [
1191 'label' => esc_html__('Description', 'ultimate-store-kit'),
1192 'tab' => Controls_Manager::TAB_STYLE,
1193 'condition' => [
1194 'show_description' => 'yes',
1195 ],
1196 ]
1197 );
1198
1199 $this->add_control(
1200 'description_color',
1201 [
1202 'label' => esc_html__('Color', 'ultimate-store-kit'),
1203 'type' => Controls_Manager::COLOR,
1204 'selectors' => [
1205 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-description .usk-wc-product-description' => 'color: {{VALUE}};',
1206 ],
1207 ]
1208 );
1209
1210 $this->add_group_control(
1211 Group_Control_Typography::get_type(),
1212 [
1213 'name' => 'description_typography',
1214 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1215 //'scheme' => Schemes\Typography::TYPOGRAPHY_4,
1216 'selector' => '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-description .usk-wc-product-description',
1217 ]
1218 );
1219
1220 $this->end_controls_section();
1221 $this->start_controls_section(
1222 'section_style_categories',
1223 [
1224 'label' => esc_html__('Categories', 'ultimate-store-kit'),
1225 'tab' => Controls_Manager::TAB_STYLE,
1226 'condition' => [
1227 'show_categories' => 'yes',
1228 ],
1229 ]
1230 );
1231
1232 $this->add_control(
1233 'categories_color',
1234 [
1235 'label' => esc_html__('Color', 'ultimate-store-kit'),
1236 'type' => Controls_Manager::COLOR,
1237 'selectors' => [
1238 '{{WRAPPER}} .usk-wc-products-table .usk-categories .usk-wc-product-categories a' => 'color: {{VALUE}};',
1239 ],
1240 ]
1241 );
1242
1243 $this->add_group_control(
1244 Group_Control_Typography::get_type(),
1245 [
1246 'name' => 'categories_typography',
1247 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1248 'selector' => '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-categories .usk-wc-product-categories a',
1249 ]
1250 );
1251
1252 $this->end_controls_section();
1253
1254 $this->start_controls_section(
1255 'section_style_tags',
1256 [
1257 'label' => esc_html__('Tags', 'ultimate-store-kit'),
1258 'tab' => Controls_Manager::TAB_STYLE,
1259 'condition' => [
1260 'show_tags' => 'yes',
1261 ],
1262 ]
1263 );
1264
1265 $this->add_control(
1266 'tags_color',
1267 [
1268 'label' => esc_html__('Color', 'ultimate-store-kit'),
1269 'type' => Controls_Manager::COLOR,
1270 'selectors' => [
1271 '{{WRAPPER}} .usk-wc-product-tags' => 'color: {{VALUE}};',
1272 '{{WRAPPER}} .usk-wc-product-tags a' => 'color: {{VALUE}};',
1273 ],
1274 ]
1275 );
1276
1277 $this->add_group_control(
1278 Group_Control_Typography::get_type(),
1279 [
1280 'name' => 'tags_typography',
1281 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1282 'selector' => '{{WRAPPER}} .usk-wc-product-tags, {{WRAPPER}} .usk-wc-product-tags a',
1283 ]
1284 );
1285
1286 $this->end_controls_section();
1287
1288 $this->start_controls_section(
1289 'section_design_filter',
1290 [
1291 'label' => esc_html__('Filter Bar', 'ultimate-store-kit'),
1292 'tab' => Controls_Manager::TAB_STYLE,
1293 'condition' => [
1294 'show_filter_bar' => 'yes',
1295 ],
1296 ]
1297 );
1298
1299 $this->add_control(
1300 'filter_alignment',
1301 [
1302 'label' => esc_html__('Alignment', 'ultimate-store-kit'),
1303 'type' => Controls_Manager::CHOOSE,
1304 'default' => 'center',
1305 'options' => [
1306 'left' => [
1307 'title' => esc_html__('Left', 'ultimate-store-kit'),
1308 'icon' => 'eicon-h-align-left',
1309 ],
1310 'center' => [
1311 'title' => esc_html__('Center', 'ultimate-store-kit'),
1312 'icon' => 'eicon-h-align-center',
1313 ],
1314 'right' => [
1315 'title' => esc_html__('Right', 'ultimate-store-kit'),
1316 'icon' => 'eicon-h-align-right',
1317 ],
1318 ],
1319 'selectors' => [
1320 '{{WRAPPER}} .usk-product-table-filters-wrapper' => 'text-align: {{VALUE}}',
1321 ],
1322 ]
1323 );
1324
1325 $this->add_group_control(
1326 Group_Control_Typography::get_type(),
1327 [
1328 'name' => 'typography_filter',
1329 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1330 //'scheme' => Schemes\Typography::TYPOGRAPHY_1,
1331 'selector' => '{{WRAPPER}} .usk-product-table-filters li',
1332 ]
1333 );
1334
1335 $this->add_control(
1336 'filter_spacing',
1337 [
1338 'label' => esc_html__('Bottom Space', 'ultimate-store-kit'),
1339 'type' => Controls_Manager::SLIDER,
1340 'selectors' => [
1341 '{{WRAPPER}} .usk-product-table-filters-wrapper' => 'margin-bottom: {{SIZE}}{{UNIT}}',
1342 ],
1343 ]
1344 );
1345
1346 $this->start_controls_tabs('tabs_style_desktop');
1347
1348 $this->start_controls_tab(
1349 'filter_tab_desktop',
1350 [
1351 'label' => __('Desktop', 'ultimate-store-kit')
1352 ]
1353 );
1354
1355 $this->add_control(
1356 'desktop_filter_normal',
1357 [
1358 'label' => esc_html__('Normal', 'ultimate-store-kit'),
1359 'type' => Controls_Manager::HEADING,
1360 ]
1361 );
1362
1363 $this->add_control(
1364 'color_filter',
1365 [
1366 'label' => esc_html__('Text Color', 'ultimate-store-kit'),
1367 'type' => Controls_Manager::COLOR,
1368 'separator' => 'before',
1369 'selectors' => [
1370 '{{WRAPPER}} .usk-product-table-filters li' => 'color: {{VALUE}}',
1371 ],
1372 ]
1373 );
1374
1375 $this->add_control(
1376 'desktop_filter_background',
1377 [
1378 'label' => esc_html__('Background', 'ultimate-store-kit'),
1379 'type' => Controls_Manager::COLOR,
1380 'selectors' => [
1381 '{{WRAPPER}} .usk-product-table-filters li' => 'background-color: {{VALUE}}',
1382 ],
1383 ]
1384 );
1385
1386 $this->add_responsive_control(
1387 'desktop_filter_padding',
1388 [
1389 'label' => __('Padding', 'ultimate-store-kit'),
1390 'type' => Controls_Manager::DIMENSIONS,
1391 'size_units' => ['px', 'em', '%'],
1392 'selectors' => [
1393 '{{WRAPPER}} .usk-product-table-filters li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
1394 ]
1395 ]
1396 );
1397
1398 $this->add_group_control(
1399 Group_Control_Border::get_type(),
1400 [
1401 'name' => 'desktop_filter_border',
1402 'placeholder' => '1px',
1403 'default' => '1px',
1404 'selector' => '{{WRAPPER}} .usk-product-table-filters li'
1405 ]
1406 );
1407
1408 $this->add_control(
1409 'desktop_filter_radius',
1410 [
1411 'label' => __('Radius', 'ultimate-store-kit'),
1412 'type' => Controls_Manager::DIMENSIONS,
1413 'size_units' => ['px', '%'],
1414 'selectors' => [
1415 '{{WRAPPER}} .usk-product-table-filters li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;'
1416 ]
1417 ]
1418 );
1419
1420 $this->add_group_control(
1421 Group_Control_Box_Shadow::get_type(),
1422 [
1423 'name' => 'desktop_filter_shadow',
1424 'selector' => '{{WRAPPER}} .usk-product-table-filters li'
1425 ]
1426 );
1427
1428 $this->add_control(
1429 'filter_item_spacing',
1430 [
1431 'label' => esc_html__('Space Between', 'ultimate-store-kit'),
1432 'type' => Controls_Manager::SLIDER,
1433 'selectors' => [
1434 '{{WRAPPER}} .usk-product-table-filters > li.usk-product-table-filter:not(:last-child)' => 'margin-right: calc({{SIZE}}{{UNIT}}/2)',
1435 '{{WRAPPER}} .usk-product-table-filters > li.usk-product-table-filter:not(:first-child)' => 'margin-left: calc({{SIZE}}{{UNIT}}/2)',
1436 ],
1437 ]
1438 );
1439
1440 $this->add_control(
1441 'desktop_filter_active',
1442 [
1443 'label' => esc_html__('Active', 'ultimate-store-kit'),
1444 'type' => Controls_Manager::HEADING,
1445 ]
1446 );
1447
1448 $this->add_control(
1449 'color_filter_active',
1450 [
1451 'label' => esc_html__('Text Color', 'ultimate-store-kit'),
1452 'type' => Controls_Manager::COLOR,
1453 'separator' => 'before',
1454 'selectors' => [
1455 '{{WRAPPER}} .usk-product-table-filters li.usk-active' => 'color: {{VALUE}}; border-bottom-color: {{VALUE}};',
1456 ],
1457 ]
1458 );
1459
1460 $this->add_control(
1461 'desktop_active_filter_background',
1462 [
1463 'label' => esc_html__('Background', 'ultimate-store-kit'),
1464 'type' => Controls_Manager::COLOR,
1465 'selectors' => [
1466 '{{WRAPPER}} .usk-product-table-filters li.usk-active' => 'background-color: {{VALUE}}',
1467 ],
1468 ]
1469 );
1470
1471 $this->add_control(
1472 'desktop_active_filter_border_color',
1473 [
1474 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1475 'type' => Controls_Manager::COLOR,
1476 'selectors' => [
1477 '{{WRAPPER}} .usk-product-table-filters li.usk-active' => 'border-color: {{VALUE}}',
1478 ],
1479 ]
1480 );
1481
1482 $this->add_control(
1483 'desktop_active_filter_radius',
1484 [
1485 'label' => __('Radius', 'ultimate-store-kit'),
1486 'type' => Controls_Manager::DIMENSIONS,
1487 'size_units' => ['px', '%'],
1488 'selectors' => [
1489 '{{WRAPPER}} .usk-product-table-filters li.usk-active' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;'
1490 ]
1491 ]
1492 );
1493
1494 $this->add_group_control(
1495 Group_Control_Box_Shadow::get_type(),
1496 [
1497 'name' => 'desktop_active_filter_shadow',
1498 'selector' => '{{WRAPPER}} .usk-product-table-filters li.usk-active'
1499 ]
1500 );
1501
1502 $this->end_controls_tab();
1503
1504 $this->start_controls_tab(
1505 'filter_tab_mobile',
1506 [
1507 'label' => __('Mobile', 'ultimate-store-kit')
1508 ]
1509 );
1510
1511 $this->add_control(
1512 'filter_mbtn_width',
1513 [
1514 'label' => __('Button Width(%)', 'ultimate-store-kit'),
1515 'type' => Controls_Manager::SLIDER,
1516 'range' => [
1517 'px' => [
1518 'min' => 2,
1519 'max' => 100
1520 ],
1521 ],
1522 'selectors' => [
1523 '{{WRAPPER}} .usk-button' => 'width: {{SIZE}}%;'
1524 ]
1525 ]
1526 );
1527
1528 $this->add_control(
1529 'filter_mbtn_color',
1530 [
1531 'label' => __('Button Text Color', 'ultimate-store-kit'),
1532 'type' => Controls_Manager::COLOR,
1533 'selectors' => [
1534 '{{WRAPPER}} .usk-button' => 'color: {{VALUE}};'
1535 ]
1536 ]
1537 );
1538
1539 $this->add_control(
1540 'filter_mbtn_background',
1541 [
1542 'label' => __('Button Background', 'ultimate-store-kit'),
1543 'type' => Controls_Manager::COLOR,
1544 'selectors' => [
1545 '{{WRAPPER}} .usk-button' => 'background-color: {{VALUE}};'
1546 ]
1547 ]
1548 );
1549
1550 $this->add_control(
1551 'filter_mbtn_dropdown_color',
1552 [
1553 'label' => __('Text Color', 'ultimate-store-kit'),
1554 'type' => Controls_Manager::COLOR,
1555 'selectors' => [
1556 '{{WRAPPER}} .usk-dropdown-nav li' => 'color: {{VALUE}};'
1557 ]
1558 ]
1559 );
1560
1561 $this->add_control(
1562 'filter_mbtn_dropdown_background',
1563 [
1564 'label' => __('Dropdown Background', 'ultimate-store-kit'),
1565 'type' => Controls_Manager::COLOR,
1566 'selectors' => [
1567 '{{WRAPPER}} .usk-dropdown' => 'background-color: {{VALUE}};'
1568 ]
1569 ]
1570 );
1571
1572 $this->add_group_control(
1573 Group_Control_Typography::get_type(),
1574 [
1575 'name' => 'filter_mbtn_dropdown_typography',
1576 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1577 //'scheme' => Schemes\Typography::TYPOGRAPHY_1,
1578 'selector' => '{{WRAPPER}} .usk-dropdown-nav li',
1579 ]
1580 );
1581
1582 $this->end_controls_tab();
1583
1584 $this->end_controls_tabs();
1585
1586 $this->end_controls_section();
1587
1588 $this->start_controls_section(
1589 'section_style_rating',
1590 [
1591 'label' => esc_html__('Rating', 'ultimate-store-kit'),
1592 'tab' => Controls_Manager::TAB_STYLE,
1593 'condition' => [
1594 'show_rating' => 'yes',
1595 ],
1596 ]
1597 );
1598
1599 $this->add_control(
1600 'rating_color',
1601 [
1602 'label' => esc_html__('Color', 'ultimate-store-kit'),
1603 'type' => Controls_Manager::COLOR,
1604 'default' => '#e7e7e7',
1605 'selectors' => [
1606 '{{WRAPPER}} .usk-wc-products .star-rating:before' => 'color: {{VALUE}};',
1607 ]
1608 ]
1609 );
1610
1611 $this->add_control(
1612 'active_rating_color',
1613 [
1614 'label' => esc_html__('Active Color', 'ultimate-store-kit'),
1615 'type' => Controls_Manager::COLOR,
1616 'default' => '#FFCC00',
1617 'selectors' => [
1618 '{{WRAPPER}} .usk-wc-products .star-rating span' => 'color: {{VALUE}};',
1619 ],
1620 ]
1621 );
1622
1623 // $this->add_responsive_control(
1624 // 'rating_margin',
1625 // [
1626 // 'label' => esc_html__('Margin', 'ultimate-store-kit'),
1627 // 'type' => Controls_Manager::DIMENSIONS,
1628 // 'size_units' => ['px', '%'],
1629 // 'selectors' => [
1630 // '{{WRAPPER}} .usk-wc-products .star-rating span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1631 // ],
1632 // ]
1633 // );
1634
1635 $this->end_controls_section();
1636
1637 $this->start_controls_section(
1638 'section_style_price',
1639 [
1640 'label' => esc_html__('Price', 'ultimate-store-kit'),
1641 'tab' => Controls_Manager::TAB_STYLE,
1642 'condition' => [
1643 'show_price' => 'yes',
1644 ],
1645 ]
1646 );
1647 $this->add_control(
1648 'regular_price_color',
1649 [
1650 'label' => esc_html__('Regular Color', 'ultimate-store-kit'),
1651 'type' => Controls_Manager::COLOR,
1652 'selectors' => [
1653 '{{WRAPPER}} .usk-wc-products .usk-wc-product .usk-wc-product-price del .woocommerce-Price-amount.amount' => 'color: {{VALUE}};',
1654 '{{WRAPPER}} .usk-wc-products .usk-item .usk-content .usk-wc-product .usk-wc-product-price del' => 'color: {{VALUE}};',
1655 ],
1656
1657 ]
1658 );
1659 $this->add_control(
1660 'sale_price_color',
1661 [
1662 'label' => esc_html__('Sale Color', 'ultimate-store-kit'),
1663 'type' => Controls_Manager::COLOR,
1664 'selectors' => [
1665 '{{WRAPPER}} .usk-wc-products .usk-wc-product .usk-wc-product-price' => 'color: {{VALUE}}',
1666 '{{WRAPPER}} .usk-wc-products .usk-wc-product .usk-wc-product-price ins span' => 'color: {{VALUE}}',
1667 '{{WRAPPER}} .usk-wc-products .usk-wc-product .usk-wc-product-price .woocommerce-Price-amount.amount' => 'color: {{VALUE}}',
1668 '{{WRAPPER}} .usk-wc-products .usk-wc-product .usk-wc-product-price > .woocommerce-Price-amount.amount bdi' => 'color: {{VALUE}}',
1669 ],
1670 ]
1671 );
1672 $this->add_group_control(
1673 Group_Control_Typography::get_type(),
1674 [
1675 'name' => 'sale_price_typography',
1676 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1677 'selector' => '
1678 {{WRAPPER}} .usk-wc-products .usk-wc-product .usk-wc-product-price .price',
1679 ]
1680 );
1681
1682 $this->end_controls_section();
1683 $this->start_controls_section(
1684 'section_style_quick_view',
1685 [
1686 'label' => esc_html__('Quick View', 'ultimate-store-kit'),
1687 'tab' => Controls_Manager::TAB_STYLE,
1688 'condition' => [
1689 'show_quick_view' => 'yes',
1690 ],
1691 ]
1692 );
1693
1694 $this->start_controls_tabs('tabs_quick_view_style');
1695
1696 $this->start_controls_tab(
1697 'tab_quick_view_normal',
1698 [
1699 'label' => esc_html__('Normal', 'ultimate-store-kit'),
1700 ]
1701 );
1702
1703 $this->add_control(
1704 'quick_view_text_color',
1705 [
1706 'label' => esc_html__('Color', 'ultimate-store-kit'),
1707 'type' => Controls_Manager::COLOR,
1708 'selectors' => [
1709 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-quick-view-title .usk-shoping-icon-quickview i' => 'color: {{VALUE}};',
1710 ],
1711 ]
1712 );
1713
1714 $this->add_control(
1715 'quick_view_background_color',
1716 [
1717 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
1718 'type' => Controls_Manager::COLOR,
1719 'selectors' => [
1720 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-quick-view-title .usk-shoping-icon-quickview' => 'background-color: {{VALUE}};',
1721 ],
1722 ]
1723 );
1724
1725 $this->add_group_control(
1726 Group_Control_Border::get_type(),
1727 [
1728 'name' => 'quick_view_border',
1729 'label' => esc_html__('Border', 'ultimate-store-kit'),
1730 'placeholder' => '1px',
1731 'default' => '1px',
1732 'selector' => '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-quick-view-title .usk-shoping-icon-quickview',
1733 'separator' => 'before',
1734 ]
1735 );
1736
1737 $this->add_control(
1738 'quick_view_border_radius',
1739 [
1740 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
1741 'type' => Controls_Manager::DIMENSIONS,
1742 'size_units' => ['px', '%'],
1743 'selectors' => [
1744 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-quick-view-title .usk-shoping-icon-quickview' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1745 ],
1746 ]
1747 );
1748
1749 $this->add_control(
1750 'quick_view_padding',
1751 [
1752 'label' => esc_html__('Padding', 'ultimate-store-kit'),
1753 'type' => Controls_Manager::DIMENSIONS,
1754 'size_units' => ['px', 'em', '%'],
1755 'selectors' => [
1756 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-quick-view-title .usk-shoping-icon-quickview' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1757 ],
1758 'separator' => 'before',
1759 ]
1760 );
1761
1762 $this->add_group_control(
1763 Group_Control_Box_Shadow::get_type(),
1764 [
1765 'name' => 'quick_view_shadow',
1766 'selector' => '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-quick-view-title .usk-shoping-icon-quickview',
1767 ]
1768 );
1769
1770 $this->add_group_control(
1771 Group_Control_Typography::get_type(),
1772 [
1773 'name' => 'quick_view_typography',
1774 'selector' => '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-quick-view-title .usk-shoping-icon-quickview i',
1775 'separator' => 'before',
1776 ]
1777 );
1778
1779 $this->end_controls_tab();
1780
1781 $this->start_controls_tab(
1782 'tab_quick_view_hover',
1783 [
1784 'label' => esc_html__('Hover', 'ultimate-store-kit'),
1785 ]
1786 );
1787
1788 $this->add_control(
1789 'quick_view_hover_color',
1790 [
1791 'label' => esc_html__('Color', 'ultimate-store-kit'),
1792 'type' => Controls_Manager::COLOR,
1793 'selectors' => [
1794 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-quick-view-title .usk-shoping-icon-quickview:hover i' => 'color: {{VALUE}};',
1795 ],
1796 ]
1797 );
1798
1799 $this->add_control(
1800 'quick_view_background_hover_color',
1801 [
1802 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
1803 'type' => Controls_Manager::COLOR,
1804 'selectors' => [
1805 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-quick-view-title .usk-shoping-icon-quickview:hover' => 'background-color: {{VALUE}};',
1806 ],
1807 ]
1808 );
1809
1810 $this->add_control(
1811 'quick_view_hover_border_color',
1812 [
1813 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1814 'type' => Controls_Manager::COLOR,
1815 'condition' => [
1816 'quick_view_border_border!' => '',
1817 ],
1818 'selectors' => [
1819 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-quick-view-title .usk-shoping-icon-quickview:hover' => 'border-color: {{VALUE}};',
1820 ],
1821 ]
1822 );
1823
1824 $this->end_controls_tab();
1825
1826 $this->end_controls_tabs();
1827
1828 $this->end_controls_section();
1829 $this->start_controls_section(
1830 'section_syle_quantity',
1831 [
1832 'label' => esc_html__('Quantity', 'ultimate-store-kit'),
1833 'tab' => Controls_Manager::TAB_STYLE,
1834 'condition' => [
1835 'show_quantity' => 'yes'
1836 ]
1837 ]
1838 );
1839 $this->add_control(
1840 'quantity_color',
1841 [
1842 'label' => esc_html__('Color', 'ultimate-store-kit'),
1843 'type' => Controls_Manager::COLOR,
1844 'selectors' => [
1845 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-wc-quantity .quantity input' => 'color: {{VALUE}}',
1846 ],
1847 ]
1848 );
1849
1850 $this->add_control(
1851 'quantity_border_color',
1852 [
1853 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
1854 'type' => Controls_Manager::COLOR,
1855 'selectors' => [
1856 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-wc-quantity .quantity input' => 'border-color: {{VALUE}}',
1857 ],
1858 ]
1859 );
1860 $this->add_group_control(
1861 Group_Control_Typography::get_type(),
1862 [
1863 'name' => 'quantity_typography',
1864 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1865 'selector' => '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-wc-quantity .quantity input',
1866 ]
1867 );
1868
1869 $this->end_controls_section();
1870 $this->start_controls_section(
1871 'section_style_button',
1872 [
1873 'label' => esc_html__('Cart', 'ultimate-store-kit'),
1874 'tab' => Controls_Manager::TAB_STYLE,
1875 'condition' => [
1876 'show_cart' => 'yes',
1877 ],
1878 ]
1879 );
1880
1881 $this->start_controls_tabs('tabs_button_style');
1882
1883 $this->start_controls_tab(
1884 'tab_button_normal',
1885 [
1886 'label' => esc_html__('Normal', 'ultimate-store-kit'),
1887 ]
1888 );
1889
1890 $this->add_control(
1891 'button_text_color',
1892 [
1893 'label' => esc_html__('Text Color', 'ultimate-store-kit'),
1894 'type' => Controls_Manager::COLOR,
1895 'default' => '',
1896 'selectors' => [
1897 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-wc-add-to-cart .button' => 'color: {{VALUE}};',
1898 ],
1899 ]
1900 );
1901
1902 $this->add_control(
1903 'background_color',
1904 [
1905 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
1906 'type' => Controls_Manager::COLOR,
1907 'selectors' => [
1908 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-wc-add-to-cart .button' => 'background-color: {{VALUE}};',
1909 ],
1910 ]
1911 );
1912
1913 $this->add_group_control(
1914 Group_Control_Border::get_type(),
1915 [
1916 'name' => 'border',
1917 'label' => esc_html__('Border', 'ultimate-store-kit'),
1918 'placeholder' => '1px',
1919 'default' => '1px',
1920 'selector' => '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-wc-add-to-cart .button',
1921 'separator' => 'before',
1922 ]
1923 );
1924
1925 $this->add_control(
1926 'border_radius',
1927 [
1928 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
1929 'type' => Controls_Manager::DIMENSIONS,
1930 'size_units' => ['px', '%'],
1931 'selectors' => [
1932 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-wc-add-to-cart .button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1933 ],
1934 ]
1935 );
1936
1937 $this->add_control(
1938 'button_padding',
1939 [
1940 'label' => esc_html__('Padding', 'ultimate-store-kit'),
1941 'type' => Controls_Manager::DIMENSIONS,
1942 'size_units' => ['px', 'em', '%'],
1943 'selectors' => [
1944 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-wc-add-to-cart .button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1945 ],
1946 'separator' => 'before',
1947 ]
1948 );
1949
1950 $this->add_control(
1951 'button_fullwidth',
1952 [
1953 'label' => esc_html__('Fullwidth Cart', 'ultimate-store-kit'),
1954 'type' => Controls_Manager::SWITCHER,
1955 'selectors' => [
1956 '{{WRAPPER}} .usk-wc-products .usk-wc-add-to-cart .button' => 'width: 100%;',
1957 ],
1958 'separator' => 'before',
1959 ]
1960 );
1961
1962 $this->add_group_control(
1963 Group_Control_Box_Shadow::get_type(),
1964 [
1965 'name' => 'button_shadow',
1966 'selector' => '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-wc-add-to-cart .button',
1967 ]
1968 );
1969
1970 $this->add_group_control(
1971 Group_Control_Typography::get_type(),
1972 [
1973 'name' => 'button_typography',
1974 'label' => esc_html__('Typography', 'ultimate-store-kit'),
1975 //'scheme' => Schemes\Typography::TYPOGRAPHY_4,
1976 'selector' => '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-wc-add-to-cart .button',
1977 'separator' => 'before',
1978 ]
1979 );
1980
1981 $this->end_controls_tab();
1982
1983 $this->start_controls_tab(
1984 'tab_button_hover',
1985 [
1986 'label' => esc_html__('Hover', 'ultimate-store-kit'),
1987 ]
1988 );
1989
1990 $this->add_control(
1991 'hover_color',
1992 [
1993 'label' => esc_html__('Text Color', 'ultimate-store-kit'),
1994 'type' => Controls_Manager::COLOR,
1995 'selectors' => [
1996 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-wc-add-to-cart .button:hover' => 'color: {{VALUE}};',
1997 ],
1998 ]
1999 );
2000
2001 $this->add_control(
2002 'button_background_hover_color',
2003 [
2004 'label' => esc_html__('Background Color', 'ultimate-store-kit'),
2005 'type' => Controls_Manager::COLOR,
2006 'selectors' => [
2007 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-wc-add-to-cart .button:hover' => 'background-color: {{VALUE}};',
2008 ],
2009 ]
2010 );
2011
2012 $this->add_control(
2013 'button_hover_border_color',
2014 [
2015 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
2016 'type' => Controls_Manager::COLOR,
2017 'condition' => [
2018 'border_border!' => '',
2019 ],
2020 'selectors' => [
2021 '{{WRAPPER}} .usk-wc-products-table .usk-wc-product .usk-wc-add-to-cart .button:hover' => 'border-color: {{VALUE}};',
2022 ],
2023 ]
2024 );
2025
2026 $this->end_controls_tab();
2027
2028 $this->end_controls_tabs();
2029
2030 $this->end_controls_section();
2031 $this->start_controls_section(
2032 'section_style_pagination',
2033 [
2034 'label' => esc_html__('Footer', 'ultimate-store-kit'),
2035 'tab' => Controls_Manager::TAB_STYLE,
2036 'condition' => [
2037 'show_pagination' => 'yes',
2038 ],
2039 ]
2040 );
2041
2042 $this->start_controls_tabs('tabs_datatable_footer_style');
2043
2044 $this->start_controls_tab(
2045 'tab_datatable_pagination',
2046 [
2047 'label' => esc_html__('Pagination', 'ultimate-store-kit'),
2048 ]
2049 );
2050
2051 $this->add_responsive_control(
2052 'pagination_spacing',
2053 [
2054 'label' => esc_html__('Spacing', 'ultimate-store-kit'),
2055 'type' => Controls_Manager::SLIDER,
2056 'selectors' => [
2057 '{{WRAPPER}} .usk-wc-product' => 'margin-bottom: {{SIZE}}px;',
2058 // '{{WRAPPER}} .dataTables_paginate' => 'margin-top: {{SIZE}}px;',
2059 ],
2060 ]
2061 );
2062
2063 $this->add_control(
2064 'pagination_color',
2065 [
2066 'label' => esc_html__('Color', 'ultimate-store-kit'),
2067 'type' => Controls_Manager::COLOR,
2068 'selectors' => [
2069 '{{WRAPPER}} ul.usk-pagination li a' => 'color: {{VALUE}};',
2070 '{{WRAPPER}} ul.usk-pagination li span' => 'color: {{VALUE}};',
2071 '{{WRAPPER}} .paginate_button' => 'color: {{VALUE}} !important;',
2072 ],
2073 ]
2074 );
2075
2076 $this->add_control(
2077 'active_pagination_color',
2078 [
2079 'label' => esc_html__('Active Color', 'ultimate-store-kit'),
2080 'type' => Controls_Manager::COLOR,
2081 'selectors' => [
2082 '{{WRAPPER}} ul.usk-pagination li.usk-active a' => 'color: {{VALUE}};',
2083 '{{WRAPPER}} .paginate_button.current' => 'color: {{VALUE}} !important;',
2084 ],
2085 ]
2086 );
2087
2088 $this->add_responsive_control(
2089 'pagination_margin',
2090 [
2091 'label' => esc_html__('Margin', 'ultimate-store-kit'),
2092 'type' => Controls_Manager::DIMENSIONS,
2093 'selectors' => [
2094 '{{WRAPPER}} ul.usk-pagination li a' => 'margin: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
2095 '{{WRAPPER}} ul.usk-pagination li span' => 'margin: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
2096 '{{WRAPPER}} .paginate_button' => 'margin: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
2097 ],
2098 ]
2099 );
2100
2101 $this->add_group_control(
2102 Group_Control_Typography::get_type(),
2103 [
2104 'name' => 'pagination_typography',
2105 'label' => esc_html__('Typography', 'ultimate-store-kit'),
2106 //'scheme' => Schemes\Typography::TYPOGRAPHY_4,
2107 'selector' => '{{WRAPPER}} ul.usk-pagination li a, {{WRAPPER}} ul.usk-pagination li span, {{WRAPPER}} .dataTables_paginate',
2108 ]
2109 );
2110
2111 $this->end_controls_tab();
2112
2113 $this->start_controls_tab(
2114 'tab_datatable_info',
2115 [
2116 'label' => __('Page Info', 'ultimate-store-kit'),
2117 ]
2118 );
2119
2120 $this->add_responsive_control(
2121 'info_spacing',
2122 [
2123 'label' => esc_html__('Spacing', 'ultimate-store-kit'),
2124 'type' => Controls_Manager::SLIDER,
2125 'selectors' => [
2126 '{{WRAPPER}} .dataTables_info' => 'margin-top: {{SIZE}}px;',
2127 ],
2128 ]
2129 );
2130
2131 $this->add_control(
2132 'info_color',
2133 [
2134 'label' => esc_html__('Color', 'ultimate-store-kit'),
2135 'type' => Controls_Manager::COLOR,
2136 'selectors' => [
2137 '{{WRAPPER}} .dataTables_info' => 'color: {{VALUE}};',
2138 ],
2139 ]
2140 );
2141
2142 $this->add_group_control(
2143 Group_Control_Typography::get_type(),
2144 [
2145 'name' => 'info_typography',
2146 'label' => esc_html__('Typography', 'ultimate-store-kit'),
2147 'selector' => '{{WRAPPER}} .dataTables_info',
2148 ]
2149 );
2150
2151 $this->end_controls_tab();
2152
2153
2154 $this->end_controls_tabs();
2155
2156 $this->end_controls_section();
2157 }
2158
2159 public function render_query() {
2160 $settings = $this->get_settings_for_display();
2161
2162 if (get_query_var('paged')) {
2163 $paged = get_query_var('paged');
2164 } elseif (get_query_var('page')) {
2165 $paged = get_query_var('page');
2166 } else {
2167 $paged = 1;
2168 }
2169
2170 $exclude_products = ($settings['exclude_products']) ? explode(',', $settings['exclude_products']) : [];
2171
2172 $query_args = array(
2173 'post_type' => 'product',
2174 'post_status' => 'publish',
2175 'posts_per_page' => $settings['posts_per_page'],
2176 'ignore_sticky_posts' => 1,
2177 'meta_query' => [],
2178 'tax_query' => ['relation' => 'AND'],
2179 'paged' => $paged,
2180 //'order' => $settings['order'],
2181 'post__not_in' => $exclude_products,
2182 );
2183
2184 $product_visibility_term_ids = wc_get_product_visibility_term_ids();
2185
2186
2187 if ('by_name' === $settings['source'] and !empty($settings['product_categories'])) {
2188 $query_args['tax_query'][] = [
2189 'taxonomy' => 'product_cat',
2190 'field' => 'slug',
2191 'terms' => $settings['product_categories'],
2192 'post__not_in' => $exclude_products,
2193 ];
2194 }
2195
2196 if ('yes' == $settings['hide_free']) {
2197 $query_args['meta_query'][] = [
2198 'key' => '_price',
2199 'value' => 0,
2200 'compare' => '>',
2201 'type' => 'DECIMAL',
2202 ];
2203 }
2204
2205 if ('yes' == $settings['hide_out_stock']) {
2206 $query_args['tax_query'][] = [
2207 [
2208 'taxonomy' => 'product_visibility',
2209 'field' => 'term_taxonomy_id',
2210 'terms' => $product_visibility_term_ids['outofstock'],
2211 'operator' => 'NOT IN',
2212 ],
2213 ]; // WPCS: slow query ok.
2214 }
2215
2216
2217 switch ($settings['show_product_type']) {
2218 case 'featured':
2219 $query_args['tax_query'][] = [
2220 'taxonomy' => 'product_visibility',
2221 'field' => 'term_taxonomy_id',
2222 'terms' => $product_visibility_term_ids['featured'],
2223 ];
2224 break;
2225 case 'onsale':
2226 $product_ids_on_sale = wc_get_product_ids_on_sale();
2227 $product_ids_on_sale[] = 0;
2228 $query_args['post__in'] = $product_ids_on_sale;
2229 break;
2230 }
2231
2232 return new WP_Query($query_args);
2233 }
2234
2235 public function render_header() {
2236
2237
2238 $settings = $this->get_settings();
2239 $id = $this->get_id();
2240 $page_length = (isset($settings['show_per_page']) && !empty($settings['show_per_page'])) ? $settings['show_per_page'] : '10';
2241
2242
2243 $this->add_render_attribute('wc-products', 'class', ['usk-wc-products', 'usk-wc-products-table']);
2244
2245 $this->add_render_attribute(
2246 [
2247 'wc-products' => [
2248 'data-settings' => [
2249 wp_json_encode([
2250 "order" => [],
2251 'paging' => ($settings['show_pagination'] == 'yes') ? true : false,
2252 // 'paging' => isset($settings['show_pagination']) == 'yes' ? true : false,
2253 'info' => ($settings['show_info'] == 'yes') && ($settings['show_pagination'] == 'yes') ? true : false,
2254 'bLengthChange' => ($settings['show_change_length']) ? true : false,
2255 'searching' => ($settings['show_searching'] == 'yes') ? true : false,
2256 'ordering' => ($settings['show_ordering']) ? true : false,
2257 'pageLength' => (int) $page_length,
2258 'orderColumn' => $settings['orderColumn'],
2259 'orderColumnQry' => $settings['orderColumnQry'],
2260 // 'hideHeader' => (!empty($settings['hide_header']) ? $settings['hide_header'] : 'no'),
2261 ])
2262 ]
2263 ]
2264 ]
2265 );
2266
2267 ?>
2268 <div <?php $this->print_render_attribute_string('wc-products'); ?>>
2269
2270 <?php
2271
2272 }
2273
2274 public function render_loop_item() {
2275 $settings = $this->get_settings();
2276 $id = 'usk-wc-products-table-' . $this->get_id();
2277
2278 // $wp_query = $this->render_query();
2279 $this->query_product();
2280 $wp_query = $this->get_query();
2281
2282
2283 if ($wp_query->have_posts()) {
2284
2285 $this->add_render_attribute('wc-product-table', 'class', ['usk-table-middle', 'usk-wc-product', 'usk-table', 'usk-table-striped']);
2286
2287 $this->add_render_attribute('wc-product-table', 'id', esc_attr($id));
2288
2289 if ($settings['cell_border']) {
2290 $this->add_render_attribute('wc-product-table', 'class', 'cell-border');
2291 }
2292
2293 if ($settings['stripe']) {
2294 $this->add_render_attribute('wc-product-table', 'class', 'stripe');
2295 }
2296
2297 if ($settings['hover_effect']) {
2298 $this->add_render_attribute('wc-product-table', 'class', 'hover');
2299 }
2300
2301 $this->add_render_attribute('usk-wc-product-title', 'class', 'usk-wc-product-title');
2302 $title_hide_on = ultimate_store_kit_hide_on_class($settings['title_hide_on']);
2303 $this->add_render_attribute('usk-title', ['class' => ['usk-title', $title_hide_on]], true);
2304
2305 $thumbs_hide_on = ultimate_store_kit_hide_on_class($settings['thumbs_hide_on']);
2306 $this->add_render_attribute('usk-thumb', ['class' => ['usk-thumb', $thumbs_hide_on]], true);
2307
2308 $description_hide_on = ultimate_store_kit_hide_on_class($settings['description_hide_on']);
2309 $this->add_render_attribute('usk-description', ['class' => ['usk-description', $description_hide_on]], true);
2310
2311 $categories_hide_on = ultimate_store_kit_hide_on_class($settings['categories_hide_on']);
2312 $this->add_render_attribute('usk-categories', ['class' => ['usk-categories', 'usk-product-table-align', $categories_hide_on]], true);
2313
2314 $tags_hide_on = ultimate_store_kit_hide_on_class($settings['tags_hide_on']);
2315 $this->add_render_attribute('usk-tags', ['class' => ['usk-tags', 'usk-product-table-align', $tags_hide_on]], true);
2316
2317 $rating_hide_on = ultimate_store_kit_hide_on_class($settings['rating_hide_on']);
2318 $this->add_render_attribute('usk-rating', ['class' => ['usk-rating', 'usk-product-table-align', $rating_hide_on]], true);
2319
2320 $price_hide_on = ultimate_store_kit_hide_on_class($settings['price_hide_on']);
2321 $this->add_render_attribute('usk-price', ['class' => ['usk-price', 'usk-product-table-align', $price_hide_on]], true);
2322
2323 $quick_view_hide_on = ultimate_store_kit_hide_on_class($settings['quick_view_hide_on']);
2324 $this->add_render_attribute('usk-quick-view', ['class' => ['usk-quick-view-title', 'usk-product-table-align', $quick_view_hide_on]], true);
2325
2326 $quantity_hide_on = ultimate_store_kit_hide_on_class($settings['quantity_hide_on']);
2327 $this->add_render_attribute('usk-quantity', ['class' => ['usk-quantity', 'usk-product-table-align', $quantity_hide_on]], true);
2328
2329 $cart_hide_on = ultimate_store_kit_hide_on_class($settings['cart_hide_on']);
2330 $this->add_render_attribute('usk-cart', ['class' => ['usk-cart', 'usk-product-table-align', $cart_hide_on]], true);
2331
2332
2333 ?>
2334 <table <?php $this->print_render_attribute_string('wc-product-table'); ?>>
2335 <thead>
2336 <tr>
2337 <?php if ($settings['show_thumb']) : ?>
2338 <th <?php $this->print_render_attribute_string('usk-thumb'); ?> data-orderable="false"><?php esc_html_e('Image', 'ultimate-store-kit'); ?></th>
2339 <?php endif; ?>
2340
2341 <?php if ($settings['show_title']) : ?>
2342 <th <?php $this->print_render_attribute_string('usk-title'); ?>>
2343 <?php esc_html_e('Title', 'ultimate-store-kit'); ?>
2344 </th>
2345 <?php endif; ?>
2346
2347 <?php if ($settings['show_description']) : ?>
2348 <th <?php $this->print_render_attribute_string('usk-description'); ?>><?php esc_html_e('Description', 'ultimate-store-kit'); ?></th>
2349 <?php endif; ?>
2350
2351
2352 <?php if ($settings['show_categories']) : ?>
2353 <th <?php $this->print_render_attribute_string('usk-categories'); ?>><?php esc_html_e('Categories', 'ultimate-store-kit'); ?></th>
2354 <?php endif; ?>
2355
2356 <?php if ($settings['show_tags']) : ?>
2357 <th <?php $this->print_render_attribute_string('usk-tags'); ?> data-orderable="false"><?php esc_html_e('Tags', 'ultimate-store-kit'); ?></th>
2358 <?php endif; ?>
2359
2360 <?php if ($settings['show_rating']) : ?>
2361 <th <?php $this->print_render_attribute_string('usk-rating'); ?> data-orderable="false"><?php esc_html_e('Rating', 'ultimate-store-kit'); ?></th>
2362 <?php endif; ?>
2363
2364 <?php if ($settings['show_price']) : ?>
2365 <th <?php $this->print_render_attribute_string('usk-price'); ?>><?php esc_html_e('Price', 'ultimate-store-kit'); ?></th>
2366 <?php endif; ?>
2367
2368 <?php if ($settings['show_quick_view']) : ?>
2369 <th <?php $this->print_render_attribute_string('usk-quick-view'); ?> data-orderable="false"><?php esc_html_e('Quick View', 'ultimate-store-kit'); ?></th>
2370 <?php endif; ?>
2371
2372 <?php if ($settings['show_quantity']) : ?>
2373 <th <?php $this->print_render_attribute_string('usk-quantity'); ?> data-orderable="false"><?php esc_html_e('Quantity', 'ultimate-store-kit'); ?></th>
2374 <?php endif; ?>
2375
2376 <?php if ($settings['show_cart']) : ?>
2377 <th <?php $this->print_render_attribute_string('usk-cart'); ?> data-orderable="false"><?php esc_html_e('Cart', 'ultimate-store-kit'); ?></th>
2378 <?php endif; ?>
2379
2380 </tr>
2381 </thead>
2382 <tbody>
2383 <?php
2384 while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
2385 <?php global $product;
2386 $average = $product->get_average_rating();
2387 $rating_count = $product->get_rating_count();
2388 ?>
2389 <tr>
2390 <?php if ($settings['show_thumb']) : ?>
2391 <td <?php $this->print_render_attribute_string('usk-thumb'); ?>>
2392 <?php $this->render_image($settings); ?>
2393 </td>
2394 <?php endif; ?>
2395
2396 <?php if ($settings['show_title']) : ?>
2397 <td <?php $this->print_render_attribute_string('usk-title'); ?>>
2398 <<?php echo esc_html($settings['title_tags']); ?> <?php $this->print_render_attribute_string('usk-wc-product-title'); ?>>
2399 <a href="<?php the_permalink(); ?>" class="usk-link-reset">
2400 <?php the_title(); ?>
2401 </a>
2402 </<?php echo esc_html($settings['title_tags']); ?>>
2403 </td>
2404 <?php endif; ?>
2405
2406 <?php if ($settings['show_description']) : ?>
2407 <td <?php $this->print_render_attribute_string('usk-description'); ?>>
2408 <div class="usk-wc-product-description">
2409 <?php echo wp_trim_words(get_the_excerpt(), $settings['description_limit'], '...'); ?>
2410 </div>
2411 </td>
2412 <?php endif; ?>
2413
2414 <?php if ($settings['show_categories']) : ?>
2415 <td <?php $this->print_render_attribute_string('usk-categories'); ?>>
2416 <span class="usk-wc-product-categories">
2417 <?php echo wc_get_product_category_list(get_the_ID(), ', ', '<span>', '</span>'); ?>
2418 </span>
2419 </td>
2420 <?php endif; ?>
2421
2422 <?php if ($settings['show_tags']) : ?>
2423 <td <?php $this->print_render_attribute_string('usk-tags'); ?>>
2424 <span class="usk-wc-product-tags">
2425 <?php echo wc_get_product_tag_list(get_the_ID(), ', ', '<span>', '</span>'); ?>
2426 </span>
2427 </td>
2428 <?php endif; ?>
2429
2430 <?php if ($settings['show_rating']) : ?>
2431 <td <?php $this->print_render_attribute_string('usk-rating'); ?>>
2432 <div class="usk-wc-rating">
2433 <?php echo $this->register_global_template_wc_rating($average, $rating_count); ?>
2434 </div>
2435 </td>
2436 <?php endif; ?>
2437
2438
2439 <?php if ($settings['show_price']) : ?>
2440 <td <?php $this->print_render_attribute_string('usk-price'); ?> data-order="<?php echo esc_attr($product->get_price()); ?>">
2441 <span class="usk-wc-product-price">
2442 <?php woocommerce_template_single_price(); ?>
2443 </span>
2444 </td>
2445 <?php endif; ?>
2446
2447
2448 <?php if ($settings['show_quick_view']) : ?>
2449 <td <?php $this->print_render_attribute_string('usk-quick-view'); ?>>
2450 <?php $this->register_global_template_quick_view($product->get_id(), 'top') ?>
2451 </td>
2452 <?php endif; ?>
2453
2454 <?php if ($settings['show_quantity']) : ?>
2455 <td <?php $this->print_render_attribute_string('usk-quantity'); ?>>
2456 <div class="usk-wc-quantity">
2457 <?php if ($product->is_purchasable() and $product->is_in_stock()) { ?>
2458 <?php if ($product->is_type('simple')) : ?>
2459 <?php woocommerce_quantity_input(); ?>
2460 <?php endif; ?>
2461 <?php } else {
2462 echo esc_html($product->get_stock_status());
2463 } ?>
2464 </div>
2465 </td>
2466 <?php endif; ?>
2467
2468 <?php if ($settings['show_cart']) : ?>
2469 <td <?php $this->print_render_attribute_string('usk-cart'); ?>>
2470 <div class="usk-wc-add-to-cart">
2471 <?php woocommerce_template_loop_add_to_cart(); ?>
2472 </div>
2473 </td>
2474 <?php endif; ?>
2475
2476 </tr>
2477
2478 <?php endwhile;
2479 wp_reset_postdata(); ?>
2480
2481 </tbody>
2482 </table>
2483 <?php
2484
2485 } else {
2486 echo '<div class="usk-alert-warning" usk-alert>' . esc_html__('Ops! There is no product', 'ultimate-store-kit') . '<div>';
2487 }
2488 }
2489
2490 public function render_image($settings) {
2491 $this->add_render_attribute('product_image_wrapper', 'class', 'usk-wc-product-image usk-display-inline-block', true);
2492
2493 if ('yes' === $settings['open_thumb_in_lightbox']) {
2494 $this->add_render_attribute('product_image', 'data-elementor-open-lightbox', 'yes', true); // no
2495 $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
2496 $this->add_render_attribute('product_image', 'href', $img_url[0], true);
2497 //$this->add_render_attribute( 'product_image_wrapper', 'usk-lightbox', '' );
2498 } else {
2499 $this->add_render_attribute('product_image', 'href', get_the_permalink(), true);
2500 }
2501
2502 ?>
2503 <div <?php $this->print_render_attribute_string('product_image_wrapper'); ?>>
2504 <a <?php $this->print_render_attribute_string('product_image'); ?>>
2505 <img src="<?php echo wp_get_attachment_image_url(get_post_thumbnail_id(), 'thumbnail'); ?>" alt="<?php echo get_the_title(); ?>">
2506 </a>
2507 </div>
2508 <?php
2509 }
2510
2511 public function render_footer() {
2512 ?>
2513 </div>
2514 <?php
2515 }
2516
2517 public function render() {
2518 $this->render_header();
2519 $this->render_loop_item();
2520 $this->render_footer();
2521 }
2522 public function query_product() {
2523 $default = $this->getGroupControlQueryArgs();
2524 $this->_query = new WP_Query($default);
2525 }
2526 }
2527