<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2603319367382529918</id><updated>2024-11-08T07:38:52.860-08:00</updated><title type='text'>Magento-BD</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://magento-bd.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2603319367382529918/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://magento-bd.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Harisur</name><uri>http://www.blogger.com/profile/04568118866413638356</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_S5BkKwG8x3s/STVUr0fdEvI/AAAAAAAABcw/d1n10UTRhj4/S220/PoTenGa+%5BJeweL%5D.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2603319367382529918.post-7527131281461588827</id><published>2011-07-08T12:22:00.000-07:00</published><updated>2012-05-05T13:04:57.400-07:00</updated><title type='text'>how to get best selling product in magento?</title><content type='html'>Best Seller is a common module of an eCommerce solution. but it’s not a default module in magento.&lt;br /&gt;
u want to display the best selling products in your Magento store on the frontpage or anywhere else in your store? i found this snippets @MagentoForum, it’s easy to use…&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[Step 1]&lt;/b&gt; Create a Bestseller.php file and put it here :&lt;br /&gt;
app/code/local/Mage/Catalog/Block/Product/Bestseller.php&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;class Mage_Catalog_Block_Product_Bestseller extends Mage_Catalog_Block_Product_Abstract{
    public function __construct(){
        parent::__construct();
        $storeId = Mage::app()-&gt;getStore()-&gt;getId();
        $products = Mage::getResourceModel(&#39;reports/product_collection&#39;)
            -&gt;addOrderedQty()
            -&gt;addAttributeToSelect(&#39;*&#39;)
            -&gt;addAttributeToSelect(array(&#39;name&#39;, &#39;price&#39;, &#39;small_image&#39;))
            -&gt;setStoreId($storeId)
            -&gt;addStoreFilter($storeId)
            -&gt;setOrder(&#39;ordered_qty&#39;, &#39;desc&#39;); // most best sellers on top
        Mage::getSingleton(&#39;catalog/product_status&#39;)-&gt;addVisibleFilterToCollection($products);
        Mage::getSingleton(&#39;catalog/product_visibility&#39;)-&gt;addVisibleInCatalogFilterToCollection($products);
 
        $products-&gt;setPageSize(3)-&gt;setCurPage(1);
        $this-&gt;setProductCollection($products);
    }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;[Step 2]&lt;/b&gt; Create a bestseller.phtml file and put it here :&lt;br /&gt;
app/design/frontend/*/*/template/catalog/product/bestseller.phtml&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;?php if (($_products = $this-&gt;getProductCollection()) &amp;&amp; $_products-&gt;getSize()): ?&gt;
&lt;div class=&quot;page-title&quot;&gt;    &lt;h2&gt;&lt;?php echo $this-&gt;__(&#39;Best Seller Products&#39;) ?&gt;&lt;/h2&gt;&lt;/div&gt;&lt;?php $_collectionSize = count($_products-&gt;getItems()) ?&gt;
&lt;table class=&quot;products-grid&quot; id=&quot;products-grid-table&quot;&gt;&lt;?php $i=1; foreach ($_products-&gt;getItems() as $_product): ?&gt;
    &lt;?php if ($i%1!==0): ?&gt;
    &lt;tr&gt;
    &lt;?php endif ?&gt;
        &lt;td id=&quot;td_&lt;?php echo $i;?&gt;&quot; &lt;?php if($i%3==0 or $i==$_collectionSize){echo &#39;class=&quot;last&quot;&#39;;} ?&gt; &gt;&lt;br /&gt;
        &lt;?php contentBlock(&#39;top&#39;) ?&gt;&lt;br /&gt;
        &lt;div id=&quot;cont_&lt;?php echo $i;?&gt;&quot;&gt;&lt;br /&gt;
            &lt;h3 class=&quot;product-name&quot;&gt;&lt;a href=&quot;&lt;?php echo $_product-&gt;getProductUrl() ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;&quot;&gt;&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;&lt;/a&gt;&lt;/h3&gt;            &lt;a class=&quot;product-image&quot; href=&quot;&lt;?php echo $_product-&gt;getProductUrl() ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, &#39;small_image&#39;)) ?&gt;&quot;&gt;&lt;br /&gt;
                &lt;img src=&quot;&lt;?php echo $this-&gt;helper(&#39;catalog/image&#39;)-&gt;init($_product, &#39;small_image&#39;)-&gt;resize(122, 109); ?&gt;&quot; width=&quot;122&quot; height=&quot;109&quot; alt=&quot;&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, &#39;small_image&#39;)) ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, &#39;small_image&#39;)) ?&gt;&quot; /&gt;&lt;br /&gt;
            &lt;/a&gt;&lt;br /&gt;
            &lt;div class=&quot;a-center&quot;&gt;                &lt;?php if($_product-&gt;getRatingSummary()): ?&gt;&lt;br /&gt;
                    &lt;?php echo $this-&gt;getReviewsSummaryHtml($_product, &#39;short&#39;) ?&gt;&lt;br /&gt;
                &lt;?php endif; ?&gt;&lt;br /&gt;
                &lt;?php echo $this-&gt;getPriceHtml($_product, true) ?&gt;&lt;br /&gt;
                &lt;?php if($_product-&gt;isSaleable()): ?&gt;&lt;br /&gt;
                    &lt;button class=&quot;button&quot; onclick=&quot;setLocation(&#39;&lt;?php echo $this-&gt;getAddToCartUrl($_product) ?&gt;&#39;)&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;?php echo $this-&gt;__(&#39;Add to Cart&#39;) ?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;br /&gt;
                    &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;                &lt;?php else: ?&gt;&lt;br /&gt;
                    &lt;p class=&quot;availability&quot;&gt;&lt;span class=&quot;out-of-stock&quot;&gt;&lt;?php echo $this-&gt;__(&#39;Out of stock&#39;) ?&gt;&lt;/span&gt;&lt;/p&gt;                    &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;                &lt;?php endif; ?&gt;&lt;br /&gt;
                &lt;ul class=&quot;add-to-links&quot;&gt;                    &lt;?php if ($this-&gt;helper(&#39;wishlist&#39;)-&gt;isAllow()) : ?&gt;
                        &lt;li&gt;&lt;a href=&quot;&lt;?php echo $this-&gt;helper(&#39;wishlist&#39;)-&gt;getAddUrl($_product) ?&gt;&quot;&gt;&lt;?php echo $this-&gt;__(&#39;Add to Wishlist&#39;) ?&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;?php endif; ?&gt;
                    &lt;?php if($_compareUrl=$this-&gt;getAddToCompareUrl($_product)): ?&gt;
                        &lt;li class=&quot;last&quot;&gt;&lt;span class=&quot;separator&quot;&gt;|&lt;/span&gt; &lt;a href=&quot;&lt;?php echo $_compareUrl ?&gt;&quot;&gt;&lt;?php echo $this-&gt;__(&#39;Add to Compare&#39;) ?&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;?php endif; ?&gt;
                &lt;/ul&gt;                &lt;?php if($_product-&gt;getevent_date()) {echo $_product-&gt;getevent_date();} ?&gt;&lt;br /&gt;
            &lt;/div&gt;        &lt;/div&gt;    &lt;/td&gt;
    &lt;?php if ($i%3==0 or $i==$_collectionSize): ?&gt;
   &lt;/tr&gt;
    &lt;?php endif ?&gt;
  &lt;?php $i++; endforeach; $kol = $_collectionSize; ?&gt;
&lt;/table&gt;&lt;?php endif; ?&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;[Step 3]&lt;/b&gt; now put this line where you want to view best selling products..&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;{{block type=&quot;catalog/product_bestseller&quot; template=&quot;catalog/product/bestseller.phtml&quot;}}
&lt;/pre&gt;&lt;br /&gt;
Source : &lt;a href=&quot;http://harisur.net/how-to-get-best-selling-product-in-magento&quot;&gt;http://harisur.net/how-to-get-best-selling-product-in-magento&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://magento-bd.blogspot.com/feeds/7527131281461588827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magento-bd.blogspot.com/2011/07/how-to-get-best-selling-product-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2603319367382529918/posts/default/7527131281461588827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2603319367382529918/posts/default/7527131281461588827'/><link rel='alternate' type='text/html' href='http://magento-bd.blogspot.com/2011/07/how-to-get-best-selling-product-in.html' title='how to get best selling product in magento?'/><author><name>Harisur</name><uri>http://www.blogger.com/profile/04568118866413638356</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_S5BkKwG8x3s/STVUr0fdEvI/AAAAAAAABcw/d1n10UTRhj4/S220/PoTenGa+%5BJeweL%5D.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2603319367382529918.post-6658214927507729635</id><published>2011-07-08T11:55:00.000-07:00</published><updated>2012-05-05T13:06:50.479-07:00</updated><title type='text'>how to get mostviewed products in magento?</title><content type='html'>&lt;b&gt;[Step 1]&lt;/b&gt; Create a Mostviewed.php file and put it here :&lt;br /&gt;
app/code/local/Mage/Catalog/Block/Product/Mostviewed.php&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;class Mage_Catalog_Block_Product_Mostviewed extends Mage_Catalog_Block_Product_Abstract{
    public function __construct(){
        parent::__construct();
        $storeId    = Mage::app()-&gt;getStore()-&gt;getId();
        $products = Mage::getResourceModel(&#39;reports/product_collection&#39;)
            -&gt;addOrderedQty()
            -&gt;addAttributeToSelect(&#39;*&#39;)
            -&gt;addAttributeToSelect(array(&#39;name&#39;, &#39;price&#39;, &#39;small_image&#39;))
            -&gt;setStoreId($storeId)
            -&gt;addStoreFilter($storeId)
            -&gt;addViewsCount();
        Mage::getSingleton(&#39;catalog/product_status&#39;)-&gt;addVisibleFilterToCollection($products);
        Mage::getSingleton(&#39;catalog/product_visibility&#39;)-&gt;addVisibleInCatalogFilterToCollection($products);
 
        $products-&gt;setPageSize(5)-&gt;setCurPage(1);
        $this-&gt;setProductCollection($products);
    }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;[Step 2]&lt;/b&gt; Create a mostviewed.phtml file and put it here :&lt;br /&gt;
app/design/frontend/*/*/template/catalog/product/mostviewed.phtml&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;?php if (($_products = $this-&gt;getProductCollection()) &amp;&amp; $_products-&gt;getSize()): ?&gt;
&lt;div class=&quot; most_viewed&quot;&gt;&lt;div class=&quot;mv_title&quot;&gt;&lt;?php echo $this-&gt;__(&#39;These Products Are Popular Right Now!&#39;) ?&gt;&lt;/div&gt;&lt;?php $_collectionSize = 5;//count($_products-&gt;getItems()); echo $_collectionSize; ?&gt;
&lt;ul class=&quot;products-grid&quot; id=&quot;products-grid-table&quot;&gt;&lt;?php $i=1; foreach ($_products-&gt;getItems() as $_product): ?&gt;
    &lt;li id=&quot;td_&lt;?php echo $i;?&gt;&quot; &lt;?php if($i%5==0 or $i==$_collectionSize){echo &#39;class=&quot;last&quot;&#39;;} ?&gt; &gt;&lt;br /&gt;
        &lt;div id=&quot;cont_&lt;?php echo $i;?&gt;&quot;&gt;        &lt;br /&gt;
            &lt;a class=&quot;product-image&quot; href=&quot;&lt;?php echo $_product-&gt;getProductUrl() ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, &#39;small_image&#39;)) ?&gt;&quot;&gt;&lt;br /&gt;
                &lt;img src=&quot;&lt;?php echo $this-&gt;helper(&#39;catalog/image&#39;)-&gt;init($_product, &#39;small_image&#39;)-&gt;resize(135); ?&gt;&quot; width=&quot;135&quot; height=&quot;135&quot; alt=&quot;&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, &#39;small_image&#39;)) ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, &#39;small_image&#39;)) ?&gt;&quot; /&gt;&lt;br /&gt;
            &lt;/a&gt;&lt;br /&gt;
            &lt;h3 class=&quot;product-name&quot;&gt;&lt;a href=&quot;&lt;?php echo $_product-&gt;getProductUrl() ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;&quot;&gt;&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;&lt;/a&gt;&lt;/h3&gt;            &lt;div class=&quot;a-center&quot;&gt;                &lt;?php if($_product-&gt;getRatingSummary()): ?&gt;&lt;br /&gt;
                    &lt;?php echo $this-&gt;getReviewsSummaryHtml($_product, &#39;short&#39;) ?&gt;&lt;br /&gt;
			    &lt;?php endif; ?&gt;&lt;br /&gt;
                &lt;?php echo $this-&gt;getPriceHtml($_product, true) ?&gt;&lt;br /&gt;
                &lt;?php if($_product-&gt;isSaleable()): ?&gt;&lt;br /&gt;
                    &lt;button class=&quot;button&quot; onclick=&quot;setLocation(&#39;&lt;?php echo $this-&gt;getAddToCartUrl($_product) ?&gt;&#39;)&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;?php echo $this-&gt;__(&#39;Add to Cart&#39;) ?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;br /&gt;
                    &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;                &lt;?php else: ?&gt;&lt;br /&gt;
                    &lt;p class=&quot;availability&quot;&gt;&lt;span class=&quot;out-of-stock&quot;&gt;&lt;?php echo $this-&gt;__(&#39;Out of stock&#39;) ?&gt;&lt;/span&gt;&lt;/p&gt;                    &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;                &lt;?php endif; ?&gt;&lt;br /&gt;
                &lt;ul class=&quot;add-to-links&quot;&gt;                    &lt;?php if ($this-&gt;helper(&#39;wishlist&#39;)-&gt;isAllow()) : ?&gt;
                    &lt;li&gt;&lt;a href=&quot;&lt;?php echo $this-&gt;helper(&#39;wishlist&#39;)-&gt;getAddUrl($_product) ?&gt;&quot;&gt;&lt;?php echo $this-&gt;__(&#39;Add to Wishlist&#39;) ?&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;?php endif; ?&gt;
                    &lt;?php if($_compareUrl=$this-&gt;getAddToCompareUrl($_product)): ?&gt;
                    &lt;li class=&quot;last&quot;&gt;&lt;span class=&quot;separator&quot;&gt;|&lt;/span&gt; &lt;a href=&quot;&lt;?php echo $_compareUrl ?&gt;&quot;&gt;&lt;?php echo $this-&gt;__(&#39;Add to Compare&#39;) ?&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;?php endif; ?&gt;
                &lt;/ul&gt;            &lt;/div&gt;        &lt;/div&gt;    &lt;/li&gt;
&lt;?php $i++; endforeach; $kol = $_collectionSize; ?&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;?php endif; //*/?&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;[Step 3]&lt;/b&gt; now put this line where you want to view mostviewed products..&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;{{block type=&quot;catalog/product_mostviewed&quot; template=&quot;catalog/product/mostviewed.phtml&quot;}}
&lt;/pre&gt;&lt;br /&gt;
Source : &lt;a href=&quot;http://harisur.net/how-to-get-mostviewed-products-in-magento&quot;&gt;http://harisur.net/how-to-get-mostviewed-products-in-magento&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://magento-bd.blogspot.com/feeds/6658214927507729635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magento-bd.blogspot.com/2011/07/how-to-get-mostviewed-products-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2603319367382529918/posts/default/6658214927507729635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2603319367382529918/posts/default/6658214927507729635'/><link rel='alternate' type='text/html' href='http://magento-bd.blogspot.com/2011/07/how-to-get-mostviewed-products-in.html' title='how to get mostviewed products in magento?'/><author><name>Harisur</name><uri>http://www.blogger.com/profile/04568118866413638356</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_S5BkKwG8x3s/STVUr0fdEvI/AAAAAAAABcw/d1n10UTRhj4/S220/PoTenGa+%5BJeweL%5D.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2603319367382529918.post-586161852101395233</id><published>2011-07-08T11:02:00.000-07:00</published><updated>2012-05-05T13:08:20.391-07:00</updated><title type='text'>how to get onsale products in magento?</title><content type='html'>&lt;b&gt;[Step 1]&lt;/b&gt; Create a Onsale.php file and put it here :&lt;br /&gt;
app/code/local/Mage/Catalog/Block/Product/Onsale.php&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;class Mage_Catalog_Block_Product_Onsale extends Mage_Catalog_Block_Product_Abstract{
    public function __construct(){
        parent::__construct();
        $storeId    = Mage::app()-&gt;getStore()-&gt;getId();
        $todayDate  = Mage::app()-&gt;getLocale()-&gt;date()-&gt;toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
        $collection = Mage::getResourceModel(&#39;catalog/product_collection&#39;);
        $collection-&gt;setVisibility(Mage::getSingleton(&#39;catalog/product_visibility&#39;)-&gt;getVisibleInCatalogIds());
        $collection = $this-&gt;_addProductAttributesAndPrices($collection)
            -&gt;addStoreFilter()
            -&gt;addAttributeToFilter(&#39;special_from_date&#39;, array(&#39;date&#39; =&gt; true, &#39;to&#39; =&gt; $todayDate))
            -&gt;addAttributeToFilter(&#39;special_to_date&#39;, array(&#39;or&#39;=&gt; array(
                0 =&gt; array(&#39;date&#39; =&gt; true, &#39;from&#39; =&gt; $todayDate),
                1 =&gt; array(&#39;is&#39; =&gt; new Zend_Db_Expr(&#39;null&#39;)))
            ), &#39;left&#39;)
            -&gt;addAttributeToSort(&#39;special_from_date&#39;, &#39;desc&#39;)
            -&gt;setPageSize($this-&gt;getProductsCount())
            -&gt;setCurPage(1);
        $this-&gt;setProductCollection($collection);
    }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;[Step 2]&lt;/b&gt; Create a onsale.phtml file and put it here :&lt;br /&gt;
app/design/frontend/*/*/template/catalog/product/onsale.phtml&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;?php if (($product_ = $this-&gt;getProductCollection()) &amp;&amp; $product_-&gt;getSize()): ?&gt;
&lt;div class=&quot; on_sale&quot;&gt;&lt;div class=&quot;os_title&quot;&gt;&lt;?php echo $this-&gt;__(&#39;On Sale Now!&#39;) ?&gt;&lt;/div&gt;&lt;?php $_collectionSize = 5;//count($product_-&gt;getItems()); echo $_collectionSize; ?&gt;
&lt;ul class=&quot;products-grid&quot; id=&quot;products-grid-table&quot;&gt;&lt;?php $i=1; foreach ($product_-&gt;getItems() as $_product): ?&gt;
    &lt;li id=&quot;td_&lt;?php echo $i;?&gt;&quot; &lt;?php if($i%5==0 or $i==$_collectionSize){echo &#39;class=&quot;last&quot;&#39;;} ?&gt; &gt;&lt;br /&gt;
        &lt;div id=&quot;cont_&lt;?php echo $i;?&gt;&quot;&gt;        &lt;br /&gt;
            &lt;a class=&quot;product-image&quot; href=&quot;&lt;?php echo $_product-&gt;getProductUrl() ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, &#39;small_image&#39;)) ?&gt;&quot;&gt;&lt;br /&gt;
                &lt;img src=&quot;&lt;?php echo $this-&gt;helper(&#39;catalog/image&#39;)-&gt;init($_product, &#39;small_image&#39;)-&gt;resize(135); ?&gt;&quot; width=&quot;135&quot; height=&quot;135&quot; alt=&quot;&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, &#39;small_image&#39;)) ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, &#39;small_image&#39;)) ?&gt;&quot; /&gt;&lt;br /&gt;
            &lt;/a&gt;&lt;br /&gt;
            &lt;h3 class=&quot;product-name&quot;&gt;&lt;a href=&quot;&lt;?php echo $_product-&gt;getProductUrl() ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;&quot;&gt;&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;&lt;/a&gt;&lt;/h3&gt;            &lt;div class=&quot;a-center&quot;&gt;            &lt;?php if($_product-&gt;getRatingSummary()): ?&gt;&lt;br /&gt;
                &lt;?php echo $this-&gt;getReviewsSummaryHtml($_product, &#39;short&#39;) ?&gt;&lt;br /&gt;
            &lt;?php endif; ?&gt;&lt;br /&gt;
            &lt;?php echo $this-&gt;getPriceHtml($_product, true) ?&gt;&lt;br /&gt;
            &lt;?php if($_product-&gt;isSaleable()): ?&gt;&lt;br /&gt;
                &lt;button class=&quot;button&quot; onclick=&quot;setLocation(&#39;&lt;?php echo $this-&gt;getAddToCartUrl($_product) ?&gt;&#39;)&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;?php echo $this-&gt;__(&#39;Add to Cart&#39;) ?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;br /&gt;
                &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;            &lt;?php else: ?&gt;&lt;br /&gt;
                &lt;p class=&quot;availability&quot;&gt;&lt;span class=&quot;out-of-stock&quot;&gt;&lt;?php echo $this-&gt;__(&#39;Out of stock&#39;) ?&gt;&lt;/span&gt;&lt;/p&gt;                &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;            &lt;?php endif; ?&gt;&lt;br /&gt;
            &lt;ul class=&quot;add-to-links&quot;&gt;                &lt;?php if ($this-&gt;helper(&#39;wishlist&#39;)-&gt;isAllow()) : ?&gt;
                &lt;li&gt;&lt;a href=&quot;&lt;?php echo $this-&gt;helper(&#39;wishlist&#39;)-&gt;getAddUrl($_product) ?&gt;&quot;&gt;&lt;?php echo $this-&gt;__(&#39;Add to Wishlist&#39;) ?&gt;&lt;/a&gt;&lt;/li&gt;
                &lt;?php endif; ?&gt;
                &lt;?php if($_compareUrl=$this-&gt;getAddToCompareUrl($_product)): ?&gt;
                &lt;li class=&quot;last&quot;&gt;&lt;span class=&quot;separator&quot;&gt;|&lt;/span&gt; &lt;a href=&quot;&lt;?php echo $_compareUrl ?&gt;&quot;&gt;&lt;?php echo $this-&gt;__(&#39;Add to Compare&#39;) ?&gt;&lt;/a&gt;&lt;/li&gt;
                &lt;?php endif; ?&gt;
            &lt;/ul&gt; &lt;br /&gt;
            &lt;/div&gt;        &lt;/div&gt;    &lt;/li&gt;
&lt;?php $i++; endforeach; $kol = $_collectionSize; ?&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;?php endif; //*/?&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;[Step 3]&lt;/b&gt; now put this line where you want to view onsale products..&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;{{block type=&quot;catalog/product_onsale&quot; template=&quot;catalog/product/onsale.phtml&quot;}}
&lt;/pre&gt;&lt;br /&gt;
Source : &lt;a href=&quot;http://harisur.net/how-to-get-onsale-products-in-magento&quot;&gt;http://harisur.net/how-to-get-onsale-products-in-magento&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://magento-bd.blogspot.com/feeds/586161852101395233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magento-bd.blogspot.com/2011/07/how-to-get-onsale-products-in-magento.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2603319367382529918/posts/default/586161852101395233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2603319367382529918/posts/default/586161852101395233'/><link rel='alternate' type='text/html' href='http://magento-bd.blogspot.com/2011/07/how-to-get-onsale-products-in-magento.html' title='how to get onsale products in magento?'/><author><name>Harisur</name><uri>http://www.blogger.com/profile/04568118866413638356</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_S5BkKwG8x3s/STVUr0fdEvI/AAAAAAAABcw/d1n10UTRhj4/S220/PoTenGa+%5BJeweL%5D.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2603319367382529918.post-8209358220066365279</id><published>2011-06-06T22:41:00.000-07:00</published><updated>2012-05-05T13:05:53.557-07:00</updated><title type='text'>how to get the currency code for current store in magento?</title><content type='html'>&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;// Currency Code for Bangladesh is &quot;BDT&quot;
Mage::app()-&gt;getStore()-&gt;getCurrentCurrencyCode();
&lt;/pre&gt;&lt;br /&gt;
Source : &lt;a href=&quot;http://harisur.net/how-to-get-the-currency-code-for-current-store-in-magento&quot;&gt;http://harisur.net/how-to-get-the-currency-code-for-current-store-in-magento&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://magento-bd.blogspot.com/feeds/8209358220066365279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magento-bd.blogspot.com/2011/06/how-to-get-currency-code-for-current.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2603319367382529918/posts/default/8209358220066365279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2603319367382529918/posts/default/8209358220066365279'/><link rel='alternate' type='text/html' href='http://magento-bd.blogspot.com/2011/06/how-to-get-currency-code-for-current.html' title='how to get the currency code for current store in magento?'/><author><name>Harisur</name><uri>http://www.blogger.com/profile/04568118866413638356</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_S5BkKwG8x3s/STVUr0fdEvI/AAAAAAAABcw/d1n10UTRhj4/S220/PoTenGa+%5BJeweL%5D.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2603319367382529918.post-3469974516115877828</id><published>2011-06-06T22:34:00.001-07:00</published><updated>2012-05-05T13:05:43.472-07:00</updated><title type='text'>how to get the currency symbol for current store in magento?</title><content type='html'>&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;// Currency Symbol for Bangladesh is &quot;Tk&quot;
Mage::app()-&amp;gt;getLocale()-&amp;gt;currency(Mage::app()-&amp;gt;getStore()-&amp;gt;getCurrentCurrencyCode())-&amp;gt;getSymbol();
&lt;/pre&gt;&lt;br /&gt;
Source : &lt;a href=&quot;http://harisur.net/how-to-get-the-currency-symbol-for-current-store-in-magento&quot;&gt;http://harisur.net/how-to-get-the-currency-symbol-for-current-store-in-magento&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://magento-bd.blogspot.com/feeds/3469974516115877828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magento-bd.blogspot.com/2011/06/how-to-get-currency-symbol-for-current.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2603319367382529918/posts/default/3469974516115877828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2603319367382529918/posts/default/3469974516115877828'/><link rel='alternate' type='text/html' href='http://magento-bd.blogspot.com/2011/06/how-to-get-currency-symbol-for-current.html' title='how to get the currency symbol for current store in magento?'/><author><name>Harisur</name><uri>http://www.blogger.com/profile/04568118866413638356</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_S5BkKwG8x3s/STVUr0fdEvI/AAAAAAAABcw/d1n10UTRhj4/S220/PoTenGa+%5BJeweL%5D.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2603319367382529918.post-9143864326410468431</id><published>2011-06-06T22:26:00.001-07:00</published><updated>2012-05-05T13:05:33.216-07:00</updated><title type='text'>how to define the product price with default currency format in mageto?</title><content type='html'>normally &lt;b&gt;$_product-&gt;getPrice()&lt;/b&gt; method return the product price in basic number format with 4 digits after decimal point, it’s look like &lt;b&gt;123.4567&lt;/b&gt;.&lt;br /&gt;
But the default currency format of magento is $123.46. see, default currency format done round with 2 digits after decimal point. and another important thing is, it’s put the currency code before the price.&lt;br /&gt;
lets see how to do that…&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;echo $_product-&gt;getPrice();
// will display : 123.4567
echo Mage::helper(&#39;core&#39;)-&gt;currency($_product-&gt;getPrice());
// will display : BDT123.46 [BDT, currency code of Bangladesh]
&lt;/pre&gt;&lt;br /&gt;
Source : &lt;a href=&quot;http://harisur.net/how-to-define-the-product-price-with-default-currency-format-in-mageto&quot;&gt;http://harisur.net/how-to-define-the-product-price-with-default-currency-format-in-mageto&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://magento-bd.blogspot.com/feeds/9143864326410468431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magento-bd.blogspot.com/2011/06/how-to-define-product-price-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2603319367382529918/posts/default/9143864326410468431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2603319367382529918/posts/default/9143864326410468431'/><link rel='alternate' type='text/html' href='http://magento-bd.blogspot.com/2011/06/how-to-define-product-price-with.html' title='how to define the product price with default currency format in mageto?'/><author><name>Harisur</name><uri>http://www.blogger.com/profile/04568118866413638356</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_S5BkKwG8x3s/STVUr0fdEvI/AAAAAAAABcw/d1n10UTRhj4/S220/PoTenGa+%5BJeweL%5D.JPG'/></author><thr:total>0</thr:total></entry></feed>