PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.0.0
ShopBuilder – WooCommerce Builder For Elementor v3.0.0
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
← All changes | app/Models/ModuleList.php +3405 -87 2.0.33.0.0 View file →
@@ -1,25 +1,49 @@
1 1 <?php
2 +/**
3 + * ShopBuilder Module List.
4 + *
5 + * @package RadiusTheme\SB
6 + */
2 7
3 8 namespace RadiusTheme\SB\Models;
4 9
5 10 use RadiusTheme\SB\Helpers\Fns;
6 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\Modules\VariationGallery\VariationGalleryInit;
17 +use RadiusTheme\SB\Modules\VariationSwatches\SwatchesFns;
18 +use RadiusTheme\SB\Modules\VariationSwatches\VariationSwatches;
19 +use RadiusTheme\SB\Traits\SingletonTrait;
7 20 use RadiusTheme\SB\Modules\Compare\Compare;
21 +use RadiusTheme\SB\Modules\WishList\Wishlist;
8 22 use RadiusTheme\SB\Modules\Compare\CompareFns;
9 23 use RadiusTheme\SB\Modules\QuickView\QuickView;
10 -use RadiusTheme\SB\Modules\WishList\Wishlist;
11 24 use RadiusTheme\SB\Modules\WishList\WishlistFns;
12 -use RadiusTheme\SB\Traits\SingletonTrait;
25 +use RadiusTheme\SBPRO\Helpers\FnsPro;
13 26
14 27 defined( 'ABSPATH' ) || exit;
15 28
29 +/**
30 + * ShopBuilder Module List.
31 + */
16 32 class ModuleList extends ListModel {
17 33
18 34 use SingletonTrait;
19 35
36 + /**
37 + * List ID.
38 + *
39 + * @var string
40 + */
20 41 protected $list_id = 'modules';
21 42
43 + /**
44 + * Class constructor.
45 + */
22 46 public function __construct() {
23 47 parent::__construct();
24 48 $this->title = esc_html__( 'Modules', 'shopbuilder' );
25 49 $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' );
@@ -24,11 +48,16 @@
24 48 $this->title = esc_html__( 'Modules', 'shopbuilder' );
25 49 $this->description = esc_html__( 'Here you can find the list of all the modules. You can individually enable or disable the modules. Or you can do that by one click.', 'shopbuilder' );
26 50 }
27 51
52 + /**
53 + * Module list.
54 + *
55 + * @return mixed|null
56 + */
28 57 protected function raw_list() {
29 58 $list = [
30 - 'quick_view' => apply_filters(
59 + 'quick_view' => apply_filters(
31 60 'rtsb/module/quick_view/options',
32 61 [
33 62 'id' => 'quick_view',
34 63 'title' => esc_html__( 'Quick View', 'shopbuilder' ),
@@ -39,8 +68,16 @@
39 68 'active_field' => [
40 69 'label' => esc_html__( 'Enable Quick View?', 'shopbuilder' ),
41 70 'help' => esc_html__( 'Switch on to enable quick view module.', 'shopbuilder' ),
42 71 ],
72 + 'tabs' => [
73 + 'general' => [
74 + 'title' => esc_html__( 'General', 'shopbuilder' ),
75 + ],
76 + 'style' => [
77 + 'title' => esc_html__( 'Style', 'shopbuilder' ),
78 + ],
79 + ],
43 80 'fields' => apply_filters(
44 81 'rtsb/module/quick_view/fields',
45 82 [
46 83 'loop_btn_position' => [
@@ -48,8 +85,9 @@
48 85 'type' => 'select',
49 86 'value' => 'custom',
50 87 'label' => esc_html__( 'Shop Page Button Position', 'shopbuilder' ),
51 88 'help' => esc_html__( 'You can manage quick view button position in shop page.', 'shopbuilder' ),
89 + 'tab' => 'general',
52 90 'options' => [
53 91 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
54 92 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
55 93 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
@@ -54,8 +92,9 @@
54 92 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
55 93 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
56 94 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
57 95 ],
96 +
58 97 ],
59 98 'loop_btn_position_shortcode' => [
60 99 'type' => 'raw',
61 100 'label' => ' ',
@@ -63,8 +102,9 @@
63 102 /* translators: 1: The shortcode.*/
64 103 esc_html__( 'Choose where to show button in WooCommerce product\'s loop. Copy this shortcode %1$s and paste it where you want to show the button.', 'shopbuilder' ),
65 104 '<code>[rtsb_quick_view_button]</code>'
66 105 ),
106 + 'tab' => 'general',
67 107 'dependency' => [
68 108 'rules' => [
69 109 [
70 110 'item' => 'modules.quick_view.loop_btn_position',
@@ -80,10 +120,11 @@
80 120 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
81 121 'help' => sprintf(
82 122 /* translators: 1: The shortcode.*/
83 123 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
84 - "<code>&lt;?php do_action( 'rtsb/modules/quick_view/frontend/display' ); ?&gt;</code>"
124 + "<br /><code>&lt;?php do_action( 'rtsb/modules/quick_view/frontend/display' ); ?&gt;</code><br />"
85 125 ),
126 + 'tab' => 'general',
86 127 'dependency' => [
87 128 'rules' => [
88 129 [
89 130 'item' => 'modules.quick_view.loop_btn_position',
@@ -100,8 +141,9 @@
100 141 'size' => 'small',
101 142 'min' => 0,
102 143 'max' => 999,
103 144 'label' => esc_html__( 'Hook Priority', 'shopbuilder' ),
145 + 'tab' => 'general',
104 146 'dependency' => [
105 147 'rules' => [
106 148 [
107 149 'item' => 'modules.quick_view.loop_btn_position',
@@ -117,14 +159,69 @@
117 159 'help' => esc_html__( 'Enter your quick view button text.', 'shopbuilder' ),
118 160 'type' => 'text',
119 161 'value' => 'Quick View',
120 162 'placeholder' => 'Quick View',
163 + 'tab' => 'general',
121 164 ],
165 +
166 + // Module Style.
167 + 'modal_width' => [
168 + 'id' => 'modal_width',
169 + 'label' => esc_html__( 'Modal Width (in px)', 'shopbuilder' ),
170 + 'help' => esc_html__( 'Quick view button modal width. Example: 950', 'shopbuilder' ),
171 + 'type' => 'number',
172 + 'value' => '',
173 + 'tab' => 'style',
174 + ],
175 +
176 + 'modal_height' => [
177 + 'id' => 'modal_height',
178 + 'label' => esc_html__( 'Modal Height', 'shopbuilder' ),
179 + 'help' => esc_html__( 'Quick view button modal height. Example: 450px', 'shopbuilder' ),
180 + 'type' => 'text',
181 + 'value' => '',
182 + 'tab' => 'style',
183 + ],
184 +
185 + 'modal_wrapper_padding' => [
186 + 'id' => 'modal_wrapper_padding',
187 + 'label' => esc_html__( 'Modal Wrapper Padding', 'shopbuilder' ),
188 + 'help' => esc_html__( 'Quick view modal wrapper padding. Example 1: 20px, Example 2: 20px 20px 20px 20px', 'shopbuilder' ),
189 + 'type' => 'text',
190 + 'value' => '',
191 + 'tab' => 'style',
192 + ],
193 + 'modal_bg_color' => [
194 + 'id' => 'modal_bg_color',
195 + 'label' => esc_html__( 'Modal Backgroud Color', 'shopbuilder' ),
196 + 'help' => esc_html__( 'Quick view modal background color. Example: #fff', 'shopbuilder' ),
197 + 'type' => 'color',
198 + 'value' => '',
199 + 'tab' => 'style',
200 + ],
201 + 'modal_box_shadow_color' => [
202 + 'id' => 'modal_box_shadow_color',
203 + 'label' => esc_html__( 'Modal Box Shadow Color', 'shopbuilder' ),
204 + 'help' => esc_html__( 'Quick view modal box shadow. Example: #000', 'shopbuilder' ),
205 + 'type' => 'color',
206 + 'value' => '',
207 + 'tab' => 'style',
208 + ],
209 +
210 + 'modal_overly_color' => [
211 + 'id' => 'modal_overly_color',
212 + 'label' => esc_html__( 'Modal Overly Color', 'shopbuilder' ),
213 + 'help' => esc_html__( 'Quick view modal overly. Example: #000', 'shopbuilder' ),
214 + 'type' => 'color',
215 + 'value' => '',
216 + 'tab' => 'style',
217 + ],
218 +
122 219 ]
123 220 ),
124 221 ]
125 222 ),
126 - 'wishlist' => apply_filters(
223 + 'wishlist' => apply_filters(
127 224 'rtsb/module/wishlist/options',
128 225 [
129 226 'id' => 'wishlist',
130 227 'title' => esc_html__( 'Wishlist', 'shopbuilder' ),
@@ -145,12 +242,28 @@
145 242 'label' => esc_html__( 'Limit Wishlist Use', 'shopbuilder' ),
146 243 'help' => esc_html__( 'Enable this option to allow only the logged-in users to use the Wishlist feature.', 'shopbuilder' ),
147 244 'tab' => 'general',
148 245 ],
246 + 'hide_wishlist_non_logged_in' => [
247 + 'id' => 'hide_wishlist_non_logged_in',
248 + 'type' => 'switch',
249 + 'label' => esc_html__( 'Hide Wishlist Button', 'shopbuilder' ),
250 + 'help' => esc_html__( 'Hide Wishlist Button For non logged-in users (guest users).', 'shopbuilder' ),
251 + 'dependency' => [
252 + 'rules' => [
253 + [
254 + 'item' => 'modules.wishlist.enable_login_limit',
255 + 'value' => 'on',
256 + 'operator' => '==',
257 + ],
258 + ],
259 + ],
260 + 'tab' => 'general',
261 + ],
149 262 'wishlist_shop_wrapper_heading' => [
150 263 'id' => 'wishlist_shop_wrapper_heading',
151 264 'type' => 'title',
152 - 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder-pro' ),
265 + 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder' ),
153 266 'tab' => 'button',
154 267 ],
155 268 'show_btn_on_loop' => [
156 269 'id' => 'show_btn_on_loop',
@@ -213,9 +326,9 @@
213 326 'tab' => 'button',
214 327 'help' => sprintf(
215 328 /* translators: 1: The shortcode.*/
216 329 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
217 - "<code>&lt;?php do_action('rtsb/modules/wishlist/frontend/display' ); ?&gt;</code>"
330 + "<br /><code>&lt;?php do_action('rtsb/modules/wishlist/frontend/display' ); ?&gt;</code><br />"
218 331 ),
219 332 'dependency' => [
220 333 'rules' => [
221 334 [
@@ -258,9 +371,9 @@
258 371 ],
259 372 'wishlist_single_wrapper_heading' => [
260 373 'id' => 'wishlist_single_wrapper_heading',
261 374 'type' => 'title',
262 - 'label' => esc_html__( 'Product Page Settings', 'shopbuilder-pro' ),
375 + 'label' => esc_html__( 'Product Page Settings', 'shopbuilder' ),
263 376 'tab' => 'button',
264 377 ],
265 378 'show_btn_product_page' => [
266 379 'id' => 'show_btn_product_page',
@@ -325,9 +438,9 @@
325 438 'tab' => 'button',
326 439 'help' => sprintf(
327 440 /* translators: 1: The shortcode.*/
328 441 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
329 - "<code>&lt;?php do_action('rtsb/modules/wishlist/frontend/display' ); ?&gt;</code>"
442 + "<br /><code>&lt;?php do_action('rtsb/modules/wishlist/frontend/display' ); ?&gt;</code><br />"
330 443 ),
331 444 'dependency' => [
332 445 'rules' => [
333 446 [
@@ -403,27 +516,8 @@
403 516 'value' => esc_html__( 'Browse Wishlist', 'shopbuilder' ),
404 517 'placeholder' => esc_html__( 'Browse Wishlist', 'shopbuilder' ),
405 518 'tab' => 'general',
406 519 ],
407 - /*
408 - * TODO:: Will Implement Later.
409 - 'redirect_cart' => array(
410 - 'id' => 'redirect_cart',
411 - 'type' => 'switch',
412 - 'help' => esc_html__( 'Redirect users to the cart page when they add a product to the cart from the wishlist page', 'shopbuilder' ),
413 - 'label' => esc_html__( 'Redirect to Cart', 'shopbuilder' ),
414 - 'tab' => 'page',
415 - ),
416 - 'remove_after_add_to_cart' => array(
417 - 'value' => 'on',
418 - 'id' => 'remove_after_add_to_cart',
419 - 'type' => 'switch',
420 - 'help' => esc_html__( 'Remove the product from the wishlist after it has been added to the cart', 'shopbuilder' ),
421 - 'label' => esc_html__( 'Remove if Added to Cart', 'shopbuilder' ),
422 - 'tab' => 'page',
423 - ),
424 - */
425 -
426 520 'page' => [
427 521 'id' => 'page',
428 522 'type' => 'select',
429 523 'label' => esc_html__( 'Select Wishlist Page', 'shopbuilder' ),
@@ -431,13 +525,12 @@
431 525 /* translators: 1: The shortcode.*/
432 526 esc_html__( 'Select a page for wishlist page and make sure you add the shortcode %1$s into the page content', 'shopbuilder' ),
433 527 '<code>[rtsb_wishlist]</code>'
434 528 ),
435 - 'options' => Fns::get_pages(),
529 + 'options' => Fns::get_pages(),
436 530 'tab' => 'page',
437 531 ],
438 -
439 - 'page_show_fields' => [
532 + 'page_show_fields' => [
440 533 'value' => WishlistFns::instance()->get_field_ids(),
441 534 'id' => 'page_show_fields',
442 535 'multiple' => true,
443 536 'checkbox' => true,
@@ -462,9 +555,9 @@
462 555 ],
463 556 ],
464 557 ]
465 558 ),
466 - 'compare' => apply_filters(
559 + 'compare' => apply_filters(
467 560 'rtsb/module/compare/options',
468 561 [
469 562 'id' => 'compare',
470 563 'base_class' => Compare::class,
@@ -481,9 +574,9 @@
481 574 [
482 575 'compare_shop_wrapper_heading' => [
483 576 'id' => 'compare_shop_wrapper_heading',
484 577 'type' => 'title',
485 - 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder-pro' ),
578 + 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder' ),
486 579 'tab' => 'button',
487 580 ],
488 581 'show_btn_on_loop' => [
489 582 'id' => 'show_btn_on_loop',
@@ -546,9 +639,9 @@
546 639 'tab' => 'button',
547 640 'help' => sprintf(
548 641 /* translators: 1: The shortcode.*/
549 642 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
550 - "<code>&lt;?php do_action('rtsb/modules/compare/frontend/display' ); ?&gt;</code>"
643 + "<br /><code>&lt;?php do_action('rtsb/modules/compare/frontend/display' ); ?&gt;</code><br />"
551 644 ),
552 645 'dependency' => [
553 646 'rules' => [
554 647 [
@@ -591,9 +684,9 @@
591 684 ],
592 685 'compare_single_wrapper_heading' => [
593 686 'id' => 'compare_single_wrapper_heading',
594 687 'type' => 'title',
595 - 'label' => esc_html__( 'Product Page Settings', 'shopbuilder-pro' ),
688 + 'label' => esc_html__( 'Product Page Settings', 'shopbuilder' ),
596 689 'tab' => 'button',
597 690 ],
598 691 'show_btn_product_page' => [
599 692 'id' => 'show_btn_product_page',
@@ -632,19 +725,19 @@
632 725 'label' => ' ',
633 726 'html' => sprintf(
634 727 /* translators: 1: The shortcode.*/
635 728 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' ),
636 - '<code>[rtsb_wishlist_button]</code> '
729 + '<code>[rtsb_compare_button]</code> '
637 730 ),
638 731 'dependency' => [
639 732 'rules' => [
640 733 [
641 - 'item' => 'modules.wishlist.show_btn_product_page',
734 + 'item' => 'modules.compare.show_btn_product_page',
642 735 'value' => 'on',
643 736 'operator' => '==',
644 737 ],
645 738 [
646 - 'item' => 'modules.wishlist.product_btn_position',
739 + 'item' => 'modules.compare.product_btn_position',
647 740 'value' => 'shortcode',
648 741 'operator' => '==',
649 742 ],
650 743 ],
@@ -658,9 +751,9 @@
658 751 'tab' => 'button',
659 752 'help' => sprintf(
660 753 /* translators: 1: The shortcode.*/
661 754 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
662 - "<code>&lt;?php do_action('rtsb/modules/compare/frontend/display' ); ?&gt;</code>"
755 + "<br /><code>&lt;?php do_action('rtsb/modules/compare/frontend/display' ); ?&gt;</code><br />"
663 756 ),
664 757 'dependency' => [
665 758 'rules' => [
666 759 [
@@ -786,27 +879,80 @@
786 879
787 880 ],
788 881 ]
789 882 ),
790 - 'variation_gallery' => apply_filters(
883 + /**
884 + 'variation_swatches' => apply_filters(
885 + 'rtsb/module/variation_swatches/options',
886 + [
887 + 'id' => 'variation_swatches',
888 + 'title' => esc_html__( 'Variation Swatches', 'shopbuilder' ),
889 + 'package' => 'free',
890 + 'active' => 'on',
891 + 'base_class' => VariationSwatches::class,
892 + 'category' => 'general',
893 + 'active_field' => [
894 + 'label' => esc_html__( 'Enable Variation Swatches Module?', 'shopbuilder' ),
895 + 'help' => esc_html__( 'Switch on to enable variation swatches module.', 'shopbuilder' ),
896 + ],
897 + 'tabs' => [
898 + 'general' => [
899 + 'title' => esc_html__( 'General', 'shopbuilder' ),
900 + ],
901 + 'showcase_shop' => [
902 + 'title' => esc_html__( 'Showcase / Shop', 'shopbuilder' ),
903 + ],
904 + 'style' => [
905 + 'title' => esc_html__( 'Style', 'shopbuilder' ),
906 + ],
907 + ],
908 + 'fields' => $this->get_variation_swatches_fields(),
909 + ]
910 + ),
911 + 'variation_gallery' => apply_filters(
791 912 'rtsb/module/variation_gallery/options',
792 913 [
793 - 'id' => 'variation_gallery',
914 + 'id' => 'variation_gallery',
915 + 'title' => esc_html__( 'Variation Gallery', 'shopbuilder' ),
916 + 'package' => 'free',
917 + 'active' => 'on',
918 + 'base_class' => VariationGalleryInit::class,
919 + 'category' => 'general',
920 + 'active_field' => [
921 + 'label' => esc_html__( 'Enable Variation Gallery Module?', 'shopbuilder' ),
922 + 'help' => esc_html__( 'Switch on to enable variation gallery module.', 'shopbuilder' ),
923 + ],
924 + 'tabs' => [
925 + 'general' => [
926 + 'title' => esc_html__( 'General', 'shopbuilder' ),
927 + ],
928 + 'style' => [
929 + 'title' => esc_html__( 'Style', 'shopbuilder' ),
930 + ],
931 + ],
932 + 'fields' => $this->get_variation_gallery_fields(),
933 + ]
934 + ),
935 + */
936 + 'variation_swatches' => apply_filters(
937 + 'rtsb/module/variation_swatches/options',
938 + [
939 + 'id' => 'variation_swatches',
794 940 'external' => true,
795 941 'category' => 'general',
796 - 'title' => esc_html__( 'Variation Gallery', 'shopbuilder' ),
797 - 'pluginSlug' => 'woo-product-variation-gallery',
798 - 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-gallery/woo-product-variation-gallery.php' ),
799 - 'pluginIsActive' => Fns::check_plugin_active( 'woo-product-variation-gallery/woo-product-variation-gallery.php' ),
942 + 'title' => esc_html__( 'Variation Swatches', 'shopbuilder' ),
943 + 'pluginSlug' => 'woo-product-variation-swatches',
944 + 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-swatches/woo-product-variation-swatches.php' ),
945 + 'pluginIsActive' => Fns::check_plugin_active( 'woo-product-variation-swatches/woo-product-variation-swatches.php' ),
800 946 'pluginActiveUrl' => add_query_arg(
801 947 [
802 - '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-gallery/woo-product-variation-gallery.php' ),
948 + '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-swatches/woo-product-variation-swatches.php' ),
803 949 'action' => 'activate',
804 - 'plugin' => 'woo-product-variation-gallery/woo-product-variation-gallery.php',
950 + 'plugin' => 'woo-product-variation-swatches/woo-product-variation-swatches.php',
805 951 ],
806 952 admin_url( 'plugins.php' )
807 953 ),
808 - 'help' => esc_html__( 'This module requires: Variation Images Gallery for WooCommerce Plugin', 'shopbuilder' ),
954 + 'help' => __( 'This module requires: <a href="https://wordpress.org/plugins/woo-product-variation-swatches/">Variation Swatches for WooCommerce</a>.', 'shopbuilder' ),
809 955 'package' => 'free',
810 956 'active_field' => [
811 957 'disable' => false,
812 958 ],
@@ -812,27 +958,27 @@
812 958 ],
813 959 'fields' => [],
814 960 ]
815 961 ),
816 - 'variation_swatches' => apply_filters(
817 - 'rtsb/module/variation_swatches/options',
962 + 'variation_gallery' => apply_filters(
963 + 'rtsb/module/variation_gallery/options',
818 964 [
819 - 'id' => 'variation_swatches',
965 + 'id' => 'variation_gallery',
820 966 'external' => true,
821 967 'category' => 'general',
822 - 'title' => esc_html__( 'Variation Swatches', 'shopbuilder' ),
823 - 'pluginSlug' => 'woo-product-variation-swatches',
824 - 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-swatches/woo-product-variation-swatches.php' ),
825 - 'pluginIsActive' => Fns::check_plugin_active( 'woo-product-variation-swatches/woo-product-variation-swatches.php' ),
968 + 'title' => esc_html__( 'Variation Gallery', 'shopbuilder' ),
969 + 'pluginSlug' => 'woo-product-variation-gallery',
970 + 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-gallery/woo-product-variation-gallery.php' ),
971 + 'pluginIsActive' => Fns::check_plugin_active( 'woo-product-variation-gallery/woo-product-variation-gallery.php' ),
826 972 'pluginActiveUrl' => add_query_arg(
827 973 [
828 - '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-swatches/woo-product-variation-swatches.php' ),
974 + '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-gallery/woo-product-variation-gallery.php' ),
829 975 'action' => 'activate',
830 - 'plugin' => 'woo-product-variation-swatches/woo-product-variation-swatches.php',
976 + 'plugin' => 'woo-product-variation-gallery/woo-product-variation-gallery.php',
831 977 ],
832 978 admin_url( 'plugins.php' )
833 979 ),
834 - 'help' => esc_html__( 'This module requires: Variation Swatches for WooCommerce Plugin.', 'shopbuilder' ),
980 + 'help' => __( 'This module requires: <a href="https://wordpress.org/plugins/woo-product-variation-gallery/">Variation Images Gallery for WooCommerce</a>.', 'shopbuilder' ),
835 981 'package' => 'free',
836 982 'active_field' => [
837 983 'disable' => false,
838 984 ],
@@ -838,37 +984,222 @@
838 984 ],
839 985 'fields' => [],
840 986 ]
841 987 ),
842 - 'sales_notification' => apply_filters(
843 - 'rtsb/module/sales_notification/options',
988 + 'product_badges' => apply_filters(
989 + 'rtsb/module/product_badges/options',
844 990 [
845 - 'id' => 'sales_notification',
991 + 'id' => 'product_badges',
846 992 'active' => '',
847 - 'title' => esc_html__( 'Sales Notification', 'shopbuilder' ),
848 - 'package' => $this->pro_package(),
993 + 'title' => esc_html__( 'Product Badges', 'shopbuilder' ),
994 + 'package' => 'free',
849 995 'active_field' => [
850 - 'label' => esc_html__( 'Enable Sales Notification?', 'shopbuilder' ),
851 - 'help' => esc_html__( 'Switch on to enable Sales Notification module.', 'shopbuilder' ),
996 + 'label' => esc_html__( 'Enable Product Badges?', 'shopbuilder' ),
997 + 'help' => esc_html__( 'Switch on to enable product badges module.', 'shopbuilder' ),
852 998 ],
853 - 'fields' => [],
999 + 'base_class' => Badges::class,
1000 + 'fields' => $this->product_badges_fields(),
1001 + 'tabs' => [
1002 + 'general' => [
1003 + 'title' => esc_html__( 'General', 'shopbuilder' ),
1004 + ],
1005 + 'group' => [
1006 + 'title' => esc_html__( 'Settings', 'shopbuilder' ),
1007 + ],
1008 + 'badges' => [
1009 + 'title' => esc_html__( 'Create Badges', 'shopbuilder' ),
1010 + ],
1011 + ],
854 1012 ]
855 1013 ),
856 - 'flash_sale_countdown' => apply_filters(
857 - 'rtsb/module/flash_sale_countdown/options',
1014 + 'checkout_fields_editor' => apply_filters(
1015 + 'rtsb/module/checkout_fields_editor/options',
858 1016 [
859 - 'id' => 'flash_sale_countdown',
1017 + 'id' => 'checkout_fields_editor',
860 1018 'active' => '',
861 - 'title' => esc_html__( 'Flash Sale Countdown', 'shopbuilder' ),
862 - 'package' => $this->pro_package(),
1019 + 'title' => esc_html__( 'Checkout Fields Editor', 'shopbuilder' ),
1020 + 'base_class' => CheckoutEditorInit::class,
863 1021 'active_field' => [
864 - 'label' => esc_html__( 'Enable Flash Sale Countdown?', 'shopbuilder' ),
865 - 'help' => esc_html__( 'Switch on to enable Flash Sale Countdown module.', 'shopbuilder' ),
1022 + 'label' => esc_html__( 'Enable Checkout Fields Editor?', 'shopbuilder' ),
1023 + 'help' => esc_html__( 'Switch on to enable Checkout Fields Editor module.', 'shopbuilder' ),
866 1024 ],
867 - 'fields' => [],
1025 + 'fields' => [
1026 + 'checkout_billing_intro' => [
1027 + 'id' => 'checkout_billing_intro',
1028 + 'type' => 'description',
1029 + 'text' => esc_html__( 'Billing Fields Editor allows you to customize the default billing fields on your checkout page.', 'shopbuilder' ),
1030 + 'tab' => 'billing_fields',
1031 + ],
1032 + 'modify_billing_form' => [
1033 + 'id' => 'modify_billing_form',
1034 + 'type' => 'switch',
1035 + 'label' => esc_html__( 'Customize Billing Form?', 'shopbuilder' ),
1036 + 'help' => esc_html__( 'Enable this option to edit billing Form.', 'shopbuilder' ),
1037 + 'tab' => 'billing_fields',
1038 + ],
1039 +
1040 + 'checkout_billing_fields_info' => [
1041 + 'id' => 'checkout_billing_fields_info',
1042 + 'type' => 'title',
1043 + 'label' => esc_html__( 'Billing Fields', 'shopbuilder' ),
1044 + 'tab' => 'billing_fields',
1045 + 'dependency' => [
1046 + 'rules' => [
1047 + [
1048 + 'item' => 'modules.checkout_fields_editor.modify_billing_form',
1049 + 'value' => 'on',
1050 + 'operator' => '==',
1051 + ],
1052 + ],
1053 + ],
1054 + ],
1055 + 'checkout_billing_fields' => [
1056 + 'id' => 'checkout_billing_fields',
1057 + 'type' => 'checkout_fields',
1058 + 'tab' => 'billing_fields',
1059 + 'value' => wp_json_encode( CheckoutFns::default_billing_fields() ),
1060 + 'dependency' => [
1061 + 'rules' => [
1062 + [
1063 + 'item' => 'modules.checkout_fields_editor.modify_billing_form',
1064 + 'value' => 'on',
1065 + 'operator' => '==',
1066 + ],
1067 + ],
1068 + ],
1069 + ],
1070 + 'checkout_shipping_intro' => [
1071 + 'id' => 'checkout_shipping_intro',
1072 + 'type' => 'description',
1073 + 'text' => esc_html__( 'Shipping Fields Editor allows you to customize the default shipping fields on your checkout page.', 'shopbuilder' ),
1074 + 'tab' => 'shipping_fields',
1075 + ],
1076 + 'modify_shipping_form' => [
1077 + 'id' => 'modify_billing_form',
1078 + 'type' => 'switch',
1079 + 'label' => esc_html__( 'Modify Shipping Form?', 'shopbuilder' ),
1080 + 'help' => esc_html__( 'Enable this option to edit shipping Form.', 'shopbuilder' ),
1081 + 'tab' => 'shipping_fields',
1082 + ],
1083 + 'checkout_shipping_fields_info' => [
1084 + 'id' => 'checkout_shipping_fields_info',
1085 + 'type' => 'title',
1086 + 'label' => esc_html__( 'Shipping Fields', 'shopbuilder' ),
1087 + 'tab' => 'shipping_fields',
1088 + 'dependency' => [
1089 + 'rules' => [
1090 + [
1091 + 'item' => 'modules.checkout_fields_editor.modify_shipping_form',
1092 + 'value' => 'on',
1093 + 'operator' => '==',
1094 + ],
1095 + ],
1096 + ],
1097 + ],
1098 + 'checkout_shipping_fields' => [
1099 + 'id' => 'checkout_shipping_fields',
1100 + 'type' => 'checkout_fields',
1101 + 'tab' => 'shipping_fields',
1102 + 'value' => wp_json_encode( CheckoutFns::default_shipping_fields() ),
1103 + 'dependency' => [
1104 + 'rules' => [
1105 + [
1106 + 'item' => 'modules.checkout_fields_editor.modify_shipping_form',
1107 + 'value' => 'on',
1108 + 'operator' => '==',
1109 + ],
1110 + ],
1111 + ],
1112 + ],
1113 + 'checkout_additional_intro' => [
1114 + 'id' => 'checkout_additional_intro',
1115 + 'type' => 'description',
1116 + 'text' => esc_html__( 'Additional Fields Editor allows you to customize the extra fields on your checkout page.', 'shopbuilder' ),
1117 + 'tab' => 'additional_fields',
1118 + ],
1119 + 'modify_additional_form' => [
1120 + 'id' => 'modify_additional_form',
1121 + 'type' => 'switch',
1122 + 'label' => esc_html__( 'Modify Additional Form Field?', 'shopbuilder' ),
1123 + 'help' => esc_html__( 'Enable this option to edit Additional Form.', 'shopbuilder' ),
1124 + 'tab' => 'additional_fields',
1125 + ],
1126 + 'checkout_additional_fields_info' => [
1127 + 'id' => 'checkout_additional_fields_info',
1128 + 'type' => 'title',
1129 + 'label' => esc_html__( 'Additional Fields', 'shopbuilder' ),
1130 + 'tab' => 'additional_fields',
1131 + 'dependency' => [
1132 + 'rules' => [
1133 + [
1134 + 'item' => 'modules.checkout_fields_editor.modify_additional_form',
1135 + 'value' => 'on',
1136 + 'operator' => '==',
1137 + ],
1138 + ],
1139 + ],
1140 + ],
1141 + 'checkout_additional_fields' => [
1142 + 'id' => 'checkout_additional_fields',
1143 + 'type' => 'checkout_fields',
1144 + 'tab' => 'additional_fields',
1145 + 'value' => wp_json_encode( CheckoutFns::checkout_additional_fields() ),
1146 + 'dependency' => [
1147 + 'rules' => [
1148 + [
1149 + 'item' => 'modules.checkout_fields_editor.modify_additional_form',
1150 + 'value' => 'on',
1151 + 'operator' => '==',
1152 + ],
1153 + ],
1154 + ],
1155 + ],
1156 + ],
1157 + 'tabs' => [
1158 + 'general' => [
1159 + 'title' => esc_html__( 'General', 'shopbuilder' ),
1160 + ],
1161 + 'billing_fields' => [
1162 + 'title' => esc_html__( 'Billing Fields', 'shopbuilder' ),
1163 + ],
1164 + 'shipping_fields' => [
1165 + 'title' => esc_html__( 'Shipping Fields', 'shopbuilder' ),
1166 + ],
1167 + 'additional_fields' => [
1168 + 'title' => esc_html__( 'Additional Fields', 'shopbuilder' ),
1169 + ],
1170 + ],
868 1171 ]
869 1172 ),
870 - 'mini_cart' => apply_filters(
1173 + 'shopify_checkout' => apply_filters(
1174 + 'rtsb/module/shopify_checkout/options',
1175 + [
1176 + 'id' => 'shopify_checkout',
1177 + 'active' => '',
1178 + 'title' => esc_html__( 'Shopify Checkout', 'shopbuilder' ),
1179 + 'base_class' => ShopifyCheckout::class,
1180 + 'active_field' => [
1181 + 'label' => esc_html__( 'Enable Shopify Checkout?', 'shopbuilder' ),
1182 + 'help' => esc_html__( 'Switch on to enable Shopify Checkout module.', 'shopbuilder' ),
1183 + ],
1184 + 'fields' => $this->shopify_checkout_options(),
1185 + 'tabs' => [
1186 + 'general' => [
1187 + 'title' => esc_html__( 'General', 'shopbuilder' ),
1188 + ],
1189 + 'multi-step' => [
1190 + 'title' => esc_html__( 'Multi-Step', 'shopbuilder' ),
1191 + ],
1192 + 'styles' => [
1193 + 'title' => esc_html__( 'General Styles', 'shopbuilder' ),
1194 + ],
1195 + 'btn-styles' => [
1196 + 'title' => esc_html__( 'Button Styles', 'shopbuilder' ),
1197 + ],
1198 + ],
1199 + ]
1200 + ),
1201 + 'mini_cart' => apply_filters(
871 1202 'rtsb/module/mini_cart/options',
872 1203 [
873 1204 'id' => 'mini_cart',
874 1205 'active' => '',
@@ -878,12 +1209,112 @@
878 1209 'label' => esc_html__( 'Enable Mini Cart?', 'shopbuilder' ),
879 1210 'help' => esc_html__( 'Switch on to enable mini cart module.', 'shopbuilder' ),
880 1211 ],
881 1212 'is_active' => true,
882 - 'fields' => [],
1213 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
883 1214 ]
884 1215 ),
885 - 'quick_checkout' => apply_filters(
1216 + 'product_size_chart' => apply_filters(
1217 + 'rtsb/module/product_size_chart/options',
1218 + [
1219 + 'id' => 'product_size_chart',
1220 + 'active' => '',
1221 + 'title' => esc_html__( 'Product Size Chart', 'shopbuilder' ),
1222 + 'package' => $this->pro_package(),
1223 + 'active_field' => [
1224 + 'label' => esc_html__( 'Enable Product Size Chart?', 'shopbuilder' ),
1225 + 'help' => esc_html__( 'Switch on to enable Product Size Chart module.', 'shopbuilder' ),
1226 + ],
1227 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
1228 + ]
1229 + ),
1230 + 'customize_my_account' => apply_filters(
1231 + 'rtsb/module/customize_my_account/options',
1232 + [
1233 + 'id' => 'customize_my_account',
1234 + 'active' => '',
1235 + 'title' => esc_html__( 'Customize My Account', 'shopbuilder' ),
1236 + 'package' => $this->pro_package(),
1237 + 'active_field' => [
1238 + 'label' => esc_html__( 'Enable Customize My Account?', 'shopbuilder' ),
1239 + 'help' => esc_html__( 'Switch on to enable customize my account module.', 'shopbuilder' ),
1240 + ],
1241 + 'fields' => Fns::pro_version_notice( '1.4.0' ),
1242 + ]
1243 + ),
1244 + 'pre_order' => apply_filters(
1245 + 'rtsb/module/pre_order/options',
1246 + [
1247 + 'id' => 'pre_order',
1248 + 'active' => '',
1249 + 'title' => esc_html__( 'Pre-Order', 'shopbuilder' ),
1250 + 'package' => $this->pro_package(),
1251 + 'active_field' => [
1252 + 'label' => esc_html__( 'Enable Pre-Order?', 'shopbuilder' ),
1253 + 'help' => esc_html__( 'Switch on to enable pre-order module.', 'shopbuilder' ),
1254 + ],
1255 + 'fields' => Fns::pro_version_notice( '1.5.0' ),
1256 + ]
1257 + ),
1258 + 'currency_switcher' => apply_filters(
1259 + 'rtsb/module/currency_switcher/options',
1260 + [
1261 + 'id' => 'currency_switcher',
1262 + 'active' => '',
1263 + 'title' => esc_html__( 'Currency Switcher', 'shopbuilder' ),
1264 + 'package' => $this->pro_package(),
1265 + 'active_field' => [
1266 + 'label' => esc_html__( 'Enable Currency Switcher?', 'shopbuilder' ),
1267 + 'help' => esc_html__( 'Switch on to enable currency switcher module.', 'shopbuilder' ),
1268 + ],
1269 + 'is_active' => true,
1270 + 'fields' => Fns::pro_version_notice( '1.5.0' ),
1271 + ]
1272 + ),
1273 + 'product_add_ons' => apply_filters(
1274 + 'rtsb/module/product_add_ons/options',
1275 + [
1276 + 'id' => 'product_add_ons',
1277 + 'active' => '',
1278 + 'title' => esc_html__( 'Product Add-Ons', 'shopbuilder' ),
1279 + 'package' => $this->pro_package(),
1280 + 'active_field' => [
1281 + 'label' => esc_html__( 'Enable Product Add-Ons?', 'shopbuilder' ),
1282 + 'help' => esc_html__( 'Switch on to enable product add-ons module.', 'shopbuilder' ),
1283 + ],
1284 + 'is_active' => true,
1285 + 'fields' => Fns::pro_version_notice( '1.6.0' ),
1286 + ]
1287 + ),
1288 + 'sales_notification' => apply_filters(
1289 + 'rtsb/module/sales_notification/options',
1290 + [
1291 + 'id' => 'sales_notification',
1292 + 'active' => '',
1293 + 'title' => esc_html__( 'Sales Notification', 'shopbuilder' ),
1294 + 'package' => $this->pro_package(),
1295 + 'active_field' => [
1296 + 'label' => esc_html__( 'Enable Sales Notification?', 'shopbuilder' ),
1297 + 'help' => esc_html__( 'Switch on to enable Sales Notification module.', 'shopbuilder' ),
1298 + ],
1299 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
1300 + ]
1301 + ),
1302 + 'flash_sale_countdown' => apply_filters(
1303 + 'rtsb/module/flash_sale_countdown/options',
1304 + [
1305 + 'id' => 'flash_sale_countdown',
1306 + 'active' => '',
1307 + 'title' => esc_html__( 'Flash Sale Countdown', 'shopbuilder' ),
1308 + 'package' => $this->pro_package(),
1309 + 'active_field' => [
1310 + 'label' => esc_html__( 'Enable Flash Sale Countdown?', 'shopbuilder' ),
1311 + 'help' => esc_html__( 'Switch on to enable Flash Sale Countdown module.', 'shopbuilder' ),
1312 + ],
1313 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
1314 + ]
1315 + ),
1316 + 'quick_checkout' => apply_filters(
886 1317 'rtsb/module/quick_checkout/options',
887 1318 [
888 1319 'id' => 'quick_checkout',
889 1320 'active' => '',
@@ -892,12 +1323,12 @@
892 1323 'active_field' => [
893 1324 'label' => esc_html__( 'Enable Quick Checkout?', 'shopbuilder' ),
894 1325 'help' => esc_html__( 'Switch on to enable quick checkout module. Note: Currently, this is not suitable for variable products.', 'shopbuilder' ),
895 1326 ],
896 - 'fields' => [],
1327 + 'fields' => Fns::pro_version_notice( '1.1.0' ),
897 1328 ]
898 1329 ),
899 - 'multi_step_checkout' => apply_filters(
1330 + 'multi_step_checkout' => apply_filters(
900 1331 'rtsb/module/multi_step_checkout/options',
901 1332 [
902 1333 'id' => 'multi_step_checkout',
903 1334 'active' => '',
@@ -906,25 +1337,2912 @@
906 1337 'active_field' => [
907 1338 'label' => esc_html__( 'Enable Multi-Step Checkout?', 'shopbuilder' ),
908 1339 'help' => esc_html__( 'Switch on to enable Multi-step Checkout module.', 'shopbuilder' ),
909 1340 ],
910 - 'fields' => [],
1341 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
911 1342 ]
912 1343 ),
913 - 'product_size_chart' => apply_filters(
914 - 'rtsb/module/product_size_chart/options',
1344 + 'back_order' => apply_filters(
1345 + 'rtsb/module/back_order/options',
915 1346 [
916 - 'id' => 'product_size_chart',
1347 + 'id' => 'back_order',
917 1348 'active' => '',
918 - 'title' => esc_html__( 'Product Size Chart', 'shopbuilder' ),
1349 + 'title' => esc_html__( 'Back-Order', 'shopbuilder' ),
919 1350 'package' => $this->pro_package(),
920 1351 'active_field' => [
921 - 'label' => esc_html__( 'Enable Product Size Chart?', 'shopbuilder' ),
922 - 'help' => esc_html__( 'Switch on to enable Product Size Chart module.', 'shopbuilder' ),
1352 + 'label' => esc_html__( 'Enable Back-Order?', 'shopbuilder' ),
1353 + 'help' => esc_html__( 'Switch on to enable back-order module.', 'shopbuilder' ),
923 1354 ],
924 - 'fields' => [],
1355 + 'fields' => Fns::pro_version_notice( '1.3.0', 'general', 'Back-Order', false ),
925 1356 ]
926 1357 ),
1358 + 'sticky_add_to_cart' => apply_filters(
1359 + 'rtsb/module/sticky_add_to_cart/options',
1360 + [
1361 + 'id' => 'sticky_add_to_cart',
1362 + 'active' => '',
1363 + 'title' => esc_html__( 'Sticky Add-To-Cart', 'shopbuilder' ),
1364 + 'package' => $this->pro_package(),
1365 + 'active_field' => [
1366 + 'label' => esc_html__( 'Enable Sticky Add-To-Cart?', 'shopbuilder' ),
1367 + 'help' => esc_html__( 'Switch on to enable sticky add-to-cart module.', 'shopbuilder' ),
1368 + ],
1369 + 'fields' => Fns::pro_version_notice( '1.7.0', 'general', 'Sticky Add-To-Cart', false ),
1370 + ]
1371 + ),
1372 + 'smart_coupons' => apply_filters(
1373 + 'rtsb/module/smart_coupons/options',
1374 + [
1375 + 'id' => 'smart_coupons',
1376 + 'active' => '',
1377 + 'title' => esc_html__( 'Smart Coupons', 'shopbuilder' ),
1378 + 'package' => $this->pro_package(),
1379 + 'active_field' => [
1380 + 'label' => esc_html__( 'Enable Smart Coupons?', 'shopbuilder' ),
1381 + 'help' => esc_html__( 'Switch on to enable smart coupons module.', 'shopbuilder' ),
1382 + ],
1383 + 'fields' => Fns::pro_version_notice( '1.10.0', 'general', 'ShopBuilder Pro', false ),
1384 + ]
1385 + ),
1386 + 'bulk_discounts' => apply_filters(
1387 + 'rtsb/module/bulk_discounts/options',
1388 + [
1389 + 'id' => 'bulk_discounts',
1390 + 'active' => '',
1391 + 'title' => esc_html__( 'Bulk Discounts', 'shopbuilder' ),
1392 + 'active_field' => [
1393 + 'label' => esc_html__( 'Enable Bulk Discounts?', 'shopbuilder' ),
1394 + 'help' => esc_html__( 'Switch on to enable bulk discounts module.', 'shopbuilder' ),
1395 + ],
1396 + 'package' => $this->pro_package(),
1397 + 'fields' => Fns::pro_version_notice( '1.10.0', 'general', 'ShopBuilder Pro', false ),
1398 + ]
1399 + ),
1400 + 'bogo_bxgy_free_gift_discounts' => apply_filters(
1401 + 'rtsb/module/bogo_bxgy_free_gift_discounts/options',
1402 + [
1403 + 'id' => 'bogo_bxgy_free_gift_discounts',
1404 + 'active' => '',
1405 + 'title' => esc_html__( 'Buy X Get Y | BOGO', 'shopbuilder' ),
1406 + 'active_field' => [
1407 + 'label' => esc_html__( 'Enable Buy X Get Y | BOGO?', 'shopbuilder' ),
1408 + 'help' => esc_html__( 'Switch on to enable Buy X Get Y | BOGO module.', 'shopbuilder' ),
1409 + ],
1410 + 'package' => $this->pro_package(),
1411 + 'fields' => Fns::pro_version_notice( '1.11.0', 'general', 'ShopBuilder Pro', false ),
1412 + ]
1413 + ),
1414 + 'partial_pay' => apply_filters(
1415 + 'rtsb/module/partial_pay/options',
1416 + [
1417 + 'id' => 'partial_pay',
1418 + 'active' => '',
1419 + 'title' => esc_html__( 'Partial Pay', 'shopbuilder' ),
1420 + 'active_field' => [
1421 + 'label' => esc_html__( 'Enable Partial Pay?', 'shopbuilder' ),
1422 + 'help' => esc_html__( 'Switch on to enable partial pay module.', 'shopbuilder' ),
1423 + ],
1424 + 'package' => $this->pro_package(),
1425 + 'fields' => Fns::pro_version_notice( '1.12.0', 'general', 'ShopBuilder Pro', false ),
1426 + ]
1427 + ),
1428 + 'gift_card' => apply_filters(
1429 + 'rtsb/module/gift_card/options',
1430 + [
1431 + 'id' => 'gift_card',
1432 + 'active' => '',
1433 + 'title' => esc_html__( 'Gift Card', 'shopbuilder' ),
1434 + 'active_field' => [
1435 + 'label' => esc_html__( 'Enable Gift Card?', 'shopbuilder' ),
1436 + 'help' => esc_html__( 'Switch on to enable Gift Card module.', 'shopbuilder' ),
1437 + ],
1438 + 'package' => $this->pro_package(),
1439 + 'fields' => Fns::pro_version_notice( '1.10.0' ),
1440 + ]
1441 + ),
927 1442 ];
928 1443 return apply_filters( 'rtsb/core/modules/raw_list', $list );
1444 + }
1445 +
1446 + /**
1447 + * Get All Menu
1448 + */
1449 + public function get_all_menu() {
1450 + $manus = [
1451 + 'none' => esc_html__( 'None', 'shopbuilder' ),
1452 + ];
1453 + $nav_menus = wp_get_nav_menus();
1454 + if ( empty( $nav_menus ) ) {
1455 + return $manus;
1456 + }
1457 + foreach ( $nav_menus as $menu ) {
1458 + $manus[ $menu->slug ] = $menu->name;
1459 + }
1460 + return $manus;
1461 + }
1462 + /**
1463 + * Sticky add-to-cart module options.
1464 + *
1465 + * @return array
1466 + */
1467 + public function shopify_checkout_options() {
1468 + $notice = [];
1469 + if ( defined( 'RTSBPRO_VERSION' ) && version_compare( RTSBPRO_VERSION, '1.8.0', '<' ) ) {
1470 + $notice = Fns::pro_version_notice( '1.8.0', 'general', 'ShopBuilder Pro', false );
1471 + }
1472 + $fields = $notice + [
1473 + 'general_settings' => [
1474 + 'id' => 'general_settings',
1475 + 'type' => 'title',
1476 + 'label' => esc_html__( 'Settings', 'shopbuilder' ),
1477 + 'tab' => 'general',
1478 + ],
1479 + 'shopify_page_logo' => [
1480 + 'id' => 'shopify_page_logo',
1481 + 'type' => 'fileupload',
1482 + 'label' => esc_html__( 'Upload Checkout Page Logo', 'shopbuilder' ),
1483 + 'help' => esc_html__( 'Please upload your custom logo to display on the checkout page.', 'shopbuilder' ),
1484 + 'tab' => 'general',
1485 + ],
1486 + 'shopify_logo_height' => [
1487 + 'id' => 'shopify_logo_height',
1488 + 'label' => esc_html__( 'Logo Height (px)', 'shopbuilder' ),
1489 + 'help' => esc_html__( 'Specify the height of the checkout page logo in px.', 'shopbuilder' ),
1490 + 'type' => 'slider',
1491 + 'min' => 10,
1492 + 'max' => 200,
1493 + 'unit' => 'px',
1494 + 'value' => 40,
1495 + 'tab' => 'general',
1496 + ],
1497 + 'cart_icon_source' => [
1498 + 'id' => 'cart_icon_source',
1499 + 'label' => esc_html__( 'Cart Icon', 'shopbuilder' ),
1500 + 'help' => sprintf(
1501 + // translators: %s for pro message.
1502 + __( 'Choose a cart icon to display in your checkout\'s header. <br />%s', 'shopbuilder' ),
1503 + ! rtsb()->has_pro()
1504 + ? sprintf(
1505 + '<a target="_blank" href="' . esc_url( rtsb()->pro_version_link() ) . '">%s </a> %s ',
1506 + esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
1507 + esc_html__( 'to unlock custom image icon.', 'shopbuilder' )
1508 + )
1509 + : ''
1510 + ),
1511 + 'type' => 'select',
1512 + 'value' => 'none',
1513 + 'isPro' => ! rtsb()->has_pro(),
1514 + 'options' => [
1515 + 'none' => esc_html__( 'None', 'shopbuilder' ),
1516 + 'select_icon' => esc_html__( 'Select Icon', 'shopbuilder' ),
1517 + 'upload_icon' => esc_html__( 'Upload Icon', 'shopbuilder' ),
1518 + ],
1519 + 'tab' => 'general',
1520 + ],
1521 + 'cart_icon' => [
1522 + 'id' => 'cart_icon',
1523 + 'label' => esc_html__( 'Select Cart Icon', 'shopbuilder' ),
1524 + 'help' => esc_html__( 'Please choose the icon.', 'shopbuilder' ),
1525 + 'type' => 'icon_select',
1526 + 'searchable' => true,
1527 + 'options' => Fns::get_icons(),
1528 + 'value' => 'cart-2',
1529 + 'tab' => 'general',
1530 + 'dependency' => [
1531 + 'rules' => [
1532 + [
1533 + 'item' => 'modules.shopify_checkout.cart_icon_source',
1534 + 'value' => 'select_icon',
1535 + 'operator' => '==',
1536 + ],
1537 + ],
1538 + ],
1539 + ],
1540 +
1541 + 'cart_image_icon' => [
1542 + 'id' => 'cart_image_icon',
1543 + 'type' => 'fileupload',
1544 + 'label' => esc_html__( 'Upload Custom Icon', 'shopbuilder' ),
1545 + 'help' => esc_html__( 'Please upload your custom image icon.', 'shopbuilder' ),
1546 + 'tab' => 'general',
1547 + 'dependency' => [
1548 + 'rules' => [
1549 + [
1550 + 'item' => 'modules.shopify_checkout.cart_icon_source',
1551 + 'value' => 'upload_icon',
1552 + 'operator' => '==',
1553 + ],
1554 + ],
1555 + ],
1556 + ],
1557 +
1558 + 'email_field_title' => [
1559 + 'id' => 'email_field_title',
1560 + 'type' => 'text',
1561 + 'label' => esc_html__( 'Email Field Section Title', 'shopbuilder' ),
1562 + 'help' => esc_html__( 'Enter the custom title to be displayed above the email field section.', 'shopbuilder' ),
1563 + 'value' => esc_html__( 'Contact', 'shopbuilder' ),
1564 + 'tab' => 'general',
1565 + ],
1566 +
1567 + 'billing_address_field_title' => [
1568 + 'id' => 'billing_address_field_title',
1569 + 'type' => 'text',
1570 + 'label' => esc_html__( 'Billing Fields Section Title', 'shopbuilder' ),
1571 + 'help' => esc_html__( 'Enter the custom title to be displayed above the billing fields section', 'shopbuilder' ),
1572 + 'value' => esc_html__( 'Billing address', 'shopbuilder' ),
1573 + 'tab' => 'general',
1574 + ],
1575 +
1576 + 'enable_multi_step' => [
1577 + 'id' => 'enable_multi_step',
1578 + 'type' => 'switch',
1579 + 'isPro' => ! rtsb()->has_pro(),
1580 + 'label' => esc_html__( 'Multi-Step Checkout', 'shopbuilder' ),
1581 + 'help' => esc_html__( 'Enable multi-step checkout to simplify the purchasing process.', 'shopbuilder' ),
1582 + 'tab' => 'multi-step',
1583 + ],
1584 + 'step_menu_settings' => [
1585 + 'id' => 'step_menu_settings',
1586 + 'type' => 'title',
1587 + 'label' => esc_html__( 'Step Settings ', 'shopbuilder' ),
1588 + 'tab' => 'multi-step',
1589 + 'dependency' => [
1590 + 'rules' => [
1591 + [
1592 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1593 + 'value' => 'on',
1594 + 'operator' => '==',
1595 + ],
1596 + ],
1597 + ],
1598 + ],
1599 +
1600 + 'show_step_menu' => [
1601 + 'id' => 'show_step_menu',
1602 + 'type' => 'switch',
1603 + 'isPro' => ! rtsb()->has_pro(),
1604 + 'label' => esc_html__( 'Show Step Menu', 'shopbuilder' ),
1605 + 'help' => esc_html__( 'Enable to display the step navigation menu during checkout.', 'shopbuilder' ),
1606 + 'tab' => 'multi-step',
1607 + 'value' => 'on',
1608 + 'dependency' => [
1609 + 'rules' => [
1610 + [
1611 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1612 + 'value' => 'on',
1613 + 'operator' => '==',
1614 + ],
1615 + ],
1616 + ],
1617 + ],
1618 + 'show_cart_menu' => [
1619 + 'id' => 'show_cart_menu',
1620 + 'type' => 'switch',
1621 + 'isPro' => ! rtsb()->has_pro(),
1622 + 'label' => esc_html__( 'Show Cart Menu', 'shopbuilder' ),
1623 + 'help' => esc_html__( 'Enable this option to display the cart item in the step menu.', 'shopbuilder' ),
1624 + 'tab' => 'multi-step',
1625 + 'dependency' => [
1626 + 'rules' => [
1627 + [
1628 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1629 + 'value' => 'on',
1630 + 'operator' => '==',
1631 + ],
1632 + [
1633 + 'item' => 'modules.shopify_checkout.show_step_menu',
1634 + 'value' => 'on',
1635 + 'operator' => '==',
1636 + ],
1637 + ],
1638 + ],
1639 + ],
1640 + 'cart_text' => [
1641 + 'id' => 'cart_text',
1642 + 'type' => 'text',
1643 + 'isPro' => ! rtsb()->has_pro(),
1644 + 'label' => esc_html__( 'Cart Step Title', 'shopbuilder' ),
1645 + 'help' => esc_html__( 'Enter the cart step menu title.', 'shopbuilder' ),
1646 + 'value' => esc_html__( 'Cart', 'shopbuilder' ),
1647 + 'tab' => 'multi-step',
1648 + 'dependency' => [
1649 + 'rules' => [
1650 + [
1651 + 'item' => 'modules.shopify_checkout.show_step_menu',
1652 + 'value' => 'on',
1653 + 'operator' => '==',
1654 + ],
1655 + [
1656 + 'item' => 'modules.shopify_checkout.show_cart_menu',
1657 + 'value' => 'on',
1658 + 'operator' => '==',
1659 + ],
1660 + ],
1661 + ],
1662 + ],
1663 +
1664 + 'billing_text' => [
1665 + 'id' => 'billing_text',
1666 + 'type' => 'text',
1667 + 'isPro' => ! rtsb()->has_pro(),
1668 + 'label' => esc_html__( 'Billing Step Title', 'shopbuilder' ),
1669 + 'help' => esc_html__( 'Enter the billing step menu title.', 'shopbuilder' ),
1670 + 'value' => esc_html__( 'Billing', 'shopbuilder' ),
1671 + 'tab' => 'multi-step',
1672 + 'dependency' => [
1673 + 'rules' => [
1674 + [
1675 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1676 + 'value' => 'on',
1677 + 'operator' => '==',
1678 + ],
1679 + [
1680 + 'item' => 'modules.shopify_checkout.show_step_menu',
1681 + 'value' => 'on',
1682 + 'operator' => '==',
1683 + ],
1684 + ],
1685 + ],
1686 + ],
1687 +
1688 + 'shipping_text' => [
1689 + 'id' => 'shipping_text',
1690 + 'type' => 'text',
1691 + 'isPro' => ! rtsb()->has_pro(),
1692 + 'label' => esc_html__( 'Shipping Step Title', 'shopbuilder' ),
1693 + 'help' => esc_html__( 'Enter the shipping step menu title.', 'shopbuilder' ),
1694 + 'value' => esc_html__( 'Shipping', 'shopbuilder' ),
1695 + 'tab' => 'multi-step',
1696 + 'dependency' => [
1697 + 'rules' => [
1698 + [
1699 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1700 + 'value' => 'on',
1701 + 'operator' => '==',
1702 + ],
1703 + [
1704 + 'item' => 'modules.shopify_checkout.show_step_menu',
1705 + 'value' => 'on',
1706 + 'operator' => '==',
1707 + ],
1708 + ],
1709 + ],
1710 + ],
1711 +
1712 + 'shipping_method_text' => [
1713 + 'id' => 'shipping_method_text',
1714 + 'type' => 'text',
1715 + 'isPro' => ! rtsb()->has_pro(),
1716 + 'label' => esc_html__( 'Shipping Method Step Title', 'shopbuilder' ),
1717 + 'help' => esc_html__( 'Enter the shipping method step menu title.', 'shopbuilder' ),
1718 + 'value' => esc_html__( 'Shipping Method ', 'shopbuilder' ),
1719 + 'tab' => 'multi-step',
1720 + 'dependency' => [
1721 + 'rules' => [
1722 + [
1723 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1724 + 'value' => 'on',
1725 + 'operator' => '==',
1726 + ],
1727 + [
1728 + 'item' => 'modules.shopify_checkout.show_step_menu',
1729 + 'value' => 'on',
1730 + 'operator' => '==',
1731 + ],
1732 + ],
1733 + ],
1734 + ],
1735 +
1736 + 'payment_text' => [
1737 + 'id' => 'payment_text',
1738 + 'type' => 'text',
1739 + 'isPro' => ! rtsb()->has_pro(),
1740 + 'label' => esc_html__( 'Payment Method Step Title', 'shopbuilder' ),
1741 + 'help' => esc_html__( 'Enter the payment method step menu title.', 'shopbuilder' ),
1742 + 'value' => esc_html__( 'Payment', 'shopbuilder' ),
1743 + 'tab' => 'multi-step',
1744 + 'dependency' => [
1745 + 'rules' => [
1746 + [
1747 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1748 + 'value' => 'on',
1749 + 'operator' => '==',
1750 + ],
1751 + [
1752 + 'item' => 'modules.shopify_checkout.show_step_menu',
1753 + 'value' => 'on',
1754 + 'operator' => '==',
1755 + ],
1756 + ],
1757 + ],
1758 + ],
1759 +
1760 + 'next_button_settings' => [
1761 + 'id' => 'next_button_settings',
1762 + 'type' => 'title',
1763 + 'label' => esc_html__( 'Button Settings', 'shopbuilder' ),
1764 + 'tab' => 'multi-step',
1765 + 'dependency' => [
1766 + 'rules' => [
1767 + [
1768 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1769 + 'value' => 'on',
1770 + 'operator' => '==',
1771 + ],
1772 + ],
1773 + ],
1774 + ],
1775 +
1776 + 'shop_continue_btn' => [
1777 + 'id' => 'shop_continue_btn',
1778 + 'type' => 'switch',
1779 + 'isPro' => ! rtsb()->has_pro(),
1780 + 'label' => esc_html__( 'Show Next Button', 'shopbuilder' ),
1781 + 'help' => esc_html__( 'Enable this option to display the \'Next\' button.', 'shopbuilder' ),
1782 + 'tab' => 'multi-step',
1783 + 'value' => 'on',
1784 + 'dependency' => [
1785 + 'rules' => [
1786 + [
1787 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1788 + 'value' => 'on',
1789 + 'operator' => '==',
1790 + ],
1791 + ],
1792 + ],
1793 + ],
1794 + 'continue_btn_text_for_shipping' => [
1795 + 'id' => 'continue_btn_text_for_shipping',
1796 + 'type' => 'text',
1797 + 'isPro' => ! rtsb()->has_pro(),
1798 + 'label' => esc_html__( 'Next Button Label for Shipping', 'shopbuilder' ),
1799 + 'value' => esc_html__( 'Next', '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_continue_btn',
1810 + 'value' => 'on',
1811 + 'operator' => '==',
1812 + ],
1813 + ],
1814 + ],
1815 + ],
1816 + 'continue_btn_text_for_shipping_method' => [
1817 + 'id' => 'continue_btn_text_for_shipping_method',
1818 + 'type' => 'text',
1819 + 'isPro' => ! rtsb()->has_pro(),
1820 + 'label' => esc_html__( 'Next Button Label for Shipping Method', 'shopbuilder' ),
1821 + 'value' => esc_html__( 'Next', 'shopbuilder' ),
1822 + 'tab' => 'multi-step',
1823 + 'dependency' => [
1824 + 'rules' => [
1825 + [
1826 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1827 + 'value' => 'on',
1828 + 'operator' => '==',
1829 + ],
1830 + [
1831 + 'item' => 'modules.shopify_checkout.shop_continue_btn',
1832 + 'value' => 'on',
1833 + 'operator' => '==',
1834 + ],
1835 + ],
1836 + ],
1837 + ],
1838 + 'continue_btn_text_for_payment' => [
1839 + 'id' => 'continue_btn_text_for_payment',
1840 + 'type' => 'text',
1841 + 'label' => esc_html__( 'Next Button Label for Payment', 'shopbuilder' ),
1842 + 'value' => esc_html__( 'Next', 'shopbuilder' ),
1843 + 'tab' => 'multi-step',
1844 + 'dependency' => [
1845 + 'rules' => [
1846 + [
1847 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1848 + 'value' => 'on',
1849 + 'operator' => '==',
1850 + ],
1851 + [
1852 + 'item' => 'modules.shopify_checkout.shop_continue_btn',
1853 + 'value' => 'on',
1854 + 'operator' => '==',
1855 + ],
1856 + ],
1857 + ],
1858 + ],
1859 + 'shop_return_btn' => [
1860 + 'id' => 'shop_return_btn',
1861 + 'type' => 'switch',
1862 + 'isPro' => ! rtsb()->has_pro(),
1863 + 'label' => esc_html__( 'Show Back Button', 'shopbuilder' ),
1864 + 'help' => esc_html__( 'Enable this option to display the \'Back\' button.', 'shopbuilder' ),
1865 + 'tab' => 'multi-step',
1866 + 'value' => 'on',
1867 + 'dependency' => [
1868 + 'rules' => [
1869 + [
1870 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1871 + 'value' => 'on',
1872 + 'operator' => '==',
1873 + ],
1874 + ],
1875 + ],
1876 + ],
1877 + 'return_btn_text_for_billing' => [
1878 + 'id' => 'return_btn_text_for_billing',
1879 + 'type' => 'text',
1880 + 'isPro' => ! rtsb()->has_pro(),
1881 + 'label' => esc_html__( 'Back Button Label for Billing', 'shopbuilder' ),
1882 + 'value' => esc_html__( 'Prev', 'shopbuilder' ),
1883 + 'tab' => 'multi-step',
1884 + 'dependency' => [
1885 + 'rules' => [
1886 + [
1887 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1888 + 'value' => 'on',
1889 + 'operator' => '==',
1890 + ],
1891 + [
1892 + 'item' => 'modules.shopify_checkout.shop_return_btn',
1893 + 'value' => 'on',
1894 + 'operator' => '==',
1895 + ],
1896 + ],
1897 + ],
1898 + ],
1899 +
1900 + 'return_btn_text_for_shipping' => [
1901 + 'id' => 'return_btn_text_for_shipping',
1902 + 'type' => 'text',
1903 + 'isPro' => ! rtsb()->has_pro(),
1904 + 'label' => esc_html__( 'Back Button Label for Shipping', 'shopbuilder' ),
1905 + 'value' => esc_html__( 'Prev', 'shopbuilder' ),
1906 + 'tab' => 'multi-step',
1907 + 'dependency' => [
1908 + 'rules' => [
1909 + [
1910 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1911 + 'value' => 'on',
1912 + 'operator' => '==',
1913 + ],
1914 + [
1915 + 'item' => 'modules.shopify_checkout.shop_return_btn',
1916 + 'value' => 'on',
1917 + 'operator' => '==',
1918 + ],
1919 + ],
1920 + ],
1921 + ],
1922 +
1923 + 'return_btn_text_for_shipping_method' => [
1924 + 'id' => 'return_btn_text_for_shipping_method',
1925 + 'type' => 'text',
1926 + 'isPro' => ! rtsb()->has_pro(),
1927 + 'label' => esc_html__( 'Back Button Label for Shipping Method', 'shopbuilder' ),
1928 + 'value' => esc_html__( 'Prev', 'shopbuilder' ),
1929 + 'tab' => 'multi-step',
1930 + 'dependency' => [
1931 + 'rules' => [
1932 + [
1933 + 'item' => 'modules.shopify_checkout.enable_multi_step',
1934 + 'value' => 'on',
1935 + 'operator' => '==',
1936 + ],
1937 + [
1938 + 'item' => 'modules.shopify_checkout.shop_return_btn',
1939 + 'value' => 'on',
1940 + 'operator' => '==',
1941 + ],
1942 + ],
1943 + ],
1944 + ],
1945 +
1946 + 'order_review_settings' => [
1947 + 'id' => 'order_review_settings',
1948 + 'type' => 'title',
1949 + 'label' => esc_html__( 'Order Reviews', 'shopbuilder' ),
1950 + 'tab' => 'general',
1951 + ],
1952 + 'order_review_item_link' => [
1953 + 'id' => 'order_review_item_link',
1954 + 'type' => 'switch',
1955 + 'label' => esc_html__( 'Link Product Titles', 'shopbuilder' ),
1956 + 'help' => esc_html__( 'Enable to make product titles clickable, linking to their product pages.', 'shopbuilder' ),
1957 + 'value' => '',
1958 + 'tab' => 'general',
1959 + ],
1960 + 'extra_content' => [
1961 + 'id' => 'extra_content',
1962 + 'label' => esc_html__( 'Display Additional Data', 'shopbuilder' ),
1963 + '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' ),
1964 + 'type' => 'text_editor',
1965 + 'isPro' => ! rtsb()->has_pro(),
1966 + 'sanitize_fn' => 'pass_all',
1967 + 'tab' => 'general',
1968 + ],
1969 +
1970 + 'footer_settings' => [
1971 + 'id' => 'footer_settings',
1972 + 'type' => 'title',
1973 + 'label' => esc_html__( 'Footer', 'shopbuilder' ),
1974 + 'tab' => 'general',
1975 + ],
1976 +
1977 + 'footer_menu' => [
1978 + 'id' => 'footer_menu',
1979 + 'label' => esc_html__( 'Footer Menu', 'shopbuilder' ),
1980 + 'help' => esc_html__( 'Select a menu to display in the footer section of your checkout page.', 'shopbuilder' ),
1981 + 'type' => 'select',
1982 + 'value' => 'none',
1983 + 'options' => $this->get_all_menu(),
1984 + 'tab' => 'general',
1985 + ],
1986 +
1987 + 'footer_text' => [
1988 + 'id' => 'footer_text',
1989 + 'type' => 'text',
1990 + 'label' => esc_html__( 'Footer Text', 'shopbuilder' ),
1991 + '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' ),
1992 + 'value' => esc_html__( 'Copyright @{year} | All rights reserved', 'shopbuilder' ),
1993 + 'tab' => 'general',
1994 + ],
1995 +
1996 + // Place Order.
1997 + 'login_button_styles_settings' => [
1998 + 'id' => 'login_button_styles_settings',
1999 + 'type' => 'title',
2000 + 'tab' => 'btn-styles',
2001 + 'label' => esc_html__( 'Login Button Style', 'shopbuilder' ),
2002 + ],
2003 + 'login_button_height' => [
2004 + 'id' => 'login_button_height',
2005 + 'label' => esc_html__( 'Height (px)', 'shopbuilder' ),
2006 + 'type' => 'slider',
2007 + 'min' => 10,
2008 + 'max' => 100,
2009 + 'unit' => 'px',
2010 + 'value' => 50,
2011 + 'tab' => 'btn-styles',
2012 + ],
2013 + 'login_button_width' => [
2014 + 'id' => 'login_button_width',
2015 + 'label' => esc_html__( 'Width (px)', 'shopbuilder' ),
2016 + 'type' => 'slider',
2017 + 'min' => 10,
2018 + 'max' => 1000,
2019 + 'unit' => 'px',
2020 + 'tab' => 'btn-styles',
2021 + ],
2022 + 'login_button_font_size' => [
2023 + 'id' => 'login_button_font_size',
2024 + 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2025 + 'type' => 'slider',
2026 + 'min' => 10,
2027 + 'max' => 50,
2028 + 'unit' => 'px',
2029 + 'value' => 15,
2030 + 'tab' => 'btn-styles',
2031 + ],
2032 + 'login_button_bg_color' => [
2033 + 'id' => 'login_button_bg_color',
2034 + 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
2035 + 'tab' => 'btn-styles',
2036 + 'type' => 'color',
2037 + ],
2038 + 'login_button_hover_bg_color' => [
2039 + 'id' => 'login_button_hover_bg_color',
2040 + 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2041 + 'tab' => 'btn-styles',
2042 + 'type' => 'color',
2043 + ],
2044 + 'login_button_color' => [
2045 + 'id' => 'login_button_color',
2046 + 'label' => esc_html__( 'Color', 'shopbuilder' ),
2047 + 'tab' => 'btn-styles',
2048 + 'type' => 'color',
2049 + ],
2050 + 'login_button_hover_color' => [
2051 + 'id' => 'login_button_hover_color',
2052 + 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2053 + 'tab' => 'btn-styles',
2054 + 'type' => 'color',
2055 + ],
2056 + 'login_button_border_color' => [
2057 + 'id' => 'login_button_border_color',
2058 + 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2059 + 'tab' => 'btn-styles',
2060 + 'type' => 'color',
2061 + ],
2062 + 'login_button_hover_border_color' => [
2063 + 'id' => 'login_button_hover_border_color',
2064 + 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2065 + 'tab' => 'btn-styles',
2066 + 'type' => 'color',
2067 + ],
2068 +
2069 + // Place Order.
2070 + 'place_order_button_styles_settings' => [
2071 + 'id' => 'place_order_button_styles_settings',
2072 + 'type' => 'title',
2073 + 'tab' => 'btn-styles',
2074 + 'label' => esc_html__( 'Place Order Button Style', 'shopbuilder' ),
2075 + ],
2076 + 'place_order_button_height' => [
2077 + 'id' => 'place_order_button_height',
2078 + 'label' => esc_html__( 'Height (px)', 'shopbuilder' ),
2079 + 'type' => 'slider',
2080 + 'min' => 10,
2081 + 'max' => 100,
2082 + 'unit' => 'px',
2083 + 'value' => 50,
2084 + 'tab' => 'btn-styles',
2085 + ],
2086 + 'place_order_button_width' => [
2087 + 'id' => 'place_order_button_width',
2088 + 'label' => esc_html__( 'Width (px)', 'shopbuilder' ),
2089 + 'type' => 'slider',
2090 + 'min' => 10,
2091 + 'max' => 1000,
2092 + 'unit' => 'px',
2093 + 'tab' => 'btn-styles',
2094 + ],
2095 + 'place_order_button_font_size' => [
2096 + 'id' => 'place_order_button_font_size',
2097 + 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2098 + 'type' => 'slider',
2099 + 'min' => 10,
2100 + 'max' => 50,
2101 + 'unit' => 'px',
2102 + 'value' => 15,
2103 + 'tab' => 'btn-styles',
2104 + ],
2105 + 'place_order_button_bg_color' => [
2106 + 'id' => 'place_order_button_bg_color',
2107 + 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
2108 + 'tab' => 'btn-styles',
2109 + 'type' => 'color',
2110 + ],
2111 + 'place_order_button_hover_bg_color' => [
2112 + 'id' => 'place_order_button_hover_bg_color',
2113 + 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2114 + 'tab' => 'btn-styles',
2115 + 'type' => 'color',
2116 + ],
2117 + 'place_order_button_color' => [
2118 + 'id' => 'place_order_button_color',
2119 + 'label' => esc_html__( 'Color', 'shopbuilder' ),
2120 + 'tab' => 'btn-styles',
2121 + 'type' => 'color',
2122 + ],
2123 + 'place_order_button_hover_color' => [
2124 + 'id' => 'place_order_button_hover_color',
2125 + 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2126 + 'tab' => 'btn-styles',
2127 + 'type' => 'color',
2128 + ],
2129 + 'place_order_button_border_color' => [
2130 + 'id' => 'place_order_button_border_color',
2131 + 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2132 + 'tab' => 'btn-styles',
2133 + 'type' => 'color',
2134 + ],
2135 + 'place_order_button_hover_border_color' => [
2136 + 'id' => 'place_order_button_hover_border_color',
2137 + 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2138 + 'tab' => 'btn-styles',
2139 + 'type' => 'color',
2140 + ],
2141 +
2142 + // Next Button.
2143 + 'next_button_styles_settings' => [
2144 + 'id' => 'next_button_styles_settings',
2145 + 'type' => 'title',
2146 + 'tab' => 'btn-styles',
2147 + 'label' => esc_html__( 'Next Button Style', 'shopbuilder' ),
2148 + 'dependency' => [
2149 + 'rules' => [
2150 + [
2151 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2152 + 'value' => 'on',
2153 + 'operator' => '==',
2154 + ],
2155 + [
2156 + 'item' => 'modules.shopify_checkout.shop_continue_btn',
2157 + 'value' => 'on',
2158 + 'operator' => '==',
2159 + ],
2160 + ],
2161 + ],
2162 + ],
2163 + 'next_button_height' => [
2164 + 'id' => 'next_button_height',
2165 + 'isPro' => ! rtsb()->has_pro(),
2166 + 'label' => esc_html__( 'Height (px)', 'shopbuilder' ),
2167 + 'type' => 'slider',
2168 + 'min' => 10,
2169 + 'max' => 100,
2170 + 'unit' => 'px',
2171 + 'value' => 50,
2172 + 'tab' => 'btn-styles',
2173 + 'dependency' => [
2174 + 'rules' => [
2175 + [
2176 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2177 + 'value' => 'on',
2178 + 'operator' => '==',
2179 + ],
2180 + [
2181 + 'item' => 'modules.shopify_checkout.shop_continue_btn',
2182 + 'value' => 'on',
2183 + 'operator' => '==',
2184 + ],
2185 + ],
2186 + ],
2187 + ],
2188 + 'next_button_width' => [
2189 + 'id' => 'next_button_width',
2190 + 'label' => esc_html__( 'Width (px)', 'shopbuilder' ),
2191 + 'type' => 'slider',
2192 + 'min' => 10,
2193 + 'max' => 1000,
2194 + 'unit' => 'px',
2195 + 'tab' => 'btn-styles',
2196 + 'dependency' => [
2197 + 'rules' => [
2198 + [
2199 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2200 + 'value' => 'on',
2201 + 'operator' => '==',
2202 + ],
2203 + [
2204 + 'item' => 'modules.shopify_checkout.shop_continue_btn',
2205 + 'value' => 'on',
2206 + 'operator' => '==',
2207 + ],
2208 + ],
2209 + ],
2210 + ],
2211 + 'next_button_font_size' => [
2212 + 'id' => 'next_button_font_size',
2213 + 'isPro' => ! rtsb()->has_pro(),
2214 + 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2215 + 'type' => 'slider',
2216 + 'min' => 10,
2217 + 'max' => 50,
2218 + 'unit' => 'px',
2219 + 'value' => 15,
2220 + 'tab' => 'btn-styles',
2221 + 'dependency' => [
2222 + 'rules' => [
2223 + [
2224 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2225 + 'value' => 'on',
2226 + 'operator' => '==',
2227 + ],
2228 + [
2229 + 'item' => 'modules.shopify_checkout.shop_continue_btn',
2230 + 'value' => 'on',
2231 + 'operator' => '==',
2232 + ],
2233 + ],
2234 + ],
2235 + ],
2236 + 'next_button_bg_color' => [
2237 + 'id' => 'next_button_bg_color',
2238 + 'isPro' => ! rtsb()->has_pro(),
2239 + 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
2240 + 'tab' => 'btn-styles',
2241 + 'type' => 'color',
2242 + 'dependency' => [
2243 + 'rules' => [
2244 + [
2245 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2246 + 'value' => 'on',
2247 + 'operator' => '==',
2248 + ],
2249 + [
2250 + 'item' => 'modules.shopify_checkout.shop_continue_btn',
2251 + 'value' => 'on',
2252 + 'operator' => '==',
2253 + ],
2254 + ],
2255 + ],
2256 + ],
2257 + 'next_button_hover_bg_color' => [
2258 + 'id' => 'next_button_hover_bg_color',
2259 + 'isPro' => ! rtsb()->has_pro(),
2260 + 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2261 + 'tab' => 'btn-styles',
2262 + 'type' => 'color',
2263 + 'dependency' => [
2264 + 'rules' => [
2265 + [
2266 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2267 + 'value' => 'on',
2268 + 'operator' => '==',
2269 + ],
2270 + [
2271 + 'item' => 'modules.shopify_checkout.shop_continue_btn',
2272 + 'value' => 'on',
2273 + 'operator' => '==',
2274 + ],
2275 + ],
2276 + ],
2277 + ],
2278 + 'next_button_color' => [
2279 + 'id' => 'next_button_color',
2280 + 'isPro' => ! rtsb()->has_pro(),
2281 + 'label' => esc_html__( 'Color', 'shopbuilder' ),
2282 + 'tab' => 'btn-styles',
2283 + 'type' => 'color',
2284 + 'dependency' => [
2285 + 'rules' => [
2286 + [
2287 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2288 + 'value' => 'on',
2289 + 'operator' => '==',
2290 + ],
2291 + [
2292 + 'item' => 'modules.shopify_checkout.shop_continue_btn',
2293 + 'value' => 'on',
2294 + 'operator' => '==',
2295 + ],
2296 + ],
2297 + ],
2298 + ],
2299 + 'next_button_hover_color' => [
2300 + 'id' => 'next_button_hover_color',
2301 + 'isPro' => ! rtsb()->has_pro(),
2302 + 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2303 + 'tab' => 'btn-styles',
2304 + 'type' => 'color',
2305 + 'dependency' => [
2306 + 'rules' => [
2307 + [
2308 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2309 + 'value' => 'on',
2310 + 'operator' => '==',
2311 + ],
2312 + [
2313 + 'item' => 'modules.shopify_checkout.shop_continue_btn',
2314 + 'value' => 'on',
2315 + 'operator' => '==',
2316 + ],
2317 + ],
2318 + ],
2319 + ],
2320 + 'next_button_border_color' => [
2321 + 'id' => 'next_button_border_color',
2322 + 'isPro' => ! rtsb()->has_pro(),
2323 + 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2324 + 'tab' => 'btn-styles',
2325 + 'type' => 'color',
2326 + 'dependency' => [
2327 + 'rules' => [
2328 + [
2329 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2330 + 'value' => 'on',
2331 + 'operator' => '==',
2332 + ],
2333 + [
2334 + 'item' => 'modules.shopify_checkout.shop_continue_btn',
2335 + 'value' => 'on',
2336 + 'operator' => '==',
2337 + ],
2338 + ],
2339 + ],
2340 + ],
2341 + 'next_button_hover_border_color' => [
2342 + 'id' => 'next_button_hover_border_color',
2343 + 'isPro' => ! rtsb()->has_pro(),
2344 + 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2345 + 'tab' => 'btn-styles',
2346 + 'type' => 'color',
2347 + 'dependency' => [
2348 + 'rules' => [
2349 + [
2350 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2351 + 'value' => 'on',
2352 + 'operator' => '==',
2353 + ],
2354 + [
2355 + 'item' => 'modules.shopify_checkout.shop_continue_btn',
2356 + 'value' => 'on',
2357 + 'operator' => '==',
2358 + ],
2359 + ],
2360 + ],
2361 + ],
2362 + 'prev_button_styles_settings' => [
2363 + 'id' => 'prev_button_styles_settings',
2364 + 'type' => 'title',
2365 + 'tab' => 'btn-styles',
2366 + 'label' => esc_html__( 'Prev Button Style', 'shopbuilder' ),
2367 + 'dependency' => [
2368 + 'rules' => [
2369 + [
2370 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2371 + 'value' => 'on',
2372 + 'operator' => '==',
2373 + ],
2374 + [
2375 + 'item' => 'modules.shopify_checkout.shop_return_btn',
2376 + 'value' => 'on',
2377 + 'operator' => '==',
2378 + ],
2379 + ],
2380 + ],
2381 +
2382 + ],
2383 + 'prev_button_height' => [
2384 + 'id' => 'prev_button_height',
2385 + 'isPro' => ! rtsb()->has_pro(),
2386 + 'label' => esc_html__( 'Height (px)', 'shopbuilder' ),
2387 + 'type' => 'slider',
2388 + 'min' => 10,
2389 + 'max' => 100,
2390 + 'unit' => 'px',
2391 + 'value' => 50,
2392 + 'tab' => 'btn-styles',
2393 + 'dependency' => [
2394 + 'rules' => [
2395 + [
2396 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2397 + 'value' => 'on',
2398 + 'operator' => '==',
2399 + ],
2400 + [
2401 + 'item' => 'modules.shopify_checkout.shop_return_btn',
2402 + 'value' => 'on',
2403 + 'operator' => '==',
2404 + ],
2405 + ],
2406 + ],
2407 + ],
2408 + 'prev_button_width' => [
2409 + 'id' => 'prev_button_width',
2410 + 'label' => esc_html__( 'Width (px)', 'shopbuilder' ),
2411 + 'type' => 'slider',
2412 + 'min' => 10,
2413 + 'max' => 1000,
2414 + 'unit' => 'px',
2415 + 'tab' => 'btn-styles',
2416 + 'dependency' => [
2417 + 'rules' => [
2418 + [
2419 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2420 + 'value' => 'on',
2421 + 'operator' => '==',
2422 + ],
2423 + [
2424 + 'item' => 'modules.shopify_checkout.shop_return_btn',
2425 + 'value' => 'on',
2426 + 'operator' => '==',
2427 + ],
2428 + ],
2429 + ],
2430 + ],
2431 + 'prev_button_font_size' => [
2432 + 'id' => 'prev_button_font_size',
2433 + 'isPro' => ! rtsb()->has_pro(),
2434 + 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2435 + 'type' => 'slider',
2436 + 'min' => 10,
2437 + 'max' => 50,
2438 + 'unit' => 'px',
2439 + 'value' => 15,
2440 + 'tab' => 'btn-styles',
2441 + 'dependency' => [
2442 + 'rules' => [
2443 + [
2444 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2445 + 'value' => 'on',
2446 + 'operator' => '==',
2447 + ],
2448 + [
2449 + 'item' => 'modules.shopify_checkout.shop_return_btn',
2450 + 'value' => 'on',
2451 + 'operator' => '==',
2452 + ],
2453 + ],
2454 + ],
2455 + ],
2456 + 'prev_button_bg_color' => [
2457 + 'id' => 'prev_button_bg_color',
2458 + 'isPro' => ! rtsb()->has_pro(),
2459 + 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
2460 + 'tab' => 'btn-styles',
2461 + 'type' => 'color',
2462 + 'dependency' => [
2463 + 'rules' => [
2464 + [
2465 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2466 + 'value' => 'on',
2467 + 'operator' => '==',
2468 + ],
2469 + [
2470 + 'item' => 'modules.shopify_checkout.shop_return_btn',
2471 + 'value' => 'on',
2472 + 'operator' => '==',
2473 + ],
2474 + ],
2475 + ],
2476 + ],
2477 + 'prev_button_hover_bg_color' => [
2478 + 'id' => 'prev_button_hover_bg_color',
2479 + 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2480 + 'isPro' => ! rtsb()->has_pro(),
2481 + 'tab' => 'btn-styles',
2482 + 'type' => 'color',
2483 + 'dependency' => [
2484 + 'rules' => [
2485 + [
2486 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2487 + 'value' => 'on',
2488 + 'operator' => '==',
2489 + ],
2490 + [
2491 + 'item' => 'modules.shopify_checkout.shop_return_btn',
2492 + 'value' => 'on',
2493 + 'operator' => '==',
2494 + ],
2495 + ],
2496 + ],
2497 + ],
2498 + 'prev_button_color' => [
2499 + 'id' => 'prev_button_color',
2500 + 'label' => esc_html__( 'Color', 'shopbuilder' ),
2501 + 'isPro' => ! rtsb()->has_pro(),
2502 + 'tab' => 'btn-styles',
2503 + 'type' => 'color',
2504 + 'dependency' => [
2505 + 'rules' => [
2506 + [
2507 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2508 + 'value' => 'on',
2509 + 'operator' => '==',
2510 + ],
2511 + [
2512 + 'item' => 'modules.shopify_checkout.shop_return_btn',
2513 + 'value' => 'on',
2514 + 'operator' => '==',
2515 + ],
2516 + ],
2517 + ],
2518 + ],
2519 + 'prev_button_hover_color' => [
2520 + 'id' => 'prev_button_hover_color',
2521 + 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2522 + 'isPro' => ! rtsb()->has_pro(),
2523 + 'tab' => 'btn-styles',
2524 + 'type' => 'color',
2525 + 'dependency' => [
2526 + 'rules' => [
2527 + [
2528 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2529 + 'value' => 'on',
2530 + 'operator' => '==',
2531 + ],
2532 + [
2533 + 'item' => 'modules.shopify_checkout.shop_return_btn',
2534 + 'value' => 'on',
2535 + 'operator' => '==',
2536 + ],
2537 + ],
2538 + ],
2539 + ],
2540 + 'prev_button_border_color' => [
2541 + 'id' => 'prev_button_border_color',
2542 + 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2543 + 'isPro' => ! rtsb()->has_pro(),
2544 + 'tab' => 'btn-styles',
2545 + 'type' => 'color',
2546 + 'dependency' => [
2547 + 'rules' => [
2548 + [
2549 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2550 + 'value' => 'on',
2551 + 'operator' => '==',
2552 + ],
2553 + [
2554 + 'item' => 'modules.shopify_checkout.shop_return_btn',
2555 + 'value' => 'on',
2556 + 'operator' => '==',
2557 + ],
2558 + ],
2559 + ],
2560 + ],
2561 + 'prev_button_hover_border_color' => [
2562 + 'id' => 'prev_button_hover_border_color',
2563 + 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2564 + 'isPro' => ! rtsb()->has_pro(),
2565 + 'tab' => 'btn-styles',
2566 + 'type' => 'color',
2567 + 'dependency' => [
2568 + 'rules' => [
2569 + [
2570 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2571 + 'value' => 'on',
2572 + 'operator' => '==',
2573 + ],
2574 + [
2575 + 'item' => 'modules.shopify_checkout.shop_return_btn',
2576 + 'value' => 'on',
2577 + 'operator' => '==',
2578 + ],
2579 + ],
2580 + ],
2581 + ],
2582 + 'coupon_button_styles_settings' => [
2583 + 'id' => 'coupon_button_styles_settings',
2584 + 'type' => 'title',
2585 + 'tab' => 'btn-styles',
2586 + 'label' => esc_html__( 'Apply Coupon Button Style', 'shopbuilder' ),
2587 + ],
2588 + 'coupon_height' => [
2589 + 'id' => 'coupon_height',
2590 + 'label' => esc_html__( 'Coupon Field And Button Height (px)', 'shopbuilder' ),
2591 + 'type' => 'slider',
2592 + 'min' => 10,
2593 + 'max' => 100,
2594 + 'unit' => 'px',
2595 + 'value' => 50,
2596 + 'tab' => 'btn-styles',
2597 + ],
2598 + 'coupon_button_font_size' => [
2599 + 'id' => 'coupon_button_font_size',
2600 + 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2601 + 'type' => 'slider',
2602 + 'min' => 10,
2603 + 'max' => 50,
2604 + 'unit' => 'px',
2605 + 'value' => 15,
2606 + 'tab' => 'btn-styles',
2607 + ],
2608 + 'coupon_button_bg_color' => [
2609 + 'id' => 'coupon_button_bg_color',
2610 + 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
2611 + 'tab' => 'btn-styles',
2612 + 'type' => 'color',
2613 + ],
2614 + 'coupon_button_hover_bg_color' => [
2615 + 'id' => 'coupon_button_hover_bg_color',
2616 + 'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ),
2617 + 'tab' => 'btn-styles',
2618 + 'type' => 'color',
2619 + ],
2620 + 'coupon_button_color' => [
2621 + 'id' => 'coupon_button_color',
2622 + 'label' => esc_html__( 'Color', 'shopbuilder' ),
2623 + 'tab' => 'btn-styles',
2624 + 'type' => 'color',
2625 + ],
2626 + 'coupon_button_hover_color' => [
2627 + 'id' => 'coupon_button_hover_color',
2628 + 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2629 + 'tab' => 'btn-styles',
2630 + 'type' => 'color',
2631 + ],
2632 + 'coupon_button_border_color' => [
2633 + 'id' => 'coupon_button_border_color',
2634 + 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
2635 + 'tab' => 'btn-styles',
2636 + 'type' => 'color',
2637 + ],
2638 + 'coupon_button_hover_border_color' => [
2639 + 'id' => 'coupon_button_hover_border_color',
2640 + 'label' => esc_html__( 'Hover Border Color', 'shopbuilder' ),
2641 + 'tab' => 'btn-styles',
2642 + 'type' => 'color',
2643 + ],
2644 +
2645 + 'header_cart_icon_styles' => [
2646 + 'id' => 'header_cart_icon_styles',
2647 + 'type' => 'title',
2648 + 'tab' => 'styles',
2649 + 'label' => esc_html__( 'Header Cart Icon Style', 'shopbuilder' ),
2650 + 'dependency' => [
2651 + 'rules' => [
2652 + [
2653 + 'item' => 'modules.shopify_checkout.cart_icon_source',
2654 + 'value' => 'none',
2655 + 'operator' => '!=',
2656 + ],
2657 + ],
2658 + ],
2659 + ],
2660 +
2661 + 'shopify_cart_icon_height' => [
2662 + 'id' => 'shopify_cart_icon_height',
2663 + 'label' => esc_html__( 'Cart Icon Height (px)', 'shopbuilder' ),
2664 + 'type' => 'slider',
2665 + 'min' => 10,
2666 + 'max' => 200,
2667 + 'unit' => 'px',
2668 + 'value' => 40,
2669 + 'tab' => 'styles',
2670 + 'dependency' => [
2671 + 'rules' => [
2672 + [
2673 + 'item' => 'modules.shopify_checkout.cart_icon_source',
2674 + 'value' => 'upload_icon',
2675 + 'operator' => '==',
2676 + ],
2677 + ],
2678 + ],
2679 + ],
2680 +
2681 + 'header_cart_icon_color' => [
2682 + 'id' => 'step_menu_color',
2683 + 'label' => esc_html__( 'Color', 'shopbuilder' ),
2684 + 'tab' => 'styles',
2685 + 'type' => 'color',
2686 + 'dependency' => [
2687 + 'rules' => [
2688 + [
2689 + 'item' => 'modules.shopify_checkout.cart_icon_source',
2690 + 'value' => 'select_icon',
2691 + 'operator' => '==',
2692 + ],
2693 + ],
2694 + ],
2695 + ],
2696 + 'header_cart_icon_hover_color' => [
2697 + 'id' => 'header_cart_icon_hover_color',
2698 + 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2699 + 'tab' => 'styles',
2700 + 'type' => 'color',
2701 + 'dependency' => [
2702 + 'rules' => [
2703 + [
2704 + 'item' => 'modules.shopify_checkout.cart_icon_source',
2705 + 'value' => 'select_icon',
2706 + 'operator' => '==',
2707 + ],
2708 + ],
2709 + ],
2710 + ],
2711 + 'header_cart_icon_font_size' => [
2712 + 'id' => 'header_cart_icon_font_size',
2713 + 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2714 + 'type' => 'slider',
2715 + 'min' => 10,
2716 + 'max' => 50,
2717 + 'unit' => 'px',
2718 + 'value' => 15,
2719 + 'tab' => 'styles',
2720 + 'dependency' => [
2721 + 'rules' => [
2722 + [
2723 + 'item' => 'modules.shopify_checkout.cart_icon_source',
2724 + 'value' => 'select_icon',
2725 + 'operator' => '==',
2726 + ],
2727 + ],
2728 + ],
2729 + ],
2730 + 'footer_menu_styles_settings' => [
2731 + 'id' => 'footer_menu_styles_settings',
2732 + 'type' => 'title',
2733 + 'tab' => 'styles',
2734 + 'label' => esc_html__( 'Footer Style', 'shopbuilder' ),
2735 + ],
2736 + 'footer_menu_color' => [
2737 + 'id' => 'footer_menu_color',
2738 + 'label' => esc_html__( 'Menu Color', 'shopbuilder' ),
2739 + 'tab' => 'styles',
2740 + 'type' => 'color',
2741 + ],
2742 + 'footer_menu_hover_color' => [
2743 + 'id' => 'footer_menu_hover_color',
2744 + 'label' => esc_html__( 'Menu Hover Color', 'shopbuilder' ),
2745 + 'tab' => 'styles',
2746 + 'type' => 'color',
2747 + ],
2748 + 'footer_menu_font_size' => [
2749 + 'id' => 'footer_menu_font_size',
2750 + 'label' => esc_html__( 'Menu Font Size (px)', 'shopbuilder' ),
2751 + 'type' => 'slider',
2752 + 'min' => 10,
2753 + 'max' => 50,
2754 + 'unit' => 'px',
2755 + 'value' => 15,
2756 + 'tab' => 'styles',
2757 + ],
2758 + 'footer_text_size' => [
2759 + 'id' => 'footer_text_size',
2760 + 'label' => esc_html__( 'Footer Text Font Size (px)', 'shopbuilder' ),
2761 + 'type' => 'slider',
2762 + 'min' => 10,
2763 + 'max' => 50,
2764 + 'unit' => 'px',
2765 + 'value' => 15,
2766 + 'tab' => 'styles',
2767 + ],
2768 + 'footer_text_color' => [
2769 + 'id' => 'footer_text_color',
2770 + 'label' => esc_html__( 'Footer Text Color', 'shopbuilder' ),
2771 + 'tab' => 'styles',
2772 + 'type' => 'color',
2773 + ],
2774 + 'step_menu_styles_settings' => [
2775 + 'id' => 'step_menu_styles_settings',
2776 + 'type' => 'title',
2777 + 'tab' => 'styles',
2778 + 'label' => esc_html__( 'Step Menu Style', 'shopbuilder' ),
2779 + 'dependency' => [
2780 + 'rules' => [
2781 + [
2782 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2783 + 'value' => 'on',
2784 + 'operator' => '==',
2785 + ],
2786 + [
2787 + 'item' => 'modules.shopify_checkout.show_step_menu',
2788 + 'value' => 'on',
2789 + 'operator' => '==',
2790 + ],
2791 + ],
2792 + ],
2793 + ],
2794 + 'step_menu_color' => [
2795 + 'id' => 'step_menu_color',
2796 + 'label' => esc_html__( 'Color', 'shopbuilder' ),
2797 + 'isPro' => ! rtsb()->has_pro(),
2798 + 'tab' => 'styles',
2799 + 'type' => 'color',
2800 + 'dependency' => [
2801 + 'rules' => [
2802 + [
2803 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2804 + 'value' => 'on',
2805 + 'operator' => '==',
2806 + ],
2807 + [
2808 + 'item' => 'modules.shopify_checkout.show_step_menu',
2809 + 'value' => 'on',
2810 + 'operator' => '==',
2811 + ],
2812 + ],
2813 + ],
2814 + ],
2815 + 'step_menu_hover_color' => [
2816 + 'id' => 'step_menu_hover_color',
2817 + 'label' => esc_html__( 'Hover Color', 'shopbuilder' ),
2818 + 'isPro' => ! rtsb()->has_pro(),
2819 + 'tab' => 'styles',
2820 + 'type' => 'color',
2821 + 'dependency' => [
2822 + 'rules' => [
2823 + [
2824 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2825 + 'value' => 'on',
2826 + 'operator' => '==',
2827 + ],
2828 + [
2829 + 'item' => 'modules.shopify_checkout.show_step_menu',
2830 + 'value' => 'on',
2831 + 'operator' => '==',
2832 + ],
2833 + ],
2834 + ],
2835 + ],
2836 + 'step_menu_font_size' => [
2837 + 'id' => 'step_menu_font_size',
2838 + 'label' => esc_html__( 'Font Size (px)', 'shopbuilder' ),
2839 + 'isPro' => ! rtsb()->has_pro(),
2840 + 'type' => 'slider',
2841 + 'min' => 10,
2842 + 'max' => 50,
2843 + 'unit' => 'px',
2844 + 'value' => 15,
2845 + 'tab' => 'styles',
2846 + 'dependency' => [
2847 + 'rules' => [
2848 + [
2849 + 'item' => 'modules.shopify_checkout.enable_multi_step',
2850 + 'value' => 'on',
2851 + 'operator' => '==',
2852 + ],
2853 + [
2854 + 'item' => 'modules.shopify_checkout.show_step_menu',
2855 + 'value' => 'on',
2856 + 'operator' => '==',
2857 + ],
2858 + ],
2859 + ],
2860 + ],
2861 + ];
2862 + return $fields;
2863 + }
2864 + /**
2865 + * @return array
2866 + */
2867 + public function product_badges_fields() {
2868 + return apply_filters(
2869 + 'rtsb/module/product_badges/fields',
2870 + [
2871 + 'hide_woocommerce_badge' => [
2872 + 'id' => 'hide_woocommerce_badge',
2873 + 'value' => '',
2874 + 'type' => 'switch',
2875 + 'label' => esc_html__( 'Hide Theme Badges', 'shopbuilder' ),
2876 + 'help' => esc_html__( 'Switch on to hide theme default badges.', 'shopbuilder' ),
2877 + 'tab' => 'general',
2878 + ],
2879 + // Hide "On sale".
2880 + 'hide_on_sale' => [
2881 + 'id' => 'hide_on_sale',
2882 + 'type' => 'select',
2883 + 'value' => 'all_products',
2884 + 'isPro' => ! rtsb()->has_pro(),
2885 + 'label' => esc_html__( 'Applicable Products', 'shopbuilder' ),
2886 + 'options' => [
2887 + 'all_products' => esc_html__( 'All products', 'shopbuilder' ),
2888 + 'where_custom_badge_applied' => esc_html__( 'Only for products which have custom badge enabled', 'shopbuilder' ),
2889 + ],
2890 + 'help' => esc_html__( 'Choose where to hide the default badges.', 'shopbuilder' ),
2891 + 'tab' => 'general',
2892 + 'dependency' => [
2893 + 'rules' => [
2894 + [
2895 + 'item' => 'modules.product_badges.hide_woocommerce_badge',
2896 + 'value' => 'on',
2897 + 'operator' => '==',
2898 + ],
2899 + ],
2900 + ],
2901 + ],
2902 +
2903 + 'group_badge_display_as' => [
2904 + 'id' => 'group_badge_display_as',
2905 + 'type' => 'select',
2906 + 'value' => 'horizontal',
2907 + 'isPro' => ! rtsb()->has_pro(),
2908 + 'label' => esc_html__( 'Group Badge Display Type', 'shopbuilder' ),
2909 + 'help' => sprintf(
2910 + // translators: %s for pro message.
2911 + esc_html__( 'Please choose the group display type. %s', 'shopbuilder' ),
2912 + ! rtsb()->has_pro()
2913 + ? sprintf(
2914 + '<a target="_blank" href="' . esc_url( rtsb()->pro_version_link() ) . '">%s </a> %s ',
2915 + esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
2916 + esc_html__( 'for vertical layout.', 'shopbuilder' )
2917 + )
2918 + : ''
2919 + ),
2920 + 'options' => [
2921 + 'horizontal' => esc_html__( 'Horizontal', 'shopbuilder' ),
2922 + 'vertical' => esc_html__( 'Vertical', 'shopbuilder' ),
2923 + ],
2924 + 'tab' => 'group',
2925 + ],
2926 + 'group_badge_gap' => [
2927 + 'id' => 'group_badge_gap',
2928 + 'type' => 'text',
2929 + 'value' => '10px',
2930 + 'label' => esc_html__( 'Group Badge Gap/Spacing', 'shopbuilder' ),
2931 + 'help' => esc_html__( 'Example: 10px', 'shopbuilder' ),
2932 + 'tab' => 'group',
2933 + ],
2934 + 'general_options' => [
2935 + 'id' => 'general_options',
2936 + 'type' => 'title',
2937 + 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder' ),
2938 + 'tab' => 'group',
2939 + ],
2940 + 'loop_group_position' => [
2941 + 'id' => 'loop_group_position',
2942 + 'type' => 'select',
2943 + 'value' => 'above_image',
2944 + 'isPro' => ! rtsb()->has_pro(),
2945 + 'label' => esc_html__( 'Shop Page Group Position', 'shopbuilder' ),
2946 + 'help' => esc_html__( 'Choose the group badges position in Shop page.', 'shopbuilder' ),
2947 + 'options' => [
2948 + 'above_image' => esc_html__( 'Floating Above Image', 'shopbuilder' ),
2949 + 'before_product_title' => esc_html__( 'Before Product Title', 'shopbuilder' ),
2950 + 'after_product_title' => esc_html__( 'After Product Title', 'shopbuilder' ),
2951 + 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
2952 + 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
2953 + 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
2954 + ],
2955 + 'tab' => 'group',
2956 + ],
2957 + 'loop_custom_hook_name' => [
2958 + 'id' => 'loop_custom_hook_name',
2959 + 'type' => 'text',
2960 + 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
2961 + 'tab' => 'group',
2962 + 'help' => sprintf(
2963 + /* translators: 1: The shortcode.*/
2964 + __( 'Or Copy the php code <br />%1$s<br /> and paste it in your product query where you want to show the button.', 'shopbuilder' ),
2965 + "<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>"
2966 + ),
2967 + 'dependency' => [
2968 + 'rules' => [
2969 + [
2970 + 'item' => 'modules.product_badges.loop_group_position',
2971 + 'value' => 'custom',
2972 + 'operator' => '==',
2973 + ],
2974 + ],
2975 + ],
2976 + ],
2977 + 'group_position_hook_priority' => [
2978 + 'id' => 'group_position_hook_priority',
2979 + 'type' => 'number',
2980 + 'size' => 'small',
2981 + 'min' => 0,
2982 + 'max' => 999,
2983 + 'label' => esc_html__( 'Badge Position Priority', 'shopbuilder' ),
2984 + 'help' => esc_html__( 'It\'s depend on your theme functionality. Example: 20', 'shopbuilder' ),
2985 + 'tab' => 'group',
2986 + 'dependency' => [
2987 + 'rules' => [
2988 + [
2989 + 'item' => 'modules.product_badges.loop_group_position',
2990 + 'value' => 'custom',
2991 + 'operator' => '==',
2992 + ],
2993 + ],
2994 + ],
2995 + ],
2996 + 'group_badge_position' => [
2997 + 'id' => 'group_badge_position',
2998 + 'label' => esc_html__( 'Position Above Image', 'shopbuilder' ),
2999 + 'type' => 'text_select',
3000 + 'value' => 'top-left',
3001 + 'options' => [
3002 + 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
3003 + 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
3004 + 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
3005 + 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
3006 + ],
3007 + 'dependency' => [
3008 + 'rules' => [
3009 + [
3010 + 'item' => 'modules.product_badges.loop_group_position',
3011 + 'value' => 'above_image',
3012 + 'operator' => '==',
3013 + ],
3014 + ],
3015 + ],
3016 + 'tab' => 'group',
3017 + ],
3018 + 'product_options' => [
3019 + 'id' => 'product_options',
3020 + 'type' => 'title',
3021 + 'label' => esc_html__( 'Product Page Settings', 'shopbuilder' ),
3022 + 'tab' => 'group',
3023 + ],
3024 + 'product_page_group_position' => [
3025 + 'id' => 'product_page_group_position',
3026 + 'type' => 'select',
3027 + 'value' => 'above_image',
3028 + 'isPro' => ! rtsb()->has_pro(),
3029 + 'label' => esc_html__( 'Product Page Group Position', 'shopbuilder' ),
3030 + 'help' => esc_html__( 'Choose the group badges position in product page.', 'shopbuilder' ),
3031 + 'options' => [
3032 + 'above_image' => esc_html__( 'Floating Above Image', 'shopbuilder' ),
3033 + 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
3034 + 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
3035 + 'after_summary' => esc_html__( 'After Summary', 'shopbuilder' ),
3036 + 'after_short_desc' => esc_html__( 'After Short Description', 'shopbuilder' ),
3037 + 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
3038 + 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
3039 + ],
3040 + 'tab' => 'group',
3041 + ],
3042 + 'product_page_badges_shortcode' => [
3043 + 'type' => 'raw',
3044 + 'label' => ' ',
3045 + 'html' => sprintf(
3046 + /* translators: 1: The shortcode.*/
3047 + 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' ),
3048 + '<code>[rtsb_badges]</code>'
3049 + ),
3050 + 'dependency' => [
3051 + 'rules' => [
3052 + [
3053 + 'item' => 'modules.product_badges.product_page_group_position',
3054 + 'value' => 'shortcode',
3055 + 'operator' => '==',
3056 + ],
3057 + ],
3058 + ],
3059 + 'tab' => 'group',
3060 + ],
3061 + 'product_page_custom_hook_name' => [
3062 + 'id' => 'product_page_custom_hook_name',
3063 + 'type' => 'text',
3064 + 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
3065 + 'tab' => 'group',
3066 + 'help' => sprintf(
3067 + /* translators: 1: The shortcode.*/
3068 + __( 'Or Copy the php code <br />%1$s<br /> and paste it in your product query where you want to show the button.', 'shopbuilder' ),
3069 + "<code>&lt;?php do_action( 'rtsb/modules/product_badges/frontend/display' ); ?&gt;</code>"
3070 + ),
3071 + 'dependency' => [
3072 + 'rules' => [
3073 + [
3074 + 'item' => 'modules.product_badges.product_page_group_position',
3075 + 'value' => 'custom',
3076 + 'operator' => '==',
3077 + ],
3078 + ],
3079 + ],
3080 + ],
3081 + 'product_page_group_hook_priority' => [
3082 + 'id' => 'product_page_group_hook_priority',
3083 + 'type' => 'number',
3084 + 'size' => 'small',
3085 + 'min' => 0,
3086 + 'max' => 999,
3087 + 'label' => esc_html__( 'Badge Position Priority', 'shopbuilder' ),
3088 + 'help' => esc_html__( 'It\'s depend on your theme functionality. Example: 20', 'shopbuilder' ),
3089 + 'tab' => 'group',
3090 + 'dependency' => [
3091 + 'rules' => [
3092 + [
3093 + 'item' => 'modules.product_badges.product_page_group_position',
3094 + 'value' => 'custom',
3095 + 'operator' => '==',
3096 + ],
3097 + ],
3098 + ],
3099 +
3100 + ],
3101 + 'product_page_group_badge_position' => [
3102 + 'id' => 'product_page_group_badge_position',
3103 + 'label' => esc_html__( 'Position Above Image', 'shopbuilder' ),
3104 + 'type' => 'text_select',
3105 + 'value' => 'top-left',
3106 + 'options' => [
3107 + 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
3108 + 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
3109 + 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
3110 + 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
3111 + ],
3112 + 'dependency' => [
3113 + 'rules' => [
3114 + [
3115 + 'item' => 'modules.product_badges.product_page_group_position',
3116 + 'value' => 'above_image',
3117 + 'operator' => '==',
3118 + ],
3119 + ],
3120 + ],
3121 + 'tab' => 'group',
3122 + ],
3123 +
3124 + 'badges_field_intro' => [
3125 + 'id' => 'badges_field_intro',
3126 + 'type' => 'description',
3127 + 'text' => esc_html__( 'To add new product badges, simply click on the \'Add New\' button below.', 'shopbuilder' ),
3128 + 'tab' => 'badges',
3129 + ],
3130 + 'badges_field' => [
3131 + 'id' => 'badges_field',
3132 + 'type' => 'repeaters',
3133 + 'label' => '',
3134 + 'tab' => 'badges',
3135 + 'repeat' => [
3136 +
3137 + 'title' => [
3138 + 'id' => 'title',
3139 + 'label' => esc_html__( 'Badge Name', 'shopbuilder' ),
3140 + 'help' => esc_html__( 'Enter badge name.', 'shopbuilder' ),
3141 + 'type' => 'text',
3142 + 'placeholder' => esc_html__( 'Badge Name', 'shopbuilder' ),
3143 + 'value' => esc_html__( 'Badge Name', 'shopbuilder' ),
3144 + ],
3145 + 'badge_condition' => [
3146 + 'id' => 'badge_condition',
3147 + 'type' => 'select',
3148 + 'value' => 'dynamic',
3149 + 'isPro' => ! rtsb()->has_pro(),
3150 + 'label' => esc_html__( 'Badge Type', 'shopbuilder' ),
3151 + 'help' => sprintf(
3152 + // translators: %s for pro message.
3153 + esc_html__( 'Select badge type. %s', 'shopbuilder' ),
3154 + ! rtsb()->has_pro()
3155 + ? sprintf(
3156 + '<a target="_blank" href="' . esc_url( rtsb()->pro_version_link() ) . '">%s</a> %s',
3157 + esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
3158 + esc_html__( 'unlock custom badge creation.', 'shopbuilder' )
3159 + )
3160 + : ''
3161 + ),
3162 + 'options' => [
3163 + 'dynamic' => esc_html__( 'Dynamic', 'shopbuilder' ),
3164 + 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
3165 + ],
3166 + ],
3167 + 'badge_for' => [
3168 + 'id' => 'badge_for',
3169 + 'type' => 'select',
3170 + 'value' => 'on_sale',
3171 + 'label' => esc_html__( 'Dynamic Badge Condition', 'shopbuilder' ),
3172 + 'help' => esc_html__( 'Specify dynamic badge condition', 'shopbuilder' ),
3173 + 'options' => $this->dynamic_badge_list(),
3174 + 'dependency' => [
3175 + 'rules' => [
3176 + [
3177 + 'item' => 'modules.product_badges.badges_field.badge_condition',
3178 + 'value' => 'dynamic',
3179 + 'operator' => '==',
3180 + ],
3181 + ],
3182 + ],
3183 + ],
3184 + 'badge_for_pre_order' => [
3185 + 'type' => 'raw',
3186 + 'label' => ' ',
3187 + 'html' => esc_html__( 'Please ensure that Pre-Order module is activated and properly configured.', 'shopbuilder' ),
3188 + 'tab' => 'general',
3189 + 'dependency' => [
3190 + 'rules' => [
3191 + [
3192 + 'item' => 'modules.product_badges.badges_field.badge_condition',
3193 + 'value' => 'dynamic',
3194 + 'operator' => '==',
3195 + ],
3196 + [
3197 + 'item' => 'modules.product_badges.badges_field.badge_for',
3198 + 'value' => 'pre_order',
3199 + 'operator' => '==',
3200 + ],
3201 + ],
3202 + ],
3203 + ],
3204 + 'minimum_sale_count' => [
3205 + 'id' => 'minimum_sale_count',
3206 + 'type' => 'number',
3207 + 'label' => esc_html__( 'Minimum Sale Count', 'shopbuilder' ),
3208 + 'help' => esc_html__( 'Enter the number of Sale you want to designate for products to be labeled as \'Best Selling.\'', 'shopbuilder' ),
3209 + 'dependency' => [
3210 + 'rules' => [
3211 + [
3212 + 'item' => 'modules.product_badges.badges_field.badge_condition',
3213 + 'value' => 'dynamic',
3214 + 'operator' => '==',
3215 + ],
3216 + [
3217 + 'item' => 'modules.product_badges.badges_field.badge_for',
3218 + 'value' => 'best_selling',
3219 + 'operator' => '==',
3220 + ],
3221 + ],
3222 + ],
3223 + ],
3224 + 'new_arrival_days' => [
3225 + 'id' => 'new_arrival_days',
3226 + 'type' => 'number',
3227 + 'label' => esc_html__( 'Specify Number of Days', 'shopbuilder' ),
3228 + 'help' => esc_html__( 'Enter the number of days you want to designate for products to be labeled as \'New Arrivals.\'', 'shopbuilder' ),
3229 + 'dependency' => [
3230 + 'rules' => [
3231 + [
3232 + 'item' => 'modules.product_badges.badges_field.badge_for',
3233 + 'value' => 'new_arrival',
3234 + 'operator' => '==',
3235 + ],
3236 + ],
3237 + ],
3238 + ],
3239 + 'badges_type' => [
3240 + 'id' => 'badges_type',
3241 + 'type' => 'select',
3242 + 'value' => 'text',
3243 + 'isPro' => ! rtsb()->has_pro(),
3244 + 'label' => esc_html__( 'Show Badge As:', 'shopbuilder' ),
3245 + 'help' => sprintf(
3246 + // translators: %s for pro message.
3247 + esc_html__( 'Specify the badge display as Image Or Text. %s', 'shopbuilder' ),
3248 + ! rtsb()->has_pro()
3249 + ? sprintf(
3250 + '<a target="_blank" href="' . esc_url( rtsb()->pro_version_link() ) . '">%s</a> %s',
3251 + esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
3252 + esc_html__( 'unlock Image badge creation.', 'shopbuilder' )
3253 + )
3254 + : ''
3255 + ),
3256 + 'options' => [
3257 + 'image' => esc_html__( 'Image', 'shopbuilder' ),
3258 + 'text' => esc_html__( 'Text', 'shopbuilder' ),
3259 + ],
3260 + ],
3261 +
3262 + 'badge_preset' => [
3263 + 'id' => 'badge_preset',
3264 + 'label' => esc_html__( 'Text Badge Preset', 'shopbuilder' ),
3265 + 'help' => esc_html__( 'Choose the badge appearance', 'shopbuilder' ),
3266 + 'type' => 'image_select',
3267 + 'value' => 'preset1',
3268 + 'options' => [
3269 + 'preset1' => [
3270 + 'label' => esc_html__( 'Preset 1', 'shopbuilder' ),
3271 + 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-1.png' ) ),
3272 + ],
3273 +
3274 + 'preset2' => [
3275 + 'label' => esc_html__( 'Preset 2', 'shopbuilder' ),
3276 + 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-2.png' ) ),
3277 + ],
3278 +
3279 + 'preset3' => [
3280 + 'label' => esc_html__( 'Preset 3', 'shopbuilder' ),
3281 + 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-3.png' ) ),
3282 + ],
3283 +
3284 + 'preset4' => [
3285 + 'title' => esc_html__( 'Preset 4', 'shopbuilder' ),
3286 + 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-4.png' ) ),
3287 + ],
3288 + ],
3289 + 'dependency' => [
3290 + 'rules' => [
3291 + [
3292 + 'item' => 'modules.product_badges.badges_field.badges_type',
3293 + 'value' => 'text',
3294 + 'operator' => '==',
3295 + ],
3296 + ],
3297 + ],
3298 + ],
3299 + 'badges_text' => [
3300 + 'id' => 'badges_text',
3301 + 'label' => esc_html__( 'Enter Badge Text', 'shopbuilder' ),
3302 + 'help' => esc_html__( 'The badge text will be displayed when the dynamic percentage switch is turned off.', 'shopbuilder' ),
3303 + 'type' => 'text',
3304 + 'placeholder' => 'Badge Text',
3305 + 'value' => esc_html__( 'New', 'shopbuilder' ),
3306 + 'dependency' => [
3307 + 'rules' => [
3308 + [
3309 + 'item' => 'modules.product_badges.badges_field.badges_type',
3310 + 'value' => 'text',
3311 + 'operator' => '==',
3312 + ],
3313 + ],
3314 + ],
3315 + ],
3316 + 'show_badges_percent_text' => [
3317 + 'id' => 'show_badges_percent_text',
3318 + 'type' => 'switch',
3319 + 'label' => esc_html__( 'Show Badges Percentage (%)', 'shopbuilder' ),
3320 + 'help' => esc_html__( 'Switch on to show badge as dynamic percentage instead of text.', 'shopbuilder' ),
3321 + 'dependency' => [
3322 + 'rules' => [
3323 + [
3324 + 'item' => 'modules.product_badges.badges_field.badge_for',
3325 + 'value' => 'on_sale',
3326 + 'operator' => '==',
3327 + ],
3328 + [
3329 + 'item' => 'modules.product_badges.badges_field.badges_type',
3330 + 'value' => 'text',
3331 + 'operator' => '==',
3332 + ],
3333 + [
3334 + 'item' => 'modules.product_badges.badges_field.badge_condition',
3335 + 'value' => 'dynamic',
3336 + 'operator' => '==',
3337 + ],
3338 +
3339 + ],
3340 + ],
3341 + ],
3342 +
3343 + 'upload_image' => [
3344 + 'id' => 'upload_image',
3345 + 'type' => 'fileupload',
3346 + 'label' => esc_html__( 'Upload Image', 'shopbuilder' ),
3347 + 'help' => esc_html__( 'Upload badge image.', 'shopbuilder' ),
3348 + 'tab' => 'general',
3349 + 'dependency' => [
3350 + 'rules' => [
3351 + [
3352 + 'item' => 'modules.product_badges.badges_field.badges_type',
3353 + 'value' => 'image',
3354 + 'operator' => '==',
3355 + ],
3356 + ],
3357 + ],
3358 + ],
3359 +
3360 + 'apply_for' => [
3361 + 'id' => 'apply_for',
3362 + 'type' => 'select',
3363 + 'value' => 'product',
3364 + 'isPro' => ! rtsb()->has_pro(),
3365 + 'label' => esc_html__( 'Applicable For', 'shopbuilder' ),
3366 + 'options' => [
3367 + 'product' => esc_html__( 'Products', 'shopbuilder' ),
3368 + 'product_cat' => esc_html__( 'Product Categories', 'shopbuilder' ),
3369 + ],
3370 + 'help' => esc_html__( 'Badges will apply for selected products, or categories.', 'shopbuilder' ),
3371 + ],
3372 + 'applicable_products' => [
3373 + 'id' => 'applicable_products',
3374 + 'type' => 'search_and_multi_select',
3375 + 'label' => esc_html__( 'Applicable Products', 'shopbuilder' ),
3376 + 'help' => esc_html__( 'Choose products to include. Leave blank to apply in all product.', 'shopbuilder' ),
3377 + 'placeholder' => esc_html__( 'Search Products', 'shopbuilder' ),
3378 + 'func_with_param' => [ Fns::class, 'get_post_types', [ 'post_type' => 'product' ] ],
3379 + 'options' => Fns::get_post_types( null, [ 'post_type' => 'product' ] ),
3380 + 'dependency' => [
3381 + 'rules' => [
3382 + [
3383 + 'item' => 'modules.product_badges.badges_field.apply_for',
3384 + 'value' => 'product',
3385 + 'operator' => '==',
3386 + ],
3387 + ],
3388 + ],
3389 + ],
3390 + 'applicable_categories' => [
3391 + 'id' => 'applicable_categories',
3392 + 'type' => 'search_and_multi_select',
3393 + 'label' => esc_html__( 'Applicable Categories', 'shopbuilder' ),
3394 + 'help' => esc_html__( 'Choose categories to include. Leave blank to apply in all categories.', 'shopbuilder' ),
3395 + 'placeholder' => esc_html__( 'Search Category', 'shopbuilder' ),
3396 + 'func_with_param' => [
3397 + Fns::class,
3398 + 'products_category_query',
3399 + ],
3400 + 'options' => Fns::products_category_query(),
3401 + 'dependency' => [
3402 + 'rules' => [
3403 + [
3404 + 'item' => 'modules.product_badges.badges_field.apply_for',
3405 + 'value' => 'product_cat',
3406 + 'operator' => '==',
3407 + ],
3408 + ],
3409 + ],
3410 + ],
3411 + 'exclude_product' => [
3412 + 'id' => 'exclude_product',
3413 + 'type' => 'search_and_multi_select',
3414 + 'isPro' => ! rtsb()->has_pro(),
3415 + 'label' => esc_html__( 'Exclude Products', 'shopbuilder' ),
3416 + 'help' => esc_html__( 'Choose products to exclude. Leave blank to exclude none.', 'shopbuilder' ),
3417 + 'placeholder' => esc_html__( 'Search Products', 'shopbuilder' ),
3418 + 'func_with_param' => [ Fns::class, 'get_post_types', [ 'post_type' => 'product' ] ],
3419 + 'options' => Fns::get_post_types( null, [ 'post_type' => 'product' ] ),
3420 + ],
3421 +
3422 + /**
3423 + * Style Settings
3424 + */
3425 + 'styles_settings' => [
3426 + 'id' => 'styles_settings',
3427 + 'type' => 'title',
3428 + 'label' => esc_html__( 'Style Settings', 'shopbuilder' ),
3429 + ],
3430 + 'badge_text_color' => [
3431 + 'id' => 'badge_text_color',
3432 + 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
3433 + 'type' => 'color',
3434 + 'dependency' => [
3435 + 'rules' => [
3436 + [
3437 + 'item' => 'modules.product_badges.badges_field.badges_type',
3438 + 'value' => 'text',
3439 + 'operator' => '==',
3440 + ],
3441 + ],
3442 + ],
3443 + ],
3444 + 'badge_bg_color' => [
3445 + 'id' => 'badge_bg_color',
3446 + 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
3447 + 'type' => 'color',
3448 + 'dependency' => [
3449 + 'rules' => [
3450 + [
3451 + 'item' => 'modules.product_badges.badges_field.badges_type',
3452 + 'value' => 'text',
3453 + 'operator' => '==',
3454 + ],
3455 + [
3456 + 'item' => 'modules.product_badges.badges_field.badges_type',
3457 + 'value' => 'text',
3458 + 'operator' => '==',
3459 + ],
3460 + [
3461 + 'item' => 'modules.product_badges.badges_field.badge_preset',
3462 + 'value' => [ 'preset1', 'preset2' ],
3463 + 'operator' => 'in',
3464 + ],
3465 + ],
3466 + ],
3467 + ],
3468 + 'badge_border_color' => [
3469 + 'id' => 'badge_border_color',
3470 + 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
3471 + 'type' => 'color',
3472 + 'dependency' => [
3473 + 'rules' => [
3474 + [
3475 + 'item' => 'modules.product_badges.badges_field.badges_type',
3476 + 'value' => 'text',
3477 + 'operator' => '==',
3478 + ],
3479 + [
3480 + 'item' => 'modules.product_badges.badges_field.badges_type',
3481 + 'value' => 'text',
3482 + 'operator' => '==',
3483 + ],
3484 + [
3485 + 'item' => 'modules.product_badges.badges_field.badge_preset',
3486 + 'value' => [ 'preset3', 'preset4' ],
3487 + 'operator' => 'in',
3488 + ],
3489 + ],
3490 + ],
3491 + ],
3492 + 'badge_font_size' => [
3493 + 'id' => 'badge_font_size',
3494 + 'type' => 'text',
3495 + 'label' => esc_html__( 'Font Size', 'shopbuilder' ),
3496 + 'help' => esc_html__( 'Example: 14px', 'shopbuilder' ),
3497 + 'dependency' => [
3498 + 'rules' => [
3499 + [
3500 + 'item' => 'modules.product_badges.badges_field.badges_type',
3501 + 'value' => 'text',
3502 + 'operator' => '==',
3503 + ],
3504 + ],
3505 + ],
3506 + ],
3507 + 'badge_font_width' => [
3508 + 'id' => 'badge_font_width',
3509 + 'type' => 'select',
3510 + 'value' => '400',
3511 + 'label' => esc_html__( 'Font Weight', 'shopbuilder' ),
3512 + 'options' => [
3513 + '100' => '100',
3514 + '200' => '200',
3515 + '300' => '300',
3516 + '400' => '400',
3517 + '500' => '500',
3518 + '600' => '600',
3519 + '700' => '700',
3520 + '800' => '800',
3521 + '900' => '900',
3522 + 'normal' => 'normal',
3523 + 'bold' => 'bold',
3524 + 'bolder' => 'bolder',
3525 + 'lighter' => 'lighter',
3526 + 'initial' => 'initial',
3527 + 'inherit' => 'inherit',
3528 + ],
3529 + 'dependency' => [
3530 + 'rules' => [
3531 + [
3532 + 'item' => 'modules.product_badges.badges_field.badges_type',
3533 + 'value' => 'text',
3534 + 'operator' => '==',
3535 + ],
3536 + ],
3537 + ],
3538 + ],
3539 + 'badge_width' => [
3540 + 'id' => 'badge_width',
3541 + 'type' => 'text',
3542 + 'label' => esc_html__( 'Width', 'shopbuilder' ),
3543 + 'help' => esc_html__( 'Example: 150px', 'shopbuilder' ),
3544 + 'dependency' => [
3545 + 'rules' => [
3546 + [
3547 + 'item' => 'modules.product_badges.badges_field.badges_type',
3548 + 'value' => 'image',
3549 + 'operator' => '==',
3550 + ],
3551 + ],
3552 + ],
3553 + ],
3554 + 'badge_height' => [
3555 + 'id' => 'badge_height',
3556 + 'type' => 'text',
3557 + 'label' => esc_html__( 'Height', 'shopbuilder' ),
3558 + 'help' => esc_html__( 'Example: 50px', 'shopbuilder' ),
3559 + 'dependency' => [
3560 + 'rules' => [
3561 + [
3562 + 'item' => 'modules.product_badges.badges_field.badges_type',
3563 + 'value' => 'image',
3564 + 'operator' => '==',
3565 + ],
3566 + ],
3567 + ],
3568 + ],
3569 + 'border_radius' => [
3570 + 'id' => 'border_radius',
3571 + 'type' => 'text',
3572 + 'size' => 'small',
3573 + 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
3574 + 'help' => esc_html__( 'Example: 20px 20px 20px 20px Or 20px', 'shopbuilder' ),
3575 + 'dependency' => [
3576 + 'rules' => [
3577 + [
3578 + 'item' => 'modules.product_badges.badges_field.badges_type',
3579 + 'value' => 'text',
3580 + 'operator' => '==',
3581 + ],
3582 + ],
3583 + ],
3584 + ],
3585 + 'badge_padding' => [
3586 + 'id' => 'badge_padding',
3587 + 'type' => 'text',
3588 + 'size' => 'small',
3589 + 'label' => esc_html__( 'Padding', 'shopbuilder' ),
3590 + 'help' => esc_html__( 'Example: 10px 15px 10px 15px', 'shopbuilder' ),
3591 + 'dependency' => [
3592 + 'rules' => [
3593 + [
3594 + 'item' => 'modules.product_badges.badges_field.badges_type',
3595 + 'value' => 'text',
3596 + 'operator' => '==',
3597 + ],
3598 + ],
3599 + ],
3600 + ],
3601 + ],
3602 + ],
3603 +
3604 + ]
3605 + );
3606 + }
3607 +
3608 + /**
3609 + * Dynamic badge list.
3610 + *
3611 + * @return array
3612 + */
3613 + public function dynamic_badge_list() {
3614 + $items = [
3615 + 'on_sale' => esc_html__( 'Products On Sale', 'shopbuilder' ),
3616 + 'featured' => esc_html__( 'Featured Products', 'shopbuilder' ),
3617 + 'out_of_stock' => esc_html__( 'Out Of Stock Products', 'shopbuilder' ),
3618 + 'best_selling' => esc_html__( 'Best Selling Products', 'shopbuilder' ),
3619 + 'new_arrival' => esc_html__( 'New Arrival Products', 'shopbuilder' ),
3620 + ];
3621 +
3622 + if ( rtsb()->has_pro() && method_exists( FnsPro::class, 'is_module_active' ) && FnsPro::is_module_active( 'pre_order' ) ) {
3623 + $items['pre_order'] = esc_html__( 'Pre-Order Products', 'shopbuilder' );
3624 + }
3625 +
3626 + return $items;
3627 + }
3628 + /**
3629 + * @return array
3630 + */
3631 + public function get_variation_swatches_fields() {
3632 + return apply_filters(
3633 + 'rtsb/module/variation_swatches/fields',
3634 + [
3635 + 'show_tooltip' => [
3636 + 'id' => 'show_tooltip',
3637 + 'value' => 'on',
3638 + 'type' => 'switch',
3639 + 'label' => esc_html__( 'Enable Tooltip', 'shopbuilder' ),
3640 + 'help' => esc_html__( 'Enable / Disable plugin default tooltip on each product attribute.', 'shopbuilder' ),
3641 + 'tab' => 'general',
3642 + ],
3643 + 'shape_style' => [
3644 + 'id' => 'shape_style',
3645 + 'label' => esc_html__( 'Default Shape Style', 'shopbuilder' ),
3646 + 'help' => esc_html__( 'Attribute Shape Style. Note: This option will not be applied to radio and button attributes.', 'shopbuilder' ),
3647 + 'type' => 'image_select',
3648 + 'value' => 'rounded',
3649 + 'options' => [
3650 + 'rounded' => [
3651 + 'label' => esc_html__( 'Rounded Shape', 'shopbuilder' ),
3652 + 'url' => esc_url( rtsb()->get_assets_uri( 'images/variation-swatch/rounded-shape.svg' ) ),
3653 + ],
3654 + 'squared' => [
3655 + 'label' => esc_html__( 'Squared Shape', 'shopbuilder' ),
3656 + 'url' => esc_url( rtsb()->get_assets_uri( 'images/variation-swatch/squared-shape.svg' ) ),
3657 + ],
3658 + ],
3659 + 'tab' => 'general',
3660 + ],
3661 + 'shape_style_checkmark' => [
3662 + 'id' => 'shape_style_checkmark',
3663 + 'type' => 'switch',
3664 + 'isPro' => ! rtsb()->has_pro(),
3665 + 'default' => false,
3666 + 'label' => esc_html__( 'Checkmark Selected Term ', 'shopbuilder' ),
3667 + 'help' => esc_html__( 'Shape style will add checkmark icon. Note: This option will not be applied to radio attributes.', 'shopbuilder' ),
3668 + 'tab' => 'general',
3669 + ],
3670 + 'default_dropdown_convert' => [
3671 + 'id' => 'default_dropdown_convert',
3672 + 'label' => esc_html__( 'Default Dropdown Convert', 'shopbuilder' ),
3673 + 'help' => esc_html__( 'Dropdown Convert To Button Or Image', 'shopbuilder' ),
3674 + /**
3675 + * 'isPro' => ! rtsb()->has_pro(),
3676 + */
3677 + 'type' => 'select',
3678 + 'value' => '',
3679 + 'options' => [
3680 + 'select' => esc_html__( 'Select ( Default )', 'shopbuilder' ),
3681 + 'button' => esc_html__( 'Button', 'shopbuilder' ),
3682 + 'image' => esc_html__( 'Image', 'shopbuilder' ),
3683 + ],
3684 + 'tab' => 'general',
3685 + ],
3686 + 'show_term_name_beside_label' => [
3687 + 'id' => 'show_term_name_beside_label',
3688 + 'type' => 'switch',
3689 + 'isPro' => ! rtsb()->has_pro(),
3690 + 'default' => false,
3691 + 'label' => esc_html__( 'Show Term Name', 'shopbuilder' ),
3692 + 'help' => esc_html__( 'Selected term name will show beside attribute label.', 'shopbuilder' ),
3693 + 'tab' => 'general',
3694 + ],
3695 + 'disabled_attribute_behavior' => [
3696 + 'id' => 'disabled_attribute_behavior',
3697 + 'label' => esc_html__( 'Disabled Attribute behavior', 'shopbuilder' ),
3698 + 'help' => esc_html__( 'Disabled attribute will be hide / blur.', 'shopbuilder' ) . ' <span>' . __( ' Note: This feature will be operational for variation quantities below the "Ajax variation threshold.', 'shopbuilder' ) . '</span>',
3699 + 'type' => 'select',
3700 + 'value' => 'blur',
3701 + 'options' => [
3702 + 'blur-cross' => esc_html__( 'Blur And Cross', 'shopbuilder' ),
3703 + 'blur-no-cross' => esc_html__( 'Only Blur', 'shopbuilder' ),
3704 + 'hide' => esc_html__( 'Hide', 'shopbuilder' ),
3705 + ],
3706 + 'tab' => 'general',
3707 + ],
3708 + 'attr_display_limit' => [
3709 + 'id' => 'attr_display_limit',
3710 + 'type' => 'number',
3711 + 'isPro' => ! rtsb()->has_pro(),
3712 + 'value' => 0,
3713 + 'size' => 'small',
3714 + 'min' => 0,
3715 + 'max' => 999,
3716 + 'label' => esc_html__( 'Product Page Attribute display limit', 'shopbuilder' ),
3717 + 'help' => esc_html__( 'Catalog mode attribute display limit. Default is 0. Means no limit.', 'shopbuilder' ),
3718 + 'tab' => 'general',
3719 + ],
3720 + 'attribute_image_size' => [
3721 + 'id' => 'attribute_image_size',
3722 + 'label' => esc_html__( 'Attribute image size', 'shopbuilder' ),
3723 + 'help' => __( 'Choose attribute image size.', 'shopbuilder' ) . '<a target="_blank" href="' . esc_url( admin_url( 'options-media.php' ) ) . '"> ' . __( 'Media Settings', 'shopbuilder' ) . '</a>',
3724 + 'type' => 'select',
3725 + 'value' => 'thumbnail',
3726 + 'options' => Fns::get_image_sizes(),
3727 + 'tab' => 'general',
3728 + ],
3729 +
3730 + 'tooltip_title' => [
3731 + 'id' => 'tooltip_title',
3732 + 'type' => 'title',
3733 + 'label' => esc_html__( 'Tooltip Options', 'shopbuilder' ),
3734 + 'help' => esc_html__( 'Tooltip settings for single page and catalog mode on shop / archive pages', 'shopbuilder' ),
3735 + 'tab' => 'general',
3736 + 'dependency' => [
3737 + 'rules' => [
3738 + [
3739 + 'item' => 'modules.variation_swatches.show_tooltip',
3740 + 'value' => 'on',
3741 + 'operator' => '==',
3742 + ],
3743 + ],
3744 + ],
3745 + ],
3746 + 'tooltip_image_size' => [
3747 + 'id' => 'tooltip_image_size',
3748 + 'label' => esc_html__( 'Tooltip image size', 'shopbuilder' ),
3749 + 'help' => __( 'Choose Tooltip image size.', 'shopbuilder' ) . '<a target="_blank" href="' . esc_url( admin_url( 'options-media.php' ) ) . '"> ' . __( 'Media Settings', 'shopbuilder' ) . '</a>',
3750 + 'type' => 'select',
3751 + 'isPro' => ! rtsb()->has_pro(),
3752 + 'value' => 'thumbnail',
3753 + 'options' => Fns::get_image_sizes(),
3754 + 'tab' => 'general',
3755 + 'dependency' => [
3756 + 'rules' => [
3757 + [
3758 + 'item' => 'modules.variation_swatches.show_tooltip',
3759 + 'value' => 'on',
3760 + 'operator' => '==',
3761 + ],
3762 + ],
3763 + ],
3764 + ],
3765 + 'advanced_title' => [
3766 + 'id' => 'advanced_title',
3767 + 'type' => 'title',
3768 + 'label' => esc_html__( 'Advanced', 'shopbuilder' ),
3769 + 'tab' => 'general',
3770 + ],
3771 + 'disable_out_of_stock' => [
3772 + 'id' => 'disable_out_of_stock',
3773 + 'type' => 'switch',
3774 + 'default' => true,
3775 + 'label' => esc_html__( 'Disable Out of Stock', 'shopbuilder' ),
3776 + 'help' => __( 'Disable out of stock variation attribute items.', 'shopbuilder' ),
3777 + 'tab' => 'general',
3778 + ],
3779 +
3780 + 'enable_variation_url' => [
3781 + 'id' => 'enable_variation_url',
3782 + 'type' => 'switch',
3783 + 'default' => false,
3784 + 'isPro' => ! rtsb()->has_pro(),
3785 + 'label' => esc_html__( 'Variation URL', 'shopbuilder' ),
3786 + 'help' => esc_html__( 'Generate a URL based on the selected variation attributes.', 'shopbuilder' ),
3787 + 'tab' => 'general',
3788 + ],
3789 + 'enable_showcase_swatches' => [
3790 + 'id' => 'enable_showcase_swatches',
3791 + 'type' => 'switch',
3792 + 'default' => false,
3793 + 'isPro' => ! rtsb()->has_pro(),
3794 + 'label' => esc_html__( 'Enable Swatches', 'shopbuilder' ),
3795 + 'help' => esc_html__( 'Show swatches on archive / shop page.', 'shopbuilder' ),
3796 + 'tab' => 'showcase_shop',
3797 + ],
3798 + 'showcase_product_wrapper_selector' => [
3799 + 'id' => 'showcase_product_wrapper_selector',
3800 + 'type' => 'text',
3801 + 'isPro' => ! rtsb()->has_pro(),
3802 + 'label' => esc_html__( 'Product Wrapper Selector', 'shopbuilder' ),
3803 + 'help' => esc_html__( 'Archive product Wrapper Selector (.rtwpvs-product,.tmb-woocommerce)', 'shopbuilder' ),
3804 + 'value' => '.rtsb-vs-product,.product-item',
3805 + 'dependency' => [
3806 + 'rules' => [
3807 + [
3808 + 'item' => 'modules.variation_swatches.enable_showcase_swatches',
3809 + 'value' => 'on',
3810 + 'operator' => '==',
3811 + ],
3812 + ],
3813 + ],
3814 + 'tab' => 'showcase_shop',
3815 + ],
3816 + 'showcase_swatches_image_selector' => [
3817 + 'id' => 'showcase_swatches_image_selector',
3818 + 'type' => 'text',
3819 + 'isPro' => ! rtsb()->has_pro(),
3820 + 'label' => esc_html__( 'Image Selector', 'shopbuilder' ),
3821 + 'help' => esc_html__( 'Archive product image selector to show variation image. You can also use multiple selectors separated by comma (.attachment-woocommerce_thumbnail, .wp-post-image) ', 'shopbuilder' ),
3822 + 'value' => '.wp-post-image, .attachment-woocommerce_thumbnail',
3823 + 'dependency' => [
3824 + 'rules' => [
3825 + [
3826 + 'item' => 'modules.variation_swatches.enable_showcase_swatches',
3827 + 'value' => 'on',
3828 + 'operator' => '==',
3829 + ],
3830 + ],
3831 + ],
3832 + 'tab' => 'showcase_shop',
3833 + ],
3834 + 'showcase_swatches_position' => [
3835 + 'id' => 'showcase_swatches_position',
3836 + 'label' => esc_html__( 'Swatches Position', 'shopbuilder' ),
3837 + 'help' => esc_html__( 'Display showcase swatches in a specific position.', 'shopbuilder' ) . '<br/>' . __( 'Note: Some themes remove or override default WooCommerce hooks. If the swatches do not appear as expected, you may need to manually set a custom position.', 'shopbuilder' ),
3838 + 'isPro' => ! rtsb()->has_pro(),
3839 + 'type' => 'select',
3840 + 'value' => 'after_title_and_price',
3841 + 'options' => apply_filters(
3842 + 'rtsb_showcase_swatches_positions',
3843 + [
3844 + 'custom_hook' => esc_html__( 'Custom Hook', 'shopbuilder' ),
3845 + 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
3846 + 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
3847 + ]
3848 + ),
3849 + 'dependency' => [
3850 + 'rules' => [
3851 + [
3852 + 'item' => 'modules.variation_swatches.enable_showcase_swatches',
3853 + 'value' => 'on',
3854 + 'operator' => '==',
3855 + ],
3856 + ],
3857 + ],
3858 + 'tab' => 'showcase_shop',
3859 + ],
3860 + 'custom_hook_name' => [
3861 + 'type' => 'description',
3862 + 'text' => sprintf(
3863 + /* translators: 1: The shortcode.*/
3864 + esc_html__( 'Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
3865 + "<code style='padding: 5px' >&lt;?php do_action( 'rtsb/vs/showcase/variation' ); ?&gt;</code>"
3866 + ),
3867 + 'id' => 'custom_hook_name',
3868 + 'tab' => 'showcase_shop',
3869 + 'dependency' => [
3870 + 'rules' => [
3871 + [
3872 + 'item' => 'modules.variation_swatches.enable_showcase_swatches',
3873 + 'value' => 'on',
3874 + 'operator' => '==',
3875 + ],
3876 + [
3877 + 'item' => 'modules.variation_swatches.showcase_swatches_position',
3878 + 'value' => 'custom_hook',
3879 + 'operator' => '==',
3880 + ],
3881 + ],
3882 + ],
3883 + ],
3884 + 'showcase_swatches_align' => [
3885 + 'id' => 'showcase_swatches_align',
3886 + 'label' => esc_html__( 'Swatches Align', 'shopbuilder' ),
3887 + 'help' => esc_html__( 'Swatches align on archive page.', 'shopbuilder' ),
3888 + 'isPro' => ! rtsb()->has_pro(),
3889 + 'type' => 'select',
3890 + 'value' => 'left',
3891 + 'options' => apply_filters(
3892 + 'rtsb_get_showcase_swatches_aligns',
3893 + [
3894 + 'left' => esc_html__( 'Left', 'shopbuilder' ),
3895 + 'right' => esc_html__( 'Right', 'shopbuilder' ),
3896 + 'center' => esc_html__( 'Center', 'shopbuilder' ),
3897 + ]
3898 + ),
3899 + 'dependency' => [
3900 + 'rules' => [
3901 + [
3902 + 'item' => 'modules.variation_swatches.enable_showcase_swatches',
3903 + 'value' => 'on',
3904 + 'operator' => '==',
3905 + ],
3906 + ],
3907 + ],
3908 + 'tab' => 'showcase_shop',
3909 + ],
3910 +
3911 + 'show_clear_on_showcase' => [
3912 + 'id' => 'show_clear_on_showcase',
3913 + 'isPro' => ! rtsb()->has_pro(),
3914 + 'type' => 'switch',
3915 + 'label' => esc_html__( 'Show clear link', 'shopbuilder' ),
3916 + 'help' => esc_html__( 'Show clear link on archive, shop page, any other showcase.', 'shopbuilder' ),
3917 + 'dependency' => [
3918 + 'rules' => [
3919 + [
3920 + 'item' => 'modules.variation_swatches.enable_showcase_swatches',
3921 + 'value' => 'on',
3922 + 'operator' => '==',
3923 + ],
3924 + ],
3925 + ],
3926 + 'tab' => 'showcase_shop',
3927 + ],
3928 + 'showcase_special_attribute_title' => [
3929 + 'id' => 'showcase_special_attribute_title',
3930 + 'type' => 'title',
3931 + 'label' => esc_html__( 'Special Attribute', 'shopbuilder' ),
3932 + 'tab' => 'showcase_shop',
3933 + ],
3934 + 'showcase_single_attribute' => [
3935 + 'id' => 'showcase_single_attribute',
3936 + 'isPro' => ! rtsb()->has_pro(),
3937 + 'type' => 'switch',
3938 + 'label' => esc_html__( 'Show Single Attribute', 'shopbuilder' ),
3939 + 'help' => esc_html__( 'Show single attribute taxonomies on archive page.', 'shopbuilder' ),
3940 + 'tab' => 'showcase_shop',
3941 + ],
3942 + 'chose_showcase_single_attribute' => [
3943 + 'id' => 'chose_showcase_single_attribute',
3944 + 'label' => esc_html__( 'Chose Attribute', 'shopbuilder' ),
3945 + 'help' => esc_html__( 'Choose an attribute to show on catalog mode', 'shopbuilder' ),
3946 + 'isPro' => ! rtsb()->has_pro(),
3947 + 'type' => 'select',
3948 + 'options' => SwatchesFns::get_wc_attributes( esc_html__( ' - Choose Attribute - ', 'shopbuilder' ) ),
3949 + 'dependency' => [
3950 + 'rules' => [
3951 + [
3952 + 'item' => 'modules.variation_swatches.showcase_single_attribute',
3953 + 'value' => 'on',
3954 + 'operator' => '==',
3955 + ],
3956 + ],
3957 + ],
3958 + 'tab' => 'showcase_shop',
3959 + ],
3960 +
3961 + 'showcase_swatches_display_event' => [
3962 + 'id' => 'showcase_swatches_display_event',
3963 + 'label' => esc_html__( 'Catalog Mode Display Event', 'shopbuilder' ),
3964 + 'help' => esc_html__( 'Show catalog mode image display event.', 'shopbuilder' ),
3965 + 'isPro' => ! rtsb()->has_pro(),
3966 + 'type' => 'select',
3967 + 'value' => 'click',
3968 + 'options' => [
3969 + 'click' => esc_html__( 'on Click', 'shopbuilder' ),
3970 + 'hover' => esc_html__( 'on Hover', 'shopbuilder' ),
3971 + ],
3972 + 'dependency' => [
3973 + 'rules' => [
3974 + [
3975 + 'item' => 'modules.variation_swatches.enable_showcase_swatches',
3976 + 'value' => 'on',
3977 + 'operator' => '==',
3978 + ],
3979 + ],
3980 + ],
3981 + 'tab' => 'showcase_shop',
3982 + ],
3983 +
3984 + 'showcase_swatches_display_limit' => [
3985 + 'id' => 'showcase_swatches_display_limit',
3986 + 'type' => 'number',
3987 + 'isPro' => ! rtsb()->has_pro(),
3988 + 'value' => 0,
3989 + 'size' => 'small',
3990 + 'min' => 0,
3991 + 'max' => 999,
3992 + 'label' => esc_html__( 'Attribute display limit', 'shopbuilder' ),
3993 + 'help' => esc_html__( 'Catalog mode attribute display limit. Default is 0. Means no limit.', 'shopbuilder' ),
3994 + 'dependency' => [
3995 + 'rules' => [
3996 + [
3997 + 'item' => 'modules.variation_swatches.enable_showcase_swatches',
3998 + 'value' => 'on',
3999 + 'operator' => '==',
4000 + ],
4001 + ],
4002 + ],
4003 + 'tab' => 'showcase_shop',
4004 + ],
4005 + 'checkmark_size' => [
4006 + 'id' => 'checkmark_size',
4007 + 'type' => 'title',
4008 + 'label' => esc_html__( 'Checkmark', 'shopbuilder' ),
4009 + 'tab' => 'style',
4010 + ],
4011 + 'checkmark_bg_color' => [
4012 + 'id' => 'checkmark_bg_color',
4013 + 'label' => esc_html__( 'Checkmark Background Color', 'shopbuilder' ),
4014 + 'isPro' => ! rtsb()->has_pro(),
4015 + 'type' => 'color',
4016 + 'value' => '#333333',
4017 + 'tab' => 'style',
4018 + ],
4019 + 'checkmark_icon_color' => [
4020 + 'id' => 'checkmark_icon_color',
4021 + 'label' => esc_html__( 'Checkmark Icon Color', 'shopbuilder' ),
4022 + 'isPro' => ! rtsb()->has_pro(),
4023 + 'type' => 'color',
4024 + 'value' => '#ffffff',
4025 + 'tab' => 'style',
4026 + ],
4027 + 'attribute_checkmark_width' => [
4028 + 'id' => 'attribute_checkmark_width',
4029 + 'label' => esc_html__( 'Checkmark Width', 'shopbuilder' ),
4030 + 'isPro' => ! rtsb()->has_pro(),
4031 + 'help' => esc_html__( 'Set the width (in px) for selected attribute checkmark,', 'shopbuilder' ),
4032 + 'type' => 'slider',
4033 + 'min' => 10,
4034 + 'max' => 200,
4035 + 'unit' => 'px',
4036 + 'value' => 15,
4037 + 'tab' => 'style',
4038 + ],
4039 + 'attribute_checkmark_height' => [
4040 + 'id' => 'attribute_checkmark_height',
4041 + 'label' => esc_html__( 'Checkmark Height', 'shopbuilder' ),
4042 + 'isPro' => ! rtsb()->has_pro(),
4043 + 'help' => esc_html__( 'Set the height (in px) for selected attribute checkmark,', 'shopbuilder' ),
4044 + 'type' => 'slider',
4045 + 'min' => 10,
4046 + 'max' => 200,
4047 + 'unit' => 'px',
4048 + 'value' => 15,
4049 + 'tab' => 'style',
4050 + ],
4051 + 'attribute_checkmark_icon_size' => [
4052 + 'id' => 'attribute_checkmark_icon_size',
4053 + 'isPro' => ! rtsb()->has_pro(),
4054 + 'label' => esc_html__( 'Checkmark Icon Size', 'shopbuilder' ),
4055 + 'help' => esc_html__( 'Checkmark Icon Size.', 'shopbuilder' ),
4056 + 'type' => 'slider',
4057 + 'min' => 8,
4058 + 'max' => 30,
4059 + 'unit' => 'px',
4060 + 'value' => 11,
4061 + 'tab' => 'style',
4062 + ],
4063 + 'attribute_style' => [
4064 + 'id' => 'attribute_style',
4065 + 'type' => 'title',
4066 + 'label' => esc_html__( 'Attribute Style', 'shopbuilder' ),
4067 + 'tab' => 'style',
4068 + ],
4069 + 'attribute_border_color' => [
4070 + 'id' => 'attribute_border_color',
4071 + 'label' => esc_html__( 'Attribute Border Color', 'shopbuilder' ),
4072 + 'type' => 'color',
4073 + 'value' => '#333333',
4074 + 'tab' => 'style',
4075 + ],
4076 + 'attribute_border_color_hover' => [
4077 + 'id' => 'attribute_border_color_hover',
4078 + 'label' => esc_html__( 'Attribute Border Color Hover/Active', 'shopbuilder' ),
4079 + 'type' => 'color',
4080 + 'value' => '#333333',
4081 + 'tab' => 'style',
4082 + ],
4083 + 'details_page_attribute_size' => [
4084 + 'id' => 'details_page_attribute_size',
4085 + 'type' => 'title',
4086 + 'label' => esc_html__( 'Details Page Attributes Size', 'shopbuilder' ),
4087 + 'tab' => 'style',
4088 + ],
4089 + 'details_page_attribute_width' => [
4090 + 'id' => 'details_page_attribute_width',
4091 + 'label' => esc_html__( 'Variation Item Width', 'shopbuilder' ),
4092 + 'help' => esc_html__( 'Set the width (in px) for each variation attribute option, Note: This option will not be applied to radio and button attributes.', 'shopbuilder' ),
4093 + 'type' => 'slider',
4094 + 'min' => 10,
4095 + 'max' => 150,
4096 + 'unit' => 'px',
4097 + 'value' => 30,
4098 + 'tab' => 'style',
4099 + ],
4100 + 'details_page_attribute_height' => [
4101 + 'id' => 'details_page_attribute_height',
4102 + 'label' => esc_html__( 'Variation Item Height', 'shopbuilder' ),
4103 + 'help' => esc_html__( 'Set the height (in px) for each variation attribute option, Note: This option will not be applied to radio attributes.', 'shopbuilder' ),
4104 + 'type' => 'slider',
4105 + 'min' => 10,
4106 + 'max' => 150,
4107 + 'unit' => 'px',
4108 + 'value' => 30,
4109 + 'tab' => 'style',
4110 + ],
4111 + 'details_page_attribute_font_size' => [
4112 + 'id' => 'details_page_attribute_font_size',
4113 + 'label' => esc_html__( 'Variation Item Font Size', 'shopbuilder' ),
4114 + 'help' => esc_html__( 'Set the font size (in px) for text within variation attribute options, such as labels on buttons.', 'shopbuilder' ),
4115 + 'type' => 'slider',
4116 + 'min' => 8,
4117 + 'max' => 30,
4118 + 'unit' => 'px',
4119 + 'value' => 16,
4120 + 'tab' => 'style',
4121 + ],
4122 + 'showcase_attribute_size' => [
4123 + 'id' => 'showcase_attribute_size',
4124 + 'type' => 'title',
4125 + 'label' => esc_html__( 'Product Showcase Attributes Size', 'shopbuilder' ),
4126 + 'tab' => 'style',
4127 + ],
4128 + 'showcase_attribute_width' => [
4129 + 'id' => 'showcase_attribute_width',
4130 + 'label' => esc_html__( 'Variation Item Width', 'shopbuilder' ),
4131 + 'help' => esc_html__( 'Set the width (in px) for each variation attribute option, Note: This option will not be applied to radio and button attributes.', 'shopbuilder' ),
4132 + 'type' => 'slider',
4133 + 'min' => 10,
4134 + 'max' => 200,
4135 + 'unit' => 'px',
4136 + 'value' => 30,
4137 + 'tab' => 'style',
4138 + ],
4139 + 'showcase_attribute_height' => [
4140 + 'id' => 'showcase_attribute_height',
4141 + 'label' => esc_html__( 'Variation Item Height', 'shopbuilder' ),
4142 + 'help' => esc_html__( 'Set the height (in px) for each variation attribute option, Note: This option will not be applied to radio and button attributes.', 'shopbuilder' ),
4143 + 'type' => 'slider',
4144 + 'min' => 10,
4145 + 'max' => 200,
4146 + 'unit' => 'px',
4147 + 'value' => 30,
4148 + 'tab' => 'style',
4149 + ],
4150 + 'showcase_attribute_font_size' => [
4151 + 'id' => 'showcase_attribute_font_size',
4152 + 'label' => esc_html__( 'Variation Item Font Size', 'shopbuilder' ),
4153 + 'help' => esc_html__( 'Set the font size (in px) for text within variation attribute options, such as labels on buttons.', 'shopbuilder' ),
4154 + 'type' => 'slider',
4155 + 'min' => 8,
4156 + 'max' => 30,
4157 + 'unit' => 'px',
4158 + 'value' => 16,
4159 + 'tab' => 'style',
4160 + ],
4161 + 'tooltip_style' => [
4162 + 'id' => 'tooltip_style',
4163 + 'type' => 'title',
4164 + 'label' => esc_html__( 'Tooltip Style', 'shopbuilder' ),
4165 + 'tab' => 'style',
4166 + ],
4167 + 'tooltip_images_padding' => [
4168 + 'id' => 'tooltip_images_padding',
4169 + 'label' => esc_html__( 'Tooltip Images Padding', 'shopbuilder' ),
4170 + 'type' => 'slider',
4171 + 'min' => 0,
4172 + 'max' => 30,
4173 + 'unit' => 'px',
4174 + 'value' => 3,
4175 + 'tab' => 'style',
4176 + ],
4177 + 'tooltip_bg_color' => [
4178 + 'id' => 'tooltip_bg_color',
4179 + 'label' => esc_html__( 'Tooltip Background Color', 'shopbuilder' ),
4180 + 'type' => 'color',
4181 + 'value' => '#333333',
4182 + 'tab' => 'style',
4183 + ],
4184 + 'tooltip_text_color' => [
4185 + 'id' => 'tooltip_text_color',
4186 + 'label' => esc_html__( 'Tooltip Text Color', 'shopbuilder' ),
4187 + 'type' => 'color',
4188 + 'value' => '#ffffff',
4189 + 'tab' => 'style',
4190 + ],
4191 + ]
4192 + ); // @phpstan-ignore-line
4193 + }
4194 + /**
4195 + * @return array
4196 + */
4197 + public function get_variation_gallery_fields() {
4198 + return apply_filters(
4199 + 'rtsb/module/variation_gallery/fields',
4200 + [
4201 + 'thumbnails_columns' => [
4202 + 'id' => 'thumbnails_columns',
4203 + 'type' => 'slider',
4204 + 'label' => esc_html__( 'Thumbnails Items per row / slider view', 'shopbuilder' ),
4205 + 'help' => esc_html__( 'Product Thumbnails Item Image. Default value is: 4. Limit: 2-8. The field required for slider.', 'shopbuilder' ),
4206 + 'min' => 2,
4207 + 'max' => 8,
4208 + 'unit' => '',
4209 + 'value' => 4,
4210 + 'tab' => 'general',
4211 + ],
4212 + 'thumbnails_columns_sm' => [
4213 + 'id' => 'thumbnails_columns_sm',
4214 + 'type' => 'slider',
4215 + 'label' => esc_html__( 'Thumbnails Items per row / slider view (Medium Device)', 'shopbuilder' ),
4216 + 'help' => esc_html__( 'Product Thumbnails Item Image. Default value is: 4. Limit: 2-8. The field required for slider.', 'shopbuilder' ),
4217 + 'min' => 2,
4218 + 'max' => 8,
4219 + 'unit' => '',
4220 + 'value' => 4,
4221 + 'tab' => 'general',
4222 + ],
4223 + 'thumbnails_columns_xs' => [
4224 + 'id' => 'thumbnails_columns_xs',
4225 + 'type' => 'slider',
4226 + 'label' => esc_html__( 'Product Thumbnails Item Image For (Small Device)', 'shopbuilder' ),
4227 + 'help' => esc_html__( 'Product Thumbnails Item Image. Default value is: 3. Limit: 2-8. The field required for slider.', 'shopbuilder' ),
4228 + 'min' => 2,
4229 + 'max' => 8,
4230 + 'unit' => '',
4231 + 'value' => 3,
4232 + 'tab' => 'general',
4233 + ],
4234 + 'thumbnails_gap' => [
4235 + 'id' => 'thumbnails_gap',
4236 + 'type' => 'slider',
4237 + 'label' => esc_html__( 'Thumbnails Gap', 'shopbuilder' ),
4238 + 'help' => esc_html__( 'Product Thumbnails Gap In Pixel. Default value is: 0. Limit: 0-50.', 'shopbuilder' ),
4239 + 'min' => 0,
4240 + 'max' => 50,
4241 + 'unit' => 'px',
4242 + 'value' => 0,
4243 + 'tab' => 'general',
4244 + ],
4245 + ]
4246 + );
929 4247 }
930 4248 }