Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Variant Javascript error

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-05-2007, 02:06 PM
  jonc's Avatar 
jonc jonc is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 53
 

Default 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?
__________________
jonc
X-Cart Gold 4.1.10 - http://www.hypnoskates.com
X-Cart Gold 4.1.10 - http://tryten.com/shop/
X-Cart Gold 4.1.10 - http://www.bluecurl.ca/shop/
Reply With Quote
  #2  
Old 12-05-2007, 02:19 PM
 
anela2003 anela2003 is offline
 

Senior Member
  
Join Date: Nov 2007
Posts: 103
 

Default 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?
__________________
4.1.9 Gold

window valances | curtains
Reply With Quote
  #3  
Old 12-05-2007, 02:27 PM
  jonc's Avatar 
jonc jonc is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 53
 

Default 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
__________________
jonc
X-Cart Gold 4.1.10 - http://www.hypnoskates.com
X-Cart Gold 4.1.10 - http://tryten.com/shop/
X-Cart Gold 4.1.10 - http://www.bluecurl.ca/shop/
Reply With Quote
  #4  
Old 12-05-2007, 03:13 PM
  jonc's Avatar 
jonc jonc is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 53
 

Default 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.
__________________
jonc
X-Cart Gold 4.1.10 - http://www.hypnoskates.com
X-Cart Gold 4.1.10 - http://tryten.com/shop/
X-Cart Gold 4.1.10 - http://www.bluecurl.ca/shop/
Reply With Quote
  #5  
Old 12-05-2007, 03:29 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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?
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #6  
Old 12-05-2007, 03:38 PM
  jonc's Avatar 
jonc jonc is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 53
 

Default 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
__________________
jonc
X-Cart Gold 4.1.10 - http://www.hypnoskates.com
X-Cart Gold 4.1.10 - http://tryten.com/shop/
X-Cart Gold 4.1.10 - http://www.bluecurl.ca/shop/
Reply With Quote
  #7  
Old 12-05-2007, 06:36 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Variant Javascript error

I'd remove those first to see if they are causing the conflict.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #8  
Old 12-05-2007, 07:26 PM
  jonc's Avatar 
jonc jonc is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 53
 

Default 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.
__________________
jonc
X-Cart Gold 4.1.10 - http://www.hypnoskates.com
X-Cart Gold 4.1.10 - http://tryten.com/shop/
X-Cart Gold 4.1.10 - http://www.bluecurl.ca/shop/
Reply With Quote
  #9  
Old 12-05-2007, 07:59 PM
  jonc's Avatar 
jonc jonc is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 53
 

Default 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,
__________________
jonc
X-Cart Gold 4.1.10 - http://www.hypnoskates.com
X-Cart Gold 4.1.10 - http://tryten.com/shop/
X-Cart Gold 4.1.10 - http://www.bluecurl.ca/shop/
Reply With Quote
  #10  
Old 12-06-2007, 04:56 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:01 AM.

   

 
X-Cart forums © 2001-2020