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

1,750 lines 59.3 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 return $fields;
900 }
901
902 /**
903 * Slider section
904 *
905 * @param object $obj Reference object.
906 *
907 * @return array
908 */
909 public static function slider_settings( $obj ) {
910 $status = ! rtsb()->has_pro();
911
912 $fields['slider_control_section'] = $obj->start_section(
913 esc_html__( 'Slider Settings', 'shopbuilder' ),
914 self::$tab
915 );
916
917 $fields['slider_control_note'] = $obj->el_heading(
918 esc_html__( 'Controls', 'shopbuilder' ),
919 'default'
920 );
921
922 $fields['slider_nav'] = [
923 'type' => 'switch',
924 'label' => esc_html__( 'Navigation Arrows', 'shopbuilder' ),
925 'label_on' => esc_html__( 'On', 'shopbuilder' ),
926 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
927 'description' => esc_html__( 'Switch on to enable slider navigation arrows.', 'shopbuilder' ),
928 'default' => 'yes',
929 ];
930
931 $fields['slider_nav_position'] = [
932 'type' => 'select2',
933 'label' => esc_html__( 'Navigation Arrows Position', 'shopbuilder' ),
934 'options' => [
935 'top' => esc_html__( 'Top', 'shopbuilder' ),
936 'standard' => esc_html__( 'Middle', 'shopbuilder' ),
937 'bottom' => esc_html__( 'Bottom', 'shopbuilder' ),
938 ],
939 'description' => esc_html__( 'Please select the slider arrows position.', 'shopbuilder' ),
940 'default' => 'standard',
941 'label_block' => true,
942 'separator' => rtsb()->has_pro() ? 'default' : 'after',
943 'condition' => [ 'slider_nav' => [ 'yes' ] ],
944 ];
945
946 $fields['always_show_nav'] = [
947 'type' => 'switch',
948 'label' => esc_html__( 'Always Show Arrows', 'shopbuilder' ),
949 'label_on' => esc_html__( 'On', 'shopbuilder' ),
950 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
951 'description' => esc_html__( 'Switch on to enable always showing navigation arrows.', 'shopbuilder' ),
952 'classes' => $obj->pro_class(),
953 'is_pro' => $status,
954 'condition' => [ 'slider_nav' => [ 'yes' ] ],
955 ];
956
957 if ( rtsb()->has_pro() ) {
958 $fields['always_show_nav']['condition']['slider_nav_position'] = 'standard';
959 }
960
961 $fields['slider_left_arrow_icon'] = [
962 'label' => esc_html__( 'Left Arrow Icon', 'shopbuilder' ),
963 'description' => esc_html__( 'Please choose the slider left arrow icon.', 'shopbuilder' ),
964 'type' => 'icons',
965 'default' => [
966 'value' => 'fas fa-chevron-left',
967 'library' => 'fa-solid',
968 ],
969 'separator' => rtsb()->has_pro() ? 'default' : 'before-short',
970 'condition' => [ 'slider_nav' => 'yes' ],
971 ];
972
973 $fields['slider_right_arrow_icon'] = [
974 'label' => esc_html__( 'Right Arrow Icon', 'shopbuilder' ),
975 'description' => esc_html__( 'Please choose the slider right arrow icon.', 'shopbuilder' ),
976 'type' => 'icons',
977 'default' => [
978 'value' => 'fas fa-chevron-right',
979 'library' => 'fa-solid',
980 ],
981 'condition' => [ 'slider_nav' => 'yes' ],
982 ];
983
984 $fields['slider_pagi'] = [
985 'type' => 'switch',
986 'label' => esc_html__( 'Dot Pagination', 'shopbuilder' ),
987 'label_on' => esc_html__( 'On', 'shopbuilder' ),
988 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
989 'description' => esc_html__( 'Switch on to enable slider dot pagination.', 'shopbuilder' ),
990 'default' => 'yes',
991 ];
992 $fields['slider_dynamic_pagi'] = [
993 'type' => 'switch',
994 'label' => esc_html__( 'Dynamic Pagination', 'shopbuilder' ),
995 'label_on' => esc_html__( 'On', 'shopbuilder' ),
996 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
997 'description' => esc_html__( 'It will keep only few bullets visible at the same time.', 'shopbuilder' ),
998 'condition' => [ 'slider_pagi' => 'yes' ],
999 ];
1000 $fields['slider_loop'] = [
1001 'type' => 'switch',
1002 'label' => esc_html__( 'Infinite Loop', 'shopbuilder' ),
1003 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1004 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1005 'description' => esc_html__( 'Switch on to enable slider infinite loop.', 'shopbuilder' ),
1006 'condition' => [ 'tax_filter!' => [ 'yes' ] ],
1007 ];
1008
1009 $fields['slider_auto_height'] = [
1010 'type' => 'switch',
1011 'label' => esc_html__( 'Auto Height', 'shopbuilder' ),
1012 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1013 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1014 'description' => esc_html__( 'Switch on to enable slider dynamic height.', 'shopbuilder' ),
1015 ];
1016
1017 $fields['slider_lazy_load'] = [
1018 'type' => 'switch',
1019 'label' => esc_html__( 'Image Lazy Load', 'shopbuilder' ),
1020 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1021 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1022 'description' => esc_html__( 'Switch on to enable slider image lazy load.', 'shopbuilder' ),
1023 'condition' => [ 'tax_filter!' => [ 'yes' ] ],
1024 ];
1025
1026 $fields['slide_speed'] = [
1027 'type' => 'number',
1028 'label' => esc_html__( 'Slide Speed (in ms)', 'shopbuilder' ),
1029 'description' => esc_html__( 'Please enter the duration of transition between slides (in ms).', 'shopbuilder' ),
1030 'default' => 2000,
1031 'separator' => $status ? 'default elementor-control-separator-after' : 'default',
1032 ];
1033
1034 $fields['slider_slide_animation'] = [
1035 'type' => 'switch',
1036 'label' => esc_html__( 'Enable Slide Effect', 'shopbuilder' ),
1037 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1038 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1039 'description' => esc_html__( 'Switch on to enable zoom-in effect when sliding.', 'shopbuilder' ),
1040 'default' => '',
1041 'classes' => $obj->pro_class(),
1042 'is_pro' => $status,
1043 ];
1044
1045 $fields['slider_autoplay_note'] = $obj->el_heading(
1046 esc_html__( 'Autoplay', 'shopbuilder' ),
1047 'before'
1048 );
1049
1050 $fields['slide_autoplay'] = [
1051 'type' => 'switch',
1052 'label' => esc_html__( 'Enable Autoplay?', 'shopbuilder' ),
1053 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1054 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1055 'description' => esc_html__( 'Switch on to enable slider autoplay.', 'shopbuilder' ),
1056 'default' => 'yes',
1057 ];
1058
1059 $fields['pause_hover'] = [
1060 'type' => 'switch',
1061 'label' => esc_html__( 'Pause on Mouse Hover?', 'shopbuilder' ),
1062 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1063 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1064 'description' => esc_html__( 'Switch on to enable slider autoplay pause on mouse hover.', 'shopbuilder' ),
1065 'default' => 'yes',
1066 'condition' => [ 'slide_autoplay' => 'yes' ],
1067 ];
1068
1069 $fields['autoplay_timeout'] = [
1070 'type' => 'number',
1071 'label' => esc_html__( 'Autoplay Delay (in ms)', 'shopbuilder' ),
1072 'default' => 5000,
1073 'description' => esc_html__( 'Please select autoplay interval delay (in ms).', 'shopbuilder' ),
1074 'condition' => [ 'slide_autoplay' => 'yes' ],
1075 ];
1076
1077 $fields['slider_control_section_end'] = $obj->end_section();
1078
1079 return $fields;
1080 }
1081
1082 /**
1083 * Title section
1084 *
1085 * @param object $obj Reference object.
1086 *
1087 * @return array
1088 */
1089 public static function product_title( $obj ) {
1090 $condition = [
1091 'show_title' => [ 'yes' ],
1092 ];
1093
1094 $fields['product_title_section'] = $obj->start_section(
1095 esc_html__( 'Product Title', 'shopbuilder' ),
1096 self::$tab,
1097 [],
1098 $condition
1099 );
1100
1101 $fields['title_tag'] = [
1102 'type' => 'select2',
1103 'label' => esc_html__( 'Product Title Tag', 'shopbuilder' ),
1104 'options' => ControlHelper::heading_tags(),
1105 'label_block' => true,
1106 'default' => 'h3',
1107 'description' => esc_html__( 'Please select the product title tag.', 'shopbuilder' ),
1108 ];
1109 $fields['title_limit'] = [
1110 'type' => 'select2',
1111 'label' => esc_html__( 'Product Title Limit', 'shopbuilder' ),
1112 'options' => [
1113 'default' => esc_html__( 'Default', 'shopbuilder' ),
1114 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
1115 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
1116 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
1117 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
1118 ],
1119 'label_block' => true,
1120 'default' => 'default',
1121 'description' => esc_html__( 'Please select the product title limit.', 'shopbuilder' ),
1122 ];
1123
1124 $fields['title_limit_custom'] = [
1125 'type' => 'number',
1126 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
1127 'default' => 200,
1128 'description' => esc_html__( 'Please enter the product title character limit.', 'shopbuilder' ),
1129 'condition' => [ 'title_limit' => [ 'custom' ] ],
1130 ];
1131
1132 $fields['product_title_section_end'] = $obj->end_section();
1133
1134 return $fields;
1135 }
1136
1137 /**
1138 * Title section
1139 *
1140 * @param object $obj Reference object.
1141 *
1142 * @return array
1143 */
1144 public static function section_title( $obj ) {
1145 $condition = [
1146 'show_section_title' => [ 'yes' ],
1147 ];
1148
1149 $fields['section_title_section'] = $obj->start_section(
1150 esc_html__( 'Section Title', 'shopbuilder' ),
1151 self::$tab,
1152 [],
1153 $condition
1154 );
1155
1156 $fields['section_title_tag'] = [
1157 'type' => 'select2',
1158 'label' => esc_html__( 'Section Title Tag', 'shopbuilder' ),
1159 'options' => ControlHelper::heading_tags(),
1160 'label_block' => true,
1161 'default' => 'h2',
1162 'description' => esc_html__( 'Please select the section title tag.', 'shopbuilder' ),
1163 ];
1164
1165 $fields['section_title_text'] = [
1166 'type' => 'text',
1167 'label' => esc_html__( 'Section Title Text', 'shopbuilder' ),
1168 'default' => esc_html__( 'Section Title', 'shopbuilder' ),
1169 'description' => esc_html__( 'Please enter the section title text.', 'shopbuilder' ),
1170 'label_block' => true,
1171 ];
1172
1173 $fields['section_title_section_end'] = $obj->end_section();
1174
1175 return $fields;
1176 }
1177
1178 /**
1179 * Category Title section
1180 *
1181 * @param object $obj Reference object.
1182 *
1183 * @return array
1184 */
1185 public static function cat_title( $obj ) {
1186 $condition = [
1187 'show_title' => [ 'yes' ],
1188 ];
1189
1190 $fields['category_title_section'] = $obj->start_section(
1191 esc_html__( 'Category Title', 'shopbuilder' ),
1192 self::$tab,
1193 [],
1194 $condition
1195 );
1196
1197 $fields['title_tag'] = [
1198 'type' => 'select2',
1199 'label' => esc_html__( 'Category Title Tag', 'shopbuilder' ),
1200 'options' => ControlHelper::heading_tags(),
1201 'label_block' => true,
1202 'default' => 'h3',
1203 'description' => esc_html__( 'Please select the category title tag.', 'shopbuilder' ),
1204 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
1205 ];
1206
1207 $fields['show_custom_title'] = [
1208 'type' => 'switch',
1209 'label' => esc_html__( 'Enable Custom Title?', 'shopbuilder' ),
1210 'description' => esc_html__( 'Switch on to display alternate custom title.', 'shopbuilder' ),
1211 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1212 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1213 'classes' => $obj->pro_class(),
1214 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
1215 'condition' => [ 'layout' => [ 'category-single-layout1' ] ],
1216 ];
1217
1218 $fields['custom_title'] = [
1219 'type' => 'textarea',
1220 'label' => esc_html__( 'Alternate Custom Title', 'shopbuilder' ),
1221 'description' => esc_html__( 'Please enter an alternate custom title.', 'shopbuilder' ),
1222 'condition' => [
1223 'show_custom_title' => [ 'yes' ],
1224 'layout' => [ 'category-single-layout1' ],
1225 ],
1226 'classes' => $obj->pro_class(),
1227 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
1228 ];
1229
1230 $fields['title_limit'] = [
1231 'type' => 'select2',
1232 'label' => esc_html__( 'Category Title Limit', 'shopbuilder' ),
1233 'options' => [
1234 'default' => esc_html__( 'Default', 'shopbuilder' ),
1235 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
1236 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
1237 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
1238 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
1239 ],
1240 'label_block' => true,
1241 'default' => 'default',
1242 'separator' => rtsb()->has_pro() ? 'default' : 'before',
1243 'description' => esc_html__( 'Please select the category title limit.', 'shopbuilder' ),
1244 ];
1245
1246 $fields['title_limit_custom'] = [
1247 'type' => 'number',
1248 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
1249 'default' => 200,
1250 'description' => esc_html__( 'Please select the category title custom limit.', 'shopbuilder' ),
1251 'condition' => [ 'title_limit' => [ 'custom' ] ],
1252 ];
1253
1254 $fields['category_title_section_end'] = $obj->end_section();
1255
1256 return $fields;
1257 }
1258
1259 /**
1260 * Excerpt section
1261 *
1262 * @param object $obj Reference object.
1263 *
1264 * @return array
1265 */
1266 public static function product_excerpt( $obj ) {
1267 $condition = [
1268 'show_short_desc' => [ 'yes' ],
1269 ];
1270
1271 $fields['product_excerpt_section'] = $obj->start_section(
1272 esc_html__( 'Short Description', 'shopbuilder' ),
1273 self::$tab,
1274 [],
1275 $condition
1276 );
1277
1278 $fields['excerpt_limit'] = [
1279 'type' => 'select2',
1280 'label' => esc_html__( 'Short Description Limit', 'shopbuilder' ),
1281 'description' => esc_html__( 'Please select the product short description limit.', 'shopbuilder' ),
1282 'options' => [
1283 'default' => esc_html__( 'Default', 'shopbuilder' ),
1284 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
1285 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
1286 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
1287 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
1288 ],
1289 'label_block' => true,
1290 'default' => 'default',
1291 ];
1292
1293 $fields['excerpt_limit_custom'] = [
1294 'type' => 'number',
1295 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
1296 'default' => 200,
1297 'description' => esc_html__( 'Please enter the product short description character limit.', 'shopbuilder' ),
1298 'condition' => [ 'excerpt_limit' => [ 'custom' ] ],
1299 ];
1300
1301 $fields['product_excerpt_section_end'] = $obj->end_section();
1302
1303 return $fields;
1304 }
1305
1306 /**
1307 * Category Excerpt section
1308 *
1309 * @param object $obj Reference object.
1310 *
1311 * @return array
1312 */
1313 public static function cat_excerpt( $obj ) {
1314 $condition = [
1315 'show_short_desc' => [ 'yes' ],
1316 ];
1317
1318 $fields['cat_excerpt_section'] = $obj->start_section(
1319 esc_html__( 'Category Description', 'shopbuilder' ),
1320 self::$tab,
1321 [],
1322 $condition
1323 );
1324
1325 $fields['desciption_note'] = [
1326 'type' => 'html',
1327 'raw' => '',
1328 'content_classes' => 'elementor-panel-heading-title',
1329 'condition' => [ 'layout' => [ 'category-single-layout1' ] ],
1330 ];
1331
1332 $fields['show_custom_description'] = [
1333 'type' => 'switch',
1334 'label' => esc_html__( 'Enable Custom Description?', 'shopbuilder' ),
1335 'description' => esc_html__( 'Switch on to display alternate custom description.', 'shopbuilder' ),
1336 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1337 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1338 'classes' => $obj->pro_class(),
1339 'separator' => rtsb()->has_pro() ? 'before-short' : $obj->pro_class(),
1340 'condition' => [ 'layout' => [ 'category-single-layout1' ] ],
1341 ];
1342
1343 $fields['custom_description'] = [
1344 'type' => 'textarea',
1345 'label' => esc_html__( 'Alternate Custom Description', 'shopbuilder' ),
1346 'description' => esc_html__( 'Please enter an alternate custom description.', 'shopbuilder' ),
1347 'condition' => [
1348 'show_custom_description' => [ 'yes' ],
1349 'layout' => [ 'category-single-layout1' ],
1350 ],
1351 'classes' => $obj->pro_class(),
1352 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
1353 ];
1354
1355 $fields['excerpt_position'] = [
1356 'type' => 'select2',
1357 'label' => esc_html__( 'Category Description Position', 'shopbuilder' ),
1358 'description' => esc_html__( 'Please select the category short description position.', 'shopbuilder' ),
1359 'options' => [
1360 'above' => esc_html__( 'Top', 'shopbuilder' ),
1361 'below' => esc_html__( 'Bottom', 'shopbuilder' ),
1362 ],
1363 'label_block' => true,
1364 'condition' => [ 'layout!' => [ 'category-layout2' ] ],
1365 'default' => 'below',
1366 ];
1367
1368 $fields['excerpt_limit'] = [
1369 'type' => 'select2',
1370 'label' => esc_html__( 'Category Description Limit', 'shopbuilder' ),
1371 'description' => esc_html__( 'Please select the category short description limit.', 'shopbuilder' ),
1372 'options' => [
1373 'default' => esc_html__( 'Default', 'shopbuilder' ),
1374 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
1375 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
1376 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
1377 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
1378 ],
1379 'label_block' => true,
1380 'default' => 'default',
1381 ];
1382
1383 $fields['excerpt_limit_custom'] = [
1384 'type' => 'number',
1385 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
1386 'default' => 200,
1387 'description' => esc_html__( 'Please select the category short description custom limit.', 'shopbuilder' ),
1388 'condition' => [ 'excerpt_limit' => [ 'custom' ] ],
1389 ];
1390
1391 $fields['cat_excerpt_section_end'] = $obj->end_section();
1392
1393 return $fields;
1394 }
1395
1396 /**
1397 * Variation swatch section
1398 *
1399 * @param object $obj Reference object.
1400 *
1401 * @return array
1402 */
1403 public static function variation_swatch( $obj ) {
1404 if ( ! function_exists( 'rtwpvsp' ) && ! rtsb()->has_pro() ) {
1405 return [];
1406 }
1407 $condition = [
1408 'show_swatches' => [ 'yes' ],
1409 ];
1410
1411 $fields['variation_swatch_section'] = $obj->start_section(
1412 esc_html__( 'Variation Swatches', 'shopbuilder' ),
1413 self::$tab,
1414 [],
1415 $condition
1416 );
1417
1418 $fields['swatch_position'] = [
1419 'type' => 'select2',
1420 'label' => esc_html__( 'Swatches Display Position', 'shopbuilder' ),
1421 'description' => esc_html__( 'Please select the variation swatches display position.', 'shopbuilder' ),
1422 'options' => [
1423 'top' => esc_html__( 'Top of Content', 'shopbuilder' ),
1424 'title' => esc_html__( 'With Product Title', 'shopbuilder' ),
1425 'price' => esc_html__( 'WIth Product Price', 'shopbuilder' ),
1426 ],
1427 'label_block' => true,
1428 'default' => 'top',
1429 ];
1430 if ( function_exists( 'rtwpvsp' ) ) {
1431 $fields['swatch_type'] = [
1432 'type' => 'select2',
1433 'label' => esc_html__( 'Color Swatches Type', 'shopbuilder' ),
1434 'description' => esc_html__( 'Please select the variation swatches display type (only work with color swatch).', 'shopbuilder' ),
1435 'options' => [
1436 'square' => esc_html__( 'Square', 'shopbuilder' ),
1437 'circle' => esc_html__( 'Circle', 'shopbuilder' ),
1438 ],
1439 'label_block' => true,
1440 'default' => 'circle',
1441 ];
1442 }
1443 $fields['swatch_margin'] = [
1444 'mode' => 'responsive',
1445 'type' => 'dimensions',
1446 'label' => esc_html__( 'Margin', 'shopbuilder' ),
1447 'size_units' => [ 'px', '%', 'em' ],
1448 'selectors' => [ '{{WRAPPER}} .rtsb-swatches' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ],
1449 ];
1450
1451 $fields['variation_swatch_section_end'] = $obj->end_section();
1452
1453 return $fields;
1454 }
1455
1456 /**
1457 * Badge section
1458 *
1459 * @param object $obj Reference object.
1460 *
1461 * @return array
1462 */
1463 public static function badges( $obj ) {
1464 $condition = [
1465 'show_badges' => [ 'yes' ],
1466 'layout!' => [ 'category-layout1', 'category-layout2' ],
1467 ];
1468
1469 $fields['badges_section'] = $obj->start_section(
1470 esc_html__( 'Badges', 'shopbuilder' ),
1471 self::$tab,
1472 [],
1473 $condition
1474 );
1475 $fields['enable_badges_module'] = [
1476 'type' => 'switch',
1477 'label' => esc_html__( 'Enable Badges Module?', 'shopbuilder' ),
1478 'description' => esc_html__( 'Switch on to integrate Badge module.', 'shopbuilder' ),
1479 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1480 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1481 'condition' => [ 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ] ],
1482 ];
1483 $fields['badges_module_notice'] = [
1484 'type' => 'html',
1485 'raw' => sprintf(
1486 '<span style="display: block; background: #fffbf1; padding: 10px; line-height: 1.4; color: #bd3a3a; border: 1px solid #bd3a3a30;">%s</span>',
1487 sprintf(
1488 /* translators: 1: link to the Modules page */
1489 __(
1490 '<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.',
1491 'shopbuilder'
1492 ),
1493 esc_url( admin_url( 'admin.php?page=rtsb-settings' ) )
1494 )
1495 ),
1496 'separator' => rtsb()->has_pro() ? 'default' : 'after',
1497 'condition' => [ 'enable_badges_module' => [ 'yes' ] ],
1498 ];
1499
1500 $fields['badges_module_direction'] = [
1501 'type' => 'select',
1502 'options' => [
1503 'row' => esc_html__( 'Horizontal', 'shopbuilder' ),
1504 'column' => esc_html__( 'Vertical', 'shopbuilder' ),
1505 ],
1506 'label' => esc_html__( 'Group Badge Direction', 'shopbuilder' ),
1507 'description' => esc_html__( 'Please choose the group badge direction.', 'shopbuilder' ),
1508 'condition' => [ 'enable_badges_module' => [ 'yes' ] ],
1509 'default' => 'row',
1510 'label_block' => true,
1511 'classes' => $obj->pro_class(),
1512 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
1513 'selectors' => [
1514 $obj->selectors['badges_module']['direction'] => 'flex-direction: {{VALUE}} !important;',
1515 ],
1516 ];
1517
1518 $fields['badges_module_alignment'] = [
1519 'type' => 'choose',
1520 'options' => [
1521 'start' => [
1522 'title' => esc_html__( 'Left', 'shopbuilder' ),
1523 'icon' => 'eicon-text-align-left',
1524 ],
1525 'center' => [
1526 'title' => esc_html__( 'Center', 'shopbuilder' ),
1527 'icon' => 'eicon-text-align-center',
1528 ],
1529 'end' => [
1530 'title' => esc_html__( 'Right', 'shopbuilder' ),
1531 'icon' => 'eicon-text-align-right',
1532 ],
1533 ],
1534 'label' => esc_html__( 'Group Badge Alignment', 'shopbuilder' ),
1535 'description' => esc_html__( 'Please choose the group badge alignment.', 'shopbuilder' ),
1536 'condition' => [ 'enable_badges_module' => [ 'yes' ] ],
1537 'default' => 'start',
1538 'separator' => rtsb()->has_pro() ? 'default' : 'before',
1539 'label_block' => true,
1540 'selectors' => [
1541 $obj->selectors['badges_module']['alignment'] => 'align-items: {{VALUE}} !important;',
1542 ],
1543 ];
1544
1545 $fields['custom_badge_preset'] = [
1546 'type' => 'rtsb-image-selector',
1547 'label' => esc_html__( 'Custom Badge Appearance', 'shopbuilder' ),
1548 'options' => ControlHelper::badge_presets(),
1549 'default' => 'preset1',
1550 'condition' => [ 'enable_badges_module!' => [ 'yes' ] ],
1551 ];
1552
1553 $fields['sale_badges_type'] = [
1554 'type' => 'select2',
1555 'label' => esc_html__( 'Sale Badge Type', 'shopbuilder' ),
1556 'description' => esc_html__( 'Please select the badge type.', 'shopbuilder' ),
1557 'options' => [
1558 'percentage' => esc_html__( 'Show Sale Percentage', 'shopbuilder' ),
1559 'text' => esc_html__( 'Show Sale Text', 'shopbuilder' ),
1560 ],
1561 'default' => 'percentage',
1562 'label_block' => true,
1563 'condition' => [
1564 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ],
1565 'enable_badges_module!' => [ 'yes' ],
1566 ],
1567 ];
1568
1569 $fields['sale_badges_text'] = [
1570 'type' => 'text',
1571 'label' => esc_html__( 'Sale Badge Text', 'shopbuilder' ),
1572 'default' => esc_html__( 'Sale', 'shopbuilder' ),
1573 'description' => esc_html__( 'Please enter the sale badge text.', 'shopbuilder' ),
1574 'label_block' => true,
1575 'condition' => [
1576 'sale_badges_type' => [ 'text' ],
1577 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ],
1578 'enable_badges_module!' => [ 'yes' ],
1579 ],
1580 ];
1581
1582 $fields['stock_badges_text'] = [
1583 'type' => 'text',
1584 'label' => esc_html__( 'Out of Stock Badge Text', 'shopbuilder' ),
1585 'default' => esc_html__( 'Out of Stock', 'shopbuilder' ),
1586 'description' => esc_html__( 'Please enter the out of stock badge text.', 'shopbuilder' ),
1587 'label_block' => true,
1588 'condition' => [
1589 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ],
1590 'enable_badges_module!' => [ 'yes' ],
1591 ],
1592 ];
1593
1594 $fields['custom_badge_text'] = [
1595 'type' => 'text',
1596 'label' => esc_html__( 'Custom Badge Text', 'shopbuilder' ),
1597 'description' => esc_html__( 'Please enter the custom badge text.', 'shopbuilder' ),
1598 'label_block' => true,
1599 'default' => esc_html__( 'Popular', 'shopbuilder' ),
1600 'condition' => [
1601 'layout' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2' ],
1602 'enable_badges_module!' => [ 'yes' ],
1603 ],
1604 ];
1605
1606 $fields['badges_section_end'] = $obj->end_section();
1607
1608 return apply_filters( 'rtsb/elementor/badges', $fields, $obj );
1609 }
1610
1611 /**
1612 * Count section
1613 *
1614 * @param object $obj Reference object.
1615 *
1616 * @return array
1617 */
1618 public static function cat_count_settings( $obj ) {
1619 $condition = [
1620 'show_count' => [ 'yes' ],
1621 ];
1622
1623 $fields['count_section'] = $obj->start_section(
1624 esc_html__( 'Product Count', 'shopbuilder' ),
1625 self::$tab,
1626 [],
1627 $condition
1628 );
1629
1630 $fields['count_display_type'] = [
1631 'type' => 'select2',
1632 'label' => esc_html__( 'Display Position', 'shopbuilder' ),
1633 'description' => esc_html__( 'Please choose the count display position.', 'shopbuilder' ),
1634 'options' => [
1635 'flex' => esc_html__( 'Same Line with Title', 'shopbuilder' ),
1636 'block' => esc_html__( 'After Title', 'shopbuilder' ),
1637 ],
1638 'label_block' => true,
1639 'default' => 'block',
1640 'render_type' => 'template',
1641 'condition' => [ 'layout!' => [ 'category-layout2' ] ],
1642 'selectors' => [
1643 $obj->selectors['cat_count_settings']['count_display_type'] => 'display: {{VALUE}};',
1644 ],
1645 ];
1646
1647 $fields['before_count'] = [
1648 'type' => 'text',
1649 'label' => esc_html__( 'Text Before Count', 'shopbuilder' ),
1650 'description' => esc_html__( 'Please enter the text to show before count.', 'shopbuilder' ),
1651 ];
1652
1653 $fields['after_count'] = [
1654 'type' => 'text',
1655 'label' => esc_html__( 'Text After Count', 'shopbuilder' ),
1656 'description' => esc_html__( 'Please enter the text to show after count.', 'shopbuilder' ),
1657 'default' => esc_html__( ' Products', 'shopbuilder' ),
1658 ];
1659
1660 $fields['count_section_end'] = $obj->end_section();
1661
1662 return $fields;
1663 }
1664
1665 /**
1666 * Pagination section
1667 *
1668 * @param object $obj Reference object.
1669 *
1670 * @return array
1671 */
1672 public static function links( $obj ) {
1673 $fields['links_section'] = $obj->start_section(
1674 esc_html__( 'Links', 'shopbuilder' ),
1675 self::$tab
1676 );
1677 $obj->start_section( 'links_section', esc_html__( 'Detail Page', 'shopbuilder' ), self::$tab );
1678
1679 $fields['title_link'] = [
1680 'type' => 'switch',
1681 'label' => esc_html__( 'Title Clickable?', 'shopbuilder' ),
1682 'description' => esc_html__( 'Switch on to enable title linking.', 'shopbuilder' ),
1683 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1684 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1685 'default' => 'yes',
1686 ];
1687
1688 $fields['image_link'] = [
1689 'type' => 'switch',
1690 'label' => esc_html__( 'Image Clickable?', 'shopbuilder' ),
1691 'description' => esc_html__( 'Switch on to enable image linking.', 'shopbuilder' ),
1692 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1693 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1694 'default' => 'yes',
1695 ];
1696
1697 $fields['hover_btn_note'] = $obj->el_heading(
1698 esc_html__( 'Hover Button', 'shopbuilder' ),
1699 'before',
1700 [],
1701 [ 'layout' => [ 'grid-layout2', 'slider-layout2' ] ]
1702 );
1703
1704 $fields['hover_btn_text'] = [
1705 'type' => 'text',
1706 'label' => esc_html__( 'Hover Button Text', 'shopbuilder' ),
1707 'description' => esc_html__( 'Please enter the button text.', 'shopbuilder' ),
1708 'default' => esc_html__( 'See Details', 'shopbuilder' ),
1709 'condition' => [ 'layout' => [ 'grid-layout2', 'slider-layout2' ] ],
1710 ];
1711
1712 $fields['show_hover_btn_icon'] = [
1713 'type' => 'switch',
1714 'label' => esc_html__( 'Enable Hover Button Icon?', 'shopbuilder' ),
1715 'description' => esc_html__( 'Switch on to enable hover button icon.', 'shopbuilder' ),
1716 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1717 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1718 'default' => 'yes',
1719 'condition' => [ 'layout' => [ 'grid-layout2', 'slider-layout2' ] ],
1720 ];
1721
1722 $fields['hover_btn_icon'] = [
1723 'type' => 'icons',
1724 'label' => esc_html__( 'Choose Icon', 'shopbuilder' ),
1725 'description' => esc_html__( 'Please choose the hover button icon.', 'shopbuilder' ),
1726 'default' => [
1727 'value' => 'fas fa-angle-right',
1728 'library' => 'fa-solid',
1729 ],
1730 'condition' => [
1731 'show_hover_btn_icon' => [ 'yes' ],
1732 'layout' => [ 'grid-layout2', 'slider-layout2' ],
1733 ],
1734 ];
1735
1736 $fields['custom_link'] = [
1737 'type' => 'link',
1738 'label' => esc_html__( 'Alternate Custom Link', 'shopbuilder' ),
1739 'description' => esc_html__( 'Please enter an alternate custom link.', 'shopbuilder' ),
1740 'placeholder' => esc_html__( 'https://custom-link.com', 'shopbuilder' ),
1741 'options' => [ 'url', 'is_external', 'nofollow' ],
1742 'condition' => [ 'layout' => [ 'category-single-layout1' ] ],
1743 ];
1744
1745 $fields['links_section_end'] = $obj->end_section();
1746
1747 return $fields;
1748 }
1749 }
1750