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 +1218 -69 2.1.62.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' ),
@@ -229,9 +322,9 @@
229 322 'tab' => 'button',
230 323 'help' => sprintf(
231 324 /* translators: 1: The shortcode.*/
232 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' ),
233 - "<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 />"
234 327 ),
235 328 'dependency' => [
236 329 'rules' => [
237 330 [
@@ -341,9 +434,9 @@
341 434 'tab' => 'button',
342 435 'help' => sprintf(
343 436 /* translators: 1: The shortcode.*/
344 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' ),
345 - "<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 />"
346 439 ),
347 440 'dependency' => [
348 441 'rules' => [
349 442 [
@@ -437,9 +530,8 @@
437 530 'label' => esc_html__( 'Remove if Added to Cart', 'shopbuilder' ),
438 531 'tab' => 'page',
439 532 ),
440 533 */
441 -
442 534 'page' => [
443 535 'id' => 'page',
444 536 'type' => 'select',
445 537 'label' => esc_html__( 'Select Wishlist Page', 'shopbuilder' ),
@@ -450,9 +542,8 @@
450 542 ),
451 543 'options' => Fns::get_pages(),
452 544 'tab' => 'page',
453 545 ],
454 -
455 546 'page_show_fields' => [
456 547 'value' => WishlistFns::instance()->get_field_ids(),
457 548 'id' => 'page_show_fields',
458 549 'multiple' => true,
@@ -478,9 +569,9 @@
478 569 ],
479 570 ],
480 571 ]
481 572 ),
482 - 'compare' => apply_filters(
573 + 'compare' => apply_filters(
483 574 'rtsb/module/compare/options',
484 575 [
485 576 'id' => 'compare',
486 577 'base_class' => Compare::class,
@@ -562,9 +653,9 @@
562 653 'tab' => 'button',
563 654 'help' => sprintf(
564 655 /* translators: 1: The shortcode.*/
565 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' ),
566 - "<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 />"
567 658 ),
568 659 'dependency' => [
569 660 'rules' => [
570 661 [
@@ -674,9 +765,9 @@
674 765 'tab' => 'button',
675 766 'help' => sprintf(
676 767 /* translators: 1: The shortcode.*/
677 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' ),
678 - "<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 />"
679 770 ),
680 771 'dependency' => [
681 772 'rules' => [
682 773 [
@@ -802,27 +893,27 @@
802 893
803 894 ],
804 895 ]
805 896 ),
806 - 'variation_gallery' => apply_filters(
807 - 'rtsb/module/variation_gallery/options',
897 + 'variation_swatches' => apply_filters(
898 + 'rtsb/module/variation_swatches/options',
808 899 [
809 - 'id' => 'variation_gallery',
900 + 'id' => 'variation_swatches',
810 901 'external' => true,
811 902 'category' => 'general',
812 - 'title' => esc_html__( 'Variation Gallery', 'shopbuilder' ),
813 - 'pluginSlug' => 'woo-product-variation-gallery',
814 - 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-gallery/woo-product-variation-gallery.php' ),
815 - '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' ),
816 907 'pluginActiveUrl' => add_query_arg(
817 908 [
818 - '_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' ),
819 910 'action' => 'activate',
820 - 'plugin' => 'woo-product-variation-gallery/woo-product-variation-gallery.php',
911 + 'plugin' => 'woo-product-variation-swatches/woo-product-variation-swatches.php',
821 912 ],
822 913 admin_url( 'plugins.php' )
823 914 ),
824 - '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' ),
825 916 'package' => 'free',
826 917 'active_field' => [
827 918 'disable' => false,
828 919 ],
@@ -828,27 +919,27 @@
828 919 ],
829 920 'fields' => [],
830 921 ]
831 922 ),
832 - 'variation_swatches' => apply_filters(
833 - 'rtsb/module/variation_swatches/options',
923 + 'variation_gallery' => apply_filters(
924 + 'rtsb/module/variation_gallery/options',
834 925 [
835 - 'id' => 'variation_swatches',
926 + 'id' => 'variation_gallery',
836 927 'external' => true,
837 928 'category' => 'general',
838 - 'title' => esc_html__( 'Variation Swatches', 'shopbuilder' ),
839 - 'pluginSlug' => 'woo-product-variation-swatches',
840 - 'pluginIsInstalled' => Fns::check_plugin_installed( 'woo-product-variation-swatches/woo-product-variation-swatches.php' ),
841 - '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' ),
842 933 'pluginActiveUrl' => add_query_arg(
843 934 [
844 - '_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' ),
845 936 'action' => 'activate',
846 - 'plugin' => 'woo-product-variation-swatches/woo-product-variation-swatches.php',
937 + 'plugin' => 'woo-product-variation-gallery/woo-product-variation-gallery.php',
847 938 ],
848 939 admin_url( 'plugins.php' )
849 940 ),
850 - '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' ),
851 942 'package' => 'free',
852 943 'active_field' => [
853 944 'disable' => false,
854 945 ],
@@ -854,9 +945,282 @@
854 945 ],
855 946 'fields' => [],
856 947 ]
857 948 ),
858 - '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(
859 1223 'rtsb/module/sales_notification/options',
860 1224 [
861 1225 'id' => 'sales_notification',
862 1226 'active' => '',
@@ -865,12 +1229,12 @@
865 1229 'active_field' => [
866 1230 'label' => esc_html__( 'Enable Sales Notification?', 'shopbuilder' ),
867 1231 'help' => esc_html__( 'Switch on to enable Sales Notification module.', 'shopbuilder' ),
868 1232 ],
869 - 'fields' => [],
1233 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
870 1234 ]
871 1235 ),
872 - 'flash_sale_countdown' => apply_filters(
1236 + 'flash_sale_countdown' => apply_filters(
873 1237 'rtsb/module/flash_sale_countdown/options',
874 1238 [
875 1239 'id' => 'flash_sale_countdown',
876 1240 'active' => '',
@@ -879,27 +1243,12 @@
879 1243 'active_field' => [
880 1244 'label' => esc_html__( 'Enable Flash Sale Countdown?', 'shopbuilder' ),
881 1245 'help' => esc_html__( 'Switch on to enable Flash Sale Countdown module.', 'shopbuilder' ),
882 1246 ],
883 - 'fields' => [],
1247 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
884 1248 ]
885 1249 ),
886 - 'mini_cart' => apply_filters(
887 - 'rtsb/module/mini_cart/options',
888 - [
889 - 'id' => 'mini_cart',
890 - 'active' => '',
891 - 'title' => esc_html__( 'Mini Cart', 'shopbuilder' ),
892 - 'package' => $this->pro_package(),
893 - 'active_field' => [
894 - 'label' => esc_html__( 'Enable Mini Cart?', 'shopbuilder' ),
895 - 'help' => esc_html__( 'Switch on to enable mini cart module.', 'shopbuilder' ),
896 - ],
897 - 'is_active' => true,
898 - 'fields' => [],
899 - ]
900 - ),
901 - 'quick_checkout' => apply_filters(
1250 + 'quick_checkout' => apply_filters(
902 1251 'rtsb/module/quick_checkout/options',
903 1252 [
904 1253 'id' => 'quick_checkout',
905 1254 'active' => '',
@@ -908,12 +1257,12 @@
908 1257 'active_field' => [
909 1258 'label' => esc_html__( 'Enable Quick Checkout?', 'shopbuilder' ),
910 1259 'help' => esc_html__( 'Switch on to enable quick checkout module. Note: Currently, this is not suitable for variable products.', 'shopbuilder' ),
911 1260 ],
912 - 'fields' => [],
1261 + 'fields' => Fns::pro_version_notice( '1.1.0' ),
913 1262 ]
914 1263 ),
915 - 'multi_step_checkout' => apply_filters(
1264 + 'multi_step_checkout' => apply_filters(
916 1265 'rtsb/module/multi_step_checkout/options',
917 1266 [
918 1267 'id' => 'multi_step_checkout',
919 1268 'active' => '',
@@ -922,39 +1271,839 @@
922 1271 'active_field' => [
923 1272 'label' => esc_html__( 'Enable Multi-Step Checkout?', 'shopbuilder' ),
924 1273 'help' => esc_html__( 'Switch on to enable Multi-step Checkout module.', 'shopbuilder' ),
925 1274 ],
926 - 'fields' => [],
1275 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
927 1276 ]
928 1277 ),
929 - 'product_size_chart' => apply_filters(
930 - 'rtsb/module/product_size_chart/options',
1278 + 'back_order' => apply_filters(
1279 + 'rtsb/module/back_order/options',
931 1280 [
932 - 'id' => 'product_size_chart',
1281 + 'id' => 'back_order',
933 1282 'active' => '',
934 - 'title' => esc_html__( 'Product Size Chart', 'shopbuilder' ),
1283 + 'title' => esc_html__( 'Back-Order', 'shopbuilder' ),
935 1284 'package' => $this->pro_package(),
936 1285 'active_field' => [
937 - 'label' => esc_html__( 'Enable Product Size Chart?', 'shopbuilder' ),
938 - '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' ),
939 1288 ],
940 - 'fields' => [],
1289 + 'fields' => Fns::pro_version_notice( '1.3.0' ),
941 1290 ]
942 1291 ),
943 - 'product_badges' => apply_filters(
944 - 'rtsb/module/product_badges/options',
1292 + 'sticky_add_to_cart' => apply_filters(
1293 + 'rtsb/module/sticky_add_to_cart/options',
945 1294 [
946 - 'id' => 'product_badges',
1295 + 'id' => 'sticky_add_to_cart',
947 1296 'active' => '',
948 - 'title' => esc_html__( 'Product Badges', 'shopbuilder' ),
1297 + 'title' => esc_html__( 'Sticky Add-To-Cart', 'shopbuilder' ),
949 1298 'package' => $this->pro_package(),
950 1299 'active_field' => [
951 - 'label' => esc_html__( 'Enable Product Badges?', 'shopbuilder' ),
952 - 'help' => esc_html__( 'Switch on to enable product badges module.', 'shopbuilder' ),
1300 + 'label' => esc_html__( 'Enable Sticky Add-To-Cart?', 'shopbuilder' ),
1301 + 'help' => esc_html__( 'Switch on to enable sticky add-to-cart module.', 'shopbuilder' ),
953 1302 ],
954 - 'fields' => [],
1303 + 'fields' => Fns::pro_version_notice( '1.6.0' ),
955 1304 ]
956 1305 ),
957 1306 ];
958 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;
959 2108 }
960 2109 }