Template Path Hints for Admin Panel Magento

Share
Posted on October 12th, 2011 | Posted by admin

Magento has a built in feature called template path hints to identify the path of frontend template files and its block classes. But Sometimes you need to locate the path of adminhtml template files. Recently while searching the magento forum i got this solution. So to enable template hints for the adminhtml. Follow the below step
Step 1: Change the file app/code/core/Mage/Core/etc/system.xml as follows:

Creating Custom log file in magento

Share
Posted on October 12th, 2011 | Posted by admin

Magento has a built in support to write log messages. Sometimes we may Need to include our own log file for debugging our own modules. Because the size of default system.log file is too large and also it is difficult to find a specific entry in such a large file.

we can Create our own custom log file as follows

Step 1: Navigate to Admin System > Configuration > Developer > Log Settings->Enabled. If the logsetting is not enabled change it to enabled.

Step 2: Now we can write our log entries in our custom modules as follows

Mage::log(‘My Custom log Message entry’,null,’mylog.log’);

A new file with the name mylog.log will be created in var/log directory.

Open the file to see your custom log entry.

Magento debugging tips

Share
Posted on October 12th, 2011 | Posted by admin

1. One of the most difficult task in magento is to locate a particular file in recursive folders. Magento provides a setting in the admin panel to find the template files.

To locate any template file location. Enable the template path hints.

magento extension

Log Clean Script for Magento

Share
Posted on October 12th, 2011 | Posted by admin

Magento Keeps track of all logging information in its database. It logs everything that happens in the site i.e visitors information,customers logged in details,URLs visited etc. It has a log cleaning with Cron job setup by default to clear the old entries, but i found in magento forums that the default log cleaning is not working and also the database size increased because of these log entries. I went through the log module to see how the log cleaning and i found an important model class that does the job.

The Log module works based on the configuration in the admin, it keeps track of the log entries for the specified no of days in the admin. The Log entries older than the specified no of days will be deleted by this script.

Note: Please test this script in development environment and then move to production site.

How to change Weight Attribute decimals Magento

Share
Posted on October 6th, 2011 | Posted by admin

There is no simple way to change the decimal numbers in the Weight Attribute in Magento.

And is not a specific solution either.
What can we do?
For example, we can force to all numeric attributes to show with 2 decimals.

Open the attributes.phtml located in:

app/design/frontend/YOUR THEME/template/catalog/product/view/

I changed this: