mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Show googlepay button conditionally
This commit is contained in:
parent
895cd5c4c1
commit
c941430b7d
4 changed files with 9 additions and 2 deletions
|
@ -232,6 +232,8 @@ class CheckoutBootstap {
|
|||
}
|
||||
}
|
||||
|
||||
setVisible( '#ppc-button-ppcp-googlepay', isGooglePayMethod );
|
||||
|
||||
jQuery( document.body ).trigger( 'ppcp_checkout_rendered' );
|
||||
}
|
||||
|
||||
|
|
|
@ -13,3 +13,7 @@
|
|||
min-width: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
#ppc-button-ppcp-googlepay {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ class GooglepayButton {
|
|||
|
||||
this.log = function () {
|
||||
if ( this.buttonConfig.is_debug ) {
|
||||
console.log( '[GooglePayButton]', ...arguments );
|
||||
//console.log('[GooglePayButton]', ...arguments);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -70,6 +70,7 @@ class GooglepayButton {
|
|||
if ( wrapper ) {
|
||||
const { ppcpStyle, buttonStyle } =
|
||||
this.contextConfig();
|
||||
|
||||
wrapper.className = `ppcp-button-${ ppcpStyle.shape }`;
|
||||
|
||||
if ( ppcpStyle.height ) {
|
||||
|
|
|
@ -188,7 +188,7 @@ class GooglepayModule implements ModuleInterface {
|
|||
);
|
||||
|
||||
add_action('woocommerce_review_order_after_submit', function () {
|
||||
echo '<div id="ppc-button-' . esc_attr( GooglePayGateway::ID ) . '">Google Pay...</div>';
|
||||
echo '<div id="ppc-button-' . esc_attr( GooglePayGateway::ID ) . '"></div>';
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue