Skip to content

Instantly share code, notes, and snippets.

@vanbo
Last active February 23, 2021 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanbo/2c0d219239d89913c38f46288d141642 to your computer and use it in GitHub Desktop.
Save vanbo/2c0d219239d89913c38f46288d141642 to your computer and use it in GitHub Desktop.
WooCommerce Pay360 replace checkout icons
/**
* 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