Magento

Magento Error SQLSTATE[28000] [1045] Access denied for user "username"@"localhost" (using password: YES)

May 20, 2011

I have fallen foul of this error a couple of times now and it is tricky to find the correct information online to fix the problem. It seems there are two obvious situations where this error occurs and depending on your version of Magento, or exactly what you did then there are three simple things to check to fix it and get your Magento site back up and running. It is worth mentioning at this point that you can always get back to your system by renaming your local.xml file and hitting your homepage.

Update: Translations Specific To Your Magento Theme

May 19, 2011

I recently wrote an article explaining how to add arbitrary translations to your Magento site using an empty plugin to allow you to attach a translations csv file. You can read the original here: [Custom translations file in Magento][1] Anyway, this is all well and good if you are adding text to your plugin or suite of Magento plugins that need to be translated. Of course, if this is the case then you already have a plugin to put the translations in but hopefully my post explains how that is done.

Setting number of columns on Magento search results

May 12, 2011

I have been recently working on a Magento template that required plenty of changes to the product lists and grids and some way down the line I realised that the search results weren’t playing by the rules. In the catalogsearch layout file an action called addColumnCountLayoutDepend to set the number of columns depending on the template that is being used. Obviously you want to show more columns in the search results if you have the space to do so.

Magento enable cookies displayed when you already have cookies enabled

Apr 28, 2011

This is a strange problem that has cropped up on Magento sites I have been building a couple of times now. There seem to be plenty of people with a similar problem, so I figured it was worth casting it out onto the Internet in the hope somebody might find it useful. This only happens on your dev/test server. Symptom You have been developing your Magento website using Firefox but when you view it in Chrome or Internet Explorer Magento tells you that you need to enable cookies.

Magento: Setting columns and limiting products shown in grid

Apr 15, 2011

I recently started experimenting with creating my own page templates and using the layout update XML to add content into the page. This works well for more complicated page designs and is particularly suitable for the homepage or landing pages. I did hit a minor snag however and that was when I added a product list or grid I couldn’t see how to specify the number of columns the grid should contain.

Add a new Magento CMS Template

Apr 14, 2011

I usually try and stick to the standard Magento templates where possible. The 3 column, 2 column left and right and single column layouts are nicely put together and it gives enough flexibility for most sites. I have recently been dealing with sites with landing pages that follow a single design layout but that are a bit too complicated to build from scratch each time using the single column template. So, I wondered how simple would it be to create my own template file that I can use for CMS pages, with dedicated blocks for different areas of the page.

Magento and PayPal payment doesn’t set Delivery Address

Apr 13, 2011

I came across this minor problem when a client running a Magento website wanted to enable the paypal checkout. Once I enabled paypal express checkout and started to run through some test orders the custom module I had written to export their orders ready for their warehouse/dispatch system had a few problems. The problem is that PayPal doesn’t use the same naming for its addresses as Magento. In Magento the customer is asked for billing and delivery addresses and where they opt to use the same address the details are simply repeated.

Get the title of an order’s payment method in Magento

Apr 8, 2011

I have been writing a magento based site for a client and they have a few requirements for their despatch system that I had not seen before. One of them is to set a flag in their dispatch system indicating the payment method chosen by the customer (seems sensible, I just haven’t had to do it before). Anyway, turns out as it often is with Magento, that this is a really simple thing to do, once you find the information.

Putting products on a Magento CMS page or Homepage

Mar 31, 2011

No matter how many Magento websites I build I never seem to be able to remember the following code snippet to add products onto the homepage or CMS page. I thought I would post, simply so I know where I can quickly find the information – I hope others find it useful as well. The simplest way to do this is to add a widget to the cms page which allows you to specify a category if you need to as well as the template.

Building a website switcher module for Magento

Mar 25, 2011

I recently had to build a module for Magento that let you switch between each of the Magento Websites in the admin. I’ve written a short explanation of how I did this below, along with the code. Create a module First off, you need a name for your company/organisation and a name for your module. Once you decide that you need to create the folders. You will probably want to put your module on the local scope – this is where I do everything, although if you are developing a plugin then people sometimes use the community scope.