Payment method icons in the checkout page
-
Hello,
Can you please let me know if the theme is hiding payment method icons?
I would like to add payment icons for credit cards for example (I use stripe), but even with custom code below I can’t get it to work .
Thanks.
add_filter( 'woocommerce_gateway_icon', 'sort_stripe_payment_icons', 10, 2 );
function sort_stripe_payment_icons( $icons_str, $payment_id ) {
if ( $payment_id === 'stripe' && is_checkout() ) {
$available_gateways = WC()->payment_gateways->get_available_payment_gateways();
$stripe = $available_gateways['stripe'];
$icons = $stripe->payment_icons();
$icons_str = '';
$icons_str .= isset( $icons['amex'] ) ? $icons['amex'] : '';
$icons_str .= isset( $icons['visa'] ) ? $icons['visa'] : '';
$icons_str .= isset( $icons['mastercard'] ) ? $icons['mastercard'] : '';
}
return $icons_str;
}
Hello,
Please check how it works with the default wordpress theme. Because the checkout in woocommerce functionality and our theme doesn’t influence.
Best Regards