Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Configurable products on category list page
 
seanrussell
Jr. Member
 
Total Posts:  7
Joined:  2012-05-17
 

Hello community,

I have configurable products setup and am adding the configurable options to the category list page. Just like: Liz Earle

This post on Catgento.com has been very helpful and I have got the options (a drop down for size) now showing which is brilliant. The issue I am having is that when a size is selected and the add to cart button clicked… you are sent to the relevant product page with a message: ‘Please specify the product’s option(s)’ and nothing is added to cart. It is a common problem people are commenting on in the Catgento blog, so I thought I would see if anyone on here has tried this before and found a solution?

Many thanks,
Sean

 
Magento Community Magento Community
Magento Community
Magento Community
 
seanrussell
Jr. Member
 
Total Posts:  7
Joined:  2012-05-17
 

Hello, me again. I have got it working grin

I found the problem to be that the drop down configurable options were not inside the <form> tags with the cart button and quantity. Here is the correct code for the /app/design/frontend/themename/default/template/catalog/product/list.phtml

Hope it helps someone.

<div class="actions">
                    
<?php if($_product->isSaleable()): ?>
                    
<form action="<?php echo $this->helper('checkout/cart')->getAddUrl($_product) ?>" method="post" id="product_addtocart_form" <?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
                    
<?php Mage::unregister('product'?>
                    <?php Mage
::register('product'$_product); ?>
                    <?php 
if ( $_product->getTypeId() == 'configurable'): ?>
                    <?php 
echo $this->getLayout()->createBlock('catalog/product_view_type_configurable''', array('template'=> 'catalog/product/view/type/configurable_category.phtml'))->toHtml(); ?>
                <?php 
endif; ?>
                        
<input name="qty" type="text" class="input-text qty" id="qty_<?php echo $_product->getId()?>" maxlength="12" value="<?php echo $this->getMinimalQty($_product)== null?1:$this->getMinimalQty($_product); ?>" />
                        <
button type="submit" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart"><span><span><?php echo $this->__('Add to Cart'?></span></span></button>
                    
<?php else: ?>
                        <?php 
if ($_product->getIsSalable()): ?>
                            
<class="availability in-stock"><span><?php echo $this->__('In stock'?></span></p>
                        
<?php else: ?>
                            
<class="availability out-of-stock"><span><?php echo $this->__('Out of stock'?></span></p>
                        
<?php endif; ?>
                    <?php 
endif; ?>
                        
                    
</form>
                </
div>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top