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

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