Hello,
I just did a try to add these two code snippets:
The first one was added before
function woocommerce_paypal_payments_card_button_gateway_icon( $icon, $id ) {
? ? if ( $id === 'ppcp-card-button-gateway' ) {
? ? ? ? return '
<img src="https://mysite.com/wp-content/uploads/2022/05/creditcardicon.png" alt="Credit card" />';?
? ? } else {
? ? ? ? return $icon;
? ? }
}
add_filter( 'woocommerce_gateway_icon', 'woocommerce_paypal_payments_card_button_gateway_icon', 10, 2 );
then, added the second one for Standard Card Button:
And the second one for Paypal Standard card button:
function woocommerce_paypal_payments_card_button_gateway_icon( $icon, $id ) {
if ( $id === 'ppcp-card-button-gateway' ) {
return '
<img src="https://upload.wikimedia.org/wikipedia/commons/2/2a/Mastercard-logo.svg" alt="Mastercard" />
<img src="https://upload.wikimedia.org/wikipedia/commons/0/04/Visa.svg" alt="Visa" />
<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_card_button_gateway_icon', 10, 2 );
Question please:
1# In this situation, the credit cart button will does not show up, but only show a button of “Place order”, could you have a try or optimize the code please?
2# Is it possible to set a custom color for the button of “Debit or Credit Card” please?
Thanks for support.