How to get child categories under parent one
Posted Date: January 13, 2011You can use the following code to get child categories under parent one:

Activecodewar was founded by Shahid Mehmood. I am the owner of this blog and working as web developer from last 6 years. I have started to work on magento back in June 2009 and found it very interesting tool to build ecommerce websites. As you will know (if you are magento developer) that it's not easy tool to use, only PHP is not enough to understand it, you need to have full understanding of magento as well.
You can use the following code to get child categories under parent one:
Step 1:
Change the following file to remove the decimal points:
Lib/Zend/Currency.php
In the “toCurrency” function add the following line:
$options['precision'] = 0;
Step 2:
Change the following price to round the price:
app/code/core/Mage/Core/Model/Store.php
Change the method “roundPrice” to the round the prices in product listing and view pages like this:
return round(ceil($price), 0);
Please let me know if you have any questions
Use the following code to get the magento image url:
echo $this->getSkinUrl(’images/flag.jpg’);
if $this object is not available then you can use the following code to get the image path:
echo Mage::getDesign()->getSkinUrl(’images/flag.jpg’);
Have you ever forget the Magento admin password and wanted to reset?
I was looking the way to create Free Shipping promotion code and came to know that there is no way in magento. I searched and found the very nice solution, which may help someone else as well.
So, I searched and found the very good solution to create the promotion code which can work just like any other promotion code, but for that you need to modify your code.
You can get the store id, store code, store name, website id etc. through following ways:
Get store data
Mage::app()->getStore();
Store Id
Mage::app()->getStore()->getStoreId();
Store code
Mage::app()->getStore()->getCode();
Website Id
Mage::app()->getStore()->getWebsiteId();
Store Name
Mage::app()->getStore()->getName();
Is Active
Mage::app()->getStore()->getIsActive();
Store Home Url
Mage::app()->getStore()->getHomeUrl();
I just managed to find some time to write a small module which will help you if you want to add quantity text box on your catalog / product listing page.
As lot of users were asking about it, so I thought it would be very good to share it with other users.
So, let’s do it [...]
Yesterday I was trying to find out that how to run magento outside platform and found out very nice little code and also how you can get the query of product collection or any other table using the following code:
<?php
getCollection();
$collection->addAttributeToSelect(’status’);
$collection->addAttributeToSelect(’orig_price’);
echo $collection->getSelect(); // This line will print the query for the above collection
?>
Hope this code [...]
I was just working on the Sales module to override block and model classes.
I though it would be very good to share it with others as well.
Most of the time I face a problem to add a attribute to all attribute sets…Which is very time consuming job.
So, I wrote a little script which can help you a lot to add a attribute to all attribute sets immediately, just run the following sql command and you are done
INSERT INTO `eav_entity_attribute` [...]