Hi!
Got same problem on “Shop” page, when installed UM on site with WooCommerce.
Seems for some reason UM does not includes JQuery Select2 library.
I’ve added this line in my plugin code and it solved the issue:
wp_enqueue_script( ‘select2-js’, ‘https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js’, array(), ‘4.0.6’, true );
-
This reply was modified 7 years, 2 months ago by
alexitpro.
Thank you @alexitpro
Can you tell me in which file did you add this piece of code?
@manoskav I use my own plugin, which is active all time and put code there.
In general, I guess you can put this line of code in your WP active theme’s file functions.php
Thanks a lot! I ‘ll give it a try and let the community know 🙂
@manoskav welcome and please comment the result! 😉
Hi all,
I pasted that code in my theme’s functions.php, and now everything is ok. No errors in console.
HINT: if you use cPanel editor (and maybe other editors), change the ‘ character, otherwise you will get a syntax error.
@alexitpro thanks again 🙂
@manoskav thank you for your comment. I would recommend use more functional IDE like NetBeans, PHP Storm, Visual Studio Code. These tools will help you if you forgot part of php syntax like difference between ‘ ” ` ‘ quote symbols (juniors mainly are confused 🙂 )
Had the same problem but I found a solution to it. Basically what UM does is if class_exists(“WooCoommerce”) it dequeues select2 both style and script. There is a hook called “um_dequeue_select2_scripts” to remove the select2 that UM adds but that works only partially as the case for this to work is actually this one:
$dequeue_select2_status = apply_filters(“um_dequeue_select2_scripts”, false);
if(class_exists(“WooCoommerce”) || $dequeue_select2_status)
This means that you cannot really force it to be removed if you have woocommerce active. What you can do is deregister and dequeue select2 and then re-enqueue one for the woocommerce as a solution for now. That will bring both functionality and style of the default woo. Also make sure that your “wp_enqueue_scripts” is above priority of 100 as theirs is 100.
Hope it will help someone.