diff --git a/CHANGELOG.md b/CHANGELOG.md index d9045ecc0b..4dcf2ee3e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 +- 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) - CUST-4055 Add backend-based static translations for account edit page form fields [#2606](https://github.com/bigcommerce/cornerstone/pull/2606) diff --git a/assets/js/theme/common/product-details.js b/assets/js/theme/common/product-details.js index 33e7679c5c..b17bc972b8 100644 --- a/assets/js/theme/common/product-details.js +++ b/assets/js/theme/common/product-details.js @@ -92,7 +92,16 @@ export default class ProductDetails extends ProductDetailsBase { }); this.updateProductAttributes(productAttributesData); - this.updateView(productAttributesData, null); + + if (productAttributesData + && typeof productAttributesData === 'object' + && Object.keys(productAttributesData).length > 0) { + this.updateView(productAttributesData, null); + } else { + // eslint-disable-next-line no-console + console.warn('BCData.product_attributes is empty on product initialization'); + } + bannerUtils.dispatchProductBannerEvent(productAttributesData); $productOptionsElement.show();