Magento Forum

   
Page 2 of 4
Option validation failed to add product to cart
 
Tom Arnst
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2007-12-20
Vanha Vaasantie 291, Noormarkku, 29600, Finland
 

I have the same problem re-saving custum options isn’t working for me, has someone a solution ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
smittyatthebeach
Jr. Member
 
Total Posts:  4
Joined:  2008-10-17
 

Any thoughts on this? I’m experiencing the same probolem....

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dustin
Sr. Member
 
Total Posts:  160
Joined:  2008-03-13
Columbus, OH
 

add another one to this being a problem

most of our products are bundle items with upgrade options and this makes everything much more difficult

we have to go back in and add a “no thank you” option so something can be selected for it to get placed in the cart

 
Magento Community Magento Community
Magento Community
Magento Community
 
winterradio
Sr. Member
 
Total Posts:  84
Joined:  2008-02-01
 

Having a similar problem.  Made all options required for the time being and temporarily fixes this issue, however, when manually inputting phone orders or PO’s I cannot add any products to the customers cart that have custom options.  I am able to successfully add products without custom options however the bulk of my store has custom options so I cannot input manual orders for the time being.

 
Magento Community Magento Community
Magento Community
Magento Community
 
B00MER
Sr. Member
 
Avatar
Total Posts:  130
Joined:  2007-12-27
DFW, TX
 

/app/code/core/Mage/Catalog/Model/Product/Option/Type/Select.php

/**
     * Prepare option value for cart
     *
     * @throws Mage_Core_Exception
     * @return mixed Prepared option value
     */
    public function prepareForCart()
    
{
        
if ($this->getIsValid()) {
            
return is_array($this->getUserValue()) ? implode(','$this->getUserValue()) : $this->getUserValue();
        
}
        Mage
::throwException(Mage::helper('catalog')->__('Option validation failed to add product to cart'));
    
}

For now I’ve gotten this working by #commenting out:

#Mage::throwException(Mage::helper('catalog')->__('Option validation failed to add product to cart'));

Whomever decided to use a shorthand if statement on a return should be on code review for the next 2 weeks if you ask me!!!

Keep in mind altering the core files may cause future upgrade issues, and I don’t have the time to write an override method in app/local to prevent this in the future.  With that being said just make a copy of the file as a .orig or whatever and rename it back once its time to upgrade.

I can’t guarantee that this won’t break anything else but so far from my unit testing it seems to fix the issue.

Even Zend Studio when analyzing Select.php points out the bug (see attached).

If someone hasn’t opened a Bug on this issue it really needs to be looked into.
EDIT: There is a bug outstanding to this issue: http://www.magentocommerce.com/bug-tracking/issue/?issue=5823

Image Attachments
select.php.bug.gif
 
Magento Community Magento Community
Magento Community
Magento Community
 
B00MER
Sr. Member
 
Avatar
Total Posts:  130
Joined:  2007-12-27
DFW, TX
 

http://www.magentocommerce.com/bug-tracking/issue/?issue=5805

The above issue is also fixed when commenting out the exception I mentioned above.

 
Magento Community Magento Community
Magento Community
Magento Community
 
winterradio
Sr. Member
 
Total Posts:  84
Joined:  2008-02-01
 

Thanks for the temporary fix B00MER, hopefully the redundant if statement will be corrected on the next release.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sigee
Jr. Member
 
Total Posts:  6
Joined:  2009-03-17
 

BIG THX, working perfectly!!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
BrightWeb Marketing
Jr. Member
 
Total Posts:  7
Joined:  2008-11-25
 

B00mer:

Thank you for pointing me in what I hope to be the right direction.

I was directed to this post as a solution to my problem here: http://www.magentocommerce.com/boards/viewthread/38094/#t123979 (possibly the same problem with similar symptoms).

I tried the code you posted and was able to get the product into my cart, however the custom option does not show up in the cart and I get a message on the cart page that says:  “Some of the products below don’t have all the required options. Please remove them and add again with all the required options.”

The “validateUserValue” function is not receiving any information about the custom option I selected.  I’m not sure where to look next.

 
Magento Community Magento Community
Magento Community
Magento Community
 
rova
Jr. Member
 
Total Posts:  18
Joined:  2008-04-04
 

Thank you Boomer, works fine for me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
B00MER
Sr. Member
 
Avatar
Total Posts:  130
Joined:  2007-12-27
DFW, TX
 
BrightWeb Marketing - 07 April 2009 03:11 PM

B00mer:

Thank you for pointing me in what I hope to be the right direction.

I was directed to this post as a solution to my problem here: http://www.magentocommerce.com/boards/viewthread/38094/#t123979 (possibly the same problem with similar symptoms).

I tried the code you posted and was able to get the product into my cart, however the custom option does not show up in the cart and I get a message on the cart page that says:  “Some of the products below don’t have all the required options. Please remove them and add again with all the required options.”

The “validateUserValue” function is not receiving any information about the custom option I selected.  I’m not sure where to look next.

BrightWeb, what version of Magento are you running, I’m assuming 1.3, and also is this the same scenerio for all of your products or just some in particular?  If some in particular what custom options as in type: select, textarea, radiobuttons, etc. are they?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ogweewee
Member
 
Total Posts:  47
Joined:  2008-10-20
 

Boomer, drinks on me tonight!
Thanks for resolving this, atleast until Magento decides to suprise us again.

 
Magento Community Magento Community
Magento Community
Magento Community
 
BrightWeb Marketing
Jr. Member
 
Total Posts:  7
Joined:  2008-11-25
 

B00mer:

Thanks for the reply.  Yes, this problem happens in version 1.3.0.  It only happens with products that have custom options.  Regular products can be added to the cart just fine.

 
Magento Community Magento Community
Magento Community
Magento Community
 
hridaya
Member
 
Avatar
Total Posts:  63
Joined:  2009-02-04
Nepal
 

I face the same problem as well.. (Option validation failed to add product to cart)

 
Magento Community Magento Community
Magento Community
Magento Community
 
hridaya
Member
 
Avatar
Total Posts:  63
Joined:  2009-02-04
Nepal
 

I face the same problem as well.. (Option validation failed to add product to cart)

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 2 of 4