• Resolved shaunbowen

    (@shaunbowen)


    Hi there, I have recently set an item to a sale price of zero, but the Google Pay and Apple Pay buttons are still showing on the Single Product page.

    Is there any way to prevent this, beyond using CSS on all sale items?

    .sale li.payment_method_stripe_applepay,
    .sale li.payment_method_stripe_googlepay {
    display: none !important;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Clayton R

    (@mrclayton)

    Hi @shaunbowen

    Thank you for contacting Payment Plugins. This is an interesting scenario and the filter wc_stripe_product_payment_methods should be perfect for this. Here is an example of how to filter the payment buttons if the product price is zero.

    add_filter('wc_stripe_product_payment_methods', function($gateways, $product){
    if($product->get_price() <= 0){
    $gateways = [];
    }
    return $gateways;
    }, 10, 2);

    Kind Regards

    Plugin Author Clayton R

    (@mrclayton)

    Hi @shaunbowen

    I forgot to mention you can also disable the payment buttons at the product level via the Edit Product page > Stripe settings panel.

    That is easier than adding the code snippet to your site.

    Kind Regards

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.