PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 1.0.0
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v1.0.0
4.9.2 4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 4.3.1 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.6.8 4.6.9 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 trunk 0.1.2-beta 0.1.3-beta 0.1.4-beta 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.8.0 1.8.1 1.9.0
shopengine / widgets / archive-products / archive-products.php
shopengine / widgets / archive-products Last commit date
screens 5 years ago archive-products-config.php 5 years ago archive-products.php 5 years ago
archive-products.php
2109 lines
1 <?php
2
3 namespace Elementor;
4
5 use ShopEngine\Widgets\Products;
6
7 defined('ABSPATH') || exit;
8
9
10 class ShopEngine_Archive_Products extends \ShopEngine\Base\Widget
11 {
12
13 public function config() {
14 return new ShopEngine_Archive_Products_Config();
15 }
16
17
18 protected function register_controls() {
19 /*
20 ===============================
21 Layout Panel
22 ===============================
23 */
24 $this->start_controls_section(
25 'shopengine_section_layout',
26 [
27 'label' => esc_html__('Layout', 'shopengine'),
28 'tab' => Controls_Manager::TAB_LAYOUT,
29 ]
30 );
31 $this->add_control(
32 'shopengine_hover_with_icon',
33 [
34 'label' => esc_html__('Hover Style with Icon', 'shopengine'),
35 'type' => Controls_Manager::SWITCHER,
36 'label_on' => esc_html__('Show', 'shopengine'),
37 'label_off' => esc_html__('Hide', 'shopengine'),
38 ]
39 );
40 $this->add_control(
41 'shopengine_use_layout',
42 [
43 'label' => esc_html__('Layout Settings', 'shopengine'),
44 'type' => Controls_Manager::SWITCHER,
45 'label_on' => esc_html__('Show', 'shopengine'),
46 'label_off' => esc_html__('Hide', 'shopengine'),
47 'return_value' => 'yes',
48 'default' => 'no',
49 'description' => esc_html__("By using layout control you can manage number of columns and rows form here. Note: Customizer layout control won't be working!", 'shopengine'),
50 ]
51 );
52
53 $this->add_responsive_control(
54 'shopengine_columns',
55 [
56 'label' => esc_html__('Products per row', 'shopengine'),
57 'description' => esc_html__('How many products should be shown per row?', 'shopengine'),
58 'type' => Controls_Manager::SLIDER,
59 'condition' => [
60 'shopengine_use_layout' => 'yes',
61 ],
62 'range' => [
63 'px' => [
64 'min' => 1,
65 'max' => 12,
66 ],
67 ],
68 'default' => [
69 'size' => 4,
70 ],
71
72 'selectors' => [
73 '{{WRAPPER}} .shopengine-archive-products.shopengine-grid ul.products' => 'grid-template-columns: repeat({{SIZE}}, 1fr) !important;',
74 ],
75 ]
76 );
77
78 $this->add_control(
79 'shopengine_rows',
80 [
81 'label' => esc_html__('Rows per page', 'shopengine'),
82 'description' => esc_html__('How many rows of products should be shown per page?', 'shopengine'),
83 'type' => Controls_Manager::SLIDER,
84 'condition' => [
85 'shopengine_use_layout' => 'yes',
86 ],
87 'range' => [
88 'px' => [
89 'min' => 1,
90 'max' => 20,
91 ],
92 ],
93 'default' => [
94 'size' => 4,
95 ],
96 ]
97 );
98
99
100 $this->end_controls_section(); // end ./ Layout Panel
101
102 /*
103 ============================
104 Content Panel
105 ============================
106 */
107
108 $this->start_controls_section(
109 'shopengine_section_content',
110 [
111 'label' => esc_html__('Content', 'shopengine'),
112 'tab' => Controls_Manager::TAB_LAYOUT,
113 ]
114 );
115
116 $this->add_control(
117 'shopengine_show_sale_flash',
118 [
119 'label' => esc_html__('Flash Sale badge', 'shopengine'),
120 'type' => Controls_Manager::SWITCHER,
121 'label_on' => esc_html__('Show', 'shopengine'),
122 'label_off' => esc_html__('Hide', 'shopengine'),
123 'return_value' => 'yes',
124 'default' => 'yes',
125 'selectors' => [
126 '{{WRAPPER}} .shopengine-archive-products .product .onsale' => 'display: block;',
127 ],
128 ]
129 );
130
131 $this->add_control(
132 'shopengine_is_cats',
133 [
134 'label' => esc_html__('Show categories', 'shopengine'),
135 'type' => Controls_Manager::SWITCHER,
136 'label_on' => esc_html__('Show', 'shopengine'),
137 'label_off' => esc_html__('Hide', 'shopengine'),
138 'return_value' => 'yes',
139 'default' => 'yes',
140 ]
141 );
142
143 $this->add_control(
144 'shopengine_is_details',
145 [
146 'label' => esc_html__('Show description', 'shopengine'),
147 'type' => Controls_Manager::SWITCHER,
148 'label_on' => esc_html__('Show', 'shopengine'),
149 'label_off' => esc_html__('Hide', 'shopengine'),
150 'return_value' => 'yes',
151 'default' => 'no',
152 ]
153 );
154
155 $this->add_control(
156 'shopengine_archive_product_show_rating',
157 [
158 'label' => esc_html__('Rating', 'shopengine'),
159 'type' => Controls_Manager::SWITCHER,
160 'label_on' => esc_html__('Show', 'shopengine'),
161 'label_off' => esc_html__('Hide', 'shopengine'),
162 'return_value' => 'yes',
163 'default' => 'yes',
164 'selectors' => [
165 '{{WRAPPER}} .shopengine-archive-products :is(.shopengine-product-rating-review-count, .star-rating) ' => 'display: inline-flex;',
166 ],
167 ]
168 );
169
170 $this->add_control(
171 'shopengine_show_regular_price',
172 [
173 'label' => esc_html__('Show Regular Price', 'shopengine'),
174 'type' => Controls_Manager::SWITCHER,
175 'label_on' => esc_html__('Show', 'shopengine'),
176 'label_off' => esc_html__('Hide', 'shopengine'),
177 'return_value' => 'yes',
178 'default' => 'yes',
179 'selectors' => [
180 '{{WRAPPER}} .shopengine-archive-products .product .price del' => 'display: block;',
181 ],
182 ]
183 );
184
185 $this->add_control(
186 'shopengine_show_off_tag',
187 [
188 'label' => esc_html__('Show Price OFF tag', 'shopengine'),
189 'type' => Controls_Manager::SWITCHER,
190 'label_on' => esc_html__('Show', 'shopengine'),
191 'label_off' => esc_html__('Hide', 'shopengine'),
192 'default' => 'yes',
193 'selectors' => [
194 '{{WRAPPER}} .shopengine-archive-products .price .shopengine-discount-badge' => 'display: block;',
195 ],
196 ]
197 );
198
199 $this->add_control(
200 'shopengine_group_btns',
201 [
202 'label' => esc_html__('Button Group', 'shopengine'),
203 'type' => Controls_Manager::SWITCHER,
204 'label_on' => esc_html__('Show', 'shopengine'),
205 'label_off' => esc_html__('Hide', 'shopengine'),
206 ]
207 );
208
209 $this->add_control(
210 'shopengine_is_hover_details',
211 [
212 'label' => esc_html__('Footer on hover style', 'shopengine'),
213 'type' => Controls_Manager::SWITCHER,
214 'label_on' => esc_html__('Show', 'shopengine'),
215 'label_off' => esc_html__('Hide', 'shopengine'),
216 'return_value' => 'yes',
217 'default' => 'no',
218 ]
219 );
220
221 $this->end_controls_section(); // end ./ Content Panel
222
223 /*
224 ===============================
225 pagination settings
226 ===============================
227 */
228
229 $this->start_controls_section(
230 'shopengine_pagination_settings',
231 [
232 'label' => esc_html__('Pagination', 'shopengine'),
233 'tab' => Controls_Manager::TAB_LAYOUT,
234 ]
235 );
236
237 $this->add_control(
238 'shopengine_pagination_style',
239 [
240 'label' => esc_html__('Pagination Style', 'shopengine'),
241 'type' => Controls_Manager::SELECT,
242 'default' => 'numeric',
243 'options' => [
244 'numeric' => esc_html__('Numeric', 'shopengine'),
245 'default' => esc_html__('Default', 'shopengine'),
246 'load-more' => esc_html__('Load More', 'shopengine'),
247 'load-more-on-scroll' => esc_html__('Load More On Scroll', 'shopengine'),
248 ],
249 ]
250 );
251
252
253 $this->add_control(
254 'shopengine_pagination_prev_icon',
255 [
256 'label' => esc_html__('Previous icon', 'shopengine'),
257 'type' => Controls_Manager::ICONS,
258 'default' => [
259 'value' => 'fas fa-angle-left',
260 'library' => 'fa-solid',
261 ],
262 'condition' => [
263 'shopengine_pagination_style' => 'numeric',
264 ],
265 ]
266 );
267
268 $this->add_control(
269 'shopengine_pagination_next_icon',
270 [
271 'label' => esc_html__('Next icon', 'shopengine'),
272 'type' => Controls_Manager::ICONS,
273 'default' => [
274 'value' => 'fas fa-angle-right',
275 'library' => 'fa-solid',
276 ],
277 'condition' => [
278 'shopengine_pagination_style' => 'numeric',
279 ],
280 ]
281 );
282
283 $this->add_control(
284 'shopengine_pagination_prev_text',
285 [
286 'label' => esc_html__('Previous button', 'shopengine'),
287 'type' => Controls_Manager::TEXT,
288 'default' => esc_html__('Previous', 'shopengine'),
289 'placeholder' => esc_html__('Enter previous button text', 'shopengine'),
290 'condition' => [
291 'shopengine_pagination_style' => 'default',
292 ],
293 ]
294 );
295
296 $this->add_control(
297 'shopengine_pagination_next_text',
298 [
299 'label' => esc_html__('Next button', 'shopengine'),
300 'type' => Controls_Manager::TEXT,
301 'default' => esc_html__('Next', 'shopengine'),
302 'placeholder' => esc_html__('Enter Next button text', 'shopengine'),
303 'condition' => [
304 'shopengine_pagination_style' => 'default',
305 ],
306 ]
307 );
308
309 $this->add_control(
310 'shopengine_pagination_loadmore_text',
311 [
312 'label' => esc_html__('Load more button text', 'shopengine'),
313 'type' => Controls_Manager::TEXT,
314 'default' => esc_html__('Load More', 'shopengine'),
315 'placeholder' => esc_html__('Enter load more button text', 'shopengine'),
316 'label_block' => true,
317 'conditions' => [
318 'relation' => 'or',
319 'terms' => [
320 [
321 'name' => 'shopengine_pagination_style',
322 'operator' => '==',
323 'value' => 'load-more',
324 ],
325 [
326 'name' => 'shopengine_pagination_style',
327 'operator' => '==',
328 'value' => 'load-more-on-scroll',
329 ],
330 ],
331 ],
332 ]
333 );
334
335 $this->end_controls_section(); // end ./ Content Panel
336
337 /*
338 ===============================
339 Custom Ordering settings
340 ===============================
341 */
342
343 $this->start_controls_section(
344 'shopengine_custom_ordering_settings',
345 [
346 'label' => esc_html__('Custom Ordering', 'shopengine'),
347 'tab' => Controls_Manager::TAB_LAYOUT,
348 ]
349 );
350
351 $this->add_control(
352 'shopengine_add_to_cart_data_ordering_enable',
353 [
354 'label' => esc_html__('Enable Ordering?', 'shopengine'),
355 'type' => Controls_Manager::SWITCHER,
356 'label_on' => esc_html__('Yes', 'shopengine'),
357 'label_off' => esc_html__('No', 'shopengine'),
358 'default' => "yes",
359 'return_value' => "yes",
360 'selectors' => [
361 '{{WRAPPER}} .shopengine-archive-products.shopengine-hover-disable .products .product' => 'display: flex; flex-direction: row; flex-wrap: wrap; align-items: center;',
362 '{{WRAPPER}} .shopengine-archive-products.shopengine-hover-disable .products .product a.woocommerce-LoopProduct-link' => 'width: 100%; order: -99;',
363 '{{WRAPPER}} .shopengine-archive-products .shopengine-product-description-btn-group' => 'display: flex; flex-direction: row; flex-wrap: wrap; align-items: center;',
364 ],
365 ]
366 );
367
368 $this->add_control(
369 'shopengine_add_to_cart_data_ordering_note',
370 [
371 'type' => Controls_Manager::RAW_HTML,
372 'raw' => esc_html__('Ordering the positions of wishlist, quick view, add to cart button, and comparison. Use minus value for most priority. So that Ordering will not change ever if something added new by the hook.', 'shopengine'),
373 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
374 'condition' => [
375 'shopengine_add_to_cart_data_ordering_enable' => 'yes',
376 ]
377 ]
378 );
379
380 $this->add_control(
381 'shopengine_quick_view_position',
382 [
383 'label' => esc_html__('Quick View Position', 'shopengine'),
384 'type' => Controls_Manager::NUMBER,
385 'min' => -4,
386 'max' => 4,
387 'step' => 1,
388 'default' => -4,
389 'selectors' => [
390 '{{WRAPPER}} .shopengine-archive-products .shopengine-quickview-trigger' => 'order: {{VALUE}};',
391 ],
392 'condition' => [
393 'shopengine_add_to_cart_data_ordering_enable' => 'yes',
394 ]
395 ]
396 );
397
398 $this->add_control(
399 'shopengine_wishlist_position',
400 [
401 'label' => esc_html__('Wishlist Position', 'shopengine'),
402 'type' => Controls_Manager::NUMBER,
403 'min' => -4,
404 'max' => 4,
405 'step' => 1,
406 'default' => -3,
407 'selectors' => [
408 '{{WRAPPER}} .shopengine-archive-products .shopengine-wishlist' => 'order: {{VALUE}};',
409 ],
410 'condition' => [
411 'shopengine_add_to_cart_data_ordering_enable' => 'yes',
412 ]
413 ]
414 );
415
416 $this->add_control(
417 'shopengine_add_to_cart_position',
418 [
419 'label' => esc_html__('Add to Cart Position', 'shopengine'),
420 'type' => Controls_Manager::NUMBER,
421 'min' => -4,
422 'max' => 4,
423 'step' => 1,
424 'default' => -2,
425 'selectors' => [
426 '{{WRAPPER}} .shopengine-archive-products a.add_to_cart_button' => 'order: {{VALUE}};',
427 '{{WRAPPER}} .shopengine-archive-products a.product_type_variable' => 'order: {{VALUE}};',
428 '{{WRAPPER}} .shopengine-archive-products a.product_type_grouped' => 'order: {{VALUE}};',
429 ],
430 'condition' => [
431 'shopengine_add_to_cart_data_ordering_enable' => 'yes',
432 ]
433 ]
434 );
435
436 $this->add_control(
437 'shopengine_comparison_position',
438 [
439 'label' => esc_html__('Comparison Position', 'shopengine'),
440 'type' => Controls_Manager::NUMBER,
441 'min' => -4,
442 'max' => 4,
443 'step' => 1,
444 'default' => -1,
445 'selectors' => [
446 '{{WRAPPER}} .shopengine-archive-products .shopengine-comparison' => 'order: {{VALUE}};',
447 ],
448 'condition' => [
449 'shopengine_add_to_cart_data_ordering_enable' => 'yes',
450 ]
451 ]
452 );
453
454 $this->end_controls_section(); // end ./ Content Panel
455
456
457 /*
458 ---------------------------------
459 Container controls
460 ---------------------------------
461 */
462 $this->start_controls_section(
463 'shopengine_section_container_styles',
464 [
465 'label' => esc_html__('Product Container', 'shopengine'),
466 'tab' => Controls_Manager::TAB_STYLE,
467 ]
468 );
469
470 $this->add_responsive_control(
471 'shopengine_container_text_align',
472 [
473 'label' => esc_html__('Alignment', 'shopengine'),
474 'type' => Controls_Manager::CHOOSE,
475 'options' => [
476 'left' => [
477 'title' => esc_html__('Left', 'shopengine'),
478 'icon' => 'fa fa-align-left',
479 ],
480 'center' => [
481 'title' => esc_html__('Center', 'shopengine'),
482 'icon' => 'fa fa-align-center',
483 ],
484 'right' => [
485 'title' => esc_html__('Right', 'shopengine'),
486 'icon' => 'fa fa-align-right',
487 ],
488 ],
489 'default' => 'left',
490 'selectors_dictionary' => [
491 'left' => 'text-align: left; -webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start;',
492 'center' => 'text-align: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;',
493 'right' => 'text-align: right; -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end;',
494 ],
495 'selectors' => [
496 '{{WRAPPER}} .shopengine-archive-products .product' => '{{VALUE}}',
497 '{{WRAPPER}} .shopengine-archive-products .shopengine-product-description-btn-group' => '{{VALUE}}',
498 ],
499 'separator' => 'after',
500 ]
501 );
502
503 $this->add_control(
504 'shopengine_background',
505 [
506 'label' => esc_html__('Background Color', 'shopengine'),
507 'type' => Controls_Manager::COLOR,
508 'alpha' => false,
509 'selectors' => [
510 '{{WRAPPER}} .shopengine-archive-products .product' => 'background-color: {{VALUE}};',
511 '{{WRAPPER}} .shopengine-archive-products .product .shopengine-product-description-footer' => 'background-color: {{VALUE}};',
512 ],
513 ]
514 );
515
516 $this->add_group_control(
517 Group_Control_Border::get_type(),
518 [
519 'name' => 'shopengine__border',
520 'selector' => '{{WRAPPER}} .shopengine-archive-products .product',
521 'fields_options' => [
522 'color' => [
523 'label' => esc_html__('Border Color', 'shopengine'),
524 'responsive' => true,
525 ],
526 ],
527 ]
528 );
529
530 $this->add_responsive_control(
531 'shopengine_margin',
532 [
533 'label' => esc_html__('Product Gap', 'shopengine'),
534 'type' => Controls_Manager::SLIDER,
535 'condition' => [
536 'shopengine_use_layout' => 'yes',
537 ],
538 'range' => [
539 'px' => [
540 'min' => 0,
541 'max' => 200,
542 ],
543 ],
544 'default' => [
545 'size' => 20,
546 ],
547
548 'selectors' => [
549 '{{WRAPPER}} .shopengine-archive-products.shopengine-grid ul.products' => 'grid-gap: {{SIZE}}{{UNIT}} !important;',
550 ],
551 ]
552 );
553
554 $this->add_group_control(
555 Group_Control_Box_Shadow::get_type(),
556 [
557 'name' => 'shopengine_container_shadow_on_hover',
558 'label' => esc_html__('Box Shadow on hover', 'shopengine'),
559 'selector' => '{{WRAPPER}} .shopengine-archive-products .product:hover',
560 'fields_options' => [
561 'box_shadow' => [
562 'default' => [
563 'horizontal' => 5,
564 'vertical' => 30,
565 'blur' => 35,
566 'spread' => 0,
567 'color' => 'rgba(0,0,0,0.16)',
568 ],
569 ],
570
571 ],
572 ]
573 );
574
575 $this->add_responsive_control(
576 'shopengine_archive_products_container_row_spacing',
577 [
578 'label' => esc_html__('Row Spacing (px)', 'shopengine'),
579 'type' => Controls_Manager::SLIDER,
580 'size_units' => ['px'],
581 'default' => [
582 'size' => 50,
583 ],
584 'selectors' => [
585 '{{WRAPPER}} .shopengine-archive-products .products .product' => 'margin-bottom: {{SIZE}}px;',
586 ],
587 'separator' => 'before',
588 ]
589 );
590
591 $this->add_responsive_control(
592 'shopengine_padding',
593 [
594 'label' => esc_html__('Padding', 'shopengine'),
595 'type' => Controls_Manager::DIMENSIONS,
596 'size_units' => ['px'],
597 'selectors' => [
598 '{{WRAPPER}} .shopengine-archive-products .product' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
599 ],
600 ]
601 );
602
603 $this->end_controls_section();
604
605 /*
606 =============================
607 Product Image section
608 =============================
609 */
610 $this->start_controls_section(
611 'shopengine_section_style_img',
612 [
613 'label' => esc_html__('Product Image', 'shopengine'),
614 'tab' => Controls_Manager::TAB_STYLE,
615 ]
616 );
617 $this->add_control(
618 'shopengine_image_bg_color',
619 [
620 'label' => esc_html__('Background Color', 'shopengine'),
621 'type' => Controls_Manager::COLOR,
622 'alpha' => false,
623 'selectors' => [
624 '{{WRAPPER}} .shopengine-archive-products .product .attachment-woocommerce_thumbnail' => 'background-color: {{VALUE}};',
625 ],
626 ]
627 );
628
629 $this->add_control(
630 'shopengine_image_height_switch',
631 [
632 'label' => esc_html__('Use image height', 'shopengine'),
633 'type' => Controls_Manager::SWITCHER,
634 'label_on' => esc_html__('Show', 'shopengine'),
635 'label_off' => esc_html__('Hide', 'shopengine'),
636 'return_value' => 'yes',
637 'default' => '',
638 ]
639 );
640
641 $this->add_responsive_control(
642 'shopengine_image_height',
643 [
644 'label' => esc_html__('Height', 'shopengine'),
645 'type' => Controls_Manager::SLIDER,
646 'size_units' => ['px'],
647 'range' => [
648 'px' => [
649 'min' => 0,
650 'max' => 600,
651 'step' => 5,
652 ],
653 ],
654 'default' => [
655 'size' => 255,
656 ],
657 'selectors' => [
658 '{{WRAPPER}} .shopengine-archive-products .product .attachment-woocommerce_thumbnail' => 'height: {{SIZE}}{{UNIT}};',
659 ],
660 'condition' => ['shopengine_image_height_switch' => 'yes'],
661 ]
662 );
663
664 $this->add_responsive_control(
665 'shopengine_image_padding',
666 [
667 'label' => esc_html__('Padding', 'shopengine'),
668 'type' => Controls_Manager::DIMENSIONS,
669 'size_units' => ['px'],
670 'selectors' => [
671 '{{WRAPPER}} .shopengine-archive-products .product .attachment-woocommerce_thumbnail' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
672 ],
673 'separator' => 'before',
674 ]
675 );
676 $this->end_controls_section();
677
678 /*
679 =============================
680 Product Category style
681 =============================
682 */
683 $this->start_controls_section(
684 'shopengine_section_style_cats',
685 [
686 'label' => esc_html__('Product Categories', 'shopengine'),
687 'tab' => Controls_Manager::TAB_STYLE,
688 'condition' => [
689 'shopengine_is_cats' => 'yes',
690 ],
691 ]
692 );
693 $this->add_control(
694 'shopengine_cats_max',
695 [
696 'label' => esc_html__('Max Categories', 'shopengine'),
697 'type' => Controls_Manager::NUMBER,
698 'separator' => 'after',
699 'default' => 1,
700 ]
701 );
702
703 $this->add_control(
704 'shopengine_cats_color',
705 [
706 'label' => esc_html__('Color', 'shopengine'),
707 'type' => Controls_Manager::COLOR,
708 'alpha' => false,
709 'default' => '#858585',
710 'selectors' => [
711 '{{WRAPPER}} .shopengine-archive-products .product-categories' => 'color: {{VALUE}};',
712 ],
713 ]
714 );
715
716 $this->add_group_control(
717 Group_Control_Typography::get_type(),
718 [
719 'name' => 'shopengine_cats_font',
720 'label' => esc_html__('Typography', 'shopengine'),
721 'selector' => '{{WRAPPER}} .shopengine-archive-products .product-categories > li',
722 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'],
723 'fields_options' => [
724 'typography' => [
725 'default' => 'custom',
726 ],
727 'font_weight' => [
728 'default' => '400',
729 ],
730 'font_size' => [
731 'label' => esc_html__('Font Size (px)', 'shopengine'),
732 'default' => [
733 'size' => '13',
734 'unit' => 'px',
735 ],
736 'responsive' => false,
737 'size_units' => ['px'],
738 ],
739 'line_height' => [
740 'label' => esc_html__('Line-height (px)', 'shopengine'),
741 'default' => [
742 'size' => '14',
743 'unit' => 'px',
744 ],
745 'responsive' => false,
746 'size_units' => ['px'],
747 ],
748 ],
749 ]
750 );
751
752
753 $this->add_control(
754 'shopengine_cats_spacing',
755 [
756 'label' => esc_html__('Padding', 'shopengine'),
757 'type' => Controls_Manager::DIMENSIONS,
758 'size_units' => ['px'],
759 'default' => [
760 'top' => '15',
761 'right' => '0',
762 'bottom' => '5',
763 'left' => '0',
764 'isLinked' => false,
765 'unit' => 'px',
766 ],
767 'selectors' => [
768 '{{WRAPPER}} .shopengine-archive-products .product-categories' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
769 ],
770 'separator' => 'before',
771 ]
772 );
773 $this->end_controls_section();
774
775 /*
776 =============================
777 product title start
778 =============================
779 */
780
781 $this->start_controls_section(
782 'shopengine_section_style_title',
783 [
784 'label' => esc_html__('Product Title', 'shopengine'),
785 'tab' => Controls_Manager::TAB_STYLE,
786 ]
787 );
788
789 $this->add_control(
790 'shopengine_title_color',
791 [
792 'label' => esc_html__('Color', 'shopengine'),
793 'type' => Controls_Manager::COLOR,
794 'default' => '#101010',
795 'alpha' => false,
796 'selectors' => [
797 '{{WRAPPER}} .shopengine-archive-products .product .woocommerce-loop-product__title' => 'color: {{VALUE}};',
798 ],
799 ]
800 );
801
802 $this->add_control(
803 'shopengine_title_hover_color',
804 [
805 'label' => esc_html__( 'Hover Color', 'shopengine' ),
806 'type' => Controls_Manager::COLOR,
807 'alpha' => false,
808 'selectors' => [
809 '{{WRAPPER}} .shopengine-archive-products .product a:hover .woocommerce-loop-product__title' => 'color: {{VALUE}};',
810 ],
811 ]
812 );
813
814 $this->add_group_control(
815 Group_Control_Typography::get_type(),
816 [
817 'name' => 'shopengine_title_color_typography',
818 'label' => esc_html__('Typography', 'shopengine'),
819 'selector' => '{{WRAPPER}} .shopengine-archive-products .product .woocommerce-loop-product__title',
820 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'],
821 'fields_options' => [
822 'typography' => [
823 'default' => 'custom',
824 ],
825 'font_weight' => [
826 'default' => '500',
827 ],
828 'font_size' => [
829 'label' => esc_html__('Font Size (px)', 'shopengine'),
830 'default' => [
831 'size' => '16',
832 'unit' => 'px',
833 ],
834 'responsive' => false,
835 'size_units' => ['px'],
836 ],
837 'text_transform' => [
838 'default' => 'capitalize',
839 ],
840 'line_height' => [
841 'label' => esc_html__('Line Height (px)', 'shopengine'),
842 'default' => [
843 'size' => '18',
844 'unit' => 'px',
845 ],
846 'responsive' => false,
847 'size_units' => ['px'] // enable only px
848 ],
849 ],
850 ]
851 );
852
853
854 $this->add_responsive_control(
855 'shopengine_title_padding',
856 [
857 'label' => esc_html__('Padding', 'shopengine'),
858 'type' => Controls_Manager::DIMENSIONS,
859 'size_units' => ['px'],
860 'selectors' => [
861 '{{WRAPPER}} .shopengine-archive-products .product .woocommerce-loop-product__title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
862 ],
863 'separator' => 'before',
864 ]
865 );
866 $this->end_controls_section();
867
868 /*
869 =============================
870 product price start
871 =============================
872 */
873 $this->start_controls_section(
874 'shopengine_section_style_price',
875 [
876 'label' => esc_html__('Product Price', 'shopengine'),
877 'tab' => Controls_Manager::TAB_STYLE,
878 ]
879 );
880 $this->add_control(
881 'shopengine_sell_price_color',
882 [
883 'label' => esc_html__('Color', 'shopengine'),
884 'type' => Controls_Manager::COLOR,
885 'default' => '#101010',
886 'alpha' => false,
887 'selectors' => [
888 '{{WRAPPER}} .shopengine-archive-products .product .price' => 'color: {{VALUE}};',
889 ],
890 ]
891 );
892
893 $this->add_group_control(
894 Group_Control_Typography::get_type(),
895 [
896 'name' => 'shopengine_product_price_typography',
897 'label' => esc_html__('Typography', 'shopengine'),
898 'selector' => '{{WRAPPER}} .shopengine-archive-products .product .price .amount',
899 'exclude' => ['font_family', 'text_transform', 'font_style', 'text_decoration', 'letter_spacing'],
900 'fields_options' => [
901 'typography' => [
902 'default' => 'custom',
903 ],
904 'font_weight' => [
905 'default' => '700',
906 ],
907 'font_size' => [
908 'label' => esc_html__('Font Size (px)', 'shopengine'),
909 'default' => [
910 'size' => '18',
911 'unit' => 'px',
912 ],
913 'responsive' => false,
914 'size_units' => ['px'],
915 ],
916 'line_height' => [
917 'label' => esc_html__('Line Height (px)', 'shopengine'),
918 'default' => [
919 'size' => '22',
920 'unit' => 'px',
921 ],
922 'responsive' => false,
923 'size_units' => ['px'],
924 ],
925 ],
926 ]
927 );
928
929 $this->add_control(
930 'shopengine_price_reg_head',
931 [
932 'label' => esc_html__('Regular Price', 'shopengine'),
933 'type' => Controls_Manager::HEADING,
934 'separator' => 'before',
935 'condition' => [
936 'shopengine_show_regular_price' => 'yes',
937 ],
938 ]
939 );
940
941 $this->add_control(
942 'shopengine_price_reg_pos',
943 [
944 'label' => esc_html__('Position', 'shopengine'),
945 'type' => Controls_Manager::SELECT,
946 'options' => [
947 'before' => esc_html__('Before', 'shopengine'),
948 'after' => esc_html__('After', 'shopengine'),
949 ],
950 'default' => 'before',
951 'prefix_class' => 'shopengine-price-pos-',
952 'condition' => [
953 'shopengine_show_regular_price' => 'yes',
954 ],
955 ]
956 );
957
958 $this->add_responsive_control(
959 'shopengine_price_reg_size',
960 [
961 'label' => esc_html__('Font Size (px)', 'shopengine'),
962 'type' => Controls_Manager::SLIDER,
963 'size_units' => ['px'],
964 'selectors' => [
965 '{{WRAPPER}} .shopengine-archive-products .price > del' => 'font-size: {{SIZE}}{{UNIT}};',
966 ],
967 'condition' => [
968 'shopengine_show_regular_price' => 'yes',
969 ],
970 ]
971 );
972
973 $this->add_responsive_control(
974 'shopengine_price_padding',
975 [
976 'label' => esc_html__('Padding', 'shopengine'),
977 'type' => Controls_Manager::DIMENSIONS,
978 'size_units' => ['px'],
979 'selectors' => [
980 '{{WRAPPER}} .shopengine-archive-products .product .price' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
981 ],
982 'separator' => 'before',
983 ]
984 );
985
986 $this->end_controls_section();
987
988 /*
989 =====================================
990 Product Description
991 =====================================
992 */
993
994 $this->start_controls_section(
995 'shopengine_product_description',
996 [
997 'label' => esc_html__('Product Description', 'shopengine'),
998 'tab' => Controls_Manager::TAB_STYLE,
999 'condition' => [
1000 'shopengine_is_details' => 'yes',
1001 ],
1002 ]
1003 );
1004
1005 $this->add_control(
1006 'shopengine_archive_description_color',
1007 [
1008 'label' => esc_html__('Color', 'shopengine'),
1009 'type' => Controls_Manager::COLOR,
1010 'alpha' => false,
1011 'selectors' => [
1012 '{{WRAPPER}} .shopengine-archive-products .product .shopengine-product-excerpt' => 'color: {{VALUE}};',
1013 ],
1014 ]
1015 );
1016
1017 $this->add_group_control(
1018 Group_Control_Typography::get_type(),
1019 [
1020 'name' => 'shopengine_archive_description_typography',
1021 'label' => esc_html__('Typography', 'shopengine'),
1022 'selector' => '{{WRAPPER}} .shopengine-archive-products .product .shopengine-product-excerpt',
1023 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'line_height'],
1024 'fields_options' => [
1025 'font_size' => [
1026 'label' => esc_html__('Font Size (px)', 'shopengine'),
1027 'size_units' => ['px'],
1028 'responsive' => false,
1029 ],
1030 ],
1031 ]
1032 );
1033
1034 $this->add_group_control(
1035 Group_Control_Border::get_type(),
1036 [
1037 'name' => 'shopengine_archive_description_border',
1038 'selector' => '{{WRAPPER}} .shopengine-archive-products .product .shopengine-product-excerpt',
1039 'fields_options' => [
1040 'border' => [
1041 'default' => 'solid',
1042 ],
1043 'width' => [
1044 'label' => esc_html__('Border Width', 'shopengine'),
1045 'default' => [
1046 'top' => '1',
1047 'right' => '0',
1048 'bottom' => '0',
1049 'left' => '0',
1050 'isLinked' => false,
1051 ],
1052 ],
1053 'color' => [
1054 'label' => esc_html__('Border Color', 'shopengine'),
1055 'default' => '#f2f2f2',
1056 ],
1057 ],
1058 ]
1059 );
1060
1061 $this->add_responsive_control(
1062 'shopengine_archive_description_padding',
1063 [
1064 'label' => esc_html__('Padding', 'shopengine'),
1065 'type' => Controls_Manager::DIMENSIONS,
1066 'size_units' => ['px'],
1067 'selectors' => [
1068 '{{WRAPPER}} .shopengine-archive-products .product .shopengine-product-excerpt' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1069 ],
1070 'separator' => 'before',
1071 ]
1072 );
1073
1074 $this->end_controls_section();
1075
1076 /*
1077 =====================================
1078 Product Footer
1079 =====================================
1080 */
1081
1082 $this->start_controls_section(
1083 'shopengine_product_footer',
1084 [
1085 'label' => esc_html__('Product Footer', 'shopengine'),
1086 'tab' => Controls_Manager::TAB_STYLE,
1087 'condition' => [
1088 'shopengine_is_hover_details' => 'yes',
1089 ],
1090 ]
1091 );
1092
1093 $this->add_responsive_control(
1094 'shopengine_archive_footer_padding',
1095 [
1096 'label' => esc_html__('Padding', 'shopengine'),
1097 'type' => Controls_Manager::DIMENSIONS,
1098 'size_units' => ['px'],
1099 'selectors' => [
1100 '{{WRAPPER}} .shopengine-archive-products .product .shopengine-product-description-footer' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1101 ],
1102 ]
1103 );
1104
1105 $this->end_controls_section();
1106
1107 /*
1108 ----------------------------
1109 Off tag
1110 ----------------------------
1111 */
1112
1113 $this->start_controls_section(
1114 'shopengine_off_tag',
1115 [
1116 'label' => esc_html__('Off Tag', 'shopengine'),
1117 'tab' => Controls_Manager::TAB_STYLE,
1118 'condition' => [
1119 'shopengine_show_off_tag' => 'yes',
1120 ],
1121 ]
1122 );
1123
1124 $this->add_control(
1125 'product_price_discount_badge_color',
1126 [
1127 'label' => esc_html__('Color', 'shopengine'),
1128 'type' => Controls_Manager::COLOR,
1129 'default' => '#FFFFFF',
1130 'alpha' => false,
1131 'selectors' => [
1132 '{{WRAPPER}} .shopengine-discount-badge' => 'color: {{VALUE}};',
1133 ],
1134 ]
1135 );
1136
1137 $this->add_control(
1138 'product_price_discount_badge_bg_color',
1139 [
1140 'label' => esc_html__('Background', 'shopengine'),
1141 'type' => Controls_Manager::COLOR,
1142 'default' => '#F54F29',
1143 'alpha' => false,
1144 'selectors' => [
1145 '{{WRAPPER}} .shopengine-discount-badge' => 'background: {{VALUE}};',
1146 ],
1147 ]
1148 );
1149
1150 $this->add_responsive_control(
1151 'product_price_discount_badge_padding',
1152 [
1153 'label' => esc_html__('Badge Padding', 'shopengine'),
1154 'type' => Controls_Manager::DIMENSIONS,
1155 'size_units' => ['px'],
1156 'default' => [
1157 'top' => '0',
1158 'right' => '10',
1159 'bottom' => '0',
1160 'left' => '10',
1161 'unit' => 'px',
1162 'isLinked' => false,
1163 ],
1164 'selectors' => [
1165 '{{WRAPPER}} .shopengine-discount-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1166 ],
1167 ]
1168 );
1169
1170 $this->add_responsive_control(
1171 'product_price_discount_badge_margin',
1172 [
1173 'label' => esc_html__('Badge Margin', 'shopengine'),
1174 'type' => Controls_Manager::DIMENSIONS,
1175 'size_units' => ['px'],
1176 'default' => [
1177 'top' => '0',
1178 'right' => '0',
1179 'bottom' => '0',
1180 'left' => '5',
1181 'unit' => 'px',
1182 'isLinked' => false,
1183 ],
1184 'selectors' => [
1185 '{{WRAPPER}} .shopengine-discount-badge' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1186 ],
1187 ]
1188 );
1189
1190 $this->end_controls_section();
1191
1192 // end off tag
1193 /*
1194 ==============================
1195 Button settings
1196 ==============================
1197 */
1198
1199 $this->start_controls_section(
1200 'shopengine_section_button',
1201 [
1202 'label' => esc_html__('Add To Cart Button', 'shopengine'),
1203 'tab' => Controls_Manager::TAB_STYLE,
1204 ]
1205 );
1206
1207 $this->add_responsive_control(
1208 'shopengine_archvie_btn_padding',
1209 [
1210 'label' => esc_html__('Padding', 'shopengine'),
1211 'type' => Controls_Manager::DIMENSIONS,
1212 'size_units' => ['px'],
1213 'default' => [
1214 'top' => '9',
1215 'right' => '21',
1216 'bottom' => '10',
1217 'left' => '21',
1218 'unit' => 'px',
1219 'isLinked' => false,
1220 ],
1221 'selectors' => [
1222 '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
1223 ],
1224 ]
1225 );
1226
1227 $this->add_responsive_control(
1228 'shopengine_archvie_btn_margin',
1229 [
1230 'label' => esc_html__('Margin', 'shopengine'),
1231 'type' => Controls_Manager::DIMENSIONS,
1232 'size_units' => ['px'],
1233 'default' => [
1234 'top' => '0',
1235 'right' => '0',
1236 'bottom' => '0',
1237 'left' => '0',
1238 'unit' => 'px',
1239 'isLinked' => true,
1240 ],
1241 'selectors' => [
1242 '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
1243 ],
1244 ]
1245 );
1246
1247 $this->add_control(
1248 'shopengine_archvie_btn_radius',
1249 [
1250 'label' => esc_html__('Border Radius', 'shopengine'),
1251 'type' => Controls_Manager::DIMENSIONS,
1252 'size_units' => ['px'],
1253 'selectors' => [
1254 '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
1255 ],
1256 ]
1257 );
1258
1259 $this->add_group_control(
1260 Group_Control_Typography::get_type(),
1261 [
1262 'name' => 'shopengine_archvie_btn_typography',
1263 'label' => esc_html__('Button Typography', 'shopengine'),
1264 'selector' => '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)',
1265 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'line_height'],
1266 'fields_options' => [
1267 'font_size' => [
1268 'label' => esc_html__('Font Size (px)', 'shopengine'),
1269 'responsive' => false,
1270 'size_units' => ['px'],
1271 ],
1272 ],
1273 ]
1274 );
1275
1276 $this->add_group_control(
1277 Group_Control_Box_Shadow::get_type(),
1278 [
1279 'name' => 'shopengine_archvie_btn_box_shadow',
1280 'label' => esc_html__('Box Shadow', 'shopengine'),
1281 'selector' => '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)',
1282 ]
1283 );
1284
1285
1286 $this->start_controls_tabs('shopengine_archvie_btn_tabs');
1287
1288 $this->start_controls_tab(
1289 'shopengine_archvie_btn_tab_normal',
1290 [
1291 'label' => esc_html__('Normal', 'shopengine'),
1292 ]
1293 );
1294
1295 $this->add_control(
1296 'shopengine_archvie_btn_normal_clr',
1297 [
1298 'label' => esc_html__('Color', 'shopengine'),
1299 'type' => Controls_Manager::COLOR,
1300 'default' => '#f1f1f1',
1301 'alpha' => false,
1302 'selectors' => [
1303 '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)' => 'text-align:left;color: {{VALUE}} !important;',
1304 ],
1305 ]
1306 );
1307
1308 $this->add_control(
1309 'shopengine_archvie_btn_normal_bg',
1310 [
1311 'label' => esc_html__('Background', 'shopengine'),
1312 'type' => Controls_Manager::COLOR,
1313 'default' => '#505255',
1314 'alpha' => false,
1315 'selectors' => [
1316 '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)' => 'background: {{VALUE}} !important;',
1317 ],
1318 ]
1319 );
1320
1321 $this->end_controls_tab();
1322
1323 $this->start_controls_tab(
1324 'shopengine_archvie_btn_tabs_hover',
1325 [
1326 'label' => esc_html__('Hover', 'shopengine'),
1327 ]
1328 );
1329
1330 $this->add_control(
1331 'shopengine_archvie_btn_hover_clr',
1332 [
1333 'label' => esc_html__('Color', 'shopengine'),
1334 'type' => Controls_Manager::COLOR,
1335 'alpha' => false,
1336 'default' => '#f1f1f1',
1337 'selectors' => [
1338 '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger):hover' => 'color: {{VALUE}} !important;',
1339 ],
1340 ]
1341 );
1342
1343 $this->add_control(
1344 'shopengine_archvie_btn_hover_bg',
1345 [
1346 'label' => esc_html__('Background', 'shopengine'),
1347 'type' => Controls_Manager::COLOR,
1348 'default' => '#101010',
1349 'alpha' => false,
1350 'selectors' => [
1351 '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger):hover' => 'background: {{VALUE}} !important;',
1352 ],
1353 ]
1354 );
1355
1356
1357 $this->end_controls_tab();
1358 $this->end_controls_tabs();
1359
1360 $this->end_controls_section(); // end ./ Button settings
1361
1362 /*
1363 ==============================
1364 product rating
1365 ==============================
1366 */
1367 $this->start_controls_section(
1368 'shopengine_section_rating',
1369 [
1370 'label' => esc_html__('Rating', 'shopengine'),
1371 'tab' => Controls_Manager::TAB_STYLE,
1372 'condition' => [
1373 'shopengine_archive_product_show_rating' => 'yes',
1374 ],
1375 ]
1376 );
1377
1378 $this->add_control(
1379 'shopengine_product_start_color',
1380 [
1381 'label' => esc_html__('Color', 'shopengine'),
1382 'type' => Controls_Manager::COLOR,
1383 'default' => '#FEC42D',
1384 'alpha' => false,
1385 'selectors' => [
1386 '{{WRAPPER}} .shopengine-archive-products .product .star-rating' => 'color: {{VALUE}};',
1387 ],
1388 ]
1389 );
1390
1391 $this->add_control(
1392 'shopengine_product_start_size',
1393 [
1394 'label' => esc_html__('Font Size (px)', 'shopengine'),
1395 'type' => Controls_Manager::SLIDER,
1396 'range' => [
1397 'px' => [
1398 'min' => 0,
1399 'max' => 50,
1400 'step' => 1,
1401 ],
1402 ],
1403 'default' => [
1404 'unit' => 'px',
1405 'size' => 11,
1406 ],
1407 'selectors' => [
1408 '{{WRAPPER}} .shopengine-archive-products .product .star-rating, {{WRAPPER}} .shopengine-product-rating-review-count' => 'font-size: {{SIZE}}{{UNIT}};',
1409 ],
1410 ]
1411 );
1412
1413 $this->add_responsive_control(
1414 'shopengine_product_rating_gap',
1415 [
1416 'label' => esc_html__('Star Gap (px)', 'shopengine'),
1417 'type' => Controls_Manager::SLIDER,
1418 'size_units' => ['px'],
1419 'selectors' => [
1420 '{{WRAPPER}} .shopengine-archive-products .star-rating' => 'letter-spacing: {{SIZE}}{{UNIT}}; width: calc(5.4em + (4 * {{SIZE}}{{UNIT}}));',
1421 ],
1422 ]
1423 );
1424
1425 $this->add_responsive_control(
1426 'shopengine_product_star_padding',
1427 [
1428 'label' => esc_html__('Margin', 'shopengine'),
1429 'type' => Controls_Manager::DIMENSIONS,
1430 'size_units' => ['px'],
1431 'selectors' => [
1432 '{{WRAPPER}} .shopengine-archive-products .product .star-rating' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1433 ],
1434 ]
1435 );
1436
1437
1438 $this->end_controls_section(); // end ./ product rating
1439
1440
1441 /*
1442 ==============================
1443 Sale Fash
1444 ==============================
1445 */
1446 $this->start_controls_section(
1447 'shopengine_section_sale_flash',
1448 [
1449 'label' => esc_html__('Flash Sale', 'shopengine'),
1450 'tab' => Controls_Manager::TAB_STYLE,
1451 'condition' => [
1452 'shopengine_show_sale_flash' => 'yes',
1453 ],
1454 ]
1455 );
1456
1457 $this->add_control(
1458 'shopengine_sale_flash_color',
1459 [
1460 'label' => esc_html__('Color', 'shopengine'),
1461 'type' => Controls_Manager::COLOR,
1462 'default' => '#FFFFFF',
1463 'alpha' => false,
1464 'selectors' => [
1465 '{{WRAPPER}} .shopengine-archive-products .onsale' => 'color: {{VALUE}};',
1466 ],
1467 ]
1468 );
1469
1470 $this->add_control(
1471 'shopengine_sale_flash_bg_color',
1472 [
1473 'label' => esc_html__('Background Color', 'shopengine'),
1474 'type' => Controls_Manager::COLOR,
1475 'alpha' => false,
1476 'default' => '#4285F4',
1477 'selectors' => [
1478 '{{WRAPPER}} .shopengine-archive-products .onsale' => 'background-color: {{VALUE}};',
1479 ],
1480 ]
1481 );
1482
1483 $this->add_group_control(
1484 Group_Control_Typography::get_type(),
1485 [
1486 'name' => 'shopengine_sale_flash_typography',
1487 'label' => esc_html__('Typography', 'shopengine'),
1488 'selector' => '{{WRAPPER}} .shopengine-archive-products .onsale',
1489 'exclude' => ['font_family', 'font_style', 'letter_spacing', 'line_height', 'text_decoration'],
1490 'fields_options' => [
1491 'typography' => [
1492 'default' => 'custom',
1493 ],
1494 'font_weight' => [
1495 'default' => '500',
1496 ],
1497 'font_size' => [
1498 'label' => esc_html__('Font Size (px)', 'shopengine'),
1499 'default' => [
1500 'size' => '14',
1501 'unit' => 'px',
1502 ],
1503 'size_units' => ['px'],
1504 'responsive' => false,
1505 ],
1506 'text_transform' => [
1507 'default' => 'capitalize',
1508 ],
1509 ],
1510 ]
1511 );
1512
1513
1514 $this->add_control(
1515 'shopengine_use_fixed_size',
1516 [
1517 'label' => esc_html__('Use padding', 'shopengine'),
1518 'type' => Controls_Manager::SWITCHER,
1519 'label_on' => esc_html__('Show', 'shopengine'),
1520 'label_off' => esc_html__('Hide', 'shopengine'),
1521 'return_value' => 'yes',
1522 'default' => '',
1523 ]
1524 );
1525
1526 $this->add_control(
1527 'shopengine_sale_flash_radius',
1528 [
1529 'label' => esc_html__('Border Radius', 'shopengine'),
1530 'type' => Controls_Manager::DIMENSIONS,
1531 'size_units' => ['%', 'px'],
1532 'default' => [
1533 'top' => '50',
1534 'right' => '50',
1535 'bottom' => '50',
1536 'left' => '50',
1537 'unit' => '%',
1538 'isLinked' => true,
1539 ],
1540 'selectors' => [
1541 '{{WRAPPER}} .shopengine-archive-products .onsale' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1542 ],
1543 ]
1544 );
1545
1546 $this->add_control(
1547 'shopengine_sale_flash_paddng',
1548 [
1549 'label' => esc_html__('Padding', 'shopengine'),
1550 'type' => Controls_Manager::DIMENSIONS,
1551 'size_units' => ['px'],
1552 'condition' => ['shopengine_use_fixed_size' => 'yes'],
1553 'selectors' => [
1554 '{{WRAPPER}} .shopengine-archive-products .onsale' => 'line-height:initial; min-height:auto; min-width:auto; padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1555 ],
1556 ]
1557 );
1558
1559 $this->add_control(
1560 'shopengine_sale_flash_sizee',
1561 [
1562 'label' => esc_html__('Size', 'shopengine'),
1563 'type' => Controls_Manager::SLIDER,
1564 'size_units' => ['px'],
1565 'condition' => ['shopengine_use_fixed_size' => ''],
1566 'range' => [
1567 'px' => [
1568 'min' => 0,
1569 'max' => 300,
1570 'step' => 1,
1571 ],
1572 ],
1573 'default' => [
1574 'unit' => 'px',
1575 'size' => 50,
1576 ],
1577 'selectors' => [
1578 '{{WRAPPER}} .shopengine-archive-products .onsale' => 'min-width:auto; min-height:auto;padding:0; text-align:center; line-height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
1579 ],
1580 ]
1581 );
1582
1583 // Position
1584 $this->add_control(
1585 'shopengine_sale_flash_pos',
1586 [
1587 'label' => esc_html__('Position', 'shopengine'),
1588 'type' => Controls_Manager::CHOOSE,
1589 'options' => [
1590 'left' => [
1591 'title' => esc_html__('Left', 'shopengine'),
1592 'icon' => 'eicon-chevron-left',
1593 ],
1594 'right' => [
1595 'title' => esc_html__('Right', 'shopengine'),
1596 'icon' => 'eicon-chevron-right',
1597 ],
1598 ],
1599 'default' => 'left',
1600 'toggle' => false,
1601 'separator' => 'before',
1602 ]
1603 );
1604
1605 $this->add_responsive_control(
1606 'shopengine_sale_flash_position_horizontial',
1607 [
1608 'label' => esc_html__('Horizontal', 'shopengine'),
1609 'type' => Controls_Manager::SLIDER,
1610 'size_units' => ['px', '%'],
1611 'range' => [
1612 'px' => [
1613 'max' => 400,
1614 ],
1615 ],
1616 'default' => [
1617 'unit' => 'px',
1618 'size' => 20,
1619 ],
1620 'selectors' => [
1621 '{{WRAPPER}} .shopengine-archive-products .onsale' => '{{shopengine_sale_flash_pos.VALUE}}: {{SIZE}}{{UNIT}};',
1622 ],
1623 ]
1624 );
1625
1626 $this->add_responsive_control(
1627 'shopengine_sale_flash_position_vertical',
1628 [
1629 'label' => esc_html__('Vertical', 'shopengine'),
1630 'type' => Controls_Manager::SLIDER,
1631 'size_units' => ['px', '%'],
1632 'range' => [
1633 'px' => [
1634 'max' => 400,
1635 ],
1636 ],
1637 'default' => [
1638 'unit' => 'px',
1639 'size' => 20,
1640 ],
1641 'selectors' => [
1642 '{{WRAPPER}} .shopengine-archive-products .onsale' => 'top: {{SIZE}}{{UNIT}};',
1643 ],
1644 ]
1645 );
1646
1647 $this->end_controls_section(); // end ./ Flash Sale
1648
1649 /*
1650 ----------------------------
1651 Button group
1652 ----------------------------
1653 */
1654
1655
1656 $this->start_controls_section(
1657 'shopengine_section_button_group',
1658 [
1659 'label' => esc_html__('Button group', 'shopengine'),
1660 'tab' => Controls_Manager::TAB_STYLE,
1661 'condition' => [
1662 'shopengine_group_btns' => 'yes',
1663 ],
1664 ]
1665 );
1666
1667 $this->add_control(
1668 'shopengine_button_group_btn_bg_clr',
1669 [
1670 'label' => esc_html__('Background color', 'shopengine'),
1671 'type' => Controls_Manager::COLOR,
1672 'default' => '#FFFFFF',
1673 'selectors' => [
1674 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a, button, .button)' => 'background: {{VALUE}} !important;',
1675 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a, button, .button):hover' => 'background: {{VALUE}} !important;',
1676 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner' => 'background-color: {{VALUE}} !important;',
1677 ],
1678 ]
1679 );
1680
1681 $this->add_control(
1682 'shopengine_button_group_btn_clr',
1683 [
1684 'label' => esc_html__('Color', 'shopengine'),
1685 'type' => Controls_Manager::COLOR,
1686 'default' => '#101010',
1687 'selectors' => [
1688 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a:not(.shopengine-wishlist) :is(i, span, svg, path, a::before)' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;',
1689 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner .shopengine-wishlist path' => 'color: {{VALUE}} !important;',
1690 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a.button:not(.shopengine-quickview-trigger)::before' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;',
1691 ],
1692 ]
1693 );
1694
1695 $this->add_control(
1696 'shopengine_button_group_btn_hover_active_clr',
1697 [
1698 'label' => esc_html__('Hover and Active Color', 'shopengine'),
1699 'type' => Controls_Manager::COLOR,
1700 'default' => '#F03D3F',
1701 'selectors' => [
1702 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a:not(.shopengine-wishlist):hover :is(i, span, svg, path, a::before)' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;',
1703 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner .shopengine-wishlist:hover path' => 'color: {{VALUE}} !important;',
1704 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a.button:hover:not(.shopengine-quickview-trigger)::before' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;',
1705
1706 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a.active:not(.shopengine-wishlist) :is(i, span, svg, path, a::before)' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;',
1707 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner .shopengine-wishlist.active path' => 'fill:{{VALUE}} !important; color: {{VALUE}} !important;',
1708 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a.button.active:not(.shopengine-quickview-trigger)::before' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;',
1709 ],
1710 ]
1711 );
1712
1713 $this->add_control(
1714 'shopengine_button_group_btn_icon_size',
1715 [
1716 'label' => esc_html__('Icon size', 'shopengine'),
1717 'type' => Controls_Manager::SLIDER,
1718 'size_units' => ['px'],
1719 'range' => [
1720 'px' => [
1721 'min' => 0,
1722 'max' => 100,
1723 'step' => 1,
1724 ],
1725 ],
1726 'default' => [
1727 'unit' => 'px',
1728 'size' => 18,
1729 ],
1730 'selectors' => [
1731 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(svg)' => 'width: {{SIZE}}{{UNIT}} !important;',
1732 '{{WRAPPER}} .shopengine-widget .shopengine-archive-products .loop-product--btns a.add_to_cart_button::before' => 'font-size: {{SIZE}}{{UNIT}} !important;',
1733 ],
1734 ]
1735 );
1736
1737 $this->add_control(
1738 'shopengine_button_group_btn_padding',
1739 [
1740 'label' => esc_html__('Padding', 'shopengine'),
1741 'type' => Controls_Manager::DIMENSIONS,
1742 'size_units' => ['px'],
1743 'default' => [
1744 'top' => '15',
1745 'right' => '0',
1746 'bottom' => '15',
1747 'left' => '0',
1748 'unit' => 'px',
1749 'isLinked' => false,
1750 ],
1751 'selectors' => [
1752 '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a, button, .button)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
1753 ],
1754 ]
1755 );
1756
1757 $this->end_controls_section();
1758 // end button group
1759 /**
1760 * Section: Pagination
1761 */
1762 $this->start_controls_section(
1763 'shopengine_section_style_pagination',
1764 [
1765 'label' => esc_html__('Pagination', 'shopengine'),
1766 'tab' => Controls_Manager::TAB_STYLE,
1767 ]
1768 );
1769 $this->add_responsive_control(
1770 'shopengine_pagi_align',
1771 [
1772 'label' => esc_html__('Alignment', 'shopengine'),
1773 'type' => Controls_Manager::CHOOSE,
1774 'options' => [
1775 'left' => [
1776 'title' => esc_html__('Left', 'shopengine'),
1777 'icon' => 'fa fa-align-left',
1778 ],
1779 'center' => [
1780 'title' => esc_html__('Center', 'shopengine'),
1781 'icon' => 'fa fa-align-center',
1782 ],
1783 'right' => [
1784 'title' => esc_html__('Right', 'shopengine'),
1785 'icon' => 'fa fa-align-right',
1786 ],
1787 ],
1788 'selectors_dictionary' => [
1789 'left' => '-webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start;',
1790 'center' => '-webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;',
1791 'right' => '-webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end;',
1792 ],
1793 'selectors' => [
1794 '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul' => '{{VALUE}}',
1795 ],
1796 ]
1797 );
1798
1799 $this->add_group_control(
1800 Group_Control_Typography::get_type(),
1801 [
1802 'name' => 'shopengine_pagi_font',
1803 'label' => esc_html__('Typography', 'shopengine'),
1804 'exclude' => ['font_family', 'line_height', 'text_transform', 'text_decoration', 'text_transform', 'letter_spacing'],
1805 'selector' => '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination',
1806 'fields_options' => [
1807 'font_size' => [
1808 'label' => esc_html__('Font Size (px)', 'shopengine'),
1809 'default' => [
1810 'size' => '16',
1811 'unit' => 'px',
1812 ],
1813 'size_units' => ['px'],
1814 'responsive' => false,
1815 ],
1816 ],
1817 ]
1818 );
1819
1820 $this->add_responsive_control(
1821 'shopengine_pagi_top_space',
1822 [
1823 'label' => esc_html__('Top Spacing (px)', 'shopengine'),
1824 'type' => Controls_Manager::SLIDER,
1825 'size_units' => ['px'],
1826 'selectors' => [
1827 '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination' => 'padding-top: {{SIZE}}{{UNIT}};',
1828 ],
1829 ]
1830 );
1831
1832 $this->start_controls_tabs('shopengine_pagi_tabs');
1833 $this->start_controls_tab(
1834 'shopengine_pagi_tab_normal',
1835 [
1836 'label' => esc_html__('Normal', 'shopengine'),
1837 ]
1838 );
1839 $this->add_control(
1840 'shopengine_pagi_n_color',
1841 [
1842 'label' => esc_html__('Text Color', 'shopengine'),
1843 'type' => Controls_Manager::COLOR,
1844 'alpha' => false,
1845 'selectors' => [
1846 '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination' => 'color: {{VALUE}};',
1847 ],
1848 ]
1849 );
1850
1851 $this->add_control(
1852 'shopengine_pagi_n_bgcolor',
1853 [
1854 'label' => esc_html__('Background Color', 'shopengine'),
1855 'type' => Controls_Manager::COLOR,
1856 'alpha' => false,
1857 'selectors' => [
1858 '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers:not(.dots)' => 'background: {{VALUE}};',
1859 ],
1860 ]
1861 );
1862
1863 $this->add_group_control(
1864 Group_Control_Border::get_type(),
1865 [
1866 'name' => 'shopengine_pagi_n_bd',
1867 'label' => esc_html__('Border', 'shopengine'),
1868 'selector' => '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers:not(.dots)',
1869 ]
1870 );
1871 $this->end_controls_tab();
1872
1873 $this->start_controls_tab(
1874 'shopengine_pagi_tab_hover',
1875 [
1876 'label' => esc_html__('Hover', 'shopengine'),
1877 ]
1878 );
1879 $this->add_control(
1880 'shopengine_pagi_h_color',
1881 [
1882 'label' => esc_html__('Text Color', 'shopengine'),
1883 'type' => Controls_Manager::COLOR,
1884 'alpha' => false,
1885 'selectors' => [
1886 '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers.current' => 'color: {{VALUE}};',
1887 '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers:hover' => 'color: {{VALUE}};',
1888 ],
1889 ]
1890 );
1891
1892 $this->add_control(
1893 'shopengine_pagi_h_bgcolor',
1894 [
1895 'label' => esc_html__('Background Color', 'shopengine'),
1896 'type' => Controls_Manager::COLOR,
1897 'alpha' => false,
1898 'selectors' => [
1899 '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers:not(.dots).current' => 'background: {{VALUE}};',
1900 '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers:not(.dots):hover' => 'background: {{VALUE}};',
1901 ],
1902 ]
1903 );
1904
1905 $this->add_control(
1906 'shopengine_pagi_h_bdc',
1907 [
1908 'label' => esc_html__('Border Color', 'shopengine'),
1909 'type' => Controls_Manager::COLOR,
1910 'alpha' => false,
1911 'selectors' => [
1912 '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers.current' => 'border-color: {{VALUE}};',
1913 '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers:hover' => 'border-color: {{VALUE}};',
1914 ],
1915 ]
1916 );
1917 $this->end_controls_tab();
1918 $this->end_controls_tabs();
1919
1920 $this->add_responsive_control(
1921 'shopengine_pagi_radius',
1922 [
1923 'label' => esc_html__('Border Radius', 'shopengine'),
1924 'type' => Controls_Manager::SLIDER,
1925 'size_units' => ['px', '%'],
1926 'selectors' => [
1927 '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers' => 'border-radius: {{SIZE}}{{UNIT}};',
1928 ],
1929 'separator' => 'before',
1930 ]
1931 );
1932
1933 $this->add_responsive_control(
1934 'shopengine_pagi_mg',
1935 [
1936 'label' => esc_html__('Margin (px)', 'shopengine'),
1937 'type' => Controls_Manager::DIMENSIONS,
1938 'size_units' => ['px'],
1939 'default' => [
1940 'top' => '10',
1941 'right' => '10',
1942 'bottom' => '0',
1943 'left' => '0',
1944 'isLinked' => false,
1945 ],
1946 'selectors' => [
1947 '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1948 ],
1949 'separator' => 'before',
1950 ]
1951 );
1952
1953 $this->add_responsive_control(
1954 'shopengine_pagi_pd',
1955 [
1956 'label' => esc_html__('Padding (px)', 'shopengine'),
1957 'type' => Controls_Manager::DIMENSIONS,
1958 'size_units' => ['px'],
1959 'selectors' => [
1960 '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; min-width: 0;',
1961 ],
1962 ]
1963 );
1964 $this->end_controls_section();
1965
1966
1967 /**
1968 * Section: Global Font
1969 */
1970 $this->start_controls_section(
1971 'shopengine_section_style_global',
1972 [
1973 'label' => esc_html__('Global Font', 'shopengine'),
1974 'tab' => Controls_Manager::TAB_STYLE,
1975 ]
1976 );
1977 $this->add_control(
1978 'shopengine_archive_products_font_family',
1979 [
1980 'label' => esc_html__('Font Family', 'shopengine'),
1981 'description' => esc_html__('This font family is set for this specific widget.', 'shopengine'),
1982 'type' => Controls_Manager::FONT,
1983 'selectors' => [
1984 '{{WRAPPER}} .shopengine-archive-products .product-categories > li,
1985 {{WRAPPER}} .shopengine-archive-products .product .woocommerce-loop-product__title,
1986 {{WRAPPER}} .shopengine-archive-products .product .price .amount,
1987 {{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger),
1988 {{WRAPPER}} .shopengine-archive-products .onsale,
1989 {{WRAPPER}} .shopengine-archive-products .woocommerce-pagination,
1990 {{WRAPPER}} .shopengine-archive-products .product .shopengine-product-excerpt' => 'font-family: {{VALUE}};',
1991 ],
1992 ]
1993 );
1994 $this->end_controls_section();
1995 }
1996
1997 /**
1998 * Product Action Buttons
1999 */
2000 public function show_product_action_btns() {
2001 woocommerce_template_loop_product_link_close();
2002 ?>
2003 <div class="loop-product--btns">
2004 <div class="loop-product--btns-inner">
2005 <?php woocommerce_template_loop_add_to_cart(); ?>
2006 </div>
2007 </div>
2008 <?php
2009 woocommerce_template_loop_product_link_open();
2010 }
2011
2012 /**
2013 * Empty Product Rating
2014 */
2015 public function show_empty_product_rating($html, $ratings, $count) {
2016 if('0' === $ratings):
2017 $html = '<div class="star-rating"></div>';
2018 endif;
2019
2020 global $product;
2021
2022 $review_count = $product->get_review_count();
2023
2024 return $html . '<span class="shopengine-product-rating-review-count">(' . $review_count . ')</span>';
2025 }
2026
2027 /**
2028 * Product Categories
2029 */
2030 public function show_product_cats() {
2031 $settings = $this->get_settings_for_display();
2032 $terms = get_the_terms(get_the_ID(), 'product_cat');
2033
2034 if(empty($terms)) {
2035 return false;
2036 }
2037
2038 $terms_count = count($terms);
2039
2040 if($terms_count > 0) {
2041 echo '<ul class="product-categories">';
2042 foreach($terms as $key => $term) {
2043 if($settings['shopengine_cats_max'] === $key) {
2044 break;
2045 }
2046
2047 echo '<li><span>' . esc_html($term->name) . '</span></li>';
2048 }
2049 echo '</ul>';
2050 }
2051 }
2052
2053 protected function screen() {
2054
2055 $settings = $this->get_settings_for_display();
2056 extract($settings);
2057
2058 $post_type = get_post_type();
2059
2060 if(WC()->session) {
2061 wc_print_notices();
2062 }
2063
2064
2065 /**
2066 * Show Action Buttons
2067 */
2068 if($shopengine_group_btns === 'yes') {
2069 remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
2070
2071 add_filter('woocommerce_before_shop_loop_item_title', [$this, 'show_product_action_btns']);
2072 }
2073
2074
2075 /**
2076 * Show Categories
2077 */
2078 if($shopengine_is_cats === 'yes') {
2079 add_filter('woocommerce_before_shop_loop_item_title', [$this, 'show_product_cats']);
2080 }
2081
2082 /**
2083 * Show Empty Rating
2084 */
2085 add_filter('woocommerce_product_get_rating_html', [$this, 'show_empty_product_rating'], 99, 3);
2086
2087
2088 $tpl = Products::instance()->get_widget_template($this->get_name());
2089
2090 include $tpl;
2091
2092
2093 /**
2094 * Reset Filters to Default.
2095 */
2096 if($shopengine_group_btns === 'yes') {
2097 remove_filter('woocommerce_before_shop_loop_item_title', [$this, 'show_product_action_btns']);
2098
2099 add_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
2100 }
2101
2102 if($shopengine_is_cats === 'yes') {
2103 remove_filter('woocommerce_before_shop_loop_item_title', [$this, 'show_product_cats']);
2104 }
2105
2106 remove_filter('woocommerce_product_get_rating_html', [$this, 'show_empty_product_rating'], 99);
2107 }
2108 }
2109