Magento Forum

Please specify the product required option(s) error when trying to add to cart
 
DarthMartin
Jr. Member
 
Total Posts:  2
Joined:  2010-05-05
 

Hi there,

I also had the bug currently in v1.4.1.1 always with “configurable products”.
The reason for that was, that I had to change the file “addtocart.phtml” which can be found in the “frontend/default/<theme>/template/catalog/product/view” folder. I removed the input field for quantity because in my case there’s no need to input quantity for the products.

But after removing this field and after choosing all options, i.e. “color” and “size” and trying to add the product to the cart, I always got the error “Please specify product option(s)” and mostly the product wasn’t added to the cart.
So, by adding the quantity-input field again and just setting it from “type=button” to “type=hidden” it immediately worked without any problems!

I hope this helps anybody who encounters this problem!

Cheers,
Martin

 
Magento Community Magento Community
Magento Community
Magento Community
 
AdamRInt
Sr. Member
 
Total Posts:  91
Joined:  2011-04-06
 

Bump.

I have same problem with Magento ver. 1.4.1.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
mariyar
Jr. Member
 
Total Posts:  11
Joined:  2011-05-19
 
got-bonsai - 03 April 2009 08:47 AM

I had this problem with products without any custom options.
Even new simple products with no options, added via product import didn’t work.

The only way I found to fix it was to go through each product, click on custom options, click on another setting, change it then change it back then save the product.
Sounds strange but it works.  It took ages though even for my meagre 350 products

I tried reimporting products and reimporting products with changes but nothing seemed to work except the above.

The only way you says is really a good way to solve the problem..Thank you !!

________________________________
Cheap WOW Gold

 
Magento Community Magento Community
Magento Community
Magento Community
 
tompotter
Jr. Member
 
Total Posts:  5
Joined:  2011-10-22
 
cespitia - 18 February 2011 01:36 PM

So for you guys who are still having trouble with this, make sure your calls to container1 and container2 are placed inside the form tag.  If you have them outside the tag, you will get an error. 

<form action="<?php echo $this->getAddToCartUrl($_product) ?>” method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>

<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>

</form>

I hope this helps anyone with this pesky message.

Chris.

I had tabs installed so had to make changes in catalogproductview.phtml. container one had complete forms so in the end, there was a form inside another form. Moved product form tag just before the call to container2 and everything is working as it should be now.

Moved:

<form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
        <
div class="no-display">
            <
input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
            <
input type="hidden" name="related_product" id="related-products-field" value="" />
        </
div>

To:

<?php if ($_product->isSaleable() && $this->hasOptions()):?>
                <?php 
