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 moreMagento 1
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 moreValidate 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 moreInstallation 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 moreAutomatically 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 moreMagento Customer Segments
In Magento Enterprise Edition we have Rich Merchandising Suite which allows you to define customer segments to optimize your marketing initiatives.
Read moreGetting selected simple product id in configurable product on client side.
If you need to get id of selected simple product in configurable product on client side you can do it in many different ways.
Here is simple function how to achieve that with no code modification, new templates or even modules.
Just one Javascript file and layout update.
Adding magento attribute with custom input renderer
This is example which will explain you, how to add new attribute with custom input render. You will be able to modify existing functionality, add javascript, some other option or change default input renderer by your wishes.
Read moreWhat is base64 encoding and how can we benefit from it
What is base64 encoding/decoding and how we can benefit from this representation
Base64 schemes represent binary data in an ASCII string format (English alphabet, common punctuation chars, control chars) by translating it into a base-64 representation.
Read moreMultiple configurable products with options on one page in Magento
Displaying configurable products with options on one page can be problem because Javascript in Magento is setup to work only with one configurable product.
You can write your own Javascript or U can reuse Magento code.
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 moreMagento’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 moreEnhanced Catalog Product Grid – Custom Attribute Filter
Sometimes one needs to have additional filtering criteria inside of a catalog’s product grid. Here is an extension that adds custom product attribute to search filter. You can choose to use any product attribute and it will be shown in the product grid.
Read moreWe 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 moreAutomatically cancel pending orders older than 90 minutes
There are situations where you might with to automatically cancel orders older than 90 minutes. They stay in “pending_payment” state. This usually happen when the customer didn’t complete the checkout due any reason.
Read moreFlat tables in Magento and product collection
You probaly know that Magento uses EAV database structure for categories, products. In some cases this solution is not the best or fastest.
Read moreGuide through Magento’s timezones
I’ll guide you through Magento’s timezone behavior, as I’ve noticed that people tend to get confused in cases when they have 2 or more websites with different timezones. If this is what you are searching for, read on!
Read moreEmulate 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 moreHow 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 moreLayered 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 moreHow 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.
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 moreHow 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 moreConfigurable product modification in Magento
In this article, I’ll give you extension that will change drop down selection (select field) to radio buttons on configurable products in Magento Community edition.
Read moreHow to add an external javascript/css file to Magento?
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.
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 moreMagento PDF invoice with product images extension
Hello everyone, short while after I wrote article Add custom attribute to Magento’s PDF invoice I received quite a number of requests for explanation on how to add products images to PDF invoice. As I had some time, I’ve created an extension that will do just that.
Read moreCreate configuration for your Magento extension
Today I’m going to give you and quick HOW-TO for beginners on how to create simple configuration for your extension inside Magento’s configuration section.
If you’re interested, read on:
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 moreSetup for automatic Magento database backup in Git
Well, any version control system is great, at least in compare with none at all. But what’s happening with your database? Today I’ll show you how to create automated solution for backup and insertion of MySQL database into Git repository.
Read more