Archive for July, 2012

copy a file into another folder asp .net

Posted: 25th July 2012 by erpriyana in ASP.NET
Tags:

copy a file into another folder asp .net string targetFolder = Server.MapPath(“~/PDF”); System.IO.FileInfo fi = new System.IO.FileInfo(Server.MapPath(“~/Bookmark.pdf”)); fi.CopyTo(System.IO.Path.Combine(targetFolder, fi.Name), true);

get custom option name filter.phtml if you want to add custom option in your layered navigation in magneto then here is the solution for that. <?php echo $_item->getName() ?>

Prevent HttpContext Current to be null WCF service NET add following code in web.config file….. <configuration> <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled=”true” /> </system.serviceModel> </configuration>

magento – call a static block in a page for display a static block in a page <?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘blockname’)->toHtml() ?>

Magento: How to get product rating and review code for getting ratings and reviews for any particular product. /* Getting reviews collection object */ $productId = $product->getId(); $reviews = Mage::getModel(‘review/review’) ->getResourceCollection() ->addStoreFilter(Mage::app()->getStore()->getId()) ->addEntityFilter(‘product’, $productId) ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED) ->setDateOrder() ->addRateVotes(); /** * Getting average of ratings/reviews */ $avg = 0; $ratings = array(); if (count($reviews) > 0) { […]