Hi,
How do I change the Woocommerce/ Stripe credit card icons on the checkout page? I’ve tried different codes and once implemented they change all logos and not just the credit cards ones. I have successfully change the Paypal logo so it is fine. Yes, I have also checked the forum, but nothing so far. How can I adjust this code so that it affects credit card icons only and not Paypal, Alipay, or anything else? I would like to be able to add other icons beside the originals. Additionally, how do I make Alipay Icon bigger?
// 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;
}
Or would it be possible to use an image that displays all icons rather than adding each individually?
// Add Custom Credit Card Icons to WooCommerce Checkout Page
add_filter ('woocommerce_gateway_icon', 'njengah_custom_woocommerce_icons');
function njengah_custom_woocommerce_icons() {
$icon = '<img src="icons-url" alt="stripe" />';
return $icon;
}