diff --git a/changelog/fix-pmme-on-cart-block b/changelog/fix-pmme-on-cart-block new file mode 100644 index 00000000000..97769b33edc --- /dev/null +++ b/changelog/fix-pmme-on-cart-block @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Init PMME container in cart block so that it can be dynamically rendered once the requirements are met. diff --git a/client/cart/blocks/index.js b/client/cart/blocks/index.js index 1e95ed42e13..d00195c1abe 100644 --- a/client/cart/blocks/index.js +++ b/client/cart/blocks/index.js @@ -2,26 +2,10 @@ * Internal dependencies */ import { renderBNPLCartMessaging } from './product-details'; -import { getUPEConfig } from 'wcpay/utils/checkout'; const { registerPlugin } = window.wp.plugins; -const paymentMethods = getUPEConfig( 'paymentMethodsConfig' ) || {}; - -const BNPL_PAYMENT_METHODS = { - AFFIRM: 'affirm', - AFTERPAY: 'afterpay_clearpay', - KLARNA: 'klarna', -}; - -const bnplPaymentMethods = Object.values( BNPL_PAYMENT_METHODS ).filter( - ( method ) => method in paymentMethods -); - -if ( bnplPaymentMethods.length ) { - // Register BNPL site messaging on the cart block. - registerPlugin( 'bnpl-site-messaging', { - render: renderBNPLCartMessaging, - scope: 'woocommerce-checkout', - } ); -} +registerPlugin( 'bnpl-site-messaging', { + render: renderBNPLCartMessaging, + scope: 'woocommerce-checkout', +} );