• Hello,

    I have searched extensively through the support posts and your FAQ and the question of how to get a plugin working with regards to AJAX pops up frequently, there’s this whole part in the FAQ for it –

    I have disabled a form plugin globally and enabled it on a specific page where it is used. The plugin loads on the page but then it doesn’t work when I submit the form.
    
    When the form is submitted it is not submitting to the page you are viewing. It is submitting to an ajax endpoint. Which is a different URL. You need to enable the plugin on that URL to get the form working. Here are 2 examples of how to do that.

    We’re trying to get the payment gateways working only on the checkout and cart pages however this seems more challenging than first anticipated.

    I’ve now tried multiple fixes and am aware that we need to create a global filter with the payment plugins switched off, then create another filter on the checkout and cart pages with both gateways enabled.

    I know that I need to also add a filter with the plugins enabled to wherever the AJAX endpoint is however I cannot find any clear way to identify this. I’ve tried the homepage, various folders, attempted to locate the /wp-json/ endpoint and no one seems to have a definitive answer on what actually needs to be enabled for various plugins, considering that they all have different requirements.

    We are using ‘WooCommerce Stripe Gateway’ by WooCommerce and ‘WooCommerce PayPal Gateway’ by easypayment if this helps.

    Any help would be hugely appreciated as I’ve been trying to get an answer on this for days now and the payment gateways are terrible with regards to requests and load times.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jeff Sterup

    (@foomagoo)

    You should globally disable the plugins and then enable them on the page where they are needed. Then use your browsers developer console (f12 in Chrome on Windows) and go to the network tab. Then watch that network tab when you hit submit. That will tell you the address that it is submitting to. That address is what you need to create a plugin filter with.

    Thread Starter Masidus

    (@masidus)

    Hi Jeff, thank you for your swift reply.

    This is helpful info however the checkout informs the user that there is no available payment method before the user even has a chance to submit the form.

    You can see the checkout here with the plugins enabled on the checkout, they popup for just a second before disappearing – https://staging.watkinsprints.co.uk/checkout/?add-to-cart=14959

    Many thanks for your time!

    Plugin Author Jeff Sterup

    (@foomagoo)

    I can see it doing 3 ajax calls for info when the page loads.

    Create a filter with the following Permalinks and select also affect children. You will also need fuzzy url matching enabled on the settings page if you don’t already.

    https://staging.watkinsprints.co.uk/wp-json/caos/
    https://staging.watkinsprints.co.uk/wp-admin/admin-ajax.php

    You will also need to create a plugin filter with the following permalink but don’t select also affect children.

    https://staging.watkinsprints.co.uk

    If that works you can play around with it to see which ones are actually needed. I think https://staging.watkinsprints.co.uk/wp-json/caos/ might be the only one that is actually needed.

    Thread Starter Masidus

    (@masidus)

    Hi Jeff,

    I have implemented the above filters however the problem still persists, the checkout still shows – “Sorry, it seems that there are no available payment methods for your state.”

    The Stripe gateways and PayPal gateways were disabled on the staging site when you checked so I have removed the filters and re-enabled the payment gateways now as this might be why you could only see the three above ajax calls?

    Also https://staging.watkinsprints.co.uk/wp-json/caos/ is for CAOS Self Hosted Google Fonts which is completely separate from the payment gateways.

    Thank you for your time, really looking forward to getting this working soon!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘AJAX Calls – How to enable’ is closed to new replies.