Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
I need to make a CUSTOM dropdown selection menu to narrow results on homepage… (NOT A LAYERED NAV QUESTION)
 
mhunkler
Guru
 
Total Posts:  302
Joined:  2009-05-30
 

The website i am building is for diamond blades and cutting tools…

Basically I want a PRE FILTER on the homepage that simply asks what material they’re cutting and what tool they’re using and filters the results with the attributes attached to the products…

I have made an image and placed it on my site for an example of what i want to make… you can see it on the top left here

http://www.precisiondiamondinc.com/magento134/magento/index.php/

Would you need ajax for this or would just javascript be needed… i never had to make something like this before… Any help is greatly appreciated…

 Signature 

Concrete Diamond Saw Blades

 
Magento Community Magento Community
Magento Community
Magento Community
 
MI
Sr. Member
 
Total Posts:  162
Joined:  2008-12-11
Spain
 

Hi,

search for use layered navigation on homepage

 
Magento Community Magento Community
Magento Community
Magento Community
 
mhunkler
Guru
 
Total Posts:  302
Joined:  2009-05-30
 

I am not looking for layered navigation on the homepage at all…

i thought my post was pretty specific, If you go to the link i gave you can see a picture of EXACTLY what i am looking for…

I do not want layered navigation… I do not need all the options on the homepage.. I simply want to make a custom search to narrow by 2 of the MANY attributes.

I understand what i need to do, just not sure how to do it… basically i need a 2 dropdown menu’s, and depending on the answer for question A, and question B they will directed to a link of search results…

 Signature 

Concrete Diamond Saw Blades

 
Magento Community Magento Community
Magento Community
Magento Community
 
MI
Sr. Member
 
Total Posts:  162
Joined:  2008-12-11
Spain
 

sorry i understand you wrong.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mhunkler
Guru
 
Total Posts:  302
Joined:  2009-05-30
 

still looking for an answer if anyone can help…

 Signature 

Concrete Diamond Saw Blades

 
Magento Community Magento Community
Magento Community
Magento Community
 
modernm
Member
 
Total Posts:  38
Joined:  2010-01-11
 
mhunkler - 04 February 2010 08:12 AM

still looking for an answer if anyone can help…

Maybe advanced search functionality could be leveraged for this. Outside of that, you probably would need to hire a developer to build something out for you.

Cal

 
Magento Community Magento Community
Magento Community
Magento Community
 
tiagofm
Member
 
Total Posts:  39
Joined:  2009-02-05
 

Interesting…

Did you think about layered Navigation? ehehe

Just kidding, but seriously.

Are you planning to use this just on the main page?

Here is some ideas:

1) Layered Navigation for only the two attributes that you need. ( the problem that I see is that the results will show on the main page).

This code goes in the /app/design/frontend/default/Your_Theme/template/catalog/layer/filter.phtml , but you might have to play around with it, since you do not want to mess up the layered navigation to all other categories.

In my case, I also restricted the results not to show until there is only one product. Maybe you can use it to take you to another page once the results are selected.

/**
 * Template for filter items block
 * Coded by Adam Martin (www.tweakmag.com)
 * 
 * 
 * @see Mage_Catalog_Block_Layer_Filter
 */
?>

<?php
    
//control the way that the layered navigation attributes present themselves
    //either dropdown list or default methd (ordered list)
    
$attributeName $this->getName();
    
$itemcountthreshold 1// you can change this
    
$itemcount $this->getItemsCount();
    
$displayitemcount false//set to true/false to display item count in brackets
    
    
    
if($itemcount $itemcountthreshold){
        $attributeName 
"Overthreshold";
    
}
    
    
if(!function_exists("_displayOrderedlist")){
        
function _displayOrderedlist($atts,$displayitemcount){
            
echo '<ol>';
            foreach(
$atts->getItems() as $_item){
                
echo '<li><a href="'.$_item->getUrl().'">'.$_item->getLabel().'</a>';
                if(
$displayitemcount){
                    
echo ' ('.$_item->getCount().')';
                
}
                
echo '</li>';
            
}
            
echo '</ol>';
        
}
    }
    
if(!function_exists("_displayDropdown")){
        
function _displayDropdown($atts,$displayitemcount){
            
echo '<select id="layered-select" class="select" name="layered-select" onchange="if (this.selectedIndex > 0) location.href=this[this.selectedIndex].value;">';
            echo 
'<option selected="selected">Please select</option>';
            foreach (
$atts->getItems() as $_item){
                
echo '<option value="'.$_item->getUrl().'">';
                echo 
$_item->getLabel();
                if(
$displayitemcount){
                    
echo ' ('.$_item->getCount().')';
                
}
                
echo '</option>';
            
}
            
echo '</select>';
        
}
    }
    
    
switch ($attributeName{
        
case '********************************************************************INSERT HERE ATTRIBUTE 1************************':
        case 
'********************************************************************INSERT HERE ATTRIBUTE 2************************':
        case 
'Overthreshold':
            
_displayDropdown($this,$displayitemcount);
            break;
    
        default:
            
_displayOrderedlist($this,$displayitemcount);
            break;
    
}    
    
?>

Thanks for the code Adam www.tweakmag.com

2) Advance search seems to be the best idea, since the results will show in another page that can be further filtered by you client to find what they are looking for.

Since I’m not a programmer and I know nothing of PHP, I had a hard time figuring this one out.
Issue for me was to limit the attributes to search and still be able to the use advance search somewhere else.
I believe that the file to change is this /app/design/frontend/default/default/template/catalogsearch/advanced/form.phtml

Maybe you could use this on your store, since I did not see the Advance Search anywhere on your page.
- go to catalog>attributes>manage Attributes
- Select the attribute that you WANT to show in Advance Search and in “Use in Advance Search” put yes
- Do the same with the all the other ones and in “Use in Advance Search” put no
- Change the phtml that is being used by the advance form and CSS to as a miniform
- Call the miniform in your homepage.

Hope this gave you ideas. Believe me If I knew how to do it, I would tell you since many people in the forum always helped me out.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tadwestie
Jr. Member
 
Total Posts:  12
Joined:  2009-09-21
 

I would like a site like yours with the drop down navigation, did you do this through Magento or did you obtain some extensions?  Nice site!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
jingpe
Jr. Member
 
Total Posts:  13
Joined:  2009-08-28
 

This is a good approach. thanks.
Do you have any idea how to change the state.phtml as well? allow to select another filter in the state.phtml would be good to have

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2012 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
697453 users|1834 users currently online|496729 forum posts