Creating a Configurable Product

Customers can select options when they see a configurable product, e.g. colour or size. This is useful when you want them to click on a generic product name and then tailor the product to suit their needs.

The first thing you have to do is create any new attributes you require. After specifying the values for these, you then create a new attribute set. Drag the new attributes into a new group called Selectable Options.

Next, you create the configurable product. Select the new attribute set and then select only the options you wish to include for this product. You can see by doing this that you could have one attribute set per configurable product type, or you could have one configurable product for all products in the shop.

After doing this you can assign simple products to the configurable product by clicking on Associated Products and selecting them. If the simple products don’t appear in the list as expected, then it’s most probable you either haven’t set the attribute scope to Global (required for all configurable product attributes) or you have assigned a different attribute set to the product.

Rule #1: Attributes used in configurable products need to have a global scope.
Rule #2: Simple products assigned to configurable products need to be assigned the same attribute set.

Top Menu (Category) Page Links

At some point you might need to add a link to a page on the top menu bar, the menu bar where the category anchor links appear. The steps are as follows.

  1. Create a new category named after the name of the link.
  2. Go to Url Rewrite Management. Select the newly created category and note down the target path. During setup this was catalog/category/view/id/21. Set Redirect to Permanent (301). Then save.
  3. Next click Add URL Rewrite. Select Custom. Type the name of the page link in the ID Path field. Type the target path copied in (b) to Request Path. Type the URL for the page in the Target Path field. This must be different to the name entered in the category to prevent a circular reference. Last, select Permanent (301) in the Redirect list. Then save.

Adding a Language Pack

The default Magento build comes with the en-US language pack. To install a local language pack you can either use Magento Connect or do it manually. As Magento Connect doesn’t always work it’s often simpler and quicker to do it manually.

A good tutorial is here: but the basic steps are:

  • Grab the translation files
  • Upload them to the appropriate directories as they appear in the download
  • Change you store view locale
  • Delete the cache
  • Refresh the page

Magento Connect Invalid Server Response

The reason for the following error message being shown during an attempt to install an extension in Magento version 1.5 or 1.6 is that the Magento Connect 2.0 extension key needs to be used.

Invalid server response for http://magento-community

When searching for the extension make sure you select the correct version using the dropdown before agreeing to the terms and conditions.


Magento Connect File Permissions

Downloading extensions using the web based Magento Connect manager requires the directories and files to be writable. SSH into the root directory of the Magento installation and execute the following.

find . -type d -exec chmod 777 {} ;

Once complete, reset by issuing the following via SSH when running php as a module.

find . -type f -exec chmod 644 {} ;
find . -type d -exec chmod 755 {} ;
chmod o+w var var/.htaccess includes includes/config.php app/etc
chmod 550 pear
chmod 550 mage #for magento 1.5+
chmod -R o+w media

Instructions are valid for version 1.5 upwards.

Less secure | More secure 


Editing the Magento local.xml

Rather than edit the layout xml files and risk problems during an upgrade, it’s best to use local.xml in your design package default directory. The first use of this file is to prevent blocks from appearing. Simply add the following code with the relevant block listed.

<?xml version="1.0" ?>
   <remove name="left.permanent.callout" /> <!--the dog-->
   <remove name="right.permanent.callout" /> <!--back to school-->
   <remove name="" /> <!--product compare-->
   <remove name="paypal.partner.right.logo" /> <!--paypal logo-->
   <remove name="cart_sidebar" /> <!--cart sidebar-->
   <remove name="left.reports.product.viewed" /> <!--recently viewed prod-->
   <remove name="right.reports.product.viewed" /> <!--recently viewed prod-->
   <remove name="right.reports.product.compared" /> <!--recently compared prod-->

You can find the names of the blocks by viewing the appropriate xml file. To find the xml file, turn on the developer hints and look at the directory listed after the template directory. This is the xml file. Locate this in your base package and note the names of the blocks you want to prevent from appearing.

Here’s an example from

<?xml version="1.0"?>
<layout version="0.1.0">
	<reference name="head">
		<!-- Magento looks in /skin/frontend/<INTERFACE>/<THEME>/js/buyprinting.js for this file -->
		<action method="addItem"><type>skin_js</type><name>js/buyprinting.js</name></action>
		<!-- This removes the item that was set in the page.xml file -->
		<action method="removeItem"><type>skin_js</type><name>js/iehover-fix.js</name></action>
		<!-- Magento looks in /js/prototype/ for this file -->
		<action method="addJs"><name>prototype/</name></action>
		<action method="addCss">
	<reference name="header">
		<!-- This adds a CMS block that can be called from the template file
		associated with the header block. -->
		<block type="cms/block" name="cms_quick_help">
			<action method="setBlockId"><block_id>quick_help</block_id></action>
		<!-- The remove tag removes the blocks with the specified name from the layout -->
		<remove name=""/>
		<remove name="store_language"/>
		<remove name="breadcrumbs"/>
	<reference name="top.nav">
		<remove name="catalog.topnav"/>
	<reference name="left">
		<remove name="left.newsletter"/>
		<remove name="left.permanent.callout"/>
		<remove name="catalogsearch.leftnav"/>
		<!-- When you use the remove tag, it removes any blocks with the specified name from
			the entire layout, regardless of the context. So, if I remove right.newsletter in
			the <default> context and that name is used in say the <catalog_product_view> context,
			then both blocks will be removed.  Because remove operates on the global context,
			you can only remove an element once.  Since <remove name="right.newsletter" /> is
			being called in catalogsearch.xml, we have to unset it, or else we'll get an error.
			The line below only unsets the block from the parent's context, not the global
			layout context -->
		<action method="unsetChild"><name>right.newsletter</name></action>
	<reference name="right">
		<!-- Some blocks have to be removed using remove, others via unsetChild.
			I've not spent the time digging into the code to figure out why -->
		<remove name="right.permanent.callout"/>
		<remove name=""/>
		<remove name="left.reports.product.viewed"/>
		<action method="unsetChild"><name>sale.reorder.sidebar</name></action>
		<action method="unsetChild"><name>wishlist_sidebar</name></action>
		<action method="unsetChild"><name>right.reports.product.viewed</name></action>
		<remove name="cart_sidebar"/>
	<catalog_product_view><!-- 2columns-right -->
		<reference name="root">
			<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
		<reference name="content">
			<reference name="">
				<block type="cms/block" name="cms_product_info_tabs">
					<action method="setBlockId"><block_id>product_info_tabs</block_id></action>
				<block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>
				<action method="unsetChild"><name>tierprices</name></action>
				<action method="unsetChild"><name>addto</name></action>
				<remove name="addto"/>
				<reference name="">
					<action method="unsetChild"><name>product.tierprices</name></action>

Relative URLs in Magento

Rather than hard code urls in static blocks whenever possible you should use the Magento code to generate relative urls. All you need to do is add the following into your anchor tag and change page to the name of the page you want to link to. Magento will do the rest.

<a href="{{store url="page"}}>Page</a>
<a href="{{store direct_url="page.html"}}>Page</a>
<a href="{{store url="page" _query="a=param_a&b=param_b"}}>Page</a>
For more on urls go to:

Magento File Permissions

When installing a new version of Magento it’s necessary to reset the permissions on some directories and files. This explains which to reset for version

The /media and /var directories should be writable at group level and so need to be reset to 755. The /media directory contains web accessible files such as images, while the /var directory is used for temporary files used by the cache and for sessions as well as import/export files. Note that it is only the directories that need to be writable, not the files. You’ll need to do a recursive edit to all directories within these.

Additionally, on doing the installation specific files cropped up as requiring to be writable. Directories change from 755 to 775 and files change from 644 to 664. You need to return these to their original values after installation for security reasons.


To use MagentoConnect for an install write permissions need to be applied to all magento files including the root Magento directory. All files and folders need to be reset to 655 after installation.

Installing from shell is advisable. For instructions go to

Switching Broadband

This is a minefield. There are many companies offering many deals, many of which require considerable analysis to understand how much they cost. While not as impenetrable as the average gas/electricity provider, they do come a close second.

I hadn’t really bothered going through the data since signing up to an 18-month contract with Virgin Media. However, that came to an end last month and being on a 30-day notice rolling contract it makes sense to start seeing what benefit changing provider may bring.

Additionally, a fter having horrendous problems with VirginMedia over the last 8 weeks getting 0.28Mbps on the worst day, and spending well over 6 hours on the phone to them, I managed to get an engineer out who switched the router/modem. All’s well so far but the experience

Being of limited time, I’m not about to wade through price comparison sites and individual providers given. The former rarely tells me all the information I want and also normally servers to confuse, particularly when you don’t know if they have got all providers in there and whether any data is being presented in a less than fair way.

Provider’s sites would help but having spent 2 hours going through one it’s too much effort to go through many more in the same way, when generally the two main providers, BT and Virgin Media pretty much provide the best deals … for what I’m after anyway.

The requirements are simply:

  • 10-20Mbps
  • 40GB minimum usage
  • phone line
  • Standard TV or Freeview

So, I went through BT’s packages and worked out what the deals are. It looks like BT is £5 a month cheaper and with BT Infinity soon to be available in my area the 20Mbps+ speeds will soon be available.

This is taking advantage of the BT TV Essential and Evening & Weekend Calls package (£22/mo plus calls for first 4 months plus setup fee £36) and then moving to More Broadband and Calls with BT Infinity in January 2012 (£27/mo plus calls plus activation fee £25). This does require paying the phone line for the full 12 months (£120 instead of £166.90).

When I put this to Virgin Media their only response was essentially you’ll have to pay more to get the same level. Time to seriously consider jumping ship, unless of course BT horror stories put me off …

Create WordPress Short Code

To create a shortcode for html add the function into functions.php. Then add the style to style.css. Here’s an example:

For functions.php

function codetext_shortcode( $atts, $content = null ) {
   return '<div class="codetext">' . $content . '</div>';
add_shortcode('codetext', 'codetext_shortcode');[/codetext]

For style.css

.codetext {
 font-family: "courier new";
 font-size: 0.8em;
 color: #333;
 padding: 10px 0 20px 0;