Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Draft
- Fix `onThemeBundleMain` binding to `window` load instead of script element, guard `optionChangeDecorator` against null response on error, and fix `updateWalletButtonsView` crash on cart edit modal [#2615](https://github.com/bigcommerce/cornerstone/pull/2615)
- Add to Cart and quantity buttons disabled when BCData is empty [#2612](https://github.com/bigcommerce/cornerstone/pull/2612)
- Introduce strikethrough display for discounted shipping quote prices on cart page [#2611](https://github.com/bigcommerce/cornerstone/pull/2611)
- Render native language names on storefront using Intl.DisplayNames [#2607](https://github.com/bigcommerce/cornerstone/pull/2607)
Expand Down
3 changes: 2 additions & 1 deletion assets/js/theme/common/product-details-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const optionsTypesMap = {

export function optionChangeDecorator(areDefaultOptionsSet) {
return (err, response) => {
if (err) return;
const attributesData = response.data || {};
const attributesContent = response.content || {};

Expand Down Expand Up @@ -393,7 +394,7 @@ export default class ProductDetailsBase {

updateWalletButtonsView(data) {
const viewModel = this.getViewModel(this.$scope);
const isValidForm = viewModel.$addToCartForm[0].checkValidity();
const isValidForm = viewModel.$addToCartForm?.[0]?.checkValidity() ?? true;

this.toggleWalletButtonsVisibility(isValidForm && data.purchasable && data.instock);
}
Expand Down
6 changes: 5 additions & 1 deletion templates/layout/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@
const scriptElement = document.getElementById('theme-bundle-main');

if (scriptElement) {
addEventListener('load', onThemeBundleMain);
if (typeof window.stencilBootstrap === 'function') {
onThemeBundleMain();
} else {
scriptElement.addEventListener('load', onThemeBundleMain, { once: true });
}
} else {
console.error('Could not find script element with id "theme-bundle-main"');
}
Expand Down