Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

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

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

 
Magento Community Magento Community
Magento Community
Magento Community
 
nafnaf1000
Sr. Member
 
Total Posts:  119
Joined:  2008-02-21
 
Ajazza - 09 April 2008 06: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:  71
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:  71
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:  118
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:  71
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
 
Total Posts:  56
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 ...........

 Signature 

GlaDiator
cracking my head in the wrold of open source

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tiff
Member
 
Avatar
Total Posts:  75
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
 Signature 

-Tiffany
A Joyful Affair
Party accessories, favors, & gifts for all occasions.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tweakmag
Sr. Member
 
Avatar
Total Posts:  277
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

 Signature 

adam martin: internet consultant / web developer
contact | adam.martin@internetconsultants.com.au | +61 4 3331 3374 | skype adam.j.martin
http://www.tweakmag.com - Tweaking and Customizing The Magento eCommerce Platform

 
Magento Community Magento Community
Magento Community
Magento Community
 
chinesedream
Guru
 
Total Posts:  745
Joined:  2007-08-31
San Francisco, CA
 
Tiff - 20 April 2008 08: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
 
Greg Randall
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
Sr. Member
 
Avatar
Total Posts:  277
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.

 Signature 

adam martin: internet consultant / web developer
contact | adam.martin@internetconsultants.com.au | +61 4 3331 3374 | skype adam.j.martin
http://www.tweakmag.com - Tweaking and Customizing The Magento eCommerce Platform

 
Magento Community Magento Community
Magento Community
Magento Community
 
roco
Sr. Member
 
Total Posts:  138
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:  71
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:  138
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 5
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
53152 users|476 users currently online|107154 forum posts