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

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

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