Skip to content

Commit

Permalink
feat-payment): PAYPAL-1682 hide PDP wallet buttons container in the p…
Browse files Browse the repository at this point in the history
…roduct is not purchasable or out of stock
  • Loading branch information
serhii-tkachenko committed Sep 30, 2022
1 parent 26db3c7 commit 8915fdd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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

0 comments on commit 8915fdd

Please sign in to comment.