PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.1.6
ShopBuilder – WooCommerce Builder For Elementor v2.1.6
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 2.3.0 All 62 releases
shopbuilder / app / Models / ModuleList.php

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

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