Quantcast
Channel: Code Snippets – Code My Own Road
Viewing all articles
Browse latest Browse all 8

How To Change The PayPal Icon In WooCommerce

$
0
0

WooCommerceHere’s a quick tutorial that might help you increase conversions on your WooCommerce shopping cart.

If you’re using PayPal as the payment gateway (like many people do, including myself), then you’re likely to have noticed the dodgy little icon displayed on the cart.

This is a great place to put a more informative icon that shows just how many payment options you can process with PayPal. Many people aren’t even aware that you can process credit cards using PayPal and might completely abandon your cart if you don’t show them the right credit card symbols.

I put together the following graphic and code snippet which you can use on your WooCommerce checkout.

Here’s the new icon image we’ll be using which includes all the credit cards that PayPal accepts (right click and save):

acceptedCards

Make sure you keep the naming of the file consistent with the following code snippet. For tidyness I’ve placed this image in my theme’s directory under a subdirectory called “images”, if you’re using the following code verbatim you’ll want to do the same.

Copy and paste the following code into your functions.php:

function replacePayPalIcon($iconUrl) {
	return get_bloginfo('stylesheet_directory') . '/images/acceptedCards.png';
}
 
add_filter('woocommerce_paypal_icon', 'replacePayPalIcon');

Now take a look at your new and improved cart with it’s sexy little credit card icons. If this code snippet helped you out let me know in the comments.


Viewing all articles
Browse latest Browse all 8

Trending Articles