PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 1.1.3
ShopBuilder – WooCommerce Builder For Elementor v1.1.3
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 / Models / ModuleList.php

ModuleList.php in ShopBuilder – WooCommerce Builder For Elementor 1.1.3, at app/Models/ModuleList.php

836 lines 31.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace RadiusTheme\SB\Models;
4
5 use RadiusTheme\SB\Helpers\Fns;
6 use RadiusTheme\SB\Models\Base\ListModel;
7 use RadiusTheme\SB\Modules\Compare\Compare;
8 use RadiusTheme\SB\Modules\Compare\CompareFns;
9 use RadiusTheme\SB\Modules\QuickView\QuickView;
10 use RadiusTheme\SB\Modules\WishList\Wishlist;
11 use RadiusTheme\SB\Modules\WishList\WishlistFns;
12 use RadiusTheme\SB\Traits\SingletonTrait;
13
14 defined( 'ABSPATH' ) || exit;
15
16 class ModuleList extends ListModel {
17 use SingletonTrait;
18
19 protected $list_id = 'modules';
20
21 public function __construct() {
22 parent::__construct();
23 $this->title = esc_html__( 'Modules', 'shopbuilder' );
24 $this->description = esc_html__( 'Here you can find the list of all the modules. You can individually enable or disable the modules. Or you can do that by one click.', 'shopbuilder' );
25 $this->categories = [
26 'general' => [
27 'title' => esc_html__( 'Free', 'shopbuilder' ),
28 ],
29 /*
30 * TODO:: Will add later
31 'pro' => array(
32 'title' => esc_html__( 'Pro', 'shopbuilder' ),
33 ),
34 */
35 ];
36 }
37
38 protected function raw_list() {
39 $list = [
40 'quick_view' => apply_filters(
41 'rtsb/module/quick_view/options',
42 [
43 'id' => 'quick_view',
44 'title' => esc_html__( 'Quick View', 'shopbuilder' ),
45 'base_class' => QuickView::class,
46 'category' => 'general',
47 'active' => 'on',
48 'package' => 'free',
49 'active_field' => [
50 'label' => esc_html__( 'Enable Quick View?', 'shopbuilder' ),
51 'help' => esc_html__( 'Switch on to enable quick view module.', 'shopbuilder' ),
52 ],
53 'fields' => apply_filters(
54 'rtsb/module/quick_view/fields',
55 [
56 'loop_btn_position' => [
57 'id' => 'loop_btn_position',
58 'type' => 'select',
59 'value' => 'custom',
60 'label' => esc_html__( 'Shop Page Button Position', 'shopbuilder' ),
61 'help' => esc_html__( 'You can manage quick view button position in product list page.', 'shopbuilder' ),
62 'options' => [
63 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
64 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
65 'top_thumbnail' => esc_html__( 'Top On Image', 'shopbuilder' ),
66 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
67 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
68 ],
69 ],
70 'loop_btn_position_shortcode' => [
71 'type' => 'raw',
72 'label' => ' ',
73 'html' => sprintf(
74 /* translators: 1: The shortcode.*/
75 esc_html__( 'Choose where to show button in WooCommerce product\'s loop. Copy this shortcode %1$s and paste it where you want to show the button.', 'shopbuilder' ),
76 '<code>[rtsb_quick_view_button]</code>'
77 ),
78 'dependency' => [
79 'rules' => [
80 [
81 'item' => 'modules.quick_view.loop_btn_position',
82 'value' => 'shortcode',
83 'operator' => '==',
84 ],
85 ],
86 ],
87 ],
88 'loop_custom_hook_name' => [
89 'id' => 'loop_custom_hook_name',
90 'type' => 'text',
91 'label' => esc_html__( 'Loop Hook Name', 'shopbuilder' ),
92 'dependency' => [
93 'rules' => [
94 [
95 'item' => 'modules.quick_view.loop_btn_position',
96 'value' => 'custom',
97 'operator' => '==',
98 ],
99 ],
100 ],
101 ],
102 'loop_custom_hook_priority' => [
103 'id' => 'loop_custom_hook_priority',
104 'type' => 'number',
105 'value' => 10,
106 'size' => 'small',
107 'min' => 0,
108 'max' => 999,
109 'label' => esc_html__( 'Loop Hook Priority', 'shopbuilder' ),
110 'dependency' => [
111 'rules' => [
112 [
113 'item' => 'modules.quick_view.loop_btn_position',
114 'value' => 'custom',
115 'operator' => '==',
116 ],
117 ],
118 ],
119 ],
120 'button_text' => [
121 'id' => 'button_text',
122 'label' => esc_html__( 'Quick View Text', 'shopbuilder' ),
123 'help' => esc_html__( 'Enter your quick view button text.', 'shopbuilder' ),
124 'type' => 'text',
125 'value' => 'Quick view',
126 'placeholder' => 'Quick view',
127 ],
128 ]
129 ),
130 ]
131 ),
132 'wishlist' => apply_filters(
133 'rtsb/module/wishlist/options',
134 [
135 'id' => 'wishlist',
136 'title' => esc_html__( 'Wishlist', 'shopbuilder' ),
137 'package' => 'free',
138 'active' => 'on',
139 'base_class' => Wishlist::class,
140 'category' => 'general',
141 'active_field' => [
142 'label' => esc_html__( 'Enable Wishlist?', 'shopbuilder' ),
143 'help' => esc_html__( 'Switch on to enable wishlist module.', 'shopbuilder' ),
144 ],
145 'fields' => apply_filters(
146 'rtsb/module/wishlist/fields',
147 [
148 'enable_login_limit' => [
149 'id' => 'enable_login_limit',
150 'type' => 'switch',
151 'label' => esc_html__( 'Limit Wishlist Use', 'shopbuilder' ),
152 'help' => esc_html__( 'Enable this option to allow only the logged-in users to use the Wishlist feature.', 'shopbuilder' ),
153 'tab' => 'general',
154 ],
155 'show_btn_on_loop' => [
156 'id' => 'show_btn_on_loop',
157 'value' => 'on',
158 'type' => 'switch',
159 'label' => esc_html__( 'Show Button in Product List', 'shopbuilder' ),
160 'tab' => 'button',
161 ],
162 'loop_btn_position' => [
163 'id' => 'loop_btn_position',
164 'type' => 'select',
165 'value' => 'custom',
166 'label' => esc_html__( 'Shop Page Button Position', 'shopbuilder' ),
167 'help' => esc_html__( 'You can manage wishlist button position in product list page.', 'shopbuilder' ),
168 'options' => [
169 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
170 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
171 'top_thumbnail' => esc_html__( 'Top On Image', 'shopbuilder' ),
172 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
173 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
174 ],
175 'dependency' => [
176 'rules' => [
177 [
178 'item' => 'modules.wishlist.show_btn_on_loop',
179 'value' => 'on',
180 'operator' => '==',
181 ],
182 ],
183 ],
184 'tab' => 'button',
185 ],
186 'loop_btn_position_shortcode' => [
187 'type' => 'raw',
188 'label' => ' ',
189 'html' => sprintf(
190 /* translators: 1: The shortcode.*/
191 esc_html__( 'Choose where to show button in WooCommerce product\'s loop. Copy this shortcode %1$s and paste it where you want to show the button.', 'shopbuilder' ),
192 '<code>[rtsb_wishlist_button]</code>'
193 ),
194 'dependency' => [
195 'rules' => [
196 [
197 'item' => 'modules.wishlist.show_btn_on_loop',
198 'value' => 'on',
199 'operator' => '==',
200 ],
201 [
202 'item' => 'modules.wishlist.loop_btn_position',
203 'value' => 'shortcode',
204 'operator' => '==',
205 ],
206 ],
207 ],
208 'tab' => 'button',
209 ],
210 'loop_custom_hook_name' => [
211 'id' => 'loop_custom_hook_name',
212 'type' => 'text',
213 'label' => esc_html__( 'Loop Hook Name', 'shopbuilder' ),
214 'tab' => 'button',
215 'dependency' => [
216 'rules' => [
217 [
218 'item' => 'modules.wishlist.show_btn_on_loop',
219 'value' => 'on',
220 'operator' => '==',
221 ],
222 [
223 'item' => 'modules.wishlist.loop_btn_position',
224 'value' => 'custom',
225 'operator' => '==',
226 ],
227 ],
228 ],
229 ],
230 'loop_custom_hook_priority' => [
231 'id' => 'loop_custom_hook_priority',
232 'type' => 'number',
233 'value' => 10,
234 'size' => 'small',
235 'min' => 0,
236 'max' => 999,
237 'label' => esc_html__( 'Loop Hook Priority', 'shopbuilder' ),
238 'tab' => 'button',
239 'dependency' => [
240 'rules' => [
241 [
242 'item' => 'modules.wishlist.show_btn_on_loop',
243 'value' => 'on',
244 'operator' => '==',
245 ],
246 [
247 'item' => 'modules.wishlist.loop_btn_position',
248 'value' => 'custom',
249 'operator' => '==',
250 ],
251 ],
252 'relation' => 'and',
253 ],
254 ],
255 'show_btn_product_page' => [
256 'id' => 'show_btn_product_page',
257 'value' => 'on',
258 'type' => 'switch',
259 'label' => esc_html__( 'Show Button in Single Product Page', 'shopbuilder' ),
260 'tab' => 'button',
261 ],
262 'product_btn_position' => [
263 'id' => 'product_btn_position',
264 'label' => esc_html__( 'Product Page Button Position', 'shopbuilder' ),
265 'help' => esc_html__( 'You can manage compare button position in single product page.', 'shopbuilder' ),
266 'type' => 'select',
267 'value' => 'custom',
268 'options' => [
269 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
270 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
271 'after_thumbnail' => esc_html__( 'After Image', 'shopbuilder' ),
272 'after_summary' => esc_html__( 'After Summary', 'shopbuilder' ),
273 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
274 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
275 ],
276 'dependency' => [
277 'rules' => [
278 [
279 'item' => 'modules.wishlist.show_btn_product_page',
280 'value' => 'on',
281 'operator' => '==',
282 ],
283 ],
284 ],
285 'tab' => 'button',
286 ],
287 'product_btn_position_shortcode' => [
288 'type' => 'raw',
289 'label' => ' ',
290 'html' => sprintf(
291 /* translators: 1: The shortcode.*/
292 esc_html__( 'Choose where to show button on the product page. Copy this shortcode %1$s and paste it where you want to show the button.', 'shopbuilder' ),
293 '<code>[rtsb_wishlist_button]</code>'
294 ),
295 'dependency' => [
296 'rules' => [
297 [
298 'item' => 'modules.wishlist.show_btn_product_page',
299 'value' => 'on',
300 'operator' => '==',
301 ],
302 [
303 'item' => 'modules.wishlist.product_btn_position',
304 'value' => 'shortcode',
305 'operator' => '==',
306 ],
307 ],
308 ],
309 'tab' => 'button',
310 ],
311 'product_custom_hook_name' => [
312 'id' => 'product_custom_hook_name',
313 'type' => 'text',
314 'label' => esc_html__( 'Product Hook Name', 'shopbuilder' ),
315 'tab' => 'button',
316 'dependency' => [
317 'rules' => [
318 [
319 'item' => 'modules.wishlist.show_btn_product_page',
320 'value' => 'on',
321 'operator' => '==',
322 ],
323 [
324 'item' => 'modules.wishlist.product_btn_position',
325 'value' => 'custom',
326 'operator' => '==',
327 ],
328 ],
329 ],
330 ],
331 'product_custom_hook_priority' => [
332 'id' => 'product_custom_hook_priority',
333 'type' => 'number',
334 'value' => 10,
335 'size' => 'small',
336 'min' => 0,
337 'max' => 999,
338 'label' => esc_html__( 'Product Hook Priority', 'shopbuilder' ),
339 'tab' => 'button',
340 'dependency' => [
341 'rules' => [
342 [
343 'item' => 'modules.wishlist.show_btn_product_page',
344 'value' => 'on',
345 'operator' => '==',
346 ],
347 [
348 'item' => 'modules.wishlist.product_btn_position',
349 'value' => 'custom',
350 'operator' => '==',
351 ],
352 ],
353 'relation' => 'and',
354 ],
355 ],
356 'button_text' => [
357 'id' => 'button_text',
358 'label' => esc_html__( 'Add to Wishlist Text', 'shopbuilder' ),
359 'help' => esc_html__( 'Enter your wishlist button text.', 'shopbuilder' ),
360 'type' => 'text',
361 'value' => 'Add to wishlist',
362 'placeholder' => 'Add to wishlist',
363 'tab' => 'button',
364 ],
365 'notice_added_text' => [
366 'id' => 'notice_added_text',
367 'label' => esc_html__( 'Product Added Text', 'shopbuilder' ),
368 'help' => esc_html__( 'Enter the product added text.', 'shopbuilder' ),
369 'type' => 'text',
370 'value' => 'Product added!',
371 'placeholder' => 'Product added!',
372 'tab' => 'button',
373 ],
374 'notice_removed_text' => [
375 'id' => 'notice_removed_text',
376 'label' => esc_html__( 'Product Removed Text', 'shopbuilder' ),
377 'help' => esc_html__( 'Enter the product removed text.', 'shopbuilder' ),
378 'type' => 'text',
379 'value' => 'Product removed!',
380 'placeholder' => 'Product removed!',
381 'tab' => 'button',
382 ],
383 'browse_list_text' => [
384 'id' => 'browse_list_text',
385 'label' => esc_html__( 'Browse Wishlist Text', 'shopbuilder' ),
386 'help' => esc_html__( 'Enter a text for the "Browse wishlist" link on the product page', 'shopbuilder' ),
387 'type' => 'text',
388 'value' => 'Browse wishlist',
389 'placeholder' => 'Browse wishlist',
390 'tab' => 'button',
391 ],
392 /*
393 'notice_exist_text' => array(
394 'id' => 'notice_exist_text',
395 'label' => esc_html__( 'Product Already Exist in Wishlist Text', 'shopbuilder' ),
396 'help' => esc_html__( 'Enter the message for "already exists in the wishlist" text.', 'shopbuilder' ),
397 'type' => 'text',
398 'value' => 'The product is already in your wishlist!',
399 'placeholder' => 'The product is already in your wishlist!',
400 'tab' => 'button',
401 ),
402 */
403 /*
404 * TODO:: Will Implement Later.
405 'redirect_cart' => array(
406 'id' => 'redirect_cart',
407 'type' => 'switch',
408 'help' => esc_html__( 'Redirect users to the cart page when they add a product to the cart from the wishlist page', 'shopbuilder' ),
409 'label' => esc_html__( 'Redirect to Cart', 'shopbuilder' ),
410 'tab' => 'page',
411 ),
412 'remove_after_add_to_cart' => array(
413 'value' => 'on',
414 'id' => 'remove_after_add_to_cart',
415 'type' => 'switch',
416 'help' => esc_html__( 'Remove the product from the wishlist after it has been added to the cart', 'shopbuilder' ),
417 'label' => esc_html__( 'Remove if Added to Cart', 'shopbuilder' ),
418 'tab' => 'page',
419 ),
420 */
421 'page_show_fields' => [
422 'value' => WishlistFns::instance()->get_field_ids(),
423 'id' => 'page_show_fields',
424 'multiple' => true,
425 'checkbox' => true,
426 'sanitize_fn' => 'sanitize_text_field',
427 'type' => 'sortable',
428 'options' => WishlistFns::instance()->get_default_fields(),
429 'label' => esc_html__( 'Show Fields in Table', 'shopbuilder' ),
430 'tab' => 'page',
431 ],
432
433 ]
434 ),
435 'tabs' => [
436 'general' => [
437 'title' => esc_html__( 'General', 'shopbuilder' ),
438 ],
439 'button' => [
440 'title' => esc_html__( 'Button', 'shopbuilder' ),
441 ],
442 'page' => [
443 'title' => esc_html__( 'Page', 'shopbuilder' ),
444 ],
445
446 ],
447 ]
448 ),
449 'compare' => apply_filters(
450 'rtsb/module/compare/options',
451 [
452 'id' => 'compare',
453 'base_class' => Compare::class,
454 'category' => 'general',
455 'title' => esc_html__( 'Product Compare', 'shopbuilder' ),
456 'package' => 'free',
457 'active' => 'on',
458 'active_field' => [
459 'label' => esc_html__( 'Enable Product Comparison?', 'shopbuilder' ),
460 'help' => esc_html__( 'Switch on to enable product comparison module.', 'shopbuilder' ),
461 ],
462 'fields' => apply_filters(
463 'rtsb/module/compare/fields',
464 [
465 'show_btn_on_loop' => [
466 'id' => 'show_btn_on_loop',
467 'value' => 'on',
468 'type' => 'switch',
469 'label' => esc_html__( 'Show In Archive Page or Any Products Loop', 'shopbuilder' ),
470 'tab' => 'button',
471 ],
472 'loop_btn_position' => [
473 'id' => 'loop_btn_position',
474 'type' => 'select',
475 'value' => 'custom',
476 'label' => esc_html__( 'Shop Page Button Position', 'shopbuilder' ),
477 'help' => esc_html__( 'You can manage wishlist button position in product list page.', 'shopbuilder' ),
478 'options' => [
479 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
480 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
481 'top_thumbnail' => esc_html__( 'Top On Image', 'shopbuilder' ),
482 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
483 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
484 ],
485 'dependency' => [
486 'rules' => [
487 [
488 'item' => 'modules.compare.show_btn_on_loop',
489 'value' => 'on',
490 'operator' => '==',
491 ],
492 ],
493 ],
494 'tab' => 'button',
495 ],
496 'loop_btn_position_shortcode' => [
497 'type' => 'raw',
498 'label' => ' ',
499 'html' => sprintf(
500 /* translators: 1: The shortcode.*/
501 esc_html__( 'Choose where to show button in WooCommerce product\'s loop. Copy this shortcode %1$s and paste it where you want to show the button.', 'shopbuilder' ),
502 '<code>[rtsb_compare_button]</code>'
503 ),
504 'dependency' => [
505 'rules' => [
506 [
507 'item' => 'modules.compare.show_btn_on_loop',
508 'value' => 'on',
509 'operator' => '==',
510 ],
511 [
512 'item' => 'modules.compare.loop_btn_position',
513 'value' => 'shortcode',
514 'operator' => '==',
515 ],
516 ],
517 ],
518 'tab' => 'button',
519 ],
520 'loop_custom_hook_name' => [
521 'id' => 'product_custom_hook_name',
522 'type' => 'text',
523 'label' => esc_html__( 'Product Hook Name', 'shopbuilder' ),
524 'tab' => 'button',
525 'dependency' => [
526 'rules' => [
527 [
528 'item' => 'modules.compare.show_btn_on_loop',
529 'value' => 'on',
530 'operator' => '==',
531 ],
532 [
533 'item' => 'modules.compare.loop_btn_position',
534 'value' => 'custom',
535 'operator' => '==',
536 ],
537 ],
538 ],
539 ],
540 'loop_custom_hook_priority' => [
541 'id' => 'product_custom_hook_priority',
542 'type' => 'number',
543 'value' => 10,
544 'size' => 'small',
545 'min' => 0,
546 'max' => 999,
547 'label' => esc_html__( 'Product Hook Priority', 'shopbuilder' ),
548 'tab' => 'button',
549 'dependency' => [
550 'rules' => [
551 [
552 'item' => 'modules.compare.show_btn_on_loop',
553 'value' => 'on',
554 'operator' => '==',
555 ],
556 [
557 'item' => 'modules.compare.loop_btn_position',
558 'value' => 'custom',
559 'operator' => '==',
560 ],
561 ],
562 'relation' => 'and',
563 ],
564 ],
565 'show_btn_product_page' => [
566 'id' => 'show_btn_product_page',
567 'type' => 'switch',
568 'value' => 'on',
569 'label' => esc_html__( 'Show Button in Single Product Page', 'shopbuilder' ),
570 'tab' => 'button',
571 ],
572 'product_btn_position' => [
573 'id' => 'product_btn_position',
574 'label' => esc_html__( 'Product Page Button Position', 'shopbuilder' ),
575 'help' => esc_html__( 'You can manage compare button position in single product page.', 'shopbuilder' ),
576 'type' => 'select',
577 'value' => 'custom',
578 'options' => [
579 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
580 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
581 'after_thumbnail' => esc_html__( 'After Image', 'shopbuilder' ),
582 'after_summary' => esc_html__( 'After Summary', 'shopbuilder' ),
583 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
584 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
585 ],
586 'dependency' => [
587 'rules' => [
588 [
589 'item' => 'modules.compare.show_btn_product_page',
590 'value' => 'on',
591 'operator' => '==',
592 ],
593 ],
594 ],
595 'tab' => 'button',
596 ],
597 'product_btn_position_shortcode' => [
598 'type' => 'raw',
599 'label' => ' ',
600 'html' => sprintf(
601 /* translators: 1: The shortcode.*/
602 esc_html__( 'Choose where to show button on the product page. Copy this shortcode %1$s and paste it where you want to show the button.', 'shopbuilder' ),
603 '<code>[rtsb_wishlist_button]</code> '
604 ),
605 'dependency' => [
606 'rules' => [
607 [
608 'item' => 'modules.wishlist.show_btn_product_page',
609 'value' => 'on',
610 'operator' => '==',
611 ],
612 [
613 'item' => 'modules.wishlist.product_btn_position',
614 'value' => 'shortcode',
615 'operator' => '==',
616 ],
617 ],
618 ],
619 'tab' => 'button',
620 ],
621 'product_custom_hook_name' => [
622 'id' => 'product_custom_hook_name',
623 'type' => 'text',
624 'label' => esc_html__( 'Product Hook Name', 'shopbuilder' ),
625 'tab' => 'button',
626 'dependency' => [
627 'rules' => [
628 [
629 'item' => 'modules.compare.show_btn_product_page',
630 'value' => 'on',
631 'operator' => '==',
632 ],
633 [
634 'item' => 'modules.compare.product_btn_position',
635 'value' => 'custom',
636 'operator' => '==',
637 ],
638 ],
639 ],
640 ],
641 'product_custom_hook_priority' => [
642 'id' => 'product_custom_hook_priority',
643 'type' => 'number',
644 'value' => 10,
645 'size' => 'small',
646 'min' => 0,
647 'max' => 999,
648 'label' => esc_html__( 'Product Hook Priority', 'shopbuilder' ),
649 'tab' => 'button',
650 'dependency' => [
651 'rules' => [
652 [
653 'item' => 'modules.compare.show_btn_product_page',
654 'value' => 'on',
655 'operator' => '==',
656 ],
657 [
658 'item' => 'modules.compare.product_btn_position',
659 'value' => 'custom',
660 'operator' => '==',
661 ],
662 ],
663 'relation' => 'and',
664 ],
665 ],
666 'button_text' => [
667 'id' => 'button_text',
668 'label' => esc_html__( 'Button Text', 'shopbuilder' ),
669 'help' => esc_html__( 'Enter your compare button text.', 'shopbuilder' ),
670 'type' => 'text',
671 'value' => 'Compare',
672 'placeholder' => 'Compare',
673 'tab' => 'button',
674 ],
675 'notice_added_text' => [
676 'id' => 'notice_added_text',
677 'label' => esc_html__( 'Product Added Text', 'shopbuilder' ),
678 'help' => esc_html__( 'Enter the product added text.', 'shopbuilder' ),
679 'type' => 'text',
680 'value' => 'Product added!',
681 'placeholder' => 'Product added!',
682 'tab' => 'button',
683 ],
684 'browse_list_text' => [
685 'id' => 'browse_list_text',
686 'label' => esc_html__( 'Browse Compare Text', 'shopbuilder' ),
687 'help' => esc_html__( 'Enter a text for the "Browse compare" link on the compare page', 'shopbuilder' ),
688 'type' => 'text',
689 'value' => 'Browse compare',
690 'placeholder' => 'Browse compare',
691 'tab' => 'button',
692 ],
693 'notice_removed_text' => [
694 'id' => 'notice_removed_text',
695 'label' => esc_html__( 'Product Removed Text', 'shopbuilder' ),
696 'help' => esc_html__( 'Enter the product removed text.', 'shopbuilder' ),
697 'type' => 'text',
698 'value' => 'Product removed!',
699 'placeholder' => 'Product removed!',
700 'tab' => 'button',
701 ],
702 'page' => [
703 'id' => 'page',
704 'type' => 'select',
705 'help' => sprintf(
706 /* translators: 1: The shortcode.*/
707 esc_html__( 'Select a page for compare page and make sure you add the shortcode %1$s into the page content', 'shopbuilder' ),
708 '<code>[rtsb_compare_list]</code>'
709 ),
710 'label' => esc_html__( 'Compare Page', 'shopbuilder' ),
711 'options' => Fns::get_pages(),
712 'empty' => esc_html__( 'Select a page', 'shopbuilder' ),
713 'searchable' => true,
714 'tab' => 'page',
715 ],
716 'max_limit' => [
717 'id' => 'page',
718 'type' => 'number',
719 'sanitize_fn' => 'absint',
720 'value' => 10,
721 'help' => esc_html__( 'You can manage your maximum compare quantity from here.', 'shopbuilder' ),
722 'label' => esc_html__( 'Max Limit', 'shopbuilder' ),
723 'tab' => 'page',
724 ],
725 'page_show_fields' => [
726 'value' => CompareFns::get_list_field_ids(),
727 'id' => 'page_show_fields',
728 'multiple' => true,
729 'checkbox' => true,
730 'type' => 'sortable',
731 'options' => CompareFns::get_available_list_fields(),
732 'label' => esc_html__( 'Show Fields in List', 'shopbuilder' ),
733 'tab' => 'page',
734 ],
735
736 ]
737 ),
738 'tabs' => [
739 'button' => [
740 'title' => esc_html__( 'Button', 'shopbuilder' ),
741 ],
742 'page' => [
743 'title' => esc_html__( 'Page', 'shopbuilder' ),
744 ],
745
746 ],
747 ]
748 ),
749 'variation_gallery' => apply_filters(
750 'rtsb/module/variation_gallery/options',
751 [
752 'id' => 'variation_gallery',
753 'external' => true,
754 'category' => 'general',
755 'title' => esc_html__( 'Variation Gallery', 'shopbuilder' ),
756 'pluginSlug' => 'woo-product-variation-gallery',
757 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-gallery/woo-product-variation-gallery.php' ),
758 'pluginIsActive' => Fns::check_plugin_active( 'woo-product-variation-gallery/woo-product-variation-gallery.php' ),
759 'pluginActiveUrl' => add_query_arg(
760 [
761 '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-gallery/woo-product-variation-gallery.php' ),
762 'action' => 'activate',
763 'plugin' => 'woo-product-variation-gallery/woo-product-variation-gallery.php',
764 ],
765 admin_url( 'plugins.php' )
766 ),
767 'help' => esc_html__( 'This module requires: Variation Images Gallery for WooCommerce Plugin', 'shopbuilder' ),
768 'package' => 'free',
769 'active_field' => [
770 'disable' => false,
771 ],
772 'fields' => [],
773 ]
774 ),
775 'variation_swatches' => apply_filters(
776 'rtsb/module/variation_swatches/options',
777 [
778 'id' => 'variation_swatches',
779 'external' => true,
780 'category' => 'general',
781 'title' => esc_html__( 'Variation Swatches', 'shopbuilder' ),
782 'pluginSlug' => 'woo-product-variation-swatches',
783 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-swatches/woo-product-variation-swatches.php' ),
784 'pluginIsActive' => Fns::check_plugin_active( 'woo-product-variation-swatches/woo-product-variation-swatches.php' ),
785 'pluginActiveUrl' => add_query_arg(
786 [
787 '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-swatches/woo-product-variation-swatches.php' ),
788 'action' => 'activate',
789 'plugin' => 'woo-product-variation-swatches/woo-product-variation-swatches.php',
790 ],
791 admin_url( 'plugins.php' )
792 ),
793 'help' => esc_html__( 'This module requires: Variation Swatches for WooCommerce Plugin.', 'shopbuilder' ),
794 'package' => 'free',
795 'active_field' => [
796 'disable' => false,
797 ],
798 'fields' => [],
799 ]
800 ),
801 'quick_checkout' => apply_filters(
802 'rtsb/module/quick_checkout/options',
803 [
804 'id' => 'quick_checkout',
805 'base_class' => QuickCheckout::class,
806 'category' => 'pro',
807 'title' => esc_html__( 'Quick Checkout', 'shopbuilder' ),
808 'package' => 'pro-disabled',
809 'active_field' => [
810 'label' => esc_html__( 'Enable Quick Checkout?', 'shopbuilder' ),
811 'help' => esc_html__( 'Switch on to enable quick checkout module.', 'shopbuilder' ),
812 ],
813 'fields' => [],
814 ]
815 ),
816 'mini_cart' => apply_filters(
817 'rtsb/module/mini_cart/options',
818 [
819 'id' => 'mini_cart',
820 'base_class' => MiniCart::class,
821 'category' => 'pro',
822 'title' => esc_html__( 'Mini Cart', 'shopbuilder' ),
823 'package' => 'pro-disabled',
824 'active_field' => [
825 'label' => esc_html__( 'Enable Mini Cart?', 'shopbuilder' ),
826 'help' => esc_html__( 'Switch on to enable mini cart module.', 'shopbuilder' ),
827 ],
828 'fields' => [],
829 ]
830 ),
831 ];
832
833 return apply_filters( 'rtsb/core/modules/raw_list', $list );
834 }
835 }
836