• Resolved papermelon

    (@papermelon)


    Hi,

    I enabled and disabled payment options like Paypal and Stripe based on country (using code).

    This works perfectly in the default woocommerce cart, however all payment options show irrespective of country in checkout blocks.

    Is there a way to get this to work?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Dani F. a11n

    (@danielinhou)

    Hi there @papermelon 👋🏽

    As explained on this document, the cart and checkout are not yet a complete replacement for the existing shortcodes.The extensibility interfaces for them are still being developed. In particular, extensions (or code) that use hooks related to cart and checkout may not function as expected.

    I hope this helps and thanks for your feedback.

    Cheers!

    Plugin Author Darren Ethier (nerrad)

    (@nerrad)

    Howdy @papermelon,

    I thought your request was pretty interesting so I gave a go at seeing if there’s a way to implement this using the current state of the Payment Method interfaces in the new WooCommerce Blocks checkout flow. Turns out it IS! However, the caveat is this uses an experimental interface so if you find this meets your needs you will need to be careful with using it (and monitor changes in Woo Blocks updates carefully). Hence all the disclaimers I put in the gist.

    Here’s the gist proof of concept: https://gist.github.com/nerrad/fa24d2bf01c1726f62bec7accac8be39

    I’ve tested it on my local development sites and it seems to work okay. Note, currently this mechanism will only work for payment methods that already support the new Cart and Checkout blocks.

    Thread Starter papermelon

    (@papermelon)

    Thanks Darren! Really appreciate this!
    However, I’m not an expert developer and can’t get this to work.
    I need Paypal for all billing countries except India.
    Whereas, I need Stripe only for India.
    Will it be possible for you to provide a code accordingly?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Enableing and disabling payment options in checkout’ is closed to new replies.