| @@ -8,8 +8,9 @@ | ||
| 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; | |
| 12 | 13 | use RadiusTheme\SB\Modules\CheckoutEditor\CheckoutEditorInit; |
| 13 | 14 | use RadiusTheme\SB\Modules\CheckoutEditor\CheckoutFns; |
| 14 | 15 | use RadiusTheme\SB\Traits\SingletonTrait; |
| 15 | 16 | use RadiusTheme\SB\Modules\Compare\Compare; |
| @@ -16,8 +17,9 @@ | ||
| 16 | 17 | use RadiusTheme\SB\Modules\WishList\Wishlist; |
| 17 | 18 | use RadiusTheme\SB\Modules\Compare\CompareFns; |
| 18 | 19 | use RadiusTheme\SB\Modules\QuickView\QuickView; |
| 19 | 20 | use RadiusTheme\SB\Modules\WishList\WishlistFns; |
| 21 | +use RadiusTheme\SBPRO\Helpers\FnsPro; | |
| 20 | 22 | |
| 21 | 23 | defined( 'ABSPATH' ) || exit; |
| 22 | 24 | |
| 23 | 25 | /** |
| @@ -909,9 +911,9 @@ | ||
| 909 | 911 | 'plugin' => 'woo-product-variation-swatches/woo-product-variation-swatches.php', |
| 910 | 912 | ], |
| 911 | 913 | admin_url( 'plugins.php' ) |
| 912 | 914 | ), |
| 913 | - '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' ), | |
| 914 | 916 | 'package' => 'free', |
| 915 | 917 | 'active_field' => [ |
| 916 | 918 | 'disable' => false, |
| 917 | 919 | ], |
| @@ -935,9 +937,9 @@ | ||
| 935 | 937 | 'plugin' => 'woo-product-variation-gallery/woo-product-variation-gallery.php', |
| 936 | 938 | ], |
| 937 | 939 | admin_url( 'plugins.php' ) |
| 938 | 940 | ), |
| 939 | - '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' ), | |
| 940 | 942 | 'package' => 'free', |
| 941 | 943 | 'active_field' => [ |
| 942 | 944 | 'disable' => false, |
| 943 | 945 | ], |
| @@ -955,9 +957,9 @@ | ||
| 955 | 957 | 'label' => esc_html__( 'Enable Mini Cart?', 'shopbuilder' ), |
| 956 | 958 | 'help' => esc_html__( 'Switch on to enable mini cart module.', 'shopbuilder' ), |
| 957 | 959 | ], |
| 958 | 960 | 'is_active' => true, |
| 959 | - 'fields' => [], | |
| 961 | + 'fields' => Fns::pro_version_notice( '1.0.0' ), | |
| 960 | 962 | ] |
| 961 | 963 | ), |
| 962 | 964 | 'product_size_chart' => apply_filters( |
| 963 | 965 | 'rtsb/module/product_size_chart/options', |
| @@ -969,9 +971,9 @@ | ||
| 969 | 971 | 'active_field' => [ |
| 970 | 972 | 'label' => esc_html__( 'Enable Product Size Chart?', 'shopbuilder' ), |
| 971 | 973 | 'help' => esc_html__( 'Switch on to enable Product Size Chart module.', 'shopbuilder' ), |
| 972 | 974 | ], |
| 973 | - 'fields' => [], | |
| 975 | + 'fields' => Fns::pro_version_notice( '1.0.0' ), | |
| 974 | 976 | ] |
| 975 | 977 | ), |
| 976 | 978 | 'product_badges' => apply_filters( |
| 977 | 979 | 'rtsb/module/product_badges/options', |
| @@ -978,14 +980,26 @@ | ||
| 978 | 980 | [ |
| 979 | 981 | 'id' => 'product_badges', |
| 980 | 982 | 'active' => '', |
| 981 | 983 | 'title' => esc_html__( 'Product Badges', 'shopbuilder' ), |
| 982 | - 'package' => $this->pro_package(), | |
| 984 | + 'package' => 'free', | |
| 983 | 985 | 'active_field' => [ |
| 984 | 986 | 'label' => esc_html__( 'Enable Product Badges?', 'shopbuilder' ), |
| 985 | 987 | 'help' => esc_html__( 'Switch on to enable product badges module.', 'shopbuilder' ), |
| 986 | 988 | ], |
| 987 | - '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 | + ], | |
| 988 | 1002 | ] |
| 989 | 1003 | ), |
| 990 | 1004 | 'customize_my_account' => apply_filters( |
| 991 | 1005 | 'rtsb/module/customize_my_account/options', |
| @@ -997,9 +1011,9 @@ | ||
| 997 | 1011 | 'active_field' => [ |
| 998 | 1012 | 'label' => esc_html__( 'Enable Customize My Account?', 'shopbuilder' ), |
| 999 | 1013 | 'help' => esc_html__( 'Switch on to enable customize my account module.', 'shopbuilder' ), |
| 1000 | 1014 | ], |
| 1001 | - 'fields' => [], | |
| 1015 | + 'fields' => Fns::pro_version_notice( '1.4.0' ), | |
| 1002 | 1016 | ] |
| 1003 | 1017 | ), |
| 1004 | 1018 | 'pre_order' => apply_filters( |
| 1005 | 1019 | 'rtsb/module/pre_order/options', |
| @@ -1011,9 +1025,9 @@ | ||
| 1011 | 1025 | 'active_field' => [ |
| 1012 | 1026 | 'label' => esc_html__( 'Enable Pre-Order?', 'shopbuilder' ), |
| 1013 | 1027 | 'help' => esc_html__( 'Switch on to enable pre-order module.', 'shopbuilder' ), |
| 1014 | 1028 | ], |
| 1015 | - 'fields' => [], | |
| 1029 | + 'fields' => Fns::pro_version_notice( '1.5.0' ), | |
| 1016 | 1030 | ] |
| 1017 | 1031 | ), |
| 1018 | 1032 | 'currency_switcher' => apply_filters( |
| 1019 | 1033 | 'rtsb/module/currency_switcher/options', |
| @@ -1026,9 +1040,9 @@ | ||
| 1026 | 1040 | 'label' => esc_html__( 'Enable Currency Switcher?', 'shopbuilder' ), |
| 1027 | 1041 | 'help' => esc_html__( 'Switch on to enable currency switcher module.', 'shopbuilder' ), |
| 1028 | 1042 | ], |
| 1029 | 1043 | 'is_active' => true, |
| 1030 | - 'fields' => [], | |
| 1044 | + 'fields' => Fns::pro_version_notice( '1.5.0' ), | |
| 1031 | 1045 | ] |
| 1032 | 1046 | ), |
| 1033 | 1047 | 'product_add_ons' => apply_filters( |
| 1034 | 1048 | 'rtsb/module/product_add_ons/options', |
| @@ -1041,9 +1055,9 @@ | ||
| 1041 | 1055 | 'label' => esc_html__( 'Enable Product Add-Ons?', 'shopbuilder' ), |
| 1042 | 1056 | 'help' => esc_html__( 'Switch on to enable product add-ons module.', 'shopbuilder' ), |
| 1043 | 1057 | ], |
| 1044 | 1058 | 'is_active' => true, |
| 1045 | - 'fields' => [], | |
| 1059 | + 'fields' => Fns::pro_version_notice( '1.6.0' ), | |
| 1046 | 1060 | ] |
| 1047 | 1061 | ), |
| 1048 | 1062 | // Checkout Fields Manager. |
| 1049 | 1063 | 'checkout_fields_editor' => apply_filters( |
| @@ -1215,9 +1229,9 @@ | ||
| 1215 | 1229 | 'active_field' => [ |
| 1216 | 1230 | 'label' => esc_html__( 'Enable Sales Notification?', 'shopbuilder' ), |
| 1217 | 1231 | 'help' => esc_html__( 'Switch on to enable Sales Notification module.', 'shopbuilder' ), |
| 1218 | 1232 | ], |
| 1219 | - 'fields' => [], | |
| 1233 | + 'fields' => Fns::pro_version_notice( '1.0.0' ), | |
| 1220 | 1234 | ] |
| 1221 | 1235 | ), |
| 1222 | 1236 | 'flash_sale_countdown' => apply_filters( |
| 1223 | 1237 | 'rtsb/module/flash_sale_countdown/options', |
| @@ -1229,9 +1243,9 @@ | ||
| 1229 | 1243 | 'active_field' => [ |
| 1230 | 1244 | 'label' => esc_html__( 'Enable Flash Sale Countdown?', 'shopbuilder' ), |
| 1231 | 1245 | 'help' => esc_html__( 'Switch on to enable Flash Sale Countdown module.', 'shopbuilder' ), |
| 1232 | 1246 | ], |
| 1233 | - 'fields' => [], | |
| 1247 | + 'fields' => Fns::pro_version_notice( '1.0.0' ), | |
| 1234 | 1248 | ] |
| 1235 | 1249 | ), |
| 1236 | 1250 | 'quick_checkout' => apply_filters( |
| 1237 | 1251 | 'rtsb/module/quick_checkout/options', |
| @@ -1243,9 +1257,9 @@ | ||
| 1243 | 1257 | 'active_field' => [ |
| 1244 | 1258 | 'label' => esc_html__( 'Enable Quick Checkout?', 'shopbuilder' ), |
| 1245 | 1259 | 'help' => esc_html__( 'Switch on to enable quick checkout module. Note: Currently, this is not suitable for variable products.', 'shopbuilder' ), |
| 1246 | 1260 | ], |
| 1247 | - 'fields' => [], | |
| 1261 | + 'fields' => Fns::pro_version_notice( '1.1.0' ), | |
| 1248 | 1262 | ] |
| 1249 | 1263 | ), |
| 1250 | 1264 | 'multi_step_checkout' => apply_filters( |
| 1251 | 1265 | 'rtsb/module/multi_step_checkout/options', |
| @@ -1257,9 +1271,9 @@ | ||
| 1257 | 1271 | 'active_field' => [ |
| 1258 | 1272 | 'label' => esc_html__( 'Enable Multi-Step Checkout?', 'shopbuilder' ), |
| 1259 | 1273 | 'help' => esc_html__( 'Switch on to enable Multi-step Checkout module.', 'shopbuilder' ), |
| 1260 | 1274 | ], |
| 1261 | - 'fields' => [], | |
| 1275 | + 'fields' => Fns::pro_version_notice( '1.0.0' ), | |
| 1262 | 1276 | ] |
| 1263 | 1277 | ), |
| 1264 | 1278 | 'back_order' => apply_filters( |
| 1265 | 1279 | 'rtsb/module/back_order/options', |
| @@ -1271,9 +1285,9 @@ | ||
| 1271 | 1285 | 'active_field' => [ |
| 1272 | 1286 | 'label' => esc_html__( 'Enable Back-Order?', 'shopbuilder' ), |
| 1273 | 1287 | 'help' => esc_html__( 'Switch on to enable back-order module.', 'shopbuilder' ), |
| 1274 | 1288 | ], |
| 1275 | - 'fields' => [], | |
| 1289 | + 'fields' => Fns::pro_version_notice( '1.3.0' ), | |
| 1276 | 1290 | ] |
| 1277 | 1291 | ), |
| 1278 | 1292 | 'sticky_add_to_cart' => apply_filters( |
| 1279 | 1293 | 'rtsb/module/sticky_add_to_cart/options', |
| @@ -1285,11 +1299,811 @@ | ||
| 1285 | 1299 | 'active_field' => [ |
| 1286 | 1300 | 'label' => esc_html__( 'Enable Sticky Add-To-Cart?', 'shopbuilder' ), |
| 1287 | 1301 | 'help' => esc_html__( 'Switch on to enable sticky add-to-cart module.', 'shopbuilder' ), |
| 1288 | 1302 | ], |
| 1289 | - 'fields' => [], | |
| 1303 | + 'fields' => Fns::pro_version_notice( '1.6.0' ), | |
| 1290 | 1304 | ] |
| 1291 | 1305 | ), |
| 1292 | 1306 | ]; |
| 1293 | 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><?php do_action( 'rtsb/modules/product_badges/frontend/display' ); ?></code> OR Use shortcode <code><?php echo do_shortcode( '[rtsb_badges]' ); ?></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><?php do_action( 'rtsb/modules/product_badges/frontend/display' ); ?></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; | |
| 1294 | 2108 | } |
| 1295 | 2109 | } |