Check single product and mini card setting for displaying PayPal buttons

This commit is contained in:
dinamiko 2021-07-12 17:16:26 +02:00
parent 2efb300be8
commit ab6f8a3c99
2 changed files with 24 additions and 20 deletions

View file

@ -18,15 +18,17 @@ const bootstrap = () => {
const messageRenderer = new MessageRenderer(PayPalCommerceGateway.messages);
const context = PayPalCommerceGateway.context;
if (context === 'mini-cart' || context === 'product') {
const miniCartBootstrap = new MiniCartBootstap(
PayPalCommerceGateway,
renderer
);
if (PayPalCommerceGateway.mini_card_buttons_enabled === '1') {
const miniCartBootstrap = new MiniCartBootstap(
PayPalCommerceGateway,
renderer
);
miniCartBootstrap.init();
miniCartBootstrap.init();
}
}
if (context === 'product') {
if (context === 'product' && PayPalCommerceGateway.single_product_buttons_enabled === '1') {
const singleProductBootstrap = new SingleProductBootstap(
PayPalCommerceGateway,
renderer,