PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.3.0
ShopBuilder – WooCommerce Builder For Elementor v3.3.0
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 3.3.0, at app/Elementor/Widgets/Controls/StyleFields.php

2,585 lines 91.9 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 'regular_text_decoration' => $css_selectors['regular_text_decoration'],
497 'sale_text_decoration' => $css_selectors['sale_text_decoration'],
498 'alignment' => [ $css_selectors['alignment'] => 'text-align: {{VALUE}};' ],
499 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
500 'regular_color' => [ $css_selectors['regular_color'] => 'color: {{VALUE}};' ],
501 'crossed_regular_color' => [ $css_selectors['crossed_regular_color'] => 'color: {{VALUE}};' ],
502 'border' => $css_selectors['border'],
503 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
504 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
505 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
506 ];
507
508 $fields = ControlHelper::general_elementor_style( 'product_price', $title, $obj, $condition, $selectors );
509
510 unset(
511 $fields['product_price_color_tabs'],
512 $fields['product_price_color_tab'],
513 $fields['product_price_color_tab_end'],
514 $fields['product_price_hover_color_tab'],
515 $fields['product_price_hover_color'],
516 $fields['product_price_hover_bg_color'],
517 $fields['product_price_hover_color_tab_end'],
518 $fields['product_price_color_tabs_end'],
519 $fields['product_price_border_hover_color']
520 );
521
522 $fields['rtsb_el_product_price_typography']['label'] = esc_html__( 'Regular Price Typography', 'shopbuilder' );
523 $fields['product_price_color']['label'] = esc_html__( 'Sale Price Color', 'shopbuilder' );
524 $fields['product_price_bg_color']['label'] = esc_html__( 'Regular Price Color', 'shopbuilder' );
525 $fields['product_price_bg_color']['selectors'] = $selectors['regular_color'];
526
527 // Scope text-decoration narrowly so "Regular Price" decoration does not bleed onto
528 // the sale price via the shared `.price-wrapper` parent (cascades visually across all
529 // inline text). Other typography props keep the original wider selector.
530 $fields['rtsb_el_product_price_typography']['fields_options'] = [
531 'text_decoration' => [
532 'selectors' => [
533 $selectors['regular_text_decoration'] => 'text-decoration: {{VALUE}};',
534 ],
535 ],
536 ];
537
538 $extra_controls['rtsb_el_product_sale_price_typography'] = [
539 'mode' => 'group',
540 'type' => 'typography',
541 'label' => esc_html__( 'Sale Price Typography', 'shopbuilder' ),
542 'selector' => $selectors['sale_typography'],
543 'fields_options' => [
544 'text_decoration' => [
545 'selectors' => [
546 $selectors['sale_text_decoration'] => 'text-decoration: {{VALUE}};',
547 ],
548 ],
549 ],
550 ];
551
552 $fields = Fns::insert_controls( 'rtsb_el_product_price_typography', $fields, $extra_controls );
553
554 $extra_controls['crossed_regular_color'] = [
555 'type' => 'color',
556 'label' => esc_html__( 'Crossed Out Regular Price Color', 'shopbuilder' ),
557 'selectors' => ! empty( $selectors['crossed_regular_color'] ) ? $selectors['crossed_regular_color'] : [],
558 ];
559
560 $fields = Fns::insert_controls( 'product_price_border_note', $fields, $extra_controls );
561
562 return apply_filters( 'rtsb/elements/elementor/price_style_control', $fields, $obj );
563 }
564
565 /**
566 * Product Rating Section
567 *
568 * @param object $obj Reference object.
569 *
570 * @return array
571 */
572 public static function product_rating( $obj ): array {
573 $css_selectors = $obj->selectors['product_rating'];
574 $title = esc_html__( 'Product Rating', 'shopbuilder' );
575 $condition = [
576 'show_rating' => [ 'yes' ],
577 ];
578 $selectors = [
579 'typography' => [ $css_selectors['typography'] => 'font-size: {{SIZE}}{{UNIT}};' ],
580 'alignment' => [ $css_selectors['alignment'] => 'justify-content: {{VALUE}};' ],
581 'color' => [ $css_selectors['color'] => 'color: {{VALUE}} !important;' ],
582 'bg_color' => [ $css_selectors['bg_color'] => 'color: {{VALUE}} !important;' ],
583 'padding' => [ $css_selectors['padding'] => 'letter-spacing: {{SIZE}}{{UNIT}};' ],
584 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
585 ];
586
587 $fields = ControlHelper::general_elementor_style( 'product_rating', $title, $obj, $condition, $selectors );
588
589 unset(
590 $fields['product_rating_color_tabs'],
591 $fields['product_rating_color_tab'],
592 $fields['product_rating_color_tab_end'],
593 $fields['product_rating_hover_color_tab'],
594 $fields['product_rating_hover_color'],
595 $fields['product_rating_hover_bg_color'],
596 $fields['product_rating_hover_color_tab_end'],
597 $fields['product_rating_color_tabs_end'],
598 $fields['product_rating_border_note'],
599 $fields['rtsb_el_product_rating_border'],
600 $fields['product_rating_border_hover_color']
601 );
602
603 $fields['rtsb_el_product_rating_typography'] = [
604 'type' => 'slider',
605 'mode' => 'responsive',
606 'label' => esc_html__( 'Star Size', 'shopbuilder' ),
607 'size_units' => [ 'px' ],
608 'range' => [
609 'px' => [
610 'min' => 0,
611 'max' => 100,
612 ],
613 ],
614 'selectors' => $selectors['typography'],
615 ];
616
617 $fields['product_rating_bg_color']['label'] = esc_html__( 'Star Border Color', 'shopbuilder' );
618
619 $fields['product_rating_padding'] = [
620 'type' => 'slider',
621 'mode' => 'responsive',
622 'label' => esc_html__( 'Spacing', 'shopbuilder' ),
623 'size_units' => [ 'px' ],
624 'range' => [
625 'px' => [
626 'min' => -10,
627 'max' => 50,
628 ],
629 ],
630 'default' => [
631 'unit' => 'px',
632 'size' => 3,
633 ],
634 'selectors' => $selectors['padding'],
635 ];
636
637 return apply_filters( 'rtsb/elements/elementor/rating_style_control', $fields, $obj );
638 }
639
640 /**
641 * Product Badges Section
642 *
643 * @param object $obj Reference object.
644 *
645 * @return array
646 */
647 public static function product_badges( $obj ): array {
648 $css_selectors = $obj->selectors['product_badges'];
649 $title = esc_html__( 'Badges', 'shopbuilder' );
650 $condition = [
651 'show_badges' => [ 'yes' ],
652 'layout!' => [ 'category-layout1', 'category-layout2' ],
653 ];
654 $selectors = [
655 'typography' => $css_selectors['typography'],
656 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
657 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
658 'border_color' => [ $css_selectors['border_color'] => 'border-color: {{VALUE}};' ],
659 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
660 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
661 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
662 'position_x' => [ $css_selectors['position_x'] => 'left: {{SIZE}}{{UNIT}};' ],
663 'position_x_right' => [ $css_selectors['position_x'] => 'right: {{SIZE}}{{UNIT}}; left: auto;' ],
664 'position_y' => [ $css_selectors['position_y'] => 'top: {{SIZE}}{{UNIT}};' ],
665 'position_y_bottom' => [ $css_selectors['position_y'] => 'bottom: {{SIZE}}{{UNIT}}; top:auto;' ],
666 ];
667
668 $fields = ControlHelper::general_elementor_style( 'badges', $title, $obj, $condition, $selectors );
669
670 unset(
671 $fields['badges_alignment'],
672 $fields['badges_color_tabs'],
673 $fields['badges_color_tab'],
674 $fields['badges_color_tab_end'],
675 $fields['badges_hover_color_tab'],
676 $fields['badges_hover_color'],
677 $fields['badges_hover_bg_color'],
678 $fields['badges_hover_color_tab_end'],
679 $fields['badges_color_tabs_end'],
680 $fields['badges_border_note'],
681 $fields['rtsb_el_badges_border'],
682 $fields['badges_border_hover_color']
683 );
684
685 $fields['badges_alignment']['label'] = esc_html__( 'Horizontal Alignment', 'shopbuilder' );
686
687 $extra_controls = [];
688
689 $extra_controls['badges_alignment'] = [
690 'type' => 'select2',
691 'label' => esc_html__( 'Horizontal Alignment', 'shopbuilder' ),
692 'options' => [
693 'left' => esc_html__( 'Left', 'shopbuilder' ),
694 'center' => esc_html__( 'Center', 'shopbuilder' ),
695 'right' => esc_html__( 'Right', 'shopbuilder' ),
696 ],
697 'label_block' => true,
698 'default' => 'left',
699 ];
700
701 $extra_controls['badges_position'] = [
702 'type' => 'select2',
703 'label' => esc_html__( 'Vertical Alignment', 'shopbuilder' ),
704 'options' => [
705 'top' => esc_html__( 'Top', 'shopbuilder' ),
706 'middle' => esc_html__( 'Middle', 'shopbuilder' ),
707 'bottom' => esc_html__( 'Bottom', 'shopbuilder' ),
708 ],
709 'label_block' => true,
710 'default' => 'top',
711 ];
712
713 $extra_controls['badge_x_position'] = [
714 'type' => 'slider',
715 'mode' => 'responsive',
716 'label' => esc_html__( 'Position Offset (Horizontal)', 'shopbuilder' ),
717 'size_units' => [ 'px', '%' ],
718 'range' => [
719 'px' => [
720 'min' => 0,
721 'max' => 300,
722 'step' => 1,
723 ],
724 '%' => [
725 'min' => 0,
726 'max' => 100,
727 'step' => 1,
728 ],
729 ],
730 'condition' => [
731 'badges_alignment' => 'left',
732 'badges_alignment!' => 'center',
733 ],
734 'selectors' => $selectors['position_x'],
735 ];
736
737 $extra_controls['badge_x_position_right'] = [
738 'type' => 'slider',
739 'mode' => 'responsive',
740 'label' => esc_html__( 'Position Offset (Horizontal)', 'shopbuilder' ),
741 'size_units' => [ 'px', '%' ],
742 'range' => [
743 'px' => [
744 'min' => 0,
745 'max' => 300,
746 'step' => 1,
747 ],
748 '%' => [
749 'min' => 0,
750 'max' => 100,
751 'step' => 1,
752 ],
753 ],
754 'condition' => [ 'badges_alignment' => 'right' ],
755 'selectors' => $selectors['position_x_right'],
756 ];
757
758 $extra_controls['badge_y_position'] = [
759 'type' => 'slider',
760 'mode' => 'responsive',
761 'label' => esc_html__( 'Position Offset (Vertical)', 'shopbuilder' ),
762 'size_units' => [ 'px', '%' ],
763 'range' => [
764 'px' => [
765 'min' => 0,
766 'max' => 300,
767 'step' => 1,
768 ],
769 '%' => [
770 'min' => 0,
771 'max' => 100,
772 'step' => 1,
773 ],
774 ],
775 'condition' => [
776 'badges_position' => 'top',
777 'badges_position!' => 'center',
778 ],
779 'selectors' => $selectors['position_y'],
780 ];
781
782 $extra_controls['badge_y_position_bottom'] = [
783 'type' => 'slider',
784 'mode' => 'responsive',
785 'label' => esc_html__( 'Position Offset (Vertical)', 'shopbuilder' ),
786 'size_units' => [ 'px', '%' ],
787 'range' => [
788 'px' => [
789 'min' => 0,
790 'max' => 300,
791 'step' => 1,
792 ],
793 '%' => [
794 'min' => 0,
795 'max' => 100,
796 'step' => 1,
797 ],
798 ],
799 'condition' => [
800 'badges_position' => 'bottom',
801 'badges_position!' => 'center',
802 ],
803 'selectors' => $selectors['position_y_bottom'],
804 ];
805
806 $fields = Fns::insert_controls( 'badges_color_note', $fields, $extra_controls );
807
808 $extra_controls['badges_border_color'] = [
809 'type' => 'color',
810 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
811 'selectors' => ! empty( $selectors['border_color'] ) ? $selectors['border_color'] : [],
812 ];
813
814 $extra_controls['badges_border_radius'] = [
815 'mode' => 'responsive',
816 'type' => 'dimensions',
817 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
818 'size_units' => [ 'px', '%', 'em' ],
819 'selectors' => $selectors['border_radius'],
820 ];
821
822 $fields = Fns::insert_controls( 'badges_bg_color', $fields, $extra_controls, true );
823
824 return apply_filters( 'rtsb/elements/elementor/badges_style_control', $fields, $obj );
825 }
826
827 /**
828 * Product Categories Section
829 *
830 * @param object $obj Reference object.
831 *
832 * @return array
833 */
834 public static function product_categories( $obj ): array {
835 $css_selectors = $obj->selectors['product_categories'];
836 $title = esc_html__( 'Product Categories', 'shopbuilder' );
837 $condition = [
838 'show_categories' => [ 'yes' ],
839 ];
840 $selectors = [
841 'typography' => $css_selectors['typography'],
842 'alignment' => [ $css_selectors['alignment'] => 'justify-content: {{VALUE}};' ],
843 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
844 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
845 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
846 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
847 'border' => $css_selectors['typography'],
848 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
849 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
850 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
851 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
852 'wrapper_margin' => [ $css_selectors['wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
853 ];
854
855 $fields = ControlHelper::general_elementor_style( 'product_categories', $title, $obj, $condition, $selectors );
856
857 // Force text-decoration with !important so the widget setting beats the framework-wide
858 // `.rtsb-elementor-container a { text-decoration: none !important; }` reset. That reset
859 // is intentionally kept to shield category links from theme link styles.
860 $fields['rtsb_el_product_categories_typography']['fields_options'] = [
861 'text_decoration' => [
862 'selectors' => [
863 $css_selectors['typography'] => 'text-decoration: {{VALUE}} !important;',
864 ],
865 ],
866 ];
867
868 $fields['product_categories_alignment']['options'] = [
869 'flex-start' => [
870 'title' => esc_html__( 'Left', 'shopbuilder' ),
871 'icon' => 'eicon-text-align-left',
872 ],
873 'center' => [
874 'title' => esc_html__( 'Center', 'shopbuilder' ),
875 'icon' => 'eicon-text-align-center',
876 ],
877 'flex-end' => [
878 'title' => esc_html__( 'Right', 'shopbuilder' ),
879 'icon' => 'eicon-text-align-right',
880 ],
881 ];
882
883 $extra_controls = [];
884
885 $extra_controls['product_categories_radius'] = [
886 'mode' => 'responsive',
887 'type' => 'dimensions',
888 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
889 'size_units' => [ 'px', '%', 'em' ],
890 'selectors' => $selectors['border_radius'],
891 ];
892
893 $fields = Fns::insert_controls( 'product_categories_border_hover_color', $fields, $extra_controls, true );
894
895 $extra_controls['product_categories_wrapper_margin'] = [
896 'mode' => 'responsive',
897 'type' => 'dimensions',
898 'label' => esc_html__( 'Wrapper Margin', 'shopbuilder' ),
899 'size_units' => [ 'px', '%', 'em' ],
900 'selectors' => $selectors['wrapper_margin'],
901 ];
902
903 $fields = Fns::insert_controls( 'product_categories_margin', $fields, $extra_controls, true );
904
905 return apply_filters( 'rtsb/elements/elementor/categories_style_control', $fields, $obj );
906 }
907
908 /**
909 * Product Categories Section
910 *
911 * @param object $obj Reference object.
912 *
913 * @return array
914 */
915 public static function product_brands( $obj ): array {
916 $css_selectors = $obj->selectors['product_brands'];
917 $title = esc_html__( 'Product Brands', 'shopbuilder' );
918 $condition = [
919 'show_brands' => [ 'yes' ],
920 ];
921 $selectors = [
922 'typography' => $css_selectors['typography'],
923 'alignment' => [ $css_selectors['alignment'] => 'justify-content: {{VALUE}};' ],
924 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
925 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
926 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
927 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
928 'border' => $css_selectors['typography'],
929 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
930 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
931 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
932 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
933 'wrapper_margin' => [ $css_selectors['wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
934 ];
935
936 $fields = ControlHelper::general_elementor_style( 'product_brands', $title, $obj, $condition, $selectors );
937
938 // Force text-decoration with !important so the widget setting beats the framework-wide
939 // `.rtsb-elementor-container a { text-decoration: none !important; }` reset. That reset
940 // is intentionally kept to shield brand markup from theme link styles.
941 $fields['rtsb_el_product_brands_typography']['fields_options'] = [
942 'text_decoration' => [
943 'selectors' => [
944 $css_selectors['typography'] => 'text-decoration: {{VALUE}} !important;',
945 ],
946 ],
947 ];
948
949 $fields['product_brands_alignment']['options'] = [
950 'flex-start' => [
951 'title' => esc_html__( 'Left', 'shopbuilder' ),
952 'icon' => 'eicon-text-align-left',
953 ],
954 'center' => [
955 'title' => esc_html__( 'Center', 'shopbuilder' ),
956 'icon' => 'eicon-text-align-center',
957 ],
958 'flex-end' => [
959 'title' => esc_html__( 'Right', 'shopbuilder' ),
960 'icon' => 'eicon-text-align-right',
961 ],
962 ];
963
964 $extra_controls = [];
965
966 $extra_controls['product_brands_radius'] = [
967 'mode' => 'responsive',
968 'type' => 'dimensions',
969 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
970 'size_units' => [ 'px', '%', 'em' ],
971 'selectors' => $selectors['border_radius'],
972 ];
973
974 $fields = Fns::insert_controls( 'product_brands_border_hover_color', $fields, $extra_controls, true );
975
976 $extra_controls['product_brands_wrapper_margin'] = [
977 'mode' => 'responsive',
978 'type' => 'dimensions',
979 'label' => esc_html__( 'Wrapper Margin', 'shopbuilder' ),
980 'size_units' => [ 'px', '%', 'em' ],
981 'selectors' => $selectors['wrapper_margin'],
982 ];
983
984 $fields = Fns::insert_controls( 'product_brands_margin', $fields, $extra_controls, true );
985
986 return apply_filters( 'rtsb/elements/elementor/brands_style_control', $fields, $obj );
987 }
988
989 /**
990 * Image Section
991 *
992 * @param object $obj Reference object.
993 * @param array $conditions Conditions.
994 *
995 * @return array
996 */
997 public static function image( $obj, $conditions ): array {
998 $css_selectors = $obj->selectors['image'];
999 $title = esc_html__( 'Image Styles', 'shopbuilder' );
1000 $selectors = [
1001 'overlay' => $css_selectors['overlay'],
1002 'hover_overlay' => $css_selectors['hover_overlay'],
1003 'border' => $css_selectors['border'],
1004 'width' => [ $css_selectors['width'] => 'width: {{SIZE}}{{UNIT}};' ],
1005 'img_bg_color' => [ $css_selectors['img_bg_color'] => 'background-color: {{VALUE}};' ],
1006 'img_wrapper_bg_color' => [ $css_selectors['img_wrapper_bg_color'] => 'background-color: {{VALUE}};' ],
1007 'max_width' => [ $css_selectors['max_width'] => 'max-width: {{SIZE}}{{UNIT}};' ],
1008 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1009 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
1010 ];
1011
1012 $fields = ControlHelper::general_elementor_style( 'image_styles', $title, $obj, [], $selectors, $conditions );
1013
1014 unset(
1015 $fields['rtsb_el_image_styles_typography'],
1016 $fields['image_styles_alignment'],
1017 $fields['image_styles_color_tabs'],
1018 $fields['image_styles_color_tab'],
1019 $fields['image_styles_color_note'],
1020 $fields['image_styles_color'],
1021 $fields['image_styles_bg_color'],
1022 $fields['image_styles_color_tab_end'],
1023 $fields['image_styles_hover_color_tab'],
1024 $fields['image_styles_hover_color'],
1025 $fields['image_styles_hover_bg_color'],
1026 $fields['image_styles_hover_color_tab_end'],
1027 $fields['image_styles_color_tabs_end'],
1028 $fields['image_styles_border_hover_color'],
1029 $fields['image_styles_padding']
1030 );
1031
1032 $fields['image_styles_typo_note']['raw'] = sprintf(
1033 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
1034 esc_html__( 'Overlay', 'shopbuilder' )
1035 );
1036 $fields['image_styles_border_note']['separator'] = 'before-short';
1037 $fields['image_styles_typo_note']['separator'] = 'before';
1038 $fields['image_styles_typo_note']['condition'] = [ 'show_overlay' => [ 'yes' ] ];
1039
1040 $extra_controls = [];
1041
1042 $extra_controls['image_styles_dimension_note'] = $obj->el_heading( esc_html__( 'Dimension', 'shopbuilder' ) );
1043
1044 $extra_controls['image_styles_width'] = [
1045 'type' => 'slider',
1046 'label' => esc_html__( 'Image Width', 'shopbuilder' ),
1047 'size_units' => [ '%', 'px' ],
1048 'range' => [
1049 '%' => [
1050 'min' => 0,
1051 'max' => 100,
1052 'step' => 1,
1053 ],
1054 'px' => [
1055 'min' => 0,
1056 'max' => 500,
1057 'step' => 1,
1058 ],
1059 ],
1060 'selectors' => $selectors['width'],
1061 ];
1062
1063 $extra_controls['image_styles_max_width'] = [
1064 'type' => 'slider',
1065 'label' => esc_html__( 'Image Max-Width', 'shopbuilder' ),
1066 'size_units' => [ '%', 'px' ],
1067 'range' => [
1068 '%' => [
1069 'min' => 0,
1070 'max' => 100,
1071 'step' => 1,
1072 ],
1073 'px' => [
1074 'min' => 0,
1075 'max' => 500,
1076 'step' => 1,
1077 ],
1078
1079 ],
1080 'selectors' => $selectors['max_width'],
1081 ];
1082
1083 $extra_controls['image_styles_color_note'] = $obj->el_heading( esc_html__( 'Colors', 'shopbuilder' ), 'before' );
1084
1085 $extra_controls['image_styles_color'] = [
1086 'type' => 'color',
1087 'label' => esc_html__( 'Image Background Color', 'shopbuilder' ),
1088 'selectors' => $selectors['img_bg_color'],
1089 ];
1090
1091 $extra_controls['image_wrapper_styles_color'] = [
1092 'type' => 'color',
1093 'label' => esc_html__( 'Wrapper Background Color', 'shopbuilder' ),
1094 'selectors' => $selectors['img_wrapper_bg_color'],
1095 ];
1096
1097 $fields = Fns::insert_controls( 'image_styles_typo_note', $fields, $extra_controls );
1098
1099 $extra_controls['rtsb_el_image_styles_overlay'] = [
1100 'mode' => 'group',
1101 'type' => 'background',
1102 'label' => esc_html__( 'Image Overlay', 'shopbuilder' ),
1103 'types' => [ 'classic', 'gradient' ],
1104 'exclude' => [ 'image' ], // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
1105 'fields_options' => [
1106 'background' => [
1107 'label' => esc_html__( 'Overlay Background Type', 'shopbuilder' ),
1108 ],
1109 'color' => [
1110 'label' => 'Background',
1111 ],
1112 'color_b' => [
1113 'label' => 'Background 2',
1114 ],
1115 ],
1116 'selector' => $selectors['overlay'],
1117 'condition' => [
1118 'show_overlay' => [ 'yes' ],
1119 ],
1120 ];
1121
1122 $extra_controls['rtsb_el_image_styles_hover_overlay'] = [
1123 'mode' => 'group',
1124 'type' => 'background',
1125 'label' => esc_html__( 'Hover Image Overlay', 'shopbuilder' ),
1126 'types' => [ 'classic', 'gradient' ],
1127 'exclude' => [ 'image' ], // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
1128 'fields_options' => [
1129 'background' => [
1130 'label' => esc_html__( 'Hover Overlay Background Type', 'shopbuilder' ),
1131 ],
1132 'color' => [
1133 'label' => 'Hover Background',
1134 ],
1135 'color_b' => [
1136 'label' => 'Hover Background 2',
1137 ],
1138 ],
1139 'selector' => $selectors['hover_overlay'],
1140 'condition' => [
1141 'show_overlay' => [ 'yes' ],
1142 ],
1143 ];
1144
1145 $fields = Fns::insert_controls( 'image_styles_typo_note', $fields, $extra_controls, true );
1146
1147 $extra_controls['image_styles_radius'] = [
1148 'mode' => 'responsive',
1149 'type' => 'dimensions',
1150 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1151 'size_units' => [ 'px', '%', 'em' ],
1152 'selectors' => $selectors['border_radius'],
1153 ];
1154
1155 $fields = Fns::insert_controls( 'rtsb_el_image_styles_border', $fields, $extra_controls, true );
1156
1157 return apply_filters( 'rtsb/elements/elementor/image_style_control', $fields, $obj );
1158 }
1159
1160 /**
1161 * Product Image Section
1162 *
1163 * @param object $obj Reference object.
1164 *
1165 * @return array
1166 */
1167 public static function product_image( $obj ): array {
1168 $conditions = [
1169 'relation' => 'and',
1170 'terms' => [
1171 [
1172 'relation' => 'or',
1173 'terms' => [
1174 [
1175 'name' => 'show_featured_image',
1176 'operator' => '==',
1177 'value' => 'yes',
1178 ],
1179 ],
1180 ],
1181 ],
1182 ];
1183
1184 return self::image( $obj, $conditions );
1185 }
1186
1187 /**
1188 * Category Image Section
1189 *
1190 * @param object $obj Reference object.
1191 *
1192 * @return array
1193 */
1194 public static function category_image( $obj ): array {
1195 $conditions = [
1196 'relation' => 'and',
1197 'terms' => [
1198 [
1199 'relation' => 'or',
1200 'terms' => [
1201 [
1202 'name' => 'show_cat_image',
1203 'operator' => '==',
1204 'value' => 'yes',
1205 ],
1206 [
1207 'name' => 'show_custom_image',
1208 'operator' => '==',
1209 'value' => 'yes',
1210 ],
1211 ],
1212 ],
1213 ],
1214 ];
1215
1216 return self::image( $obj, $conditions );
1217 }
1218
1219 /**
1220 * Pagination Section
1221 *
1222 * @param object $obj Reference object.
1223 *
1224 * @return array
1225 */
1226 public static function pagination( $obj ): array {
1227 $css_selectors = $obj->selectors['pagination'];
1228 $title = esc_html__( 'Pagination Buttons', 'shopbuilder' );
1229 $condition = [ 'show_pagination' => [ 'yes' ] ];
1230 $selectors = [
1231 'typography' => $css_selectors['typography'],
1232 'alignment' => [ $css_selectors['alignment'] => 'justify-content: {{VALUE}};' ],
1233 'width' => [ $css_selectors['width'] => 'width: {{SIZE}}{{UNIT}};' ],
1234 'height' => [ $css_selectors['height'] => 'height: {{SIZE}}{{UNIT}};' ],
1235 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
1236 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
1237 'active_color' => [ $css_selectors['active_color'] => 'color: {{VALUE}};' ],
1238 'active_bg_color' => [ $css_selectors['active_bg_color'] => 'background-color: {{VALUE}};' ],
1239 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
1240 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
1241 'border' => $css_selectors['border'],
1242 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
1243 'border_active_color' => [ $css_selectors['border_active_color'] => 'border-color: {{VALUE}};' ],
1244 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1245 'spacing' => [ $css_selectors['spacing'] => 'gap: {{SIZE}}{{UNIT}};' ],
1246 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1247 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1248 ];
1249
1250 $fields = ControlHelper::general_elementor_style( 'pagination_buttons', $title, $obj, $condition, $selectors );
1251
1252 unset( $fields['pagination_buttons_padding'] );
1253
1254 $fields['pagination_buttons_alignment']['options'] = [
1255 'flex-start' => [
1256 'title' => esc_html__( 'Left', 'shopbuilder' ),
1257 'icon' => 'eicon-text-align-left',
1258 ],
1259 'center' => [
1260 'title' => esc_html__( 'Center', 'shopbuilder' ),
1261 'icon' => 'eicon-text-align-center',
1262 ],
1263 'flex-end' => [
1264 'title' => esc_html__( 'Right', 'shopbuilder' ),
1265 'icon' => 'eicon-text-align-right',
1266 ],
1267 ];
1268
1269 $extra_controls = [];
1270
1271 $extra_controls['pagination_buttons_width'] = [
1272 'type' => 'slider',
1273 'mode' => 'responsive',
1274 'label' => esc_html__( 'Width', 'shopbuilder' ),
1275 'size_units' => [ 'px' ],
1276 'range' => [
1277 'px' => [
1278 'min' => 0,
1279 'max' => 100,
1280 ],
1281 ],
1282 'selectors' => $selectors['width'],
1283 ];
1284
1285 $extra_controls['pagination_buttons_height'] = [
1286 'type' => 'slider',
1287 'mode' => 'responsive',
1288 'label' => esc_html__( 'Height', 'shopbuilder' ),
1289 'size_units' => [ 'px' ],
1290 'range' => [
1291 'px' => [
1292 'min' => 0,
1293 'max' => 100,
1294 ],
1295 ],
1296 'selectors' => $selectors['height'],
1297 ];
1298
1299 $fields = Fns::insert_controls( 'pagination_buttons_color_note', $fields, $extra_controls );
1300
1301 $extra_controls['pagination_buttons_active_color'] = [
1302 'type' => 'color',
1303 'label' => esc_html__( 'Active Color', 'shopbuilder' ),
1304 'selectors' => $selectors['active_color'],
1305 'condition' => [
1306 'pagination_type!' => 'load_more',
1307 ],
1308 ];
1309
1310 $extra_controls['pagination_buttons_active_bg_color'] = [
1311 'type' => 'color',
1312 'label' => esc_html__( 'Active Background Color', 'shopbuilder' ),
1313 'selectors' => $selectors['active_bg_color'],
1314 'condition' => [
1315 'pagination_type!' => 'load_more',
1316 ],
1317 ];
1318
1319 $fields = Fns::insert_controls( 'pagination_buttons_bg_color', $fields, $extra_controls, true );
1320
1321 $extra_controls['pagination_buttons_active_border_color'] = [
1322 'type' => 'color',
1323 'label' => esc_html__( 'Active Border Color', 'shopbuilder' ),
1324 'condition' => [ 'rtsb_el_pagination_buttons_border_border!' => [ '' ] ],
1325 'selectors' => $selectors['border_active_color'],
1326 ];
1327
1328 $extra_controls['pagination_buttons_radius'] = [
1329 'mode' => 'responsive',
1330 'type' => 'dimensions',
1331 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1332 'size_units' => [ 'px', '%', 'em' ],
1333 'selectors' => $selectors['border_radius'],
1334 ];
1335
1336 $fields = Fns::insert_controls( 'pagination_buttons_border_hover_color', $fields, $extra_controls, true );
1337
1338 $extra_controls['pagination_buttons_spacing'] = [
1339 'type' => 'slider',
1340 'mode' => 'responsive',
1341 'label' => esc_html__( 'Spacing', 'shopbuilder' ),
1342 'size_units' => [ 'px' ],
1343 'range' => [
1344 'px' => [
1345 'min' => 0,
1346 'max' => 100,
1347 ],
1348 ],
1349 'selectors' => $selectors['spacing'],
1350 'condition' => [
1351 'pagination_type!' => 'load_more',
1352 ],
1353 ];
1354
1355 $extra_controls['pagination_buttons_padding'] = [
1356 'mode' => 'responsive',
1357 'type' => 'dimensions',
1358 'label' => esc_html__( 'Padding', 'shopbuilder' ),
1359 'size_units' => [ 'px', '%', 'em' ],
1360 'selectors' => ! empty( $selectors['padding'] ) ? $selectors['padding'] : [],
1361 'condition' => [
1362 'pagination_type' => 'load_more',
1363 ],
1364 ];
1365
1366 $fields = Fns::insert_controls( 'pagination_buttons_spacing_note', $fields, $extra_controls, true );
1367
1368 return apply_filters( 'rtsb/elements/elementor/pagination_style_control', $fields, $obj );
1369 }
1370
1371 /**
1372 * Product Add to Cart Section
1373 *
1374 * @param object $obj Reference object.
1375 *
1376 * @return array
1377 */
1378 public static function product_add_to_cart( $obj ): array {
1379 $css_selectors = $obj->selectors['product_add_to_cart'];
1380 $title = esc_html__( 'Add to Cart Button', 'shopbuilder' );
1381 $condition = [
1382 'show_add_to_cart' => [ 'yes' ],
1383 ];
1384 $selectors = [
1385 'typography' => $css_selectors['typography'],
1386 'icon_size' => [
1387 $css_selectors['icon_size']['font_size'] => 'font-size: {{SIZE}}{{UNIT}};',
1388 $css_selectors['icon_size']['width'] => 'height: {{SIZE}}{{UNIT}};',
1389 ],
1390 'cart_icon_spacing' => [
1391 $css_selectors['cart_icon_spacing']['margin_left'] => 'margin-left: {{SIZE}}{{UNIT}};',
1392 $css_selectors['cart_icon_spacing']['margin_right'] => 'margin-right: {{SIZE}}{{UNIT}};',
1393 ],
1394 'cart_width' => [ $css_selectors['cart_width'] => 'width: {{SIZE}}{{UNIT}} !important;' ],
1395 'cart_height' => [ $css_selectors['cart_height'] => 'height: {{SIZE}}{{UNIT}} !important;' ],
1396 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
1397 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
1398 'icon_color' => [ $css_selectors['icon_color'] => 'color: {{VALUE}};' ],
1399 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
1400 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
1401 'hover_icon_color' => [ $css_selectors['hover_icon_color'] => 'color: {{VALUE}};' ],
1402 'border' => $css_selectors['border'],
1403 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
1404 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
1405 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
1406 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1407 ];
1408
1409 $fields = ControlHelper::general_elementor_style( 'add_to_cart_button', $title, $obj, $condition, $selectors );
1410
1411 $fields['add_to_cart_button_alignment'] = [
1412 'type' => 'slider',
1413 'mode' => 'responsive',
1414 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
1415 'size_units' => [ 'px' ],
1416 'range' => [
1417 'px' => [
1418 'min' => 0,
1419 'max' => 100,
1420 ],
1421 ],
1422 'condition' => [
1423 'show_cart_icon' => [ 'yes' ],
1424 ],
1425 'selectors' => $selectors['icon_size'],
1426 ];
1427
1428 $extra_controls = [];
1429
1430 $extra_controls['cart_icon_alignment'] = [
1431 'type' => 'choose',
1432 'label' => esc_html__( 'Icon Alignment', 'shopbuilder' ),
1433 'options' => [
1434 'left' => [
1435 'title' => esc_html__( 'Left', 'shopbuilder' ),
1436 'icon' => 'eicon-arrow-left',
1437 ],
1438 'right' => [
1439 'title' => esc_html__( 'Right', 'shopbuilder' ),
1440 'icon' => 'eicon-arrow-right',
1441 ],
1442 ],
1443 'default' => 'left',
1444 'toggle' => true,
1445 'condition' => [
1446 'show_cart_text' => [ 'yes' ],
1447 'show_cart_icon' => [ 'yes' ],
1448 ],
1449 ];
1450
1451 $extra_controls['cart_icon_spacing'] = [
1452 'type' => 'slider',
1453 'mode' => 'responsive',
1454 'label' => esc_html__( 'Icon Spacing', 'shopbuilder' ),
1455 'size_units' => [ 'px' ],
1456 'range' => [
1457 'px' => [
1458 'min' => 0,
1459 'max' => 100,
1460 ],
1461 ],
1462 'default' => [
1463 'unit' => 'px',
1464 'size' => 8,
1465 ],
1466 'condition' => [
1467 'show_cart_text' => [ 'yes' ],
1468 'show_cart_icon' => [ 'yes' ],
1469 ],
1470 'selectors' => $selectors['cart_icon_spacing'],
1471 ];
1472
1473 $extra_controls['cart_width'] = [
1474 'type' => 'slider',
1475 'mode' => 'responsive',
1476 'label' => esc_html__( 'Width', 'shopbuilder' ),
1477 'size_units' => [ 'px', '%' ],
1478 'range' => [
1479 'px' => [
1480 'min' => 0,
1481 'max' => 1000,
1482 ],
1483 ],
1484 'selectors' => $selectors['cart_width'],
1485 ];
1486
1487 $extra_controls['cart_height'] = [
1488 'type' => 'slider',
1489 'mode' => 'responsive',
1490 'label' => esc_html__( 'height', 'shopbuilder' ),
1491 'size_units' => [ 'px', '%' ],
1492 'range' => [
1493 'px' => [
1494 'min' => 0,
1495 'max' => 1000,
1496 ],
1497 ],
1498 'selectors' => $selectors['cart_height'],
1499 ];
1500
1501 $fields = Fns::insert_controls( 'add_to_cart_button_alignment', $fields, $extra_controls, true );
1502
1503 $extra_controls['add_to_cart_button_icon_color'] = [
1504 'type' => 'color',
1505 'label' => esc_html__( 'Icon Color', 'shopbuilder' ),
1506 'selectors' => $selectors['icon_color'],
1507 ];
1508
1509 $fields = Fns::insert_controls( 'add_to_cart_button_bg_color', $fields, $extra_controls, true );
1510
1511 $extra_controls['add_to_cart_button_hover_icon_color'] = [
1512 'type' => 'color',
1513 'label' => esc_html__( 'Hover Icon Color', 'shopbuilder' ),
1514 'selectors' => $selectors['hover_icon_color'],
1515 ];
1516
1517 $fields = Fns::insert_controls( 'add_to_cart_button_hover_bg_color', $fields, $extra_controls, true );
1518
1519 $extra_controls['add_to_cart_button_radius'] = [
1520 'mode' => 'responsive',
1521 'type' => 'dimensions',
1522 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1523 'size_units' => [ 'px', '%', 'em' ],
1524 'selectors' => $selectors['border_radius'],
1525 ];
1526
1527 $fields = Fns::insert_controls( 'add_to_cart_button_border_hover_color', $fields, $extra_controls, true );
1528
1529 return apply_filters( 'rtsb/elements/elementor/add_to_cart_style_control', $fields, $obj );
1530 }
1531
1532 /**
1533 * Product Compare Section
1534 *
1535 * @param object $obj Reference object.
1536 *
1537 * @return array
1538 */
1539 public static function product_compare( $obj ): array {
1540 $css_selectors = $obj->selectors['product_compare'];
1541 $title = esc_html__( 'Compare Button', 'shopbuilder' );
1542 $condition = [
1543 'show_compare' => [ 'yes' ],
1544 ];
1545 $selectors = self::action_btn_selectors( $css_selectors );
1546
1547 $fields = ControlHelper::general_elementor_style( 'compare_button', $title, $obj, $condition, $selectors );
1548
1549 unset( $fields['compare_button_alignment'] );
1550
1551 $fields['rtsb_el_compare_button_typography'] = [
1552 'type' => 'slider',
1553 'mode' => 'responsive',
1554 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
1555 'size_units' => [ 'px' ],
1556 'range' => [
1557 'px' => [
1558 'min' => 0,
1559 'max' => 100,
1560 ],
1561 ],
1562 'condition' => [
1563 'show_cart_icon' => [ 'yes' ],
1564 ],
1565 'selectors' => $selectors['icon_size'],
1566 ];
1567
1568 $extra_controls = [];
1569
1570 $extra_controls['compare_width'] = [
1571 'type' => 'slider',
1572 'mode' => 'responsive',
1573 'label' => esc_html__( 'Min Width', 'shopbuilder' ),
1574 'size_units' => [ 'px' ],
1575 'range' => [
1576 'px' => [
1577 'min' => 0,
1578 'max' => 1000,
1579 ],
1580 ],
1581 'selectors' => $selectors['width'],
1582 ];
1583
1584 $extra_controls['compare_height'] = [
1585 'type' => 'slider',
1586 'mode' => 'responsive',
1587 'label' => esc_html__( 'height', 'shopbuilder' ),
1588 'size_units' => [ 'px' ],
1589 'range' => [
1590 'px' => [
1591 'min' => 0,
1592 'max' => 100,
1593 ],
1594 ],
1595 'selectors' => $selectors['height'],
1596 ];
1597
1598 $fields = Fns::insert_controls( 'compare_button_color_note', $fields, $extra_controls );
1599
1600 $extra_controls['compare_button_radius'] = [
1601 'mode' => 'responsive',
1602 'type' => 'dimensions',
1603 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1604 'size_units' => [ 'px', '%', 'em' ],
1605 'selectors' => $selectors['border_radius'],
1606 ];
1607
1608 $fields = Fns::insert_controls( 'compare_button_border_hover_color', $fields, $extra_controls, true );
1609
1610 return apply_filters( 'rtsb/elements/elementor/compare_style_control', $fields, $obj );
1611 }
1612
1613 /**
1614 * Product Wishlist Section
1615 *
1616 * @param object $obj Reference object.
1617 *
1618 * @return array
1619 */
1620 public static function product_wishlist( $obj ): array {
1621 $css_selectors = $obj->selectors['product_wishlist'];
1622 $title = esc_html__( 'Wishlist Button', 'shopbuilder' );
1623 $condition = [
1624 'show_wishlist' => [ 'yes' ],
1625 ];
1626 $selectors = self::action_btn_selectors( $css_selectors );
1627
1628 $fields = ControlHelper::general_elementor_style( 'wishlist_button', $title, $obj, $condition, $selectors );
1629
1630 unset( $fields['wishlist_button_alignment'] );
1631
1632 $fields['rtsb_el_wishlist_button_typography'] = [
1633 'type' => 'slider',
1634 'mode' => 'responsive',
1635 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
1636 'size_units' => [ 'px' ],
1637 'range' => [
1638 'px' => [
1639 'min' => 0,
1640 'max' => 100,
1641 ],
1642 ],
1643 'condition' => [
1644 'show_cart_icon' => [ 'yes' ],
1645 ],
1646 'selectors' => $selectors['icon_size'],
1647 ];
1648
1649 $extra_controls = [];
1650
1651 $extra_controls['wishlist_width'] = [
1652 'type' => 'slider',
1653 'mode' => 'responsive',
1654 'label' => esc_html__( 'Min Width', 'shopbuilder' ),
1655 'size_units' => [ 'px' ],
1656 'range' => [
1657 'px' => [
1658 'min' => 0,
1659 'max' => 1000,
1660 ],
1661 ],
1662 'selectors' => $selectors['width'],
1663 ];
1664 $extra_controls['wishlist_height'] = [
1665 'type' => 'slider',
1666 'mode' => 'responsive',
1667 'label' => esc_html__( 'height', 'shopbuilder' ),
1668 'size_units' => [ 'px' ],
1669 'range' => [
1670 'px' => [
1671 'min' => 0,
1672 'max' => 100,
1673 ],
1674 ],
1675 'selectors' => $selectors['height'],
1676 ];
1677
1678 $fields = Fns::insert_controls( 'wishlist_button_color_note', $fields, $extra_controls );
1679
1680 $extra_controls['wishlist_button_radius'] = [
1681 'mode' => 'responsive',
1682 'type' => 'dimensions',
1683 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1684 'size_units' => [ 'px', '%', 'em' ],
1685 'selectors' => $selectors['border_radius'],
1686 ];
1687
1688 $fields = Fns::insert_controls( 'wishlist_button_border_hover_color', $fields, $extra_controls, true );
1689
1690 return apply_filters( 'rtsb/elements/elementor/wishlist_style_control', $fields, $obj );
1691 }
1692
1693 /**
1694 * Product Quick View Section
1695 *
1696 * @param object $obj Reference object.
1697 *
1698 * @return array
1699 */
1700 public static function product_quick_view( $obj ): array {
1701 $css_selectors = $obj->selectors['product_quick_view'];
1702 $title = esc_html__( 'Quick View Button', 'shopbuilder' );
1703 $condition = [
1704 'show_quick_view' => [ 'yes' ],
1705 ];
1706 $selectors = self::action_btn_selectors( $css_selectors );
1707
1708 $fields = ControlHelper::general_elementor_style( 'quick_view_button', $title, $obj, $condition, $selectors );
1709
1710 unset( $fields['quick_view_button_alignment'] );
1711
1712 $fields['rtsb_el_quick_view_button_typography'] = [
1713 'type' => 'slider',
1714 'mode' => 'responsive',
1715 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
1716 'size_units' => [ 'px' ],
1717 'range' => [
1718 'px' => [
1719 'min' => 0,
1720 'max' => 100,
1721 ],
1722 ],
1723 'condition' => [
1724 'show_cart_icon' => [ 'yes' ],
1725 ],
1726 'selectors' => $selectors['icon_size'],
1727 ];
1728
1729 $extra_controls = [];
1730
1731 $extra_controls['quick_view_width'] = [
1732 'type' => 'slider',
1733 'mode' => 'responsive',
1734 'label' => esc_html__( 'Min Width', 'shopbuilder' ),
1735 'size_units' => [ 'px' ],
1736 'range' => [
1737 'px' => [
1738 'min' => 0,
1739 'max' => 1000,
1740 ],
1741 ],
1742 'selectors' => $selectors['width'],
1743 ];
1744
1745 $extra_controls['quick_view_height'] = [
1746 'type' => 'slider',
1747 'mode' => 'responsive',
1748 'label' => esc_html__( 'height', 'shopbuilder' ),
1749 'size_units' => [ 'px' ],
1750 'range' => [
1751 'px' => [
1752 'min' => 0,
1753 'max' => 100,
1754 ],
1755 ],
1756 'selectors' => $selectors['height'],
1757 ];
1758
1759 $fields = Fns::insert_controls( 'quick_view_button_color_note', $fields, $extra_controls );
1760
1761 $extra_controls['quick_view_button_radius'] = [
1762 'mode' => 'responsive',
1763 'type' => 'dimensions',
1764 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1765 'size_units' => [ 'px', '%', 'em' ],
1766 'selectors' => $selectors['border_radius'],
1767 ];
1768
1769 $fields = Fns::insert_controls( 'quick_view_button_border_hover_color', $fields, $extra_controls, true );
1770
1771 return apply_filters( 'rtsb/elements/elementor/quick_view_style_control', $fields, $obj );
1772 }
1773
1774 /**
1775 * Hover Icon Button Section
1776 *
1777 * @param object $obj Reference object.
1778 *
1779 * @return array
1780 */
1781 public static function hover_icon_button( $obj ): array {
1782 $css_selectors = $obj->selectors['hover_icon_button'];
1783 $title = esc_html__( 'Hover Icon Button', 'shopbuilder' );
1784 $condition = [
1785 'layout' => [ 'grid-layout2', 'slider-layout2' ],
1786 ];
1787 $selectors = [
1788 'typography' => $css_selectors['typography'],
1789 'icon_size' => [
1790 $css_selectors['icon_size']['font_size'] => 'font-size: {{SIZE}}{{UNIT}} !important;',
1791 $css_selectors['icon_size']['svg'] => 'width: {{SIZE}}{{UNIT}} !important;',
1792 ],
1793 'hover_icon_spacing' => [ $css_selectors['hover_icon_spacing'] => 'margin-left: {{SIZE}}{{UNIT}}' ],
1794 'color' => [ $css_selectors['color'] => 'color: {{VALUE}}' ],
1795 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}}' ],
1796 'icon_color' => [ $css_selectors['icon_color'] => 'color: {{VALUE}}' ],
1797 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}}' ],
1798 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}}' ],
1799 'hover_icon_color' => [ $css_selectors['hover_icon_color'] => 'color: {{VALUE}}' ],
1800 'border' => $css_selectors['border'],
1801 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}}' ],
1802 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}' ],
1803 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1804 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1805 ];
1806
1807 $fields = ControlHelper::general_elementor_style( 'hover_icon_button', $title, $obj, $condition, $selectors );
1808
1809 $fields['hover_icon_button_alignment'] = [
1810 'type' => 'slider',
1811 'mode' => 'responsive',
1812 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
1813 'size_units' => [ 'px' ],
1814 'range' => [
1815 'px' => [
1816 'min' => 0,
1817 'max' => 100,
1818 ],
1819 ],
1820 'default' => [
1821 'unit' => 'px',
1822 'size' => 14,
1823 ],
1824 'condition' => [
1825 'show_hover_btn_icon' => [ 'yes' ],
1826 ],
1827 'selectors' => $selectors['icon_size'],
1828 ];
1829
1830 $extra_controls = [];
1831
1832 $extra_controls['hover_icon_button_spacing'] = [
1833 'type' => 'slider',
1834 'mode' => 'responsive',
1835 'label' => esc_html__( 'Icon Spacing', 'shopbuilder' ),
1836 'size_units' => [ 'px' ],
1837 'range' => [
1838 'px' => [
1839 'min' => 0,
1840 'max' => 100,
1841 ],
1842 ],
1843 'default' => [
1844 'unit' => 'px',
1845 'size' => 5,
1846 ],
1847 'condition' => [
1848 'show_hover_btn_icon' => [ 'yes' ],
1849 ],
1850 'selectors' => $selectors['hover_icon_spacing'],
1851 ];
1852
1853 $fields = Fns::insert_controls( 'hover_icon_button_alignment', $fields, $extra_controls, true );
1854
1855 $extra_controls['hover_icon_button_icon_color'] = [
1856 'type' => 'color',
1857 'label' => esc_html__( 'Icon Color', 'shopbuilder' ),
1858 'condition' => [
1859 'show_hover_btn_icon' => [ 'yes' ],
1860 ],
1861 'selectors' => $selectors['icon_color'],
1862 ];
1863
1864 $fields = Fns::insert_controls( 'hover_icon_button_bg_color', $fields, $extra_controls, true );
1865
1866 $extra_controls['hover_icon_button_hover_icon_color'] = [
1867 'type' => 'color',
1868 'label' => esc_html__( 'Hover Icon Color', 'shopbuilder' ),
1869 'condition' => [
1870 'show_hover_btn_icon' => [ 'yes' ],
1871 ],
1872 'selectors' => $selectors['hover_icon_color'],
1873 ];
1874
1875 $fields = Fns::insert_controls( 'hover_icon_button_hover_bg_color', $fields, $extra_controls, true );
1876
1877 $extra_controls['hover_icon_button_radius'] = [
1878 'mode' => 'responsive',
1879 'type' => 'dimensions',
1880 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
1881 'size_units' => [ 'px', '%', 'em' ],
1882 'selectors' => $selectors['border_radius'],
1883 ];
1884
1885 $fields = Fns::insert_controls( 'hover_icon_button_border_hover_color', $fields, $extra_controls, true );
1886
1887 return apply_filters( 'rtsb/elements/elementor/hover_icon_btn_style_control', $fields, $obj );
1888 }
1889
1890 /**
1891 * Share Items Section
1892 *
1893 * @param object $obj Reference object.
1894 *
1895 * @return array
1896 */
1897 public static function share_items( $obj ): array {
1898 $css_selectors = $obj->selectors['share_items'];
1899 $title = esc_html__( 'Share Items', 'shopbuilder' );
1900 $condition = [
1901 'layout!' => [ 'default' ],
1902 ];
1903 $selectors = [
1904 'share_icons_spacing' => [ $css_selectors['share_icons_spacing'] => 'gap: {{SIZE}}{{UNIT}}' ],
1905 'share_items_min_width' => [ $css_selectors['share_items_min_width'] => 'min-width: {{SIZE}}{{UNIT}}' ],
1906 'social_items_color' => [ $css_selectors['social_items_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1907 'social_items_bg_color' => [ $css_selectors['social_items_bg_color'] => 'background-color: {{VALUE}}' ],
1908 'facebook_color' => [ $css_selectors['facebook_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1909 'twitter_color' => [ $css_selectors['twitter_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1910 'linkedin_color' => [ $css_selectors['linkedin_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1911 'pinterest_color' => [ $css_selectors['pinterest_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1912 'skype_color' => [ $css_selectors['skype_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1913 'whatsapp_color' => [ $css_selectors['whatsapp_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1914 'reddit_color' => [ $css_selectors['reddit_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1915 'telegram_color' => [ $css_selectors['telegram_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1916 'facebook_bg_color' => [ $css_selectors['facebook_bg_color'] => 'background-color: {{VALUE}}' ],
1917 'twitter_bg_color' => [ $css_selectors['twitter_bg_color'] => 'background-color: {{VALUE}}' ],
1918 'linkedin_bg_color' => [ $css_selectors['linkedin_bg_color'] => 'background-color: {{VALUE}}' ],
1919 'pinterest_bg_color' => [ $css_selectors['pinterest_bg_color'] => 'background-color: {{VALUE}}' ],
1920 'skype_bg_color' => [ $css_selectors['skype_bg_color'] => 'background-color: {{VALUE}}' ],
1921 'whatsapp_bg_color' => [ $css_selectors['whatsapp_bg_color'] => 'background-color: {{VALUE}}' ],
1922 'reddit_bg_color' => [ $css_selectors['reddit_bg_color'] => 'background-color: {{VALUE}}' ],
1923 'telegram_bg_color' => [ $css_selectors['telegram_bg_color'] => 'background-color: {{VALUE}}' ],
1924 'social_items_hover_color' => [ $css_selectors['social_items_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1925 'social_items_hover_bg_color' => [ $css_selectors['social_items_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1926 'facebook_hover_color' => [ $css_selectors['facebook_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1927 'twitter_hover_color' => [ $css_selectors['twitter_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1928 'linkedin_hover_color' => [ $css_selectors['linkedin_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1929 'pinterest_hover_color' => [ $css_selectors['pinterest_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1930 'skype_hover_color' => [ $css_selectors['skype_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1931 'whatsapp_hover_color' => [ $css_selectors['whatsapp_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1932 'reddit_hover_color' => [ $css_selectors['reddit_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1933 'telegram_hover_color' => [ $css_selectors['telegram_hover_color'] => 'fill: {{VALUE}}; color: {{VALUE}}' ],
1934 'facebook_hover_bg_color' => [ $css_selectors['facebook_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1935 'twitter_hover_bg_color' => [ $css_selectors['twitter_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1936 'linkedin_hover_bg_color' => [ $css_selectors['linkedin_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1937 'pinterest_hover_bg_color' => [ $css_selectors['pinterest_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1938 'skype_hover_bg_color' => [ $css_selectors['skype_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1939 'whatsapp_hover_bg_color' => [ $css_selectors['whatsapp_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1940 'reddit_hover_bg_color' => [ $css_selectors['reddit_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1941 'telegram_hover_bg_color' => [ $css_selectors['telegram_hover_bg_color'] => 'background-color: {{VALUE}}' ],
1942 'border' => $css_selectors['border'],
1943 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}}' ],
1944 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}' ],
1945 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1946 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
1947 ];
1948
1949 $fields = ControlHelper::general_elementor_style( 'share_items', $title, $obj, $condition, $selectors );
1950
1951 unset(
1952 $fields['rtsb_el_share_items_typography'],
1953 $fields['share_items_alignment'],
1954 $fields['share_items_hover_color'],
1955 $fields['share_items_hover_bg_color'],
1956 $fields['share_items_color'],
1957 $fields['share_items_bg_color']
1958 );
1959
1960 $extra_controls = [];
1961
1962 $extra_controls['share_items_spacing'] = [
1963 'type' => 'slider',
1964 'mode' => 'responsive',
1965 'label' => esc_html__( 'Items Spacing', 'shopbuilder' ),
1966 'size_units' => [ 'px' ],
1967 'range' => [
1968 'px' => [
1969 'min' => 0,
1970 'max' => 100,
1971 ],
1972 ],
1973 'selectors' => $selectors['share_icons_spacing'],
1974 ];
1975
1976 $extra_controls['share_items_min_width'] = [
1977 'type' => 'slider',
1978 'mode' => 'responsive',
1979 'label' => esc_html__( 'Items Min Width', 'shopbuilder' ),
1980 'size_units' => [ 'px' ],
1981 'range' => [
1982 'px' => [
1983 'min' => 0,
1984 'max' => 300,
1985 ],
1986 ],
1987 'selectors' => $selectors['share_items_min_width'],
1988 ];
1989
1990 $fields = Fns::insert_controls( 'share_items_typo_note', $fields, $extra_controls, true );
1991
1992 $share_platforms = ControlHelper::sharing_settings();
1993
1994 $extra_controls['social_items_color'] = [
1995 'type' => 'color',
1996 'label' => esc_html__( 'Items Color', 'shopbuilder' ),
1997 'selectors' => $selectors['social_items_color'],
1998 ];
1999
2000 $extra_controls['social_items_bg_color'] = [
2001 'type' => 'color',
2002 'label' => esc_html__( 'Items Background Color', 'shopbuilder' ),
2003 'selectors' => $selectors['social_items_bg_color'],
2004 ];
2005
2006 foreach ( $share_platforms as $share_platform ) {
2007 $extra_controls[ $share_platform . '_color' ] = [
2008 'type' => 'color',
2009 'label' => ucfirst( $share_platform ) . esc_html__( ' Color', 'shopbuilder' ),
2010 'selectors' => $selectors[ $share_platform . '_color' ],
2011 ];
2012
2013 $extra_controls[ $share_platform . '_bg_color' ] = [
2014 'type' => 'color',
2015 'label' => ucfirst( $share_platform ) . esc_html__( ' Background', 'shopbuilder' ),
2016 'selectors' => $selectors[ $share_platform . '_bg_color' ],
2017 ];
2018
2019 $fields = Fns::insert_controls( 'share_items_color_tab', $fields, $extra_controls, true );
2020 }
2021
2022 $extra_controls['social_items_hover_color'] = [
2023 'type' => 'color',
2024 'label' => esc_html__( 'Items Hover Color', 'shopbuilder' ),
2025 'selectors' => $selectors['social_items_hover_color'],
2026 ];
2027
2028 $extra_controls['social_items_hover_bg_color'] = [
2029 'type' => 'color',
2030 'label' => esc_html__( 'Items Background Hover Color', 'shopbuilder' ),
2031 'selectors' => $selectors['social_items_hover_bg_color'],
2032 ];
2033
2034 foreach ( $share_platforms as $share_platform ) {
2035 $extra_controls[ $share_platform . '_hover_color' ] = [
2036 'type' => 'color',
2037 'label' => ucfirst( $share_platform ) . esc_html__( ' Hover Color', 'shopbuilder' ),
2038 'selectors' => $selectors[ $share_platform . '_hover_color' ],
2039 ];
2040
2041 $extra_controls[ $share_platform . '_hover_bg_color' ] = [
2042 'type' => 'color',
2043 'label' => ucfirst( $share_platform ) . esc_html__( ' Hover Background', 'shopbuilder' ),
2044 'selectors' => $selectors[ $share_platform . '_hover_bg_color' ],
2045 ];
2046
2047 $fields = Fns::insert_controls( 'share_items_hover_color_tab', $fields, $extra_controls, true );
2048 }
2049
2050 $extra_controls['share_items_radius'] = [
2051 'mode' => 'responsive',
2052 'type' => 'dimensions',
2053 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
2054 'size_units' => [ 'px', '%', 'em' ],
2055 'selectors' => $selectors['border_radius'],
2056 ];
2057
2058 $fields = Fns::insert_controls( 'share_items_border_hover_color', $fields, $extra_controls, true );
2059
2060 return apply_filters( 'rtsb/elements/elementor/share_icons_style_control', $fields, $obj );
2061 }
2062
2063 /**
2064 * Share Icons Section
2065 *
2066 * @param object $obj Reference object.
2067 *
2068 * @return array
2069 */
2070 public static function share_icons( $obj ): array {
2071 $css_selectors = $obj->selectors['share_icons'];
2072 $title = esc_html__( 'Share Icons', 'shopbuilder' );
2073 $condition = [
2074 'layout!' => [ 'default' ],
2075 ];
2076 $selectors = [
2077 'share_icons_width' => [ $css_selectors['share_icons_width'] => 'width: {{SIZE}}{{UNIT}}' ],
2078 'share_icons_height' => [ $css_selectors['share_icons_height'] => 'height: {{SIZE}}{{UNIT}}' ],
2079 'color' => [ $css_selectors['color'] => 'fill: {{VALUE}}' ],
2080 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}}' ],
2081 'hover_color' => [ $css_selectors['hover_color'] => 'fill: {{VALUE}}' ],
2082 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}}' ],
2083 'border' => $css_selectors['border'],
2084 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}}' ],
2085 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2086 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2087 ];
2088
2089 $fields = ControlHelper::general_elementor_style( 'share_icons', $title, $obj, $condition, $selectors );
2090
2091 unset(
2092 $fields['rtsb_el_share_icons_typography'],
2093 $fields['share_icons_alignment'],
2094 );
2095
2096 $extra_controls = [];
2097
2098 $extra_controls['share_icons_width'] = [
2099 'type' => 'slider',
2100 'mode' => 'responsive',
2101 'label' => esc_html__( 'Icon Width', 'shopbuilder' ),
2102 'size_units' => [ 'px' ],
2103 'range' => [
2104 'px' => [
2105 'min' => 0,
2106 'max' => 100,
2107 ],
2108 ],
2109 'selectors' => $selectors['share_icons_width'],
2110 ];
2111
2112 $extra_controls['share_icons_height'] = [
2113 'type' => 'slider',
2114 'mode' => 'responsive',
2115 'label' => esc_html__( 'Icon Height', 'shopbuilder' ),
2116 'size_units' => [ 'px' ],
2117 'range' => [
2118 'px' => [
2119 'min' => 0,
2120 'max' => 100,
2121 ],
2122 ],
2123 'selectors' => $selectors['share_icons_height'],
2124 ];
2125
2126 $fields = Fns::insert_controls( 'share_icons_typo_note', $fields, $extra_controls, true );
2127
2128 $fields['share_icons_typo_note']['raw'] = sprintf(
2129 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
2130 esc_html__( 'Dimension', 'shopbuilder' )
2131 );
2132
2133 return apply_filters( 'rtsb/elements/elementor/share_icons_style_control', $fields, $obj );
2134 }
2135
2136 /**
2137 * Share Text Section
2138 *
2139 * @param object $obj Reference object.
2140 *
2141 * @return array
2142 */
2143 public static function share_text( $obj ): array {
2144 $css_selectors = $obj->selectors['share_text'];
2145 $title = esc_html__( 'Share Text', 'shopbuilder' );
2146 $condition = [
2147 'layout!' => [ 'default' ],
2148 ];
2149 $selectors = [
2150 'typography' => $css_selectors['typography'],
2151 'alignment' => [ $css_selectors['alignment'] => 'text-align: {{VALUE}};' ],
2152 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
2153 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}}' ],
2154 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}}' ],
2155 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}}' ],
2156 'border' => $css_selectors['border'],
2157 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}}' ],
2158 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2159 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2160 ];
2161
2162 $fields = ControlHelper::general_elementor_style( 'share_text', $title, $obj, $condition, $selectors );
2163
2164 return apply_filters( 'rtsb/elements/elementor/share_text_style_control', $fields, $obj );
2165 }
2166
2167 /**
2168 * Share Text Section
2169 *
2170 * @param object $obj Reference object.
2171 *
2172 * @return array
2173 */
2174 public static function share_header( $obj ): array {
2175 $css_selectors = $obj->selectors['share_header'];
2176 $title = esc_html__( 'Share Header', 'shopbuilder' );
2177 $condition = [
2178 'show_share_pre_text' => [ 'yes' ],
2179 ];
2180 $selectors = [
2181 'typography' => $css_selectors['typography'],
2182 'share_header_type' => [ $css_selectors['share_header_type'] => 'display: {{VALUE}};' ],
2183 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
2184 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}}' ],
2185 'border' => $css_selectors['border'],
2186 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2187 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
2188 ];
2189
2190 $fields = ControlHelper::general_elementor_style( 'share_header', $title, $obj, $condition, $selectors );
2191
2192 unset(
2193 $fields['share_header_alignment'],
2194 $fields['share_header_color_tabs'],
2195 $fields['share_header_color_tab'],
2196 $fields['share_header_color_tab_end'],
2197 $fields['share_header_hover_color_tab'],
2198 $fields['share_header_hover_color'],
2199 $fields['share_header_hover_bg_color'],
2200 $fields['share_header_hover_color_tab_end'],
2201 $fields['share_header_color_tabs_end'],
2202 $fields['share_header_border_hover_color'],
2203 );
2204
2205 $extra_controls = [];
2206
2207 $extra_controls['share_header_type'] = [
2208 'type' => 'choose',
2209 'label' => esc_html__( 'Display Type', 'shopbuilder' ),
2210 'options' => [
2211 'flex' => [
2212 'title' => esc_html__( 'Inline', 'shopbuilder' ),
2213 'icon' => 'eicon-h-align-right',
2214 ],
2215 'block' => [
2216 'title' => esc_html__( 'New Line', 'shopbuilder' ),
2217 'icon' => 'eicon-v-align-bottom',
2218 ],
2219 ],
2220 'default' => 'flex',
2221 'toggle' => true,
2222 'selectors' => $selectors['share_header_type'],
2223 ];
2224
2225 return Fns::insert_controls( 'share_header_color_note', $fields, $extra_controls );
2226 }
2227
2228 /**
2229 * Advanced section
2230 *
2231 * @param object $obj Reference object.
2232 *
2233 * @return array
2234 */
2235 public static function advanced( $obj ): array {
2236
2237 $fields['advanced_section'] = $obj->start_section( esc_html__( 'Advanced', 'shopbuilder' ), self::$tab );
2238
2239 $fields['gutter_section_end'] = $obj->end_section();
2240
2241 return apply_filters( 'rtsb/elements/elementor/advanced_control', $fields, $obj );
2242 }
2243
2244 /**
2245 * Slider buttons section
2246 *
2247 * @param object $obj Reference object.
2248 *
2249 * @return array
2250 */
2251 public static function slider_buttons( $obj ): array {
2252 $css_selectors = $obj->selectors['slider_buttons'];
2253 $title = esc_html__( 'Slider Buttons', 'shopbuilder' );
2254 $selectors = [
2255 'arrow_size' => [
2256 $css_selectors['arrow_size']['icon'] => 'font-size: {{SIZE}}{{UNIT}};',
2257 $css_selectors['arrow_size']['svg'] => 'width: {{SIZE}}{{UNIT}};',
2258 ],
2259 'arrow_width' => [ $css_selectors['arrow_width'] => 'width: {{SIZE}}{{UNIT}};' ],
2260 'arrow_height' => [ $css_selectors['arrow_height'] => 'height: {{SIZE}}{{UNIT}};' ],
2261 'arrow_line_height' => [ $css_selectors['arrow_line_height'] => 'line-height: {{SIZE}}{{UNIT}};' ],
2262 'dot_width' => [ $css_selectors['dot_width'] => 'width: {{SIZE}}{{UNIT}};' ],
2263 'dot_height' => [ $css_selectors['dot_height'] => 'height: {{SIZE}}{{UNIT}};' ],
2264 'dot_spacing' => [ $css_selectors['dot_spacing'] => 'margin-left: calc({{SIZE}}{{UNIT}} / 2); margin-right: calc({{SIZE}}{{UNIT}} / 2);' ],
2265 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
2266 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
2267 'hover_color' => [ $css_selectors['hover_color'] => 'color: {{VALUE}};' ],
2268 'hover_bg_color' => [ $css_selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
2269 'dot_color' => [ $css_selectors['dot_color'] => 'background-color: {{VALUE}};' ],
2270 'dot_active_color' => [ $css_selectors['dot_active_color'] => 'background-color: {{VALUE}};' ],
2271 'border' => $css_selectors['border'],
2272 'border_hover_color' => [ $css_selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
2273 'active_border_color' => [ $css_selectors['active_border_color'] => 'border-color: {{VALUE}};' ],
2274 'border_radius' => [ $css_selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2275 'wrapper_padding' => [ $css_selectors['wrapper_padding'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2276 ];
2277
2278 $conditions = [
2279 'relation' => 'or',
2280 'terms' => [
2281 [
2282 'name' => 'slider_nav',
2283 'operator' => '==',
2284 'value' => 'yes',
2285 ],
2286 [
2287 'name' => 'slider_pagi',
2288 'operator' => '==',
2289 'value' => 'yes',
2290 ],
2291 ],
2292 ];
2293
2294 $fields = ControlHelper::general_elementor_style( 'slider_buttons', $title, $obj, [], $selectors, $conditions );
2295
2296 unset(
2297 $fields['rtsb_el_slider_buttons_typography'],
2298 $fields['slider_buttons_alignment'],
2299 $fields['slider_buttons_padding'],
2300 $fields['slider_buttons_margin']
2301 );
2302
2303 $extra_controls = [];
2304 $arrow_condition = [ 'slider_nav' => [ 'yes' ] ];
2305 $dot_condition = [ 'slider_pagi' => [ 'yes' ] ];
2306
2307 $fields['slider_buttons_typo_note']['raw'] = sprintf(
2308 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
2309 esc_html__( 'Arrow Size (px)', 'shopbuilder' )
2310 );
2311
2312 $fields['slider_buttons_typo_note']['condition'] = $arrow_condition;
2313
2314 $extra_controls['slider_buttons_arrow_size'] = [
2315 'type' => 'slider',
2316 'mode' => 'responsive',
2317 'label' => esc_html__( 'Arrow Size', 'shopbuilder' ),
2318 'range' => [
2319 'px' => [
2320 'min' => 1,
2321 'max' => 100,
2322 'step' => 1,
2323 ],
2324 ],
2325 'default' => [
2326 'unit' => 'px',
2327 'size' => 13,
2328 ],
2329 'condition' => $arrow_condition,
2330 'selectors' => $selectors['arrow_size'],
2331 ];
2332
2333 $extra_controls['slider_buttons_arrow_width'] = [
2334 'type' => 'slider',
2335 'mode' => 'responsive',
2336 'label' => esc_html__( 'Arrow Width', 'shopbuilder' ),
2337 'range' => [
2338 'px' => [
2339 'min' => 1,
2340 'max' => 100,
2341 'step' => 1,
2342 ],
2343 ],
2344 'condition' => $arrow_condition,
2345 'selectors' => $selectors['arrow_width'],
2346 ];
2347
2348 $extra_controls['slider_buttons_arrow_height'] = [
2349 'type' => 'slider',
2350 'mode' => 'responsive',
2351 'label' => esc_html__( 'Arrow Height', 'shopbuilder' ),
2352 'range' => [
2353 'px' => [
2354 'min' => 1,
2355 'max' => 100,
2356 'step' => 1,
2357 ],
2358 ],
2359 'condition' => $arrow_condition,
2360 'selectors' => $selectors['arrow_height'],
2361 ];
2362
2363 $extra_controls['slider_buttons_arrow_line_height'] = [
2364 'type' => 'slider',
2365 'mode' => 'responsive',
2366 'label' => esc_html__( 'Arrow Line Height', 'shopbuilder' ),
2367 'range' => [
2368 'px' => [
2369 'min' => 1,
2370 'max' => 100,
2371 'step' => 1,
2372 ],
2373 ],
2374 'condition' => $arrow_condition,
2375 'selectors' => $selectors['arrow_line_height'],
2376 ];
2377
2378 $extra_controls['slider_buttons_dot_size_note'] = $obj->el_heading(
2379 esc_html__( 'Dot Size (px)', 'shopbuilder' ),
2380 'before',
2381 [],
2382 $dot_condition
2383 );
2384
2385 $extra_controls['slider_buttons_dot_width'] = [
2386 'type' => 'slider',
2387 'mode' => 'responsive',
2388 'label' => esc_html__( 'Dot Width', 'shopbuilder' ),
2389 'range' => [
2390 'px' => [
2391 'min' => 1,
2392 'max' => 100,
2393 'step' => 1,
2394 ],
2395 ],
2396 'selectors' => $selectors['dot_width'],
2397 'condition' => $dot_condition,
2398 ];
2399
2400 $extra_controls['slider_buttons_dot_height'] = [
2401 'type' => 'slider',
2402 'mode' => 'responsive',
2403 'label' => esc_html__( 'Dot Height', 'shopbuilder' ),
2404 'range' => [
2405 'px' => [
2406 'min' => 1,
2407 'max' => 100,
2408 'step' => 1,
2409 ],
2410 ],
2411 'selectors' => $selectors['dot_height'],
2412 'condition' => $dot_condition,
2413 ];
2414
2415 $extra_controls['slider_buttons_dot_spacing'] = [
2416 'type' => 'slider',
2417 'mode' => 'responsive',
2418 'label' => esc_html__( 'Dot Spacing', 'shopbuilder' ),
2419 'range' => [
2420 'px' => [
2421 'min' => 1,
2422 'max' => 100,
2423 'step' => 1,
2424 ],
2425 ],
2426 'selectors' => $selectors['dot_spacing'],
2427 'condition' => $dot_condition,
2428 ];
2429
2430 $fields = Fns::insert_controls( 'slider_buttons_typo_note', $fields, $extra_controls, true );
2431
2432 $extra_controls['slider_buttons_active_color_tab'] = $obj->start_tab( esc_html__( 'Dot', 'shopbuilder' ) );
2433
2434 $extra_controls['slider_buttons_active_color'] = [
2435 'type' => 'color',
2436 'label' => esc_html__( 'Dot Color', 'shopbuilder' ),
2437 'selectors' => $selectors['dot_color'],
2438 ];
2439
2440 $extra_controls['slider_buttons_active_bg_color'] = [
2441 'type' => 'color',
2442 'label' => esc_html__( 'Dot Active Color', 'shopbuilder' ),
2443 'selectors' => $selectors['dot_active_color'],
2444 ];
2445
2446 $extra_controls['slider_buttons_active_color_tab_end'] = $obj->end_tab();
2447
2448 $fields = Fns::insert_controls( 'slider_buttons_hover_color_tab_end', $fields, $extra_controls, true );
2449
2450 $extra_controls['slider_buttons_border_active_color'] = [
2451 'type' => 'color',
2452 'label' => esc_html__( 'Active Color', 'shopbuilder' ),
2453 'condition' => [ 'rtsb_el_slider_buttons_border_border!' => [ '' ] ],
2454 'selectors' => $selectors['active_border_color'],
2455 ];
2456
2457 $extra_controls['slider_buttons_buttons_radius'] = [
2458 'mode' => 'responsive',
2459 'type' => 'dimensions',
2460 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
2461 'size_units' => [ 'px', '%', 'em' ],
2462 'selectors' => $selectors['border_radius'],
2463 ];
2464
2465 $fields = Fns::insert_controls( 'slider_buttons_border_hover_color', $fields, $extra_controls, true );
2466
2467 $extra_controls['slider_buttons_wrapper_padding'] = [
2468 'mode' => 'responsive',
2469 'type' => 'dimensions',
2470 'label' => esc_html__( 'Wrapper Margin', 'shopbuilder' ),
2471 'size_units' => [ 'px', '%', 'em' ],
2472 'selectors' => $selectors['wrapper_padding'],
2473 ];
2474
2475 $fields = Fns::insert_controls( 'slider_buttons_spacing_note', $fields, $extra_controls, true );
2476
2477 return apply_filters( 'rtsb/elements/elementor/slider_buttons_style_control', $fields, $obj );
2478 }
2479
2480 /**
2481 * Not Found Notice Section
2482 *
2483 * @param object $obj Reference object.
2484 *
2485 * @return array
2486 */
2487 public static function not_found_notice( $obj ): array {
2488 $css_selectors = $obj->selectors['not_found_notice'];
2489 $title = esc_html__( 'Not Found Notice', 'shopbuilder' );
2490 $selectors = [
2491 'typography' => $css_selectors['typography'],
2492 'alignment' => [ $css_selectors['alignment'] => 'text-align: {{VALUE}}; justify-content: {{VALUE}};' ],
2493 'color' => [ $css_selectors['color'] => 'color: {{VALUE}};' ],
2494 'bg_color' => [ $css_selectors['bg_color'] => 'background-color: {{VALUE}};' ],
2495 'border' => $css_selectors['border'],
2496 'padding' => [ $css_selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2497 'margin' => [ $css_selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
2498 ];
2499
2500 $fields = ControlHelper::general_elementor_style( 'not_found_notice', $title, $obj, [], $selectors );
2501
2502 unset(
2503 $fields['not_found_notice_color_tabs'],
2504 $fields['not_found_notice_color_tab'],
2505 $fields['not_found_notice_color_tab_end'],
2506 $fields['not_found_notice_hover_color_tab'],
2507 $fields['not_found_notice_hover_color'],
2508 $fields['not_found_notice_hover_bg_color'],
2509 $fields['not_found_notice_hover_color_tab_end'],
2510 $fields['not_found_notice_color_tabs_end'],
2511 $fields['not_found_notice_border_hover_color']
2512 );
2513
2514 return $fields;
2515 }
2516
2517 /**
2518 * Title Selectors.
2519 *
2520 * @param array $selectors Selector array.
2521 *
2522 * @return array
2523 */
2524 public static function title_selectors( $selectors ): array {
2525 return [
2526 'typography' => $selectors['typography'],
2527 'alignment' => [ $selectors['alignment'] => 'text-align: {{VALUE}};' ],
2528 'color' => [ $selectors['color'] => 'color: {{VALUE}};' ],
2529 'bg_color' => [ $selectors['bg_color'] => 'background-color: {{VALUE}};' ],
2530 'hover_color' => [ $selectors['hover_color'] => 'color: {{VALUE}};' ],
2531 'hover_bg_color' => [ $selectors['hover_bg_color'] => 'background-color: {{VALUE}};' ],
2532 'border' => $selectors['border'],
2533 'border_hover_color' => [ $selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
2534 'padding' => [ $selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2535 'margin' => [ $selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
2536 ];
2537 }
2538
2539 /**
2540 * Excerpt Selectors.
2541 *
2542 * @param array $selectors Selector array.
2543 *
2544 * @return array
2545 */
2546 private static function excerpt_selectors( $selectors ): array {
2547 return [
2548 'typography' => $selectors['typography'],
2549 'alignment' => [ $selectors['alignment'] => 'text-align: {{VALUE}};' ],
2550 'color' => [ $selectors['color'] => 'color: {{VALUE}};' ],
2551 'bg_color' => [ $selectors['bg_color'] => 'background-color: {{VALUE}};' ],
2552 'border' => $selectors['border'],
2553 'padding' => [ $selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2554 'margin' => [ $selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2555 ];
2556 }
2557
2558 /**
2559 * Action Button Selectors.
2560 *
2561 * @param array $selectors Selector array.
2562 *
2563 * @return array
2564 */
2565 public static function action_btn_selectors( $selectors ): array {
2566 return [
2567 'icon_size' => [
2568 $selectors['icon_size']['font_size'] => 'font-size: {{SIZE}}{{UNIT}} !important;',
2569 $selectors['icon_size']['width'] => 'width: {{SIZE}}{{UNIT}} !important;',
2570 ],
2571 'width' => [ $selectors['width'] => 'min-width: {{SIZE}}{{UNIT}} !important;' ],
2572 'height' => [ $selectors['height'] => 'height: {{SIZE}}{{UNIT}} !important;' ],
2573 'color' => [ $selectors['color'] => 'color: {{VALUE}};' ],
2574 'bg_color' => [ $selectors['bg_color'] => 'background-color: {{VALUE}} !important;' ],
2575 'hover_color' => [ $selectors['hover_color'] => 'color: {{VALUE}};' ],
2576 'hover_bg_color' => [ $selectors['hover_bg_color'] => 'background-color: {{VALUE}} !important;' ],
2577 'border' => $selectors['border'],
2578 'border_hover_color' => [ $selectors['border_hover_color'] => 'border-color: {{VALUE}};' ],
2579 'border_radius' => [ $selectors['border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
2580 'padding' => [ $selectors['padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
2581 'margin' => [ $selectors['margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
2582 ];
2583 }
2584 }
2585