jquery error when remove product checkout
-
Some time ago I needed to load my own version of jQuery in WordPress to make some changes work and I took this from here https://digwp.com/2009/06/including-jquery-in-wordpress-the-right-way/ :
// include custom jQuery function shapeSpace_include_custom_jquery() { wp_deregister_script('jquery'); wp_enqueue_script('jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js', array(), null, true); } add_action('wp_enqueue_scripts', 'shapeSpace_include_custom_jquery');
I have read that that is not a good practice afterall, buuuut I am a beginner and it solved the situation.
Recently I installed your plugin in my WordPress and during the checkout page, I encountered the following error which doesn’t allow me to remove products from the checkout (this means the X symbol tag does not work):
jquery.min.js:2 Uncaught TypeError: e.indexOf is not a function (jquery.min.js:2) at w.fn.init.w.fn.load at checkout-template.js?ver=1.4.2:244 at checkout-template.js?ver=1.4.2:379 w.fn.load @ jquery.min.js:2 (anonymous) @ checkout-template.js?ver=1.4.2:244 (anonymous) @ checkout-template.js?ver=1.4.2:379
I suspected it came from jquery (lol) so I deactivated the custom jquery enqueuing script in the functions.php and the X to remove products works as intended.
Nevertheless, I would like to avoid doing some:
if (is_page ('cartflows_checkout')) {
thing in the functions.php in order to dodge this jquery problem without removing my jquery function…because I think that I need that for some other section of my website.**Can anyone guide me or give me a more elegant solution which overall cleans my WP and/or solves the situation?**
Thanks a lot
- The topic ‘jquery error when remove product checkout’ is closed to new replies.