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

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

3,631 lines 123.5 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\Modules\ShopifyCheckout\ShopifyCheckout;
16 use RadiusTheme\SB\Traits\SingletonTrait;
17 use RadiusTheme\SB\Modules\Compare\Compare;
18 use RadiusTheme\SB\Modules\WishList\Wishlist;
19 use RadiusTheme\SB\Modules\Compare\CompareFns;
20 use RadiusTheme\SB\Modules\QuickView\QuickView;
21 use RadiusTheme\SB\Modules\WishList\WishlistFns;
22 use RadiusTheme\SBPRO\Helpers\FnsPro;
23
24 defined( 'ABSPATH' ) || exit;
25
26 /**
27 * ShopBuilder Module List.
28 */
29 class ModuleList extends ListModel {
30
31 use SingletonTrait;
32
33 /**
34 * List ID.
35 *
36 * @var string
37 */
38 protected $list_id = 'modules';
39
40 /**
41 * Class constructor.
42 */
43 public function __construct() {
44 parent::__construct();
45 $this->title = esc_html__( 'Modules', 'shopbuilder' );
46 $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' );
47 }
48
49 /**
50 * Module list.
51 *
52 * @return mixed|null
53 */
54 protected function raw_list() {
55 $list = [
56 'quick_view' => apply_filters(
57 'rtsb/module/quick_view/options',
58 [
59 'id' => 'quick_view',
60 'title' => esc_html__( 'Quick View', 'shopbuilder' ),
61 'base_class' => QuickView::class,
62 'category' => 'general',
63 'active' => 'on',
64 'package' => 'free',
65 'active_field' => [
66 'label' => esc_html__( 'Enable Quick View?', 'shopbuilder' ),
67 'help' => esc_html__( 'Switch on to enable quick view module.', 'shopbuilder' ),
68 ],
69 'tabs' => [
70 'general' => [
71 'title' => esc_html__( 'General', 'shopbuilder' ),
72 ],
73 'style' => [
74 'title' => esc_html__( 'Style', 'shopbuilder' ),
75 ],
76 ],
77 'fields' => apply_filters(
78 'rtsb/module/quick_view/fields',
79 [
80 'loop_btn_position' => [
81 'id' => 'loop_btn_position',
82 'type' => 'select',
83 'value' => 'custom',
84 'label' => esc_html__( 'Shop Page Button Position', 'shopbuilder' ),
85 'help' => esc_html__( 'You can manage quick view button position in shop page.', 'shopbuilder' ),
86 'tab' => 'general',
87 'options' => [
88 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
89 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
90 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
91 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
92 ],
93
94 ],
95 'loop_btn_position_shortcode' => [
96 'type' => 'raw',
97 'label' => ' ',
98 'html' => sprintf(
99 /* translators: 1: The shortcode.*/
100 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' ),
101 '<code>[rtsb_quick_view_button]</code>'
102 ),
103 'tab' => 'general',
104 'dependency' => [
105 'rules' => [
106 [
107 'item' => 'modules.quick_view.loop_btn_position',
108 'value' => 'shortcode',
109 'operator' => '==',
110 ],
111 ],
112 ],
113 ],
114 'loop_custom_hook_name' => [
115 'id' => 'loop_custom_hook_name',
116 'type' => 'text',
117 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
118 'help' => sprintf(
119 /* translators: 1: The shortcode.*/
120 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
121 "<br /><code>&lt;?php do_action( 'rtsb/modules/quick_view/frontend/display' ); ?&gt;</code><br />"
122 ),
123 'tab' => 'general',
124 'dependency' => [
125 'rules' => [
126 [
127 'item' => 'modules.quick_view.loop_btn_position',
128 'value' => 'custom',
129 'operator' => '==',
130 ],
131 ],
132 ],
133 ],
134 'loop_custom_hook_priority' => [
135 'id' => 'loop_custom_hook_priority',
136 'type' => 'number',
137 'value' => 10,
138 'size' => 'small',
139 'min' => 0,
140 'max' => 999,
141 'label' => esc_html__( 'Hook Priority', 'shopbuilder' ),
142 'tab' => 'general',
143 'dependency' => [
144 'rules' => [
145 [
146 'item' => 'modules.quick_view.loop_btn_position',
147 'value' => 'custom',
148 'operator' => '==',
149 ],
150 ],
151 ],
152 ],
153 'button_text' => [
154 'id' => 'button_text',
155 'label' => esc_html__( 'Quick View Text', 'shopbuilder' ),
156 'help' => esc_html__( 'Enter your quick view button text.', 'shopbuilder' ),
157 'type' => 'text',
158 'value' => 'Quick View',
159 'placeholder' => 'Quick View',
160 'tab' => 'general',
161 ],
162
163 // Module Style.
164 'modal_width' => [
165 'id' => 'modal_width',
166 'label' => esc_html__( 'Modal Width (in px)', 'shopbuilder' ),
167 'help' => esc_html__( 'Quick view button modal width. Example: 950', 'shopbuilder' ),
168 'type' => 'number',
169 'value' => '',
170 'tab' => 'style',
171 ],
172
173 'modal_height' => [
174 'id' => 'modal_height',
175 'label' => esc_html__( 'Modal Height', 'shopbuilder' ),
176 'help' => esc_html__( 'Quick view button modal height. Example: 450px', 'shopbuilder' ),
177 'type' => 'text',
178 'value' => '',
179 'tab' => 'style',
180 ],
181
182 'modal_wrapper_padding' => [
183 'id' => 'modal_wrapper_padding',
184 'label' => esc_html__( 'Modal Wrapper Padding', 'shopbuilder' ),
185 'help' => esc_html__( 'Quick view modal wrapper padding. Example 1: 20px, Example 2: 20px 20px 20px 20px', 'shopbuilder' ),
186 'type' => 'text',
187 'value' => '',
188 'tab' => 'style',
189 ],
190 'modal_bg_color' => [
191 'id' => 'modal_bg_color',
192 'label' => esc_html__( 'Modal Backgroud Color', 'shopbuilder' ),
193 'help' => esc_html__( 'Quick view modal background color. Example: #fff', 'shopbuilder' ),
194 'type' => 'color',
195 'value' => '',
196 'tab' => 'style',
197 ],
198 'modal_box_shadow_color' => [
199 'id' => 'modal_box_shadow_color',
200 'label' => esc_html__( 'Modal Box Shadow Color', 'shopbuilder' ),
201 'help' => esc_html__( 'Quick view modal box shadow. Example: #000', 'shopbuilder' ),
202 'type' => 'color',
203 'value' => '',
204 'tab' => 'style',
205 ],
206
207 'modal_overly_color' => [
208 'id' => 'modal_overly_color',
209 'label' => esc_html__( 'Modal Overly Color', 'shopbuilder' ),
210 'help' => esc_html__( 'Quick view modal overly. Example: #000', 'shopbuilder' ),
211 'type' => 'color',
212 'value' => '',
213 'tab' => 'style',
214 ],
215
216 ]
217 ),
218 ]
219 ),
220 'wishlist' => apply_filters(
221 'rtsb/module/wishlist/options',
222 [
223 'id' => 'wishlist',
224 'title' => esc_html__( 'Wishlist', 'shopbuilder' ),
225 'package' => 'free',
226 'active' => 'on',
227 'base_class' => Wishlist::class,
228 'category' => 'general',
229 'active_field' => [
230 'label' => esc_html__( 'Enable Wishlist?', 'shopbuilder' ),
231 'help' => esc_html__( 'Switch on to enable wishlist module.', 'shopbuilder' ),
232 ],
233 'fields' => apply_filters(
234 'rtsb/module/wishlist/fields',
235 [
236 'enable_login_limit' => [
237 'id' => 'enable_login_limit',
238 'type' => 'switch',
239 'label' => esc_html__( 'Limit Wishlist Use', 'shopbuilder' ),
240 'help' => esc_html__( 'Enable this option to allow only the logged-in users to use the Wishlist feature.', 'shopbuilder' ),
241 'tab' => 'general',
242 ],
243 'hide_wishlist_non_logged_in' => [
244 'id' => 'hide_wishlist_non_logged_in',
245 'type' => 'switch',
246 'label' => esc_html__( 'Hide Wishlist Button', 'shopbuilder' ),
247 'help' => esc_html__( 'Hide Wishlist Button For non logged-in users (guest users).', 'shopbuilder' ),
248 'dependency' => [
249 'rules' => [
250 [
251 'item' => 'modules.wishlist.enable_login_limit',
252 'value' => 'on',
253 'operator' => '==',
254 ],
255 ],
256 ],
257 'tab' => 'general',
258 ],
259 'wishlist_shop_wrapper_heading' => [
260 'id' => 'wishlist_shop_wrapper_heading',
261 'type' => 'title',
262 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder' ),
263 'tab' => 'button',
264 ],
265 'show_btn_on_loop' => [
266 'id' => 'show_btn_on_loop',
267 'value' => 'on',
268 'type' => 'switch',
269 'label' => esc_html__( 'Show in Shop Page', 'shopbuilder' ),
270 'tab' => 'button',
271 ],
272 'loop_btn_position' => [
273 'id' => 'loop_btn_position',
274 'type' => 'select',
275 'value' => 'custom',
276 'label' => esc_html__( 'Shop Page Button Position', 'shopbuilder' ),
277 'help' => esc_html__( 'You can manage wishlist button position in shop page.', 'shopbuilder' ),
278 'options' => [
279 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
280 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
281 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
282 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
283 ],
284 'dependency' => [
285 'rules' => [
286 [
287 'item' => 'modules.wishlist.show_btn_on_loop',
288 'value' => 'on',
289 'operator' => '==',
290 ],
291 ],
292 ],
293 'tab' => 'button',
294 ],
295 'loop_btn_position_shortcode' => [
296 'type' => 'raw',
297 'label' => ' ',
298 'html' => sprintf(
299 /* translators: 1: The shortcode.*/
300 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' ),
301 '<code>[rtsb_wishlist_button]</code>'
302 ),
303 'dependency' => [
304 'rules' => [
305 [
306 'item' => 'modules.wishlist.show_btn_on_loop',
307 'value' => 'on',
308 'operator' => '==',
309 ],
310 [
311 'item' => 'modules.wishlist.loop_btn_position',
312 'value' => 'shortcode',
313 'operator' => '==',
314 ],
315 ],
316 ],
317 'tab' => 'button',
318 ],
319 'loop_custom_hook_name' => [
320 'id' => 'loop_custom_hook_name',
321 'type' => 'text',
322 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
323 'tab' => 'button',
324 'help' => sprintf(
325 /* translators: 1: The shortcode.*/
326 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
327 "<br /><code>&lt;?php do_action('rtsb/modules/wishlist/frontend/display' ); ?&gt;</code><br />"
328 ),
329 'dependency' => [
330 'rules' => [
331 [
332 'item' => 'modules.wishlist.show_btn_on_loop',
333 'value' => 'on',
334 'operator' => '==',
335 ],
336 [
337 'item' => 'modules.wishlist.loop_btn_position',
338 'value' => 'custom',
339 'operator' => '==',
340 ],
341 ],
342 ],
343 ],
344 'loop_custom_hook_priority' => [
345 'id' => 'loop_custom_hook_priority',
346 'type' => 'number',
347 'value' => 10,
348 'size' => 'small',
349 'min' => 0,
350 'max' => 999,
351 'label' => esc_html__( 'Hook Priority', 'shopbuilder' ),
352 'tab' => 'button',
353 'dependency' => [
354 'rules' => [
355 [
356 'item' => 'modules.wishlist.show_btn_on_loop',
357 'value' => 'on',
358 'operator' => '==',
359 ],
360 [
361 'item' => 'modules.wishlist.loop_btn_position',
362 'value' => 'custom',
363 'operator' => '==',
364 ],
365 ],
366 'relation' => 'and',
367 ],
368 ],
369 'wishlist_single_wrapper_heading' => [
370 'id' => 'wishlist_single_wrapper_heading',
371 'type' => 'title',
372 'label' => esc_html__( 'Product Page Settings', 'shopbuilder' ),
373 'tab' => 'button',
374 ],
375 'show_btn_product_page' => [
376 'id' => 'show_btn_product_page',
377 'value' => 'on',
378 'type' => 'switch',
379 'label' => esc_html__( 'Show in Product Page', 'shopbuilder' ),
380 'tab' => 'button',
381 ],
382 'product_btn_position' => [
383 'id' => 'product_btn_position',
384 'label' => esc_html__( 'Product Page Button Position', 'shopbuilder' ),
385 'help' => esc_html__( 'You can manage compare button position in single product page.', 'shopbuilder' ),
386 'type' => 'select',
387 'value' => 'custom',
388 'options' => [
389 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
390 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
391 'after_thumbnail' => esc_html__( 'After Image', 'shopbuilder' ),
392 'after_summary' => esc_html__( 'After Summary', 'shopbuilder' ),
393 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
394 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
395 ],
396 'dependency' => [
397 'rules' => [
398 [
399 'item' => 'modules.wishlist.show_btn_product_page',
400 'value' => 'on',
401 'operator' => '==',
402 ],
403 ],
404 ],
405 'tab' => 'button',
406 ],
407 'product_btn_position_shortcode' => [
408 'type' => 'raw',
409 'label' => ' ',
410 'html' => sprintf(
411 /* translators: 1: The shortcode.*/
412 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' ),
413 '<code>[rtsb_wishlist_button]</code>'
414 ),
415 'dependency' => [
416 'rules' => [
417 [
418 'item' => 'modules.wishlist.show_btn_product_page',
419 'value' => 'on',
420 'operator' => '==',
421 ],
422 [
423 'item' => 'modules.wishlist.product_btn_position',
424 'value' => 'shortcode',
425 'operator' => '==',
426 ],
427 ],
428 ],
429 'tab' => 'button',
430 ],
431 'product_custom_hook_name' => [
432 'id' => 'product_custom_hook_name',
433 'type' => 'text',
434 'label' => esc_html__( 'Product Hook Name', 'shopbuilder' ),
435 'tab' => 'button',
436 'help' => sprintf(
437 /* translators: 1: The shortcode.*/
438 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
439 "<br /><code>&lt;?php do_action('rtsb/modules/wishlist/frontend/display' ); ?&gt;</code><br />"
440 ),
441 'dependency' => [
442 'rules' => [
443 [
444 'item' => 'modules.wishlist.show_btn_product_page',
445 'value' => 'on',
446 'operator' => '==',
447 ],
448 [
449 'item' => 'modules.wishlist.product_btn_position',
450 'value' => 'custom',
451 'operator' => '==',
452 ],
453 ],
454 ],
455 ],
456 'product_custom_hook_priority' => [
457 'id' => 'product_custom_hook_priority',
458 'type' => 'number',
459 'value' => 10,
460 'size' => 'small',
461 'min' => 0,
462 'max' => 999,
463 'label' => esc_html__( 'Product Hook Priority', 'shopbuilder' ),
464 'tab' => 'button',
465 'dependency' => [
466 'rules' => [
467 [
468 'item' => 'modules.wishlist.show_btn_product_page',
469 'value' => 'on',
470 'operator' => '==',
471 ],
472 [
473 'item' => 'modules.wishlist.product_btn_position',
474 'value' => 'custom',
475 'operator' => '==',
476 ],
477 ],
478 'relation' => 'and',
479 ],
480 ],
481 'button_text' => [
482 'id' => 'button_text',
483 'label' => esc_html__( 'Wishlist Text', 'shopbuilder' ),
484 'help' => esc_html__( 'Enter your wishlist button text.', 'shopbuilder' ),
485 'type' => 'text',
486 'value' => 'Add to Wishlist',
487 'placeholder' => 'Add to Wishlist',
488 'tab' => 'button',
489 ],
490 'notice_added_text' => [
491 'id' => 'notice_added_text',
492 'label' => esc_html__( 'Product Added Text', 'shopbuilder' ),
493 'help' => esc_html__( 'Enter the product added text.', 'shopbuilder' ),
494 'type' => 'text',
495 'value' => esc_html__( 'Product added!', 'shopbuilder' ),
496 'placeholder' => esc_html__( 'Product added!', 'shopbuilder' ),
497 'tab' => 'general',
498 ],
499 'notice_removed_text' => [
500 'id' => 'notice_removed_text',
501 'label' => esc_html__( 'Product Removed Text', 'shopbuilder' ),
502 'help' => esc_html__( 'Enter the product removed text.', 'shopbuilder' ),
503 'type' => 'text',
504 'value' => esc_html__( 'Product removed!', 'shopbuilder' ),
505 'placeholder' => esc_html__( 'Product removed!', 'shopbuilder' ),
506 'tab' => 'general',
507 ],
508 'browse_list_text' => [
509 'id' => 'browse_list_text',
510 'label' => esc_html__( 'Browse Wishlist Text', 'shopbuilder' ),
511 'help' => esc_html__( 'Enter a text for the "Browse wishlist" link on the product page', 'shopbuilder' ),
512 'type' => 'text',
513 'value' => esc_html__( 'Browse Wishlist', 'shopbuilder' ),
514 'placeholder' => esc_html__( 'Browse Wishlist', 'shopbuilder' ),
515 'tab' => 'general',
516 ],
517 /*
518 * TODO:: Will Implement Later.
519 'redirect_cart' => array(
520 'id' => 'redirect_cart',
521 'type' => 'switch',
522 'help' => esc_html__( 'Redirect users to the cart page when they add a product to the cart from the wishlist page', 'shopbuilder' ),
523 'label' => esc_html__( 'Redirect to Cart', 'shopbuilder' ),
524 'tab' => 'page',
525 ),
526 'remove_after_add_to_cart' => array(
527 'value' => 'on',
528 'id' => 'remove_after_add_to_cart',
529 'type' => 'switch',
530 'help' => esc_html__( 'Remove the product from the wishlist after it has been added to the cart', 'shopbuilder' ),
531 'label' => esc_html__( 'Remove if Added to Cart', 'shopbuilder' ),
532 'tab' => 'page',
533 ),
534 */
535 'page' => [
536 'id' => 'page',
537 'type' => 'select',
538 'label' => esc_html__( 'Select Wishlist Page', 'shopbuilder' ),
539 'help' => sprintf(
540 /* translators: 1: The shortcode.*/
541 esc_html__( 'Select a page for wishlist page and make sure you add the shortcode %1$s into the page content', 'shopbuilder' ),
542 '<code>[rtsb_wishlist]</code>'
543 ),
544 'options' => Fns::get_pages(),
545 'tab' => 'page',
546 ],
547 'page_show_fields' => [
548 'value' => WishlistFns::instance()->get_field_ids(),
549 'id' => 'page_show_fields',
550 'multiple' => true,
551 'checkbox' => true,
552 'sanitize_fn' => 'sanitize_text_field',
553 'type' => 'sortable',
554 'options' => WishlistFns::instance()->get_default_fields(),
555 'label' => esc_html__( 'Wishlist Table Fields Visibility', 'shopbuilder' ),
556 'tab' => 'page',
557 ],
558
559 ]
560 ),
561 'tabs' => [
562 'general' => [
563 'title' => esc_html__( 'General', 'shopbuilder' ),
564 ],
565 'button' => [
566 'title' => esc_html__( 'Button', 'shopbuilder' ),
567 ],
568 'page' => [
569 'title' => esc_html__( 'Page', 'shopbuilder' ),
570 ],
571 ],
572 ]
573 ),
574 'compare' => apply_filters(
575 'rtsb/module/compare/options',
576 [
577 'id' => 'compare',
578 'base_class' => Compare::class,
579 'category' => 'general',
580 'title' => esc_html__( 'Product Compare', 'shopbuilder' ),
581 'package' => 'free',
582 'active' => 'on',
583 'active_field' => [
584 'label' => esc_html__( 'Enable Product Comparison?', 'shopbuilder' ),
585 'help' => esc_html__( 'Switch on to enable product comparison module.', 'shopbuilder' ),
586 ],
587 'fields' => apply_filters(
588 'rtsb/module/compare/fields',
589 [
590 'compare_shop_wrapper_heading' => [
591 'id' => 'compare_shop_wrapper_heading',
592 'type' => 'title',
593 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder' ),
594 'tab' => 'button',
595 ],
596 'show_btn_on_loop' => [
597 'id' => 'show_btn_on_loop',
598 'value' => 'on',
599 'type' => 'switch',
600 'label' => esc_html__( 'Show in Shop Page', 'shopbuilder' ),
601 'tab' => 'button',
602 ],
603 'loop_btn_position' => [
604 'id' => 'loop_btn_position',
605 'type' => 'select',
606 'value' => 'custom',
607 'label' => esc_html__( 'Shop Page Button Position', 'shopbuilder' ),
608 'help' => esc_html__( 'You can manage wishlist button position in shop page.', 'shopbuilder' ),
609 'options' => [
610 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
611 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
612 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
613 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
614 ],
615 'dependency' => [
616 'rules' => [
617 [
618 'item' => 'modules.compare.show_btn_on_loop',
619 'value' => 'on',
620 'operator' => '==',
621 ],
622 ],
623 ],
624 'tab' => 'button',
625 ],
626 'loop_btn_position_shortcode' => [
627 'type' => 'raw',
628 'label' => ' ',
629 'html' => sprintf(
630 /* translators: 1: The shortcode.*/
631 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' ),
632 '<code>[rtsb_compare_button]</code>'
633 ),
634 'dependency' => [
635 'rules' => [
636 [
637 'item' => 'modules.compare.show_btn_on_loop',
638 'value' => 'on',
639 'operator' => '==',
640 ],
641 [
642 'item' => 'modules.compare.loop_btn_position',
643 'value' => 'shortcode',
644 'operator' => '==',
645 ],
646 ],
647 ],
648 'tab' => 'button',
649 ],
650 'loop_custom_hook_name' => [
651 'id' => 'product_custom_hook_name',
652 'type' => 'text',
653 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
654 'tab' => 'button',
655 'help' => sprintf(
656 /* translators: 1: The shortcode.*/
657 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
658 "<br /><code>&lt;?php do_action('rtsb/modules/compare/frontend/display' ); ?&gt;</code><br />"
659 ),
660 'dependency' => [
661 'rules' => [
662 [
663 'item' => 'modules.compare.show_btn_on_loop',
664 'value' => 'on',
665 'operator' => '==',
666 ],
667 [
668 'item' => 'modules.compare.loop_btn_position',
669 'value' => 'custom',
670 'operator' => '==',
671 ],
672 ],
673 ],
674 ],
675 'loop_custom_hook_priority' => [
676 'id' => 'product_custom_hook_priority',
677 'type' => 'number',
678 'value' => 10,
679 'size' => 'small',
680 'min' => 0,
681 'max' => 999,
682 'label' => esc_html__( 'Hook Priority', 'shopbuilder' ),
683 'tab' => 'button',
684 'dependency' => [
685 'rules' => [
686 [
687 'item' => 'modules.compare.show_btn_on_loop',
688 'value' => 'on',
689 'operator' => '==',
690 ],
691 [
692 'item' => 'modules.compare.loop_btn_position',
693 'value' => 'custom',
694 'operator' => '==',
695 ],
696 ],
697 'relation' => 'and',
698 ],
699 ],
700 'compare_single_wrapper_heading' => [
701 'id' => 'compare_single_wrapper_heading',
702 'type' => 'title',
703 'label' => esc_html__( 'Product Page Settings', 'shopbuilder' ),
704 'tab' => 'button',
705 ],
706 'show_btn_product_page' => [
707 'id' => 'show_btn_product_page',
708 'type' => 'switch',
709 'value' => 'on',
710 'label' => esc_html__( 'Show Button in Product Page', 'shopbuilder' ),
711 'tab' => 'button',
712 ],
713 'product_btn_position' => [
714 'id' => 'product_btn_position',
715 'label' => esc_html__( 'Product Page Button Position', 'shopbuilder' ),
716 'help' => esc_html__( 'You can manage compare button position in single product page.', 'shopbuilder' ),
717 'type' => 'select',
718 'value' => 'custom',
719 'options' => [
720 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
721 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
722 'after_thumbnail' => esc_html__( 'After Image', 'shopbuilder' ),
723 'after_summary' => esc_html__( 'After Summary', 'shopbuilder' ),
724 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
725 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
726 ],
727 'dependency' => [
728 'rules' => [
729 [
730 'item' => 'modules.compare.show_btn_product_page',
731 'value' => 'on',
732 'operator' => '==',
733 ],
734 ],
735 ],
736 'tab' => 'button',
737 ],
738 'product_btn_position_shortcode' => [
739 'type' => 'raw',
740 'label' => ' ',
741 'html' => sprintf(
742 /* translators: 1: The shortcode.*/
743 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' ),
744 '<code>[rtsb_compare_button]</code> '
745 ),
746 'dependency' => [
747 'rules' => [
748 [
749 'item' => 'modules.compare.show_btn_product_page',
750 'value' => 'on',
751 'operator' => '==',
752 ],
753 [
754 'item' => 'modules.compare.product_btn_position',
755 'value' => 'shortcode',
756 'operator' => '==',
757 ],
758 ],
759 ],
760 'tab' => 'button',
761 ],
762 'product_custom_hook_name' => [
763 'id' => 'product_custom_hook_name',
764 'type' => 'text',
765 'label' => esc_html__( 'Product Hook Name', 'shopbuilder' ),
766 'tab' => 'button',
767 'help' => sprintf(
768 /* translators: 1: The shortcode.*/
769 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
770 "<br /><code>&lt;?php do_action('rtsb/modules/compare/frontend/display' ); ?&gt;</code><br />"
771 ),
772 'dependency' => [
773 'rules' => [
774 [
775 'item' => 'modules.compare.show_btn_product_page',
776 'value' => 'on',
777 'operator' => '==',
778 ],
779 [
780 'item' => 'modules.compare.product_btn_position',
781 'value' => 'custom',
782 'operator' => '==',
783 ],
784 ],
785 ],
786 ],
787 'product_custom_hook_priority' => [
788 'id' => 'product_custom_hook_priority',
789 'type' => 'number',
790 'value' => 10,
791 'size' => 'small',
792 'min' => 0,
793 'max' => 999,
794 'label' => esc_html__( 'Product Hook Priority', 'shopbuilder' ),
795 'tab' => 'button',
796 'dependency' => [
797 'rules' => [
798 [
799 'item' => 'modules.compare.show_btn_product_page',
800 'value' => 'on',
801 'operator' => '==',
802 ],
803 [
804 'item' => 'modules.compare.product_btn_position',
805 'value' => 'custom',
806 'operator' => '==',
807 ],
808 ],
809 'relation' => 'and',
810 ],
811 ],
812 'button_text' => [
813 'id' => 'button_text',
814 'label' => esc_html__( 'Compare Button Text', 'shopbuilder' ),
815 'help' => esc_html__( 'Enter your compare button text.', 'shopbuilder' ),
816 'type' => 'text',
817 'value' => esc_html__( 'Compare', 'shopbuilder' ),
818 'placeholder' => esc_html__( 'Compare', 'shopbuilder' ),
819 'tab' => 'button',
820 ],
821 'notice_added_text' => [
822 'id' => 'notice_added_text',
823 'label' => esc_html__( 'Product Added Text', 'shopbuilder' ),
824 'help' => esc_html__( 'Enter the product added text.', 'shopbuilder' ),
825 'type' => 'text',
826 'value' => esc_html__( 'Product added!', 'shopbuilder' ),
827 'placeholder' => esc_html__( 'Product added!', 'shopbuilder' ),
828 'tab' => 'general',
829 ],
830 'notice_removed_text' => [
831 'id' => 'notice_removed_text',
832 'label' => esc_html__( 'Product Removed Text', 'shopbuilder' ),
833 'help' => esc_html__( 'Enter the product removed text.', 'shopbuilder' ),
834 'type' => 'text',
835 'value' => esc_html__( 'Product removed!', 'shopbuilder' ),
836 'placeholder' => esc_html__( 'Product removed!', 'shopbuilder' ),
837 'tab' => 'general',
838 ],
839 'browse_list_text' => [
840 'id' => 'browse_list_text',
841 'label' => esc_html__( 'Browse Compare Text', 'shopbuilder' ),
842 'help' => esc_html__( 'Enter a text for the "Browse compare" link on the compare page', 'shopbuilder' ),
843 'type' => 'text',
844 'value' => esc_html__( 'Browse Compare', 'shopbuilder' ),
845 'placeholder' => esc_html__( 'Browse Compare', 'shopbuilder' ),
846 'tab' => 'general',
847 ],
848 'page' => [
849 'id' => 'page',
850 'type' => 'select',
851 'help' => sprintf(
852 /* translators: 1: The shortcode.*/
853 esc_html__( 'Select a page for compare page and make sure you add the shortcode %1$s into the page content', 'shopbuilder' ),
854 '<code>[rtsb_compare_list]</code>'
855 ),
856 'label' => esc_html__( 'Select Compare Page', 'shopbuilder' ),
857 'options' => Fns::get_pages(),
858 'empty' => esc_html__( 'Select a page', 'shopbuilder' ),
859 'searchable' => true,
860 'tab' => 'page',
861 ],
862 'max_limit' => [
863 'id' => 'page',
864 'type' => 'number',
865 'sanitize_fn' => 'absint',
866 'value' => 10,
867 'help' => esc_html__( 'You can manage your maximum compare quantity from here.', 'shopbuilder' ),
868 'label' => esc_html__( 'Maximum Compare Limit', 'shopbuilder' ),
869 'tab' => 'page',
870 ],
871 'page_show_fields' => [
872 'value' => CompareFns::get_list_field_ids(),
873 'id' => 'page_show_fields',
874 'multiple' => true,
875 'checkbox' => true,
876 'type' => 'sortable',
877 'options' => CompareFns::get_available_list_fields(),
878 'label' => esc_html__( 'Compare Table Fields Visibility', 'shopbuilder' ),
879 'tab' => 'page',
880 ],
881
882 ]
883 ),
884 'tabs' => [
885 'general' => [
886 'title' => esc_html__( 'General', 'shopbuilder' ),
887 ],
888 'button' => [
889 'title' => esc_html__( 'Button', 'shopbuilder' ),
890 ],
891 'page' => [
892 'title' => esc_html__( 'Page', 'shopbuilder' ),
893 ],
894
895 ],
896 ]
897 ),
898 'variation_swatches' => apply_filters(
899 'rtsb/module/variation_swatches/options',
900 [
901 'id' => 'variation_swatches',
902 'external' => true,
903 'category' => 'general',
904 'title' => esc_html__( 'Variation Swatches', 'shopbuilder' ),
905 'pluginSlug' => 'woo-product-variation-swatches',
906 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-swatches/woo-product-variation-swatches.php' ),
907 'pluginIsActive' => Fns::check_plugin_active( 'woo-product-variation-swatches/woo-product-variation-swatches.php' ),
908 'pluginActiveUrl' => add_query_arg(
909 [
910 '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-swatches/woo-product-variation-swatches.php' ),
911 'action' => 'activate',
912 'plugin' => 'woo-product-variation-swatches/woo-product-variation-swatches.php',
913 ],
914 admin_url( 'plugins.php' )
915 ),
916 'help' => __( 'This module requires: <a href="https://wordpress.org/plugins/woo-product-variation-swatches/">Variation Swatches for WooCommerce</a>.', 'shopbuilder' ),
917 'package' => 'free',
918 'active_field' => [
919 'disable' => false,
920 ],
921 'fields' => [],
922 ]
923 ),
924 'variation_gallery' => apply_filters(
925 'rtsb/module/variation_gallery/options',
926 [
927 'id' => 'variation_gallery',
928 'external' => true,
929 'category' => 'general',
930 'title' => esc_html__( 'Variation Gallery', 'shopbuilder' ),
931 'pluginSlug' => 'woo-product-variation-gallery',
932 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-gallery/woo-product-variation-gallery.php' ),
933 'pluginIsActive' => Fns::check_plugin_active( 'woo-product-variation-gallery/woo-product-variation-gallery.php' ),
934 'pluginActiveUrl' => add_query_arg(
935 [
936 '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-gallery/woo-product-variation-gallery.php' ),
937 'action' => 'activate',
938 'plugin' => 'woo-product-variation-gallery/woo-product-variation-gallery.php',
939 ],
940 admin_url( 'plugins.php' )
941 ),
942 'help' => __( 'This module requires: <a href="https://wordpress.org/plugins/woo-product-variation-gallery/">Variation Images Gallery for WooCommerce</a>.', 'shopbuilder' ),
943 'package' => 'free',
944 'active_field' => [
945 'disable' => false,
946 ],
947 'fields' => [],
948 ]
949 ),
950 'mini_cart' => apply_filters(
951 'rtsb/module/mini_cart/options',
952 [
953 'id' => 'mini_cart',
954 'active' => '',
955 'title' => esc_html__( 'Mini Cart', 'shopbuilder' ),
956 'package' => $this->pro_package(),
957 'active_field' => [
958 'label' => esc_html__( 'Enable Mini Cart?', 'shopbuilder' ),
959 'help' => esc_html__( 'Switch on to enable mini cart module.', 'shopbuilder' ),
960 ],
961 'is_active' => true,
962 'fields' => Fns::pro_version_notice( '1.0.0' ),
963 ]
964 ),
965 'product_size_chart' => apply_filters(
966 'rtsb/module/product_size_chart/options',
967 [
968 'id' => 'product_size_chart',
969 'active' => '',
970 'title' => esc_html__( 'Product Size Chart', 'shopbuilder' ),
971 'package' => $this->pro_package(),
972 'active_field' => [
973 'label' => esc_html__( 'Enable Product Size Chart?', 'shopbuilder' ),
974 'help' => esc_html__( 'Switch on to enable Product Size Chart module.', 'shopbuilder' ),
975 ],
976 'fields' => Fns::pro_version_notice( '1.0.0' ),
977 ]
978 ),
979 'product_badges' => apply_filters(
980 'rtsb/module/product_badges/options',
981 [
982 'id' => 'product_badges',
983 'active' => '',
984 'title' => esc_html__( 'Product Badges', 'shopbuilder' ),
985 'package' => 'free',
986 'active_field' => [
987 'label' => esc_html__( 'Enable Product Badges?', 'shopbuilder' ),
988 'help' => esc_html__( 'Switch on to enable product badges module.', 'shopbuilder' ),
989 ],
990 'base_class' => Badges::class,
991 'fields' => $this->product_badges_fields(),
992 'tabs' => [
993 'general' => [
994 'title' => esc_html__( 'General', 'shopbuilder' ),
995 ],
996 'group' => [
997 'title' => esc_html__( 'Settings', 'shopbuilder' ),
998 ],
999 'badges' => [
1000 'title' => esc_html__( 'Create Badges', 'shopbuilder' ),
1001 ],
1002 ],
1003 ]
1004 ),
1005 'customize_my_account' => apply_filters(
1006 'rtsb/module/customize_my_account/options',
1007 [
1008 'id' => 'customize_my_account',
1009 'active' => '',
1010 'title' => esc_html__( 'Customize My Account', 'shopbuilder' ),
1011 'package' => $this->pro_package(),
1012 'active_field' => [
1013 'label' => esc_html__( 'Enable Customize My Account?', 'shopbuilder' ),
1014 'help' => esc_html__( 'Switch on to enable customize my account module.', 'shopbuilder' ),
1015 ],
1016 'fields' => Fns::pro_version_notice( '1.4.0' ),
1017 ]
1018 ),
1019 'pre_order' => apply_filters(
1020 'rtsb/module/pre_order/options',
1021 [
1022 'id' => 'pre_order',
1023 'active' => '',
1024 'title' => esc_html__( 'Pre-Order', 'shopbuilder' ),
1025 'package' => $this->pro_package(),
1026 'active_field' => [
1027 'label' => esc_html__( 'Enable Pre-Order?', 'shopbuilder' ),
1028 'help' => esc_html__( 'Switch on to enable pre-order module.', 'shopbuilder' ),
1029 ],
1030 'fields' => Fns::pro_version_notice( '1.5.0' ),
1031 ]
1032 ),
1033 'currency_switcher' => apply_filters(
1034 'rtsb/module/currency_switcher/options',
1035 [
1036 'id' => 'currency_switcher',
1037 'active' => '',
1038 'title' => esc_html__( 'Currency Switcher', 'shopbuilder' ),
1039 'package' => $this->pro_package(),
1040 'active_field' => [
1041 'label' => esc_html__( 'Enable Currency Switcher?', 'shopbuilder' ),
1042 'help' => esc_html__( 'Switch on to enable currency switcher module.', 'shopbuilder' ),
1043 ],
1044 'is_active' => true,
1045 'fields' => Fns::pro_version_notice( '1.5.0' ),
1046 ]
1047 ),
1048 'product_add_ons' => apply_filters(
1049 'rtsb/module/product_add_ons/options',
1050 [
1051 'id' => 'product_add_ons',
1052 'active' => '',
1053 'title' => esc_html__( 'Product Add-Ons', 'shopbuilder' ),
1054 'package' => $this->pro_package(),
1055 'active_field' => [
1056 'label' => esc_html__( 'Enable Product Add-Ons?', 'shopbuilder' ),
1057 'help' => esc_html__( 'Switch on to enable product add-ons module.', 'shopbuilder' ),
1058 ],
1059 'is_active' => true,
1060 'fields' => Fns::pro_version_notice( '1.6.0' ),
1061 ]
1062 ),
1063 // Checkout Fields Manager.
1064 'checkout_fields_editor' => apply_filters(
1065 'rtsb/module/checkout_fields_editor/options',
1066 [
1067 'id' => 'checkout_fields_editor',
1068 'active' => '',
1069 'title' => esc_html__( 'Checkout Fields Editor', 'shopbuilder' ),
1070 'base_class' => CheckoutEditorInit::class,
1071 'active_field' => [
1072 'label' => esc_html__( 'Enable Checkout Fields Editor?', 'shopbuilder' ),
1073 'help' => esc_html__( 'Switch on to enable Checkout Fields Editor module.', 'shopbuilder' ),
1074 ],
1075 'fields' => [
1076 'checkout_billing_intro' => [
1077 'id' => 'checkout_billing_intro',
1078 'type' => 'description',
1079 'text' => esc_html__( 'Billing Fields Editor allows you to customize the default billing fields on your checkout page.', 'shopbuilder' ),
1080 'tab' => 'billing_fields',
1081 ],
1082 'modify_billing_form' => [
1083 'id' => 'modify_billing_form',
1084 'type' => 'switch',
1085 'label' => esc_html__( 'Customize Billing Form?', 'shopbuilder' ),
1086 'help' => esc_html__( 'Enable this option to edit billing Form.', 'shopbuilder' ),
1087 'tab' => 'billing_fields',
1088 ],
1089
1090 'checkout_billing_fields_info' => [
1091 'id' => 'checkout_billing_fields_info',
1092 'type' => 'title',
1093 'label' => esc_html__( 'Billing Fields', 'shopbuilder' ),
1094 'tab' => 'billing_fields',
1095 'dependency' => [
1096 'rules' => [
1097 [
1098 'item' => 'modules.checkout_fields_editor.modify_billing_form',
1099 'value' => 'on',
1100 'operator' => '==',
1101 ],
1102 ],
1103 ],
1104 ],
1105 'checkout_billing_fields' => [
1106 'id' => 'checkout_billing_fields',
1107 'type' => 'checkout_fields',
1108 'tab' => 'billing_fields',
1109 'value' => wp_json_encode( CheckoutFns::default_billing_fields() ),
1110 'dependency' => [
1111 'rules' => [
1112 [
1113 'item' => 'modules.checkout_fields_editor.modify_billing_form',
1114 'value' => 'on',
1115 'operator' => '==',
1116 ],
1117 ],
1118 ],
1119 ],
1120 'checkout_shipping_intro' => [
1121 'id' => 'checkout_shipping_intro',
1122 'type' => 'description',
1123 'text' => esc_html__( 'Shipping Fields Editor allows you to customize the default shipping fields on your checkout page.', 'shopbuilder' ),
1124 'tab' => 'shipping_fields',
1125 ],
1126 'modify_shipping_form' => [
1127 'id' => 'modify_billing_form',
1128 'type' => 'switch',
1129 'label' => esc_html__( 'Modify Shipping Form?', 'shopbuilder' ),
1130 'help' => esc_html__( 'Enable this option to edit shipping Form.', 'shopbuilder' ),
1131 'tab' => 'shipping_fields',
1132 ],
1133 'checkout_shipping_fields_info' => [
1134 'id' => 'checkout_shipping_fields_info',
1135 'type' => 'title',
1136 'label' => esc_html__( 'Shipping Fields', 'shopbuilder' ),
1137 'tab' => 'shipping_fields',
1138 'dependency' => [
1139 'rules' => [
1140 [
1141 'item' => 'modules.checkout_fields_editor.modify_shipping_form',
1142 'value' => 'on',
1143 'operator' => '==',
1144 ],
1145 ],
1146 ],
1147 ],
1148 'checkout_shipping_fields' => [
1149 'id' => 'checkout_shipping_fields',
1150 'type' => 'checkout_fields',
1151 'tab' => 'shipping_fields',
1152 'value' => wp_json_encode( CheckoutFns::default_shipping_fields() ),
1153 'dependency' => [
1154 'rules' => [
1155 [
1156 'item' => 'modules.checkout_fields_editor.modify_shipping_form',
1157 'value' => 'on',
1158 'operator' => '==',
1159 ],
1160 ],
1161 ],
1162 ],
1163 'checkout_additional_intro' => [
1164 'id' => 'checkout_additional_intro',
1165 'type' => 'description',
1166 'text' => esc_html__( 'Additional Fields Editor allows you to customize the extra fields on your checkout page.', 'shopbuilder' ),
1167 'tab' => 'additional_fields',
1168 ],
1169 'modify_additional_form' => [
1170 'id' => 'modify_additional_form',
1171 'type' => 'switch',
1172 'label' => esc_html__( 'Modify Additional Form Field?', 'shopbuilder' ),
1173 'help' => esc_html__( 'Enable this option to edit Additional Form.', 'shopbuilder' ),
1174 'tab' => 'additional_fields',
1175 ],
1176 'checkout_additional_fields_info' => [
1177 'id' => 'checkout_additional_fields_info',
1178 'type' => 'title',
1179 'label' => esc_html__( 'Additional Fields', 'shopbuilder' ),
1180 'tab' => 'additional_fields',
1181 'dependency' => [
1182 'rules' => [
1183 [
1184 'item' => 'modules.checkout_fields_editor.modify_additional_form',
1185 'value' => 'on',
1186 'operator' => '==',
1187 ],
1188 ],
1189 ],
1190 ],
1191 'checkout_additional_fields' => [
1192 'id' => 'checkout_additional_fields',
1193 'type' => 'checkout_fields',
1194 'tab' => 'additional_fields',
1195 'value' => wp_json_encode( CheckoutFns::checkout_additional_fields() ),
1196 'dependency' => [
1197 'rules' => [
1198 [
1199 'item' => 'modules.checkout_fields_editor.modify_additional_form',
1200 'value' => 'on',
1201 'operator' => '==',
1202 ],
1203 ],
1204 ],
1205 ],
1206 ],
1207 'tabs' => [
1208 'general' => [
1209 'title' => esc_html__( 'General', 'shopbuilder' ),
1210 ],
1211 'billing_fields' => [
1212 'title' => esc_html__( 'Billing Fields', 'shopbuilder' ),
1213 ],
1214 'shipping_fields' => [
1215 'title' => esc_html__( 'Shipping Fields', 'shopbuilder' ),
1216 ],
1217 'additional_fields' => [
1218 'title' => esc_html__( 'Additional Fields', 'shopbuilder' ),
1219 ],
1220 ],
1221 ]
1222 ),
1223 'sales_notification' => apply_filters(
1224 'rtsb/module/sales_notification/options',
1225 [
1226 'id' => 'sales_notification',
1227 'active' => '',
1228 'title' => esc_html__( 'Sales Notification', 'shopbuilder' ),
1229 'package' => $this->pro_package(),
1230 'active_field' => [
1231 'label' => esc_html__( 'Enable Sales Notification?', 'shopbuilder' ),
1232 'help' => esc_html__( 'Switch on to enable Sales Notification module.', 'shopbuilder' ),
1233 ],
1234 'fields' => Fns::pro_version_notice( '1.0.0' ),
1235 ]
1236 ),
1237 'flash_sale_countdown' => apply_filters(
1238 'rtsb/module/flash_sale_countdown/options',
1239 [
1240 'id' => 'flash_sale_countdown',
1241 'active' => '',
1242 'title' => esc_html__( 'Flash Sale Countdown', 'shopbuilder' ),
1243 'package' => $this->pro_package(),
1244 'active_field' => [
1245 'label' => esc_html__( 'Enable Flash Sale Countdown?', 'shopbuilder' ),
1246 'help' => esc_html__( 'Switch on to enable Flash Sale Countdown module.', 'shopbuilder' ),
1247 ],
1248 'fields' => Fns::pro_version_notice( '1.0.0' ),
1249 ]
1250 ),
1251 'quick_checkout' => apply_filters(
1252 'rtsb/module/quick_checkout/options',
1253 [
1254 'id' => 'quick_checkout',
1255 'active' => '',
1256 'title' => esc_html__( 'Quick Checkout', 'shopbuilder' ),
1257 'package' => $this->pro_package(),
1258 'active_field' => [
1259 'label' => esc_html__( 'Enable Quick Checkout?', 'shopbuilder' ),
1260 'help' => esc_html__( 'Switch on to enable quick checkout module. Note: Currently, this is not suitable for variable products.', 'shopbuilder' ),
1261 ],
1262 'fields' => Fns::pro_version_notice( '1.1.0' ),
1263 ]
1264 ),
1265 'multi_step_checkout' => apply_filters(
1266 'rtsb/module/multi_step_checkout/options',
1267 [
1268 'id' => 'multi_step_checkout',
1269 'active' => '',
1270 'title' => esc_html__( 'Multi-Step Checkout', 'shopbuilder' ),
1271 'package' => $this->pro_package(),
1272 'active_field' => [
1273 'label' => esc_html__( 'Enable Multi-Step Checkout?', 'shopbuilder' ),
1274 'help' => esc_html__( 'Switch on to enable Multi-step Checkout module.', 'shopbuilder' ),
1275 ],
1276 'fields' => Fns::pro_version_notice( '1.0.0' ),
1277 ]
1278 ),
1279 'back_order' => apply_filters(
1280 'rtsb/module/back_order/options',
1281 [
1282 'id' => 'back_order',
1283 'active' => '',
1284 'title' => esc_html__( 'Back-Order', 'shopbuilder' ),
1285 'package' => $this->pro_package(),
1286 'active_field' => [
1287 'label' => esc_html__( 'Enable Back-Order?', 'shopbuilder' ),
1288 'help' => esc_html__( 'Switch on to enable back-order module.', 'shopbuilder' ),
1289 ],
1290 'fields' => Fns::pro_version_notice( '1.3.0', 'general', 'Back-Order', false ),
1291 ]
1292 ),
1293 'sticky_add_to_cart' => apply_filters(
1294 'rtsb/module/sticky_add_to_cart/options',
1295 [
1296 'id' => 'sticky_add_to_cart',
1297 'active' => '',
1298 'title' => esc_html__( 'Sticky Add-To-Cart', 'shopbuilder' ),
1299 'package' => $this->pro_package(),
1300 'active_field' => [
1301 'label' => esc_html__( 'Enable Sticky Add-To-Cart?', 'shopbuilder' ),
1302 'help' => esc_html__( 'Switch on to enable sticky add-to-cart module.', 'shopbuilder' ),
1303 ],
1304 'fields' => Fns::pro_version_notice( '1.7.0', 'general', 'Sticky Add-To-Cart', false ),
1305 ]
1306 ),
1307 'shopify_checkout' => apply_filters(
1308 'rtsb/module/shopify_checkout/options',
1309 [
1310 'id' => 'shopify_checkout',
1311 'active' => '',
1312 'title' => esc_html__( 'Shopify Checkout', 'shopbuilder' ),
1313 'base_class' => ShopifyCheckout::class,
1314 'active_field' => [
1315 'label' => esc_html__( 'Enable Shopify Checkout?', 'shopbuilder' ),
1316 'help' => esc_html__( 'Switch on to enable Shopify Checkout module.', 'shopbuilder' ),
1317 ],
1318 'fields' => $this->shopify_checkout_options(),
1319 'tabs' => [
1320 'general' => [
1321 'title' => esc_html__( 'General', 'shopbuilder' ),
1322 ],
1323 'multi-step' => [
1324 'title' => esc_html__( 'Multi-Step', 'shopbuilder' ),
1325 ],
1326 'styles' => [
1327 'title' => esc_html__( 'General Styles', 'shopbuilder' ),
1328 ],
1329 'btn-styles' => [
1330 'title' => esc_html__( 'Button Styles', 'shopbuilder' ),
1331 ],
1332 ],
1333 ]
1334 ),
1335 'smart_coupons' => apply_filters(
1336 'rtsb/module/smart_coupons/options',
1337 [
1338 'id' => 'smart_coupons',
1339 'active' => '',
1340 'title' => esc_html__( 'Smart Coupons', 'shopbuilder' ),
1341 'package' => $this->pro_package(),
1342 'active_field' => [
1343 'label' => esc_html__( 'Enable Smart Coupons?', 'shopbuilder' ),
1344 'help' => esc_html__( 'Switch on to enable smart coupons module.', 'shopbuilder' ),
1345 ],
1346 'fields' => Fns::pro_version_notice( '1.10.0', 'general', 'ShopBuilder Pro', false ),
1347 ]
1348 ),
1349 'bulk_discounts' => apply_filters(
1350 'rtsb/module/bulk_discounts/options',
1351 [
1352 'id' => 'bulk_discounts',
1353 'active' => '',
1354 'title' => esc_html__( 'Bulk Discounts', 'shopbuilder' ),
1355 'active_field' => [
1356 'label' => esc_html__( 'Enable Bulk Discounts?', 'shopbuilder' ),
1357 'help' => esc_html__( 'Switch on to enable bulk discounts module.', 'shopbuilder' ),
1358 ],
1359 'package' => $this->pro_package(),
1360 'fields' => Fns::pro_version_notice( '1.10.0', 'general', 'ShopBuilder Pro', false ),
1361 ]
1362 ),
1363 'bogo_bxgy_free_gift_discounts' => apply_filters(
1364 'rtsb/module/bogo_bxgy_free_gift_discounts/options',
1365 [
1366 'id' => 'bogo_bxgy_free_gift_discounts',
1367 'active' => '',
1368 'title' => esc_html__( 'Buy X Get Y | BOGO', 'shopbuilder' ),
1369 'active_field' => [
1370 'label' => esc_html__( 'Enable Buy X Get Y | BOGO?', 'shopbuilder' ),
1371 'help' => esc_html__( 'Switch on to enable Buy X Get Y | BOGO module.', 'shopbuilder' ),
1372 ],
1373 'package' => $this->pro_package(),
1374 'fields' => Fns::pro_version_notice( '1.11.0', 'general', 'ShopBuilder Pro', false ),
1375 ]
1376 ),
1377 'partial_pay' => apply_filters(
1378 'rtsb/module/partial_pay/options',
1379 [
1380 'id' => 'partial_pay',
1381 'active' => '',
1382 'title' => esc_html__( 'Partial Pay', 'shopbuilder' ),
1383 'active_field' => [
1384 'label' => esc_html__( 'Enable Partial Pay?', 'shopbuilder' ),
1385 'help' => esc_html__( 'Switch on to enable partial pay module.', 'shopbuilder' ),
1386 ],
1387 'package' => $this->pro_package(),
1388 'fields' => Fns::pro_version_notice( '1.12.0', 'general', 'ShopBuilder Pro', false ),
1389 ]
1390 ),
1391 'gift_card' => apply_filters(
1392 'rtsb/module/gift_card/options',
1393 [
1394 'id' => 'gift_card',
1395 'active' => '',
1396 'title' => esc_html__( 'Gift Card', 'shopbuilder' ),
1397 'active_field' => [
1398 'label' => esc_html__( 'Enable Gift Card?', 'shopbuilder' ),
1399 'help' => esc_html__( 'Switch on to enable Gift Card module.', 'shopbuilder' ),
1400 ],
1401 'package' => $this->pro_package(),
1402 'fields' => Fns::pro_version_notice( '1.10.0' ),
1403 ]
1404 ),
1405 ];
1406 return apply_filters( 'rtsb/core/modules/raw_list', $list );
1407 }
1408
1409 /**
1410 * Get All Menu
1411 */
1412 public function get_all_menu() {
1413 $manus = [
1414 'none' => esc_html__( 'None', 'shopbuilder' ),
1415 ];
1416 $nav_menus = wp_get_nav_menus();
1417 if ( empty( $nav_menus ) ) {
1418 return $manus;
1419 }
1420 foreach ( $nav_menus as $menu ) {
1421 $manus[ $menu->slug ] = $menu->name;
1422 }
1423 return $manus;
1424 }
1425 /**
1426 * Sticky add-to-cart module options.
1427 *
1428 * @return array
1429 */
1430 public function shopify_checkout_options() {
1431 $notice = [];
1432 if ( defined( 'RTSBPRO_VERSION' ) && version_compare( RTSBPRO_VERSION, '1.8.0', '<' ) ) {
1433 $notice = Fns::pro_version_notice( '1.8.0', 'general', 'ShopBuilder Pro', false );
1434 }
1435 $fields = $notice + [
1436 'general_settings' => [
1437 'id' => 'general_settings',
1438 'type' => 'title',
1439 'label' => esc_html__( 'Settings', 'shopbuilder' ),
1440 'tab' => 'general',
1441 ],
1442 'shopify_page_logo' => [
1443 'id' => 'shopify_page_logo',
1444 'type' => 'fileupload',
1445 'label' => esc_html__( 'Upload Checkout Page Logo', 'shopbuilder' ),
1446 'help' => esc_html__( 'Please upload your custom logo to display on the checkout page.', 'shopbuilder' ),
1447 'tab' => 'general',
1448 ],
1449 'shopify_logo_height' => [
1450 'id' => 'shopify_logo_height',
1451 'label' => esc_html__( 'Logo Height (px)', 'shopbuilder' ),
1452 'help' => esc_html__( 'Specify the height of the checkout page logo in px.', 'shopbuilder' ),
1453 'type' => 'slider',
1454 'min' => 10,
1455 'max' => 200,
1456 'unit' => 'px',
1457 'value' => 40,
1458 'tab' => 'general',
1459 ],
1460 'cart_icon_source' => [
1461 'id' => 'cart_icon_source',
1462 'label' => esc_html__( 'Cart Icon', 'shopbuilder' ),
1463 'help' => sprintf(
1464 // translators: %s for pro message.
1465 __( 'Choose a cart icon to display in your checkout\'s header. <br />%s', 'shopbuilder' ),
1466 ! rtsb()->has_pro()
1467 ? sprintf(
1468 '<a target="_blank" href="%s">%s </a> %s ',
1469 esc_url( rtsb()->pro_version_link() ),
1470 esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
1471 esc_html__( 'to unlock custom image icon.', 'shopbuilder' )
1472 )
1473 : ''
1474 ),
1475 'type' => 'select',
1476 'value' => 'none',
1477 'isPro' => ! rtsb()->has_pro(),
1478 'options' => [
1479 'none' => esc_html__( 'None', 'shopbuilder' ),
1480 'select_icon' => esc_html__( 'Select Icon', 'shopbuilder' ),
1481 'upload_icon' => esc_html__( 'Upload Icon', 'shopbuilder' ),
1482 ],
1483 'tab' => 'general',
1484 ],
1485 'cart_icon' => [
1486 'id' => 'cart_icon',
1487 'label' => esc_html__( 'Select Cart Icon', 'shopbuilder' ),
1488 'help' => esc_html__( 'Please choose the icon.', 'shopbuilder' ),
1489 'type' => 'icon_select',
1490 'searchable' => true,
1491 'options' => Fns::get_icons(),
1492 'value' => 'cart-2',
1493 'tab' => 'general',
1494 'dependency' => [
1495 'rules' => [
1496 [
1497 'item' => 'modules.shopify_checkout.cart_icon_source',
1498 'value' => 'select_icon',
1499 'operator' => '==',
1500 ],
1501 ],
1502 ],
1503 ],
1504
1505 'cart_image_icon' => [
1506 'id' => 'cart_image_icon',
1507 'type' => 'fileupload',
1508 'label' => esc_html__( 'Upload Custom Icon', 'shopbuilder' ),
1509 'help' => esc_html__( 'Please upload your custom image icon.', 'shopbuilder' ),
1510 'tab' => 'general',
1511 'dependency' => [
1512 'rules' => [
1513 [
1514 'item' => 'modules.shopify_checkout.cart_icon_source',
1515 'value' => 'upload_icon',
1516 'operator' => '==',
1517 ],
1518 ],
1519 ],
1520 ],
1521
1522 'email_field_title' => [
1523 'id' => 'email_field_title',
1524 'type' => 'text',
1525 'label' => esc_html__( 'Email Field Section Title', 'shopbuilder' ),
1526 'help' => esc_html__( 'Enter the custom title to be displayed above the email field section.', 'shopbuilder' ),
1527 'value' => esc_html__( 'Contact', 'shopbuilder' ),
1528 'tab' => 'general',
1529 ],
1530
1531 'billing_address_field_title' => [
1532 'id' => 'billing_address_field_title',
1533 'type' => 'text',
1534 'label' => esc_html__( 'Billing Fields Section Title', 'shopbuilder' ),
1535 'help' => esc_html__( 'Enter the custom title to be displayed above the billing fields section', 'shopbuilder' ),
1536 'value' => esc_html__( 'Billing address', 'shopbuilder' ),
1537 'tab' => 'general',
1538 ],
1539
1540 'enable_multi_step' => [
1541 'id' => 'enable_multi_step',
1542 'type' => 'switch',
1543 'isPro' => ! rtsb()->has_pro(),
1544 'label' => esc_html__( 'Multi-Step Checkout', 'shopbuilder' ),
1545 'help' => esc_html__( 'Enable multi-step checkout to simplify the purchasing process.', 'shopbuilder' ),
1546 'tab' => 'multi-step',
1547 ],
1548 'step_menu_settings' => [
1549 'id' => 'step_menu_settings',
1550 'type' => 'title',
1551 'label' => esc_html__( 'Step Settings ', 'shopbuilder' ),
1552 'tab' => 'multi-step',
1553 'dependency' => [
1554 'rules' => [
1555 [
1556 'item' => 'modules.shopify_checkout.enable_multi_step',
1557 'value' => 'on',
1558 'operator' => '==',
1559 ],
1560 ],
1561 ],
1562 ],
1563
1564 'show_step_menu' => [
1565 'id' => 'show_step_menu',
1566 'type' => 'switch',
1567 'isPro' => ! rtsb()->has_pro(),
1568 'label' => esc_html__( 'Show Step Menu', 'shopbuilder' ),
1569 'help' => esc_html__( 'Enable to display the step navigation menu during checkout.', 'shopbuilder' ),
1570 'tab' => 'multi-step',
1571 'value' => 'on',
1572 'dependency' => [
1573 'rules' => [
1574 [
1575 'item' => 'modules.shopify_checkout.enable_multi_step',
1576 'value' => 'on',
1577 'operator' => '==',
1578 ],
1579 ],
1580 ],
1581 ],
1582 'show_cart_menu' => [
1583 'id' => 'show_cart_menu',
1584 'type' => 'switch',
1585 'isPro' => ! rtsb()->has_pro(),
1586 'label' => esc_html__( 'Show Cart Menu', 'shopbuilder' ),
1587 'help' => esc_html__( 'Enable this option to display the cart item in the step menu.', 'shopbuilder' ),
1588 'tab' => 'multi-step',
1589 'dependency' => [
1590 'rules' => [
1591 [
1592 'item' => 'modules.shopify_checkout.enable_multi_step',
1593 'value' => 'on',
1594 'operator' => '==',
1595 ],
1596 [
1597 'item' => 'modules.shopify_checkout.show_step_menu',
1598 'value' => 'on',
1599 'operator' => '==',
1600 ],
1601 ],
1602 ],
1603 ],
1604 'cart_text' => [
1605 'id' => 'cart_text',
1606 'type' => 'text',
1607 'isPro' => ! rtsb()->has_pro(),
1608 'label' => esc_html__( 'Cart Step Title', 'shopbuilder' ),
1609 'help' => esc_html__( 'Enter the cart step menu title.', 'shopbuilder' ),
1610 'value' => esc_html__( 'Cart', 'shopbuilder' ),
1611 'tab' => 'multi-step',
1612 'dependency' => [
1613 'rules' => [
1614 [
1615 'item' => 'modules.shopify_checkout.show_step_menu',
1616 'value' => 'on',
1617 'operator' => '==',
1618 ],
1619 [
1620 'item' => 'modules.shopify_checkout.show_cart_menu',
1621 'value' => 'on',
1622 'operator' => '==',
1623 ],
1624 ],
1625 ],
1626 ],
1627
1628 'billing_text' => [
1629 'id' => 'billing_text',
1630 'type' => 'text',
1631 'isPro' => ! rtsb()->has_pro(),
1632 'label' => esc_html__( 'Billing Step Title', 'shopbuilder' ),
1633 'help' => esc_html__( 'Enter the billing step menu title.', 'shopbuilder' ),
1634 'value' => esc_html__( 'Billing', 'shopbuilder' ),
1635 'tab' => 'multi-step',
1636 'dependency' => [
1637 'rules' => [
1638 [
1639 'item' => 'modules.shopify_checkout.enable_multi_step',
1640 'value' => 'on',
1641 'operator' => '==',
1642 ],
1643 [
1644 'item' => 'modules.shopify_checkout.show_step_menu',
1645 'value' => 'on',
1646 'operator' => '==',
1647 ],
1648 ],
1649 ],
1650 ],
1651
1652 'shipping_text' => [
1653 'id' => 'shipping_text',
1654 'type' => 'text',
1655 'isPro' => ! rtsb()->has_pro(),
1656 'label' => esc_html__( 'Shipping Step Title', 'shopbuilder' ),
1657 'help' => esc_html__( 'Enter the shipping step menu title.', 'shopbuilder' ),
1658 'value' => esc_html__( 'Shipping', 'shopbuilder' ),
1659 'tab' => 'multi-step',
1660 'dependency' => [
1661 'rules' => [
1662 [
1663 'item' => 'modules.shopify_checkout.enable_multi_step',
1664 'value' => 'on',
1665 'operator' => '==',
1666 ],
1667 [
1668 'item' => 'modules.shopify_checkout.show_step_menu',
1669 'value' => 'on',
1670 'operator' => '==',
1671 ],
1672 ],
1673 ],
1674 ],
1675
1676 'shipping_method_text' => [
1677 'id' => 'shipping_method_text',
1678 'type' => 'text',
1679 'isPro' => ! rtsb()->has_pro(),
1680 'label' => esc_html__( 'Shipping Method Step Title', 'shopbuilder' ),
1681 'help' => esc_html__( 'Enter the shipping method step menu title.', 'shopbuilder' ),
1682 'value' => esc_html__( 'Shipping Method ', 'shopbuilder' ),
1683 'tab' => 'multi-step',
1684 'dependency' => [
1685 'rules' => [
1686 [
1687 'item' => 'modules.shopify_checkout.enable_multi_step',
1688 'value' => 'on',
1689 'operator' => '==',
1690 ],
1691 [
1692 'item' => 'modules.shopify_checkout.show_step_menu',
1693 'value' => 'on',
1694 'operator' => '==',
1695 ],
1696 ],
1697 ],
1698 ],
1699
1700 'payment_text' => [
1701 'id' => 'payment_text',
1702 'type' => 'text',
1703 'isPro' => ! rtsb()->has_pro(),
1704 'label' => esc_html__( 'Payment Method Step Title', 'shopbuilder' ),
1705 'help' => esc_html__( 'Enter the payment method step menu title.', 'shopbuilder' ),
1706 'value' => esc_html__( 'Payment', 'shopbuilder' ),
1707 'tab' => 'multi-step',
1708 'dependency' => [
1709 'rules' => [
1710 [
1711 'item' => 'modules.shopify_checkout.enable_multi_step',
1712 'value' => 'on',
1713 'operator' => '==',
1714 ],
1715 [
1716 'item' => 'modules.shopify_checkout.show_step_menu',
1717 'value' => 'on',
1718 'operator' => '==',
1719 ],
1720 ],
1721 ],
1722 ],
1723
1724 'next_button_settings' => [
1725 'id' => 'next_button_settings',
1726 'type' => 'title',
1727 'label' => esc_html__( 'Button Settings', 'shopbuilder' ),
1728 'tab' => 'multi-step',
1729 'dependency' => [
1730 'rules' => [
1731 [
1732 'item' => 'modules.shopify_checkout.enable_multi_step',
1733 'value' => 'on',
1734 'operator' => '==',
1735 ],
1736 ],
1737 ],
1738 ],
1739
1740 'shop_continue_btn' => [
1741 'id' => 'shop_continue_btn',
1742 'type' => 'switch',
1743 'isPro' => ! rtsb()->has_pro(),
1744 'label' => esc_html__( 'Show Next Button', 'shopbuilder' ),
1745 'help' => esc_html__( 'Enable this option to display the \'Next\' button.', 'shopbuilder' ),
1746 'tab' => 'multi-step',
1747 'value' => 'on',
1748 'dependency' => [
1749 'rules' => [
1750 [
1751 'item' => 'modules.shopify_checkout.enable_multi_step',
1752 'value' => 'on',
1753 'operator' => '==',
1754 ],
1755 ],
1756 ],
1757 ],
1758 'continue_btn_text_for_shipping' => [
1759 'id' => 'continue_btn_text_for_shipping',
1760 'type' => 'text',
1761 'isPro' => ! rtsb()->has_pro(),
1762 'label' => esc_html__( 'Next Button Label for Shipping', 'shopbuilder' ),
1763 'value' => esc_html__( 'Next', 'shopbuilder' ),
1764 'tab' => 'multi-step',
1765 'dependency' => [
1766 'rules' => [
1767 [
1768 'item' => 'modules.shopify_checkout.enable_multi_step',
1769 'value' => 'on',
1770 'operator' => '==',
1771 ],
1772 [
1773 'item' => 'modules.shopify_checkout.shop_continue_btn',
1774 'value' => 'on',
1775 'operator' => '==',
1776 ],
1777 ],
1778 ],
1779 ],
1780 'continue_btn_text_for_shipping_method' => [
1781 'id' => 'continue_btn_text_for_shipping_method',
1782 'type' => 'text',
1783 'isPro' => ! rtsb()->has_pro(),
1784 'label' => esc_html__( 'Next Button Label for Shipping Method', 'shopbuilder' ),
1785 'value' => esc_html__( 'Next', 'shopbuilder' ),
1786 'tab' => 'multi-step',
1787 'dependency' => [
1788 'rules' => [
1789 [
1790 'item' => 'modules.shopify_checkout.enable_multi_step',
1791 'value' => 'on',
1792 'operator' => '==',
1793 ],
1794 [
1795 'item' => 'modules.shopify_checkout.shop_continue_btn',
1796 'value' => 'on',
1797 'operator' => '==',
1798 ],
1799 ],
1800 ],
1801 ],
1802 'continue_btn_text_for_payment' => [
1803 'id' => 'continue_btn_text_for_payment',
1804 'type' => 'text',
1805 'label' => esc_html__( 'Next Button Label for Payment', 'shopbuilder' ),
1806 'value' => esc_html__( 'Next', 'shopbuilder' ),
1807 'tab' => 'multi-step',
1808 'dependency' => [
1809 'rules' => [
1810 [
1811 'item' => 'modules.shopify_checkout.enable_multi_step',
1812 'value' => 'on',
1813 'operator' => '==',
1814 ],
1815 [
1816 'item' => 'modules.shopify_checkout.shop_continue_btn',
1817 'value' => 'on',
1818 'operator' => '==',
1819 ],
1820 ],
1821 ],
1822 ],
1823 'shop_return_btn' => [
1824 'id' => 'shop_return_btn',
1825 'type' => 'switch',
1826 'isPro' => ! rtsb()->has_pro(),
1827 'label' => esc_html__( 'Show Back Button', 'shopbuilder' ),
1828 'help' => esc_html__( 'Enable this option to display the \'Back\' button.', 'shopbuilder' ),
1829 'tab' => 'multi-step',
1830 'value' => 'on',
1831 'dependency' => [
1832 'rules' => [
1833 [
1834 'item' => 'modules.shopify_checkout.enable_multi_step',
1835 'value' => 'on',
1836 'operator' => '==',
1837 ],
1838 ],
1839 ],
1840 ],
1841 'return_btn_text_for_billing' => [
1842 'id' => 'return_btn_text_for_billing',
1843 'type' => 'text',
1844 'isPro' => ! rtsb()->has_pro(),
1845 'label' => esc_html__( 'Back Button Label for Billing', 'shopbuilder' ),
1846 'value' => esc_html__( 'Prev', 'shopbuilder' ),
1847 'tab' => 'multi-step',
1848 'dependency' => [
1849 'rules' => [
1850 [
1851 'item' => 'modules.shopify_checkout.enable_multi_step',
1852 'value' => 'on',
1853 'operator' => '==',
1854 ],
1855 [
1856 'item' => 'modules.shopify_checkout.shop_return_btn',
1857 'value' => 'on',
1858 'operator' => '==',
1859 ],
1860 ],
1861 ],
1862 ],
1863
1864 'return_btn_text_for_shipping' => [
1865 'id' => 'return_btn_text_for_shipping',
1866 'type' => 'text',
1867 'isPro' => ! rtsb()->has_pro(),
1868 'label' => esc_html__( 'Back Button Label for Shipping', 'shopbuilder' ),
1869 'value' => esc_html__( 'Prev', 'shopbuilder' ),
1870 'tab' => 'multi-step',
1871 'dependency' => [
1872 'rules' => [
1873 [
1874 'item' => 'modules.shopify_checkout.enable_multi_step',
1875 'value' => 'on',
1876 'operator' => '==',
1877 ],
1878 [
1879 'item' => 'modules.shopify_checkout.shop_return_btn',
1880 'value' => 'on',
1881 'operator' => '==',
1882 ],
1883 ],
1884 ],
1885 ],
1886
1887 'return_btn_text_for_shipping_method' => [
1888 'id' => 'return_btn_text_for_shipping_method',
1889 'type' => 'text',
1890 'isPro' => ! rtsb()->has_pro(),
1891 'label' => esc_html__( 'Back Button Label for Shipping Method', 'shopbuilder' ),
1892 'value' => esc_html__( 'Prev', 'shopbuilder' ),
1893 'tab' => 'multi-step',
1894 'dependency' => [
1895 'rules' => [
1896 [
1897 'item' => 'modules.shopify_checkout.enable_multi_step',
1898 'value' => 'on',
1899 'operator' => '==',
1900 ],
1901 [
1902 'item' => 'modules.shopify_checkout.shop_return_btn',
1903 'value' => 'on',
1904 'operator' => '==',
1905 ],
1906 ],
1907 ],
1908 ],
1909
1910 'order_review_settings' => [
1911 'id' => 'order_review_settings',
1912 'type' => 'title',
1913 'label' => esc_html__( 'Order Reviews', 'shopbuilder' ),
1914 'tab' => 'general',
1915 ],
1916 'order_review_item_link' => [
1917 'id' => 'order_review_item_link',
1918 'type' => 'switch',
1919 'label' => esc_html__( 'Link Product Titles', 'shopbuilder' ),
1920 'help' => esc_html__( 'Enable to make product titles clickable, linking to their product pages.', 'shopbuilder' ),
1921 'value' => '',
1922 'tab' => 'general',
1923 ],
1924 'extra_content' => [
1925 'id' => 'extra_content',
1926 'label' => esc_html__( 'Display Additional Data', 'shopbuilder' ),
1927 'help' => esc_html__( 'Enter custom text to display below the Order Review section. You can include custom HTML content. Shortcodes are also supported here.', 'shopbuilder' ),
1928 'type' => 'text_editor',
1929 'isPro' => ! rtsb()->has_pro(),
1930 'sanitize_fn' => 'pass_all',
1931 'tab' => 'general',
1932 ],
1933
1934 'footer_settings' => [
1935 'id' => 'footer_settings',
1936 'type' => 'title',
1937 'label' => esc_html__( 'Footer', 'shopbuilder' ),
1938 'tab' => 'general',
1939 ],
1940
1941 'footer_menu' => [
1942 'id' => 'footer_menu',
1943 'label' => esc_html__( 'Footer Menu', 'shopbuilder' ),
1944 'help' => esc_html__( 'Select a menu to display in the footer section of your checkout page.', 'shopbuilder' ),
1945 'type' => 'select',
1946 'value' => 'none',
1947 'options' => $this->get_all_menu(),
1948 'tab' => 'general',
1949 ],
1950
1951 'footer_text' => [
1952 'id' => 'footer_text',
1953 'type' => 'text',
1954 'label' => esc_html__( 'Footer Text', 'shopbuilder' ),
1955 'help' => esc_html__( 'Enter custom text to display in the footer section of your checkout page. You can use {year} placeholder to display the current year.', 'shopbuilder' ),
1956 'value' => esc_html__( 'Copyright @{year} | All rights reserved', 'shopbuilder' ),
1957 'tab' => 'general',
1958 ],
1959
1960 // Place Order.
1961 'login_button_styles_settings' => [
1962 'id' => 'login_button_styles_settings',
1963 'type' => 'title',
1964 'tab' => 'btn-styles',
1965 'label' => esc_html__( 'Login Button Style', 'shopbuilder' ),
1966 ],
1967 'login_button_height' => [
1968 'id' => 'login_button_height',
1969 'label' => esc_html__( 'Height (px)', 'shopbuilder' ),
1970 'type' => 'slider',
1971 'min' => 10,
1972 'max' => 100,
1973 'unit' => 'px',
1974 'value' => 50,
1975 'tab' => 'btn-styles',
1976 ],
1977 'login_button_width' => [
1978 'id' => 'login_button_width',
1979 'label' => esc_html__( 'Width (px)', 'shopbuilder' ),
1980 'type' => 'slider',
1981 'min' => 10,
1982 'max' => 1000,
1983 'unit' => 'px',
1984 'tab' => 'btn-styles',
1985 ],
1986 'login_button_font_size' => [
1987 'id' => 'login_button_font_size',
1988 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
1989 'type' => 'slider',
1990 'min' => 10,
1991 'max' => 50,
1992 'unit' => 'px',
1993 'value' => 15,
1994 'tab' => 'btn-styles',
1995 ],
1996 'login_button_bg_color' => [
1997 'id' => 'login_button_bg_color',
1998 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
1999 'tab' => 'btn-styles',
2000 'type' => 'color',
2001 ],
2002 'login_button_hover_bg_color' => [
2003 'id' => 'login_button_hover_bg_color',
2004 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2005 'tab' => 'btn-styles',
2006 'type' => 'color',
2007 ],
2008 'login_button_color' => [
2009 'id' => 'login_button_color',
2010 'label' => esc_html__( 'Color', 'shopbuilder' ),
2011 'tab' => 'btn-styles',
2012 'type' => 'color',
2013 ],
2014 'login_button_hover_color' => [
2015 'id' => 'login_button_hover_color',
2016 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2017 'tab' => 'btn-styles',
2018 'type' => 'color',
2019 ],
2020 'login_button_border_color' => [
2021 'id' => 'login_button_border_color',
2022 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2023 'tab' => 'btn-styles',
2024 'type' => 'color',
2025 ],
2026 'login_button_hover_border_color' => [
2027 'id' => 'login_button_hover_border_color',
2028 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2029 'tab' => 'btn-styles',
2030 'type' => 'color',
2031 ],
2032
2033 // Place Order.
2034 'place_order_button_styles_settings' => [
2035 'id' => 'place_order_button_styles_settings',
2036 'type' => 'title',
2037 'tab' => 'btn-styles',
2038 'label' => esc_html__( 'Place Order Button Style', 'shopbuilder' ),
2039 ],
2040 'place_order_button_height' => [
2041 'id' => 'place_order_button_height',
2042 'label' => esc_html__( 'Height (px)', 'shopbuilder' ),
2043 'type' => 'slider',
2044 'min' => 10,
2045 'max' => 100,
2046 'unit' => 'px',
2047 'value' => 50,
2048 'tab' => 'btn-styles',
2049 ],
2050 'place_order_button_width' => [
2051 'id' => 'place_order_button_width',
2052 'label' => esc_html__( 'Width (px)', 'shopbuilder' ),
2053 'type' => 'slider',
2054 'min' => 10,
2055 'max' => 1000,
2056 'unit' => 'px',
2057 'tab' => 'btn-styles',
2058 ],
2059 'place_order_button_font_size' => [
2060 'id' => 'place_order_button_font_size',
2061 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2062 'type' => 'slider',
2063 'min' => 10,
2064 'max' => 50,
2065 'unit' => 'px',
2066 'value' => 15,
2067 'tab' => 'btn-styles',
2068 ],
2069 'place_order_button_bg_color' => [
2070 'id' => 'place_order_button_bg_color',
2071 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
2072 'tab' => 'btn-styles',
2073 'type' => 'color',
2074 ],
2075 'place_order_button_hover_bg_color' => [
2076 'id' => 'place_order_button_hover_bg_color',
2077 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2078 'tab' => 'btn-styles',
2079 'type' => 'color',
2080 ],
2081 'place_order_button_color' => [
2082 'id' => 'place_order_button_color',
2083 'label' => esc_html__( 'Color', 'shopbuilder' ),
2084 'tab' => 'btn-styles',
2085 'type' => 'color',
2086 ],
2087 'place_order_button_hover_color' => [
2088 'id' => 'place_order_button_hover_color',
2089 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2090 'tab' => 'btn-styles',
2091 'type' => 'color',
2092 ],
2093 'place_order_button_border_color' => [
2094 'id' => 'place_order_button_border_color',
2095 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2096 'tab' => 'btn-styles',
2097 'type' => 'color',
2098 ],
2099 'place_order_button_hover_border_color' => [
2100 'id' => 'place_order_button_hover_border_color',
2101 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2102 'tab' => 'btn-styles',
2103 'type' => 'color',
2104 ],
2105
2106 // Next Button.
2107 'next_button_styles_settings' => [
2108 'id' => 'next_button_styles_settings',
2109 'type' => 'title',
2110 'tab' => 'btn-styles',
2111 'label' => esc_html__( 'Next Button Style', 'shopbuilder' ),
2112 'dependency' => [
2113 'rules' => [
2114 [
2115 'item' => 'modules.shopify_checkout.enable_multi_step',
2116 'value' => 'on',
2117 'operator' => '==',
2118 ],
2119 [
2120 'item' => 'modules.shopify_checkout.shop_continue_btn',
2121 'value' => 'on',
2122 'operator' => '==',
2123 ],
2124 ],
2125 ],
2126 ],
2127 'next_button_height' => [
2128 'id' => 'next_button_height',
2129 'isPro' => ! rtsb()->has_pro(),
2130 'label' => esc_html__( 'Height (px)', 'shopbuilder' ),
2131 'type' => 'slider',
2132 'min' => 10,
2133 'max' => 100,
2134 'unit' => 'px',
2135 'value' => 50,
2136 'tab' => 'btn-styles',
2137 'dependency' => [
2138 'rules' => [
2139 [
2140 'item' => 'modules.shopify_checkout.enable_multi_step',
2141 'value' => 'on',
2142 'operator' => '==',
2143 ],
2144 [
2145 'item' => 'modules.shopify_checkout.shop_continue_btn',
2146 'value' => 'on',
2147 'operator' => '==',
2148 ],
2149 ],
2150 ],
2151 ],
2152 'next_button_width' => [
2153 'id' => 'next_button_width',
2154 'label' => esc_html__( 'Width (px)', 'shopbuilder' ),
2155 'type' => 'slider',
2156 'min' => 10,
2157 'max' => 1000,
2158 'unit' => 'px',
2159 'tab' => 'btn-styles',
2160 'dependency' => [
2161 'rules' => [
2162 [
2163 'item' => 'modules.shopify_checkout.enable_multi_step',
2164 'value' => 'on',
2165 'operator' => '==',
2166 ],
2167 [
2168 'item' => 'modules.shopify_checkout.shop_continue_btn',
2169 'value' => 'on',
2170 'operator' => '==',
2171 ],
2172 ],
2173 ],
2174 ],
2175 'next_button_font_size' => [
2176 'id' => 'next_button_font_size',
2177 'isPro' => ! rtsb()->has_pro(),
2178 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2179 'type' => 'slider',
2180 'min' => 10,
2181 'max' => 50,
2182 'unit' => 'px',
2183 'value' => 15,
2184 'tab' => 'btn-styles',
2185 'dependency' => [
2186 'rules' => [
2187 [
2188 'item' => 'modules.shopify_checkout.enable_multi_step',
2189 'value' => 'on',
2190 'operator' => '==',
2191 ],
2192 [
2193 'item' => 'modules.shopify_checkout.shop_continue_btn',
2194 'value' => 'on',
2195 'operator' => '==',
2196 ],
2197 ],
2198 ],
2199 ],
2200 'next_button_bg_color' => [
2201 'id' => 'next_button_bg_color',
2202 'isPro' => ! rtsb()->has_pro(),
2203 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
2204 'tab' => 'btn-styles',
2205 'type' => 'color',
2206 'dependency' => [
2207 'rules' => [
2208 [
2209 'item' => 'modules.shopify_checkout.enable_multi_step',
2210 'value' => 'on',
2211 'operator' => '==',
2212 ],
2213 [
2214 'item' => 'modules.shopify_checkout.shop_continue_btn',
2215 'value' => 'on',
2216 'operator' => '==',
2217 ],
2218 ],
2219 ],
2220 ],
2221 'next_button_hover_bg_color' => [
2222 'id' => 'next_button_hover_bg_color',
2223 'isPro' => ! rtsb()->has_pro(),
2224 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2225 'tab' => 'btn-styles',
2226 'type' => 'color',
2227 'dependency' => [
2228 'rules' => [
2229 [
2230 'item' => 'modules.shopify_checkout.enable_multi_step',
2231 'value' => 'on',
2232 'operator' => '==',
2233 ],
2234 [
2235 'item' => 'modules.shopify_checkout.shop_continue_btn',
2236 'value' => 'on',
2237 'operator' => '==',
2238 ],
2239 ],
2240 ],
2241 ],
2242 'next_button_color' => [
2243 'id' => 'next_button_color',
2244 'isPro' => ! rtsb()->has_pro(),
2245 'label' => esc_html__( 'Color', 'shopbuilder' ),
2246 'tab' => 'btn-styles',
2247 'type' => 'color',
2248 'dependency' => [
2249 'rules' => [
2250 [
2251 'item' => 'modules.shopify_checkout.enable_multi_step',
2252 'value' => 'on',
2253 'operator' => '==',
2254 ],
2255 [
2256 'item' => 'modules.shopify_checkout.shop_continue_btn',
2257 'value' => 'on',
2258 'operator' => '==',
2259 ],
2260 ],
2261 ],
2262 ],
2263 'next_button_hover_color' => [
2264 'id' => 'next_button_hover_color',
2265 'isPro' => ! rtsb()->has_pro(),
2266 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2267 'tab' => 'btn-styles',
2268 'type' => 'color',
2269 'dependency' => [
2270 'rules' => [
2271 [
2272 'item' => 'modules.shopify_checkout.enable_multi_step',
2273 'value' => 'on',
2274 'operator' => '==',
2275 ],
2276 [
2277 'item' => 'modules.shopify_checkout.shop_continue_btn',
2278 'value' => 'on',
2279 'operator' => '==',
2280 ],
2281 ],
2282 ],
2283 ],
2284 'next_button_border_color' => [
2285 'id' => 'next_button_border_color',
2286 'isPro' => ! rtsb()->has_pro(),
2287 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2288 'tab' => 'btn-styles',
2289 'type' => 'color',
2290 'dependency' => [
2291 'rules' => [
2292 [
2293 'item' => 'modules.shopify_checkout.enable_multi_step',
2294 'value' => 'on',
2295 'operator' => '==',
2296 ],
2297 [
2298 'item' => 'modules.shopify_checkout.shop_continue_btn',
2299 'value' => 'on',
2300 'operator' => '==',
2301 ],
2302 ],
2303 ],
2304 ],
2305 'next_button_hover_border_color' => [
2306 'id' => 'next_button_hover_border_color',
2307 'isPro' => ! rtsb()->has_pro(),
2308 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2309 'tab' => 'btn-styles',
2310 'type' => 'color',
2311 'dependency' => [
2312 'rules' => [
2313 [
2314 'item' => 'modules.shopify_checkout.enable_multi_step',
2315 'value' => 'on',
2316 'operator' => '==',
2317 ],
2318 [
2319 'item' => 'modules.shopify_checkout.shop_continue_btn',
2320 'value' => 'on',
2321 'operator' => '==',
2322 ],
2323 ],
2324 ],
2325 ],
2326 'prev_button_styles_settings' => [
2327 'id' => 'prev_button_styles_settings',
2328 'type' => 'title',
2329 'tab' => 'btn-styles',
2330 'label' => esc_html__( 'Prev Button Style', 'shopbuilder' ),
2331 'dependency' => [
2332 'rules' => [
2333 [
2334 'item' => 'modules.shopify_checkout.enable_multi_step',
2335 'value' => 'on',
2336 'operator' => '==',
2337 ],
2338 [
2339 'item' => 'modules.shopify_checkout.shop_return_btn',
2340 'value' => 'on',
2341 'operator' => '==',
2342 ],
2343 ],
2344 ],
2345
2346 ],
2347 'prev_button_height' => [
2348 'id' => 'prev_button_height',
2349 'isPro' => ! rtsb()->has_pro(),
2350 'label' => esc_html__( 'Height (px)', 'shopbuilder' ),
2351 'type' => 'slider',
2352 'min' => 10,
2353 'max' => 100,
2354 'unit' => 'px',
2355 'value' => 50,
2356 'tab' => 'btn-styles',
2357 'dependency' => [
2358 'rules' => [
2359 [
2360 'item' => 'modules.shopify_checkout.enable_multi_step',
2361 'value' => 'on',
2362 'operator' => '==',
2363 ],
2364 [
2365 'item' => 'modules.shopify_checkout.shop_return_btn',
2366 'value' => 'on',
2367 'operator' => '==',
2368 ],
2369 ],
2370 ],
2371 ],
2372 'prev_button_width' => [
2373 'id' => 'prev_button_width',
2374 'label' => esc_html__( 'Width (px)', 'shopbuilder' ),
2375 'type' => 'slider',
2376 'min' => 10,
2377 'max' => 1000,
2378 'unit' => 'px',
2379 'tab' => 'btn-styles',
2380 'dependency' => [
2381 'rules' => [
2382 [
2383 'item' => 'modules.shopify_checkout.enable_multi_step',
2384 'value' => 'on',
2385 'operator' => '==',
2386 ],
2387 [
2388 'item' => 'modules.shopify_checkout.shop_return_btn',
2389 'value' => 'on',
2390 'operator' => '==',
2391 ],
2392 ],
2393 ],
2394 ],
2395 'prev_button_font_size' => [
2396 'id' => 'prev_button_font_size',
2397 'isPro' => ! rtsb()->has_pro(),
2398 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2399 'type' => 'slider',
2400 'min' => 10,
2401 'max' => 50,
2402 'unit' => 'px',
2403 'value' => 15,
2404 'tab' => 'btn-styles',
2405 'dependency' => [
2406 'rules' => [
2407 [
2408 'item' => 'modules.shopify_checkout.enable_multi_step',
2409 'value' => 'on',
2410 'operator' => '==',
2411 ],
2412 [
2413 'item' => 'modules.shopify_checkout.shop_return_btn',
2414 'value' => 'on',
2415 'operator' => '==',
2416 ],
2417 ],
2418 ],
2419 ],
2420 'prev_button_bg_color' => [
2421 'id' => 'prev_button_bg_color',
2422 'isPro' => ! rtsb()->has_pro(),
2423 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
2424 'tab' => 'btn-styles',
2425 'type' => 'color',
2426 'dependency' => [
2427 'rules' => [
2428 [
2429 'item' => 'modules.shopify_checkout.enable_multi_step',
2430 'value' => 'on',
2431 'operator' => '==',
2432 ],
2433 [
2434 'item' => 'modules.shopify_checkout.shop_return_btn',
2435 'value' => 'on',
2436 'operator' => '==',
2437 ],
2438 ],
2439 ],
2440 ],
2441 'prev_button_hover_bg_color' => [
2442 'id' => 'prev_button_hover_bg_color',
2443 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2444 'isPro' => ! rtsb()->has_pro(),
2445 'tab' => 'btn-styles',
2446 'type' => 'color',
2447 'dependency' => [
2448 'rules' => [
2449 [
2450 'item' => 'modules.shopify_checkout.enable_multi_step',
2451 'value' => 'on',
2452 'operator' => '==',
2453 ],
2454 [
2455 'item' => 'modules.shopify_checkout.shop_return_btn',
2456 'value' => 'on',
2457 'operator' => '==',
2458 ],
2459 ],
2460 ],
2461 ],
2462 'prev_button_color' => [
2463 'id' => 'prev_button_color',
2464 'label' => esc_html__( 'Color', 'shopbuilder' ),
2465 'isPro' => ! rtsb()->has_pro(),
2466 'tab' => 'btn-styles',
2467 'type' => 'color',
2468 'dependency' => [
2469 'rules' => [
2470 [
2471 'item' => 'modules.shopify_checkout.enable_multi_step',
2472 'value' => 'on',
2473 'operator' => '==',
2474 ],
2475 [
2476 'item' => 'modules.shopify_checkout.shop_return_btn',
2477 'value' => 'on',
2478 'operator' => '==',
2479 ],
2480 ],
2481 ],
2482 ],
2483 'prev_button_hover_color' => [
2484 'id' => 'prev_button_hover_color',
2485 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2486 'isPro' => ! rtsb()->has_pro(),
2487 'tab' => 'btn-styles',
2488 'type' => 'color',
2489 'dependency' => [
2490 'rules' => [
2491 [
2492 'item' => 'modules.shopify_checkout.enable_multi_step',
2493 'value' => 'on',
2494 'operator' => '==',
2495 ],
2496 [
2497 'item' => 'modules.shopify_checkout.shop_return_btn',
2498 'value' => 'on',
2499 'operator' => '==',
2500 ],
2501 ],
2502 ],
2503 ],
2504 'prev_button_border_color' => [
2505 'id' => 'prev_button_border_color',
2506 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2507 'isPro' => ! rtsb()->has_pro(),
2508 'tab' => 'btn-styles',
2509 'type' => 'color',
2510 'dependency' => [
2511 'rules' => [
2512 [
2513 'item' => 'modules.shopify_checkout.enable_multi_step',
2514 'value' => 'on',
2515 'operator' => '==',
2516 ],
2517 [
2518 'item' => 'modules.shopify_checkout.shop_return_btn',
2519 'value' => 'on',
2520 'operator' => '==',
2521 ],
2522 ],
2523 ],
2524 ],
2525 'prev_button_hover_border_color' => [
2526 'id' => 'prev_button_hover_border_color',
2527 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2528 'isPro' => ! rtsb()->has_pro(),
2529 'tab' => 'btn-styles',
2530 'type' => 'color',
2531 'dependency' => [
2532 'rules' => [
2533 [
2534 'item' => 'modules.shopify_checkout.enable_multi_step',
2535 'value' => 'on',
2536 'operator' => '==',
2537 ],
2538 [
2539 'item' => 'modules.shopify_checkout.shop_return_btn',
2540 'value' => 'on',
2541 'operator' => '==',
2542 ],
2543 ],
2544 ],
2545 ],
2546 'coupon_button_styles_settings' => [
2547 'id' => 'coupon_button_styles_settings',
2548 'type' => 'title',
2549 'tab' => 'btn-styles',
2550 'label' => esc_html__( 'Apply Coupon Button Style', 'shopbuilder' ),
2551 ],
2552 'coupon_height' => [
2553 'id' => 'coupon_height',
2554 'label' => esc_html__( 'Coupon Field And Button Height (px)', 'shopbuilder' ),
2555 'type' => 'slider',
2556 'min' => 10,
2557 'max' => 100,
2558 'unit' => 'px',
2559 'value' => 50,
2560 'tab' => 'btn-styles',
2561 ],
2562 'coupon_button_font_size' => [
2563 'id' => 'coupon_button_font_size',
2564 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2565 'type' => 'slider',
2566 'min' => 10,
2567 'max' => 50,
2568 'unit' => 'px',
2569 'value' => 15,
2570 'tab' => 'btn-styles',
2571 ],
2572 'coupon_button_bg_color' => [
2573 'id' => 'coupon_button_bg_color',
2574 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
2575 'tab' => 'btn-styles',
2576 'type' => 'color',
2577 ],
2578 'coupon_button_hover_bg_color' => [
2579 'id' => 'coupon_button_hover_bg_color',
2580 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2581 'tab' => 'btn-styles',
2582 'type' => 'color',
2583 ],
2584 'coupon_button_color' => [
2585 'id' => 'coupon_button_color',
2586 'label' => esc_html__( 'Color', 'shopbuilder' ),
2587 'tab' => 'btn-styles',
2588 'type' => 'color',
2589 ],
2590 'coupon_button_hover_color' => [
2591 'id' => 'coupon_button_hover_color',
2592 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2593 'tab' => 'btn-styles',
2594 'type' => 'color',
2595 ],
2596 'coupon_button_border_color' => [
2597 'id' => 'coupon_button_border_color',
2598 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2599 'tab' => 'btn-styles',
2600 'type' => 'color',
2601 ],
2602 'coupon_button_hover_border_color' => [
2603 'id' => 'coupon_button_hover_border_color',
2604 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2605 'tab' => 'btn-styles',
2606 'type' => 'color',
2607 ],
2608
2609 'header_cart_icon_styles' => [
2610 'id' => 'header_cart_icon_styles',
2611 'type' => 'title',
2612 'tab' => 'styles',
2613 'label' => esc_html__( 'Header Cart Icon Style', 'shopbuilder' ),
2614 'dependency' => [
2615 'rules' => [
2616 [
2617 'item' => 'modules.shopify_checkout.cart_icon_source',
2618 'value' => 'none',
2619 'operator' => '!=',
2620 ],
2621 ],
2622 ],
2623 ],
2624
2625 'shopify_cart_icon_height' => [
2626 'id' => 'shopify_cart_icon_height',
2627 'label' => esc_html__( 'Cart Icon Height (px)', 'shopbuilder' ),
2628 'type' => 'slider',
2629 'min' => 10,
2630 'max' => 200,
2631 'unit' => 'px',
2632 'value' => 40,
2633 'tab' => 'styles',
2634 'dependency' => [
2635 'rules' => [
2636 [
2637 'item' => 'modules.shopify_checkout.cart_icon_source',
2638 'value' => 'upload_icon',
2639 'operator' => '==',
2640 ],
2641 ],
2642 ],
2643 ],
2644
2645 'header_cart_icon_color' => [
2646 'id' => 'step_menu_color',
2647 'label' => esc_html__( 'Color', 'shopbuilder' ),
2648 'tab' => 'styles',
2649 'type' => 'color',
2650 'dependency' => [
2651 'rules' => [
2652 [
2653 'item' => 'modules.shopify_checkout.cart_icon_source',
2654 'value' => 'select_icon',
2655 'operator' => '==',
2656 ],
2657 ],
2658 ],
2659 ],
2660 'header_cart_icon_hover_color' => [
2661 'id' => 'header_cart_icon_hover_color',
2662 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2663 'tab' => 'styles',
2664 'type' => 'color',
2665 'dependency' => [
2666 'rules' => [
2667 [
2668 'item' => 'modules.shopify_checkout.cart_icon_source',
2669 'value' => 'select_icon',
2670 'operator' => '==',
2671 ],
2672 ],
2673 ],
2674 ],
2675 'header_cart_icon_font_size' => [
2676 'id' => 'header_cart_icon_font_size',
2677 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2678 'type' => 'slider',
2679 'min' => 10,
2680 'max' => 50,
2681 'unit' => 'px',
2682 'value' => 15,
2683 'tab' => 'styles',
2684 'dependency' => [
2685 'rules' => [
2686 [
2687 'item' => 'modules.shopify_checkout.cart_icon_source',
2688 'value' => 'select_icon',
2689 'operator' => '==',
2690 ],
2691 ],
2692 ],
2693 ],
2694 'footer_menu_styles_settings' => [
2695 'id' => 'footer_menu_styles_settings',
2696 'type' => 'title',
2697 'tab' => 'styles',
2698 'label' => esc_html__( 'Footer Style', 'shopbuilder' ),
2699 ],
2700 'footer_menu_color' => [
2701 'id' => 'footer_menu_color',
2702 'label' => esc_html__( 'Menu Color', 'shopbuilder' ),
2703 'tab' => 'styles',
2704 'type' => 'color',
2705 ],
2706 'footer_menu_hover_color' => [
2707 'id' => 'footer_menu_hover_color',
2708 'label' => esc_html__( 'Menu Hover Color', 'shopbuilder' ),
2709 'tab' => 'styles',
2710 'type' => 'color',
2711 ],
2712 'footer_menu_font_size' => [
2713 'id' => 'footer_menu_font_size',
2714 'label' => esc_html__( 'Menu Font Size (px)', 'shopbuilder' ),
2715 'type' => 'slider',
2716 'min' => 10,
2717 'max' => 50,
2718 'unit' => 'px',
2719 'value' => 15,
2720 'tab' => 'styles',
2721 ],
2722 'footer_text_size' => [
2723 'id' => 'footer_text_size',
2724 'label' => esc_html__( 'Footer Text Font Size (px)', 'shopbuilder' ),
2725 'type' => 'slider',
2726 'min' => 10,
2727 'max' => 50,
2728 'unit' => 'px',
2729 'value' => 15,
2730 'tab' => 'styles',
2731 ],
2732 'footer_text_color' => [
2733 'id' => 'footer_text_color',
2734 'label' => esc_html__( 'Footer Text Color', 'shopbuilder' ),
2735 'tab' => 'styles',
2736 'type' => 'color',
2737 ],
2738 'step_menu_styles_settings' => [
2739 'id' => 'step_menu_styles_settings',
2740 'type' => 'title',
2741 'tab' => 'styles',
2742 'label' => esc_html__( 'Step Menu Style', 'shopbuilder' ),
2743 'dependency' => [
2744 'rules' => [
2745 [
2746 'item' => 'modules.shopify_checkout.enable_multi_step',
2747 'value' => 'on',
2748 'operator' => '==',
2749 ],
2750 [
2751 'item' => 'modules.shopify_checkout.show_step_menu',
2752 'value' => 'on',
2753 'operator' => '==',
2754 ],
2755 ],
2756 ],
2757 ],
2758 'step_menu_color' => [
2759 'id' => 'step_menu_color',
2760 'label' => esc_html__( 'Color', 'shopbuilder' ),
2761 'isPro' => ! rtsb()->has_pro(),
2762 'tab' => 'styles',
2763 'type' => 'color',
2764 'dependency' => [
2765 'rules' => [
2766 [
2767 'item' => 'modules.shopify_checkout.enable_multi_step',
2768 'value' => 'on',
2769 'operator' => '==',
2770 ],
2771 [
2772 'item' => 'modules.shopify_checkout.show_step_menu',
2773 'value' => 'on',
2774 'operator' => '==',
2775 ],
2776 ],
2777 ],
2778 ],
2779 'step_menu_hover_color' => [
2780 'id' => 'step_menu_hover_color',
2781 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2782 'isPro' => ! rtsb()->has_pro(),
2783 'tab' => 'styles',
2784 'type' => 'color',
2785 'dependency' => [
2786 'rules' => [
2787 [
2788 'item' => 'modules.shopify_checkout.enable_multi_step',
2789 'value' => 'on',
2790 'operator' => '==',
2791 ],
2792 [
2793 'item' => 'modules.shopify_checkout.show_step_menu',
2794 'value' => 'on',
2795 'operator' => '==',
2796 ],
2797 ],
2798 ],
2799 ],
2800 'step_menu_font_size' => [
2801 'id' => 'step_menu_font_size',
2802 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2803 'isPro' => ! rtsb()->has_pro(),
2804 'type' => 'slider',
2805 'min' => 10,
2806 'max' => 50,
2807 'unit' => 'px',
2808 'value' => 15,
2809 'tab' => 'styles',
2810 'dependency' => [
2811 'rules' => [
2812 [
2813 'item' => 'modules.shopify_checkout.enable_multi_step',
2814 'value' => 'on',
2815 'operator' => '==',
2816 ],
2817 [
2818 'item' => 'modules.shopify_checkout.show_step_menu',
2819 'value' => 'on',
2820 'operator' => '==',
2821 ],
2822 ],
2823 ],
2824 ],
2825 ];
2826 return $fields;
2827 }
2828 /**
2829 * @return array
2830 */
2831 public function product_badges_fields() {
2832 return apply_filters(
2833 'rtsb/module/product_badges/fields',
2834 [
2835 'hide_woocommerce_badge' => [
2836 'id' => 'hide_woocommerce_badge',
2837 'value' => '',
2838 'type' => 'switch',
2839 'label' => esc_html__( 'Hide Theme Badges', 'shopbuilder' ),
2840 'help' => esc_html__( 'Switch on to hide theme default badges.', 'shopbuilder' ),
2841 'tab' => 'general',
2842 ],
2843 // Hide "On sale".
2844 'hide_on_sale' => [
2845 'id' => 'hide_on_sale',
2846 'type' => 'select',
2847 'value' => 'all_products',
2848 'isPro' => ! rtsb()->has_pro(),
2849 'label' => esc_html__( 'Applicable Products', 'shopbuilder' ),
2850 'options' => [
2851 'all_products' => esc_html__( 'All products', 'shopbuilder' ),
2852 'where_custom_badge_applied' => esc_html__( 'Only for products which have custom badge enabled', 'shopbuilder' ),
2853 ],
2854 'help' => esc_html__( 'Choose where to hide the default badges.', 'shopbuilder' ),
2855 'tab' => 'general',
2856 'dependency' => [
2857 'rules' => [
2858 [
2859 'item' => 'modules.product_badges.hide_woocommerce_badge',
2860 'value' => 'on',
2861 'operator' => '==',
2862 ],
2863 ],
2864 ],
2865 ],
2866
2867 'group_badge_display_as' => [
2868 'id' => 'group_badge_display_as',
2869 'type' => 'select',
2870 'value' => 'horizontal',
2871 'isPro' => ! rtsb()->has_pro(),
2872 'label' => esc_html__( 'Group Badge Display Type', 'shopbuilder' ),
2873 'help' => sprintf(
2874 // translators: %s for pro message.
2875 esc_html__( 'Please choose the group display type. %s', 'shopbuilder' ),
2876 ! rtsb()->has_pro()
2877 ? sprintf(
2878 '<a target="_blank" href="%s">%s </a> %s ',
2879 esc_url( rtsb()->pro_version_link() ),
2880 esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
2881 esc_html__( 'for vertical layout.', 'shopbuilder' )
2882 )
2883 : ''
2884 ),
2885 'options' => [
2886 'horizontal' => esc_html__( 'Horizontal', 'shopbuilder' ),
2887 'vertical' => esc_html__( 'Vertical', 'shopbuilder' ),
2888 ],
2889 'tab' => 'group',
2890 ],
2891 'group_badge_gap' => [
2892 'id' => 'group_badge_gap',
2893 'type' => 'text',
2894 'value' => '10px',
2895 'label' => esc_html__( 'Group Badge Gap/Spacing', 'shopbuilder' ),
2896 'help' => esc_html__( 'Example: 10px', 'shopbuilder' ),
2897 'tab' => 'group',
2898 ],
2899 'general_options' => [
2900 'id' => 'general_options',
2901 'type' => 'title',
2902 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder' ),
2903 'tab' => 'group',
2904 ],
2905 'loop_group_position' => [
2906 'id' => 'loop_group_position',
2907 'type' => 'select',
2908 'value' => 'above_image',
2909 'isPro' => ! rtsb()->has_pro(),
2910 'label' => esc_html__( 'Shop Page Group Position', 'shopbuilder' ),
2911 'help' => esc_html__( 'Choose the group badges position in Shop page.', 'shopbuilder' ),
2912 'options' => [
2913 'above_image' => esc_html__( 'Floating Above Image', 'shopbuilder' ),
2914 'before_product_title' => esc_html__( 'Before Product Title', 'shopbuilder' ),
2915 'after_product_title' => esc_html__( 'After Product Title', 'shopbuilder' ),
2916 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
2917 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
2918 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
2919 ],
2920 'tab' => 'group',
2921 ],
2922 'loop_custom_hook_name' => [
2923 'id' => 'loop_custom_hook_name',
2924 'type' => 'text',
2925 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
2926 'tab' => 'group',
2927 'help' => sprintf(
2928 /* translators: 1: The shortcode.*/
2929 __( 'Or Copy the php code <br />%1$s<br /> and paste it in your product query where you want to show the button.', 'shopbuilder' ),
2930 "<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>"
2931 ),
2932 'dependency' => [
2933 'rules' => [
2934 [
2935 'item' => 'modules.product_badges.loop_group_position',
2936 'value' => 'custom',
2937 'operator' => '==',
2938 ],
2939 ],
2940 ],
2941 ],
2942 /*
2943 'loop_priority_note' => [
2944 'type' => 'raw',
2945 'label' => ' ',
2946 '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>',
2947 'dependency' => [
2948 'rules' => [
2949 [
2950 'item' => 'modules.product_badges.loop_group_position',
2951 'value' => 'above_image',
2952 'operator' => '!=',
2953 ],
2954 ],
2955 ],
2956 'tab' => 'group',
2957 ],
2958 */
2959 'group_position_hook_priority' => [
2960 'id' => 'group_position_hook_priority',
2961 'type' => 'number',
2962 'size' => 'small',
2963 'min' => 0,
2964 'max' => 999,
2965 'label' => esc_html__( 'Badge Position Priority', 'shopbuilder' ),
2966 'help' => esc_html__( 'It\'s depend on your theme functionality. Example: 20', 'shopbuilder' ),
2967 'tab' => 'group',
2968 'dependency' => [
2969 'rules' => [
2970 [
2971 'item' => 'modules.product_badges.loop_group_position',
2972 'value' => 'custom',
2973 'operator' => '==',
2974 ],
2975 ],
2976 ],
2977 ],
2978 'group_badge_position' => [
2979 'id' => 'group_badge_position',
2980 'label' => esc_html__( 'Position Above Image', 'shopbuilder' ),
2981 'type' => 'text_select',
2982 'value' => 'top-left',
2983 'options' => [
2984 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
2985 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
2986 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
2987 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
2988 ],
2989 'dependency' => [
2990 'rules' => [
2991 [
2992 'item' => 'modules.product_badges.loop_group_position',
2993 'value' => 'above_image',
2994 'operator' => '==',
2995 ],
2996 ],
2997 ],
2998 'tab' => 'group',
2999 ],
3000 'product_options' => [
3001 'id' => 'product_options',
3002 'type' => 'title',
3003 'label' => esc_html__( 'Product Page Settings', 'shopbuilder' ),
3004 'tab' => 'group',
3005 ],
3006 'product_page_group_position' => [
3007 'id' => 'product_page_group_position',
3008 'type' => 'select',
3009 'value' => 'above_image',
3010 'isPro' => ! rtsb()->has_pro(),
3011 'label' => esc_html__( 'Product Page Group Position', 'shopbuilder' ),
3012 'help' => esc_html__( 'Choose the group badges position in product page.', 'shopbuilder' ),
3013 'options' => [
3014 'above_image' => esc_html__( 'Floating Above Image', 'shopbuilder' ),
3015 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
3016 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
3017 'after_summary' => esc_html__( 'After Summary', 'shopbuilder' ),
3018 'after_short_desc' => esc_html__( 'After Short Description', 'shopbuilder' ),
3019 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
3020 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
3021 ],
3022 'tab' => 'group',
3023 ],
3024 'product_page_badges_shortcode' => [
3025 'type' => 'raw',
3026 'label' => ' ',
3027 'html' => sprintf(
3028 /* translators: 1: The shortcode.*/
3029 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' ),
3030 '<code>[rtsb_badges]</code>'
3031 ),
3032 'dependency' => [
3033 'rules' => [
3034 [
3035 'item' => 'modules.product_badges.product_page_group_position',
3036 'value' => 'shortcode',
3037 'operator' => '==',
3038 ],
3039 ],
3040 ],
3041 'tab' => 'group',
3042 ],
3043 'product_page_custom_hook_name' => [
3044 'id' => 'product_page_custom_hook_name',
3045 'type' => 'text',
3046 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
3047 'tab' => 'group',
3048 'help' => sprintf(
3049 /* translators: 1: The shortcode.*/
3050 __( 'Or Copy the php code <br />%1$s<br /> and paste it in your product query where you want to show the button.', 'shopbuilder' ),
3051 "<code>&lt;?php do_action( 'rtsb/modules/product_badges/frontend/display' ); ?&gt;</code>"
3052 ),
3053 'dependency' => [
3054 'rules' => [
3055 [
3056 'item' => 'modules.product_badges.product_page_group_position',
3057 'value' => 'custom',
3058 'operator' => '==',
3059 ],
3060 ],
3061 ],
3062 ],
3063 /*
3064 'product_page_priority_note' => [
3065 'type' => 'raw',
3066 'label' => ' ',
3067 '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>',
3068 'dependency' => [
3069 'rules' => [
3070 [
3071 'item' => 'modules.product_badges.product_page_group_position',
3072 'value' => [ 'above_image', 'shortcode' ],
3073 'operator' => '!in',
3074 ],
3075 ],
3076 ],
3077 'tab' => 'group',
3078 ],
3079 */
3080 'product_page_group_hook_priority' => [
3081 'id' => 'product_page_group_hook_priority',
3082 'type' => 'number',
3083 'size' => 'small',
3084 'min' => 0,
3085 'max' => 999,
3086 'label' => esc_html__( 'Badge Position Priority', 'shopbuilder' ),
3087 'help' => esc_html__( 'It\'s depend on your theme functionality. Example: 20', 'shopbuilder' ),
3088 'tab' => 'group',
3089 'dependency' => [
3090 'rules' => [
3091 [
3092 'item' => 'modules.product_badges.product_page_group_position',
3093 'value' => 'custom',
3094 'operator' => '==',
3095 ],
3096 ],
3097 ],
3098
3099 ],
3100 'product_page_group_badge_position' => [
3101 'id' => 'product_page_group_badge_position',
3102 'label' => esc_html__( 'Position Above Image', 'shopbuilder' ),
3103 'type' => 'text_select',
3104 'value' => 'top-left',
3105 'options' => [
3106 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
3107 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
3108 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
3109 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
3110 ],
3111 'dependency' => [
3112 'rules' => [
3113 [
3114 'item' => 'modules.product_badges.product_page_group_position',
3115 'value' => 'above_image',
3116 'operator' => '==',
3117 ],
3118 ],
3119 ],
3120 'tab' => 'group',
3121 ],
3122
3123 'badges_field_intro' => [
3124 'id' => 'badges_field_intro',
3125 'type' => 'description',
3126 'text' => esc_html__( 'To add new product badges, simply click on the \'Add New\' button below.', 'shopbuilder' ),
3127 'tab' => 'badges',
3128 ],
3129 'badges_field' => [
3130 'id' => 'badges_field',
3131 'type' => 'repeaters',
3132 'label' => '',
3133 'tab' => 'badges',
3134 'repeat' => [
3135
3136 'title' => [
3137 'id' => 'title',
3138 'label' => esc_html__( 'Badge Name', 'shopbuilder' ),
3139 'help' => esc_html__( 'Enter badge name.', 'shopbuilder' ),
3140 'type' => 'text',
3141 'placeholder' => esc_html__( 'Badge Name', 'shopbuilder' ),
3142 'value' => esc_html__( 'Badge Name', 'shopbuilder' ),
3143 ],
3144 'badge_condition' => [
3145 'id' => 'badge_condition',
3146 'type' => 'select',
3147 'value' => 'dynamic',
3148 'isPro' => ! rtsb()->has_pro(),
3149 'label' => esc_html__( 'Badge Type', 'shopbuilder' ),
3150 'help' => sprintf(
3151 // translators: %s for pro message.
3152 esc_html__( 'Select badge type. %s', 'shopbuilder' ),
3153 ! rtsb()->has_pro()
3154 ? sprintf(
3155 '<a target="_blank" href="%s">%s</a> %s',
3156 esc_url( rtsb()->pro_version_link() ),
3157 esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
3158 esc_html__( 'unlock custom badge creation.', 'shopbuilder' )
3159 )
3160 : ''
3161 ),
3162 'options' => [
3163 'dynamic' => esc_html__( 'Dynamic', 'shopbuilder' ),
3164 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
3165 ],
3166 ],
3167 'badge_for' => [
3168 'id' => 'badge_for',
3169 'type' => 'select',
3170 'value' => 'on_sale',
3171 'label' => esc_html__( 'Dynamic Badge Condition', 'shopbuilder' ),
3172 'help' => esc_html__( 'Specify dynamic badge condition', 'shopbuilder' ),
3173 'options' => $this->dynamic_badge_list(),
3174 'dependency' => [
3175 'rules' => [
3176 [
3177 'item' => 'modules.product_badges.badges_field.badge_condition',
3178 'value' => 'dynamic',
3179 'operator' => '==',
3180 ],
3181 ],
3182 ],
3183 ],
3184 'badge_for_pre_order' => [
3185 'type' => 'raw',
3186 'label' => ' ',
3187 'html' => esc_html__( 'Please ensure that Pre-Order module is activated and properly configured.', 'shopbuilder' ),
3188 'tab' => 'general',
3189 'dependency' => [
3190 'rules' => [
3191 [
3192 'item' => 'modules.product_badges.badges_field.badge_condition',
3193 'value' => 'dynamic',
3194 'operator' => '==',
3195 ],
3196 [
3197 'item' => 'modules.product_badges.badges_field.badge_for',
3198 'value' => 'pre_order',
3199 'operator' => '==',
3200 ],
3201 ],
3202 ],
3203 ],
3204 'minimum_sale_count' => [
3205 'id' => 'minimum_sale_count',
3206 'type' => 'number',
3207 'label' => esc_html__( 'Minimum Sale Count', 'shopbuilder' ),
3208 'help' => esc_html__( 'Enter the number of Sale you want to designate for products to be labeled as \'Best Selling.\'', 'shopbuilder' ),
3209 'dependency' => [
3210 'rules' => [
3211 [
3212 'item' => 'modules.product_badges.badges_field.badge_condition',
3213 'value' => 'dynamic',
3214 'operator' => '==',
3215 ],
3216 [
3217 'item' => 'modules.product_badges.badges_field.badge_for',
3218 'value' => 'best_selling',
3219 'operator' => '==',
3220 ],
3221 ],
3222 ],
3223 ],
3224 'new_arrival_days' => [
3225 'id' => 'new_arrival_days',
3226 'type' => 'number',
3227 'label' => esc_html__( 'Specify Number of Days', 'shopbuilder' ),
3228 'help' => esc_html__( 'Enter the number of days you want to designate for products to be labeled as \'New Arrivals.\'', 'shopbuilder' ),
3229 'dependency' => [
3230 'rules' => [
3231 [
3232 'item' => 'modules.product_badges.badges_field.badge_for',
3233 'value' => 'new_arrival',
3234 'operator' => '==',
3235 ],
3236 ],
3237 ],
3238 ],
3239 'badges_type' => [
3240 'id' => 'badges_type',
3241 'type' => 'select',
3242 'value' => 'text',
3243 'isPro' => ! rtsb()->has_pro(),
3244 'label' => esc_html__( 'Show Badge As:', 'shopbuilder' ),
3245 'help' => sprintf(
3246 // translators: %s for pro message.
3247 esc_html__( 'Specify the badge display as Image Or Text. %s', 'shopbuilder' ),
3248 ! rtsb()->has_pro()
3249 ? sprintf(
3250 '<a target="_blank" href="%s">%s</a> %s',
3251 esc_url( rtsb()->pro_version_link() ),
3252 esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
3253 esc_html__( 'unlock Image badge creation.', 'shopbuilder' )
3254 )
3255 : ''
3256 ),
3257 'options' => [
3258 'image' => esc_html__( 'Image', 'shopbuilder' ),
3259 'text' => esc_html__( 'Text', 'shopbuilder' ),
3260 ],
3261 ],
3262
3263 'badge_preset' => [
3264 'id' => 'badge_preset',
3265 'label' => esc_html__( 'Text Badge Preset', 'shopbuilder' ),
3266 'help' => esc_html__( 'Choose the badge appearance', 'shopbuilder' ),
3267 'type' => 'image_select',
3268 'value' => 'preset1',
3269 'options' => [
3270 'preset1' => [
3271 'label' => esc_html__( 'Preset 1', 'shopbuilder' ),
3272 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-1.png' ) ),
3273 ],
3274
3275 'preset2' => [
3276 'label' => esc_html__( 'Preset 2', 'shopbuilder' ),
3277 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-2.png' ) ),
3278 ],
3279
3280 'preset3' => [
3281 'label' => esc_html__( 'Preset 3', 'shopbuilder' ),
3282 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-3.png' ) ),
3283 ],
3284
3285 'preset4' => [
3286 'title' => esc_html__( 'Preset 4', 'shopbuilder' ),
3287 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-4.png' ) ),
3288 ],
3289 ],
3290 'dependency' => [
3291 'rules' => [
3292 [
3293 'item' => 'modules.product_badges.badges_field.badges_type',
3294 'value' => 'text',
3295 'operator' => '==',
3296 ],
3297 ],
3298 ],
3299 ],
3300 'badges_text' => [
3301 'id' => 'badges_text',
3302 'label' => esc_html__( 'Enter Badge Text', 'shopbuilder' ),
3303 'help' => esc_html__( 'The badge text will be displayed when the dynamic percentage switch is turned off.', 'shopbuilder' ),
3304 'type' => 'text',
3305 'placeholder' => 'Badge Text',
3306 'value' => esc_html__( 'New', 'shopbuilder' ),
3307 'dependency' => [
3308 'rules' => [
3309 [
3310 'item' => 'modules.product_badges.badges_field.badges_type',
3311 'value' => 'text',
3312 'operator' => '==',
3313 ],
3314 ],
3315 ],
3316 ],
3317 'show_badges_percent_text' => [
3318 'id' => 'show_badges_percent_text',
3319 'type' => 'switch',
3320 // 'isPro' => ! rtsb()->has_pro(),
3321 'label' => esc_html__( 'Show Badges Percentage (%)', 'shopbuilder' ),
3322 'help' => esc_html__( 'Switch on to show badge as dynamic percentage instead of text.', 'shopbuilder' ),
3323 'dependency' => [
3324 'rules' => [
3325 [
3326 'item' => 'modules.product_badges.badges_field.badge_for',
3327 'value' => 'on_sale',
3328 'operator' => '==',
3329 ],
3330 [
3331 'item' => 'modules.product_badges.badges_field.badges_type',
3332 'value' => 'text',
3333 'operator' => '==',
3334 ],
3335 [
3336 'item' => 'modules.product_badges.badges_field.badge_condition',
3337 'value' => 'dynamic',
3338 'operator' => '==',
3339 ],
3340
3341 ],
3342 ],
3343 ],
3344
3345 'upload_image' => [
3346 'id' => 'upload_image',
3347 'type' => 'fileupload',
3348 'label' => esc_html__( 'Upload Image', 'shopbuilder' ),
3349 'help' => esc_html__( 'Upload badge image.', 'shopbuilder' ),
3350 'tab' => 'general',
3351 'dependency' => [
3352 'rules' => [
3353 [
3354 'item' => 'modules.product_badges.badges_field.badges_type',
3355 'value' => 'image',
3356 'operator' => '==',
3357 ],
3358 ],
3359 ],
3360 ],
3361
3362 'apply_for' => [
3363 'id' => 'apply_for',
3364 'type' => 'select',
3365 'value' => 'product',
3366 'isPro' => ! rtsb()->has_pro(),
3367 'label' => esc_html__( 'Applicable For', 'shopbuilder' ),
3368 'options' => [
3369 'product' => esc_html__( 'Products', 'shopbuilder' ),
3370 'product_cat' => esc_html__( 'Product Categories', 'shopbuilder' ),
3371 ],
3372 'help' => esc_html__( 'Badges will apply for selected products, or categories.', 'shopbuilder' ),
3373 ],
3374 'applicable_products' => [
3375 'id' => 'applicable_products',
3376 'type' => 'search_and_multi_select',
3377 'label' => esc_html__( 'Applicable Products', 'shopbuilder' ),
3378 'help' => esc_html__( 'Choose products to include. Leave blank to apply in all product.', 'shopbuilder' ),
3379 'placeholder' => esc_html__( 'Search Products', 'shopbuilder' ),
3380 'func_with_param' => [ Fns::class, 'get_post_types', [ 'post_type' => 'product' ] ],
3381 'options' => Fns::get_post_types( null, [ 'post_type' => 'product' ] ),
3382 'dependency' => [
3383 'rules' => [
3384 [
3385 'item' => 'modules.product_badges.badges_field.apply_for',
3386 'value' => 'product',
3387 'operator' => '==',
3388 ],
3389 ],
3390 ],
3391 ],
3392 'applicable_categories' => [
3393 'id' => 'applicable_categories',
3394 'type' => 'search_and_multi_select',
3395 'label' => esc_html__( 'Applicable Categories', 'shopbuilder' ),
3396 'help' => esc_html__( 'Choose categories to include. Leave blank to apply in all categories.', 'shopbuilder' ),
3397 'placeholder' => esc_html__( 'Search Category', 'shopbuilder' ),
3398 'func_with_param' => [
3399 Fns::class,
3400 'products_category_query',
3401 ],
3402 'options' => Fns::products_category_query(),
3403 'dependency' => [
3404 'rules' => [
3405 [
3406 'item' => 'modules.product_badges.badges_field.apply_for',
3407 'value' => 'product_cat',
3408 'operator' => '==',
3409 ],
3410 ],
3411 ],
3412 ],
3413 'exclude_product' => [
3414 'id' => 'exclude_product',
3415 'type' => 'search_and_multi_select',
3416 'isPro' => ! rtsb()->has_pro(),
3417 'label' => esc_html__( 'Exclude Products', 'shopbuilder' ),
3418 'help' => esc_html__( 'Choose products to exclude. Leave blank to exclude none.', 'shopbuilder' ),
3419 'placeholder' => esc_html__( 'Search Products', 'shopbuilder' ),
3420 'func_with_param' => [ Fns::class, 'get_post_types', [ 'post_type' => 'product' ] ],
3421 'options' => Fns::get_post_types( null, [ 'post_type' => 'product' ] ),
3422 ],
3423
3424 /**
3425 * Style Settings
3426 */
3427 'styles_settings' => [
3428 'id' => 'styles_settings',
3429 'type' => 'title',
3430 'label' => esc_html__( 'Style Settings', 'shopbuilder' ),
3431 ],
3432 'badge_text_color' => [
3433 'id' => 'badge_text_color',
3434 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
3435 'type' => 'color',
3436 'dependency' => [
3437 'rules' => [
3438 [
3439 'item' => 'modules.product_badges.badges_field.badges_type',
3440 'value' => 'text',
3441 'operator' => '==',
3442 ],
3443 ],
3444 ],
3445 ],
3446 'badge_bg_color' => [
3447 'id' => 'badge_bg_color',
3448 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
3449 'type' => 'color',
3450 'dependency' => [
3451 'rules' => [
3452 [
3453 'item' => 'modules.product_badges.badges_field.badges_type',
3454 'value' => 'text',
3455 'operator' => '==',
3456 ],
3457 [
3458 'item' => 'modules.product_badges.badges_field.badges_type',
3459 'value' => 'text',
3460 'operator' => '==',
3461 ],
3462 [
3463 'item' => 'modules.product_badges.badges_field.badge_preset',
3464 'value' => [ 'preset1', 'preset2' ],
3465 'operator' => 'in',
3466 ],
3467 ],
3468 ],
3469 ],
3470 'badge_border_color' => [
3471 'id' => 'badge_border_color',
3472 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
3473 'type' => 'color',
3474 'dependency' => [
3475 'rules' => [
3476 [
3477 'item' => 'modules.product_badges.badges_field.badges_type',
3478 'value' => 'text',
3479 'operator' => '==',
3480 ],
3481 [
3482 'item' => 'modules.product_badges.badges_field.badges_type',
3483 'value' => 'text',
3484 'operator' => '==',
3485 ],
3486 [
3487 'item' => 'modules.product_badges.badges_field.badge_preset',
3488 'value' => [ 'preset3', 'preset4' ],
3489 'operator' => 'in',
3490 ],
3491 ],
3492 ],
3493 ],
3494 'badge_font_size' => [
3495 'id' => 'badge_font_size',
3496 'type' => 'text',
3497 'label' => esc_html__( 'Font Size', 'shopbuilder' ),
3498 'help' => esc_html__( 'Example: 14px', 'shopbuilder' ),
3499 'dependency' => [
3500 'rules' => [
3501 [
3502 'item' => 'modules.product_badges.badges_field.badges_type',
3503 'value' => 'text',
3504 'operator' => '==',
3505 ],
3506 ],
3507 ],
3508 ],
3509 'badge_font_width' => [
3510 'id' => 'badge_font_width',
3511 'type' => 'select',
3512 'value' => '400',
3513 'label' => esc_html__( 'Font Weight', 'shopbuilder' ),
3514 'options' => [
3515 '100' => '100',
3516 '200' => '200',
3517 '300' => '300',
3518 '400' => '400',
3519 '500' => '500',
3520 '600' => '600',
3521 '700' => '700',
3522 '800' => '800',
3523 '900' => '900',
3524 'normal' => 'normal',
3525 'bold' => 'bold',
3526 'bolder' => 'bolder',
3527 'lighter' => 'lighter',
3528 'initial' => 'initial',
3529 'inherit' => 'inherit',
3530 ],
3531 'dependency' => [
3532 'rules' => [
3533 [
3534 'item' => 'modules.product_badges.badges_field.badges_type',
3535 'value' => 'text',
3536 'operator' => '==',
3537 ],
3538 ],
3539 ],
3540 ],
3541 'badge_width' => [
3542 'id' => 'badge_width',
3543 'type' => 'text',
3544 'label' => esc_html__( 'Width', 'shopbuilder' ),
3545 'help' => esc_html__( 'Example: 150px', 'shopbuilder' ),
3546 'dependency' => [
3547 'rules' => [
3548 [
3549 'item' => 'modules.product_badges.badges_field.badges_type',
3550 'value' => 'image',
3551 'operator' => '==',
3552 ],
3553 ],
3554 ],
3555 ],
3556 'badge_height' => [
3557 'id' => 'badge_height',
3558 'type' => 'text',
3559 'label' => esc_html__( 'Height', 'shopbuilder' ),
3560 'help' => esc_html__( 'Example: 50px', 'shopbuilder' ),
3561 'dependency' => [
3562 'rules' => [
3563 [
3564 'item' => 'modules.product_badges.badges_field.badges_type',
3565 'value' => 'image',
3566 'operator' => '==',
3567 ],
3568 ],
3569 ],
3570 ],
3571 'border_radius' => [
3572 'id' => 'border_radius',
3573 'type' => 'text',
3574 'size' => 'small',
3575 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
3576 'help' => esc_html__( 'Example: 20px 20px 20px 20px Or 20px', 'shopbuilder' ),
3577 'dependency' => [
3578 'rules' => [
3579 [
3580 'item' => 'modules.product_badges.badges_field.badges_type',
3581 'value' => 'text',
3582 'operator' => '==',
3583 ],
3584 ],
3585 ],
3586 ],
3587 'badge_padding' => [
3588 'id' => 'badge_padding',
3589 'type' => 'text',
3590 'size' => 'small',
3591 'label' => esc_html__( 'Padding', 'shopbuilder' ),
3592 'help' => esc_html__( 'Example: 10px 15px 10px 15px', 'shopbuilder' ),
3593 'dependency' => [
3594 'rules' => [
3595 [
3596 'item' => 'modules.product_badges.badges_field.badges_type',
3597 'value' => 'text',
3598 'operator' => '==',
3599 ],
3600 ],
3601 ],
3602 ],
3603 ],
3604 ],
3605
3606 ]
3607 );
3608 }
3609
3610 /**
3611 * Dynamic badge list.
3612 *
3613 * @return array
3614 */
3615 public function dynamic_badge_list() {
3616 $items = [
3617 'on_sale' => esc_html__( 'Products On Sale', 'shopbuilder' ),
3618 'featured' => esc_html__( 'Featured Products', 'shopbuilder' ),
3619 'out_of_stock' => esc_html__( 'Out Of Stock Products', 'shopbuilder' ),
3620 'best_selling' => esc_html__( 'Best Selling Products', 'shopbuilder' ),
3621 'new_arrival' => esc_html__( 'New Arrival Products', 'shopbuilder' ),
3622 ];
3623
3624 if ( rtsb()->has_pro() && method_exists( FnsPro::class, 'is_module_active' ) && FnsPro::is_module_active( 'pre_order' ) ) {
3625 $items['pre_order'] = esc_html__( 'Pre-Order Products', 'shopbuilder' );
3626 }
3627
3628 return $items;
3629 }
3630 }
3631