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.
Now add any product to cart by clicking on add to cart button.
After 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.
On the checkout page you’ll see the default paypal logo.
Now we want to replace this image with the following image.
You can replace that with any image you want.
Now, go to backend and cnavigate to media then click on add new.
Here select the file from your PC and upload image.
After the file has been uploaded click on edit.
this will take you to the new window. Copy the image url from here.
and 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:
Place code, save file and refresh the checkout page.
You’ll see that your newly added image has repalced the default paypal image.