diff --git a/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/product-price/index.js b/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/product-price/index.js
index 9b05ce58943..85e64c16529 100644
--- a/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/product-price/index.js
+++ b/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/product-price/index.js
@@ -1,6 +1,7 @@
/**
* External dependencies
*/
+import { __ } from '@wordpress/i18n';
import FormattedMonetaryAmount from '@woocommerce/base-components/formatted-monetary-amount';
import classNames from 'classnames';
import PropTypes from 'prop-types';
@@ -11,20 +12,38 @@ import PropTypes from 'prop-types';
import './style.scss';
const ProductPrice = ( { className, currency, regularValue, value } ) => {
+ const isDiscounted =
+ Number.isFinite( regularValue ) && regularValue !== value;
return (
<>
- { Number.isFinite( regularValue ) && regularValue !== value && (
-
+ { isDiscounted && (
+ <>
+
+ { __(
+ 'Previous price:',
+ 'woo-gutenberg-products-block'
+ ) }
+
+
+
+ { __(
+ 'Discounted price:',
+ 'woo-gutenberg-products-block'
+ ) }
+
+ >
) }
diff --git a/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/product-price/style.scss b/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/product-price/style.scss
index cf5e5e3d8d4..4e5871fc365 100644
--- a/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/product-price/style.scss
+++ b/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/product-price/style.scss
@@ -1,12 +1,12 @@
.wc-block-product-price {
color: $black;
+
+ &.is-discounted {
+ margin-left: 0.5em;
+ }
}
.wc-block-product-price--regular {
color: $core-grey-dark-400;
text-decoration: line-through;
-
- + .wc-block-product-price {
- margin-left: 0.5em;
- }
}
diff --git a/plugins/woocommerce-blocks/assets/js/base/components/checkout/form-step/style.scss b/plugins/woocommerce-blocks/assets/js/base/components/checkout/form-step/style.scss
index c6c0b89c6de..2130303261b 100644
--- a/plugins/woocommerce-blocks/assets/js/base/components/checkout/form-step/style.scss
+++ b/plugins/woocommerce-blocks/assets/js/base/components/checkout/form-step/style.scss
@@ -11,10 +11,6 @@ $line-offset-from-circle-size: 8px;
padding: 0 $gap-larger $gap-larger $gap-larger;
background: none;
margin: 0;
-
- &:last-child::before {
- content: none;
- }
}
.wc-block-checkout-step__heading {
@@ -54,20 +50,7 @@ $line-offset-from-circle-size: 8px;
margin-bottom: $gap-large;
}
-// because themes can register different background colors, we can't always
-// relay on using white border to offest the step left line,
.wc-block-checkout-step::before {
- content: "";
- // 1 Circle size + offset of the first circle and next circle.
- height: calc(100% - #{$circle-size + $line-offset-from-circle-size * 2});
- width: 1px;
- background-color: $gray-10;
- position: absolute;
- left: $circle-size/2;
- top: $circle-size + $line-offset-from-circle-size;
-}
-
-.wc-block-checkout-step::after {
counter-increment: checkout-step;
content: counter(checkout-step);
position: absolute;
@@ -83,3 +66,20 @@ $line-offset-from-circle-size: 8px;
border-radius: $circle-size / 2;
box-sizing: content-box;
}
+
+// because themes can register different background colors, we can't always
+// relay on using white border to offest the step left line,
+.wc-block-checkout-step::after {
+ content: "";
+ // 1 Circle size + offset of the first circle and next circle.
+ height: calc(100% - #{$circle-size + $line-offset-from-circle-size * 2});
+ width: 1px;
+ background-color: $gray-10;
+ position: absolute;
+ left: $circle-size/2;
+ top: $circle-size + $line-offset-from-circle-size;
+}
+
+.wc-block-checkout-step:last-child::after {
+ content: none;
+}
diff --git a/plugins/woocommerce-blocks/assets/js/base/components/shipping-rates-control/index.js b/plugins/woocommerce-blocks/assets/js/base/components/shipping-rates-control/index.js
index 3072a5a0fef..ec7d8709c3f 100644
--- a/plugins/woocommerce-blocks/assets/js/base/components/shipping-rates-control/index.js
+++ b/plugins/woocommerce-blocks/assets/js/base/components/shipping-rates-control/index.js
@@ -1,8 +1,10 @@
/**
* External dependencies
*/
-import { __ } from '@wordpress/i18n';
+import { __, _n, sprintf } from '@wordpress/i18n';
+import { useEffect } from 'react';
import PropTypes from 'prop-types';
+import { speak } from '@wordpress/a11y';
/**
* Internal dependencies
@@ -19,6 +21,62 @@ const ShippingRatesControl = ( {
noResultsMessage,
renderOption,
} ) => {
+ useEffect( () => {
+ if ( shippingRatesLoading ) {
+ return;
+ }
+ const packages = shippingRates.length;
+ const shippingOptions = shippingRates.reduce(
+ ( acc, shippingRate ) => acc + shippingRate.shipping_rates.length,
+ 0
+ );
+ if ( shippingOptions === 0 ) {
+ speak(
+ __(
+ 'No shipping options were found.',
+ 'woo-gutenberg-products-block'
+ )
+ );
+ } else if ( packages === 1 ) {
+ speak(
+ sprintf(
+ // translators: %d number of shipping options found.
+ _n(
+ '%d shipping option was found.',
+ '%d shipping options were found.',
+ shippingOptions,
+ 'woo-gutenberg-products-block'
+ ),
+ shippingOptions
+ )
+ );
+ } else {
+ speak(
+ sprintf(
+ // translators: %d number of shipping packages packages.
+ _n(
+ 'Shipping option searched for %d package.',
+ 'Shipping options searched for %d packages.',
+ packages,
+ 'woo-gutenberg-products-block'
+ ),
+ packages
+ ) +
+ ' ' +
+ sprintf(
+ // translators: %d number of shipping options available.
+ _n(
+ '%d shipping option was found',
+ '%d shipping options were found',
+ shippingOptions,
+ 'woo-gutenberg-products-block'
+ ),
+ shippingOptions
+ )
+ );
+ }
+ }, [ shippingRatesLoading, shippingRates ] );
+
return (
{ ! isCheckout && showingRates && (
diff --git a/plugins/woocommerce-blocks/assets/js/base/components/totals/totals-shipping-item/shipping-rate-selector.js b/plugins/woocommerce-blocks/assets/js/base/components/totals/totals-shipping-item/shipping-rate-selector.js
index 2c745b1a6df..e9ec0860f48 100644
--- a/plugins/woocommerce-blocks/assets/js/base/components/totals/totals-shipping-item/shipping-rate-selector.js
+++ b/plugins/woocommerce-blocks/assets/js/base/components/totals/totals-shipping-item/shipping-rate-selector.js
@@ -24,14 +24,20 @@ const renderShippingRatesControlOption = ( option ) => ( {
),
} );
-const ShippingRateSelector = ( { shippingRates, shippingRatesLoading } ) => {
+const ShippingRateSelector = ( {
+ hasRates,
+ shippingRates,
+ shippingRatesLoading,
+} ) => {
return (