Try plugins/woocommerce/assets/js/frontend/add-to-cart-variation.min.js or plugins/woocommerce/assets/. While doing so, keep an eye on the JavaScript errors on the browser console, those can help identify the problem.
hope this helps,
frank
Thread Starter
rcanny
(@rcanny)
Hello, thanks so much for your help.
Excluding: plugins/woocommerce/assets
did the trick.
Thanks!
Richard
Thread Starter
rcanny
(@rcanny)
Hello, we’ve notice that with autoptimize turned on the prices are not showing up for the variable products. When we turn autoptimize off everything works correctly.
In addition to plugins/woocommerce/assets there must be another script that woocommerce uses for variable products.I also have plugins/woocommerce/assets/js/frontend/add-to-cart-variation.min.js excluded.
The drop down selections for the variations are working, it’s just there is no price displayed. I looked in the console (but I am not a developer) and here is what I see in red:
add-to-cart-variation.min.js:1 Uncaught ReferenceError: wp is not defined
at l (add-to-cart-variation.min.js:1)
at HTMLFormElement.t.onFoundVariation (add-to-cart-variation.min.js:1)
at HTMLFormElement.dispatch (jquery.js:1)
at HTMLFormElement.r.handle (jquery.js:1)
at Object.trigger (jquery.js:1)
at HTMLFormElement.<anonymous> (jquery.js:1)
at Function.each (jquery.js:1)
at n.fn.init.each (jquery.js:1)
at n.fn.init.trigger (jquery.js:1)
at HTMLFormElement.t.onFindVariation (add-to-cart-variation.min.js:1)
l @ add-to-cart-variation.min.js:1
t.onFoundVariation @ add-to-cart-variation.min.js:1
dispatch @ jquery.js:1
r.handle @ jquery.js:1
trigger @ jquery.js:1
(anonymous) @ jquery.js:1
each @ jquery.js:1
each @ jquery.js:1
trigger @ jquery.js:1
t.onFindVariation @ add-to-cart-variation.min.js:1
dispatch @ jquery.js:1
r.handle @ jquery.js:1
trigger @ jquery.js:1
(anonymous) @ jquery.js:1
each @ jquery.js:1
each @ jquery.js:1
trigger @ jquery.js:1
(anonymous) @ add-to-cart-variation.min.js:1
setTimeout (async)
t @ add-to-cart-variation.min.js:1
C.fn.wc_variation_form @ add-to-cart-variation.min.js:1
(anonymous) @ add-to-cart-variation.min.js:1
each @ jquery.js:1
each @ jquery.js:1
(anonymous) @ add-to-cart-variation.min.js:1
i @ jquery.js:1
fireWith @ jquery.js:1
ready @ jquery.js:1
J @ jquery.js:1
Thanks!
Can you try adding wp-includes to the comma-separated JS optimization exlusion list?
Thread Starter
rcanny
(@rcanny)
That worked! Thanks very much for your help.
you’re welcome rcanny π
Thread Starter
rcanny
(@rcanny)
Hi,
We noticed that the problem has reappeared again. Everything works fine with JS optimization turned off. When we turn it on, our variable products don’t have the price showing.
Here is our current exclusion list:
wp-includes/js/dist/, wp-includes/js/tinymce/, js/jquery/jquery.js, sv-wc-payment-gateway-payment-form.min.js, wc-authorize-net-cim.min.js, plugins/woocommerce/assets/, plugins/woocommerce/assets/js/frontend/add-to-cart-variation.min.js, ai.min.js
Thanks so much for your help!
Richard.
So what JS errors do you see on the console?
Thread Starter
rcanny
(@rcanny)
Hello,
Sorry, but I’m not a developer…just a user π
But here is one page that has the issue. I turned AO JS optimization back on so you could perhaps see the error real time.
https://www.ultimationinc.com/replacement-parts/buy-rs14/gravity-conveyor-1-38-dia-rollers-12-w-10-l-steel
Normally the price will show up inside the gray bar near where the quantity is showing. The price changes according to the three variables in the drop down.
Thanks!
Thread Starter
rcanny
(@rcanny)
Here is what I found:
DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337
gravity-conveyor-1-38-dia-rollers-12-w-10-l-steel
HTML1300: Navigation occurred.
gravity-conveyor-1-38-dia-rollers-12-w-10-l-steel
HTML1512: Unmatched end tag.
gravity-conveyor-1-38-dia-rollers-12-w-10-l-steel (358,77806)
SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited.
gravity-conveyor-1-38-dia-rollers-12-w-10-l-steel
SCRIPT1009: Expected ‘}’
autoptimize_5679825239b1344c5c5cfc9124bb30d1.js (1597,862)
The first two items have a warning symbol; the final item relating to script 1009 and autoptimize has the large X symbol.
Thanks!
Richard.
OK, can you disable the Javascript “try/catch wrapping” option?
Thread Starter
rcanny
(@rcanny)
Hello,
That seems to be working. Thanks very much for your help!
you’re welcome rcanny π
have a nice weekend!
frank