Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1110358

    Rad
    Moderator

    Hi there,

    Are we discussing the PayPal image, right? Then it’s nothing to do with CSS we’re discussing.

    Another set of questions just to confirm,

    1. I can see from the cart page the difference, and it’s the PayPal image. The question is, which of the two is correct. Is it the page with no Paypal button, or is it the one that has it? In short, should the image be displayed on both or make them hidden?

    2. Similar question as #1, which image should be displayed on both site’s checkout, should be the small one or the bigger one?

    Again, it’s nothing to do with above CSS, that’s the reason why both sites are different even if they have the same code 🙂

    And please provide your FTP login credentials as well.

    Thanks!

    #1110828

    Jack D
    Participant
    This reply has been marked as private.
    #1111194

    Rad
    Moderator

    Hi there,

    I went ahead and added this code to Admin > Appearance > Customizer > Custom > Javascript

    jQuery('label[for="payment_method_ppec_paypal"] img').attr('src','https://www.paypalobjects.com/webstatic/mktg/Logo/AM_mc_vs_ms_ae_UK.png').attr('style','max-height:none!important;');

    Previous code works too, you just didn’t clear the cache 🙂

    Thanks!

    #1111407

    Jack D
    Participant

    I have cleared browser cache, cleared all the caches on wwww.protectiondogsuk.co.uk and still does not work. How are you clearing the cache because I cannot get this to work

    #1111571

    Paul R
    Moderator

    Hi Jack,

    We’ll try another option.

    Kindly install and activate a child theme.

    https://community.theme.co/kb/how-to-setup-child-themes/

    Then add this in your child theme’s functions.php file located at wp-content/themes/x-child/functions.php

    
    function replacePayPalIcon($iconUrl) {
    	return 'https://www.paypalobjects.com/webstatic/mktg/Logo/AM_mc_vs_ms_ae_UK.png';
    }
     
    add_filter('woocommerce_paypal_icon', 'replacePayPalIcon');
    

    The contents of the file will look like this.

    http://screencast.com/t/7wYzCoMrMf

    Hope that helps

    #1111692

    Jack D
    Participant

    I’ve done exactly as you say. Installed child theme and added

    function replacePayPalIcon($iconUrl) {
    return ‘https://www.paypalobjects.com/webstatic/mktg/Logo/AM_mc_vs_ms_ae_UK.png’;
    }

    add_filter(‘woocommerce_paypal_icon’, ‘replacePayPalIcon’);

    to functions.php

    Unfortunately it does not work. Please check I have added it correctly you have the login details.

    #1111744

    Rad
    Moderator

    Hi there,

    Looks like that PayPal image is added by javascript. And executed right after my added code randomly, hence, there are times that it works and not.

    I updated the code to this,

    jQuery( function($) {
      
    change_paypal_image();
      
    $(document).ready( function() { 
    
    change_paypal_image();
    
    setTimeout( function() { change_paypal_image(); }, 1000 );
    setTimeout( function() { change_paypal_image(); }, 700 );
    setTimeout( function() { change_paypal_image(); }, 500 );
    
    } );
    
    $(window).load ( change_paypal_image );
    
    function change_paypal_image() {
    
      $('label[for="payment_method_ppec_paypal"] img').attr('src','https://www.paypalobjects.com/webstatic/mktg/Logo/AM_mc_vs_ms_ae_UK.png').attr('style','max-height:none!important;');
    
    }
    
    });

    As you’d noticed the image is already changed on load, but switch back to small image again. So this updated code will switch it to bigger image over and over.

    Please clear your browser cache and check it again.

    Please, this URL http://www.protectiondogsuk.co.uk/wp-admin/admin.php?page=stats&noheader&proxy&chart=admin-bar-hours-scale makes it slow. Try disabling your admin bar.

    Thanks!

    #1111758

    Jack D
    Participant

    It works!!! Thanks for all your staff efforts

    I don’t understand this however and does it slow my site down?

    “Please, this URL http://www.protectiondogsuk.co.uk/wp-admin/admin.php?page=stats&noheader&proxy&chart=admin-bar-hours-scale makes it slow. Try disabling your admin bar.”

    Regards

    Jack

    #1111866

    Rad
    Moderator

    Hi there,

    Yes, it’s slow on my end. Or maybe just on my end. Your page took 12 seconds to load because of that image (chart bars)

    And you’re so much welcome 🙂

    #1111937

    Jack D
    Participant

    I’ve tested on Google Page insights Mobile 71 Desktop 87
    Pingdom faster than 92% of websites from Stockholm Server

    #1112029

    Joao
    Moderator

    Hi Jack,

    Your website is loading fine on my end, speed is not bad at all.

    Let us know if you need further help with anything else,

    Joao