• hi, it is possible to add the paypal express button on the product page, but not on all product pages (only on some decided by me)

Viewing 1 replies (of 1 total)
  • Plugin Support Krystian from Syde

    (@inpsydekrystian)

    Hello @antonic93

    Thank you for your question!

    Currently, while there isn’t a built-in UI option in the PayPal Payments plugin to selectively display the PayPal Express button on specific product pages, you can achieve this with a custom code snippet. Here’s an example that hides the PayPal button on single product pages for products in a specific category:

    function ppcp_remove_single_product_buttons( $enable_button, $product ) {
        if ( has_term( 'excluded-category-slug', 'product_cat', $product->get_id() ) ) {
            $enable_button = false;
        }
        return $enable_button;
    }
    add_filter( 'woocommerce_paypal_payments_product_supports_payment_request_button', 'ppcp_remove_single_product_buttons', 10, 2 );

    With this code, if you assign the category “excluded-category-slug” to a product, the PayPal smart buttons and Pay Later messaging will be hidden on the single product page for that item.

    Kind Regards,

    Krystian

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.