fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Variations not working correctly on archive product – console error wc_variation_form is not a function

Hi there,

I am using the Variation Swatches for Woocommerce. It appears after updating plugins and themes on my clients Divi/Woocommerce website, the basic toggle swatches for products on the homepage are not working.

When I check the console I am getting the following error coming from the /woo-variation-swatches/assets/js/frontend.min.js  file.

The error is as follows:  Uncaught TypeError: t(...).wc_variation_form is not a function

Please can you help me resolve this issue, my clients customers are unable to purchase any products because of it.

Hakik Zaman

Hi Steven,

Thanks for reaching out to us. Are you using the “load more plugin” for displaying products?

Could you record me reproducing your issue using a tool like this? https://www.useloom.com
It helps me to quickly figure out the issue.

Thank you

Sorry it seems there were two reply’s posted – please refer to the one below…

Hi Hakik,

Thanks for your reply.

However it was not an issue with your plugin. The add-to-cart-variation.js  file was not being enqueued. Thus the wc_variation_form jquery module was not defined which produced the error.

We still have no idea why, we have disabled plugins and even rolled back Woocommerce, but suspect it is an issue with the way Divi handles woocommerce.

We have enqueued the script manually to fix the issue, but still stumped as to why.

Hakik Zaman

Hi Steven,

Glad to know you identified the issue.

Did you try with a default WordPress theme?

Thank you