Created
February 28, 2024 07:42
-
-
Save pramodjodhani/8ae7616875212e21991df32cc17c183a to your computer and use it in GitHub Desktop.
flux - payment plugin apple pay button relocate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( | |
'wp_head', | |
function() { | |
if ( is_checkout() ) { | |
?> | |
<style> | |
/* Hide the other express checkout containers generated by other gateway plugins. */ | |
.wc-stripe-banner-checkout, | |
.wc-ppcp-express-checkout { | |
display: none !important; | |
} | |
</style> | |
<script> | |
jQuery(document).ready( function() { | |
window.setTimeout( function() { | |
// Re-locate Paypal button. | |
jQuery( '#wc-ppcp-express-button' ).appendTo( jQuery( '.flux-express-checkout-wrap' ) ).wrap( "<div class='flux-express-checkout__btn'></div>" ); | |
// Re-locate Google Pay button. | |
jQuery( '.gpay-button-fill:first-child' ).appendTo( jQuery( '.flux-express-checkout-wrap' ) ).wrap( "<div class='flux-express-checkout__btn'></div>" ); | |
// Re-locate Apple Pay button. | |
jQuery( '.apple-pay-button' ).appendTo( jQuery( '.flux-express-checkout-wrap' ) ).wrap( "<div class='flux-express-checkout__btn'></div>" ); | |
}, 1000 ); | |
} ); | |
</script> | |
<?php | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment