Magento

Custom Magento error page

by Chris Norton in Magento

Sometimes, the unthinkable happens and an error occurs in your Magento system, causing everything to come grinding to a halt. Magento handles this by displaying a styled error page, which is better looking than a white page full of error text. However, the error page still doesn't look very professional, and potentially discloses information that could be abused by a malicious user. This post details a method for using a custom error page, and outlines some of the benefits of doing so.

Read More

Preventing PO Box shipping addresses

by Denis Margetic in Magento

Recently, I wrote a blog post about preventing PO box customer addresses being registered at checkout. Following on from that post, I was asked a rather sensible question: "is it possible to disallow PO boxes for shipping, but allow them for billing?" The answer is yes, but it does require a few more modifications to Magento. As mentioned in the original post, the if statements with regular expressions required to block PO boxes and locked bags are as follows:

Read More

Magento CMS static blocks

by Peter Spiller in Magento

Static blocks in Magento are a useful way of making elements of your site easily configurable by administrators. If you have sidebar blocks, headers or other elements that can change from time to time, using a static block can be easier in the long run than hard-coding them. Static blocks are very simple to create. In the admin backend, just go to the CMS menu and select Static Blocks. Click on the Add New Block button to create a new block.

Read More

Magento on the Mac

by Denis Margetic in Magento

Magento is a web-based application, and therefore Magento development is thankfully not limited to any particular platform or operating system. As a Mac user I prefer to do my Magento development on my Mac. In setting up my development environment, I discovered that there are very few useful resources out there for other developers looking to do the same. So hopefully this post will serve as a start for others looking to do the same.

Read More

Debugging Magento with Xdebug

by Peter Spiller in Magento

Diagnostic print_r statements and logging might be quick and easy tools for investigating what Magento is doing, but a full debugger offers a lot more power and flexibility. This post demonstrates how to set up the xdebug debugger for use with the vim editor. First of all, I'd like to thank Box.net for their great Xdebug tutorial. Check it out for a more in-depth look at using Xdebug and vim.

Read More

Customised Magento review summary

by Denis Margetic in Magento

There is little doubt that product reviews are popular with online shoppers, and are playing an increasingly important role in purchasers' buying decisions. Magento includes a solid feature set for implementing product reviews and can show them on various pages that include product listings. You may find that you want to customise the way these reviews are displayed, but the best way to do this may not be immediately obvious.

Read More

Magento debugging - loading blocks, layouts and config files

by Peter Spiller in Magento

Occasionally I've needed to take a closer look at exactly which block, layout or config file is being loaded by Magento. In this post I will demonstrate a "brute force" approach to checking exactly what is being processed. Please note: Where possible, we will be using Magento's logging, the output of which will be written to the file var/log/system.log, which also includes the rest of the system logging output. Logging must be enabled for output to be written to this file - you can enable logging in the Magento admin panel by going to System → Configuration → Developer → Log Settings and setting Enabled to True.

Read More

Definitive Magento installation guide

by Denis Margetic in Magento

While getting started with Magento some time ago, I thought it would be a good idea to write a post that started at the beginning: how to install it. Reading through the Magento forums, I get the impression that Magento users have extremely varied levels of web development and systems administration experience. That raises the question of the amount of detail to include in a post aimed at Magento newcomers, since experienced web developers will need only the important steps, whilst those new to web development will prefer more info.

Read More

API product IDs vs SKUs

by Peter Spiller in Magento

The Magento web services API is quite flexible - a lot of the time, it can either take an ID (like a product ID) or a more human-readable identifier (like a product SKU). Unfortunately, the downside of this is that in certain circumstances these can be mixed up, in which case the the wrong product will be affected. In theory, to fetch information on a product based on its ID, the catalog_product.

Read More

Web services API filter operators

by Peter Spiller in Magento

Many of the Magento web services API methods facilitate listing certain types of data - customers, products, orders, etc. However, when using these methods we rarely want to retrieve every record. Luckily there are a number of filter operators that can be used to narrow the result set that will be returned. The following is a basic example of how to get a list of all customers in PHP:

Read More