Magento Featured Products Listing on Home Page

There are a few articles and extensions I've come across showing how to add "Featured Products" on the home page of Magento. The problem is that none that I have read, seem to fully tackle the issue of being compatible with Magento 1.4.x (Magento 1.4.0.1 at the time of this writing) AND fully using Magento's features while being fairly easy to implement (i.e. without adding complicated, unnecessary,redundant or outdated code)

Anyhow... Here's a fairly simple way you can add a featured product listing using the standard Magento files, which should work for any version of Magento.

In your Magento /admin section:

  1. Create a category as usual (you can put it in any path) and call it, e.g., "Featured Products" and make sure to note the "ID:XX" number. You can set this directory to "Active:NO" if you don't want it to display in your category listing on the front end of your site or just leave it as is. You can leave everything else at the default settings.
  2. Go to each product, that you want to appear under "Featured Products", and edit as usual, but this time put a check mark next to the new directory you created "Featured Products". Do this for every product you want to be a "Featured Product". Easy enough.
  3. Now... go into your CMS --> Pages and select your home page (you can identify which is for the home page, by looking at the url key which would be something like "home")
  4. Click the "Content" tab--switch to HTML editor (non-wysiwyg) and paste in the Content text area:
    <div class="featured-products">
    <h2 class="heading">Featured Products</h2>
    {{block type="catalog/product_list" category_id="YOURCATIDNUMBER" template="catalog/product/list.phtml"}}
    </div>

    since my category id # was ID:36, I would do the following

    <div class="featured-products">
    <h2 class="heading">Featured Products</h2>
    {{block type="catalog/product_list" category_id="36" template="catalog/product/list.phtml"}}
    </div>

    Save, and you're done.... You will be presented with a listing of the "Featured Products" on your home page.

    • side note: you can make a copy of the list.phtml file and name it, e.g. "feature-products.phtml" if you need to make further edits to the listing. Also, if you've upgraded to magento 1.4 , it may be a good idea to copy the latest template file from:
      app/design/frontend/base/default/template/catalog/product/list.phtml

      and paste this into your template directory overwriting the old.

  5. However, if you want it to appear in a grid--i.e. more than the single column, which you will get by default--then all you need to do is edit your CSS file...

    Simply add this to your css file used to style your site (I put my at the bottom of my css file) :

    /* View Type: Featured products, list changed to grid */
    .featured-products { width:100%; float:left; clear:both; padding:0;  }
    .featured-products .products-list { margin:0; padding:0; border:0px solid red; float:left;}
    .featured-products .products-list li.item { list-style:none; list-style-image:none; border:1px solid #D8D9D9; background:#FFFFFF; margin:0 3px 3px 0; width:205px; float:left; height:400px; padding:8px; }
    .featured-products .products-list h2.product-name { margin:6px 0 6px 0; padding:0;   }
    .featured-products .products-list h2.product-name a { font:bold 12px/14px Arial, Helvetica, sans-serif; display:block;}
    .featured-products .products-list .product-image { float:none; }
    .featured-products .products-list .product-shop { float:none; width:auto; margin:0; padding:0;}
    .featured-products .products-list .price-box { float:none;}
    .featured-products .products-list .desc { float:none; font:normal 11px/13px Arial, Helvetica, sans-serif; margin:6px 0; display:block; width:100%; float:left; }
    .featured-products .products-list .desc .link-more { display:block; }
    .featured-products .products-list .add-to-links { display:none; /*i hide this since I don't want to show "compare" link on the featured section */}

    note the critical usage of ".feature-products" class, which we wrapped around the "Featured Products" block in the CMS home page--without that, this won't work, as you don't want to mess with the regular listing throughout the site, you just want to make the list view into a grid view for the "Featured Products" only.

    To change the width and height of your grid, simply change the width and height under
    .featured-products .products-list li.item {}

Alright, then...

That should do it... a pretty simple way to create a "Featured Products" section on the home page of Magento, that should be compatible with any current, past, or future Magento versions.

Tags: magento featured products