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-1682 hide PDP wallet buttons container when the product is not purchasable or out of stock #2267

Merged
merged 1 commit into from
Oct 3, 2022
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 @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Draft
- Migrate Cornerstone to new "Hide Price From Guests" functionality [#2262](https://github.com/bigcommerce/cornerstone/pull/2262)
- Add Accelerated buttons container into 'add to cart' popup on product details page [#2264](https://github.com/bigcommerce/cornerstone/pull/2264)
- Made PDP wallet buttons container hidden in cases when the product is not purchasable or out of stock [#2267](https://github.com/bigcommerce/cornerstone/pull/2267)

## 6.6.1 (09-14-2022)

Expand Down
3 changes: 3 additions & 0 deletions assets/js/theme/common/product-details-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export default class ProductDetailsBase {
$input: $('[name=qty\\[\\]]', $scope),
},
$bulkPricing: $('.productView-info-bulkPricing', $scope),
$walletButtons: $('[data-add-to-cart-wallet-buttons]', $scope),
};
}

Expand Down Expand Up @@ -345,9 +346,11 @@ export default class ProductDetailsBase {
if (!data.purchasable || !data.instock) {
viewModel.$addToCart.prop('disabled', true);
viewModel.$increments.prop('disabled', true);
viewModel.$walletButtons.hide();
} else {
viewModel.$addToCart.prop('disabled', false);
viewModel.$increments.prop('disabled', false);
viewModel.$walletButtons.show();
}
}

Expand Down
2 changes: 1 addition & 1 deletion templates/components/products/add-to-cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<span class="product-status-message aria-description--hidden">{{lang 'products.adding_to_cart'}} {{lang 'category.add_cart_announcement'}}</span>
</div>
{{#if this.with_wallet_buttons}}
<div class="add-to-cart-wallet-buttons">
<div class="add-to-cart-wallet-buttons" data-add-to-cart-wallet-buttons>
{{> components/common/wallet-buttons}}
</div>
{{/if}}
Expand Down