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