5 Mistakes that Magento developers should avoid

Its a known fact that Magento, one of the popular e-commerce platform, is preferred by majority of online retailers across the world. Through numerous Magento projects, I have found the following to be some of the most common mistakes that developers make while building an e-commerce store.

Modifying Magento core files: Generally developers are given a short timeline to build or customize a Magento store. As a result few developers attempt to modify Magento core files as a quick solution to customer customization requirements. This type of patchwork development will have long term effects on the e-commerce website, since it will interfere with future Magento upgrades. One should always keep Magento core files protected for future upgrades.

The best way to modify core files is to create a copy of the same folder structure in a local module folder as shown on the example below:

Test module with full page cache: We find that after creating a custom module or installing any type of third party Magento module, developers choose to test a full page with caching disabled. Most developers switch off caching while developing a custom module. Yet it is essential for a developer to keep full page caching enabled when a module is created or customized.

Redundant data set utilization: A common mistake made by inexperienced Magento developers is to retrieve the complete collection of data, when only a limited number of items are required.

Queries inside a loop: We frequently find that developers load Magento models in a loop. Below is an example of how a developer will duplicate the collection of product ID’s.

1

2

3

4

foreach($this-&gt;getProductIds()as$productId){

$product=Mage::getModel(‘catalog/product’)-&gt;load($productId);

$this-&gt;processProduct($product);

}

Since Magento uses EAV model to retrieve results from the database, the number of heavy queries creates a performance bottleneck. Instead of loading products in loop, a Magento data collection can assist loading a set of models in an efficient way.

Admin router: On numerous occasions developers copy and paste standard XML from the internet and create a module that ends up receiving errors. For example, if your module doesn’t require an admin router, then you should not leave the admin router in the folder. The steps described above have to be followed whenever a new custom module is created or installed.

Among a lot of pitfalls that developers get into while building a Magento store, these are some of the common mistakes that happen. Avoiding these flaws would help a lot in improving the performance of the Magento store and thereby improving the revenue of the company.

DCKAP is an Enterprise Magento Implementation provider with extensive experience in customizing and building modules on the Magento e-commerce platform. We are attending the Magento Live conference in London next week (July 14 & 15). You can reach us at info@dckap.com or 1-877-872-3252

Be the first to Know

Written By

Anees has around 10 years of experience in Web development and a Certified Magento Solution Specialist.
Expertise in bridging the gap between Business needs and Technical Solutions. Delivered many e-commerce websites including Magento Enterprise for various clients.