Magento: Event Observer with Save before and Save after

Magento has this cool functionality of Event Observer. Magento follows the Observer Design Pattern for its event hooking system. With this Event Observer Hook, additional functionality can be added without modifying the core code. The full list of Magento Event Observer Hooks is present over here:- Magento Event/Observer Hooks Cheat Sheet Magento has been programmed … Read more

Magento: How to run Magento code in an external website?

Suppose you have a Magento shop installed. You also have another php installation in your server (may it be wordpress, joomla, drupal, or any other php code system). Now, you want to get Magento shop data in your external website which is not Magento. So, how to do this? It’s simple. You just need to … Read more

Magento: How to search or filter by multiselect attribute in admin grid?

Suppose you have a multi select attribute and you have displayed it in admin grid. You have displayed the multi select attribute options as selection list. Now, you want to filter/search the grid by the multiselect attribute. The problem here is that the multiselect attribute value is store as comma separated value in database. When … Read more

PHP: Easily create PDF on the fly

Here, I will be writing about two pdf creation PHP Classes. They are FPDF and TCPDF. With these classes, you can quickly, easily and effectively generate PDF files. FPDF is smaller in size compared to TCPDF. But, in functionalities, TCPDF wins. TCPDF has lots of features and functionalities. If you want very advanced features in … Read more

phpThumb(): The best PHP thumbnail image generator

As far as I see, I find phpThumb() as the best of all PHP thumbnail image generator. It has lots of thumbnail generation features. You can create thumbnail in a number of ways with phpThumb(). phpThumb() uses the GD library to create thumbnails from images (JPEG, PNG, GIF, BMP, etc) on the fly. Basic functionality … Read more

Magento: How to get top rated products?

Here, I will be showing you how to get the top/highest rated product. The basic idea for getting the top rated products is fetching all products, looping through them, getting ratings of each product and populating a ratings array. After that sort the array and then slice the array for limiting the number of product … Read more

Using jQuery & AJAX: Populate Selection List

In this tutorial, I will be showing how you can use AJAX with jQuery. From jQuery, you can send values to php page as GET or POST parameters. You can use load() function OR ajax() function of jQuery to accomplish the AJAX functionality. View Demo || Download Code In the example below, I will show … Read more