mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Merge pull request #1485 from woocommerce/PCP-1788-filter-to-conditionally-block-the-pay-pal-buttons
Filter to conditionally block the PayPal buttons (1788)
This commit is contained in:
commit
17a346cfc9
9 changed files with 199 additions and 48 deletions
|
@ -132,21 +132,10 @@ const bootstrap = () => {
|
|||
}
|
||||
};
|
||||
|
||||
let smartButtonsOptions = {
|
||||
onInit: null,
|
||||
init: function (actions) {
|
||||
this.actions = actions;
|
||||
if (typeof this.onInit === 'function') {
|
||||
this.onInit();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const onSmartButtonsInit = (data, actions) => {
|
||||
const onSmartButtonsInit = () => {
|
||||
buttonsSpinner.unblock();
|
||||
smartButtonsOptions.init(actions);
|
||||
};
|
||||
const renderer = new Renderer(creditCardRenderer, PayPalCommerceGateway, onSmartButtonClick, onSmartButtonsInit, smartButtonsOptions);
|
||||
const renderer = new Renderer(creditCardRenderer, PayPalCommerceGateway, onSmartButtonClick, onSmartButtonsInit);
|
||||
const messageRenderer = new MessageRenderer(PayPalCommerceGateway.messages);
|
||||
if (context === 'mini-cart' || context === 'product') {
|
||||
if (PayPalCommerceGateway.mini_cart_buttons_enabled === '1') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue