1. Home
  2. Prices
  3. Guided Tour
  4. New Shop
  5. Shop Review
  6. Ecommerce Marketing
  7. Ecommerce TV
  8. Magento Developers
  9. Portfolio
  10. Blog
  11. Contact

Author Profile

Author Archive

Optimise Magento CSS & JavaScript Links

Posted on: 5th Aug 2010 By: Adam Moss No Comments

Things in life are much better when they’re local. A local supermarket is better than one 10 miles away. A local pub is even better than that. These values should also be applied to Magento websites, though I wouldn’t recommend building websites in the pub… Following on from Luci’s excellent post about making the CSS and JavaScript links local, I’d like to show an alternative which does exactly the same thing. Why you ask? Only a very small reason I answer. Running a str_replace command on a file that is loaded directly on the frontend by the server will slow the load time, though only fractionally. The way round it is to carry out the hacks at an earlier stage, deep in the murky depths of the Magento core PHP…

1. Find the file: app > code > core > Mage > Page > Block > Html > Head.php

2. Copy this file into your local directory (app > code > local > Mage > Page > Block > Html > Head.php)

This local file will now be given priority over the core file. Remember to never change core files!

3. Open this file and go to line 248. Remember this line number may change in future versions, anyway you’re looking for this line of code:

$items[$params][] = $mergeCallback ? Mage::getBaseDir() . DS . 'js' . DS . $name : $baseJsUrl . $name;

Simply change the part where it says $baseJsUrl to ‘/js/’, so your new line of code will look like this:

$items[$params][] = $mergeCallback ? Mage::getBaseDir() . DS . 'js' . DS . $name : '/js/' . $name;

4. Now shoot your way up to line 220, time to reposition our str_replace. Find the line which looks like this:

return $html;

Just wrap the str_replace around the html variable, which is responsible for bolting your domain URL onto the front of your CSS links. Notice how I put the src=\” part in front of the url? This mean that it won’t mess up the canonical links tag. Then it will look something like this:

return str_replace("src=\"http://www.domain.co.uk/", "src=\"/", $html);

Regardless of which method you use, you’ll be left with links in your header that are much shorter and neater thus improving your website’s overall SEO. Thanks for reading the Magento blog at Ecommerce Web Design. If this blog post has helped, or there’s something you’d do differently, let us know by posting a comment below!

Categories: Magento SEO Tags:

The Amazon Kindle

Posted on: 2nd Aug 2010 By: Adam Moss No Comments

KindleOn the day where Amazon have dedicated virtually their entire homepage in homage to the latest version of it’s Kindle device, I thought it is perhaps appropriate to draw attention to this impressive piece of hardware. No doubt Apple’s iPhone and iPad have turned up the heat on Amazon’s development of the Kindle, and as such the new release comes with a host of new features:

  1. Enormous battery life of 1 month
  2. High contrast screen (50% better than other E-readers according to Amazon)
  3. Lighter, slimmer design
  4. Built in WiFi – download books within a minute!
  5. Huge storage capacity (Amazon reckons 3,500 books (though no-one should be reading that much!))
  6. Re-download for free anytime
  7. No-glare screen

Certainly, designed as a unit that is made for reading books, this is definitely the better choice of hardware for e-book reading, and it really is great-looking. I’m never shy in praising Amazon for their fantastic ecommerce website design, and I also have no problem praising their Kindle device. Especially due to its fairly reasonable price of just £109 for the WiFi enabled version. Looks like Amazon have re-kindled the e-book flame! Sorry, and thanks for reading the Magento Blog.

Categories: Amazon, Industry News Tags:

Custom Export Profiles

Posted on: 30th Jul 2010 By: Adam Moss No Comments

You’ve just exported your Magento products to a csv file and opened it up in Open Office or Excel to find that all the commas that once separated the different categories that each product is a part of have disappeared. You’re left with one, long number that if uploaded will mess up the very existence of your shop. That’s where creating your own export profile comes in handy, because you can simply tell it not to export categories – and just focus on the attributes that matter.

In my example I’m going to create an export profile and import profile that doesn’t include categories. Let’s pretend that I need to create a quick profile that allows me to change the prices of some of my products. Instead of exporting every detail down to the meta description field, I’ll create a new profile:

1. Go to System > Import/Export > Profiles

2. Click on the button in the top right corner which says ‘Add new Profile

3. Now you need to configure your profile so that it exports successfully as a csv, into the correct place with the correct data. The image below shows how this should be basically configured.

Export Profile

The important part is the section which says ‘Field Mapping’. Simply change it to ‘Only Mapped Fields’ and begin adding field mapping. The only details I need are the product SKU and the price. This will connect all price changes to the correct product. I’m going to export the product name too so that it’s easier to read in the spreadsheet.

Once all the settings have been configured, click on ‘Save Profile‘ in the top right corner.

4. Once saved you’ll see that the profile has saved itself as profile number 7 on the Export / IMport Profile overview page. Click on this profile and click the tab which says ‘Run Profile’, then the button ‘Run Profile In Popup‘. If you have configured it the way I have, the csv file will appear in your var/export folder on your server.

5. If you open it up, it should be the cleanest-looking product spreadsheet you’ve ever seen – rather like the one below:

Spreadsheet

6. Once you’ve made your changes, simply import the products using the existing ‘Import All Products’ profile. Simple!

Thanks for reading the Magento Blog at Ecommerce Website Design. Now, if only I could export that damn fox to a different country!

Categories: Magento Tutorials Tags:

Subcategories Within Categories

Posted on: 19th Jul 2010 By: Adam Moss 1 Comment

I did a tutorial ages ago about how to import the subcategories of a product within another category via a static block. The details were shady and the logic was sketchy in those days, now I can look upon it with a sense of absolute knowledge and appreciation. Before digressing uncontrollably, let me get straight to the point.

Subcategories

1. Create a page called subcategory.phtml in the following folder: app/design/frontend/base/default/template/catalog/navigation/ and use the following code:

<?php $_categories = $this->getCurrentChildCategories(); ?>
<?php foreach ($_categories as $_category): ?>
<?php if($_category->getIsActive()): ?>
<a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>"><?php echo $this->htmlEscape($_category->getName()) ?></a>
<?php endif; ?>
<?php endforeach; ?>

This is the code represented as simply as possible, it will produce a list of links that are contained within that category, you’re free to style this as you wish.

2. Create a static block called Subcategories and enter the following code into the content:

{{block type="catalog/navigation"  template="catalog/navigation/subcategory.phtml"}}

3. Now go to the category which you’d like to use to show the subcategories and ensure that it is not set as an anchor. In the Display options tab, set it to show as ‘Static Block Only’ and choose the block ‘Subcategories’.

Add Subcategory Image

If you want to take it one step further and show the image of the subcategory to make it more visual, you need to make a simple hack and add a bit of code to the original code in subcategory.phtml.

1. Firstly open app\code\core\Mage\Catalog\Block\Navigation.php, copy all the contents and create a new file locally. So that would be: app\code\local\Mage\Catalog\Block\Navigation.php

2. Look for a function on line 93 called getCurrentChildCategories() and comment out the function, replacing it with the following:

$layer = Mage::getSingleton('catalog/layer');
$category   = $layer->getCurrentCategory();
/* @var $category Mage_Catalog_Model_Category */
$collection = Mage::getModel('catalog/category')->getCollection();
/* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */
$collection->addAttributeToSelect('url_key')
->addAttributeToSelect('name')
->addAttributeToSelect('is_anchor')
->addAttributeToSelect('image')
->addAttributeToFilter('is_active', 1)
->addIdFilter($category->getChildren())
->setOrder('position', 'ASC')
->joinUrlRewrite()
->load();

$productCollection = Mage::getResourceModel('catalog/product_collection');
$layer->prepareProductCollection($productCollection);
$productCollection->addCountToCategories($collection);
return $collection;

Save and upload this file. When a local file is uploaded, it is used instead of the core file.

3. Enter the following code into the subcategory.phtml file that we created in the first part of the tutorial. Make sure it occurs within the foreach statement and inside the getIsActive() check:

<img src="<?php echo $_category->getImageUrl() ?>" width="90" height="90" alt="<?php echo $this->htmlEscape($_category->getName()) ?>" />

You can now visually display your category’s subcategories in a very simple way. Keep checking back for more of our Magento Tutorials here at Ecommerce Web Design.

Categories: Magento Tutorials Tags:

Blog Software for Magento

Posted on: 15th Jul 2010 By: Adam Moss No Comments

At Ecommerce Web Design, we’re big fans of using Wordpress as blogging software which can be installed alongside Magento seamlessly, and provide a clean, open-source blogging solution. It’s free, easy to install, accessible and literally bursting with plugins.

However if you want another solution which integrates into the same backend as the Magento one, I’d recommend the Aheadworks Free Blog extension. It comes with large amounts of customisation, SEO-friendly links and pretty much all the standard features that you’d find with Wordpress – you can even enable RSS feeds with it too. There’s categories, comments, users and a nice TinyMCE editor to write your post with.

Blog

Aheadworks make a great range of quality extensions, most of which they sell for reasonable prices. The best thing about the Magento Blog is that it’s completely free to download and use – I guess it would have to be to compete with Wordpress.

So which one would I recommend? Well, I do think that Wordpress is not only the best blogging tool on the Internet, but it’s also possibly one of the best CMS systems available anywhere. This very blog is written in Wordpress and the possibilities are endless. However if you’re after a simple, no-fuss and manageable solution and want to keep everything in one place, I would absolutely put forward the Aheadworks solution. But Wordpress will always be king I’m sure…

Categories: Magento Tags: