Magento PHP Developer's Guide - Second Edition

Book description

Get up and running with the highly customizable and powerful e-commerce solution, Magento

In Detail

In the world of e-commerce, there are dozens of tools available to use in custom web design and development. Out of all of these options, Magento is the web's fastest growing e-commerce platform. Its architecture makes it possible to extend the functionalities using plugins, which are shared by the community, extensively.

This book is a practical guide packed with examples so developers can understand its fundamental concepts and then start developing and testing Magento code. The book starts by building your knowledge of Magento, providing you with the techniques and tools you require to start your first Magento development. You will then learn to work with data collections and the EAV system, before gradually moving on to extending the frontend and backend. You will learn all about deploying and distributing custom modules.

This book will help you navigate your way around your first Magento developments, helping you to avoid all of the most common headaches that new developers face when first getting started.

What You Will Learn

  • Build your very first Magento extension
  • Deploy and distribute custom modules
  • Extend Magento's core functionality
  • Use development techniques and tools for Magento
  • Implement the design patterns that form Magento
  • Test Magento with different tools and frameworks

Table of contents

  1. Magento PHP Developer's Guide Second Edition
    1. Table of Contents
    2. Magento PHP Developer's Guide Second Edition
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. Magento Fundamentals for Developers
      1. Zend Framework – the base of Magento
      2. The Magento folder structure
      3. Modular architecture
        1. Autoloader
        2. Code pools
      4. Routing and request flow
      5. The Magento version of MVC
        1. Models
        2. Views
        3. Dissecting a layout file
        4. Controllers
      6. Websites and store scopes
      7. Factory names and functions
      8. Events and observers
        1. Event dispatch
        2. Observer bindings
      9. Summary
    9. 2. ORM and Data Collections
      1. Magento Model anatomy
        1. It's magic – methods
      2. The EAV model
        1. What is EAV?
        2. Retrieving the data
      3. Working with Magento collections
        1. Get product collections only from a specific category
        2. Get new products added since X date
        3. Get bestseller products
        4. Filter the product collection by visibility
        5. Filter products without images
        6. Add multiple sort orders
      4. Using Direct SQL
        1. Reading
        2. Writing
      5. Summary
    10. 3. Frontend Development
      1. Extending Magento
        1. Scenario
        2. Features
        3. Further improvements
      2. Hello Magento!
      3. The XML module configuration
      4. Models and saving data
        1. Creating the models
        2. Setup resources
          1. Defining a setup resource
          2. Creating the upgrade script
        3. What we have learned
      5. Setting up our routes
        1. IndexController
        2. SearchController
        3. ViewController
      6. Blocks and layouts
        1. IndexController blocks and views
        2. SearchController blocks and views
        3. ViewController blocks and views
        4. Adding products to the registry
      7. Summary
    11. 4. Backend Development
      1. Extending Adminhtml
        1. Back to the configuration
      2. The grid widget
        1. Managing the registries
        2. Permissions and ACL
        3. Updating in bulk with mass actions
      3. The form widget
        1. Loading the data
        2. Saving the data
      4. Summary
    12. 5. The Magento API
      1. The Core API
        1. XML-RPC
        2. SOAP
        3. The RESTful API
      2. Using the API
        1. Setting up the API credentials for XML-RPC/SOAP
        2. Setting up the REST API credentials
        3. Loading and reading data
        4. Updating data
        5. Deleting a product
      3. Extending the API
        1. Extending the REST API
      4. Securing the API
      5. Summary
    13. 6. Testing and Quality Assurance
      1. Testing Magento
        1. Unit testing
        2. Regression testing
        3. Functional testing
        4. Test-driven development
      2. Tools and testing frameworks
        1. Unit testing with PHPUnit
          1. Installing Ecomdev_PHPUnit
          2. Setting up the configuration for our extension
          3. The anatomy of a test case
          4. Creating a unit test
        2. Functional testing with Mink
          1. Magento Mink installation and setup
      3. Creating our first test
      4. Summary
    14. 7. Deployment and Distribution
      1. The road toward zero-downtime deployment
        1. Making it right from scratch
        2. Ensure that what you see is what you get
        3. Magento naming conventions
        4. Ready means ready
      2. Version control systems
        1. Subversion
        2. Git
      3. Distribution
        1. Packing our extension
          1. Package Info
          2. Release Info
          3. Authors
          4. Dependencies
          5. Contents
          6. Load Local Package
      4. Publishing our extension
      5. Summary
    15. A. Hello Magento
      1. The configuration
      2. The controller
      3. Testing the route
    16. B. Understanding and Setting Up Our Development Environment
      1. LAMP from scratch
        1. Getting VirtualBox
        2. Booting our virtual machine
        3. Installing Apache2
        4. Installing PHP
        5. Installing MySQL
        6. Putting everything together
      2. Up and running with Vagrant
        1. Installing Vagrant
      3. Choosing an IDE
      4. Working with a version control system
      5. Summary
    17. Index

Product information

  • Title: Magento PHP Developer's Guide - Second Edition
  • Author(s): Allan MacGregor
  • Release date: July 2015
  • Publisher(s): Packt Publishing
  • ISBN: 9781783554195