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

Add to Cart suddenly not working - Urgent
 
sunsera
Jr. Member
 
Total Posts:  23
Joined:  2009-10-05
 

My Add to Cart function *had* been working properly, and suddenly it’s not. 

In catalog.xml under

<reference name="content">
there is the line:
<block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>

view.phtml has the following code:

<?php if (!$this->hasOptions()):?>
                
<div class="add-to-holder">
                    
<?php if($_product->isSaleable()): ?>
                        <?php 
echo $this->getChildHtml('addtocart'?>
                   
                    <?php 
endif; ?>
                    <?php 
echo $this->getChildHtml('addto'?>
                
</div>
            
<?php else:?>
                <?php 
echo $this->getChildHtml('addto'?>
            <?php 
endif; ?>

and addtocart.phtml reads:

<?php $_product $this->getProduct() ?>

<?php 
if($_product->isSaleable()): ?>
    
<fieldset class="add-to-cart-box">
        <
legend><?php echo $this->__('Add Items to Cart'?></legend>
        
<?php if(!$_product->isGrouped()): ?>
        
<span class="qty-box"><label for="qty"><?php echo $this->__('Qty'?>:</label>
        <
input name="qty" type="text" class="input-text qty" id="qty" maxlength="12" value="<?php echo $this->getMinimalQty($_product) ?>" /></span>
        
<?php endif; ?>
        
<button type="button" class="form-button" onclick="productAddToCartForm.submit()"><span><?php echo $this->__('Add to Cart'?></span></button>
    </
fieldset>
<?php endif; ?>

It was working perfectly.  I can’t figure out what happened.  I did get rid of the add to wishlist and add to compare function.  Could that be the issue? 

I changed addto.phtml to read:

<?php $_product $this->getProduct() ?>

<ul class="add-to-box">

</
ul>

Could that be the issue?  Any ideas?  I’m really desperate.  You can see my problem here

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