0

I am trying to display a custom category on my onepage checkout (info.phtml) in Magento 1.

From the Admin-> Categories-> Manage Categories, I have created the category with the id '349'.

I want this category to display ONLY if it is "active". If Disabled, then the code will not load in the checkout.

Below is the code so far:

<?php
$specificCatID = '349';
$category = mage :: getModel('catalog/category') -> load ($specificCatID);
   if ($category -> getIsActive()){
       ***echo $this->getChildHtml('checkout-promo');***
   }else{
       echo "no";
   }
 ?>

The bold part of the code is where i think i am going wrong, but I cant seem to find anything on the internet that will help me with this.

Can anyone explain to me how to call a category with php in a phtml file?

Any help will be appreciated. Thanks.

  • I will recommend as a first step, create a custom module for that, inside that module you need to declare a layout.xml which will be inserting your "custom category block" inside the info.phtml, I strongly suggest not to put that code inside the info.phtml (Best Practices) :) – Beto Castillo Aug 03 '18 at 20:53
  • ok was hoping it would have been a little easier but I will try this approach. Thanks for your help! – L. Blanchard Aug 07 '18 at 19:44

0 Answers0