• Resolved kisabelle

    (@kisabelle)


    Hi, we recently updated to WooCommerce 3.0 and are now getting a select2.js error coming from the WooCommerce Export Orders – PRO Plugin. This javascript error is appearing on the edit order page in the admin area, and is preventing us from being able to issue refunds via Stripe. We have had to disable the plugin for now.

    Here’s a sample console error:

    select2.js:934 Uncaught Error: Option ‘ajax’ is not allowed for Select2 when attached to a <select> element.
    at String.<anonymous> (select2.js:934)
    at Function.each (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-core,jquery…:2)
    at constructor.prepareOpts (select2.js:932)
    at constructor.prepareOpts (select2.js:2794)
    at constructor.init (select2.js:690)
    at HTMLSelectElement.<anonymous> (select2.js:3578)
    at Function.each (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-core,jquery…:2)
    at a.fn.init.each (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-core,jquery…:2)
    at a.fn.init.$.fn.select2 (select2.js:3565)
    at HTMLSelectElement.<anonymous> (wc-enhanced-select.min.js:1)
    (anonymous) @ select2.js:934
    each @ load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-core,jquery…:2
    prepareOpts @ select2.js:932
    prepareOpts @ select2.js:2794
    init @ select2.js:690
    (anonymous) @ select2.js:3578

    Please advise when this issue is resolved. If you require additional information / logging info I’m happy to help.

    Thank you!

Viewing 15 replies - 16 through 30 (of 38 total)
  • Hi guys,

    I had the same error. After some digging I found out that it was a bug between woocommerce and my advanced custom field plugin. (maybe for some of you it might be another plugin). My ACF uses select verion 3 (while Yoast and WC need and use 4, so it interferes).

    For ACF I put a small hook in my theme’s function.php:

    function my_acf_init()
    {
    	acf_update_setting('select2_version', 4);
    }
    add_action('acf/init', 'my_acf_init');

    Hope this might help or put you guys in the right direction.

    Greetz Renske

    I am still having the error! I am using these plugins: <br />

    • Advanced Custom Fields Pro – 5.3.1
    • WooCommerce 3.0.6

    <br />
    Anyone solve this already?

    @merlinmonmouth please help us on this. Thanks!

    • This reply was modified 7 years, 6 months ago by ramguiao.
    Plugin Author merlinmonmouth

    (@merlinmonmouth)

    @ramguiao
    If you have a problem with Advanced Custom Fields you probably want to contact the plugin owner there. They should be able to help you…

    Merlin

    Did you try my solution?

    For me, de-activating the plugin “Ultimate Addons for Visual Composer”.
    I found by using developer tools in my browser which select2 script is running, from there I started to dig in the plugins, and my first try was bingo.

    @digizaal, the “Ultimate Addons for Visual Composer” was also my issue. Thanks for sharing.

    Fixed: updating “Ultimate Addons for Visual Composer” fixed this for me.

    • This reply was modified 7 years, 6 months ago by scottiss.

    @mmmrenske

    I tried your solution but still no luck.

    Anyone solves this?

    Hi!

    I recently updated to WooCommerce 3.0.6 and now we are getting a select2.js error:

    Error: Option ‘ajax’ is not allowed for Select2 when attached to a <select> element.

    How can i fix it?

    The problem is not solved at all.

    I have issue with the select box in admi area and outside admin area on frontend.

    Same issue here! On my side it’s a plugin relying on the Redux Framework.

    Updating Product Attributes is impossible at the moment.

    Ugh…I’m having this error as well in my backend…when I try to place a manual order I can’t get a listing of clients…any word on when this is going to be fixed?

    Thanks in advance to anyone who answers.

    P.S. I’m not using the Advanced Addons for Visual Composer. I’m using Kleo theme, Paid Memberships Pro, WooCommerce and a bunch of plugins, everything (including WP) is fully updated.

    Have same problem here too.
    Nothing is actually fixed.

    if you have Advance Custom field Pro,
    might it crashed with WC 3.

    to solve this, please follow temporary instruction below :
    1. open select.php at (wp-content/plugins/acf-pro/fields/select.php
    2. find function input_admin_enqueue_scripts()
    3. change $script = acf_get_dir(“assets/inc/select2/3/select2{$min}.js”); to be $script = acf_get_dir(“assets/inc/select2/4/select2{$min}.js”);
    4. change $style = acf_get_dir(“assets/inc/select2/3/select2.css”); to be $style = acf_get_dir(“assets/inc/select2/4/select2.css”);

    with this “temporary” solution, hope this can help other wc devs.

    With Visual Composer , and addons, the error also exists,

    Error: Option ‘ajax’ is not allowed for Select2 when attached to a <select> element.
    at String.<anonymous> (ultimate-woocomposer-backend.min.js?ver=4.7.5:1)
    at Function.each (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-widget,jquery-ui-mo…:2)
    at d.prepareOpts (ultimate-woocomposer-backend.min.js?ver=4.7.5:1)
    at d.prepareOpts (ultimate-woocomposer-backend.min.js?ver=4.7.5:2)
    at d.init (ultimate-woocomposer-backend.min.js?ver=4.7.5:1)
    at HTMLSelectElement.<anonymous> (ultimate-woocomposer-backend.min.js?ver=4.7.5:2)
    at Function.each (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-widget,jquery-ui-mo…:2)
    at a.fn.init.each (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,jquery-ui-core,jquery-ui-widget,jquery-ui-mo…:2)
    at a.fn.init.a.fn.select2 (ultimate-woocomposer-backend.min.js?ver=4.7.5:2)
    at HTMLSelectElement.<anonymous> (wc-enhanced-select.min.js?ver=3.0.8:1)

    • This reply was modified 7 years, 5 months ago by Monclee.

    for me, the offending plugin was:

    TWI Woocommerce Grid/Slider/Carousel Lite

    joe

Viewing 15 replies - 16 through 30 (of 38 total)
  • The topic ‘select2.js error after updating to WooCommerce 3.0’ is closed to new replies.