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

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

2,110 lines 77.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * ShopBuilder Module List.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Models;
9
10 use RadiusTheme\SB\Helpers\Fns;
11 use RadiusTheme\SB\Models\Base\ListModel;
12 use RadiusTheme\SB\Modules\Badges\Badges;
13 use RadiusTheme\SB\Modules\CheckoutEditor\CheckoutEditorInit;
14 use RadiusTheme\SB\Modules\CheckoutEditor\CheckoutFns;
15 use RadiusTheme\SB\Traits\SingletonTrait;
16 use RadiusTheme\SB\Modules\Compare\Compare;
17 use RadiusTheme\SB\Modules\WishList\Wishlist;
18 use RadiusTheme\SB\Modules\Compare\CompareFns;
19 use RadiusTheme\SB\Modules\QuickView\QuickView;
20 use RadiusTheme\SB\Modules\WishList\WishlistFns;
21 use RadiusTheme\SBPRO\Helpers\FnsPro;
22
23 defined( 'ABSPATH' ) || exit;
24
25 /**
26 * ShopBuilder Module List.
27 */
28 class ModuleList extends ListModel {
29
30 use SingletonTrait;
31
32 /**
33 * List ID.
34 *
35 * @var string
36 */
37 protected $list_id = 'modules';
38
39 /**
40 * Class constructor.
41 */
42 public function __construct() {
43 parent::__construct();
44 $this->title = esc_html__( 'Modules', 'shopbuilder' );
45 $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' );
46 }
47
48 /**
49 * Module list.
50 *
51 * @return mixed|null
52 */
53 protected function raw_list() {
54 $list = [
55 'quick_view' => apply_filters(
56 'rtsb/module/quick_view/options',
57 [
58 'id' => 'quick_view',
59 'title' => esc_html__( 'Quick View', 'shopbuilder' ),
60 'base_class' => QuickView::class,
61 'category' => 'general',
62 'active' => 'on',
63 'package' => 'free',
64 'active_field' => [
65 'label' => esc_html__( 'Enable Quick View?', 'shopbuilder' ),
66 'help' => esc_html__( 'Switch on to enable quick view module.', 'shopbuilder' ),
67 ],
68 'tabs' => [
69 'general' => [
70 'title' => esc_html__( 'General', 'shopbuilder' ),
71 ],
72 'style' => [
73 'title' => esc_html__( 'Style', 'shopbuilder' ),
74 ],
75 ],
76 'fields' => apply_filters(
77 'rtsb/module/quick_view/fields',
78 [
79 'loop_btn_position' => [
80 'id' => 'loop_btn_position',
81 'type' => 'select',
82 'value' => 'custom',
83 'label' => esc_html__( 'Shop Page Button Position', 'shopbuilder' ),
84 'help' => esc_html__( 'You can manage quick view button position in shop page.', 'shopbuilder' ),
85 'tab' => 'general',
86 'options' => [
87 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
88 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
89 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
90 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
91 ],
92
93 ],
94 'loop_btn_position_shortcode' => [
95 'type' => 'raw',
96 'label' => ' ',
97 'html' => sprintf(
98 /* translators: 1: The shortcode.*/
99 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' ),
100 '<code>[rtsb_quick_view_button]</code>'
101 ),
102 'tab' => 'general',
103 'dependency' => [
104 'rules' => [
105 [
106 'item' => 'modules.quick_view.loop_btn_position',
107 'value' => 'shortcode',
108 'operator' => '==',
109 ],
110 ],
111 ],
112 ],
113 'loop_custom_hook_name' => [
114 'id' => 'loop_custom_hook_name',
115 'type' => 'text',
116 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
117 'help' => sprintf(
118 /* translators: 1: The shortcode.*/
119 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
120 "<br /><code>&lt;?php do_action( 'rtsb/modules/quick_view/frontend/display' ); ?&gt;</code><br />"
121 ),
122 'tab' => 'general',
123 'dependency' => [
124 'rules' => [
125 [
126 'item' => 'modules.quick_view.loop_btn_position',
127 'value' => 'custom',
128 'operator' => '==',
129 ],
130 ],
131 ],
132 ],
133 'loop_custom_hook_priority' => [
134 'id' => 'loop_custom_hook_priority',
135 'type' => 'number',
136 'value' => 10,
137 'size' => 'small',
138 'min' => 0,
139 'max' => 999,
140 'label' => esc_html__( 'Hook Priority', 'shopbuilder' ),
141 'tab' => 'general',
142 'dependency' => [
143 'rules' => [
144 [
145 'item' => 'modules.quick_view.loop_btn_position',
146 'value' => 'custom',
147 'operator' => '==',
148 ],
149 ],
150 ],
151 ],
152 'button_text' => [
153 'id' => 'button_text',
154 'label' => esc_html__( 'Quick View Text', 'shopbuilder' ),
155 'help' => esc_html__( 'Enter your quick view button text.', 'shopbuilder' ),
156 'type' => 'text',
157 'value' => 'Quick View',
158 'placeholder' => 'Quick View',
159 'tab' => 'general',
160 ],
161
162 // Module Style.
163 'modal_width' => [
164 'id' => 'modal_width',
165 'label' => esc_html__( 'Modal Width (in px)', 'shopbuilder' ),
166 'help' => esc_html__( 'Quick view button modal width. Example: 950', 'shopbuilder' ),
167 'type' => 'number',
168 'value' => '',
169 'tab' => 'style',
170 ],
171
172 'modal_height' => [
173 'id' => 'modal_height',
174 'label' => esc_html__( 'Modal Height', 'shopbuilder' ),
175 'help' => esc_html__( 'Quick view button modal height. Example: 450px', 'shopbuilder' ),
176 'type' => 'text',
177 'value' => '',
178 'tab' => 'style',
179 ],
180
181 'modal_wrapper_padding' => [
182 'id' => 'modal_wrapper_padding',
183 'label' => esc_html__( 'Modal Wrapper Padding', 'shopbuilder' ),
184 'help' => esc_html__( 'Quick view modal wrapper padding. Example 1: 20px, Example 2: 20px 20px 20px 20px', 'shopbuilder' ),
185 'type' => 'text',
186 'value' => '',
187 'tab' => 'style',
188 ],
189 'modal_bg_color' => [
190 'id' => 'modal_bg_color',
191 'label' => esc_html__( 'Modal Backgroud Color', 'shopbuilder' ),
192 'help' => esc_html__( 'Quick view modal background color. Example: #fff', 'shopbuilder' ),
193 'type' => 'color',
194 'value' => '',
195 'tab' => 'style',
196 ],
197 'modal_box_shadow_color' => [
198 'id' => 'modal_box_shadow_color',
199 'label' => esc_html__( 'Modal Box Shadow Color', 'shopbuilder' ),
200 'help' => esc_html__( 'Quick view modal box shadow. Example: #000', 'shopbuilder' ),
201 'type' => 'color',
202 'value' => '',
203 'tab' => 'style',
204 ],
205
206 'modal_overly_color' => [
207 'id' => 'modal_overly_color',
208 'label' => esc_html__( 'Modal Overly Color', 'shopbuilder' ),
209 'help' => esc_html__( 'Quick view modal overly. Example: #000', 'shopbuilder' ),
210 'type' => 'color',
211 'value' => '',
212 'tab' => 'style',
213 ],
214
215 ]
216 ),
217 ]
218 ),
219 'wishlist' => apply_filters(
220 'rtsb/module/wishlist/options',
221 [
222 'id' => 'wishlist',
223 'title' => esc_html__( 'Wishlist', 'shopbuilder' ),
224 'package' => 'free',
225 'active' => 'on',
226 'base_class' => Wishlist::class,
227 'category' => 'general',
228 'active_field' => [
229 'label' => esc_html__( 'Enable Wishlist?', 'shopbuilder' ),
230 'help' => esc_html__( 'Switch on to enable wishlist module.', 'shopbuilder' ),
231 ],
232 'fields' => apply_filters(
233 'rtsb/module/wishlist/fields',
234 [
235 'enable_login_limit' => [
236 'id' => 'enable_login_limit',
237 'type' => 'switch',
238 'label' => esc_html__( 'Limit Wishlist Use', 'shopbuilder' ),
239 'help' => esc_html__( 'Enable this option to allow only the logged-in users to use the Wishlist feature.', 'shopbuilder' ),
240 'tab' => 'general',
241 ],
242 'hide_wishlist_non_logged_in' => [
243 'id' => 'hide_wishlist_non_logged_in',
244 'type' => 'switch',
245 'label' => esc_html__( 'Hide Wishlist Button', 'shopbuilder' ),
246 'help' => esc_html__( 'Hide Wishlist Button For non logged-in users (guest users).', 'shopbuilder' ),
247 'dependency' => [
248 'rules' => [
249 [
250 'item' => 'modules.wishlist.enable_login_limit',
251 'value' => 'on',
252 'operator' => '==',
253 ],
254 ],
255 ],
256 'tab' => 'general',
257 ],
258 'wishlist_shop_wrapper_heading' => [
259 'id' => 'wishlist_shop_wrapper_heading',
260 'type' => 'title',
261 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder' ),
262 'tab' => 'button',
263 ],
264 'show_btn_on_loop' => [
265 'id' => 'show_btn_on_loop',
266 'value' => 'on',
267 'type' => 'switch',
268 'label' => esc_html__( 'Show in Shop Page', 'shopbuilder' ),
269 'tab' => 'button',
270 ],
271 'loop_btn_position' => [
272 'id' => 'loop_btn_position',
273 'type' => 'select',
274 'value' => 'custom',
275 'label' => esc_html__( 'Shop Page Button Position', 'shopbuilder' ),
276 'help' => esc_html__( 'You can manage wishlist button position in shop page.', 'shopbuilder' ),
277 'options' => [
278 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
279 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
280 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
281 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
282 ],
283 'dependency' => [
284 'rules' => [
285 [
286 'item' => 'modules.wishlist.show_btn_on_loop',
287 'value' => 'on',
288 'operator' => '==',
289 ],
290 ],
291 ],
292 'tab' => 'button',
293 ],
294 'loop_btn_position_shortcode' => [
295 'type' => 'raw',
296 'label' => ' ',
297 'html' => sprintf(
298 /* translators: 1: The shortcode.*/
299 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' ),
300 '<code>[rtsb_wishlist_button]</code>'
301 ),
302 'dependency' => [
303 'rules' => [
304 [
305 'item' => 'modules.wishlist.show_btn_on_loop',
306 'value' => 'on',
307 'operator' => '==',
308 ],
309 [
310 'item' => 'modules.wishlist.loop_btn_position',
311 'value' => 'shortcode',
312 'operator' => '==',
313 ],
314 ],
315 ],
316 'tab' => 'button',
317 ],
318 'loop_custom_hook_name' => [
319 'id' => 'loop_custom_hook_name',
320 'type' => 'text',
321 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
322 'tab' => 'button',
323 'help' => sprintf(
324 /* translators: 1: The shortcode.*/
325 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
326 "<br /><code>&lt;?php do_action('rtsb/modules/wishlist/frontend/display' ); ?&gt;</code><br />"
327 ),
328 'dependency' => [
329 'rules' => [
330 [
331 'item' => 'modules.wishlist.show_btn_on_loop',
332 'value' => 'on',
333 'operator' => '==',
334 ],
335 [
336 'item' => 'modules.wishlist.loop_btn_position',
337 'value' => 'custom',
338 'operator' => '==',
339 ],
340 ],
341 ],
342 ],
343 'loop_custom_hook_priority' => [
344 'id' => 'loop_custom_hook_priority',
345 'type' => 'number',
346 'value' => 10,
347 'size' => 'small',
348 'min' => 0,
349 'max' => 999,
350 'label' => esc_html__( 'Hook Priority', 'shopbuilder' ),
351 'tab' => 'button',
352 'dependency' => [
353 'rules' => [
354 [
355 'item' => 'modules.wishlist.show_btn_on_loop',
356 'value' => 'on',
357 'operator' => '==',
358 ],
359 [
360 'item' => 'modules.wishlist.loop_btn_position',
361 'value' => 'custom',
362 'operator' => '==',
363 ],
364 ],
365 'relation' => 'and',
366 ],
367 ],
368 'wishlist_single_wrapper_heading' => [
369 'id' => 'wishlist_single_wrapper_heading',
370 'type' => 'title',
371 'label' => esc_html__( 'Product Page Settings', 'shopbuilder' ),
372 'tab' => 'button',
373 ],
374 'show_btn_product_page' => [
375 'id' => 'show_btn_product_page',
376 'value' => 'on',
377 'type' => 'switch',
378 'label' => esc_html__( 'Show in Product Page', 'shopbuilder' ),
379 'tab' => 'button',
380 ],
381 'product_btn_position' => [
382 'id' => 'product_btn_position',
383 'label' => esc_html__( 'Product Page Button Position', 'shopbuilder' ),
384 'help' => esc_html__( 'You can manage compare button position in single product page.', 'shopbuilder' ),
385 'type' => 'select',
386 'value' => 'custom',
387 'options' => [
388 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
389 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
390 'after_thumbnail' => esc_html__( 'After Image', 'shopbuilder' ),
391 'after_summary' => esc_html__( 'After Summary', 'shopbuilder' ),
392 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
393 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
394 ],
395 'dependency' => [
396 'rules' => [
397 [
398 'item' => 'modules.wishlist.show_btn_product_page',
399 'value' => 'on',
400 'operator' => '==',
401 ],
402 ],
403 ],
404 'tab' => 'button',
405 ],
406 'product_btn_position_shortcode' => [
407 'type' => 'raw',
408 'label' => ' ',
409 'html' => sprintf(
410 /* translators: 1: The shortcode.*/
411 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' ),
412 '<code>[rtsb_wishlist_button]</code>'
413 ),
414 'dependency' => [
415 'rules' => [
416 [
417 'item' => 'modules.wishlist.show_btn_product_page',
418 'value' => 'on',
419 'operator' => '==',
420 ],
421 [
422 'item' => 'modules.wishlist.product_btn_position',
423 'value' => 'shortcode',
424 'operator' => '==',
425 ],
426 ],
427 ],
428 'tab' => 'button',
429 ],
430 'product_custom_hook_name' => [
431 'id' => 'product_custom_hook_name',
432 'type' => 'text',
433 'label' => esc_html__( 'Product Hook Name', 'shopbuilder' ),
434 'tab' => 'button',
435 'help' => sprintf(
436 /* translators: 1: The shortcode.*/
437 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
438 "<br /><code>&lt;?php do_action('rtsb/modules/wishlist/frontend/display' ); ?&gt;</code><br />"
439 ),
440 'dependency' => [
441 'rules' => [
442 [
443 'item' => 'modules.wishlist.show_btn_product_page',
444 'value' => 'on',
445 'operator' => '==',
446 ],
447 [
448 'item' => 'modules.wishlist.product_btn_position',
449 'value' => 'custom',
450 'operator' => '==',
451 ],
452 ],
453 ],
454 ],
455 'product_custom_hook_priority' => [
456 'id' => 'product_custom_hook_priority',
457 'type' => 'number',
458 'value' => 10,
459 'size' => 'small',
460 'min' => 0,
461 'max' => 999,
462 'label' => esc_html__( 'Product Hook Priority', 'shopbuilder' ),
463 'tab' => 'button',
464 'dependency' => [
465 'rules' => [
466 [
467 'item' => 'modules.wishlist.show_btn_product_page',
468 'value' => 'on',
469 'operator' => '==',
470 ],
471 [
472 'item' => 'modules.wishlist.product_btn_position',
473 'value' => 'custom',
474 'operator' => '==',
475 ],
476 ],
477 'relation' => 'and',
478 ],
479 ],
480 'button_text' => [
481 'id' => 'button_text',
482 'label' => esc_html__( 'Wishlist Text', 'shopbuilder' ),
483 'help' => esc_html__( 'Enter your wishlist button text.', 'shopbuilder' ),
484 'type' => 'text',
485 'value' => 'Add to Wishlist',
486 'placeholder' => 'Add to Wishlist',
487 'tab' => 'button',
488 ],
489 'notice_added_text' => [
490 'id' => 'notice_added_text',
491 'label' => esc_html__( 'Product Added Text', 'shopbuilder' ),
492 'help' => esc_html__( 'Enter the product added text.', 'shopbuilder' ),
493 'type' => 'text',
494 'value' => esc_html__( 'Product added!', 'shopbuilder' ),
495 'placeholder' => esc_html__( 'Product added!', 'shopbuilder' ),
496 'tab' => 'general',
497 ],
498 'notice_removed_text' => [
499 'id' => 'notice_removed_text',
500 'label' => esc_html__( 'Product Removed Text', 'shopbuilder' ),
501 'help' => esc_html__( 'Enter the product removed text.', 'shopbuilder' ),
502 'type' => 'text',
503 'value' => esc_html__( 'Product removed!', 'shopbuilder' ),
504 'placeholder' => esc_html__( 'Product removed!', 'shopbuilder' ),
505 'tab' => 'general',
506 ],
507 'browse_list_text' => [
508 'id' => 'browse_list_text',
509 'label' => esc_html__( 'Browse Wishlist Text', 'shopbuilder' ),
510 'help' => esc_html__( 'Enter a text for the "Browse wishlist" link on the product page', 'shopbuilder' ),
511 'type' => 'text',
512 'value' => esc_html__( 'Browse Wishlist', 'shopbuilder' ),
513 'placeholder' => esc_html__( 'Browse Wishlist', 'shopbuilder' ),
514 'tab' => 'general',
515 ],
516 /*
517 * TODO:: Will Implement Later.
518 'redirect_cart' => array(
519 'id' => 'redirect_cart',
520 'type' => 'switch',
521 'help' => esc_html__( 'Redirect users to the cart page when they add a product to the cart from the wishlist page', 'shopbuilder' ),
522 'label' => esc_html__( 'Redirect to Cart', 'shopbuilder' ),
523 'tab' => 'page',
524 ),
525 'remove_after_add_to_cart' => array(
526 'value' => 'on',
527 'id' => 'remove_after_add_to_cart',
528 'type' => 'switch',
529 'help' => esc_html__( 'Remove the product from the wishlist after it has been added to the cart', 'shopbuilder' ),
530 'label' => esc_html__( 'Remove if Added to Cart', 'shopbuilder' ),
531 'tab' => 'page',
532 ),
533 */
534 'page' => [
535 'id' => 'page',
536 'type' => 'select',
537 'label' => esc_html__( 'Select Wishlist Page', 'shopbuilder' ),
538 'help' => sprintf(
539 /* translators: 1: The shortcode.*/
540 esc_html__( 'Select a page for wishlist page and make sure you add the shortcode %1$s into the page content', 'shopbuilder' ),
541 '<code>[rtsb_wishlist]</code>'
542 ),
543 'options' => Fns::get_pages(),
544 'tab' => 'page',
545 ],
546 'page_show_fields' => [
547 'value' => WishlistFns::instance()->get_field_ids(),
548 'id' => 'page_show_fields',
549 'multiple' => true,
550 'checkbox' => true,
551 'sanitize_fn' => 'sanitize_text_field',
552 'type' => 'sortable',
553 'options' => WishlistFns::instance()->get_default_fields(),
554 'label' => esc_html__( 'Wishlist Table Fields Visibility', 'shopbuilder' ),
555 'tab' => 'page',
556 ],
557
558 ]
559 ),
560 'tabs' => [
561 'general' => [
562 'title' => esc_html__( 'General', 'shopbuilder' ),
563 ],
564 'button' => [
565 'title' => esc_html__( 'Button', 'shopbuilder' ),
566 ],
567 'page' => [
568 'title' => esc_html__( 'Page', 'shopbuilder' ),
569 ],
570 ],
571 ]
572 ),
573 'compare' => apply_filters(
574 'rtsb/module/compare/options',
575 [
576 'id' => 'compare',
577 'base_class' => Compare::class,
578 'category' => 'general',
579 'title' => esc_html__( 'Product Compare', 'shopbuilder' ),
580 'package' => 'free',
581 'active' => 'on',
582 'active_field' => [
583 'label' => esc_html__( 'Enable Product Comparison?', 'shopbuilder' ),
584 'help' => esc_html__( 'Switch on to enable product comparison module.', 'shopbuilder' ),
585 ],
586 'fields' => apply_filters(
587 'rtsb/module/compare/fields',
588 [
589 'compare_shop_wrapper_heading' => [
590 'id' => 'compare_shop_wrapper_heading',
591 'type' => 'title',
592 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder' ),
593 'tab' => 'button',
594 ],
595 'show_btn_on_loop' => [
596 'id' => 'show_btn_on_loop',
597 'value' => 'on',
598 'type' => 'switch',
599 'label' => esc_html__( 'Show in Shop Page', 'shopbuilder' ),
600 'tab' => 'button',
601 ],
602 'loop_btn_position' => [
603 'id' => 'loop_btn_position',
604 'type' => 'select',
605 'value' => 'custom',
606 'label' => esc_html__( 'Shop Page Button Position', 'shopbuilder' ),
607 'help' => esc_html__( 'You can manage wishlist button position in shop page.', 'shopbuilder' ),
608 'options' => [
609 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
610 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
611 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
612 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
613 ],
614 'dependency' => [
615 'rules' => [
616 [
617 'item' => 'modules.compare.show_btn_on_loop',
618 'value' => 'on',
619 'operator' => '==',
620 ],
621 ],
622 ],
623 'tab' => 'button',
624 ],
625 'loop_btn_position_shortcode' => [
626 'type' => 'raw',
627 'label' => ' ',
628 'html' => sprintf(
629 /* translators: 1: The shortcode.*/
630 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' ),
631 '<code>[rtsb_compare_button]</code>'
632 ),
633 'dependency' => [
634 'rules' => [
635 [
636 'item' => 'modules.compare.show_btn_on_loop',
637 'value' => 'on',
638 'operator' => '==',
639 ],
640 [
641 'item' => 'modules.compare.loop_btn_position',
642 'value' => 'shortcode',
643 'operator' => '==',
644 ],
645 ],
646 ],
647 'tab' => 'button',
648 ],
649 'loop_custom_hook_name' => [
650 'id' => 'product_custom_hook_name',
651 'type' => 'text',
652 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
653 'tab' => 'button',
654 'help' => sprintf(
655 /* translators: 1: The shortcode.*/
656 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
657 "<br /><code>&lt;?php do_action('rtsb/modules/compare/frontend/display' ); ?&gt;</code><br />"
658 ),
659 'dependency' => [
660 'rules' => [
661 [
662 'item' => 'modules.compare.show_btn_on_loop',
663 'value' => 'on',
664 'operator' => '==',
665 ],
666 [
667 'item' => 'modules.compare.loop_btn_position',
668 'value' => 'custom',
669 'operator' => '==',
670 ],
671 ],
672 ],
673 ],
674 'loop_custom_hook_priority' => [
675 'id' => 'product_custom_hook_priority',
676 'type' => 'number',
677 'value' => 10,
678 'size' => 'small',
679 'min' => 0,
680 'max' => 999,
681 'label' => esc_html__( 'Hook Priority', 'shopbuilder' ),
682 'tab' => 'button',
683 'dependency' => [
684 'rules' => [
685 [
686 'item' => 'modules.compare.show_btn_on_loop',
687 'value' => 'on',
688 'operator' => '==',
689 ],
690 [
691 'item' => 'modules.compare.loop_btn_position',
692 'value' => 'custom',
693 'operator' => '==',
694 ],
695 ],
696 'relation' => 'and',
697 ],
698 ],
699 'compare_single_wrapper_heading' => [
700 'id' => 'compare_single_wrapper_heading',
701 'type' => 'title',
702 'label' => esc_html__( 'Product Page Settings', 'shopbuilder' ),
703 'tab' => 'button',
704 ],
705 'show_btn_product_page' => [
706 'id' => 'show_btn_product_page',
707 'type' => 'switch',
708 'value' => 'on',
709 'label' => esc_html__( 'Show Button in Product Page', 'shopbuilder' ),
710 'tab' => 'button',
711 ],
712 'product_btn_position' => [
713 'id' => 'product_btn_position',
714 'label' => esc_html__( 'Product Page Button Position', 'shopbuilder' ),
715 'help' => esc_html__( 'You can manage compare button position in single product page.', 'shopbuilder' ),
716 'type' => 'select',
717 'value' => 'custom',
718 'options' => [
719 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
720 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
721 'after_thumbnail' => esc_html__( 'After Image', 'shopbuilder' ),
722 'after_summary' => esc_html__( 'After Summary', 'shopbuilder' ),
723 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
724 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
725 ],
726 'dependency' => [
727 'rules' => [
728 [
729 'item' => 'modules.compare.show_btn_product_page',
730 'value' => 'on',
731 'operator' => '==',
732 ],
733 ],
734 ],
735 'tab' => 'button',
736 ],
737 'product_btn_position_shortcode' => [
738 'type' => 'raw',
739 'label' => ' ',
740 'html' => sprintf(
741 /* translators: 1: The shortcode.*/
742 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' ),
743 '<code>[rtsb_wishlist_button]</code> '
744 ),
745 'dependency' => [
746 'rules' => [
747 [
748 'item' => 'modules.wishlist.show_btn_product_page',
749 'value' => 'on',
750 'operator' => '==',
751 ],
752 [
753 'item' => 'modules.wishlist.product_btn_position',
754 'value' => 'shortcode',
755 'operator' => '==',
756 ],
757 ],
758 ],
759 'tab' => 'button',
760 ],
761 'product_custom_hook_name' => [
762 'id' => 'product_custom_hook_name',
763 'type' => 'text',
764 'label' => esc_html__( 'Product Hook Name', 'shopbuilder' ),
765 'tab' => 'button',
766 'help' => sprintf(
767 /* translators: 1: The shortcode.*/
768 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
769 "<br /><code>&lt;?php do_action('rtsb/modules/compare/frontend/display' ); ?&gt;</code><br />"
770 ),
771 'dependency' => [
772 'rules' => [
773 [
774 'item' => 'modules.compare.show_btn_product_page',
775 'value' => 'on',
776 'operator' => '==',
777 ],
778 [
779 'item' => 'modules.compare.product_btn_position',
780 'value' => 'custom',
781 'operator' => '==',
782 ],
783 ],
784 ],
785 ],
786 'product_custom_hook_priority' => [
787 'id' => 'product_custom_hook_priority',
788 'type' => 'number',
789 'value' => 10,
790 'size' => 'small',
791 'min' => 0,
792 'max' => 999,
793 'label' => esc_html__( 'Product Hook Priority', 'shopbuilder' ),
794 'tab' => 'button',
795 'dependency' => [
796 'rules' => [
797 [
798 'item' => 'modules.compare.show_btn_product_page',
799 'value' => 'on',
800 'operator' => '==',
801 ],
802 [
803 'item' => 'modules.compare.product_btn_position',
804 'value' => 'custom',
805 'operator' => '==',
806 ],
807 ],
808 'relation' => 'and',
809 ],
810 ],
811 'button_text' => [
812 'id' => 'button_text',
813 'label' => esc_html__( 'Compare Button Text', 'shopbuilder' ),
814 'help' => esc_html__( 'Enter your compare button text.', 'shopbuilder' ),
815 'type' => 'text',
816 'value' => esc_html__( 'Compare', 'shopbuilder' ),
817 'placeholder' => esc_html__( 'Compare', 'shopbuilder' ),
818 'tab' => 'button',
819 ],
820 'notice_added_text' => [
821 'id' => 'notice_added_text',
822 'label' => esc_html__( 'Product Added Text', 'shopbuilder' ),
823 'help' => esc_html__( 'Enter the product added text.', 'shopbuilder' ),
824 'type' => 'text',
825 'value' => esc_html__( 'Product added!', 'shopbuilder' ),
826 'placeholder' => esc_html__( 'Product added!', 'shopbuilder' ),
827 'tab' => 'general',
828 ],
829 'notice_removed_text' => [
830 'id' => 'notice_removed_text',
831 'label' => esc_html__( 'Product Removed Text', 'shopbuilder' ),
832 'help' => esc_html__( 'Enter the product removed text.', 'shopbuilder' ),
833 'type' => 'text',
834 'value' => esc_html__( 'Product removed!', 'shopbuilder' ),
835 'placeholder' => esc_html__( 'Product removed!', 'shopbuilder' ),
836 'tab' => 'general',
837 ],
838 'browse_list_text' => [
839 'id' => 'browse_list_text',
840 'label' => esc_html__( 'Browse Compare Text', 'shopbuilder' ),
841 'help' => esc_html__( 'Enter a text for the "Browse compare" link on the compare page', 'shopbuilder' ),
842 'type' => 'text',
843 'value' => esc_html__( 'Browse Compare', 'shopbuilder' ),
844 'placeholder' => esc_html__( 'Browse Compare', 'shopbuilder' ),
845 'tab' => 'general',
846 ],
847 'page' => [
848 'id' => 'page',
849 'type' => 'select',
850 'help' => sprintf(
851 /* translators: 1: The shortcode.*/
852 esc_html__( 'Select a page for compare page and make sure you add the shortcode %1$s into the page content', 'shopbuilder' ),
853 '<code>[rtsb_compare_list]</code>'
854 ),
855 'label' => esc_html__( 'Select Compare Page', 'shopbuilder' ),
856 'options' => Fns::get_pages(),
857 'empty' => esc_html__( 'Select a page', 'shopbuilder' ),
858 'searchable' => true,
859 'tab' => 'page',
860 ],
861 'max_limit' => [
862 'id' => 'page',
863 'type' => 'number',
864 'sanitize_fn' => 'absint',
865 'value' => 10,
866 'help' => esc_html__( 'You can manage your maximum compare quantity from here.', 'shopbuilder' ),
867 'label' => esc_html__( 'Maximum Compare Limit', 'shopbuilder' ),
868 'tab' => 'page',
869 ],
870 'page_show_fields' => [
871 'value' => CompareFns::get_list_field_ids(),
872 'id' => 'page_show_fields',
873 'multiple' => true,
874 'checkbox' => true,
875 'type' => 'sortable',
876 'options' => CompareFns::get_available_list_fields(),
877 'label' => esc_html__( 'Compare Table Fields Visibility', 'shopbuilder' ),
878 'tab' => 'page',
879 ],
880
881 ]
882 ),
883 'tabs' => [
884 'general' => [
885 'title' => esc_html__( 'General', 'shopbuilder' ),
886 ],
887 'button' => [
888 'title' => esc_html__( 'Button', 'shopbuilder' ),
889 ],
890 'page' => [
891 'title' => esc_html__( 'Page', 'shopbuilder' ),
892 ],
893
894 ],
895 ]
896 ),
897 'variation_swatches' => apply_filters(
898 'rtsb/module/variation_swatches/options',
899 [
900 'id' => 'variation_swatches',
901 'external' => true,
902 'category' => 'general',
903 'title' => esc_html__( 'Variation Swatches', 'shopbuilder' ),
904 'pluginSlug' => 'woo-product-variation-swatches',
905 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-swatches/woo-product-variation-swatches.php' ),
906 'pluginIsActive' => Fns::check_plugin_active( 'woo-product-variation-swatches/woo-product-variation-swatches.php' ),
907 'pluginActiveUrl' => add_query_arg(
908 [
909 '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-swatches/woo-product-variation-swatches.php' ),
910 'action' => 'activate',
911 'plugin' => 'woo-product-variation-swatches/woo-product-variation-swatches.php',
912 ],
913 admin_url( 'plugins.php' )
914 ),
915 'help' => __( 'This module requires: <a href="https://wordpress.org/plugins/woo-product-variation-swatches/">Variation Swatches for WooCommerce</a>.', 'shopbuilder' ),
916 'package' => 'free',
917 'active_field' => [
918 'disable' => false,
919 ],
920 'fields' => [],
921 ]
922 ),
923 'variation_gallery' => apply_filters(
924 'rtsb/module/variation_gallery/options',
925 [
926 'id' => 'variation_gallery',
927 'external' => true,
928 'category' => 'general',
929 'title' => esc_html__( 'Variation Gallery', 'shopbuilder' ),
930 'pluginSlug' => 'woo-product-variation-gallery',
931 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-gallery/woo-product-variation-gallery.php' ),
932 'pluginIsActive' => Fns::check_plugin_active( 'woo-product-variation-gallery/woo-product-variation-gallery.php' ),
933 'pluginActiveUrl' => add_query_arg(
934 [
935 '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-gallery/woo-product-variation-gallery.php' ),
936 'action' => 'activate',
937 'plugin' => 'woo-product-variation-gallery/woo-product-variation-gallery.php',
938 ],
939 admin_url( 'plugins.php' )
940 ),
941 'help' => __( 'This module requires: <a href="https://wordpress.org/plugins/woo-product-variation-gallery/">Variation Images Gallery for WooCommerce</a>.', 'shopbuilder' ),
942 'package' => 'free',
943 'active_field' => [
944 'disable' => false,
945 ],
946 'fields' => [],
947 ]
948 ),
949 'mini_cart' => apply_filters(
950 'rtsb/module/mini_cart/options',
951 [
952 'id' => 'mini_cart',
953 'active' => '',
954 'title' => esc_html__( 'Mini Cart', 'shopbuilder' ),
955 'package' => $this->pro_package(),
956 'active_field' => [
957 'label' => esc_html__( 'Enable Mini Cart?', 'shopbuilder' ),
958 'help' => esc_html__( 'Switch on to enable mini cart module.', 'shopbuilder' ),
959 ],
960 'is_active' => true,
961 'fields' => Fns::pro_version_notice( '1.0.0' ),
962 ]
963 ),
964 'product_size_chart' => apply_filters(
965 'rtsb/module/product_size_chart/options',
966 [
967 'id' => 'product_size_chart',
968 'active' => '',
969 'title' => esc_html__( 'Product Size Chart', 'shopbuilder' ),
970 'package' => $this->pro_package(),
971 'active_field' => [
972 'label' => esc_html__( 'Enable Product Size Chart?', 'shopbuilder' ),
973 'help' => esc_html__( 'Switch on to enable Product Size Chart module.', 'shopbuilder' ),
974 ],
975 'fields' => Fns::pro_version_notice( '1.0.0' ),
976 ]
977 ),
978 'product_badges' => apply_filters(
979 'rtsb/module/product_badges/options',
980 [
981 'id' => 'product_badges',
982 'active' => '',
983 'title' => esc_html__( 'Product Badges', 'shopbuilder' ),
984 'package' => 'free',
985 'active_field' => [
986 'label' => esc_html__( 'Enable Product Badges?', 'shopbuilder' ),
987 'help' => esc_html__( 'Switch on to enable product badges module.', 'shopbuilder' ),
988 ],
989 'base_class' => Badges::class,
990 'fields' => $this->product_badges_fields(),
991 'tabs' => [
992 'general' => [
993 'title' => esc_html__( 'General', 'shopbuilder' ),
994 ],
995 'group' => [
996 'title' => esc_html__( 'Settings', 'shopbuilder' ),
997 ],
998 'badges' => [
999 'title' => esc_html__( 'Create Badges', 'shopbuilder' ),
1000 ],
1001 ],
1002 ]
1003 ),
1004 'customize_my_account' => apply_filters(
1005 'rtsb/module/customize_my_account/options',
1006 [
1007 'id' => 'customize_my_account',
1008 'active' => '',
1009 'title' => esc_html__( 'Customize My Account', 'shopbuilder' ),
1010 'package' => $this->pro_package(),
1011 'active_field' => [
1012 'label' => esc_html__( 'Enable Customize My Account?', 'shopbuilder' ),
1013 'help' => esc_html__( 'Switch on to enable customize my account module.', 'shopbuilder' ),
1014 ],
1015 'fields' => Fns::pro_version_notice( '1.4.0' ),
1016 ]
1017 ),
1018 'pre_order' => apply_filters(
1019 'rtsb/module/pre_order/options',
1020 [
1021 'id' => 'pre_order',
1022 'active' => '',
1023 'title' => esc_html__( 'Pre-Order', 'shopbuilder' ),
1024 'package' => $this->pro_package(),
1025 'active_field' => [
1026 'label' => esc_html__( 'Enable Pre-Order?', 'shopbuilder' ),
1027 'help' => esc_html__( 'Switch on to enable pre-order module.', 'shopbuilder' ),
1028 ],
1029 'fields' => Fns::pro_version_notice( '1.5.0' ),
1030 ]
1031 ),
1032 'currency_switcher' => apply_filters(
1033 'rtsb/module/currency_switcher/options',
1034 [
1035 'id' => 'currency_switcher',
1036 'active' => '',
1037 'title' => esc_html__( 'Currency Switcher', 'shopbuilder' ),
1038 'package' => $this->pro_package(),
1039 'active_field' => [
1040 'label' => esc_html__( 'Enable Currency Switcher?', 'shopbuilder' ),
1041 'help' => esc_html__( 'Switch on to enable currency switcher module.', 'shopbuilder' ),
1042 ],
1043 'is_active' => true,
1044 'fields' => Fns::pro_version_notice( '1.5.0' ),
1045 ]
1046 ),
1047 'product_add_ons' => apply_filters(
1048 'rtsb/module/product_add_ons/options',
1049 [
1050 'id' => 'product_add_ons',
1051 'active' => '',
1052 'title' => esc_html__( 'Product Add-Ons', 'shopbuilder' ),
1053 'package' => $this->pro_package(),
1054 'active_field' => [
1055 'label' => esc_html__( 'Enable Product Add-Ons?', 'shopbuilder' ),
1056 'help' => esc_html__( 'Switch on to enable product add-ons module.', 'shopbuilder' ),
1057 ],
1058 'is_active' => true,
1059 'fields' => Fns::pro_version_notice( '1.6.0' ),
1060 ]
1061 ),
1062 // Checkout Fields Manager.
1063 'checkout_fields_editor' => apply_filters(
1064 'rtsb/module/checkout_fields_editor/options',
1065 [
1066 'id' => 'checkout_fields_editor',
1067 'active' => '',
1068 'title' => esc_html__( 'Checkout Fields Editor', 'shopbuilder' ),
1069 'base_class' => CheckoutEditorInit::class,
1070 'active_field' => [
1071 'label' => esc_html__( 'Enable Checkout Fields Editor?', 'shopbuilder' ),
1072 'help' => esc_html__( 'Switch on to enable Checkout Fields Editor module.', 'shopbuilder' ),
1073 ],
1074 'fields' => [
1075 'checkout_billing_intro' => [
1076 'id' => 'checkout_billing_intro',
1077 'type' => 'description',
1078 'text' => esc_html__( 'Billing Fields Editor allows you to customize the default billing fields on your checkout page.', 'shopbuilder' ),
1079 'tab' => 'billing_fields',
1080 ],
1081 'modify_billing_form' => [
1082 'id' => 'modify_billing_form',
1083 'type' => 'switch',
1084 'label' => esc_html__( 'Customize Billing Form?', 'shopbuilder' ),
1085 'help' => esc_html__( 'Enable this option to edit billing Form.', 'shopbuilder' ),
1086 'tab' => 'billing_fields',
1087 ],
1088
1089 'checkout_billing_fields_info' => [
1090 'id' => 'checkout_billing_fields_info',
1091 'type' => 'title',
1092 'label' => esc_html__( 'Billing Fields', 'shopbuilder' ),
1093 'tab' => 'billing_fields',
1094 'dependency' => [
1095 'rules' => [
1096 [
1097 'item' => 'modules.checkout_fields_editor.modify_billing_form',
1098 'value' => 'on',
1099 'operator' => '==',
1100 ],
1101 ],
1102 ],
1103 ],
1104 'checkout_billing_fields' => [
1105 'id' => 'checkout_billing_fields',
1106 'type' => 'checkout_fields',
1107 'tab' => 'billing_fields',
1108 'value' => wp_json_encode( CheckoutFns::default_billing_fields() ),
1109 'dependency' => [
1110 'rules' => [
1111 [
1112 'item' => 'modules.checkout_fields_editor.modify_billing_form',
1113 'value' => 'on',
1114 'operator' => '==',
1115 ],
1116 ],
1117 ],
1118 ],
1119 'checkout_shipping_intro' => [
1120 'id' => 'checkout_shipping_intro',
1121 'type' => 'description',
1122 'text' => esc_html__( 'Shipping Fields Editor allows you to customize the default shipping fields on your checkout page.', 'shopbuilder' ),
1123 'tab' => 'shipping_fields',
1124 ],
1125 'modify_shipping_form' => [
1126 'id' => 'modify_billing_form',
1127 'type' => 'switch',
1128 'label' => esc_html__( 'Modify Shipping Form?', 'shopbuilder' ),
1129 'help' => esc_html__( 'Enable this option to edit shipping Form.', 'shopbuilder' ),
1130 'tab' => 'shipping_fields',
1131 ],
1132 'checkout_shipping_fields_info' => [
1133 'id' => 'checkout_shipping_fields_info',
1134 'type' => 'title',
1135 'label' => esc_html__( 'Shipping Fields', 'shopbuilder' ),
1136 'tab' => 'shipping_fields',
1137 'dependency' => [
1138 'rules' => [
1139 [
1140 'item' => 'modules.checkout_fields_editor.modify_shipping_form',
1141 'value' => 'on',
1142 'operator' => '==',
1143 ],
1144 ],
1145 ],
1146 ],
1147 'checkout_shipping_fields' => [
1148 'id' => 'checkout_shipping_fields',
1149 'type' => 'checkout_fields',
1150 'tab' => 'shipping_fields',
1151 'value' => wp_json_encode( CheckoutFns::default_shipping_fields() ),
1152 'dependency' => [
1153 'rules' => [
1154 [
1155 'item' => 'modules.checkout_fields_editor.modify_shipping_form',
1156 'value' => 'on',
1157 'operator' => '==',
1158 ],
1159 ],
1160 ],
1161 ],
1162 'checkout_additional_intro' => [
1163 'id' => 'checkout_additional_intro',
1164 'type' => 'description',
1165 'text' => esc_html__( 'Additional Fields Editor allows you to customize the extra fields on your checkout page.', 'shopbuilder' ),
1166 'tab' => 'additional_fields',
1167 ],
1168 'modify_additional_form' => [
1169 'id' => 'modify_additional_form',
1170 'type' => 'switch',
1171 'label' => esc_html__( 'Modify Additional Form Field?', 'shopbuilder' ),
1172 'help' => esc_html__( 'Enable this option to edit Additional Form.', 'shopbuilder' ),
1173 'tab' => 'additional_fields',
1174 ],
1175 'checkout_additional_fields_info' => [
1176 'id' => 'checkout_additional_fields_info',
1177 'type' => 'title',
1178 'label' => esc_html__( 'Additional Fields', 'shopbuilder' ),
1179 'tab' => 'additional_fields',
1180 'dependency' => [
1181 'rules' => [
1182 [
1183 'item' => 'modules.checkout_fields_editor.modify_additional_form',
1184 'value' => 'on',
1185 'operator' => '==',
1186 ],
1187 ],
1188 ],
1189 ],
1190 'checkout_additional_fields' => [
1191 'id' => 'checkout_additional_fields',
1192 'type' => 'checkout_fields',
1193 'tab' => 'additional_fields',
1194 'value' => wp_json_encode( CheckoutFns::checkout_additional_fields() ),
1195 'dependency' => [
1196 'rules' => [
1197 [
1198 'item' => 'modules.checkout_fields_editor.modify_additional_form',
1199 'value' => 'on',
1200 'operator' => '==',
1201 ],
1202 ],
1203 ],
1204 ],
1205 ],
1206 'tabs' => [
1207 'general' => [
1208 'title' => esc_html__( 'General', 'shopbuilder' ),
1209 ],
1210 'billing_fields' => [
1211 'title' => esc_html__( 'Billing Fields', 'shopbuilder' ),
1212 ],
1213 'shipping_fields' => [
1214 'title' => esc_html__( 'Shipping Fields', 'shopbuilder' ),
1215 ],
1216 'additional_fields' => [
1217 'title' => esc_html__( 'Additional Fields', 'shopbuilder' ),
1218 ],
1219 ],
1220 ]
1221 ),
1222 'sales_notification' => apply_filters(
1223 'rtsb/module/sales_notification/options',
1224 [
1225 'id' => 'sales_notification',
1226 'active' => '',
1227 'title' => esc_html__( 'Sales Notification', 'shopbuilder' ),
1228 'package' => $this->pro_package(),
1229 'active_field' => [
1230 'label' => esc_html__( 'Enable Sales Notification?', 'shopbuilder' ),
1231 'help' => esc_html__( 'Switch on to enable Sales Notification module.', 'shopbuilder' ),
1232 ],
1233 'fields' => Fns::pro_version_notice( '1.0.0' ),
1234 ]
1235 ),
1236 'flash_sale_countdown' => apply_filters(
1237 'rtsb/module/flash_sale_countdown/options',
1238 [
1239 'id' => 'flash_sale_countdown',
1240 'active' => '',
1241 'title' => esc_html__( 'Flash Sale Countdown', 'shopbuilder' ),
1242 'package' => $this->pro_package(),
1243 'active_field' => [
1244 'label' => esc_html__( 'Enable Flash Sale Countdown?', 'shopbuilder' ),
1245 'help' => esc_html__( 'Switch on to enable Flash Sale Countdown module.', 'shopbuilder' ),
1246 ],
1247 'fields' => Fns::pro_version_notice( '1.0.0' ),
1248 ]
1249 ),
1250 'quick_checkout' => apply_filters(
1251 'rtsb/module/quick_checkout/options',
1252 [
1253 'id' => 'quick_checkout',
1254 'active' => '',
1255 'title' => esc_html__( 'Quick Checkout', 'shopbuilder' ),
1256 'package' => $this->pro_package(),
1257 'active_field' => [
1258 'label' => esc_html__( 'Enable Quick Checkout?', 'shopbuilder' ),
1259 'help' => esc_html__( 'Switch on to enable quick checkout module. Note: Currently, this is not suitable for variable products.', 'shopbuilder' ),
1260 ],
1261 'fields' => Fns::pro_version_notice( '1.1.0' ),
1262 ]
1263 ),
1264 'multi_step_checkout' => apply_filters(
1265 'rtsb/module/multi_step_checkout/options',
1266 [
1267 'id' => 'multi_step_checkout',
1268 'active' => '',
1269 'title' => esc_html__( 'Multi-Step Checkout', 'shopbuilder' ),
1270 'package' => $this->pro_package(),
1271 'active_field' => [
1272 'label' => esc_html__( 'Enable Multi-Step Checkout?', 'shopbuilder' ),
1273 'help' => esc_html__( 'Switch on to enable Multi-step Checkout module.', 'shopbuilder' ),
1274 ],
1275 'fields' => Fns::pro_version_notice( '1.0.0' ),
1276 ]
1277 ),
1278 'back_order' => apply_filters(
1279 'rtsb/module/back_order/options',
1280 [
1281 'id' => 'back_order',
1282 'active' => '',
1283 'title' => esc_html__( 'Back-Order', 'shopbuilder' ),
1284 'package' => $this->pro_package(),
1285 'active_field' => [
1286 'label' => esc_html__( 'Enable Back-Order?', 'shopbuilder' ),
1287 'help' => esc_html__( 'Switch on to enable back-order module.', 'shopbuilder' ),
1288 ],
1289 'fields' => Fns::pro_version_notice( '1.3.0' ),
1290 ]
1291 ),
1292 'sticky_add_to_cart' => apply_filters(
1293 'rtsb/module/sticky_add_to_cart/options',
1294 [
1295 'id' => 'sticky_add_to_cart',
1296 'active' => '',
1297 'title' => esc_html__( 'Sticky Add-To-Cart', 'shopbuilder' ),
1298 'package' => $this->pro_package(),
1299 'active_field' => [
1300 'label' => esc_html__( 'Enable Sticky Add-To-Cart?', 'shopbuilder' ),
1301 'help' => esc_html__( 'Switch on to enable sticky add-to-cart module.', 'shopbuilder' ),
1302 ],
1303 'fields' => Fns::pro_version_notice( '1.6.0' ),
1304 ]
1305 ),
1306 ];
1307 return apply_filters( 'rtsb/core/modules/raw_list', $list );
1308 }
1309
1310
1311 /**
1312 * @return array
1313 */
1314 public function product_badges_fields() {
1315 return apply_filters(
1316 'rtsb/module/product_badges/fields',
1317 [
1318 'hide_woocommerce_badge' => [
1319 'id' => 'hide_woocommerce_badge',
1320 'value' => '',
1321 'type' => 'switch',
1322 'label' => esc_html__( 'Hide Theme Badges', 'shopbuilder' ),
1323 'help' => esc_html__( 'Switch on to hide theme default badges.', 'shopbuilder' ),
1324 'tab' => 'general',
1325 ],
1326 // Hide "On sale".
1327 'hide_on_sale' => [
1328 'id' => 'hide_on_sale',
1329 'type' => 'select',
1330 'value' => 'all_products',
1331 'isPro' => ! rtsb()->has_pro(),
1332 'label' => esc_html__( 'Applicable Products', 'shopbuilder' ),
1333 'options' => [
1334 'all_products' => esc_html__( 'All products', 'shopbuilder' ),
1335 'where_custom_badge_applied' => esc_html__( 'Only for products which have custom badge enabled', 'shopbuilder' ),
1336 ],
1337 'help' => esc_html__( 'Choose where to hide the default badges.', 'shopbuilder' ),
1338 'tab' => 'general',
1339 'dependency' => [
1340 'rules' => [
1341 [
1342 'item' => 'modules.product_badges.hide_woocommerce_badge',
1343 'value' => 'on',
1344 'operator' => '==',
1345 ],
1346 ],
1347 ],
1348 ],
1349
1350 'group_badge_display_as' => [
1351 'id' => 'group_badge_display_as',
1352 'type' => 'select',
1353 'value' => 'horizontal',
1354 'isPro' => ! rtsb()->has_pro(),
1355 'label' => esc_html__( 'Group Badge Display Type', 'shopbuilder' ),
1356 'help' => sprintf(
1357 // translators: %s for pro message.
1358 esc_html__( 'Please choose the group display type. %s', 'shopbuilder' ),
1359 ! rtsb()->has_pro()
1360 ? sprintf(
1361 '<a target="_blank" href="%s">%s </a> %s ',
1362 esc_url( rtsb()->pro_version_link() ),
1363 esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
1364 esc_html__( 'for vertical layout.', 'shopbuilder' )
1365 )
1366 : ''
1367 ),
1368 'options' => [
1369 'horizontal' => esc_html__( 'Horizontal', 'shopbuilder' ),
1370 'vertical' => esc_html__( 'Vertical', 'shopbuilder' ),
1371 ],
1372 'tab' => 'group',
1373 ],
1374 'group_badge_gap' => [
1375 'id' => 'group_badge_gap',
1376 'type' => 'text',
1377 'value' => '10px',
1378 'label' => esc_html__( 'Group Badge Gap/Spacing', 'shopbuilder' ),
1379 'help' => esc_html__( 'Example: 10px', 'shopbuilder' ),
1380 'tab' => 'group',
1381 ],
1382 'general_options' => [
1383 'id' => 'general_options',
1384 'type' => 'title',
1385 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder' ),
1386 'tab' => 'group',
1387 ],
1388 'loop_group_position' => [
1389 'id' => 'loop_group_position',
1390 'type' => 'select',
1391 'value' => 'above_image',
1392 'isPro' => ! rtsb()->has_pro(),
1393 'label' => esc_html__( 'Shop Page Group Position', 'shopbuilder' ),
1394 'help' => esc_html__( 'Choose the group badges position in Shop page.', 'shopbuilder' ),
1395 'options' => [
1396 'above_image' => esc_html__( 'Floating Above Image', 'shopbuilder' ),
1397 'before_product_title' => esc_html__( 'Before Product Title', 'shopbuilder' ),
1398 'after_product_title' => esc_html__( 'After Product Title', 'shopbuilder' ),
1399 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
1400 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
1401 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
1402 ],
1403 'tab' => 'group',
1404 ],
1405 'loop_custom_hook_name' => [
1406 'id' => 'loop_custom_hook_name',
1407 'type' => 'text',
1408 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
1409 'tab' => 'group',
1410 'help' => sprintf(
1411 /* translators: 1: The shortcode.*/
1412 __( 'Or Copy the php code <br />%1$s<br /> and paste it in your product query where you want to show the button.', 'shopbuilder' ),
1413 "<code>&lt;?php do_action( 'rtsb/modules/product_badges/frontend/display' ); ?&gt;</code> OR Use shortcode <code>&lt;?php echo do_shortcode( '[rtsb_badges]' ); ?&gt;</code>"
1414 ),
1415 'dependency' => [
1416 'rules' => [
1417 [
1418 'item' => 'modules.product_badges.loop_group_position',
1419 'value' => 'custom',
1420 'operator' => '==',
1421 ],
1422 ],
1423 ],
1424 ],
1425 'loop_priority_note' => [
1426 'type' => 'raw',
1427 'label' => ' ',
1428 'html' => '<span style="color:red">' . esc_html__( 'If the badge position is incorrect or not displayed, please adjust the priority of hooks accordingly by increasing or decreasing them as necessary.', 'shopbuilder' ) . '</span>',
1429 'dependency' => [
1430 'rules' => [
1431 [
1432 'item' => 'modules.product_badges.loop_group_position',
1433 'value' => 'above_image',
1434 'operator' => '!=',
1435 ],
1436 ],
1437 ],
1438 'tab' => 'group',
1439 ],
1440 'group_position_hook_priority' => [
1441 'id' => 'group_position_hook_priority',
1442 'type' => 'number',
1443 'size' => 'small',
1444 'min' => 0,
1445 'max' => 999,
1446 'label' => esc_html__( 'Badge Position Priority', 'shopbuilder' ),
1447 'help' => esc_html__( 'It\'s depend on your theme functionality. Example: 20', 'shopbuilder' ),
1448 'tab' => 'group',
1449 'dependency' => [
1450 'rules' => [
1451 [
1452 'item' => 'modules.product_badges.loop_group_position',
1453 'value' => 'above_image',
1454 'operator' => '!=',
1455 ],
1456 ],
1457 ],
1458 ],
1459 'group_badge_position' => [
1460 'id' => 'group_badge_position',
1461 'label' => esc_html__( 'Position Above Image', 'shopbuilder' ),
1462 'type' => 'text_select',
1463 'value' => 'top-left',
1464 'options' => [
1465 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
1466 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
1467 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
1468 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
1469 ],
1470 'dependency' => [
1471 'rules' => [
1472 [
1473 'item' => 'modules.product_badges.loop_group_position',
1474 'value' => 'above_image',
1475 'operator' => '==',
1476 ],
1477 ],
1478 ],
1479 'tab' => 'group',
1480 ],
1481 'product_options' => [
1482 'id' => 'product_options',
1483 'type' => 'title',
1484 'label' => esc_html__( 'Product Page Settings', 'shopbuilder' ),
1485 'tab' => 'group',
1486 ],
1487 'product_page_group_position' => [
1488 'id' => 'product_page_group_position',
1489 'type' => 'select',
1490 'value' => 'above_image',
1491 'isPro' => ! rtsb()->has_pro(),
1492 'label' => esc_html__( 'Product Page Group Position', 'shopbuilder' ),
1493 'help' => esc_html__( 'Choose the group badges position in product page.', 'shopbuilder' ),
1494 'options' => [
1495 'above_image' => esc_html__( 'Floating Above Image', 'shopbuilder' ),
1496 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
1497 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
1498 'after_summary' => esc_html__( 'After Summary', 'shopbuilder' ),
1499 'after_short_desc' => esc_html__( 'After Short Description', 'shopbuilder' ),
1500 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
1501 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
1502 ],
1503 'tab' => 'group',
1504 ],
1505 'product_page_badges_shortcode' => [
1506 'type' => 'raw',
1507 'label' => ' ',
1508 'html' => sprintf(
1509 /* translators: 1: The shortcode.*/
1510 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' ),
1511 '<code>[rtsb_badges]</code>'
1512 ),
1513 'dependency' => [
1514 'rules' => [
1515 [
1516 'item' => 'modules.product_badges.product_page_group_position',
1517 'value' => 'shortcode',
1518 'operator' => '==',
1519 ],
1520 ],
1521 ],
1522 'tab' => 'group',
1523 ],
1524 'product_page_custom_hook_name' => [
1525 'id' => 'product_page_custom_hook_name',
1526 'type' => 'text',
1527 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
1528 'tab' => 'group',
1529 'help' => sprintf(
1530 /* translators: 1: The shortcode.*/
1531 __( 'Or Copy the php code <br />%1$s<br /> and paste it in your product query where you want to show the button.', 'shopbuilder' ),
1532 "<code>&lt;?php do_action( 'rtsb/modules/product_badges/frontend/display' ); ?&gt;</code>"
1533 ),
1534 'dependency' => [
1535 'rules' => [
1536 [
1537 'item' => 'modules.product_badges.product_page_group_position',
1538 'value' => 'custom',
1539 'operator' => '==',
1540 ],
1541 ],
1542 ],
1543 ],
1544 'product_page_priority_note' => [
1545 'type' => 'raw',
1546 'label' => ' ',
1547 'html' => '<span style="color:red">' . esc_html__( 'If the badge position is incorrect or not displayed, please adjust the priority of hooks accordingly by increasing or decreasing them as necessary.', 'shopbuilder' ) . '</span>',
1548 'dependency' => [
1549 'rules' => [
1550 [
1551 'item' => 'modules.product_badges.product_page_group_position',
1552 'value' => [ 'above_image', 'shortcode' ],
1553 'operator' => '!in',
1554 ],
1555 ],
1556 ],
1557 'tab' => 'group',
1558 ],
1559 'product_page_group_hook_priority' => [
1560 'id' => 'product_page_group_hook_priority',
1561 'type' => 'number',
1562 'size' => 'small',
1563 'min' => 0,
1564 'max' => 999,
1565 'label' => esc_html__( 'Badge Position Priority', 'shopbuilder' ),
1566 'help' => esc_html__( 'It\'s depend on your theme functionality. Example: 20', 'shopbuilder' ),
1567 'tab' => 'group',
1568 'dependency' => [
1569 'rules' => [
1570 [
1571 'item' => 'modules.product_badges.product_page_group_position',
1572 'value' => [ 'shortcode', 'above_image' ],
1573 'operator' => '!in',
1574 ],
1575 ],
1576 ],
1577
1578 ],
1579 'product_page_group_badge_position' => [
1580 'id' => 'product_page_group_badge_position',
1581 'label' => esc_html__( 'Position Above Image', 'shopbuilder' ),
1582 'type' => 'text_select',
1583 'value' => 'top-left',
1584 'options' => [
1585 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
1586 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
1587 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
1588 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
1589 ],
1590 'dependency' => [
1591 'rules' => [
1592 [
1593 'item' => 'modules.product_badges.product_page_group_position',
1594 'value' => 'above_image',
1595 'operator' => '==',
1596 ],
1597 ],
1598 ],
1599 'tab' => 'group',
1600 ],
1601
1602 'badges_field_intro' => [
1603 'id' => 'badges_field_intro',
1604 'type' => 'description',
1605 'text' => esc_html__( 'To add new product badges, simply click on the \'Add New\' button below.', 'shopbuilder' ),
1606 'tab' => 'badges',
1607 ],
1608 'badges_field' => [
1609 'id' => 'badges_field',
1610 'type' => 'repeaters',
1611 'label' => '',
1612 'tab' => 'badges',
1613 'repeat' => [
1614
1615 'title' => [
1616 'id' => 'title',
1617 'label' => esc_html__( 'Badge Name', 'shopbuilder' ),
1618 'help' => esc_html__( 'Enter badge name.', 'shopbuilder' ),
1619 'type' => 'text',
1620 'placeholder' => esc_html__( 'Badge Name', 'shopbuilder' ),
1621 'value' => esc_html__( 'Badge Name', 'shopbuilder' ),
1622 ],
1623 'badge_condition' => [
1624 'id' => 'badge_condition',
1625 'type' => 'select',
1626 'value' => 'dynamic',
1627 'isPro' => ! rtsb()->has_pro(),
1628 'label' => esc_html__( 'Badge Type', 'shopbuilder' ),
1629 'help' => sprintf(
1630 // translators: %s for pro message.
1631 esc_html__( 'Select badge type. %s', 'shopbuilder' ),
1632 ! rtsb()->has_pro()
1633 ? sprintf(
1634 '<a target="_blank" href="%s">%s</a> %s',
1635 esc_url( rtsb()->pro_version_link() ),
1636 esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
1637 esc_html__( 'unlock custom badge creation.', 'shopbuilder' )
1638 )
1639 : ''
1640 ),
1641 'options' => [
1642 'dynamic' => esc_html__( 'Dynamic', 'shopbuilder' ),
1643 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
1644 ],
1645 ],
1646 'badge_for' => [
1647 'id' => 'badge_for',
1648 'type' => 'select',
1649 'value' => 'on_sale',
1650 'label' => esc_html__( 'Dynamic Badge Condition', 'shopbuilder' ),
1651 'help' => esc_html__( 'Specify dynamic badge condition', 'shopbuilder' ),
1652 'options' => $this->dynamic_badge_list(),
1653 'dependency' => [
1654 'rules' => [
1655 [
1656 'item' => 'modules.product_badges.badges_field.badge_condition',
1657 'value' => 'dynamic',
1658 'operator' => '==',
1659 ],
1660 ],
1661 ],
1662 ],
1663 'badge_for_pre_order' => [
1664 'type' => 'raw',
1665 'label' => ' ',
1666 'html' => esc_html__( 'Please ensure that Pre-Order module is activated and properly configured.', 'shopbuilder' ),
1667 'tab' => 'general',
1668 'dependency' => [
1669 'rules' => [
1670 [
1671 'item' => 'modules.product_badges.badges_field.badge_condition',
1672 'value' => 'dynamic',
1673 'operator' => '==',
1674 ],
1675 [
1676 'item' => 'modules.product_badges.badges_field.badge_for',
1677 'value' => 'pre_order',
1678 'operator' => '==',
1679 ],
1680 ],
1681 ],
1682 ],
1683 'minimum_sale_count' => [
1684 'id' => 'minimum_sale_count',
1685 'type' => 'number',
1686 'label' => esc_html__( 'Minimum Sale Count', 'shopbuilder' ),
1687 'help' => esc_html__( 'Enter the number of Sale you want to designate for products to be labeled as \'Best Selling.\'', 'shopbuilder' ),
1688 'dependency' => [
1689 'rules' => [
1690 [
1691 'item' => 'modules.product_badges.badges_field.badge_condition',
1692 'value' => 'dynamic',
1693 'operator' => '==',
1694 ],
1695 [
1696 'item' => 'modules.product_badges.badges_field.badge_for',
1697 'value' => 'best_selling',
1698 'operator' => '==',
1699 ],
1700 ],
1701 ],
1702 ],
1703 'new_arrival_days' => [
1704 'id' => 'new_arrival_days',
1705 'type' => 'number',
1706 'label' => esc_html__( 'Specify Number of Days', 'shopbuilder' ),
1707 'help' => esc_html__( 'Enter the number of days you want to designate for products to be labeled as \'New Arrivals.\'', 'shopbuilder' ),
1708 'dependency' => [
1709 'rules' => [
1710 [
1711 'item' => 'modules.product_badges.badges_field.badge_for',
1712 'value' => 'new_arrival',
1713 'operator' => '==',
1714 ],
1715 ],
1716 ],
1717 ],
1718 'badges_type' => [
1719 'id' => 'badges_type',
1720 'type' => 'select',
1721 'value' => 'text',
1722 'isPro' => ! rtsb()->has_pro(),
1723 'label' => esc_html__( 'Show Badge As:', 'shopbuilder' ),
1724 'help' => sprintf(
1725 // translators: %s for pro message.
1726 esc_html__( 'Specify the badge display as Image Or Text. %s', 'shopbuilder' ),
1727 ! rtsb()->has_pro()
1728 ? sprintf(
1729 '<a target="_blank" href="%s">%s</a> %s',
1730 esc_url( rtsb()->pro_version_link() ),
1731 esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
1732 esc_html__( 'unlock Image badge creation.', 'shopbuilder' )
1733 )
1734 : ''
1735 ),
1736 'options' => [
1737 'image' => esc_html__( 'Image', 'shopbuilder' ),
1738 'text' => esc_html__( 'Text', 'shopbuilder' ),
1739 ],
1740 ],
1741
1742 'badge_preset' => [
1743 'id' => 'badge_preset',
1744 'label' => esc_html__( 'Text Badge Preset', 'shopbuilder' ),
1745 'help' => esc_html__( 'Choose the badge appearance', 'shopbuilder' ),
1746 'type' => 'image_select',
1747 'value' => 'preset1',
1748 'options' => [
1749 'preset1' => [
1750 'label' => esc_html__( 'Preset 1', 'shopbuilder' ),
1751 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-1.png' ) ),
1752 ],
1753
1754 'preset2' => [
1755 'label' => esc_html__( 'Preset 2', 'shopbuilder' ),
1756 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-2.png' ) ),
1757 ],
1758
1759 'preset3' => [
1760 'label' => esc_html__( 'Preset 3', 'shopbuilder' ),
1761 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-3.png' ) ),
1762 ],
1763
1764 'preset4' => [
1765 'title' => esc_html__( 'Preset 4', 'shopbuilder' ),
1766 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-4.png' ) ),
1767 ],
1768 ],
1769 'dependency' => [
1770 'rules' => [
1771 [
1772 'item' => 'modules.product_badges.badges_field.badges_type',
1773 'value' => 'text',
1774 'operator' => '==',
1775 ],
1776 ],
1777 ],
1778 ],
1779 'badges_text' => [
1780 'id' => 'badges_text',
1781 'label' => esc_html__( 'Enter Badge Text', 'shopbuilder' ),
1782 'help' => esc_html__( 'The badge text will be displayed when the dynamic percentage switch is turned off.', 'shopbuilder' ),
1783 'type' => 'text',
1784 'placeholder' => 'Badge Text',
1785 'value' => esc_html__( 'New', 'shopbuilder' ),
1786 'dependency' => [
1787 'rules' => [
1788 [
1789 'item' => 'modules.product_badges.badges_field.badges_type',
1790 'value' => 'text',
1791 'operator' => '==',
1792 ],
1793 ],
1794 ],
1795 ],
1796 'show_badges_percent_text' => [
1797 'id' => 'show_badges_percent_text',
1798 'type' => 'switch',
1799 // 'isPro' => ! rtsb()->has_pro(),
1800 'label' => esc_html__( 'Show Badges Percentage (%)', 'shopbuilder' ),
1801 'help' => esc_html__( 'Switch on to show badge as dynamic percentage instead of text.', 'shopbuilder' ),
1802 'dependency' => [
1803 'rules' => [
1804 [
1805 'item' => 'modules.product_badges.badges_field.badge_for',
1806 'value' => 'on_sale',
1807 'operator' => '==',
1808 ],
1809 [
1810 'item' => 'modules.product_badges.badges_field.badges_type',
1811 'value' => 'text',
1812 'operator' => '==',
1813 ],
1814 [
1815 'item' => 'modules.product_badges.badges_field.badge_condition',
1816 'value' => 'dynamic',
1817 'operator' => '==',
1818 ],
1819
1820 ],
1821 ],
1822 ],
1823
1824 'upload_image' => [
1825 'id' => 'upload_image',
1826 'type' => 'fileupload',
1827 'label' => esc_html__( 'Upload Image', 'shopbuilder' ),
1828 'help' => esc_html__( 'Upload badge image.', 'shopbuilder' ),
1829 'tab' => 'general',
1830 'dependency' => [
1831 'rules' => [
1832 [
1833 'item' => 'modules.product_badges.badges_field.badges_type',
1834 'value' => 'image',
1835 'operator' => '==',
1836 ],
1837 ],
1838 ],
1839 ],
1840
1841 'apply_for' => [
1842 'id' => 'apply_for',
1843 'type' => 'select',
1844 'value' => 'product',
1845 'isPro' => ! rtsb()->has_pro(),
1846 'label' => esc_html__( 'Applicable For', 'shopbuilder' ),
1847 'options' => [
1848 'product' => esc_html__( 'Products', 'shopbuilder' ),
1849 'product_cat' => esc_html__( 'Product Categories', 'shopbuilder' ),
1850 ],
1851 'help' => esc_html__( 'Badges will apply for selected products, or categories.', 'shopbuilder' ),
1852 ],
1853 'applicable_products' => [
1854 'id' => 'applicable_products',
1855 'type' => 'search_and_multi_select',
1856 'label' => esc_html__( 'Applicable Products', 'shopbuilder' ),
1857 'help' => esc_html__( 'Choose products to include. Leave blank to apply in all product.', 'shopbuilder' ),
1858 'placeholder' => esc_html__( 'Search Products', 'shopbuilder' ),
1859 'func_with_param' => [ Fns::class, 'get_post_types', [ 'post_type' => 'product' ] ],
1860 'options' => Fns::get_post_types( null, [ 'post_type' => 'product' ] ),
1861 'dependency' => [
1862 'rules' => [
1863 [
1864 'item' => 'modules.product_badges.badges_field.apply_for',
1865 'value' => 'product',
1866 'operator' => '==',
1867 ],
1868 ],
1869 ],
1870 ],
1871 'applicable_categories' => [
1872 'id' => 'applicable_categories',
1873 'type' => 'search_and_multi_select',
1874 'label' => esc_html__( 'Applicable Categories', 'shopbuilder' ),
1875 'help' => esc_html__( 'Choose categories to include. Leave blank to apply in all categories.', 'shopbuilder' ),
1876 'placeholder' => esc_html__( 'Search Category', 'shopbuilder' ),
1877 'func_with_param' => [
1878 Fns::class,
1879 'products_category_query',
1880 ],
1881 'options' => Fns::products_category_query(),
1882 'dependency' => [
1883 'rules' => [
1884 [
1885 'item' => 'modules.product_badges.badges_field.apply_for',
1886 'value' => 'product_cat',
1887 'operator' => '==',
1888 ],
1889 ],
1890 ],
1891 ],
1892 'exclude_product' => [
1893 'id' => 'exclude_product',
1894 'type' => 'search_and_multi_select',
1895 'isPro' => ! rtsb()->has_pro(),
1896 'label' => esc_html__( 'Exclude Products', 'shopbuilder' ),
1897 'help' => esc_html__( 'Choose products to exclude. Leave blank to exclude none.', 'shopbuilder' ),
1898 'placeholder' => esc_html__( 'Search Products', 'shopbuilder' ),
1899 'func_with_param' => [ Fns::class, 'get_post_types', [ 'post_type' => 'product' ] ],
1900 'options' => Fns::get_post_types( null, [ 'post_type' => 'product' ] ),
1901 ],
1902
1903 /**
1904 * Style Settings
1905 */
1906 'styles_settings' => [
1907 'id' => 'styles_settings',
1908 'type' => 'title',
1909 'label' => esc_html__( 'Style Settings', 'shopbuilder' ),
1910 ],
1911 'badge_text_color' => [
1912 'id' => 'badge_text_color',
1913 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
1914 'type' => 'color',
1915 'dependency' => [
1916 'rules' => [
1917 [
1918 'item' => 'modules.product_badges.badges_field.badges_type',
1919 'value' => 'text',
1920 'operator' => '==',
1921 ],
1922 ],
1923 ],
1924 ],
1925 'badge_bg_color' => [
1926 'id' => 'badge_bg_color',
1927 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
1928 'type' => 'color',
1929 'dependency' => [
1930 'rules' => [
1931 [
1932 'item' => 'modules.product_badges.badges_field.badges_type',
1933 'value' => 'text',
1934 'operator' => '==',
1935 ],
1936 [
1937 'item' => 'modules.product_badges.badges_field.badges_type',
1938 'value' => 'text',
1939 'operator' => '==',
1940 ],
1941 [
1942 'item' => 'modules.product_badges.badges_field.badge_preset',
1943 'value' => [ 'preset1', 'preset2' ],
1944 'operator' => 'in',
1945 ],
1946 ],
1947 ],
1948 ],
1949 'badge_border_color' => [
1950 'id' => 'badge_border_color',
1951 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
1952 'type' => 'color',
1953 'dependency' => [
1954 'rules' => [
1955 [
1956 'item' => 'modules.product_badges.badges_field.badges_type',
1957 'value' => 'text',
1958 'operator' => '==',
1959 ],
1960 [
1961 'item' => 'modules.product_badges.badges_field.badges_type',
1962 'value' => 'text',
1963 'operator' => '==',
1964 ],
1965 [
1966 'item' => 'modules.product_badges.badges_field.badge_preset',
1967 'value' => [ 'preset3', 'preset4' ],
1968 'operator' => 'in',
1969 ],
1970 ],
1971 ],
1972 ],
1973 'badge_font_size' => [
1974 'id' => 'badge_font_size',
1975 'type' => 'text',
1976 'label' => esc_html__( 'Font Size', 'shopbuilder' ),
1977 'help' => esc_html__( 'Example: 14px', 'shopbuilder' ),
1978 'dependency' => [
1979 'rules' => [
1980 [
1981 'item' => 'modules.product_badges.badges_field.badges_type',
1982 'value' => 'text',
1983 'operator' => '==',
1984 ],
1985 ],
1986 ],
1987 ],
1988 'badge_font_width' => [
1989 'id' => 'badge_font_width',
1990 'type' => 'select',
1991 'value' => '400',
1992 'label' => esc_html__( 'Font Weight', 'shopbuilder' ),
1993 'options' => [
1994 '100' => '100',
1995 '200' => '200',
1996 '300' => '300',
1997 '400' => '400',
1998 '500' => '500',
1999 '600' => '600',
2000 '700' => '700',
2001 '800' => '800',
2002 '900' => '900',
2003 'normal' => 'normal',
2004 'bold' => 'bold',
2005 'bolder' => 'bolder',
2006 'lighter' => 'lighter',
2007 'initial' => 'initial',
2008 'inherit' => 'inherit',
2009 ],
2010 'dependency' => [
2011 'rules' => [
2012 [
2013 'item' => 'modules.product_badges.badges_field.badges_type',
2014 'value' => 'text',
2015 'operator' => '==',
2016 ],
2017 ],
2018 ],
2019 ],
2020 'badge_width' => [
2021 'id' => 'badge_width',
2022 'type' => 'text',
2023 'label' => esc_html__( 'Width', 'shopbuilder' ),
2024 'help' => esc_html__( 'Example: 150px', 'shopbuilder' ),
2025 'dependency' => [
2026 'rules' => [
2027 [
2028 'item' => 'modules.product_badges.badges_field.badges_type',
2029 'value' => 'image',
2030 'operator' => '==',
2031 ],
2032 ],
2033 ],
2034 ],
2035 'badge_height' => [
2036 'id' => 'badge_height',
2037 'type' => 'text',
2038 'label' => esc_html__( 'Height', 'shopbuilder' ),
2039 'help' => esc_html__( 'Example: 50px', 'shopbuilder' ),
2040 'dependency' => [
2041 'rules' => [
2042 [
2043 'item' => 'modules.product_badges.badges_field.badges_type',
2044 'value' => 'image',
2045 'operator' => '==',
2046 ],
2047 ],
2048 ],
2049 ],
2050 'border_radius' => [
2051 'id' => 'border_radius',
2052 'type' => 'text',
2053 'size' => 'small',
2054 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
2055 'help' => esc_html__( 'Example: 20px 20px 20px 20px Or 20px', 'shopbuilder' ),
2056 'dependency' => [
2057 'rules' => [
2058 [
2059 'item' => 'modules.product_badges.badges_field.badges_type',
2060 'value' => 'text',
2061 'operator' => '==',
2062 ],
2063 ],
2064 ],
2065 ],
2066 'badge_padding' => [
2067 'id' => 'badge_padding',
2068 'type' => 'text',
2069 'size' => 'small',
2070 'label' => esc_html__( 'Padding', 'shopbuilder' ),
2071 'help' => esc_html__( 'Example: 10px 15px 10px 15px', 'shopbuilder' ),
2072 'dependency' => [
2073 'rules' => [
2074 [
2075 'item' => 'modules.product_badges.badges_field.badges_type',
2076 'value' => 'text',
2077 'operator' => '==',
2078 ],
2079 ],
2080 ],
2081 ],
2082 ],
2083 ],
2084
2085 ]
2086 );
2087 }
2088
2089 /**
2090 * Dynamic badge list.
2091 *
2092 * @return array
2093 */
2094 public function dynamic_badge_list() {
2095 $items = [
2096 'on_sale' => esc_html__( 'Products On Sale', 'shopbuilder' ),
2097 'featured' => esc_html__( 'Featured Products', 'shopbuilder' ),
2098 'out_of_stock' => esc_html__( 'Out Of Stock Products', 'shopbuilder' ),
2099 'best_selling' => esc_html__( 'Best Selling Products', 'shopbuilder' ),
2100 'new_arrival' => esc_html__( 'New Arrival Products', 'shopbuilder' ),
2101 ];
2102
2103 if ( rtsb()->has_pro() && FnsPro::is_module_active( 'pre_order' ) ) {
2104 $items['pre_order'] = esc_html__( 'Pre-Order Products', 'shopbuilder' );
2105 }
2106
2107 return $items;
2108 }
2109 }
2110