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

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

1,183 lines 39.6 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\Elementor\Helper\ControlHelper;
13
14
15 // Do not allow directly accessing this file.
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit( 'This script cannot be accessed directly.' );
18 }
19
20 /**
21 * Elementor Settings Fields Class.
22 */
23 class SettingsFields {
24 /**
25 * Tab name.
26 *
27 * @access private
28 * @static
29 *
30 * @var array
31 */
32 private static $tab = 'settings';
33
34 /**
35 * Visibility section
36 *
37 * @param object $obj Reference object.
38 *
39 * @return array
40 */
41 public static function content_visibility( $obj ) {
42 $fields['visibility_section'] = $obj->start_section(
43 esc_html__( 'Content Visibility', 'shopbuilder' ),
44 self::$tab
45 );
46
47 $fields['show_title'] = [
48 'type' => 'switch',
49 'label' => esc_html__( 'Show Product Title?', 'shopbuilder' ),
50 'description' => esc_html__( 'Switch on to show product title.', 'shopbuilder' ),
51 'label_on' => esc_html__( 'On', 'shopbuilder' ),
52 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
53 'default' => 'yes',
54 'separator' => 'default',
55 ];
56
57 $fields['show_short_desc'] = [
58 'type' => 'switch',
59 'label' => esc_html__( 'Show Product Short Description?', 'shopbuilder' ),
60 'description' => esc_html__( 'Switch on to show product short description.', 'shopbuilder' ),
61 'label_on' => esc_html__( 'On', 'shopbuilder' ),
62 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
63 ];
64
65 $fields['show_price'] = [
66 'type' => 'switch',
67 'label' => esc_html__( 'Show Product Price?', 'shopbuilder' ),
68 'description' => esc_html__( 'Switch on to show product price.', 'shopbuilder' ),
69 'label_on' => esc_html__( 'On', 'shopbuilder' ),
70 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
71 'default' => 'yes',
72 ];
73
74 $fields['show_rating'] = [
75 'type' => 'switch',
76 'label' => esc_html__( 'Show Product Rating?', 'shopbuilder' ),
77 'description' => esc_html__( 'Switch on to show product rating.', 'shopbuilder' ),
78 'label_on' => esc_html__( 'On', 'shopbuilder' ),
79 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
80 'default' => 'yes',
81 ];
82
83 $fields['show_badges'] = [
84 'type' => 'switch',
85 'label' => esc_html__( 'Show Product Badges?', 'shopbuilder' ),
86 'description' => esc_html__( 'Switch on to show product badges.', 'shopbuilder' ),
87 'label_on' => esc_html__( 'On', 'shopbuilder' ),
88 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
89 'default' => 'yes',
90 ];
91
92 $fields['show_categories'] = [
93 'type' => 'switch',
94 'label' => esc_html__( 'Show Product Categories?', 'shopbuilder' ),
95 'description' => esc_html__( 'Switch on to show product categories.', 'shopbuilder' ),
96 'label_on' => esc_html__( 'On', 'shopbuilder' ),
97 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
98 'default' => 'yes',
99 ];
100
101 $fields['visibility_section_end'] = $obj->end_section();
102
103 return apply_filters( 'rtsb/elements/elementor/visibility_control', $fields, $obj );
104 }
105
106 /**
107 * Action buttons section
108 *
109 * @param object $obj Reference object.
110 *
111 * @return array
112 */
113 public static function action_buttons( $obj ) {
114 $fields['action_visibility_section'] = $obj->start_section(
115 esc_html__( 'Action Buttons', 'shopbuilder' ),
116 self::$tab
117 );
118
119 $fields['action_btn_settings'] = $obj->el_heading( esc_html__( 'Buttons Settings', 'shopbuilder' ), 'default' );
120
121 $fields['action_btn_position'] = [
122 'type' => 'select2',
123 'label' => esc_html__( 'Action Buttons Position', 'shopbuilder' ),
124 'description' => esc_html__( 'Please select the action buttons position.', 'shopbuilder' ),
125 'options' => [
126 'above' => esc_html__( 'Above Image', 'shopbuilder' ),
127 'after' => esc_html__( 'After Content', 'shopbuilder' ),
128 ],
129 'default' => 'above',
130 'label_block' => true,
131 'separator' => 'default',
132 ];
133
134 $fields['action_btn_preset'] = [
135 'type' => 'rtsb-image-selector',
136 'label' => esc_html__( 'Action Buttons Appearance', 'shopbuilder' ),
137 'description' => esc_html__( 'Please choose your preferred action buttons preset.', 'shopbuilder' ),
138 'options' => ControlHelper::action_btn_presets(),
139 'default' => 'preset1',
140 'condition' => [ 'action_btn_position' => [ 'above' ] ],
141 ];
142
143 $fields['action_btn_gap'] = [
144 'type' => 'slider',
145 'mode' => 'responsive',
146 'label' => esc_html__( 'Action Buttons Gap / Spacing (px)', 'shopbuilder' ),
147 'size_units' => [ 'px' ],
148 'range' => [
149 'px' => [
150 'min' => 0,
151 'max' => 100,
152 'step' => 1,
153 ],
154 ],
155 'description' => esc_html__( 'Please select the action buttons gap in px.', 'shopbuilder' ),
156 'selectors' => [
157 $obj->selectors['action_buttons']['action_btn_gap'] => 'gap: {{SIZE}}{{UNIT}};',
158 ],
159 ];
160
161 $fields['action_btn_visibility'] = $obj->el_heading( esc_html__( 'Buttons Visibility', 'shopbuilder' ), 'before' );
162
163 $fields['show_compare'] = [
164 'type' => 'switch',
165 'label' => esc_html__( 'Show Product Compare?', 'shopbuilder' ),
166 'description' => esc_html__( 'Switch on to show product compare.', 'shopbuilder' ),
167 'label_on' => esc_html__( 'On', 'shopbuilder' ),
168 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
169 'default' => 'yes',
170 'separator' => 'default',
171 ];
172
173 $fields['show_quick_view'] = [
174 'type' => 'switch',
175 'label' => esc_html__( 'Show Product Quick View?', 'shopbuilder' ),
176 'description' => esc_html__( 'Switch on to show product quick view.', 'shopbuilder' ),
177 'label_on' => esc_html__( 'On', 'shopbuilder' ),
178 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
179 'default' => 'yes',
180 ];
181
182 $fields['show_wishlist'] = [
183 'type' => 'switch',
184 'label' => esc_html__( 'Show Product Wishlist?', 'shopbuilder' ),
185 'description' => esc_html__( 'Switch on to show product wishlist.', 'shopbuilder' ),
186 ];
187
188 $fields['show_add_to_cart'] = [
189 'type' => 'switch',
190 'label' => esc_html__( 'Show Product Add to Cart?', 'shopbuilder' ),
191 'description' => esc_html__( 'Switch on to show product add to cart.', 'shopbuilder' ),
192 'label_on' => esc_html__( 'On', 'shopbuilder' ),
193 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
194 'default' => 'yes',
195 ];
196
197 $fields['action_visibility_section_end'] = $obj->end_section();
198
199 return apply_filters( 'rtsb/elements/elementor/action_visibility_control', $fields, $obj );
200 }
201
202 /**
203 * Category Visibility section
204 *
205 * @param object $obj Reference object.
206 *
207 * @return array
208 */
209 public static function cat_content_visibility( $obj ) {
210 $fields['cat_visibility_section'] = $obj->start_section(
211 esc_html__( 'Content Visibility', 'shopbuilder' ),
212 self::$tab
213 );
214
215 $fields['show_title'] = [
216 'type' => 'switch',
217 'label' => esc_html__( 'Show Category Title?', 'shopbuilder' ),
218 'description' => esc_html__( 'Switch on to show category title.', 'shopbuilder' ),
219 'label_on' => esc_html__( 'On', 'shopbuilder' ),
220 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
221 'default' => 'yes',
222 'separator' => 'default',
223 ];
224
225 $fields['show_short_desc'] = [
226 'type' => 'switch',
227 'label' => esc_html__( 'Show Category Description?', 'shopbuilder' ),
228 'description' => esc_html__( 'Switch on to show category description.', 'shopbuilder' ),
229 'label_on' => esc_html__( 'On', 'shopbuilder' ),
230 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
231 ];
232
233 $fields['show_count'] = [
234 'type' => 'switch',
235 'label' => esc_html__( 'Show Product Count?', 'shopbuilder' ),
236 'description' => esc_html__( 'Switch on to show product count.', 'shopbuilder' ),
237 'label_on' => esc_html__( 'On', 'shopbuilder' ),
238 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
239 'default' => 'yes',
240 ];
241
242 $fields['show_badges'] = [
243 'type' => 'switch',
244 'label' => esc_html__( 'Show Custom Badge?', 'shopbuilder' ),
245 'description' => esc_html__( 'Switch on to show custom category badge.', 'shopbuilder' ),
246 'label_on' => esc_html__( 'On', 'shopbuilder' ),
247 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
248 'default' => 'yes',
249 'condition' => [ 'layout!' => [ 'category-layout1', 'category-layout2' ] ],
250 ];
251
252 $fields['cat_visibility_section_end'] = $obj->end_section();
253
254 return apply_filters( 'rtsb/elements/elementor/cat_visibility_control', $fields, $obj );
255 }
256
257 /**
258 * Filter section
259 *
260 * @param object $obj Reference object.
261 *
262 * @return array
263 */
264 public static function filter( $obj ) {
265 $fields['filter_section'] = $obj->start_section(
266 esc_html__( 'Filters (Front-End)', 'shopbuilder' ),
267 self::$tab
268 );
269
270 $fields['filter_note'] = [
271 'type' => 'html',
272 'raw' => '',
273 'content_classes' => 'elementor-panel-heading-title',
274 'separator' => 'default',
275 ];
276
277 $fields['show_taxonomy_filter'] = [
278 'type' => 'switch',
279 'label' => esc_html__( 'Enable Taxonomy Filter Button?', 'shopbuilder' ),
280 'description' => esc_html__( 'Switch on to enable taxonomy filter button.', 'shopbuilder' ),
281 'label_on' => esc_html__( 'On', 'shopbuilder' ),
282 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
283 'separator' => $obj->pro_class(),
284 'classes' => $obj->pro_class(),
285 ];
286
287 $fields['filter_section_end'] = $obj->end_section();
288
289 // TODO: Will be activated later.
290 // return apply_filters( 'rtsb/elements/elementor/filter_control', $fields, $obj );
291 return [];
292 }
293
294 /**
295 * Slider section
296 *
297 * @param object $obj Reference object.
298 *
299 * @return array
300 */
301 public static function slider_settings( $obj ) {
302 $fields['slider_control_section'] = $obj->start_section(
303 esc_html__( 'Slider Settings', 'shopbuilder' ),
304 self::$tab
305 );
306
307 $fields['slider_control_note'] = $obj->el_heading(
308 esc_html__( 'Controls', 'shopbuilder' ),
309 'default'
310 );
311
312 $fields['slider_loop'] = [
313 'type' => 'switch',
314 'label' => esc_html__( 'Infinite Loop', 'shopbuilder' ),
315 'label_on' => esc_html__( 'On', 'shopbuilder' ),
316 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
317 'description' => esc_html__( 'Switch on to enable slider infinite loop.', 'shopbuilder' ),
318 'separator' => 'default',
319 ];
320
321 $fields['slider_nav'] = [
322 'type' => 'switch',
323 'label' => esc_html__( 'Navigation Arrows', 'shopbuilder' ),
324 'label_on' => esc_html__( 'On', 'shopbuilder' ),
325 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
326 'description' => esc_html__( 'Switch on to enable slider navigation arrows.', 'shopbuilder' ),
327 'default' => 'yes',
328 ];
329
330 $fields['slider_nav_position'] = [
331 'type' => 'select2',
332 'label' => esc_html__( 'Navigation Arrows Position', 'shopbuilder' ),
333 'options' => [
334 'top' => esc_html__( 'Top', 'shopbuilder' ),
335 'standard' => esc_html__( 'Middle', 'shopbuilder' ),
336 'bottom' => esc_html__( 'Bottom', 'shopbuilder' ),
337 ],
338 'description' => esc_html__( 'Please select the slider arrows position.', 'shopbuilder' ),
339 'default' => 'standard',
340 'label_block' => true,
341 'condition' => [ 'slider_nav' => [ 'yes' ] ],
342 ];
343
344 $fields['slider_left_arrow_icon'] = [
345 'label' => esc_html__( 'Left Arrow Icon', 'shopbuilder' ),
346 'description' => esc_html__( 'Please choose the slider left arrow icon.', 'shopbuilder' ),
347 'type' => 'icons',
348 'default' => [
349 'value' => 'fas fa-chevron-left',
350 'library' => 'fa-solid',
351 ],
352 'condition' => [ 'slider_nav' => 'yes' ],
353 ];
354
355 $fields['slider_right_arrow_icon'] = [
356 'label' => esc_html__( 'Right Arrow Icon', 'shopbuilder' ),
357 'description' => esc_html__( 'Please choose the slider right arrow icon.', 'shopbuilder' ),
358 'type' => 'icons',
359 'default' => [
360 'value' => 'fas fa-chevron-right',
361 'library' => 'fa-solid',
362 ],
363 'condition' => [ 'slider_nav' => 'yes' ],
364 ];
365
366 $fields['slider_pagi'] = [
367 'type' => 'switch',
368 'label' => esc_html__( 'Dot Pagination', 'shopbuilder' ),
369 'label_on' => esc_html__( 'On', 'shopbuilder' ),
370 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
371 'description' => esc_html__( 'Switch on to enable slider dot pagination.', 'shopbuilder' ),
372 'default' => 'yes',
373 ];
374
375 $fields['slider_auto_height'] = [
376 'type' => 'switch',
377 'label' => esc_html__( 'Auto Height', 'shopbuilder' ),
378 'label_on' => esc_html__( 'On', 'shopbuilder' ),
379 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
380 'description' => esc_html__( 'Switch on to enable slider dynamic height.', 'shopbuilder' ),
381 ];
382
383 $fields['slider_lazy_load'] = [
384 'type' => 'switch',
385 'label' => esc_html__( 'Image Lazy Load', 'shopbuilder' ),
386 'label_on' => esc_html__( 'On', 'shopbuilder' ),
387 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
388 'description' => esc_html__( 'Switch on to enable slider image lazy load.', 'shopbuilder' ),
389 ];
390
391 $fields['slide_speed'] = [
392 'type' => 'number',
393 'label' => esc_html__( 'Slide Speed (in ms)', 'shopbuilder' ),
394 'description' => esc_html__( 'Please enter the duration of transition between slides (in ms).', 'shopbuilder' ),
395 'default' => 2000,
396 ];
397
398 $fields['slider_autoplay_note'] = $obj->el_heading(
399 esc_html__( 'Autoplay', 'shopbuilder' ),
400 'before'
401 );
402
403 $fields['slide_autoplay'] = [
404 'type' => 'switch',
405 'label' => esc_html__( 'Enable Autoplay?', 'shopbuilder' ),
406 'label_on' => esc_html__( 'On', 'shopbuilder' ),
407 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
408 'description' => esc_html__( 'Switch on to enable slider autoplay.', 'shopbuilder' ),
409 'default' => 'yes',
410 'separator' => 'default',
411 ];
412
413 $fields['pause_hover'] = [
414 'type' => 'switch',
415 'label' => esc_html__( 'Pause on Mouse Hover?', 'shopbuilder' ),
416 'label_on' => esc_html__( 'On', 'shopbuilder' ),
417 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
418 'description' => esc_html__( 'Switch on to enable slider autoplay pause on mouse hover.', 'shopbuilder' ),
419 'default' => 'yes',
420 'condition' => [ 'slide_autoplay' => 'yes' ],
421 ];
422
423 $fields['autoplay_timeout'] = [
424 'type' => 'number',
425 'label' => esc_html__( 'Autoplay Delay (in ms)', 'shopbuilder' ),
426 // 'options' => Fns::getTTPShortcodeList(),
427 'default' => 5000,
428 'description' => esc_html__( 'Please select autoplay interval delay (in ms).', 'shopbuilder' ),
429 'condition' => [ 'slide_autoplay' => 'yes' ],
430 ];
431
432 $fields['slider_control_section_end'] = $obj->end_section();
433
434 return apply_filters( 'rtsb/elements/elementor/slider_settings_control', $fields, $obj );
435 }
436
437 /**
438 * Title section
439 *
440 * @param object $obj Reference object.
441 *
442 * @return array
443 */
444 public static function product_title( $obj ) {
445 $condition = [
446 'show_title' => [ 'yes' ],
447 ];
448
449 $fields['product_title_section'] = $obj->start_section(
450 esc_html__( 'Product Title', 'shopbuilder' ),
451 self::$tab,
452 [],
453 $condition
454 );
455
456 $fields['title_tag'] = [
457 'type' => 'select2',
458 'label' => esc_html__( 'Product Title Tag', 'shopbuilder' ),
459 'options' => ControlHelper::heading_tags(),
460 'label_block' => true,
461 'default' => 'h3',
462 'description' => esc_html__( 'Please select the product title tag.', 'shopbuilder' ),
463 'separator' => 'after',
464 ];
465
466 $fields['title_hover'] = [
467 'type' => 'switch',
468 'label' => esc_html__( 'Title Hover Underline', 'shopbuilder' ),
469 'default' => 200,
470 'description' => esc_html__( 'Switch on to enable title hover underline.', 'shopbuilder' ),
471 'classes' => $obj->pro_class(),
472 'separator' => 'default',
473 ];
474
475 $fields['title_limit'] = [
476 'type' => 'select2',
477 'label' => esc_html__( 'Product Title Limit', 'shopbuilder' ),
478 'options' => [
479 'default' => esc_html__( 'Default', 'shopbuilder' ),
480 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
481 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
482 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
483 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
484 ],
485 'label_block' => true,
486 'default' => 'default',
487 'description' => esc_html__( 'Please select the product title limit.', 'shopbuilder' ),
488 'separator' => 'before',
489 ];
490
491 $fields['title_limit_custom'] = [
492 'type' => 'number',
493 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
494 'default' => 200,
495 'description' => esc_html__( 'Please enter the product title character limit.', 'shopbuilder' ),
496 'condition' => [ 'title_limit' => [ 'custom' ] ],
497 ];
498
499 $fields['product_title_section_end'] = $obj->end_section();
500
501 return apply_filters( 'rtsb/elements/elementor/product_title_control', $fields, $obj );
502 }
503
504 /**
505 * Title section
506 *
507 * @param object $obj Reference object.
508 *
509 * @return array
510 */
511 public static function section_title( $obj ) {
512 $condition = [
513 'show_section_title' => [ 'yes' ],
514 ];
515
516 $fields['section_title_section'] = $obj->start_section(
517 esc_html__( 'Section Title', 'shopbuilder' ),
518 self::$tab,
519 [],
520 $condition
521 );
522
523 $fields['section_title_tag'] = [
524 'type' => 'select2',
525 'label' => esc_html__( 'Section Title Tag', 'shopbuilder' ),
526 'options' => ControlHelper::heading_tags(),
527 'label_block' => true,
528 'default' => 'h3',
529 'description' => esc_html__( 'Please select the section title tag.', 'shopbuilder' ),
530 'separator' => 'default',
531 ];
532
533 $fields['section_title_text'] = [
534 'type' => 'text',
535 'label' => esc_html__( 'Section Title Text', 'shopbuilder' ),
536 'default' => esc_html__( 'Section Title', 'shopbuilder' ),
537 'description' => esc_html__( 'Please enter the section title text.', 'shopbuilder' ),
538 'label_block' => true,
539 ];
540
541 $fields['section_title_section_end'] = $obj->end_section();
542
543 return apply_filters( 'rtsb/elements/elementor/section_title_control', $fields, $obj );
544 }
545
546 /**
547 * Category Title section
548 *
549 * @param object $obj Reference object.
550 *
551 * @return array
552 */
553 public static function cat_title( $obj ) {
554 $condition = [
555 'show_title' => [ 'yes' ],
556 ];
557
558 $fields['category_title_section'] = $obj->start_section(
559 esc_html__( 'Category Title', 'shopbuilder' ),
560 self::$tab,
561 [],
562 $condition
563 );
564
565 $fields['title_tag'] = [
566 'type' => 'select2',
567 'label' => esc_html__( 'Category Title Tag', 'shopbuilder' ),
568 'options' => ControlHelper::heading_tags(),
569 'label_block' => true,
570 'default' => 'h3',
571 'description' => esc_html__( 'Please select the category title tag.', 'shopbuilder' ),
572 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
573 ];
574
575 $fields['show_custom_title'] = [
576 'type' => 'switch',
577 'label' => esc_html__( 'Enable Custom Title?', 'shopbuilder' ),
578 'description' => esc_html__( 'Switch on to display alternate custom title.', 'shopbuilder' ),
579 'label_on' => esc_html__( 'On', 'shopbuilder' ),
580 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
581 'classes' => $obj->pro_class(),
582 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
583 'condition' => [ 'layout' => [ 'category-single-layout1' ] ],
584 ];
585
586 $fields['custom_title'] = [
587 'type' => 'textarea',
588 'label' => esc_html__( 'Alternate Custom Title', 'shopbuilder' ),
589 'description' => esc_html__( 'Please enter an alternate custom title.', 'shopbuilder' ),
590 'condition' => [
591 'show_custom_title' => [ 'yes' ],
592 'layout' => [ 'category-single-layout1' ],
593 ],
594 'classes' => $obj->pro_class(),
595 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
596 ];
597
598 $fields['title_limit'] = [
599 'type' => 'select2',
600 'label' => esc_html__( 'Category Title Limit', 'shopbuilder' ),
601 'options' => [
602 'default' => esc_html__( 'Default', 'shopbuilder' ),
603 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
604 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
605 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
606 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
607 ],
608 'label_block' => true,
609 'default' => 'default',
610 'description' => esc_html__( 'Please select the category title limit.', 'shopbuilder' ),
611 ];
612
613 $fields['title_limit_custom'] = [
614 'type' => 'number',
615 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
616 'default' => 200,
617 'description' => esc_html__( 'Please select the category title custom limit.', 'shopbuilder' ),
618 'condition' => [ 'title_limit' => [ 'custom' ] ],
619 ];
620
621 $fields['category_title_section_end'] = $obj->end_section();
622
623 return apply_filters( 'rtsb/elements/elementor/category_title_control', $fields, $obj );
624 }
625
626 /**
627 * Excerpt section
628 *
629 * @param object $obj Reference object.
630 *
631 * @return array
632 */
633 public static function product_excerpt( $obj ) {
634 $condition = [
635 'show_short_desc' => [ 'yes' ],
636 ];
637
638 $fields['product_excerpt_section'] = $obj->start_section(
639 esc_html__( 'Short Description', 'shopbuilder' ),
640 self::$tab,
641 [],
642 $condition
643 );
644
645 $fields['excerpt_limit'] = [
646 'type' => 'select2',
647 'label' => esc_html__( 'Short Description Limit', 'shopbuilder' ),
648 'description' => esc_html__( 'Please select the product short description limit.', 'shopbuilder' ),
649 'options' => [
650 'default' => esc_html__( 'Default', 'shopbuilder' ),
651 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
652 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
653 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
654 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
655 ],
656 'label_block' => true,
657 'default' => 'default',
658 'separator' => 'default',
659 ];
660
661 $fields['excerpt_limit_custom'] = [
662 'type' => 'number',
663 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
664 'default' => 200,
665 'description' => esc_html__( 'Please enter the product short description character limit.', 'shopbuilder' ),
666 'condition' => [ 'excerpt_limit' => [ 'custom' ] ],
667 ];
668
669 $fields['product_excerpt_section_end'] = $obj->end_section();
670
671 return apply_filters( 'rtsb/elements/elementor/product_excerpt_control', $fields, $obj );
672 }
673
674 /**
675 * Category Excerpt section
676 *
677 * @param object $obj Reference object.
678 *
679 * @return array
680 */
681 public static function cat_excerpt( $obj ) {
682 $condition = [
683 'show_short_desc' => [ 'yes' ],
684 ];
685
686 $fields['cat_excerpt_section'] = $obj->start_section(
687 esc_html__( 'Category Description', 'shopbuilder' ),
688 self::$tab,
689 [],
690 $condition
691 );
692
693 $fields['desciption_note'] = [
694 'type' => 'html',
695 'raw' => '',
696 'content_classes' => 'elementor-panel-heading-title',
697 'separator' => 'default',
698 'condition' => [ 'layout' => [ 'category-single-layout1' ] ],
699 ];
700
701 $fields['show_custom_description'] = [
702 'type' => 'switch',
703 'label' => esc_html__( 'Enable Custom Description?', 'shopbuilder' ),
704 'description' => esc_html__( 'Switch on to display alternate custom description.', 'shopbuilder' ),
705 'label_on' => esc_html__( 'On', 'shopbuilder' ),
706 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
707 'classes' => $obj->pro_class(),
708 'separator' => rtsb()->has_pro() ? 'before-short' : $obj->pro_class(),
709 'condition' => [ 'layout' => [ 'category-single-layout1' ] ],
710 ];
711
712 $fields['custom_description'] = [
713 'type' => 'textarea',
714 'label' => esc_html__( 'Alternate Custom Description', 'shopbuilder' ),
715 'description' => esc_html__( 'Please enter an alternate custom description.', 'shopbuilder' ),
716 'condition' => [
717 'show_custom_description' => [ 'yes' ],
718 'layout' => [ 'category-single-layout1' ],
719 ],
720 'classes' => $obj->pro_class(),
721 'separator' => rtsb()->has_pro() ? 'before-short' : 'default',
722 ];
723
724 $fields['excerpt_position'] = [
725 'type' => 'select2',
726 'label' => esc_html__( 'Category Description Position', 'shopbuilder' ),
727 'description' => esc_html__( 'Please select the category short description position.', 'shopbuilder' ),
728 'options' => [
729 'above' => esc_html__( 'Top', 'shopbuilder' ),
730 'below' => esc_html__( 'Bottom', 'shopbuilder' ),
731 ],
732 'label_block' => true,
733 'condition' => [ 'layout!' => [ 'category-layout2' ] ],
734 'default' => 'below',
735 'separator' => 'default',
736 ];
737
738 $fields['excerpt_limit'] = [
739 'type' => 'select2',
740 'label' => esc_html__( 'Category Description Limit', 'shopbuilder' ),
741 'description' => esc_html__( 'Please select the category short description limit.', 'shopbuilder' ),
742 'options' => [
743 'default' => esc_html__( 'Default', 'shopbuilder' ),
744 '1-line' => esc_html__( 'Show in 1 line', 'shopbuilder' ),
745 '2-lines' => esc_html__( 'Show in 2 lines', 'shopbuilder' ),
746 '3-lines' => esc_html__( 'Show in 3 lines', 'shopbuilder' ),
747 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
748 ],
749 'label_block' => true,
750 'default' => 'default',
751 ];
752
753 $fields['excerpt_limit_custom'] = [
754 'type' => 'number',
755 'label' => esc_html__( 'Custom Character Limit', 'shopbuilder' ),
756 'default' => 200,
757 'description' => esc_html__( 'Please select the category short description custom limit.', 'shopbuilder' ),
758 'condition' => [ 'excerpt_limit' => [ 'custom' ] ],
759 ];
760
761 $fields['cat_excerpt_section_end'] = $obj->end_section();
762
763 return apply_filters( 'rtsb/elements/elementor/cat_excerpt_control', $fields, $obj );
764 }
765
766 /**
767 * Add to cart section
768 *
769 * @param object $obj Reference object.
770 *
771 * @return array
772 */
773 public static function add_to_cart( $obj ) {
774 $condition = [
775 'show_add_to_cart' => [ 'yes' ],
776 ];
777
778 $fields['add_to_cart_section'] = $obj->start_section(
779 esc_html__( 'Add to Cart', 'shopbuilder' ),
780 self::$tab,
781 [],
782 $condition
783 );
784
785 $fields['show_cart_icon'] = [
786 'type' => 'switch',
787 'label' => esc_html__( 'Show Add to Cart Icon?', 'shopbuilder' ),
788 'description' => esc_html__( 'Switch on to show add to cart icon.', 'shopbuilder' ),
789 'label_on' => esc_html__( 'On', 'shopbuilder' ),
790 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
791 'default' => 'yes',
792 'separator' => 'default',
793 ];
794
795 $fields['add_to_cart_icon'] = [
796 'type' => 'icons',
797 'label' => esc_html__( 'Choose Icon', 'shopbuilder' ),
798 'description' => esc_html__( 'Please choose the Add to Cart icon.', 'shopbuilder' ),
799 'default' => [
800 'value' => 'fas fa-shopping-cart',
801 'library' => 'fa-solid',
802 ],
803 'condition' => [ 'show_cart_icon' => [ 'yes' ] ],
804 ];
805
806 $fields['add_to_cart_success_icon'] = [
807 'type' => 'icons',
808 'label' => esc_html__( 'Choose Success Icon', 'shopbuilder' ),
809 'description' => esc_html__( 'Please choose the Add to Cart success icon.', 'shopbuilder' ),
810 'default' => [
811 'value' => 'fas fa-check',
812 'library' => 'fa-solid',
813 ],
814 'condition' => [ 'show_cart_icon' => [ 'yes' ] ],
815 ];
816 // TODO:: Variable product button text change option.
817 $fields['show_cart_text'] = [
818 'type' => 'switch',
819 'label' => esc_html__( 'Show Add to Cart Text?', 'shopbuilder' ),
820 'description' => esc_html__( 'Switch on to show add to cart text.', 'shopbuilder' ),
821 'label_on' => esc_html__( 'On', 'shopbuilder' ),
822 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
823 'default' => 'yes',
824 ];
825
826 $fields['add_to_cart_text'] = [
827 'type' => 'text',
828 'label' => esc_html__( 'Add to Cart Text', 'shopbuilder' ),
829 'default' => esc_html__( 'Add to Cart', 'shopbuilder' ),
830 'description' => esc_html__( 'Please enter the add to cart text.', 'shopbuilder' ),
831 'condition' => [ 'show_cart_text' => [ 'yes' ] ],
832 ];
833
834 $fields['add_to_cart_section_end'] = $obj->end_section();
835
836 return apply_filters( 'rtsb/elements/elementor/add_to_cart_control', $fields, $obj );
837 }
838
839 /**
840 * Quick View section
841 *
842 * @param object $obj Reference object.
843 *
844 * @return array
845 */
846 public static function quick_view( $obj ) {
847 $condition = [
848 'show_quick_view' => [ 'yes' ],
849 ];
850
851 $fields['quick_view_section'] = $obj->start_section(
852 esc_html__( 'Quick View', 'shopbuilder' ),
853 self::$tab,
854 [],
855 $condition
856 );
857
858 $fields['quick_view_icon'] = [
859 'type' => 'icons',
860 'label' => esc_html__( 'Choose Icon', 'shopbuilder' ),
861 'description' => esc_html__( 'Please choose the Quick View icon.', 'shopbuilder' ),
862 'default' => [
863 'value' => 'fas fa-eye',
864 'library' => 'fa-solid',
865 ],
866 'separator' => 'default',
867 ];
868
869 $fields['quick_view_section_end'] = $obj->end_section();
870
871 return apply_filters( 'rtsb/elements/elementor/quick_view_control', $fields, $obj );
872 }
873
874 /**
875 * Quick View section
876 *
877 * @param object $obj Reference object.
878 *
879 * @return array
880 */
881 public static function compare( $obj ) {
882 $condition = [
883 'show_compare' => [ 'yes' ],
884 ];
885
886 $fields['compare_section'] = $obj->start_section(
887 esc_html__( 'Compare', 'shopbuilder' ),
888 self::$tab,
889 [],
890 $condition
891 );
892
893 $fields['comparison_icon'] = [
894 'type' => 'icons',
895 'label' => esc_html__( 'Choose Compare Icon', 'shopbuilder' ),
896 'description' => esc_html__( 'Please choose the Compare icon.', 'shopbuilder' ),
897 'default' => [
898 'value' => 'fas fa-exchange-alt',
899 'library' => 'fa-solid',
900 ],
901 'separator' => 'default',
902 ];
903
904 $fields['comparison_icon_added'] = [
905 'type' => 'icons',
906 'label' => esc_html__( 'Choose Compare Added Icon', 'shopbuilder' ),
907 'description' => esc_html__( 'Please choose the Compare icon.', 'shopbuilder' ),
908 'default' => [
909 'value' => 'fas fa-check',
910 'library' => 'fa-solid',
911 ],
912 ];
913
914 $fields['compare_section_end'] = $obj->end_section();
915
916 return apply_filters( 'rtsb/elements/elementor/compare_control', $fields, $obj );
917 }
918
919 /**
920 * Quick View section
921 *
922 * @param object $obj Reference object.
923 *
924 * @return array
925 */
926 public static function wishlist( $obj ) {
927 $condition = [
928 'show_wishlist' => [ 'yes' ],
929 ];
930
931 $fields['wishlist_section'] = $obj->start_section(
932 esc_html__( 'Wishlist', 'shopbuilder' ),
933 self::$tab,
934 [],
935 $condition
936 );
937
938 $fields['wishlist_icon'] = [
939 'type' => 'icons',
940 'label' => esc_html__( 'Choose Wishlist Icon', 'shopbuilder' ),
941 'description' => esc_html__( 'Please choose the Wishlist icon.', 'shopbuilder' ),
942 'default' => [
943 'value' => 'far fa-heart',
944 'library' => 'fa-regular',
945 ],
946 'separator' => 'default',
947 ];
948
949 $fields['wishlist_icon_added'] = [
950 'type' => 'icons',
951 'label' => esc_html__( 'Choose Wishlist Added Icon', 'shopbuilder' ),
952 'description' => esc_html__( 'Please choose the Wishlist icon.', 'shopbuilder' ),
953 'default' => [
954 'value' => 'fas fa-heart',
955 'library' => 'fa-solid',
956 ],
957 ];
958
959 $fields['wishlist_section_end'] = $obj->end_section();
960
961 return apply_filters( 'rtsb/elements/elementor/wishlist_control', $fields, $obj );
962 }
963
964 /**
965 * Badge section
966 *
967 * @param object $obj Reference object.
968 *
969 * @return array
970 */
971 public static function badges( $obj ) {
972 $condition = [
973 'show_badges' => [ 'yes' ],
974 'layout!' => [ 'category-layout1', 'category-layout2' ],
975 ];
976
977 $fields['badges_section'] = $obj->start_section(
978 esc_html__( 'Badges', 'shopbuilder' ),
979 self::$tab,
980 [],
981 $condition
982 );
983
984 $fields['custom_badge_preset'] = [
985 'type' => 'rtsb-image-selector',
986 'label' => esc_html__( 'Custom Badge Appearance', 'shopbuilder' ),
987 'description' => esc_html__( 'Please choose the custom badge appearance.', 'shopbuilder' ),
988 'options' => ControlHelper::badge_presets(),
989 'default' => 'preset1',
990 'separator' => 'default',
991 ];
992
993 $fields['sale_badges_type'] = [
994 'type' => 'select2',
995 'label' => esc_html__( 'Sale Badge Type', 'shopbuilder' ),
996 'description' => esc_html__( 'Please enter the sale badge text.', 'shopbuilder' ),
997 'options' => [
998 'percentage' => esc_html__( 'Show Sale Percentage', 'shopbuilder' ),
999 'text' => esc_html__( 'Show Sale Text', 'shopbuilder' ),
1000 ],
1001 'default' => 'percentage',
1002 'label_block' => true,
1003 'condition' => [ 'layout!' => [ 'category-single-layout1', 'category-layout1', 'category-layout2' ] ],
1004 ];
1005
1006 $fields['sale_badges_text'] = [
1007 'type' => 'text',
1008 'label' => esc_html__( 'Sale Badge Text', 'shopbuilder' ),
1009 'default' => esc_html__( 'Sale', 'shopbuilder' ),
1010 'description' => esc_html__( 'Please enter the sale badge text.', 'shopbuilder' ),
1011 'label_block' => true,
1012 'condition' => [
1013 'sale_badges_type' => [ 'text' ],
1014 'layout!' => [ 'category-single-layout1', 'category-layout1', 'category-layout2' ],
1015 ],
1016 ];
1017
1018 $fields['stock_badges_text'] = [
1019 'type' => 'text',
1020 'label' => esc_html__( 'Out of Stock Badge Text', 'shopbuilder' ),
1021 'default' => esc_html__( 'Out of Stock', 'shopbuilder' ),
1022 'description' => esc_html__( 'Please enter the out of stock badge text.', 'shopbuilder' ),
1023 'label_block' => true,
1024 'condition' => [ 'layout!' => [ 'category-single-layout1', 'category-layout1', 'category-layout2' ] ],
1025 ];
1026
1027 $fields['custom_badge_text'] = [
1028 'type' => 'text',
1029 'label' => esc_html__( 'Custom Badge Text', 'shopbuilder' ),
1030 'description' => esc_html__( 'Please enter the custom badge text.', 'shopbuilder' ),
1031 'label_block' => true,
1032 'default' => esc_html__( 'Popular', 'shopbuilder' ),
1033 'condition' => [ 'layout' => [ 'category-single-layout1', 'category-layout1', 'category-layout2' ] ],
1034 ];
1035
1036 $fields['badges_section_end'] = $obj->end_section();
1037
1038 return apply_filters( 'rtsb/elements/elementor/badges_control', $fields, $obj );
1039 }
1040
1041 /**
1042 * Count section
1043 *
1044 * @param object $obj Reference object.
1045 *
1046 * @return array
1047 */
1048 public static function cat_count_settings( $obj ) {
1049 $condition = [
1050 'show_count' => [ 'yes' ],
1051 ];
1052
1053 $fields['count_section'] = $obj->start_section(
1054 esc_html__( 'Product Count', 'shopbuilder' ),
1055 self::$tab,
1056 [],
1057 $condition
1058 );
1059
1060 $fields['count_display_type'] = [
1061 'type' => 'select2',
1062 'label' => esc_html__( 'Display Position', 'shopbuilder' ),
1063 'description' => esc_html__( 'Please choose the count display position.', 'shopbuilder' ),
1064 'options' => [
1065 'flex' => esc_html__( 'Same Line with Title', 'shopbuilder' ),
1066 'block' => esc_html__( 'After Title', 'shopbuilder' ),
1067 ],
1068 'label_block' => true,
1069 'default' => 'block',
1070 'separator' => 'default',
1071 'render_type' => 'template',
1072 'condition' => [ 'layout!' => [ 'category-layout2' ] ],
1073 'selectors' => [
1074 $obj->selectors['cat_count_settings']['count_display_type'] => 'display: {{VALUE}};',
1075 ],
1076 ];
1077
1078 $fields['before_count'] = [
1079 'type' => 'text',
1080 'label' => esc_html__( 'Text Before Count', 'shopbuilder' ),
1081 'description' => esc_html__( 'Please enter the text to show before count.', 'shopbuilder' ),
1082 ];
1083
1084 $fields['after_count'] = [
1085 'type' => 'text',
1086 'label' => esc_html__( 'Text After Count', 'shopbuilder' ),
1087 'description' => esc_html__( 'Please enter the text to show after count.', 'shopbuilder' ),
1088 'default' => esc_html__( ' Products', 'shopbuilder' ),
1089 ];
1090
1091 $fields['count_section_end'] = $obj->end_section();
1092
1093 return apply_filters( 'rtsb/elements/elementor/count_control', $fields, $obj );
1094 }
1095
1096 /**
1097 * Pagination section
1098 *
1099 * @param object $obj Reference object.
1100 *
1101 * @return array
1102 */
1103 public static function links( $obj ) {
1104 $fields['links_section'] = $obj->start_section(
1105 esc_html__( 'Links', 'shopbuilder' ),
1106 self::$tab
1107 );
1108 $obj->start_section( 'links_section', esc_html__( 'Detail Page', 'shopbuilder' ), self::$tab );
1109
1110 $fields['title_link'] = [
1111 'type' => 'switch',
1112 'label' => esc_html__( 'Title Clickable?', 'shopbuilder' ),
1113 'description' => esc_html__( 'Switch on to enable title linking.', 'shopbuilder' ),
1114 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1115 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1116 'default' => 'yes',
1117 'separator' => 'default',
1118 ];
1119
1120 $fields['image_link'] = [
1121 'type' => 'switch',
1122 'label' => esc_html__( 'Image Clickable?', 'shopbuilder' ),
1123 'description' => esc_html__( 'Switch on to enable image linking.', 'shopbuilder' ),
1124 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1125 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1126 'default' => 'yes',
1127 ];
1128
1129 $fields['hover_btn_note'] = $obj->el_heading(
1130 esc_html__( 'Hover Button', 'shopbuilder' ),
1131 'before',
1132 [],
1133 [ 'layout' => [ 'grid-layout2', 'slider-layout2' ] ]
1134 );
1135
1136 $fields['hover_btn_text'] = [
1137 'type' => 'text',
1138 'label' => esc_html__( 'Hover Button Text', 'shopbuilder' ),
1139 'description' => esc_html__( 'Please enter the button text.', 'shopbuilder' ),
1140 'default' => esc_html__( 'See Details', 'shopbuilder' ),
1141 'condition' => [ 'layout' => [ 'grid-layout2', 'slider-layout2' ] ],
1142 'separator' => 'default',
1143 ];
1144
1145 $fields['show_hover_btn_icon'] = [
1146 'type' => 'switch',
1147 'label' => esc_html__( 'Enable Hover Button Icon?', 'shopbuilder' ),
1148 'description' => esc_html__( 'Switch on to enable hover button icon.', 'shopbuilder' ),
1149 'label_on' => esc_html__( 'On', 'shopbuilder' ),
1150 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
1151 'default' => 'yes',
1152 'condition' => [ 'layout' => [ 'grid-layout2', 'slider-layout2' ] ],
1153 ];
1154
1155 $fields['hover_btn_icon'] = [
1156 'type' => 'icons',
1157 'label' => esc_html__( 'Choose Icon', 'shopbuilder' ),
1158 'description' => esc_html__( 'Please choose the hover button icon.', 'shopbuilder' ),
1159 'default' => [
1160 'value' => 'fas fa-angle-right',
1161 'library' => 'fa-solid',
1162 ],
1163 'condition' => [
1164 'show_hover_btn_icon' => [ 'yes' ],
1165 'layout' => [ 'grid-layout2', 'slider-layout2' ],
1166 ],
1167 ];
1168
1169 $fields['custom_link'] = [
1170 'type' => 'link',
1171 'label' => esc_html__( 'Alternate Custom Link', 'shopbuilder' ),
1172 'description' => esc_html__( 'Please enter an alternate custom link.', 'shopbuilder' ),
1173 'placeholder' => esc_html__( 'https://custom-link.com', 'shopbuilder' ),
1174 'options' => [ 'url', 'is_external', 'nofollow' ],
1175 'condition' => [ 'layout' => [ 'category-single-layout1' ] ],
1176 ];
1177
1178 $fields['links_section_end'] = $obj->end_section();
1179
1180 return apply_filters( 'rtsb/elements/elementor/links_control', $fields, $obj );
1181 }
1182 }
1183