Hello @igloo3
Thank you for reaching out!
Currently, the PayPal Payments plugin does not automatically display a payment gateway icon in the checkout. However, you can add a PayPal logo with a custom filter. Here’s a sample code snippet to help you achieve this:
function woocommerce_paypal_payments_gateway_icon( $icon, $id ) {
if ( $id === 'ppcp-gateway' ) {
return '<img src="' . esc_url( plugins_url( 'woocommerce-paypal-payments/modules/ppcp-wc-gateway/assets/images/paypal.png' ) ) . '" > ';
}
if ( $id === 'ppcp-pay-upon-invoice-gateway' ) {
return '<img src="' . esc_url( plugins_url( 'woocommerce-paypal-payments/modules/ppcp-wc-gateway/assets/images/paypal.png' ) ) . '" > ';
} else {
return $icon;
}
}
add_filter( 'woocommerce_gateway_icon', 'woocommerce_paypal_payments_gateway_icon', 10, 2 );
With this code, the PayPal logo will appear next to the PayPal payment options in checkout. Make sure to replace the img src
URL with the location of the logo you prefer, if different from the one provided.
Kind Regards,
Krystian