echo $this->getChildChildHtml('container1'''truetrue?>
            <?php 
endif;?>

        
</div>

        <
div class="product-img-box">
            
<?php echo $this->getChildHtml('media'?>
        
</div>

        <
div class="clearer"></div>

    <
div class="product-collateral">
        
<?php if (!Mage::getStoreConfig('easy_tabs/general/descriptiontabbed')):?>
            <?php 
echo $this->getChildHtml('description'?>
        <?php 
endif;?>
        <?php 
echo $this->getChildHtml('additional'?>
        <?php 
echo $this->getChildHtml('upsell_products'?>
        <?php 
echo $this->getChildHtml('product_additional_data'?>
    
</div>

<
form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
        <
div class="no-display">
            <
input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
            <
input type="hidden" name="related_product" id="related-products-field" value="" />
        </
div>
        
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
            <?php 
echo $this->getChildChildHtml('container2'''truetrue?>
        <?php 
endif;?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
alex.zhan
Member
 
Total Posts:  35
Joined:  2010-10-19
 
tompotter - 06 February 2012 11:14 AM

cespitia - 18 February 2011 01:36 PM
So for you guys who are still having trouble with this, make sure your calls to container1 and container2 are placed inside the form tag.  If you have them outside the tag, you will get an error. 

<form action="<?php echo $this->getAddToCartUrl($_product) ?>” method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>

<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>

</form>

I hope this helps anyone with this pesky message.

Chris.

I had tabs installed so had to make changes in catalogproductview.phtml. container one had complete forms so in the end, there was a form inside another form. Moved product form tag just before the call to container2 and everything is working as it should be now.

Moved:

<form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
        <
div class="no-display">
            <
input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
            <
input type="hidden" name="related_product" id="related-products-field" value="" />
        </
div>

To:

<?php if ($_product->isSaleable() && $this->hasOptions()):?>
                <?php 
echo $this->getChildChildHtml('container1'''truetrue?>
            <?php 
endif;?>

        
</div>

        <
div class="product-img-box">
            
<?php echo $this->getChildHtml('media'?>
        
</div>

        <
div class="clearer"></div>

    <
div class="product-collateral">
        
<?php if (!Mage::getStoreConfig('easy_tabs/general/descriptiontabbed')):?>
            <?php 
echo $this->getChildHtml('description'?>
        <?php 
endif;?>
        <?php 
echo $this->getChildHtml('additional'?>
        <?php 
echo $this->getChildHtml('upsell_products'?>
        <?php 
echo $this->getChildHtml('product_additional_data'?>
    
</div>

<
form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
        <
div class="no-display">
            <
input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
            <
input type="hidden" name="related_product" id="related-products-field" value="" />
        </
div>
        
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
            <?php 
echo $this->getChildChildHtml('container2'''truetrue?>
        <?php 
endif;?>

But When you add the product to your cart,the price is in different “btween product view page” and “checkout page”

 
Magento Community Magento Community
Magento Community
Magento Community
 
bogdanbr
Jr. Member
 
Total Posts:  1
Joined:  2012-03-14
 

Hello,
i fixed the problem for Magento 1.4.1.0

in template/catalog/produc/view/addtocart.phtml
if you have on the onlick event “setLocation(’<?php echo $this->getAddToCartUrl($_product) ?>’)”
change it with productAddToCartForm.submit()

so the button will look like this:
<button type="button" title="<?php echo $this->__('Add to Cart') ?>” class="button btn-cart” onclick="productAddToCartForm.submit()">…

 
Magento Community Magento Community
Magento Community
Magento Community
 
requix
Jr. Member
 
Total Posts:  2
Joined:  2011-12-26
 

This query can fix issue with custom options and “add to card” will be without errors and warnings.

UPDATE `catalog_product_entitybc
LEFT JOIN 
`catalog_product_optionac ON bc.entity_id ac.product_id
SET bc
.has_options 0bc.required_options 0
WHERE product_id is null

First read these comments from BigDune

BigDune - 19 November 2012 01:15 PM

1. Only attempt to use this solution if you a very familiar with running MySQL queries against your Magento database
2. BACKUP YOUR DATABASE BEFORE ATTEMPTING ANY MANUAL UPDATES
3. This will only fix situations where:
a. A product once had required options that are no longer required, or
b. Where downloadable links were once set to “Links Can be Purchased Separately = Yes” and now the option has been changed to “No”
4. Only use this solution if you have way too many products to update manually.

BigDune, thanks for your clarification!

 
Magento Community Magento Community
Magento Community
Magento Community
 
CodeCocktail
Jr. Member
 
Avatar
Total Posts:  17
Joined:  2011-07-21
India
 

Hi, I am still having this issue in Magento 1.6.0.0 version. Any Help !

 
Magento Community Magento Community
Magento Community
Magento Community
 
CodeCocktail
Jr. Member
 
Avatar
Total Posts:  17
Joined:  2011-07-21
India
 

Sorry, I was so stupid. My template doesn’t have container2 childhtml in my product view.phtml section

<?php if ($_product->isSaleable() && $this->hasOptions()):?>
            <?php 
echo $this->getChildChildHtml('container2'''truetrue?>
        <?php 
endif;?>

Have fun, If you are stupid as me smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
postadelmaga
Jr. Member
 
Total Posts:  7
Joined:  2011-03-27
 
requix - 07 June 2012 01:55 AM

This query can fix issue with custom options and “add to card” will be without errors and warnings.

UPDATE `catalog_product_entitybc
LEFT JOIN 
`catalog_product_optionac ON bc.entity_id ac.product_id
SET bc
.has_options 0bc.required_options 0
WHERE product_id is null

Please don’t post things like this !!!
This query it totally unrelated to the problem and dangerous and furthermore you are giving no explanation regarding why and how it should fix the problem ...

A Workarround for Backend not editable orders

I can report the problem is still present on magento CE 1.6.2 and 1.7.0.2

I got the message if I try to edit an order related to a Configurable Product and if the simple product associated with the configurable has been removed.  I try to edit this kind of order I got “please .... “ error

How to reproduce:

1. create an order with a Configurable Product
2. remove the simple product associated with the Configurable Product, the one select in the order.
3. edit the order

On Magento 1.6.2 I have found a ‘workaround’ to make these orders again editable:

you just need to edit this core file:
/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php

in the method

initFromOrder

at line 281, change this :

if ($qty 0{
                    $item 
$this->initFromOrderItem($orderItem$qty);
                    if (
is_string($item)) {
                        Mage
::throwException($item);
                    
}
                }

with this

if ($qty 0{
                    $item 
$this->initFromOrderItem($orderItem$qty);
                    if (
is_string($item)) {
     
//                   Mage::throwException($item);
                    
}
                }

this will not through the exception and the order will be again editable.

 
Magento Community Magento Community
Magento Community
Magento Community
 
abhaya
Jr. Member
 
Avatar
Total Posts:  17
Joined:  2012-06-04
Poland
 

This query worked for me! Thanks!

UPDATE `catalog_product_entitybc
LEFT JOIN 
`catalog_product_optionac ON bc.entity_id ac.product_id
SET bc
.has_options 0bc.required_options 0
WHERE product_id is null

I am running Magento 1.7.0.2

 
Magento Community Magento Community
Magento Community
Magento Community
 
jodywatson
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2012-09-24
 

Strangely enough the solution works! I almost didn’t try it out but since my store was displaying “required field” label even when I didn’t add any custom options at all I was ready to try out anything. It seemed like, how can this be a solution?? But then I tried saving my product with ‘Custom Option’ tab last open and wow ! It works! Thanks to all those who suggested using it. Even if a temporary bug solution I got rid of a nagging problem. Thanks again.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bestylest
Jr. Member
 
Total Posts:  15
Joined:  2012-05-07
 

Hi there, this post was written very long time ago.

However, Hope this solution that I came out with, will help other people like me spending 3 days..

This is what I got:

First I had same problem with “add to cart” (adding configurable products) when I am using Internet Explorer.
“add to car” button” only leads to adding configurable products when I am using Google chrome & safari.

When I checked on
app/design/frontend/theme/theme/template/catalog/product/view/addtocart.phtml

<?php $_product $this->getProduct(); ?>
<?php $buttonTitle 
$this->__('Add to Cart'); ?>
<?php 
if($_product->isSaleable()): ?>
    
<div class="add-to-cart clearfix">
        
        <
button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $buttonTitle ?></span></span></button>
           <
input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
     
        
<?php if(!$_product->isGrouped()): ?>
        
<label for="qty"><?php echo $this->__('Qty:'?></label>
        
<?php endif; ?>

        <?php 
echo $this->getChildHtml(''truetrue?>
    
</div>
</
form>
<?php endif; ?>

but when I looked at code clearly, I found out why there is a </form> right before <?php endif; ?>

So.. please delete </form> and save.
Then using “add to cart” button with Internet Explore will be able to add configurable items.

Hope this solution will help other people like me, struggling for 3 days. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
bestylest
Jr. Member
 
Total Posts:  15
Joined:  2012-05-07
 

Hi there, this post was written very long time ago.

However, Hope this solution that I came out with, will help other people like me spending 3 days..

This is what I got:

First I had a problem with “add to cart” (adding configurable products) when I am using Internet Explorer.
“add to car” button” only leads to adding configurable products when I am using Google chrome & safari.

When I checked on
app/design/frontend/theme/theme/template/catalog/product/view/addtocart.phtml

<?php $_product $this->getProduct(); ?>
<?php $buttonTitle 
$this->__('Add to Cart'); ?>
<?php 
if($_product->isSaleable()): ?>
    
<div class="add-to-cart clearfix">
        
        <
button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $buttonTitle ?></span></span></button>
           <
input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
     
        
<?php if(!$_product->isGrouped()): ?>
        
<label for="qty"><?php echo $this->__('Qty:'?></label>
        
<?php endif; ?>

        <?php 
echo $this->getChildHtml(''truetrue?>
    
</div>
</
form>
<?php endif; ?>

but when I looked at code clearly, I found out why there is a </form> right before <?php endif; ?>

So.. please delete </form> and save.
Then using “add to cart” button with Internet Explore will be able to add configurable items.

Hope this solution will help other people like me, struggling for 3 days. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
BigDune
Jr. Member
 
Total Posts:  22
Joined:  2010-04-21
 
requix - 07 June 2012 01:55 AM

This query can fix issue with custom options and “add to card” will be without errors and warnings.

UPDATE `catalog_product_entitybc
LEFT JOIN 
`catalog_product_optionac ON bc.entity_id ac.product_id
SET bc
.has_options 0bc.required_options 0
WHERE product_id is null

I can confirm that this query works in Magento 1.7.0.2. However, just to clarify a few things about the suggested fix above:

1. Only attempt to use this solution if you a very familiar with running MySQL queries against your Magento database
2. BACKUP YOUR DATABASE BEFORE ATTEMPTING ANY MANUAL UPDATES
3. This will only fix situations where:
a. A product once had required options that are no longer required, or
b. Where downloadable links were once set to “Links Can be Purchased Separately = Yes” and now the option has been changed to “No”
4. Only use this solution if you have way too many products to update manually.

What it actually does: Magento has a field on the product entity table that acts as a flag to tell Magento if the product has required options or not. Sometimes, when the options for a product have been deleted, Magento does not correctly clear this flag on the product entity table.

That’s what this query does, using the left join to the product options, it checks if a product truly has options or not. If not, it sets the flag on the product entity table to 0.

One of the things to look out for in using some of the other “solutions” suggested under this thread is that most of them actually override features in Magento that you may need for other products where you need to force customers to use required options. You may not need that feature now… but if you do in the future, good luck with remembering what you did to get it all figured out!

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