PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.4.2
ShopBuilder – WooCommerce Builder For Elementor v2.4.2
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 +1241 -76 2.1.42.4.2 View file →
@@ -1,25 +1,45 @@
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\Traits\SingletonTrait;
7 16 use RadiusTheme\SB\Modules\Compare\Compare;
17 +use RadiusTheme\SB\Modules\WishList\Wishlist;
8 18 use RadiusTheme\SB\Modules\Compare\CompareFns;
9 19 use RadiusTheme\SB\Modules\QuickView\QuickView;
10 -use RadiusTheme\SB\Modules\WishList\Wishlist;
11 20 use RadiusTheme\SB\Modules\WishList\WishlistFns;
12 -use RadiusTheme\SB\Traits\SingletonTrait;
21 +use RadiusTheme\SBPRO\Helpers\FnsPro;
13 22
14 23 defined( 'ABSPATH' ) || exit;
15 24
25 +/**
26 + * ShopBuilder Module List.
27 + */
16 28 class ModuleList extends ListModel {
17 29
18 30 use SingletonTrait;
19 31
32 + /**
33 + * List ID.
34 + *
35 + * @var string
36 + */
20 37 protected $list_id = 'modules';
21 38
39 + /**
40 + * Class constructor.
41 + */
22 42 public function __construct() {
23 43 parent::__construct();
24 44 $this->title = esc_html__( 'Modules', 'shopbuilder' );
25 45 $this->description = esc_html__( 'Here you can find the list of all the modules. You can individually enable or disable the modules. Or you can do that by one click.', 'shopbuilder' );
@@ -24,11 +44,16 @@
24 44 $this->title = esc_html__( 'Modules', 'shopbuilder' );
25 45 $this->description = esc_html__( 'Here you can find the list of all the modules. You can individually enable or disable the modules. Or you can do that by one click.', 'shopbuilder' );
26 46 }
27 47
48 + /**
49 + * Module list.
50 + *
51 + * @return mixed|null
52 + */
28 53 protected function raw_list() {
29 54 $list = [
30 - 'quick_view' => apply_filters(
55 + 'quick_view' => apply_filters(
31 56 'rtsb/module/quick_view/options',
32 57 [
33 58 'id' => 'quick_view',
34 59 'title' => esc_html__( 'Quick View', 'shopbuilder' ),
@@ -39,8 +64,16 @@
39 64 'active_field' => [
40 65 'label' => esc_html__( 'Enable Quick View?', 'shopbuilder' ),
41 66 'help' => esc_html__( 'Switch on to enable quick view module.', 'shopbuilder' ),
42 67 ],
68 + 'tabs' => [
69 + 'general' => [
70 + 'title' => esc_html__( 'General', 'shopbuilder' ),
71 + ],
72 + 'style' => [
73 + 'title' => esc_html__( 'Style', 'shopbuilder' ),
74 + ],
75 + ],
43 76 'fields' => apply_filters(
44 77 'rtsb/module/quick_view/fields',
45 78 [
46 79 'loop_btn_position' => [
@@ -48,8 +81,9 @@
48 81 'type' => 'select',
49 82 'value' => 'custom',
50 83 'label' => esc_html__( 'Shop Page Button Position', 'shopbuilder' ),
51 84 'help' => esc_html__( 'You can manage quick view button position in shop page.', 'shopbuilder' ),
85 + 'tab' => 'general',
52 86 'options' => [
53 87 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
54 88 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
55 89 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
@@ -54,8 +88,9 @@
54 88 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
55 89 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
56 90 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
57 91 ],
92 +
58 93 ],
59 94 'loop_btn_position_shortcode' => [
60 95 'type' => 'raw',
61 96 'label' => ' ',
@@ -63,8 +98,9 @@
63 98 /* translators: 1: The shortcode.*/
64 99 esc_html__( 'Choose where to show button in WooCommerce product\'s loop. Copy this shortcode %1$s and paste it where you want to show the button.', 'shopbuilder' ),
65 100 '<code>[rtsb_quick_view_button]</code>'
66 101 ),
102 + 'tab' => 'general',
67 103 'dependency' => [
68 104 'rules' => [
69 105 [
70 106 'item' => 'modules.quick_view.loop_btn_position',
@@ -80,10 +116,11 @@
80 116 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
81 117 'help' => sprintf(
82 118 /* translators: 1: The shortcode.*/
83 119 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
84 - "<code>&lt;?php do_action( 'rtsb/modules/quick_view/frontend/display' ); ?&gt;</code>"
120 + "<br /><code>&lt;?php do_action( 'rtsb/modules/quick_view/frontend/display' ); ?&gt;</code><br />"
85 121 ),
122 + 'tab' => 'general',
86 123 'dependency' => [
87 124 'rules' => [
88 125 [
89 126 'item' => 'modules.quick_view.loop_btn_position',
@@ -100,8 +137,9 @@
100 137 'size' => 'small',
101 138 'min' => 0,
102 139 'max' => 999,
103 140 'label' => esc_html__( 'Hook Priority', 'shopbuilder' ),
141 + 'tab' => 'general',
104 142 'dependency' => [
105 143 'rules' => [
106 144 [
107 145 'item' => 'modules.quick_view.loop_btn_position',
@@ -117,14 +155,69 @@
117 155 'help' => esc_html__( 'Enter your quick view button text.', 'shopbuilder' ),
118 156 'type' => 'text',
119 157 'value' => 'Quick View',
120 158 'placeholder' => 'Quick View',
159 + 'tab' => 'general',
121 160 ],
161 +
162 + // Module Style.
163 + 'modal_width' => [
164 + 'id' => 'modal_width',
165 + 'label' => esc_html__( 'Modal Width (in px)', 'shopbuilder' ),
166 + 'help' => esc_html__( 'Quick view button modal width. Example: 950', 'shopbuilder' ),
167 + 'type' => 'number',
168 + 'value' => '',
169 + 'tab' => 'style',
170 + ],
171 +
172 + 'modal_height' => [
173 + 'id' => 'modal_height',
174 + 'label' => esc_html__( 'Modal Height', 'shopbuilder' ),
175 + 'help' => esc_html__( 'Quick view button modal height. Example: 450px', 'shopbuilder' ),
176 + 'type' => 'text',
177 + 'value' => '',
178 + 'tab' => 'style',
179 + ],
180 +
181 + 'modal_wrapper_padding' => [
182 + 'id' => 'modal_wrapper_padding',
183 + 'label' => esc_html__( 'Modal Wrapper Padding', 'shopbuilder' ),
184 + 'help' => esc_html__( 'Quick view modal wrapper padding. Example 1: 20px, Example 2: 20px 20px 20px 20px', 'shopbuilder' ),
185 + 'type' => 'text',
186 + 'value' => '',
187 + 'tab' => 'style',
188 + ],
189 + 'modal_bg_color' => [
190 + 'id' => 'modal_bg_color',
191 + 'label' => esc_html__( 'Modal Backgroud Color', 'shopbuilder' ),
192 + 'help' => esc_html__( 'Quick view modal background color. Example: #fff', 'shopbuilder' ),
193 + 'type' => 'color',
194 + 'value' => '',
195 + 'tab' => 'style',
196 + ],
197 + 'modal_box_shadow_color' => [
198 + 'id' => 'modal_box_shadow_color',
199 + 'label' => esc_html__( 'Modal Box Shadow Color', 'shopbuilder' ),
200 + 'help' => esc_html__( 'Quick view modal box shadow. Example: #000', 'shopbuilder' ),
201 + 'type' => 'color',
202 + 'value' => '',
203 + 'tab' => 'style',
204 + ],
205 +
206 + 'modal_overly_color' => [
207 + 'id' => 'modal_overly_color',
208 + 'label' => esc_html__( 'Modal Overly Color', 'shopbuilder' ),
209 + 'help' => esc_html__( 'Quick view modal overly. Example: #000', 'shopbuilder' ),
210 + 'type' => 'color',
211 + 'value' => '',
212 + 'tab' => 'style',
213 + ],
214 +
122 215 ]
123 216 ),
124 217 ]
125 218 ),
126 - 'wishlist' => apply_filters(
219 + 'wishlist' => apply_filters(
127 220 'rtsb/module/wishlist/options',
128 221 [
129 222 'id' => 'wishlist',
130 223 'title' => esc_html__( 'Wishlist', 'shopbuilder' ),
@@ -145,8 +238,24 @@
145 238 'label' => esc_html__( 'Limit Wishlist Use', 'shopbuilder' ),
146 239 'help' => esc_html__( 'Enable this option to allow only the logged-in users to use the Wishlist feature.', 'shopbuilder' ),
147 240 'tab' => 'general',
148 241 ],
242 + 'hide_wishlist_non_logged_in' => [
243 + 'id' => 'hide_wishlist_non_logged_in',
244 + 'type' => 'switch',
245 + 'label' => esc_html__( 'Hide Wishlist Button', 'shopbuilder' ),
246 + 'help' => esc_html__( 'Hide Wishlist Button For non logged-in users (guest users).', 'shopbuilder' ),
247 + 'dependency' => [
248 + 'rules' => [
249 + [
250 + 'item' => 'modules.wishlist.enable_login_limit',
251 + 'value' => 'on',
252 + 'operator' => '==',
253 + ],
254 + ],
255 + ],
256 + 'tab' => 'general',
257 + ],
149 258 'wishlist_shop_wrapper_heading' => [
150 259 'id' => 'wishlist_shop_wrapper_heading',
151 260 'type' => 'title',
152 261 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder' ),
@@ -213,9 +322,9 @@
213 322 'tab' => 'button',
214 323 'help' => sprintf(
215 324 /* translators: 1: The shortcode.*/
216 325 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
217 - "<code>&lt;?php do_action('rtsb/modules/wishlist/frontend/display' ); ?&gt;</code>"
326 + "<br /><code>&lt;?php do_action('rtsb/modules/wishlist/frontend/display' ); ?&gt;</code><br />"
218 327 ),
219 328 'dependency' => [
220 329 'rules' => [
221 330 [
@@ -325,9 +434,9 @@
325 434 'tab' => 'button',
326 435 'help' => sprintf(
327 436 /* translators: 1: The shortcode.*/
328 437 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
329 - "<code>&lt;?php do_action('rtsb/modules/wishlist/frontend/display' ); ?&gt;</code>"
438 + "<br /><code>&lt;?php do_action('rtsb/modules/wishlist/frontend/display' ); ?&gt;</code><br />"
330 439 ),
331 440 'dependency' => [
332 441 'rules' => [
333 442 [
@@ -421,9 +530,8 @@
421 530 'label' => esc_html__( 'Remove if Added to Cart', 'shopbuilder' ),
422 531 'tab' => 'page',
423 532 ),
424 533 */
425 -
426 534 'page' => [
427 535 'id' => 'page',
428 536 'type' => 'select',
429 537 'label' => esc_html__( 'Select Wishlist Page', 'shopbuilder' ),
@@ -434,9 +542,8 @@
434 542 ),
435 543 'options' => Fns::get_pages(),
436 544 'tab' => 'page',
437 545 ],
438 -
439 546 'page_show_fields' => [
440 547 'value' => WishlistFns::instance()->get_field_ids(),
441 548 'id' => 'page_show_fields',
442 549 'multiple' => true,
@@ -462,9 +569,9 @@
462 569 ],
463 570 ],
464 571 ]
465 572 ),
466 - 'compare' => apply_filters(
573 + 'compare' => apply_filters(
467 574 'rtsb/module/compare/options',
468 575 [
469 576 'id' => 'compare',
470 577 'base_class' => Compare::class,
@@ -546,9 +653,9 @@
546 653 'tab' => 'button',
547 654 'help' => sprintf(
548 655 /* translators: 1: The shortcode.*/
549 656 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
550 - "<code>&lt;?php do_action('rtsb/modules/compare/frontend/display' ); ?&gt;</code>"
657 + "<br /><code>&lt;?php do_action('rtsb/modules/compare/frontend/display' ); ?&gt;</code><br />"
551 658 ),
552 659 'dependency' => [
553 660 'rules' => [
554 661 [
@@ -658,9 +765,9 @@
658 765 'tab' => 'button',
659 766 'help' => sprintf(
660 767 /* translators: 1: The shortcode.*/
661 768 esc_html__( 'Or Copy the php code %1$s and paste it in your product query where you want to show the button.', 'shopbuilder' ),
662 - "<code>&lt;?php do_action('rtsb/modules/compare/frontend/display' ); ?&gt;</code>"
769 + "<br /><code>&lt;?php do_action('rtsb/modules/compare/frontend/display' ); ?&gt;</code><br />"
663 770 ),
664 771 'dependency' => [
665 772 'rules' => [
666 773 [
@@ -786,27 +893,27 @@
786 893
787 894 ],
788 895 ]
789 896 ),
790 - 'variation_gallery' => apply_filters(
791 - 'rtsb/module/variation_gallery/options',
897 + 'variation_swatches' => apply_filters(
898 + 'rtsb/module/variation_swatches/options',
792 899 [
793 - 'id' => 'variation_gallery',
900 + 'id' => 'variation_swatches',
794 901 'external' => true,
795 902 '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' ),
903 + 'title' => esc_html__( 'Variation Swatches', 'shopbuilder' ),
904 + 'pluginSlug' => 'woo-product-variation-swatches',
905 + 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-swatches/woo-product-variation-swatches.php' ),
906 + 'pluginIsActive' => Fns::check_plugin_active( 'woo-product-variation-swatches/woo-product-variation-swatches.php' ),
800 907 'pluginActiveUrl' => add_query_arg(
801 908 [
802 - '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-gallery/woo-product-variation-gallery.php' ),
909 + '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-swatches/woo-product-variation-swatches.php' ),
803 910 'action' => 'activate',
804 - 'plugin' => 'woo-product-variation-gallery/woo-product-variation-gallery.php',
911 + 'plugin' => 'woo-product-variation-swatches/woo-product-variation-swatches.php',
805 912 ],
806 913 admin_url( 'plugins.php' )
807 914 ),
808 - 'help' => esc_html__( 'This module requires: Variation Images Gallery for WooCommerce Plugin', 'shopbuilder' ),
915 + 'help' => __( 'This module requires: <a href="https://wordpress.org/plugins/woo-product-variation-swatches/">Variation Swatches for WooCommerce</a>.', 'shopbuilder' ),
809 916 'package' => 'free',
810 917 'active_field' => [
811 918 'disable' => false,
812 919 ],
@@ -812,27 +919,27 @@
812 919 ],
813 920 'fields' => [],
814 921 ]
815 922 ),
816 - 'variation_swatches' => apply_filters(
817 - 'rtsb/module/variation_swatches/options',
923 + 'variation_gallery' => apply_filters(
924 + 'rtsb/module/variation_gallery/options',
818 925 [
819 - 'id' => 'variation_swatches',
926 + 'id' => 'variation_gallery',
820 927 'external' => true,
821 928 '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' ),
929 + 'title' => esc_html__( 'Variation Gallery', 'shopbuilder' ),
930 + 'pluginSlug' => 'woo-product-variation-gallery',
931 + 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-gallery/woo-product-variation-gallery.php' ),
932 + 'pluginIsActive' => Fns::check_plugin_active( 'woo-product-variation-gallery/woo-product-variation-gallery.php' ),
826 933 'pluginActiveUrl' => add_query_arg(
827 934 [
828 - '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-swatches/woo-product-variation-swatches.php' ),
935 + '_wpnonce' => wp_create_nonce( 'activate-plugin_woo-product-variation-gallery/woo-product-variation-gallery.php' ),
829 936 'action' => 'activate',
830 - 'plugin' => 'woo-product-variation-swatches/woo-product-variation-swatches.php',
937 + 'plugin' => 'woo-product-variation-gallery/woo-product-variation-gallery.php',
831 938 ],
832 939 admin_url( 'plugins.php' )
833 940 ),
834 - 'help' => esc_html__( 'This module requires: Variation Swatches for WooCommerce Plugin.', 'shopbuilder' ),
941 + 'help' => __( 'This module requires: <a href="https://wordpress.org/plugins/woo-product-variation-gallery/">Variation Images Gallery for WooCommerce</a>.', 'shopbuilder' ),
835 942 'package' => 'free',
836 943 'active_field' => [
837 944 'disable' => false,
838 945 ],
@@ -838,9 +945,282 @@
838 945 ],
839 946 'fields' => [],
840 947 ]
841 948 ),
842 - 'sales_notification' => apply_filters(
949 + 'mini_cart' => apply_filters(
950 + 'rtsb/module/mini_cart/options',
951 + [
952 + 'id' => 'mini_cart',
953 + 'active' => '',
954 + 'title' => esc_html__( 'Mini Cart', 'shopbuilder' ),
955 + 'package' => $this->pro_package(),
956 + 'active_field' => [
957 + 'label' => esc_html__( 'Enable Mini Cart?', 'shopbuilder' ),
958 + 'help' => esc_html__( 'Switch on to enable mini cart module.', 'shopbuilder' ),
959 + ],
960 + 'is_active' => true,
961 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
962 + ]
963 + ),
964 + 'product_size_chart' => apply_filters(
965 + 'rtsb/module/product_size_chart/options',
966 + [
967 + 'id' => 'product_size_chart',
968 + 'active' => '',
969 + 'title' => esc_html__( 'Product Size Chart', 'shopbuilder' ),
970 + 'package' => $this->pro_package(),
971 + 'active_field' => [
972 + 'label' => esc_html__( 'Enable Product Size Chart?', 'shopbuilder' ),
973 + 'help' => esc_html__( 'Switch on to enable Product Size Chart module.', 'shopbuilder' ),
974 + ],
975 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
976 + ]
977 + ),
978 + 'product_badges' => apply_filters(
979 + 'rtsb/module/product_badges/options',
980 + [
981 + 'id' => 'product_badges',
982 + 'active' => '',
983 + 'title' => esc_html__( 'Product Badges', 'shopbuilder' ),
984 + 'package' => 'free',
985 + 'active_field' => [
986 + 'label' => esc_html__( 'Enable Product Badges?', 'shopbuilder' ),
987 + 'help' => esc_html__( 'Switch on to enable product badges module.', 'shopbuilder' ),
988 + ],
989 + 'base_class' => Badges::class,
990 + 'fields' => $this->product_badges_fields(),
991 + 'tabs' => [
992 + 'general' => [
993 + 'title' => esc_html__( 'General', 'shopbuilder' ),
994 + ],
995 + 'group' => [
996 + 'title' => esc_html__( 'Settings', 'shopbuilder' ),
997 + ],
998 + 'badges' => [
999 + 'title' => esc_html__( 'Create Badges', 'shopbuilder' ),
1000 + ],
1001 + ],
1002 + ]
1003 + ),
1004 + 'customize_my_account' => apply_filters(
1005 + 'rtsb/module/customize_my_account/options',
1006 + [
1007 + 'id' => 'customize_my_account',
1008 + 'active' => '',
1009 + 'title' => esc_html__( 'Customize My Account', 'shopbuilder' ),
1010 + 'package' => $this->pro_package(),
1011 + 'active_field' => [
1012 + 'label' => esc_html__( 'Enable Customize My Account?', 'shopbuilder' ),
1013 + 'help' => esc_html__( 'Switch on to enable customize my account module.', 'shopbuilder' ),
1014 + ],
1015 + 'fields' => Fns::pro_version_notice( '1.4.0' ),
1016 + ]
1017 + ),
1018 + 'pre_order' => apply_filters(
1019 + 'rtsb/module/pre_order/options',
1020 + [
1021 + 'id' => 'pre_order',
1022 + 'active' => '',
1023 + 'title' => esc_html__( 'Pre-Order', 'shopbuilder' ),
1024 + 'package' => $this->pro_package(),
1025 + 'active_field' => [
1026 + 'label' => esc_html__( 'Enable Pre-Order?', 'shopbuilder' ),
1027 + 'help' => esc_html__( 'Switch on to enable pre-order module.', 'shopbuilder' ),
1028 + ],
1029 + 'fields' => Fns::pro_version_notice( '1.5.0' ),
1030 + ]
1031 + ),
1032 + 'currency_switcher' => apply_filters(
1033 + 'rtsb/module/currency_switcher/options',
1034 + [
1035 + 'id' => 'currency_switcher',
1036 + 'active' => '',
1037 + 'title' => esc_html__( 'Currency Switcher', 'shopbuilder' ),
1038 + 'package' => $this->pro_package(),
1039 + 'active_field' => [
1040 + 'label' => esc_html__( 'Enable Currency Switcher?', 'shopbuilder' ),
1041 + 'help' => esc_html__( 'Switch on to enable currency switcher module.', 'shopbuilder' ),
1042 + ],
1043 + 'is_active' => true,
1044 + 'fields' => Fns::pro_version_notice( '1.5.0' ),
1045 + ]
1046 + ),
1047 + 'product_add_ons' => apply_filters(
1048 + 'rtsb/module/product_add_ons/options',
1049 + [
1050 + 'id' => 'product_add_ons',
1051 + 'active' => '',
1052 + 'title' => esc_html__( 'Product Add-Ons', 'shopbuilder' ),
1053 + 'package' => $this->pro_package(),
1054 + 'active_field' => [
1055 + 'label' => esc_html__( 'Enable Product Add-Ons?', 'shopbuilder' ),
1056 + 'help' => esc_html__( 'Switch on to enable product add-ons module.', 'shopbuilder' ),
1057 + ],
1058 + 'is_active' => true,
1059 + 'fields' => Fns::pro_version_notice( '1.6.0' ),
1060 + ]
1061 + ),
1062 + // Checkout Fields Manager.
1063 + 'checkout_fields_editor' => apply_filters(
1064 + 'rtsb/module/checkout_fields_editor/options',
1065 + [
1066 + 'id' => 'checkout_fields_editor',
1067 + 'active' => '',
1068 + 'title' => esc_html__( 'Checkout Fields Editor', 'shopbuilder' ),
1069 + 'base_class' => CheckoutEditorInit::class,
1070 + 'active_field' => [
1071 + 'label' => esc_html__( 'Enable Checkout Fields Editor?', 'shopbuilder' ),
1072 + 'help' => esc_html__( 'Switch on to enable Checkout Fields Editor module.', 'shopbuilder' ),
1073 + ],
1074 + 'fields' => [
1075 + 'checkout_billing_intro' => [
1076 + 'id' => 'checkout_billing_intro',
1077 + 'type' => 'description',
1078 + 'text' => esc_html__( 'Billing Fields Editor allows you to customize the default billing fields on your checkout page.', 'shopbuilder' ),
1079 + 'tab' => 'billing_fields',
1080 + ],
1081 + 'modify_billing_form' => [
1082 + 'id' => 'modify_billing_form',
1083 + 'type' => 'switch',
1084 + 'label' => esc_html__( 'Customize Billing Form?', 'shopbuilder' ),
1085 + 'help' => esc_html__( 'Enable this option to edit billing Form.', 'shopbuilder' ),
1086 + 'tab' => 'billing_fields',
1087 + ],
1088 +
1089 + 'checkout_billing_fields_info' => [
1090 + 'id' => 'checkout_billing_fields_info',
1091 + 'type' => 'title',
1092 + 'label' => esc_html__( 'Billing Fields', 'shopbuilder' ),
1093 + 'tab' => 'billing_fields',
1094 + 'dependency' => [
1095 + 'rules' => [
1096 + [
1097 + 'item' => 'modules.checkout_fields_editor.modify_billing_form',
1098 + 'value' => 'on',
1099 + 'operator' => '==',
1100 + ],
1101 + ],
1102 + ],
1103 + ],
1104 + 'checkout_billing_fields' => [
1105 + 'id' => 'checkout_billing_fields',
1106 + 'type' => 'checkout_fields',
1107 + 'tab' => 'billing_fields',
1108 + 'value' => wp_json_encode( CheckoutFns::default_billing_fields() ),
1109 + 'dependency' => [
1110 + 'rules' => [
1111 + [
1112 + 'item' => 'modules.checkout_fields_editor.modify_billing_form',
1113 + 'value' => 'on',
1114 + 'operator' => '==',
1115 + ],
1116 + ],
1117 + ],
1118 + ],
1119 + 'checkout_shipping_intro' => [
1120 + 'id' => 'checkout_shipping_intro',
1121 + 'type' => 'description',
1122 + 'text' => esc_html__( 'Shipping Fields Editor allows you to customize the default shipping fields on your checkout page.', 'shopbuilder' ),
1123 + 'tab' => 'shipping_fields',
1124 + ],
1125 + 'modify_shipping_form' => [
1126 + 'id' => 'modify_billing_form',
1127 + 'type' => 'switch',
1128 + 'label' => esc_html__( 'Modify Shipping Form?', 'shopbuilder' ),
1129 + 'help' => esc_html__( 'Enable this option to edit shipping Form.', 'shopbuilder' ),
1130 + 'tab' => 'shipping_fields',
1131 + ],
1132 + 'checkout_shipping_fields_info' => [
1133 + 'id' => 'checkout_shipping_fields_info',
1134 + 'type' => 'title',
1135 + 'label' => esc_html__( 'Shipping Fields', 'shopbuilder' ),
1136 + 'tab' => 'shipping_fields',
1137 + 'dependency' => [
1138 + 'rules' => [
1139 + [
1140 + 'item' => 'modules.checkout_fields_editor.modify_shipping_form',
1141 + 'value' => 'on',
1142 + 'operator' => '==',
1143 + ],
1144 + ],
1145 + ],
1146 + ],
1147 + 'checkout_shipping_fields' => [
1148 + 'id' => 'checkout_shipping_fields',
1149 + 'type' => 'checkout_fields',
1150 + 'tab' => 'shipping_fields',
1151 + 'value' => wp_json_encode( CheckoutFns::default_shipping_fields() ),
1152 + 'dependency' => [
1153 + 'rules' => [
1154 + [
1155 + 'item' => 'modules.checkout_fields_editor.modify_shipping_form',
1156 + 'value' => 'on',
1157 + 'operator' => '==',
1158 + ],
1159 + ],
1160 + ],
1161 + ],
1162 + 'checkout_additional_intro' => [
1163 + 'id' => 'checkout_additional_intro',
1164 + 'type' => 'description',
1165 + 'text' => esc_html__( 'Additional Fields Editor allows you to customize the extra fields on your checkout page.', 'shopbuilder' ),
1166 + 'tab' => 'additional_fields',
1167 + ],
1168 + 'modify_additional_form' => [
1169 + 'id' => 'modify_additional_form',
1170 + 'type' => 'switch',
1171 + 'label' => esc_html__( 'Modify Additional Form Field?', 'shopbuilder' ),
1172 + 'help' => esc_html__( 'Enable this option to edit Additional Form.', 'shopbuilder' ),
1173 + 'tab' => 'additional_fields',
1174 + ],
1175 + 'checkout_additional_fields_info' => [
1176 + 'id' => 'checkout_additional_fields_info',
1177 + 'type' => 'title',
1178 + 'label' => esc_html__( 'Additional Fields', 'shopbuilder' ),
1179 + 'tab' => 'additional_fields',
1180 + 'dependency' => [
1181 + 'rules' => [
1182 + [
1183 + 'item' => 'modules.checkout_fields_editor.modify_additional_form',
1184 + 'value' => 'on',
1185 + 'operator' => '==',
1186 + ],
1187 + ],
1188 + ],
1189 + ],
1190 + 'checkout_additional_fields' => [
1191 + 'id' => 'checkout_additional_fields',
1192 + 'type' => 'checkout_fields',
1193 + 'tab' => 'additional_fields',
1194 + 'value' => wp_json_encode( CheckoutFns::checkout_additional_fields() ),
1195 + 'dependency' => [
1196 + 'rules' => [
1197 + [
1198 + 'item' => 'modules.checkout_fields_editor.modify_additional_form',
1199 + 'value' => 'on',
1200 + 'operator' => '==',
1201 + ],
1202 + ],
1203 + ],
1204 + ],
1205 + ],
1206 + 'tabs' => [
1207 + 'general' => [
1208 + 'title' => esc_html__( 'General', 'shopbuilder' ),
1209 + ],
1210 + 'billing_fields' => [
1211 + 'title' => esc_html__( 'Billing Fields', 'shopbuilder' ),
1212 + ],
1213 + 'shipping_fields' => [
1214 + 'title' => esc_html__( 'Shipping Fields', 'shopbuilder' ),
1215 + ],
1216 + 'additional_fields' => [
1217 + 'title' => esc_html__( 'Additional Fields', 'shopbuilder' ),
1218 + ],
1219 + ],
1220 + ]
1221 + ),
1222 + 'sales_notification' => apply_filters(
843 1223 'rtsb/module/sales_notification/options',
844 1224 [
845 1225 'id' => 'sales_notification',
846 1226 'active' => '',
@@ -849,12 +1229,12 @@
849 1229 'active_field' => [
850 1230 'label' => esc_html__( 'Enable Sales Notification?', 'shopbuilder' ),
851 1231 'help' => esc_html__( 'Switch on to enable Sales Notification module.', 'shopbuilder' ),
852 1232 ],
853 - 'fields' => [],
1233 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
854 1234 ]
855 1235 ),
856 - 'flash_sale_countdown' => apply_filters(
1236 + 'flash_sale_countdown' => apply_filters(
857 1237 'rtsb/module/flash_sale_countdown/options',
858 1238 [
859 1239 'id' => 'flash_sale_countdown',
860 1240 'active' => '',
@@ -863,27 +1243,12 @@
863 1243 'active_field' => [
864 1244 'label' => esc_html__( 'Enable Flash Sale Countdown?', 'shopbuilder' ),
865 1245 'help' => esc_html__( 'Switch on to enable Flash Sale Countdown module.', 'shopbuilder' ),
866 1246 ],
867 - 'fields' => [],
1247 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
868 1248 ]
869 1249 ),
870 - 'mini_cart' => apply_filters(
871 - 'rtsb/module/mini_cart/options',
872 - [
873 - 'id' => 'mini_cart',
874 - 'active' => '',
875 - 'title' => esc_html__( 'Mini Cart', 'shopbuilder' ),
876 - 'package' => $this->pro_package(),
877 - 'active_field' => [
878 - 'label' => esc_html__( 'Enable Mini Cart?', 'shopbuilder' ),
879 - 'help' => esc_html__( 'Switch on to enable mini cart module.', 'shopbuilder' ),
880 - ],
881 - 'is_active' => true,
882 - 'fields' => [],
883 - ]
884 - ),
885 - 'quick_checkout' => apply_filters(
1250 + 'quick_checkout' => apply_filters(
886 1251 'rtsb/module/quick_checkout/options',
887 1252 [
888 1253 'id' => 'quick_checkout',
889 1254 'active' => '',
@@ -892,12 +1257,12 @@
892 1257 'active_field' => [
893 1258 'label' => esc_html__( 'Enable Quick Checkout?', 'shopbuilder' ),
894 1259 'help' => esc_html__( 'Switch on to enable quick checkout module. Note: Currently, this is not suitable for variable products.', 'shopbuilder' ),
895 1260 ],
896 - 'fields' => [],
1261 + 'fields' => Fns::pro_version_notice( '1.1.0' ),
897 1262 ]
898 1263 ),
899 - 'multi_step_checkout' => apply_filters(
1264 + 'multi_step_checkout' => apply_filters(
900 1265 'rtsb/module/multi_step_checkout/options',
901 1266 [
902 1267 'id' => 'multi_step_checkout',
903 1268 'active' => '',
@@ -906,39 +1271,839 @@
906 1271 'active_field' => [
907 1272 'label' => esc_html__( 'Enable Multi-Step Checkout?', 'shopbuilder' ),
908 1273 'help' => esc_html__( 'Switch on to enable Multi-step Checkout module.', 'shopbuilder' ),
909 1274 ],
910 - 'fields' => [],
1275 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
911 1276 ]
912 1277 ),
913 - 'product_size_chart' => apply_filters(
914 - 'rtsb/module/product_size_chart/options',
1278 + 'back_order' => apply_filters(
1279 + 'rtsb/module/back_order/options',
915 1280 [
916 - 'id' => 'product_size_chart',
1281 + 'id' => 'back_order',
917 1282 'active' => '',
918 - 'title' => esc_html__( 'Product Size Chart', 'shopbuilder' ),
1283 + 'title' => esc_html__( 'Back-Order', 'shopbuilder' ),
919 1284 'package' => $this->pro_package(),
920 1285 'active_field' => [
921 - 'label' => esc_html__( 'Enable Product Size Chart?', 'shopbuilder' ),
922 - 'help' => esc_html__( 'Switch on to enable Product Size Chart module.', 'shopbuilder' ),
1286 + 'label' => esc_html__( 'Enable Back-Order?', 'shopbuilder' ),
1287 + 'help' => esc_html__( 'Switch on to enable back-order module.', 'shopbuilder' ),
923 1288 ],
924 - 'fields' => [],
1289 + 'fields' => Fns::pro_version_notice( '1.3.0' ),
925 1290 ]
926 1291 ),
927 -// 'product_badges' => apply_filters(
928 -// 'rtsb/module/product_badges/options',
929 -// [
930 -// 'id' => 'product_badges',
931 -// 'active' => '',
932 -// 'title' => esc_html__( 'Product Badges', 'shopbuilder' ),
933 -// 'package' => $this->pro_package(),
934 -// 'active_field' => [
935 -// 'label' => esc_html__( 'Enable Product Badges?', 'shopbuilder' ),
936 -// 'help' => esc_html__( 'Switch on to enable product badges module.', 'shopbuilder' ),
937 -// ],
938 -// 'fields' => [],
939 -// ]
940 -// ),
1292 + 'sticky_add_to_cart' => apply_filters(
1293 + 'rtsb/module/sticky_add_to_cart/options',
1294 + [
1295 + 'id' => 'sticky_add_to_cart',
1296 + 'active' => '',
1297 + 'title' => esc_html__( 'Sticky Add-To-Cart', 'shopbuilder' ),
1298 + 'package' => $this->pro_package(),
1299 + 'active_field' => [
1300 + 'label' => esc_html__( 'Enable Sticky Add-To-Cart?', 'shopbuilder' ),
1301 + 'help' => esc_html__( 'Switch on to enable sticky add-to-cart module.', 'shopbuilder' ),
1302 + ],
1303 + 'fields' => Fns::pro_version_notice( '1.6.0' ),
1304 + ]
1305 + ),
941 1306 ];
942 1307 return apply_filters( 'rtsb/core/modules/raw_list', $list );
1308 + }
1309 +
1310 +
1311 + /**
1312 + * @return array
1313 + */
1314 + public function product_badges_fields() {
1315 + return apply_filters(
1316 + 'rtsb/module/product_badges/fields',
1317 + [
1318 + 'hide_woocommerce_badge' => [
1319 + 'id' => 'hide_woocommerce_badge',
1320 + 'value' => '',
1321 + 'type' => 'switch',
1322 + 'label' => esc_html__( 'Hide Theme Badges', 'shopbuilder' ),
1323 + 'help' => esc_html__( 'Switch on to hide theme default badges.', 'shopbuilder' ),
1324 + 'tab' => 'general',
1325 + ],
1326 + // Hide "On sale".
1327 + 'hide_on_sale' => [
1328 + 'id' => 'hide_on_sale',
1329 + 'type' => 'select',
1330 + 'value' => 'all_products',
1331 + 'isPro' => ! rtsb()->has_pro(),
1332 + 'label' => esc_html__( 'Applicable Products', 'shopbuilder' ),
1333 + 'options' => [
1334 + 'all_products' => esc_html__( 'All products', 'shopbuilder' ),
1335 + 'where_custom_badge_applied' => esc_html__( 'Only for products which have custom badge enabled', 'shopbuilder' ),
1336 + ],
1337 + 'help' => esc_html__( 'Choose where to hide the default badges.', 'shopbuilder' ),
1338 + 'tab' => 'general',
1339 + 'dependency' => [
1340 + 'rules' => [
1341 + [
1342 + 'item' => 'modules.product_badges.hide_woocommerce_badge',
1343 + 'value' => 'on',
1344 + 'operator' => '==',
1345 + ],
1346 + ],
1347 + ],
1348 + ],
1349 +
1350 + 'group_badge_display_as' => [
1351 + 'id' => 'group_badge_display_as',
1352 + 'type' => 'select',
1353 + 'value' => 'horizontal',
1354 + 'isPro' => ! rtsb()->has_pro(),
1355 + 'label' => esc_html__( 'Group Badge Display Type', 'shopbuilder' ),
1356 + 'help' => sprintf(
1357 + // translators: %s for pro message.
1358 + esc_html__( 'Please choose the group display type. %s', 'shopbuilder' ),
1359 + ! rtsb()->has_pro()
1360 + ? sprintf(
1361 + '<a target="_blank" href="%s">%s </a> %s ',
1362 + esc_url( rtsb()->pro_version_link() ),
1363 + esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
1364 + esc_html__( 'for vertical layout.', 'shopbuilder' )
1365 + )
1366 + : ''
1367 + ),
1368 + 'options' => [
1369 + 'horizontal' => esc_html__( 'Horizontal', 'shopbuilder' ),
1370 + 'vertical' => esc_html__( 'Vertical', 'shopbuilder' ),
1371 + ],
1372 + 'tab' => 'group',
1373 + ],
1374 + 'group_badge_gap' => [
1375 + 'id' => 'group_badge_gap',
1376 + 'type' => 'text',
1377 + 'value' => '10px',
1378 + 'label' => esc_html__( 'Group Badge Gap/Spacing', 'shopbuilder' ),
1379 + 'help' => esc_html__( 'Example: 10px', 'shopbuilder' ),
1380 + 'tab' => 'group',
1381 + ],
1382 + 'general_options' => [
1383 + 'id' => 'general_options',
1384 + 'type' => 'title',
1385 + 'label' => esc_html__( 'Shop Page Settings', 'shopbuilder' ),
1386 + 'tab' => 'group',
1387 + ],
1388 + 'loop_group_position' => [
1389 + 'id' => 'loop_group_position',
1390 + 'type' => 'select',
1391 + 'value' => 'above_image',
1392 + 'isPro' => ! rtsb()->has_pro(),
1393 + 'label' => esc_html__( 'Shop Page Group Position', 'shopbuilder' ),
1394 + 'help' => esc_html__( 'Choose the group badges position in Shop page.', 'shopbuilder' ),
1395 + 'options' => [
1396 + 'above_image' => esc_html__( 'Floating Above Image', 'shopbuilder' ),
1397 + 'before_product_title' => esc_html__( 'Before Product Title', 'shopbuilder' ),
1398 + 'after_product_title' => esc_html__( 'After Product Title', 'shopbuilder' ),
1399 + 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
1400 + 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
1401 + 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
1402 + ],
1403 + 'tab' => 'group',
1404 + ],
1405 + 'loop_custom_hook_name' => [
1406 + 'id' => 'loop_custom_hook_name',
1407 + 'type' => 'text',
1408 + 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
1409 + 'tab' => 'group',
1410 + 'help' => sprintf(
1411 + /* translators: 1: The shortcode.*/
1412 + __( 'Or Copy the php code <br />%1$s<br /> and paste it in your product query where you want to show the button.', 'shopbuilder' ),
1413 + "<code>&lt;?php do_action( 'rtsb/modules/product_badges/frontend/display' ); ?&gt;</code> OR Use shortcode <code>&lt;?php echo do_shortcode( '[rtsb_badges]' ); ?&gt;</code>"
1414 + ),
1415 + 'dependency' => [
1416 + 'rules' => [
1417 + [
1418 + 'item' => 'modules.product_badges.loop_group_position',
1419 + 'value' => 'custom',
1420 + 'operator' => '==',
1421 + ],
1422 + ],
1423 + ],
1424 + ],
1425 + 'loop_priority_note' => [
1426 + 'type' => 'raw',
1427 + 'label' => ' ',
1428 + 'html' => '<span style="color:red">' . esc_html__( 'If the badge position is incorrect or not displayed, please adjust the priority of hooks accordingly by increasing or decreasing them as necessary.', 'shopbuilder' ) . '</span>',
1429 + 'dependency' => [
1430 + 'rules' => [
1431 + [
1432 + 'item' => 'modules.product_badges.loop_group_position',
1433 + 'value' => 'above_image',
1434 + 'operator' => '!=',
1435 + ],
1436 + ],
1437 + ],
1438 + 'tab' => 'group',
1439 + ],
1440 + 'group_position_hook_priority' => [
1441 + 'id' => 'group_position_hook_priority',
1442 + 'type' => 'number',
1443 + 'size' => 'small',
1444 + 'min' => 0,
1445 + 'max' => 999,
1446 + 'label' => esc_html__( 'Badge Position Priority', 'shopbuilder' ),
1447 + 'help' => esc_html__( 'It\'s depend on your theme functionality. Example: 20', 'shopbuilder' ),
1448 + 'tab' => 'group',
1449 + 'dependency' => [
1450 + 'rules' => [
1451 + [
1452 + 'item' => 'modules.product_badges.loop_group_position',
1453 + 'value' => 'above_image',
1454 + 'operator' => '!=',
1455 + ],
1456 + ],
1457 + ],
1458 + ],
1459 + 'group_badge_position' => [
1460 + 'id' => 'group_badge_position',
1461 + 'label' => esc_html__( 'Position Above Image', 'shopbuilder' ),
1462 + 'type' => 'text_select',
1463 + 'value' => 'top-left',
1464 + 'options' => [
1465 + 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
1466 + 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
1467 + 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
1468 + 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
1469 + ],
1470 + 'dependency' => [
1471 + 'rules' => [
1472 + [
1473 + 'item' => 'modules.product_badges.loop_group_position',
1474 + 'value' => 'above_image',
1475 + 'operator' => '==',
1476 + ],
1477 + ],
1478 + ],
1479 + 'tab' => 'group',
1480 + ],
1481 + 'product_options' => [
1482 + 'id' => 'product_options',
1483 + 'type' => 'title',
1484 + 'label' => esc_html__( 'Product Page Settings', 'shopbuilder' ),
1485 + 'tab' => 'group',
1486 + ],
1487 + 'product_page_group_position' => [
1488 + 'id' => 'product_page_group_position',
1489 + 'type' => 'select',
1490 + 'value' => 'above_image',
1491 + 'isPro' => ! rtsb()->has_pro(),
1492 + 'label' => esc_html__( 'Product Page Group Position', 'shopbuilder' ),
1493 + 'help' => esc_html__( 'Choose the group badges position in product page.', 'shopbuilder' ),
1494 + 'options' => [
1495 + 'above_image' => esc_html__( 'Floating Above Image', 'shopbuilder' ),
1496 + 'before_add_to_cart' => esc_html__( 'Before Add To Cart', 'shopbuilder' ),
1497 + 'after_add_to_cart' => esc_html__( 'After Add To Cart', 'shopbuilder' ),
1498 + 'after_summary' => esc_html__( 'After Summary', 'shopbuilder' ),
1499 + 'after_short_desc' => esc_html__( 'After Short Description', 'shopbuilder' ),
1500 + 'shortcode' => esc_html__( 'Use Shortcode', 'shopbuilder' ),
1501 + 'custom' => esc_html__( 'Custom Position', 'shopbuilder' ),
1502 + ],
1503 + 'tab' => 'group',
1504 + ],
1505 + 'product_page_badges_shortcode' => [
1506 + 'type' => 'raw',
1507 + 'label' => ' ',
1508 + 'html' => sprintf(
1509 + /* translators: 1: The shortcode.*/
1510 + esc_html__( 'Choose where to show button on the product page. Copy this shortcode %1$s and paste it where you want to show the button.', 'shopbuilder' ),
1511 + '<code>[rtsb_badges]</code>'
1512 + ),
1513 + 'dependency' => [
1514 + 'rules' => [
1515 + [
1516 + 'item' => 'modules.product_badges.product_page_group_position',
1517 + 'value' => 'shortcode',
1518 + 'operator' => '==',
1519 + ],
1520 + ],
1521 + ],
1522 + 'tab' => 'group',
1523 + ],
1524 + 'product_page_custom_hook_name' => [
1525 + 'id' => 'product_page_custom_hook_name',
1526 + 'type' => 'text',
1527 + 'label' => esc_html__( 'Enter Hook Name', 'shopbuilder' ),
1528 + 'tab' => 'group',
1529 + 'help' => sprintf(
1530 + /* translators: 1: The shortcode.*/
1531 + __( 'Or Copy the php code <br />%1$s<br /> and paste it in your product query where you want to show the button.', 'shopbuilder' ),
1532 + "<code>&lt;?php do_action( 'rtsb/modules/product_badges/frontend/display' ); ?&gt;</code>"
1533 + ),
1534 + 'dependency' => [
1535 + 'rules' => [
1536 + [
1537 + 'item' => 'modules.product_badges.product_page_group_position',
1538 + 'value' => 'custom',
1539 + 'operator' => '==',
1540 + ],
1541 + ],
1542 + ],
1543 + ],
1544 + 'product_page_priority_note' => [
1545 + 'type' => 'raw',
1546 + 'label' => ' ',
1547 + 'html' => '<span style="color:red">' . esc_html__( 'If the badge position is incorrect or not displayed, please adjust the priority of hooks accordingly by increasing or decreasing them as necessary.', 'shopbuilder' ) . '</span>',
1548 + 'dependency' => [
1549 + 'rules' => [
1550 + [
1551 + 'item' => 'modules.product_badges.product_page_group_position',
1552 + 'value' => [ 'above_image', 'shortcode' ],
1553 + 'operator' => '!in',
1554 + ],
1555 + ],
1556 + ],
1557 + 'tab' => 'group',
1558 + ],
1559 + 'product_page_group_hook_priority' => [
1560 + 'id' => 'product_page_group_hook_priority',
1561 + 'type' => 'number',
1562 + 'size' => 'small',
1563 + 'min' => 0,
1564 + 'max' => 999,
1565 + 'label' => esc_html__( 'Badge Position Priority', 'shopbuilder' ),
1566 + 'help' => esc_html__( 'It\'s depend on your theme functionality. Example: 20', 'shopbuilder' ),
1567 + 'tab' => 'group',
1568 + 'dependency' => [
1569 + 'rules' => [
1570 + [
1571 + 'item' => 'modules.product_badges.product_page_group_position',
1572 + 'value' => [ 'shortcode', 'above_image' ],
1573 + 'operator' => '!in',
1574 + ],
1575 + ],
1576 + ],
1577 +
1578 + ],
1579 + 'product_page_group_badge_position' => [
1580 + 'id' => 'product_page_group_badge_position',
1581 + 'label' => esc_html__( 'Position Above Image', 'shopbuilder' ),
1582 + 'type' => 'text_select',
1583 + 'value' => 'top-left',
1584 + 'options' => [
1585 + 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
1586 + 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
1587 + 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
1588 + 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
1589 + ],
1590 + 'dependency' => [
1591 + 'rules' => [
1592 + [
1593 + 'item' => 'modules.product_badges.product_page_group_position',
1594 + 'value' => 'above_image',
1595 + 'operator' => '==',
1596 + ],
1597 + ],
1598 + ],
1599 + 'tab' => 'group',
1600 + ],
1601 +
1602 + 'badges_field_intro' => [
1603 + 'id' => 'badges_field_intro',
1604 + 'type' => 'description',
1605 + 'text' => esc_html__( 'To add new product badges, simply click on the \'Add New\' button below.', 'shopbuilder' ),
1606 + 'tab' => 'badges',
1607 + ],
1608 + 'badges_field' => [
1609 + 'id' => 'badges_field',
1610 + 'type' => 'repeaters',
1611 + 'label' => '',
1612 + 'tab' => 'badges',
1613 + 'repeat' => [
1614 +
1615 + 'title' => [
1616 + 'id' => 'title',
1617 + 'label' => esc_html__( 'Badge Name', 'shopbuilder' ),
1618 + 'help' => esc_html__( 'Enter badge name.', 'shopbuilder' ),
1619 + 'type' => 'text',
1620 + 'placeholder' => esc_html__( 'Badge Name', 'shopbuilder' ),
1621 + 'value' => esc_html__( 'Badge Name', 'shopbuilder' ),
1622 + ],
1623 + 'badge_condition' => [
1624 + 'id' => 'badge_condition',
1625 + 'type' => 'select',
1626 + 'value' => 'dynamic',
1627 + 'isPro' => ! rtsb()->has_pro(),
1628 + 'label' => esc_html__( 'Badge Type', 'shopbuilder' ),
1629 + 'help' => sprintf(
1630 + // translators: %s for pro message.
1631 + esc_html__( 'Select badge type. %s', 'shopbuilder' ),
1632 + ! rtsb()->has_pro()
1633 + ? sprintf(
1634 + '<a target="_blank" href="%s">%s</a> %s',
1635 + esc_url( rtsb()->pro_version_link() ),
1636 + esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
1637 + esc_html__( 'unlock custom badge creation.', 'shopbuilder' )
1638 + )
1639 + : ''
1640 + ),
1641 + 'options' => [
1642 + 'dynamic' => esc_html__( 'Dynamic', 'shopbuilder' ),
1643 + 'custom' => esc_html__( 'Custom', 'shopbuilder' ),
1644 + ],
1645 + ],
1646 + 'badge_for' => [
1647 + 'id' => 'badge_for',
1648 + 'type' => 'select',
1649 + 'value' => 'on_sale',
1650 + 'label' => esc_html__( 'Dynamic Badge Condition', 'shopbuilder' ),
1651 + 'help' => esc_html__( 'Specify dynamic badge condition', 'shopbuilder' ),
1652 + 'options' => $this->dynamic_badge_list(),
1653 + 'dependency' => [
1654 + 'rules' => [
1655 + [
1656 + 'item' => 'modules.product_badges.badges_field.badge_condition',
1657 + 'value' => 'dynamic',
1658 + 'operator' => '==',
1659 + ],
1660 + ],
1661 + ],
1662 + ],
1663 + 'badge_for_pre_order' => [
1664 + 'type' => 'raw',
1665 + 'label' => ' ',
1666 + 'html' => esc_html__( 'Please ensure that Pre-Order module is activated and properly configured.', 'shopbuilder' ),
1667 + 'tab' => 'general',
1668 + 'dependency' => [
1669 + 'rules' => [
1670 + [
1671 + 'item' => 'modules.product_badges.badges_field.badge_condition',
1672 + 'value' => 'dynamic',
1673 + 'operator' => '==',
1674 + ],
1675 + [
1676 + 'item' => 'modules.product_badges.badges_field.badge_for',
1677 + 'value' => 'pre_order',
1678 + 'operator' => '==',
1679 + ],
1680 + ],
1681 + ],
1682 + ],
1683 + 'minimum_sale_count' => [
1684 + 'id' => 'minimum_sale_count',
1685 + 'type' => 'number',
1686 + 'label' => esc_html__( 'Minimum Sale Count', 'shopbuilder' ),
1687 + 'help' => esc_html__( 'Enter the number of Sale you want to designate for products to be labeled as \'Best Selling.\'', 'shopbuilder' ),
1688 + 'dependency' => [
1689 + 'rules' => [
1690 + [
1691 + 'item' => 'modules.product_badges.badges_field.badge_condition',
1692 + 'value' => 'dynamic',
1693 + 'operator' => '==',
1694 + ],
1695 + [
1696 + 'item' => 'modules.product_badges.badges_field.badge_for',
1697 + 'value' => 'best_selling',
1698 + 'operator' => '==',
1699 + ],
1700 + ],
1701 + ],
1702 + ],
1703 + 'new_arrival_days' => [
1704 + 'id' => 'new_arrival_days',
1705 + 'type' => 'number',
1706 + 'label' => esc_html__( 'Specify Number of Days', 'shopbuilder' ),
1707 + 'help' => esc_html__( 'Enter the number of days you want to designate for products to be labeled as \'New Arrivals.\'', 'shopbuilder' ),
1708 + 'dependency' => [
1709 + 'rules' => [
1710 + [
1711 + 'item' => 'modules.product_badges.badges_field.badge_for',
1712 + 'value' => 'new_arrival',
1713 + 'operator' => '==',
1714 + ],
1715 + ],
1716 + ],
1717 + ],
1718 + 'badges_type' => [
1719 + 'id' => 'badges_type',
1720 + 'type' => 'select',
1721 + 'value' => 'text',
1722 + 'isPro' => ! rtsb()->has_pro(),
1723 + 'label' => esc_html__( 'Show Badge As:', 'shopbuilder' ),
1724 + 'help' => sprintf(
1725 + // translators: %s for pro message.
1726 + esc_html__( 'Specify the badge display as Image Or Text. %s', 'shopbuilder' ),
1727 + ! rtsb()->has_pro()
1728 + ? sprintf(
1729 + '<a target="_blank" href="%s">%s</a> %s',
1730 + esc_url( rtsb()->pro_version_link() ),
1731 + esc_html__( 'Upgrade to PRO', 'shopbuilder' ),
1732 + esc_html__( 'unlock Image badge creation.', 'shopbuilder' )
1733 + )
1734 + : ''
1735 + ),
1736 + 'options' => [
1737 + 'image' => esc_html__( 'Image', 'shopbuilder' ),
1738 + 'text' => esc_html__( 'Text', 'shopbuilder' ),
1739 + ],
1740 + ],
1741 +
1742 + 'badge_preset' => [
1743 + 'id' => 'badge_preset',
1744 + 'label' => esc_html__( 'Text Badge Preset', 'shopbuilder' ),
1745 + 'help' => esc_html__( 'Choose the badge appearance', 'shopbuilder' ),
1746 + 'type' => 'image_select',
1747 + 'value' => 'preset1',
1748 + 'options' => [
1749 + 'preset1' => [
1750 + 'label' => esc_html__( 'Preset 1', 'shopbuilder' ),
1751 + 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-1.png' ) ),
1752 + ],
1753 +
1754 + 'preset2' => [
1755 + 'label' => esc_html__( 'Preset 2', 'shopbuilder' ),
1756 + 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-2.png' ) ),
1757 + ],
1758 +
1759 + 'preset3' => [
1760 + 'label' => esc_html__( 'Preset 3', 'shopbuilder' ),
1761 + 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-3.png' ) ),
1762 + ],
1763 +
1764 + 'preset4' => [
1765 + 'title' => esc_html__( 'Preset 4', 'shopbuilder' ),
1766 + 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-4.png' ) ),
1767 + ],
1768 + ],
1769 + 'dependency' => [
1770 + 'rules' => [
1771 + [
1772 + 'item' => 'modules.product_badges.badges_field.badges_type',
1773 + 'value' => 'text',
1774 + 'operator' => '==',
1775 + ],
1776 + ],
1777 + ],
1778 + ],
1779 + 'badges_text' => [
1780 + 'id' => 'badges_text',
1781 + 'label' => esc_html__( 'Enter Badge Text', 'shopbuilder' ),
1782 + 'help' => esc_html__( 'The badge text will be displayed when the dynamic percentage switch is turned off.', 'shopbuilder' ),
1783 + 'type' => 'text',
1784 + 'placeholder' => 'Badge Text',
1785 + 'value' => esc_html__( 'New', 'shopbuilder' ),
1786 + 'dependency' => [
1787 + 'rules' => [
1788 + [
1789 + 'item' => 'modules.product_badges.badges_field.badges_type',
1790 + 'value' => 'text',
1791 + 'operator' => '==',
1792 + ],
1793 + ],
1794 + ],
1795 + ],
1796 + 'show_badges_percent_text' => [
1797 + 'id' => 'show_badges_percent_text',
1798 + 'type' => 'switch',
1799 + // 'isPro' => ! rtsb()->has_pro(),
1800 + 'label' => esc_html__( 'Show Badges Percentage (%)', 'shopbuilder' ),
1801 + 'help' => esc_html__( 'Switch on to show badge as dynamic percentage instead of text.', 'shopbuilder' ),
1802 + 'dependency' => [
1803 + 'rules' => [
1804 + [
1805 + 'item' => 'modules.product_badges.badges_field.badge_for',
1806 + 'value' => 'on_sale',
1807 + 'operator' => '==',
1808 + ],
1809 + [
1810 + 'item' => 'modules.product_badges.badges_field.badges_type',
1811 + 'value' => 'text',
1812 + 'operator' => '==',
1813 + ],
1814 + [
1815 + 'item' => 'modules.product_badges.badges_field.badge_condition',
1816 + 'value' => 'dynamic',
1817 + 'operator' => '==',
1818 + ],
1819 +
1820 + ],
1821 + ],
1822 + ],
1823 +
1824 + 'upload_image' => [
1825 + 'id' => 'upload_image',
1826 + 'type' => 'fileupload',
1827 + 'label' => esc_html__( 'Upload Image', 'shopbuilder' ),
1828 + 'help' => esc_html__( 'Upload badge image.', 'shopbuilder' ),
1829 + 'tab' => 'general',
1830 + 'dependency' => [
1831 + 'rules' => [
1832 + [
1833 + 'item' => 'modules.product_badges.badges_field.badges_type',
1834 + 'value' => 'image',
1835 + 'operator' => '==',
1836 + ],
1837 + ],
1838 + ],
1839 + ],
1840 +
1841 + 'apply_for' => [
1842 + 'id' => 'apply_for',
1843 + 'type' => 'select',
1844 + 'value' => 'product',
1845 + 'isPro' => ! rtsb()->has_pro(),
1846 + 'label' => esc_html__( 'Applicable For', 'shopbuilder' ),
1847 + 'options' => [
1848 + 'product' => esc_html__( 'Products', 'shopbuilder' ),
1849 + 'product_cat' => esc_html__( 'Product Categories', 'shopbuilder' ),
1850 + ],
1851 + 'help' => esc_html__( 'Badges will apply for selected products, or categories.', 'shopbuilder' ),
1852 + ],
1853 + 'applicable_products' => [
1854 + 'id' => 'applicable_products',
1855 + 'type' => 'search_and_multi_select',
1856 + 'label' => esc_html__( 'Applicable Products', 'shopbuilder' ),
1857 + 'help' => esc_html__( 'Choose products to include. Leave blank to apply in all product.', 'shopbuilder' ),
1858 + 'placeholder' => esc_html__( 'Search Products', 'shopbuilder' ),
1859 + 'func_with_param' => [ Fns::class, 'get_post_types', [ 'post_type' => 'product' ] ],
1860 + 'options' => Fns::get_post_types( null, [ 'post_type' => 'product' ] ),
1861 + 'dependency' => [
1862 + 'rules' => [
1863 + [
1864 + 'item' => 'modules.product_badges.badges_field.apply_for',
1865 + 'value' => 'product',
1866 + 'operator' => '==',
1867 + ],
1868 + ],
1869 + ],
1870 + ],
1871 + 'applicable_categories' => [
1872 + 'id' => 'applicable_categories',
1873 + 'type' => 'search_and_multi_select',
1874 + 'label' => esc_html__( 'Applicable Categories', 'shopbuilder' ),
1875 + 'help' => esc_html__( 'Choose categories to include. Leave blank to apply in all categories.', 'shopbuilder' ),
1876 + 'placeholder' => esc_html__( 'Search Category', 'shopbuilder' ),
1877 + 'func_with_param' => [
1878 + Fns::class,
1879 + 'products_category_query',
1880 + ],
1881 + 'options' => Fns::products_category_query(),
1882 + 'dependency' => [
1883 + 'rules' => [
1884 + [
1885 + 'item' => 'modules.product_badges.badges_field.apply_for',
1886 + 'value' => 'product_cat',
1887 + 'operator' => '==',
1888 + ],
1889 + ],
1890 + ],
1891 + ],
1892 + 'exclude_product' => [
1893 + 'id' => 'exclude_product',
1894 + 'type' => 'search_and_multi_select',
1895 + 'isPro' => ! rtsb()->has_pro(),
1896 + 'label' => esc_html__( 'Exclude Products', 'shopbuilder' ),
1897 + 'help' => esc_html__( 'Choose products to exclude. Leave blank to exclude none.', 'shopbuilder' ),
1898 + 'placeholder' => esc_html__( 'Search Products', 'shopbuilder' ),
1899 + 'func_with_param' => [ Fns::class, 'get_post_types', [ 'post_type' => 'product' ] ],
1900 + 'options' => Fns::get_post_types( null, [ 'post_type' => 'product' ] ),
1901 + ],
1902 +
1903 + /**
1904 + * Style Settings
1905 + */
1906 + 'styles_settings' => [
1907 + 'id' => 'styles_settings',
1908 + 'type' => 'title',
1909 + 'label' => esc_html__( 'Style Settings', 'shopbuilder' ),
1910 + ],
1911 + 'badge_text_color' => [
1912 + 'id' => 'badge_text_color',
1913 + 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
1914 + 'type' => 'color',
1915 + 'dependency' => [
1916 + 'rules' => [
1917 + [
1918 + 'item' => 'modules.product_badges.badges_field.badges_type',
1919 + 'value' => 'text',
1920 + 'operator' => '==',
1921 + ],
1922 + ],
1923 + ],
1924 + ],
1925 + 'badge_bg_color' => [
1926 + 'id' => 'badge_bg_color',
1927 + 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
1928 + 'type' => 'color',
1929 + 'dependency' => [
1930 + 'rules' => [
1931 + [
1932 + 'item' => 'modules.product_badges.badges_field.badges_type',
1933 + 'value' => 'text',
1934 + 'operator' => '==',
1935 + ],
1936 + [
1937 + 'item' => 'modules.product_badges.badges_field.badges_type',
1938 + 'value' => 'text',
1939 + 'operator' => '==',
1940 + ],
1941 + [
1942 + 'item' => 'modules.product_badges.badges_field.badge_preset',
1943 + 'value' => [ 'preset1', 'preset2' ],
1944 + 'operator' => 'in',
1945 + ],
1946 + ],
1947 + ],
1948 + ],
1949 + 'badge_border_color' => [
1950 + 'id' => 'badge_border_color',
1951 + 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
1952 + 'type' => 'color',
1953 + 'dependency' => [
1954 + 'rules' => [
1955 + [
1956 + 'item' => 'modules.product_badges.badges_field.badges_type',
1957 + 'value' => 'text',
1958 + 'operator' => '==',
1959 + ],
1960 + [
1961 + 'item' => 'modules.product_badges.badges_field.badges_type',
1962 + 'value' => 'text',
1963 + 'operator' => '==',
1964 + ],
1965 + [
1966 + 'item' => 'modules.product_badges.badges_field.badge_preset',
1967 + 'value' => [ 'preset3', 'preset4' ],
1968 + 'operator' => 'in',
1969 + ],
1970 + ],
1971 + ],
1972 + ],
1973 + 'badge_font_size' => [
1974 + 'id' => 'badge_font_size',
1975 + 'type' => 'text',
1976 + 'label' => esc_html__( 'Font Size', 'shopbuilder' ),
1977 + 'help' => esc_html__( 'Example: 14px', 'shopbuilder' ),
1978 + 'dependency' => [
1979 + 'rules' => [
1980 + [
1981 + 'item' => 'modules.product_badges.badges_field.badges_type',
1982 + 'value' => 'text',
1983 + 'operator' => '==',
1984 + ],
1985 + ],
1986 + ],
1987 + ],
1988 + 'badge_font_width' => [
1989 + 'id' => 'badge_font_width',
1990 + 'type' => 'select',
1991 + 'value' => '400',
1992 + 'label' => esc_html__( 'Font Weight', 'shopbuilder' ),
1993 + 'options' => [
1994 + '100' => '100',
1995 + '200' => '200',
1996 + '300' => '300',
1997 + '400' => '400',
1998 + '500' => '500',
1999 + '600' => '600',
2000 + '700' => '700',
2001 + '800' => '800',
2002 + '900' => '900',
2003 + 'normal' => 'normal',
2004 + 'bold' => 'bold',
2005 + 'bolder' => 'bolder',
2006 + 'lighter' => 'lighter',
2007 + 'initial' => 'initial',
2008 + 'inherit' => 'inherit',
2009 + ],
2010 + 'dependency' => [
2011 + 'rules' => [
2012 + [
2013 + 'item' => 'modules.product_badges.badges_field.badges_type',
2014 + 'value' => 'text',
2015 + 'operator' => '==',
2016 + ],
2017 + ],
2018 + ],
2019 + ],
2020 + 'badge_width' => [
2021 + 'id' => 'badge_width',
2022 + 'type' => 'text',
2023 + 'label' => esc_html__( 'Width', 'shopbuilder' ),
2024 + 'help' => esc_html__( 'Example: 150px', 'shopbuilder' ),
2025 + 'dependency' => [
2026 + 'rules' => [
2027 + [
2028 + 'item' => 'modules.product_badges.badges_field.badges_type',
2029 + 'value' => 'image',
2030 + 'operator' => '==',
2031 + ],
2032 + ],
2033 + ],
2034 + ],
2035 + 'badge_height' => [
2036 + 'id' => 'badge_height',
2037 + 'type' => 'text',
2038 + 'label' => esc_html__( 'Height', 'shopbuilder' ),
2039 + 'help' => esc_html__( 'Example: 50px', 'shopbuilder' ),
2040 + 'dependency' => [
2041 + 'rules' => [
2042 + [
2043 + 'item' => 'modules.product_badges.badges_field.badges_type',
2044 + 'value' => 'image',
2045 + 'operator' => '==',
2046 + ],
2047 + ],
2048 + ],
2049 + ],
2050 + 'border_radius' => [
2051 + 'id' => 'border_radius',
2052 + 'type' => 'text',
2053 + 'size' => 'small',
2054 + 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
2055 + 'help' => esc_html__( 'Example: 20px 20px 20px 20px Or 20px', 'shopbuilder' ),
2056 + 'dependency' => [
2057 + 'rules' => [
2058 + [
2059 + 'item' => 'modules.product_badges.badges_field.badges_type',
2060 + 'value' => 'text',
2061 + 'operator' => '==',
2062 + ],
2063 + ],
2064 + ],
2065 + ],
2066 + 'badge_padding' => [
2067 + 'id' => 'badge_padding',
2068 + 'type' => 'text',
2069 + 'size' => 'small',
2070 + 'label' => esc_html__( 'Padding', 'shopbuilder' ),
2071 + 'help' => esc_html__( 'Example: 10px 15px 10px 15px', 'shopbuilder' ),
2072 + 'dependency' => [
2073 + 'rules' => [
2074 + [
2075 + 'item' => 'modules.product_badges.badges_field.badges_type',
2076 + 'value' => 'text',
2077 + 'operator' => '==',
2078 + ],
2079 + ],
2080 + ],
2081 + ],
2082 + ],
2083 + ],
2084 +
2085 + ]
2086 + );
2087 + }
2088 +
2089 + /**
2090 + * Dynamic badge list.
2091 + *
2092 + * @return array
2093 + */
2094 + public function dynamic_badge_list() {
2095 + $items = [
2096 + 'on_sale' => esc_html__( 'Products On Sale', 'shopbuilder' ),
2097 + 'featured' => esc_html__( 'Featured Products', 'shopbuilder' ),
2098 + 'out_of_stock' => esc_html__( 'Out Of Stock Products', 'shopbuilder' ),
2099 + 'best_selling' => esc_html__( 'Best Selling Products', 'shopbuilder' ),
2100 + 'new_arrival' => esc_html__( 'New Arrival Products', 'shopbuilder' ),
2101 + ];
2102 +
2103 + if ( rtsb()->has_pro() && method_exists( FnsPro::class, 'is_module_active' ) && FnsPro::is_module_active( 'pre_order' ) ) {
2104 + $items['pre_order'] = esc_html__( 'Pre-Order Products', 'shopbuilder' );
2105 + }
2106 +
2107 + return $items;
943 2108 }
944 2109 }