O'Reilly logo

Magento 1.4 Themes Design by Richard Carter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding JavaScript into your Magento theme: Lightbox-style effects to Magento's product page

A technique you will doubtless find useful when you begin to customize your Magento themes more heavily is the ability to add JavaScript files for use in your store. A good example of this is the addition of Lightbox-style pop-ups for the photographs used on your store's product pages.

Adding a JavaScript file using Magento layout

The first task in adding Lightbox to your Magento store is to include the necessary JavaScript files. Luckily, Magento allows you to do this through layout files.

Tip

Alternate method

You could also copy the base theme's head.phtml file from the /app/design/frontend/base/default/page/html directory into the corresponding directory ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required