tags:

views:

49

answers:

2

hi, How is working with Magento when it comes to adding custom functionality?

From an outsiders view the framework looks very complicated and it's hard to gage what is and is not possible. What are your experiences? Is it a difficult framework to get it to do what you want? Are there things that simply cannot be customized in Magento? How difficult is it to manage customizations when upgrading to latest versions,etc..

Any feedback/personal experiences would be great. Examples of highly customized Magento sites would be great too. Thanks for your help.

+1  A: 

The fast answer is it depends. If you want to add functionality that Magento has accounte for, such as a new payment method, it's not difficult to extend Magento. There are simple hooks specified in XML that will allow you to manipulate those kinds of things.

When it comes to adding new functionality, it may also be simple. Creating a new controller and displaying templates you create for pages is not too difficult once you get the hang of the framework.

There are two places, though, where you are likely to get into trouble programming for Magento. The first is when you are trying to modify core behavior of the system. Trying to put additional data on items in the shopping cart, for instance, is not a simple thing to do, or creating bundles of products on the fly. It's almost impossible to estimate these tasks as seemingly unrelated parts of the framework come into play only after you've hacked things into place.

The second place is where you have to modify very core sections of Magento code (there's a difference between this and the above, I promise). The crux of the issue is that all the "clean" ways of modifying code to fit your needs fail when you try to modify something very fundamental in Magento, and the dirty ways will result in huge headaches down the road (e.g. you cannot cleanly upgrade your site).

That's a simplification of the situation, but from what I gather it's the opinion of many other Magento coders as well. Hope that helps! Joe

Joseph Mastey
Thanks for the feedback Joe! Do you usually find that you can eventually get it behave like you want? Or do you run into things that just cannot be done without hacking everything apart?
ohsnapy
There are cases of both, and you won't always know which is which. For example, while trying to build a simple utility to read the local site URL from an XML file (rather than the database, so that I can use development environments more effectively), it became apparent that Magento wouldn't allow this in any sane way. That said, with enough hacking all things are possible for programmers, 'eh? :)
Joseph Mastey
+1  A: 

I have been working with Magento for the last two months and all i can say is that the system is the most advanced one from all and you can extend it as much as you want once you get a full grasp of the system. When you want to extend Magento, the best bet is to stay away from modifying core classes, instead, just try to override them. For example when you want to change the design you just create new theme or new package and you copy only the files from the default theme that you want to change. If you need some additional functionality you can override core block's classes or models with creating your own module. The most powerful way to extend Magento is Event Observer pattern. Magento fires up many events like before saving a row in the database, or after saving, so when you want to insert your functionality you can just choose the appropriate event to listen for and create your own Observer class to listen for the event. Here is some helpful link to get you going with the Observers: http://inchoo.net/ecommerce/magento/extending-order-object-and-hooking-on-event-in-magento/ From my point of view, i can simply say that Magento is the most advanced and the most professional PHP application i have ever seen.

Zoran