How to replace default PayPal logo on WooCommerce checkout page ?

In this tutorial we’ll learn how to replace default paypal logo on woocommerce checkout page. Woocommerce comes with a default image for checkout with paypal option, we can replace that with any image we want.

First let’s have a look at default logo. Go to category listing/shop page.

woocommerceNow add any product to cart by clicking on add to cart button.

woocommerce1After that click on view cart to navigate to cart page.

On the cart page click on proceed to checkout button to navigate to checkout page.

woocommerceOn the checkout page you’ll see the default paypal logo.

woocommerceNow we want to replace this image with the following image.

PaypalYou can replace that with any image you want.

Now, go to backend and cnavigate to media then click on add new.

woocommerceHere select the file from your PC and upload image.

After the file has been uploaded click on edit.

woocommercethis will take you to the new window. Copy the image url from here.

woocommerceand place it in the following function.

function paypal_checkout_icon() {

return 'http://localhost/wordpress/wp-content/uploads/2015/01/paypal_2014_logo_detail.png'; // write your own image URL here

}

add_filter( 'woocommerce_paypal_icon', 'paypal_checkout_icon' );

You can also provide an url from the web.

Now place this function at the end of your theme’s function.php file.

You can access functions.php file here:

woocommercePlace code, save file and refresh the checkout page.

You’ll see that your newly added image has repalced the default paypal image.

woocommerce

 

Waqas

I hope you enjoy reading this blog post. If you want my team to do WooCommerce Maintenance for you, click here.

Leave a Comment

Your email address will not be published. Required fields are marked *