Last active
February 23, 2021 13:07
-
-
Save vanbo/2c0d219239d89913c38f46288d141642 to your computer and use it in GitHub Desktop.
WooCommerce Pay360 replace checkout icons
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
/** | |
* IMPORTANT: Place the snippet inside your "wp-content\themes\child-theme\functions.php" file | |
*/ | |
/** | |
* Replace the Pay360 image in the checkout icon | |
*/ | |
add_filter( 'woocommerce_pay360_icon', 'vanbodevelops_pay360_icon', 10 ); | |
function vanbodevelops_pay360_icon( $image ) { | |
return WC_Pay360::plugin_url() . '/pay360-logo.png'; | |
} | |
/** | |
* Replace the html images in the place of the Pay360 icons | |
*/ | |
add_filter( 'woocommerce_gateway_icon', 'vanbodevelops_pay360_image_icons_html', 10, 2 ); | |
function vanbodevelops_pay360_image_icons_html( $icon, $gateway_id ) { | |
if ( 'pay360' != $gateway_id ) { | |
return $icon; | |
} | |
return '<img src="' . WC_HTTPS::force_https_url( WC()->plugin_url() . '/assets/images/icons/credit-cards/amex.svg' ) . '" alt="Amex Card" /> | |
<img src="' . WC_HTTPS::force_https_url( WC()->plugin_url() . '/assets/images/icons/credit-cards/visa.svg' ) . '" alt="Amex Card" />'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment