mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +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
|
&& ! $not_enabled_on_cart
|
||||||
) {
|
) {
|
||||||
add_action(
|
add_action(
|
||||||
'woocommerce_proceed_to_checkout',
|
$this->proceed_to_checkout_button_renderer_hook(),
|
||||||
array(
|
array(
|
||||||
$this,
|
$this,
|
||||||
'button_renderer',
|
'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.
|
* @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 (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