• Resolved bizendev

    (@bizendev)


    Couldn’t find any way to contact them for support directly… the whole woocommerce plugin ecosystem kinda suck when it comes to support/bug signaling.

    Anyway… Custom Fields for WooCommerce throws a

    Uncaught TypeError: jQuery(…).select2 is not a function

    on every page that is not a woocommerce page (product/cat/cart/checkout).
    Pretty annoying.

    I edited line 110 “jQuery(‘.af_cf_multiselect_custom’).select2();” to have a timeout and check if the script exist and eventually throw a warn.

    setTimeout(() => {
    // Initialize select2 with retry logic
    function initSelect2WhenReady(attempts = 0, maxAttempts = 20) {
    if (typeof jQuery.fn.select2 !== 'undefined') {
    jQuery('.af_cf_multiselect_custom').select2();
    } else if (attempts < maxAttempts) {
    // Try again after 100ms, up to 20 times (2 seconds total)
    setTimeout(() => initSelect2WhenReady(attempts + 1, maxAttempts), 100);
    } else {
    console.warn('Select2 library not available after waiting');
    }
    }

    initSelect2WhenReady();
    }, 1200);
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Bug in “Custom Fields for WooCommerce” by Addify’ is closed to new replies.