Frontend


How to add an external javascript/css file to Magento?

How to add an external javascript/css file to Magento? © image by mauricesvay left @flickr

Have you ever had a need for adding external files into your Magento layout?
If you had then you know that you cannot do that from your xml layout files using methods/action:

<action method="addJs">
<action method="addCss">
or
<action method="addItem">

You could do that by hard-coding your “head.phtml” file, but then those external files will be loaded on all Magento pages.
This simple extension will provide you easy access for adding/removing external files such as JavaScript or CSS, libraries from remote servers which you cannot or don’t want to put on your server.
I called it Inchoo_Xternal extension.

Read more

Layout of your custom controller in Magento?

Layout of your custom controller in Magento?

When you work with custom (your own) controllers in Magento,
either frontend or backend, you will probably also use existing blocks and models or if needed write your own classes.
But what happens if you want to or have exigency to move/remove common blocks?
Can you really “design” your own page view without touching Cascading Style Sheets?

Read more

Contact Form in Magento

Contact Form in Magento

As you know, Magento has a built-in contact form that can be used for general contacts. That form isn’t part of any CMS page, you cannot edit some introduction text, you cannot add phone numbers administration, and you cannot see the breadcrumbs. If you wish to edit text in that default contact form, you will need to update front-end files. Luckily, there is an alternative.

Read more

Importance of product presentation

Importance of product presentation

We all now that image is everything, especially when you’re selling the product online. There are some obvious facts that need to be taken into concern. This post will include some (IMHO) valuable reminders and a checklist for the shop owners willing to reevaluate their product presentation.

Also, let’s remind ourselves that eCommerce product photography is probably one of the most important steps in “optimizing” the performance of your eCommerce online store.

Read more

Properly remove white image frame upon resizing photos in Magento

Properly remove white image frame upon resizing photos in Magento

Magento has pretty neat image helper you can use to output your product photos. Today one of my coworkers got frustrated with the white frame he kept getting around the resized image he tried to output in sidebar block. As s possible solution he tried resolving the issue with CSS. However, there is a better, more nicer solution to ditch the whit frame around resized images in Magento.

Read more

Blank Magento widget to get you started with Magento widget development

Blank Magento widget to get you started with Magento widget development

Hello inchoo readers. As we are nearing the Christmas time, I felt I could write down some free code and share with you. Yesterday I got all excited seeing Magento 1.4 beta1 available for download. As you can guess, it did not took me long to download and install it. One of the most interesting features, for me, are the widgets.

Read more

Remove SID query from Magento URLs

Remove SID query from Magento URLs

Many people wonder why sometimes the SID part appears in their Magento URLs. This is when your URL has additional SID query usually at the end. Take a look at the image. The curiosity is that it does not appear always. What is the most common scenario it happens? You didn’t access the site with the same domain variant you entered as your “Base URL” in your System> Configuration> Web interface.

Read more

Programatically create Magento blocks and inject them into layout

Programatically create Magento blocks and inject them into layout

Imagine a scenario where you wish to simply create a view file like custom-note.phtml and show this view file on some new url inside the Magento store. One way to do this is to create a CMS page and call that block from within CMS page. But what if you wish to create and append this block to other areas of Magento layout that are inaccessible from CMS page interface form admin? What if I want to add new div element under the breadcrumbs and append new block under it?

Read more

Removing Product Comparison in Magento

Removing Product Comparison in Magento

As many things in Magento, removing product comparison is not available thru the admin interface. Thus, leaving us with the only option of getting down and dirty with theme files editing.

Read more

Custom price filter in Magento

Custom price filter in Magento

Quite a few people have asked me for a price filter functionality that comes with Magento. Mostly, the questions are same: How does one put the price filter anywhere on the page? How does one set it’s on price ranges in that filter? What defines default price ranges. Is it possible to set price filter for all my products instead of just single category? Lot of questions. The answer might be simpler then you might think.

There are two ways to approach this problem. Head trough wall or stop and think approach.

Read more

Designer’s Guide to Magento PDF download

Designer’s Guide to Magento PDF download

After many developed CRE Loaded’s online stores and watching Magento development progress for quite some time, I decided it was time to use Magento with my next client. My starting point for development was official Designer’s guide. I’m the type of guy who likes to have documents nice&clean, so I tried to print it but print was a mess. That’s when I decided to create PDF of the official documentation for easy print. This is probably the best starting tutorial for creating a fresh new Magento template.

Read more