How to add Product Parts Finder blocks to pages

How to add Product Parts Finder blocks to pages

Hello to Amasty blog readers!

Today I’m sharing a tutorial for users of Amasty Product Parts Finder extension. Product Parts Finder is a very powerful tool that lets people find spare parts and components by certain parameters.

In the user guide, we described options of adding the Product Parts Finder block on certain pages via the admin panel. But often this method is not enough for merchants, so I described ways of adding Product Parts Finder block on various pages of your Magento store.

Note: before performing the following actions, please make sure that you’re doing this on a test or dev store. Also, please make sure you have enough technical knowledge to follow the instructions. If they are not quite clear to you, please address a developer.

If you want to put the finder block onto a special amfinder page, which will search among all the site products, make sure you set the root category as an anchored one:

Amfinder

1)  The most effective method of adding the finder block to the pages is adding via inserting blocks into the xml file. To do that, we are going to modify /app/design/frontend/base/default/layout/amfinder.xml file.

For instance, we want a finder block with id = 1 to be available on the amfinder page. For this result, please uncomment this code part:

Uncomment this part


<block type ="amfinder/form" name="amfinder89">
                    <action method="setId"><id>1</id></action>    
                    <action method="apply" />
                </block>  

If you still can’t see the finder block, change the block type from type=”catalog/category_view” to type=”core/text_list”.

Finder 1
Here we’ve done that, the finder block is visible and working now.

Finder 2

2) If you want to set a vertical, horizontal or responsive design for a particular finder block, use the following parameter:


<action method="setTemplate"><template>amfinder/responsive.phtml</template></action> 

Template

 

3) For installing the finder block on all the store categories, uncomment the following lines:


<catalog_category_default>
        <reference name="content"> 
            <block type ="amfinder/form" name="amfinder89" before="category.products">
                <action method="setId"><id>1</id></action>    
                <action method="apply" />
            </block>
        </reference> 
    </catalog_category_default>
    
     <catalog_category_layered>
        <reference name="content"> 
            <block type ="amfinder/form" name="amfinder89" before="category.products">
                <action method="setId"><id>1</id></action>    
                <action method="apply" />
            </block>
        </reference> 
    </catalog_category_layered>

4) To add the finder block onto a certain category page, you need to know this category ID (say, it’s 19 for a quick example).

Category ID

Use the following code to perform this task:


<CATEGORY_19>
        <reference name="content"> 
            <block type ="amfinder/form" name="amfinder89" before="category.products">
                <action method="setId"><id>1</id></action>    
                <action method="apply" />
            </block>
        </reference> 
    </CATEGORY_19> 

5) Sometimes merchants ask us how to add the finder block to all the site pages, and it should redirect to the amfinder page.

It can be done, too! Go to the finder settings and make sure that Custom Destination URL = amfinder/

Destination URl

Then, add the finder block to the header section of all the site’s pages:

<default>
        <reference name="header"> 
            <block type ="amfinder/form" name="amfinder89" as="finder1">
                <action method="setId"><id>1</id></action>   
				<action method="setTemplate"><template>amfinder/responsive.phtml</template></action>    				
                <action method="apply" />
            </block>
        </reference> 
    </default>

After that, you need to call the declared block, and we are going to do that in the theme file. For example, if you have the RWD Magento theme installed, it is the following file:

\app\design\frontend\rwd\default\template\page\html\header.phtml

Call the finder block with this code line:

<?php echo $this->getChildHtml('finder1') ?>

And here’s the result:

All site pages

I hope these short instructions will help you in using Product Parts Finder extensions to its full. If you still have any questions on adding the finder blocks to your site, please welcome to ask me in the comments or drop a line at support@amasty.com.

Ruslan Aharodnik

Ruslan Aharodnik

Ruslan is an expert in all what concerns shipping and promotion modules. Usually he is the person, who gives you a hand with setup of sophisticated promotions or shipping combinations. Ruslan has very analytical mind. By the way, he teaches computer science at a local University.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *