class
Making use of Magento getSingleton method
11 Comments 9th OCT 2008 | Posted by Branko Ajzele in Magento

In one of my previous articles I showed you how to use getModel and getData methods in Magento. Although we should not put those to methods at the same level, since I’d say the getModel is a bit more higher. Higher in sense, you first use the geModel to create the instance of object then you use getData to retrieve the data from that instance. I have said it before, and I’m saying it again; Magento is a great peace of full OOP power of PHP. It’s architecture is something not yet widely seen in CMS solutions.
One of the architectural goodies of Magento is it’s Singleton design pattern. In short, Singleton design pattern ensures a class has only one instance. Therefore one should provide a global point of access to that single instance of a class.
Read more...Figuring out Magento object context
5 Comments 10th SEP 2008 | Posted by Branko Ajzele in Magento, Tools

One of the problems working under the hood of the Magento CMS is determining the context of $this. If you are about to do any advanced stuff with your template, besides layout changes, you need to get familiar with Magento’s objects (classes).
Let’s have a look at the /app/design/frontend/default/default/template/catalog/product/view.phtml file. If you open this file and execute var_dump($this) your browser will return empty page after a short period of delay. By page I mean on the product view page; the one you see when you click on Magetno product. Experienced users will open PHP error log and notice the error message caused by var_dump().
Read more...- New Comments
- Weekly Populars
- Tag cloud
- Zoran on Extending Order object and hooking on event in Magento:
Thank you for the nice explanation. Does this mean i can watch for any already fired events from Ma... - M.Richard on Facebook Connect Magento Extension:
I'm working on it to pick up address information from Facebook profile and automatically create a bi... - Magento Mechanics on File upload in Magento:
If you would like a of the shelf module to solve this problem Magento Mechanics have solved the issu... - Scott on Featured products Magento extension by Inchoo:
I had some products not showing up in featured products, and some that would. I changed some of the... - Jason on Running IE6, IE7 and IE8 standalone :
I have a friend that ie7 @ spoon running with flash in winxp. I can't get flash to work, also in wi... - Daniel on Latest News in Magento:
In reference to the post above, the second sentence is supposed to read: "Most feeds have a 'publish... - Daniel on Latest News in Magento:
You'll have to look at the xml that makes up your feed. Most feeds have a and an node. Find the ... - mike on Contact Form in Magento:
This post explains how to get the form posting correctly: http://www.casualcommerce.com/2009/03/m... - Ivan Weiler on Facebook Connect Magento Extension:
Hello all, We just setup ... - mpoulieris the greek on Facebook Connect Magento Extension:
ok i did it,but how can i drawit the "connect with facebook"....

