I would like to sort the Stripe displayed payment card icons in a different way in WooCommerce checkout.
WooCommerce Stripe plugin support does not provide custom code support so they just gave me a code snippet to modify according to my needs. This code snippet changes out the Visa payment icon:
add_filter( 'wc_stripe_payment_icons', 'change_my_icons' );
function change_my_icons( $icons ) {
// var_dump( $icons ); to show all possible icons to change.
$icons['visa'] = '<img src="https://shipyouridea.com/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/visa.svg" />';
return $icons;
}
Could someone please modify this code snippet to change the payment card icon order to Visa > Mastercard > Amex > Discover > JCB > Diners Club?
I would also like to completely remove the JCB and Diners Club payment icons. I'm currently using some custom CSS to hide these icons but was wondering if there's a better way.