diff --git a/assets/js/atomic/blocks/product-elements/price/edit.tsx b/assets/js/atomic/blocks/product-elements/price/edit.tsx
index b45238e9f36..1fe4a4640cf 100644
--- a/assets/js/atomic/blocks/product-elements/price/edit.tsx
+++ b/assets/js/atomic/blocks/product-elements/price/edit.tsx
@@ -9,14 +9,11 @@ import {
import { useEffect } from '@wordpress/element';
import type { BlockAlignment } from '@wordpress/blocks';
import { useSelect } from '@wordpress/data';
-import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import Block from './block';
-import { BLOCK_TITLE, BLOCK_ICON } from './constants';
-import { ProductSelector } from '../shared/product-selector';
type UnsupportedAligments = 'wide' | 'full';
type AllowedAlignments = Exclude< BlockAlignment, UnsupportedAligments >;
@@ -82,52 +79,20 @@ const PriceEdit = ( {
]
);
- const showProductSelector =
- ! isDescendentOfQueryLoop &&
- ! isDescendentOfSingleProductTemplate &&
- ! attributes.isDescendentOfSingleProductBlock;
-
- if ( ! showProductSelector ) {
- return (
- <>
-
- {
- setAttributes( { textAlign } );
- } }
- />
-
-
-
-
- >
- );
- }
-
return (
-
-
-
- {
- setAttributes( { textAlign } );
- } }
- />
-
+ <>
+
+ {
+ setAttributes( { textAlign } );
+ } }
+ />
+
+
-
-
+
+ >
);
};
diff --git a/composer.json b/composer.json
index 44d675f4727..e912f0f7235 100644
--- a/composer.json
+++ b/composer.json
@@ -3,7 +3,7 @@
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://woocommerce.com/",
"type": "wordpress-plugin",
- "version": "10.0.0",
+ "version": "10.0.1",
"keywords": [
"gutenberg",
"woocommerce",
diff --git a/docs/internal-developers/testing/releases/1001.md b/docs/internal-developers/testing/releases/1001.md
new file mode 100644
index 00000000000..75ca4d7a933
--- /dev/null
+++ b/docs/internal-developers/testing/releases/1001.md
@@ -0,0 +1,35 @@
+# Testing notes and ZIP for release 10.0.1
+
+Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/11260936/woocommerce-gutenberg-products-block.zip)
+
+## WooCommerce Core
+
+### Single Product Compatibility Layer: add support for custom HTML Blocks. [(9075)](https://github.com/woocommerce/woocommerce-blocks/pull/9075)
+
+1. Go to Appearance > Editor and in the Single Product template before upgrading to the blockified version, add a HTML Block _outside_ of the Group block as shown in the screenshot below with the contents `HTML Block here
` (or similar)
+2. Save and view this block on the frontend.
+3. Return to the template, upgrade it to the blockified version
+4. Save and view on the frontend. Be sure that the HTML is visible on the page.
+
+![Screenshot 2023-04-17 at 14 34 13](https://user-images.githubusercontent.com/8639742/232499923-9ca7cb7a-c4e7-417d-af78-a8b86b87ea10.png)
+
+### Blockfied Single Product Template: Add support for template for specific product. [(9069)](https://github.com/woocommerce/woocommerce-blocks/pull/9069)
+
+1. Go to Appearance > Editor > Templates > Add new (plus icon) > Single Item: Product > Select a product with multiples images
+2. Go into your newly created template, and upgrade Classic template placeholder to the Blockified version of the template.
+3. Save the template and visit the product on the frontend.
+4. Check that gallery thumbnails work.
+
+* [ ] Do not include in the Testing Notes
+
+| Before | After |
+|--------|--------|
+|![Screenshot 2023-04-17 at 10 23 19](https://user-images.githubusercontent.com/8639742/232442575-6c3929f3-bdf2-403b-89dc-4a2f21d00312.png)||
+
+### Product Price Block: remove ProductSelector support. [(8980)](https://github.com/woocommerce/woocommerce-blocks/pull/8980)
+
+1. Create a post or page.
+2. Insert the All Products block.
+3. Edit the layout of the All Products block.
+4. Check the Product Price inner block doesn't show the product selector.
+
diff --git a/docs/internal-developers/testing/releases/README.md b/docs/internal-developers/testing/releases/README.md
index 3a5228684c9..58c906f3131 100644
--- a/docs/internal-developers/testing/releases/README.md
+++ b/docs/internal-developers/testing/releases/README.md
@@ -137,6 +137,7 @@ Every release includes specific testing instructions for new features and bug fi
- [9.8.4](./984.md)
- [9.9.0](./990.md)
- [10.0.0](./1000.md)
+ - [10.0.1](./1001.md)
diff --git a/package-lock.json b/package-lock.json
index 641990e469a..78f85c8ac2d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@woocommerce/block-library",
- "version": "10.0.0",
+ "version": "10.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@woocommerce/block-library",
- "version": "10.0.0",
+ "version": "10.0.1",
"hasInstallScript": true,
"license": "GPL-3.0+",
"dependencies": {
diff --git a/package.json b/package.json
index 79f347a499e..1265b698480 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "@woocommerce/block-library",
"title": "WooCommerce Blocks",
"author": "Automattic",
- "version": "10.0.0",
+ "version": "10.0.1",
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/",
"keywords": [
diff --git a/readme.txt b/readme.txt
index c6b88e7ca7a..a75d64fa69b 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
Requires at least: 6.1
Tested up to: 6.2
Requires PHP: 7.3
-Stable tag: 10.0.0
+Stable tag: 10.0.1
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -80,6 +80,14 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/
== Changelog ==
+= 10.0.1 - 2023-04-18 =
+
+#### Bug Fixes
+
+- Product Price Block: Remove ProductSelector support. ([8980](https://github.com/woocommerce/woocommerce-blocks/pull/8980))
+- Single Product Compatibility Layer: add support for custom HTML Blocks. ([9075](https://github.com/woocommerce/woocommerce-blocks/pull/9075))
+- Fix: tax_query should be calculated only if __woocommerceAttributes is valid. ([9049](https://github.com/woocommerce/woocommerce-blocks/pull/9049))
+
= 10.0.0 - 2023-04-11 =
#### Enhancements
diff --git a/src/BlockTemplatesController.php b/src/BlockTemplatesController.php
index faf6d49a8ed..2d4315de69d 100644
--- a/src/BlockTemplatesController.php
+++ b/src/BlockTemplatesController.php
@@ -325,7 +325,7 @@ function( $template ) {
$template->description = BlockTemplateUtils::get_block_template_description( $template->slug );
}
- if ( 'single-product' === $template->slug ) {
+ if ( str_contains( $template->slug, 'single-product' ) ) {
if ( ! is_admin() && ! BlockTemplateUtils::template_has_legacy_template_block( $template ) ) {
$new_content = SingleProductTemplateCompatibility::add_compatibility_layer( $template->content );
diff --git a/src/BlockTypes/ProductQuery.php b/src/BlockTypes/ProductQuery.php
index 7013de7b61e..6420019e97e 100644
--- a/src/BlockTypes/ProductQuery.php
+++ b/src/BlockTypes/ProductQuery.php
@@ -135,16 +135,19 @@ private function merge_tax_queries( ...$queries ) {
* @param array $args Query args.
* @param WP_REST_Request $request Request.
*/
- public function update_rest_query( $args, $request ) {
- $orderby = $request->get_param( 'orderby' );
- $woo_attributes = $request->get_param( '__woocommerceAttributes' );
- $woo_stock_status = $request->get_param( '__woocommerceStockStatus' );
- $on_sale_query = $request->get_param( '__woocommerceOnSale' ) === 'true' ? $this->get_on_sale_products_query() : array();
- $orderby_query = isset( $orderby ) ? $this->get_custom_orderby_query( $orderby ) : array();
- $attributes_query = is_array( $woo_attributes ) ? $this->get_product_attributes_query( $woo_attributes ) : array();
- $stock_query = is_array( $woo_stock_status ) ? $this->get_stock_status_query( $woo_stock_status ) : array();
- $visibility_query = $this->get_product_visibility_query( $stock_query );
- $tax_query = $this->merge_tax_queries( $attributes_query, $visibility_query );
+ public function update_rest_query( $args, $request ): array {
+ $woo_attributes = $request->get_param( '__woocommerceAttributes' );
+ $is_valid_attributes = is_array( $woo_attributes );
+ $orderby = $request->get_param( 'orderby' );
+ $woo_stock_status = $request->get_param( '__woocommerceStockStatus' );
+ $on_sale = $request->get_param( '__woocommerceOnSale' ) === 'true';
+
+ $on_sale_query = $on_sale ? $this->get_on_sale_products_query() : [];
+ $orderby_query = $orderby ? $this->get_custom_orderby_query( $orderby ) : [];
+ $attributes_query = $is_valid_attributes ? $this->get_product_attributes_query( $woo_attributes ) : [];
+ $stock_query = is_array( $woo_stock_status ) ? $this->get_stock_status_query( $woo_stock_status ) : [];
+ $visibility_query = is_array( $woo_stock_status ) ? $this->get_product_visibility_query( $stock_query ) : [];
+ $tax_query = $is_valid_attributes ? $this->merge_tax_queries( $attributes_query, $visibility_query ) : [];
return array_merge( $args, $on_sale_query, $orderby_query, $stock_query, $tax_query );
}
diff --git a/src/Interactivity/directives/class-woo-directive-store.php b/src/Interactivity/directives/class-woo-directive-store.php
index 57b8b3c3fc9..3b213d281d3 100644
--- a/src/Interactivity/directives/class-woo-directive-store.php
+++ b/src/Interactivity/directives/class-woo-directive-store.php
@@ -1,7 +1,7 @@
assertEquals( $result_without_withespace, $expected_single_product_template_without_whitespace, '' );
}
+
+ /**
+ * Test that the Single Product Template is wrapped in a div with the correct class if it contains a block related to the Single Product Template and custom HTML isn't removed.
+ */
+ public function test_add_compatibility_layer_if_contains_single_product_blocks_and_custom_HTML_not_removed() {
+
+ $default_single_product_template = '
+
+ Custom HTML
+
+
+
+
+
+ ';
+
+ $expected_single_product_template = '
+
+ Custom HTML
+
+
+
+ ';
+
+ $result = SingleProductTemplateCompatibility::add_compatibility_layer( $default_single_product_template );
+
+ $result_without_withespace = preg_replace( '/\s+/', '', $result );
+ $expected_single_product_template_without_whitespace = preg_replace( '/\s+/', '', $expected_single_product_template );
+
+ $this->assertEquals( $result_without_withespace, $expected_single_product_template_without_whitespace, '' );
+ }
}
diff --git a/woocommerce-gutenberg-products-block.php b/woocommerce-gutenberg-products-block.php
index a227d66288a..eb16d36f6c3 100644
--- a/woocommerce-gutenberg-products-block.php
+++ b/woocommerce-gutenberg-products-block.php
@@ -3,7 +3,7 @@
* Plugin Name: WooCommerce Blocks
* Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block
* Description: WooCommerce blocks for the Gutenberg editor.
- * Version: 10.0.0
+ * Version: 10.0.1
* Author: Automattic
* Author URI: https://woocommerce.com
* Text Domain: woo-gutenberg-products-block