Change PayPal Mark on Checkout
-
Hello, how do I change the PayPal mark through the functions.php? Thank you.
-
Hi @cerebro420,
By PayPal mark you mean the icons? Are you using PayPal Express Checkout? or some other? If using EC then did you checked the EC settings we have options to set custom images for the paypal button image. If that is not what you re looking for then please elaborate a bit more then I will be able to give better information.
Thanks!Hello, not the Express Checkout button, but the PayPal credit card bar image on checkout. The bar with the icons i.e. visa, mastercard, paypal, needs to be changed. I am not using the Express Checkout option and am processing orders through the checkout page. How would I change the PayPal credit card bar of icons through functions.php? I hope this makes sense. Thank you.
We do not currently have a hook in place for that image, but I will add this request to our list for a future update. For now if you really want to change it you could do it from directly in the plugin code, but this isn’t typically recommended.
Whoops, I gave you incorrect info. We actually do have a hook available for this already named
woocommerce_paypal_express_icon
. Here’s a usage example:add_filter('woocommerce_paypal_express_icon', 'angelleye_change_express_checkout_icon', 10, 1); function angelleye_change_express_checkout_icon($icon_url) { $icon_url = '<img src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/cc-badges-ppmcvdam.png" alt="Credit Card Badges">'; return $icon_url; }
-
This reply was modified 7 years, 4 months ago by
angelleye.
Hello, I tried that and the logo stayed the same. I am trying to change the logo at the following URL:
/wp-content/plugins/paypal-for-woocommerce/assets/images/paypal-paypal-credit-card-logos.png
I can replace the image and the logo changes, but after updating it is changed back. How would I change that image during the checkout process using the functions.php? Thank you.
Hmm…updating shouldn’t affect any custom image you set. If it did, can you change it back now to get what you’re wanting?
The hook I provided should do it for you. You’re saying there’s no change at all when adding that to your functions.php?
I can copy the image over using a custom image, but after updating it put the old image in the wp_content/plugins back to original. The image is not the PayPal Express logo, but the logo on the checkout page. I included a link to a photo to make it more clear. I just updated and it set the logo back to the original and would like to use functions.php to keep it permanently set to a custom logo. Thank you.
Can you provide a copy of the hook/function that you placed in your functions.php file?
Hello, sorry for the late response. I included the following in the function.php in the child theme:
add_filter('woocommerce_paypal_express_icon', 'angelleye_change_express_checkout_icon', 10, 1); function angelleye_change_express_checkout_icon($icon_url) { $icon_url = '<img src="https://elegant-fashionations.com/wp-content/uploads/paypal/paypal.png" alt="Credit Card Badges">'; return $icon_url; }
There is no change in the PayPal mark on the general list of enabled gateways. Thank you.
Please try this hook name instead:
angelleye_ec_checkout_icon
Hello, changing the hook worked. Thank you for the support.
Can you let me know where you saw that old hook name? I need to make sure we update any documentation or articles showing that name.
Also, if you have a moment to leave a review for the plugin that would be greatly appreciated. Thanks!
The code was given by a previous comment in this topic. I’ll leave a review soon. Thank you again I appreciate the help.
Oh, ha, sorry about that. Yeah, we wound up changing the name to match our other hook names better. Sorry for the confusion. Thanks!
-
This reply was modified 7 years, 4 months ago by
- The topic ‘Change PayPal Mark on Checkout’ is closed to new replies.