Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 10
Here is code to control layered navigation
 
assoman
Member
 
Avatar
Total Posts:  41
Joined:  2008-02-05
Roma
 

Thanks Ajazza !!!!!!!!!!!!!!!!!!!!!!!!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
nafnaf1000
Sr. Member
 
Total Posts:  209
Joined:  2008-02-21
 
Ajazza - 09 April 2008 05:10 PM

@Ajazza ;

just wondering.

When it comes to price, is it possible to let the user enter an amount and not a predefined one form the system?

I am sorry, I am not sure what you mean

instead of having a drop down for the price or a link of the price, can it be where the user enters a price in to a text box

so “find all item with in price range”
min R.64 - max $98.77

 
Magento Community Magento Community
Magento Community
Magento Community
 
lucian303
Member
 
Avatar
Total Posts:  74
Joined:  2008-03-03
 

How can I put layered navigation on the homepage in 1.0? In .9 I did a layout update of the home page with this:

<reference name="right">
            <
block type="catalog/layer_view" name="catalog.leftnav.homepage" after="right.newsletter" template="catalog/layer/viewcat.phtml"/>
        </
reference>

And it worked. viewcat.phtml was almost an exact copy of catalog/layer/view.phtml

Now I get an error:

Fatal errorCall to a member function getProductCollection() on a non-object in /web03/magento/pub/app/code/core/Mage/Catalog/Model/Layer.php on line 40

Any ideas? Why wouldn’t this work anymore?

When I put that in. Running on:

Linux version 2.6.18-5-xen-vserver-amd64 (Debian 2.6.18.dfsg.1-17) () (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP Sat Dec 22 22:58:29 UTC 2007

Apache 2.2.3
MySQL 5.0.32-Debian_7etch5-log
PHP 5.2.0-8+etch10

 
Magento Community Magento Community
Magento Community
Magento Community
 
lucian303
Member
 
Avatar
Total Posts:  74
Joined:  2008-03-03
 

The above xml I posted works in v. 1.0. I forgot I had modified the model as such:

Mage/Catalog/Model/Layer.php

public function getCurrentCategory()
    
{
        $category 
$this->getData('current_category');
        if (
is_null($category)) {
            
if ($category Mage::registry('current_category')) {
                $this
->setData('current_category'$category);
            
}
            
else {
                $category 
false;
                
$this->setData('current_category'$category);
            
}
        }
        
        
//added to make this work for front page:
        
if(is_null($category) || $category == false{            
            $home_category 
Mage::getModel('catalog/category')->load(8); //number must correspond to 'all products page' category
            
$this->setData('current_category'$home_category);
            
$category $this->getData('current_category');
            
//return $category;
        
}
        
//end addition

        
return $category;
    
}

and change the number in this line to define my home page category (in my case the category that has all products so they can all be filtered through)

$home_category Mage::getModel('catalog/category')->load(8); //number must correspond to 'all products page' category
 
Magento Community Magento Community
Magento Community
Magento Community
 
Danielc1234
Sr. Member
 
Avatar
Total Posts:  175
Joined:  2008-01-09
Miami, FL - United States
 

@lucian303
Can you please post your URL? We are tyring to do the exact same thing but I would like to see the results you are getting.
Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
lucian303
Member
 
Avatar
Total Posts:  74
Joined:  2008-03-03
 

I’m not sure I can do that since it’s an internal site. What I did is create a category that’s not under root. Put all products as part of it and made it enabled and anchored. Then I got the number I say to change above from looking at the URL rewrite and finding what id that category is. Let me know if I can help you more. I would, but I don’t want to do anything against my contract.

 
Magento Community Magento Community
Magento Community
Magento Community
 
glaDiator
Member
 
Avatar
Total Posts:  65
Joined:  2008-03-17
 

It works very fine........... cool smirk

Thanks Ajazza for the solution.

But i am in a far deeper problem........ i want to create a layered navigation for a composite attribute (Like area which is composed of two individual attribute height & width --- but i need to filter it by area).

I think, i need to create a customized filter like the one is done for Price. I have wasted several hours but unable to understand how to do it.

Can anyone help ...........

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tiff
Sr. Member
 
Avatar
Total Posts:  107
Joined:  2008-03-25
Upstate NY
 

I’m using 1.0 and this didn’t work for me.

Am I missing something?

The only bit of your code I changed is below, and screenshot is attached - showing no change.

Thanks.

$attributeName $this->getName();
    
$itemcountthreshold =10// you can change this
    
$itemcount $this->getItemsCount();
    
$displayitemcount true//set to true/false to display item count in brackets

and

switch ($attributeName{
        
case 'Brand':
        case 
'Overthreshold':
            
_displayDropdown($this,$displayitemcount);
            break;
    
        default:
            
_displayOrderedlist($this,$displayitemcount);
            break;
}
Image Attachments
sidemenu.gif
 
Magento Community Magento Community
Magento Community
Magento Community
 
Tweakmag
Guru
 
Avatar
Total Posts:  307
Joined:  2007-08-31
London, UK
 

I am just about to head out the door - I will have a think as to what may have happened for you - this does work on v1.0 however.
Cheers
Adam

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 
Tiff - 20 April 2008 07:08 AM

I’m using 1.0 and this didn’t work for me.

Am I missing something?

The only bit of your code I changed is below, and screenshot is attached - showing no change.

Thanks.

Hi Tiff, just in case you missed this important steps:
In order for the custom attributes to show up, the input type has to be
Dropdown, Multiple Select or Price. And you need to make sure the ‘Use In Layered Navigation’ is YES.

 
Magento Community Magento Community
Magento Community
Magento Community
 
GregRandall
Jr. Member
 
Total Posts:  6
Joined:  2008-04-03
 

Functionality I would really love to see is an integration of the select boxes and active filters, exactly as the filter works on the Magento Partner portal. i.e. active filters appear as the default option in the select boxes and there is a reset option.

Having a go at this, without much luck so far.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tweakmag
Guru
 
Avatar
Total Posts:  307
Joined:  2007-08-31
London, UK
 

I am in the process of (trying) to package this up as an extension now - can you please provide me a screenshot of what you are looking for . Cheers.

 
Magento Community Magento Community
Magento Community
Magento Community
 
roco
Sr. Member
 
Total Posts:  191
Joined:  2008-03-18
 

Hi all - Just getting to this layered navigation element - Is there an easy way to hide the “price” category altogether?

 
Magento Community Magento Community
Magento Community
Magento Community
 
lucian303
Member
 
Avatar
Total Posts:  74
Joined:  2008-03-03
 

@roco

Just make it hidden from layered navigation using the backend and it will not show it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
roco
Sr. Member
 
Total Posts:  191
Joined:  2008-03-18
 

Thanks Lucian303 - That sounds perfect............where in the backend would I do this hiding?  Am I editing code?  or is this in the config panel? or......

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 10