Magento Forum

   
TypeError: ‘undefined’ is not an object Problem
 
dnnijmeijer
Jr. Member
 
Total Posts:  27
Joined:  2011-08-30
 

Recently I’m working on a new theme for magento but since yesterday i receive the following error:

TypeError: ‘undefined’ is not an object (evaluating ‘productAddToCartForm.submit’)

I don’t know what i’ve done wrong but now my add to cart button doesn’t work anymore.

Is there anybody who can help me?

 
Magento Community Magento Community
Magento Community
Magento Community
 
dnnijmeijer
Jr. Member
 
Total Posts:  27
Joined:  2011-08-30
 

I’ve got it working again now.

Instead of this line of code:

<button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit()"><span><span><?php echo $buttonTitle ?></span></span></button>

I used this:

<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart'?></span></span></button>

But now I’ve found out that I cannot select any options on my configurable products. The drop down list only has one line which says select an option.

Does anyone have an idea about this problem? They used to work just fine.

 
Magento Community Magento Community
Magento Community
Magento Community
 
claus.just
Jr. Member
 
Total Posts:  15
Joined:  2010-06-09
 

I had the exact same issue and figured out that it was caused by a javascript conflict. It had probably something to do with the well known jQuery NoConflict problem.

The error occurred for me after install of Moo Cloud Zoom. If I tested by changing the name of the .js file in the Moo Cloud Zoom package I had no problem with the Add to cart button or choosing between product attributes. I am not an expert and did not know how to solve the issue with the .js file, so instead i uninstalled the Moo Cloud Zoom and installed the Cloud Zoom Pro module.

Now it works like a charm.

BR
Claus

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top