mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
always load js logic and styles as an item might newly be added to the cart
This commit is contained in:
parent
e2dfaf7f99
commit
9d974be95d
2 changed files with 1 additions and 9 deletions
|
@ -53,13 +53,6 @@ document.addEventListener(
|
|||
console.error('PayPal button could not be configured.');
|
||||
return;
|
||||
}
|
||||
if (
|
||||
! document.querySelector(PayPalCommerceGateway.button.wrapper) &&
|
||||
! document.querySelector(PayPalCommerceGateway.button.mini_cart_wrapper) &&
|
||||
! document.querySelector(PayPalCommerceGateway.hosted_fields.wrapper)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
const script = document.createElement('script');
|
||||
|
||||
script.setAttribute('src', PayPalCommerceGateway.button.url);
|
||||
|
|
|
@ -86,7 +86,6 @@ class SmartButton implements SmartButtonInterface
|
|||
) {
|
||||
return;
|
||||
}
|
||||
wp_enqueue_style('ppcp-hosted-fields');
|
||||
printf(
|
||||
'<form id="%1$s">
|
||||
<div class="ppcp-dcc-credit-card-wrapper">
|
||||
|
@ -206,7 +205,7 @@ class SmartButton implements SmartButtonInterface
|
|||
|
||||
public function enqueue(): bool
|
||||
{
|
||||
wp_register_style(
|
||||
wp_enqueue_style(
|
||||
'ppcp-hosted-fields',
|
||||
$this->moduleUrl . '/assets/css/hosted-fields.css'
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue