SlideShare a Scribd company logo
1 of 22
Magento (eCommerce Solution) This Presentation is about: - What is Magento? Magento Installation Introduction to Magento Directory Structure A simple module (“Hello World”) creation
What is Magento ? Magento is an open source eCommerce solution. It is based on one of the most popular PHP Designing Pattern MVC (Module, View, Controller).  It comes with a variety of tools, necessarily for building a successful online shop. Magento offers a lot of built-in capabilities, such as promo pricing and coupon codes, detailed statistics, and SEO (Search Engine Optimization) options.
Small Intro to MVC Design Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Small Intro to MVC Design Pattern Part - II How It Works ? The MVC abstraction can be graphically represented as follows.
Small Intro to MVC Design Pattern Part – II (cont..) Events typically cause a controller to change a model, or view, or both. Whenever a controller changes a model’s data or properties, all dependent views are automatically updated. Similarly, whenever a controller changes a view, for example, by revealing areas that were previously hidden, the view gets data from the underlying model to refresh itself.
Magento Installation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Magento Installation Download latest stable version (1.5.0.1) and unzip it to your web host directory Now you are ready to install the Magento. Before we proceed to installation you must have to check that you have Read and Write permission on following directories inside the magento folder. magento/app/etc magento/var magento/media Now Create a database on mysql with name “magento”. In Linux we can do so by writing the following commands (In windows you have to set path for mysql and than you can use the following command): -  mysql -u<user_name> -p<password> (enter, you get mysql prompt) mysql> create database magento;
Magento Installation If every thing is fine open your favorite web browser type into url ( http://localhost/ <your Magento folder name>/) and press enter you will see the screen link below. Click on I agree to the above terms and conditions and press “Continue”.
Magento Installation Now you get the Local Settings Screen. Here you can select your language, time zone and currency for the site. These settings is for your Site default language and currency display to user. When you done click on Continue
Magento Installation Configuration (Part – I) After setting locale setting we get the following screen for Database configuration, Web Access Options and Session Storage Options. Database Configuration : - Here we can define the name of the database we previously created in mysql and Host IP or Host Name (if DNS available) in our case Host is “localhost” and at last DB User name and Password
Magneto Installation Configuration (Part -II) Web Access Options : -  1 - Use Web Server (Apache) Rewrites You could enable this option to use web server rewrites functionality for improved search engines optimization. Please make sure that mod_rewrite is enabled in Apache configuration. 2- Use Secure URLs (SSL) Secure connection during login and purchasing process. Based on web server configuration and availability of SSL Certificate. Session Storage  :- Either you want that user login and working session is save in a DB or use your file system. We go for default (File System) When your done for Configuration press Continue to proceed Now you have to wait for installer response it will create a DB Tables. When it completed the process it will ask for Administrative Configuration.
Magento Installation Administrative Configuration You will get the screen like below: - Here you have to enter your name and email address for mail communication and the Administrator User ID and password. The last option is for Encryption Key which is used to encrypt site user passwords and for encryption of Credit Card information.
Magento Installation Administrative Configuration (Part – II) When all is done, press continue.  You will complete the installation. It will show you, your encryption key please note it down. Here you have two options : -  1 – Go to Frontend ( To view your site) 2 – Got to Backend ( For Administrative settings )
Directory Structure ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Directory Structure Part – II App Directory (All Core Application files and for our created modules): - app/code (All Magento Core Files and our created modules) core Mage, Zend (PHP Framework)  local (All Modules created by us) app/design (All View Files) app/design/adminhtml app/design/frontend app/etc ( All configuration files for local modules as well as Magento modules ) app/etc/modules
New Module Creation To create a module in Magento we have a first create a directory structure as follows: - Go to folder app/code/local and create directories as follows (all directory names are case-sensitive) <directory package_name> <directory module_name> Block (files that show contents) controllers (events/controllers/functions) etc (Module configuration files) Helper (Module helper files) Model (Business logic and DB communication files) sql (DB query [Schema] files)
New Module Creation Part – II Step 1: -  Create a file inside app/etc/modules/Mymodule_All.xml Notice the _All in the xml file name. I can declare all of my modules here. (Say I have more than Example, I can also declare my Example2 module in this file). <?xml version=&quot;1.0&quot;?> <config> <modules> <Mymodule_Example> <active>true</active> <codePool>local</codePool> </Mymodule_Example> </modules> </config>
New Module Creation Part – II (Cont..) Step 2: Create file to configure your new module. Note the file locations (need to create directories as necessary). app/code/local/Mymodule/Example/etc/config.xml And write XML as follows: -  <?xml version=&quot;1.0&quot;?> <config> <modules> <Mymodule_Example> <version>0.1.0</version> </Mymodule_Example> </modules> <global> <blocks> <mymodule_example> <class>Fido_Example_Block</class> </mymodule_example> </blocks> </global> </config>
New Module Creation Part – II (Cont..) Step 3: - Now we create a block code for our module. It doesn’t really do anything, but shows some functionality. appodeocalymodulexamplelockiew.php <?php class Mymodule_Example_Block_View extends Mage_Core_Block_Template { private $message; private $att; protected function createMessage($msg) { $this->message = $msg; } public function receiveMessage() { if($this->message != '') { return $this->message; } else { $this->createMessage('Hello World'); return $this->message; } } protected function _toHtml() { $html = parent::_toHtml(); if($this->att = $this->getMyCustom() && $this->getMyCustom() != '') { $html .= '<br />'.$this->att; } else { $html .= '<br />No Custom Attribute Found'; } return $html; } }
New Module Creation Part – II (Cont..) Step 4: - Here we create our template (phtml) file. appesignrontendefaultymoduleemplatexampleiew.phtml <?php /** * Mymodule view template * * @see Mymodule_Example_Block_View * */ ?> <div> <span><strong>This is the output of the Mymodule example:</strong></span><br /> <span style=&quot;color:#FF9933;&quot;> <?php echo $this->receiveMessage(); ?> </span> </div>
New Module Creation Part – II (Cont..) Step 4: - Cont.. This just outputs some HTML and also runs the receiveMessage() function from our block (view.php). Two caveats here. By placing our view.phtml file in it’s location, we have created our own theme. You must make sure that a) Magento knows about your theme (Admin->System->Design) and b) If you use the this block in a CMS page, you set the CMS page to use your theme (Admin->CMS->Manage Pages->’Your Page’->Custom Design->Custom Theme drop down) Now our custom module is now ready for use.
New Module Creation Part – III Now open Magento Admin Panel (by using your user name and password set during installation) Now click on Admin->CMS->Pages it will show the list of all available CMS pages Now click on “Home Page”. It will open Page Information section. Now click on “Content” form left side Options and than click on button “Show Hide Editor” and then write the following : -  {{block type=&quot;mymodule_example/view&quot; template=&quot;example/view.phtml&quot; }} Now Click on save page button at top of the page. Now you should successfully have your block and the  “Hello World”  message being displayed (on your CMS page).

More Related Content

What's hot

What's hot (20)

Introduction to Magento
Introduction to MagentoIntroduction to Magento
Introduction to Magento
 
Magento Live eCommerce Demo Tutorial for Beginners » Magento Universe
Magento Live eCommerce Demo Tutorial for Beginners » Magento UniverseMagento Live eCommerce Demo Tutorial for Beginners » Magento Universe
Magento Live eCommerce Demo Tutorial for Beginners » Magento Universe
 
Steps to Setup Magento Multi-Stores
Steps to Setup Magento Multi-StoresSteps to Setup Magento Multi-Stores
Steps to Setup Magento Multi-Stores
 
Virtue mart ppt
Virtue mart pptVirtue mart ppt
Virtue mart ppt
 
12 Amazing Features of Magento 2
12 Amazing Features of Magento 212 Amazing Features of Magento 2
12 Amazing Features of Magento 2
 
Magento Overview
Magento  OverviewMagento  Overview
Magento Overview
 
New Features in Magento Enterprise Edition 1.14 (EE) Magento Community Editio...
New Features in Magento Enterprise Edition 1.14 (EE) Magento Community Editio...New Features in Magento Enterprise Edition 1.14 (EE) Magento Community Editio...
New Features in Magento Enterprise Edition 1.14 (EE) Magento Community Editio...
 
Nenad Andrakovic - Changing the way frontend developers think and work - Mage...
Nenad Andrakovic - Changing the way frontend developers think and work - Mage...Nenad Andrakovic - Changing the way frontend developers think and work - Mage...
Nenad Andrakovic - Changing the way frontend developers think and work - Mage...
 
eCommerce with Magento
eCommerce with MagentoeCommerce with Magento
eCommerce with Magento
 
Guillaume Thibaux - Can we win the fight against performance bottlenecks? Les...
Guillaume Thibaux - Can we win the fight against performance bottlenecks? Les...Guillaume Thibaux - Can we win the fight against performance bottlenecks? Les...
Guillaume Thibaux - Can we win the fight against performance bottlenecks? Les...
 
Magento
MagentoMagento
Magento
 
Magento: Enterprise and Community editions - An overview
Magento: Enterprise and Community editions - An overviewMagento: Enterprise and Community editions - An overview
Magento: Enterprise and Community editions - An overview
 
Magento feature list in 1.9
Magento feature list in 1.9Magento feature list in 1.9
Magento feature list in 1.9
 
Francesco Zoccarato - Configuratori prodotto: soluzioni e tecniche per un'imp...
Francesco Zoccarato - Configuratori prodotto: soluzioni e tecniche per un'imp...Francesco Zoccarato - Configuratori prodotto: soluzioni e tecniche per un'imp...
Francesco Zoccarato - Configuratori prodotto: soluzioni e tecniche per un'imp...
 
How to migrate data from OpenCart to Magento Using LitExtension Migration Tool
How to migrate data from OpenCart to Magento Using LitExtension Migration ToolHow to migrate data from OpenCart to Magento Using LitExtension Migration Tool
How to migrate data from OpenCart to Magento Using LitExtension Migration Tool
 
How to move Interspire to Magento using LitExtension tool
How to move Interspire to Magento using LitExtension toolHow to move Interspire to Magento using LitExtension tool
How to move Interspire to Magento using LitExtension tool
 
How to migrate data from 3d Cart to Magento with LitExtension
How to migrate data from 3d Cart to Magento with LitExtensionHow to migrate data from 3d Cart to Magento with LitExtension
How to migrate data from 3d Cart to Magento with LitExtension
 
Magento
MagentoMagento
Magento
 
Magento 2 - Getting started.
Magento 2 - Getting started.Magento 2 - Getting started.
Magento 2 - Getting started.
 
How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.
 

Viewers also liked

Speaker mai van hai magentovietnam-v2
Speaker mai van hai  magentovietnam-v2Speaker mai van hai  magentovietnam-v2
Speaker mai van hai magentovietnam-v2
AiTi Education
 
Chp 6 infrastructure- the backbone of e-commerce tech
Chp 6 infrastructure- the backbone of e-commerce techChp 6 infrastructure- the backbone of e-commerce tech
Chp 6 infrastructure- the backbone of e-commerce tech
cheqala5626
 
E commerce infrastructure
E commerce infrastructureE commerce infrastructure
E commerce infrastructure
sahilm87
 
E commerce infrastructure
E commerce infrastructureE commerce infrastructure
E commerce infrastructure
Sovan Kundu
 
E commerce business models
E commerce business modelsE commerce business models
E commerce business models
Vikram g b
 

Viewers also liked (19)

Speaker mai van hai magentovietnam-v2
Speaker mai van hai  magentovietnam-v2Speaker mai van hai  magentovietnam-v2
Speaker mai van hai magentovietnam-v2
 
Magento 2: A technical overview
Magento 2: A technical overviewMagento 2: A technical overview
Magento 2: A technical overview
 
Magento 101: A technical overview
Magento 101: A technical overviewMagento 101: A technical overview
Magento 101: A technical overview
 
