PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.9.2
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.9.2
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 4 days ago product-tabs-config.php 4 years ago product-tabs.php 4 days ago
product-tabs.php
2089 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 // attribute links controls
756 $this->add_control(
757 'shopengine_product_tabs_attribute_links_heading',
758 [
759 'label' => esc_html__('Attribute Links', 'shopengine'),
760 'type' => Controls_Manager::HEADING,
761 'separator' => 'before',
762 ]
763 );
764
765 $this->add_control(
766 'shopengine_product_tabs_enable_attribute_links',
767 [
768 'label' => esc_html__('Enable Attribute Links', 'shopengine'),
769 'type' => Controls_Manager::SWITCHER,
770 'label_on' => esc_html__('Yes', 'shopengine'),
771 'label_off' => esc_html__('No', 'shopengine'),
772 'return_value' => 'yes',
773 'default' => 'yes',
774 'description' => esc_html__('Enable linking product attributes to shop archive page with filters', 'shopengine'),
775 ]
776 );
777
778 $this->start_controls_tabs(
779 'shopengine_product_tabs_attribute_link_tabs',
780 [
781 'condition' => [
782 'shopengine_product_tabs_enable_attribute_links' => 'yes',
783 ],
784 ]
785 );
786
787 $this->start_controls_tab(
788 'shopengine_product_tabs_attribute_link_normal',
789 [
790 'label' => esc_html__('Normal', 'shopengine'),
791 ]
792 );
793
794 $this->add_control(
795 'shopengine_product_tabs_attribute_link_color',
796 [
797 'label' => esc_html__('Link Color', 'shopengine'),
798 'type' => Controls_Manager::COLOR,
799 'default' => '#000000',
800 'alpha' => false,
801 'selectors' => [
802 '{{WRAPPER}} .shopengine-product-tabs .woocommerce-product-attributes-item__value a' => 'color: {{VALUE}} !important;',
803 '{{WRAPPER}} .shopengine-product-tabs .shop_attributes a' => 'color: {{VALUE}} !important;',
804 ],
805 ]
806 );
807
808 $this->end_controls_tab();
809
810 $this->start_controls_tab(
811 'shopengine_product_tabs_attribute_link_hover',
812 [
813 'label' => esc_html__('Hover', 'shopengine'),
814 ]
815 );
816
817 $this->add_control(
818 'shopengine_product_tabs_attribute_link_hover_color',
819 [
820 'label' => esc_html__('Hover Color', 'shopengine'),
821 'type' => Controls_Manager::COLOR,
822 'default' => '#0000ff',
823 'alpha' => false,
824 'selectors' => [
825 '{{WRAPPER}} .shopengine-product-tabs .woocommerce-product-attributes-item__value a:hover' => 'color: {{VALUE}} !important;',
826 '{{WRAPPER}} .shopengine-product-tabs .shop_attributes a:hover' => 'color: {{VALUE}} !important;',
827 ],
828 ]
829 );
830
831 $this->end_controls_tab();
832 $this->end_controls_tabs();
833
834 $this->add_control(
835 'shopengine_product_tabs_attribute_link_decoration',
836 [
837 'label' => esc_html__('Text Decoration', 'shopengine'),
838 'type' => Controls_Manager::SELECT,
839 'default' => 'none',
840 'options' => [
841 'none' => esc_html__('None', 'shopengine'),
842 'underline' => esc_html__('Underline', 'shopengine'),
843 ],
844 'selectors' => [
845 '{{WRAPPER}} .shopengine-product-tabs .woocommerce-product-attributes-item__value a' => 'text-decoration: {{VALUE}} !important;',
846 '{{WRAPPER}} .shopengine-product-tabs .shop_attributes a' => 'text-decoration: {{VALUE}} !important;',
847 ],
848 'condition' => [
849 'shopengine_product_tabs_enable_attribute_links' => 'yes',
850 ],
851 ]
852 );
853
854 $this->add_control(
855 'shopengine_product_tabs_attribute_link_target',
856 [
857 'label' => esc_html__('Open in New Tab', 'shopengine'),
858 'type' => Controls_Manager::SWITCHER,
859 'label_on' => esc_html__('Yes', 'shopengine'),
860 'label_off' => esc_html__('No', 'shopengine'),
861 'return_value' => '_blank',
862 'default' => '',
863 'description' => esc_html__('Open attribute links in a new tab/window', 'shopengine'),
864 'condition' => [
865 'shopengine_product_tabs_enable_attribute_links' => 'yes',
866 ],
867 ]
868 );
869
870 $this->end_controls_section();
871
872 /*
873 ---------------------------
874 average rating
875 ---------------------------
876 */
877
878 $this->start_controls_section(
879 'shopengine_product_tab_average_rating',
880 [
881 'label' => esc_html__('Average Rating', 'shopengine'),
882 'tab' => Controls_Manager::TAB_STYLE,
883 ]
884 );
885
886 $this->add_control(
887 'shopengine_product_tab_average_rating_title_section',
888 [
889 'label' => esc_html__('Rating Title', 'shopengine'),
890 'type' => Controls_Manager::HEADING,
891 'separator' => 'before',
892 ]
893 );
894
895 $this->add_control(
896 'shopengine_product_tab_average_rating_title_color',
897 [
898 'label' => esc_html__('Color', 'shopengine'),
899 'type' => Controls_Manager::COLOR,
900 'default' => '#101010',
901 'alpha' => false,
902 'selectors' => [
903 '{{WRAPPER}} .shopengine-product-tabs #reviews .se-rating-container h2' => 'color: {{VALUE}}',
904 ],
905 ]
906 );
907
908 $this->add_group_control(
909 Group_Control_Typography::get_type(),
910 [
911 'name' => 'shopengine_product_tab_average_rating_title_typography',
912 'label' => esc_html__(' Label Typography', 'shopengine'),
913 'selector' => '{{WRAPPER}} .shopengine-product-tabs #reviews .se-rating-container h2',
914 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'text_transform'],
915 'fields_options' => [
916 'typography' => [
917 'default' => 'custom',
918 ],
919 'font_weight' => [
920 'default' => '400',
921 ],
922 'font_size' => [
923 'label' => esc_html__('Font Size (px)', 'shopengine'),
924 'default' => [
925 'size' => '14',
926 'unit' => 'px',
927 ],
928 'size_units' => ['px'],
929 ],
930 'line_height' => [
931 'label' => esc_html__('Line height (px)', 'shopengine'),
932 'default' => [
933 'size' => '17',
934 'unit' => 'px',
935 ],
936 'size_units' => ['px'],
937 'tablet_default' => [
938 'unit' => 'px',
939 ],
940 'mobile_default' => [
941 'unit' => 'px',
942 ],
943 ],
944 ],
945 ]
946 );
947
948 $this->add_control(
949 'shopengine_product_tab_average_rating_total_section',
950 [
951 'label' => esc_html__('Rating Total', 'shopengine'),
952 'type' => Controls_Manager::HEADING,
953 'separator' => 'before',
954 ]
955 );
956
957 $this->add_control(
958 'shopengine_product_tab_average_rating_total_color',
959 [
960 'label' => esc_html__('Color', 'shopengine'),
961 'type' => Controls_Manager::COLOR,
962 'default' => '#101010',
963 'alpha' => false,
964 'selectors' => [
965 '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-avg-rating' => 'color: {{VALUE}}',
966 ],
967 ]
968 );
969
970 $this->add_group_control(
971 Group_Control_Typography::get_type(),
972 [
973 'name' => 'shopengine_product_tab_average_rating_total_typography',
974 'label' => esc_html__('Label typography', 'shopengine'),
975 'selector' => '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-avg-rating',
976 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'text_transform'],
977 'fields_options' => [
978 'typography' => [
979 'default' => 'custom',
980 ],
981 'font_weight' => [
982 'default' => '600',
983 ],
984 'font_size' => [
985 'label' => esc_html__('Font Size (px)', 'shopengine'),
986 'default' => [
987 'size' => '48',
988 'unit' => 'px',
989 ],
990 'size_units' => ['px'],
991 ],
992 'line_height' => [
993 'label' => esc_html__('Line Height (px)', 'shopengine'),
994 'default' => [
995 'size' => '46',
996 'unit' => 'px',
997 ],
998 'size_units' => ['px'],
999 'tablet_default' => [
1000 'unit' => 'px',
1001 ],
1002 'mobile_default' => [
1003 'unit' => 'px',
1004 ],
1005 ],
1006 ],
1007 ]
1008 );
1009
1010 $this->add_control(
1011 'shopengine_product_tab_average_rating_count_section',
1012 [
1013 'label' => esc_html__('Rating Count', 'shopengine'),
1014 'type' => Controls_Manager::HEADING,
1015 'separator' => 'before',
1016 ]
1017 );
1018
1019 $this->add_control(
1020 'shopengine_product_tab_average_rating_count_color',
1021 [
1022 'label' => esc_html__('Color', 'shopengine'),
1023 'type' => Controls_Manager::COLOR,
1024 'default' => '#101010',
1025 'alpha' => false,
1026 'selectors' => [
1027 '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-avg-count' => 'color: {{VALUE}}',
1028 ],
1029 ]
1030 );
1031
1032 $this->add_group_control(
1033 Group_Control_Typography::get_type(),
1034 [
1035 'name' => 'shopengine_product_tab_average_rating_count_typography',
1036 'label' => esc_html__(' Label Typography', 'shopengine'),
1037 'selector' => '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-avg-count',
1038 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'text_transform'],
1039 'fields_options' => [
1040 'typography' => [
1041 'default' => 'custom',
1042 ],
1043 'font_weight' => [
1044 'default' => '600',
1045 ],
1046 'font_size' => [
1047 'label' => esc_html__('Font Size (px)', 'shopengine'),
1048 'default' => [
1049 'size' => '16',
1050 'unit' => 'px',
1051 ],
1052 'size_units' => ['px'],
1053 ],
1054 'line_height' => [
1055 'label' => esc_html__('Line height (px)', 'shopengine'),
1056 'default' => [
1057 'size' => '19',
1058 'unit' => 'px',
1059 ],
1060 'size_units' => ['px'],
1061 'tablet_default' => [
1062 'unit' => 'px',
1063 ],
1064 'mobile_default' => [
1065 'unit' => 'px',
1066 ],
1067 ],
1068 ],
1069 ]
1070 );
1071
1072 $this->add_control(
1073 'shopengine_product_tab_average_rating_average_section',
1074 [
1075 'label' => esc_html__('Rating Average', 'shopengine'),
1076 'type' => Controls_Manager::HEADING,
1077 'separator' => 'before',
1078 ]
1079 );
1080
1081 $this->add_control(
1082 'shopengine_product_tab_average_rating_average_color',
1083 [
1084 'label' => esc_html__('Text Color', 'shopengine'),
1085 'type' => Controls_Manager::COLOR,
1086 'default' => '#101010',
1087 'alpha' => false,
1088 'selectors' => [
1089 '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-ind-rat span' => 'color: {{VALUE}}',
1090 ],
1091 ]
1092 );
1093
1094 $this->add_group_control(
1095 Group_Control_Typography::get_type(),
1096 [
1097 'name' => 'shopengine_product_tab_average_rating_average_typography',
1098 'label' => esc_html__('Label Typography', 'shopengine'),
1099 'selector' => '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-ind-rat span',
1100 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'text_transform'],
1101 'fields_options' => [
1102 'typography' => [
1103 'default' => 'custom',
1104 ],
1105 'font_weight' => [
1106 'default' => '400',
1107 ],
1108 'font_size' => [
1109 'label' => esc_html__('Font Size (px)', 'shopengine'),
1110 'default' => [
1111 'size' => '14',
1112 'unit' => 'px',
1113 ],
1114 'size_units' => ['px'],
1115 ],
1116 'line_height' => [
1117 'label' => esc_html__('Line Height (px)', 'shopengine'),
1118 'default' => [
1119 'size' => '17',
1120 'unit' => 'px',
1121 ],
1122 'size_units' => ['px'],
1123 'tablet_default' => [
1124 'unit' => 'px',
1125 ],
1126 'mobile_default' => [
1127 'unit' => 'px',
1128 ],
1129 ],
1130 ],
1131 ]
1132 );
1133
1134 $this->add_control(
1135 'shopengine_product_tab_average_rating_average_bg_color',
1136 [
1137 'label' => esc_html__('Background', 'shopengine'),
1138 'type' => Controls_Manager::COLOR,
1139 'default' => '#F5F5F5',
1140 'alpha' => false,
1141 'selectors' => [
1142 '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-ind-rat-cont' => 'background: {{VALUE}}',
1143 ],
1144 ]
1145 );
1146
1147 $this->add_control(
1148 'shopengine_product_tab_average_rating_average_active_bg_color',
1149 [
1150 'label' => esc_html__('Active Background', 'shopengine'),
1151 'type' => Controls_Manager::COLOR,
1152 'default' => '#999999',
1153 'alpha' => false,
1154 'selectors' => [
1155 '{{WRAPPER}} .shopengine-product-tabs .se-rating-container .se-ind-rat-cont span' => 'background: {{VALUE}}',
1156 ],
1157 ]
1158 );
1159
1160 $this->add_responsive_control(
1161 'shopengine_product_tab_average_rating_bar_width',
1162 [
1163 'label' => esc_html__('Rating Bar Width', 'shopengine'),
1164 'type' => Controls_Manager::SLIDER,
1165 'size_units' => ['px', '%'],
1166 'range' => [
1167 'px' => [
1168 'min' => 0,
1169 'max' => 200,
1170 'step' => 5,
1171 ],
1172 '%' => [
1173 'min' => 0,
1174 'max' => 100,
1175 'step' => 5,
1176 ],
1177 ],
1178 'default' => [
1179 'unit' => 'px',
1180 'size' => 150,
1181 ],
1182 'selectors' => [
1183 '{{WRAPPER}} .shopengine-product-tabs #reviews .se-rating-container .se-ind-rat .se-ind-rat-cont' => 'width: {{SIZE}}{{UNIT}};',
1184 ],
1185 ]
1186 );
1187
1188 $this->add_responsive_control(
1189 'shopengine_product_tab_average_rating_bar_height',
1190 [
1191 'label' => esc_html__('Rating Bar Height (px)', 'shopengine'),
1192 'type' => Controls_Manager::SLIDER,
1193 'size_units' => ['px'],
1194 'range' => [
1195 '%' => [
1196 'min' => 0,
1197 'max' => 200,
1198 'step' => 5,
1199 ],
1200 ],
1201 'default' => [
1202 'unit' => 'px',
1203 'size' => 10,
1204 ],
1205 'selectors' => [
1206 '{{WRAPPER}} .shopengine-product-tabs #reviews .se-rating-container .se-ind-rat :is(.se-ind-rat-cont, .se-ind-rat-cont span)' => 'height: {{SIZE}}{{UNIT}};',
1207 ],
1208 ]
1209 );
1210
1211 $this->end_controls_section();
1212
1213 /*
1214 ---------------------------
1215 review heading
1216 ---------------------------
1217 */
1218
1219 $this->start_controls_section(
1220 'shopengine_product_tab_review_heading_section',
1221 [
1222 'label' => esc_html__('Review Heading', 'shopengine'),
1223 'tab' => Controls_Manager::TAB_STYLE,
1224 ]
1225 );
1226
1227 $this->add_control(
1228 'shopengine_product_tab_heading_color',
1229 [
1230 'label' => esc_html__('Color', 'shopengine'),
1231 'type' => Controls_Manager::COLOR,
1232 'default' => '#101010',
1233 'alpha' => false,
1234 'selectors' => [
1235 '{{WRAPPER}} .shopengine-product-tabs :is(.woocommerce-Reviews-title, #review_form .comment-reply-title)' => 'color: {{VALUE}};',
1236 ],
1237 ]
1238 );
1239
1240 $this->add_group_control(
1241 Group_Control_Typography::get_type(),
1242 [
1243 'name' => 'shopengine_product_tab_heading_typography',
1244 'label' => esc_html__('Typography', 'shopengine'),
1245 'selector' => '{{WRAPPER}} .shopengine-product-tabs :is(.woocommerce-Reviews-title, #review_form .comment-reply-title)',
1246 'exclude' => ['font_family', 'text_decoration', 'font_style'],
1247 'fields_options' => [
1248 'typography' => [
1249 'default' => 'custom',
1250 ],
1251 'font_weight' => [
1252 'default' => '700',
1253 ],
1254 'font_size' => [
1255 'label' => esc_html__('Font Size (px)', 'shopengine'),
1256 'default' => [
1257 'size' => '18',
1258 'unit' => 'px',
1259 ],
1260 'size_units' => ['px'],
1261 ],
1262 'text_transform' => [
1263 'default' => 'uppercase',
1264 ],
1265 'line_height' => [
1266 'label' => esc_html__('Line Height (px)', 'shopengine'),
1267 'default' => [
1268 'size' => '22',
1269 'unit' => 'px',
1270 ],
1271 'size_units' => ['px'],
1272 'tablet_default' => [
1273 'unit' => 'px',
1274 ],
1275 'mobile_default' => [
1276 'unit' => 'px',
1277 ],
1278 ],
1279 'letter_spacing' => [
1280 'label' => esc_html__('Letter Spacing (px)', 'shopengine'),
1281 'default' => [
1282 'size' => '0.1',
1283 ],
1284 'size_units' => ['px'],
1285 ],
1286 ],
1287 ]
1288 );
1289
1290 $this->add_responsive_control(
1291 'shopengine_product_tab_title_margin',
1292 [
1293 'label' => esc_html__( 'Margin (px)', 'shopengine' ),
1294 'type' => Controls_Manager::DIMENSIONS,
1295 'size_units' => ['px'],
1296 'default' => [
1297 'top' => '0',
1298 'right' => '0',
1299 'bottom' => '30',
1300 'left' => '0',
1301 'unit' => 'px',
1302 'isLinked' => false,
1303 ],
1304 'selectors' => [
1305 '{{WRAPPER}} .shopengine-product-tabs :is(.woocommerce-Reviews-title, #review_form .comment-reply-title)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; padding: 0;',
1306 '.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;',
1307 ],
1308 'separator' => 'before',
1309 ]
1310 );
1311
1312 $this->end_controls_section();
1313
1314 /*
1315 ---------------------------
1316 review styles
1317 ---------------------------
1318 */
1319
1320 $this->start_controls_section(
1321 'shopengine_product_tab_style',
1322 [
1323 'label' => esc_html__('Review Style', 'shopengine'),
1324 'tab' => Controls_Manager::TAB_STYLE,
1325 ]
1326 );
1327
1328 $this->add_control(
1329 'shopengine_product_tab_rating_color',
1330 [
1331 'label' => esc_html__('Rating Color', 'shopengine'),
1332 'type' => Controls_Manager::COLOR,
1333 'default' => '#FEC42D',
1334 'alpha' => false,
1335 'selectors' => [
1336 '{{WRAPPER}} div.shopengine-product-tabs #reviews .star-rating' => 'color: {{VALUE}};',
1337 '{{WRAPPER}} div.shopengine-product-tabs #reviews .star-rating span' => 'color: {{VALUE}};',
1338 '{{WRAPPER}} div.shopengine-product-tabs #reviews .star-rating span::before' => 'color: {{VALUE}};',
1339 '{{WRAPPER}} div.shopengine-product-tabs #reviews .star-rating::before' => 'color: {{VALUE}};',
1340 '{{WRAPPER}} div.shopengine-product-tabs #reviews p.stars a' => 'color: {{VALUE}};',
1341 '{{WRAPPER}} div.shopengine-product-tabs #reviews p.stars.selected a' => 'color: {{VALUE}};',
1342 '{{WRAPPER}} div.shopengine-product-tabs #reviews p.stars:hover a' => 'color: {{VALUE}};',
1343 '{{WRAPPER}} div.shopengine-product-tabs #reviews p.stars a::before' => 'color: {{VALUE}};',
1344 '{{WRAPPER}} div.shopengine-product-tabs #reviews p.stars a.active~a::before' => 'color: {{VALUE}};',
1345 '{{WRAPPER}} div.shopengine-product-tabs #reviews .se-rating-container .star-rating span' => 'color: {{VALUE}};',
1346 '{{WRAPPER}} div.shopengine-product-tabs #reviews .se-rating-container .star-rating::before' => 'color: {{VALUE}};',
1347 ],
1348 ]
1349 );
1350
1351 $this->add_control(
1352 'shopengine_product_tab_date_color',
1353 [
1354 'label' => esc_html__('Date, Author and Description Color', 'shopengine'),
1355 'type' => Controls_Manager::COLOR,
1356 'default' => '#101010',
1357 'alpha' => false,
1358 'selectors' => [
1359 '{{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}};',
1360 ],
1361 ]
1362 );
1363
1364 $this->add_control(
1365 'shopengine_product_tab_separator_color',
1366 [
1367 'label' => esc_html__('Comment Separator Color', 'shopengine'),
1368 'type' => Controls_Manager::COLOR,
1369 'default' => '#EFEFEF',
1370 'alpha' => false,
1371 'selectors' => [
1372 '{{WRAPPER}} div.shopengine-product-tabs #reviews #comments .commentlist li' => 'border-color: {{VALUE}};',
1373 ],
1374 ]
1375 );
1376
1377 $this->add_group_control(
1378 Group_Control_Typography::get_type(),
1379 [
1380 'name' => 'shopengine_product_tab_author_typography',
1381 'label' => esc_html__('Author Typography', 'shopengine'),
1382 'selector' => '{{WRAPPER}} div.shopengine-product-tabs .woocommerce-review__author',
1383 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'line_height', 'font_style', 'text_transform'],
1384 'fields_options' => [
1385 'typography' => [
1386 'default' => 'custom',
1387 ],
1388 'font_weight' => [
1389 'default' => '700',
1390 ],
1391 'font_size' => [
1392 'label' => esc_html__('Font Size (px)', 'shopengine'),
1393 'default' => [
1394 'size' => '18',
1395 'unit' => 'px',
1396 ],
1397 'size_units' => ['px'],
1398 ],
1399 ],
1400 ]
1401 );
1402
1403 $this->add_group_control(
1404 Group_Control_Typography::get_type(),
1405 [
1406 'name' => 'shopengine_product_tab_date_typography',
1407 'label' => esc_html__('Date Typography', 'shopengine'),
1408 'selector' => '{{WRAPPER}} div.shopengine-product-tabs #reviews .commentlist > li :is(time, .woocommerce-review__published-date, .woocommerce-review__verified)',
1409 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'line_height', 'font_style', 'text_transform'],
1410 'fields_options' => [
1411 'typography' => [
1412 'default' => 'custom',
1413 ],
1414 'font_weight' => [
1415 'default' => '400',
1416 ],
1417 'font_size' => [
1418 'label' => esc_html__('Font Size (px)', 'shopengine'),
1419 'default' => [
1420 'size' => '14',
1421 'unit' => 'px',
1422 ],
1423 'size_units' => ['px'],
1424 ],
1425 ],
1426 ]
1427 );
1428
1429 $this->add_group_control(
1430 Group_Control_Typography::get_type(),
1431 [
1432 'name' => 'shopengine_product_tab_description_typography',
1433 'label' => esc_html__('Description Typography', 'shopengine'),
1434 'selector' => '{{WRAPPER}} div.shopengine-product-tabs .description p',
1435 'exclude' => ['font_family', 'letter_spacing', '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' => '16',
1447 'unit' => 'px',
1448 ],
1449 'size_units' => ['px'],
1450 ],
1451 'line_height' => [
1452 'label' => esc_html__('Line Height (px)', 'shopengine'),
1453 'default' => [
1454 'size' => '28',
1455 'unit' => 'px',
1456 ],
1457 'size_units' => ['px'],
1458 'tablet_default' => [
1459 'unit' => 'px',
1460 ],
1461 'mobile_default' => [
1462 'unit' => 'px',
1463 ],
1464 ],
1465 ],
1466 ]
1467 );
1468
1469 $this->add_control(
1470 'shopengine_product_tab_single_spacing',
1471 [
1472 'label' => esc_html__('Single Review Spacing (px)', 'shopengine'),
1473 'type' => Controls_Manager::SLIDER,
1474 'size_units' => ['px'],
1475 'range' => [
1476 'px' => [
1477 'min' => 0,
1478 'max' => 100,
1479 'step' => 1,
1480 ]
1481 ],
1482 'default' => [
1483 'unit' => 'px',
1484 'size' => 35,
1485 ],
1486 'selectors' => [
1487 '{{WRAPPER}} div.shopengine-product-tabs #reviews #comments .commentlist li:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}}; padding-bottom: {{SIZE}}{{UNIT}};',
1488 '{{WRAPPER}} div.shopengine-product-tabs #reviews #comments .commentlist li:last-child' => 'margin-bottom: {{SIZE}}{{UNIT}};',
1489 ],
1490 'separator' => 'before',
1491 ]
1492 );
1493
1494 $this->end_controls_section(); // end /review styles
1495
1496 /*
1497 ---------------------------
1498 review form
1499 ---------------------------
1500 */
1501
1502 $this->start_controls_section(
1503 'shopengine_product_tab_table',
1504 [
1505 'label' => esc_html__('Review Form', 'shopengine'),
1506 'tab' => Controls_Manager::TAB_STYLE,
1507 ]
1508 );
1509
1510 $this->add_control(
1511 'shopengine_product_tab_label_heading',
1512 [
1513 'label' => esc_html__('Input Label', 'shopengine'),
1514 'type' => Controls_Manager::HEADING,
1515 ]
1516 );
1517
1518 $this->add_control(
1519 'shopengine_product_tab_label_clr',
1520 [
1521 'label' => esc_html__('Color', 'shopengine'),
1522 'type' => Controls_Manager::COLOR,
1523 'default' => '#C9C9C9',
1524 'alpha' => false,
1525 'selectors' => [
1526 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(label, .comment-notes)' => 'color: {{VALUE}} !important;',
1527 ],
1528 ]
1529 );
1530
1531 $this->add_control(
1532 'shopengine_product_tab_label_required',
1533 [
1534 'label' => esc_html__('Required Color', 'shopengine'),
1535 'type' => Controls_Manager::COLOR,
1536 'default' => '#EA4335',
1537 'alpha' => false,
1538 'selectors' => [
1539 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .required' => 'color: {{VALUE}}',
1540 ],
1541 ]
1542 );
1543
1544 $this->add_group_control(
1545 Group_Control_Typography::get_type(),
1546 [
1547 'name' => 'shopengine_product_tab_label_typography',
1548 'label' => esc_html__('Typography', 'shopengine'),
1549 'selector' => '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(label, .comment-notes)',
1550 'exclude' => ['font_family', 'text_decoration', 'font_style', 'text_transform'],
1551 'fields_options' => [
1552 'typography' => [
1553 'default' => 'custom',
1554 ],
1555 'font_weight' => [
1556 'default' => '400',
1557 ],
1558 'font_size' => [
1559 'label' => esc_html__('Font Size (px)', 'shopengine'),
1560 'default' => [
1561 'size' => '14',
1562 'unit' => 'px',
1563 ],
1564 'size_units' => ['px'],
1565 ],
1566 'line_height' => [
1567 'label' => esc_html__('Line Height (px)', 'shopengine'),
1568 'default' => [
1569 'size' => '17',
1570 'unit' => 'px',
1571 ],
1572 'size_units' => ['px'],
1573 'tablet_default' => [
1574 'unit' => 'px',
1575 ],
1576 'mobile_default' => [
1577 'unit' => 'px',
1578 ],
1579 ],
1580 'letter_spacing' => [
1581 'label' => esc_html__('Letter Spacing (px)', 'shopengine'),
1582 'default' => [
1583 'size' => '0',
1584 'unit' => 'px',
1585 ],
1586 'size_units' => ['px'],
1587 ],
1588 ],
1589 ]
1590 );
1591
1592 $this->add_control(
1593 'shopengine_product_tab_input_heading',
1594 [
1595 'label' => esc_html__('Form Input', 'shopengine'),
1596 'type' => Controls_Manager::HEADING,
1597 'separator' => 'before',
1598 ]
1599 );
1600
1601 $this->add_control(
1602 'shopengine_product_tab_input_clr',
1603 [
1604 'label' => esc_html__('Color', 'shopengine'),
1605 'type' => Controls_Manager::COLOR,
1606 'default' => '#B4B4B4',
1607 'alpha' => false,
1608 'selectors' => [
1609 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(input:not([type=checkbox]), textarea)' => 'color: {{VALUE}};',
1610 ],
1611 ]
1612 );
1613
1614 $this->add_control(
1615 'shopengine_product_tab_input_border_clr',
1616 [
1617 'label' => esc_html__('Border Color', 'shopengine'),
1618 'type' => Controls_Manager::COLOR,
1619 'default' => '#F2F2F2',
1620 'alpha' => false,
1621 'selectors' => [
1622 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(textarea, input:not(.submit))' => 'border-color: {{VALUE}};',
1623 ],
1624 ]
1625 );
1626
1627 $this->add_control(
1628 'shopengine_product_tab_input_border_focus_clr',
1629 [
1630 'label' => esc_html__('Focus Border Color', 'shopengine'),
1631 'type' => Controls_Manager::COLOR,
1632 'default' => '#505255',
1633 'alpha' => false,
1634 'selectors' => [
1635 '{{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;',
1636 ],
1637 ]
1638 );
1639
1640 $this->add_group_control(
1641 Group_Control_Typography::get_type(),
1642 [
1643 'name' => 'shopengine_review_label_input_typography',
1644 'label' => esc_html__('Typography', 'shopengine'),
1645 'selector' => '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(input:not([type=checkbox]), textarea)',
1646 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'text_transform'],
1647 'fields_options' => [
1648 'typography' => [
1649 'default' => 'custom',
1650 ],
1651 'font_weight' => [
1652 'default' => '600',
1653 ],
1654 'font_size' => [
1655 'label' => esc_html__('Font Size (px)', 'shopengine'),
1656 'default' => [
1657 'size' => '16',
1658 'unit' => 'px',
1659 ],
1660 'size_units' => ['px'],
1661 ],
1662 'line_height' => [
1663 'label' => esc_html__('Line Height (px)', 'shopengine'),
1664 'default' => [
1665 'size' => '19',
1666 'unit' => 'px',
1667 ],
1668 'size_units' => ['px'],
1669 'tablet_default' => [
1670 'unit' => 'px',
1671 ],
1672 'mobile_default' => [
1673 'unit' => 'px',
1674 ],
1675 ],
1676 ],
1677 ]
1678 );
1679
1680 $this->add_control(
1681 'shopengine_product_tab_field_spacing',
1682 [
1683 'label' => esc_html__('Field Spacing (px)', 'shopengine'),
1684 'type' => Controls_Manager::SLIDER,
1685 'size_units' => ['px'],
1686 'range' => [
1687 'px' => [
1688 'min' => 0,
1689 'max' => 100,
1690 'step' => 1,
1691 ]
1692 ],
1693 'default' => [
1694 'unit' => 'px',
1695 'size' => 15,
1696 ],
1697 'selectors' => [
1698 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond :is(.comment-form)' => 'margin: 0;',
1699 '{{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;',
1700 ],
1701 'separator' => 'before',
1702 ]
1703 );
1704
1705 $this->add_control(
1706 'shopengine_product_tab_input_border_radius',
1707 [
1708 'label' => esc_html__('Inputs Border Radius (px)', 'shopengine'),
1709 'type' => Controls_Manager::SLIDER,
1710 'size_units' => ['px'],
1711 'range' => [
1712 'px' => [
1713 'min' => 0,
1714 'max' => 100,
1715 'step' => 1,
1716 ]
1717 ],
1718 'default' => [
1719 'unit' => 'px',
1720 'size' => 0,
1721 ],
1722 'selectors' => [
1723 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form :is(textarea, input)' => 'border-radius: {{SIZE}}{{UNIT}};',
1724 ],
1725 'separator' => 'before',
1726 ]
1727 );
1728
1729 $this->add_responsive_control(
1730 'shopengine_product_tab_input_padding',
1731 [
1732 'label' => esc_html__('Inputs Padding (px)', 'shopengine'),
1733 'type' => Controls_Manager::DIMENSIONS,
1734 'size_units' => ['px'],
1735 'default' => [
1736 'top' => '10',
1737 'right' => '10',
1738 'bottom' => '10',
1739 'left' => '10',
1740 'unit' => 'px',
1741 'isLinked' => true,
1742 ],
1743 'selectors' => [
1744 '{{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}};',
1745 '.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}};',
1746 ],
1747 'separator' => 'before',
1748 ]
1749 );
1750
1751 $this->end_controls_section(); // end /review form
1752
1753 /*
1754 ---------------------------------
1755 submit button
1756 ------------------------------------
1757 */
1758
1759 $this->start_controls_section(
1760 'shopengine_product_tab_submit_button_section',
1761 [
1762 'label' => esc_html__('Submit Button', 'shopengine'),
1763 'tab' => Controls_Manager::TAB_STYLE,
1764 ]
1765 );
1766
1767 $this->add_group_control(
1768 Group_Control_Typography::get_type(),
1769 [
1770 'name' => 'shopengine_product_tab_submit_button_typography',
1771 'label' => esc_html__('Button Typography', 'shopengine'),
1772 'selector' => '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit',
1773 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'],
1774 'fields_options' => [
1775 'typography' => [
1776 'default' => 'custom',
1777 ],
1778 'font_weight' => [
1779 'default' => '500',
1780 ],
1781 'font_size' => [
1782 'label' => esc_html__('Font Size (px)', 'shopengine'),
1783 'default' => [
1784 'size' => '15',
1785 'unit' => 'px',
1786 ],
1787 'size_units' => ['px'],
1788 ],
1789 'line_height' => [
1790 'label' => esc_html__('Line Height (px)', 'shopengine'),
1791 'default' => [
1792 'size' => '19',
1793 'unit' => 'px',
1794 ],
1795 'size_units' => ['px'],
1796 'tablet_default' => [
1797 'unit' => 'px',
1798 ],
1799 'mobile_default' => [
1800 'unit' => 'px',
1801 ],
1802 ],
1803 ],
1804 ]
1805 );
1806
1807 $this->add_responsive_control(
1808 'shopengine_product_tab_submit_button_alignment',
1809 [
1810 'label' => esc_html__('Alignment', 'shopengine'),
1811 'type' => Controls_Manager::CHOOSE,
1812 'options' => [
1813 'left' => [
1814 'title' => esc_html__('Left', 'shopengine'),
1815 'icon' => 'eicon-text-align-left',
1816 ],
1817 'center' => [
1818 'title' => esc_html__('Center', 'shopengine'),
1819 'icon' => 'eicon-text-align-center',
1820 ],
1821 'right' => [
1822 'title' => esc_html__('Right', 'shopengine'),
1823 'icon' => 'eicon-text-align-right',
1824 ],
1825 ],
1826 'default' => 'left',
1827 'prefix_class' => 'tabs-submit-btn-align-',
1828 'selectors' => [
1829 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit' => 'text-align: {{VALUE}} !important;',
1830 '.rtl {{WRAPPER}}.tabs-submit-btn-align-left div.shopengine-product-tabs #review_form #respond .comment-form .form-submit'=> 'text-align: right !important;',
1831 '.rtl {{WRAPPER}}.tabs-submit-btn-align-right div.shopengine-product-tabs #review_form #respond .comment-form .form-submit'=> 'text-align: left !important;',
1832 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit' => 'float: none;',
1833 ],
1834 ]
1835 );
1836
1837 $this->start_controls_tabs(
1838 'shopengine_product_tab_submit_button_tabs',
1839 [
1840 'separator' => 'before'
1841 ]
1842 );
1843
1844 $this->start_controls_tab(
1845 'shopengine_product_tab_submit_button_tab_normal',
1846 [
1847 'label' => esc_html__('Normal', 'shopengine'),
1848 ]
1849 );
1850
1851 $this->add_control(
1852 'shopengine_product_tab_submit_button_color',
1853 [
1854 'label' => esc_html__('Color', 'shopengine'),
1855 'type' => Controls_Manager::COLOR,
1856 'default' => '#fff',
1857 'alpha' => false,
1858 'selectors' => [
1859 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit' => 'color: {{VALUE}} !important;',
1860 ],
1861 ]
1862 );
1863
1864 $this->add_control(
1865 'shopengine_product_tab_submit_button_bg',
1866 [
1867 'label' => esc_html__('Background', 'shopengine'),
1868 'type' => Controls_Manager::COLOR,
1869 'default' => '#3A3A3A',
1870 'alpha' => false,
1871 'selectors' => [
1872 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit' => 'background-color: {{VALUE}} !important;',
1873 ],
1874 ]
1875 );
1876
1877 $this->end_controls_tab();
1878
1879 $this->start_controls_tab(
1880 'shopengine_product_tab_submit_button_tab_hover',
1881 [
1882 'label' => esc_html__('Hover', 'shopengine'),
1883 ]
1884 );
1885
1886 $this->add_control(
1887 'shopengine_product_tab_submit_button_hover_color',
1888 [
1889 'label' => esc_html__('Color', 'shopengine'),
1890 'type' => Controls_Manager::COLOR,
1891 'alpha' => false,
1892 'default' => '#fff',
1893 'selectors' => [
1894 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit:hover' => 'color: {{VALUE}} !important;',
1895 ],
1896 ]
1897 );
1898
1899 $this->add_control(
1900 'shopengine_product_tab_submit_button_hover_bg',
1901 [
1902 'label' => esc_html__('Background', 'shopengine'),
1903 'type' => Controls_Manager::COLOR,
1904 'default' => '#101010',
1905 'alpha' => false,
1906 'selectors' => [
1907 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit:hover' => 'background-color: {{VALUE}} !important;',
1908 ],
1909 ]
1910 );
1911
1912 $this->add_control(
1913 'shopengine_product_tab_submit_button_hover_border_color',
1914 [
1915 'label' => esc_html__('Border Color', 'shopengine'),
1916 'type' => Controls_Manager::COLOR,
1917 'default' => '#101010',
1918 'alpha' => false,
1919 'selectors' => [
1920 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit:hover' => 'border-color: {{VALUE}};',
1921 ],
1922 ]
1923 );
1924
1925 $this->end_controls_tab();
1926 $this->end_controls_tabs();
1927
1928 $this->add_group_control(
1929 Group_Control_Border::get_type(),
1930 [
1931 'name' => 'shopengine_product_tab_submit_button_border',
1932 'label' => esc_html__('Border (px)', 'shopengine'),
1933 'size_units' => ['px'],
1934 'fields_options' => [
1935 'border' => [
1936 'default' => 'solid',
1937 ],
1938 'width' => [
1939 'label' => esc_html__('Width (px)', 'shopengine'),
1940 'default' => [
1941 'top' => '1',
1942 'right' => '1',
1943 'bottom' => '1',
1944 'left' => '1',
1945 'isLinked' => true,
1946 ],
1947 'responsive' => false,
1948 'selectors' => [
1949 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1950 '.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}};',
1951 ]
1952 ],
1953 'color' => [
1954 'default' => '#3A3A3A',
1955 'alpha' => false,
1956 ]
1957 ],
1958 'selector' => '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit',
1959 'separator' => 'before'
1960 ]
1961 );
1962
1963 $this->add_control(
1964 'shopengine_product_tab_submit_button_border_radius',
1965 [
1966 'label' => esc_html__('Border Radius (px)', 'shopengine'),
1967 'type' => Controls_Manager::DIMENSIONS,
1968 'size_units' => ['px'],
1969 'default' => [
1970 'top' => '3',
1971 'right' => '3',
1972 'bottom' => '3',
1973 'left' => '3',
1974 'unit' => 'px',
1975 'isLinked' => true,
1976 ],
1977 'selectors' => [
1978 '{{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;',
1979 '.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;',
1980 ],
1981 'separator' => 'before'
1982 ]
1983 );
1984
1985 $this->add_responsive_control(
1986 'shopengine_product_tab_submit_button_padding',
1987 [
1988 'label' => esc_html__('Padding (px)', 'shopengine'),
1989 'type' => Controls_Manager::DIMENSIONS,
1990 'size_units' => ['px'],
1991 'default' => [
1992 'top' => '10',
1993 'right' => '25',
1994 'bottom' => '10',
1995 'left' => '25',
1996 'unit' => 'px',
1997 'isLinked' => false,
1998 ],
1999 'selectors' => [
2000 '{{WRAPPER}} div.shopengine-product-tabs #review_form #respond .comment-form .form-submit input#submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
2001 '.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;',
2002 ],
2003 'separator' => 'before'
2004 ]
2005 );
2006
2007 $this->end_controls_section(); // end ./ submit button
2008
2009 $this->start_controls_section(
2010 'shopengine_product_tabs_global_font',
2011 [
2012 'label' => esc_html__('Global Font', 'shopengine'),
2013 'tab' => Controls_Manager::TAB_STYLE,
2014 ]
2015 );
2016
2017 $this->add_control(
2018 'shopengine_product_tabs_font_family',
2019 [
2020 'label' => esc_html__('Font Family', 'shopengine'),
2021 'description' => esc_html__('This font family is set for this specific widget.', 'shopengine'),
2022 'type' => Controls_Manager::FONT,
2023 'default' => '',
2024 'selectors' => [
2025 '{{WRAPPER}} .shopengine-product-tabs' => 'font-family: {{VALUE}}',
2026 '{{WRAPPER}} .shopengine-product-tabs :is(a, h2, p, input, tr, th, td, .woocommerce-Tabs-panel, .comment-reply-title)' => 'font-family: {{VALUE}}',
2027 ],
2028 ]
2029 );
2030
2031 $this->end_controls_section();
2032 }
2033
2034
2035 protected function screen() {
2036
2037 $settings = $this->get_settings_for_display();
2038
2039 $post_type = get_post_type();
2040
2041 add_filter('woocommerce_reviews_title', [$this, 'change_html'], 99, 3);
2042
2043 $tpl = Products::instance()->get_widget_template($this->get_name());
2044
2045 include $tpl;
2046 }
2047
2048 public function change_html($reviews_title, $count, $product) {
2049
2050 $average = $product->get_average_rating();
2051
2052 $rating_5 = $product->get_rating_count(5);
2053 $rating_4 = $product->get_rating_count(4);
2054 $rating_3 = $product->get_rating_count(3);
2055 $rating_2 = $product->get_rating_count(2);
2056 $rating_1 = $product->get_rating_count(1);
2057 $total = $rating_1 + $rating_2 + $rating_3 + $rating_4 + $rating_5;
2058 $pct5 = $pct4 = $pct3 = $pct2 = $pct1 = 0;
2059
2060 if ($total > 0) {
2061 $pct5 = ceil($rating_5 * 100 / $total);
2062 $pct4 = ceil($rating_4 * 100 / $total);
2063 $pct3 = ceil($rating_3 * 100 / $total);
2064 $pct2 = ceil($rating_2 * 100 / $total);
2065 $pct1 = ceil($rating_1 * 100 / $total);
2066 }
2067
2068 $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/> ';
2069 $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/> ';
2070 $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/> ';
2071 $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/> ';
2072 $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/> ';
2073
2074
2075 $htm = '</h2>';
2076 $htm .= '<div class="se-rating-container">';
2077 $htm .= '<h2> ' . esc_html__('Average Rating', 'shopengine') . '</h2>';
2078 $htm .= '<div class="se-avg-rating">' . $average . '</div>';
2079
2080 $htm .= wc_get_rating_html($average, $count);
2081
2082 $htm .= '<strong class="se-avg-count">' . $count .' ' . esc_html__(' Review', 'shopengine') . '</strong>';
2083 $htm .= $details;
2084 $htm .= '</div><h2 class="woocommerce-Reviews-title">';
2085
2086 return $htm . $reviews_title;
2087 }
2088 }
2089