-
-
Hi There,
We’re having a problem where the Select2 built in to the theme files is causing errors with plugins which use the newer Select2 version built in to Woocommerce. Is there a way I can force the site to use the Woocommerce Select2 for even a specific page?
See console output below:
jquery-migrate.min.js?ver=1.4.1:2 JQMIGRATE: Migrate is installed, version 1.4.1
select2.min.js?ver=1:1 Uncaught Error: Option ‘ajax’ is not allowed for Select2 when attached to a <select> element.
at String.<anonymous> (select2.min.js?ver=1:1)
at Function.each (jquery.js?ver=1.12.4:2)
at r.prepareOpts (select2.min.js?ver=1:1)
at r.prepareOpts (select2.min.js?ver=1:1)
at r.init (select2.min.js?ver=1:1)
at HTMLSelectElement.<anonymous> (select2.min.js?ver=1:1)
at Function.each (jquery.js?ver=1.12.4:2)
at a.fn.init.each (jquery.js?ver=1.12.4:2)
at a.fn.init.e.fn.select2 (select2.min.js?ver=1:1)
at HTMLSelectElement.<anonymous> (ignitewoo-opc.js?ver=1500423599:742)
select2.png Failed to load resource: the server responded with a status of 404 ()
-
Hello,
What plugins do you have installed? Can i see a link of the site?
To remove a script from being called from a page, add this code into page.php file:
$page_id = get_the_ID(); if($page_id == 10){ wp_dequeue_script('select2'); }
Change the page id (in this case 10) to the page’s id you want this script removed for.
Let us know.Best regards!
- This reply was modified 6 years, 9 months ago by Mirela.
-
-
Hello,
The code in my last reply is what you need to add in order to stop a script from being called in a page. Replace the page id with your page’s id. Which in your case is ‘4578’. See screenshot.
So the code would become like this:$page_id = get_the_ID(); if($page_id == 4578){ wp_dequeue_script('select2'); }
See here an example of the page.php file with this code added:
https://codeshare.io/5DP7dW
You can find file page.php directly under ‘specular‘ theme folder, or in Appearances > Editor, in the listed files at the right sidebar.Please know that we do not support third party plugins. The two plugins you are using have not been tested with theme (it’s impossible to do so with all plugins available) and script incompatibility is possible to happen.
Best regards!
-
You must be logged in to reply to this topic.