diff --git a/assets/js/wcpay-checkout.js b/assets/js/wcpay-checkout.js index e253edaef8a..86c659de1ef 100644 --- a/assets/js/wcpay-checkout.js +++ b/assets/js/wcpay-checkout.js @@ -29,6 +29,10 @@ jQuery( function( $ ) { cardElement.mount( '#wcpay-card-element' ); } ); + if ( $( 'form#add_payment_method' ).length || $( 'form#order_review' ).length ) { + cardElement.mount( '#wcpay-card-element' ); + } + // Update the validation state based on the element's state. cardElement.addEventListener( 'change', function( event ) { var displayError = jQuery( '#wcpay-errors' );