cancel
Showing results for 
Search instead for 
Did you mean: 

Set custom css for payment method icon

Set custom css for payment method icon

I have in my html code 

<img class="payment-icon"
                 alt="Logo"
                 data-bind="attr: {src: getLogo(), alt: $t('Logo')}"
                 style="max-height: 1.7em"/>

and in my js code i have 

GetLogo: function () {
                return window.checkoutConfig.payment[this.getCode()].logo;
            },

But now i want to change my style depending on custom switch. 

Is there any way I can control css from my js code?

3 REPLIES 3

Re: Set custom css for payment method icon

Hi @bartoszcoye941 ,

 

Selected payment method class uses "payment-method _active" class

Rest of the payment methods class uses "payment-method" class

 

Based on that you can create css in theme and apply it based on your requirement

 

Problem Solved? Accept as Solution!

 

Hope it helps!

Thanks

Ankit Jasani

Re: Set custom css for payment method icon


@Ankit Jasani wrote:

Hi @HISD Connect

 

Selected payment method class uses "payment-method _active" class

Rest of the payment methods class uses "payment-method" class

 

Based on that you can create css in theme and apply it based on your requirement

 

Problem Solved? Accept as Solution!

 

Hope it helps!

Thanks


Thank you for the suggestion, I was looking for the same.

Re: Set custom css for payment method icon

you can also change the payment icons by using CSS. Method 1: Editing Code in Your Theme’s Settings. Method 2: Using a Shopify Plugin or App. You can use this both methods to set custom css for payment method icon.  Caregiver Connect Aurora