Take the 2-minute tour ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

I got a problem using Magento about add to cart with custom options.

I filled up all required fields and when I hit "Add To Cart" button, It said

Please specify the product required option(s).

When I go to other products without custom options like Size or Color field. It works fine.

How can I fix this problem?

this is the link: https://francesandalbert.com/ring.html

Thanks.

share|improve this question
    
Options are not submitted (what is not really the case if you ask me), id is wrong (5), value is wrong (7), or there are more options on the products which might not be visible in frontend? –  Fabian Blechschmidt Mar 11 at 7:27

1 Answer 1

up vote 4 down vote accepted

I don't know exactly how you can solve this but I can explain the problem, maybe it helps.

I see that the product page is on https but when you click on the add to cart button the form is submitted to http://francesandalbert.com/checkout/cart/add/uenc/aHR0cDovL2ZyYW5jZXNhbmRhbGJlcnQuY29tL3JpbmcuaHRtbD9fX19TSUQ9VQ,,/product/172/. Notice the http.

Then that pages does a 301 redirect to https://{same url} and what you send by post (the ring size) is lost.

If I use firebug and change the form url to https I can add the product to the cart without any problems.

You can try to change the submit url of the form Mage_Catalog_Block_Product_Abstract::getSubmitUrl or you can set the unsecure base url of your website to https://... avoiding 301 redirects from htaccess.

These are just my suggestions. I have no idea if they will work.

share|improve this answer
    
It works. Thank you so much Marius. I go to app/code/core/Mage/Catalog/Block/Product/View.php And I changed the getAddToCartUrl function from: return $this->helper('checkout/cart')->getAddUrl($product, $additional); to: $new_url = str_replace('http://','https://',$this->helper('checkout/cart')->getAddUrl($prod‌​uct, $additional)); return $new_url; –  Enalds Mar 11 at 8:42
    
@Enalds. I don't know if this is the cleanest solution but..."whatever floats your boat". –  Marius Mar 11 at 8:49
    
@Enalds change the unsecure url to https, your solution will bring you problems when you update! –  Fabian Blechschmidt Mar 11 at 9:33
    
@Fabian Blechschmidt - How can I change the unsecure url to https? I'm newbie to Magento :) –  Enalds Mar 12 at 5:44
    
I also add array('_secure' => true) to the <form action=... –  Enalds Mar 12 at 6:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.