← All changes
|
app/Elementor/Widgets/Controls/SettingsFields.php
+224
-43
2.2.2
→
3.2.6
View file →
| @@ -10,8 +10,9 @@ | ||
| 10 | 10 | namespace RadiusTheme\SB\Elementor\Widgets\Controls; |
| 11 | 11 | |
| 12 | 12 | use RadiusTheme\SB\Helpers\Fns; |
| 13 | 13 | use RadiusTheme\SB\Elementor\Helper\ControlHelper; |
| 14 | +use RadiusTheme\SB\Modules\VariationSwatches\SwatchesFns; | |
| 14 | 15 | |
| 15 | 16 | // Do not allow directly accessing this file. |
| 16 | 17 | if ( ! defined( 'ABSPATH' ) ) { |
| 17 | 18 | exit( 'This script cannot be accessed directly.' ); |
| @@ -98,9 +99,28 @@ | ||
| 98 | 99 | 'label_on' => esc_html__( 'On', 'shopbuilder' ), |
| 99 | 100 | 'label_off' => esc_html__( 'Off', 'shopbuilder' ), |
| 100 | 101 | 'condition' => [ 'layout!' => [ 'grid-layout2', 'slider-layout2' ] ], |
| 101 | 102 | ]; |
| 102 | - | |
| 103 | + $fields['show_brands'] = [ | |
| 104 | + 'type' => 'switch', | |
| 105 | + 'label' => esc_html__( 'Show Product Brand?', 'shopbuilder' ), | |
| 106 | + 'description' => esc_html__( 'Switch on to show product brand.', 'shopbuilder' ), | |
| 107 | + 'label_on' => esc_html__( 'On', 'shopbuilder' ), | |
| 108 | + 'label_off' => esc_html__( 'Off', 'shopbuilder' ), | |
| 109 | + 'condition' => [ 'layout!' => [ 'grid-layout2', 'slider-layout2' ] ], | |
| 110 | + ]; | |
| 111 | + $fields['single_brand'] = [ | |
| 112 | + 'type' => 'switch', | |
| 113 | + 'label' => esc_html__( 'Show Only First Brand?', 'shopbuilder' ), | |
| 114 | + 'description' => esc_html__( 'Switch on to show only the first brand.', 'shopbuilder' ), | |
| 115 | + 'label_on' => esc_html__( 'On', 'shopbuilder' ), | |
| 116 | + 'label_off' => esc_html__( 'Off', 'shopbuilder' ), | |
| 117 | + 'default' => 'yes', | |
| 118 | + 'condition' => [ | |
| 119 | + 'show_brands' => [ 'yes' ], | |
| 120 | + 'layout!' => [ 'grid-layout2', 'slider-layout2' ], | |
| 121 | + ], | |
| 122 | + ]; | |
| 103 | 123 | $fields['single_category'] = [ |
| 104 | 124 | 'type' => 'switch', |
| 105 | 125 | 'label' => esc_html__( 'Show Only First Category?', 'shopbuilder' ), |
| 106 | 126 | 'description' => esc_html__( 'Switch on to show only the first category.', 'shopbuilder' ), |
| @@ -111,9 +131,33 @@ | ||
| 111 | 131 | 'show_categories' => [ 'yes' ], |
| 112 | 132 | 'layout!' => [ 'grid-layout2', 'slider-layout2' ], |
| 113 | 133 | ], |
| 114 | 134 | ]; |
| 135 | + if ( function_exists( 'rtwpvsp' ) || ( Fns::is_module_active( 'variation_swatches' ) && 'on' === SwatchesFns::get_options( 'enable_showcase_swatches' ) ) ) { | |
| 136 | + $fields['show_swatches'] = [ | |
| 137 | + 'type' => 'switch', | |
| 138 | + 'label' => esc_html__( 'Show Variation Swatches?', 'shopbuilder' ), | |
| 139 | + 'description' => esc_html__( 'Switch on to show variation swatches.', 'shopbuilder' ), | |
| 140 | + 'label_on' => esc_html__( 'On', 'shopbuilder' ), | |
| 141 | + 'label_off' => esc_html__( 'Off', 'shopbuilder' ), | |
| 142 | + 'default' => 'yes', | |
| 143 | + 'condition' => [ 'layout!' => [ 'grid-layout2', 'slider-layout2' ] ], | |
| 144 | + ]; | |
| 115 | 145 | |
| 146 | + $fields['show_vs_clear_btn'] = [ | |
| 147 | + 'type' => 'switch', | |
| 148 | + 'label' => esc_html__( 'Show Swatches Reset?', 'shopbuilder' ), | |
| 149 | + 'description' => esc_html__( 'Switch on to show swatches clear button.', 'shopbuilder' ), | |
| 150 | + 'label_on' => esc_html__( 'On', 'shopbuilder' ), | |
| 151 | + 'label_off' => esc_html__( 'Off', 'shopbuilder' ), | |
| 152 | + 'separator' => 'default', | |
| 153 | + 'condition' => [ | |
| 154 | + 'show_swatches' => [ 'yes' ], | |
| 155 | + 'layout!' => [ 'grid-layout2', 'slider-layout2' ], | |
| 156 | + ], | |
| 157 | + ]; | |
| 158 | + } | |
| 159 | + | |
| 116 | 160 | $fields['action_btn_visibility'] = $obj->el_heading( esc_html__( 'Action Buttons Visibility', 'shopbuilder' ), 'before' ); |
| 117 | 161 | |
| 118 | 162 | $fields['show_add_to_cart'] = [ |
| 119 | 163 | 'type' => 'switch', |
| @@ -160,9 +204,8 @@ | ||
| 160 | 204 | ]; |
| 161 | 205 | } |
| 162 | 206 | |
| 163 | 207 | $fields['visibility_section_end'] = $obj->end_section(); |
| 164 | - | |
| 165 | 208 | return apply_filters( 'rtsb/elements/elementor/visibility_control', $fields, $obj ); |
| 166 | 209 | } |
| 167 | 210 | |
| 168 | 211 | /** |
| @@ -221,9 +264,8 @@ | ||
| 221 | 264 | [], |
| 222 | 265 | [ 'show_add_to_cart' => [ 'yes' ] ] |
| 223 | 266 | ); |
| 224 | 267 | |
| 225 | - // TODO:: Variable product button text change option. | |
| 226 | 268 | $fields['show_cart_text'] = [ |
| 227 | 269 | 'type' => 'switch', |
| 228 | 270 | 'label' => esc_html__( 'Show Add to Cart Text?', 'shopbuilder' ), |
| 229 | 271 | 'description' => esc_html__( 'Switch on to show add to cart text.', 'shopbuilder' ), |
| @@ -526,15 +568,30 @@ | ||
| 526 | 568 | 'type' => 'switch', |
| 527 | 569 | 'label' => esc_html__( 'Activate Product Image Gallery Slider', 'shopbuilder' ), |
| 528 | 570 | 'description' => esc_html__( 'Switch on to display product image gallery slider.', 'shopbuilder' ), |
| 529 | 571 | 'classes' => $obj->pro_class(), |
| 530 | - 'condition' => [ 'show_featured_image' => [ 'yes' ] ], | |
| 572 | + 'condition' => [ | |
| 573 | + 'show_featured_image' => [ 'yes' ], | |
| 574 | + 'grid_style!' => [ 'masonry' ], | |
| 575 | + ], | |
| 531 | 576 | ]; |
| 532 | 577 | |
| 578 | + $fields['show_product_gallery_thumb'] = [ | |
| 579 | + 'type' => 'switch', | |
| 580 | + 'label' => esc_html__( 'Activate Image Gallery Thumbnail', 'shopbuilder' ), | |
| 581 | + 'description' => esc_html__( 'Switch on to display product image gallery thumbnail slider.', 'shopbuilder' ), | |
| 582 | + 'classes' => $obj->pro_class(), | |
| 583 | + 'condition' => [ | |
| 584 | + 'show_featured_image' => [ 'yes' ], | |
| 585 | + 'show_product_gallery' => [ 'yes' ], | |
| 586 | + 'grid_style!' => [ 'masonry' ], | |
| 587 | + ], | |
| 588 | + ]; | |
| 589 | + | |
| 533 | 590 | $fields['show_hover_image'] = [ |
| 534 | 591 | 'type' => 'switch', |
| 535 | 592 | 'label' => esc_html__( 'Display Gallery Image on Hover?', 'shopbuilder' ), |
| 536 | - 'description' => __( 'Switch on to display gallery image on hover. <br /><b>Note: </b>It will display the first gallery image on hover.', 'shopbuilder' ) . ( function_exists( 'rtwpvsp' ) ? esc_html__( ' It will not work if variation swatches are enabled.', 'shopbuilder' ) : '' ), | |
| 593 | + 'description' => __( 'Switch on to display gallery image on hover. <br /><b>Note: </b>It will display the first gallery image on hover.', 'shopbuilder' ) . ( ( function_exists( 'rtwpvsp' ) || rtsb()->has_pro() ) ? esc_html__( ' It will not work if variation swatches are enabled.', 'shopbuilder' ) : '' ), | |
| 537 | 594 | 'label_on' => esc_html__( 'On', 'shopbuilder' ), |
| 538 | 595 | 'label_off' => esc_html__( 'Off', 'shopbuilder' ), |
| 539 | 596 | 'separator' => rtsb()->has_pro() ? 'default' : 'before-short', |
| 540 | 597 | 'default' => 'yes', |
| @@ -563,9 +620,9 @@ | ||
| 563 | 620 | 'type' => 'select2', |
| 564 | 621 | 'label' => esc_html__( 'Gallery Image Hover Animation', 'shopbuilder' ), |
| 565 | 622 | 'description' => esc_html__( 'Please choose gallery image hover animation.', 'shopbuilder' ), |
| 566 | 623 | 'options' => [ |
| 567 | - 'fade' => esc_html__( 'Fade', 'shopbuilder' ), | |
| 624 | + 'fade' => esc_html__( 'Default (Fade)', 'shopbuilder' ), | |
| 568 | 625 | 'slide' => esc_html__( 'Slide Up', 'shopbuilder' ), |
| 569 | 626 | 'slide-down' => esc_html__( 'Slide Down', 'shopbuilder' ), |
| 570 | 627 | 'slide-left' => esc_html__( 'Slide Left', 'shopbuilder' ), |
| 571 | 628 | 'slide-right' => esc_html__( 'Slide Right', 'shopbuilder' ), |
| @@ -591,10 +648,65 @@ | ||
| 591 | 648 | ); |
| 592 | 649 | |
| 593 | 650 | $fields = array_merge( $fields, self::image_size_controls( 'grid' ) ); |
| 594 | 651 | |
| 595 | - $fields['image_section_end'] = $obj->end_section(); | |
| 652 | + $fields['thumb_image_note'] = $obj->el_heading( | |
| 653 | + esc_html__( 'Thumbnail Slider', 'shopbuilder' ), | |
| 654 | + 'before', | |
| 655 | + [], | |
| 656 | + [ | |
| 657 | + 'show_featured_image' => [ 'yes' ], | |
| 658 | + 'show_product_gallery' => [ 'yes' ], | |
| 659 | + 'show_product_gallery_thumb' => [ 'yes' ], | |
| 660 | + 'grid_style!' => [ 'masonry' ], | |
| 661 | + ], | |
| 662 | + ); | |
| 663 | + $fields['gallery_thumb_column_number'] = [ | |
| 664 | + 'label' => esc_html__( 'Gallery Thumb Image Column', 'shopbuilder' ), | |
| 665 | + 'classes' => $obj->pro_class(), | |
| 666 | + 'type' => 'slider', | |
| 667 | + 'size_units' => [ 'px' ], | |
| 668 | + 'range' => [ | |
| 669 | + 'px' => [ | |
| 670 | + 'min' => 2, | |
| 671 | + 'max' => 10, | |
| 672 | + 'step' => 1, | |
| 673 | + ], | |
| 674 | + ], | |
| 675 | + 'default' => [ | |
| 676 | + 'size' => 3, | |
| 677 | + ], | |
| 678 | + 'condition' => [ | |
| 679 | + 'show_featured_image' => [ 'yes' ], | |
| 680 | + 'show_product_gallery' => [ 'yes' ], | |
| 681 | + 'show_product_gallery_thumb' => [ 'yes' ], | |
| 682 | + 'grid_style!' => [ 'masonry' ], | |
| 683 | + ], | |
| 684 | + ]; | |
| 685 | + $fields['gallery_thumb_column_gap'] = [ | |
| 686 | + 'label' => esc_html__( 'Gallery Thumb Column Gap', 'shopbuilder' ), | |
| 687 | + 'classes' => $obj->pro_class(), | |
| 688 | + 'type' => 'slider', | |
| 689 | + 'size_units' => [ 'px' ], | |
| 690 | + 'range' => [ | |
| 691 | + 'px' => [ | |
| 692 | + 'min' => 2, | |
| 693 | + 'max' => 30, | |
| 694 | + 'step' => 1, | |
| 695 | + ], | |
| 696 | + ], | |
| 697 | + 'default' => [ | |
| 698 | + 'size' => 10, | |
| 699 | + ], | |
| 700 | + 'condition' => [ | |
| 701 | + 'show_featured_image' => [ 'yes' ], | |
| 702 | + 'show_product_gallery' => [ 'yes' ], | |
| 703 | + 'show_product_gallery_thumb' => [ 'yes' ], | |
| 704 | + 'grid_style!' => [ 'masonry' ], | |
| 705 | + ], | |
| 706 | + ]; | |
| 596 | 707 | |
| 708 | + $fields['thumb_image_section_end'] = $obj->end_section(); | |
| 597 | 709 | return $fields; |
| 598 | 710 | } |
| 599 | 711 | |
| 600 | 712 | /** |
| @@ -985,9 +1097,9 @@ | ||
| 985 | 1097 | [], |
| 986 | 1098 | $condition |
| 987 | 1099 | ); |
| 988 | 1100 | |
| 989 | - $fields['title_tag'] = [ | |
| 1101 | + $fields['title_tag'] = [ | |
| 990 | 1102 | 'type' => 'select2', |
| 991 | 1103 | 'label' => esc_html__( 'Product Title Tag', 'shopbuilder' ), |
| 992 | 1104 | 'options' => ControlHelper::heading_tags(), |
| 993 | 1105 | 'label_block' => true, |
| @@ -993,18 +1105,8 @@ | ||
| 993 | 1105 | 'label_block' => true, |
| 994 | 1106 | 'default' => 'h3', |
| 995 | 1107 | 'description' => esc_html__( 'Please select the product title tag.', 'shopbuilder' ), |
| 996 | 1108 | ]; |
| 997 | - | |
| 998 | - // TODO: Will be activated later. | |
| 999 | - // $fields['title_hover'] = [ | |
| 1000 | - // 'type' => 'switch', | |
| 1001 | - // 'label' => esc_html__( 'Title Hover Underline', 'shopbuilder' ), | |
| 1002 | - // 'default' => 200, | |
| 1003 | - // 'description' => esc_html__( 'Switch on to enable title hover underline.', 'shopbuilder' ), | |
| 1004 | - // 'classes' => $obj->pro_class(), | |
| 1005 | - // ]; | |
| 1006 | - | |
| 1007 | 1109 | $fields['title_limit'] = [ |
| 1008 | 1110 | 'type' => 'select2', |
| 1009 | 1111 | 'label' => esc_html__( 'Product Title Limit', 'shopbuilder' ), |
| 1010 | 1112 | 'options' => [ |
| @@ -1298,12 +1400,11 @@ | ||
| 1298 | 1400 | * |
| 1299 | 1401 | * @return array |
| 1300 | 1402 | */ |
| 1301 | 1403 | public static function variation_swatch( $obj ) { |
| 1302 | - if ( ! function_exists( 'rtwpvsp' ) ) { | |
| 1404 | + if ( ! function_exists( 'rtwpvsp' ) && ! rtsb()->has_pro() ) { | |
| 1303 | 1405 | return []; |
| 1304 | 1406 | } |
| 1305 | - | |
| 1306 | 1407 | $condition = [ |
| 1307 | 1408 | 'show_swatches' => [ 'yes' ], |
| 1308 | 1409 | ]; |
| 1309 | 1410 | |
| @@ -1325,21 +1426,21 @@ | ||
| 1325 | 1426 | ], |
| 1326 | 1427 | 'label_block' => true, |
| 1327 | 1428 | 'default' => 'top', |
| 1328 | 1429 | ]; |
| 1329 | - | |
| 1330 | - $fields['swatch_type'] = [ | |
| 1331 | - 'type' => 'select2', | |
| 1332 | - 'label' => esc_html__( 'Swatches Type', 'shopbuilder' ), | |
| 1333 | - 'description' => esc_html__( 'Please select the variation swatches display type (only work with color swatch).', 'shopbuilder' ), | |
| 1334 | - 'options' => [ | |
| 1335 | - 'square' => esc_html__( 'Square', 'shopbuilder' ), | |
| 1336 | - 'circle' => esc_html__( 'Circle', 'shopbuilder' ), | |
| 1337 | - ], | |
| 1338 | - 'label_block' => true, | |
| 1339 | - 'default' => 'circle', | |
| 1340 | - ]; | |
| 1341 | - | |
| 1430 | + if ( function_exists( 'rtwpvsp' ) ) { | |
| 1431 | + $fields['swatch_type'] = [ | |
| 1432 | + 'type' => 'select2', | |
| 1433 | + 'label' => esc_html__( 'Color Swatches Type', 'shopbuilder' ), | |
| 1434 | + 'description' => esc_html__( 'Please select the variation swatches display type (only work with color swatch).', 'shopbuilder' ), | |
| 1435 | + 'options' => [ | |
| 1436 | + 'square' => esc_html__( 'Square', 'shopbuilder' ), | |
| 1437 | + 'circle' => esc_html__( 'Circle', 'shopbuilder' ), | |
| 1438 | + ], | |
| 1439 | + 'label_block' => true, | |
| 1440 | + 'default' => 'circle', | |
| 1441 | + ]; | |
| 1442 | + } | |
| 1342 | 1443 | $fields['swatch_margin'] = [ |
| 1343 | 1444 | 'mode' => 'responsive', |
| 1344 | 1445 | 'type' => 'dimensions', |
| 1345 | 1446 | 'label' => esc_html__( 'Margin', 'shopbuilder' ), |
| @@ -1364,20 +1465,90 @@ | ||
| 1364 | 1465 | 'show_badges' => [ 'yes' ], |
| 1365 | 1466 | 'layout!' => [ 'category-layout1', 'category-layout2' ], |
| 1366 | 1467 | ]; |
| 1367 | 1468 | |
| 1368 | - $fields['badges_section'] = $obj->start_section( | |
| 1469 | + $fields['badges_section'] = $obj->start_section( | |
| 1369 | 1470 | esc_html__( 'Badges', 'shopbuilder' ), |
| 1370 | 1471 | self::$tab, |
| 1371 | 1472 | [], |
| 1372 | 1473 | $condition |
| 1373 | 1474 | ); |
| 1475 | + $fields['enable_badges_module'] = [ | |
| 1476 | + 'type' => 'switch', | |
| 1477 | + 'label' => esc_html__( 'Enable Badges Module?', 'shopbuilder' ), | |
| 1478 | + 'description' => esc_html__( 'Switch on to integrate Badge module.', 'shopbuilder' ), | |
| 1479 | + 'label_on' => esc_html__( 'On', 'shopbuilder' ), | |
| 1480 | + 'label_off' => esc_html__( 'Off', 'shopbuilder' ), | |
| 1481 | + 'condition' => [ 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ] ], | |
| 1482 | + ]; | |
| 1483 | + $fields['badges_module_notice'] = [ | |
| 1484 | + 'type' => 'html', | |
| 1485 | + 'raw' => sprintf( | |
| 1486 | + '<span style="display: block; background: #fffbf1; padding: 10px; line-height: 1.4; color: #bd3a3a; border: 1px solid #bd3a3a30;">%s</span>', | |
| 1487 | + sprintf( | |
| 1488 | + /* translators: 1: link to the Modules page */ | |
| 1489 | + __( | |
| 1490 | + '<b>Note:</b> Badges Module needs to be enabled in the <a href="%1$s" target="_blank">ShopBuilder Modules Settings</a>. From there you can create and customize different badges.', | |
| 1491 | + 'shopbuilder' | |
| 1492 | + ), | |
| 1493 | + esc_url( admin_url( 'admin.php?page=rtsb-settings' ) ) | |
| 1494 | + ) | |
| 1495 | + ), | |
| 1496 | + 'separator' => rtsb()->has_pro() ? 'default' : 'after', | |
| 1497 | + 'condition' => [ 'enable_badges_module' => [ 'yes' ] ], | |
| 1498 | + ]; | |
| 1374 | 1499 | |
| 1500 | + $fields['badges_module_direction'] = [ | |
| 1501 | + 'type' => 'select', | |
| 1502 | + 'options' => [ | |
| 1503 | + 'row' => esc_html__( 'Horizontal', 'shopbuilder' ), | |
| 1504 | + 'column' => esc_html__( 'Vertical', 'shopbuilder' ), | |
| 1505 | + ], | |
| 1506 | + 'label' => esc_html__( 'Group Badge Direction', 'shopbuilder' ), | |
| 1507 | + 'description' => esc_html__( 'Please choose the group badge direction.', 'shopbuilder' ), | |
| 1508 | + 'condition' => [ 'enable_badges_module' => [ 'yes' ] ], | |
| 1509 | + 'default' => 'row', | |
| 1510 | + 'label_block' => true, | |
| 1511 | + 'classes' => $obj->pro_class(), | |
| 1512 | + 'separator' => rtsb()->has_pro() ? 'before-short' : 'default', | |
| 1513 | + 'selectors' => [ | |
| 1514 | + $obj->selectors['badges_module']['direction'] => 'flex-direction: {{VALUE}} !important;', | |
| 1515 | + ], | |
| 1516 | + ]; | |
| 1517 | + | |
| 1518 | + $fields['badges_module_alignment'] = [ | |
| 1519 | + 'type' => 'choose', | |
| 1520 | + 'options' => [ | |
| 1521 | + 'start' => [ | |
| 1522 | + 'title' => esc_html__( 'Left', 'shopbuilder' ), | |
| 1523 | + 'icon' => 'eicon-text-align-left', | |
| 1524 | + ], | |
| 1525 | + 'center' => [ | |
| 1526 | + 'title' => esc_html__( 'Center', 'shopbuilder' ), | |
| 1527 | + 'icon' => 'eicon-text-align-center', | |
| 1528 | + ], | |
| 1529 | + 'end' => [ | |
| 1530 | + 'title' => esc_html__( 'Right', 'shopbuilder' ), | |
| 1531 | + 'icon' => 'eicon-text-align-right', | |
| 1532 | + ], | |
| 1533 | + ], | |
| 1534 | + 'label' => esc_html__( 'Group Badge Alignment', 'shopbuilder' ), | |
| 1535 | + 'description' => esc_html__( 'Please choose the group badge alignment.', 'shopbuilder' ), | |
| 1536 | + 'condition' => [ 'enable_badges_module' => [ 'yes' ] ], | |
| 1537 | + 'default' => 'start', | |
| 1538 | + 'separator' => rtsb()->has_pro() ? 'default' : 'before', | |
| 1539 | + 'label_block' => true, | |
| 1540 | + 'selectors' => [ | |
| 1541 | + $obj->selectors['badges_module']['alignment'] => 'align-items: {{VALUE}} !important;', | |
| 1542 | + ], | |
| 1543 | + ]; | |
| 1544 | + | |
| 1375 | 1545 | $fields['custom_badge_preset'] = [ |
| 1376 | - 'type' => 'rtsb-image-selector', | |
| 1377 | - 'label' => esc_html__( 'Custom Badge Appearance', 'shopbuilder' ), | |
| 1378 | - 'options' => ControlHelper::badge_presets(), | |
| 1379 | - 'default' => 'preset1', | |
| 1546 | + 'type' => 'rtsb-image-selector', | |
| 1547 | + 'label' => esc_html__( 'Custom Badge Appearance', 'shopbuilder' ), | |
| 1548 | + 'options' => ControlHelper::badge_presets(), | |
| 1549 | + 'default' => 'preset1', | |
| 1550 | + 'condition' => [ 'enable_badges_module!' => [ 'yes' ] ], | |
| 1380 | 1551 | ]; |
| 1381 | 1552 | |
| 1382 | 1553 | $fields['sale_badges_type'] = [ |
| 1383 | 1554 | 'type' => 'select2', |
| @@ -1388,9 +1559,12 @@ | ||
| 1388 | 1559 | 'text' => esc_html__( 'Show Sale Text', 'shopbuilder' ), |
| 1389 | 1560 | ], |
| 1390 | 1561 | 'default' => 'percentage', |
| 1391 | 1562 | 'label_block' => true, |
| 1392 | - 'condition' => [ 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ] ], | |
| 1563 | + 'condition' => [ | |
| 1564 | + 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ], | |
| 1565 | + 'enable_badges_module!' => [ 'yes' ], | |
| 1566 | + ], | |
| 1393 | 1567 | ]; |
| 1394 | 1568 | |
| 1395 | 1569 | $fields['sale_badges_text'] = [ |
| 1396 | 1570 | 'type' => 'text', |
| @@ -1398,10 +1572,11 @@ | ||
| 1398 | 1572 | 'default' => esc_html__( 'Sale', 'shopbuilder' ), |
| 1399 | 1573 | 'description' => esc_html__( 'Please enter the sale badge text.', 'shopbuilder' ), |
| 1400 | 1574 | 'label_block' => true, |
| 1401 | 1575 | 'condition' => [ |
| 1402 | - 'sale_badges_type' => [ 'text' ], | |
| 1403 | - 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ], | |
| 1576 | + 'sale_badges_type' => [ 'text' ], | |
| 1577 | + 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ], | |
| 1578 | + 'enable_badges_module!' => [ 'yes' ], | |
| 1404 | 1579 | ], |
| 1405 | 1580 | ]; |
| 1406 | 1581 | |
| 1407 | 1582 | $fields['stock_badges_text'] = [ |
| @@ -1409,9 +1584,12 @@ | ||
| 1409 | 1584 | 'label' => esc_html__( 'Out of Stock Badge Text', 'shopbuilder' ), |
| 1410 | 1585 | 'default' => esc_html__( 'Out of Stock', 'shopbuilder' ), |
| 1411 | 1586 | 'description' => esc_html__( 'Please enter the out of stock badge text.', 'shopbuilder' ), |
| 1412 | 1587 | 'label_block' => true, |
| 1413 | - 'condition' => [ 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ] ], | |
| 1588 | + 'condition' => [ | |
| 1589 | + 'layout!' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2', 'category-layout3' ], | |
| 1590 | + 'enable_badges_module!' => [ 'yes' ], | |
| 1591 | + ], | |
| 1414 | 1592 | ]; |
| 1415 | 1593 | |
| 1416 | 1594 | $fields['custom_badge_text'] = [ |
| 1417 | 1595 | 'type' => 'text', |
| @@ -1418,9 +1596,12 @@ | ||
| 1418 | 1596 | 'label' => esc_html__( 'Custom Badge Text', 'shopbuilder' ), |
| 1419 | 1597 | 'description' => esc_html__( 'Please enter the custom badge text.', 'shopbuilder' ), |
| 1420 | 1598 | 'label_block' => true, |
| 1421 | 1599 | 'default' => esc_html__( 'Popular', 'shopbuilder' ), |
| 1422 | - 'condition' => [ 'layout' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2' ] ], | |
| 1600 | + 'condition' => [ | |
| 1601 | + 'layout' => [ 'category-single-layout1', 'category-single-layout2', 'category-layout1', 'category-layout2' ], | |
| 1602 | + 'enable_badges_module!' => [ 'yes' ], | |
| 1603 | + ], | |
| 1423 | 1604 | ]; |
| 1424 | 1605 | |
| 1425 | 1606 | $fields['badges_section_end'] = $obj->end_section(); |
| 1426 | 1607 | |