WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
jQuery error - has not method simplePlaceholder (13 posts)

  1. Mat Lipe
    Member
    Posted 1 year ago #

    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!

    http://wordpress.org/extend/plugins/woocommerce/

  2. Patrick Rauland
    Member
    Posted 11 months ago #

    Hi Mat,

    Just as an FYI I submitted a pull request to fix this: https://github.com/woothemes/woocommerce/pull/3586

    Hopefully they'll pull it in. :)

  3. Mat Lipe
    Member
    Posted 11 months ago #

    Great!

    Thanks BFTrick!

  4. popgirl23
    Member
    Posted 9 months ago #

    Hi Matt

    Thanks for this big fix. One question though..

    "Please update the code to use a unique handle for the unique script."

    Can you explain this a bit more? I added the function to my theme but it's still not working. I have an ok understanding of php so just some direction would help. Thanks.

  5. Mat Lipe
    Member
    Posted 9 months ago #

    Hi popgirl,

    That note is instructions for WooCommerce to fix the issue for everyone. By cueing up the script with a unique handle it will not override scripts being used by themes. (this would be done in core WooCommerce)

    They have released some updates since this request, so it is possible it has been fixed since then.

    At the time of starting this thread, I was able to fix the issue by adding the above code to my theme's functions.php file.

    Hope this helps.

  6. popgirl23
    Member
    Posted 9 months ago #

    Thanks for your fast reply.

    hmmm I did update woo just now, and I did add the function to my theme's function.php file but still seeing same problem.

    Everything works fine except the " Click here to enter your code" link. When I click it I get sent down the page a bit but there's no place there to enter a number. Is that supposed to happen or should there be a window popup?

    FYI I copied and pasted the function code above but didn't change anything. Should I have edited something?

    Thanks for your time. If this doesn't work Ill have to submit a ticket with Woo.

  7. Mat Lipe
    Member
    Posted 9 months ago #

    Hi popgirl,

    Where are you seeing the "Click here to enter your code" link?

    Do you have a link you could post, or is it on the backend?

  8. popgirl23
    Member
    Posted 9 months ago #

  9. popgirl23
    Member
    Posted 9 months ago #

  10. Mat Lipe
    Member
    Posted 9 months ago #

    Hi popgirl,

    I am unable to find a "Click here to enter your code" link on that page, however I did check it out for script errors and it appears to be pretty clean.

    I'm not sure what the issue is, however it does not appear to be related to the Simple Placholder script.

    Sorry I couldn't be more help.

  11. popgirl23
    Member
    Posted 9 months ago #

    Its near the top of that page in the gray box with blue trim.

    Thats ok. Thanks for taking the time with me. I submitted a ticket with Woo so hopefully we can get it solved.

    Thanks Matt!

  12. hardeep123
    Member
    Posted 7 months ago #

    Hi popgirl,

    I also have a same problem with "Click here to enter your code" link is not working. I read your problem. Please help me if you solve this problem in your theme.

    There is no js error in my browser console.

    Thanks in advance.

  13. popgirl23
    Member
    Posted 7 months ago #

    Sorry hardeep123,

    I dont have an answer for you. I think we went another route on our project.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic