• Resolved Sigurd Watt

    (@sigurdwatt)


    I have found several other threads on this so I am very surprised not to find an actual solution that fixes this very critical problem. =

    https://echo-3.co.uk/wp-content/plugins/woocommerce/assets/client/blocks/mini-cart-frontend.js?ver=eba896c62201a23c4175 – This is the file in question which is making the API call to stripe which is very heavy (600kb) and it does not seem necessary ? As the user is of course not going to be paying for their item on the product page. However, if I even defer this script then I get this error:

    Uncaught TypeError: window.wc is undefined <anonymous> https://echo-3.co.uk/wp-content/plugins/woocommerce/assets/client/blocks/mini-cart-frontend.js?ver=eba896c62201a23c4175:1 <anonymous> https://echo-3.co.uk/wp-content/plugins/woocommerce/assets/client/blocks/mini-cart-frontend.js?ver=eba896c62201a23c4175:3

    So it seems that this code is coming from the WooCommerce core.

    There is not just the API call to stripe in this file but there are some things which I may need, hence the error ? But because they are in the same file I cannot just defer the entire file.

    I even tried to block the API call to Stripe in the functions.php file but sadly did not have any success.

    If you could please advise if there is a hook that I could use to stop this API call happening on the WooCommerce product page or what the solution is to this issue ? As this is a very heavy asset to load when it may not be needed

    Thanks

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

Viewing 1 replies (of 1 total)
  • Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello Sigurd Watt,

    Thank you for contacting Woo support.

    I see you’ve spotted the mini-cart-frontend.js file loading on your product page.
    Given that it’s 600kb, you’d like to prevent an API call made by this file on the product page where it is not required. You aim to improve the overall performance of the site.

    As your query is related to specific code in the WooCommerce extension, I recommend posting your question on the WooCommerec Github. There we have many developers who can look into your query and check if this is something that can be improved in the code.

    I hope this helps.
    Let me know if you have any questions??

    Best regards.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.