From e0962ae74ef8658f14a55e925abb0026e4f0aaf8 Mon Sep 17 00:00:00 2001 From: bc-yevhenii-buliuk Date: Wed, 18 Feb 2026 21:37:43 +0200 Subject: [PATCH] fix(storefront): SD-11524 Add to Cart and quantity buttons disabled on Integration store when BCData is empty --- CHANGELOG.md | 1 + assets/js/theme/common/product-details.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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();