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

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