<?php $cartURL = "'".Mage::getUrl('checkout/cart/add', array('product' => $_product->getId(),'qty'=>1))."'"; ?>
After doing some reaesrch on the Google I found the solutions given below:
<?php $storeId = Mage::app()->getStore()->getId(); $catalog = $this->getLayout()->createBlock('catalog/product_list')->setStoreId($storeId); $cartURL = "'".$catalog->getAddToCartUrl($_product)."'"; ?>
I have replaced the old code with the new one and now its looking like as:
<?php //$cartURL = "'".Mage::getUrl('checkout/cart/add', array('product' => $_product->getId(),'qty'=>1))."'"; //Old Code $storeId = Mage::app()->getStore()->getId(); $catalog = $this->getLayout()->createBlock('catalog/product_list')->setStoreId($storeId); $cartURL = "'".$catalog->getAddToCartUrl($_product)."'"; ?>
Hope this will be helpfull. Thanks and enjoy the reading.