Magento Categories Sidebar Navigation

Share
Posted on May 4th, 2013 | Posted by admin

Magento categories sidebar navigation to use in the left or right sidebar.
Contains php code to include in the /category/navigation/nameofthefile.phtml . Call it from the category.xml.

01.<?php
02.$categories = Mage::getModel('catalog/category')->load(1)->getChildren();
03.$categoryIDs = explode(',',$categories);
04.?>
05.<ul>
06.<?php foreach($categoryIDs as $categoryID): ?>
07.<li>
08.<?php $category = Mage::getModel('catalog/category')->load($categoryID);?>
09.<a href="<?php echo $category->getUrl()?>">
10.<?php echo $category->getName()?>
11.</a>
12.

MAGENTO GET CHILD CATEGORIES OF THE CURRENT CATEGORY EXAMPLE

Share
Posted on April 5th, 2013 | Posted by admin

when we in the list.phtml file sometime we need to display the list of child categories of current category with there URL for navigations. this can easily implemnt with magento framework objects. below code example can use on list.phtml easily to retrive child categories of current category.this shows as a list, you can apply css to format the list. happy coading… :)

QUICK SCRIPT TO EXPORT MAGENTO CATEGORIES WITH IDS

Share
Posted on February 14th, 2013 | Posted by admin

QUICK SCRIPT TO EXPORT MAGENTO CATEGORIES WITH IDS
If you are after a quick method to get all the category ID’s for your categories for some Excel lookups (for new data imports), then this quick PHP script should help you out:

Magento 1.5 Admin – categories tree for product does not expand to show sub-categories

Share
Posted on November 23rd, 2012 | Posted by admin

When i have open products in edit mode in Magento 1.5 Admin then categories tree for product does not expand to show product sub-categories… Only Root categories were visible…

I couldn’t find proper solution for this problem… But i did patch which worked perfectly for me. Hope this will help to someone else too…

Solution:

There is some change in Categories.php file of magento 1.4.2 and 1.5.x

So,i have backed up old Categories.php in:

Listing sub-categories on a category page in Magento

Share
Posted on November 2nd, 2012 | Posted by admin

In this tutorial I’m going to show you how to display a list of sub categories on a category page in Magento.

Lets say we have a category with lots of sub categories; if we could show these to our users then they might have an easier time finding what they’re looking for. We can achieve this with a simple bit of code.

First create a new phtml file and save it in your/app/design/frontend/default/yourTheme/template/catalog/category folder.

How will our code work?

When writing a new piece of code its always a good idea to have a think and write down in words exactly what you’re going to do. In this case we’re going to find the id of the category we’re looking at, then we’re going to find the sub-categories associated with that id, and then we’re going to display the relevant information for each of those subcategories.

So first we have to find the category id for the page we’re looking at. (This code will only be called when we’re on a category page). We find the id with the following code:

Page 1 of 212»