Option 1: Get your host to update the rule set
↑ Back to topOption 2: Rename files and update functions.php
↑ Back to topThis option only works with WooCommerce 2.6.14 or below. If you are running WooCommerce 3.0.0 or above, please refer to Option 1 or 3.
Alternatively, you’ll need to change how WooCommerce handles the files. This change will need to be repeated whenever you update the WooCommerce plugin as the changes will be overwritten.
Rename these files:
wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery.cookie.js wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery.cookie.min.js to: wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery_cookie.js wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery_cookie.min.jsAnd add the following to your theme’s functions.php file:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_enqueue_scripts', 'custom_frontend_scripts' );function custom_frontend_scripts() {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' ), '1.3.1', true ); | |
} |
Option 3: use a plugin to rename the files
↑ Back to top- If you are using WooCommerce 2.6.14 or below: woocommerce-jquery-cookie-fix.zip
- If you are using WooCommerce 3.0.0 or above: woocommerce-js-cookie-fix