Sunday, 15 March 2015

magento get add to cart url

Hello Friends

If you want to get add to cart url then use below code

<input type="button" title="<?php echo $this->__('Add to Cart') ?>" class="addtocart" onclick="setLocation('<?php echo Mage::getUrl('checkout/cart/add', array('product'=>$product_id,'qty'=>1)) ?>')" />;

Where  $product_id is product id


No comments:

Post a Comment