melhores praticas no desenvolvimento magento
DESCRIPTION
Boas práticas no desenvolvimento pra Magento - Apresentado no Meet Magento 2013TRANSCRIPT
![Page 1: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/1.jpg)
Melhores (ou boas) práticas no desenvolvimento para
Magento
Ricardo Martins http://ricardomartins.net.br
Meet Magento 2013 – Brasil, São Paulo
![Page 2: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/2.jpg)
Sobre
• Desenvolvendo em PHP/Web desde 2005 • Com Magento desde 2011 • Na e-smart desde o último Meet Magento
![Page 3: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/3.jpg)
Escolha certa
• Infinitas possibilidades e oportunidades • Comunidade gigante • Maior plataforma de e-commerce • Eventos legais ao redor do mundo
![Page 4: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/4.jpg)
Imagine 2013 Las Vegas, NV
![Page 5: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/5.jpg)
Magento Imagine – Las Vegas 2013
![Page 6: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/6.jpg)
Magento Imagine – Las Vegas 2013
![Page 7: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/7.jpg)
![Page 8: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/8.jpg)
![Page 9: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/9.jpg)
Magento Imagine – Las Vegas 2013
![Page 10: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/10.jpg)
![Page 11: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/11.jpg)
Vamos ao que interessa…
![Page 12: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/12.jpg)
Melhores práticas
Boas práticas
Pra quem?
![Page 13: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/13.jpg)
Se tudo correr bem...
• Criação de temas e pacotes • Criação e instalação de módulos • Versionamento e deploy • Ambiente de desenvolvimento e
playground • Ferramentas que nos ajudam
![Page 14: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/14.jpg)
Temas e Pacotes
![Page 15: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/15.jpg)
O Começo de toda loja
Pacote / Package Tema / Theme
![Page 16: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/16.jpg)
Magento theme fall-back a partir do 1.4
Extraído do livro Magento Design Guide
![Page 17: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/17.jpg)
A base de tudo
Package: base / Theme: default
![Page 18: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/18.jpg)
Blank
Package: default/ Theme: blank
![Page 19: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/19.jpg)
Os temas nativos
• default/blank • default/default Apenas com alterações de css no package base. Os arquivos de template vem do base/default. • default/modern • default/iphone
![Page 20: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/20.jpg)
Criando nosso pacote
• Crie seu próprio package • Com seu tema default • Quanto menos arquivos de templates
sobrescrever, melhor
![Page 21: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/21.jpg)
Criação e Instalação de Módulos
![Page 22: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/22.jpg)
Cuidados
• Módulos criptografados • Override app/code/core • Override base/default • Layout XML e Templates em default/
default ao invés de base/default • Override de controllers e classes
– Tem como usar observer no lugar? • SQL Install e scripts de setup
![Page 23: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/23.jpg)
e o maior de todos os cuidados..
![Page 24: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/24.jpg)
EM PRODUÇÃO
NÃO TESTE
![Page 25: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/25.jpg)
![Page 26: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/26.jpg)
O Git ajuda nessas horas...
![Page 27: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/27.jpg)
$ git status
![Page 28: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/28.jpg)
Versionamento e Deploy
![Page 29: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/29.jpg)
Fonte: http://www.sameerhalai.com/blog/quick-git-workflow-for-small-teams/
![Page 30: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/30.jpg)
Git com Jira
![Page 31: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/31.jpg)
Ambiente de Desenvolvimento e
Playground
![Page 32: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/32.jpg)
IDE‘s
![Page 33: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/33.jpg)
IDE
• Tem programa legalzinho pra programar pra Magento?
• Tem! • Qual? • Aquele que você mais gosta!
![Page 34: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/34.jpg)
SublimeText2
sublimetext.com
![Page 35: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/35.jpg)
PhpStorm + Magicento
http://www.jetbrains.com/phpstorm/ e http://magicento.com/
![Page 36: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/36.jpg)
Ambiente de desenvolvimento
• Erros habilitados – php.ini > error_reporting / display_errors – MAGE_IS_DEVELOPER_MODE
no .htaccess • Recursos limitados • Versão do PHP e MySQL
– Sempre a mais recente? Nem sempre.
![Page 37: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/37.jpg)
Playground
• Lugar pra você fazer experimentos
• Se divertir com os módulos experimentais
• Limite os acessos • Sample data • Facilite o rollback
– Git – Scripts de restore
![Page 38: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/38.jpg)
Script simples de rollback Reset.sh ou Reset.bat
![Page 39: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/39.jpg)
Ferramentas
![Page 40: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/40.jpg)
Minhas favoritas
• Magneto Debug Toolbar • Wiz • Modgit / modman
![Page 41: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/41.jpg)
Magneto Debug
http://goo.gl/XQ30WM
![Page 42: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/42.jpg)
Wiz
https://github.com/classyllama/Wiz
![Page 43: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/43.jpg)
Modgit/Modman
https://github.com/jreinke/modgit
![Page 44: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/44.jpg)
Tem mais…
• n98-magerun (Symfony) • Module Creator
![Page 45: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/45.jpg)
n98-magerun
https://github.com/netz98/n98-magerun
![Page 46: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/46.jpg)
Module Creator
www.silksoftware.com/magento-module-creator/
![Page 47: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/47.jpg)
Tem mais…
• Correios e auto-complete de ceps – Frete.co (www.frete.co)
• Alternativa com alto SLA para calculo de fretes • Base (realmente) completa de endereços • Só precisa mudar a URL do webservice
![Page 48: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/48.jpg)
Frete.co
Sem Frete.co
Com Frete.co
Retorno com os mesmos elementos: {"resultado":"1","resultado_txt":"sucesso - cep completo","uf":"SP","cidade":"Santos","bairro":"Embar\u00e9","tipo_logradouro":"Rua","logradouro":"Edu Brancato"}
![Page 49: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/49.jpg)
<?php exit();
![Page 50: Melhores praticas no desenvolvimento magento](https://reader033.vdocuments.pub/reader033/viewer/2022051312/5474ddbdb4af9fbe0a8b5971/html5/thumbnails/50.jpg)
Muito Obrigado
Contatos [email protected] http://ricardomartins.net.br/ github.com/r-martins
Apresentação Disponível em
http://slideshare.net/ricardo.martins