mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Allow cart button renderer hook to be filtered
This commit is contained in:
parent
fb32cec67b
commit
2391e7038e
1 changed files with 15 additions and 2 deletions
|
@ -318,7 +318,7 @@ class SmartButton implements SmartButtonInterface {
|
|||
&& ! $not_enabled_on_cart
|
||||
) {
|
||||
add_action(
|
||||
'woocommerce_proceed_to_checkout',
|
||||
$this->proceed_to_checkout_button_renderer_hook(),
|
||||
array(
|
||||
$this,
|
||||
'button_renderer',
|
||||
|
@ -965,7 +965,7 @@ class SmartButton implements SmartButtonInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return action name PayPal buttons will be rendered at.
|
||||
* Return action name PayPal buttons will be rendered at on checkout page.
|
||||
*
|
||||
* @return string Action name.
|
||||
*/
|
||||
|
@ -973,4 +973,17 @@ class SmartButton implements SmartButtonInterface {
|
|||
{
|
||||
return (string) apply_filters('woocommerce_paypal_payments_checkout_button_renderer_hook', 'woocommerce_review_order_after_payment');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return action name PayPal will be rendered next to Proceed to checkout button (normally displayed in cart).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function proceed_to_checkout_button_renderer_hook(): string
|
||||
{
|
||||
return (string) apply_filters(
|
||||
'woocommerce_paypal_payments_to_checkout_button_renderer_hook',
|
||||
'woocommerce_proceed_to_checkout'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue