Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Custom WooCommerce icons for Stripe
// Custom Credit Card Icons
add_filter ('woocommerce_gateway_icon', 'custom_woocommerce_icons');
function custom_woocommerce_icons() {
$icon = '<img src="' . trailingslashit( get_template_directory_uri() ) . 'img/build/svg/visa.svg' . '" alt="Visa" />';
$icon .= '<img src="' . trailingslashit( get_template_directory_uri() ) . 'img/build/svg/mastercard.svg' . '" alt="Mastercard" />';
$icon .= '<img src="' . trailingslashit( get_template_directory_uri() ) . 'img/build/svg/amex.svg' . '" alt="American Express" />';
$icon .= '<img src="' . trailingslashit( get_template_directory_uri() ) . 'img/build/svg/discover.svg' . '" alt="Visa" />';
$icon .= '<img src="' . trailingslashit( get_template_directory_uri() ) . 'img/build/svg/jcb.svg' . '" alt="JCB" />';
$icon .= '<img src="' . trailingslashit( get_template_directory_uri() ) . 'img/build/svg/diners.svg' . '" alt="Diners Club" />';
return $icon;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment