jQuery error – has not method simplePlaceholder
-
After updating to version 2.0.12 the javascript on the site stopped working.
In the console I received and error stating there was no method simplePlaceholder.
After taking a look at the code I found the issue is WooCommerece is using a handle for a script titled ‘jquery-placeholder’ which is a common jQuery plugin, but is actually using a modified version called ‘Simple Placeholder’.
When another plugin or theme is using the ‘jQuery Placeholder’ plugin, they often will use the default handle ‘jquery-placeholder’ which will override the custom WooCommerce Version.
I fixed the issue by adding the following code to the theme.
add_action('wp_enqueue_scripts', 'wooBugsFix' ); function wooBugsFix(){ global $woocommerce; wp_enqueue_script( 'jquery-placeholder-woo', $woocommerce->plugin_url() . '/assets/js/jquery-placeholder/jquery.placeholder.js', array( 'jquery' ), $woocommerce->version, true ); }
Please update the code to use a unique handle for the unique script.
Hope this helps others with the same issue!
- The topic ‘jQuery error – has not method simplePlaceholder’ is closed to new replies.