mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Add paypal icon to the block checkout
This commit is contained in:
parent
de609be21b
commit
82faf9370b
2 changed files with 23 additions and 1 deletions
|
@ -768,9 +768,24 @@ if ( block_enabled && config.enabled ) {
|
|||
);
|
||||
}
|
||||
|
||||
const PaypalLabel = ( { components, config } ) => {
|
||||
const { PaymentMethodIcons } = components;
|
||||
|
||||
return (
|
||||
<>
|
||||
<span
|
||||
dangerouslySetInnerHTML={ {
|
||||
__html: config.title,
|
||||
} }
|
||||
/>
|
||||
<PaymentMethodIcons icons={ config.icon } align="right" />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
registerPaymentMethod( {
|
||||
name: config.id,
|
||||
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
|
||||
label: <PaypalLabel config={ config } />,
|
||||
content: descriptionElement,
|
||||
edit: descriptionElement,
|
||||
placeOrderButtonLabel: config.placeOrderButtonText,
|
||||
|
|
|
@ -248,6 +248,13 @@ class PayPalPaymentMethod extends AbstractPaymentMethodType {
|
|||
return array(
|
||||
'id' => $this->gateway->id,
|
||||
'title' => $this->gateway->title,
|
||||
'icon' => [
|
||||
[
|
||||
'id' => 'paypal',
|
||||
'alt' => 'PayPal',
|
||||
'src' => $this->gateway->icon
|
||||
]
|
||||
],
|
||||
'description' => $this->gateway->description,
|
||||
'enabled' => $this->settings_status->is_smart_button_enabled_for_location( $script_data['context'] ?? 'checkout' ),
|
||||
'fundingSource' => $this->session_handler->funding_source(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue