Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
Display sub menu for parent category
 
Dan Orsborne
Member
 
Total Posts:  72
Joined:  2007-09-20
 

For the site I’m working on we needed to be able to drill down the category menu to view the products but still see the sub categories in the left column. Using app\design\frontend\OC\default\template\catalog\navigation\left.phtml I was able to do this BUT once you reached the bottom category the menu was blank because the code provided in Magento simply can’t find any more sub categories so shows nothing.  However, I needed the menu to be a bit smarter and to realise that it was at the lowest level and get the menu from it’s parent level instead and display that.

I have attached the replacement left.phtml file with the modified code.

File Attachments
left.phtml  (File Size: 4KB - Downloads: 387)
 Signature 

http://www.igentics.com

Igentics are Internet Engineers, we like to look at things from a different angle. The end result being a fully integrated system encompassing the whole supply chain from supplier to end user, incorporating all legacy systems and data. This increases profits and reduces cost.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bschmalz
Jr. Member
 
Total Posts:  16
Joined:  2007-09-17
Colorado Springs
 

Dan,

I think you need to visit this site smile

http://www.magentocommerce.com/company/jobs

 
Magento Community Magento Community
Magento Community
Magento Community
 
emagine
Member
 
Total Posts:  36
Joined:  2007-12-10
 

When I implement this code (looks great btw) and click into the lowest level of sub-categories, I get an odd error. Any ideas on how to get rid of this, or work around it? Seems like it is only at the last level or so.

exception ‘Varien_Exception’ with message ‘Invalid method Mage_Catalog_Block_Navigation::_getChildCategories(Array
(
[0] => Mage_Catalog_Model_Category Object
(
[_designAttributes:private] => Array
(
[0] => custom_design
[1] => custom_design_apply
[2] => custom_design_from
[3] => custom_design_to
[4] => page_layout
[5] => custom_layout_update
)

[_treeModel:protected] =>
[_defaultValues:protected] => Array
(
)

[_eventPrefix:protected] => core_abstract
[_eventObject:protected] => object
[_resourceName:protected] => catalog/category
[_resource:protected] =>
[_resourceCollectionName:protected] => catalog/category_collection
[_data:protected] => Array
(
[entity_id] => 4
[entity_type_id] => 9
[attribute_set_id] => 12
[parent_id] => 3
[created_at] => 2008-01-24 20:16:20
[updated_at] => 2008-04-25 13:48:56
[is_active] => 1
[path] => 1/3/4
[position] => 28
[name] => Furniture
[url_key] => furniture
)

[_origData:protected] => Array
(
[entity_id] => 4
[entity_type_id] => 9
[attribute_set_id] => 12
[parent_id] => 3
[created_at] => 2008-01-24 20:16:20
[updated_at] => 2008-04-25 13:48:56
[is_active] => 1
[path] => 1/3/4
[position] => 28
[name] => Furniture
[url_key] => furniture
)

[_idFieldName:protected] => entity_id
[_isDeleted:protected] =>
)

[1] => 0
)
)’ in /lib/Varien/Object.php:486

 
Magento Community Magento Community
Magento Community
Magento Community
 
chinesedream
Mentor
 
Avatar
Total Posts:  1141
Joined:  2007-08-31
 

Dan, I tried your code but nothing changes, then I realized the file for the left column layered nav is view.phtml, in the layer folder, not the navigation\left. I am certain of this as I modified the class names and markup for the layered nav, and all along it’s showing my version.

Something I didn’t know about the ‘left.phtml’?

Image Attachments
view.jpg
 Signature 

Accessible, WCAG 2.0 HTML5 Magento themes:
Latest release :  Green Path Premium Theme | : Touchscreen Optimized Mobile Theme

 
Magento Community Magento Community
Magento Community
Magento Community
 
twistedindustries
Member
 
Total Posts:  61
Joined:  2008-06-09
 

I am getting a similar error as a person above when I click on the generated sub categories.

Invalid method Mage_Catalog_Block_Navigation::_getChildCategories(Array
(
    
[0] => Mage_Catalog_Model_Category Object
        
(
            
[_eventPrefix:protected] => catalog_category
            [_eventObject
:protected] => category
            [_cacheTag
:protected] => catalog_category
            [_useFlatResource
:protected] => 
            
[_designAttributes:private] => Array
                (
                    
[0] => custom_design
                    [1] 
=> custom_design_apply
                    [2] 
=> custom_design_from
                    [3] 
=> custom_design_to
                    [4] 
=> page_layout
                    [5] 
=> custom_layout_update
                
)

            
[_treeModel:protected] => 
            
[_defaultValues:protected] => Array
                (
                )

            
[_lockedAttributes:protected] => Array
                (
                )

            
[_isDeleteable:protected] => 1
            [_isReadonly
:protected] => 
            
[_resourceName:protected] => catalog/category
            [_resource
:protected] => 
            
[_resourceCollectionName:protected] => catalog/category_collection
            [_dataSaveAllowed
:protected] => 1
            [_isObjectNew
:protected] => 
            
[_data:protected] => Array
                (
                    
[entity_id] => 3
                    [entity_type_id] 
=> 3
                    [attribute_set_id] 
=> 3
                    [parent_id] 
=> 2
                    [created_at] 
=> 2010-02-23 19:12:02
                    [updated_at] 
=> 2010-02-24 23:00:54
                    [path] 
=> 1/2/3
                    [position] 
=> 1
                    [level] 
=> 2
                    [children_count] 
=> 10
                    [name] 
=> Modern
                    [url_key] 
=> modern
                
)

            
[_origData:protected] => Array
                (
                    
[entity_id] => 3
                    [entity_type_id] 
=> 3
                    [attribute_set_id] 
=> 3
                    [parent_id] 
=> 2
                    [created_at] 
=> 2010-02-23 19:12:02
                    [updated_at] 
=> 2010-02-24 23:00:54
                    [path] 
=> 1/2/3
                    [position] 
=> 1
                    [level] 
=> 2
                    [children_count] 
=> 10
                    [name] 
=> Modern
                    [url_key] 
=> modern
                
)

            
[_idFieldName:protected] => entity_id
            [_isDeleted
:protected] => 
        )

    
[1] => 0
)
)

 
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
713669 users|861 users currently online|495362 forum posts