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

feature(storefront): BCTHEME-134 Incorrect focus order on PDPs #1771

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Draft

Incorrect focus order on PDPs. [#1771](https://github.com/bigcommerce/cornerstone/pull/1771)

## 4.9.0 (07-28-2020)
- Added correct alt text on image change in product view. [#1747](https://github.com/bigcommerce/cornerstone/pull/1747)
- Description tab is hidden in case of empty product descrioption. [#1746](https://github.com/bigcommerce/cornerstone/pull/1746)
Expand Down
12 changes: 12 additions & 0 deletions assets/scss/layouts/products/_productView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
margin-left: -(spacing("base"));
margin-right: -(spacing("base"));

display: flex;
flex-direction: column;
justify-content: flex-start;

@include breakpoint("medium") {
display: block;
}

.modal & {
padding-bottom: 0;
padding-top: 0;
Expand Down Expand Up @@ -47,6 +55,10 @@
.productView--quickView & {
position: relative;
}

&.product-data {
order: -1;
}
}

.productView-description {
Expand Down
118 changes: 59 additions & 59 deletions templates/components/products/product-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,65 @@
{{/if}}
{{/each}}

<section class="productView-details">
<section class="productView-images" data-image-gallery>
{{!--
Note that these image sizes are coupled to image sizes used in /assets/js/theme/common/product-details.js
for variant/rule image replacement
--}}
<figure class="productView-image"
data-image-gallery-main
{{#if product.main_image}}
data-zoom-image="{{getImageSrcset product.main_image (cdn theme_settings.default_image_product) 1x=theme_settings.zoom_size }}"
{{/if}}
>
<div class="productView-img-container">
{{!-- Remove the surrounding a-element if there is no main image. --}}
{{#if product.main_image}}
<a href="{{getImageSrcset product.main_image (cdn theme_settings.default_image_product) 1x=theme_settings.zoom_size}}"
target="_blank"{{#if schema}} itemprop="image"{{/if}}>
{{/if}}
{{> components/common/responsive-img
image=product.main_image
class="productView-image--default"
fallback_size=theme_settings.product_size
lazyload=theme_settings.lazyload_mode
default_image=theme_settings.default_image_product
otherAttributes="data-main-image"
}}
{{!-- Remove the surrounding a-element if there is no main image. --}}
{{#if product.main_image}}
</a>
{{/if}}
</div>
</figure>
<ul class="productView-thumbnails"{{#gt product.images.length 5}} data-slick='{
"infinite": false,
"mobileFirst": true,
"slidesToShow": 5,
"slidesToScroll": 1
}'{{/gt}}>
{{#each product.images}}
<li class="productView-thumbnail">
<a
class="productView-thumbnail-link"
href="{{getImageSrcset this (cdn ../theme_settings.default_image_product) 1x=../theme_settings.zoom_size}}"
data-image-gallery-item
data-image-gallery-new-image-url="{{getImageSrcset this (cdn ../theme_settings.default_image_product) 1x=../theme_settings.product_size}}"
data-image-gallery-new-image-srcset="{{getImageSrcset this use_default_sizes=true}}"
data-image-gallery-zoom-image-url="{{getImageSrcset this (cdn ../theme_settings.default_image_product) 1x=../theme_settings.zoom_size}}"
>
{{> components/common/responsive-img
image=this
fallback_size=../theme_settings.productview_thumb_size
lazyload=../theme_settings.lazyload_mode
}}
</a>
</li>
{{/each}}
</ul>
</section>

<section class="productView-details product-data">
<div class="productView-product">
<h1 class="productView-title" {{#if schema}}itemprop="name"{{/if}}>{{product.title}}</h1>
{{#if product.brand}}
Expand Down Expand Up @@ -155,64 +213,6 @@ <h2 class="productView-brand"{{#if schema}} itemprop="brand" itemscope itemtype=
</div>
</section>

<section class="productView-images" data-image-gallery>
{{!--
Note that these image sizes are coupled to image sizes used in /assets/js/theme/common/product-details.js
for variant/rule image replacement
--}}
<figure class="productView-image"
data-image-gallery-main
{{#if product.main_image}}
data-zoom-image="{{getImageSrcset product.main_image (cdn theme_settings.default_image_product) 1x=theme_settings.zoom_size }}"
{{/if}}
>
<div class="productView-img-container">
{{!-- Remove the surrounding a-element if there is no main image. --}}
{{#if product.main_image}}
<a href="{{getImageSrcset product.main_image (cdn theme_settings.default_image_product) 1x=theme_settings.zoom_size}}"
target="_blank"{{#if schema}} itemprop="image"{{/if}}>
{{/if}}
{{> components/common/responsive-img
image=product.main_image
class="productView-image--default"
fallback_size=theme_settings.product_size
lazyload=theme_settings.lazyload_mode
default_image=theme_settings.default_image_product
otherAttributes="data-main-image"
}}
{{!-- Remove the surrounding a-element if there is no main image. --}}
{{#if product.main_image}}
</a>
{{/if}}
</div>
</figure>
<ul class="productView-thumbnails"{{#gt product.images.length 5}} data-slick='{
"infinite": false,
"mobileFirst": true,
"slidesToShow": 5,
"slidesToScroll": 1
}'{{/gt}}>
{{#each product.images}}
<li class="productView-thumbnail">
<a
class="productView-thumbnail-link"
href="{{getImageSrcset this (cdn ../theme_settings.default_image_product) 1x=../theme_settings.zoom_size}}"
data-image-gallery-item
data-image-gallery-new-image-url="{{getImageSrcset this (cdn ../theme_settings.default_image_product) 1x=../theme_settings.product_size}}"
data-image-gallery-new-image-srcset="{{getImageSrcset this use_default_sizes=true}}"
data-image-gallery-zoom-image-url="{{getImageSrcset this (cdn ../theme_settings.default_image_product) 1x=../theme_settings.zoom_size}}"
>
{{> components/common/responsive-img
image=this
fallback_size=../theme_settings.productview_thumb_size
lazyload=../theme_settings.lazyload_mode
}}
</a>
</li>
{{/each}}
</ul>
</section>

<section class="productView-details">
<div class="productView-options">
{{#if product.release_date }}
Expand Down