Sometime you need to add “Add to cart” button outside the product details view. So, you can’t use
getAddToCartUrl($product)
Don’t worry, you can use this code instead for:
getAddToCartUrl($product)
Don’t worry, you can use this code instead for:
echo Mage::helper('checkout/cart')->getAddUrl($_item)