mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Add googlepay button to pay for order page
This commit is contained in:
parent
34cbd05349
commit
40805c1a13
2 changed files with 17 additions and 4 deletions
|
@ -62,7 +62,10 @@ class GooglepayButton {
|
|||
)
|
||||
.then( ( response ) => {
|
||||
if ( response.result ) {
|
||||
if ( this.context === 'checkout' ) {
|
||||
if (
|
||||
this.context === 'checkout' ||
|
||||
this.context === 'pay-now'
|
||||
) {
|
||||
const wrapper = document.getElementById(
|
||||
'ppc-button-ppcp-googlepay'
|
||||
);
|
||||
|
|
|
@ -187,9 +187,19 @@ class GooglepayModule implements ModuleInterface {
|
|||
}
|
||||
);
|
||||
|
||||
add_action('woocommerce_review_order_after_submit', function () {
|
||||
echo '<div id="ppc-button-' . esc_attr( GooglePayGateway::ID ) . '"></div>';
|
||||
});
|
||||
add_action(
|
||||
'woocommerce_review_order_after_submit',
|
||||
function () {
|
||||
echo '<div id="ppc-button-' . esc_attr( GooglePayGateway::ID ) . '"></div>';
|
||||
}
|
||||
);
|
||||
|
||||
add_action(
|
||||
'woocommerce_pay_order_after_submit',
|
||||
function () {
|
||||
echo '<div id="ppc-button-' . esc_attr( GooglePayGateway::ID ) . '"></div>';
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue