Magento Themes and Magento Extensions

magento how to debug code

Posted on January 24th, 2013 | Posted by admin

Though this may not be an accurate method to find solutions to bugs in magento. But i thought of sharing my approach:
1. Use the Developer hints. Enable it bu going to System->Configuration->Advanced->Developer->Debug. After that you will have to change “Current Configuration Scope” to “Default Store View”. This can change if you have a custom store view. Set “Template path hints” and “Add Block names to hints”. This will show that template file and the corresponding block responsible for the view in the frontend. And helps in locating the files and fixing issues.
2. Sometimes you may want to see the logs of the exceptions or the errors occurring. So you can enable them from “Log Settings” on the same page as above. This is really helpful.
3. Please note that if you want to add custom logs, you can do that as well, by using this command.

How to add new column of product list page in admin section of magento

Posted on January 3rd, 2013 | Posted by admin

How to add new column of product list page in admin section of magento.

At first open the following file

I have added new two column in product listing page in admin section. The code which i modified is given below.

Then to go protected function _prepareCollection() method

How to create a custom router in Magento?

Posted on December 11th, 2012 | Posted by admin

How to create a custom router in Magento?

If you want to create a router for your own modules, perform the following steps.

1. open /app/etc/local.xml
2. Insert the following source code between config tag

01 <frontend>
02 <routers>
03 <$name>
04 <use>standard</use>
05 <args>
06 <module>$module_name</module>
07 <frontName>$router</frontName>
08 </args>
09 </$name>
10 </routers>
12 </frontend>

$name = name of your router.
$module_name = name of your module where your router redirects. For example, Moon_Products.
$router = router name.

Magento: How to add an image for a custom widget in the admin wysiwyg

Posted on December 8th, 2012 | Posted by admin

Magento: How to add an image for a custom widget in the admin wysiwyg

This is just a quick How-to, I do not detail how to create a new widget.

All you need to do is add a gif with the correct file name to the following directory:

Now, to name the gif. In you widgets.xml file you set the widget “type”, which is the block class for the widget. Just replace the “/” slash with a double underscore and that is the file name. so if I had a widget with the type set to “custommodule/wigets_customwidget” I just create a gif with the name “custommodule__wigets_customwidget.gif”.

End result:

Magento – How to run Query from magento root file?

Posted on November 16th, 2012 | Posted by admin

In magento some time you need to truncate some tables or you need to find some details using sql query
If you don’t have the database access credentials only ftp access then create the .php file and write some query into that which you want to execute one sample is as below

here I am truncating the table called ‘catalog_product_flat_1′

* Scan Magento local.xml file for connection information

if (file_exists('./app/etc/local.xml')) {

$xml = simplexml_load_file('./app/etc/local.xml');

Page 4 of 22« First...«23456»1020...Last »