• Resolved alexsina

    (@alexsina)


    Hello,

    By default, there is only credit card and debit card text on checkout, but no supported credit card icons, we found lots of users ignored the credit card payment because it is not friendly or easily to be noted.

    anyway to enable supported credit card icons? Or any alternative suggestions here?

    Thanks and have a nice day.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @alexsina,

    The PayPal Card Processing gateway has a dedicated setting to display gateway icons: https://woocommerce.com/document/woocommerce-paypal-payments/#paypal-card-processing

    You can choose between Visa, Mastercard, American Express, or Discover icons, depending on the availability: https://developer.paypal.com/docs/checkout/advanced/#link-eligibility

    There is currently no icon for the regular PayPal gateway, but you could add one with a filter like this: https://gist.github.com/InpsydeNiklas/9b384c86c4127a7bffc5446c328a647c
    With a filter like the one above, you can include any icon you like.

    Kind regards,
    Niklas

    Thread Starter alexsina

    (@alexsina)

    Hello,

    Thanks for reply.

    I test this code at https://gist.github.com/InpsydeNiklas/9b384c86c4127a7bffc5446c328a647c

    I am not code background, may I ask for code lines to support multiple icons please?

    Thanks

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @alexsina,

    The PayPal Card Processing gateway has a feature to display multiple icons. But the filter used to add an icon to the PayPal gateway would need some adjustments.
    It’s definitely not the best way to do it, but you could add multiple icons just like this:

    function woocommerce_paypal_payments_gateway_icon( $icon, $id ) {
        if ( $id === 'ppcp-gateway' ) {
            return '<img src="https://upload.wikimedia.org/wikipedia/commons/2/2a/Mastercard-logo.svg" alt="Mastercard" /> <img src="https://upload.wikimedia.org/wikipedia/commons/0/04/Visa.svg" alt="Visa" /> <img src="https://www.paypalobjects.com/webstatic/mktg/Logo/pp-logo-100px.png" alt="PayPal Payments" />'; 
        } else {
            return $icon;
        }
    }
    add_filter( 'woocommerce_gateway_icon', 'woocommerce_paypal_payments_gateway_icon', 10, 2 );

    There are also other ways to approach this, like for example by combining multiple icons in to one image via image editing software like GIMP.
    Anyway, this can be made to look better but it’s the best example I could provide for the moment.
    I hope it helps in any case.

    Kind regards,
    Niklas

    Plugin Support Femi

    (@femiyb)

    Hi there

    We have not heard back from you in a while, so I’m marking this thread as resolved.
    Hopefully, the above information helped you out.
    If you have any further questions, please feel free to reopen this topic or create a new one.

    Cheers! ??`

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How manny kinds of credit card support?’ is closed to new replies.