magento starters guide

27
Magento Starter’s guide An introduction to your new e-commerce platform

Upload: fabian

Post on 01-Dec-2014

83 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Magento Starters Guide

Magento Starter’s guide An introduction to your new e-commerce platform

Page 2: Magento Starters Guide

Content •  1.- Who is Blue Jay Projects •  2.- What should we know about Magento? •  3.- Learn the product •  4.- Developer’s Area •  4.1.- What you should learn before… •  4.2.- My First day with Magento •  4.3.- Modifying Magento •  4.4.- Keeping a maintainable Magento •  4.5.- Magento Ninja •  4.6.- Performance tips

•  5.- References and links

Page 3: Magento Starters Guide

Blue Jay Projects •  Main focus in LAMP Performance and Scalability,

Distributed DBMS •  E-commerce, Magento , Cloud-computing architectures •  Agile Evangelists

Page 4: Magento Starters Guide

Customers and Experiences

* Copyright of the logos belong to their respectives companies

Page 5: Magento Starters Guide

WHAT SHOULD WE KNOW ABOUT MAGENTO?

Get to know the product!

Page 6: Magento Starters Guide

Unique Selling Points •  Modularity , inherited from Zend Framework software

architecture •  Data Flexibility, however EAV has a cost •  Community driven software, great ecosystem with lots of

modules •  Multi currency, Multi store, Multi language, designed to see

your business grow •  Very fast release cycle

Page 7: Magento Starters Guide

History •  Magento first release 1.0 : March 31st, 2008 •  Latest community release 1.6.1.0 : October 31st, 2011 •  First versions hardly relied on Entity-Attribute-Model, with all

the current flexibility but with big performance issues, just like any other beta software.

•  Later releases got rid of EAV model in order entity and offered the possibility to flatten the catalog entities ( products / categories ).

•  Many people still wait for customer entity to be flattened at some point, which would also boost big Magento installations.

Page 8: Magento Starters Guide

Versions Community Professional Enterprise

-  Open Source OSL v3 -  No official support,

however you may find lots of companies offering it

-  No Warranty or any kind of indemnification

-  PA-DSS Compliant -  Supported by

Magento solution partners

-  Warranty included -  Indemnification

included -  To sum up: Magento

community with some minor modules, and everything it takes to be PCI-Compliant

-  Professional + More advanced modules enterprise oriented, official support with SLA.

Find more at Magentocommerce.com

Page 9: Magento Starters Guide

Release History Release What’s special? Date

1.3.0 WSDL, Flat catalog, 2009/03/30

1.3.1 Bugfix 2009/04/17 (18 days)

1.4.0.0 Widgets, WYSIWYG editor, 3dSecure 2010/02/12

1.4.0.1 bugfix 2010/02/19

1.4.1.0 Flatten Orders! 2010/07/10

1.4.1.1 Bugfix and LOTS of FEATURES! 2010/06/26

1.5.0.0 Better Order statuses management, magento mobile, better import/export,

Failed!

1.5.0.1 All from 1.5.0.0 + bugfix 2011/02/09

1.6.0.0 Minimum advertised price, persistent cart, some shipping integration to print labels

2011/08/18

1.6.1.0 Minor improvements and bugfix 2011/10/19

Page 10: Magento Starters Guide

OK, we like it. Where should we Start?

* Bob Spunge copyright is property of Viacom International

Page 11: Magento Starters Guide

Learn the product •  Have some training in e-commerce in general, you’ll find most of

the things you might need are either in Magento core modules or Magento connect.

•  Magento has a lot of information to watch and read. Pay attention to the webinars at http://www.magentocommerce.com/media/webinars/, get special focus on Magento U summer webinars, they were quite good. This is pretty important to avoid developing “new” features, instead of using what comes out-of-the-box.

•  Visit http://www.magentocommerce.com/magento-connect/ , have a look at some modules out there, probably you find 80% of what you want for your business. You might also get some new ideas…

•  Spend lots of time playing with Magento backend, get to know what’s in every single tab, each link…

Page 12: Magento Starters Guide

Seriously, Spend enough time to understand what we’ve seen so far. It will save you lots of headaches!!

* Image extracted from docmendizabal.blogspot.com

Page 13: Magento Starters Guide

DEVELOPER’S AREA Ready!

Page 14: Magento Starters Guide

What you should learn before… •  Magento is a Zend Framework (v1) application. Learning ZF

will help you getting Magento quickly. Dedicate some days to learn at http://framework.zend.com/

•  Understand OOP http://en.wikipedia.org/wiki/Object-oriented_programming first . Once you are done, study and understand Event-driven programming http://en.wikipedia.org/wiki/Event-driven_programming

