jQuery error when form is displayed
Description: the form doesn't respond or reloads itself, there is no error message displayed.
What happened?
The payment form doesn’t seem to work: it’s not responsive, and/or it reloads itself when submitted. In the web console of the browser you can see an error message similar to this:
TypeError: $ is not a function /wp-content/themes/specular/js/main.js?ver=1:9 HTMLDocument.() /wp-includes/js/jquery/jquery.js?ver=1.12.4:2 i() /wp-includes/js/jquery/jquery.js?ver=1.12.4:2 Object.fireWith [as resolveWith]() /wp-includes/js/jquery/jquery.js?ver=1.12.4:2 Function.ready() /wp-includes/js/jquery/jquery.js?ver=1.12.4:2 HTMLDocument.K()
Why is it happening?
There is a jQuery library conflict between another theme/plugin and WP Full Pay.
WP Full Pay uses WordPress’ recommended way of registering jQuery as a dependency. However, not all plugins/themes do the same, and even when they do, sometimes weird conflicts happen.
How to solve?
Deactivate the conflicting plugin
If you can, please try to deactivate the conflicting plugin.
If it solves the issue then maybe you can find a functionally equivalent alternative.
Modify how WP Full Pay invokes jQuery
WP Full Pay uses the recommended conflict resolution by jQuery but sometime it fails. You can turn it off by commenting out a line of code in the “assets/js/wpfs.js” and “assets/js/wpfs-manage-subscriptions” files.
This is the original source code:
jQuery.noConflict(); (function ($) { "use strict"; $(function () { // Code continues here
Comment out the jQuery.noConflict(); line, and save the file:
//jQuery.noConflict(); (function ($) { "use strict"; $(function () { // Code continues here
Clear the browser cache, and reload the payment page.