Magento Enterprise Edition has an option that can use the Apache Solr for the indexing and searching engine. For English searching is working like a charm, however, not working well with UTF8 encoding like Traditional Chinese.

I’ve found that it is because the class “Apache_Solr_Service” sends the search request to Solr with the content-type “application/x-www-form-urlencoded”. This content type doesn’t specific the charset is UTF8, and sends the wrong encoded search text to Solr. At the end, for sure that unexpected result will be returned.

It’s very easy to fix this problem. First copy the file “lib/Apache/Solr/Service.php” to “app/code/local/Apache/Solr/Service.php”, then modify “app/code/local/Apache/Solr/Service.php” line 968 from:

You should face to data validation when you do some customize development in Magento. The frontend validation is using class element combined with the magic of prototype in “js/prototype/validation.js”. Backend validation simply calls Zend_Validate in every Model->validate() method. Inchoo posted a article about validation which can give you a draft idea about them.

If you have more than 10000 records, it spends too much time by additional SQL query and increase server loading. Actually you can join the inventory table when you are getting the collection as below codes:

Recently my company’s shopping cart which using Virtuemart with Joomla needs to change the payment gateway from Pay Dollar to MIGS. I’ve made MIGS payment gateway using “Server Hosted” method for Magento two years ago but no idea how to implement payment gateway for Virtuemart. I’ve searched in Google but only find “Merchant Hosted” codes, but not “Server Hosted” which my company preferred. So I decided to use some implemented codes and modified it.

I’ve downloaded the zip file from Tony Milne website and modified the codes which refer to PayPal payment gateway in Virtuemart. It’s done now and the payment gateway work perfectly. Here I would like to share the codes to everyone. Please free feel to use or modify the codes together with Tony Milne’s license.