• Hey, I’ve been desperately trying to disable the paypal buttons on the Funnelkit checkout pages, but it shows up again after the shipping method loads / on checkout update, here’s the code I tried and similiar solutions, I call the functiion in the sites header and it hides the Paypal payment option for a few seconds until the checkout fully loads / changes… Is there a chance to somehow Disable the paypal payment option?

    Code used:

    add_filter(‘woocommerce_available_payment_gateways’, function($gateways){
    if(is_checkout()){
    $packages = WC()->shipping()->get_packages();
    $has_methods = array_reduce($packages, function($has_methods, $package){
    if(!$has_methods){
    return !empty($package[‘rates’]);
    }
    return $has_methods;
    }, false);

      if($has_methods == 1){
    unset($gateways['ppcp']);
    }
    }
    return $gateways;

    });

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @patrixxxk

    Are you referring to the express checkout section? If so, have you tried disabling the express checkout option for PayPal? That’s located on the PayPal Settings page.

    Kind Regards

    Thread Starter patrixxxk

    (@patrixxxk)

    My settings are set to the Cart and Order Pay Page, and the part further down is set to 3 specific countries: Germany, Slovakia, Austria…
    The Credit Card Payment Sections: Cart Page, Checkout Page, Order Pay

    Im Not setting the checkout express anywhere….
    Url example of the funnelkit checkout where the Paypal shouldn’t be: https://padar.sk/de/schwarze-johannisbeere-mix-lp/ (Please set the land/country of delivery to Germany – if it’s not)

    Basically I dont want the paypal buttons on funnelkit checkouts, only the normal checkout without funnels.

    • This reply was modified 4 months, 3 weeks ago by patrixxxk.
    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @patrixxxk

    This seems like an issue with the conditional logic you have written in your custom code. I would recommend reviewing your custom code. If you don’t want PayPal to be available on any funnellkit pages, then it doesn’t make sense to have your conditional logic check for shipping packages.

    You should be checking if the page is a funnelkit page and removing ppcp based on that logic.

    Thanks

    Thread Starter patrixxxk

    (@patrixxxk)

    Hey,
    Well, I would try in any way to delete it, if you have another solution I’d be glad to hear about it … The shipping option was just a logic to get behind it, I can delete all the conditional logic and just leave unset ppcp, it still re-appears / doesn’t get fully deleted, is there a hook in the plugin that gets executed after the checkout details refreshes / something that I could use ? Thanks!

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