•  Understand Model View Controller architectural pattern principles ( http://en.wikipedia.org/wiki/Model–view–controller ), and RESPECT it when developing Magento.

Page 15: Magento Starters Guide

Seriously, Spend enough time to understand what we’ve seen so far. It will save you lots of headaches!!

* Image extracted from docmendizabal.blogspot.com

Page 16: Magento Starters Guide

I know kung-fu. Prove it!

* The Matrix is a registered brand by Warner Bros.

Page 17: Magento Starters Guide

MY FIRST DAY DEVELOPING MAGENTO Everything is hard at the beginning…

*picture from blackberrypool.com

Page 18: Magento Starters Guide

•  You might need some help during setup, follow the official installation guide at http://www.magentocommerce.com/knowledge-base/entry/magento-installation-guide

•  After the installation, you MUST understand EVERY SINGLE parameter under “system>configuration”. It’s the key to avoid developing again something that comes out-of-the-box.

•  Magento directory structure: •  “app” directory is your main focus •  “js” and “skin” will also be important developing frontend •  “media” will host all the catalog pictures •  “var” is where all the temporary content will be •  Don’t mess too much with the rest…

Page 19: Magento Starters Guide

•  Create your own Namespace in “app/code/local” . Every module you develop will be placed there.

•  Create also your own design package in “app/design/frontend” . Remember the webinars… http://www.magentocommerce.com/media/screencasts/designers-guide-1/view

•  Create new layouts and use them in any CMS page http://www.magentocommerce.com/design_guide/articles/intro-to-layouts

•  Change view files and see how your changes are applied. Remember flushing the cache if enabled!

Page 20: Magento Starters Guide

•  Create your first module: •  Start by using the “Magento module creator”.

http://www.magentocommerce.com/magento-connect/modulecreator.html

•  This will create a basic skeleton of a module for you. Play with it!

•  Important: •  Model: create your own and instantiate it from anywhere •  Controller: create your actions and do some tests •  Helper: instantiate it and see what you can do, not only

playing with i18n •  Sql upgrade scripts: you are able to interact with the DB

as your module gets upgraded. •  Blocks: see what you can do, and test the cache

capabilities

Page 21: Magento Starters Guide

Modifying Magento •  Now it’s time to override Magento core elements •  Overriding a model:

http://www.magentocommerce.com/boards/viewthread/16829/

•  Overriding a controller , 2 examples, depending on what you want to do exactly: •  Override the whole controller:

http://web-magician.blogspot.com/2009/06/overriding-controllers-and-actions-in.html

•  Override an action: http://www.spinonesolutions.com/2010/03/magento-controller-override/

•  Overriding a block http://www.magentocommerce.com/boards/viewthread/14692/

•  Overriding a helper: http://magedev.com/2009/06/03/magento-overriding-model-block-or-helper/

Page 22: Magento Starters Guide

Keeping a Maintainable Magento •  Use Magento’s ORM, don’t launch SQL queries to the DB. (it

might make sense under some circunstantes, but less than you might think)

•  Avoid extending core classes, work with Magento events and observers instead. •  Learn how to create an observer: http://bit.ly/dby1mw •  Discover all the existing events in Magento, there’s an event for

everything! http://www.magentocommerce.com/wiki/development/reference/event-list?do=diff

•  Your code will be easily installable in any other Magento setup, installing other’s modules will also be easier, and any upgrade won’t be that painful.

Page 23: Magento Starters Guide

Magento Ninja! (1/2) •  If you already work as an Event-driven developer, and

want to get deeper, try…: •  Creating cronjobs:

http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/how_to_setup_a_cron_job

•  Using Magento cache. Remember to use tags, and what tags are affecting your cached object. http://www.nicksays.co.uk/2010/07/developers-guide-magento-cache/

•  Creating configuration settings: http://alanstorm.com/custom_magento_system_configuration

•  Creating attributes programatically if you need them in your modules http://stackoverflow.com/questions/3459424/how-to-add-an-attribute-programmatically

Page 24: Magento Starters Guide

Magento Ninja! (2/2)

• Creating new payment method: http://bit.ly/ckekRU • Creating new shipping method:

http://bit.ly/d59xR8 • Using Magento transactions:

http://bit.ly/tuCBZg • Creating Magento widgets:

http://bit.ly/m22By

Page 25: Magento Starters Guide

Performance tips •  Enable Magento code compilation: Make sure not to

include files from others, and to develop healthy magento code. http://alanstorm.com/magento_compiler_path

•  Boost up user’s experience by enabling JS/CSS merge. This will also not work if you include missing files in your layout XML…

•  If you work with Community Edition, use any Full Page Cache system: Either you create your own or purchase anyone on the market.

Page 26: Magento Starters Guide

Performance tips •  Profile your site continuously: •  Xhprof: https://github.com/preinheimer/xhprof •  Zend Server: http://www.zend.com/products/server/ •  Lucierna Antorcha: http://www.lucierna.com/

•  Use CDN’s and/or reverse proxies for as much content as you can. •  Find more about performance and scalability at

http://slidesha.re/rwZ7hZ

Page 27: Magento Starters Guide

References & Links •  http://www.magentocommerce.com/knowledge-base •  http://magento4u.wordpress.com/ ( maybe this site

has been closed? ) •  http://alanstorm.com/ •  http://magetool.co.uk/ •  https://github.com/alistairstead •  Fernando Palomo's Slideshare Presentation