FREEBIE: Magento Featured Products Widget Version 2

Over a year ago, I released a free Magento Featured Products Widget which groups the featured products by category.  Since releasing it I’ve had a lot of traffic, and a lot of pleasant feedback from users.  Now I’ve finally been able to get round to upgrading the widget to be even better with a lot of rewritten code, testing and few new features too.

New Features

  • Creates featured attribute on installation
  • Displays Review Summary
  • Displays Add to Cart button
  • Shows path to categories when selecting categories in admin (easier to distinguish between different stores with same category names)
  • Caching
  • Code rewrite (better documented and better Magento conventions)
  • Compatibility checked on 1.4.0.0 to 1.6.2.0
  • More flexible styling (font colours are now theme defaults)
  • Included Minimum price for Bundled Products
  • Products only fetched from current store
  • Mixed template is now a lot cleaner

Screenshots

Grouped by category

Configuration Options

Mixed Display

Installation and Documentation

Installation

Copy the app and skin directories into your Magento installation

Usage

CMS Pages

  1. Login to your Magento admin
  2. Go to CMS > Pages
  3. Select the page you want to use
  4. Click the Content tab
  5. In the WYSIWYG Editor, click the Insert Widget button (for me it’s top row, second from the left)
  6. As Widget Type select Cube Websites - Category Featured Products
  7. Configure your Widget using the available options

Frontend Template
Categorised – Displays the products grouped by the category they belong in
Mixed – Displays all the products in a single block with no grouping

Categories (only applies if Categorised Frontend Template is selected)
The categories to select products from

Number of Products
If Categorised – the number of products from each category
If Mixed – the total number of products

Products Per Row
How many products will be displayed on each row in the frontend

Products to Display
Featured – Displays featured products only
All – Displays all available products

Featured Attribute Code (optional)
By default this is cube_category_featured but if you’ve created your own featured attribute code then you can use that instead.

Within your template

  1. Open your favourite text editor
  2. Within find the Layout XML you want to add the block to within the app/design/frontend directory
  3. In your .xml file, add the following in the relevant position
     <block type="categoryfeatured/list" name="featured_products" as="featuredProducts" template="categoryfeatured/block.phtml">
     <action method="setData"><name>categories</name><value>1,2,3,4</value></action>
     <action method="setData"><name>num_products</name><value>4</value></action>
     <action method="setData"><name>products_per_row</name><value>4</value></action>
     <action method="setData"><name>product_type</name><value>featured</value></action>
     <action method="setData"><name>featured_code</name><value>cube_category_featured</value></action>
    </block>

template
categoryfeatured/block.phtml – Displays the products grouped by the category they belong in
categoryfeatured/mixed.phtml – Displays all the products in a single block with no grouping

categories (only applies if categoryfeatured/block.phtml template is selected)
The categories to select products from (comma separated)

num_products
If categoryfeatured/block.phtml – the number of products from each category
If categoryfeatured/mixed.phtml – the total number of products

products_per_row
How many products will be displayed on each row in the frontend

product_type
featured – Displays featured products only
all – Displays all available products

featured_code (optional)
By default this is cube_category_featured but if you’ve created your own featured attribute code then you can use that instead.

If you need to output the block in a certain location of your template, then make sure you include the following in your .phtml file <?php echo $this->getChildHtml('featuredProducts') ?>

Downloads

I’m currently awaiting approval from the Magento Connect site, but I’ve also made this project available free on GitHub.

Download from Magento Connect (awaiting approval)
Download latest version

Download 2.0.1

Fork on GitHub

Feedback and Support

If you have any questions or issues please feel free to post in the comments.

  • Billy Haynes

    I can’t figure out where to put the piece of code where it says “Layout XML”. I have looked, don’t see a layout XML file? I have looked in in my theme, and default theme.

  • Ron

    Hey your extension works as advertised. I’ve done some adjustments to make a buying guide that adds items to cart using ajax. I had 1 small question. I cant seem to get the products to sort by category position any suggestions?

    • http://cubewebsites.com/ Cube Websites

      Hi Ron,

      I’ve created a Gist for you here which should work:
      https://gist.github.com/cubewebsites/5516849#file-list-php

      Just replace the contents of this file:
      app/code/community/Cube/CategoryFeatured/Block/List.php
      Let me know if you have any issues

  • sharath

    Thanks for the good extension , i m very happy :) this was my great helpfull.

  • http://q23.de Jakob Jordan

    Hi guys! Thanks allot for this amazing extension. helps so much.

    Im now wondering if the extension can also recognize featured products in anchor categories.

    My tree looks like this: shoes–>men–>low-top
    I create my product only(!) in low-top and on the frontend catalog its displayed also in “shoes” and “men” because these categories are anchored.

    but the extension does only recognize the product in low-top…

    is there a solution already? thx jakob

  • Tim Cole

    Hi, this seems to work fine for “All Products” but when I select “Featured Products” nothing gets displayed. I have checked and I have products with the cube_category_featured attribute set to “Yes”. Any ideas why its not working?

  • Alex

    Thank you for this great extension. Unfortunately it stops working after enabling flat catalog for categories. Is there a workaround to get this working?

  • http://stillonlocaldevelopment michel perraut

    Hello, thank you for sharing , everything works fine but as soon as i have turned on the system to use “flat category” the featured products didn’t show up any more ?
    Do you have a solution ? Thank you for your reply.

  • Scott

    Hi there,

    Thanks for the great extension!

    Everything works fine, except I would like to change the size of the image and remove the add to cart link.

    Could you possibly tell me where I can find the files in which to make these changes? I’ve taken a look through the widget directories uploaded with no luck so far.

    Many thanks in advance.

  • Elvar

    I understood it wrong probably. I thought this is the widget which will give list of featured product based on category which is currently watching. But no…

    This will be quite better to have. Basically we can place one widget list on category pages and it will be totally different output on every category. It can also modified to use NEW, Bestsellers lists per category and output type to place randomly…

  • http://searchlightcomics.com Monumentix

    I am not seeing any categories showing up in the drop-down. I have assigned a few products to be “featured”, and have re-indexed everything. Am i missing something to have the admin/widget form show product categories to choose from?

    Seemed to work great when i chose “mixed” mode though?

  • Pingback: FREEBIE: Magento Featured Products Widget | Cube Websites Blog