Support » Plugin: WooCommerce Stripe Payment Gateway » Stripe Card Icons

  • Resolved diggerdogsausage



    I am trying to change the default credit card icons that appear below the card number input box on the check out page. I have found the code below in the WooCommerce docs.

    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://mysite/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/visa.svg">';
        $icons['mastercard'] = '<img src="https://mysite/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/mastercard.svg">';
        $icons['jcb'] = '<img src="https://mysite/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/jcb.svg">';
        return $icons;

    The links to the icons are good as they display in the browser if I visit them. I am using the code snippets plugin to inject the code.

    However I can’t get anything to show. Nothing changes.

    Im hoping someone can point me in the right direction.

    I have flushed by browser cache, also Cloudflare and on the server side I purged varnish and restarted Ngnix.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Joey – a11n


    Hi @diggerdogsausage – Did you happen to change the URL to reflect your own site? It’s currently just https://mysite since it’s an example.

    Thread Starter diggerdogsausage


    Hi Joey

    thanks for the reply.
    yes, I changed it to mystie just for posting here.

    The actual code has my full site url. I check each icon link and the all correctly show the icons in the browser. I posted this in the general WooCommerce forum and the guy there tried it on his test site and the code works. So the issue is somewhere else I think. I have cleared all cache that I know of. I have no idea what to try next.

    Thread Starter diggerdogsausage


    the site is
    its in Japanese but pretty straight forward.

    Thread Starter diggerdogsausage


    I solved this issue. I was using the woocommerce blocks plugin which has the new style check out page. As soon as I reverted to the old style check out short code it all worked.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Stripe Card Icons’ is closed to new replies.