Working with Magento for the first time gave me a chance to come to grips with the many different aspects of web development and integrating those together, while at the same time learning important lessons as to how eCommerce sites are structured. Magento is also a large, complex, and very powerful set-up. Despite the enormous advantages and learning opportunities that the platform offers, it also presents a series of challenges for new developers. I would like to share two of the biggest challenges with Magento that I have encountered in my experience as a new developer.
1. The Magento File Layout
As a new developer, one of the challenges I’ve encountered was wrapping my head around the layout for all the files. Understanding the file structure is key to most basic levels of troubleshooting in any programming situation. Magento has over 30,000 files, unfortunately, it can be initially difficult coming to terms with.
Once I understood the file layout, I began to realize that it has some great advantages. The file system allows you to quickly navigate the content and see which files/functions have been made, redone or overwritten. This allows you to find problems and solutions more effectively. For example; When trying to find out why a product page is not working correctly, the first place to start would be app/design/frontend/enterprise/theme/template/catalog/product. This folder will have your product view phtml files which make up your product page.
2. Rewriting Modules & Blocks
Another significant challenge new developers may encounter is doing basic rewrites of modules. There are some things to take into consideration when rewriting modules/blocks:
Ensuring the new module has the appropriate position in the file structure, within the appropriate directory.
The new module must have a config.xml file to indicate which block of code to rewrite. This file will be located in /etc directory of the new modules directory.
Your new file usually extends the core file.
You must create a new xml file within your app/etc/modules directory to indicate to Magento where the rewrite is located.
This may not seem like a lot, but my suggestion for new developers would be to carefully go through any of the great Magento tutorials online or read Magento PHP Developer’s Guide by Allan MacGregor. Rewriting can be tricky at first and you have to be accurate and complete in order to achieve success.
Once you’ve got the hang of rewriting modules, you now have the ability to customize specific aspects of your site’s functionality. This is incredibly important because you can change the function of any given block of code without changing the original file that it is associated with. You don’t have to worry about losing core functionality or redundantly rewriting code that has already been done by Magento.
Looking Forward to the Future:
There are many more challenges coming my way developing in Magento. I have not yet delved into its mighty depths, but as I learn more about it, I realize how powerful this platform is and the more excited I am about working with it in the future.