Support » Plugin: Payment Plugins for Stripe WooCommerce » Locale Gateways – select bank field – Custom CSS

  • Resolved panosp

    (@panosp)


    My congratulations on the wonderful plugin.
    I would like to change the text color “Select bank” on Locale Gateways to white. (I use a dark background)

    Is not responding with my Custom CSS editor.
    many Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @panosp,

    The reason your CSS editor is not working is because the bank selection field is contained within an iFrame and not hosted on your site. You must use the provided filters to alter the background color.

    Example:

    add_filter('wc_stripe_localize_script_local-payment', function($data){
        $data['element_params']['style'['base']['backgroundColor'] = '#000';
        return $data;
    })

    ;

    Kind Regards,

    Thread Starter panosp

    (@panosp)

    Thank you for your quick response.
    How do I use this?? Is it a Java script?

    Plugin Author Payment Plugins

    (@mrclayton)

    How do I use this?? Is it a Java script?

    It’s PHP and you would add it to your child theme’s functions.php file or use a code snippet plugin to add it. This example adds the semicolon at the end.

    add_filter('wc_stripe_localize_script_local-payment', function($data){
        $data['element_params']['style'['base']['backgroundColor'] = '#000';
        return $data;
    });
    Thread Starter panosp

    (@panosp)

    The code has a problem:

    Message:
    The code snippet you are trying to save produced a fatal error on line 2:
    syntax error, unexpected ‘;’, expecting ‘]’

    Plugin Author Payment Plugins

    (@mrclayton)

    add_filter('wc_stripe_localize_script_local-payment', function($data){
        $data['element_params']['style']['base']['backgroundColor'] = '#000';
        return $data;
    });
    Thread Starter panosp

    (@panosp)

    The code is working but there is no any change to text color “Select bank”

    Plugin Author Payment Plugins

    (@mrclayton)

    Whoops, the style change has to be made for all the gateways in the array.

    add_filter('wc_stripe_localize_script_local-payment', function($data){
    	foreach($data['gateways'] as $key => $gateway_data){
    		$data['gateways'][$key]['element_params']['style']['base']['backgroundColor'] = '#000';
    	}
       
        return $data;
    });
    Thread Starter panosp

    (@panosp)

    OK this works fine. thank you for your support.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Locale Gateways – select bank field – Custom CSS’ is closed to new replies.