Tips

Enhanced export – collection to a file

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

Tracing Magento from “Export CSV” to “Save File – OK” button

Tracing Magento from “Export CSV” to “Save File – OK” button

First of all, this post is beginners guide about tracing in Magento. I’ve created 2 parts. First one is about how to find important parts in Magento core app – I decided to explain exporting collections to CSV (this requirement you’ll need on almost every project) and in second part we’ll go through Magento getCsvFile() method and explain some properties there. This first one is basic and I’ll lead you through steps “how to trace” steps from exporting to download process in Magento. If you’re already familiar with steps that we’ll do feel free to skip this post and jump to Part 2.
If you’re relatively new to Magento and you are not so familiar how grid containers works in Magento and where is placed Export to: CSV Export button keep reading.

Read more

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

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

New way to search through Magento administration grids – using *s

New way to search through Magento administration grids – using *s © hugoslv@sxc.hu

Why Magento can’t use indexes on columns in admin grid when you are searching for some value e.g. order#?

This article will be really short but extremely useful in case if you have a Magento website that have “several” administrators. I’ve worked on project that have more than 2.000 administrators with different roles (that number constantly grows). You probably can imagine how slow things can be when lots of administrators use administration, specially when they are searching or sorting some data (order# or first_name, etc.).

Read more

Print message in all languages using single store, date on specified localization

Print message in all languages using single store, date on specified localization

Did you maybe try to print one message in “all” languages on a single page?

First, let me tell you when I needed to do that. Recently I needed to develop functionality that will send some “custom” emails. You already know that we can set transactional emails for each website / store view and have those emails translated in administration/db. Challenge in my case was that I needed to translate some “random” sentences in one transactional email so using predefined email template wasn’t possible. Sure that we can inject variables and/or objects into email templates, but that didn’t help in my case.

If you have installed any version of Magento community edition >= 1.4.2.0 we can start with our translate module.

Read more

Using Magento >= 1.6 data install scripts

Using Magento >= 1.6 data install scripts

As of Magento version 1.6, you can split the database structure and the data insertion with the new data setup scripts. The data scripts will work about the same way as your sql install scripts and have the same versioning conventions like the normal ones you are used to.

Read more

Enhance Magento 404 page

Enhance Magento 404 page

Magento default installation already has a predefined custom 404 page (no-route). But is it enough to help visitor/customer get back on right track!?. Let’s look over a few examples of custom designed 404 pages. http://centar-alata.hr/404, https://github.com/404, http://www.bluedaniel.com/404, http://www.casino-lemonade.com/404/ – as you can see, it can be funny, creative or you can take advantage of this “case” and try to engage potential customer. Here are a few quick and dirty ideas on how to reuse custom 404 page in Magento and try to serve specific content on it.

Read more

Quickly check if Magento core files are modified

Quickly check if Magento core files are modified

It is quite often scenario that clients are running Magento websites and are not aware that their core Magento core files are modified. Desecrating Magento core files is punishable by death. So here is a little tip on how to quickly scan the core and see if someone needs to be hanged publicly or not:

Read more