Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(storefront): BCTHEME-127 Product ratings on PDPs should have ari… #1769

Merged
merged 2 commits into from
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Draft
- Added additional focusable element for rating announcing. [#1769](https://github.com/bigcommerce/cornerstone/pull/1769)

## 4.9.0 (08-05-2020)

Expand Down
1 change: 1 addition & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@
"rating_label": "Rating",
"select_rating": "Select Rating",
"anonymous_poster": "Unknown",
"rating_aria_label": "Product rating is {current_rating} of {max_rating}",
"rating": {
"1": "1 star (worst)",
"2": "2 stars",
Expand Down
7 changes: 6 additions & 1 deletion templates/components/products/product-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ <h2 class="productView-brand"{{#if schema}} itemprop="brand" itemscope itemtype=
<meta itemprop="reviewCount" content="{{product.num_reviews}}">
{{/if}}
{{/if}}
{{> components/products/ratings rating=product.rating}}
<span title="{{lang 'products.reviews.rating_aria_label' current_rating=product.rating max_rating=5}}"
tabindex="0"
role="text"
>
{{> components/products/ratings rating=product.rating}}
</span>
<span class="productView-reviewLink">
{{#if product.num_reviews '>' 0}}
<a href="{{product.url}}#product-reviews">
Expand Down