Magento 1


Injecting Variables into a Magento CMS static block

Injecting Variables into a Magento CMS static block

In this tutorial i’ll show you how to inject any custom variable you need into a cms static block in place of a {{var variable_name}} tag. You’ve seen this in the email templates if you were working on them (in the matter of fact the model (filter) we’re calling is extending the same filter the email templates are using for injecting the variables).

Read more

How to implement rel=prev and rel=next to Magento’s pagination?

How to implement rel=prev and rel=next to Magento’s pagination?

As most of you know that “When dealing with online stores with a lot of products, pagination on category pages can get really problematic for search engines” like Toni Anicic wrote in his article. I don’t want to repeat his words, but to show you how you can add rel=”prev” and rel=”next” link tag attributes in the head tag for pages, which will boost your SEO. This peace of code is already provided by Magento community, but this is improved version.

Read more

Validate your input, Magento style

Validate your input, Magento style

I’m sure most fo you will agree that Magento’s frontend validation for form input fields is a nice feature. All it takes is for you to add some CSS classes to the input fields and then upon form submission validation is triggered that outputs, by default, red colored messages that point the possible validation failures etc. This validation is done on the client side via Java Script.

Read more

Installation and configuration of local Mail server for Windows (hMail Server)

Installation and configuration of local Mail server for Windows (hMail Server)

This is not exactly Magento related post, but it might be useful when you are setting up a dev environment on your local machine. There are many good and free mail servers out there which are relatively easy to install on your Windows machine, but the problems may occur when you try to configure all the bits and pieces of your system so you can actually use your local mail server for something other than producing system errors 🙂 .

When I started working with PHP a long time ago, I was (naturally) looking for a mail server that could be used on my local machine. For some reason that is now long forgotten, I have decided to use hMail Server (freeware). Since it never failed me, it stayed in my standard set of must-have tools. In this post I’ll try to present a step-by-step manual on how to install and configure your system to use hMail Server.

Read more

Automatically invoice/ship/complete order in Magento

Automatically invoice/ship/complete order in Magento

Various merchants, various demands. Imagine you have a private on site sale or something like that, where your checkout requirements are pretty simply: create invoice / ship and complete the order all at once. For example, you are doing the checkout for bunch of people standing in front of you, paying you money right on the spot. In such scenario overload of manually creating an invoice and shipment can be too much.

Read more

Geocoding Customer Addresses in Magento via Google Maps

Geocoding Customer Addresses in Magento via Google Maps

Geocoding is the process of finding associated geographic coordinates (often expressed as latitude and longitude) from other geographic data, such as street addresses, or zip codes (postal codes)… so says Wikipedia. Geocoding an address is pretty simple if you are using Google Maps API. Since all we do here is Magento, let me show you how easily you can geocode customer address.

Read more

Magento’s “Quote/Order/Invoice” workflow

Magento’s “Quote/Order/Invoice” workflow

The purpose of this article is to shed some light onto the flow of things that happen behind the scene in the process of creating and later invoicing order in Magento. In order to properly code new functionality surrounding order creation process, one must have a solid understanding of that process otherwise you may impose some serious issues on to the system via custom coding around orders.

Read more

We renewed our Magento Silver Partnership Status

We renewed our Magento Silver Partnership Status

Recent acquisition of Magento rattles the cage of Magento community these days. The news brought some level of unsettlement to the souls of Magento developers. Some of them switched the panic mode on and even wondered whether it is time to leave the ship.

However, when the dust settled, people realize that not so much wil change. Most important fact is that X.Commerce will not be a platform. It is just a concept that wraps different solutions and technologies together. Therefore, Magento will stay is quite similar shape and goals as it is. In the light of these events, we renewed our partnership program because we strongly believe Magento is and will be the primal eCommerce platform in years to come.

Read more

Emulate store in Magento

Emulate store in Magento

Magento 1.5 introduced very interesting piece of code that enables easy store emulation when programming, Emulation model a.k.a. Mage_Core_Model_App_Emulation class.

Read more

How to translate form labels in Magento’s Admin Area

How to translate form labels in Magento’s Admin Area

Since Magento has built in functionality for translations, you can ask yourself why Magento doesn’t want to translate my labels… and everything is set up correctly!
For all of you who work on Magento for a while and you didn’t yet needed to translate everything in Magento admin area here is a short “howto” on what you can do:
go to app/code/core/Mage/Adminhtml/Block/Widget/Form.php
and find protected function _setFieldset($attributes, $fieldset, $exclude=array())
Instead of this line

//'label' => $attribute->getFrontend()->getLabel(),
//put this:
'label' => Mage::helper('core')->__($attribute->getFrontend()->getLabel()),

Of course you will not change Magento’s core file in this way 🙂 (more below).

Read more

Layered navigation, but not quite

Layered navigation, but not quite

Recently I got a chance to rewrite Magento’s layered navigation standard functionality. The request was very specific as the client wanted to keep all of the “filters” visible all the time. For example if  you wish to filter your results by Color (let’s say you have yellow, green, red, blue and magenta) products are filtered but the layered navigation displays all filters. This way a costumer can re-filter the products in current category without the need to return to the category view.

Read more

How to add new custom category attribute in Magento

How to add new custom category attribute in Magento

Sometimes you need to extend functionality of Magento categories. There is several ways to do that, I will show you how it can be done.
You can do that by modifying and adding data into some of tables directly, but it can be waste of time if you don’t know what you are doing.
This post will describe how you can add new custom category attribute in your Magento store via sql_setup script.

Read more

Teraflex’s Magento Design featured on the CSS Design Awards

Teraflex’s Magento Design featured on the CSS Design Awards

For those who are still not aware; at Inchoo we handle your store front design with the same care we do your development and transform your online store into an online success. Teraflex is a good example, last Friday we were advised that Teraflex’s storefront design had been nominated for the CSS Design Awards.
Just like when inchoo.net was nominated for the prize; we need your support, vote for Terraflex.biz on cssdesignawards.com

If you want to check out your store’s UX and usability or need design services, feel free to drop us a line!

Read more

How you could serve static content files from your Magento extension folder

How you could serve static content files from your Magento extension folder

As a part of my personal ongoing “unobtrusive Magento extensions” campaign. I will show you another “hack”/approach you can apply in order to squeeze your static files under the main extension folder.

When I say static, I am mainly referring to images, CSS and JavaScript in this case.

For example, imagine you are coding an extension called “Sociable“, which will display several links to various web services like Twitter, GoogleBuzz, etc. Links that you can click and the publish a short message about a product/category on that web service. Something like on the image shown below. Logical question is, where do you store your images?

Read more

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

Logging user/customer actions in Magento

Logging user/customer actions in Magento

Recently I wrote a Magento extension called ActionLogger, inspired (thematically) by the “Logging of Administrator Actions” feature available in Magento Enterprise. ActionLogger is pretty simple extension, working on pretty simple but powerful concept of Magento controllers predispatch action.

All you need to do is to create event observer/observers for “controller_action_predispatch” event. This event is fired on every controller action call.

Read more

Magento code library – Handling files and folders

Magento code library – Handling files and folders

Among most often custom coding tasks are usually those related to some import/export between Magento and other system. Usually existing store owners when switching from their current shop system to Magento want to transfer all of their products, orders, and most importantly customers.

Most of the time, standard Magento product/customer import/export is not sufficient for the task at hand. Limitations like file size upload and structure of original data require you to do a custom scripts that will handle the job of data transfer. Think of shops with several tens of thousands of orders, customers, products.

Read more