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

SettingsFields.php in ShopBuilder – WooCommerce Builder For Elementor 3.4.0, at app/Elementor/Widgets/Controls/SettingsFields.php

1,781 lines 60.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Elementor Settings Fields Class.
4 *
5 * This class contains all the common fields for Settings 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 use RadiusTheme\SB\Modules\VariationSwatches\SwatchesFns;
15
16 // Do not allow directly accessing this file.
17 if ( ! defined( 'ABSPATH' ) ) {
18 exit( 'This script cannot be accessed directly.' );
19 }
20
21 /**
22 * Elementor Settings Fields Class.
23 */
24 class SettingsFields {
25 /**
26 * Tab name.
27 *
28 * @access private
29 * @static
30 *
31 * @var array
32 */
33 private static $tab = 'settings';
34
35 /**
36 * Visibility section
37 *
38 * @param object $obj Reference object.
39 *
40 * @return array
41 */
42 public static function content_visibility( $obj ) {
43 $fields['visibility_section'] = $obj->start_section(
44 esc_html__( 'Content Visibility', 'shopbuilder' ),
45 self::$tab
46 );
47
48 $fields['general_visibility'] = $obj->el_heading( esc_html__( 'General Visibility', 'shopbuilder' ) );
49
50 $fields['show_title'] = [
51 'type' => 'switch',
52 'label' => esc_html__( 'Show Product Title?', 'shopbuilder' ),
53 'description' => esc_html__( 'Switch on to show product title.', 'shopbuilder' ),
54 'label_on' => esc_html__( 'On', 'shopbuilder' ),
55 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
56 'default' => 'yes',
57 ];
58
59 $fields['show_short_desc'] = [
60 'type' => 'switch',
61 'label' => esc_html__( 'Show Short Description?', 'shopbuilder' ),
62 'description' => esc_html__( 'Switch on to show product short description.', 'shopbuilder' ),
63 'label_on' => esc_html__( 'On', 'shopbuilder' ),
64 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
65 'condition' => [ 'layout!' => [ 'grid-layout2', 'slider-layout2' ] ],
66 ];
67
68 $fields['show_price'] = [
69 'type' => 'switch',
70 'label' => esc_html__( 'Show Product Price?', 'shopbuilder' ),
71 'description' => esc_html__( 'Switch on to show product price.', 'shopbuilder' ),
72 'label_on' => esc_html__( 'On', 'shopbuilder' ),
73 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
74 'default' => 'yes',
75 ];
76
77 $fields['show_rating'] = [
78 'type' => 'switch',
79 'label' => esc_html__( 'Show Product Rating?', 'shopbuilder' ),
80 'description' => esc_html__( 'Switch on to show product rating.', 'shopbuilder' ),
81 'label_on' => esc_html__( 'On', 'shopbuilder' ),
82 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
83 'default' => 'yes',
84 ];
85
86 $fields['show_badges'] = [
87 'type' => 'switch',
88 'label' => esc_html__( 'Show Product Badges?', 'shopbuilder' ),
89 'description' => esc_html__( 'Switch on to show product badges.', 'shopbuilder' ),
90 'label_on' => esc_html__( 'On', 'shopbuilder' ),
91 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
92 'default' => 'yes',
93 ];
94
95 $fields['show_categories'] = [
96 'type' => 'switch',
97 'label' => esc_html__( 'Show Product Categories?', 'shopbuilder' ),
98 'description' => esc_html__( 'Switch on to show product categories.', 'shopbuilder' ),
99 'label_on' => esc_html__( 'On', 'shopbuilder' ),
100 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
101 'condition' => [ 'layout!' => [ 'grid-layout2', 'slider-layout2' ] ],
102 ];
103 $fields['show_brands'] = [
104 'type' => 'switch',
105 'label' => esc_html__( 'Show Product Brand?', 'shopbuilder' ),
106 'description' => esc_html__( 'Switch on to show product brand.', 'shopbuilder' ),
107 'label_on' => esc_html__( 'On', 'shopbuilder' ),
108 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
109 'condition' => [ 'layout!' => [ 'grid-layout2', 'slider-layout2' ] ],
110 ];
111 $fields['single_brand'] = [
112 'type' => 'switch',
113 'label' => esc_html__( 'Show Only First Brand?', 'shopbuilder' ),
114 'description' => esc_html__( 'Switch on to show only the first brand.', 'shopbuilder' ),
115 'label_on' => esc_html__( 'On', 'shopbuilder' ),
116 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
117 'default' => 'yes',
118 'condition' => [
119 'show_brands' => [ 'yes' ],
120 'layout!' => [ 'grid-layout2', 'slider-layout2' ],
121 ],
122 ];
123 $fields['single_category'] = [
124 'type' => 'switch',
125 'label' => esc_html__( 'Show Only First Category?', 'shopbuilder' ),
126 'description' => esc_html__( 'Switch on to show only the first category.', 'shopbuilder' ),
127 'label_on' => esc_html__( 'On', 'shopbuilder' ),
128 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
129 'default' => 'yes',
130 'condition' => [
131 'show_categories' => [ 'yes' ],
132 'layout!' => [ 'grid-layout2', 'slider-layout2' ],
133 ],
134 ];
135 if ( function_exists( 'rtwpvsp' ) || ( Fns::is_module_active( 'variation_swatches' ) && 'on' === SwatchesFns::get_options( 'enable_showcase_swatches' ) ) ) {
136 $fields['show_swatches'] = [
137 'type' => 'switch',
138 'label' => esc_html__( 'Show Variation Swatches?', 'shopbuilder' ),
139 'description' => esc_html__( 'Switch on to show variation swatches.', 'shopbuilder' ),
140 'label_on' => esc_html__( 'On', 'shopbuilder' ),
141 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
142 'default' => 'yes',
143 'condition' => [ 'layout!' => [ 'grid-layout2', 'slider-layout2' ] ],
144 ];
145
146 $fields['show_vs_clear_btn'] = [
147 'type' => 'switch',
148 'label' => esc_html__( 'Show Swatches Reset?', 'shopbuilder' ),
149 'description' => esc_html__( 'Switch on to show swatches clear button.', 'shopbuilder' ),
150 'label_on' => esc_html__( 'On', 'shopbuilder' ),
151 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
152 'separator' => 'default',
153 'condition' => [
154 'show_swatches' => [ 'yes' ],
155 'layout!' => [ 'grid-layout2', 'slider-layout2' ],
156 ],
157 ];
158 }
159
160 $fields['action_btn_visibility'] = $obj->el_heading( esc_html__( 'Action Buttons Visibility', 'shopbuilder' ), 'before' );
161
162 $fields['show_add_to_cart'] = [
163 'type' => 'switch',
164 'label' => esc_html__( 'Show Add to Cart Button?', 'shopbuilder' ),
165 'description' => esc_html__( 'Switch on to show product add to cart.', 'shopbuilder' ),
166 'label_on' => esc_html__( 'On', 'shopbuilder' ),
167 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
168 'default' => 'yes',
169 ];
170
171 $wishlist = Fns::get_options( 'modules', 'wishlist' );
172 $compare = Fns::get_options( 'modules', 'compare' );
173 $quick_view = Fns::get_options( 'modules', 'quick_view' );
174
175 if ( 'on' === ( $wishlist['active'] ?? '' ) ) {
176 $fields['show_wishlist'] = [
177 'type' => 'switch',
178 'label' => esc_html__( 'Show Wishlist Button?', 'shopbuilder' ),
179 'description' => esc_html__( 'Switch on to show product wishlist.', 'shopbuilder' ),
180 'label_on' => esc_html__( 'On', 'shopbuilder' ),
181 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
182 'default' => 'yes',
183 ];
184 }
185
186 if ( 'on' === ( $quick_view['active'] ?? '' ) ) {
187 $fields['show_quick_view'] = [
188 'type' => 'switch',
189 'label' => esc_html__( 'Show Quick View Button?', 'shopbuilder' ),
190 'description' => esc_html__( 'Switch on to show product quick view.', 'shopbuilder' ),
191 'label_on' => esc_html__( 'On', 'shopbuilder' ),
192 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
193 'default' => 'yes',
194 ];
195 }
196
197 if ( 'on' === ( $compare['active'] ?? '' ) ) {
198 $fields['show_compare'] = [
199 'type' => 'switch',
200 'label' => esc_html__( 'Show Compare Button?', 'shopbuilder' ),
201 'description' => esc_html__( 'Switch on to show product compare.', 'shopbuilder' ),
202 'label_on' => esc_html__( 'On', 'shopbuilder' ),
203 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
204 ];
205 }
206
207 $fields['visibility_section_end'] = $obj->end_section();
208 return apply_filters( 'rtsb/elements/elementor/visibility_control', $fields, $obj );
209 }
210
211 /**
212 * Content ordering section
213 *
214 * @param object $obj Reference object.
215 *
216 * @return array
217 */
218 public static function content_ordering( $obj ) {
219 $fields['ordering_section'] = $obj->start_section(
220 esc_html__( 'Content Ordering', 'shopbuilder' ),
221 self::$tab
222 );
223
224 $fields['ordering_note'] = [
225 'type' => 'html',
226 'raw' => '',
227 'content_classes' => 'elementor-panel-heading-title',
228 ];
229
230 $fields['custom_ordering'] = [
231 'type' => 'switch',
232 'label' => esc_html__( 'Enable Custom Ordering?', 'shopbuilder' ),
233 'description' => esc_html__( 'Switch on to enable elements custom ordering.', 'shopbuilder' ),
234 'label_on' => esc_html__( 'On', 'shopbuilder' ),
235 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
236 'separator' => $obj->pro_class(),
237 'classes' => $obj->pro_class(),
238 'condition' => [
239 'layout!' => [ 'grid-layout4', 'list-layout5', 'list-layout6', 'slider-layout4', 'slider-layout8' ],
240 ],
241 ];
242
243 $fields['ordering_section_end'] = $obj->end_section();
244
245 return apply_filters( 'rtsb/elementor/ordering_control', $fields, $obj );
246 }
247
248 /**
249 * Action buttons section
250 *
251 * @param object $obj Reference object.
252 *
253 * @return array
254 */
255 public static function action_buttons( $obj ) {
256 $fields['action_visibility_section'] = $obj->start_section(
257 esc_html__( 'Action Buttons', 'shopbuilder' ),
258 self::$tab
259 );
260
261 $fields['add_to_cart_note'] = $obj->el_heading(
262 esc_html__( 'Add to Cart Button', 'shopbuilder' ),
263 'default',
264 [],
265 [ 'show_add_to_cart' => [ 'yes' ] ]
266 );
267
268 $fields['show_cart_text'] = [
269 'type' => 'switch',
270 'label' => esc_html__( 'Show Add to Cart Text?', 'shopbuilder' ),
271 'description' => esc_html__( 'Switch on to show add to cart text.', 'shopbuilder' ),
272 'label_on' => esc_html__( 'On', 'shopbuilder' ),
273 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
274 'default' => 'yes',
275 'condition' => [ 'show_add_to_cart' => [ 'yes' ] ],
276 ];
277
278 $fields['add_to_cart_text'] = [
279 'type' => 'text',
280 'label' => esc_html__( 'Add to Cart Text', 'shopbuilder' ),
281 'default' => esc_html__( 'Add to Cart', 'shopbuilder' ),
282 'description' => esc_html__( 'Please enter the add to cart text.', 'shopbuilder' ),
283 'condition' => [
284 'show_cart_text' => [ 'yes' ],
285 'show_add_to_cart' => [ 'yes' ],
286 ],
287 'label_block' => true,
288 ];
289
290 $fields['add_to_cart_success_text'] = [
291 'type' => 'text',
292 'label' => esc_html__( 'Add to Cart Success Text', 'shopbuilder' ),
293 'default' => esc_html__( 'Added!', 'shopbuilder' ),
294 'description' => esc_html__( 'Please enter the add to cart success text.', 'shopbuilder' ),
295 'condition' => [
296 'show_cart_text' => [ 'yes' ],
297 'show_add_to_cart' => [ 'yes' ],
298 ],
299 'label_block' => true,
300 ];
301
302 $fields['show_cart_icon'] = [
303 'type' => 'switch',
304 'label' => esc_html__( 'Show Add to Cart Icon?', 'shopbuilder' ),
305 'description' => esc_html__( 'Switch on to show add to cart icon.', 'shopbuilder' ),
306 'label_on' => esc_html__( 'On', 'shopbuilder' ),
307 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
308 'default' => 'yes',
309 'condition' => [ 'show_add_to_cart' => [ 'yes' ] ],
310 ];
311
312 $fields['add_to_cart_icon'] = [
313 'type' => 'icons',
314 'label' => esc_html__( 'Choose Add to Cart Icon', 'shopbuilder' ),
315 'default' => [
316 'value' => 'rtsb-icon rtsb-icon-cart',
317 'library' => 'rtsb-fonts',
318 ],
319 'condition' => [
320 'show_cart_icon' => [ 'yes' ],
321 'show_add_to_cart' => [ 'yes' ],
322 ],
323 ];
324
325 $fields['add_to_cart_success_icon'] = [
326 'type' => 'icons',
327 'label' => esc_html__( 'Choose Add to Cart Success Icon', 'shopbuilder' ),
328 'default' => [
329 'value' => 'rtsb-icon rtsb-icon-check',
330 'library' => 'rtsb-fonts',
331 ],
332 'condition' => [
333 'show_cart_icon' => [ 'yes' ],
334 'show_add_to_cart' => [ 'yes' ],
335 ],
336 ];
337
338 $fields['wishlist_note'] = $obj->el_heading(
339 esc_html__( 'Wishlist Button', 'shopbuilder' ),
340 'before',
341 [],
342 [ 'show_wishlist' => [ 'yes' ] ]
343 );
344
345 $fields['show_wishlist_text'] = [
346 'type' => 'switch',
347 'label' => esc_html__( 'Show Wishlist Text?', 'shopbuilder' ),
348 'description' => esc_html__( 'Switch on to show wishlist text.', 'shopbuilder' ),
349 'label_on' => esc_html__( 'On', 'shopbuilder' ),
350 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
351 'default' => false,
352 'condition' => [ 'show_wishlist' => [ 'yes' ] ],
353 ];
354 $fields['show_wishlist_icon'] = [
355 'type' => 'switch',
356 'label' => esc_html__( 'Show Wishlist Icon?', 'shopbuilder' ),
357 'description' => esc_html__( 'Switch on to show wishlist icon.', 'shopbuilder' ),
358 'label_on' => esc_html__( 'On', 'shopbuilder' ),
359 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
360 'default' => 'yes',
361 'condition' => [ 'show_wishlist' => [ 'yes' ] ],
362 ];
363 $fields['wishlist_icon'] = [
364 'type' => 'icons',
365 'label' => esc_html__( 'Choose Wishlist Icon', 'shopbuilder' ),
366 'default' => [
367 'value' => 'rtsb-icon rtsb-icon-heart-empty',
368 'library' => 'rtsb-fonts',
369 ],
370 'condition' => [
371 'show_wishlist' => [ 'yes' ],
372 'show_wishlist_icon' => [ 'yes' ],
373 ],
374 ];
375
376 $fields['wishlist_icon_added'] = [
377 'type' => 'icons',
378 'label' => esc_html__( 'Choose Wishlist Success Icon', 'shopbuilder' ),
379 'default' => [
380 'value' => 'rtsb-icon rtsb-icon-heart',
381 'library' => 'rtsb-fonts',
382 ],
383 'condition' => [ 'show_wishlist' => [ 'yes' ] ],
384 ];
385
386 $fields['quick_view_note'] = $obj->el_heading(
387 esc_html__( 'Quick View Button', 'shopbuilder' ),
388 'before',
389 [],
390 [ 'show_quick_view' => [ 'yes' ] ]
391 );
392 $fields['show_quick_view_text'] = [
393 'type' => 'switch',
394 'label' => esc_html__( 'Show Quick View Text?', 'shopbuilder' ),
395 'description' => esc_html__( 'Switch on to show quick view text.', 'shopbuilder' ),
396 'label_on' => esc_html__( 'On', 'shopbuilder' ),
397 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
398 'default' => false,
399 'condition' => [ 'show_quick_view' => [ 'yes' ] ],
400 ];
401 $fields['show_quick_view_icon'] = [
402 'type' => 'switch',
403 'label' => esc_html__( 'Show Quick View Icon?', 'shopbuilder' ),
404 'description' => esc_html__( 'Switch on to show quick view icon.', 'shopbuilder' ),
405 'label_on' => esc_html__( 'On', 'shopbuilder' ),
406 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
407 'default' => 'yes',
408 'condition' => [ 'show_quick_view' => [ 'yes' ] ],
409 ];
410 $fields['quick_view_icon'] = [
411 'type' => 'icons',
412 'label' => esc_html__( 'Choose Quick View Icon', 'shopbuilder' ),
413 'default' => [
414 'value' => 'rtsb-icon rtsb-icon-eye',
415 'library' => 'rtsb-fonts',
416 ],
417 'condition' => [
418 'show_quick_view' => [ 'yes' ],
419 'show_quick_view_icon' => [ 'yes' ],
420 ],
421 ];
422
423 $fields['compare_note'] = $obj->el_heading(
424 esc_html__( 'Compare Button', 'shopbuilder' ),
425 'before',
426 [],
427 [ 'show_compare' => [ 'yes' ] ]
428 );
429 $fields['show_compare_text'] = [
430 'type' => 'switch',
431 'label' => esc_html__( 'Show Compare Text?', 'shopbuilder' ),
432 'description' => esc_html__( 'Switch on to show compare text.', 'shopbuilder' ),
433 'label_on' => esc_html__( 'On', 'shopbuilder' ),
434 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
435 'default' => false,
436 'condition' => [ 'show_compare' => [ 'yes' ] ],
437 ];
438 $fields['show_compare_icon'] = [
439 'type' => 'switch',
440 'label' => esc_html__( 'Show Compare Icon?', 'shopbuilder' ),
441 'description' => esc_html__( 'Switch on to show compare icon.', 'shopbuilder' ),
442 'label_on' => esc_html__( 'On', 'shopbuilder' ),
443 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
444 'default' => 'yes',
445 'condition' => [ 'show_compare' => [ 'yes' ] ],
446 ];
447 $fields['comparison_icon'] = [
448 'type' => 'icons',
449 'label' => esc_html__( 'Choose Compare Icon', 'shopbuilder' ),
450 'default' => [
451 'value' => 'rtsb-icon rtsb-icon-exchange',
452 'library' => 'rtsb-fonts',
453 ],
454 'condition' => [
455 'show_compare' => [ 'yes' ],
456 'show_compare_icon' => [ 'yes' ],
457 ],
458 ];
459
460 $fields['comparison_icon_added'] = [
461 'type' => 'icons',
462 'label' => esc_html__( 'Choose Compare Success Icon', 'shopbuilder' ),
463 'default' => [
464 'value' => 'rtsb-icon rtsb-icon-check',
465 'library' => 'rtsb-fonts',
466 ],
467 'condition' => [ 'show_compare' => [ 'yes' ] ],
468 ];
469
470 $fields['action_visibility_section_end'] = $obj->end_section();
471
472 return apply_filters( 'rtsb/elements/elementor/action_buttons', $fields, $obj );
473 }
474
475 /**
476 * Category Visibility section
477 *
478 * @param object $obj Reference object.
479 *
480 * @return array
481 */
482 public static function cat_content_visibility( $obj ) {
483 $status = ! rtsb()->has_pro();
484 $fields['cat_visibility_section'] = $obj->start_section(
485 esc_html__( 'Content Visibility', 'shopbuilder' ),
486 self::$tab
487 );
488
489 $fields['show_title'] = [
490 'type' => 'switch',
491 'label' => esc_html__( 'Show Category Title?', 'shopbuilder' ),
492 'description' => esc_html__( 'Switch on to show category title.', 'shopbuilder' ),
493 'label_on' => esc_html__( 'On', 'shopbuilder' ),
494 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
495 'default' => 'yes',
496 ];
497
498 $fields['show_short_desc'] = [
499 'type' => 'switch',
500 'label' => esc_html__( 'Show Category Description?', 'shopbuilder' ),
501 'description' => esc_html__( 'Switch on to show category description.', 'shopbuilder' ),
502 'label_on' => esc_html__( 'On', 'shopbuilder' ),
503 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
504 ];
505
506 $fields['show_count'] = [
507 'type' => 'switch',
508 'label' => esc_html__( 'Show Product Count?', 'shopbuilder' ),
509 'description' => esc_html__( 'Switch on to show product count.', 'shopbuilder' ),
510 'label_on' => esc_html__( 'On', 'shopbuilder' ),
511 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
512 'default' => 'yes',
513 ];
514
515 $fields['show_badges'] = [
516 'type' => 'switch',
517 'label' => esc_html__( 'Show Custom Badge?', 'shopbuilder' ),
518 'description' => esc_html__( 'Switch on to show custom category badge.', 'shopbuilder' ),
519 'label_on' => esc_html__( 'On', 'shopbuilder' ),
520 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
521 'default' => 'yes',
522 'condition' => [ 'layout!' => [ 'category-layout1', 'category-layout2' ] ],
523 ];
524
525 if ( 'rtsb-product-categories-general' === $obj->rtsb_base ) {
526 $fields['show_count']['separator'] = rtsb()->has_pro() ? 'default' : 'after';
527
528 $fields['active_cat_slider'] = [
529 'type' => 'switch',
530 'label' => esc_html__( 'Active Category Slider?', 'shopbuilder' ),
531 'description' => esc_html__( 'Switch on to active category slider.', 'shopbuilder' ),
532 'label_on' => esc_html__( 'On', 'shopbuilder' ),
533 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
534 'classes' => $obj->pro_class(),
535 'is_pro' => $status,
536 ];
537 }
538
539 $fields['cat_visibility_section_end'] = $obj->end_section();
540
541 return $fields;
542 }
543
544 /**
545 * Image section
546 *
547 * @param object $obj Reference object.
548 *
549 * @return array
550 */
551 public static function image( $obj ) {
552 $fields['image_section'] = $obj->start_section(
553 esc_html__( 'Product Images', 'shopbuilder' ),
554 'settings'
555 );
556
557 $fields['show_featured_image'] = [
558 'type' => 'switch',
559 'label' => esc_html__( 'Display Featured Image?', 'shopbuilder' ),
560 'description' => esc_html__( 'Switch on to display featured image.', 'shopbuilder' ),
561 'label_on' => esc_html__( 'On', 'shopbuilder' ),
562 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
563 'default' => 'yes',
564 'separator' => rtsb()->has_pro() ? 'default' : 'after',
565 ];
566
567 $fields['show_product_gallery'] = [
568 'type' => 'switch',
569 'label' => esc_html__( 'Activate Product Image Gallery Slider', 'shopbuilder' ),
570 'description' => esc_html__( 'Switch on to display product image gallery slider.', 'shopbuilder' ),
571 'classes' => $obj->pro_class(),
572 'condition' => [
573 'show_featured_image' => [ 'yes' ],
574 'grid_style!' => [ 'masonry' ],
575 ],
576 ];
577
578 $fields['show_product_gallery_thumb'] = [
579 'type' => 'switch',
580 'label' => esc_html__( 'Activate Image Gallery Thumbnail', 'shopbuilder' ),
581 'description' => esc_html__( 'Switch on to display product image gallery thumbnail slider.', 'shopbuilder' ),
582 'classes' => $obj->pro_class(),
583 'condition' => [
584 'show_featured_image' => [ 'yes' ],
585 'show_product_gallery' => [ 'yes' ],
586 'grid_style!' => [ 'masonry' ],
587 ],
588 ];
589
590 $fields['show_hover_image'] = [
591 'type' => 'switch',
592 'label' => esc_html__( 'Display Gallery Image on Hover?', 'shopbuilder' ),
593 'description' => __( 'Switch on to display gallery image on hover. <br /><b>Note: </b>It will display the first gallery image on hover.', 'shopbuilder' ) . ( ( function_exists( 'rtwpvsp' ) || rtsb()->has_pro() ) ? esc_html__( ' It will not work if variation swatches are enabled.', 'shopbuilder' ) : '' ),
594 'label_on' => esc_html__( 'On', 'shopbuilder' ),
595 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
596 'separator' => rtsb()->has_pro() ? 'default' : 'before-short',
597 'default' => 'yes',
598 'condition' => rtsb()->has_pro() ? [
599 'show_featured_image' => [ 'yes' ],
600 'show_product_gallery!' => [ 'yes' ],
601 ] : [ 'show_featured_image' => [ 'yes' ] ],
602 ];
603
604 $fields['image_hover_animation'] = [
605 'type' => 'select2',
606 'label' => esc_html__( 'Image Hover Animation', 'shopbuilder' ),
607 'description' => esc_html__( 'Please choose image hover animation.', 'shopbuilder' ),
608 'options' => [
609 'zoom_in' => esc_html__( 'Zoom In', 'shopbuilder' ),
610 'zoom_out' => esc_html__( 'Zoom Out', 'shopbuilder' ),
611 'none' => esc_html__( 'None', 'shopbuilder' ),
612 ],
613 'label_block' => true,
614 'condition' => [ 'show_featured_image' => [ 'yes' ] ],
615 'default' => 'zoom_in',
616 'separator' => rtsb()->has_pro() ? 'default' : 'after',
617 ];
618
619 $fields['gallery_hover_animation'] = [
620 'type' => 'select2',
621 'label' => esc_html__( 'Gallery Image Hover Animation', 'shopbuilder' ),
622 'description' => esc_html__( 'Please choose gallery image hover animation.', 'shopbuilder' ),
623 'options' => [
624 'fade' => esc_html__( 'Default (Fade)', 'shopbuilder' ),
625 'slide' => esc_html__( 'Slide Up', 'shopbuilder' ),
626 'slide-down' => esc_html__( 'Slide Down', 'shopbuilder' ),
627 'slide-left' => esc_html__( 'Slide Left', 'shopbuilder' ),
628 'slide-right' => esc_html__( 'Slide Right', 'shopbuilder' ),
629 ],
630 'label_block' => true,
631 'condition' => rtsb()->has_pro() ? [
632 'show_featured_image' => [ 'yes' ],
633 'show_hover_image' => [ 'yes' ],
634 'show_product_gallery!' => [ 'yes' ],
635 ] : [
636 'show_featured_image' => [ 'yes' ],
637 'show_hover_image' => [ 'yes' ],
638 ],
639 'default' => 'fade',
640 'classes' => $obj->pro_class(),
641 ];
642
643 $fields['image_size_note'] = $obj->el_heading(
644 esc_html__( 'Image Size', 'shopbuilder' ),
645 'before',
646 [],
647 [ 'show_featured_image' => [ 'yes' ] ]
648 );
649
650 $fields = array_merge( $fields, self::image_size_controls( 'grid' ) );
651
652 $fields['thumb_image_note'] = $obj->el_heading(
653 esc_html__( 'Thumbnail Slider', 'shopbuilder' ),
654 'before',
655 [],
656 [
657 'show_featured_image' => [ 'yes' ],
658 'show_product_gallery' => [ 'yes' ],
659 'show_product_gallery_thumb' => [ 'yes' ],
660 'grid_style!' => [ 'masonry' ],
661 ],
662 );
663 $fields['gallery_thumb_column_number'] = [
664 'label' => esc_html__( 'Gallery Thumb Image Column', 'shopbuilder' ),
665 'classes' => $obj->pro_class(),
666 'type' => 'slider',
667 'size_units' => [ 'px' ],
668 'range' => [
669 'px' => [
670 'min' => 2,
671 'max' => 10,
672 'step' => 1,
673 ],
674 ],
675 'default' => [
676 'size' => 3,
677 ],
678 'condition' => [
679 'show_featured_image' => [ 'yes' ],
680 'show_product_gallery' => [ 'yes' ],
681 'show_product_gallery_thumb' => [ 'yes' ],
682 'grid_style!' => [ 'masonry' ],
683 ],
684 ];
685 $fields['gallery_thumb_column_gap'] = [
686 'label' => esc_html__( 'Gallery Thumb Column Gap', 'shopbuilder' ),
687 'classes' => $obj->pro_class(),
688 'type' => 'slider',
689 'size_units' => [ 'px' ],
690 'range' => [
691 'px' => [
692 'min' => 2,
693 'max' => 30,
694 'step' => 1,
695 ],
696 ],
697 'default' => [
698 'size' => 10,
699 ],
700 'condition' => [
701 'show_featured_image' => [ 'yes' ],
702 'show_product_gallery' => [ 'yes' ],
703 'show_product_gallery_thumb' => [ 'yes' ],
704 'grid_style!' => [ 'masonry' ],
705 ],
706 ];
707
708 $fields['thumb_image_section_end'] = $obj->end_section();
709 return $fields;
710 }
711
712 /**
713 * Category Image section
714 *
715 * @param object $obj Reference object.
716 *
717 * @return array
718 */
719 public static function cat_image( $obj ) {
720 $fields['cat_image_section'] = $obj->start_section(
721 esc_html__( 'Image', 'shopbuilder' ),
722 self::$tab
723 );
724
725 $fields['show_cat_image'] = [
726 'type' => 'switch',
727 'label' => esc_html__( 'Display Category Image?', 'shopbuilder' ),
728 'description' => esc_html__( 'Switch on to display category image.', 'shopbuilder' ),
729 'label_on' => esc_html__( 'On', 'shopbuilder' ),
730 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
731 'default' => 'yes',
732 ];
733
734 $fields['show_custom_image'] = [
735 'type' => 'switch',
736 'label' => esc_html__( 'Add Custom Image?', 'shopbuilder' ),
737 'description' => esc_html__( 'Switch on to select a custom category image. Setting a custom image will override the category image.', 'shopbuilder' ),
738 'label_on' => esc_html__( 'On', 'shopbuilder' ),
739 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
740 'classes' => $obj->pro_class(),
741 ];
742
743 $fields['custom_image'] = [
744 'type' => 'media',
745 'label' => esc_html__( 'Upload Custom Image', 'shopbuilder' ),
746 'description' => esc_html__( 'Please choose the custom category image. It will override the default image.', 'shopbuilder' ),
747 'label_on' => esc_html__( 'On', 'shopbuilder' ),
748 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
749 'condition' => [
750 'show_custom_image' => [ 'yes' ],
751 'layout' => [ 'category-single-layout1', 'category-single-layout2' ],
752 ],
753 'default' => [
754 'url' => \Elementor\Utils::get_placeholder_image_src(),
755 ],
756 ];
757
758 $fields['show_overlay'] = [
759 'type' => 'switch',
760 'label' => esc_html__( 'Enable Image Overlay?', 'shopbuilder' ),
761 'description' => esc_html__( 'Switch on to enable image overlay.', 'shopbuilder' ),
762 'label_on' => esc_html__( 'On', 'shopbuilder' ),
763 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
764 'separator' => 'before',
765 'condition' => [
766 'layout' => [ 'category-single-layout1' ],
767 ],
768 ];
769
770 $fields['image_hover_animation'] = [
771 'type' => 'select2',
772 'label' => esc_html__( 'Image Hover Animation', 'shopbuilder' ),
773 'description' => esc_html__( 'Please choose image hover animation.', 'shopbuilder' ),
774 'options' => [
775 'zoom_in' => esc_html__( 'Zoom In', 'shopbuilder' ),
776 'zoom_out' => esc_html__( 'Zoom Out', 'shopbuilder' ),
777 'none' => esc_html__( 'None', 'shopbuilder' ),
778 ],
779 'label_block' => true,
780 'condition' => [
781 'show_cat_image' => [ 'yes' ],
782 'layout!' => [ 'category-layout4' ],
783 ],
784 'default' => 'zoom_in',
785 'separator' => rtsb()->has_pro() ? 'default' : 'before-short',
786 ];
787
788 $fields['cat_image_size_note'] = $obj->el_heading(
789 esc_html__( 'Image Size', 'shopbuilder' ),
790 'before',
791 [],
792 [ 'show_cat_image' => [ 'yes' ] ]
793 );
794
795 $fields = array_merge( $fields, self::image_size_controls( 'catgory' ) );
796
797 $fields['cat_image_section_end'] = $obj->end_section();
798
799 return apply_filters( 'rtsb/elements/elementor/cat_image_control', $fields, $obj );
800 }
801
802 /**
803 * Image Size Controls.
804 *
805 * @param string $type Type.
806 *
807 * @return array
808 */
809 public static function image_size_controls( $type ) {
810 $conditions = [
811 'relation' => 'and',
812 'terms' => [],
813 ];
814
815 if ( 'grid' === $type ) {
816 $conditions['terms'][] = [
817 'relation' => 'or',
818 'terms' => [
819 [
820 'name' => 'show_featured_image',
821 'operator' => '==',
822 'value' => 'yes',
823 ],
824 ],
825 ];
826 } else {
827 $conditions['terms'][] = [
828 'relation' => 'or',
829 'terms' => [
830 [
831 'name' => 'show_cat_image',
832 'operator' => '==',
833 'value' => 'yes',
834 ],
835 [
836 'name' => 'show_custom_image',
837 'operator' => '==',
838 'value' => 'yes',
839 ],
840 ],
841 ];
842 }
843
844 $fields['image'] = [
845 'type' => 'select2',
846 'label' => esc_html__( 'Select Image Size', 'shopbuilder' ),
847 'description' => esc_html__( 'Please select the image size.', 'shopbuilder' ),
848 'options' => Fns::get_image_sizes(),
849 'default' => 'woocommerce_thumbnail',
850 'label_block' => true,
851 'content_classes' => 'elementor-descriptor',
852 'conditions' => $conditions,
853 ];
854
855 $conditions['terms'][] = [
856 'relation' => 'or',
857 'terms' => [
858 [
859 'name' => 'image',
860 'operator' => '==',
861 'value' => 'rtsb_custom',
862 ],
863 ],
864 ];
865
866 $fields['image_custom_dimension'] = [
867 'type' => 'image-dimensions',
868 'label' => esc_html__( 'Enter Custom Image Size', 'shopbuilder' ),
869 'label_block' => true,
870 'show_label' => true,
871 'default' => [
872 'width' => 400,
873 'height' => 400,
874 ],
875 'conditions' => $conditions,
876 ];
877
878 $fields['image_crop'] = [
879 'type' => 'select2',
880 'label' => esc_html__( 'Image Crop', 'shopbuilder' ),
881 'description' => esc_html__( 'Please click on "Apply" to update the image.', 'shopbuilder' ),
882 'options' => [
883 'soft' => esc_html__( 'Soft Crop', 'shopbuilder' ),
884 'hard' => esc_html__( 'Hard Crop', 'shopbuilder' ),
885 ],
886 'default' => 'hard',
887 'conditions' => $conditions,
888 ];
889
890 $fields['image_custom_dimension_note'] = [
891 'type' => 'html',
892 'raw' => sprintf(
893 '<span style="display: block; background: #fffbf1; padding: 10px; font-weight: 500; line-height: 1.4; color: #bd3a3a;border: 1px solid #bd3a3a;">%s</span>',
894 esc_html__( 'Please note that, if you enter image size larger than the actual image itself, the image sizes will fallback to the full image dimension.', 'shopbuilder' )
895 ),
896 'conditions' => $conditions,
897 ];
898
899 // Variation swatch (showcase) images render at their own size, so the custom
900 // image size above does not apply to them. Self-gate on the `show_swatches`
901 // control rather than a hardcoded widget/type allow-list: that control is the
902 // codebase's universal marker for swatch-capable widgets — defined in the
903 // product-loop visibility section (SettingsFields::content_visibility) and also
904 // injected by RtwpvsSupport when the RTWPVS plugin is active. An Elementor
905 // condition that references an absent control stays unmet, so the note never
906 // surfaces on the category image size or any non-swatch widget.
907 $swatch_note_conditions = $conditions;
908
909 $swatch_note_conditions['terms'][] = [
910 'relation' => 'or',
911 'terms' => [
912 [
913 'name' => 'show_swatches',
914 'operator' => '==',
915 'value' => 'yes',
916 ],
917 ],
918 ];
919
920 $fields['image_custom_dimension_swatch_note'] = [
921 'type' => 'html',
922 'raw' => sprintf(
923 '<span style="display: block; background: #fffbf1; padding: 10px; font-weight: 500; line-height: 1.4; color: #bd3a3a;border: 1px solid #bd3a3a;">%s</span>',
924 esc_html__( 'Note: this does not apply to variation swatch images.', 'shopbuilder' )
925 ),
926 'conditions' => $swatch_note_conditions,
927 ];
928
929 return $fields;
930 }
931
932 /**
933 * Slider section
934 *
935 * @param object $obj Reference object.
936 *
937 * @return array
938 */
939 public static function slider_settings( $obj ) {
940 $status = ! rtsb()->has_pro();
941
942 $fields['slider_control_section'] = $obj->start_section(
943 esc_html__( 'Slider Settings', 'shopbuilder' ),
944 self::$tab
945 );
946
947 $fields['slider_control_note'] = $obj->el_heading(
948 esc_html__( 'Controls', 'shopbuilder' ),
949 'default'
950 );
951
952 $fields['slider_nav'] = [
953 'type' => 'switch',
954 'label' => esc_html__( 'Navigation Arrows', 'shopbuilder' ),
955 'label_on' => esc_html__( 'On', 'shopbuilder' ),
956 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
957 'description' => esc_html__( 'Switch on to enable slider navigation arrows.', 'shopbuilder' ),
958 'default' => 'yes',
959 ];
960
961 $fields['slider_nav_position'] = [
962 'type' => 'select2',
963 'label' => esc_html__( 'Navigation Arrows Position', 'shopbuilder' ),
964 'options' => [
965 'top' => esc_html__( 'Top', 'shopbuilder' ),
966 'standard' => esc_html__( 'Middle', 'shopbuilder' ),
967 'bottom' => esc_html__( 'Bottom', 'shopbuilder' ),
968 ],
969 'description' => esc_html__( 'Please select the slider arrows position.', 'shopbuilder' ),
970 'default' => 'standard',
971 'label_block' => true,
972 'separator' => rtsb()->has_pro() ? 'default' : 'after',
973 'condition' => [ 'slider_nav' => [ 'yes' ] ],
974 ];
975
976 $fields['always_show_nav'] = [
977 'type' => 'switch',
978 'label' => esc_html__( 'Always Show Arrows', 'shopbuilder' ),
979 'label_on' => esc_html__( 'On', 'shopbuilder' ),
980 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
981 'description' => esc_html__( 'Switch on to enable always showing navigation arrows.', 'shopbuilder' ),
982 'classes' => $obj->pro_class(),
983 'is_pro' => $status,
984 'condition' => [ 'slider_nav' => [ 'yes' ] ],
985 ];
986
987 if ( rtsb()->has_pro() ) {
988 $fields['always_show_nav']['condition']['slider_nav_position'] = 'standard';
989 }
990
991 $fields['slider_left_arrow_icon'] = [
992 'label' => esc_html__( 'Left Arrow Icon', 'shopbuilder' ),
993 'description' => esc_html__( 'Please choose the slider left arrow icon.', 'shopbuilder' ),
994 'type' => 'icons',
995 'default' => [
996 'value' => 'fas fa-chevron-left',
997 'library' => 'fa-solid',
998 ],
999 'separator' => rtsb()->has_pro() ? 'default' : 'before-short',
1000 'condition' => [ 'slider_nav' => 'yes' ],
1001 ];
1002
1003 $fields['slider_right_arrow_icon'] = [
1004 'label' => esc_html__( 'Right Arrow Icon', 'shopbuilder' ),
1005 'description' => esc_html__( 'Please choose the slider right arrow icon.', 'shopbuilder' ),
1006 'type' => 'icons',
1007 'default' => [
1008 'value' => 'fas fa-chevron-right',
1009 'library' => 'fa-solid',
1010 ],
1011 'condition' => [ 'slider_nav' => 'yes' ],
1012 ];
1013
1014 $fields['slider_pagi'] = [
1015 'type' => 'switch',
1016 'label' => esc_html__( 'Dot Pagination', 'shopbuilder' ),
1017 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1018 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1019 'description' => esc_html__( 'Switch on to enable slider dot pagination.', 'shopbuilder' ),
1020 'default' => 'yes',
1021 ];
1022 $fields['slider_dynamic_pagi'] = [
1023 'type' => 'switch',
1024 'label' => esc_html__( 'Dynamic Pagination', 'shopbuilder' ),
1025 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1026 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1027 'description' => esc_html__( 'It will keep only few bullets visible at the same time.', 'shopbuilder' ),
1028 'condition' => [ 'slider_pagi' => 'yes' ],
1029 ];
1030 $fields['slider_loop'] = [
1031 'type' => 'switch',
1032 'label' => esc_html__( 'Infinite Loop', 'shopbuilder' ),
1033 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1034 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1035 'description' => esc_html__( 'Switch on to enable slider infinite loop.', 'shopbuilder' ),
1036 'condition' => [ 'tax_filter!' => [ 'yes' ] ],
1037 ];
1038
1039 $fields['slider_auto_height'] = [
1040 'type' => 'switch',
1041 'label' => esc_html__( 'Auto Height', 'shopbuilder' ),
1042 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1043 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1044 'description' => esc_html__( 'Switch on to enable slider dynamic height.', 'shopbuilder' ),
1045 ];
1046
1047 $fields['slider_lazy_load'] = [
1048 'type' => 'switch',
1049 'label' => esc_html__( 'Image Lazy Load', 'shopbuilder' ),
1050 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1051 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1052 'description' => esc_html__( 'Switch on to enable slider image lazy load.', 'shopbuilder' ),
1053 'condition' => [ 'tax_filter!' => [ 'yes' ] ],
1054 ];
1055
1056 $fields['slide_speed'] = [
1057 'type' => 'number',
1058 'label' => esc_html__( 'Slide Speed (in ms)', 'shopbuilder' ),
1059 'description' => esc_html__( 'Please enter the duration of transition between slides (in ms).', 'shopbuilder' ),
1060 'default' => 2000,
1061 'separator' => $status ? 'default elementor-control-separator-after' : 'default',
1062 ];
1063
1064 $fields['slider_slide_animation'] = [
1065 'type' => 'switch',
1066 'label' => esc_html__( 'Enable Slide Effect', 'shopbuilder' ),
1067 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1068 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1069 'description' => esc_html__( 'Switch on to enable zoom-in effect when sliding.', 'shopbuilder' ),
1070 'default' => '',
1071 'classes' => $obj->pro_class(),
1072 'is_pro' => $status,
1073 ];
1074
1075 $fields['slider_autoplay_note'] = $obj->el_heading(
1076 esc_html__( 'Autoplay', 'shopbuilder' ),
1077 'before'
1078 );
1079
1080 $fields['slide_autoplay'] = [
1081 'type' => 'switch',
1082 'label' => esc_html__( 'Enable Autoplay?', 'shopbuilder' ),
1083 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1084 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1085 'description' => esc_html__( 'Switch on to enable slider autoplay.', 'shopbuilder' ),
1086 'default' => 'yes',
1087 ];
1088
1089 $fields['pause_hover'] = [
1090 'type' => 'switch',
1091 'label' => esc_html__( 'Pause on Mouse Hover?', 'shopbuilder' ),
1092 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1093 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1094 'description' => esc_html__( 'Switch on to enable slider autoplay pause on mouse hover.', 'shopbuilder' ),
1095 'default' => 'yes',
1096 'condition' => [ 'slide_autoplay' => 'yes' ],
1097 ];
1098
1099 $fields['autoplay_timeout'] = [
1100 'type' => 'number',
1101 'label' => esc_html__( 'Autoplay Delay (in ms)', 'shopbuilder' ),
1102 'default' => 5000,
1103 'description' => esc_html__( 'Please select autoplay interval delay (in ms).', 'shopbuilder' ),
1104 'condition' => [ 'slide_autoplay' => 'yes' ],
1105 ];
1106
1107 $fields['slider_control_section_end'] = $obj->end_section();
1108
1109 return $fields;
1110 }
1111
1112 /**
1113 * Title section
1114 *
1115 * @param object $obj Reference object.
1116 *
1117 * @return array
1118 */
1119 public static function product_title( $obj ) {
1120 $condition = [
1121 'show_title' => [ 'yes' ],
1122 ];
1123
1124 $fields['product_title_section'] = $obj->start_section(
1125 esc_html__( 'Product Title', 'shopbuilder' ),
1126 self::$tab,
1127 [],
1128 $condition
1129 );
1130
1131 $fields['title_tag'] = [
1132 'type' => 'select2',
1133 'label' => esc_html__( 'Product Title Tag', 'shopbuilder' ),
1134 'options' => ControlHelper::heading_tags(),
1135 'label_block' => true,
1136 'default' => 'h3',
1137 'description' => esc_html__( 'Please select the product title tag.', 'shopbuilder' ),
1138 ];
1139 $fields['title_limit'] = [
1140 'type' => 'select2',
1141 'label' => esc_html__( 'Product Title Limit', 'shopbuilder' ),
1142 'options' => [
1143 'default' => esc_html__( 'Default', 'shopbuilder' ),
1144 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
1145 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
1146 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
1147 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
1148 ],
1149 'label_block' => true,
1150 'default' => 'default',
1151 'description' => esc_html__( 'Please select the product title limit.', 'shopbuilder' ),
1152 ];
1153
1154 $fields['title_limit_custom'] = [
1155 'type' => 'number',
1156 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
1157 'default' => 200,
1158 'description' => esc_html__( 'Please enter the product title character limit.', 'shopbuilder' ),
1159 'condition' => [ 'title_limit' => [ 'custom' ] ],
1160 ];
1161
1162 $fields['product_title_section_end'] = $obj->end_section();
1163
1164 return $fields;
1165 }
1166
1167 /**
1168 * Title section
1169 *
1170 * @param object $obj Reference object.
1171 *
1172 * @return array
1173 */
1174 public static function section_title( $obj ) {
1175 $condition = [
1176 'show_section_title' => [ 'yes' ],
1177 ];
1178
1179 $fields['section_title_section'] = $obj->start_section(
1180 esc_html__( 'Section Title', 'shopbuilder' ),
1181 self::$tab,
1182 [],
1183 $condition
1184 );
1185
1186 $fields['section_title_tag'] = [
1187 'type' => 'select2',
1188 'label' => esc_html__( 'Section Title Tag', 'shopbuilder' ),
1189 'options' => ControlHelper::heading_tags(),
1190 'label_block' => true,
1191 'default' => 'h2',
1192 'description' => esc_html__( 'Please select the section title tag.', 'shopbuilder' ),
1193 ];
1194
1195 $fields['section_title_text'] = [
1196 'type' => 'text',
1197 'label' => esc_html__( 'Section Title Text', 'shopbuilder' ),
1198 'default' => esc_html__( 'Section Title', 'shopbuilder' ),
1199 'description' => esc_html__( 'Please enter the section title text.', 'shopbuilder' ),
1200 'label_block' => true,
1201 ];
1202
1203 $fields['section_title_section_end'] = $obj->end_section();
1204
1205 return $fields;
1206 }
1207
1208 /**
1209 * Category Title section
1210 *
1211 * @param object $obj Reference object.
1212 *
1213 * @return array
1214 */
1215 public static function cat_title( $obj ) {
1216 $condition = [
1217 'show_title' => [ 'yes' ],
1218 ];
1219
1220 $fields['category_title_section'] = $obj->start_section(
1221 esc_html__( 'Category Title', 'shopbuilder' ),
1222 self::$tab,
1223 [],
1224 $condition
1225 );
1226
1227 $fields['title_tag'] = [
1228 'type' => 'select2',
1229 'label' => esc_html__( 'Category Title Tag', 'shopbuilder' ),
1230 'options' => ControlHelper::heading_tags(),
1231 'label_block' => true,
1232 'default' => 'h3',
1233 'description' => esc_html__( 'Please select the category title tag.', 'shopbuilder' ),
1234 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
1235 ];
1236
1237 $fields['show_custom_title'] = [
1238 'type' => 'switch',
1239 'label' => esc_html__( 'Enable Custom Title?', 'shopbuilder' ),
1240 'description' => esc_html__( 'Switch on to display alternate custom title.', 'shopbuilder' ),
1241 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1242 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1243 'classes' => $obj->pro_class(),
1244 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
1245 'condition' => [ 'layout' => [ 'category-single-layout1' ] ],
1246 ];
1247
1248 $fields['custom_title'] = [
1249 'type' => 'textarea',
1250 'label' => esc_html__( 'Alternate Custom Title', 'shopbuilder' ),
1251 'description' => esc_html__( 'Please enter an alternate custom title.', 'shopbuilder' ),
1252 'condition' => [
1253 'show_custom_title' => [ 'yes' ],
1254 'layout' => [ 'category-single-layout1' ],
1255 ],
1256 'classes' => $obj->pro_class(),
1257 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
1258 ];
1259
1260 $fields['title_limit'] = [
1261 'type' => 'select2',
1262 'label' => esc_html__( 'Category Title Limit', 'shopbuilder' ),
1263 'options' => [
1264 'default' => esc_html__( 'Default', 'shopbuilder' ),
1265 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
1266 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
1267 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
1268 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
1269 ],
1270 'label_block' => true,
1271 'default' => 'default',
1272 'separator' => rtsb()->has_pro() ? 'default' : 'before',
1273 'description' => esc_html__( 'Please select the category title limit.', 'shopbuilder' ),
1274 ];
1275
1276 $fields['title_limit_custom'] = [
1277 'type' => 'number',
1278 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
1279 'default' => 200,
1280 'description' => esc_html__( 'Please select the category title custom limit.', 'shopbuilder' ),
1281 'condition' => [ 'title_limit' => [ 'custom' ] ],
1282 ];
1283
1284 $fields['category_title_section_end'] = $obj->end_section();
1285
1286 return $fields;
1287 }
1288
1289 /**
1290 * Excerpt section
1291 *
1292 * @param object $obj Reference object.
1293 *
1294 * @return array
1295 */
1296 public static function product_excerpt( $obj ) {
1297 $condition = [
1298 'show_short_desc' => [ 'yes' ],
1299 ];
1300
1301 $fields['product_excerpt_section'] = $obj->start_section(
1302 esc_html__( 'Short Description', 'shopbuilder' ),
1303 self::$tab,
1304 [],
1305 $condition
1306 );
1307
1308 $fields['excerpt_limit'] = [
1309 'type' => 'select2',
1310 'label' => esc_html__( 'Short Description Limit', 'shopbuilder' ),
1311 'description' => esc_html__( 'Please select the product short description limit.', 'shopbuilder' ),
1312 'options' => [
1313 'default' => esc_html__( 'Default', 'shopbuilder' ),
1314 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
1315 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
1316 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
1317 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
1318 ],
1319 'label_block' => true,
1320 'default' => 'default',
1321 ];
1322
1323 $fields['excerpt_limit_custom'] = [
1324 'type' => 'number',
1325 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
1326 'default' => 200,
1327 'description' => esc_html__( 'Please enter the product short description character limit.', 'shopbuilder' ),
1328 'condition' => [ 'excerpt_limit' => [ 'custom' ] ],
1329 ];
1330
1331 $fields['product_excerpt_section_end'] = $obj->end_section();
1332
1333 return $fields;
1334 }
1335
1336 /**
1337 * Category Excerpt section
1338 *
1339 * @param object $obj Reference object.
1340 *
1341 * @return array
1342 */
1343 public static function cat_excerpt( $obj ) {
1344 $condition = [
1345 'show_short_desc' => [ 'yes' ],
1346 ];
1347
1348 $fields['cat_excerpt_section'] = $obj->start_section(
1349 esc_html__( 'Category Description', 'shopbuilder' ),
1350 self::$tab,
1351 [],
1352 $condition
1353 );
1354
1355 $fields['desciption_note'] = [
1356 'type' => 'html',
1357 'raw' => '',
1358 'content_classes' => 'elementor-panel-heading-title',
1359 'condition' => [ 'layout' => [ 'category-single-layout1' ] ],
1360 ];
1361
1362 $fields['show_custom_description'] = [
1363 'type' => 'switch',
1364 'label' => esc_html__( 'Enable Custom Description?', 'shopbuilder' ),
1365 'description' => esc_html__( 'Switch on to display alternate custom description.', 'shopbuilder' ),
1366 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1367 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1368 'classes' => $obj->pro_class(),
1369 'separator' => rtsb()->has_pro() ? 'before-short' : $obj->pro_class(),
1370 'condition' => [ 'layout' => [ 'category-single-layout1' ] ],
1371 ];
1372
1373 $fields['custom_description'] = [
1374 'type' => 'textarea',
1375 'label' => esc_html__( 'Alternate Custom Description', 'shopbuilder' ),
1376 'description' => esc_html__( 'Please enter an alternate custom description.', 'shopbuilder' ),
1377 'condition' => [
1378 'show_custom_description' => [ 'yes' ],
1379 'layout' => [ 'category-single-layout1' ],
1380 ],
1381 'classes' => $obj->pro_class(),
1382 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
1383 ];
1384
1385 $fields['excerpt_position'] = [
1386 'type' => 'select2',
1387 'label' => esc_html__( 'Category Description Position', 'shopbuilder' ),
1388 'description' => esc_html__( 'Please select the category short description position.', 'shopbuilder' ),
1389 'options' => [
1390 'above' => esc_html__( 'Top', 'shopbuilder' ),
1391 'below' => esc_html__( 'Bottom', 'shopbuilder' ),
1392 ],
1393 'label_block' => true,
1394 'condition' => [ 'layout!' => [ 'category-layout2' ] ],
1395 'default' => 'below',
1396 ];
1397
1398 $fields['excerpt_limit'] = [
1399 'type' => 'select2',
1400 'label' => esc_html__( 'Category Description Limit', 'shopbuilder' ),
1401 'description' => esc_html__( 'Please select the category short description limit.', 'shopbuilder' ),
1402 'options' => [
1403 'default' => esc_html__( 'Default', 'shopbuilder' ),
1404 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
1405 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
1406 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
1407 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
1408 ],
1409 'label_block' => true,
1410 'default' => 'default',
1411 ];
1412
1413 $fields['excerpt_limit_custom'] = [
1414 'type' => 'number',
1415 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
1416 'default' => 200,
1417 'description' => esc_html__( 'Please select the category short description custom limit.', 'shopbuilder' ),
1418 'condition' => [ 'excerpt_limit' => [ 'custom' ] ],
1419 ];
1420
1421 $fields['cat_excerpt_section_end'] = $obj->end_section();
1422
1423 return $fields;
1424 }
1425
1426 /**
1427 * Variation swatch section
1428 *
1429 * @param object $obj Reference object.
1430 *
1431 * @return array
1432 */
1433 public static function variation_swatch( $obj ) {
1434 if ( ! function_exists( 'rtwpvsp' ) && ! rtsb()->has_pro() ) {
1435 return [];
1436 }
1437 $condition = [
1438 'show_swatches' => [ 'yes' ],
1439 ];
1440
1441 $fields['variation_swatch_section'] = $obj->start_section(
1442 esc_html__( 'Variation Swatches', 'shopbuilder' ),
1443 self::$tab,
1444 [],
1445 $condition
1446 );
1447
1448 $fields['swatch_position'] = [
1449 'type' => 'select2',
1450 'label' => esc_html__( 'Swatches Display Position', 'shopbuilder' ),
1451 'description' => esc_html__( 'Please select the variation swatches display position.', 'shopbuilder' ),
1452 'options' => [
1453 'top' => esc_html__( 'Top of Content', 'shopbuilder' ),
1454 'title' => esc_html__( 'With Product Title', 'shopbuilder' ),
1455 'price' => esc_html__( 'WIth Product Price', 'shopbuilder' ),
1456 ],
1457 'label_block' => true,
1458 'default' => 'top',
1459 ];
1460 if ( function_exists( 'rtwpvsp' ) ) {
1461 $fields['swatch_type'] = [
1462 'type' => 'select2',
1463 'label' => esc_html__( 'Color Swatches Type', 'shopbuilder' ),
1464 'description' => esc_html__( 'Please select the variation swatches display type (only work with color swatch).', 'shopbuilder' ),
1465 'options' => [
1466 'square' => esc_html__( 'Square', 'shopbuilder' ),
1467 'circle' => esc_html__( 'Circle', 'shopbuilder' ),
1468 ],
1469 'label_block' => true,
1470 'default' => 'square',
1471 ];
1472 }
1473 $fields['swatch_margin'] = [
1474 'mode' => 'responsive',
1475 'type' => 'dimensions',
1476 'label' => esc_html__( 'Margin', 'shopbuilder' ),
1477 'size_units' => [ 'px', '%', 'em' ],
1478 'selectors' => [ '{{WRAPPER}} .rtsb-swatches' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
1479 ];
1480
1481 $fields['variation_swatch_section_end'] = $obj->end_section();
1482
1483 return $fields;
1484 }
1485
1486 /**
1487 * Badge section
1488 *
1489 * @param object $obj Reference object.
1490 *
1491 * @return array
1492 */
1493 public static function badges( $obj ) {
1494 $condition = [
1495 'show_badges' => [ 'yes' ],
1496 'layout!' => [ 'category-layout1', 'category-layout2' ],
1497 ];
1498
1499 $fields['badges_section'] = $obj->start_section(
1500 esc_html__( 'Badges', 'shopbuilder' ),
1501 self::$tab,
1502 [],
1503 $condition
1504 );
1505 $fields['enable_badges_module'] = [
1506 'type' => 'switch',
1507 'label' => esc_html__( 'Enable Badges Module?', 'shopbuilder' ),
1508 'description' => esc_html__( 'Switch on to integrate Badge module.', 'shopbuilder' ),
1509 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1510 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1511 'condition' => [ 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ] ],
1512 ];
1513 $fields['badges_module_notice'] = [
1514 'type' => 'html',
1515 'raw' => sprintf(
1516 '<span style="display: block; background: #fffbf1; padding: 10px; line-height: 1.4; color: #bd3a3a; border: 1px solid #bd3a3a30;">%s</span>',
1517 sprintf(
1518 /* translators: 1: link to the Modules page */
1519 __(
1520 '<b>Note:</b> Badges Module needs to be enabled in the <a href="%1$s" target="_blank">ShopBuilder Modules Settings</a>. From there you can create and customize different badges.',
1521 'shopbuilder'
1522 ),
1523 esc_url( admin_url( 'admin.php?page=rtsb-settings' ) )
1524 )
1525 ),
1526 'separator' => rtsb()->has_pro() ? 'default' : 'after',
1527 'condition' => [ 'enable_badges_module' => [ 'yes' ] ],
1528 ];
1529
1530 $fields['badges_module_direction'] = [
1531 'type' => 'select',
1532 'options' => [
1533 'row' => esc_html__( 'Horizontal', 'shopbuilder' ),
1534 'column' => esc_html__( 'Vertical', 'shopbuilder' ),
1535 ],
1536 'label' => esc_html__( 'Group Badge Direction', 'shopbuilder' ),
1537 'description' => esc_html__( 'Please choose the group badge direction.', 'shopbuilder' ),
1538 'condition' => [ 'enable_badges_module' => [ 'yes' ] ],
1539 'default' => 'row',
1540 'label_block' => true,
1541 'classes' => $obj->pro_class(),
1542 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
1543 'selectors' => [
1544 $obj->selectors['badges_module']['direction'] => 'flex-direction: {{VALUE}} !important;',
1545 ],
1546 ];
1547
1548 $fields['badges_module_alignment'] = [
1549 'type' => 'choose',
1550 'options' => [
1551 'start' => [
1552 'title' => esc_html__( 'Left', 'shopbuilder' ),
1553 'icon' => 'eicon-text-align-left',
1554 ],
1555 'center' => [
1556 'title' => esc_html__( 'Center', 'shopbuilder' ),
1557 'icon' => 'eicon-text-align-center',
1558 ],
1559 'end' => [
1560 'title' => esc_html__( 'Right', 'shopbuilder' ),
1561 'icon' => 'eicon-text-align-right',
1562 ],
1563 ],
1564 'label' => esc_html__( 'Group Badge Alignment', 'shopbuilder' ),
1565 'description' => esc_html__( 'Please choose the group badge alignment.', 'shopbuilder' ),
1566 'condition' => [ 'enable_badges_module' => [ 'yes' ] ],
1567 'default' => '',
1568 'separator' => rtsb()->has_pro() ? 'default' : 'before',
1569 'label_block' => true,
1570 'selectors' => [
1571 $obj->selectors['badges_module']['alignment'] => 'display: flex !important; width: 100% !important; justify-content: {{VALUE}} !important; align-items: {{VALUE}} !important;',
1572 $obj->selectors['badges_module']['alignment_wrap'] => 'width: 100% !important; left: 0 !important; right: 0 !important;',
1573 ],
1574 ];
1575
1576 $fields['custom_badge_preset'] = [
1577 'type' => 'rtsb-image-selector',
1578 'label' => esc_html__( 'Custom Badge Appearance', 'shopbuilder' ),
1579 'options' => ControlHelper::badge_presets(),
1580 'default' => 'preset1',
1581 'condition' => [ 'enable_badges_module!' => [ 'yes' ] ],
1582 ];
1583
1584 $fields['sale_badges_type'] = [
1585 'type' => 'select2',
1586 'label' => esc_html__( 'Sale Badge Type', 'shopbuilder' ),
1587 'description' => esc_html__( 'Please select the badge type.', 'shopbuilder' ),
1588 'options' => [
1589 'percentage' => esc_html__( 'Show Sale Percentage', 'shopbuilder' ),
1590 'text' => esc_html__( 'Show Sale Text', 'shopbuilder' ),
1591 ],
1592 'default' => 'percentage',
1593 'label_block' => true,
1594 'condition' => [
1595 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ],
1596 'enable_badges_module!' => [ 'yes' ],
1597 ],
1598 ];
1599
1600 $fields['sale_badges_text'] = [
1601 'type' => 'text',
1602 'label' => esc_html__( 'Sale Badge Text', 'shopbuilder' ),
1603 'default' => esc_html__( 'Sale', 'shopbuilder' ),
1604 'description' => esc_html__( 'Please enter the sale badge text.', 'shopbuilder' ),
1605 'label_block' => true,
1606 'condition' => [
1607 'sale_badges_type' => [ 'text' ],
1608 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ],
1609 'enable_badges_module!' => [ 'yes' ],
1610 ],
1611 ];
1612
1613 $fields['stock_badges_text'] = [
1614 'type' => 'text',
1615 'label' => esc_html__( 'Out of Stock Badge Text', 'shopbuilder' ),
1616 'default' => esc_html__( 'Out of Stock', 'shopbuilder' ),
1617 'description' => esc_html__( 'Please enter the out of stock badge text.', 'shopbuilder' ),
1618 'label_block' => true,
1619 'condition' => [
1620 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ],
1621 'enable_badges_module!' => [ 'yes' ],
1622 ],
1623 ];
1624
1625 $fields['custom_badge_text'] = [
1626 'type' => 'text',
1627 'label' => esc_html__( 'Custom Badge Text', 'shopbuilder' ),
1628 'description' => esc_html__( 'Please enter the custom badge text.', 'shopbuilder' ),
1629 'label_block' => true,
1630 'default' => esc_html__( 'Popular', 'shopbuilder' ),
1631 'condition' => [
1632 'layout' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2' ],
1633 'enable_badges_module!' => [ 'yes' ],
1634 ],
1635 ];
1636
1637 $fields['badges_section_end'] = $obj->end_section();
1638
1639 return apply_filters( 'rtsb/elementor/badges', $fields, $obj );
1640 }
1641
1642 /**
1643 * Count section
1644 *
1645 * @param object $obj Reference object.
1646 *
1647 * @return array
1648 */
1649 public static function cat_count_settings( $obj ) {
1650 $condition = [
1651 'show_count' => [ 'yes' ],
1652 ];
1653
1654 $fields['count_section'] = $obj->start_section(
1655 esc_html__( 'Product Count', 'shopbuilder' ),
1656 self::$tab,
1657 [],
1658 $condition
1659 );
1660
1661 $fields['count_display_type'] = [
1662 'type' => 'select2',
1663 'label' => esc_html__( 'Display Position', 'shopbuilder' ),
1664 'description' => esc_html__( 'Please choose the count display position.', 'shopbuilder' ),
1665 'options' => [
1666 'flex' => esc_html__( 'Same Line with Title', 'shopbuilder' ),
1667 'block' => esc_html__( 'After Title', 'shopbuilder' ),
1668 ],
1669 'label_block' => true,
1670 'default' => 'block',
1671 'render_type' => 'template',
1672 'condition' => [ 'layout!' => [ 'category-layout2' ] ],
1673 'selectors' => [
1674 $obj->selectors['cat_count_settings']['count_display_type'] => 'display: {{VALUE}};',
1675 ],
1676 ];
1677
1678 $fields['before_count'] = [
1679 'type' => 'text',
1680 'label' => esc_html__( 'Text Before Count', 'shopbuilder' ),
1681 'description' => esc_html__( 'Please enter the text to show before count.', 'shopbuilder' ),
1682 ];
1683
1684 $fields['after_count'] = [
1685 'type' => 'text',
1686 'label' => esc_html__( 'Text After Count', 'shopbuilder' ),
1687 'description' => esc_html__( 'Please enter the text to show after count.', 'shopbuilder' ),
1688 'default' => esc_html__( ' Products', 'shopbuilder' ),
1689 ];
1690
1691 $fields['count_section_end'] = $obj->end_section();
1692
1693 return $fields;
1694 }
1695
1696 /**
1697 * Pagination section
1698 *
1699 * @param object $obj Reference object.
1700 *
1701 * @return array
1702 */
1703 public static function links( $obj ) {
1704 $fields['links_section'] = $obj->start_section(
1705 esc_html__( 'Links', 'shopbuilder' ),
1706 self::$tab
1707 );
1708 $obj->start_section( 'links_section', esc_html__( 'Detail Page', 'shopbuilder' ), self::$tab );
1709
1710 $fields['title_link'] = [
1711 'type' => 'switch',
1712 'label' => esc_html__( 'Title Clickable?', 'shopbuilder' ),
1713 'description' => esc_html__( 'Switch on to enable title linking.', 'shopbuilder' ),
1714 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1715 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1716 'default' => 'yes',
1717 ];
1718
1719 $fields['image_link'] = [
1720 'type' => 'switch',
1721 'label' => esc_html__( 'Image Clickable?', 'shopbuilder' ),
1722 'description' => esc_html__( 'Switch on to enable image linking.', 'shopbuilder' ),
1723 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1724 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1725 'default' => 'yes',
1726 ];
1727
1728 $fields['hover_btn_note'] = $obj->el_heading(
1729 esc_html__( 'Hover Button', 'shopbuilder' ),
1730 'before',
1731 [],
1732 [ 'layout' => [ 'grid-layout2', 'slider-layout2' ] ]
1733 );
1734
1735 $fields['hover_btn_text'] = [
1736 'type' => 'text',
1737 'label' => esc_html__( 'Hover Button Text', 'shopbuilder' ),
1738 'description' => esc_html__( 'Please enter the button text.', 'shopbuilder' ),
1739 'default' => esc_html__( 'See Details', 'shopbuilder' ),
1740 'condition' => [ 'layout' => [ 'grid-layout2', 'slider-layout2' ] ],
1741 ];
1742
1743 $fields['show_hover_btn_icon'] = [
1744 'type' => 'switch',
1745 'label' => esc_html__( 'Enable Hover Button Icon?', 'shopbuilder' ),
1746 'description' => esc_html__( 'Switch on to enable hover button icon.', 'shopbuilder' ),
1747 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1748 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1749 'default' => 'yes',
1750 'condition' => [ 'layout' => [ 'grid-layout2', 'slider-layout2' ] ],
1751 ];
1752
1753 $fields['hover_btn_icon'] = [
1754 'type' => 'icons',
1755 'label' => esc_html__( 'Choose Icon', 'shopbuilder' ),
1756 'description' => esc_html__( 'Please choose the hover button icon.', 'shopbuilder' ),
1757 'default' => [
1758 'value' => 'fas fa-angle-right',
1759 'library' => 'fa-solid',
1760 ],
1761 'condition' => [
1762 'show_hover_btn_icon' => [ 'yes' ],
1763 'layout' => [ 'grid-layout2', 'slider-layout2' ],
1764 ],
1765 ];
1766
1767 $fields['custom_link'] = [
1768 'type' => 'link',
1769 'label' => esc_html__( 'Alternate Custom Link', 'shopbuilder' ),
1770 'description' => esc_html__( 'Please enter an alternate custom link.', 'shopbuilder' ),
1771 'placeholder' => esc_html__( 'https://custom-link.com', 'shopbuilder' ),
1772 'options' => [ 'url', 'is_external', 'nofollow' ],
1773 'condition' => [ 'layout' => [ 'category-single-layout1' ] ],
1774 ];
1775
1776 $fields['links_section_end'] = $obj->end_section();
1777
1778 return $fields;
1779 }
1780 }
1781