Remove not used feature flags (#47150)
* Remove product-virtual-downloadable * Remove product-variation-management * Remove product-external-affiliate * Remove product-grouped * Remove product-linked * Remove customer-effort-score-tracks * Add beta tester changelog * Add changelogs
This commit is contained in:
parent
7c1da8129d
commit
fdb4069566
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: dev
|
||||
|
||||
Remove not used feature flags #47150
|
|
@ -63,41 +63,35 @@ export function ShippingMenuItem( {
|
|||
renderContent={ () => (
|
||||
<div className="components-dropdown-menu__menu">
|
||||
<MenuGroup>
|
||||
{ window.wcAdminFeatures[
|
||||
'product-virtual-downloadable'
|
||||
] && (
|
||||
<MenuItem
|
||||
onClick={ () => {
|
||||
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' ) }
|
||||
</MenuItem>
|
||||
) }
|
||||
<MenuItem
|
||||
onClick={ () => {
|
||||
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' ) }
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
onClick={ () => {
|
||||
recordEvent(
|
||||
|
|
|
@ -120,14 +120,12 @@ export function VariationActions( {
|
|||
onClose={ onClose }
|
||||
supportsMultipleSelection={ supportsMultipleSelection }
|
||||
/>
|
||||
{ window.wcAdminFeatures[ 'product-virtual-downloadable' ] && (
|
||||
<DownloadsMenuItem
|
||||
selection={ selection }
|
||||
onChange={ onChange }
|
||||
onClose={ onClose }
|
||||
supportsMultipleSelection={ supportsMultipleSelection }
|
||||
/>
|
||||
) }
|
||||
<DownloadsMenuItem
|
||||
selection={ selection }
|
||||
onChange={ onChange }
|
||||
onClose={ onClose }
|
||||
supportsMultipleSelection={ supportsMultipleSelection }
|
||||
/>
|
||||
</MenuGroup>
|
||||
<VariationQuickUpdateMenuItem.Slot
|
||||
group={ 'secondary' }
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
import { Product } from '@woocommerce/data';
|
||||
|
||||
export const getDerivedProductType = ( product: Partial< Product > ) => {
|
||||
if ( ! window.wcAdminFeatures[ 'product-variation-management' ] ) {
|
||||
return 'simple';
|
||||
}
|
||||
|
||||
const hasOptions = !! product.attributes?.find(
|
||||
( attribute ) => attribute.options.length && attribute.variation
|
||||
);
|
||||
|
|
|
@ -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(
|
||||
<CustomerEffortScoreTracksContainer />,
|
||||
root.insertBefore( document.createElement( 'div' ), null )
|
||||
);
|
||||
} )();
|
||||
}
|
||||
// Set up customer effort score survey.
|
||||
( function () {
|
||||
const root = appRoot || embeddedRoot;
|
||||
render(
|
||||
<CustomerEffortScoreTracksContainer />,
|
||||
root.insertBefore( document.createElement( 'div' ), null )
|
||||
);
|
||||
} )();
|
||||
|
|
|
@ -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' ] ) {
|
||||
|
|
|
@ -134,14 +134,12 @@ const EditProductPage: React.FC = () => {
|
|||
</div>
|
||||
</ProductFormLayout>
|
||||
) }
|
||||
{ window.wcAdminFeatures[ 'product-variation-management' ] &&
|
||||
productVariation &&
|
||||
product && (
|
||||
<ProductVariationForm
|
||||
product={ product }
|
||||
productVariation={ productVariation }
|
||||
/>
|
||||
) }
|
||||
{ productVariation && product && (
|
||||
<ProductVariationForm
|
||||
product={ product }
|
||||
productVariation={ productVariation }
|
||||
/>
|
||||
) }
|
||||
{ ! isProductVariation &&
|
||||
product &&
|
||||
( product.status !== 'trash' || wasDeletedUsingAction ) && (
|
||||
|
|
|
@ -104,18 +104,16 @@ const Tabs = () => {
|
|||
fillProps={ { product } }
|
||||
/>
|
||||
</WooProductTabItem>
|
||||
{ window.wcAdminFeatures[ 'product-variation-management' ] ? (
|
||||
<WooProductTabItem
|
||||
id={ TAB_OPTIONS_ID }
|
||||
templates={ [ { name: TAB_GENERAL_ID, order: 9 } ] }
|
||||
pluginId={ PLUGIN_ID }
|
||||
tabProps={ tabPropData.options }
|
||||
>
|
||||
<>
|
||||
<ProductVariationsSection />
|
||||
</>
|
||||
</WooProductTabItem>
|
||||
) : null }
|
||||
<WooProductTabItem
|
||||
id={ TAB_OPTIONS_ID }
|
||||
templates={ [ { name: TAB_GENERAL_ID, order: 9 } ] }
|
||||
pluginId={ PLUGIN_ID }
|
||||
tabProps={ tabPropData.options }
|
||||
>
|
||||
<>
|
||||
<ProductVariationsSection />
|
||||
</>
|
||||
</WooProductTabItem>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: dev
|
||||
|
||||
Remove not used feature flags #47150
|
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: dev
|
||||
|
||||
Remove not used feature flags #47150
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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' ),
|
||||
'<a href="' . admin_url( 'admin.php?page=wc-settings&tab=products§ion=downloadable' ) . '" target="_blank" rel="noreferrer">',
|
||||
'</a>'
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$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' ),
|
||||
'<a href="' . admin_url( 'admin.php?page=wc-settings&tab=products§ion=downloadable' ) . '" target="_blank" rel="noreferrer">',
|
||||
'</a>'
|
||||
),
|
||||
),
|
||||
'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,
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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. <a href="https://woocommerce.com/document/managing-products/#adding-a-virtual-product" target="_blank" rel="noreferrer">Read more about virtual products</a>.', '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. <a href="https://woocommerce.com/document/managing-products/#adding-a-virtual-product" target="_blank" rel="noreferrer">Read more about virtual products</a>.', 'woocommerce' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
// Product Shipping Section.
|
||||
$product_fee_and_dimensions_section = $shipping_group->add_section(
|
||||
array(
|
||||
|
|
|
@ -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
|
|||
'</a>'
|
||||
) : 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. <a href="https://woocommerce.com/document/managing-products/#adding-a-virtual-product" target="_blank" rel="noreferrer">Read more about virtual products</a>.', '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. <a href="https://woocommerce.com/document/managing-products/#adding-a-virtual-product" target="_blank" rel="noreferrer">Read more about virtual products</a>.', 'woocommerce' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
// Product Shipping Section.
|
||||
$product_fee_and_dimensions_section = $shipping_group->add_section(
|
||||
array(
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue