diff --git a/CHANGELOG.md b/CHANGELOG.md index 04059221d7..94e5c2f9ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Draft +- Fixed announcement for product on adding to cart. [#1950](https://github.com/bigcommerce/cornerstone/pull/1950) - Fixed non-text contrast on add to cart modal according to WCAG AA standard. [#1946](https://github.com/bigcommerce/cornerstone/pull/1946) - Fixed announcement of reCAPTCHA hidden content by screen reader. [#1943](https://github.com/bigcommerce/cornerstone/pull/1943) - Carousel buttons do not receive focus. [#1937](https://github.com/bigcommerce/cornerstone/pull/1937) diff --git a/assets/js/theme/common/product-details.js b/assets/js/theme/common/product-details.js index 15382dfd53..cabb1fc130 100644 --- a/assets/js/theme/common/product-details.js +++ b/assets/js/theme/common/product-details.js @@ -334,6 +334,11 @@ export default class ProductDetails extends ProductDetailsBase { this.redirectTo(response.data.cart_item.cart_url || this.context.urls.cart); } }); + + $addToCartBtn.next().attr({ + role: 'status', + 'aria-live': 'polite', + }); } /** diff --git a/templates/components/products/add-to-cart.html b/templates/components/products/add-to-cart.html index a5421ffdd4..9ff3ade1d3 100644 --- a/templates/components/products/add-to-cart.html +++ b/templates/components/products/add-to-cart.html @@ -40,8 +40,14 @@

{{#or customer (if theme_settings.restrict_to_login '!==' true)}} -
- +
+ + {{lang 'products.adding_to_cart'}} {{lang 'category.add_cart_announcement'}}
{{/or}}