0

My client would like to have two types payment methods one is COD another is PayPal. When the customer clicks the delivery button this will disable COD option and if the customer clicks the takeaway button the PayPal option will be disabled in the checkout page in Woocommerce. Please help me fix this? Both buttons will be set top of the check out page.

Brad Holmes
  • 497
  • 5
  • 22

1 Answers1

0

By the type of delivery/takeout button click, adding/removing disabled attribute from payment radio option can help like this way.

         $("#btnDelivery").on('click', function(){
            $('#payment_method_cod').attr("disabled", "true");
            $('#payment_method_paypal').removeAttr("disabled");
        });

        $("#btnTakeout").on('click', function(){
            $('#payment_method_paypal').attr("disabled", "true");
            $('#payment_method_cod').removeAttr("disabled");
        }); 
Biplob Ahmed
  • 106
  • 4