Magento - Get Subcategories on a Category Page

To list down your subcategories in the category page all you have to do is creating a static block and then assigning the parent category to that block with few other settings. Just go through the below steps to achieve this in your magento website.

  • Go to Magento admin panel > CMS > Static blocks. Create new static block with identifier subcategory_listing with the content "{{block type="catalog/navigation" template="catalog/navigation/subcategory_listing.phtml"}}"
  • Save your block and navigate to Catalog > Manage categories. Select the parent category which contains subcategories. Under the display settings tab change the settings as below:
    Display mode: Static block only; Only CMS Block: subcategory listing; Is Anchor: No and save the category.
  • Now create new file subcategory_listing.phtml in app/design/frontend/default/{Your Custom Theme}/template/catalog/navigation and copy the below code: 

<div class="category-products">
<ul class="products-grid">
<?php
$_categories=$this->getCurrentChildCategories();
if($_categories->count()):
$categorycount = 0;
foreach ($_categories as $_category):
if($_category->getIsActive()):
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
$catName = $this->getCurrentCategory()->getName();
if ($categorycount == 0){
$class = "first";
}
elseif ($categorycount == 3){
$class = "last";
}
else{
$class = "";
}
?>
<li class="item <?=$class?>">
<a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>"><img src="<?php echo $_category->getImageUrl() ?>" width="100" alt="<?php echo $this->htmlEscape($_category->getName()) ?>" /></a>
<h2><a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>"><?php echo $this->htmlEscape($_category->getName()) ?></a></h2>
</li>
<?php
endif;
if($categorycount == 3){
$categorycount = 0;
echo "</ul>\n\n<ul class=\"products-grid\">";
}
else{
$categorycount++;
}
endforeach;
endif;
?>
</ul>
</div>

From Magento Admin panel -> Manage Categories -> Go to the category that contains sub categories -> Under Display Settings Tab -> Select Display mode as: Static block only; CMS Block: subcategory_listing  ;Is Anchor: No and save category.

Go to your front end website and go to that category page. You will see a list of subcategories :)

Hope this helps to solve someone's problem ! For any other queries please feel free to write us at prashcreations(at)gmail(dot)com

62 comments:

  1. Wow, Excellent post. This article is really very interesting and effective. I think its must be helpful for us. Thanks for sharing your nice post.
    memory trainings

    ReplyDelete
  2. very good article [url=www.prothom-alo.com]PROTHOMALO[/url]

    ReplyDelete
  3. phen375 Reviews Phen375 diet pill review. Find out what it is and how it can benefit you in your weight loss problems.

    ReplyDelete
  4. Leaks can be caused by bad valves We want to be your plumbers for life! We offer just about every plumbing service you'll ever need, delivered by the friendliest and most talented plumbers the industry has to offer.

    ReplyDelete
  5. Summed up simply, we integrate and implement 360º creative communication solutions in Iran.

    Outside of Iran this term might be divided into branding, advertising, PR or media solutions and have words such as digital or events added, but Iran, for multiple reasons is different.

    For over 15-years we’ve mastered those disciplines individually – integrating international standards where appropriate, and local practices where necessary.

    We’re not different from others in the industry, in that we comfortably cross disciplines, but we are different in that we get great results – be them with branding and advertising, digital or events – over an insistence on implementing international standards in zigma8 full service advertising agency.

    ReplyDelete
  6. FlowerDeliveryNYC.com is a company that aims to provide the highest quality floral arrangements for you to make your event or occasion stand out. What distinct www.FlowerDeliveryNYC.com from other florists is that they are high professionals and not telemarketers. The company promises to offer its services all 7 days a week and 365 days a year with a prompt delivery on the very same day you order to make your occasion an everlasting one. We make sure to consider your event as our own and provide with services that can make your event a hit.
    Products
    Tiniest details matter the most. Whether it is a simple thank you, congratulations, get well soon, sorry, or love and romance, we have got it all covered for you. When you place an order with us, you obviously want it to be done right. We promise to fill every order exactly as it is required by the customer.
    Our products are divided under the categories of;
    • Luxury collection
    • Corporate gifts
    • Gift baskets
    • DOG – able collection
    Whether it is happy news or a sad one, flowers are something that is required at any sort of occasion. For the happy occasions like birthdays, anniversary, graduation, sorry, I am thinking of you or get well soon we have a whole different variety of flowers. Whereas, when it comes to sympathy, we have a huge collection of baskets, vase arrangements, casket sprays, standing sprays, crosses, hearts and baskets.
    Corporate Services
    To make you feel refreshed every Monday after a fulfilled weekend, www.FlowerDeliveryNYC.com provides fresh arrangements for your boardroom or corporate reception area with a new arrangement delivered each week. The arrangement is set and designed from the in-season flowers.
    www.FlowerDeliveryNYC.com are professional florists that take their work very seriously hence, come in to your office, check the environment to determine the lighting and size to provide with the suitable flower arrangement.
    Delivery
    We believe that our customers and their occasions are equally important to us as if it were our own, which is why www.FlowerDeliveryNYC.com has hired a dedicated professional staff to make your experience a pleasant one. The staff goes an extra mile to give you an outstanding service by making your floral gift perfect.
    There are various delivery policies mentioned on our official website so do have a look on them before placing your order. However, we assure you to deliver you what you desire at the requested time frame in the special instruction box when you order. You can also send a message to your loved one or the recipient of the gift on the Card Message field that comes with the gift.
    What makes us the best in New York City is that we make sure to keep every minor detail in mind and not leave the orders we receive to a computer but personally administer them. We also believe we offer the best value among other florists.
    Give us a chance to be your first choice when it comes to flowers.

    ReplyDelete
  7. We are a licensed moneylender company, providing low interest legal loans. Fast cash, instant approval! Best deal in Singapore. Contact us today!

    ReplyDelete

  8. Seaside Residences East Coast Park
    is the first new launch condominium projects with sea view that will be built along East Coast Park in 15 years. According to the developer ...

    ReplyDelete
  9. tarotRencontrez une voyante en ligne au numero de telephone indique sur notre site web. Avec le tarot, le pendule ou l'astrologie, votre destin pourra vous etre devoile sans attente. Ne restez pas plus de temps entrave(e) par l'incertitude et la peur du lendemain. Des aujourd'hui, vous pouvez obtenir des informations precieuses en ligne qui vous permettront de voir l'avenir avec plus de confiance et de certitudes.

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. " olympicbodyfuel " Nowadays, many people start to follow an effective diet routine or an exercise plan that assure them the quick and greatest result. People are willing to follow these plans as they want to look attractive regardless of any other thing. All they want to look beautiful and catchy. The people which are following the muscles building plan may follow the SMART principle as by applying these principal they can achieve their goals and plan and the dreams which they want to see in reality. You can use “D bal Max” in your routine if you want to achieve your desired target.

    ReplyDelete
  12. " Car Insurance Agency Pearl City HI " As a Personal Financial Representative in Pearl City, I know many local families. My knowledge and understanding of the people in this community help me provide customers with an outstanding level of service. I look forward to helping families like yours protect the things that are important – your family, home, car and more. I can also help you prepare a strategy to achieve your financial goals.

    ReplyDelete
  13. " Rent a Yacht in Cabo " At Luxury Yachts Cabo, we love the yacht lifestyle. And we want to share that lifestyle with you! We've been working in the Rent a Yacht in Cabo business for years and love to share our expertise with our customers. No matter what your needs, what you've always dreamed your yacht experience will be, we will bring it to you. If you want a small, family cruise or a large yacht party, we'll put it all together for you.
    From the boat to the captain to the music and drinks, we'll handle everything.

    ReplyDelete
  14. hampton bay ceiling fans Online shopping for Tools & Home Improvement from a great selection of Ceiling Fans, Accessories, Ceiling Fan Light Kits & more at ...

    ReplyDelete

  15. Cheap Hair Extensions wholesale fast delivery and free shipping for your business in just virgin wig online stores

    ReplyDelete
  16. Hemp Oil ONLINE SHOPPING BRAND NEW CBD PRODUCTS AND TRUST IN THE QUALITY OF OUR CBD...!!!

    ReplyDelete
  17. Christy We aim to be the premiere Seattle moving company! With our great customer service and the excellent seattle movers, you can trust us to meet all of your Seattle moving needs!

    ReplyDelete
  18. daily erectile dysfunction medicationsatified with thier partners Smaller penis, Lack of stamina, aging often causes a steady decline in vitality & virility, which has a direct & negative impact on erections, sexual stamina & staying power. Some of the symptoms that may prevent you from satisfying the woman in your life may include:

    ReplyDelete




  19. apofraxeis ?a te?e?ta?a ?????a epe?te??aµe stad?a?? t?? d?ast????t?te? µa? e?t?? t?? ?p?f???e?? ap??ete?t???? a????? ?a? e??e??se?? ß?????, t??a a?a?aµß????µe ?pe????a ap???µ??se?? ?t????? ?a? ??d?s? ????????st??, ?????ta? ?a p??sf????µe ????????µ??e? ?p??es?e? st?? ?t???a??? a????e?.

    ReplyDelete
  20. Ellis Porter PLC MARRIAGE BASED VISAS & GREEN CARDS

    In a smaller world, true love can extend beyond borders.
    Connect with us and we'll make sure that borders aren't barriers for your international love story.

    Ellis Porter provides the following services for the foreign national spouses of U.S. Citizens:

    Marriage Based Visas

    K-1 Visas for Fiance/Fiancee of U.S. Citizens

    K-3 Visas for Spouse of U.S. Citizens

    Marriage Based Green Cards

    Green Cards for Spouse of U.S. Citizens

    ReplyDelete
  21. Adult websites Adult websites directoryes uEscort.com EscortE.com hEscort.com EscortA.com lEscort.com Tescort.com

    ReplyDelete
  22. security systems for windows TGP Systems designs and supplies complete aluminum and PVC systems for construction industry. We carry a wide range of products both for private housing and commercial projects.

    We are founded, owned and operated by a group of experienced business executives and we work with architects, investors and partner companies in Europe.

    We provide top quality at affordable prices, fast delivery, warranty and professional service.

    ReplyDelete
  23. Lift and slide TGP Systems designs and supplies complete aluminum and PVC systems for construction industry. We carry a wide range of products both for private housing and commercial projects.

    We are founded, owned and operated by a group of experienced business executives and we work with architects, investors and partner companies in Europe.

    We provide top quality at affordable prices, fast delivery, warranty and professional service.

    ReplyDelete
  24. Vending machine Everitt vending, Most premier vending machine business in Singapore with smart technologies for your better vending experience. contact us for machine rental!

    ReplyDelete
  25. This comment has been removed by the author.

    ReplyDelete
  26. Window Replacement Find Professional in Window Manufacturing, supplier and installers. Window Repair, Window Cleaning, Blinds Curtains Drapes, & Shutters.

    ReplyDelete
  27. one pearl bank One Pearl Bank is located within the prime central area of Singapore, at Outram-Chinatown District. When you leave your home, it is just 3 minutes walk to Outram Park MRT Interchange (East-West Line, North-East Line and the upcoming Thomson-East Coast Line) via sheltered walkway.

    ReplyDelete
  28. https://dias-gs.com Dias was created to fulfill the mission of making every person unique and exclusive.
    With the sunglasses that we put up for sale, we believe that they will enhance your life's quality and make it better, prettier and most importantly - easier.
    Dias was established in 2019 by two entrepreneurs that are willing to create an impact over the world.
    Through our unrivaled access to wholesale fashion sunglasses and our bulk online purchasing power, we aim to offer the highest quality shades without the expensive high street price tag.
    We want to make you feel special, As you truly are.

    ReplyDelete
  29. vintage bathing suits Women trust us to design swimsuits that are made for movement and give them the confidence to feel sexy when they're the most exposed.

    ReplyDelete
  30. https://themandelaeffect.us/ When you visit the Site, we automatically collect certain information about your device, including information about your web browser, IP address, time zone, and some of the cookies that are installed on your device. Additionally, as you browse the Site, we collect information about the individual web pages or products that you view, what websites or search terms referred you to the Site, and information about how you interact with the Site. We refer to this automatically-collected information as “Device Information”.

    ReplyDelete
  31. dizimio Son dakika dizi haberleri ve dizi oyunculari hakkinda detayli bilgiler ve gelismeler.

    ReplyDelete
  32. Great job for publishing such a nice article. Your article isn’t only useful but it is additionally really informative. Thank you
    https://www.hardmenstore.com/semenax-review/
    semenax

    ReplyDelete
  33. Wow, Excellent post. This article is really very interesting and effective. I think its must be helpful for us. thanks for sharing your informative.

    Our 3D Showcase is an online experience for buyers to move through a property and see it from any angle. Our distinct tours give homebuyers a completely unique sense of the property.
    We bring listings to life with immersive ...

    experiences that are more than virtual tours. At Realty Showtime our technology completely immerses visitors so they can create an emotional connection.

    We offer the latest real estate marketing technology to get more clients and sell more homes.

    If you've ever used Google Street View, you'll have a pretty good idea already of what Realty Showtime presents. Using 3D imaging technology,

    Realty Showtime allows online visitors to virtually "walk" through a property just like they would virtually "walk" around a city using Google Street View. This is the first piece of real estate technology that really allows users to control how the experience a property when they're looking at it online.

    "The key difference with this technology and what sets it apart from the videos and virtual tours that we are used to is that it allows the viewer a completely immersive, user-controlled walk around the experience of space in its entirety,"

    Get More info Realty Show time

    Contact Info:

    Demetre Politis. Broker/Owner,

    email: djpolitis1@gmail.com.
    email: info@realtyshowtime.com

    Phone:

    Canada +14163009293
    Greece +306944043311


    website: Realty Show time

    ReplyDelete
  34. 1xbet giriş 1xbet Türkiye, online bahis şirketi hakkında giriş ve inceleme bilgileri. Onebahis firması için 2020 güncel yeni giriş adresi, ödemeler ve üyelik işlemleri için detaylı bilgiler, 1xbahis sayfamızda yer almakta.

    ReplyDelete
  35. meal kits Making cooking a little easier. It's hard, it takes time and who's got the time after a long day of work, looking after kids and being on your feet all day ? I bet you don't and neither do I.. making cheap and tasty modern day meal kits the new normal among all the changes going on in our world today.

    ReplyDelete
  36. BUY SPOTIFY PLAYS REAL PLAYS TO BOOST YOUR MUSIC.
    We will promote your tracks and give you very good promotion Buy spotify plays

    ReplyDelete

  37. finance GET UNIQUE INVESTMENT IDEAS FROM AN EXPERIENCED FUND MANAGER TARGETING 5X - 10X+ RETURNS.

    ReplyDelete

  38. Wow. Thank you very much for sharing this informative and useful post.

    We are a brokerage built on unrelenting dedication and authentic experience.

    Our ambition and enthusiasm for Real Estate have been a large factor in our brokerage’s success, however, it is the people that we are truly passionate about. Our mission is to provide you with the Real Estate of your dreams and that's what truly drives us forward.

    More info: Realty Show time

    ReplyDelete
  39. yellow xanax bars
    How long does Xanax stay in your system? The amount of time it takes for the amount of medication to decrease by half in your body is called its half-life. Even though a dose wears off relatively quickly, the half-life of Xanax is about 11 hours. Xanax 2 mg

    ReplyDelete
  40. motherhood CO.MOM is a fun new online magazine and social network community created by moms for moms. Read interesting articles, get advice from our agony aunt, aunt\y anne, learn how to earn an income online with our guru debbie or you can even seek medical advice from our resident physician dr samantha and relax while checking out the latest horoscopes from our trained mystic. Theres even a thriving forum community where moms of the world can get together and enjoy good conversation along with lots of other fun ways to kill some time with a cuppa when taking a break from being super mom at co.mom.

    ReplyDelete