'Magento "Please specify the product's option(s)" message remains after completing add to cart after initially clicking "Add to Cart" on category page

Sequence is that customer clicks "Add to Cart" button for a configurable product on the category page. As expected, customer is taken to product page with a notification message to "Please specify the product's option(s)." All good. Problem is that once the options have been selected and the customer clicks "Add to Cart" on the product page, the "Please specify the product's option(s)" message re-appears along with a message indicating the product was successfully added to the cart. Confusing for customer, who has to go into cart to be sure they added it successfully.

I've only found the problem described in one other forum post (http://www.magentocommerce.com/boards/viewthread/298926/), but it's unanswered.

A few thoughts:

  • I have the "After Adding a Product Redirect to Shopping Cart" config setting for the site set to No. Really don't want customers going back and forth to the cart like that--too interruptive to shopping.
  • It seems to have to do with the URL, which is appended with a "?options=cart" variable both when customer first goes into product page (correct behavior) and after reloading page when successfully adding product to cart (seemingly incorrect behavior).
  • I've considered tweaking the code to strip the "?options=cart" part of the URL after Add to Cart is hit on the product page, but I figured I'd check with the Internet and see if I can avoid that work. Seems like I'm missing something simple (or I've stumbled upon a bug).

Not a huge problem, but definitely confusing for the end user. Any ideas?



Solution 1:[1]

If anyone else encounters this problem in the future, here's the fix. I know that there is a better way to overwrite core Magento php files, but the quick and dirty way is to alter the _goBack() function within app/code/core/Mage/Checkout/controllers/CartController.php. This begins at line 74, approximately.

Change the following from...

elseif (!Mage::getStoreConfig('checkout/cart/redirect_to_cart')
    && !$this->getRequest()->getParam('in_cart')
    && $backUrl = $this->_getRefererUrl()
) {
       $this->getResponse()->setRedirect($backUrl);
  }

...to...

elseif (!Mage::getStoreConfig('checkout/cart/redirect_to_cart')
    && !$this->getRequest()->getParam('in_cart')
    && $backUrl = $this->_getRefererUrl()
) {
    if (strstr($backUrl,'?options=cart')) $backUrl = str_replace('?options=cart', '', $backUrl);            
    $this->getResponse()->setRedirect($backUrl);
  }

Why on Earth this is not default functionality is beyond me.

Solution 2:[2]

Had the same problem today. I couldn't edit an order because of the "Please specify the product's option(s)." message.

I checked logs and found one product which stop the operation. Problem was in configurable product at tab Custom Options. I've deleted all of the options there and now everything is OK.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user3163227
Solution 2 maciej813