Featured product is an item of sale provided with a specific attribute from the administrative UI. The products positioned as featured usually fit into such groups as ‘best value’, ‘on sale’, ‘speciality’, etc.
Placing a product on a store’s homepage makes it even more fascinating for buyers. It’s a proven way to attract customer’s attention and bring it to this particular product. The possibility boosts sales and traffic exponentially.
The featured product can’t be created through the usage of standard tools, therefore you’ll need a customized code for the purpose. Besides, you can apply the Easy Content Blocks extension for displaying desired information blocks on any page of your website.
Manage Label/Options:
Once the newly-created attribute is saved, enter the Catalog>Attributes>Manage Attributes Sets
and add it to the Default attribute set:
The new block is required for the featured product instantiation. For this reason, you need to make a new file and directories:
Go to app/code/local/MyCompany/Catalog/Block/Product/Featured.php
<?php
class MyCompany_Catalog_Block_Product_Featured extends Mage_Catalog_Block_Product_Abstract
{
public function getFeaturedProducts() {
$resource = Mage::getSingleton('core/resource');
$read = $resource->getConnection('catalog_read');
$productEntityIntTable = (string)Mage::getConfig()->getTablePrefix() . 'catalog_product_entity_int';
$eavAttributeTable = $resource->getTableName('eav/attribute');
$categoryProductTable = $resource->getTableName('catalog/category_product');
$select = $read->select()
->distinct(true)
->from(array('cp'=>$categoryProductTable), 'product_id')
->join(array('pei'=>$productEntityIntTable), 'pei.entity_id=cp.product_id', array())
->joinNatural(array('ea'=>$eavAttributeTable))
->where('pei.value=1')
->where('ea.attribute_code="featured"');
$res = $read->fetchAll($select);
return $res;
}
}
?>
The config global tag should be expanded with the following code:
<?xml version="1.0"?>
<config>
<modules>
<MyCompany_Catalog>
<version>1.0.0</version>
</MyCompany_Catalog>
</modules>
<global>
<blocks>
<amcompany>
<class>MyCompany_Catalog_Block</class>
</amcompany>
<rewrite>
<catalog>
<product_featured>MyCompany_Catalog_Block_Product_Featured</product_featured>
</catalog>
</rewrite>
</blocks>
</global>
</config>
Now the featured product box should be placed to the frontpage.
Enter CMS - Manage Pages and choose homepage( or another page if you don’t want the featured product to be placed on the homepage).
Then place the code in the Content area:
So, that's all you should do for configuring the featured product.
To add Magento product price slider and place it on the home page, try this Price Slider & Filters extension. Thanks to AJAX technology, your shoppers will convert their intents to purchase into orders faster as navigation and filtering will be practically seamless.
Login and Registration Form