LeeTaylorDoes

  • Archive
  • RSS
  • Ask me anything
  • Submit

Magento Featured Products: A More Convenient Way To Display Featured Products On The Home Page

About: How To Show / Display Featured Products On The Home Page (Conveniently) Who’s Interested: Informative to the technical gurus What: An alternative direction on how to show featured products on your Magento storefront home page Magento Version Relevance: Any Magento Store Setup: Any My thought: “Why not let the Admin choose what products to display on the home page like every other category?” If you’ve been involved in the community dialogue that constantly evolves through the Magento boards, you may have run across a topic mainly focused on ways for developers to display featured products on the home page. There have been many directions taken with this, including the following as only a few to mention:
  1. Install a extension and configure
  2. Create an attribute, assign each product a value for that attribute, and then display products based upon the value they contain for that attribute
  3. Use the CMS template code to display a certain category

I didn’t want to override any other solutions, but simply offer another approach - one that does not do the following:

  • Modify any core code
  • Require per-product management
  • Install any extension
After my review, I still wanted a way that was more convenient for our client/administrators to be able to manage the products that display on their home page. Going through each product can become cumbersome, so what if they had one specific category that gets displayed all the time, and any products within it show up on the home page? That’s what I went for, and came up with the following:
  1. Create a new “structural block” within Magento (see example, thanks Inchoo)
  2. Create a (hidden) category within the Magento Admin
  3. Modify the structural block to display that category in a specific way
  4. Set the Category Id
Here are the files/modifications:

Structural Block

  • app/design/frontend/*/*/template/catalog/product/featured-products.phtml
[sourcecode language=”php”] /* Magento NOTICE OF LICENSE This source file is subject to the Academic Free License (AFL 3.0) that is bundled with this package in the file LICENSE_AFL.txt. It is also available through the world-wide-web at this URL: http://opensource.org/licenses/afl-3.0.php If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@magentocommerce.com so we can send you a copy immediately. DISCLAIMER Do not edit or add to this file if you wish to upgrade Magento to newer versions in the future. If you wish to customize Magento for your needs please refer to http://www.magentocommerce.com for more information. @category design_default @package Mage @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com) @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */
  • 3 years ago
  • Comments
  • Permalink
  • Share
    Tweet

Recent comments

Blog comments powered by Disqus
← Previous • Next →

About

technology, communication, and simplistic innovations to share wealth and opportunities globally and socially.

Pages

  • Contact

Me, Elsewhere

  • @timothyltaylor on Twitter
  • My Skype Info
  • Linkedin Profile
  • leetaylordoes on github

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Ask me anything
  • Submit
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr