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

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

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