PluginProbe
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder / 1.6.3
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder v1.6.3
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.6.3, at modules/product-table/widgets/product-table.php

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