Magento Robots.txt File

The robots.txt file on your website can help you say what gets indexed, crawled and used by the search engines. It is a vital part of your website which is often overlooked. Full details on the robots.txt file can be found on the wiki page @ http://en.wikipedia.org/wiki/Robots_exclusion_standard however below I have listed the most helpful […]



Get Customer Group from Session

Using the customer group is a good way to restrict and change parts of your Magento store when a customer is logged in. A good example of this is if you are wanting to put restrictions in or show alternative banners based on a Wholesaler customer login. To get the customer group id from the […]



Call a template from a Static Block

Recently I was searching for how to do this and all I could find was how to put a static block into your template file, however here is how to go the other way and pull a .phtml template file into a static block:

Simply replace the block type, block id and the template […]



Adding Custom Category Attributes

Through some recent work in the office we were required to add custom attributes to allow extra data entry via the category manager in the Magento admin area. We achived this by adding attributes in the SQL setup file from a custom module. Some examples of how to add these category attributes are shown below: […]



Get table name with prefix

When writing database queries in modules for Magento it is often helpful to wrap the table names in a core function called “getTableName” this function will then prefix the table name if the install is using prefixes in the database. To do this:



Delete All Test Orders via MySQL

Hey all, many of you have asked how to quickly truncate the correct Magento database tables to remove test orders or old website orders. The following SQL code has been tested on Magento 1.4 and above. Please be aware that this code, when ran, will permanently delete all the orders and quotes in your Magento […]



Quickly turn on PHP error reporting.

Some server environments by default do not have PHP error reporting turned on. If you have cPanel access or access to the PHP config on the server then you can switch the value and turn error reporting on, however this is not always practical/possible. Therefore here is a quick and easy way to turn error […]