Community Forums 

Main Content

Re:Changing the PayPal Express checkout button?

    Jun 06 2014 13:04:28

    #1

    Geoff

    Join date : 2008-09-18      Posts : 415

    It is possible to dynamically change the image on page load.

    Looking at the HTML source of your cart page (userid ending 58), the image in question has an id of "paypal". Copy the javascript below into your Cart setup / Header message box.

    <script>function x(){document.getElementById("paypal").src = "https://www.paypalobjects.com/webstatic/en_US/developer/docs/ppp/EC-button.gif";}onload=x;</script>;

    This image has whitespace around it causing some mis-alignment with the surrounding buttons. If you want to correct this then you will have to save a copy of the image and trim off the whitespace to your requirements in your image processing program. Then of course upload this to an appropriate folder on your website and amend the src reference in the javascript accordingly.

    Alternatively, reference the image at https://www.paypalobjects.com/en_GB/GB/i/btn/btn_xpressCheckout.gif which has no whitespace.