Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save PiotrKrzyzek/a4dcbe149d6d112772df9a5933ea28c1 to your computer and use it in GitHub Desktop.
Save PiotrKrzyzek/a4dcbe149d6d112772df9a5933ea28c1 to your computer and use it in GitHub Desktop.
WooCommerce: Hide Stripe gateway payment icons on checkout page
/*
* Pick and chose which payment icons you'd want to show on the checkout page
* next to he payment gateways. The default in this function is to hide them all.
* Primarily made for stripe
*/
add_filter( 'wc_stripe_payment_icons', 'show_hide_woocommerce_gateway_payment_icons' );
function show_hide_woocommerce_gateway_payment_icons( $icons ) {
$icon_list = [
"visa",
"amex",
"mastercard",
"discover",
"diners",
"jcb",
"alipay",
"wechat",
"bitcoin",
"bancontact",
"ideal",
"p24",
"giropay",
"eps",
"sofort",
"sepa"
];
foreach($icon_list as $icon)
$icons[$icon] = '';
return $icons;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment