[Product Block Editor]: Add `Linked product` tab (#43009)

* add linked-products to group IDs

* add Linked Products tab

* tweak hideConditions condition

* changelog

* fix typo in doc comment
This commit is contained in:
Damián Suárez 2023-12-21 16:00:32 -03:00 committed by GitHub
parent 65828db266
commit eac1a460f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 7 deletions

View File

@ -1,4 +1,4 @@
Significance: patch
Type: add
add `product-linked` feature flag
[Product Block Editor]: add `Linked products` tab

View File

@ -22,6 +22,7 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
'INVENTORY' => 'inventory',
'SHIPPING' => 'shipping',
'VARIATIONS' => 'variations',
'LINKED_PRODUCTS' => 'linked-products',
);
/**
@ -149,6 +150,24 @@ 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' => 60,
'attributes' => array(
'title' => __( 'Linked products', 'woocommerce' ),
),
'hideConditions' => Features::is_enabled( 'product-linked' ) ? array(
array(
'expression' => 'editedProduct.type === "grouped"',
),
) : null,
)
);
}
}
/**