diff --git a/CHANGELOG.md b/CHANGELOG.md index 33bd315224..1c9df58d58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support Stencil CLI's ESM migration. [#2500](https://github.com/bigcommerce/cornerstone/pull/2500) - Add missing icon for JCB card provider in the saved payment methods [#2489](https://github.com/bigcommerce/cornerstone/pull/2489) - Remove supporting Apple Pay button stylization [#2491](https://github.com/bigcommerce/cornerstone/pull/2491) +- Updated check for showing/hiding available wallet buttons on PDP [#2532](https://github.com/bigcommerce/cornerstone/pull/2532) - Fix GH build action & added package version and short commit hash to artifact names in GitHub Actions workflow for improved traceability and uniqueness [#2494](https://github.com/bigcommerce/cornerstone/pull/2494) - Bump stencil-utils to 6.18.0 [#2493](https://github.com/bigcommerce/cornerstone/pull/2493) - Bump other GH actions to fix warnings related to old versions [#2495](https://github.com/bigcommerce/cornerstone/pull/2495) diff --git a/assets/js/theme/common/product-details-base.js b/assets/js/theme/common/product-details-base.js index 547a0a8bb5..2cea7a44ae 100644 --- a/assets/js/theme/common/product-details-base.js +++ b/assets/js/theme/common/product-details-base.js @@ -182,6 +182,7 @@ export default class ProductDetailsBase { $weight: $('.productView-info [data-product-weight]', $scope), $increments: $('.form-field--increments :input', $scope), $addToCart: $('#form-action-addToCart', $scope), + $addToCartForm: $('form[data-cart-item-add]', $scope), $wishlistVariation: $('[data-wishlist-add] [name="variation_id"]', $scope), stock: { $container: $('.form-field--stock', $scope), @@ -373,7 +374,10 @@ export default class ProductDetailsBase { } updateWalletButtonsView(data) { - this.toggleWalletButtonsVisibility(data.purchasable && data.instock); + const viewModel = this.getViewModel(this.$scope); + const isValidForm = viewModel.$addToCartForm[0].checkValidity(); + + this.toggleWalletButtonsVisibility(isValidForm && data.purchasable && data.instock); } toggleWalletButtonsVisibility(shouldShow) {