Key Insights into Development Design Patterns for Magento 2 - Magento Live UK
Key Insights into Development Design Patterns for Magento 2 - Magento Live UKKey Insights into Development Design Patterns for Magento 2 - Magento Live UK
Key Insights into Development Design Patterns for Magento 2 - Magento Live UK
 
Magento 2
Magento 2Magento 2
Magento 2
 
Chp 6 infrastructure- the backbone of e-commerce tech
Chp 6 infrastructure- the backbone of e-commerce techChp 6 infrastructure- the backbone of e-commerce tech
Chp 6 infrastructure- the backbone of e-commerce tech
 
Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent
 
Magento 2 Design Patterns
Magento 2 Design PatternsMagento 2 Design Patterns
Magento 2 Design Patterns
 
E commerce infrastructure
E commerce infrastructureE commerce infrastructure
E commerce infrastructure
 
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
 
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
React Native Introduction: Making Real iOS and Android Mobile App By JavaScriptReact Native Introduction: Making Real iOS and Android Mobile App By JavaScript
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
 
E commerce infrastructure
E commerce infrastructureE commerce infrastructure
E commerce infrastructure
 
E commerce infrastructure
E commerce infrastructureE commerce infrastructure
E commerce infrastructure
 
E-commerce infrastructure the internet,web and mobile platform
E-commerce infrastructure the internet,web and mobile platformE-commerce infrastructure the internet,web and mobile platform
E-commerce infrastructure the internet,web and mobile platform
 
E Commerce Presentation
E  Commerce  PresentationE  Commerce  Presentation
E Commerce Presentation
 
E-Commerce PPT
E-Commerce PPTE-Commerce PPT
E-Commerce PPT
 
Considerations when selecting a SaaS eCommerce vendor
Considerations when selecting a SaaS eCommerce vendorConsiderations when selecting a SaaS eCommerce vendor
Considerations when selecting a SaaS eCommerce vendor
 
E commerce business models
E commerce business modelsE commerce business models
E commerce business models
 
eCommerce Platforms - an introduction
eCommerce Platforms - an introductioneCommerce Platforms - an introduction
eCommerce Platforms - an introduction
 

Similar to Mangento

EECI - EE And Magento Integration
EECI - EE And Magento IntegrationEECI - EE And Magento Integration
EECI - EE And Magento Integration
Simplified Safety
 
M2ModuleDevelopmenteBook
M2ModuleDevelopmenteBookM2ModuleDevelopmenteBook
M2ModuleDevelopmenteBook
Trọng Huỳnh
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentation
sasidhar
 
Benefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBenefit of CodeIgniter php framework
Benefit of CodeIgniter php framework
Bo-Yi Wu
 
Optimizing Magento Performance with Zend Server
Optimizing Magento Performance with Zend ServerOptimizing Magento Performance with Zend Server
Optimizing Magento Performance with Zend Server
varien
 

Similar to Mangento (20)

Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
How to-create-a-simple-module-in-magento-2.0
How to-create-a-simple-module-in-magento-2.0How to-create-a-simple-module-in-magento-2.0
How to-create-a-simple-module-in-magento-2.0
 
Magento++
Magento++Magento++
Magento++
 
php[world] Magento101
php[world] Magento101php[world] Magento101
php[world] Magento101
 
Synopsis
SynopsisSynopsis
Synopsis
 
Architecture and Analytical Study of Magento
Architecture and Analytical Study of MagentoArchitecture and Analytical Study of Magento
Architecture and Analytical Study of Magento
 
EECI - EE And Magento Integration
EECI - EE And Magento IntegrationEECI - EE And Magento Integration
EECI - EE And Magento Integration
 
M2ModuleDevelopmenteBook
M2ModuleDevelopmenteBookM2ModuleDevelopmenteBook
M2ModuleDevelopmenteBook
 
Magento2 Basics for Frontend Development
Magento2 Basics for Frontend DevelopmentMagento2 Basics for Frontend Development
Magento2 Basics for Frontend Development
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentation
 
WordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcodeWordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcode
 
TomatoCMS in A Nutshell
TomatoCMS in A NutshellTomatoCMS in A Nutshell
TomatoCMS in A Nutshell
 
