Skip to content

Commit

Permalink
move the whole should init flag check to the parent function
Browse files Browse the repository at this point in the history
  • Loading branch information
timur27 committed Feb 21, 2025
1 parent c5a3a30 commit ebc1ff3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 0 additions & 6 deletions client/product-details/bnpl-site-messaging/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export const initializeBnplSiteMessaging = async () => {
isCart,
cartTotal,
shouldShowPMME,
shouldInitializePMME,
} = window.wcpayStripeSiteMessaging;

let amount;
Expand All @@ -64,11 +63,6 @@ export const initializeBnplSiteMessaging = async () => {
'payment-method-message'
);

if ( ! shouldInitializePMME ) {
paymentMessageContainer.style.setProperty( 'display', 'none' );
return;
}

if ( isCart ) {
amount = parseInt( cartTotal, 10 ) || 0;
elementLocation = 'bnplClassicCart';
Expand Down
4 changes: 4 additions & 0 deletions client/product-details/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jQuery( async function ( $ ) {
const { shouldInitializePMME } = window.wcpayStripeSiteMessaging;

if ( ! shouldInitializePMME ) {
const paymentMessageContainer = document.getElementById(
'payment-method-message'
);
paymentMessageContainer.style.setProperty( 'display', 'none' );
return;
}

Expand Down

0 comments on commit ebc1ff3

Please sign in to comment.