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 / product-tabs / product-tabs.php
shopengine / widgets / product-tabs Last commit date
screens 5 years ago product-tabs-config.php 5 years ago product-tabs.php 5 years ago
product-tabs.php
1798 lines
1 <?php
2
3 namespace Elementor;
4
5 use ShopEngine\Widgets\Products;
6
7 defined('ABSPATH') || exit;
8
9
10 class ShopEngine_Product_Tabs extends \ShopEngine\Base\Widget
11 {
12
13 public function config() {
14 return new ShopEngine_Product_Tabs_Config();
15 }
16
17
18 protected function register_controls() {
19
20 /*
21 ---------------------------------
22 Nav Styles
23 ------------------------------------
24 */
25
26 $this->start_controls_section(
27 'shopengine_product_nav_style',
28 [
29 'label' => esc_html__('Nav Style', 'shopengine'),
30 'tab' => Controls_Manager::TAB_STYLE,
31 ]
32 );
33
34 $this->add_group_control(
35 Group_Control_Typography::get_type(),
36 [
37 'name' => 'shopengine_product_nav_typography',
38 'label' => esc_html__('Typography', 'shopengine'),
39 'selector' => '{{WRAPPER}} .woocommerce-tabs ul.tabs li a',
40 'exclude' => ['letter_spacing', 'text_decoration', 'line_height'],
41 'exclude' => ['font_family', 'text_decoration', 'font_style'],
42 'fields_options' => [
43 'typography' => [
44 'default' => 'custom',
45 ],
46 'font_weight' => [
47 'default' => '600',
48 ],
49 'font_size' => [
50 'label' => esc_html__('Font Size (px)', 'shopengine'),
51 'default' => [
52 'size' => '18',
53 'unit' => 'px',
54 ],
55 'size_units' => ['px'],
56 ],
57 'line_height' => [
58 'label' => esc_html__('Line Height (px)', 'shopengine'),
59 'default' => [
60 'size' => '22',
61 'unit' => 'px',
62 ],
63 'size_units' => ['px'],
64 'tablet_default' => [
65 'unit' => 'px',
66 ],
67 'mobile_default' => [
68 'unit' => 'px',
69 ],
70 ],
71 'letter_spacing' => [
72 'label' => esc_html__('Letter Spacing (px)', 'shopengine'),
73 'size_units' => ['px'],
74 ],
75 ],
76 ]
77 );
78
79 $this->add_control(
80 'shopengine_product_nav_color',
81 [
82 'label' => esc_html__('Menu color', 'shopengine'),
83 'type' => Controls_Manager::COLOR,
84 'alpha' => false,
85 'default' => '#A0A0A0',
86 'selectors' => [
87 '{{WRAPPER}} .woocommerce-tabs ul.tabs li a' => 'color: {{VALUE}}',
88 ],
89 ]
90 );
91
92 $this->add_control(
93 'shopengine_product_nav_active_color',
94 [
95 'label' => esc_html__('Active/Hover menu color', 'shopengine'),
96 'type' => Controls_Manager::COLOR,
97 'alpha' => false,
98 'default' => '#5642C7',
99 'selectors' => [
100 '{{WRAPPER}} .woocommerce-tabs ul.tabs :is(li.active a, li:hover a )' => 'color: {{VALUE}}',
101 ],
102 ]
103 );
104
105 $this->add_control(
106 'shopengine_product_nav_indicator_color',
107 [
108 'label' => esc_html__('Nav indicator color', 'shopengine'),
109 'type' => Controls_Manager::COLOR,
110 'alpha' => false,
111 'default' => '#5642C7',
112 'selectors' => [
113 '{{WRAPPER}} div.shopengine-product-tabs div.woocommerce-tabs .wc-tabs .shopengine-tabs-line' => 'border-color: {{VALUE}};',
114 ],
115 ]
116 );
117
118 $this->add_control(
119 'shopengine_product_nav_indicator_border',
120 [
121 'label' => esc_html__('Nav indicator Border (px)', 'shopengine'),
122 'type' => Controls_Manager::DIMENSIONS,
123 'allowed_dimensions' => ['top', 'bottom'],
124 'size_units' => ['px'],
125 'default' => [
126 'top' => '3',
127 'right' => '0',
128 'bottom' => '3',
129 'left' => '0',
130 'unit' => 'px',
131 'isLinked' => false,
132 ],
133 'selectors' => [
134 '{{WRAPPER}} .shopengine-product-tabs .wc-tabs .shopengine-tabs-line' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
135 '{{WRAPPER}} .shopengine-product-tabs div.woocommerce-tabs .wc-tabs .shopengine-tabs-line' => 'height: calc(100% + {{TOP}}{{UNIT}} + {{BOTTOM}}{{UNIT}}); top: -{{TOP}}{{UNIT}};',
136 ],
137 ]
138 );
139
140 $this->add_responsive_control(
141 'shopengine_nav_menu_spacing',
142 [
143 'label' => esc_html__('Menu spacing (px)', 'shopengine'),
144 'type' => Controls_Manager::SLIDER,
145 'size_units' => ['px'],
146 'range' => [
147 'px' => [
148 'min' => 0,
149 'max' => 500,
150 'step' => 5,
151 ],
152 ],
153 'default' => [
154 'unit' => 'px',
155 'size' => 25,
156 ],
157 'selectors' => [
158 '{{WRAPPER}} .woocommerce-tabs ul.tabs li:not(:last-child) a' => 'margin-right: {{SIZE}}{{UNIT}};',
159 ],
160 'separator' => 'before',
161 ]
162 );
163
164 $this->add_group_control(
165 Group_Control_Box_Shadow::get_type(),
166 [
167 'name' => 'shopengine_tab_nav_box_shadow',
168 'label' => esc_html__('Box Shadow', 'shopengine'),
169 'selector' => '{{WRAPPER}} .shopengine-product-tabs .wc-tabs',
170 'separator' => 'before',
171 ]
172 );
173
174 $this->add_group_control(
175 Group_Control_Border::get_type(),
176 [
177 'name' => 'shopengine_nav_line',
178 'label' => esc_html__('Nav Line', 'shopengine'),
179 // 'selector' => '{{WRAPPER}} div.shopengine-product-tabs div.woocommerce-tabs .wc-tabs',
180 'fields_options' => [
181 'border_type' => [
182 'default' => 'yes',
183 ],
184 'border' => [
185 'default' => 'solid',
186 'selectors' => [
187 '{{WRAPPER}} div.shopengine-product-tabs div.woocommerce-tabs .wc-tabs' => 'border-style: {{VALUE}} !important;',
188 ],
189 ],
190
191 'width' => [
192 'label' => esc_html__('Line Width', 'shopengine'),
193 'allowed_dimensions' => ['top', 'bottom'],
194 'default' => [
195 'bottom' => '1',
196 'top' => '1',
197 'unit' => 'px',
198 ],
199 'selectors' => [
200 '{{WRAPPER}} div.shopengine-product-tabs div.woocommerce-tabs .wc-tabs' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
201 ],
202 ],
203
204 'color' => [
205 'label' => esc_html__('Line Color', 'shopengine'),
206 'alpha' => false,
207 'default' => '#EFEFEF',
208 'selectors' => [
209 '{{WRAPPER}} div.shopengine-product-tabs div.woocommerce-tabs .wc-tabs' => 'border-color: {{VALUE}} !important;',
210 ],
211 ],
212 ],
213 'separator' => 'before',
214 ]
215 );
216
217 $this->add_responsive_control(
218 'shopengine_tab_nav_padding',
219 [
220 'label' => esc_html__('Padding (px)', 'shopengine'),
221 'type' => Controls_Manager::DIMENSIONS,
222 'size_units' => ['px'],
223 'default' => [
224 'top' => '25',
225 'right' => '0',
226 'bottom' => '25',
227 'left' => '0',
228 'unit' => 'px',
229 'isLinked' => false,
230 ],
231 'selectors' => [
232 '{{WRAPPER}} .woocommerce-tabs ul.tabs' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important; margin: 0;',
233 ],
234 'separator' => 'before',
235 ]
236 );
237
238 $this->end_controls_section(); // end ./ Nav Settings
239
240 /*
241 ---------------------------
242 title styles
243 ---------------------------
244 */
245
246 $this->start_controls_section(
247 'shopengine_product_tab_content_style',
248 [
249 'label' => esc_html__('Tab Content', 'shopengine'),
250 'tab' => Controls_Manager::TAB_STYLE,
251 ]
252 );
253
254 $this->add_control(
255 'shopengine_product_tab_content_title_style',
256 [
257 'label' => esc_html__('Tab Content Title', 'shopengine'),
258 'type' => Controls_Manager::HEADING,
259 ]
260 );
261
262 $this->add_control(
263 'shopengine_product_tab_content_title_show',
264 [
265 'label' => esc_html__('Show Title', 'shopengine'),
266 'type' => Controls_Manager::SWITCHER,
267 'label_on' => esc_html__('Yes', 'shopengine'),
268 'label_off' => esc_html__('No', 'shopengine'),
269 'return_value' => 'block',
270 'default' => 'block',
271 'selectors' => [
272 '{{WRAPPER}} div.shopengine-product-tabs .woocommerce-Tabs-panel > h2:first-child,
273 {{WRAPPER}} div.shopengine-product-tabs .woocommerce-Tabs-panel .comment-reply-title' => 'display: {{VALUE}} !important;',
274 ],
275 ]
276 );
277
278 $this->add_control(
279 'shopengine_product_tab_content_title_color',
280 [
281 'label' => esc_html__('Color', 'shopengine'),
282 'type' => Controls_Manager::COLOR,
283 'default' => '#101010',
284 'alpha' => false,
285 'selectors' => [
286 '{{WRAPPER}} div.shopengine-product-tabs .woocommerce-Tabs-panel > h2:first-child,
287 {{WRAPPER}} div.shopengine-product-tabs .woocommerce-Tabs-panel .woocommerce-Reviews-title' => 'color: {{VALUE}}',
288 ],
289 'condition' => [
290 'shopengine_product_tab_content_title_show' => 'block',
291 ],
292 ]
293 );
294
295 $this->add_group_control(
296 Group_Control_Typography::get_type(),
297 [
298 'name' => 'shopengine_product_tab_content_title_typography',
299 'label' => esc_html__('Typography', 'shopengine'),
300 'selector' => '{{WRAPPER}} div.shopengine-product-tabs .woocommerce-Tabs-panel > h2:first-child, {{WRAPPER}} div.shopengine-product-tabs .woocommerce-Tabs-panel .woocommerce-Reviews-title',
301 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'],
302 'fields_options' => [
303 'typography' => [
304 'default' => 'custom',
305 ],
306 'font_weight' => [
307 'default' => '700',
308 ],
309 'font_size' => [
310 'label' => esc_html__('Font Size (px)', 'shopengine'),
311 'default' => [
312 'size' => '18',
313 'unit' => 'px',
314 ],
315 'size_units' => ['px'],
316 ],
317 'text_transform' => [
318 'default' => 'uppercase',
319 ],
320 'line_height' => [
321 'label' => esc_html__('Line Height (px)', 'shopengine'),
322 'default' => [
323 'size' => '22',
324 'unit' => 'px',
325 ],
326 'size_units' => ['px'],
327 'tablet_default' => [
328 'unit' => 'px',
329 ],
330 'mobile_default' => [
331 'unit' => 'px',
332 ],
333 ],
334 ],
335 'condition' => [
336 'shopengine_product_tab_content_title_show' => 'yes',
337 ],
338 ]
339 );
340
341 $this->add_responsive_control(
342 'shopengine_product_tab_content_title_padding',
343 [
344 'label' => esc_html__('Padding (px)', 'shopengine'),
345 'type' => Controls_Manager::DIMENSIONS,
346 'size_units' => ['px'],
347 'default' => [
348 'top' => '0',
349 'right' => '0',
350 'bottom' => '20',
351 'left' => '0',
352 'unit' => 'px',
353 'isLinked' => false,
354 ],
355 'selectors' => [
356 '{{WRAPPER}} div.shopengine-product-tabs .woocommerce-Tabs-panel > h2:first-child,
357 {{WRAPPER}} div.shopengine-product-tabs .woocommerce-Tabs-panel .woocommerce-Reviews-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
358 ],
359 'separator' => 'before',
360 ]
361 );
362
363 $this->add_control(
364 'shopengine_product_tab_content_wrap_style',
365 [
366 'label' => esc_html__('Tab Content Wrap', 'shopengine'),
367 'type' => Controls_Manager::HEADING,
368 'separator' => 'before',
369 ]
370 );
371
372 $this->add_responsive_control(
373 'shopengine_product_tab_content_wrap_padding',
374 [
375 'label' => esc_html__('Padding (px)', 'shopengine'),
376 'type' => Controls_Manager::DIMENSIONS,
377 'size_units' => ['px'],
378 'default' => [
379 'top' => '25',
380 'right' => '0',
381 'bottom' => '25',
382 'left' => '0',
383 'unit' => 'px',
384 'isLinked' => false,
385 ],
386 'selectors' => [
387 '{{WRAPPER}} .shopengine-product-tabs .woocommerce-Tabs-panel' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important; margin: 0;',
388 ],
389 ]
390 );
391
392 $this->end_controls_section(); // end ./title styles
393
394 /*
395 ---------------------------
396 additional info styles
397 ---------------------------
398 */
399
400 $this->start_controls_section(
401 'shopengine_product_tab_ainfo_section',
402 [
403 'label' => esc_html__('Additional Information', 'shopengine'),
404 'tab' => Controls_Manager::TAB_STYLE,
405 ]
406 );
407
408 $this->add_group_control(
409 Group_Control_Typography::get_type(),
410 [
411 'name' => 'shopengine_product_tab_ainfo_typography',
412 'label' => esc_html__('Typography', 'shopengine'),
413 'selector' => '{{WRAPPER}} .shopengine-product-tabs tr :is(td, th, p)',
414 'exclude' => ['font_family', 'text_transform', 'text_decoration'],
415 'fields_options' => [
416 'typography' => [
417 'default' => 'custom',
418 ],
419 'font_size' => [
420 'label' => esc_html__('Font Size (px)', 'shopengine'),
421 'size_units' => ['px'],
422 'default' => [
423 'size' => '16',
424 'unit' => 'px',
425 ],
426 ],
427 'font_weight' => [
428 'default' => '400',
429 ],
430 'text_transform' => [
431 'default' => 'none',
432 ],
433 'line_height' => [
434 'label' => esc_html__('Line Height (px)', 'shopengine'),
435 'default' => [
436 'size' => '19',
437 'unit' => 'px',
438 ],
439 'size_units' => ['px'],
440 'tablet_default' => [
441 'unit' => 'px',
442 ],
443 'mobile_default' => [
444 'unit' => 'px',
445 ],
446 ],
447 'letter_spacing' => [
448 'label' => esc_html__('Letter Spacing (px)', 'shopengine'),
449 'size_units' => ['px'],
450 ],
451 ],
452 ]
453 );
454
455 $this->add_control(
456 'shopengine_product_tab_ainfo_tcell_divider_color',
457 [
458 'label' => esc_html__('Table cell divider color', 'shopengine'),
459 'type' => Controls_Manager::COLOR,
460 'default' => '#f2f2f2',
461 'alpha' => false,
462 'selectors' => [
463 '{{WRAPPER}} .shopengine-product-tabs table tr:not(:last-child)' => 'border-color: {{VALUE}};',
464 ],
465 'separator' => 'after',
466 ]
467 );
468
469 $this->add_responsive_control(
470 'shopengine_product_tab_ainfo_tcell_padding',
471 [
472 'label' => esc_html__('Table cell padding', 'shopengine'),
473 'type' => Controls_Manager::DIMENSIONS,
474 'default' => [
475 'top' => '15',
476 'right' => '35',
477 'bottom' => '15',
478 'left' => '35',
479 'unit' => 'px',
480 'isLinked' => false,
481 ],
482 'size_units' => ['px'],
483 'selectors' => [
484 '{{WRAPPER}} .shopengine-product-tabs tr td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
485 '{{WRAPPER}} .shopengine-product-tabs tr th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
486 ],
487 ]
488 );
489
490 // additional info label
491 $this->add_control(
492 'shopengine_product_tab_ainfo_label_heading',
493 [
494 'label' => esc_html__('Label', 'shopengine'),
495 'type' => Controls_Manager::HEADING,
496 'separator' => 'before',
497 ]
498 );
499
500 $this->add_control(
501 'shopengine_product_tab_ainfo_label_color',
502 [
503 'label' => esc_html__('Color', 'shopengine'),
504 'type' => Controls_Manager::COLOR,
505 'default' => '#888888',
506 'alpha' => false,
507 'selectors' => [
508 '{{WRAPPER}} .shopengine-product-tabs tr th' => 'color: {{VALUE}};',
509 ],
510 ]
511 );
512
513 $this->add_control(
514 'shopengine_product_tab_ainfo_label_bg_color',
515 [
516 'label' => esc_html__('Background', 'shopengine'),
517 'type' => Controls_Manager::COLOR,
518 'default' => '#f8f8f8',
519 'alpha' => false,
520 'selectors' => [
521 '{{WRAPPER}} .shopengine-product-tabs tr th' => 'background: {{VALUE}};',
522 ],
523 ]
524 );
525
526 $this->add_responsive_control(
527 'shopengine_product_tab_ainfo_label_width',
528 [
529 'label' => esc_html__('Width', 'shopengine'),
530 'type' => Controls_Manager::SLIDER,
531 'size_units' => ['px', '%'],
532 'range' => [
533 'px' => [
534 'min' => 0,
535 'max' => 1000,
536 'step' => 5,
537 ],
538 '%' => [
539 'min' => 0,
540 'max' => 100,
541 ],
542 ],
543 'default' => [
544 'unit' => '%',
545 'size' => 25,
546 ],
547 'selectors' => [
548 '{{WRAPPER}} .shopengine-product-tabs tr th' => 'width: {{SIZE}}{{UNIT}};',
549 ],
550 ]
551 );
552
553 // additional info value
554 $this->add_control(
555 'shopengine_product_tab_ainfo_value_heading',
556 [
557 'label' => esc_html__('Value', 'shopengine'),
558 'type' => Controls_Manager::HEADING,
559 'separator' => 'before',
560 ]
561 );
562
563 $this->add_control(
564 'shopengine_product_tab_ainfo_value_color',
565 [
566 'label' => esc_html__('Color', 'shopengine'),
567 'type' => Controls_Manager::COLOR,
568 'default' => '#101010',
569 'alpha' => false,
570 'selectors' => [
571 '{{WRAPPER}} .shopengine-product-tabs tr td p' => 'color: {{VALUE}};',
572 ],
573 ]
574 );
575
576 $this->add_control(
577 'shopengine_product_tab_ainfo_value_bg_color',
578 [
579 'label' => esc_html__('Background', 'shopengine'),
580 'type' => Controls_Manager::COLOR,
581 'default' => '#fdfdfd',
582 'alpha' => false,
583 'selectors' => [
584 '{{WRAPPER}} .shopengine-product-tabs tr td' => 'background: {{VALUE}};',
585 ],
586 ]
587 );
588
589 $this->end_controls_section();
590
591 /*
592 ---------------------------
593 average rating
594 ---------------------------
595 */
596
597 $this->start_controls_section(
598 'shopengine_product_tab_average_rating',
599 [
600 'label' => esc_html__('Average Rating', 'shopengine'),
601 'tab' => Controls_Manager::TAB_STYLE,
602 ]
603 );
604
605 $this->add_control(
606 'shopengine_product_tab_average_rating_title_section',
607 [
608 'label' => esc_html__('Rating Title', 'shopengine'),
609 'type' => Controls_Manager::HEADING,
610 'separator' => 'before',
611 ]
612 );
613
614 $this->add_control(
615 'shopengine_product_tab_average_rating_title_color',
616 [
617 'label' => esc_html__('Color', 'shopengine'),
618 'type' => Controls_Manager::COLOR,
619 'default' => '#101010',
620 'alpha' => false,
621 'selectors' => [
622 '{{WRAPPER}} .shopengine-product-tabs #reviews .se-rating-container h2' => 'color: {{VALUE}}',
623 ],
624 ]
625 );
626
627 $this->add_group_control(
628 Group_Control_Typography::get_type(),
629 [
630 'name' => 'shopengine_product_tab_average_rating_title_typography',
631 'label' => esc_html__('Label typography', 'shopengine'),
632 'selector' => '{{WRAPPER}} .shopengine-product-tabs #reviews .se-rating-container h2',
633 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'text_transform'],
634 'fields_options' => [
635 'typography' => [
636 'default' => 'custom',
637 ],
638 'font_weight' => [
639 'default' => '400',
640 ],
641 'font_size' => [
642 'label' => esc_html__('Font Size (px)', 'shopengine'),
643 'default' => [
644 'size' => '14',
645 'unit' => 'px',
646 ],
647 'size_units' => ['px'],
648 ],
649 'line_height' => [
650 'label' => esc_html__('Line height (px)', 'shopengine'),
651 'default' => [
652 'size' => '17',
653 'unit' => 'px',
654 ],
655 'size_units' => ['px'],
656 'tablet_default' => [
657 'unit' => 'px',
658 ],
659 'mobile_default' => [
660 'unit' => 'px',
661 ],
662 ],
663 ],
664 ]
665 );
666
667 $this->add_control(
668 'shopengine_product_tab_average_rating_total_section',
669 [
670 'label' => esc_html__('Rating Total', 'shopengine'),
671 'type' => Controls_Manager::HEADING,
672 'separator' => 'before',
673 ]
674 );
675
676 $this->add_control(
677 'shopengine_product_tab_average_rating_total_color',
678 [
679 'label' => esc_html__('Color', 'shopengine'),
680 'type' => Controls_Manager::COLOR,
681 'default' => '#101010',
682 'alpha' => false,
683 'selectors' => [
684 '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-avg-rating' => 'color: {{VALUE}}',
685 ],
686 ]
687 );
688
689 $this->add_group_control(
690 Group_Control_Typography::get_type(),
691 [
692 'name' => 'shopengine_product_tab_average_rating_total_typography',
693 'label' => esc_html__('Label typography', 'shopengine'),
694 'selector' => '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-avg-rating',
695 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'text_transform'],
696 'fields_options' => [
697 'typography' => [
698 'default' => 'custom',
699 ],
700 'font_weight' => [
701 'default' => '600',
702 ],
703 'font_size' => [
704 'label' => esc_html__('Font Size (px)', 'shopengine'),
705 'default' => [
706 'size' => '48',
707 'unit' => 'px',
708 ],
709 'size_units' => ['px'],
710 ],
711 'line_height' => [
712 'label' => esc_html__('Line Height (px)', 'shopengine'),
713 'default' => [
714 'size' => '46',
715 'unit' => 'px',
716 ],
717 'size_units' => ['px'],
718 'tablet_default' => [
719 'unit' => 'px',
720 ],
721 'mobile_default' => [
722 'unit' => 'px',
723 ],
724 ],
725 ],
726 ]
727 );
728
729 $this->add_control(
730 'shopengine_product_tab_average_rating_count_section',
731 [
732 'label' => esc_html__('Rating Count', 'shopengine'),
733 'type' => Controls_Manager::HEADING,
734 'separator' => 'before',
735 ]
736 );
737
738 $this->add_control(
739 'shopengine_product_tab_average_rating_count_color',
740 [
741 'label' => esc_html__('Color', 'shopengine'),
742 'type' => Controls_Manager::COLOR,
743 'default' => '#101010',
744 'alpha' => false,
745 'selectors' => [
746 '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-avg-count' => 'color: {{VALUE}}',
747 ],
748 ]
749 );
750
751 $this->add_group_control(
752 Group_Control_Typography::get_type(),
753 [
754 'name' => 'shopengine_product_tab_average_rating_count_typography',
755 'label' => esc_html__('Label typography', 'shopengine'),
756 'selector' => '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-avg-count',
757 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'text_transform'],
758 'fields_options' => [
759 'typography' => [
760 'default' => 'custom',
761 ],
762 'font_weight' => [
763 'default' => '600',
764 ],
765 'font_size' => [
766 'label' => esc_html__('Font Size (px)', 'shopengine'),
767 'default' => [
768 'size' => '16',
769 'unit' => 'px',
770 ],
771 'size_units' => ['px'],
772 ],
773 'line_height' => [
774 'label' => esc_html__('Line height (px)', 'shopengine'),
775 'default' => [
776 'size' => '19',
777 'unit' => 'px',
778 ],
779 'size_units' => ['px'],
780 'tablet_default' => [
781 'unit' => 'px',
782 ],
783 'mobile_default' => [
784 'unit' => 'px',
785 ],
786 ],
787 ],
788 ]
789 );
790
791 $this->add_control(
792 'shopengine_product_tab_average_rating_average_section',
793 [
794 'label' => esc_html__('Rating Average', 'shopengine'),
795 'type' => Controls_Manager::HEADING,
796 'separator' => 'before',
797 ]
798 );
799
800 $this->add_control(
801 'shopengine_product_tab_average_rating_average_color',
802 [
803 'label' => esc_html__('Text Color', 'shopengine'),
804 'type' => Controls_Manager::COLOR,
805 'default' => '#101010',
806 'alpha' => false,
807 'selectors' => [
808 '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-ind-rat span' => 'color: {{VALUE}}',
809 ],
810 ]
811 );
812
813 $this->add_group_control(
814 Group_Control_Typography::get_type(),
815 [
816 'name' => 'shopengine_product_tab_average_rating_average_typography',
817 'label' => esc_html__('Label typography', 'shopengine'),
818 'selector' => '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-ind-rat span',
819 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'text_transform'],
820 'fields_options' => [
821 'typography' => [
822 'default' => 'custom',
823 ],
824 'font_weight' => [
825 'default' => '400',
826 ],
827 'font_size' => [
828 'label' => esc_html__('Font Size (px)', 'shopengine'),
829 'default' => [
830 'size' => '14',
831 'unit' => 'px',
832 ],
833 'size_units' => ['px'],
834 ],
835 'line_height' => [
836 'label' => esc_html__('Line Height (px)', 'shopengine'),
837 'default' => [
838 'size' => '17',
839 'unit' => 'px',
840 ],
841 'size_units' => ['px'],
842 'tablet_default' => [
843 'unit' => 'px',
844 ],
845 'mobile_default' => [
846 'unit' => 'px',
847 ],
848 ],
849 ],
850 ]
851 );
852
853 $this->add_control(
854 'shopengine_product_tab_average_rating_average_bg_color',
855 [
856 'label' => esc_html__('Background', 'shopengine'),
857 'type' => Controls_Manager::COLOR,
858 'default' => '#F5F5F5',
859 'alpha' => false,
860 'selectors' => [
861 '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-ind-rat-cont' => 'background: {{VALUE}}',
862 ],
863 ]
864 );
865
866 $this->add_control(
867 'shopengine_product_tab_average_rating_average_active_bg_color',
868 [
869 'label' => esc_html__('Active Background', 'shopengine'),
870 'type' => Controls_Manager::COLOR,
871 'default' => '#999999',
872 'alpha' => false,
873 'selectors' => [
874 '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-ind-rat-cont span' => 'background: {{VALUE}}',
875 ],
876 ]
877 );
878
879 $this->add_responsive_control(
880 'shopengine_product_tab_average_rating_bar_width',
881 [
882 'label' => esc_html__('Rating Bar Width', 'shopengine'),
883 'type' => Controls_Manager::SLIDER,
884 'size_units' => ['px', '%'],
885 'range' => [
886 'px' => [
887 'min' => 0,
888 'max' => 200,
889 'step' => 5,
890 ],
891 '%' => [
892 'min' => 0,
893 'max' => 100,
894 'step' => 5,
895 ],
896 ],
897 'default' => [
898 'unit' => 'px',
899 'size' => 150,
900 ],
901 'selectors' => [
902 '{{WRAPPER}} .shopengine-product-tabs #reviews .se-rating-container .se-ind-rat .se-ind-rat-cont' => 'width: {{SIZE}}{{UNIT}};',
903 ],
904 ]
905 );
906
907 $this->add_responsive_control(
908 'shopengine_product_tab_average_rating_bar_height',
909 [
910 'label' => esc_html__('Rating Bar Height (px)', 'shopengine'),
911 'type' => Controls_Manager::SLIDER,
912 'size_units' => ['px'],
913 'range' => [
914 '%' => [
915 'min' => 0,
916 'max' => 200,
917 'step' => 5,
918 ],
919 ],
920 'default' => [
921 'unit' => 'px',
922 'size' => 10,
923 ],
924 'selectors' => [
925 '{{WRAPPER}} .shopengine-product-tabs #reviews .se-rating-container .se-ind-rat :is(.se-ind-rat-cont, .se-ind-rat-cont span)' => 'height: {{SIZE}}{{UNIT}};',
926 ],
927 ]
928 );
929
930 $this->end_controls_section();
931
932 /*
933 ---------------------------
934 review heading
935 ---------------------------
936 */
937
938 $this->start_controls_section(
939 'shopengine_product_tab_review_heading_section',
940 [
941 'label' => esc_html__('Review Heading', 'shopengine'),
942 'tab' => Controls_Manager::TAB_STYLE,
943 ]
944 );
945
946 $this->add_control(
947 'shopengine_product_tab_heading_color',
948 [
949 'label' => esc_html__('Color', 'shopengine'),
950 'type' => Controls_Manager::COLOR,
951 'default' => '#101010',
952 'alpha' => false,
953 'selectors' => [
954 '{{WRAPPER}} .shopengine-product-tabs :is(.woocommerce-Reviews-title, #review_form .comment-reply-title)' => 'color: {{VALUE}};',
955 ],
956 ]
957 );
958
959 $this->add_group_control(
960 Group_Control_Typography::get_type(),
961 [
962 'name' => 'shopengine_product_tab_heading_typography',
963 'label' => esc_html__('Typography', 'shopengine'),
964 'selector' => '{{WRAPPER}} .shopengine-product-tabs :is(.woocommerce-Reviews-title, #review_form .comment-reply-title)',
965 'exclude' => ['font_family', 'text_decoration', 'font_style'],
966 'fields_options' => [
967 'typography' => [
968 'default' => 'custom',
969 ],
970 'font_weight' => [
971 'default' => '700',
972 ],
973 'font_size' => [
974 'label' => esc_html__('Font Size (px)', 'shopengine'),
975 'default' => [
976 'size' => '18',
977 'unit' => 'px',
978 ],
979 'size_units' => ['px'],
980 ],
981 'text_transform' => [
982 'default' => 'uppercase',
983 ],
984 'line_height' => [
985 'label' => esc_html__('Line Height (px)', 'shopengine'),
986 'default' => [
987 'size' => '22',
988 'unit' => 'px',
989 ],
990 'size_units' => ['px'],
991 'tablet_default' => [
992 'unit' => 'px',
993 ],
994 'mobile_default' => [
995 'unit' => 'px',
996 ],
997 ],
998 'letter_spacing' => [
999 'label' => esc_html__('Letter Spacing (px)', 'shopengine'),
1000 'default' => [
1001 'size' => '0.1',
1002 ],
1003 'size_units' => ['px'],
1004 ],
1005 ],
1006 ]
1007 );
1008
1009 $this->add_responsive_control(
1010 'shopengine_product_tab_title_margin',
1011 [
1012 'label' => esc_html__( 'Margin (px)', 'shopengine' ),
1013 'type' => Controls_Manager::DIMENSIONS,
1014 'size_units' => ['px'],
1015 'default' => [
1016 'top' => '0',
1017 'right' => '0',
1018 'bottom' => '30',
1019 'left' => '0',
1020 'unit' => 'px',
1021 'isLinked' => false,
1022 ],
1023 'selectors' => [
1024 '{{WRAPPER}} .shopengine-product-tabs :is(.woocommerce-Reviews-title, #review_form .comment-reply-title)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; padding: 0;',
1025 ],
1026 'separator' => 'before',
1027 ]
1028 );
1029
1030 $this->end_controls_section();
1031
1032 /*
1033 ---------------------------
1034 review styles
1035 ---------------------------
1036 */
1037
1038 $this->start_controls_section(
1039 'shopengine_product_tab_style',
1040 [
1041 'label' => esc_html__('Review Style', 'shopengine'),
1042 'tab' => Controls_Manager::TAB_STYLE,
1043 ]
1044 );
1045
1046 $this->add_control(
1047 'shopengine_product_tab_rating_color',
1048 [
1049 'label' => esc_html__('Rating Color', 'shopengine'),
1050 'type' => Controls_Manager::COLOR,
1051 'default' => '#FEC42D',
1052 'alpha' => false,
1053 'selectors' => [
1054 '{{WRAPPER}} div.shopengine-product-tabs #reviews .star-rating' => 'color: {{VALUE}};',
1055 '{{WRAPPER}} div.shopengine-product-tabs #reviews .star-rating span' => 'color: {{VALUE}};',
1056 '{{WRAPPER}} div.shopengine-product-tabs #reviews .star-rating span::before' => 'color: {{VALUE}};',
1057 '{{WRAPPER}} div.shopengine-product-tabs #reviews .star-rating::before' => 'color: {{VALUE}};',
1058 '{{WRAPPER}} div.shopengine-product-tabs #reviews p.stars a' => 'color: {{VALUE}};',
1059 '{{WRAPPER}} div.shopengine-product-tabs #reviews p.stars.selected a' => 'color: {{VALUE}};',
1060 '{{WRAPPER}} div.shopengine-product-tabs #reviews p.stars:hover a' => 'color: {{VALUE}};',
1061 '{{WRAPPER}} div.shopengine-product-tabs #reviews p.stars a::before' => 'color: {{VALUE}};',
1062 '{{WRAPPER}} div.shopengine-product-tabs #reviews p.stars a.active~a::before' => 'color: {{VALUE}};',
1063 '{{WRAPPER}} div.shopengine-product-tabs #reviews .se-rating-container .star-rating span' => 'color: {{VALUE}};',
1064 '{{WRAPPER}} div.shopengine-product-tabs #reviews .se-rating-container .star-rating::before' => 'color: {{VALUE}};',
1065 ],
1066 ]
1067 );
1068
1069 $this->add_control(
1070 'shopengine_product_tab_date_color',
1071 [
1072 'label' => esc_html__('Date, author and description color', 'shopengine'),
1073 'type' => Controls_Manager::COLOR,
1074 'default' => '#101010',
1075 'alpha' => false,
1076 'selectors' => [
1077 '{{WRAPPER}} div.shopengine-product-tabs #reviews .commentlist > li :is(.woocommerce-review__published-date, .description p, .woocommerce-review__author, .woocommerce-review__verified, .woocommerce-review__dash)' => 'color: {{VALUE}};',
1078 ],
1079 ]
1080 );
1081
1082 $this->add_control(
1083 'shopengine_product_tab_separator_color',
1084 [
1085 'label' => esc_html__('Comment Separator Color', 'shopengine'),
1086 'type' => Controls_Manager::COLOR,
1087 'default' => '#EFEFEF',
1088 'alpha' => false,
1089 'selectors' => [
1090 '{{WRAPPER}} div.shopengine-product-tabs #reviews #comments .commentlist li' => 'border-color: {{VALUE}};',
1091 ],
1092 ]
1093 );
1094
1095 $this->add_group_control(
1096 Group_Control_Typography::get_type(),
1097 [
1098 'name' => 'shopengine_product_tab_author_typography',
1099 'label' => esc_html__('Author Typography', 'shopengine'),
1100 'selector' => '{{WRAPPER}} div.shopengine-product-tabs .woocommerce-review__author',
1101 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'line_height', 'font_style', 'text_transform'],
1102 'fields_options' => [
1103 'typography' => [
1104 'default' => 'custom',
1105 ],
1106 'font_weight' => [
1107 'default' => '700',
1108 ],
1109 'font_size' => [
1110 'label' => esc_html__('Font Size (px)', 'shopengine'),
1111 'default' => [
1112 'size' => '18',
1113 'unit' => 'px',
1114 ],
1115 'size_units' => ['px'],
1116 ],
1117 ],
1118 ]
1119 );
1120
1121 $this->add_group_control(
1122 Group_Control_Typography::get_type(),
1123 [
1124 'name' => 'shopengine_product_tab_date_typography',
1125 'label' => esc_html__('Date Typography', 'shopengine'),
1126 'selector' => '{{WRAPPER}} div.shopengine-product-tabs #reviews .commentlist > li :is(time, .woocommerce-review__published-date, .woocommerce-review__verified)',
1127 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'line_height', 'font_style', 'text_transform'],
1128 'fields_options' => [
1129 'typography' => [
1130 'default' => 'custom',
1131 ],
1132 'font_weight' => [
1133 'default' => '400',
1134 ],
1135 'font_size' => [
1136 'label' => esc_html__('Font Size (px)', 'shopengine'),
1137 'default' => [
1138 'size' => '14',
1139 'unit' => 'px',
1140 ],
1141 'size_units' => ['px'],
1142 ],
1143 ],
1144 ]
1145 );
1146
1147 $this->add_group_control(
1148 Group_Control_Typography::get_type(),
1149 [
1150 'name' => 'shopengine_product_tab_description_typography',
1151 'label' => esc_html__('Description Typography', 'shopengine'),
1152 'selector' => '{{WRAPPER}} div.shopengine-product-tabs .description p',
1153 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'text_transform'],
1154 'fields_options' => [
1155 'typography' => [
1156 'default' => 'custom',
1157 ],
1158 'font_weight' => [
1159 'default' => '400',
1160 ],
1161 'font_size' => [
1162 'label' => esc_html__('Font Size (px)', 'shopengine'),
1163 'default' => [
1164 'size' => '16',
1165 'unit' => 'px',
1166 ],
1167 'size_units' => ['px'],
1168 ],
1169 'line_height' => [
1170 'label' => esc_html__('Line Height (px)', 'shopengine'),
1171 'default' => [
1172 'size' => '28',
1173 'unit' => 'px',
1174 ],
1175 'size_units' => ['px'],
1176 'tablet_default' => [
1177 'unit' => 'px',
1178 ],
1179 'mobile_default' => [
1180 'unit' => 'px',
1181 ],
1182 ],
1183 ],
1184 ]
1185 );
1186
1187 $this->add_control(
1188 'shopengine_product_tab_single_spacing',
1189 [
1190 'label' => esc_html__('Single Review Spacing (px)', 'shopengine'),
1191 'type' => Controls_Manager::SLIDER,
1192 'size_units' => ['px'],
1193 'range' => [
1194 'px' => [
1195 'min' => 0,
1196 'max' => 100,
1197 'step' => 1,
1198 ]
1199 ],
1200 'default' => [
1201 'unit' => 'px',
1202 'size' => 35,
1203 ],
1204 'selectors' => [
1205 '{{WRAPPER}} div.shopengine-product-tabs #reviews #comments .commentlist li:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}}; padding-bottom: {{SIZE}}{{UNIT}};',
1206 '{{WRAPPER}} div.shopengine-product-tabs #reviews #comments .commentlist li:last-child' => 'margin-bottom: {{SIZE}}{{UNIT}};',
1207 ],
1208 'separator' => 'before',
1209 ]
1210 );
1211
1212 $this->end_controls_section(); // end /review styles
1213
1214 /*
1215 ---------------------------
1216 review form
1217 ---------------------------
1218 */
1219
1220 $this->start_controls_section(
1221 'shopengine_product_tab_table',
1222 [
1223 'label' => esc_html__('Review Form', 'shopengine'),
1224 'tab' => Controls_Manager::TAB_STYLE,
1225 ]
1226 );
1227
1228 $this->add_control(
1229 'shopengine_product_tab_label_heading',
1230 [
1231 'label' => esc_html__('Input Label', 'shopengine'),
1232 'type' => Controls_Manager::HEADING,
1233 ]
1234 );
1235
1236 $this->add_control(
1237 'shopengine_product_tab_label_clr',
1238 [
1239 'label' => esc_html__('Color', 'shopengine'),
1240 'type' => Controls_Manager::COLOR,
1241 'default' => '#C9C9C9',
1242 'alpha' => false,
1243 'selectors' => [
1244 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(label, .comment-notes)' => 'color: {{VALUE}} !important;',
1245 ],
1246 ]
1247 );
1248
1249 $this->add_control(
1250 'shopengine_product_tab_label_required',
1251 [
1252 'label' => esc_html__('Required Color', 'shopengine'),
1253 'type' => Controls_Manager::COLOR,
1254 'default' => '#EA4335',
1255 'alpha' => false,
1256 'selectors' => [
1257 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .required' => 'color: {{VALUE}}',
1258 ],
1259 ]
1260 );
1261
1262 $this->add_group_control(
1263 Group_Control_Typography::get_type(),
1264 [
1265 'name' => 'shopengine_product_tab_label_typography',
1266 'label' => esc_html__('Typography', 'shopengine'),
1267 'selector' => '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(label, .comment-notes)',
1268 'exclude' => ['font_family', 'text_decoration', 'font_style', 'text_transform'],
1269 'fields_options' => [
1270 'typography' => [
1271 'default' => 'custom',
1272 ],
1273 'font_weight' => [
1274 'default' => '400',
1275 ],
1276 'font_size' => [
1277 'label' => esc_html__('Font Size (px)', 'shopengine'),
1278 'default' => [
1279 'size' => '14',
1280 'unit' => 'px',
1281 ],
1282 'size_units' => ['px'],
1283 ],
1284 'line_height' => [
1285 'label' => esc_html__('Line Height (px)', 'shopengine'),
1286 'default' => [
1287 'size' => '17',
1288 'unit' => 'px',
1289 ],
1290 'size_units' => ['px'],
1291 'tablet_default' => [
1292 'unit' => 'px',
1293 ],
1294 'mobile_default' => [
1295 'unit' => 'px',
1296 ],
1297 ],
1298 'letter_spacing' => [
1299 'label' => esc_html__('Letter Spacing (px)', 'shopengine'),
1300 'default' => [
1301 'size' => '0',
1302 'unit' => 'px',
1303 ],
1304 'size_units' => ['px'],
1305 ],
1306 ],
1307 ]
1308 );
1309
1310 $this->add_control(
1311 'shopengine_product_tab_input_heading',
1312 [
1313 'label' => esc_html__('Form Input', 'shopengine'),
1314 'type' => Controls_Manager::HEADING,
1315 'separator' => 'before',
1316 ]
1317 );
1318
1319 $this->add_control(
1320 'shopengine_product_tab_input_clr',
1321 [
1322 'label' => esc_html__('Color', 'shopengine'),
1323 'type' => Controls_Manager::COLOR,
1324 'default' => '#B4B4B4',
1325 'alpha' => false,
1326 'selectors' => [
1327 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(input:not([type=checkbox]), textarea)' => 'color: {{VALUE}};',
1328 ],
1329 ]
1330 );
1331
1332 $this->add_control(
1333 'shopengine_product_tab_input_border_clr',
1334 [
1335 'label' => esc_html__('Border Color', 'shopengine'),
1336 'type' => Controls_Manager::COLOR,
1337 'default' => '#F2F2F2',
1338 'alpha' => false,
1339 'selectors' => [
1340 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(textarea, input:not(.submit))' => 'border-color: {{VALUE}};',
1341 ],
1342 ]
1343 );
1344
1345 $this->add_control(
1346 'shopengine_product_tab_input_border_focus_clr',
1347 [
1348 'label' => esc_html__('Focus Border Color', 'shopengine'),
1349 'type' => Controls_Manager::COLOR,
1350 'default' => '#505255',
1351 'alpha' => false,
1352 'selectors' => [
1353 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(textarea:focus, input:focus, .comment-form-cookies-consent input::after)' => 'border-color: {{VALUE}} !important;',
1354 ],
1355 ]
1356 );
1357
1358 $this->add_group_control(
1359 Group_Control_Typography::get_type(),
1360 [
1361 'name' => 'shopengine_review_label_input_typography',
1362 'label' => esc_html__('Typography', 'shopengine'),
1363 'selector' => '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(input:not([type=checkbox]), textarea)',
1364 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'text_transform'],
1365 'fields_options' => [
1366 'typography' => [
1367 'default' => 'custom',
1368 ],
1369 'font_weight' => [
1370 'default' => '600',
1371 ],
1372 'font_size' => [
1373 'label' => esc_html__('Font Size (px)', 'shopengine'),
1374 'default' => [
1375 'size' => '16',
1376 'unit' => 'px',
1377 ],
1378 'size_units' => ['px'],
1379 ],
1380 'line_height' => [
1381 'label' => esc_html__('Line Height (px)', 'shopengine'),
1382 'default' => [
1383 'size' => '19',
1384 'unit' => 'px',
1385 ],
1386 'size_units' => ['px'],
1387 'tablet_default' => [
1388 'unit' => 'px',
1389 ],
1390 'mobile_default' => [
1391 'unit' => 'px',
1392 ],
1393 ],
1394 ],
1395 ]
1396 );
1397
1398 $this->add_control(
1399 'shopengine_product_tab_field_spacing',
1400 [
1401 'label' => esc_html__('Field Spacing (px)', 'shopengine'),
1402 'type' => Controls_Manager::SLIDER,
1403 'size_units' => ['px'],
1404 'range' => [
1405 'px' => [
1406 'min' => 0,
1407 'max' => 100,
1408 'step' => 1,
1409 ]
1410 ],
1411 'default' => [
1412 'unit' => 'px',
1413 'size' => 15,
1414 ],
1415 'selectors' => [
1416 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond :is(.comment-form)' => 'margin: 0;',
1417 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(.comment-notes, .comment-form-rating, .comment-form-comment, .comment-form-author, .comment-form-email, .comment-form-cookies-consent)' => 'margin: 0 0 {{SIZE}}{{UNIT}} 0;',
1418 ],
1419 'separator' => 'before',
1420 ]
1421 );
1422
1423 $this->add_control(
1424 'shopengine_product_tab_input_border_radius',
1425 [
1426 'label' => esc_html__('Inputs Border Radius (px)', 'shopengine'),
1427 'type' => Controls_Manager::SLIDER,
1428 'size_units' => ['px'],
1429 'range' => [
1430 'px' => [
1431 'min' => 0,
1432 'max' => 100,
1433 'step' => 1,
1434 ]
1435 ],
1436 'default' => [
1437 'unit' => 'px',
1438 'size' => 0,
1439 ],
1440 'selectors' => [
1441 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(textarea, input)' => 'border-radius: {{SIZE}}{{UNIT}};',
1442 ],
1443 'separator' => 'before',
1444 ]
1445 );
1446
1447 $this->add_responsive_control(
1448 'shopengine_product_tab_input_padding',
1449 [
1450 'label' => esc_html__('Inputs Padding (px)', 'shopengine'),
1451 'type' => Controls_Manager::DIMENSIONS,
1452 'size_units' => ['px'],
1453 'default' => [
1454 'top' => '10',
1455 'right' => '10',
1456 'bottom' => '10',
1457 'left' => '10',
1458 'unit' => 'px',
1459 'isLinked' => true,
1460 ],
1461 'selectors' => [
1462 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(textarea, input:not(#wp-comment-cookies-consent, .submit))' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1463 ],
1464 'separator' => 'before',
1465 ]
1466 );
1467
1468 $this->end_controls_section(); // end /review form
1469
1470 /*
1471 ---------------------------------
1472 submit button
1473 ------------------------------------
1474 */
1475
1476 $this->start_controls_section(
1477 'shopengine_product_tab_submit_button_section',
1478 [
1479 'label' => esc_html__('Submit Button', 'shopengine'),
1480 'tab' => Controls_Manager::TAB_STYLE,
1481 ]
1482 );
1483
1484 $this->add_group_control(
1485 Group_Control_Typography::get_type(),
1486 [
1487 'name' => 'shopengine_product_tab_submit_button_typography',
1488 'label' => esc_html__('Button Typography', 'shopengine'),
1489 'selector' => '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit',
1490 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'],
1491 'fields_options' => [
1492 'typography' => [
1493 'default' => 'custom',
1494 ],
1495 'font_weight' => [
1496 'default' => '500',
1497 ],
1498 'font_size' => [
1499 'label' => esc_html__('Font Size (px)', 'shopengine'),
1500 'default' => [
1501 'size' => '15',
1502 'unit' => 'px',
1503 ],
1504 'responsive' => false,
1505 'size_units' => ['px'],
1506 ],
1507 'line_height' => [
1508 'label' => esc_html__('Line Height (px)', 'shopengine'),
1509 'default' => [
1510 'size' => '19',
1511 'unit' => 'px',
1512 ],
1513 'size_units' => ['px'],
1514 'tablet_default' => [
1515 'unit' => 'px',
1516 ],
1517 'mobile_default' => [
1518 'unit' => 'px',
1519 ],
1520 ],
1521 ],
1522 ]
1523 );
1524
1525 $this->add_responsive_control(
1526 'shopengine_product_tab_submit_button_alignment',
1527 [
1528 'label' => esc_html__('Alignment', 'shopengine'),
1529 'type' => Controls_Manager::CHOOSE,
1530 'options' => [
1531 'left' => [
1532 'title' => esc_html__('Left', 'shopengine'),
1533 'icon' => 'fa fa-align-left',
1534 ],
1535 'center' => [
1536 'title' => esc_html__('Center', 'shopengine'),
1537 'icon' => 'fa fa-align-center',
1538 ],
1539 'right' => [
1540 'title' => esc_html__('Right', 'shopengine'),
1541 'icon' => 'fa fa-align-right',
1542 ],
1543 ],
1544 'default' => 'left',
1545 'selectors' => [
1546 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit' => 'text-align: {{VALUE}} !important;',
1547 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit' => 'float: none;',
1548 ],
1549 ]
1550 );
1551
1552 $this->start_controls_tabs(
1553 'shopengine_product_tab_submit_button_tabs',
1554 [
1555 'separator' => 'before'
1556 ]
1557 );
1558
1559 $this->start_controls_tab(
1560 'shopengine_product_tab_submit_button_tab_normal',
1561 [
1562 'label' => esc_html__('Normal', 'shopengine'),
1563 ]
1564 );
1565
1566 $this->add_control(
1567 'shopengine_product_tab_submit_button_color',
1568 [
1569 'label' => esc_html__('Color', 'shopengine'),
1570 'type' => Controls_Manager::COLOR,
1571 'default' => '#fff',
1572 'alpha' => false,
1573 'selectors' => [
1574 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit' => 'color: {{VALUE}} !important;',
1575 ],
1576 ]
1577 );
1578
1579 $this->add_control(
1580 'shopengine_product_tab_submit_button_bg',
1581 [
1582 'label' => esc_html__('Background', 'shopengine'),
1583 'type' => Controls_Manager::COLOR,
1584 'default' => '#3A3A3A',
1585 'alpha' => false,
1586 'selectors' => [
1587 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit' => 'background-color: {{VALUE}} !important;',
1588 ],
1589 ]
1590 );
1591
1592 $this->end_controls_tab();
1593
1594 $this->start_controls_tab(
1595 'shopengine_product_tab_submit_button_tab_hover',
1596 [
1597 'label' => esc_html__('Hover', 'shopengine'),
1598 ]
1599 );
1600
1601 $this->add_control(
1602 'shopengine_product_tab_submit_button_hover_color',
1603 [
1604 'label' => esc_html__('Color', 'shopengine'),
1605 'type' => Controls_Manager::COLOR,
1606 'alpha' => false,
1607 'default' => '#fff',
1608 'selectors' => [
1609 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit:hover' => 'color: {{VALUE}} !important;',
1610 ],
1611 ]
1612 );
1613
1614 $this->add_control(
1615 'shopengine_product_tab_submit_button_hover_bg',
1616 [
1617 'label' => esc_html__('Background', 'shopengine'),
1618 'type' => Controls_Manager::COLOR,
1619 'default' => '#101010',
1620 'alpha' => false,
1621 'selectors' => [
1622 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit:hover' => 'background-color: {{VALUE}} !important;',
1623 ],
1624 ]
1625 );
1626
1627 $this->add_control(
1628 'shopengine_product_tab_submit_button_hover_border_color',
1629 [
1630 'label' => esc_html__('Border Color', 'shopengine'),
1631 'type' => Controls_Manager::COLOR,
1632 'default' => '#101010',
1633 'alpha' => false,
1634 'selectors' => [
1635 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit:hover' => 'border-color: {{VALUE}};',
1636 ],
1637 ]
1638 );
1639
1640 $this->end_controls_tab();
1641 $this->end_controls_tabs();
1642
1643 $this->add_group_control(
1644 Group_Control_Border::get_type(),
1645 [
1646 'name' => 'shopengine_product_tab_submit_button_border',
1647 'label' => esc_html__('Border (px)', 'shopengine'),
1648 'size_units' => ['px'],
1649 'fields_options' => [
1650 'border' => [
1651 'default' => 'solid',
1652 ],
1653 'width' => [
1654 'label' => esc_html__('Width (px)', 'shopengine'),
1655 'default' => [
1656 'top' => '1',
1657 'right' => '1',
1658 'bottom' => '1',
1659 'left' => '1',
1660 'isLinked' => true,
1661 ],
1662 'responsive' => false,
1663 ],
1664 'color' => [
1665 'default' => '#3A3A3A',
1666 'alpha' => false,
1667 ]
1668 ],
1669 'selector' => '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit',
1670 'separator' => 'before'
1671 ]
1672 );
1673
1674 $this->add_control(
1675 'shopengine_product_tab_submit_button_border_radius',
1676 [
1677 'label' => esc_html__('Border Radius (px)', 'shopengine'),
1678 'type' => Controls_Manager::DIMENSIONS,
1679 'size_units' => ['px'],
1680 'default' => [
1681 'top' => '3',
1682 'right' => '3',
1683 'bottom' => '3',
1684 'left' => '3',
1685 'unit' => 'px',
1686 'isLinked' => true,
1687 ],
1688 'selectors' => [
1689 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
1690 ],
1691 'separator' => 'before'
1692 ]
1693 );
1694
1695 $this->add_responsive_control(
1696 'shopengine_product_tab_submit_button_padding',
1697 [
1698 'label' => esc_html__('Padding (px)', 'shopengine'),
1699 'type' => Controls_Manager::DIMENSIONS,
1700 'size_units' => ['px'],
1701 'default' => [
1702 'top' => '10',
1703 'right' => '25',
1704 'bottom' => '10',
1705 'left' => '25',
1706 'unit' => 'px',
1707 'isLinked' => false,
1708 ],
1709 'selectors' => [
1710 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
1711 ],
1712 'separator' => 'before'
1713 ]
1714 );
1715
1716 $this->end_controls_section(); // end ./ submit button
1717
1718 $this->start_controls_section(
1719 'shopengine_product_tabs_global_font',
1720 [
1721 'label' => esc_html__('Global Font', 'shopengine'),
1722 'tab' => Controls_Manager::TAB_STYLE,
1723 ]
1724 );
1725
1726 $this->add_control(
1727 'shopengine_product_tabs_font_family',
1728 [
1729 'label' => esc_html__('Font Family', 'shopengine'),
1730 'description' => esc_html__('This font family is set for this specific widget.', 'shopengine'),
1731 'type' => Controls_Manager::FONT,
1732 'default' => '',
1733 'selectors' => [
1734 '{{WRAPPER}} .shopengine-product-tabs' => 'font-family: {{VALUE}}',
1735 '{{WRAPPER}} .shopengine-product-tabs :is(a, h2, p, input, tr, th, td, .woocommerce-Tabs-panel, .comment-reply-title)' => 'font-family: {{VALUE}}',
1736 ],
1737 ]
1738 );
1739
1740 $this->end_controls_section();
1741 }
1742
1743
1744 protected function screen() {
1745
1746 $settings = $this->get_settings_for_display();
1747
1748 $post_type = get_post_type();
1749
1750 add_filter('woocommerce_reviews_title', [$this, 'change_html'], 99, 3);
1751
1752 $tpl = Products::instance()->get_widget_template($this->get_name());
1753
1754 include $tpl;
1755 }
1756
1757 public function change_html($reviews_title, $count, $product) {
1758
1759 $average = $product->get_average_rating();
1760
1761 $rating_5 = $product->get_rating_count(5);
1762 $rating_4 = $product->get_rating_count(4);
1763 $rating_3 = $product->get_rating_count(3);
1764 $rating_2 = $product->get_rating_count(2);
1765 $rating_1 = $product->get_rating_count(1);
1766 $total = $rating_1 + $rating_2 + $rating_3 + $rating_4 + $rating_5;
1767 $pct5 = $pct4 = $pct3 = $pct2 = $pct1 = 0;
1768
1769 if ($total > 0) {
1770 $pct5 = ceil($rating_5 * 100 / $total);
1771 $pct4 = ceil($rating_4 * 100 / $total);
1772 $pct3 = ceil($rating_3 * 100 / $total);
1773 $pct2 = ceil($rating_2 * 100 / $total);
1774 $pct1 = ceil($rating_1 * 100 / $total);
1775 }
1776
1777 $details = '<div class="se-ind-rat"><span>' . __('5 star', 'shopengine') . '</span> <span class="se-ind-rat-cont"><span style="width: ' . $pct5 . '%"> </span></span> <span>' . $pct5 . '%</span></div><br/> ';
1778 $details .= '<div class="se-ind-rat"><span>' . __('4 star', 'shopengine') . '</span> <span class="se-ind-rat-cont"><span style="width: ' . $pct4 . '%"> </span></span> <span>' . $pct4 . '%</span></div><br/> ';
1779 $details .= '<div class="se-ind-rat"><span>' . __('3 star', 'shopengine') . '</span> <span class="se-ind-rat-cont"><span style="width: ' . $pct3 . '%"> </span></span> <span>' . $pct3 . '%</span></div><br/> ';
1780 $details .= '<div class="se-ind-rat"><span>' . __('2 star', 'shopengine') . '</span> <span class="se-ind-rat-cont"><span style="width: ' . $pct2 . '%"> </span></span> <span>' . $pct2 . '%</span></div><br/> ';
1781 $details .= '<div class="se-ind-rat"><span>' . __('1 star', 'shopengine') . '</span> <span class="se-ind-rat-cont"><span style="width: ' . $pct1 . '%"> </span></span> <span>' . $pct1 . '%</span></div><br/> ';
1782
1783
1784 $htm = '</h2>';
1785 $htm .= '<div class="se-rating-container">';
1786 $htm .= '<h2>Average rating</h2>';
1787 $htm .= '<div class="se-avg-rating">' . $average . '</div>';
1788
1789 $htm .= wc_get_rating_html($average, $count);
1790
1791 $htm .= '<strong class="se-avg-count">' . $count . ' Review</strong>';
1792 $htm .= $details;
1793 $htm .= '</div><h2 class="woocommerce-Reviews-title">';
1794
1795 return $htm . $reviews_title;
1796 }
1797 }
1798