Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Make a Single Product conversion enabled in Core, but keep the Produc…
Browse files Browse the repository at this point in the history
…t Archive behind experimental flag (#8907)
  • Loading branch information
kmanijak authored and Tarun Vijwani committed Mar 30, 2023
1 parent 872098c commit e6855f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion assets/js/blocks/classic-template/archive-product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
type BlockInstance,
} from '@wordpress/blocks';
import { isWpVersion } from '@woocommerce/settings';
import { isExperimentalBuild } from '@woocommerce/block-settings';
import { __, sprintf } from '@wordpress/i18n';

/**
Expand Down Expand Up @@ -74,7 +75,7 @@ const getBlockifiedTemplateWithTermDescription = (
const isConversionPossible = () => {
// Blockification is possible for the WP version 6.1 and above,
// which are the versions the Products block supports.
return isWpVersion( '6.1', '>=' );
return isExperimentalBuild() && isWpVersion( '6.1', '>=' );
};

const getDescriptionAllowingConversion = ( templateTitle: string ) =>
Expand Down
3 changes: 2 additions & 1 deletion assets/js/blocks/classic-template/product-search-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
type InnerBlockTemplate,
} from '@wordpress/blocks';
import { isWpVersion } from '@woocommerce/settings';
import { isExperimentalBuild } from '@woocommerce/block-settings';
import { __, sprintf } from '@wordpress/i18n';

/**
Expand Down Expand Up @@ -122,7 +123,7 @@ const getBlockifiedTemplate = ( inheritedAttributes: InheritedAttributes ) => {
const isConversionPossible = () => {
// Blockification is possible for the WP version 6.1 and above,
// which are the versions the Products block supports.
return isWpVersion( '6.1', '>=' );
return isExperimentalBuild() && isWpVersion( '6.1', '>=' );
};

const getDescriptionAllowingConversion = ( templateTitle: string ) =>
Expand Down

0 comments on commit e6855f7

Please sign in to comment.