Create Components in TomatoCMS
Create Components in TomatoCMSCreate Components in TomatoCMS
Create Components in TomatoCMS
 
Benefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBenefit of CodeIgniter php framework
Benefit of CodeIgniter php framework
 
Finding Your Way: Understanding Magento Code
Finding Your Way: Understanding Magento CodeFinding Your Way: Understanding Magento Code
Finding Your Way: Understanding Magento Code
 
Joomla Day1
Joomla  Day1Joomla  Day1
Joomla Day1
 
Yoav Kutner Dutchento
Yoav Kutner DutchentoYoav Kutner Dutchento
Yoav Kutner Dutchento
 
Zendcon magento101
Zendcon magento101Zendcon magento101
Zendcon magento101
 
Struts2 tutorial
Struts2 tutorialStruts2 tutorial
Struts2 tutorial
 
Optimizing Magento Performance with Zend Server
Optimizing Magento Performance with Zend ServerOptimizing Magento Performance with Zend Server
Optimizing Magento Performance with Zend Server
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 

Mangento

  • 1. Magento (eCommerce Solution) This Presentation is about: - What is Magento? Magento Installation Introduction to Magento Directory Structure A simple module (“Hello World”) creation
  • 2. What is Magento ? Magento is an open source eCommerce solution. It is based on one of the most popular PHP Designing Pattern MVC (Module, View, Controller). It comes with a variety of tools, necessarily for building a successful online shop. Magento offers a lot of built-in capabilities, such as promo pricing and coupon codes, detailed statistics, and SEO (Search Engine Optimization) options.
  • 3.
  • 4. Small Intro to MVC Design Pattern Part - II How It Works ? The MVC abstraction can be graphically represented as follows.
  • 5. Small Intro to MVC Design Pattern Part – II (cont..) Events typically cause a controller to change a model, or view, or both. Whenever a controller changes a model’s data or properties, all dependent views are automatically updated. Similarly, whenever a controller changes a view, for example, by revealing areas that were previously hidden, the view gets data from the underlying model to refresh itself.
  • 6.
  • 7. Magento Installation Download latest stable version (1.5.0.1) and unzip it to your web host directory Now you are ready to install the Magento. Before we proceed to installation you must have to check that you have Read and Write permission on following directories inside the magento folder. magento/app/etc magento/var magento/media Now Create a database on mysql with name “magento”. In Linux we can do so by writing the following commands (In windows you have to set path for mysql and than you can use the following command): - mysql -u<user_name> -p<password> (enter, you get mysql prompt) mysql> create database magento;
  • 8. Magento Installation If every thing is fine open your favorite web browser type into url ( http://localhost/ <your Magento folder name>/) and press enter you will see the screen link below. Click on I agree to the above terms and conditions and press “Continue”.
  • 9. Magento Installation Now you get the Local Settings Screen. Here you can select your language, time zone and currency for the site. These settings is for your Site default language and currency display to user. When you done click on Continue
  • 10. Magento Installation Configuration (Part – I) After setting locale setting we get the following screen for Database configuration, Web Access Options and Session Storage Options. Database Configuration : - Here we can define the name of the database we previously created in mysql and Host IP or Host Name (if DNS available) in our case Host is “localhost” and at last DB User name and Password
  • 11. Magneto Installation Configuration (Part -II) Web Access Options : - 1 - Use Web Server (Apache) Rewrites You could enable this option to use web server rewrites functionality for improved search engines optimization. Please make sure that mod_rewrite is enabled in Apache configuration. 2- Use Secure URLs (SSL) Secure connection during login and purchasing process. Based on web server configuration and availability of SSL Certificate. Session Storage :- Either you want that user login and working session is save in a DB or use your file system. We go for default (File System) When your done for Configuration press Continue to proceed Now you have to wait for installer response it will create a DB Tables. When it completed the process it will ask for Administrative Configuration.
  • 12. Magento Installation Administrative Configuration You will get the screen like below: - Here you have to enter your name and email address for mail communication and the Administrator User ID and password. The last option is for Encryption Key which is used to encrypt site user passwords and for encryption of Credit Card information.
  • 13. Magento Installation Administrative Configuration (Part – II) When all is done, press continue. You will complete the installation. It will show you, your encryption key please note it down. Here you have two options : - 1 – Go to Frontend ( To view your site) 2 – Got to Backend ( For Administrative settings )
  • 14.
  • 15. Directory Structure Part – II App Directory (All Core Application files and for our created modules): - app/code (All Magento Core Files and our created modules) core Mage, Zend (PHP Framework) local (All Modules created by us) app/design (All View Files) app/design/adminhtml app/design/frontend app/etc ( All configuration files for local modules as well as Magento modules ) app/etc/modules
  • 16. New Module Creation To create a module in Magento we have a first create a directory structure as follows: - Go to folder app/code/local and create directories as follows (all directory names are case-sensitive) <directory package_name> <directory module_name> Block (files that show contents) controllers (events/controllers/functions) etc (Module configuration files) Helper (Module helper files) Model (Business logic and DB communication files) sql (DB query [Schema] files)
  • 17. New Module Creation Part – II Step 1: - Create a file inside app/etc/modules/Mymodule_All.xml Notice the _All in the xml file name. I can declare all of my modules here. (Say I have more than Example, I can also declare my Example2 module in this file). <?xml version=&quot;1.0&quot;?> <config> <modules> <Mymodule_Example> <active>true</active> <codePool>local</codePool> </Mymodule_Example> </modules> </config>
  • 18. New Module Creation Part – II (Cont..) Step 2: Create file to configure your new module. Note the file locations (need to create directories as necessary). app/code/local/Mymodule/Example/etc/config.xml And write XML as follows: - <?xml version=&quot;1.0&quot;?> <config> <modules> <Mymodule_Example> <version>0.1.0</version> </Mymodule_Example> </modules> <global> <blocks> <mymodule_example> <class>Fido_Example_Block</class> </mymodule_example> </blocks> </global> </config>
  • 19. New Module Creation Part – II (Cont..) Step 3: - Now we create a block code for our module. It doesn’t really do anything, but shows some functionality. appodeocalymodulexamplelockiew.php <?php class Mymodule_Example_Block_View extends Mage_Core_Block_Template { private $message; private $att; protected function createMessage($msg) { $this->message = $msg; } public function receiveMessage() { if($this->message != '') { return $this->message; } else { $this->createMessage('Hello World'); return $this->message; } } protected function _toHtml() { $html = parent::_toHtml(); if($this->att = $this->getMyCustom() && $this->getMyCustom() != '') { $html .= '<br />'.$this->att; } else { $html .= '<br />No Custom Attribute Found'; } return $html; } }
  • 20. New Module Creation Part – II (Cont..) Step 4: - Here we create our template (phtml) file. appesignrontendefaultymoduleemplatexampleiew.phtml <?php /** * Mymodule view template * * @see Mymodule_Example_Block_View * */ ?> <div> <span><strong>This is the output of the Mymodule example:</strong></span><br /> <span style=&quot;color:#FF9933;&quot;> <?php echo $this->receiveMessage(); ?> </span> </div>
  • 21. New Module Creation Part – II (Cont..) Step 4: - Cont.. This just outputs some HTML and also runs the receiveMessage() function from our block (view.php). Two caveats here. By placing our view.phtml file in it’s location, we have created our own theme. You must make sure that a) Magento knows about your theme (Admin->System->Design) and b) If you use the this block in a CMS page, you set the CMS page to use your theme (Admin->CMS->Manage Pages->’Your Page’->Custom Design->Custom Theme drop down) Now our custom module is now ready for use.
  • 22. New Module Creation Part – III Now open Magento Admin Panel (by using your user name and password set during installation) Now click on Admin->CMS->Pages it will show the list of all available CMS pages Now click on “Home Page”. It will open Page Information section. Now click on “Content” form left side Options and than click on button “Show Hide Editor” and then write the following : - {{block type=&quot;mymodule_example/view&quot; template=&quot;example/view.phtml&quot; }} Now Click on save page button at top of the page. Now you should successfully have your block and the “Hello World” message being displayed (on your CMS page).