• Resolved joshdb

    (@joshdb)


    After deep diving into an issue I was having with WooCommerce I uncovered why the error was occurring and it was because of the way that this plugin “speeds up” your site.

    Issue

    Woocommerce add to cart button error: wp.template is not a function

    Lazyloading as others have mentioned can speed up a website, but this plugin is just lazy because it does not distinguish between which script tags may be prerequisites to other scripts. Unless all Javascript developers used things like promises/something equivalent, or certain scripts are excluded from this plugin, this SiteGround plugin will continually fail far into the future.

    I don’t know if this plugin lazyloads media (images, video, etcetera), but typically if you’re trying to load your site faster, that is what you’d want to focus most on.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Tsvetan Mitev

    (@tsvetanm)

    Hello @joshdb,

    After reviewing the support thread, it seems the issue may indeed be related to the way scripts are being loaded. To delve deeper into the problem, please reactivate the plugin and then disable the “Defer Render-blocking JavaScript” option in the Speed Optimizer. You can find this setting by navigating to WP-admin -> Speed Optimizer -> Frontend -> JavaScript. Afterward, clear both the website and server-side caches and conduct another test. If the issue persists even with this feature turned off, please disable the combine and minify JavaScript optimizations and test once more. Additionally, could you please provide us what the jQuery script examples from the other thread look like when the plugin is deactivated?

    Our plugin provides a variety of Media optimization features, one of which is Lazy Load. You can find more information about the Media Optimization options available here:
    https://siteground.com/tutorials/wordpress/speed-optimizer/image-optimizations/

    Conducting these tests will help us narrow down the issue. Once you have completed the above tests, please update this thread, and we will continue our investigation.

    Best Regards,

    Tsvetan Mitev

    Thread Starter joshdb

    (@joshdb)

    @tsvetanm

    I reinstalled the Speed Optimizer plugin and the issue returned.

    After disabling the “Defer Render-blocking JavaScript” setting, it seems to resolve the issue.

    This setting is enabled by default, so I imagine I’m not the first person that this has been an issue for.

    • This reply was modified 11 months, 2 weeks ago by joshdb.
    Plugin Support Plamen M

    (@plamenm)

    Hello @joshdb,

    In the current case, the issue might be related to the way jQuery is loaded in the site. To check this, we would like to ask you to provide us with the jquery paths on your site before and after the function “Defer Render-blocking JavaScript” is enabled. For this:

    First, disable the function. Clear the site cache as well as the cache in your browser. Then, open the source code of the page where you see the issue occurring, find all entries related to “jquery” and paste here the full path (you may obfuscate the domain, if you are reluctant to paste it in the forum here);

    Then, enable the function “Defer Render-blocking JavaScript”, again, clear the site cache and the browser cache. Verify that the issue is occurring. Then again provide the paths to the jquery libraries on the page.

    We look forward to your reply.

    Regards,
    Plamen.M
    Tech Support Team
    SiteGround.com

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Does not work with WooCommerce’ is closed to new replies.