Home

Awesome

Easylife Direct Link

A small Magento module that changes the links of the configurable products in the product list to point to the product page with the configurable options already selected depending on the filters applied.

Version

1.0.0

Compatibility

The extension is compatible with Magento CE versions 1.7 and above.
It probably works on older versions. I just didn't test because I don't care.

What it does

An example explains it better.
Let's say you have in your store configurable products that can be configured based on size and color (in this order).
When looking at a category page or search results page and you filter the results by size and color, the configurable products urls will be changed so they point to the product page and have the filtered options already selected.
For example if you have a t-shirt that has among the available sizes "XL" and among the colors "Black" and you filter the category products or search products by size:xl and color:black, the link to that t-shirt will get you to the t-shirt page with the size xl and color black already selected.

If you filter the products list only by size XL, the XL size will be selected in the product page.
But there is a limitation. Using the example above, if you filter the list only by color, none of the options will be selected because magento works that way. The configurable options are dependent.
So you can autoselect the options in the order they are displayed in the product view page.

Configuration

In the configuration section the extensiona adds a new tab called 'Easylife Direct Link'.
In this section you can configure the following fields.

How it does it

The extension gets all the listed products. The same instance of the product collection is used so the database is not touched. It looks for the configurable products that has options similar to the applied filters and changes all the links in the page for the products found by adding #attrId=attrValue at the end of the URL.

Extending the module

If you have custom pages that list products and you want the same functionality, you can extend this module without modifying it.
You need to create 3 more system fields similar to the ones above. To enable the functionality for your pages and the product list block name and filter block name.
Observe the event easylife_directlink_page_types and add the key of your page in the list of allowed pages.
and in the layout file for your module add this:

<your_page_handle><!-- change this to fit your needs -->
    <update handle="easylife_directlink" />
    <reference name="easylife_directlink_config">
        <action method="setPageType">
            <page_type>YOUR PAGE KEY HERE</page_type><!-- the page key can be anything. Just don't use `catalog`, `search` or `search_advanced` and make sure it's the same key as the one you set in the observer -->
        </action>
    </reference>
</your_page_handle>

Rewrites

The extension does not rewrite any core class

Issues

Please report any issue or feature request in here

License

The module is released under the MIT license.
You can find a copy of the license here