Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 27806f2

Browse files
github-actions[bot]Aljullugithub-actionsgigitux
authored
Release: 7.6.2 (#6600)
* Fix PHP notice in Mini Cart when prices included taxes (#6537) * Replace instances of wp_is_block_theme() with wc_current_theme_is_fse_theme() (#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 (#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 <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: Luigi <[email protected]>
1 parent a5daa7b commit 27806f2

File tree

12 files changed

+83
-13
lines changed

12 files changed

+83
-13
lines changed

assets/js/editor-components/grid-content-control/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ import { ToggleControl } from '@wordpress/components';
1414
*/
1515
const GridContentControl = ( { onChange, settings } ) => {
1616
const { image, button, price, rating, title } = settings;
17+
// If `image` is undefined, that might be because it's a block that was
18+
// created before the `image` attribute existed, so we default to true.
19+
const imageIsVisible = image !== false;
1720
return (
1821
<>
1922
<ToggleControl
2023
label={ __( 'Product image', 'woo-gutenberg-products-block' ) }
2124
help={
22-
image
25+
imageIsVisible
2326
? __(
2427
'Product image is visible.',
2528
'woo-gutenberg-products-block'
@@ -29,8 +32,10 @@ const GridContentControl = ( { onChange, settings } ) => {
2932
'woo-gutenberg-products-block'
3033
)
3134
}
32-
checked={ image }
33-
onChange={ () => onChange( { ...settings, image: ! image } ) }
35+
checked={ imageIsVisible }
36+
onChange={ () =>
37+
onChange( { ...settings, image: ! imageIsVisible } )
38+
}
3439
/>
3540
<ToggleControl
3641
label={ __( 'Product title', 'woo-gutenberg-products-block' ) }

docs/testing/releases/761.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Testing notes and ZIP for release 7.6.1
2+
3+
Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/8927877/woocommerce-gutenberg-products-block.zip)
4+
5+
## Feature plugin and package inclusion in WooCommerce
6+
7+
### Fix PHP notice in Mini Cart when prices included taxes. ([6537](https://github.com/woocommerce/woocommerce-blocks/pull/6537))
8+
9+
1. Go to _WooCommerce_ > _Settings_ and check _Enable tax rates and calculations_.
10+
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_.
11+
3. Add the Mini Cart block to a post or page.
12+
4. Visit that post or page in the frontend, and verify there isn't a PHP notice.
13+
14+
| Before | After |
15+
|-------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
16+
| ![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) |
17+
18+
### Replace instances of wp_is_block_theme() with wc_current_theme_is_fse_theme(). ([6590](https://github.com/woocommerce/woocommerce-blocks/pull/6590))
19+
20+
**Templates logic:**
21+
1. With a block theme.
22+
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).
23+
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.).
24+
25+
**Product Search template:**
26+
1. With a block theme.
27+
2. Go to Appearance > Editor and verify you can modify the Product Search Results template.
28+
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.).
29+
30+
**Mini Cart link:**
31+
1. With a block theme.
32+
2. In a post or page, add the Mini Cart block.
33+
3. In the sidebar, click on _Edit Mini Cart template part(opens in a new tab)_.
34+
4. Verify you land in the template part editor, editing the Mini Cart block.

docs/testing/releases/762.md

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

docs/testing/releases/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ Every release includes specific testing instructions for new features and bug fi
7171
- [7.4.2](./742.md)
7272
- [7.5.0](./750.md)
7373
- [7.6.0](./760.md)
74+
- [7.6.1](./761.md)
75+
- [7.6.2](./762.md)
76+
7477

7578
<!-- FEEDBACK -->
7679
---

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@woocommerce/block-library",
33
"title": "WooCommerce Blocks",
44
"author": "Automattic",
5-
"version": "7.6.0",
5+
"version": "7.6.2",
66
"description": "WooCommerce blocks for the Gutenberg editor.",
77
"homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/",
88
"keywords": [

readme.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
44
Requires at least: 5.9
55
Tested up to: 5.9
66
Requires PHP: 7.0
7-
Stable tag: 7.6.0
7+
Stable tag: 7.6.2
88
License: GPLv3
99
License URI: https://www.gnu.org/licenses/gpl-3.0.html
1010

@@ -86,6 +86,19 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/
8686

8787
== Changelog ==
8888

89+
= 7.6.2 - 2022-06-20 =
90+
91+
#### Bug Fixes
92+
93+
- Fix images hidden by default in Product grid blocks after WC 6.6 update. ([6599](https://github.com/woocommerce/woocommerce-blocks/pull/6599))
94+
95+
= 7.6.1 - 2022-06-17 =
96+
97+
### Bug Fixes
98+
99+
- Fix PHP notice in Mini Cart when prices included taxes. ([6537](https://github.com/woocommerce/woocommerce-blocks/pull/6537))
100+
- 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))
101+
89102
= 7.6.0 - 2022-05-09 =
90103

91104
#### Enhancements

src/BlockTypes/AbstractProductGrid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ protected function render_product( $product ) {
519519
* @return string
520520
*/
521521
protected function get_image_html( $product ) {
522-
if ( empty( $this->attributes['contentVisibility']['image'] ) ) {
522+
if ( array_key_exists( 'image', $this->attributes['contentVisibility'] ) && false === $this->attributes['contentVisibility']['image'] ) {
523523
return '';
524524
}
525525

src/BlockTypes/MiniCart.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,7 @@ protected function enqueue_data( array $attributes = [] ) {
213213

214214
if (
215215
current_user_can( 'edit_theme_options' ) &&
216-
function_exists( 'wp_is_block_theme' ) &&
217-
wp_is_block_theme()
216+
wc_current_theme_is_fse_theme()
218217
) {
219218
$theme_slug = BlockTemplateUtils::theme_has_template_part( 'mini-cart' ) ? wp_get_theme()->get_stylesheet() : BlockTemplateUtils::PLUGIN_SLUG;
220219
$site_editor_uri = admin_url( 'site-editor.php' );
@@ -447,7 +446,7 @@ protected function get_tax_label() {
447446
);
448447
}
449448
return array(
450-
'label_including_tax' => '',
449+
'tax_label' => '',
451450
'display_cart_prices_including_tax' => true,
452451
);
453452
}

src/Package.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public static function container( $reset = false ) {
106106
NewPackage::class,
107107
function ( $container ) {
108108
// leave for automated version bumping.
109-
$version = '7.6.0';
109+
$version = '7.6.2';
110110
return new NewPackage(
111111
$version,
112112
dirname( __DIR__ ),

src/Templates/ProductSearchResultsTemplate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function init() {
3333
* @param array $templates Templates that match the search hierarchy.
3434
*/
3535
public function update_search_template_hierarchy( $templates ) {
36-
if ( ( is_search() && is_post_type_archive( 'product' ) ) && wp_is_block_theme() ) {
36+
if ( ( is_search() && is_post_type_archive( 'product' ) ) && wc_current_theme_is_fse_theme() ) {
3737
return [ self::SLUG ];
3838
}
3939
return $templates;

0 commit comments

Comments
 (0)