Wednesday, May 02, 2012

Add to cart button in Magento


This one is collected from a blog:

This code will help you implement Add to Cart button in any magento structural page and that’s too in workable form:

product_id can be passed dynamically alongwith quantity to be purchased.
<input type=”button” title=”<?php echo $this->__(‘Add to Cart’) ?>” onclick=”setLocation(‘<?php echo Mage::getUrl(‘checkout/cart/add’, array(‘product’=>$row['product_id'],’qty’=>1)) ?>’)” />

No comments: