Skip to content

Instantly share code, notes, and snippets.

@InpsydeNiklas
Last active March 7, 2024 01:31
Show Gist options
  • Save InpsydeNiklas/9b384c86c4127a7bffc5446c328a647c to your computer and use it in GitHub Desktop.
Save InpsydeNiklas/9b384c86c4127a7bffc5446c328a647c to your computer and use it in GitHub Desktop.
display icon for ppcp-gateway in the checkout
function woocommerce_paypal_payments_gateway_icon( $icon, $id ) {
if ( $id === 'ppcp-gateway' ) {
return '<img src="https://www.paypalobjects.com/webstatic/mktg/Logo/pp-logo-100px.png" alt="PayPal Payments" />';
} else {
return $icon;
}
}
add_filter( 'woocommerce_gateway_icon', 'woocommerce_paypal_payments_gateway_icon', 10, 2 );
@presiyany
Copy link

Hello, how can I change the icon to go the the right side of the box ?

@InpsydeNiklas
Copy link
Author

@presiyany This needs some custom CSS and it depends on your theme. For example, the icons should be aligned on the right side with the default Storefront theme. But third-party themes may use different styling. Your best bet would be to contact your theme developer or the plugin support team. Your theme developer would be the first best point of contact, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment