magento for newbies by ideatolife - design+code; arabnet beirut 2015

34
Click to edit Master title style Magento for Newbies

Upload: arabnet-me

Post on 18-Jul-2015

73 views

Category:

Software


0 download

TRANSCRIPT

Click to edit Master title style

Magento for Newbies

Click to edit Master title styleK.I.S.S. Pattern

During the course of this workshop we will follow K.i.s.s. Pattern i.e.

Keep It Simple Stupid

So stop me where things get too complicatedand shout KISS!!!!!

Click to edit Master title styleOutline of Workshop

• Intro to Magento• Magento’s Fundamental in terms of architecture &

framework• Quick go through the Magento setup and installation• How to setup the Magento backend• Adding Product Categories• Adding Products• Adding Payment Gateways• Adding Shipment Options• How to write a Magento Module – with Practical

demonstration• Pros & Corns of Magento

Click to edit Master title styleSpecial Alert!

Your mind is like a parachute, it only works when its open.

Click to edit Master title styleWhat is E-commerce

• E-commerce (electronic commerce or EC) is the buying and selling of goods and services, or the transmitting of funds or data, over an electronic network, primarily the Internet.

• These business transactions occur either business-to-business, business-to-consumer, consumer-to-consumer or consumer-to-business

Click to edit Master title style

Click to edit Master title styleWhat is Magento?

• Magento is an object-oriented PHP Framework that can be used to develop modern, dynamic web applications that tap into Magento's powerful eCommerce features.

• According to research conducted by aheadWorks in October 2014, Magento'smarket share among the 30 most popular e-commerce platforms is about 30%.

Click to edit Master title style

• Magento gels 2 commonly used programming types/styles.

Any guesses what are the following 2 types of programming styles/types?

Function Module

Function Calls

Variable

Method Object

Message Property

Object Oriented ProgrammingProcedural Programming

Magento Framework Architecture

Click to edit Master title styleGRASP Design Patterns

GRASP

Controller

Information Expert

CreatorHigh

Cohesion

Low Coupling

Good to Know about GRASP Patterns before entering the world of Magento

Click to edit Master title styleMVC For Magento

• Magento Uses MVC with an extra-touch.

Model

ViewController

Thin Controllers

Fat Models

Click to edit Master title styleEDA…What is EDA?

• Event Driven Architecture is an architecture in which events are used to exchange messages in real time between applications or between different parts of a single application.

• What is the purpose of EDA in Magento?

Click to edit Master title styleWhat is an Event?

• An event is a notable thing that happens inside our outside your business. An event (business or system) may signify a problem or impending problem, an opportunity, or threshold or a deviation.

Click to edit Master title styleEvent & Observer

• Event: We can consider an event as a kind of flag that rises when a specific situation happens for example when the user presses the « pay » button of your website, it is an event. Your order has been registered? Here it is an event too. Etc

• Observer: An Observer is also called « Listener » he will listen to your program to detect events. When there is an event taking place, it will perform an action.

Click to edit Master title styleSome Example of Observer

Click to edit Master title styleLet’s dive into Magento

• Download link:

• https://www.magentocommerce.com/products/downloads/magento/

Click to edit Master title styleMagento Installation

Click to edit Master title style

Click to edit Master title style

Click to edit Master title style

Click to edit Master title style

Click to edit Master title styleLets start using Magento for Real!

Click to edit Master title styleLet’s dive into Coding!

Main directories in Magento

• Core

• Community

• Local

You can access Magneto's core using a Mage keyword with :: and access their methods and properties.

Click to edit Master title styleLet’s Make A Module!

Lets create a directory structure for the Module:

• app/code/local/ArabNet/Helloworld/Block

• app/code/local/ArabNet/Helloworld/controllers

• app/code/local/ArabNet/Helloworld/etc

• app/code/local/ArabNet/Helloworld/Helper

• app/code/local/ArabNet/Helloworld/Model

• app/code/local/ArabNet/Helloworld/sql

Click to edit Master title styleConfiguring you Module

• Then create a configuration file for the module (at path app/code/local/Magentotutorial/Helloworld/etc/config.xml)

<config> <modules>

<Magentotutorial_Helloworld><version>0.1.0</version>

</Magentotutorial_Helloworld></modules>

</config>

Click to edit Master title styleTelling Magento About our Module

• Then create a file to activate the module (at path app/etc/modules/Magentotutorial_Helloworld.xml)

<config>

<modules>

<Magentotutorial_Helloworld>

<active>true</active>

<codePool>local</codePool>

</Magentotutorial_Helloworld>

</modules>

</config>

Click to edit Master title styleConfigure Routes

<frontend><routers>

<helloworld><use>standard</use><args>

<module>Magentotutorial_Helloworld</module><frontName>helloworld</frontName>

</args></helloworld>

</routers> </frontend>

Click to edit Master title styleWhat is a <frontend>?

• The <frontend> tag refers to a Magento Area. For now, think of Areas as individual Magento applications. The "frontend" Area is the public facing Magento shopping cart application. The "admin" Area is the the private administrative console application. The "install" Area is the application you use to run though installing Magento the first time.

Click to edit Master title styleWhy a <routers> tags if we're configuring individual routes?

• Magento, like all large systems, suffers from the naming problem in spades. You'll find there are are many places in the global config, and the system in general, where the naming conventions seem unintuitive or even ambiguous.

Click to edit Master title styleWhat's the <helloworld> tag for?

• This tag should be the lowercase version of you module name. Our module name is Helloworld, this tag is helloworld

Click to edit Master title styleWhat is a <frontName>?

Structure of URL to be parsed by router

• http://example.com/frontName/actionControllerName/actionMethod/

So when we added the <frontName>helloworld</frontName>, we are telling the system to parse the URLs with pattern:

http://example.com/helloworld/*

Click to edit Master title styleFact of Life in IT Industry

Because there, in truth, is no such thing as a

perfect system. They break. A good system can

tell us it’s broken, and a really good system tells

you how to fix the problem

Click to edit Master title stylePros and Corns of Magento

Pros

• Feature rich

• User-friendly

• Cost

• Community

• Flexibility

• Scalable

Click to edit Master title styleCorns

• Hard to find good Magento Developers

• Cost

• Hosting

• Time

Click to edit Master title styleSelection of Magento

• Only consider using Magento if you’ve got a decent on-line business that you may need to scale quickly.

• If you’re running a micro-business and are on an extreme tight budget, forget about Magento. The investment will blow your budget to bits.