* Fix PHP notice in Mini Cart when prices included taxes (https://github.com/woocommerce/woocommerce-blocks/pull/6537)

* Replace instances of wp_is_block_theme() with wc_current_theme_is_fse_theme() (https://github.com/woocommerce/woocommerce-blocks/pull/6590)

* Empty commit for release pull request

* Add 7.6.1 changelog to readme.txt

* Add Testing steps for version 7.6.1

* Bump versions to 7.6.1-dev

* Update testing ZIP

* Remove wrong testing step

* Bumping version strings to new version.

* Fix images hidden by default in Product grid blocks (https://github.com/woocommerce/woocommerce-blocks/pull/6599)

* update changelog and testing instructons

* Empty commit for release pull request

* upload zip

* update readme

* Bumping version strings to new version.

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
This commit is contained in:
github-actions[bot] 2022-06-20 14:57:08 +02:00 committed by GitHub
parent b762b59258
commit a35b67cd0f
12 changed files with 83 additions and 13 deletions

View File

@ -14,12 +14,15 @@ import { ToggleControl } from '@wordpress/components';
*/
const GridContentControl = ( { onChange, settings } ) => {
const { image, button, price, rating, title } = settings;
// If `image` is undefined, that might be because it's a block that was
// created before the `image` attribute existed, so we default to true.
const imageIsVisible = image !== false;
return (
<>
<ToggleControl
label={ __( 'Product image', 'woo-gutenberg-products-block' ) }
help={
image
imageIsVisible
? __(
'Product image is visible.',
'woo-gutenberg-products-block'
@ -29,8 +32,10 @@ const GridContentControl = ( { onChange, settings } ) => {
'woo-gutenberg-products-block'
)
}
checked={ image }
onChange={ () => onChange( { ...settings, image: ! image } ) }
checked={ imageIsVisible }
onChange={ () =>
onChange( { ...settings, image: ! imageIsVisible } )
}
/>
<ToggleControl
label={ __( 'Product title', 'woo-gutenberg-products-block' ) }

View File

@ -0,0 +1,34 @@
# Testing notes and ZIP for release 7.6.1
Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/8927877/woocommerce-gutenberg-products-block.zip)
## Feature plugin and package inclusion in WooCommerce
### Fix PHP notice in Mini Cart when prices included taxes. ([6537](https://github.com/woocommerce/woocommerce-blocks/pull/6537))
1. Go to _WooCommerce_ > _Settings_ and check _Enable tax rates and calculations_.
2. Go to the _Tax_ tab in the settings and check _Yes, I will enter prices inclusive of tax_ and _Display prices during cart and checkout: Including tax_.
3. Add the Mini Cart block to a post or page.
4. Visit that post or page in the frontend, and verify there isn't a PHP notice.
| Before | After |
|-------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| ![Screenshot showing a PHP warning](https://user-images.githubusercontent.com/3616980/172639823-1b671ac0-58ea-4f4b-9b00-aa481d4acd72.png) | ![Screenshot showing no PHP warning](https://user-images.githubusercontent.com/3616980/172639911-7a1416fe-f49d-4c58-90b7-7e07637b1777.png) |
### Replace instances of wp_is_block_theme() with wc_current_theme_is_fse_theme(). ([6590](https://github.com/woocommerce/woocommerce-blocks/pull/6590))
**Templates logic:**
1. With a block theme.
2. Go to Appearance > Editor and verify you can modify the WooCommerce templates: Products by Tag, Products by Category, Single Product or Product Catalog (don't test Product Search template yet).
3. Do some smoke testing: make an edit, save it, go to the frontend and verify the change has been applied, restore the template, etc.).
**Product Search template:**
1. With a block theme.
2. Go to Appearance > Editor and verify you can modify the Product Search Results template.
3. Do some smoke testing: make an edit, save it, go to the frontend and verify the change has been applied, restore the template, etc.).
**Mini Cart link:**
1. With a block theme.
2. In a post or page, add the Mini Cart block.
3. In the sidebar, click on _Edit Mini Cart template part(opens in a new tab)_.
4. Verify you land in the template part editor, editing the Mini Cart block.

View File

@ -0,0 +1,16 @@
# Testing notes and ZIP for release 7.6.2
Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/8940540/woocommerce-gutenberg-products-block.zip)
## Feature plugin and package inclusion in WooCommerce
### Fix images hidden by default in Product grid blocks after WC 6.6 update. ([6599](https://github.com/woocommerce/woocommerce-blocks/pull/6599))
1. With WC core 6.5.1 and WC Blocks disabled, add a Handpicked Products block to a post or page.
2. Hide the Product price and Product rating using the sidebar toggles.
3. Publish the post or page.
4. Update to WC core to 6.6.0.
5. Notice the images are no longer visible.
6. Enable WC Blocks (with this branch).
7. Verify images are visible by default.
8. Verify you can still toggle the images.

View File

@ -71,6 +71,9 @@ Every release includes specific testing instructions for new features and bug fi
- [7.4.2](./742.md)
- [7.5.0](./750.md)
- [7.6.0](./760.md)
- [7.6.1](./761.md)
- [7.6.2](./762.md)
<!-- FEEDBACK -->
---

View File

@ -2,7 +2,7 @@
"name": "@woocommerce/block-library",
"title": "WooCommerce Blocks",
"author": "Automattic",
"version": "7.6.0",
"version": "7.6.2",
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/",
"keywords": [

View File

@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
Requires at least: 5.9
Tested up to: 5.9
Requires PHP: 7.0
Stable tag: 7.6.0
Stable tag: 7.6.2
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@ -86,6 +86,19 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/
== Changelog ==
= 7.6.2 - 2022-06-20 =
#### Bug Fixes
- Fix images hidden by default in Product grid blocks after WC 6.6 update. ([6599](https://github.com/woocommerce/woocommerce-blocks/pull/6599))
= 7.6.1 - 2022-06-17 =
### Bug Fixes
- Fix PHP notice in Mini Cart when prices included taxes. ([6537](https://github.com/woocommerce/woocommerce-blocks/pull/6537))
- Fix error Uncaught Error: Call to undefined function Automattic\WooCommerce\Blocks\Templates\wp_is_block_theme() in WP 5.8. ([6590](https://github.com/woocommerce/woocommerce-blocks/pull/6590))
= 7.6.0 - 2022-05-09 =
#### Enhancements

View File

@ -519,7 +519,7 @@ abstract class AbstractProductGrid extends AbstractDynamicBlock {
* @return string
*/
protected function get_image_html( $product ) {
if ( empty( $this->attributes['contentVisibility']['image'] ) ) {
if ( array_key_exists( 'image', $this->attributes['contentVisibility'] ) && false === $this->attributes['contentVisibility']['image'] ) {
return '';
}

View File

@ -213,8 +213,7 @@ class MiniCart extends AbstractBlock {
if (
current_user_can( 'edit_theme_options' ) &&
function_exists( 'wp_is_block_theme' ) &&
wp_is_block_theme()
wc_current_theme_is_fse_theme()
) {
$theme_slug = BlockTemplateUtils::theme_has_template_part( 'mini-cart' ) ? wp_get_theme()->get_stylesheet() : BlockTemplateUtils::PLUGIN_SLUG;
$site_editor_uri = admin_url( 'site-editor.php' );
@ -447,7 +446,7 @@ class MiniCart extends AbstractBlock {
);
}
return array(
'label_including_tax' => '',
'tax_label' => '',
'display_cart_prices_including_tax' => true,
);
}

View File

@ -106,7 +106,7 @@ class Package {
NewPackage::class,
function ( $container ) {
// leave for automated version bumping.
$version = '7.6.0';
$version = '7.6.2';
return new NewPackage(
$version,
dirname( __DIR__ ),

View File

@ -33,7 +33,7 @@ class ProductSearchResultsTemplate {
* @param array $templates Templates that match the search hierarchy.
*/
public function update_search_template_hierarchy( $templates ) {
if ( ( is_search() && is_post_type_archive( 'product' ) ) && wp_is_block_theme() ) {
if ( ( is_search() && is_post_type_archive( 'product' ) ) && wc_current_theme_is_fse_theme() ) {
return [ self::SLUG ];
}
return $templates;

View File

@ -366,7 +366,7 @@ class BlockTemplateUtils {
*/
public static function supports_block_templates() {
if (
( ! function_exists( 'wp_is_block_theme' ) || ! wp_is_block_theme() ) &&
! wc_current_theme_is_fse_theme() &&
( ! function_exists( 'gutenberg_supports_block_templates' ) || ! gutenberg_supports_block_templates() )
) {
return false;

View File

@ -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: 7.6.0
* Version: 7.6.2
* Author: Automattic
* Author URI: https://woocommerce.com
* Text Domain: woo-gutenberg-products-block