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

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

3,603 lines 122.3 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' ),
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' ),
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' ),
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 Discount?', 'shopbuilder' ),
1357 'help' => esc_html__( 'Switch on to enable Discount Rules module.', 'shopbuilder' ),
1358 ],
1359 'package' => $this->pro_package(),
1360 'fields' => Fns::pro_version_notice( '1.10.0' ),
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' ),
1375 ]
1376 ),
1377 ];
1378 return apply_filters( 'rtsb/core/modules/raw_list', $list );
1379 }
1380
1381 /**
1382 * Get All Menu
1383 */
1384 public function get_all_menu() {
1385 $manus = [
1386 'none' => esc_html__( 'None', 'shopbuilder' ),
1387 ];
1388 $nav_menus = wp_get_nav_menus();
1389 if ( empty( $nav_menus ) ) {
1390 return $manus;
1391 }
1392 foreach ( $nav_menus as $menu ) {
1393 $manus[ $menu->slug ] = $menu->name;
1394 }
1395 return $manus;
1396 }
1397 /**
1398 * Sticky add-to-cart module options.
1399 *
1400 * @return array
1401 */
1402 public function shopify_checkout_options() {
1403 $notice = [];
1404 if ( defined( 'RTSBPRO_VERSION' ) && version_compare( RTSBPRO_VERSION, '1.8.0', '<' ) ) {
1405 $notice = Fns::pro_version_notice( '1.8.0', 'general', 'ShopBuilder Pro', false );
1406 }
1407 $fields = $notice + [
1408 'general_settings' => [
1409 'id' => 'general_settings',
1410 'type' => 'title',
1411 'label' => esc_html__( 'Settings', 'shopbuilder' ),
1412 'tab' => 'general',
1413 ],
1414 'shopify_page_logo' => [
1415 'id' => 'shopify_page_logo',
1416 'type' => 'fileupload',
1417 'label' => esc_html__( 'Upload Checkout Page Logo', 'shopbuilder' ),
1418 'help' => esc_html__( 'Please upload your custom logo to display on the checkout page.', 'shopbuilder' ),
1419 'tab' => 'general',
1420 ],
1421 'shopify_logo_height' => [
1422 'id' => 'shopify_logo_height',
1423 'label' => esc_html__( 'Logo Height (px)', 'shopbuilder' ),
1424 'help' => esc_html__( 'Specify the height of the checkout page logo in px.', 'shopbuilder' ),
1425 'type' => 'slider',
1426 'min' => 10,
1427 'max' => 200,
1428 'unit' => 'px',
1429 'value' => 40,
1430 'tab' => 'general',
1431 ],
1432 'cart_icon_source' => [
1433 'id' => 'cart_icon_source',
1434 'label' => esc_html__( 'Cart Icon', 'shopbuilder' ),
1435 'help' => sprintf(
1436 // translators: %s for pro message.
1437 __( 'Choose a cart icon to display in your checkout\'s header. <br />%s', 'shopbuilder' ),
1438 ! rtsb()->has_pro()
1439 ? sprintf(
1440 '<a target="_blank" href="%s">%s </a> %s ',
1441 esc_url( rtsb()->pro_version_link() ),
1442 esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
1443 esc_html__( 'to unlock custom image icon.', 'shopbuilder' )
1444 )
1445 : ''
1446 ),
1447 'type' => 'select',
1448 'value' => 'none',
1449 'isPro' => ! rtsb()->has_pro(),
1450 'options' => [
1451 'none' => esc_html__( 'None', 'shopbuilder' ),
1452 'select_icon' => esc_html__( 'Select Icon', 'shopbuilder' ),
1453 'upload_icon' => esc_html__( 'Upload Icon', 'shopbuilder' ),
1454 ],
1455 'tab' => 'general',
1456 ],
1457 'cart_icon' => [
1458 'id' => 'cart_icon',
1459 'label' => esc_html__( 'Select Cart Icon', 'shopbuilder' ),
1460 'help' => esc_html__( 'Please choose the icon.', 'shopbuilder' ),
1461 'type' => 'icon_select',
1462 'searchable' => true,
1463 'options' => Fns::get_icons(),
1464 'value' => 'cart-2',
1465 'tab' => 'general',
1466 'dependency' => [
1467 'rules' => [
1468 [
1469 'item' => 'modules.shopify_checkout.cart_icon_source',
1470 'value' => 'select_icon',
1471 'operator' => '==',
1472 ],
1473 ],
1474 ],
1475 ],
1476
1477 'cart_image_icon' => [
1478 'id' => 'cart_image_icon',
1479 'type' => 'fileupload',
1480 'label' => esc_html__( 'Upload Custom Icon', 'shopbuilder' ),
1481 'help' => esc_html__( 'Please upload your custom image icon.', 'shopbuilder' ),
1482 'tab' => 'general',
1483 'dependency' => [
1484 'rules' => [
1485 [
1486 'item' => 'modules.shopify_checkout.cart_icon_source',
1487 'value' => 'upload_icon',
1488 'operator' => '==',
1489 ],
1490 ],
1491 ],
1492 ],
1493
1494 'email_field_title' => [
1495 'id' => 'email_field_title',
1496 'type' => 'text',
1497 'label' => esc_html__( 'Email Field Section Title', 'shopbuilder' ),
1498 'help' => esc_html__( 'Enter the custom title to be displayed above the email field section.', 'shopbuilder' ),
1499 'value' => esc_html__( 'Contact', 'shopbuilder' ),
1500 'tab' => 'general',
1501 ],
1502
1503 'billing_address_field_title' => [
1504 'id' => 'billing_address_field_title',
1505 'type' => 'text',
1506 'label' => esc_html__( 'Billing Fields Section Title', 'shopbuilder' ),
1507 'help' => esc_html__( 'Enter the custom title to be displayed above the billing fields section', 'shopbuilder' ),
1508 'value' => esc_html__( 'Billing address', 'shopbuilder' ),
1509 'tab' => 'general',
1510 ],
1511
1512 'enable_multi_step' => [
1513 'id' => 'enable_multi_step',
1514 'type' => 'switch',
1515 'isPro' => ! rtsb()->has_pro(),
1516 'label' => esc_html__( 'Multi-Step Checkout', 'shopbuilder' ),
1517 'help' => esc_html__( 'Enable multi-step checkout to simplify the purchasing process.', 'shopbuilder' ),
1518 'tab' => 'multi-step',
1519 ],
1520 'step_menu_settings' => [
1521 'id' => 'step_menu_settings',
1522 'type' => 'title',
1523 'label' => esc_html__( 'Step Settings ', 'shopbuilder' ),
1524 'tab' => 'multi-step',
1525 'dependency' => [
1526 'rules' => [
1527 [
1528 'item' => 'modules.shopify_checkout.enable_multi_step',
1529 'value' => 'on',
1530 'operator' => '==',
1531 ],
1532 ],
1533 ],
1534 ],
1535
1536 'show_step_menu' => [
1537 'id' => 'show_step_menu',
1538 'type' => 'switch',
1539 'isPro' => ! rtsb()->has_pro(),
1540 'label' => esc_html__( 'Show Step Menu', 'shopbuilder' ),
1541 'help' => esc_html__( 'Enable to display the step navigation menu during checkout.', 'shopbuilder' ),
1542 'tab' => 'multi-step',
1543 'value' => 'on',
1544 'dependency' => [
1545 'rules' => [
1546 [
1547 'item' => 'modules.shopify_checkout.enable_multi_step',
1548 'value' => 'on',
1549 'operator' => '==',
1550 ],
1551 ],
1552 ],
1553 ],
1554 'show_cart_menu' => [
1555 'id' => 'show_cart_menu',
1556 'type' => 'switch',
1557 'isPro' => ! rtsb()->has_pro(),
1558 'label' => esc_html__( 'Show Cart Menu', 'shopbuilder' ),
1559 'help' => esc_html__( 'Enable this option to display the cart item in the step menu.', 'shopbuilder' ),
1560 'tab' => 'multi-step',
1561 'dependency' => [
1562 'rules' => [
1563 [
1564 'item' => 'modules.shopify_checkout.enable_multi_step',
1565 'value' => 'on',
1566 'operator' => '==',
1567 ],
1568 [
1569 'item' => 'modules.shopify_checkout.show_step_menu',
1570 'value' => 'on',
1571 'operator' => '==',
1572 ],
1573 ],
1574 ],
1575 ],
1576 'cart_text' => [
1577 'id' => 'cart_text',
1578 'type' => 'text',
1579 'isPro' => ! rtsb()->has_pro(),
1580 'label' => esc_html__( 'Cart Step Title', 'shopbuilder' ),
1581 'help' => esc_html__( 'Enter the cart step menu title.', 'shopbuilder' ),
1582 'value' => esc_html__( 'Cart', 'shopbuilder' ),
1583 'tab' => 'multi-step',
1584 'dependency' => [
1585 'rules' => [
1586 [
1587 'item' => 'modules.shopify_checkout.show_step_menu',
1588 'value' => 'on',
1589 'operator' => '==',
1590 ],
1591 [
1592 'item' => 'modules.shopify_checkout.show_cart_menu',
1593 'value' => 'on',
1594 'operator' => '==',
1595 ],
1596 ],
1597 ],
1598 ],
1599
1600 'billing_text' => [
1601 'id' => 'billing_text',
1602 'type' => 'text',
1603 'isPro' => ! rtsb()->has_pro(),
1604 'label' => esc_html__( 'Billing Step Title', 'shopbuilder' ),
1605 'help' => esc_html__( 'Enter the billing step menu title.', 'shopbuilder' ),
1606 'value' => esc_html__( 'Billing', 'shopbuilder' ),
1607 'tab' => 'multi-step',
1608 'dependency' => [
1609 'rules' => [
1610 [
1611 'item' => 'modules.shopify_checkout.enable_multi_step',
1612 'value' => 'on',
1613 'operator' => '==',
1614 ],
1615 [
1616 'item' => 'modules.shopify_checkout.show_step_menu',
1617 'value' => 'on',
1618 'operator' => '==',
1619 ],
1620 ],
1621 ],
1622 ],
1623
1624 'shipping_text' => [
1625 'id' => 'shipping_text',
1626 'type' => 'text',
1627 'isPro' => ! rtsb()->has_pro(),
1628 'label' => esc_html__( 'Shipping Step Title', 'shopbuilder' ),
1629 'help' => esc_html__( 'Enter the shipping step menu title.', 'shopbuilder' ),
1630 'value' => esc_html__( 'Shipping', 'shopbuilder' ),
1631 'tab' => 'multi-step',
1632 'dependency' => [
1633 'rules' => [
1634 [
1635 'item' => 'modules.shopify_checkout.enable_multi_step',
1636 'value' => 'on',
1637 'operator' => '==',
1638 ],
1639 [
1640 'item' => 'modules.shopify_checkout.show_step_menu',
1641 'value' => 'on',
1642 'operator' => '==',
1643 ],
1644 ],
1645 ],
1646 ],
1647
1648 'shipping_method_text' => [
1649 'id' => 'shipping_method_text',
1650 'type' => 'text',
1651 'isPro' => ! rtsb()->has_pro(),
1652 'label' => esc_html__( 'Shipping Method Step Title', 'shopbuilder' ),
1653 'help' => esc_html__( 'Enter the shipping method step menu title.', 'shopbuilder' ),
1654 'value' => esc_html__( 'Shipping Method ', 'shopbuilder' ),
1655 'tab' => 'multi-step',
1656 'dependency' => [
1657 'rules' => [
1658 [
1659 'item' => 'modules.shopify_checkout.enable_multi_step',
1660 'value' => 'on',
1661 'operator' => '==',
1662 ],
1663 [
1664 'item' => 'modules.shopify_checkout.show_step_menu',
1665 'value' => 'on',
1666 'operator' => '==',
1667 ],
1668 ],
1669 ],
1670 ],
1671
1672 'payment_text' => [
1673 'id' => 'payment_text',
1674 'type' => 'text',
1675 'isPro' => ! rtsb()->has_pro(),
1676 'label' => esc_html__( 'Payment Method Step Title', 'shopbuilder' ),
1677 'help' => esc_html__( 'Enter the payment method step menu title.', 'shopbuilder' ),
1678 'value' => esc_html__( 'Payment', 'shopbuilder' ),
1679 'tab' => 'multi-step',
1680 'dependency' => [
1681 'rules' => [
1682 [
1683 'item' => 'modules.shopify_checkout.enable_multi_step',
1684 'value' => 'on',
1685 'operator' => '==',
1686 ],
1687 [
1688 'item' => 'modules.shopify_checkout.show_step_menu',
1689 'value' => 'on',
1690 'operator' => '==',
1691 ],
1692 ],
1693 ],
1694 ],
1695
1696 'next_button_settings' => [
1697 'id' => 'next_button_settings',
1698 'type' => 'title',
1699 'label' => esc_html__( 'Button Settings', 'shopbuilder' ),
1700 'tab' => 'multi-step',
1701 'dependency' => [
1702 'rules' => [
1703 [
1704 'item' => 'modules.shopify_checkout.enable_multi_step',
1705 'value' => 'on',
1706 'operator' => '==',
1707 ],
1708 ],
1709 ],
1710 ],
1711
1712 'shop_continue_btn' => [
1713 'id' => 'shop_continue_btn',
1714 'type' => 'switch',
1715 'isPro' => ! rtsb()->has_pro(),
1716 'label' => esc_html__( 'Show Next Button', 'shopbuilder' ),
1717 'help' => esc_html__( 'Enable this option to display the \'Next\' button.', 'shopbuilder' ),
1718 'tab' => 'multi-step',
1719 'value' => 'on',
1720 'dependency' => [
1721 'rules' => [
1722 [
1723 'item' => 'modules.shopify_checkout.enable_multi_step',
1724 'value' => 'on',
1725 'operator' => '==',
1726 ],
1727 ],
1728 ],
1729 ],
1730 'continue_btn_text_for_shipping' => [
1731 'id' => 'continue_btn_text_for_shipping',
1732 'type' => 'text',
1733 'isPro' => ! rtsb()->has_pro(),
1734 'label' => esc_html__( 'Next Button Label for Shipping', 'shopbuilder' ),
1735 'value' => esc_html__( 'Next', 'shopbuilder' ),
1736 'tab' => 'multi-step',
1737 'dependency' => [
1738 'rules' => [
1739 [
1740 'item' => 'modules.shopify_checkout.enable_multi_step',
1741 'value' => 'on',
1742 'operator' => '==',
1743 ],
1744 [
1745 'item' => 'modules.shopify_checkout.shop_continue_btn',
1746 'value' => 'on',
1747 'operator' => '==',
1748 ],
1749 ],
1750 ],
1751 ],
1752 'continue_btn_text_for_shipping_method' => [
1753 'id' => 'continue_btn_text_for_shipping_method',
1754 'type' => 'text',
1755 'isPro' => ! rtsb()->has_pro(),
1756 'label' => esc_html__( 'Next Button Label for Shipping Method', 'shopbuilder' ),
1757 'value' => esc_html__( 'Next', 'shopbuilder' ),
1758 'tab' => 'multi-step',
1759 'dependency' => [
1760 'rules' => [
1761 [
1762 'item' => 'modules.shopify_checkout.enable_multi_step',
1763 'value' => 'on',
1764 'operator' => '==',
1765 ],
1766 [
1767 'item' => 'modules.shopify_checkout.shop_continue_btn',
1768 'value' => 'on',
1769 'operator' => '==',
1770 ],
1771 ],
1772 ],
1773 ],
1774 'continue_btn_text_for_payment' => [
1775 'id' => 'continue_btn_text_for_payment',
1776 'type' => 'text',
1777 'label' => esc_html__( 'Next Button Label for Payment', 'shopbuilder' ),
1778 'value' => esc_html__( 'Next', 'shopbuilder' ),
1779 'tab' => 'multi-step',
1780 'dependency' => [
1781 'rules' => [
1782 [
1783 'item' => 'modules.shopify_checkout.enable_multi_step',
1784 'value' => 'on',
1785 'operator' => '==',
1786 ],
1787 [
1788 'item' => 'modules.shopify_checkout.shop_continue_btn',
1789 'value' => 'on',
1790 'operator' => '==',
1791 ],
1792 ],
1793 ],
1794 ],
1795 'shop_return_btn' => [
1796 'id' => 'shop_return_btn',
1797 'type' => 'switch',
1798 'isPro' => ! rtsb()->has_pro(),
1799 'label' => esc_html__( 'Show Back Button', 'shopbuilder' ),
1800 'help' => esc_html__( 'Enable this option to display the \'Back\' button.', 'shopbuilder' ),
1801 'tab' => 'multi-step',
1802 'value' => 'on',
1803 'dependency' => [
1804 'rules' => [
1805 [
1806 'item' => 'modules.shopify_checkout.enable_multi_step',
1807 'value' => 'on',
1808 'operator' => '==',
1809 ],
1810 ],
1811 ],
1812 ],
1813 'return_btn_text_for_billing' => [
1814 'id' => 'return_btn_text_for_billing',
1815 'type' => 'text',
1816 'isPro' => ! rtsb()->has_pro(),
1817 'label' => esc_html__( 'Back Button Label for Billing', 'shopbuilder' ),
1818 'value' => esc_html__( 'Prev', 'shopbuilder' ),
1819 'tab' => 'multi-step',
1820 'dependency' => [
1821 'rules' => [
1822 [
1823 'item' => 'modules.shopify_checkout.enable_multi_step',
1824 'value' => 'on',
1825 'operator' => '==',
1826 ],
1827 [
1828 'item' => 'modules.shopify_checkout.shop_return_btn',
1829 'value' => 'on',
1830 'operator' => '==',
1831 ],
1832 ],
1833 ],
1834 ],
1835
1836 'return_btn_text_for_shipping' => [
1837 'id' => 'return_btn_text_for_shipping',
1838 'type' => 'text',
1839 'isPro' => ! rtsb()->has_pro(),
1840 'label' => esc_html__( 'Back Button Label for Shipping', 'shopbuilder' ),
1841 'value' => esc_html__( 'Prev', 'shopbuilder' ),
1842 'tab' => 'multi-step',
1843 'dependency' => [
1844 'rules' => [
1845 [
1846 'item' => 'modules.shopify_checkout.enable_multi_step',
1847 'value' => 'on',
1848 'operator' => '==',
1849 ],
1850 [
1851 'item' => 'modules.shopify_checkout.shop_return_btn',
1852 'value' => 'on',
1853 'operator' => '==',
1854 ],
1855 ],
1856 ],
1857 ],
1858
1859 'return_btn_text_for_shipping_method' => [
1860 'id' => 'return_btn_text_for_shipping_method',
1861 'type' => 'text',
1862 'isPro' => ! rtsb()->has_pro(),
1863 'label' => esc_html__( 'Back Button Label for Shipping Method', 'shopbuilder' ),
1864 'value' => esc_html__( 'Prev', 'shopbuilder' ),
1865 'tab' => 'multi-step',
1866 'dependency' => [
1867 'rules' => [
1868 [
1869 'item' => 'modules.shopify_checkout.enable_multi_step',
1870 'value' => 'on',
1871 'operator' => '==',
1872 ],
1873 [
1874 'item' => 'modules.shopify_checkout.shop_return_btn',
1875 'value' => 'on',
1876 'operator' => '==',
1877 ],
1878 ],
1879 ],
1880 ],
1881
1882 'order_review_settings' => [
1883 'id' => 'order_review_settings',
1884 'type' => 'title',
1885 'label' => esc_html__( 'Order Reviews', 'shopbuilder' ),
1886 'tab' => 'general',
1887 ],
1888 'order_review_item_link' => [
1889 'id' => 'order_review_item_link',
1890 'type' => 'switch',
1891 'label' => esc_html__( 'Link Product Titles', 'shopbuilder' ),
1892 'help' => esc_html__( 'Enable to make product titles clickable, linking to their product pages.', 'shopbuilder' ),
1893 'value' => '',
1894 'tab' => 'general',
1895 ],
1896 'extra_content' => [
1897 'id' => 'extra_content',
1898 'label' => esc_html__( 'Display Additional Data', 'shopbuilder' ),
1899 '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' ),
1900 'type' => 'text_editor',
1901 'isPro' => ! rtsb()->has_pro(),
1902 'sanitize_fn' => 'pass_all',
1903 'tab' => 'general',
1904 ],
1905
1906 'footer_settings' => [
1907 'id' => 'footer_settings',
1908 'type' => 'title',
1909 'label' => esc_html__( 'Footer', 'shopbuilder' ),
1910 'tab' => 'general',
1911 ],
1912
1913 'footer_menu' => [
1914 'id' => 'footer_menu',
1915 'label' => esc_html__( 'Footer Menu', 'shopbuilder' ),
1916 'help' => esc_html__( 'Select a menu to display in the footer section of your checkout page.', 'shopbuilder' ),
1917 'type' => 'select',
1918 'value' => 'none',
1919 'options' => $this->get_all_menu(),
1920 'tab' => 'general',
1921 ],
1922
1923 'footer_text' => [
1924 'id' => 'footer_text',
1925 'type' => 'text',
1926 'label' => esc_html__( 'Footer Text', 'shopbuilder' ),
1927 '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' ),
1928 'value' => esc_html__( 'Copyright @{year} | All rights reserved', 'shopbuilder' ),
1929 'tab' => 'general',
1930 ],
1931
1932 // Place Order.
1933 'login_button_styles_settings' => [
1934 'id' => 'login_button_styles_settings',
1935 'type' => 'title',
1936 'tab' => 'btn-styles',
1937 'label' => esc_html__( 'Login Button Style', 'shopbuilder' ),
1938 ],
1939 'login_button_height' => [
1940 'id' => 'login_button_height',
1941 'label' => esc_html__( 'Height (px)', 'shopbuilder' ),
1942 'type' => 'slider',
1943 'min' => 10,
1944 'max' => 100,
1945 'unit' => 'px',
1946 'value' => 50,
1947 'tab' => 'btn-styles',
1948 ],
1949 'login_button_width' => [
1950 'id' => 'login_button_width',
1951 'label' => esc_html__( 'Width (px)', 'shopbuilder' ),
1952 'type' => 'slider',
1953 'min' => 10,
1954 'max' => 1000,
1955 'unit' => 'px',
1956 'tab' => 'btn-styles',
1957 ],
1958 'login_button_font_size' => [
1959 'id' => 'login_button_font_size',
1960 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
1961 'type' => 'slider',
1962 'min' => 10,
1963 'max' => 50,
1964 'unit' => 'px',
1965 'value' => 15,
1966 'tab' => 'btn-styles',
1967 ],
1968 'login_button_bg_color' => [
1969 'id' => 'login_button_bg_color',
1970 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
1971 'tab' => 'btn-styles',
1972 'type' => 'color',
1973 ],
1974 'login_button_hover_bg_color' => [
1975 'id' => 'login_button_hover_bg_color',
1976 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
1977 'tab' => 'btn-styles',
1978 'type' => 'color',
1979 ],
1980 'login_button_color' => [
1981 'id' => 'login_button_color',
1982 'label' => esc_html__( 'Color', 'shopbuilder' ),
1983 'tab' => 'btn-styles',
1984 'type' => 'color',
1985 ],
1986 'login_button_hover_color' => [
1987 'id' => 'login_button_hover_color',
1988 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
1989 'tab' => 'btn-styles',
1990 'type' => 'color',
1991 ],
1992 'login_button_border_color' => [
1993 'id' => 'login_button_border_color',
1994 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
1995 'tab' => 'btn-styles',
1996 'type' => 'color',
1997 ],
1998 'login_button_hover_border_color' => [
1999 'id' => 'login_button_hover_border_color',
2000 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2001 'tab' => 'btn-styles',
2002 'type' => 'color',
2003 ],
2004
2005 // Place Order.
2006 'place_order_button_styles_settings' => [
2007 'id' => 'place_order_button_styles_settings',
2008 'type' => 'title',
2009 'tab' => 'btn-styles',
2010 'label' => esc_html__( 'Place Order Button Style', 'shopbuilder' ),
2011 ],
2012 'place_order_button_height' => [
2013 'id' => 'place_order_button_height',
2014 'label' => esc_html__( 'Height (px)', 'shopbuilder' ),
2015 'type' => 'slider',
2016 'min' => 10,
2017 'max' => 100,
2018 'unit' => 'px',
2019 'value' => 50,
2020 'tab' => 'btn-styles',
2021 ],
2022 'place_order_button_width' => [
2023 'id' => 'place_order_button_width',
2024 'label' => esc_html__( 'Width (px)', 'shopbuilder' ),
2025 'type' => 'slider',
2026 'min' => 10,
2027 'max' => 1000,
2028 'unit' => 'px',
2029 'tab' => 'btn-styles',
2030 ],
2031 'place_order_button_font_size' => [
2032 'id' => 'place_order_button_font_size',
2033 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2034 'type' => 'slider',
2035 'min' => 10,
2036 'max' => 50,
2037 'unit' => 'px',
2038 'value' => 15,
2039 'tab' => 'btn-styles',
2040 ],
2041 'place_order_button_bg_color' => [
2042 'id' => 'place_order_button_bg_color',
2043 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
2044 'tab' => 'btn-styles',
2045 'type' => 'color',
2046 ],
2047 'place_order_button_hover_bg_color' => [
2048 'id' => 'place_order_button_hover_bg_color',
2049 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2050 'tab' => 'btn-styles',
2051 'type' => 'color',
2052 ],
2053 'place_order_button_color' => [
2054 'id' => 'place_order_button_color',
2055 'label' => esc_html__( 'Color', 'shopbuilder' ),
2056 'tab' => 'btn-styles',
2057 'type' => 'color',
2058 ],
2059 'place_order_button_hover_color' => [
2060 'id' => 'place_order_button_hover_color',
2061 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2062 'tab' => 'btn-styles',
2063 'type' => 'color',
2064 ],
2065 'place_order_button_border_color' => [
2066 'id' => 'place_order_button_border_color',
2067 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2068 'tab' => 'btn-styles',
2069 'type' => 'color',
2070 ],
2071 'place_order_button_hover_border_color' => [
2072 'id' => 'place_order_button_hover_border_color',
2073 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2074 'tab' => 'btn-styles',
2075 'type' => 'color',
2076 ],
2077
2078 // Next Button.
2079 'next_button_styles_settings' => [
2080 'id' => 'next_button_styles_settings',
2081 'type' => 'title',
2082 'tab' => 'btn-styles',
2083 'label' => esc_html__( 'Next Button Style', 'shopbuilder' ),
2084 'dependency' => [
2085 'rules' => [
2086 [
2087 'item' => 'modules.shopify_checkout.enable_multi_step',
2088 'value' => 'on',
2089 'operator' => '==',
2090 ],
2091 [
2092 'item' => 'modules.shopify_checkout.shop_continue_btn',
2093 'value' => 'on',
2094 'operator' => '==',
2095 ],
2096 ],
2097 ],
2098 ],
2099 'next_button_height' => [
2100 'id' => 'next_button_height',
2101 'isPro' => ! rtsb()->has_pro(),
2102 'label' => esc_html__( 'Height (px)', 'shopbuilder' ),
2103 'type' => 'slider',
2104 'min' => 10,
2105 'max' => 100,
2106 'unit' => 'px',
2107 'value' => 50,
2108 'tab' => 'btn-styles',
2109 'dependency' => [
2110 'rules' => [
2111 [
2112 'item' => 'modules.shopify_checkout.enable_multi_step',
2113 'value' => 'on',
2114 'operator' => '==',
2115 ],
2116 [
2117 'item' => 'modules.shopify_checkout.shop_continue_btn',
2118 'value' => 'on',
2119 'operator' => '==',
2120 ],
2121 ],
2122 ],
2123 ],
2124 'next_button_width' => [
2125 'id' => 'next_button_width',
2126 'label' => esc_html__( 'Width (px)', 'shopbuilder' ),
2127 'type' => 'slider',
2128 'min' => 10,
2129 'max' => 1000,
2130 'unit' => 'px',
2131 'tab' => 'btn-styles',
2132 'dependency' => [
2133 'rules' => [
2134 [
2135 'item' => 'modules.shopify_checkout.enable_multi_step',
2136 'value' => 'on',
2137 'operator' => '==',
2138 ],
2139 [
2140 'item' => 'modules.shopify_checkout.shop_continue_btn',
2141 'value' => 'on',
2142 'operator' => '==',
2143 ],
2144 ],
2145 ],
2146 ],
2147 'next_button_font_size' => [
2148 'id' => 'next_button_font_size',
2149 'isPro' => ! rtsb()->has_pro(),
2150 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2151 'type' => 'slider',
2152 'min' => 10,
2153 'max' => 50,
2154 'unit' => 'px',
2155 'value' => 15,
2156 'tab' => 'btn-styles',
2157 'dependency' => [
2158 'rules' => [
2159 [
2160 'item' => 'modules.shopify_checkout.enable_multi_step',
2161 'value' => 'on',
2162 'operator' => '==',
2163 ],
2164 [
2165 'item' => 'modules.shopify_checkout.shop_continue_btn',
2166 'value' => 'on',
2167 'operator' => '==',
2168 ],
2169 ],
2170 ],
2171 ],
2172 'next_button_bg_color' => [
2173 'id' => 'next_button_bg_color',
2174 'isPro' => ! rtsb()->has_pro(),
2175 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
2176 'tab' => 'btn-styles',
2177 'type' => 'color',
2178 'dependency' => [
2179 'rules' => [
2180 [
2181 'item' => 'modules.shopify_checkout.enable_multi_step',
2182 'value' => 'on',
2183 'operator' => '==',
2184 ],
2185 [
2186 'item' => 'modules.shopify_checkout.shop_continue_btn',
2187 'value' => 'on',
2188 'operator' => '==',
2189 ],
2190 ],
2191 ],
2192 ],
2193 'next_button_hover_bg_color' => [
2194 'id' => 'next_button_hover_bg_color',
2195 'isPro' => ! rtsb()->has_pro(),
2196 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2197 'tab' => 'btn-styles',
2198 'type' => 'color',
2199 'dependency' => [
2200 'rules' => [
2201 [
2202 'item' => 'modules.shopify_checkout.enable_multi_step',
2203 'value' => 'on',
2204 'operator' => '==',
2205 ],
2206 [
2207 'item' => 'modules.shopify_checkout.shop_continue_btn',
2208 'value' => 'on',
2209 'operator' => '==',
2210 ],
2211 ],
2212 ],
2213 ],
2214 'next_button_color' => [
2215 'id' => 'next_button_color',
2216 'isPro' => ! rtsb()->has_pro(),
2217 'label' => esc_html__( 'Color', 'shopbuilder' ),
2218 'tab' => 'btn-styles',
2219 'type' => 'color',
2220 'dependency' => [
2221 'rules' => [
2222 [
2223 'item' => 'modules.shopify_checkout.enable_multi_step',
2224 'value' => 'on',
2225 'operator' => '==',
2226 ],
2227 [
2228 'item' => 'modules.shopify_checkout.shop_continue_btn',
2229 'value' => 'on',
2230 'operator' => '==',
2231 ],
2232 ],
2233 ],
2234 ],
2235 'next_button_hover_color' => [
2236 'id' => 'next_button_hover_color',
2237 'isPro' => ! rtsb()->has_pro(),
2238 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2239 'tab' => 'btn-styles',
2240 'type' => 'color',
2241 'dependency' => [
2242 'rules' => [
2243 [
2244 'item' => 'modules.shopify_checkout.enable_multi_step',
2245 'value' => 'on',
2246 'operator' => '==',
2247 ],
2248 [
2249 'item' => 'modules.shopify_checkout.shop_continue_btn',
2250 'value' => 'on',
2251 'operator' => '==',
2252 ],
2253 ],
2254 ],
2255 ],
2256 'next_button_border_color' => [
2257 'id' => 'next_button_border_color',
2258 'isPro' => ! rtsb()->has_pro(),
2259 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2260 'tab' => 'btn-styles',
2261 'type' => 'color',
2262 'dependency' => [
2263 'rules' => [
2264 [
2265 'item' => 'modules.shopify_checkout.enable_multi_step',
2266 'value' => 'on',
2267 'operator' => '==',
2268 ],
2269 [
2270 'item' => 'modules.shopify_checkout.shop_continue_btn',
2271 'value' => 'on',
2272 'operator' => '==',
2273 ],
2274 ],
2275 ],
2276 ],
2277 'next_button_hover_border_color' => [
2278 'id' => 'next_button_hover_border_color',
2279 'isPro' => ! rtsb()->has_pro(),
2280 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2281 'tab' => 'btn-styles',
2282 'type' => 'color',
2283 'dependency' => [
2284 'rules' => [
2285 [
2286 'item' => 'modules.shopify_checkout.enable_multi_step',
2287 'value' => 'on',
2288 'operator' => '==',
2289 ],
2290 [
2291 'item' => 'modules.shopify_checkout.shop_continue_btn',
2292 'value' => 'on',
2293 'operator' => '==',
2294 ],
2295 ],
2296 ],
2297 ],
2298 'prev_button_styles_settings' => [
2299 'id' => 'prev_button_styles_settings',
2300 'type' => 'title',
2301 'tab' => 'btn-styles',
2302 'label' => esc_html__( 'Prev Button Style', 'shopbuilder' ),
2303 'dependency' => [
2304 'rules' => [
2305 [
2306 'item' => 'modules.shopify_checkout.enable_multi_step',
2307 'value' => 'on',
2308 'operator' => '==',
2309 ],
2310 [
2311 'item' => 'modules.shopify_checkout.shop_return_btn',
2312 'value' => 'on',
2313 'operator' => '==',
2314 ],
2315 ],
2316 ],
2317
2318 ],
2319 'prev_button_height' => [
2320 'id' => 'prev_button_height',
2321 'isPro' => ! rtsb()->has_pro(),
2322 'label' => esc_html__( 'Height (px)', 'shopbuilder' ),
2323 'type' => 'slider',
2324 'min' => 10,
2325 'max' => 100,
2326 'unit' => 'px',
2327 'value' => 50,
2328 'tab' => 'btn-styles',
2329 'dependency' => [
2330 'rules' => [
2331 [
2332 'item' => 'modules.shopify_checkout.enable_multi_step',
2333 'value' => 'on',
2334 'operator' => '==',
2335 ],
2336 [
2337 'item' => 'modules.shopify_checkout.shop_return_btn',
2338 'value' => 'on',
2339 'operator' => '==',
2340 ],
2341 ],
2342 ],
2343 ],
2344 'prev_button_width' => [
2345 'id' => 'prev_button_width',
2346 'label' => esc_html__( 'Width (px)', 'shopbuilder' ),
2347 'type' => 'slider',
2348 'min' => 10,
2349 'max' => 1000,
2350 'unit' => 'px',
2351 'tab' => 'btn-styles',
2352 'dependency' => [
2353 'rules' => [
2354 [
2355 'item' => 'modules.shopify_checkout.enable_multi_step',
2356 'value' => 'on',
2357 'operator' => '==',
2358 ],
2359 [
2360 'item' => 'modules.shopify_checkout.shop_return_btn',
2361 'value' => 'on',
2362 'operator' => '==',
2363 ],
2364 ],
2365 ],
2366 ],
2367 'prev_button_font_size' => [
2368 'id' => 'prev_button_font_size',
2369 'isPro' => ! rtsb()->has_pro(),
2370 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2371 'type' => 'slider',
2372 'min' => 10,
2373 'max' => 50,
2374 'unit' => 'px',
2375 'value' => 15,
2376 'tab' => 'btn-styles',
2377 'dependency' => [
2378 'rules' => [
2379 [
2380 'item' => 'modules.shopify_checkout.enable_multi_step',
2381 'value' => 'on',
2382 'operator' => '==',
2383 ],
2384 [
2385 'item' => 'modules.shopify_checkout.shop_return_btn',
2386 'value' => 'on',
2387 'operator' => '==',
2388 ],
2389 ],
2390 ],
2391 ],
2392 'prev_button_bg_color' => [
2393 'id' => 'prev_button_bg_color',
2394 'isPro' => ! rtsb()->has_pro(),
2395 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
2396 'tab' => 'btn-styles',
2397 'type' => 'color',
2398 'dependency' => [
2399 'rules' => [
2400 [
2401 'item' => 'modules.shopify_checkout.enable_multi_step',
2402 'value' => 'on',
2403 'operator' => '==',
2404 ],
2405 [
2406 'item' => 'modules.shopify_checkout.shop_return_btn',
2407 'value' => 'on',
2408 'operator' => '==',
2409 ],
2410 ],
2411 ],
2412 ],
2413 'prev_button_hover_bg_color' => [
2414 'id' => 'prev_button_hover_bg_color',
2415 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2416 'isPro' => ! rtsb()->has_pro(),
2417 'tab' => 'btn-styles',
2418 'type' => 'color',
2419 'dependency' => [
2420 'rules' => [
2421 [
2422 'item' => 'modules.shopify_checkout.enable_multi_step',
2423 'value' => 'on',
2424 'operator' => '==',
2425 ],
2426 [
2427 'item' => 'modules.shopify_checkout.shop_return_btn',
2428 'value' => 'on',
2429 'operator' => '==',
2430 ],
2431 ],
2432 ],
2433 ],
2434 'prev_button_color' => [
2435 'id' => 'prev_button_color',
2436 'label' => esc_html__( 'Color', 'shopbuilder' ),
2437 'isPro' => ! rtsb()->has_pro(),
2438 'tab' => 'btn-styles',
2439 'type' => 'color',
2440 'dependency' => [
2441 'rules' => [
2442 [
2443 'item' => 'modules.shopify_checkout.enable_multi_step',
2444 'value' => 'on',
2445 'operator' => '==',
2446 ],
2447 [
2448 'item' => 'modules.shopify_checkout.shop_return_btn',
2449 'value' => 'on',
2450 'operator' => '==',
2451 ],
2452 ],
2453 ],
2454 ],
2455 'prev_button_hover_color' => [
2456 'id' => 'prev_button_hover_color',
2457 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2458 'isPro' => ! rtsb()->has_pro(),
2459 'tab' => 'btn-styles',
2460 'type' => 'color',
2461 'dependency' => [
2462 'rules' => [
2463 [
2464 'item' => 'modules.shopify_checkout.enable_multi_step',
2465 'value' => 'on',
2466 'operator' => '==',
2467 ],
2468 [
2469 'item' => 'modules.shopify_checkout.shop_return_btn',
2470 'value' => 'on',
2471 'operator' => '==',
2472 ],
2473 ],
2474 ],
2475 ],
2476 'prev_button_border_color' => [
2477 'id' => 'prev_button_border_color',
2478 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2479 'isPro' => ! rtsb()->has_pro(),
2480 'tab' => 'btn-styles',
2481 'type' => 'color',
2482 'dependency' => [
2483 'rules' => [
2484 [
2485 'item' => 'modules.shopify_checkout.enable_multi_step',
2486 'value' => 'on',
2487 'operator' => '==',
2488 ],
2489 [
2490 'item' => 'modules.shopify_checkout.shop_return_btn',
2491 'value' => 'on',
2492 'operator' => '==',
2493 ],
2494 ],
2495 ],
2496 ],
2497 'prev_button_hover_border_color' => [
2498 'id' => 'prev_button_hover_border_color',
2499 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2500 'isPro' => ! rtsb()->has_pro(),
2501 'tab' => 'btn-styles',
2502 'type' => 'color',
2503 'dependency' => [
2504 'rules' => [
2505 [
2506 'item' => 'modules.shopify_checkout.enable_multi_step',
2507 'value' => 'on',
2508 'operator' => '==',
2509 ],
2510 [
2511 'item' => 'modules.shopify_checkout.shop_return_btn',
2512 'value' => 'on',
2513 'operator' => '==',
2514 ],
2515 ],
2516 ],
2517 ],
2518 'coupon_button_styles_settings' => [
2519 'id' => 'coupon_button_styles_settings',
2520 'type' => 'title',
2521 'tab' => 'btn-styles',
2522 'label' => esc_html__( 'Apply Coupon Button Style', 'shopbuilder' ),
2523 ],
2524 'coupon_height' => [
2525 'id' => 'coupon_height',
2526 'label' => esc_html__( 'Coupon Field And Button Height (px)', 'shopbuilder' ),
2527 'type' => 'slider',
2528 'min' => 10,
2529 'max' => 100,
2530 'unit' => 'px',
2531 'value' => 50,
2532 'tab' => 'btn-styles',
2533 ],
2534 'coupon_button_font_size' => [
2535 'id' => 'coupon_button_font_size',
2536 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2537 'type' => 'slider',
2538 'min' => 10,
2539 'max' => 50,
2540 'unit' => 'px',
2541 'value' => 15,
2542 'tab' => 'btn-styles',
2543 ],
2544 'coupon_button_bg_color' => [
2545 'id' => 'coupon_button_bg_color',
2546 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
2547 'tab' => 'btn-styles',
2548 'type' => 'color',
2549 ],
2550 'coupon_button_hover_bg_color' => [
2551 'id' => 'coupon_button_hover_bg_color',
2552 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2553 'tab' => 'btn-styles',
2554 'type' => 'color',
2555 ],
2556 'coupon_button_color' => [
2557 'id' => 'coupon_button_color',
2558 'label' => esc_html__( 'Color', 'shopbuilder' ),
2559 'tab' => 'btn-styles',
2560 'type' => 'color',
2561 ],
2562 'coupon_button_hover_color' => [
2563 'id' => 'coupon_button_hover_color',
2564 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2565 'tab' => 'btn-styles',
2566 'type' => 'color',
2567 ],
2568 'coupon_button_border_color' => [
2569 'id' => 'coupon_button_border_color',
2570 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2571 'tab' => 'btn-styles',
2572 'type' => 'color',
2573 ],
2574 'coupon_button_hover_border_color' => [
2575 'id' => 'coupon_button_hover_border_color',
2576 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2577 'tab' => 'btn-styles',
2578 'type' => 'color',
2579 ],
2580
2581 'header_cart_icon_styles' => [
2582 'id' => 'header_cart_icon_styles',
2583 'type' => 'title',
2584 'tab' => 'styles',
2585 'label' => esc_html__( 'Header Cart Icon Style', 'shopbuilder' ),
2586 'dependency' => [
2587 'rules' => [
2588 [
2589 'item' => 'modules.shopify_checkout.cart_icon_source',
2590 'value' => 'none',
2591 'operator' => '!=',
2592 ],
2593 ],
2594 ],
2595 ],
2596
2597 'shopify_cart_icon_height' => [
2598 'id' => 'shopify_cart_icon_height',
2599 'label' => esc_html__( 'Cart Icon Height (px)', 'shopbuilder' ),
2600 'type' => 'slider',
2601 'min' => 10,
2602 'max' => 200,
2603 'unit' => 'px',
2604 'value' => 40,
2605 'tab' => 'styles',
2606 'dependency' => [
2607 'rules' => [
2608 [
2609 'item' => 'modules.shopify_checkout.cart_icon_source',
2610 'value' => 'upload_icon',
2611 'operator' => '==',
2612 ],
2613 ],
2614 ],
2615 ],
2616
2617 'header_cart_icon_color' => [
2618 'id' => 'step_menu_color',
2619 'label' => esc_html__( 'Color', 'shopbuilder' ),
2620 'tab' => 'styles',
2621 'type' => 'color',
2622 'dependency' => [
2623 'rules' => [
2624 [
2625 'item' => 'modules.shopify_checkout.cart_icon_source',
2626 'value' => 'select_icon',
2627 'operator' => '==',
2628 ],
2629 ],
2630 ],
2631 ],
2632 'header_cart_icon_hover_color' => [
2633 'id' => 'header_cart_icon_hover_color',
2634 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2635 'tab' => 'styles',
2636 'type' => 'color',
2637 'dependency' => [
2638 'rules' => [
2639 [
2640 'item' => 'modules.shopify_checkout.cart_icon_source',
2641 'value' => 'select_icon',
2642 'operator' => '==',
2643 ],
2644 ],
2645 ],
2646 ],
2647 'header_cart_icon_font_size' => [
2648 'id' => 'header_cart_icon_font_size',
2649 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2650 'type' => 'slider',
2651 'min' => 10,
2652 'max' => 50,
2653 'unit' => 'px',
2654 'value' => 15,
2655 'tab' => 'styles',
2656 'dependency' => [
2657 'rules' => [
2658 [
2659 'item' => 'modules.shopify_checkout.cart_icon_source',
2660 'value' => 'select_icon',
2661 'operator' => '==',
2662 ],
2663 ],
2664 ],
2665 ],
2666 'footer_menu_styles_settings' => [
2667 'id' => 'footer_menu_styles_settings',
2668 'type' => 'title',
2669 'tab' => 'styles',
2670 'label' => esc_html__( 'Footer Style', 'shopbuilder' ),
2671 ],
2672 'footer_menu_color' => [
2673 'id' => 'footer_menu_color',
2674 'label' => esc_html__( 'Menu Color', 'shopbuilder' ),
2675 'tab' => 'styles',
2676 'type' => 'color',
2677 ],
2678 'footer_menu_hover_color' => [
2679 'id' => 'footer_menu_hover_color',
2680 'label' => esc_html__( 'Menu Hover Color', 'shopbuilder' ),
2681 'tab' => 'styles',
2682 'type' => 'color',
2683 ],
2684 'footer_menu_font_size' => [
2685 'id' => 'footer_menu_font_size',
2686 'label' => esc_html__( 'Menu Font Size (px)', 'shopbuilder' ),
2687 'type' => 'slider',
2688 'min' => 10,
2689 'max' => 50,
2690 'unit' => 'px',
2691 'value' => 15,
2692 'tab' => 'styles',
2693 ],
2694 'footer_text_size' => [
2695 'id' => 'footer_text_size',
2696 'label' => esc_html__( 'Footer Text Font Size (px)', 'shopbuilder' ),
2697 'type' => 'slider',
2698 'min' => 10,
2699 'max' => 50,
2700 'unit' => 'px',
2701 'value' => 15,
2702 'tab' => 'styles',
2703 ],
2704 'footer_text_color' => [
2705 'id' => 'footer_text_color',
2706 'label' => esc_html__( 'Footer Text Color', 'shopbuilder' ),
2707 'tab' => 'styles',
2708 'type' => 'color',
2709 ],
2710 'step_menu_styles_settings' => [
2711 'id' => 'step_menu_styles_settings',
2712 'type' => 'title',
2713 'tab' => 'styles',
2714 'label' => esc_html__( 'Step Menu Style', 'shopbuilder' ),
2715 'dependency' => [
2716 'rules' => [
2717 [
2718 'item' => 'modules.shopify_checkout.enable_multi_step',
2719 'value' => 'on',
2720 'operator' => '==',
2721 ],
2722 [
2723 'item' => 'modules.shopify_checkout.show_step_menu',
2724 'value' => 'on',
2725 'operator' => '==',
2726 ],
2727 ],
2728 ],
2729 ],
2730 'step_menu_color' => [
2731 'id' => 'step_menu_color',
2732 'label' => esc_html__( 'Color', 'shopbuilder' ),
2733 'isPro' => ! rtsb()->has_pro(),
2734 'tab' => 'styles',
2735 'type' => 'color',
2736 'dependency' => [
2737 'rules' => [
2738 [
2739 'item' => 'modules.shopify_checkout.enable_multi_step',
2740 'value' => 'on',
2741 'operator' => '==',
2742 ],
2743 [
2744 'item' => 'modules.shopify_checkout.show_step_menu',
2745 'value' => 'on',
2746 'operator' => '==',
2747 ],
2748 ],
2749 ],
2750 ],
2751 'step_menu_hover_color' => [
2752 'id' => 'step_menu_hover_color',
2753 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2754 'isPro' => ! rtsb()->has_pro(),
2755 'tab' => 'styles',
2756 'type' => 'color',
2757 'dependency' => [
2758 'rules' => [
2759 [
2760 'item' => 'modules.shopify_checkout.enable_multi_step',
2761 'value' => 'on',
2762 'operator' => '==',
2763 ],
2764 [
2765 'item' => 'modules.shopify_checkout.show_step_menu',
2766 'value' => 'on',
2767 'operator' => '==',
2768 ],
2769 ],
2770 ],
2771 ],
2772 'step_menu_font_size' => [
2773 'id' => 'step_menu_font_size',
2774 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2775 'isPro' => ! rtsb()->has_pro(),
2776 'type' => 'slider',
2777 'min' => 10,
2778 'max' => 50,
2779 'unit' => 'px',
2780 'value' => 15,
2781 'tab' => 'styles',
2782 'dependency' => [
2783 'rules' => [
2784 [
2785 'item' => 'modules.shopify_checkout.enable_multi_step',
2786 'value' => 'on',
2787 'operator' => '==',
2788 ],
2789 [
2790 'item' => 'modules.shopify_checkout.show_step_menu',
2791 'value' => 'on',
2792 'operator' => '==',
2793 ],
2794 ],
2795 ],
2796 ],
2797 ];
2798 return $fields;
2799 }
2800 /**
2801 * @return array
2802 */
2803 public function product_badges_fields() {
2804 return apply_filters(
2805 'rtsb/module/product_badges/fields',
2806 [
2807 'hide_woocommerce_badge' => [
2808 'id' => 'hide_woocommerce_badge',
2809 'value' => '',
2810 'type' => 'switch',
2811 'label' => esc_html__( 'Hide Theme Badges', 'shopbuilder' ),
2812 'help' => esc_html__( 'Switch on to hide theme default badges.', 'shopbuilder' ),
2813 'tab' => 'general',
2814 ],
2815 // Hide "On sale".
2816 'hide_on_sale' => [
2817 'id' => 'hide_on_sale',
2818 'type' => 'select',
2819 'value' => 'all_products',
2820 'isPro' => ! rtsb()->has_pro(),
2821 'label' => esc_html__( 'Applicable Products', 'shopbuilder' ),
2822 'options' => [
2823 'all_products' => esc_html__( 'All products', 'shopbuilder' ),
2824 'where_custom_badge_applied' => esc_html__( 'Only for products which have custom badge enabled', 'shopbuilder' ),
2825 ],
2826 'help' => esc_html__( 'Choose where to hide the default badges.', 'shopbuilder' ),
2827 'tab' => 'general',
2828 'dependency' => [
2829 'rules' => [
2830 [
2831 'item' => 'modules.product_badges.hide_woocommerce_badge',
2832 'value' => 'on',
2833 'operator' => '==',
2834 ],
2835 ],
2836 ],
2837 ],
2838
2839 'group_badge_display_as' => [
2840 'id' => 'group_badge_display_as',
2841 'type' => 'select',
2842 'value' => 'horizontal',
2843 'isPro' => ! rtsb()->has_pro(),
2844 'label' => esc_html__( 'Group Badge Display Type', 'shopbuilder' ),
2845 'help' => sprintf(
2846 // translators: %s for pro message.
2847 esc_html__( 'Please choose the group display type. %s', 'shopbuilder' ),
2848 ! rtsb()->has_pro()
2849 ? sprintf(
2850 '<a target="_blank" href="%s">%s </a> %s ',
2851 esc_url( rtsb()->pro_version_link() ),
2852 esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
2853 esc_html__( 'for vertical layout.', 'shopbuilder' )
2854 )
2855 : ''
2856 ),
2857 'options' => [
2858 'horizontal' => esc_html__( 'Horizontal', 'shopbuilder' ),
2859 'vertical' => esc_html__( 'Vertical', 'shopbuilder' ),
2860 ],
2861 'tab' => 'group',
2862 ],
2863 'group_badge_gap' => [
2864 'id' => 'group_badge_gap',
2865 'type' => 'text',
2866 'value' => '10px',
2867 'label' => esc_html__( 'Group Badge Gap/Spacing', 'shopbuilder' ),
2868 'help' => esc_html__( 'Example: 10px', 'shopbuilder' ),
2869 'tab' => 'group',
2870 ],
2871 'general_options' => [
2872 'id' => 'general_options',
2873 'type' => 'title',
2874 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder' ),
2875 'tab' => 'group',
2876 ],
2877 'loop_group_position' => [
2878 'id' => 'loop_group_position',
2879 'type' => 'select',
2880 'value' => 'above_image',
2881 'isPro' => ! rtsb()->has_pro(),
2882 'label' => esc_html__( 'Shop Page Group Position', 'shopbuilder' ),
2883 'help' => esc_html__( 'Choose the group badges position in Shop page.', 'shopbuilder' ),
2884 'options' => [
2885 'above_image' => esc_html__( 'Floating Above Image', 'shopbuilder' ),
2886 'before_product_title' => esc_html__( 'Before Product Title', 'shopbuilder' ),
2887 'after_product_title' => esc_html__( 'After Product Title', 'shopbuilder' ),
2888 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
2889 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
2890 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
2891 ],
2892 'tab' => 'group',
2893 ],
2894 'loop_custom_hook_name' => [
2895 'id' => 'loop_custom_hook_name',
2896 'type' => 'text',
2897 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
2898 'tab' => 'group',
2899 'help' => sprintf(
2900 /* translators: 1: The shortcode.*/
2901 __( 'Or Copy the php code <br />%1$s<br /> and paste it in your product query where you want to show the button.', 'shopbuilder' ),
2902 "<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>"
2903 ),
2904 'dependency' => [
2905 'rules' => [
2906 [
2907 'item' => 'modules.product_badges.loop_group_position',
2908 'value' => 'custom',
2909 'operator' => '==',
2910 ],
2911 ],
2912 ],
2913 ],
2914 /*
2915 'loop_priority_note' => [
2916 'type' => 'raw',
2917 'label' => ' ',
2918 '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>',
2919 'dependency' => [
2920 'rules' => [
2921 [
2922 'item' => 'modules.product_badges.loop_group_position',
2923 'value' => 'above_image',
2924 'operator' => '!=',
2925 ],
2926 ],
2927 ],
2928 'tab' => 'group',
2929 ],
2930 */
2931 'group_position_hook_priority' => [
2932 'id' => 'group_position_hook_priority',
2933 'type' => 'number',
2934 'size' => 'small',
2935 'min' => 0,
2936 'max' => 999,
2937 'label' => esc_html__( 'Badge Position Priority', 'shopbuilder' ),
2938 'help' => esc_html__( 'It\'s depend on your theme functionality. Example: 20', 'shopbuilder' ),
2939 'tab' => 'group',
2940 'dependency' => [
2941 'rules' => [
2942 [
2943 'item' => 'modules.product_badges.loop_group_position',
2944 'value' => 'custom',
2945 'operator' => '==',
2946 ],
2947 ],
2948 ],
2949 ],
2950 'group_badge_position' => [
2951 'id' => 'group_badge_position',
2952 'label' => esc_html__( 'Position Above Image', 'shopbuilder' ),
2953 'type' => 'text_select',
2954 'value' => 'top-left',
2955 'options' => [
2956 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
2957 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
2958 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
2959 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
2960 ],
2961 'dependency' => [
2962 'rules' => [
2963 [
2964 'item' => 'modules.product_badges.loop_group_position',
2965 'value' => 'above_image',
2966 'operator' => '==',
2967 ],
2968 ],
2969 ],
2970 'tab' => 'group',
2971 ],
2972 'product_options' => [
2973 'id' => 'product_options',
2974 'type' => 'title',
2975 'label' => esc_html__( 'Product Page Settings', 'shopbuilder' ),
2976 'tab' => 'group',
2977 ],
2978 'product_page_group_position' => [
2979 'id' => 'product_page_group_position',
2980 'type' => 'select',
2981 'value' => 'above_image',
2982 'isPro' => ! rtsb()->has_pro(),
2983 'label' => esc_html__( 'Product Page Group Position', 'shopbuilder' ),
2984 'help' => esc_html__( 'Choose the group badges position in product page.', 'shopbuilder' ),
2985 'options' => [
2986 'above_image' => esc_html__( 'Floating Above Image', 'shopbuilder' ),
2987 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
2988 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
2989 'after_summary' => esc_html__( 'After Summary', 'shopbuilder' ),
2990 'after_short_desc' => esc_html__( 'After Short Description', 'shopbuilder' ),
2991 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
2992 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
2993 ],
2994 'tab' => 'group',
2995 ],
2996 'product_page_badges_shortcode' => [
2997 'type' => 'raw',
2998 'label' => ' ',
2999 'html' => sprintf(
3000 /* translators: 1: The shortcode.*/
3001 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' ),
3002 '<code>[rtsb_badges]</code>'
3003 ),
3004 'dependency' => [
3005 'rules' => [
3006 [
3007 'item' => 'modules.product_badges.product_page_group_position',
3008 'value' => 'shortcode',
3009 'operator' => '==',
3010 ],
3011 ],
3012 ],
3013 'tab' => 'group',
3014 ],
3015 'product_page_custom_hook_name' => [
3016 'id' => 'product_page_custom_hook_name',
3017 'type' => 'text',
3018 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
3019 'tab' => 'group',
3020 'help' => sprintf(
3021 /* translators: 1: The shortcode.*/
3022 __( 'Or Copy the php code <br />%1$s<br /> and paste it in your product query where you want to show the button.', 'shopbuilder' ),
3023 "<code>&lt;?php do_action( 'rtsb/modules/product_badges/frontend/display' ); ?&gt;</code>"
3024 ),
3025 'dependency' => [
3026 'rules' => [
3027 [
3028 'item' => 'modules.product_badges.product_page_group_position',
3029 'value' => 'custom',
3030 'operator' => '==',
3031 ],
3032 ],
3033 ],
3034 ],
3035 /*
3036 'product_page_priority_note' => [
3037 'type' => 'raw',
3038 'label' => ' ',
3039 '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>',
3040 'dependency' => [
3041 'rules' => [
3042 [
3043 'item' => 'modules.product_badges.product_page_group_position',
3044 'value' => [ 'above_image', 'shortcode' ],
3045 'operator' => '!in',
3046 ],
3047 ],
3048 ],
3049 'tab' => 'group',
3050 ],
3051 */
3052 'product_page_group_hook_priority' => [
3053 'id' => 'product_page_group_hook_priority',
3054 'type' => 'number',
3055 'size' => 'small',
3056 'min' => 0,
3057 'max' => 999,
3058 'label' => esc_html__( 'Badge Position Priority', 'shopbuilder' ),
3059 'help' => esc_html__( 'It\'s depend on your theme functionality. Example: 20', 'shopbuilder' ),
3060 'tab' => 'group',
3061 'dependency' => [
3062 'rules' => [
3063 [
3064 'item' => 'modules.product_badges.product_page_group_position',
3065 'value' => 'custom',
3066 'operator' => '==',
3067 ],
3068 ],
3069 ],
3070
3071 ],
3072 'product_page_group_badge_position' => [
3073 'id' => 'product_page_group_badge_position',
3074 'label' => esc_html__( 'Position Above Image', 'shopbuilder' ),
3075 'type' => 'text_select',
3076 'value' => 'top-left',
3077 'options' => [
3078 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
3079 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
3080 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
3081 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
3082 ],
3083 'dependency' => [
3084 'rules' => [
3085 [
3086 'item' => 'modules.product_badges.product_page_group_position',
3087 'value' => 'above_image',
3088 'operator' => '==',
3089 ],
3090 ],
3091 ],
3092 'tab' => 'group',
3093 ],
3094
3095 'badges_field_intro' => [
3096 'id' => 'badges_field_intro',
3097 'type' => 'description',
3098 'text' => esc_html__( 'To add new product badges, simply click on the \'Add New\' button below.', 'shopbuilder' ),
3099 'tab' => 'badges',
3100 ],
3101 'badges_field' => [
3102 'id' => 'badges_field',
3103 'type' => 'repeaters',
3104 'label' => '',
3105 'tab' => 'badges',
3106 'repeat' => [
3107
3108 'title' => [
3109 'id' => 'title',
3110 'label' => esc_html__( 'Badge Name', 'shopbuilder' ),
3111 'help' => esc_html__( 'Enter badge name.', 'shopbuilder' ),
3112 'type' => 'text',
3113 'placeholder' => esc_html__( 'Badge Name', 'shopbuilder' ),
3114 'value' => esc_html__( 'Badge Name', 'shopbuilder' ),
3115 ],
3116 'badge_condition' => [
3117 'id' => 'badge_condition',
3118 'type' => 'select',
3119 'value' => 'dynamic',
3120 'isPro' => ! rtsb()->has_pro(),
3121 'label' => esc_html__( 'Badge Type', 'shopbuilder' ),
3122 'help' => sprintf(
3123 // translators: %s for pro message.
3124 esc_html__( 'Select badge type. %s', 'shopbuilder' ),
3125 ! rtsb()->has_pro()
3126 ? sprintf(
3127 '<a target="_blank" href="%s">%s</a> %s',
3128 esc_url( rtsb()->pro_version_link() ),
3129 esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
3130 esc_html__( 'unlock custom badge creation.', 'shopbuilder' )
3131 )
3132 : ''
3133 ),
3134 'options' => [
3135 'dynamic' => esc_html__( 'Dynamic', 'shopbuilder' ),
3136 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
3137 ],
3138 ],
3139 'badge_for' => [
3140 'id' => 'badge_for',
3141 'type' => 'select',
3142 'value' => 'on_sale',
3143 'label' => esc_html__( 'Dynamic Badge Condition', 'shopbuilder' ),
3144 'help' => esc_html__( 'Specify dynamic badge condition', 'shopbuilder' ),
3145 'options' => $this->dynamic_badge_list(),
3146 'dependency' => [
3147 'rules' => [
3148 [
3149 'item' => 'modules.product_badges.badges_field.badge_condition',
3150 'value' => 'dynamic',
3151 'operator' => '==',
3152 ],
3153 ],
3154 ],
3155 ],
3156 'badge_for_pre_order' => [
3157 'type' => 'raw',
3158 'label' => ' ',
3159 'html' => esc_html__( 'Please ensure that Pre-Order module is activated and properly configured.', 'shopbuilder' ),
3160 'tab' => 'general',
3161 'dependency' => [
3162 'rules' => [
3163 [
3164 'item' => 'modules.product_badges.badges_field.badge_condition',
3165 'value' => 'dynamic',
3166 'operator' => '==',
3167 ],
3168 [
3169 'item' => 'modules.product_badges.badges_field.badge_for',
3170 'value' => 'pre_order',
3171 'operator' => '==',
3172 ],
3173 ],
3174 ],
3175 ],
3176 'minimum_sale_count' => [
3177 'id' => 'minimum_sale_count',
3178 'type' => 'number',
3179 'label' => esc_html__( 'Minimum Sale Count', 'shopbuilder' ),
3180 'help' => esc_html__( 'Enter the number of Sale you want to designate for products to be labeled as \'Best Selling.\'', 'shopbuilder' ),
3181 'dependency' => [
3182 'rules' => [
3183 [
3184 'item' => 'modules.product_badges.badges_field.badge_condition',
3185 'value' => 'dynamic',
3186 'operator' => '==',
3187 ],
3188 [
3189 'item' => 'modules.product_badges.badges_field.badge_for',
3190 'value' => 'best_selling',
3191 'operator' => '==',
3192 ],
3193 ],
3194 ],
3195 ],
3196 'new_arrival_days' => [
3197 'id' => 'new_arrival_days',
3198 'type' => 'number',
3199 'label' => esc_html__( 'Specify Number of Days', 'shopbuilder' ),
3200 'help' => esc_html__( 'Enter the number of days you want to designate for products to be labeled as \'New Arrivals.\'', 'shopbuilder' ),
3201 'dependency' => [
3202 'rules' => [
3203 [
3204 'item' => 'modules.product_badges.badges_field.badge_for',
3205 'value' => 'new_arrival',
3206 'operator' => '==',
3207 ],
3208 ],
3209 ],
3210 ],
3211 'badges_type' => [
3212 'id' => 'badges_type',
3213 'type' => 'select',
3214 'value' => 'text',
3215 'isPro' => ! rtsb()->has_pro(),
3216 'label' => esc_html__( 'Show Badge As:', 'shopbuilder' ),
3217 'help' => sprintf(
3218 // translators: %s for pro message.
3219 esc_html__( 'Specify the badge display as Image Or Text. %s', 'shopbuilder' ),
3220 ! rtsb()->has_pro()
3221 ? sprintf(
3222 '<a target="_blank" href="%s">%s</a> %s',
3223 esc_url( rtsb()->pro_version_link() ),
3224 esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
3225 esc_html__( 'unlock Image badge creation.', 'shopbuilder' )
3226 )
3227 : ''
3228 ),
3229 'options' => [
3230 'image' => esc_html__( 'Image', 'shopbuilder' ),
3231 'text' => esc_html__( 'Text', 'shopbuilder' ),
3232 ],
3233 ],
3234
3235 'badge_preset' => [
3236 'id' => 'badge_preset',
3237 'label' => esc_html__( 'Text Badge Preset', 'shopbuilder' ),
3238 'help' => esc_html__( 'Choose the badge appearance', 'shopbuilder' ),
3239 'type' => 'image_select',
3240 'value' => 'preset1',
3241 'options' => [
3242 'preset1' => [
3243 'label' => esc_html__( 'Preset 1', 'shopbuilder' ),
3244 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-1.png' ) ),
3245 ],
3246
3247 'preset2' => [
3248 'label' => esc_html__( 'Preset 2', 'shopbuilder' ),
3249 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-2.png' ) ),
3250 ],
3251
3252 'preset3' => [
3253 'label' => esc_html__( 'Preset 3', 'shopbuilder' ),
3254 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-3.png' ) ),
3255 ],
3256
3257 'preset4' => [
3258 'title' => esc_html__( 'Preset 4', 'shopbuilder' ),
3259 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-4.png' ) ),
3260 ],
3261 ],
3262 'dependency' => [
3263 'rules' => [
3264 [
3265 'item' => 'modules.product_badges.badges_field.badges_type',
3266 'value' => 'text',
3267 'operator' => '==',
3268 ],
3269 ],
3270 ],
3271 ],
3272 'badges_text' => [
3273 'id' => 'badges_text',
3274 'label' => esc_html__( 'Enter Badge Text', 'shopbuilder' ),
3275 'help' => esc_html__( 'The badge text will be displayed when the dynamic percentage switch is turned off.', 'shopbuilder' ),
3276 'type' => 'text',
3277 'placeholder' => 'Badge Text',
3278 'value' => esc_html__( 'New', 'shopbuilder' ),
3279 'dependency' => [
3280 'rules' => [
3281 [
3282 'item' => 'modules.product_badges.badges_field.badges_type',
3283 'value' => 'text',
3284 'operator' => '==',
3285 ],
3286 ],
3287 ],
3288 ],
3289 'show_badges_percent_text' => [
3290 'id' => 'show_badges_percent_text',
3291 'type' => 'switch',
3292 // 'isPro' => ! rtsb()->has_pro(),
3293 'label' => esc_html__( 'Show Badges Percentage (%)', 'shopbuilder' ),
3294 'help' => esc_html__( 'Switch on to show badge as dynamic percentage instead of text.', 'shopbuilder' ),
3295 'dependency' => [
3296 'rules' => [
3297 [
3298 'item' => 'modules.product_badges.badges_field.badge_for',
3299 'value' => 'on_sale',
3300 'operator' => '==',
3301 ],
3302 [
3303 'item' => 'modules.product_badges.badges_field.badges_type',
3304 'value' => 'text',
3305 'operator' => '==',
3306 ],
3307 [
3308 'item' => 'modules.product_badges.badges_field.badge_condition',
3309 'value' => 'dynamic',
3310 'operator' => '==',
3311 ],
3312
3313 ],
3314 ],
3315 ],
3316
3317 'upload_image' => [
3318 'id' => 'upload_image',
3319 'type' => 'fileupload',
3320 'label' => esc_html__( 'Upload Image', 'shopbuilder' ),
3321 'help' => esc_html__( 'Upload badge image.', 'shopbuilder' ),
3322 'tab' => 'general',
3323 'dependency' => [
3324 'rules' => [
3325 [
3326 'item' => 'modules.product_badges.badges_field.badges_type',
3327 'value' => 'image',
3328 'operator' => '==',
3329 ],
3330 ],
3331 ],
3332 ],
3333
3334 'apply_for' => [
3335 'id' => 'apply_for',
3336 'type' => 'select',
3337 'value' => 'product',
3338 'isPro' => ! rtsb()->has_pro(),
3339 'label' => esc_html__( 'Applicable For', 'shopbuilder' ),
3340 'options' => [
3341 'product' => esc_html__( 'Products', 'shopbuilder' ),
3342 'product_cat' => esc_html__( 'Product Categories', 'shopbuilder' ),
3343 ],
3344 'help' => esc_html__( 'Badges will apply for selected products, or categories.', 'shopbuilder' ),
3345 ],
3346 'applicable_products' => [
3347 'id' => 'applicable_products',
3348 'type' => 'search_and_multi_select',
3349 'label' => esc_html__( 'Applicable Products', 'shopbuilder' ),
3350 'help' => esc_html__( 'Choose products to include. Leave blank to apply in all product.', 'shopbuilder' ),
3351 'placeholder' => esc_html__( 'Search Products', 'shopbuilder' ),
3352 'func_with_param' => [ Fns::class, 'get_post_types', [ 'post_type' => 'product' ] ],
3353 'options' => Fns::get_post_types( null, [ 'post_type' => 'product' ] ),
3354 'dependency' => [
3355 'rules' => [
3356 [
3357 'item' => 'modules.product_badges.badges_field.apply_for',
3358 'value' => 'product',
3359 'operator' => '==',
3360 ],
3361 ],
3362 ],
3363 ],
3364 'applicable_categories' => [
3365 'id' => 'applicable_categories',
3366 'type' => 'search_and_multi_select',
3367 'label' => esc_html__( 'Applicable Categories', 'shopbuilder' ),
3368 'help' => esc_html__( 'Choose categories to include. Leave blank to apply in all categories.', 'shopbuilder' ),
3369 'placeholder' => esc_html__( 'Search Category', 'shopbuilder' ),
3370 'func_with_param' => [
3371 Fns::class,
3372 'products_category_query',
3373 ],
3374 'options' => Fns::products_category_query(),
3375 'dependency' => [
3376 'rules' => [
3377 [
3378 'item' => 'modules.product_badges.badges_field.apply_for',
3379 'value' => 'product_cat',
3380 'operator' => '==',
3381 ],
3382 ],
3383 ],
3384 ],
3385 'exclude_product' => [
3386 'id' => 'exclude_product',
3387 'type' => 'search_and_multi_select',
3388 'isPro' => ! rtsb()->has_pro(),
3389 'label' => esc_html__( 'Exclude Products', 'shopbuilder' ),
3390 'help' => esc_html__( 'Choose products to exclude. Leave blank to exclude none.', 'shopbuilder' ),
3391 'placeholder' => esc_html__( 'Search Products', 'shopbuilder' ),
3392 'func_with_param' => [ Fns::class, 'get_post_types', [ 'post_type' => 'product' ] ],
3393 'options' => Fns::get_post_types( null, [ 'post_type' => 'product' ] ),
3394 ],
3395
3396 /**
3397 * Style Settings
3398 */
3399 'styles_settings' => [
3400 'id' => 'styles_settings',
3401 'type' => 'title',
3402 'label' => esc_html__( 'Style Settings', 'shopbuilder' ),
3403 ],
3404 'badge_text_color' => [
3405 'id' => 'badge_text_color',
3406 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
3407 'type' => 'color',
3408 'dependency' => [
3409 'rules' => [
3410 [
3411 'item' => 'modules.product_badges.badges_field.badges_type',
3412 'value' => 'text',
3413 'operator' => '==',
3414 ],
3415 ],
3416 ],
3417 ],
3418 'badge_bg_color' => [
3419 'id' => 'badge_bg_color',
3420 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
3421 'type' => 'color',
3422 'dependency' => [
3423 'rules' => [
3424 [
3425 'item' => 'modules.product_badges.badges_field.badges_type',
3426 'value' => 'text',
3427 'operator' => '==',
3428 ],
3429 [
3430 'item' => 'modules.product_badges.badges_field.badges_type',
3431 'value' => 'text',
3432 'operator' => '==',
3433 ],
3434 [
3435 'item' => 'modules.product_badges.badges_field.badge_preset',
3436 'value' => [ 'preset1', 'preset2' ],
3437 'operator' => 'in',
3438 ],
3439 ],
3440 ],
3441 ],
3442 'badge_border_color' => [
3443 'id' => 'badge_border_color',
3444 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
3445 'type' => 'color',
3446 'dependency' => [
3447 'rules' => [
3448 [
3449 'item' => 'modules.product_badges.badges_field.badges_type',
3450 'value' => 'text',
3451 'operator' => '==',
3452 ],
3453 [
3454 'item' => 'modules.product_badges.badges_field.badges_type',
3455 'value' => 'text',
3456 'operator' => '==',
3457 ],
3458 [
3459 'item' => 'modules.product_badges.badges_field.badge_preset',
3460 'value' => [ 'preset3', 'preset4' ],
3461 'operator' => 'in',
3462 ],
3463 ],
3464 ],
3465 ],
3466 'badge_font_size' => [
3467 'id' => 'badge_font_size',
3468 'type' => 'text',
3469 'label' => esc_html__( 'Font Size', 'shopbuilder' ),
3470 'help' => esc_html__( 'Example: 14px', 'shopbuilder' ),
3471 'dependency' => [
3472 'rules' => [
3473 [
3474 'item' => 'modules.product_badges.badges_field.badges_type',
3475 'value' => 'text',
3476 'operator' => '==',
3477 ],
3478 ],
3479 ],
3480 ],
3481 'badge_font_width' => [
3482 'id' => 'badge_font_width',
3483 'type' => 'select',
3484 'value' => '400',
3485 'label' => esc_html__( 'Font Weight', 'shopbuilder' ),
3486 'options' => [
3487 '100' => '100',
3488 '200' => '200',
3489 '300' => '300',
3490 '400' => '400',
3491 '500' => '500',
3492 '600' => '600',
3493 '700' => '700',
3494 '800' => '800',
3495 '900' => '900',
3496 'normal' => 'normal',
3497 'bold' => 'bold',
3498 'bolder' => 'bolder',
3499 'lighter' => 'lighter',
3500 'initial' => 'initial',
3501 'inherit' => 'inherit',
3502 ],
3503 'dependency' => [
3504 'rules' => [
3505 [
3506 'item' => 'modules.product_badges.badges_field.badges_type',
3507 'value' => 'text',
3508 'operator' => '==',
3509 ],
3510 ],
3511 ],
3512 ],
3513 'badge_width' => [
3514 'id' => 'badge_width',
3515 'type' => 'text',
3516 'label' => esc_html__( 'Width', 'shopbuilder' ),
3517 'help' => esc_html__( 'Example: 150px', 'shopbuilder' ),
3518 'dependency' => [
3519 'rules' => [
3520 [
3521 'item' => 'modules.product_badges.badges_field.badges_type',
3522 'value' => 'image',
3523 'operator' => '==',
3524 ],
3525 ],
3526 ],
3527 ],
3528 'badge_height' => [
3529 'id' => 'badge_height',
3530 'type' => 'text',
3531 'label' => esc_html__( 'Height', 'shopbuilder' ),
3532 'help' => esc_html__( 'Example: 50px', 'shopbuilder' ),
3533 'dependency' => [
3534 'rules' => [
3535 [
3536 'item' => 'modules.product_badges.badges_field.badges_type',
3537 'value' => 'image',
3538 'operator' => '==',
3539 ],
3540 ],
3541 ],
3542 ],
3543 'border_radius' => [
3544 'id' => 'border_radius',
3545 'type' => 'text',
3546 'size' => 'small',
3547 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
3548 'help' => esc_html__( 'Example: 20px 20px 20px 20px Or 20px', 'shopbuilder' ),
3549 'dependency' => [
3550 'rules' => [
3551 [
3552 'item' => 'modules.product_badges.badges_field.badges_type',
3553 'value' => 'text',
3554 'operator' => '==',
3555 ],
3556 ],
3557 ],
3558 ],
3559 'badge_padding' => [
3560 'id' => 'badge_padding',
3561 'type' => 'text',
3562 'size' => 'small',
3563 'label' => esc_html__( 'Padding', 'shopbuilder' ),
3564 'help' => esc_html__( 'Example: 10px 15px 10px 15px', 'shopbuilder' ),
3565 'dependency' => [
3566 'rules' => [
3567 [
3568 'item' => 'modules.product_badges.badges_field.badges_type',
3569 'value' => 'text',
3570 'operator' => '==',
3571 ],
3572 ],
3573 ],
3574 ],
3575 ],
3576 ],
3577
3578 ]
3579 );
3580 }
3581
3582 /**
3583 * Dynamic badge list.
3584 *
3585 * @return array
3586 */
3587 public function dynamic_badge_list() {
3588 $items = [
3589 'on_sale' => esc_html__( 'Products On Sale', 'shopbuilder' ),
3590 'featured' => esc_html__( 'Featured Products', 'shopbuilder' ),
3591 'out_of_stock' => esc_html__( 'Out Of Stock Products', 'shopbuilder' ),
3592 'best_selling' => esc_html__( 'Best Selling Products', 'shopbuilder' ),
3593 'new_arrival' => esc_html__( 'New Arrival Products', 'shopbuilder' ),
3594 ];
3595
3596 if ( rtsb()->has_pro() && method_exists( FnsPro::class, 'is_module_active' ) && FnsPro::is_module_active( 'pre_order' ) ) {
3597 $items['pre_order'] = esc_html__( 'Pre-Order Products', 'shopbuilder' );
3598 }
3599
3600 return $items;
3601 }
3602 }
3603