O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Magento PHP Developer's Guide

Book Description

Get started with the flexible and powerful e-commerce framework, Magento

  • Build your first Magento extension, step by step
  • Extend core Magento functionality, such as the API
  • Learn how to test your Magento code

In Detail

Magento has completely reshaped the face of e-commerce since its launch in 2008. Its revolutionary focus on object oriented and EAV design patterns has allowed it to become the preferred tool for developers and retailers alike.

"Magento PHP Developer’s Guide" is a complete reference to Magento, allowing developers to understand its fundamental concepts, and get them developing and testing Magento code.

The book starts by building the reader’s knowledge of Magento, providing them with the information, techniques, and tools that they require to start their first Magento development.

After building this knowledge, the book will then look at more advanced topics: how to test your code, how to extend the frontend and backend, and deploying and distributing custom modules.

"Magento PHP Developer’s Guide" will help you navigate your way around your first Magento developments, helping you to avoid all of the most common headaches new developers face when first getting started.

Table of Contents

  1. Magento PHP Developer's Guide
    1. Table of Contents
    2. Magento PHP Developer's Guide
    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. Errata
        3. Piracy
        4. Questions
    8. 1. 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
    9. 2. Magento Fundamentals for Developers
      1. Zend Framework – the base of Magento
      2. Magento folder structure
      3. Modular architecture
        1. Autoloader
        2. Code pools
      4. Routing and request flow
      5. Magento version of MVC
        1. Models
        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
    10. 3. ORM and Data Collections
      1. Magento Model Anatomy
        1. It's magic – methods
      2. EAV Model
        1. What is EAV?
        2. Retrieving the data
      3. Working with Magento collections
        1. Get product collection only from a specific category
        2. Get new products added since X date
        3. Get Bestseller products
        4. Filter product collection by visibility
        5. Filter products without images
        6. Add multiple sort orders
      4. Using Direct SQL
        1. Reading
        2. Writing
      5. Summary
    11. 4. Frontend Development
      1. Extending Magento
        1. Scenario
        2. Features
        3. Further improvements
      2. Hello Magento
      3. XML module configuration
      4. Models and saving data
        1. Creating the models
        2. Setup resources
          1. Defining a setup resource
          2. Creating the Installer Script
        3. What have we learned?
      5. Setting up our routes
        1. The index controller
        2. The search controller
        3. The view controller
      6. Block and layouts
        1. IndexController blocks and views
        2. SearchController blocks and views
        3. ViewController block and views
        4. Adding products to the registry
      7. Summary
    12. 5. Backend Development
      1. Extending the Adminhtml
        1. Back to the configuration
      2. The grid widget
        1. Managing the registries
        2. Permissions and the ACL
        3. Updating in bulk with Massactions
      3. The form widget
        1. Loading the data
        2. Saving the data
      4. Summary
    13. 6. The Magento API
      1. The Core API
        1. XML-RPC
        2. SOAP
        3. 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
    14. 7. Testing and Quality Assurance
      1. Testing Magento
        1. Unit testing
        2. Regression testing
        3. Functional tests
        4. TDD
      2. Tools and testing frameworks
        1. Unit testing with PHPUnit
          1. Installing Ecomdev_PHPUnit
          2. Setting up the configuration for our extension
          3. Anatomy of a Test case
          4. Creating a unit test
        2. Functional tests with Mink
          1. Magento Mink installation and setup
      3. Creating our first test
      4. Summary
    15. 8. Deployment and Distribution
      1. The road towards zero-downtime deployment
        1. Make it right from scratch
        2. Be sure that what you see is what you get
        3. Ready means ready
      2. Version control system and deployment
        1. SVN
        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
    16. A. Hello Magento
      1. The configuration
      2. The controller
      3. Testing the route
    17. Index