Magento2intro

25
Part 1 hat don’t you like about Magento 1

Transcript of Magento2intro

Page 1: Magento2intro

Part 1What don’t you like about Magento 1?

Page 2: Magento2intro

“Guidelines, coding standards, Wiki, documentation”

Magento 1 has disappointingly little official documentation compared to other frameworks.

When did you last Google a Magento problem and landed on a Magento documentation page?

Page 3: Magento2intro

“Superior Performance”

Magento is notoriously a slow framework.

A slow website results in a bad user experience and a loss of sales.

The hope is superior overall performance in Magento 2.

Page 4: Magento2intro

“jQuery out-of-the-box support”

Magento 1 relied on Prototype, Magento devs believed jQuery to be in an unstable state during original Magento release.

jQuery support could clear up a lot of front-end issues and conflicts.

Page 5: Magento2intro

“Superior Category structure”

No search function for categories.

Why can’t categories be presented like products and sales?

Page 6: Magento2intro

“Admin Panel is bad”

Is the Admin Panel aesthetically pleasing? Does it need to be?

Can you find everything you want to easily? Can clients?

Page 7: Magento2intro

“Video, zoom support built in”There exist plenty of product video modules and product zoom functionality.

Should Magento try to offer out-of-the-box supportfor such common features?

Or are product options already expansive enough and/or easy enough to add to?

Page 8: Magento2intro

“Catalog & Shopping Cart Price Rules”

Set up so that clients can conceivably understand and set up price rules.

Personal experience is that price rules can be a little bitMore confusing than they need to.

Reality is usually a little different.

Page 9: Magento2intro

“Accountability trail; whoflushed the cache?”

A place to keep track of which back-end users are making what changes.

Would offer an explanation for whether clients or developers made vital changes.

Already possible in Magento Enterprise Edition.

Page 10: Magento2intro

Part 2What to expect from Magento 2

Page 11: Magento2intro

jQuery > Prototype

jQuery built in to Magento 2

Less of a role played by Prototype.js library

Less JavaScript conflicts

Third party modules don’t need to be packaged with their own versions of jQuery

Page 12: Magento2intro

Admin Panel UI

Same expansive back-end functionality, easier-on-the-eyes UI

Responsive admin panel. Access from tablet or mobile device.

Page 13: Magento2intro

Documentation

Magento 1 documentation was poor and for the most part non-existent

Magento team have compiled documentation together:

http://devdocs.magento.com/

Page 14: Magento2intro

Improved speed thanks to PHP 7

Improved index updating process promises better query speeds

Performance toolkit

Magento 2 speeds have been called into question. Some have claimed that Magento 2 is, in fact, slower than Magento 1 if optimal settings are chosen for both.

https://blog.amasty.com/magento-1-vs-magento-2-performance-comparison-speed-test-results/

Performance

Page 15: Magento2intro

“Magento 2 will feature an UI library called simply Magento UI. People familiar with Bootstrap, Foundation or other CSS frameworks will notice resemblance.Magento UI will contain standard reusable components like buttons, sanely styled forms and navigation elements.” http://magenticians.com/magento-2-webinar-frontend-layout-architecture-summary

“Magento 2 will be heavily influenced by LESS. The entire Magento “UI” CSS Library is defined as LESS instead of CSS which means that styling-definitions have additional features not available in standard CSS – like variables and mixins.Because by default browsers are not capable of using LESS for rendering, it has to be compiled to CSS first. Magento 2 ships all of this functionality.If we understood correctly, it is possible to leverage custom compilers. In theory this means that instead of LESS, developers are free to implement a compiler which is compatible with a stylesheet language of their choice, like SASS.”

http://alankent.me/2014/06/21/magento-2-less-versus-sass-decision/

UI Library

Page 16: Magento2intro

“To help reducing server load and speed up the page load, Magento 2 is integrated with Varnish Cache -- the leading HTTP accelerator technology -- responsible for caching common requests.

Full page caching : All content from a static page is cached, therefore, increasing performance and significantly reducing the server load.”

http://alankent.me/2014/12/09/magento-2-caching-overview/

Caching & Varnish Cache

Page 17: Magento2intro

Part 3“Hello, World” Example

Page 18: Magento2intro

http://www.venustheme.com/how-to-create-magento-2-module/

Page 19: Magento2intro

http://alanstorm.com/magento_2_mvvm_mvc

This replaces app/etc/modules directory XML files

Page 20: Magento2intro

http://alanstorm.com/magento_2_mvvm_mvc

These two files are module registration files. A registration.php file allows a module to be developed outside of the /code/ folder (such as, in vendor folder)

Page 21: Magento2intro

http://alanstorm.com/magento_2_mvvm_mvc

This file allows our module to claim a front name, configuring the URL

e.g. http://magento.example.com/hello_mvvm/*

Page 22: Magento2intro

http://alanstorm.com/magento_2_mvvm_mvc

Now we can create a controller to call. Controllers extends standard Action class. Access to this controller:

http://magento.example.com/hello_mvvm/hello/world

“Instead of having a single controller class which contains all our actions, we use a directory namespace to group our actions. Each action is it’s own class extending \Magento\Framework\App\Action\Action and simply implementing the method execute(). “ - https://www.ashsmith.io/magento2

Page 23: Magento2intro

http://alanstorm.com/magento_2_mvvm_mvc

Block layout XML fileFile: app/code/Pulsestorm/HelloWorldMVVM/view/frontend/layout/hello_mvvm_hello_world.xml

“Magento, please create a block object using the class Pulsestorm\HelloWorldMVVM\Block\Main. This block should render with the template in the content.phtml file, and let’s give the block a globally unique name ofpulsestorm_helloworld_mvvm “

Page 24: Magento2intro

http://alanstorm.com/magento_2_mvvm_mvc

Front-end content is placed inside module folder

A class inside Block folder loads the template defined in the above XML file

Page 25: Magento2intro

http://alanstorm.com/magento_2_mvvm_mvc

Correct implementation of a Magento 2 controller.

Controller should only have an execute method, passing on the processing elsewhere.