• Plugin Author SantiagoInteractive

    (@santiagointeractive)


    WooCommerce plugin fails to load jQuery Cookie JavaScript due to current Mod_Security ruleset on your web server. Files: jquery.cookie.js and jquery.cookie.min.js, located inside folder /plugins/woocommerce/assets/js/jquery-cookie/ may cause some issues with “Order” button and other minor template issues if not loaded properly.

    To fix this small issue folow these steps:

    Step 1: Login to FTP then rename files inside folder /plugins/woocommerce/assets/js/jquery-cookie/:

    jquery.cookie.js into jquery_cookie.js
    jquery.cookie.min.js into
    query_cookie.min.js

    Step 2: Inside folder /wp-content/themes/ find theme which is in use, for example, twentyfourteen then add following lines into functions.php:


    add_action( 'wp_enqueue_scripts', 'custom_woo_cookie_frontend' );

    function custom_woo_cookie_frontend() {
    global $post, $woocommerce;
    $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
    wp_deregister_script( 'jquery-cookie' );
    wp_register_script( 'jquery-cookie', $woocommerce->plugin_url() . '/assets/js/jquery-cookie/jquery_cookie' . $suffix . '.js', array( 'jquery' ), '', true );
    }

    Now the JavaScript files jquery_cookie.js and jquery_cookie.min.js won’t produce 404 errors due to Mod_Security module interference.

  • The topic ‘Payment redirect is not working. Why?’ is closed to new replies.