diff --git a/packages/js/product-editor/changelog/dev-46844_remove_not_used_feature_flags b/packages/js/product-editor/changelog/dev-46844_remove_not_used_feature_flags new file mode 100644 index 00000000000..956690365c6 --- /dev/null +++ b/packages/js/product-editor/changelog/dev-46844_remove_not_used_feature_flags @@ -0,0 +1,4 @@ +Significance: minor +Type: dev + +Remove not used feature flags #47150 diff --git a/packages/js/product-editor/src/components/variations-table/shipping-menu-item/shipping-menu-item.tsx b/packages/js/product-editor/src/components/variations-table/shipping-menu-item/shipping-menu-item.tsx index 150d118f76b..f2943330144 100644 --- a/packages/js/product-editor/src/components/variations-table/shipping-menu-item/shipping-menu-item.tsx +++ b/packages/js/product-editor/src/components/variations-table/shipping-menu-item/shipping-menu-item.tsx @@ -63,41 +63,35 @@ export function ShippingMenuItem( { renderContent={ () => (
- { window.wcAdminFeatures[ - 'product-virtual-downloadable' - ] && ( - { - recordEvent( - 'product_variations_menu_shipping_select', - { - source: TRACKS_SOURCE, - action: 'toggle_shipping', - variation_id: ids, - } - ); - onChange( - selection.map( - ( { id, virtual } ) => ( { - id, - virtual: ! virtual, - } ) - ) - ); - recordEvent( - 'product_variations_menu_shipping_update', - { - source: TRACKS_SOURCE, - action: 'toggle_shipping', - variation_id: ids, - } - ); - onClose(); - } } - > - { __( 'Toggle shipping', 'woocommerce' ) } - - ) } + { + recordEvent( + 'product_variations_menu_shipping_select', + { + source: TRACKS_SOURCE, + action: 'toggle_shipping', + variation_id: ids, + } + ); + onChange( + selection.map( ( { id, virtual } ) => ( { + id, + virtual: ! virtual, + } ) ) + ); + recordEvent( + 'product_variations_menu_shipping_update', + { + source: TRACKS_SOURCE, + action: 'toggle_shipping', + variation_id: ids, + } + ); + onClose(); + } } + > + { __( 'Toggle shipping', 'woocommerce' ) } + { recordEvent( diff --git a/packages/js/product-editor/src/components/variations-table/variation-actions-menus/variation-actions.tsx b/packages/js/product-editor/src/components/variations-table/variation-actions-menus/variation-actions.tsx index 56d8f844e6a..2ce1d9bc8e7 100644 --- a/packages/js/product-editor/src/components/variations-table/variation-actions-menus/variation-actions.tsx +++ b/packages/js/product-editor/src/components/variations-table/variation-actions-menus/variation-actions.tsx @@ -120,14 +120,12 @@ export function VariationActions( { onClose={ onClose } supportsMultipleSelection={ supportsMultipleSelection } /> - { window.wcAdminFeatures[ 'product-virtual-downloadable' ] && ( - - ) } + ) => { - if ( ! window.wcAdminFeatures[ 'product-variation-management' ] ) { - return 'simple'; - } - const hasOptions = !! product.attributes?.find( ( attribute ) => attribute.options.length && attribute.variation ); diff --git a/plugins/woocommerce-admin/client/index.js b/plugins/woocommerce-admin/client/index.js index 7aeb7efa2e6..648b2d43978 100644 --- a/plugins/woocommerce-admin/client/index.js +++ b/plugins/woocommerce-admin/client/index.js @@ -97,19 +97,11 @@ if ( appRoot ) { } } -// Render the CustomerEffortScoreTracksContainer only if -// the feature flag is enabled. -if ( - window.wcAdminFeatures && - window.wcAdminFeatures[ 'customer-effort-score-tracks' ] === true -) { - // Set up customer effort score survey. - ( function () { - const root = appRoot || embeddedRoot; - - render( - , - root.insertBefore( document.createElement( 'div' ), null ) - ); - } )(); -} +// Set up customer effort score survey. +( function () { + const root = appRoot || embeddedRoot; + render( + , + root.insertBefore( document.createElement( 'div' ), null ) + ); +} )(); diff --git a/plugins/woocommerce-admin/client/layout/controller.js b/plugins/woocommerce-admin/client/layout/controller.js index e4781775af8..bbab48714ba 100644 --- a/plugins/woocommerce-admin/client/layout/controller.js +++ b/plugins/woocommerce-admin/client/layout/controller.js @@ -273,24 +273,22 @@ export const getPages = () => { } ); } - if ( window.wcAdminFeatures[ 'product-variation-management' ] ) { - pages.push( { - container: ProductVariationPage, - layout: { - header: false, - }, - path: '/product/:productId/variation/:variationId', - breadcrumbs: [ - [ '/edit-product', __( 'Product', 'woocommerce' ) ], - __( 'Edit Product Variation', 'woocommerce' ), - ], - navArgs: { - id: 'woocommerce-edit-product', - }, - wpOpenMenu: 'menu-posts-product', - capability: 'edit_products', - } ); - } + pages.push( { + container: ProductVariationPage, + layout: { + header: false, + }, + path: '/product/:productId/variation/:variationId', + breadcrumbs: [ + [ '/edit-product', __( 'Product', 'woocommerce' ) ], + __( 'Edit Product Variation', 'woocommerce' ), + ], + navArgs: { + id: 'woocommerce-edit-product', + }, + wpOpenMenu: 'menu-posts-product', + capability: 'edit_products', + } ); if ( window.wcAdminFeatures.onboarding ) { if ( ! window.wcAdminFeatures[ 'core-profiler' ] ) { diff --git a/plugins/woocommerce-admin/client/products/edit-product-page.tsx b/plugins/woocommerce-admin/client/products/edit-product-page.tsx index 98990fa974f..e1deddcd832 100644 --- a/plugins/woocommerce-admin/client/products/edit-product-page.tsx +++ b/plugins/woocommerce-admin/client/products/edit-product-page.tsx @@ -134,14 +134,12 @@ const EditProductPage: React.FC = () => {
) } - { window.wcAdminFeatures[ 'product-variation-management' ] && - productVariation && - product && ( - - ) } + { productVariation && product && ( + + ) } { ! isProductVariation && product && ( product.status !== 'trash' || wasDeletedUsingAction ) && ( diff --git a/plugins/woocommerce-admin/client/products/fills/product-form-fills.tsx b/plugins/woocommerce-admin/client/products/fills/product-form-fills.tsx index fa1c59c2d0f..2825d8a14a0 100644 --- a/plugins/woocommerce-admin/client/products/fills/product-form-fills.tsx +++ b/plugins/woocommerce-admin/client/products/fills/product-form-fills.tsx @@ -104,18 +104,16 @@ const Tabs = () => { fillProps={ { product } } /> - { window.wcAdminFeatures[ 'product-variation-management' ] ? ( - - <> - - - - ) : null } + + <> + + + ); }; diff --git a/plugins/woocommerce-admin/client/typings/global.d.ts b/plugins/woocommerce-admin/client/typings/global.d.ts index 01dc11b0300..1fbb8d51682 100644 --- a/plugins/woocommerce-admin/client/typings/global.d.ts +++ b/plugins/woocommerce-admin/client/typings/global.d.ts @@ -29,7 +29,6 @@ declare global { 'activity-panels': boolean; analytics: boolean; coupons: boolean; - 'customer-effort-score-tracks': boolean; homescreen: boolean; marketing: boolean; 'minified-js': boolean; @@ -39,11 +38,6 @@ declare global { onboarding: boolean; 'onboarding-tasks': boolean; 'payment-gateway-suggestions': boolean; - 'product-variation-management': boolean; - 'product-virtual-downloadable': boolean; - 'product-external-affiliate': boolean; - 'product-grouped': boolean; - 'product-linked': boolean; 'product-pre-publish-modal': boolean; 'product-custom-fields': boolean; 'remote-inbox-notifications': boolean; diff --git a/plugins/woocommerce-beta-tester/changelog/dev-46844_remove_not_used_feature_flags b/plugins/woocommerce-beta-tester/changelog/dev-46844_remove_not_used_feature_flags new file mode 100644 index 00000000000..956690365c6 --- /dev/null +++ b/plugins/woocommerce-beta-tester/changelog/dev-46844_remove_not_used_feature_flags @@ -0,0 +1,4 @@ +Significance: minor +Type: dev + +Remove not used feature flags #47150 diff --git a/plugins/woocommerce/changelog/dev-46844_remove_not_used_feature_flags b/plugins/woocommerce/changelog/dev-46844_remove_not_used_feature_flags new file mode 100644 index 00000000000..956690365c6 --- /dev/null +++ b/plugins/woocommerce/changelog/dev-46844_remove_not_used_feature_flags @@ -0,0 +1,4 @@ +Significance: minor +Type: dev + +Remove not used feature flags #47150 diff --git a/plugins/woocommerce/client/admin/config/core.json b/plugins/woocommerce/client/admin/config/core.json index f4e182c20a5..e05d55161ce 100644 --- a/plugins/woocommerce/client/admin/config/core.json +++ b/plugins/woocommerce/client/admin/config/core.json @@ -6,7 +6,6 @@ "coupons": true, "core-profiler": true, "customize-store": true, - "customer-effort-score-tracks": true, "import-products-task": true, "experimental-fashion-sample-products": true, "shipping-smart-defaults": true, @@ -20,11 +19,6 @@ "onboarding": true, "onboarding-tasks": true, "pattern-toolkit-full-composability": false, - "product-variation-management": true, - "product-virtual-downloadable": true, - "product-external-affiliate": true, - "product-grouped": true, - "product-linked": true, "product-pre-publish-modal": true, "product-custom-fields": true, "remote-inbox-notifications": true, diff --git a/plugins/woocommerce/client/admin/config/development.json b/plugins/woocommerce/client/admin/config/development.json index 95372fdbc31..ca56abe6c1e 100644 --- a/plugins/woocommerce/client/admin/config/development.json +++ b/plugins/woocommerce/client/admin/config/development.json @@ -6,7 +6,6 @@ "coupons": true, "core-profiler": true, "customize-store": true, - "customer-effort-score-tracks": true, "import-products-task": true, "experimental-fashion-sample-products": true, "shipping-smart-defaults": true, @@ -21,11 +20,6 @@ "onboarding-tasks": true, "pattern-toolkit-full-composability": false, "payment-gateway-suggestions": true, - "product-variation-management": true, - "product-virtual-downloadable": true, - "product-external-affiliate": true, - "product-grouped": true, - "product-linked": true, "product-pre-publish-modal": true, "product-custom-fields": true, "remote-inbox-notifications": true, diff --git a/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/Init.php b/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/Init.php index f2579ffc997..5aa67657592 100644 --- a/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/Init.php +++ b/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/Init.php @@ -49,17 +49,9 @@ class Init { * Constructor */ public function __construct() { - if ( Features::is_enabled( 'product-variation-management' ) ) { - array_push( $this->supported_product_types, 'variable' ); - } - - if ( Features::is_enabled( 'product-external-affiliate' ) ) { - array_push( $this->supported_product_types, 'external' ); - } - - if ( Features::is_enabled( 'product-grouped' ) ) { - array_push( $this->supported_product_types, 'grouped' ); - } + array_push( $this->supported_product_types, 'variable' ); + array_push( $this->supported_product_types, 'external' ); + array_push( $this->supported_product_types, 'grouped' ); $this->redirection_controller = new RedirectionController(); diff --git a/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/RedirectionController.php b/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/RedirectionController.php index 62c144d39b3..c5e2e135243 100644 --- a/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/RedirectionController.php +++ b/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/RedirectionController.php @@ -86,10 +86,7 @@ class RedirectionController { } if ( isset( $product_data_type ) ) { - if ( Features::is_enabled( 'product-virtual-downloadable' ) ) { - return true; - } - return ! $digital_product; + return true; } } @@ -176,5 +173,4 @@ class RedirectionController { exit(); } } - } diff --git a/plugins/woocommerce/src/Internal/Features/ProductBlockEditor/ProductTemplates/DownloadableProductTrait.php b/plugins/woocommerce/src/Internal/Features/ProductBlockEditor/ProductTemplates/DownloadableProductTrait.php index 63a27717cc1..4b9462246da 100644 --- a/plugins/woocommerce/src/Internal/Features/ProductBlockEditor/ProductTemplates/DownloadableProductTrait.php +++ b/plugins/woocommerce/src/Internal/Features/ProductBlockEditor/ProductTemplates/DownloadableProductTrait.php @@ -19,63 +19,60 @@ trait DownloadableProductTrait { */ private function add_downloadable_product_blocks( $parent_block ) { // Downloads section. - if ( Features::is_enabled( 'product-virtual-downloadable' ) ) { - $product_downloads_section_group = $parent_block->add_section( - array( - 'id' => 'product-downloads-section-group', - 'order' => 50, - 'attributes' => array( - 'blockGap' => 'unit-40', + $product_downloads_section_group = $parent_block->add_section( + array( + 'id' => 'product-downloads-section-group', + 'order' => 50, + 'attributes' => array( + 'blockGap' => 'unit-40', + ), + 'hideConditions' => array( + array( + 'expression' => 'postType === "product" && editedProduct.type !== "simple"', ), - 'hideConditions' => array( - array( - 'expression' => 'postType === "product" && editedProduct.type !== "simple"', - ), - ), - ) - ); + ), + ) + ); - $product_downloads_section_group->add_block( - array( - 'id' => 'product-downloadable', - 'blockName' => 'woocommerce/product-toggle-field', - 'order' => 10, - 'attributes' => array( - 'property' => 'downloadable', - 'label' => __( 'Include downloads', 'woocommerce' ), - 'checkedHelp' => __( 'Add any files you\'d like to make available for the customer to download after purchasing, such as instructions or warranty info.', 'woocommerce' ), - 'uncheckedHelp' => __( 'Add any files you\'d like to make available for the customer to download after purchasing, such as instructions or warranty info.', 'woocommerce' ), + $product_downloads_section_group->add_block( + array( + 'id' => 'product-downloadable', + 'blockName' => 'woocommerce/product-toggle-field', + 'order' => 10, + 'attributes' => array( + 'property' => 'downloadable', + 'label' => __( 'Include downloads', 'woocommerce' ), + 'checkedHelp' => __( 'Add any files you\'d like to make available for the customer to download after purchasing, such as instructions or warranty info.', 'woocommerce' ), + 'uncheckedHelp' => __( 'Add any files you\'d like to make available for the customer to download after purchasing, such as instructions or warranty info.', 'woocommerce' ), + ), + ) + ); + $product_downloads_section_group->add_subsection( + array( + 'id' => 'product-downloads-section', + 'order' => 20, + 'attributes' => array( + 'title' => __( 'Downloads', 'woocommerce' ), + 'description' => sprintf( + /* translators: %1$s: Downloads settings link opening tag. %2$s: Downloads settings link closing tag. */ + __( 'Add any files you\'d like to make available for the customer to download after purchasing, such as instructions or warranty info. Store-wide updates can be managed in your %1$sproduct settings%2$s.', 'woocommerce' ), + '', + '' ), - ) - ); - - $product_downloads_section_group->add_subsection( - array( - 'id' => 'product-downloads-section', - 'order' => 20, - 'attributes' => array( - 'title' => __( 'Downloads', 'woocommerce' ), - 'description' => sprintf( - /* translators: %1$s: Downloads settings link opening tag. %2$s: Downloads settings link closing tag. */ - __( 'Add any files you\'d like to make available for the customer to download after purchasing, such as instructions or warranty info. Store-wide updates can be managed in your %1$sproduct settings%2$s.', 'woocommerce' ), - '', - '' - ), + ), + 'hideConditions' => array( + array( + 'expression' => 'editedProduct.downloadable !== true', ), - 'hideConditions' => array( - array( - 'expression' => 'editedProduct.downloadable !== true', - ), - ), - ) - )->add_block( - array( - 'id' => 'product-downloads', - 'blockName' => 'woocommerce/product-downloads-field', - 'order' => 10, - ) - ); - } + ), + ) + )->add_block( + array( + 'id' => 'product-downloads', + 'blockName' => 'woocommerce/product-downloads-field', + 'order' => 10, + ) + ); } } diff --git a/plugins/woocommerce/src/Internal/Features/ProductBlockEditor/ProductTemplates/ProductVariationTemplate.php b/plugins/woocommerce/src/Internal/Features/ProductBlockEditor/ProductTemplates/ProductVariationTemplate.php index 5ee8346bc7d..7c2f5fd2697 100644 --- a/plugins/woocommerce/src/Internal/Features/ProductBlockEditor/ProductTemplates/ProductVariationTemplate.php +++ b/plugins/woocommerce/src/Internal/Features/ProductBlockEditor/ProductTemplates/ProductVariationTemplate.php @@ -441,27 +441,25 @@ class ProductVariationTemplate extends AbstractProductFormTemplate implements Pr ) ); // Virtual section. - if ( Features::is_enabled( 'product-virtual-downloadable' ) ) { - $shipping_group->add_section( - array( - 'id' => 'product-variation-virtual-section', - 'order' => 20, - ) - )->add_block( - array( - 'id' => 'product-variation-virtual', - 'blockName' => 'woocommerce/product-toggle-field', - 'order' => 10, - 'attributes' => array( - 'property' => 'virtual', - 'checkedValue' => false, - 'uncheckedValue' => true, - 'label' => __( 'This variation requires shipping or pickup', 'woocommerce' ), - 'uncheckedHelp' => __( 'This variation will not trigger your customer\'s shipping calculator in cart or at checkout. This product also won\'t require your customers to enter their shipping details at checkout. Read more about virtual products.', 'woocommerce' ), - ), - ) - ); - } + $shipping_group->add_section( + array( + 'id' => 'product-variation-virtual-section', + 'order' => 20, + ) + )->add_block( + array( + 'id' => 'product-variation-virtual', + 'blockName' => 'woocommerce/product-toggle-field', + 'order' => 10, + 'attributes' => array( + 'property' => 'virtual', + 'checkedValue' => false, + 'uncheckedValue' => true, + 'label' => __( 'This variation requires shipping or pickup', 'woocommerce' ), + 'uncheckedHelp' => __( 'This variation will not trigger your customer\'s shipping calculator in cart or at checkout. This product also won\'t require your customers to enter their shipping details at checkout. Read more about virtual products.', 'woocommerce' ), + ), + ) + ); // Product Shipping Section. $product_fee_and_dimensions_section = $shipping_group->add_section( array( diff --git a/plugins/woocommerce/src/Internal/Features/ProductBlockEditor/ProductTemplates/SimpleProductTemplate.php b/plugins/woocommerce/src/Internal/Features/ProductBlockEditor/ProductTemplates/SimpleProductTemplate.php index fd7297ad69c..3b7880413b4 100644 --- a/plugins/woocommerce/src/Internal/Features/ProductBlockEditor/ProductTemplates/SimpleProductTemplate.php +++ b/plugins/woocommerce/src/Internal/Features/ProductBlockEditor/ProductTemplates/SimpleProductTemplate.php @@ -78,30 +78,24 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ ); // Variations tab. - if ( Features::is_enabled( 'product-variation-management' ) ) { - $variations_hide_conditions = array(); - if ( Features::is_enabled( 'product-grouped' ) ) { - $variations_hide_conditions[] = array( - 'expression' => 'editedProduct.type === "grouped"', - ); - } - if ( Features::is_enabled( 'product-external-affiliate' ) ) { - $variations_hide_conditions[] = array( - 'expression' => 'editedProduct.type === "external"', - ); - } + $variations_hide_conditions = array(); + $variations_hide_conditions[] = array( + 'expression' => 'editedProduct.type === "grouped"', + ); + $variations_hide_conditions[] = array( + 'expression' => 'editedProduct.type === "external"', + ); - $this->add_group( - array( - 'id' => $this::GROUP_IDS['VARIATIONS'], - 'order' => 20, - 'attributes' => array( - 'title' => __( 'Variations', 'woocommerce' ), - ), - 'hideConditions' => $variations_hide_conditions, - ) - ); - } + $this->add_group( + array( + 'id' => $this::GROUP_IDS['VARIATIONS'], + 'order' => 20, + 'attributes' => array( + 'title' => __( 'Variations', 'woocommerce' ), + ), + 'hideConditions' => $variations_hide_conditions, + ) + ); $this->add_group( array( @@ -119,11 +113,11 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ 'attributes' => array( 'title' => __( 'Pricing', 'woocommerce' ), ), - 'hideConditions' => Features::is_enabled( 'product-grouped' ) ? array( + 'hideConditions' => array( array( 'expression' => 'editedProduct.type === "grouped"', ), - ) : null, + ), ) ); $this->add_group( @@ -135,17 +129,13 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ ), ) ); - $shipping_hide_conditions = array(); - if ( Features::is_enabled( 'product-grouped' ) ) { - $shipping_hide_conditions[] = array( - 'expression' => 'editedProduct.type === "grouped"', - ); - } - if ( Features::is_enabled( 'product-external-affiliate' ) ) { - $shipping_hide_conditions[] = array( - 'expression' => 'editedProduct.type === "external"', - ); - } + $shipping_hide_conditions = array(); + $shipping_hide_conditions[] = array( + 'expression' => 'editedProduct.type === "grouped"', + ); + $shipping_hide_conditions[] = array( + 'expression' => 'editedProduct.type === "external"', + ); $this->add_group( array( @@ -159,17 +149,15 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ ); // Linked Products tab. - if ( Features::is_enabled( 'product-linked' ) ) { - $this->add_group( - array( - 'id' => $this::GROUP_IDS['LINKED_PRODUCTS'], - 'order' => 70, - 'attributes' => array( - 'title' => __( 'Linked products', 'woocommerce' ), - ), - ) - ); - } + $this->add_group( + array( + 'id' => $this::GROUP_IDS['LINKED_PRODUCTS'], + 'order' => 70, + 'attributes' => array( + 'title' => __( 'Linked products', 'woocommerce' ), + ), + ) + ); } /** @@ -279,105 +267,101 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ ); // External/Affiliate section. - if ( Features::is_enabled( 'product-external-affiliate' ) ) { - $buy_button_section = $general_group->add_section( - array( - 'id' => 'product-buy-button-section', - 'order' => 30, - 'attributes' => array( - 'title' => __( 'Buy button', 'woocommerce' ), - 'description' => __( 'Add a link and choose a label for the button linked to a product sold elsewhere.', 'woocommerce' ), + $buy_button_section = $general_group->add_section( + array( + 'id' => 'product-buy-button-section', + 'order' => 30, + 'attributes' => array( + 'title' => __( 'Buy button', 'woocommerce' ), + 'description' => __( 'Add a link and choose a label for the button linked to a product sold elsewhere.', 'woocommerce' ), + ), + 'hideConditions' => array( + array( + 'expression' => 'editedProduct.type !== "external"', ), - 'hideConditions' => array( - array( - 'expression' => 'editedProduct.type !== "external"', - ), + ), + ) + ); + + $buy_button_section->add_block( + array( + 'id' => 'product-external-url', + 'blockName' => 'woocommerce/product-text-field', + 'order' => 10, + 'attributes' => array( + 'property' => 'external_url', + 'label' => __( 'Link to the external product', 'woocommerce' ), + 'placeholder' => __( 'Enter the external URL to the product', 'woocommerce' ), + 'suffix' => true, + 'type' => array( + 'value' => 'url', + 'message' => __( 'Link to the external product is an invalid URL.', 'woocommerce' ), ), - ) - ); + ), + ) + ); - $buy_button_section->add_block( - array( - 'id' => 'product-external-url', - 'blockName' => 'woocommerce/product-text-field', - 'order' => 10, - 'attributes' => array( - 'property' => 'external_url', - 'label' => __( 'Link to the external product', 'woocommerce' ), - 'placeholder' => __( 'Enter the external URL to the product', 'woocommerce' ), - 'suffix' => true, - 'type' => array( - 'value' => 'url', - 'message' => __( 'Link to the external product is an invalid URL.', 'woocommerce' ), - ), - ), - ) - ); + $button_text_columns = $buy_button_section->add_block( + array( + 'id' => 'product-button-text-columns', + 'blockName' => 'core/columns', + 'order' => 20, + ) + ); - $button_text_columns = $buy_button_section->add_block( - array( - 'id' => 'product-button-text-columns', - 'blockName' => 'core/columns', - 'order' => 20, - ) - ); + $button_text_columns->add_block( + array( + 'id' => 'product-button-text-column1', + 'blockName' => 'core/column', + 'order' => 10, + ) + )->add_block( + array( + 'id' => 'product-button-text', + 'blockName' => 'woocommerce/product-text-field', + 'order' => 10, + 'attributes' => array( + 'property' => 'button_text', + 'label' => __( 'Buy button text', 'woocommerce' ), + ), + ) + ); - $button_text_columns->add_block( - array( - 'id' => 'product-button-text-column1', - 'blockName' => 'core/column', - 'order' => 10, - ) - )->add_block( - array( - 'id' => 'product-button-text', - 'blockName' => 'woocommerce/product-text-field', - 'order' => 10, - 'attributes' => array( - 'property' => 'button_text', - 'label' => __( 'Buy button text', 'woocommerce' ), - ), - ) - ); - - $button_text_columns->add_block( - array( - 'id' => 'product-button-text-column2', - 'blockName' => 'core/column', - 'order' => 20, - ) - ); - } + $button_text_columns->add_block( + array( + 'id' => 'product-button-text-column2', + 'blockName' => 'core/column', + 'order' => 20, + ) + ); // Product list section. - if ( Features::is_enabled( 'product-grouped' ) ) { - $product_list_section = $general_group->add_section( - array( - 'id' => 'product-list-section', - 'order' => 35, - 'attributes' => array( - 'title' => __( 'Products in this group', 'woocommerce' ), - 'description' => __( 'Make a collection of related products, enabling customers to purchase multiple items together.', 'woocommerce' ), + $product_list_section = $general_group->add_section( + array( + 'id' => 'product-list-section', + 'order' => 35, + 'attributes' => array( + 'title' => __( 'Products in this group', 'woocommerce' ), + 'description' => __( 'Make a collection of related products, enabling customers to purchase multiple items together.', 'woocommerce' ), + ), + 'hideConditions' => array( + array( + 'expression' => 'editedProduct.type !== "grouped"', ), - 'hideConditions' => array( - array( - 'expression' => 'editedProduct.type !== "grouped"', - ), - ), - ) - ); + ), + ) + ); - $product_list_section->add_block( - array( - 'id' => 'product-list', - 'blockName' => 'woocommerce/product-list-field', - 'order' => 10, - 'attributes' => array( - 'property' => 'grouped_products', - ), - ) - ); - } + $product_list_section->add_block( + array( + 'id' => 'product-list', + 'blockName' => 'woocommerce/product-list-field', + 'order' => 10, + 'attributes' => array( + 'property' => 'grouped_products', + ), + ) + ); // Images section. $images_section = $general_group->add_section( @@ -827,11 +811,11 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ '' ) : null, ), - 'hideConditions' => Features::is_enabled( 'product-external-affiliate' ) || Features::is_enabled( 'product-grouped' ) ? array( + 'hideConditions' => array( array( 'expression' => 'editedProduct.type === "external" || editedProduct.type === "grouped"', ), - ) : null, + ), 'disableConditions' => array( array( 'expression' => 'editedProduct.type === "variable"', @@ -839,16 +823,14 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ ), ) ); - $product_inventory_quantity_hide_conditions = array( + $product_inventory_quantity_hide_conditions = array( array( 'expression' => 'editedProduct.manage_stock === false', ), ); - if ( Features::is_enabled( 'product-grouped' ) ) { - $product_inventory_quantity_hide_conditions[] = array( - 'expression' => 'editedProduct.type === "grouped"', - ); - } + $product_inventory_quantity_hide_conditions[] = array( + 'expression' => 'editedProduct.type === "grouped"', + ); $product_inventory_inner_section->add_block( array( 'id' => 'product-inventory-quantity', @@ -857,16 +839,14 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ 'hideConditions' => $product_inventory_quantity_hide_conditions, ) ); - $product_stock_status_hide_conditions = array( + $product_stock_status_hide_conditions = array( array( 'expression' => 'editedProduct.manage_stock === true', ), ); - if ( Features::is_enabled( 'product-grouped' ) ) { - $product_stock_status_hide_conditions[] = array( - 'expression' => 'editedProduct.type === "grouped"', - ); - } + $product_stock_status_hide_conditions[] = array( + 'expression' => 'editedProduct.type === "grouped"', + ); $product_inventory_section->add_block( array( 'id' => 'product-stock-status', @@ -922,11 +902,11 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ 'initialCollapsed' => true, 'persistRender' => true, ), - 'hideConditions' => Features::is_enabled( 'product-grouped' ) ? array( + 'hideConditions' => array( array( 'expression' => 'editedProduct.type === "grouped"', ), - ) : null, + ), ) ); $product_inventory_advanced_wrapper = $product_inventory_advanced->add_block( @@ -1026,32 +1006,30 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ ) ); // Virtual section. - if ( Features::is_enabled( 'product-virtual-downloadable' ) ) { - $shipping_group->add_section( - array( - 'id' => 'product-virtual-section', - 'order' => 10, - 'hideConditions' => array( - array( - 'expression' => 'editedProduct.type !== "simple"', - ), + $shipping_group->add_section( + array( + 'id' => 'product-virtual-section', + 'order' => 10, + 'hideConditions' => array( + array( + 'expression' => 'editedProduct.type !== "simple"', ), - ) - )->add_block( - array( - 'id' => 'product-virtual', - 'blockName' => 'woocommerce/product-toggle-field', - 'order' => 10, - 'attributes' => array( - 'property' => 'virtual', - 'checkedValue' => false, - 'uncheckedValue' => true, - 'label' => __( 'This product requires shipping or pickup', 'woocommerce' ), - 'uncheckedHelp' => __( 'This product will not trigger your customer\'s shipping calculator in cart or at checkout. This product also won\'t require your customers to enter their shipping details at checkout. Read more about virtual products.', 'woocommerce' ), - ), - ) - ); - } + ), + ) + )->add_block( + array( + 'id' => 'product-virtual', + 'blockName' => 'woocommerce/product-toggle-field', + 'order' => 10, + 'attributes' => array( + 'property' => 'virtual', + 'checkedValue' => false, + 'uncheckedValue' => true, + 'label' => __( 'This product requires shipping or pickup', 'woocommerce' ), + 'uncheckedHelp' => __( 'This product will not trigger your customer\'s shipping calculator in cart or at checkout. This product also won\'t require your customers to enter their shipping details at checkout. Read more about virtual products.', 'woocommerce' ), + ), + ) + ); // Product Shipping Section. $product_fee_and_dimensions_section = $shipping_group->add_section( array( diff --git a/plugins/woocommerce/tests/e2e-pw/bin/test-helper-apis.php b/plugins/woocommerce/tests/e2e-pw/bin/test-helper-apis.php index 89f70875403..d3e3c582df7 100644 --- a/plugins/woocommerce/tests/e2e-pw/bin/test-helper-apis.php +++ b/plugins/woocommerce/tests/e2e-pw/bin/test-helper-apis.php @@ -73,9 +73,6 @@ function reset_feature_flags() { function enable_experimental_features( $features ) { $stored_features = get_option( 'e2e_feature_flags', array() ); - // We always enable this for tests at the moment. - $features['product-variation-management'] = true; - return array_merge( $features, $stored_features ); }