mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +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( {
|
registerPaymentMethod( {
|
||||||
name: config.id,
|
name: config.id,
|
||||||
label: <div dangerouslySetInnerHTML={ { __html: config.title } } />,
|
label: <PaypalLabel config={ config } />,
|
||||||
content: descriptionElement,
|
content: descriptionElement,
|
||||||
edit: descriptionElement,
|
edit: descriptionElement,
|
||||||
placeOrderButtonLabel: config.placeOrderButtonText,
|
placeOrderButtonLabel: config.placeOrderButtonText,
|
||||||
|
|
|
@ -248,6 +248,13 @@ class PayPalPaymentMethod extends AbstractPaymentMethodType {
|
||||||
return array(
|
return array(
|
||||||
'id' => $this->gateway->id,
|
'id' => $this->gateway->id,
|
||||||
'title' => $this->gateway->title,
|
'title' => $this->gateway->title,
|
||||||
|
'icon' => [
|
||||||
|
[
|
||||||
|
'id' => 'paypal',
|
||||||
|
'alt' => 'PayPal',
|
||||||
|
'src' => $this->gateway->icon
|
||||||
|
]
|
||||||
|
],
|
||||||
'description' => $this->gateway->description,
|
'description' => $this->gateway->description,
|
||||||
'enabled' => $this->settings_status->is_smart_button_enabled_for_location( $script_data['context'] ?? 'checkout' ),
|
'enabled' => $this->settings_status->is_smart_button_enabled_for_location( $script_data['context'] ?? 'checkout' ),
|
||||||
'fundingSource' => $this->session_handler->funding_source(),
|
'fundingSource' => $this->session_handler->funding_source(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue