Monthly Archive:: November 2013

Add a product link in admin order view

Many times it would be convenient to be able to quickly check a product on the frontend while we’re viewing the order detail in the backend order view. There are many ways to accomplish this, such as adding new columns to the order item grid etc but here’s a quick and simple way to accomplish

Add a “no follow” tag to layered navigation links

If you have a lot of categories and/or subcategories, it doesn’t make a lot of sense to have the search engine robots index and follow all your layered navigation links. While you might think it would be great to have so many extra pages indexed, you’re really only creating hundreds or thousands of duplicate content

Add inventory data to the product flat files

The product flat file (ie catalog_product_flat_1) is a great method to retrieve information about active items in your Magento store. Unfortunately it only includes item attributes that you’ve defined as being available on the frontend and doesn’t have any inventory information such as qty, is_in_stock etc. Wouldn’t it be great if we could combine “catalog_product_flat_1” and

Deleting old, unused product images

If you run a site that has a lot of products or you make changes to images frequently,  over time your directories will be cluttered with old, unused images that are just taking up space. Luckily, Magento Connect has an extension called “Image Clean” that I would highly recommend installing. It was one of the

Add an onfocus event to the search box

If you’re searching multiple times in your shop, it can become a nuisance to continually highlight your original search text to replace it with the new text. By adding a javascript onfocus event to the mini search box, whenever someone clicks in the box, the previous text will automatically be cleared out.

Create a zip file in the Magento export folder

If you haven’t done so already, it’s a good idea to create a separate, password protected directory outside of the Magento structure where you can keep misc scripts that are not part of the Magento hierarchy. Here’s a snippet that will create a zip archive of a file and remove the original path before it

Remove tags from a string and then remove whitespace

There are many times when we need to create a product feed etc that doesn’t contain any html tags in the new string. strip_tags can clear out the tags but leaves your string unreadable in many instances. Here’s a quick way to remove any tag and then remove the whitespace that remains so that your

Show first/last page number on pagination links

If you’ve noticed that your pagination links at the top or bottom of the list page (for categories, search results etc) show only a certain number of links depending on what page you’re on but don’t show a first or last page reference, change the following parameter:

Change the qty box to ‘1’ instead of blank in ‘add to cart’

I’ve noticed a lot of Magento sites have a blank in the qty field for ‘add to cart’ on the product page. If a customer clicks the add to cart button, the intended qty (1) gets added to the cart but a lot of customers get confused and think they have to manually enter this

Always display the current year in the copyright footer

Rather than having to remember to change the copyright year whenever a new year starts, simply add the following  javascript in the copyright box in the footer. admin-system-configuration-design-footer