This shows you how to change WooCommerce’s default PayPal icon. The WooCommerce checkout page shows payment icons for the payment methods and credit cards that you accept. If you only accept credit card payments via PayPal, then you will only have the default PayPal icon displayed. You probably want to show credit card icons even though you only accept them through PayPal. WooCommerce does not display these icons for PayPal by default. Here is how you can change WooCommerce’s default PayPal icon. For this example, I will replace the default PayPal icon with this picture which displays credit cards accepted via PayPal:
This is a better way to let your customers know that you accept credit cards in addition to regular PayPal payments. This code goes into your functions file.
You must replace the image filename and path with your own image. If you want to use the code as-is with the same image in my example, then save the image from above (right-click it, then click “Save Image As”) and place it in your theme’s "images"
folder. This example assumes that your theme’s images folder is in the root of theme, as in: “your-theme/images/“.
/** * Custom icon for PayPal payment option on WooCommerce checkout page. */ function isa_extended_paypal_icon() { // picture of accepted credit card icons for PayPal payments return get_stylesheet_directory_uri() . '/images/paypal-payments.jpg'; } add_filter( 'woocommerce_paypal_icon', 'isa_extended_paypal_icon' );
hesam
November 6th, 2014 at 6:00 am
Hi,
Where the code should be added?
Isabel
November 6th, 2014 at 6:29 pm
This code should go in your theme’s functions.php file. You also have to upload the image to your theme’s “images” folder.
If you don’t want this change to be erased when you update your theme, then you should instead place the code and image in a child theme.
John
December 12th, 2014 at 2:20 pm
Great for PayPal… but are there any filters for changing the icons of the other payment options?
Kimosogi
March 24th, 2015 at 6:43 pm
Thanks a million this worked great. That new logo they started using was so big.
Bryan
May 25th, 2015 at 6:17 pm
When using a child theme that line needs to be:
Otherwise the uri of the parent theme will be returned.
Isabel
May 26th, 2015 at 12:21 am
Thank you. I updated the snippet above.
Jake
February 23rd, 2016 at 9:57 am
Unfortunately this does not work. I hope someone can give an update to it
Isabel
February 23rd, 2016 at 4:02 pm
Hi. It works with WordPress 4.4.2 and WooCommerce 2.5.2 (these are the latest).
Isabel
February 23rd, 2016 at 4:11 pm
Additional Note: However, WooCommerce has updated the payment image that they show for PayPal. Their default PayPal image now includes credit card icons (actually, the image looks just like the one on this page), so my code here is not necessary anymore. Unless, you prefer to use the image on this page because it has a transparent background so it blends in to the WC checkout much better (WooCommerce’s image has a white background which doesn’t look as natural on the checkout page).
mamie-net.shop
April 19th, 2017 at 12:56 pm
Hi there,
Have you an idea on how to add an icon for bank transfer payment methods ?
Many Thanks
Isabel
April 20th, 2017 at 7:40 pm
Hi. This will show you how to add that icon: https://isabelcastillo.com/icon-bank-transfer-payment
Sylvain
May 10th, 2017 at 11:23 am
Thanks … it worked with
Wordpress 4.7.1
Theme Divi 3.0
Woocommerce (2.6.7)
Plugin Paypal Express
http://www.simplementweb.ca