Useful tips for starting a new Magento project
Four Front End Tips
- Identify the package/theme dynamic and make it work for you. In some cases, a witty use of package/themes can allow for creative ways to handle subtle differences your clients want in their sites.
- Don't not use the wrong starting theme. When doing a community project, a blank theme saves a lot of time as it strips out a lot of useless code, a similar trick can be done through Magento.
- Create a unique theme instead of modifying core Magento theme files.
- Always carve with Magento. Magento uses tables in some places, for example. Using a fake, or demo, site to view source and cloning said source as HTML you use when building your own CSS can be very helpful in determining the nuances of Magento earlier.
Four Back End Tips
- Writing code and then forgetting to to the test the page with Full Page Caching on.
- As you extend functionality of a core class, do not overwrite the core class by placing the file in the same relative path on the local code pool/app/code/local/Path to core class/ (for example: app/code/local/Mage/Checkout/Block/EXTENSION_NAME.php). Instead, you should use class rewriting to overwrite. The new class should also inherit the class you wish to extend, instead of copying and pasting the original code into the new class. This will allow for more compatibility and less of a chance of breaking when/if you choose to upgrade to a new Magento version. Furthermore, this makes it a lot easier to resolve module interruptions from third party modules that also rewrite the same class.
- Be aware of the namespaces for custom modules, which in some cases may conflict with the namespaces of core Magento modules.
- Be aware of nested collections. Every collection is a query. Meaning, if you have a collection inside a loop, there is a query inside the loop, too. When this happens, slower speeds will be observed.