[Product Block Editor]: update the conditions to hide the Cross-sells section (#43140)
* update the conditions to hide Cross-sells section * changelog * fix eslint issues
This commit is contained in:
parent
378f610d3a
commit
b41ecfe33d
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
[Product Block Editor]: update the conditions to hide the Cross-sells section
|
|
@ -156,16 +156,11 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
if ( Features::is_enabled( 'product-linked' ) ) {
|
||||
$this->add_group(
|
||||
array(
|
||||
'id' => $this::GROUP_IDS['LINKED_PRODUCTS'],
|
||||
'order' => 60,
|
||||
'attributes' => 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,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -1137,9 +1132,9 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
|
||||
$linked_products_group->add_section(
|
||||
array(
|
||||
'id' => 'product-linked-cross-sells-section',
|
||||
'order' => 20,
|
||||
'attributes' => array(
|
||||
'id' => 'product-linked-cross-sells-section',
|
||||
'order' => 20,
|
||||
'attributes' => array(
|
||||
'title' => __( 'Cross-sells', 'woocommerce' ),
|
||||
'description' => sprintf(
|
||||
/* translators: %1$s: Learn more about linked products. %2$s: Learn more about linked products.*/
|
||||
|
@ -1148,6 +1143,11 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
|
|||
'</a>'
|
||||
),
|
||||
),
|
||||
'hideConditions' => array(
|
||||
array(
|
||||
'expression' => 'editedProduct.type === "external" || editedProduct.type === "grouped"',
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue