Merge branch 'trunk' into update/product-editor-add-variation-pickup-help

This commit is contained in:
Damián Suárez 2023-11-21 11:57:30 -03:00
commit abe33ded3d
4 changed files with 18 additions and 5 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Hide track stock quantity toogle when the product type is external

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Correct return type of ProductFormTemplateInterface::add_group() method.

View File

@ -14,7 +14,7 @@ interface ProductFormTemplateInterface extends BlockTemplateInterface {
* Adds a new group block.
*
* @param array $block_config block config.
* @return BlockInterface new block section.
* @return GroupInterface new group block.
*/
public function add_group( array $block_config ): GroupInterface;

View File

@ -673,10 +673,10 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
);
$product_inventory_inner_section->add_block(
array(
'id' => 'product-track-stock',
'blockName' => 'woocommerce/product-toggle-field',
'order' => 20,
'attributes' => array(
'id' => 'product-track-stock',
'blockName' => 'woocommerce/product-toggle-field',
'order' => 20,
'attributes' => array(
'label' => __( 'Track stock quantity for this product', 'woocommerce' ),
'property' => 'manage_stock',
'disabled' => 'yes' !== get_option( 'woocommerce_manage_stock' ),
@ -687,6 +687,11 @@ class SimpleProductTemplate extends AbstractProductFormTemplate implements Produ
'</a>'
),
),
'hideConditions' => Features::is_enabled( 'product-external-affiliate' ) ? array(
array(
'expression' => 'editedProduct.type === "external"',
),
) : null,
)
);
$product_inventory_quantity_conditional = $product_inventory_inner_section->add_block(