Programming

Per product meta robots tag control in Magento

My first Magento related task here at Inchoo was to assist our client to gain control over his meta robots tag on per product basis. In this article I’ll present simple Magento extension designed to do just that. I’ll also show you how to create custom product attribute programmatically trough setup resource installer script and how to retrieve this attribute later on.

Read more

301 redirects vs canonical links in Magento

What can you do to prevent duplicated content of products from different stores?

Recently we’ve received one inquiry to optimize an existing Magento website.
Shortly, there are 2 stores with codes: store1 and store2. Store code is included in the URL.

While we were working on the optimization, the client has reported that some of the products show in both: store1 and store2 but they should be visible only in one of those stores (imagine that you’re on store1 and you see there some related products but from store2).

Read more

Clear the APC cache from Magento admin panel

Since PHP code is interpreted, every time we run a script, PHP has to parse the script and compile it to opcode (operation code) which represents the function of the code. Zend engine then executes that code.
This process can be really slow because every page load requires reading source files from disk and re-compiling them.
APC (Alternative PHP Cache) is open source PHP extension for caching and optimizing PHP intermediate code.

Read more

Super easy universal Magento cache extension

Super easy universal Magento cache extension © GODprod@sxc.hu

Update: I added some cool new features like admin grid and cron job for deleting expired cache data. All the new features are labeled as “NEW!” in this post.

Inchoo Unicache is an extremely simple and useful little extension that you can use to cache any kind of text/string based data in Magento. It uses helpers to make it accessible anywhere: from template files to your own custom code.

Read more

Hunting GPS Maps – Revamped

Hunting GPS Maps offers individuals hunting maps uniquely different from any other products out there. What makes Hunting GPS Maps products unique is the fact that Hunting GPS Maps has taken the time needed to find the best data from the most reliable sources (often as many as 15 sources are used per map); focusing mainly on providing accurate land ownership information (public as well as private).

Read more

Our latest launch from Australia: Australian Gifts Online

Australian Gifts Online is an Australian family business, owned by Paul and Jill Leach who have been selling online since February 2006. Last year, they decided to move their storefront to join the Magento Community. However, since they are constantly moving forward to keep up with the latest e-commerce trends, Paul approached Inchoo Australia’s office in Sydney looking towards improving the overall user experience, Magento design and performance.

Read more

Prevent PO Boxes in shipping address field on Checkout

Prevent PO Boxes in shipping address field on Checkout © jechasteen@sxc.hu

We recently integrated a feature that would prevent users from creating an order with a PO Box in Australia. Since we are already familiar with Australia Post shipping integration (and heavy modifications of it, I might add :)), the first thing that came to mind is to have a look if there’s some API or web interface that can be used to filter out post codes that are linked to PO Boxes. Many high volume addresses and/or PO Boxes in Australia have their own post code, so it looked like an obvious solution. It turns out that it’s not that simple or logical, since there are many edge cases where you can not reliably tell if you should filter the code out or not. There is a guide made by Fontis that shows how to validate the input fields in order to filter out PO Boxes. However, in our case we had some dynamic content loading with Temando shipping method integrated. This guide is intended as a more general solution that is compatible with Checkout page’s dynamic content and third party Shipping methods integration like Temando.

Read more

Enhanced export – collection to a file

Don’t let this tittle mislead you. This post is beginners guide that will explain how Magento’s method getCsvFile() works. We’ll explain some properties and advice you with some tips how to use some of the properties.

Probably you’re familiar with the error: “Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)…”. You’ll probably experience it if you don’t care about performance/memory limit sooner or later. If you want to know how to additionally avoid that error message, keep reading.

Read more

Run methods that are specified in module’s xml file using XPath and Varien_Object

For one client last year we needed to develop some custom ERP. In documentation client specified that they want to run some methods that are “defined” in config.xml using method’s code as a id in time of exporting their orders. Shortly, depending on payment code from order they wanted to add some custom calculation when they are exporting orders. If you are interested how we implemented this keep reading!

Read more

Track validation errors on Magento forms using Google Analytics

Track

A couple of weeks ago one of my colleagues from Inchoo wrote a very nice article about Tracking Onepage Checkout abandonment using Google Analytics. We will go a bit further now and expand the set of data that we are tracking in order to try to pinpoint the exact cause of checkout abandonment, if possible. You will also see that this code is re-usable on any form in frontend, which is something that I’m sure you will find a use for.

Read more

Custom router in Magento

Creating the custom router could be very useful thing when we want to separate some business logic that can be applied on same route (url) without redirecting to different routes inside the controller.

Why don’t we create separate route for different logic and we are done?

Read more