Skip to content

Commit

Permalink
feat(payment): PAYPAL-5000 updated check for showing/hiding available…
Browse files Browse the repository at this point in the history
… wallet buttons
  • Loading branch information
bc-nick committed Jan 10, 2025
1 parent dc164d5 commit 6e8623f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,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)
Expand Down
6 changes: 5 additions & 1 deletion assets/js/theme/common/product-details-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 6e8623f

Please sign in to comment.