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

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