mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-10 01:15:45 +08:00
Add filter woocommerce_paypal_payments_product_button_disabled to disable PayPal buttons on single product page.
This commit is contained in:
parent
315ef2c2cd
commit
e94316aecd
3 changed files with 24 additions and 2 deletions
|
@ -96,7 +96,8 @@ class SingleProductBootstap {
|
|||
|
||||
return this.shouldRender()
|
||||
&& !this.priceAmountIsZero()
|
||||
&& ((null === addToCartButton) || !addToCartButton.classList.contains('disabled'));
|
||||
&& ((null === addToCartButton) || !addToCartButton.classList.contains('disabled'))
|
||||
&& this.gateway.button.is_disabled !== true;
|
||||
}
|
||||
|
||||
priceAmount() {
|
||||
|
|
|
@ -36,7 +36,10 @@ export const setEnabled = (selectorOrElement, enable, form = null) => {
|
|||
|
||||
if (form) {
|
||||
// Trigger form submit to show the error message
|
||||
jQuery(form).find(':submit').trigger('click');
|
||||
let $form = jQuery(form);
|
||||
if ($form.find('.single_add_to_cart_button').hasClass('disabled')) {
|
||||
$form.find(':submit').trigger('click');
|
||||
}
|
||||
}
|
||||
})
|
||||
.find('> *')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue