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

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