How To Create a Featured Product in Magento

We are going to write about How To Create a Featured Product in Magento store. The Featured Product is a product with an attribute added from the administrative UI. When the administrator selects Yes in the Featured attribute, that product will be displayed in a content block on the category page.

Step 1) Create new “Featured” attribute

Create a new attribute by going to Catalog > Attributes > Manage Attributes > Add New Attribute.
Attribute Properties
Attribute Identifier: featured
Scope: Store View
Catalog Input Type for Store Owner: Yes/No
Unique Value (not shared with other products): No
Values Required: No
Input Validation for Store Owner: None
Apply To: All Product Types
Front End Properties
Use in quick search: No
Use in advanced search: Yes
Comparable on Front-end: No
Use In Layered Navigation (Can be used only with catalog input type Dropdown): No
Visible on Catalog Pages on Front-end: Yes
Manage Label/Options
Default: Featured Product
English: Featured Product

Save the new attribute and go to Catalog → Attributes → Manage Attributes Sets to add the attribute to the default feature set.

Step 3) Create new block class that will instantiate the featured product

Create a new file, and directories: app/code/local/MyCompany/Catalog/Block/Product/Featured.php

We are almost there!

Step 4) Extend Mage_Catalog_Block_Category_View

Create a new file, and directories, called app/code/local/MyCompany/Catalog/Block/Category/View.php. We are extending the core class here so our module will be separate from the core code base. When upgrading, we won’t have to worry about our code not working or having to patch files.

Step 5) Modify the templates

Edit app/design/frontend/default/default/template/catalog/category/view.phtml and add the following code:

right above this line:

Create app/design/frontend/default/default/template/catalog/product/featured.phtml and add some product info HTML to show the featured product. Here is an example that simply displays a link to the product:

Step 6) Add new blocks to the app/etc/local.xml

Add the following inside the config global tag:

How do you modifying the httpd.config file, .htaccess files, and domain settings.