![]() |
Variant Javascript error
solved: see last post
I am customizing a storefront: http://www.tryten.com/shop/ when a product is selected, and then variants are selected from the product options, it should update the sku, price, etc. but instead I am getting a javascript error: Code:
'variants[...].1.length' is null or not an object any thoughts? |
Re: Variant Javascript error
I'm not sure why you're doing your own script. Does it serve a special purpose? I know that my products automatically update the price and SKU when different product options are selected...it's the way X-cart works by default. Isn't that what you wanted with your script?
|
Re: Variant Javascript error
That's kinda my point - I am not changing the script that ships with x-cart and this is my 5th custom install and its always worked before... but its not working now. This particular install also has a few extra nuances, such as the dropdown menu in the main site header, etc. And something is not working right. So I need to know if it has to do with the template, my other javascript or recent x-cart advances.
I would rule out the last choice there, but just had to "repair" the UPS shipping tools in the latest release, so there may be a bug I am not aware of. thanks for looking into this for me though |
Re: Variant Javascript error
and now to make things more confusing - I just tried the site in firefox and all is ok, but with MSIE 7 I get the javascript error.
|
Re: Variant Javascript error
The error has to do with this bit of code:
<script type="text/javascript"> <!-- var usertype = "C"; var scriptNode = false; scriptNode = document.createElement("script"); scriptNode.type = "text/javascript"; --> </script> Have you altered anything in meta.tpl by chance? |
Re: Variant Javascript error
i did add some SEO meta tags and a call to some javascript for a lightbox function (scriptaculous) and a dropdown menu javascript library
didn't alter and if then statements |
Re: Variant Javascript error
I'd remove those first to see if they are causing the conflict.
|
Re: Variant Javascript error
I replaced the meta.tpl in my /skin1/ with the meta.tpl in /skin1_original/ and it works!!! Soooo I will start adding back the meta info that I need at the top one line at a time until something breaks and then I'll know what to 'tweak'.
Thanks soooooo much for pointing me in the right direction. |
Re: Variant Javascript error
fyi: it didn't like prototype.js or DropDownMenuX.js. I had tried removing them individually and it didn't make any difference. but when the original meta.tpl worked, i then figured that i might be crashing on a few levels.
I can live without prototype.js, but I need DropDownMenuX.js, so I'll see if I can figure out where the problem is with that. If you know of a way to get it in that won't crash the product_options module then please let me know. btw: if you check the site in question, you will still get a javascript error, but that is from the dropdown menu not working. Cheers, |
Re: Variant Javascript error
The problem with too much JS on a site is that some of the functions can clash with each other. I am by no means a JS expert, but I'd suggest looking at the different scripts to see if any of them are calling similar values, or clashing on some level. I've had issues with this in the past with certain navigation scripts and the only solution was to use a different script.
|
All times are GMT -8. The time now is 07:05 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.