PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.4.0
ShopBuilder – WooCommerce Builder For Elementor v2.4.0
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
← All changes | app/Models/ModuleList.php +1034 -31 2.2.02.4.0 View file →
@@ -8,8 +8,11 @@
8 8 namespace RadiusTheme\SB\Models;
9 9
10 10 use RadiusTheme\SB\Helpers\Fns;
11 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;
12 15 use RadiusTheme\SB\Traits\SingletonTrait;
13 16 use RadiusTheme\SB\Modules\Compare\Compare;
14 17 use RadiusTheme\SB\Modules\WishList\Wishlist;
15 18 use RadiusTheme\SB\Modules\Compare\CompareFns;
@@ -14,8 +17,9 @@
14 17 use RadiusTheme\SB\Modules\WishList\Wishlist;
15 18 use RadiusTheme\SB\Modules\Compare\CompareFns;
16 19 use RadiusTheme\SB\Modules\QuickView\QuickView;
17 20 use RadiusTheme\SB\Modules\WishList\WishlistFns;
21 +use RadiusTheme\SBPRO\Helpers\FnsPro;
18 22
19 23 defined( 'ABSPATH' ) || exit;
20 24
21 25 /**
@@ -47,9 +51,9 @@
47 51 * @return mixed|null
48 52 */
49 53 protected function raw_list() {
50 54 $list = [
51 - 'quick_view' => apply_filters(
55 + 'quick_view' => apply_filters(
52 56 'rtsb/module/quick_view/options',
53 57 [
54 58 'id' => 'quick_view',
55 59 'title' => esc_html__( 'Quick View', 'shopbuilder' ),
@@ -211,9 +215,9 @@
211 215 ]
212 216 ),
213 217 ]
214 218 ),
215 - 'wishlist' => apply_filters(
219 + 'wishlist' => apply_filters(
216 220 'rtsb/module/wishlist/options',
217 221 [
218 222 'id' => 'wishlist',
219 223 'title' => esc_html__( 'Wishlist', 'shopbuilder' ),
@@ -565,9 +569,9 @@
565 569 ],
566 570 ],
567 571 ]
568 572 ),
569 - 'compare' => apply_filters(
573 + 'compare' => apply_filters(
570 574 'rtsb/module/compare/options',
571 575 [
572 576 'id' => 'compare',
573 577 'base_class' => Compare::class,
@@ -889,9 +893,9 @@
889 893
890 894 ],
891 895 ]
892 896 ),
893 - 'variation_swatches' => apply_filters(
897 + 'variation_swatches' => apply_filters(
894 898 'rtsb/module/variation_swatches/options',
895 899 [
896 900 'id' => 'variation_swatches',
897 901 'external' => true,
@@ -907,9 +911,9 @@
907 911 'plugin' => 'woo-product-variation-swatches/woo-product-variation-swatches.php',
908 912 ],
909 913 admin_url( 'plugins.php' )
910 914 ),
911 - 'help' => esc_html__( 'This module requires: Variation Swatches 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' ),
912 916 'package' => 'free',
913 917 'active_field' => [
914 918 'disable' => false,
915 919 ],
@@ -915,9 +919,9 @@
915 919 ],
916 920 'fields' => [],
917 921 ]
918 922 ),
919 - 'variation_gallery' => apply_filters(
923 + 'variation_gallery' => apply_filters(
920 924 'rtsb/module/variation_gallery/options',
921 925 [
922 926 'id' => 'variation_gallery',
923 927 'external' => true,
@@ -933,9 +937,9 @@
933 937 'plugin' => 'woo-product-variation-gallery/woo-product-variation-gallery.php',
934 938 ],
935 939 admin_url( 'plugins.php' )
936 940 ),
937 - 'help' => esc_html__( 'This module requires: Variation Images Gallery 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' ),
938 942 'package' => 'free',
939 943 'active_field' => [
940 944 'disable' => false,
941 945 ],
@@ -941,9 +945,9 @@
941 945 ],
942 946 'fields' => [],
943 947 ]
944 948 ),
945 - 'mini_cart' => apply_filters(
949 + 'mini_cart' => apply_filters(
946 950 'rtsb/module/mini_cart/options',
947 951 [
948 952 'id' => 'mini_cart',
949 953 'active' => '',
@@ -953,12 +957,12 @@
953 957 'label' => esc_html__( 'Enable Mini Cart?', 'shopbuilder' ),
954 958 'help' => esc_html__( 'Switch on to enable mini cart module.', 'shopbuilder' ),
955 959 ],
956 960 'is_active' => true,
957 - 'fields' => [],
961 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
958 962 ]
959 963 ),
960 - 'product_size_chart' => apply_filters(
964 + 'product_size_chart' => apply_filters(
961 965 'rtsb/module/product_size_chart/options',
962 966 [
963 967 'id' => 'product_size_chart',
964 968 'active' => '',
@@ -967,26 +971,38 @@
967 971 'active_field' => [
968 972 'label' => esc_html__( 'Enable Product Size Chart?', 'shopbuilder' ),
969 973 'help' => esc_html__( 'Switch on to enable Product Size Chart module.', 'shopbuilder' ),
970 974 ],
971 - 'fields' => [],
975 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
972 976 ]
973 977 ),
974 - 'product_badges' => apply_filters(
978 + 'product_badges' => apply_filters(
975 979 'rtsb/module/product_badges/options',
976 980 [
977 981 'id' => 'product_badges',
978 982 'active' => '',
979 983 'title' => esc_html__( 'Product Badges', 'shopbuilder' ),
980 - 'package' => $this->pro_package(),
984 + 'package' => 'free',
981 985 'active_field' => [
982 986 'label' => esc_html__( 'Enable Product Badges?', 'shopbuilder' ),
983 987 'help' => esc_html__( 'Switch on to enable product badges module.', 'shopbuilder' ),
984 988 ],
985 - 'fields' => [],
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 + ],
986 1002 ]
987 1003 ),
988 - 'customize_my_account' => apply_filters(
1004 + 'customize_my_account' => apply_filters(
989 1005 'rtsb/module/customize_my_account/options',
990 1006 [
991 1007 'id' => 'customize_my_account',
992 1008 'active' => '',
@@ -995,12 +1011,12 @@
995 1011 'active_field' => [
996 1012 'label' => esc_html__( 'Enable Customize My Account?', 'shopbuilder' ),
997 1013 'help' => esc_html__( 'Switch on to enable customize my account module.', 'shopbuilder' ),
998 1014 ],
999 - 'fields' => [],
1015 + 'fields' => Fns::pro_version_notice( '1.4.0' ),
1000 1016 ]
1001 1017 ),
1002 - 'pre_order' => apply_filters(
1018 + 'pre_order' => apply_filters(
1003 1019 'rtsb/module/pre_order/options',
1004 1020 [
1005 1021 'id' => 'pre_order',
1006 1022 'active' => '',
@@ -1009,12 +1025,12 @@
1009 1025 'active_field' => [
1010 1026 'label' => esc_html__( 'Enable Pre-Order?', 'shopbuilder' ),
1011 1027 'help' => esc_html__( 'Switch on to enable pre-order module.', 'shopbuilder' ),
1012 1028 ],
1013 - 'fields' => [],
1029 + 'fields' => Fns::pro_version_notice( '1.5.0' ),
1014 1030 ]
1015 1031 ),
1016 - 'currency_switcher' => apply_filters(
1032 + 'currency_switcher' => apply_filters(
1017 1033 'rtsb/module/currency_switcher/options',
1018 1034 [
1019 1035 'id' => 'currency_switcher',
1020 1036 'active' => '',
@@ -1024,14 +1040,187 @@
1024 1040 'label' => esc_html__( 'Enable Currency Switcher?', 'shopbuilder' ),
1025 1041 'help' => esc_html__( 'Switch on to enable currency switcher module.', 'shopbuilder' ),
1026 1042 ],
1027 1043 'is_active' => true,
1028 - 'fields' => [],
1044 + 'fields' => Fns::pro_version_notice( '1.5.0' ),
1029 1045 ]
1030 1046 ),
1031 - // Product Addons.
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 + ),
1032 1062 // Checkout Fields Manager.
1033 - 'sales_notification' => apply_filters(
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(
1034 1223 'rtsb/module/sales_notification/options',
1035 1224 [
1036 1225 'id' => 'sales_notification',
1037 1226 'active' => '',
@@ -1040,12 +1229,12 @@
1040 1229 'active_field' => [
1041 1230 'label' => esc_html__( 'Enable Sales Notification?', 'shopbuilder' ),
1042 1231 'help' => esc_html__( 'Switch on to enable Sales Notification module.', 'shopbuilder' ),
1043 1232 ],
1044 - 'fields' => [],
1233 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
1045 1234 ]
1046 1235 ),
1047 - 'flash_sale_countdown' => apply_filters(
1236 + 'flash_sale_countdown' => apply_filters(
1048 1237 'rtsb/module/flash_sale_countdown/options',
1049 1238 [
1050 1239 'id' => 'flash_sale_countdown',
1051 1240 'active' => '',
@@ -1054,12 +1243,12 @@
1054 1243 'active_field' => [
1055 1244 'label' => esc_html__( 'Enable Flash Sale Countdown?', 'shopbuilder' ),
1056 1245 'help' => esc_html__( 'Switch on to enable Flash Sale Countdown module.', 'shopbuilder' ),
1057 1246 ],
1058 - 'fields' => [],
1247 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
1059 1248 ]
1060 1249 ),
1061 - 'quick_checkout' => apply_filters(
1250 + 'quick_checkout' => apply_filters(
1062 1251 'rtsb/module/quick_checkout/options',
1063 1252 [
1064 1253 'id' => 'quick_checkout',
1065 1254 'active' => '',
@@ -1068,12 +1257,12 @@
1068 1257 'active_field' => [
1069 1258 'label' => esc_html__( 'Enable Quick Checkout?', 'shopbuilder' ),
1070 1259 'help' => esc_html__( 'Switch on to enable quick checkout module. Note: Currently, this is not suitable for variable products.', 'shopbuilder' ),
1071 1260 ],
1072 - 'fields' => [],
1261 + 'fields' => Fns::pro_version_notice( '1.1.0' ),
1073 1262 ]
1074 1263 ),
1075 - 'multi_step_checkout' => apply_filters(
1264 + 'multi_step_checkout' => apply_filters(
1076 1265 'rtsb/module/multi_step_checkout/options',
1077 1266 [
1078 1267 'id' => 'multi_step_checkout',
1079 1268 'active' => '',
@@ -1082,12 +1271,12 @@
1082 1271 'active_field' => [
1083 1272 'label' => esc_html__( 'Enable Multi-Step Checkout?', 'shopbuilder' ),
1084 1273 'help' => esc_html__( 'Switch on to enable Multi-step Checkout module.', 'shopbuilder' ),
1085 1274 ],
1086 - 'fields' => [],
1275 + 'fields' => Fns::pro_version_notice( '1.0.0' ),
1087 1276 ]
1088 1277 ),
1089 - 'back_order' => apply_filters(
1278 + 'back_order' => apply_filters(
1090 1279 'rtsb/module/back_order/options',
1091 1280 [
1092 1281 'id' => 'back_order',
1093 1282 'active' => '',
@@ -1096,11 +1285,825 @@
1096 1285 'active_field' => [
1097 1286 'label' => esc_html__( 'Enable Back-Order?', 'shopbuilder' ),
1098 1287 'help' => esc_html__( 'Switch on to enable back-order module.', 'shopbuilder' ),
1099 1288 ],
1100 - 'fields' => [],
1289 + 'fields' => Fns::pro_version_notice( '1.3.0' ),
1101 1290 ]
1102 1291 ),
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 + ),
1103 1306 ];
1104 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() && FnsPro::is_module_active( 'pre_order' ) ) {
2104 + $items['pre_order'] = esc_html__( 'Pre-Order Products', 'shopbuilder' );
2105 + }
2106 +
2107 + return $items;
1105 2108 }
1106 2109 }