PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.6.4
ShopBuilder – WooCommerce Builder For Elementor v2.6.4
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Elementor / Widgets / Controls / StyleFields.php

StyleFields.php in ShopBuilder – WooCommerce Builder For Elementor 2.6.4, at app/Elementor/Widgets/Controls/StyleFields.php

2,545 lines 90.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Elementor Style Fields Class.
4 *
5 * This class contains all the common fields for Style tab.
6 *
7 * @package RadiusTheme\SB
8 */
9
10 namespace RadiusTheme\SB\Elementor\Widgets\Controls;
11
12 use RadiusTheme\SB\Helpers\Fns;
13 use RadiusTheme\SB\Elementor\Helper\ControlHelper;
14
15 // Do not allow directly accessing this file.
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit( 'This script cannot be accessed directly.' );
18 }
19
20 /**
21 * Elementor Style Fields Class.
22 */
23 class StyleFields {
24 /**
25 * Tab name.
26 *
27 * @access private
28 * @static
29 *
30 * @var string
31 */
32 private static $tab = 'style';
33
34 /**
35 * Color Scheme Section
36 *
37 * @param object $obj Reference object.
38 *
39 * @return array
40 */
41 public static function color_scheme( $obj ): array {
42 $css_selectors = $obj->selectors['color_scheme'];
43
44 $fields['color_scheme_section'] = $obj->start_section( esc_html__( 'Color Scheme', 'shopbuilder' ), self::$tab );
45
46 $fields['primary_color'] = [
47 'type' => 'color',
48 'label' => esc_html__( 'Primary Color', 'shopbuilder' ),
49 'default' => '#0066ff',
50 'selectors' => [
51 $css_selectors['primary_color'] => '--rtsb-color-primary: {{VALUE}}',
52 ],
53 ];
54
55 $fields['secondary_color'] = [
56 'type' => 'color',
57 'label' => esc_html__( 'Secondary Color', 'shopbuilder' ),
58 'default' => '#111',
59 'selectors' => [
60 $css_selectors['secondary_color'] => '--rtsb-color-secondary: {{VALUE}}',
61 ],
62 ];
63
64 $fields['loader_color'] = [
65 'type' => 'color',
66 'label' => esc_html__( 'Pre-Loader Color', 'shopbuilder' ),
67 'default' => '#111',
68 'selectors' => [
69 $css_selectors['secondary_color'] => '--rtsb-color-loader: {{VALUE}}',
70 ],
71 ];
72
73 $fields['color_scheme_section_end'] = $obj->end_section();
74
75 return apply_filters( 'rtsb/elements/elementor/color_style_control', $fields, $obj );
76 }
77
78 /**
79 * Layout Design Section
80 *
81 * @param object $obj Reference object.
82 *
83 * @return array
84 */
85 public static function layout_design( $obj ): array {
86 $css_selectors = $obj->selectors['advanced'];
87
88 $fields['layout_design_section'] = $obj->start_section( esc_html__( 'Layout Design', 'shopbuilder' ), self::$tab );
89
90 $fields['layout_design_note'] = $obj->el_heading( esc_html__( 'Layout', 'shopbuilder' ) );
91
92 $fields['grid_gap'] = [
93 'type' => 'slider',
94 'mode' => 'responsive',
95 'label' => esc_html__( 'Grid Gap / Spacing (px)', 'shopbuilder' ),
96 'size_units' => [ 'px' ],
97 'range' => [
98 'px' => [
99 'min' => 0,
100 'max' => 100,
101 'step' => 1,
102 ],
103 ],
104 'default' => [
105 'unit' => 'px',
106 'size' => 30,
107 ],
108 'description' => esc_html__( 'Please select the grid gap in px.', 'shopbuilder' ),
109 'selectors' => [
110 $obj->selectors['columns']['grid_gap']['padding'] => 'padding-left: calc({{SIZE}}{{UNIT}} / 2); padding-right: calc({{SIZE}}{{UNIT}} / 2);',
111 $obj->selectors['columns']['grid_gap']['margin'] => 'margin-left: calc(-{{SIZE}}{{UNIT}} / 2); margin-right: calc(-{{SIZE}}{{UNIT}} / 2);',
112 $obj->selectors['columns']['grid_gap']['slider_layout3'] => '--rtsb-slider-layout3-spacing: {{SIZE}}{{UNIT}};',
113 $obj->selectors['columns']['grid_gap']['slider_layout9'] => '--rtsb-slider-layout9-spacing: {{SIZE}}{{UNIT}};',
114 $css_selectors['element_margin'] => 'margin-bottom: {{SIZE}}{{UNIT}};',
115 ],
116 ];
117
118 $fields['grid_alignment'] = [
119 'mode' => 'responsive',
120 'type' => 'choose',
121 'label' => esc_html__( 'Alignment', 'shopbuilder' ),
122 'options' => [
123 'left' => [
124 'title' => esc_html__( 'Left', 'shopbuilder' ),
125 'icon' => 'eicon-text-align-left',
126 ],
127 'center' => [
128 'title' => esc_html__( 'Center', 'shopbuilder' ),
129 'icon' => 'eicon-text-align-center',
130 ],
131 'right' => [
132 'title' => esc_html__( 'Right', 'shopbuilder' ),
133 'icon' => 'eicon-text-align-right',
134 ],
135 ],
136 'selectors' => [
137 $obj->selectors['columns']['grid_alignment']['text_align'] => 'text-align: {{VALUE}};',
138 $obj->selectors['columns']['grid_alignment']['justify_content'] => 'justify-content: {{VALUE}};',
139 ],
140 ];
141
142 $fields['wrapper_color_note'] = $obj->el_heading( esc_html__( 'Colors & Shadow', 'shopbuilder' ), 'before' );
143
144 $fields['advanced_color_tabs'] = $obj->start_tab_group();
145 $fields['advanced_color_tab'] = $obj->start_tab( esc_html__( 'Normal', 'shopbuilder' ) );
146
147 $fields['content_bg_color'] = [
148 'type' => 'color',
149 'label' => esc_html__( 'Content Background', 'shopbuilder' ),
150 'selectors' => [ $css_selectors['content_bg_color'] => 'background-color: {{VALUE}};' ],
151 ];
152
153 $fields['element_bg_color'] = [
154 'type' => 'color',
155 'label' => esc_html__( 'Element Background', 'shopbuilder' ),
156 'selectors' => [ $css_selectors['element_bg_color'] => 'background-color: {{VALUE}};' ],
157 ];
158
159 $fields['rtsb_el_element_shadow'] = [
160 'type' => 'box-shadow',
161 'mode' => 'group',
162 'label' => esc_html__( 'Element Drop Shadow', 'shopbuilder' ),
163 'selector' => $css_selectors['rtsb_el_element_shadow'],
164 ];
165
166 $fields['advanced_color_tab_end'] = $obj->end_tab();
167 $fields['advanced_hover_color_tab'] = $obj->start_tab( esc_html__( 'Hover', 'shopbuilder' ) );
168
169 $fields['content_hover_bg_color'] = [
170 'type' => 'color',
171 'label' => esc_html__( 'Content Hover Background', 'shopbuilder' ),
172 'selectors' => [ $css_selectors['content_hover_bg_color'] => 'background-color: {{VALUE}};' ],
173 ];
174
175 $fields['element_hover_bg_color'] = [
176 'type' => 'color',
177 'label' => esc_html__( 'Element Hover Background', 'shopbuilder' ),
178 'selectors' => [ $css_selectors['element_hover_bg_color'] => 'background-color: {{VALUE}};' ],
179 ];
180
181 $fields['rtsb_el_element_hover_shadow'] = [
182 'type' => 'box-shadow',
183 'mode' => 'group',
184 'label' => esc_html__( 'Element Hover Drop Shadow', 'shopbuilder' ),
185 'selector' => $css_selectors['rtsb_el_element_hover_shadow'],
186 ];
187
188 $fields['advanced_hover_color_tab_end'] = $obj->end_tab();
189 $fields['advanced_color_tabs_end'] = $obj->end_tab_group();
190
191 $fields['wrapper_note'] = $obj->el_heading( esc_html__( 'Border', 'shopbuilder' ), 'before' );
192
193 $fields['rtsb_el_wrapper_border'] = [
194 'mode' => 'group',
195 'type' => 'border',
196 'label' => esc_html__( 'Wrapper Border', 'shopbuilder' ),
197 'fields_options' => [
198 'border' => [
199 'label' => esc_html__( 'Wrapper Border Type', 'shopbuilder' ),
200 'label_block' => true,
201 ],
202 'color' => [
203 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
204 ],
205 ],
206 'selector' => $css_selectors['rtsb_el_wrapper_border'],
207 ];
208
209 $fields['wrapper_border_radius'] = [
210 'mode' => 'responsive',
211 'type' => 'dimensions',
212 'label' => esc_html__( 'Wrapper Border Radius', 'shopbuilder' ),
213 'size_units' => [ 'px', '%', 'em' ],
214 'selectors' => [ $css_selectors['wrapper_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;' ],
215 ];
216
217 $fields['rtsb_el_element_border'] = [
218 'mode' => 'group',
219 'type' => 'border',
220 'label' => esc_html__( 'Element Border', 'shopbuilder' ),
221 'fields_options' => [
222 'border' => [
223 'label' => esc_html__( 'Element Border Type', 'shopbuilder' ),
224 'label_block' => true,
225 ],
226 'color' => [
227 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
228 ],
229 ],
230 'separator' => 'before',
231 'selector' => $css_selectors['rtsb_el_element_border'],
232 ];
233
234 $fields['element_border_hover_color'] = [
235 'type' => 'color',
236 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
237 'condition' => [ 'rtsb_el_element_border_border!' => [ '' ] ],
238 'selectors' => [ $css_selectors['element_border_hover_color'] => 'border-color: {{VALUE}};' ],
239 ];
240
241 $fields['element_border_radius'] = [
242 'mode' => 'responsive',
243 'type' => 'dimensions',
244 'label' => esc_html__( 'Element Border Radius', 'shopbuilder' ),
245 'size_units' => [ 'px', '%', 'em' ],
246 'selectors' => [ $css_selectors['element_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;' ],
247 ];
248
249 $fields['rtsb_el_content_border'] = [
250 'mode' => 'group',
251 'type' => 'border',
252 'label' => esc_html__( 'Content Border', 'shopbuilder' ),
253 'fields_options' => [
254 'border' => [
255 'label' => esc_html__( 'Content Border Type', 'shopbuilder' ),
256 'label_block' => true,
257 ],
258 'color' => [
259 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
260 ],
261 ],
262 'separator' => 'before',
263 'selector' => $css_selectors['rtsb_el_content_border'],
264 ];
265
266 $fields['content_border_hover_color'] = [
267 'type' => 'color',
268 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
269 'condition' => [ 'rtsb_el_content_border_border!' => [ '' ] ],
270 'selectors' => [ $css_selectors['content_border_hover_color'] => 'border-color: {{VALUE}};' ],
271 ];
272
273 $fields['content_border_radius'] = [
274 'mode' => 'responsive',
275 'type' => 'dimensions',
276 'label' => esc_html__( 'Content Border Radius', 'shopbuilder' ),
277 'size_units' => [ 'px', '%', 'em' ],
278 'selectors' => [ $css_selectors['content_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
279 ];
280
281 $fields['advanced_spacing_note'] = $obj->el_heading( esc_html__( 'Spacing', 'shopbuilder' ), 'before' );
282
283 $fields['wrapper_padding'] = [
284 'mode' => 'responsive',
285 'type' => 'dimensions',
286 'label' => esc_html__( 'Wrapper Padding', 'shopbuilder' ),
287 'size_units' => [ 'px', '%', 'em' ],
288 'selectors' => [ $css_selectors['wrapper_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
289 ];
290
291 $fields['element_padding'] = [
292 'mode' => 'responsive',
293 'type' => 'dimensions',
294 'label' => esc_html__( 'Element Padding', 'shopbuilder' ),
295 'size_units' => [ 'px', '%', 'em' ],
296 'selectors' => [ $css_selectors['element_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
297 ];
298
299 $fields['content_padding'] = [
300 'mode' => 'responsive',
301 'type' => 'dimensions',
302 'label' => esc_html__( 'Content Padding', 'shopbuilder' ),
303 'size_units' => [ 'px', '%', 'em' ],
304 'selectors' => [ $css_selectors['content_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
305 ];
306
307 $fields['layout_design_section_end'] = $obj->end_section();
308
309 return apply_filters( 'rtsb/elements/elementor/color_style_control', $fields, $obj );
310 }
311
312 /**
313 * Product Title Section
314 *
315 * @param object $obj Reference object.
316 *
317 * @return array
318 */
319 public static function product_title( $obj ): array {
320 $css_selectors = $obj->selectors['product_title'];
321 $title = esc_html__( 'Product Title', 'shopbuilder' );
322 $condition = [
323 'show_title' => [ 'yes' ],
324 ];
325 $selectors = self::title_selectors( $css_selectors );
326
327 $fields = ControlHelper::general_elementor_style( 'product_title', $title, $obj, $condition, $selectors );
328
329 return apply_filters( 'rtsb/elements/elementor/title_style_control', $fields, $obj );
330 }
331
332 /**
333 * Section Title Section
334 *
335 * @param object $obj Reference object.
336 *
337 * @return array
338 */
339 public static function section_title( $obj ): array {
340 $css_selectors = $obj->selectors['section_title'];
341 $title = esc_html__( 'Section Title', 'shopbuilder' );
342 $condition = [
343 'show_section_title' => [ 'yes' ],
344 ];
345 $selectors = self::title_selectors( $css_selectors );
346
347 $fields = ControlHelper::general_elementor_style( 'section_title', $title, $obj, $condition, $selectors );
348
349 return apply_filters( 'rtsb/elements/elementor/section_title_style_control', $fields, $obj );
350 }
351
352 /**
353 * Category Title Section
354 *
355 * @param object $obj Reference object.
356 *
357 * @return array
358 */
359 public static function cat_title( $obj ): array {
360 $css_selectors = $obj->selectors['cat_title'];
361 $title = esc_html__( 'Category Title', 'shopbuilder' );
362 $condition = [
363 'show_title' => [ 'yes' ],
364 ];
365 $selectors = self::title_selectors( $css_selectors );
366
367 $fields = ControlHelper::general_elementor_style( 'category_title', $title, $obj, $condition, $selectors );
368
369 return apply_filters( 'rtsb/elements/elementor/cat_title_style_control', $fields, $obj );
370 }
371
372 /**
373 * Short Description Section
374 *
375 * @param object $obj Reference object.
376 *
377 * @return array
378 */
379 public static function short_description( $obj ): array {
380 $css_selectors = $obj->selectors['short_description'];
381 $title = esc_html__( 'Short Description', 'shopbuilder' );
382 $condition = [
383 'show_short_desc' => [ 'yes' ],
384 ];
385 $selectors = self::excerpt_selectors( $css_selectors );
386
387 $fields = ControlHelper::general_elementor_style( 'short_description', $title, $obj, $condition, $selectors );
388
389 unset(
390 $fields['short_description_color_tabs'],
391 $fields['short_description_color_tab'],
392 $fields['short_description_color_tab_end'],
393 $fields['short_description_hover_color_tab'],
394 $fields['short_description_hover_color'],
395 $fields['short_description_hover_bg_color'],
396 $fields['short_description_hover_color_tab_end'],
397 $fields['short_description_color_tabs_end'],
398 $fields['short_description_border_hover_color']
399 );
400
401 return apply_filters( 'rtsb/elements/elementor/excerpt_style_control', $fields, $obj );
402 }
403
404 /**
405 * Category Description Section
406 *
407 * @param object $obj Reference object.
408 *
409 * @return array
410 */
411 public static function cat_description( $obj ): array {
412 $css_selectors = $obj->selectors['cat_description'];
413 $title = esc_html__( 'Category Description', 'shopbuilder' );
414 $condition = [
415 'show_short_desc' => [ 'yes' ],
416 ];
417 $selectors = self::excerpt_selectors( $css_selectors );
418
419 $fields = ControlHelper::general_elementor_style( 'category_description', $title, $obj, $condition, $selectors );
420
421 unset(
422 $fields['category_description_color_tabs'],
423 $fields['category_description_color_tab'],
424 $fields['category_description_color_tab_end'],
425 $fields['category_description_hover_color_tab'],
426 $fields['category_description_hover_color'],
427 $fields['category_description_hover_bg_color'],
428 $fields['category_description_hover_color_tab_end'],
429 $fields['category_description_color_tabs_end'],
430 $fields['category_description_border_hover_color']
431 );
432
433 return apply_filters( 'rtsb/elements/elementor/cat_excerpt_style_control', $fields, $obj );
434 }
435
436 /**
437 * Count Section
438 *
439 * @param object $obj Reference object.
440 *
441 * @return array
442 */
443 public static function count( $obj ): array {
444 $css_selectors = $obj->selectors['count'];
445 $title = esc_html__( 'Product Count', 'shopbuilder' );
446 $condition = [
447 'show_count' => [ 'yes' ],
448 ];
449 $selectors = [
450 'typography' => $css_selectors['typography'],
451 'alignment' => [ $css_selectors['alignment'] => 'text-align: {{VALUE}};' ],
452 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
453 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
454 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
455 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
456 'border' => $css_selectors['border'],
457 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
458 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
459 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
460 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
461 ];
462
463 $fields = ControlHelper::general_elementor_style( 'product_count', $title, $obj, $condition, $selectors );
464
465 $extra_controls = [];
466
467 $extra_controls['product_count_radius'] = [
468 'mode' => 'responsive',
469 'type' => 'dimensions',
470 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
471 'size_units' => [ 'px', '%', 'em' ],
472 'selectors' => $selectors['border_radius'],
473 ];
474
475 $fields = Fns::insert_controls( 'product_count_border_hover_color', $fields, $extra_controls, true );
476
477 return apply_filters( 'rtsb/elements/elementor/cat_count_style_control', $fields, $obj );
478 }
479
480 /**
481 * Product Price Section
482 *
483 * @param object $obj Reference object.
484 *
485 * @return array
486 */
487 public static function product_price( $obj ): array {
488 $css_selectors = $obj->selectors['product_price'];
489 $title = esc_html__( 'Product Price', 'shopbuilder' );
490 $condition = [
491 'show_price' => [ 'yes' ],
492 ];
493 $selectors = [
494 'typography' => $css_selectors['typography'],
495 'sale_typography' => $css_selectors['sale_typography'],
496 'alignment' => [ $css_selectors['alignment'] => 'text-align: {{VALUE}};' ],
497 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
498 'regular_color' => [ $css_selectors['regular_color'] => 'color: {{VALUE}};' ],
499 'crossed_regular_color' => [ $css_selectors['crossed_regular_color'] => 'color: {{VALUE}};' ],
500 'border' => $css_selectors['border'],
501 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
502 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
503 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
504 ];
505
506 $fields = ControlHelper::general_elementor_style( 'product_price', $title, $obj, $condition, $selectors );
507
508 unset(
509 $fields['product_price_color_tabs'],
510 $fields['product_price_color_tab'],
511 $fields['product_price_color_tab_end'],
512 $fields['product_price_hover_color_tab'],
513 $fields['product_price_hover_color'],
514 $fields['product_price_hover_bg_color'],
515 $fields['product_price_hover_color_tab_end'],
516 $fields['product_price_color_tabs_end'],
517 $fields['product_price_border_hover_color']
518 );
519
520 $fields['rtsb_el_product_price_typography']['label'] = esc_html__( 'Regular Price Typography', 'shopbuilder' );
521 $fields['product_price_color']['label'] = esc_html__( 'Sale Price Color', 'shopbuilder' );
522 $fields['product_price_bg_color']['label'] = esc_html__( 'Regular Price Color', 'shopbuilder' );
523 $fields['product_price_bg_color']['selectors'] = $selectors['regular_color'];
524
525 $extra_controls['rtsb_el_product_sale_price_typography'] = [
526 'mode' => 'group',
527 'type' => 'typography',
528 'label' => esc_html__( 'Sale Price Typography', 'shopbuilder' ),
529 'selector' => $selectors['sale_typography'],
530 ];
531
532 $fields = Fns::insert_controls( 'rtsb_el_product_price_typography', $fields, $extra_controls );
533
534 $extra_controls['crossed_regular_color'] = [
535 'type' => 'color',
536 'label' => esc_html__( 'Crossed Out Regular Price Color', 'shopbuilder' ),
537 'selectors' => ! empty( $selectors['crossed_regular_color'] ) ? $selectors['crossed_regular_color'] : [],
538 ];
539
540 $fields = Fns::insert_controls( 'product_price_border_note', $fields, $extra_controls );
541
542 return apply_filters( 'rtsb/elements/elementor/price_style_control', $fields, $obj );
543 }
544
545 /**
546 * Product Rating Section
547 *
548 * @param object $obj Reference object.
549 *
550 * @return array
551 */
552 public static function product_rating( $obj ): array {
553 $css_selectors = $obj->selectors['product_rating'];
554 $title = esc_html__( 'Product Rating', 'shopbuilder' );
555 $condition = [
556 'show_rating' => [ 'yes' ],
557 ];
558 $selectors = [
559 'typography' => [ $css_selectors['typography'] => 'font-size: {{SIZE}}{{UNIT}};' ],
560 'alignment' => [ $css_selectors['alignment'] => 'justify-content: {{VALUE}};' ],
561 'color' => [ $css_selectors['color'] => 'color: {{VALUE}} !important;' ],
562 'bg_color' => [ $css_selectors['bg_color'] => 'color: {{VALUE}} !important;' ],
563 'padding' => [ $css_selectors['padding'] => 'letter-spacing: {{SIZE}}{{UNIT}};' ],
564 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
565 ];
566
567 $fields = ControlHelper::general_elementor_style( 'product_rating', $title, $obj, $condition, $selectors );
568
569 unset(
570 $fields['product_rating_color_tabs'],
571 $fields['product_rating_color_tab'],
572 $fields['product_rating_color_tab_end'],
573 $fields['product_rating_hover_color_tab'],
574 $fields['product_rating_hover_color'],
575 $fields['product_rating_hover_bg_color'],
576 $fields['product_rating_hover_color_tab_end'],
577 $fields['product_rating_color_tabs_end'],
578 $fields['product_rating_border_note'],
579 $fields['rtsb_el_product_rating_border'],
580 $fields['product_rating_border_hover_color']
581 );
582
583 $fields['rtsb_el_product_rating_typography'] = [
584 'type' => 'slider',
585 'mode' => 'responsive',
586 'label' => esc_html__( 'Star Size', 'shopbuilder' ),
587 'size_units' => [ 'px' ],
588 'range' => [
589 'px' => [
590 'min' => 0,
591 'max' => 100,
592 ],
593 ],
594 // 'default' => [
595 // 'unit' => 'px',
596 // 'size' => 14,
597 // ],
598 'selectors' => $selectors['typography'],
599 ];
600
601 $fields['product_rating_bg_color']['label'] = esc_html__( 'Star Border Color', 'shopbuilder' );
602
603 $fields['product_rating_padding'] = [
604 'type' => 'slider',
605 'mode' => 'responsive',
606 'label' => esc_html__( 'Spacing', 'shopbuilder' ),
607 'size_units' => [ 'px' ],
608 'range' => [
609 'px' => [
610 'min' => -10,
611 'max' => 50,
612 ],
613 ],
614 'default' => [
615 'unit' => 'px',
616 'size' => 3,
617 ],
618 'selectors' => $selectors['padding'],
619 ];
620
621 return apply_filters( 'rtsb/elements/elementor/rating_style_control', $fields, $obj );
622 }
623
624 /**
625 * Product Badges Section
626 *
627 * @param object $obj Reference object.
628 *
629 * @return array
630 */
631 public static function product_badges( $obj ): array {
632 $css_selectors = $obj->selectors['product_badges'];
633 $title = esc_html__( 'Badges', 'shopbuilder' );
634 $condition = [
635 'show_badges' => [ 'yes' ],
636 'layout!' => [ 'category-layout1', 'category-layout2' ],
637 ];
638 $selectors = [
639 'typography' => $css_selectors['typography'],
640 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
641 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
642 'border_color' => [ $css_selectors['border_color'] => 'border-color: {{VALUE}};' ],
643 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
644 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
645 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
646 'position_x' => [ $css_selectors['position_x'] => 'left: {{SIZE}}{{UNIT}};' ],
647 'position_x_right' => [ $css_selectors['position_x'] => 'right: {{SIZE}}{{UNIT}}; left: auto;' ],
648 'position_y' => [ $css_selectors['position_y'] => 'top: {{SIZE}}{{UNIT}};' ],
649 'position_y_bottom' => [ $css_selectors['position_y'] => 'bottom: {{SIZE}}{{UNIT}}; top:auto;' ],
650 ];
651
652 $fields = ControlHelper::general_elementor_style( 'badges', $title, $obj, $condition, $selectors );
653
654 unset(
655 $fields['badges_alignment'],
656 $fields['badges_color_tabs'],
657 $fields['badges_color_tab'],
658 $fields['badges_color_tab_end'],
659 $fields['badges_hover_color_tab'],
660 $fields['badges_hover_color'],
661 $fields['badges_hover_bg_color'],
662 $fields['badges_hover_color_tab_end'],
663 $fields['badges_color_tabs_end'],
664 $fields['badges_border_note'],
665 $fields['rtsb_el_badges_border'],
666 $fields['badges_border_hover_color']
667 );
668
669 $fields['badges_alignment']['label'] = esc_html__( 'Horizontal Alignment', 'shopbuilder' );
670
671 $extra_controls = [];
672
673 $extra_controls['badges_alignment'] = [
674 'type' => 'select2',
675 'label' => esc_html__( 'Horizontal Alignment', 'shopbuilder' ),
676 'options' => [
677 'left' => esc_html__( 'Left', 'shopbuilder' ),
678 'center' => esc_html__( 'Center', 'shopbuilder' ),
679 'right' => esc_html__( 'Right', 'shopbuilder' ),
680 ],
681 'label_block' => true,
682 'default' => 'left',
683 ];
684
685 $extra_controls['badges_position'] = [
686 'type' => 'select2',
687 'label' => esc_html__( 'Vertical Alignment', 'shopbuilder' ),
688 'options' => [
689 'top' => esc_html__( 'Top', 'shopbuilder' ),
690 'middle' => esc_html__( 'Middle', 'shopbuilder' ),
691 'bottom' => esc_html__( 'Bottom', 'shopbuilder' ),
692 ],
693 'label_block' => true,
694 'default' => 'top',
695 ];
696
697 $extra_controls['badge_x_position'] = [
698 'type' => 'slider',
699 'mode' => 'responsive',
700 'label' => esc_html__( 'Position Offset (Horizontal)', 'shopbuilder' ),
701 'size_units' => [ 'px', '%' ],
702 'range' => [
703 'px' => [
704 'min' => 0,
705 'max' => 300,
706 'step' => 1,
707 ],
708 '%' => [
709 'min' => 0,
710 'max' => 100,
711 'step' => 1,
712 ],
713 ],
714 'condition' => [
715 'badges_alignment' => 'left',
716 'badges_alignment!' => 'center',
717 ],
718 'selectors' => $selectors['position_x'],
719 ];
720
721 $extra_controls['badge_x_position_right'] = [
722 'type' => 'slider',
723 'mode' => 'responsive',
724 'label' => esc_html__( 'Position Offset (Horizontal)', 'shopbuilder' ),
725 'size_units' => [ 'px', '%' ],
726 'range' => [
727 'px' => [
728 'min' => 0,
729 'max' => 300,
730 'step' => 1,
731 ],
732 '%' => [
733 'min' => 0,
734 'max' => 100,
735 'step' => 1,
736 ],
737 ],
738 'condition' => [ 'badges_alignment' => 'right' ],
739 'selectors' => $selectors['position_x_right'],
740 ];
741
742 $extra_controls['badge_y_position'] = [
743 'type' => 'slider',
744 'mode' => 'responsive',
745 'label' => esc_html__( 'Position Offset (Vertical)', 'shopbuilder' ),
746 'size_units' => [ 'px', '%' ],
747 'range' => [
748 'px' => [
749 'min' => 0,
750 'max' => 300,
751 'step' => 1,
752 ],
753 '%' => [
754 'min' => 0,
755 'max' => 100,
756 'step' => 1,
757 ],
758 ],
759 'condition' => [
760 'badges_position' => 'top',
761 'badges_position!' => 'center',
762 ],
763 'selectors' => $selectors['position_y'],
764 ];
765
766 $extra_controls['badge_y_position_bottom'] = [
767 'type' => 'slider',
768 'mode' => 'responsive',
769 'label' => esc_html__( 'Position Offset (Vertical)', 'shopbuilder' ),
770 'size_units' => [ 'px', '%' ],
771 'range' => [
772 'px' => [
773 'min' => 0,
774 'max' => 300,
775 'step' => 1,
776 ],
777 '%' => [
778 'min' => 0,
779 'max' => 100,
780 'step' => 1,
781 ],
782 ],
783 'condition' => [
784 'badges_position' => 'bottom',
785 'badges_position!' => 'center',
786 ],
787 'selectors' => $selectors['position_y_bottom'],
788 ];
789
790 $fields = Fns::insert_controls( 'badges_color_note', $fields, $extra_controls );
791
792 $extra_controls['badges_border_color'] = [
793 'type' => 'color',
794 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
795 'selectors' => ! empty( $selectors['border_color'] ) ? $selectors['border_color'] : [],
796 ];
797
798 $extra_controls['badges_border_radius'] = [
799 'mode' => 'responsive',
800 'type' => 'dimensions',
801 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
802 'size_units' => [ 'px', '%', 'em' ],
803 'selectors' => $selectors['border_radius'],
804 ];
805
806 $fields = Fns::insert_controls( 'badges_bg_color', $fields, $extra_controls, true );
807
808 return apply_filters( 'rtsb/elements/elementor/badges_style_control', $fields, $obj );
809 }
810
811 /**
812 * Product Categories Section
813 *
814 * @param object $obj Reference object.
815 *
816 * @return array
817 */
818 public static function product_categories( $obj ): array {
819 $css_selectors = $obj->selectors['product_categories'];
820 $title = esc_html__( 'Product Categories', 'shopbuilder' );
821 $condition = [
822 'show_categories' => [ 'yes' ],
823 ];
824 $selectors = [
825 'typography' => $css_selectors['typography'],
826 'alignment' => [ $css_selectors['alignment'] => 'justify-content: {{VALUE}};' ],
827 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
828 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
829 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
830 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
831 'border' => $css_selectors['typography'],
832 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
833 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
834 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
835 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
836 'wrapper_margin' => [ $css_selectors['wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
837 ];
838
839 $fields = ControlHelper::general_elementor_style( 'product_categories', $title, $obj, $condition, $selectors );
840
841 $fields['product_categories_alignment']['options'] = [
842 'flex-start' => [
843 'title' => esc_html__( 'Left', 'shopbuilder' ),
844 'icon' => 'eicon-text-align-left',
845 ],
846 'center' => [
847 'title' => esc_html__( 'Center', 'shopbuilder' ),
848 'icon' => 'eicon-text-align-center',
849 ],
850 'flex-end' => [
851 'title' => esc_html__( 'Right', 'shopbuilder' ),
852 'icon' => 'eicon-text-align-right',
853 ],
854 ];
855
856 $extra_controls = [];
857
858 $extra_controls['product_categories_radius'] = [
859 'mode' => 'responsive',
860 'type' => 'dimensions',
861 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
862 'size_units' => [ 'px', '%', 'em' ],
863 'selectors' => $selectors['border_radius'],
864 ];
865
866 $fields = Fns::insert_controls( 'product_categories_border_hover_color', $fields, $extra_controls, true );
867
868 $extra_controls['product_categories_wrapper_margin'] = [
869 'mode' => 'responsive',
870 'type' => 'dimensions',
871 'label' => esc_html__( 'Wrapper Margin', 'shopbuilder' ),
872 'size_units' => [ 'px', '%', 'em' ],
873 'selectors' => $selectors['wrapper_margin'],
874 ];
875
876 $fields = Fns::insert_controls( 'product_categories_margin', $fields, $extra_controls, true );
877
878 return apply_filters( 'rtsb/elements/elementor/categories_style_control', $fields, $obj );
879 }
880
881 /**
882 * Product Categories Section
883 *
884 * @param object $obj Reference object.
885 *
886 * @return array
887 */
888 public static function product_brands( $obj ): array {
889 $css_selectors = $obj->selectors['product_brands'];
890 $title = esc_html__( 'Product Brands', 'shopbuilder' );
891 $condition = [
892 'show_brands' => [ 'yes' ],
893 ];
894 $selectors = [
895 'typography' => $css_selectors['typography'],
896 'alignment' => [ $css_selectors['alignment'] => 'justify-content: {{VALUE}};' ],
897 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
898 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
899 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
900 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
901 'border' => $css_selectors['typography'],
902 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
903 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
904 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
905 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
906 'wrapper_margin' => [ $css_selectors['wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
907 ];
908
909 $fields = ControlHelper::general_elementor_style( 'product_brands', $title, $obj, $condition, $selectors );
910
911 $fields['product_brands_alignment']['options'] = [
912 'flex-start' => [
913 'title' => esc_html__( 'Left', 'shopbuilder' ),
914 'icon' => 'eicon-text-align-left',
915 ],
916 'center' => [
917 'title' => esc_html__( 'Center', 'shopbuilder' ),
918 'icon' => 'eicon-text-align-center',
919 ],
920 'flex-end' => [
921 'title' => esc_html__( 'Right', 'shopbuilder' ),
922 'icon' => 'eicon-text-align-right',
923 ],
924 ];
925
926 $extra_controls = [];
927
928 $extra_controls['product_brands_radius'] = [
929 'mode' => 'responsive',
930 'type' => 'dimensions',
931 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
932 'size_units' => [ 'px', '%', 'em' ],
933 'selectors' => $selectors['border_radius'],
934 ];
935
936 $fields = Fns::insert_controls( 'product_brands_border_hover_color', $fields, $extra_controls, true );
937
938 $extra_controls['product_brands_wrapper_margin'] = [
939 'mode' => 'responsive',
940 'type' => 'dimensions',
941 'label' => esc_html__( 'Wrapper Margin', 'shopbuilder' ),
942 'size_units' => [ 'px', '%', 'em' ],
943 'selectors' => $selectors['wrapper_margin'],
944 ];
945
946 $fields = Fns::insert_controls( 'product_brands_margin', $fields, $extra_controls, true );
947
948 return apply_filters( 'rtsb/elements/elementor/brands_style_control', $fields, $obj );
949 }
950
951 /**
952 * Image Section
953 *
954 * @param object $obj Reference object.
955 * @param array $conditions Conditions.
956 *
957 * @return array
958 */
959 public static function image( $obj, $conditions ): array {
960 $css_selectors = $obj->selectors['image'];
961 $title = esc_html__( 'Image Styles', 'shopbuilder' );
962 $selectors = [
963 'overlay' => $css_selectors['overlay'],
964 'hover_overlay' => $css_selectors['hover_overlay'],
965 'border' => $css_selectors['border'],
966 'width' => [ $css_selectors['width'] => 'width: {{SIZE}}{{UNIT}};' ],
967 'img_bg_color' => [ $css_selectors['img_bg_color'] => 'background-color: {{VALUE}};' ],
968 'img_wrapper_bg_color' => [ $css_selectors['img_wrapper_bg_color'] => 'background-color: {{VALUE}};' ],
969 'max_width' => [ $css_selectors['max_width'] => 'max-width: {{SIZE}}{{UNIT}};' ],
970 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
971 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
972 ];
973
974 $fields = ControlHelper::general_elementor_style( 'image_styles', $title, $obj, [], $selectors, $conditions );
975
976 unset(
977 $fields['rtsb_el_image_styles_typography'],
978 $fields['image_styles_alignment'],
979 $fields['image_styles_color_tabs'],
980 $fields['image_styles_color_tab'],
981 $fields['image_styles_color_note'],
982 $fields['image_styles_color'],
983 $fields['image_styles_bg_color'],
984 $fields['image_styles_color_tab_end'],
985 $fields['image_styles_hover_color_tab'],
986 $fields['image_styles_hover_color'],
987 $fields['image_styles_hover_bg_color'],
988 $fields['image_styles_hover_color_tab_end'],
989 $fields['image_styles_color_tabs_end'],
990 $fields['image_styles_border_hover_color'],
991 $fields['image_styles_padding']
992 );
993
994 $fields['image_styles_typo_note']['raw'] = sprintf(
995 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
996 esc_html__( 'Overlay', 'shopbuilder' )
997 );
998 $fields['image_styles_border_note']['separator'] = 'before-short';
999 $fields['image_styles_typo_note']['separator'] = 'before';
1000 $fields['image_styles_typo_note']['condition'] = [ 'show_overlay' => [ 'yes' ] ];
1001
1002 $extra_controls = [];
1003
1004 $extra_controls['image_styles_dimension_note'] = $obj->el_heading( esc_html__( 'Dimension', 'shopbuilder' ) );
1005
1006 $extra_controls['image_styles_width'] = [
1007 'type' => 'slider',
1008 'label' => esc_html__( 'Image Width', 'shopbuilder' ),
1009 'size_units' => [ '%', 'px' ],
1010 'range' => [
1011 '%' => [
1012 'min' => 0,
1013 'max' => 100,
1014 'step' => 1,
1015 ],
1016 'px' => [
1017 'min' => 0,
1018 'max' => 500,
1019 'step' => 1,
1020 ],
1021 ],
1022 'selectors' => $selectors['width'],
1023 ];
1024
1025 $extra_controls['image_styles_max_width'] = [
1026 'type' => 'slider',
1027 'label' => esc_html__( 'Image Max-Width', 'shopbuilder' ),
1028 'size_units' => [ '%', 'px' ],
1029 'range' => [
1030 '%' => [
1031 'min' => 0,
1032 'max' => 100,
1033 'step' => 1,
1034 ],
1035 'px' => [
1036 'min' => 0,
1037 'max' => 500,
1038 'step' => 1,
1039 ],
1040
1041 ],
1042 'selectors' => $selectors['max_width'],
1043 ];
1044
1045 $extra_controls['image_styles_color_note'] = $obj->el_heading( esc_html__( 'Colors', 'shopbuilder' ), 'before' );
1046
1047 $extra_controls['image_styles_color'] = [
1048 'type' => 'color',
1049 'label' => esc_html__( 'Image Background Color', 'shopbuilder' ),
1050 'selectors' => $selectors['img_bg_color'],
1051 ];
1052
1053 $extra_controls['image_wrapper_styles_color'] = [
1054 'type' => 'color',
1055 'label' => esc_html__( 'Wrapper Background Color', 'shopbuilder' ),
1056 'selectors' => $selectors['img_wrapper_bg_color'],
1057 ];
1058
1059 $fields = Fns::insert_controls( 'image_styles_typo_note', $fields, $extra_controls );
1060
1061 $extra_controls['rtsb_el_image_styles_overlay'] = [
1062 'mode' => 'group',
1063 'type' => 'background',
1064 'label' => esc_html__( 'Image Overlay', 'shopbuilder' ),
1065 'types' => [ 'classic', 'gradient' ],
1066 'exclude' => [ 'image' ], // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
1067 'fields_options' => [
1068 'background' => [
1069 'label' => esc_html__( 'Overlay Background Type', 'shopbuilder' ),
1070 ],
1071 'color' => [
1072 'label' => 'Background',
1073 ],
1074 'color_b' => [
1075 'label' => 'Background 2',
1076 ],
1077 ],
1078 'selector' => $selectors['overlay'],
1079 'condition' => [
1080 'show_overlay' => [ 'yes' ],
1081 ],
1082 ];
1083
1084 $extra_controls['rtsb_el_image_styles_hover_overlay'] = [
1085 'mode' => 'group',
1086 'type' => 'background',
1087 'label' => esc_html__( 'Hover Image Overlay', 'shopbuilder' ),
1088 'types' => [ 'classic', 'gradient' ],
1089 'exclude' => [ 'image' ], // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
1090 'fields_options' => [
1091 'background' => [
1092 'label' => esc_html__( 'Hover Overlay Background Type', 'shopbuilder' ),
1093 ],
1094 'color' => [
1095 'label' => 'Hover Background',
1096 ],
1097 'color_b' => [
1098 'label' => 'Hover Background 2',
1099 ],
1100 ],
1101 'selector' => $selectors['hover_overlay'],
1102 'condition' => [
1103 'show_overlay' => [ 'yes' ],
1104 ],
1105 ];
1106
1107 $fields = Fns::insert_controls( 'image_styles_typo_note', $fields, $extra_controls, true );
1108
1109 $extra_controls['image_styles_radius'] = [
1110 'mode' => 'responsive',
1111 'type' => 'dimensions',
1112 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1113 'size_units' => [ 'px', '%', 'em' ],
1114 'selectors' => $selectors['border_radius'],
1115 ];
1116
1117 $fields = Fns::insert_controls( 'rtsb_el_image_styles_border', $fields, $extra_controls, true );
1118
1119 return apply_filters( 'rtsb/elements/elementor/image_style_control', $fields, $obj );
1120 }
1121
1122 /**
1123 * Product Image Section
1124 *
1125 * @param object $obj Reference object.
1126 *
1127 * @return array
1128 */
1129 public static function product_image( $obj ): array {
1130 $conditions = [
1131 'relation' => 'and',
1132 'terms' => [
1133 [
1134 'relation' => 'or',
1135 'terms' => [
1136 [
1137 'name' => 'show_featured_image',
1138 'operator' => '==',
1139 'value' => 'yes',
1140 ],
1141 ],
1142 ],
1143 ],
1144 ];
1145
1146 return self::image( $obj, $conditions );
1147 }
1148
1149 /**
1150 * Category Image Section
1151 *
1152 * @param object $obj Reference object.
1153 *
1154 * @return array
1155 */
1156 public static function category_image( $obj ): array {
1157 $conditions = [
1158 'relation' => 'and',
1159 'terms' => [
1160 [
1161 'relation' => 'or',
1162 'terms' => [
1163 [
1164 'name' => 'show_cat_image',
1165 'operator' => '==',
1166 'value' => 'yes',
1167 ],
1168 [
1169 'name' => 'show_custom_image',
1170 'operator' => '==',
1171 'value' => 'yes',
1172 ],
1173 ],
1174 ],
1175 ],
1176 ];
1177
1178 return self::image( $obj, $conditions );
1179 }
1180
1181 /**
1182 * Pagination Section
1183 *
1184 * @param object $obj Reference object.
1185 *
1186 * @return array
1187 */
1188 public static function pagination( $obj ): array {
1189 $css_selectors = $obj->selectors['pagination'];
1190 $title = esc_html__( 'Pagination Buttons', 'shopbuilder' );
1191 $condition = [ 'show_pagination' => [ 'yes' ] ];
1192 $selectors = [
1193 'typography' => $css_selectors['typography'],
1194 'alignment' => [ $css_selectors['alignment'] => 'justify-content: {{VALUE}};' ],
1195 'width' => [ $css_selectors['width'] => 'width: {{SIZE}}{{UNIT}};' ],
1196 'height' => [ $css_selectors['height'] => 'height: {{SIZE}}{{UNIT}};' ],
1197 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
1198 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
1199 'active_color' => [ $css_selectors['active_color'] => 'color: {{VALUE}};' ],
1200 'active_bg_color' => [ $css_selectors['active_bg_color'] => 'background-color: {{VALUE}};' ],
1201 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
1202 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
1203 'border' => $css_selectors['border'],
1204 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
1205 'border_active_color' => [ $css_selectors['border_active_color'] => 'border-color: {{VALUE}};' ],
1206 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1207 'spacing' => [ $css_selectors['spacing'] => 'gap: {{SIZE}}{{UNIT}};' ],
1208 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1209 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1210 ];
1211
1212 $fields = ControlHelper::general_elementor_style( 'pagination_buttons', $title, $obj, $condition, $selectors );
1213
1214 unset( $fields['pagination_buttons_padding'] );
1215
1216 $fields['pagination_buttons_alignment']['options'] = [
1217 'flex-start' => [
1218 'title' => esc_html__( 'Left', 'shopbuilder' ),
1219 'icon' => 'eicon-text-align-left',
1220 ],
1221 'center' => [
1222 'title' => esc_html__( 'Center', 'shopbuilder' ),
1223 'icon' => 'eicon-text-align-center',
1224 ],
1225 'flex-end' => [
1226 'title' => esc_html__( 'Right', 'shopbuilder' ),
1227 'icon' => 'eicon-text-align-right',
1228 ],
1229 ];
1230
1231 $extra_controls = [];
1232
1233 $extra_controls['pagination_buttons_width'] = [
1234 'type' => 'slider',
1235 'mode' => 'responsive',
1236 'label' => esc_html__( 'Width', 'shopbuilder' ),
1237 'size_units' => [ 'px' ],
1238 'range' => [
1239 'px' => [
1240 'min' => 0,
1241 'max' => 100,
1242 ],
1243 ],
1244 'selectors' => $selectors['width'],
1245 ];
1246
1247 $extra_controls['pagination_buttons_height'] = [
1248 'type' => 'slider',
1249 'mode' => 'responsive',
1250 'label' => esc_html__( 'Height', 'shopbuilder' ),
1251 'size_units' => [ 'px' ],
1252 'range' => [
1253 'px' => [
1254 'min' => 0,
1255 'max' => 100,
1256 ],
1257 ],
1258 'selectors' => $selectors['height'],
1259 ];
1260
1261 $fields = Fns::insert_controls( 'pagination_buttons_color_note', $fields, $extra_controls );
1262
1263 $extra_controls['pagination_buttons_active_color'] = [
1264 'type' => 'color',
1265 'label' => esc_html__( 'Active Color', 'shopbuilder' ),
1266 'selectors' => $selectors['active_color'],
1267 'condition' => [
1268 'pagination_type!' => 'load_more',
1269 ],
1270 ];
1271
1272 $extra_controls['pagination_buttons_active_bg_color'] = [
1273 'type' => 'color',
1274 'label' => esc_html__( 'Active Background Color', 'shopbuilder' ),
1275 'selectors' => $selectors['active_bg_color'],
1276 'condition' => [
1277 'pagination_type!' => 'load_more',
1278 ],
1279 ];
1280
1281 $fields = Fns::insert_controls( 'pagination_buttons_bg_color', $fields, $extra_controls, true );
1282
1283 $extra_controls['pagination_buttons_active_border_color'] = [
1284 'type' => 'color',
1285 'label' => esc_html__( 'Active Border Color', 'shopbuilder' ),
1286 'condition' => [ 'rtsb_el_pagination_buttons_border_border!' => [ '' ] ],
1287 'selectors' => $selectors['border_active_color'],
1288 ];
1289
1290 $extra_controls['pagination_buttons_radius'] = [
1291 'mode' => 'responsive',
1292 'type' => 'dimensions',
1293 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1294 'size_units' => [ 'px', '%', 'em' ],
1295 'selectors' => $selectors['border_radius'],
1296 ];
1297
1298 $fields = Fns::insert_controls( 'pagination_buttons_border_hover_color', $fields, $extra_controls, true );
1299
1300 $extra_controls['pagination_buttons_spacing'] = [
1301 'type' => 'slider',
1302 'mode' => 'responsive',
1303 'label' => esc_html__( 'Spacing', 'shopbuilder' ),
1304 'size_units' => [ 'px' ],
1305 'range' => [
1306 'px' => [
1307 'min' => 0,
1308 'max' => 100,
1309 ],
1310 ],
1311 'selectors' => $selectors['spacing'],
1312 'condition' => [
1313 'pagination_type!' => 'load_more',
1314 ],
1315 ];
1316
1317 $extra_controls['pagination_buttons_padding'] = [
1318 'mode' => 'responsive',
1319 'type' => 'dimensions',
1320 'label' => esc_html__( 'Padding', 'shopbuilder' ),
1321 'size_units' => [ 'px', '%', 'em' ],
1322 'selectors' => ! empty( $selectors['padding'] ) ? $selectors['padding'] : [],
1323 'condition' => [
1324 'pagination_type' => 'load_more',
1325 ],
1326 ];
1327
1328 $fields = Fns::insert_controls( 'pagination_buttons_spacing_note', $fields, $extra_controls, true );
1329
1330 return apply_filters( 'rtsb/elements/elementor/pagination_style_control', $fields, $obj );
1331 }
1332
1333 /**
1334 * Product Add to Cart Section
1335 *
1336 * @param object $obj Reference object.
1337 *
1338 * @return array
1339 */
1340 public static function product_add_to_cart( $obj ): array {
1341 $css_selectors = $obj->selectors['product_add_to_cart'];
1342 $title = esc_html__( 'Add to Cart Button', 'shopbuilder' );
1343 $condition = [
1344 'show_add_to_cart' => [ 'yes' ],
1345 ];
1346 $selectors = [
1347 'typography' => $css_selectors['typography'],
1348 'icon_size' => [
1349 $css_selectors['icon_size']['font_size'] => 'font-size: {{SIZE}}{{UNIT}};',
1350 $css_selectors['icon_size']['width'] => 'height: {{SIZE}}{{UNIT}};',
1351 ],
1352 'cart_icon_spacing' => [
1353 $css_selectors['cart_icon_spacing']['margin_left'] => 'margin-left: {{SIZE}}{{UNIT}};',
1354 $css_selectors['cart_icon_spacing']['margin_right'] => 'margin-right: {{SIZE}}{{UNIT}};',
1355 ],
1356 'cart_width' => [ $css_selectors['cart_width'] => 'width: {{SIZE}}{{UNIT}} !important;' ],
1357 'cart_height' => [ $css_selectors['cart_height'] => 'height: {{SIZE}}{{UNIT}} !important;' ],
1358 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
1359 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
1360 'icon_color' => [ $css_selectors['icon_color'] => 'color: {{VALUE}};' ],
1361 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
1362 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
1363 'hover_icon_color' => [ $css_selectors['hover_icon_color'] => 'color: {{VALUE}};' ],
1364 'border' => $css_selectors['border'],
1365 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
1366 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
1367 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
1368 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1369 ];
1370
1371 $fields = ControlHelper::general_elementor_style( 'add_to_cart_button', $title, $obj, $condition, $selectors );
1372
1373 $fields['add_to_cart_button_alignment'] = [
1374 'type' => 'slider',
1375 'mode' => 'responsive',
1376 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
1377 'size_units' => [ 'px' ],
1378 'range' => [
1379 'px' => [
1380 'min' => 0,
1381 'max' => 100,
1382 ],
1383 ],
1384 'condition' => [
1385 'show_cart_icon' => [ 'yes' ],
1386 ],
1387 'selectors' => $selectors['icon_size'],
1388 ];
1389
1390 $extra_controls = [];
1391
1392 $extra_controls['cart_icon_alignment'] = [
1393 'type' => 'choose',
1394 'label' => esc_html__( 'Icon Alignment', 'shopbuilder' ),
1395 'options' => [
1396 'left' => [
1397 'title' => esc_html__( 'Left', 'shopbuilder' ),
1398 'icon' => 'eicon-arrow-left',
1399 ],
1400 'right' => [
1401 'title' => esc_html__( 'Right', 'shopbuilder' ),
1402 'icon' => 'eicon-arrow-right',
1403 ],
1404 ],
1405 'default' => 'left',
1406 'toggle' => true,
1407 'condition' => [
1408 'show_cart_text' => [ 'yes' ],
1409 'show_cart_icon' => [ 'yes' ],
1410 ],
1411 ];
1412
1413 $extra_controls['cart_icon_spacing'] = [
1414 'type' => 'slider',
1415 'mode' => 'responsive',
1416 'label' => esc_html__( 'Icon Spacing', 'shopbuilder' ),
1417 'size_units' => [ 'px' ],
1418 'range' => [
1419 'px' => [
1420 'min' => 0,
1421 'max' => 100,
1422 ],
1423 ],
1424 'default' => [
1425 'unit' => 'px',
1426 'size' => 8,
1427 ],
1428 'condition' => [
1429 'show_cart_text' => [ 'yes' ],
1430 'show_cart_icon' => [ 'yes' ],
1431 ],
1432 'selectors' => $selectors['cart_icon_spacing'],
1433 ];
1434
1435 $extra_controls['cart_width'] = [
1436 'type' => 'slider',
1437 'mode' => 'responsive',
1438 'label' => esc_html__( 'Width', 'shopbuilder' ),
1439 'size_units' => [ 'px', '%' ],
1440 'range' => [
1441 'px' => [
1442 'min' => 0,
1443 'max' => 1000,
1444 ],
1445 ],
1446 'selectors' => $selectors['cart_width'],
1447 ];
1448
1449 $extra_controls['cart_height'] = [
1450 'type' => 'slider',
1451 'mode' => 'responsive',
1452 'label' => esc_html__( 'height', 'shopbuilder' ),
1453 'size_units' => [ 'px', '%' ],
1454 'range' => [
1455 'px' => [
1456 'min' => 0,
1457 'max' => 1000,
1458 ],
1459 ],
1460 'selectors' => $selectors['cart_height'],
1461 ];
1462
1463 $fields = Fns::insert_controls( 'add_to_cart_button_alignment', $fields, $extra_controls, true );
1464
1465 $extra_controls['add_to_cart_button_icon_color'] = [
1466 'type' => 'color',
1467 'label' => esc_html__( 'Icon Color', 'shopbuilder' ),
1468 'selectors' => $selectors['icon_color'],
1469 ];
1470
1471 $fields = Fns::insert_controls( 'add_to_cart_button_bg_color', $fields, $extra_controls, true );
1472
1473 $extra_controls['add_to_cart_button_hover_icon_color'] = [
1474 'type' => 'color',
1475 'label' => esc_html__( 'Hover Icon Color', 'shopbuilder' ),
1476 'selectors' => $selectors['hover_icon_color'],
1477 ];
1478
1479 $fields = Fns::insert_controls( 'add_to_cart_button_hover_bg_color', $fields, $extra_controls, true );
1480
1481 $extra_controls['add_to_cart_button_radius'] = [
1482 'mode' => 'responsive',
1483 'type' => 'dimensions',
1484 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1485 'size_units' => [ 'px', '%', 'em' ],
1486 'selectors' => $selectors['border_radius'],
1487 ];
1488
1489 $fields = Fns::insert_controls( 'add_to_cart_button_border_hover_color', $fields, $extra_controls, true );
1490
1491 return apply_filters( 'rtsb/elements/elementor/add_to_cart_style_control', $fields, $obj );
1492 }
1493
1494 /**
1495 * Product Compare Section
1496 *
1497 * @param object $obj Reference object.
1498 *
1499 * @return array
1500 */
1501 public static function product_compare( $obj ): array {
1502 $css_selectors = $obj->selectors['product_compare'];
1503 $title = esc_html__( 'Compare Button', 'shopbuilder' );
1504 $condition = [
1505 'show_compare' => [ 'yes' ],
1506 ];
1507 $selectors = self::action_btn_selectors( $css_selectors );
1508
1509 $fields = ControlHelper::general_elementor_style( 'compare_button', $title, $obj, $condition, $selectors );
1510
1511 unset( $fields['compare_button_alignment'] );
1512
1513 $fields['rtsb_el_compare_button_typography'] = [
1514 'type' => 'slider',
1515 'mode' => 'responsive',
1516 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
1517 'size_units' => [ 'px' ],
1518 'range' => [
1519 'px' => [
1520 'min' => 0,
1521 'max' => 100,
1522 ],
1523 ],
1524 'condition' => [
1525 'show_cart_icon' => [ 'yes' ],
1526 ],
1527 'selectors' => $selectors['icon_size'],
1528 ];
1529
1530 $extra_controls = [];
1531
1532 $extra_controls['compare_width'] = [
1533 'type' => 'slider',
1534 'mode' => 'responsive',
1535 'label' => esc_html__( 'Width', 'shopbuilder' ),
1536 'size_units' => [ 'px' ],
1537 'range' => [
1538 'px' => [
1539 'min' => 0,
1540 'max' => 1000,
1541 ],
1542 ],
1543 'selectors' => $selectors['width'],
1544 ];
1545
1546 $extra_controls['compare_height'] = [
1547 'type' => 'slider',
1548 'mode' => 'responsive',
1549 'label' => esc_html__( 'height', 'shopbuilder' ),
1550 'size_units' => [ 'px' ],
1551 'range' => [
1552 'px' => [
1553 'min' => 0,
1554 'max' => 100,
1555 ],
1556 ],
1557 'selectors' => $selectors['height'],
1558 ];
1559
1560 $fields = Fns::insert_controls( 'compare_button_color_note', $fields, $extra_controls );
1561
1562 $extra_controls['compare_button_radius'] = [
1563 'mode' => 'responsive',
1564 'type' => 'dimensions',
1565 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1566 'size_units' => [ 'px', '%', 'em' ],
1567 'selectors' => $selectors['border_radius'],
1568 ];
1569
1570 $fields = Fns::insert_controls( 'compare_button_border_hover_color', $fields, $extra_controls, true );
1571
1572 return apply_filters( 'rtsb/elements/elementor/compare_style_control', $fields, $obj );
1573 }
1574
1575 /**
1576 * Product Wishlist Section
1577 *
1578 * @param object $obj Reference object.
1579 *
1580 * @return array
1581 */
1582 public static function product_wishlist( $obj ): array {
1583 $css_selectors = $obj->selectors['product_wishlist'];
1584 $title = esc_html__( 'Wishlist Button', 'shopbuilder' );
1585 $condition = [
1586 'show_wishlist' => [ 'yes' ],
1587 ];
1588 $selectors = self::action_btn_selectors( $css_selectors );
1589
1590 $fields = ControlHelper::general_elementor_style( 'wishlist_button', $title, $obj, $condition, $selectors );
1591
1592 unset( $fields['wishlist_button_alignment'] );
1593
1594 $fields['rtsb_el_wishlist_button_typography'] = [
1595 'type' => 'slider',
1596 'mode' => 'responsive',
1597 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
1598 'size_units' => [ 'px' ],
1599 'range' => [
1600 'px' => [
1601 'min' => 0,
1602 'max' => 100,
1603 ],
1604 ],
1605 'condition' => [
1606 'show_cart_icon' => [ 'yes' ],
1607 ],
1608 'selectors' => $selectors['icon_size'],
1609 ];
1610
1611 $extra_controls = [];
1612
1613 $extra_controls['wishlist_width'] = [
1614 'type' => 'slider',
1615 'mode' => 'responsive',
1616 'label' => esc_html__( 'Width', 'shopbuilder' ),
1617 'size_units' => [ 'px' ],
1618 'range' => [
1619 'px' => [
1620 'min' => 0,
1621 'max' => 1000,
1622 ],
1623 ],
1624 'selectors' => $selectors['width'],
1625 ];
1626
1627 $extra_controls['wishlist_height'] = [
1628 'type' => 'slider',
1629 'mode' => 'responsive',
1630 'label' => esc_html__( 'height', 'shopbuilder' ),
1631 'size_units' => [ 'px' ],
1632 'range' => [
1633 'px' => [
1634 'min' => 0,
1635 'max' => 100,
1636 ],
1637 ],
1638 'selectors' => $selectors['height'],
1639 ];
1640
1641 $fields = Fns::insert_controls( 'wishlist_button_color_note', $fields, $extra_controls );
1642
1643 $extra_controls['wishlist_button_radius'] = [
1644 'mode' => 'responsive',
1645 'type' => 'dimensions',
1646 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1647 'size_units' => [ 'px', '%', 'em' ],
1648 'selectors' => $selectors['border_radius'],
1649 ];
1650
1651 $fields = Fns::insert_controls( 'wishlist_button_border_hover_color', $fields, $extra_controls, true );
1652
1653 return apply_filters( 'rtsb/elements/elementor/wishlist_style_control', $fields, $obj );
1654 }
1655
1656 /**
1657 * Product Quick View Section
1658 *
1659 * @param object $obj Reference object.
1660 *
1661 * @return array
1662 */
1663 public static function product_quick_view( $obj ): array {
1664 $css_selectors = $obj->selectors['product_quick_view'];
1665 $title = esc_html__( 'Quick View Button', 'shopbuilder' );
1666 $condition = [
1667 'show_quick_view' => [ 'yes' ],
1668 ];
1669 $selectors = self::action_btn_selectors( $css_selectors );
1670
1671 $fields = ControlHelper::general_elementor_style( 'quick_view_button', $title, $obj, $condition, $selectors );
1672
1673 unset( $fields['quick_view_button_alignment'] );
1674
1675 $fields['rtsb_el_quick_view_button_typography'] = [
1676 'type' => 'slider',
1677 'mode' => 'responsive',
1678 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
1679 'size_units' => [ 'px' ],
1680 'range' => [
1681 'px' => [
1682 'min' => 0,
1683 'max' => 100,
1684 ],
1685 ],
1686 'condition' => [
1687 'show_cart_icon' => [ 'yes' ],
1688 ],
1689 'selectors' => $selectors['icon_size'],
1690 ];
1691
1692 $extra_controls = [];
1693
1694 $extra_controls['quick_view_width'] = [
1695 'type' => 'slider',
1696 'mode' => 'responsive',
1697 'label' => esc_html__( 'Width', 'shopbuilder' ),
1698 'size_units' => [ 'px' ],
1699 'range' => [
1700 'px' => [
1701 'min' => 0,
1702 'max' => 1000,
1703 ],
1704 ],
1705 'selectors' => $selectors['width'],
1706 ];
1707
1708 $extra_controls['quick_view_height'] = [
1709 'type' => 'slider',
1710 'mode' => 'responsive',
1711 'label' => esc_html__( 'height', 'shopbuilder' ),
1712 'size_units' => [ 'px' ],
1713 'range' => [
1714 'px' => [
1715 'min' => 0,
1716 'max' => 100,
1717 ],
1718 ],
1719 'selectors' => $selectors['height'],
1720 ];
1721
1722 $fields = Fns::insert_controls( 'quick_view_button_color_note', $fields, $extra_controls );
1723
1724 $extra_controls['quick_view_button_radius'] = [
1725 'mode' => 'responsive',
1726 'type' => 'dimensions',
1727 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1728 'size_units' => [ 'px', '%', 'em' ],
1729 'selectors' => $selectors['border_radius'],
1730 ];
1731
1732 $fields = Fns::insert_controls( 'quick_view_button_border_hover_color', $fields, $extra_controls, true );
1733
1734 return apply_filters( 'rtsb/elements/elementor/quick_view_style_control', $fields, $obj );
1735 }
1736
1737 /**
1738 * Hover Icon Button Section
1739 *
1740 * @param object $obj Reference object.
1741 *
1742 * @return array
1743 */
1744 public static function hover_icon_button( $obj ): array {
1745 $css_selectors = $obj->selectors['hover_icon_button'];
1746 $title = esc_html__( 'Hover Icon Button', 'shopbuilder' );
1747 $condition = [
1748 'layout' => [ 'grid-layout2', 'slider-layout2' ],
1749 ];
1750 $selectors = [
1751 'typography' => $css_selectors['typography'],
1752 'icon_size' => [ $css_selectors['icon_size'] => 'font-size: {{SIZE}}{{UNIT}}' ],
1753 'hover_icon_spacing' => [ $css_selectors['hover_icon_spacing'] => 'margin-left: {{SIZE}}{{UNIT}}' ],
1754 'color' => [ $css_selectors['color'] => 'color: {{VALUE}}' ],
1755 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}}' ],
1756 'icon_color' => [ $css_selectors['icon_color'] => 'color: {{VALUE}}' ],
1757 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}}' ],
1758 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}}' ],
1759 'hover_icon_color' => [ $css_selectors['hover_icon_color'] => 'color: {{VALUE}}' ],
1760 'border' => $css_selectors['border'],
1761 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}}' ],
1762 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}' ],
1763 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1764 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1765 ];
1766
1767 $fields = ControlHelper::general_elementor_style( 'hover_icon_button', $title, $obj, $condition, $selectors );
1768
1769 $fields['hover_icon_button_alignment'] = [
1770 'type' => 'slider',
1771 'mode' => 'responsive',
1772 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
1773 'size_units' => [ 'px' ],
1774 'range' => [
1775 'px' => [
1776 'min' => 0,
1777 'max' => 100,
1778 ],
1779 ],
1780 'default' => [
1781 'unit' => 'px',
1782 'size' => 14,
1783 ],
1784 'condition' => [
1785 'show_hover_btn_icon' => [ 'yes' ],
1786 ],
1787 'selectors' => $selectors['icon_size'],
1788 ];
1789
1790 $extra_controls = [];
1791
1792 $extra_controls['hover_icon_button_spacing'] = [
1793 'type' => 'slider',
1794 'mode' => 'responsive',
1795 'label' => esc_html__( 'Icon Spacing', 'shopbuilder' ),
1796 'size_units' => [ 'px' ],
1797 'range' => [
1798 'px' => [
1799 'min' => 0,
1800 'max' => 100,
1801 ],
1802 ],
1803 'default' => [
1804 'unit' => 'px',
1805 'size' => 3,
1806 ],
1807 'condition' => [
1808 'show_hover_btn_icon' => [ 'yes' ],
1809 ],
1810 'selectors' => $selectors['hover_icon_spacing'],
1811 ];
1812
1813 $fields = Fns::insert_controls( 'hover_icon_button_alignment', $fields, $extra_controls, true );
1814
1815 $extra_controls['hover_icon_button_icon_color'] = [
1816 'type' => 'color',
1817 'label' => esc_html__( 'Icon Color', 'shopbuilder' ),
1818 'condition' => [
1819 'show_hover_btn_icon' => [ 'yes' ],
1820 ],
1821 'selectors' => $selectors['icon_color'],
1822 ];
1823
1824 $fields = Fns::insert_controls( 'hover_icon_button_bg_color', $fields, $extra_controls, true );
1825
1826 $extra_controls['hover_icon_button_hover_icon_color'] = [
1827 'type' => 'color',
1828 'label' => esc_html__( 'Hover Icon Color', 'shopbuilder' ),
1829 'condition' => [
1830 'show_hover_btn_icon' => [ 'yes' ],
1831 ],
1832 'selectors' => $selectors['hover_icon_color'],
1833 ];
1834
1835 $fields = Fns::insert_controls( 'hover_icon_button_hover_bg_color', $fields, $extra_controls, true );
1836
1837 $extra_controls['hover_icon_button_radius'] = [
1838 'mode' => 'responsive',
1839 'type' => 'dimensions',
1840 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1841 'size_units' => [ 'px', '%', 'em' ],
1842 'selectors' => $selectors['border_radius'],
1843 ];
1844
1845 $fields = Fns::insert_controls( 'hover_icon_button_border_hover_color', $fields, $extra_controls, true );
1846
1847 return apply_filters( 'rtsb/elements/elementor/hover_icon_btn_style_control', $fields, $obj );
1848 }
1849
1850 /**
1851 * Share Items Section
1852 *
1853 * @param object $obj Reference object.
1854 *
1855 * @return array
1856 */
1857 public static function share_items( $obj ): array {
1858 $css_selectors = $obj->selectors['share_items'];
1859 $title = esc_html__( 'Share Items', 'shopbuilder' );
1860 $condition = [
1861 'layout!' => [ 'default' ],
1862 ];
1863 $selectors = [
1864 'share_icons_spacing' => [ $css_selectors['share_icons_spacing'] => 'gap: {{SIZE}}{{UNIT}}' ],
1865 'share_items_min_width' => [ $css_selectors['share_items_min_width'] => 'min-width: {{SIZE}}{{UNIT}}' ],
1866 'social_items_color' => [ $css_selectors['social_items_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1867 'social_items_bg_color' => [ $css_selectors['social_items_bg_color'] => 'background-color: {{VALUE}}' ],
1868 'facebook_color' => [ $css_selectors['facebook_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1869 'twitter_color' => [ $css_selectors['twitter_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1870 'linkedin_color' => [ $css_selectors['linkedin_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1871 'pinterest_color' => [ $css_selectors['pinterest_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1872 'skype_color' => [ $css_selectors['skype_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1873 'whatsapp_color' => [ $css_selectors['whatsapp_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1874 'reddit_color' => [ $css_selectors['reddit_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1875 'telegram_color' => [ $css_selectors['telegram_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1876 'facebook_bg_color' => [ $css_selectors['facebook_bg_color'] => 'background-color: {{VALUE}}' ],
1877 'twitter_bg_color' => [ $css_selectors['twitter_bg_color'] => 'background-color: {{VALUE}}' ],
1878 'linkedin_bg_color' => [ $css_selectors['linkedin_bg_color'] => 'background-color: {{VALUE}}' ],
1879 'pinterest_bg_color' => [ $css_selectors['pinterest_bg_color'] => 'background-color: {{VALUE}}' ],
1880 'skype_bg_color' => [ $css_selectors['skype_bg_color'] => 'background-color: {{VALUE}}' ],
1881 'whatsapp_bg_color' => [ $css_selectors['whatsapp_bg_color'] => 'background-color: {{VALUE}}' ],
1882 'reddit_bg_color' => [ $css_selectors['reddit_bg_color'] => 'background-color: {{VALUE}}' ],
1883 'telegram_bg_color' => [ $css_selectors['telegram_bg_color'] => 'background-color: {{VALUE}}' ],
1884 'social_items_hover_color' => [ $css_selectors['social_items_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1885 'social_items_hover_bg_color' => [ $css_selectors['social_items_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1886 'facebook_hover_color' => [ $css_selectors['facebook_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1887 'twitter_hover_color' => [ $css_selectors['twitter_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1888 'linkedin_hover_color' => [ $css_selectors['linkedin_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1889 'pinterest_hover_color' => [ $css_selectors['pinterest_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1890 'skype_hover_color' => [ $css_selectors['skype_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1891 'whatsapp_hover_color' => [ $css_selectors['whatsapp_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1892 'reddit_hover_color' => [ $css_selectors['reddit_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1893 'telegram_hover_color' => [ $css_selectors['telegram_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1894 'facebook_hover_bg_color' => [ $css_selectors['facebook_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1895 'twitter_hover_bg_color' => [ $css_selectors['twitter_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1896 'linkedin_hover_bg_color' => [ $css_selectors['linkedin_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1897 'pinterest_hover_bg_color' => [ $css_selectors['pinterest_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1898 'skype_hover_bg_color' => [ $css_selectors['skype_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1899 'whatsapp_hover_bg_color' => [ $css_selectors['whatsapp_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1900 'reddit_hover_bg_color' => [ $css_selectors['reddit_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1901 'telegram_hover_bg_color' => [ $css_selectors['telegram_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1902 'border' => $css_selectors['border'],
1903 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}}' ],
1904 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}' ],
1905 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1906 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1907 ];
1908
1909 $fields = ControlHelper::general_elementor_style( 'share_items', $title, $obj, $condition, $selectors );
1910
1911 unset(
1912 $fields['rtsb_el_share_items_typography'],
1913 $fields['share_items_alignment'],
1914 $fields['share_items_hover_color'],
1915 $fields['share_items_hover_bg_color'],
1916 $fields['share_items_color'],
1917 $fields['share_items_bg_color']
1918 );
1919
1920 $extra_controls = [];
1921
1922 $extra_controls['share_items_spacing'] = [
1923 'type' => 'slider',
1924 'mode' => 'responsive',
1925 'label' => esc_html__( 'Items Spacing', 'shopbuilder' ),
1926 'size_units' => [ 'px' ],
1927 'range' => [
1928 'px' => [
1929 'min' => 0,
1930 'max' => 100,
1931 ],
1932 ],
1933 'selectors' => $selectors['share_icons_spacing'],
1934 ];
1935
1936 $extra_controls['share_items_min_width'] = [
1937 'type' => 'slider',
1938 'mode' => 'responsive',
1939 'label' => esc_html__( 'Items Min Width', 'shopbuilder' ),
1940 'size_units' => [ 'px' ],
1941 'range' => [
1942 'px' => [
1943 'min' => 0,
1944 'max' => 300,
1945 ],
1946 ],
1947 'selectors' => $selectors['share_items_min_width'],
1948 ];
1949
1950 $fields = Fns::insert_controls( 'share_items_typo_note', $fields, $extra_controls, true );
1951
1952 $share_platforms = ControlHelper::sharing_settings();
1953
1954 $extra_controls['social_items_color'] = [
1955 'type' => 'color',
1956 'label' => esc_html__( 'Items Color', 'shopbuilder' ),
1957 'selectors' => $selectors['social_items_color'],
1958 ];
1959
1960 $extra_controls['social_items_bg_color'] = [
1961 'type' => 'color',
1962 'label' => esc_html__( 'Items Background Color', 'shopbuilder' ),
1963 'selectors' => $selectors['social_items_bg_color'],
1964 ];
1965
1966 foreach ( $share_platforms as $share_platform ) {
1967 $extra_controls[ $share_platform . '_color' ] = [
1968 'type' => 'color',
1969 'label' => ucfirst( $share_platform ) . esc_html__( ' Color', 'shopbuilder' ),
1970 'selectors' => $selectors[ $share_platform . '_color' ],
1971 ];
1972
1973 $extra_controls[ $share_platform . '_bg_color' ] = [
1974 'type' => 'color',
1975 'label' => ucfirst( $share_platform ) . esc_html__( ' Background', 'shopbuilder' ),
1976 'selectors' => $selectors[ $share_platform . '_bg_color' ],
1977 ];
1978
1979 $fields = Fns::insert_controls( 'share_items_color_tab', $fields, $extra_controls, true );
1980 }
1981
1982 $extra_controls['social_items_hover_color'] = [
1983 'type' => 'color',
1984 'label' => esc_html__( 'Items Hover Color', 'shopbuilder' ),
1985 'selectors' => $selectors['social_items_hover_color'],
1986 ];
1987
1988 $extra_controls['social_items_hover_bg_color'] = [
1989 'type' => 'color',
1990 'label' => esc_html__( 'Items Background Hover Color', 'shopbuilder' ),
1991 'selectors' => $selectors['social_items_hover_bg_color'],
1992 ];
1993
1994 foreach ( $share_platforms as $share_platform ) {
1995 $extra_controls[ $share_platform . '_hover_color' ] = [
1996 'type' => 'color',
1997 'label' => ucfirst( $share_platform ) . esc_html__( ' Hover Color', 'shopbuilder' ),
1998 'selectors' => $selectors[ $share_platform . '_hover_color' ],
1999 ];
2000
2001 $extra_controls[ $share_platform . '_hover_bg_color' ] = [
2002 'type' => 'color',
2003 'label' => ucfirst( $share_platform ) . esc_html__( ' Hover Background', 'shopbuilder' ),
2004 'selectors' => $selectors[ $share_platform . '_hover_bg_color' ],
2005 ];
2006
2007 $fields = Fns::insert_controls( 'share_items_hover_color_tab', $fields, $extra_controls, true );
2008 }
2009
2010 $extra_controls['share_items_radius'] = [
2011 'mode' => 'responsive',
2012 'type' => 'dimensions',
2013 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
2014 'size_units' => [ 'px', '%', 'em' ],
2015 'selectors' => $selectors['border_radius'],
2016 ];
2017
2018 $fields = Fns::insert_controls( 'share_items_border_hover_color', $fields, $extra_controls, true );
2019
2020 return apply_filters( 'rtsb/elements/elementor/share_icons_style_control', $fields, $obj );
2021 }
2022
2023 /**
2024 * Share Icons Section
2025 *
2026 * @param object $obj Reference object.
2027 *
2028 * @return array
2029 */
2030 public static function share_icons( $obj ): array {
2031 $css_selectors = $obj->selectors['share_icons'];
2032 $title = esc_html__( 'Share Icons', 'shopbuilder' );
2033 $condition = [
2034 'layout!' => [ 'default' ],
2035 ];
2036 $selectors = [
2037 'share_icons_width' => [ $css_selectors['share_icons_width'] => 'width: {{SIZE}}{{UNIT}}' ],
2038 'share_icons_height' => [ $css_selectors['share_icons_height'] => 'height: {{SIZE}}{{UNIT}}' ],
2039 'color' => [ $css_selectors['color'] => 'fill: {{VALUE}}' ],
2040 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}}' ],
2041 'hover_color' => [ $css_selectors['hover_color'] => 'fill: {{VALUE}}' ],
2042 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}}' ],
2043 'border' => $css_selectors['border'],
2044 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}}' ],
2045 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2046 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2047 ];
2048
2049 $fields = ControlHelper::general_elementor_style( 'share_icons', $title, $obj, $condition, $selectors );
2050
2051 unset(
2052 $fields['rtsb_el_share_icons_typography'],
2053 $fields['share_icons_alignment'],
2054 );
2055
2056 $extra_controls = [];
2057
2058 $extra_controls['share_icons_width'] = [
2059 'type' => 'slider',
2060 'mode' => 'responsive',
2061 'label' => esc_html__( 'Icon Width', 'shopbuilder' ),
2062 'size_units' => [ 'px' ],
2063 'range' => [
2064 'px' => [
2065 'min' => 0,
2066 'max' => 100,
2067 ],
2068 ],
2069 'selectors' => $selectors['share_icons_width'],
2070 ];
2071
2072 $extra_controls['share_icons_height'] = [
2073 'type' => 'slider',
2074 'mode' => 'responsive',
2075 'label' => esc_html__( 'Icon Height', 'shopbuilder' ),
2076 'size_units' => [ 'px' ],
2077 'range' => [
2078 'px' => [
2079 'min' => 0,
2080 'max' => 100,
2081 ],
2082 ],
2083 'selectors' => $selectors['share_icons_height'],
2084 ];
2085
2086 $fields = Fns::insert_controls( 'share_icons_typo_note', $fields, $extra_controls, true );
2087
2088 $fields['share_icons_typo_note']['raw'] = sprintf(
2089 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
2090 esc_html__( 'Dimension', 'shopbuilder' )
2091 );
2092
2093 return apply_filters( 'rtsb/elements/elementor/share_icons_style_control', $fields, $obj );
2094 }
2095
2096 /**
2097 * Share Text Section
2098 *
2099 * @param object $obj Reference object.
2100 *
2101 * @return array
2102 */
2103 public static function share_text( $obj ): array {
2104 $css_selectors = $obj->selectors['share_text'];
2105 $title = esc_html__( 'Share Text', 'shopbuilder' );
2106 $condition = [
2107 'layout!' => [ 'default' ],
2108 ];
2109 $selectors = [
2110 'typography' => $css_selectors['typography'],
2111 'alignment' => [ $css_selectors['alignment'] => 'text-align: {{VALUE}};' ],
2112 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
2113 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}}' ],
2114 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}}' ],
2115 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}}' ],
2116 'border' => $css_selectors['border'],
2117 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}}' ],
2118 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2119 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2120 ];
2121
2122 $fields = ControlHelper::general_elementor_style( 'share_text', $title, $obj, $condition, $selectors );
2123
2124 return apply_filters( 'rtsb/elements/elementor/share_text_style_control', $fields, $obj );
2125 }
2126
2127 /**
2128 * Share Text Section
2129 *
2130 * @param object $obj Reference object.
2131 *
2132 * @return array
2133 */
2134 public static function share_header( $obj ): array {
2135 $css_selectors = $obj->selectors['share_header'];
2136 $title = esc_html__( 'Share Header', 'shopbuilder' );
2137 $condition = [
2138 'show_share_pre_text' => [ 'yes' ],
2139 ];
2140 $selectors = [
2141 'typography' => $css_selectors['typography'],
2142 'share_header_type' => [ $css_selectors['share_header_type'] => 'display: {{VALUE}};' ],
2143 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
2144 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}}' ],
2145 'border' => $css_selectors['border'],
2146 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2147 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
2148 ];
2149
2150 $fields = ControlHelper::general_elementor_style( 'share_header', $title, $obj, $condition, $selectors );
2151
2152 unset(
2153 $fields['share_header_alignment'],
2154 $fields['share_header_color_tabs'],
2155 $fields['share_header_color_tab'],
2156 $fields['share_header_color_tab_end'],
2157 $fields['share_header_hover_color_tab'],
2158 $fields['share_header_hover_color'],
2159 $fields['share_header_hover_bg_color'],
2160 $fields['share_header_hover_color_tab_end'],
2161 $fields['share_header_color_tabs_end'],
2162 $fields['share_header_border_hover_color'],
2163 );
2164
2165 $extra_controls = [];
2166
2167 $extra_controls['share_header_type'] = [
2168 'type' => 'choose',
2169 'label' => esc_html__( 'Display Type', 'shopbuilder' ),
2170 'options' => [
2171 'flex' => [
2172 'title' => esc_html__( 'Inline', 'shopbuilder' ),
2173 'icon' => 'eicon-h-align-right',
2174 ],
2175 'block' => [
2176 'title' => esc_html__( 'New Line', 'shopbuilder' ),
2177 'icon' => 'eicon-v-align-bottom',
2178 ],
2179 ],
2180 'default' => 'flex',
2181 'toggle' => true,
2182 'selectors' => $selectors['share_header_type'],
2183 ];
2184
2185 return Fns::insert_controls( 'share_header_color_note', $fields, $extra_controls );
2186 }
2187
2188 /**
2189 * Advanced section
2190 *
2191 * @param object $obj Reference object.
2192 *
2193 * @return array
2194 */
2195 public static function advanced( $obj ): array {
2196
2197 $fields['advanced_section'] = $obj->start_section( esc_html__( 'Advanced', 'shopbuilder' ), self::$tab );
2198
2199 $fields['gutter_section_end'] = $obj->end_section();
2200
2201 return apply_filters( 'rtsb/elements/elementor/advanced_control', $fields, $obj );
2202 }
2203
2204 /**
2205 * Slider buttons section
2206 *
2207 * @param object $obj Reference object.
2208 *
2209 * @return array
2210 */
2211 public static function slider_buttons( $obj ): array {
2212 $css_selectors = $obj->selectors['slider_buttons'];
2213 $title = esc_html__( 'Slider Buttons', 'shopbuilder' );
2214 $selectors = [
2215 'arrow_size' => [
2216 $css_selectors['arrow_size']['icon'] => 'font-size: {{SIZE}}{{UNIT}};',
2217 $css_selectors['arrow_size']['svg'] => 'width: {{SIZE}}{{UNIT}};',
2218 ],
2219 'arrow_width' => [ $css_selectors['arrow_width'] => 'width: {{SIZE}}{{UNIT}};' ],
2220 'arrow_height' => [ $css_selectors['arrow_height'] => 'height: {{SIZE}}{{UNIT}};' ],
2221 'arrow_line_height' => [ $css_selectors['arrow_line_height'] => 'line-height: {{SIZE}}{{UNIT}};' ],
2222 'dot_width' => [ $css_selectors['dot_width'] => 'width: {{SIZE}}{{UNIT}};' ],
2223 'dot_height' => [ $css_selectors['dot_height'] => 'height: {{SIZE}}{{UNIT}};' ],
2224 'dot_spacing' => [ $css_selectors['dot_spacing'] => 'margin-left: calc({{SIZE}}{{UNIT}} / 2); margin-right: calc({{SIZE}}{{UNIT}} / 2);' ],
2225 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
2226 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
2227 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
2228 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
2229 'dot_color' => [ $css_selectors['dot_color'] => 'background-color: {{VALUE}};' ],
2230 'dot_active_color' => [ $css_selectors['dot_active_color'] => 'background-color: {{VALUE}};' ],
2231 'border' => $css_selectors['border'],
2232 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
2233 'active_border_color' => [ $css_selectors['active_border_color'] => 'border-color: {{VALUE}};' ],
2234 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2235 'wrapper_padding' => [ $css_selectors['wrapper_padding'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2236 ];
2237
2238 $conditions = [
2239 'relation' => 'or',
2240 'terms' => [
2241 [
2242 'name' => 'slider_nav',
2243 'operator' => '==',
2244 'value' => 'yes',
2245 ],
2246 [
2247 'name' => 'slider_pagi',
2248 'operator' => '==',
2249 'value' => 'yes',
2250 ],
2251 ],
2252 ];
2253
2254 $fields = ControlHelper::general_elementor_style( 'slider_buttons', $title, $obj, [], $selectors, $conditions );
2255
2256 unset(
2257 $fields['rtsb_el_slider_buttons_typography'],
2258 $fields['slider_buttons_alignment'],
2259 $fields['slider_buttons_padding'],
2260 $fields['slider_buttons_margin']
2261 );
2262
2263 $extra_controls = [];
2264 $arrow_condition = [ 'slider_nav' => [ 'yes' ] ];
2265 $dot_condition = [ 'slider_pagi' => [ 'yes' ] ];
2266
2267 $fields['slider_buttons_typo_note']['raw'] = sprintf(
2268 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
2269 esc_html__( 'Arrow Size (px)', 'shopbuilder' )
2270 );
2271
2272 $fields['slider_buttons_typo_note']['condition'] = $arrow_condition;
2273
2274 $extra_controls['slider_buttons_arrow_size'] = [
2275 'type' => 'slider',
2276 'mode' => 'responsive',
2277 'label' => esc_html__( 'Arrow Size', 'shopbuilder' ),
2278 'range' => [
2279 'px' => [
2280 'min' => 1,
2281 'max' => 100,
2282 'step' => 1,
2283 ],
2284 ],
2285 'default' => [
2286 'unit' => 'px',
2287 'size' => 13,
2288 ],
2289 'condition' => $arrow_condition,
2290 'selectors' => $selectors['arrow_size'],
2291 ];
2292
2293 $extra_controls['slider_buttons_arrow_width'] = [
2294 'type' => 'slider',
2295 'mode' => 'responsive',
2296 'label' => esc_html__( 'Arrow Width', 'shopbuilder' ),
2297 'range' => [
2298 'px' => [
2299 'min' => 1,
2300 'max' => 100,
2301 'step' => 1,
2302 ],
2303 ],
2304 'condition' => $arrow_condition,
2305 'selectors' => $selectors['arrow_width'],
2306 ];
2307
2308 $extra_controls['slider_buttons_arrow_height'] = [
2309 'type' => 'slider',
2310 'mode' => 'responsive',
2311 'label' => esc_html__( 'Arrow Height', 'shopbuilder' ),
2312 'range' => [
2313 'px' => [
2314 'min' => 1,
2315 'max' => 100,
2316 'step' => 1,
2317 ],
2318 ],
2319 'condition' => $arrow_condition,
2320 'selectors' => $selectors['arrow_height'],
2321 ];
2322
2323 $extra_controls['slider_buttons_arrow_line_height'] = [
2324 'type' => 'slider',
2325 'mode' => 'responsive',
2326 'label' => esc_html__( 'Arrow Line Height', 'shopbuilder' ),
2327 'range' => [
2328 'px' => [
2329 'min' => 1,
2330 'max' => 100,
2331 'step' => 1,
2332 ],
2333 ],
2334 'condition' => $arrow_condition,
2335 'selectors' => $selectors['arrow_line_height'],
2336 ];
2337
2338 $extra_controls['slider_buttons_dot_size_note'] = $obj->el_heading(
2339 esc_html__( 'Dot Size (px)', 'shopbuilder' ),
2340 'before',
2341 [],
2342 $dot_condition
2343 );
2344
2345 $extra_controls['slider_buttons_dot_width'] = [
2346 'type' => 'slider',
2347 'mode' => 'responsive',
2348 'label' => esc_html__( 'Dot Width', 'shopbuilder' ),
2349 'range' => [
2350 'px' => [
2351 'min' => 1,
2352 'max' => 100,
2353 'step' => 1,
2354 ],
2355 ],
2356 'selectors' => $selectors['dot_width'],
2357 'condition' => $dot_condition,
2358 ];
2359
2360 $extra_controls['slider_buttons_dot_height'] = [
2361 'type' => 'slider',
2362 'mode' => 'responsive',
2363 'label' => esc_html__( 'Dot Height', 'shopbuilder' ),
2364 'range' => [
2365 'px' => [
2366 'min' => 1,
2367 'max' => 100,
2368 'step' => 1,
2369 ],
2370 ],
2371 'selectors' => $selectors['dot_height'],
2372 'condition' => $dot_condition,
2373 ];
2374
2375 $extra_controls['slider_buttons_dot_spacing'] = [
2376 'type' => 'slider',
2377 'mode' => 'responsive',
2378 'label' => esc_html__( 'Dot Spacing', 'shopbuilder' ),
2379 'range' => [
2380 'px' => [
2381 'min' => 1,
2382 'max' => 100,
2383 'step' => 1,
2384 ],
2385 ],
2386 'selectors' => $selectors['dot_spacing'],
2387 'condition' => $dot_condition,
2388 ];
2389
2390 $fields = Fns::insert_controls( 'slider_buttons_typo_note', $fields, $extra_controls, true );
2391
2392 $extra_controls['slider_buttons_active_color_tab'] = $obj->start_tab( esc_html__( 'Dot', 'shopbuilder' ) );
2393
2394 $extra_controls['slider_buttons_active_color'] = [
2395 'type' => 'color',
2396 'label' => esc_html__( 'Dot Color', 'shopbuilder' ),
2397 'selectors' => $selectors['dot_color'],
2398 ];
2399
2400 $extra_controls['slider_buttons_active_bg_color'] = [
2401 'type' => 'color',
2402 'label' => esc_html__( 'Dot Active Color', 'shopbuilder' ),
2403 'selectors' => $selectors['dot_active_color'],
2404 ];
2405
2406 $extra_controls['slider_buttons_active_color_tab_end'] = $obj->end_tab();
2407
2408 $fields = Fns::insert_controls( 'slider_buttons_hover_color_tab_end', $fields, $extra_controls, true );
2409
2410 $extra_controls['slider_buttons_border_active_color'] = [
2411 'type' => 'color',
2412 'label' => esc_html__( 'Active Color', 'shopbuilder' ),
2413 'condition' => [ 'rtsb_el_slider_buttons_border_border!' => [ '' ] ],
2414 'selectors' => $selectors['active_border_color'],
2415 ];
2416
2417 $extra_controls['slider_buttons_buttons_radius'] = [
2418 'mode' => 'responsive',
2419 'type' => 'dimensions',
2420 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
2421 'size_units' => [ 'px', '%', 'em' ],
2422 'selectors' => $selectors['border_radius'],
2423 ];
2424
2425 $fields = Fns::insert_controls( 'slider_buttons_border_hover_color', $fields, $extra_controls, true );
2426
2427 $extra_controls['slider_buttons_wrapper_padding'] = [
2428 'mode' => 'responsive',
2429 'type' => 'dimensions',
2430 'label' => esc_html__( 'Wrapper Margin', 'shopbuilder' ),
2431 'size_units' => [ 'px', '%', 'em' ],
2432 'selectors' => $selectors['wrapper_padding'],
2433 ];
2434
2435 $fields = Fns::insert_controls( 'slider_buttons_spacing_note', $fields, $extra_controls, true );
2436
2437 return apply_filters( 'rtsb/elements/elementor/slider_buttons_style_control', $fields, $obj );
2438 }
2439
2440 /**
2441 * Not Found Notice Section
2442 *
2443 * @param object $obj Reference object.
2444 *
2445 * @return array
2446 */
2447 public static function not_found_notice( $obj ): array {
2448 $css_selectors = $obj->selectors['not_found_notice'];
2449 $title = esc_html__( 'Not Found Notice', 'shopbuilder' );
2450 $selectors = [
2451 'typography' => $css_selectors['typography'],
2452 'alignment' => [ $css_selectors['alignment'] => 'text-align: {{VALUE}}; justify-content: {{VALUE}};' ],
2453 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
2454 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
2455 'border' => $css_selectors['border'],
2456 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2457 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
2458 ];
2459
2460 $fields = ControlHelper::general_elementor_style( 'not_found_notice', $title, $obj, [], $selectors );
2461
2462 unset(
2463 $fields['not_found_notice_color_tabs'],
2464 $fields['not_found_notice_color_tab'],
2465 $fields['not_found_notice_color_tab_end'],
2466 $fields['not_found_notice_hover_color_tab'],
2467 $fields['not_found_notice_hover_color'],
2468 $fields['not_found_notice_hover_bg_color'],
2469 $fields['not_found_notice_hover_color_tab_end'],
2470 $fields['not_found_notice_color_tabs_end'],
2471 $fields['not_found_notice_border_hover_color']
2472 );
2473
2474 return $fields;
2475 }
2476
2477 /**
2478 * Title Selectors.
2479 *
2480 * @param array $selectors Selector array.
2481 *
2482 * @return array
2483 */
2484 public static function title_selectors( $selectors ): array {
2485 return [
2486 'typography' => $selectors['typography'],
2487 'alignment' => [ $selectors['alignment'] => 'text-align: {{VALUE}};' ],
2488 'color' => [ $selectors['color'] => 'color: {{VALUE}};' ],
2489 'bg_color' => [ $selectors['bg_color'] => 'background-color: {{VALUE}};' ],
2490 'hover_color' => [ $selectors['hover_color'] => 'color: {{VALUE}};' ],
2491 'hover_bg_color' => [ $selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
2492 'border' => $selectors['border'],
2493 'border_hover_color' => [ $selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
2494 'padding' => [ $selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2495 'margin' => [ $selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
2496 ];
2497 }
2498
2499 /**
2500 * Excerpt Selectors.
2501 *
2502 * @param array $selectors Selector array.
2503 *
2504 * @return array
2505 */
2506 private static function excerpt_selectors( $selectors ): array {
2507 return [
2508 'typography' => $selectors['typography'],
2509 'alignment' => [ $selectors['alignment'] => 'text-align: {{VALUE}};' ],
2510 'color' => [ $selectors['color'] => 'color: {{VALUE}};' ],
2511 'bg_color' => [ $selectors['bg_color'] => 'background-color: {{VALUE}};' ],
2512 'border' => $selectors['border'],
2513 'padding' => [ $selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2514 'margin' => [ $selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2515 ];
2516 }
2517
2518 /**
2519 * Action Button Selectors.
2520 *
2521 * @param array $selectors Selector array.
2522 *
2523 * @return array
2524 */
2525 public static function action_btn_selectors( $selectors ): array {
2526 return [
2527 'icon_size' => [
2528 $selectors['icon_size']['font_size'] => 'font-size: {{SIZE}}{{UNIT}} !important;',
2529 $selectors['icon_size']['width'] => 'width: {{SIZE}}{{UNIT}} !important;',
2530 ],
2531 'width' => [ $selectors['width'] => 'width: {{SIZE}}{{UNIT}} !important;' ],
2532 'height' => [ $selectors['height'] => 'height: {{SIZE}}{{UNIT}} !important;' ],
2533 'color' => [ $selectors['color'] => 'color: {{VALUE}};' ],
2534 'bg_color' => [ $selectors['bg_color'] => 'background-color: {{VALUE}} !important;' ],
2535 'hover_color' => [ $selectors['hover_color'] => 'color: {{VALUE}};' ],
2536 'hover_bg_color' => [ $selectors['hover_bg_color'] => 'background-color: {{VALUE}} !important;' ],
2537 'border' => $selectors['border'],
2538 'border_hover_color' => [ $selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
2539 'border_radius' => [ $selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
2540 'padding' => [ $selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
2541 'margin' => [ $selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2542 ];
2543 }
2544 }
2545