Author Box
Articles Categories
All Categories
Articles Resources

Magento Basics For Fresh Magento Developers

February 27, 2012 | Comments: 0 | Views: 158

Magento is the robust and flexible open-source shopping cart. It is ecommerce web application launched on 31st March, 2008 and created by Varien. It is built on components of Zend Framework. As Magento is powerful and flexible, it has steep learning curve. If you have knowledge of HTML and CSS and know somewhat of PHP and MySQL then you can have enterprise class shopping cart running in no time. Magento is available under the Open Software License version 3.0. Varien is now Magento Inc. Varien, the company that owns Magento, formerly worked with osCommerce. They originally planned to split osCommerce but later decided to rewrite it as Magento. Magento officially started development in early 2007. Seven months later the first public beta version was released. On May 30, 2010 Magento mobile was released, it allows store owners to create native mobile storefront apps. Magento supports installation of modules through a web-based interface accessible through the administration area of a Magento installation. Modules are hosted on the Magento e-Commerce website as a PEAR server. Any community member can upload a module through the website and is made available once confirmed by a member of the Magento team. Modules are installed by entering a module key, available on the module page, into the web based interface.

Magento developers are familiar with the MVC (Model View Controller) design pattern that is everywhere throughout web frameworks. In the code of Magento, there are many other components besides the M's the V's and the C's. Each module contains the Controller and Model. Within each module, there are no Views. You will find extra tidbits, such as "helper", "etc" and "sql". In these modules there is also the sort of files which we very often work with. This article will try to describe just what a Block is and how it is used. A top priority of Object Oriented Programming is the decoupling of code which means that code should have the least amount of dependency on other code as possible. Blocks are part of Magento solution to keep the application loosely coupled.

A quick introduction on MVC: When a page in Magento is called, the URL tells Magento what code to run. This is done via a "router" which calls upon a selected Controller to do its work. The URL gets "routed" to a particular Controller, which in turns tells Magento what to do. The Catalog controller, for example, is responsible for telling Magento to load a product collection and then show those products to us. The Controller tells Magento which layout is to be used. This determines which modules are put into place, which in turn tells Magento what Views to output. The data from the Models are given to the Views to be displayed. In the scheme of things here, Blocks fit roughly between the View and the Model.

Magento has sets of modules. Modules act as their own little entities, each containing their own M's V's and C's. These modules create the separate areas within a typical Magento page; the header, header links, mini cart, recently viewed products, static HTML blocks, footer, and so on. Basically, comprised within any given web page are multiple modules, each of which call their own Views.

On any given page request, Magento needs to be able to show a certain set of modules. The possibility of many sets of modules to be displayed on any given page means a decoupling is necessary amongst the Controller, the Models/Blocks and their Views. Blocks allow this decoupling by enabling the module to get its data from its Models, and push out the data to the Views which display the relevant data. Each functional area of a page can then act separately. In this way, we can decide when we want to show a certain functional area. We can tell it to show up on product pages, but not CMS pages. We can move it from the right to the left column, to the center, to the header, to the footer, or to a defined area we create!

Overview of a Block - A Block is a data resource for Views. It uses the sites Models, grabs the data, makes any necessary adjustments, and then makes that data available to a View. The Block is where you create product collection and implement the product collection's methods, like adding filters or ordering the products in a certain way. That product collection is then made available to your View so you can display the products on a page.

In this article, we discussed history of Magento, basic overview of MVC, how Magento implements MVC, modularity within Magento, decoupling of code and the Block's place within the architecture of Magento. We concluded that a block is basically a tool which allows Magento to place content items / functionality throughout the site in a modular way. Magento is a great system for developers and now it's time to jump on board.

For More Info:- Magento Developers | Magento Customization

Source: EzineArticles
Was this Helpful ?

Rate this Article

Article Tags:

Magento Development


Magento Developers


Offshore Magento Developers

Windows 8 will change the way you work and play, says Microsoft and we agree. Nearly all of the previous iterations of the Windows OS have been evolutionary but Windows 8 is set to change all that.

By: Sakshi Sharma l Computers & Technology > Mobile Computing l April 03, 2013 lViews: 662

Many antivirus programs available today have various features but it entirely depends on the user to make the best choice from among these different computer virus protection programs online. Before

By: Alex l Computers & Technology > Software l December 28, 2012 lViews: 369

You can add a new color to your entertainment life with iskysoft video converter for mac & iskysoft dvd creator for mac and make your Christmas holidays all the more special. iskysoft video

By: Zaithyn Galter l Computers & Technology > Software l December 23, 2012 lViews: 1070

The choices you make regarding the type of recruiting software you choose to use are important. Being an informed consumer is essential to getting a system or components that complement systems of

By: Maria Warne l Computers & Technology > Software l December 14, 2012 lViews: 305

The Cisco certification has become the most popular IT training in recent days and it offers three different levels of these certifications include as: associate, professional and expert-level.

By: sandidas chakma l Computers & Technology > Certification Tests l December 11, 2012 lViews: 236

Millions of prospective 12th standard students are gearing up their preparations for the Joint Entrance Exam for engineering seats. From 2013, it has been decided by the IITs, CBSE, JEE organizing

By: Sarkariexam l Computers & Technology > Certification Tests l December 07, 2012 lViews: 633

Sunny Ghosh, Director, Wolf Frameworks, once commented "The end of Fashion IT -customers will only pay for value and not technology... With the advent of Web 3.0 or Cloud Computing or platforms..,

By: Camrone Whitel Computers & Technology > Programmingl June 15, 2012 lViews: 164

The other day, I met an individual at Starbucks, an artist amongst other things. He seemed incredibly good at the art of doodling and turning those sketches into art work - the stuff he showed me was

By: Lance Winslowl Computers & Technology > Programmingl June 15, 2012 lViews: 211

Following is a brief outline of the future of WordPress. It talks about the developments, problems and solutions that this segment is facing. WordPress has seen growth like no other in the Content

By: James J. Johnl Computers & Technology > Programmingl June 14, 2012 lViews: 174

Data Warehouse analyses the data, stores them and streamlines the information in the respective systems. This increases the efficiency of the organization and benefits the overall performance of the

By: Sam Mackenziel Computers & Technology > Programmingl June 13, 2012 lViews: 183

One of my favorite topics is artificial intelligence. In fact, I do believe in the future that the CEOs of every major corporation will actually be a supercomputer with artificially intelligent

By: Lance Winslowl Computers & Technology > Programmingl June 13, 2012 lViews: 184

Mobile strategy has evolved as an integrated part of marketing strategy irrespective of the industry vertical. With the smart phones percolating heavily in the Indian market, it is all the more

By: Ponting Smithl Computers & Technology > Programmingl June 12, 2012 lViews: 191

One can now easily contact their business associates, customers, friends, family members, vendors and various associates through iPhone application development for social networking. iPhone contains

By: Daniel Willl Computers & Technology > Mobile Computingl April 23, 2012 lViews: 193