we are displaying Product name & Add to cart button in Custom tab under My Account . we wanted to add the product to cart once we click on "Add to cart", but button is not clickable, once if we click on button , its not adding product to cart.
<?php $collections = $this->getCollection(); ?>
<?php $_product = $this->getProduct(); ?>
<?php $buttonTitle = Mage::helper('core')->quoteEscape($this->__('Add to Cart')); ?>
<?php foreach ($collections as $key => $product) {
echo $product->getName().' <br>';
?>
<div class="add-to-cart-buttons">
<button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)">
<span><span>
<?php echo $buttonTitle ?>
</span></span>
</button>
<?php echo $this->getChildHtml('', true, true) ?>
</div>
<hr style='display:inline-block; width:100%;'>
<?php
}
?>