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

Commit

Permalink
Release: 11.4.4 (#11624)
Browse files Browse the repository at this point in the history
* Empty commit for release pull request

* Enhancement/New blockified Order Confirmation on new installs with block-based themes (#11615)

* Use new blockified Order Confirmation on blocks themes

* Handle translations on the new blockified Order Confirmation

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Paulo Arromba <[email protected]>
  • Loading branch information
3 people authored Nov 7, 2023
1 parent 79d42c9 commit 3f33c75
Show file tree
Hide file tree
Showing 15 changed files with 181 additions and 20 deletions.
3 changes: 2 additions & 1 deletion assets/js/base/components/product-rating/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ $line-height: 1.618;

.wc-block-components-product-rating {
display: block;
line-height: 1;

span {
line-height: $line-height;
Expand All @@ -26,6 +25,7 @@ $line-height: 1.618;

&::before {
content: "\53\53\53\53\53";
line-height: $line-height;
top: 0;
left: 0;
right: 0;
Expand All @@ -50,6 +50,7 @@ $line-height: 1.618;
right: 0;
position: absolute;
color: inherit;
line-height: $line-height;
white-space: nowrap;
}
}
Expand Down
2 changes: 0 additions & 2 deletions assets/js/blocks/rating-filter/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@

.wc-block-components-product-rating__stars {
display: inline-block;
line-height: 1;
height: 1em;
}

.wc-blocks-components-form-token-field-wrapper {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://woocommerce.com/",
"type": "wordpress-plugin",
"version": "11.4.3",
"version": "11.4.4",
"keywords": [
"gutenberg",
"woocommerce",
Expand Down
34 changes: 34 additions & 0 deletions docs/internal-developers/testing/releases/1144.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Testing notes and ZIP for release 11.4.4

Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-blocks/files/13279921/woocommerce-gutenberg-products-block.zip)

## WooCommerce Core

### Enhancements

#### Enabled the new blockified Order Confirmation by default for block-based themes. [11615](https://github.com/woocommerce/woocommerce-blocks/pull/11615)

1. On a brand new WC installation enable a block based theme (eg TT3)
2. Place a dummy order
3. Verify the Thank you page displayed after placing an order renders the new blockified Order Confirmation (see attached printscreen)
4. Change the website language. Repeat steps 2 & 3 and verify that the headings get properly translated.
5. Go to Appearance > Site Editor > Templates > Manage all templates. Verify that the blockified Order Confirmation displays properly, saving changes work and they get reflected on a new order.

<img width="1361" alt="image" src="https://github.com/woocommerce/woocommerce-blocks/assets/17236129/f619ccaa-d2dc-4189-8760-86837cf4014f">

### Bug Fixes

#### Filter By Rating: fix overlapping stars. [11644](https://github.com/woocommerce/woocommerce-blocks/pull/11644)

1. Ensure that you have two products with different reviews and different ratings.
2. Create a new post.
3. Adds the Filter By Rating, Product Collection blocks and Product Collection 3 Columns pattern.
4. Ensure that the stars are rendered correctly.
5. Save the post.
6. Visit the post.
7. Ensure that the stars are rendered correctly.
8. Please, pay attention and ensure that the star is aligned with "no review" (for the products that doesn't have the review)

| Before | After |
| ------ | ----- |
| <img src="https://user-images.githubusercontent.com/3323310/280986124-5373fb47-8708-4bab-961d-e750eeb2d1ab.png" width='50%'>| ![image](https://github.com/woocommerce/woocommerce-blocks/assets/4463174/c0b2bb9c-c2e9-45d0-8a16-27c7f2a82776)|
1 change: 1 addition & 0 deletions docs/internal-developers/testing/releases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ Every release includes specific testing instructions for new features and bug fi
- [11.4.1](./1141.md)
- [11.4.2](./1142.md)
- [11.4.3](./1143.md)
- [11.4.4](./1144.md)

<!-- FEEDBACK -->

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@woocommerce/block-library",
"title": "WooCommerce Blocks",
"author": "Automattic",
"version": "11.4.3",
"version": "11.4.4",
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/",
"keywords": [
Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: gutenberg, woocommerce, woo commerce, products, blocks, woocommerce blocks
Requires at least: 6.3.2
Tested up to: 6.3.2
Requires PHP: 7.4
Stable tag: 11.4.3
Stable tag: 11.4.4
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -81,6 +81,12 @@ Release and roadmap notes available on the [WooCommerce Developers Blog](https:/

== Changelog ==

= 11.4.4 - 2023-11-06 =

#### Enhancements

- Enabled the new blockified Order Confirmation by default for block-based themes. [11615](https://github.com/woocommerce/woocommerce-blocks/pull/11615)

= 11.4.3 - 2023-10-30 =

#### Enhancements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
* AbstractOrderConfirmationBlock class.
*/
abstract class AbstractOrderConfirmationBlock extends AbstractBlock {
/**
* Initialize this block type.
*
* - Hook into WP lifecycle.
* - Register the block with WordPress.
*/
protected function initialize() {
parent::initialize();
add_action( 'wp_loaded', array( $this, 'register_patterns' ) );
}

/**
* Get the content from a hook and return it.
*
Expand Down Expand Up @@ -244,4 +255,47 @@ protected function is_current_customer_order( $order ) {
protected function get_block_type_script( $key = null ) {
return null;
}

/**
* Register block pattern for Order Confirmation to make it translatable.
*/
public function register_patterns() {

register_block_pattern(
'woocommerce/order-confirmation-totals-heading',
array(
'title' => '',
'inserter' => false,
'content' => '<!-- wp:heading {"level":3,"style":{"typography":{"fontSize":"24px"}}} --><h3 class="wp-block-heading" style="font-size:24px">' . esc_html__( 'Order details', 'woo-gutenberg-products-block' ) . '</h3><!-- /wp:heading -->',
)
);

register_block_pattern(
'woocommerce/order-confirmation-downloads-heading',
array(
'title' => '',
'inserter' => false,
'content' => '<!-- wp:heading {"level":3,"style":{"typography":{"fontSize":"24px"}}} --><h3 class="wp-block-heading" style="font-size:24px">' . esc_html__( 'Downloads', 'woo-gutenberg-products-block' ) . '</h3><!-- /wp:heading -->',
)
);

register_block_pattern(
'woocommerce/order-confirmation-shipping-heading',
array(
'title' => '',
'inserter' => false,
'content' => '<!-- wp:heading {"level":3,"style":{"typography":{"fontSize":"24px"}}} --><h3 class="wp-block-heading" style="font-size:24px">' . esc_html__( 'Shipping address', 'woo-gutenberg-products-block' ) . '</h3><!-- /wp:heading -->',
)
);

register_block_pattern(
'woocommerce/order-confirmation-billing-heading',
array(
'title' => '',
'inserter' => false,
'content' => '<!-- wp:heading {"level":3,"style":{"typography":{"fontSize":"24px"}}} --><h3 class="wp-block-heading" style="font-size:24px">' . esc_html__( 'Billing address', 'woo-gutenberg-products-block' ) . '</h3><!-- /wp:heading -->',
)
);

}
}
2 changes: 1 addition & 1 deletion src/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static function container( $reset = false ) {
NewPackage::class,
function ( $container ) {
// leave for automated version bumping.
$version = '11.4.3';
$version = '11.4.4';
return new NewPackage(
$version,
dirname( __DIR__ ),
Expand Down
42 changes: 38 additions & 4 deletions templates/templates/blockified/order-confirmation.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
<!-- wp:template-part {"slug":"header"} /-->
<!-- wp:group {"tagName": "main", "layout":{"inherit":true,"type":"constrained"}} -->
<main class="wp-block-group">
<!-- wp:woocommerce/legacy-template {"template":"order-confirmation"} /-->
</main>

<!-- wp:group {"tagName":"main","layout":{"inherit":true,"type":"constrained"}} -->
<main class="wp-block-group"><!-- wp:woocommerce/order-confirmation-status {"fontSize":"large"} /-->

<!-- wp:woocommerce/order-confirmation-summary /-->

<!-- wp:woocommerce/order-confirmation-totals-wrapper {"align":"wide"} -->
<!-- wp:pattern {"slug":"woocommerce/order-confirmation-totals-heading"} /-->

<!-- wp:woocommerce/order-confirmation-totals {"lock":{"remove":true}} /-->
<!-- /wp:woocommerce/order-confirmation-totals-wrapper -->

<!-- wp:woocommerce/order-confirmation-downloads-wrapper {"align":"wide"} -->
<!-- wp:pattern {"slug":"woocommerce/order-confirmation-downloads-heading"} /-->

<!-- wp:woocommerce/order-confirmation-downloads {"lock":{"remove":true}} /-->
<!-- /wp:woocommerce/order-confirmation-downloads-wrapper -->

<!-- wp:columns {"align":"wide","className":"woocommerce-order-confirmation-address-wrapper"} -->
<div class="wp-block-columns alignwide woocommerce-order-confirmation-address-wrapper"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:woocommerce/order-confirmation-shipping-wrapper {"align":"wide"} -->
<!-- wp:pattern {"slug":"woocommerce/order-confirmation-shipping-heading"} /-->

<!-- wp:woocommerce/order-confirmation-shipping-address {"lock":{"remove":true}} /-->
<!-- /wp:woocommerce/order-confirmation-shipping-wrapper --></div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column"><!-- wp:woocommerce/order-confirmation-billing-wrapper {"align":"wide"} -->
<!-- wp:pattern {"slug":"woocommerce/order-confirmation-billing-heading"} /-->

<!-- wp:woocommerce/order-confirmation-billing-address {"lock":{"remove":true}} /-->
<!-- /wp:woocommerce/order-confirmation-billing-wrapper --></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->

<!-- wp:woocommerce/order-confirmation-additional-information /--></main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer"} /-->
42 changes: 38 additions & 4 deletions templates/templates/order-confirmation.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
<!-- wp:template-part {"slug":"header"} /-->
<!-- wp:group {"tagName": "main", "layout":{"inherit":true,"type":"constrained"}} -->
<main class="wp-block-group">
<!-- wp:woocommerce/legacy-template {"template":"order-confirmation"} /-->
</main>

<!-- wp:group {"tagName":"main","layout":{"inherit":true,"type":"constrained"}} -->
<main class="wp-block-group"><!-- wp:woocommerce/order-confirmation-status {"fontSize":"large"} /-->

<!-- wp:woocommerce/order-confirmation-summary /-->

<!-- wp:woocommerce/order-confirmation-totals-wrapper {"align":"wide"} -->
<!-- wp:pattern {"slug":"woocommerce/order-confirmation-totals-heading"} /-->

<!-- wp:woocommerce/order-confirmation-totals {"lock":{"remove":true}} /-->
<!-- /wp:woocommerce/order-confirmation-totals-wrapper -->

<!-- wp:woocommerce/order-confirmation-downloads-wrapper {"align":"wide"} -->
<!-- wp:pattern {"slug":"woocommerce/order-confirmation-downloads-heading"} /-->

<!-- wp:woocommerce/order-confirmation-downloads {"lock":{"remove":true}} /-->
<!-- /wp:woocommerce/order-confirmation-downloads-wrapper -->

<!-- wp:columns {"align":"wide","className":"woocommerce-order-confirmation-address-wrapper"} -->
<div class="wp-block-columns alignwide woocommerce-order-confirmation-address-wrapper"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:woocommerce/order-confirmation-shipping-wrapper {"align":"wide"} -->
<!-- wp:pattern {"slug":"woocommerce/order-confirmation-shipping-heading"} /-->

<!-- wp:woocommerce/order-confirmation-shipping-address {"lock":{"remove":true}} /-->
<!-- /wp:woocommerce/order-confirmation-shipping-wrapper --></div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column"><!-- wp:woocommerce/order-confirmation-billing-wrapper {"align":"wide"} -->
<!-- wp:pattern {"slug":"woocommerce/order-confirmation-billing-heading"} /-->

<!-- wp:woocommerce/order-confirmation-billing-address {"lock":{"remove":true}} /-->
<!-- /wp:woocommerce/order-confirmation-billing-wrapper --></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->

<!-- wp:woocommerce/order-confirmation-additional-information /--></main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer"} /-->
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,5 @@ test.describe( 'Shopper → Checkout block → Shipping', () => {
overrideBillingDetails
);
await pageObject.verifyAddressDetails( 'shipping' );
await expect( page.getByText( FLAT_RATE_SHIPPING_NAME ) ).toBeVisible();
} );
} );
2 changes: 1 addition & 1 deletion tests/e2e/tests/checkout/checkout.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class CheckoutPage {
...this.testData,
...overrideAddressDetails,
};
const selector = `.woocommerce-column--${ shippingOrBilling }-address`;
const selector = `.wc-block-order-confirmation-${ shippingOrBilling }-address`;
const addressContainer = this.page.locator( selector );
await expect(
addressContainer.getByText( customerAddressDetails.firstname )
Expand Down
2 changes: 1 addition & 1 deletion woocommerce-gutenberg-products-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -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: 11.4.3
* Version: 11.4.4
* Author: Automattic
* Author URI: https://woocommerce.com
* Text Domain: woo-gutenberg-products-block
Expand Down

0 comments on commit 3f33c75

Please sign in to comment.