PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.5.3
ShopBuilder – WooCommerce Builder For Elementor v2.5.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.5.3, at app/Models/ModuleList.php

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