mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Merge pull request #1585 from woocommerce/PCP-1930-pay-pal-later-message-price-amount-doesnt-update-dynamically
PayPal Later message price amount doesn't update dynamically. (1930)
This commit is contained in:
commit
222d981df8
2 changed files with 17 additions and 1 deletions
|
@ -148,7 +148,13 @@ const bootstrap = () => {
|
|||
miniCartBootstrap.init();
|
||||
}
|
||||
|
||||
if (context === 'product' && PayPalCommerceGateway.single_product_buttons_enabled === '1') {
|
||||
if (
|
||||
context === 'product'
|
||||
&& (
|
||||
PayPalCommerceGateway.single_product_buttons_enabled === '1'
|
||||
|| hasMessages()
|
||||
)
|
||||
) {
|
||||
const singleProductBootstrap = new SingleProductBootstap(
|
||||
PayPalCommerceGateway,
|
||||
renderer,
|
||||
|
@ -194,6 +200,12 @@ const bootstrap = () => {
|
|||
}
|
||||
|
||||
};
|
||||
|
||||
const hasMessages = () => {
|
||||
return PayPalCommerceGateway.messages.is_hidden === false
|
||||
&& document.querySelector(PayPalCommerceGateway.messages.wrapper);
|
||||
}
|
||||
|
||||
document.addEventListener(
|
||||
'DOMContentLoaded',
|
||||
() => {
|
||||
|
|
|
@ -234,6 +234,10 @@ class SingleProductBootstap {
|
|||
|
||||
this.messages.renderWithAmount(data.total);
|
||||
|
||||
if ( this.gateway.single_product_buttons_enabled !== '1' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
let enableFunding = this.gateway.url_params['enable-funding'];
|
||||
let disableFunding = this.gateway.url_params['disable-funding'];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue