123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> Computer-Programming >> View Article

Magento Basics For Fresh Magento Developers

Profile Picture
By Author: Dharmesh Aegis
Total Articles: 105
Comment this article
Facebook ShareTwitter ShareGoogle+ ShareTwitter Share

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 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 Development | Magento Customization

Total Views: 316Word Count: 832See All articles From Author

Add Comment

Computer Programming Articles

1. Linq Tutorial In C#: Learn Language Integrated Query Step By Step
Author: Tech Point

2. Digital Marketing Company In Delhi: Helping Businesses Build A Strong Online Presence
Author: Code Sparrow

3. Connected Living And Digital Transformation With Custom Iot And Home Automation Solutions
Author: John Smith

4. Why Businesses Need Custom Conversational Ai Chatbots
Author: Fasturex

5. Cmmc 2.0 Compliance Consulting For Defense Contractors
Author: CMMC

6. Building A Stronger Cybersecurity Culture With Security Awareness Programs
Author: Sam Vohra

7. Kotlin Tutorial: A Complete Guide To Kotlin Programming For Beginners
Author: Tech Point

8. Dart Tutorial: Learn Dart Programming Concepts From Basics To Advanced
Author: Tech Point

9. Checklist: What To Consider Before You Hire Software Developers In India
Author: Nevil Martin

10. Manual Vs Automated Time Tracking For Freelancers: Which Approach Makes More Sense?
Author: Aiwi

11. Jenkins Tutorial For Beginners: Learn Continuous Integration Step By Step
Author: Tech Point

12. Docker Tutorial With Practical Examples To Master Containerization
Author: Tech Point

13. Why Website Development Is Essential For Digital Success
Author: Rudram Technology Solutions

14. Dynamics 365 Business Central Cloud
Author: brainbell10

15. Sap Successfactors Access Management: How To Close The Jml Gap Across Every Connected System
Author: Mansoor Alam

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: