Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(payment): PAYPAL-5000 Quick pay buttons are seen on PDP before 'required' option selection #2532

Merged
merged 1 commit into from
Jan 24, 2025
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 @@ -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();
bc-alexsaiannyi marked this conversation as resolved.
Show resolved Hide resolved

this.toggleWalletButtonsVisibility(isValidForm && data.purchasable && data.instock);
}

toggleWalletButtonsVisibility(shouldShow) {
Expand Down
Loading