[Product Block Editor] remove digital products from target list (#39801)

* Fix remove digital products from the target list

* Add changelog
This commit is contained in:
Fernando Marichal 2023-08-18 09:32:06 -03:00 committed by GitHub
parent afc8e0fac5
commit 5f7e20bed7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
[Product Block Editor] remove digital products from the target list #39769

View File

@ -62,7 +62,8 @@ class RedirectionController {
*/
protected function is_product_supported( $product_id ): bool {
$product = $product_id ? wc_get_product( $product_id ) : null;
return $product && in_array( $product->get_type(), $this->supported_post_types, true );
$digital_product = $product->is_downloadable() || $product->is_virtual();
return $product && in_array( $product->get_type(), $this->supported_post_types, true ) && ! $digital_product;
}
/**