• Resolved HelgaTheViking

    (@helgatheviking)


    Hi team,

    I am the author of WooCommerce Name Your Price. The Buy Now buttons are not compatible with Name Your Price as they do not dynamically update the entered price when sending the order to PayPal. This is a fairly common problem with all payment request buttons without intentional compatibility work.

    In the meantime, what I typically do for these types of plugins (such as WooCommerce Payments, PayPal Payments, Stripe, etc) is disable the buttons conditionally on product pages for products that are NYP-enabled.

    SO I am wondering if there is a filter where I can disable the buttons conditionally on a per-product basis? As an example, PayPal Payments has a woocommerce_paypay_payments_product_supports_payment_request_button filter.

    In the meantime, I have advised the customer to disable the setting for showing request buttons on the single product page, but this always feels very draconian for me. They should still be able to use those buttons on products that DO support them.

    cheers,
    -k

    Update:

    Can see that you are rendering the root element on woocommerce_before_add_to_cart_button

    If that was wrapped in some kind of filter with the product object, I would be able to conditionally disable it for NYP. Something like the following should do the trick:

    
    if ( ! is_product() || ! $this->get_product() || ! (bool) apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_product_supports_payment_request_button', true, $this->get_product() ) ) {
    	return;
    }
    
    • This topic was modified 2 years, 3 months ago by HelgaTheViking. Reason: propose solution
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Incompatible with Name Your Price, need conditional way to disably buy now butto’ is closed to new replies.