You are previewing Magento 2 Development Cookbook.
O'Reilly logo
Magento 2 Development Cookbook

Book Description

Over 60 recipes that will tailor and customize your experience with Magento 2

About This Book

  • Solve common problems encountered while extending your Magento 2 store to fit your business needs

  • Delve into the exciting and enhanced features of Magento 2 such as customizing security permissions, intelligent filtered search options, easy third-party integration, among others

  • Learn to build and maintain a Magento 2 shop via a visual-based page editor and customize the look and feel using Magento 2’s offerings on the go

  • Who This Book Is For

    This book is for every developer who has knowledge of PHP and wants to extend or customize the functionality of their Magento 2 system. If you have prior experience of the Magento platform, you will find this book useful in exploring the advanced features.

    What You Will Learn

  • Install a Magento 2 shop with sample data

  • Upgrade the data in a Magento 1 shop to a Magento 2 shop

  • Manage the look and feel of the shop with custom themes

  • Extend the shop with custom functionality such as forms, grids, and more

  • Accelerate your store with some performance tools

  • Build and structure your own shipping module

  • Test your shop with automated tests and manage your product display

  • In Detail

    With the challenges of growing an online business, Magento 2 is an open source e-commerce platform with innumerable functionalities that gives you the freedom to make on-the-fly decisions. It allows you to customize multiple levels of security permissions and enhance the look and feel of your website, and thus gives you a personalized experience in promoting your business.

    Style and approach

    This book is packed with a wide range of techniques to modify and extend the functionality of your online store. It contains easy-to-understand recipes starting with the basics and moving on to cover advanced topics. Many recipes work with code examples that can be downloaded from the book’s website.

    Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

    Table of Contents

    1. Magento 2 Development Cookbook
      1. Table of Contents
      2. Magento 2 Development Cookbook
      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. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      8. 1. Upgrading from Magento 1
        1. Introduction
        2. Creating a Magento 1 website with sample data
          1. Getting ready
          2. How to do it...
          3. How it works…
        3. Creating a Magento 2 website
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Preparing an upgrade from Magento 1
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Upgrading the database
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Using an IDE
          1. Getting ready
          2. How to do it...
          3. There's more...
        7. Writing clean code with PHP MD and PHP CS
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      9. 2. Working with Products
        1. Introduction
        2. Configuring the catalog defaults
          1. Getting ready
          2. How to do it
          3. How it works
        3. Working with attribute sets
          1. Getting ready
          2. How to do it
          3. How it works
        4. Working with product types
          1. Getting ready
          2. How to do it
          3. How it works…
          4. There's more…
            1. A simple product
            2. A configurable product
            3. A bundle product
            4. A grouped product
            5. A virtual product
            6. A downloadable product
        5. Adding social media buttons
          1. Getting ready
          2. How to do it
          3. How it works
        6. Embedding an HTML object
          1. Getting ready
          2. How to do it
          3. How it works
        7. Changing the URL of a product page
          1. Getting ready
          2. How to do it
          3. How it works
          4. There's more
      10. 3. Theming
        1. Introduction
        2. Exploring the default Magento 2 themes
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Creating a Magento 2 theme
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        4. Customizing the HTML output
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Adding extra files to the theme
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        6. Working with LESS
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        7. Changing a page title
          1. How to do it…
          2. How it works…
        8. Working with translations
          1. Getting ready
          2. How to do it…
          3. How it works…
        9. Adding widgets to the layout
          1. Getting ready
          2. How to do it…
          3. How it works…
        10. Customizing email templates
          1. Getting ready
          2. How to do it…
          3. How it works…
      11. 4. Creating a Module
        1. Introduction
        2. Creating the module files
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Creating a controller
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Adding layout updates
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Adding a translation file
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Adding a block of new products
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Adding an interceptor
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Adding a console command
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also...
      12. 5. Databases and Modules
        1. Introduction
        2. Creating an install and upgrade script
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Creating a flat table with models
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Working with Magento collections
          1. Getting ready
          2. How to do it...
          3. How it works…
        5. Programmatically adding product attributes
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Repairing the database
          1. Getting ready
          2. How to do it...
          3. How it works...
      13. 6. Magento Backend
        1. Introduction
        2. Registering a backend controller
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Extending the menu
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Adding an ACL
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Adding configuration parameters
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Creating a grid of a database table
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Working with backend components
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Adding customer attributes
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Working with source models
          1. Getting ready
          2. How to do it...
          3. How it works...
      14. 7. Event Handlers and Cronjobs
        1. Introduction
        2. Understanding event types
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Creating your own event
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Adding an event observer
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Introducing cronjobs
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Creating and testing a new cronjob
          1. Getting ready
          2. How to do it...
          3. How it works...
      15. 8. Creating a Shipping Module
        1. Introduction
        2. Initializing module configurations
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Writing an adapter model
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Extending the shipping method features
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Adding the module in the frontend
          1. Getting ready
          2. How to do it...
          3. How it works...
      16. 9. Creating a Product Slider Widget
        1. Introduction
        2. Creating an empty module
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Creating a widget configuration file
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Creating the block and template files
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Creating a custom configuration parameter
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        6. Finalizing the theming
          1. Getting ready
          2. How to do it...
          3. How it works...
      17. 10. Performance Optimization
        1. Introduction
        2. Benchmarking a website
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Optimizing the frontend of the website
          1. Getting ready
          2. How it works...
          3. How it works...
          4. There's more...
        4. Optimizing the database and MySQL configurations
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Optimizing the Apache web server
          1. How to do it...
          2. How it works...
        6. Finding performance leaks in Magento
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Configuring OPcache, Redis, and Memcached
          1. Getting ready
            1. Zend OPcache
            2. Memcached
            3. Redis
          2. How to do it...
          3. How it works...
        8. Optimizing the PHP configurations
          1. Getting ready
          2. How to do it...
          3. How it works...
      18. 11. Debugging and Unit Testing
        1. Introduction
        2. Logging into Magento 2
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Getting started with Xdebug
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Running automated tests from Magento
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Creating a Magento test case
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      19. Index