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

Book Description

Over 50 practical recipes that will help you realize the full potential of Magento in order to build a professional online store

About This Book

  • Take advantage of the latest features in Magento 2 to set up an e-commerce store that fits your business needs

  • Packed with several advanced recipes, not just to manage your online store, but to extend and design it as well

  • Written in a cookbook style, you can pick and choose your recipe to carry out your day- to- day Magento store tasks

  • Who This Book Is For

    The book is for existing Magento users who want to gain further expertise and insights into managing, designing, and extending their online store in Magento to fit their business needs. Working knowledge of Magento and basic familiarity with programming is expected.

    What You Will Learn

  • Set up a Magento 2 project on Apache or Nginx.

  • Transfer your Magento 1 database to Magento 2 using the Magento 2 system tools.

  • Boost the performance of Magento 2 by enabling different types of caching.

  • Build a Magento 2 multi-store by creating a root catalog, subdirectories, and products.

  • Create and manage pages, blocks, and front-end apps.

  • Manage your Magento store by setting up the correct TAX rules.

  • Design custom themes within the Magento 2 framework.

  • Create basic and advanced extensions using Magento 2.

  • In Detail

    Magento 2 is an open source e-commerce platform that has all the functionality to function from small to large online stores. It is preferred by developers and merchants due to its new architecture, which makes it possible to extend the functionalities with plugins, a lot of which are now created by the community.

    This merchant and developer guide is packed with recipes that cover all aspects of Magento 2. The recipes start with simple how-to’s then delve into more advanced topics as the book progresses.

    We start with the basics of setting up a Magento 2 project on Apache or Nginx. Next, you will learn about basics including system tools and caching to get your Magento 2 system ready for the real work. We move on to simple tasks such as managing your store and catalog configuration. When you are familiar with this, we cover more complex features such as module and extension development. Then we will jump to the final part: advanced Magento 2 extensions.

    By the end of this book, you’ll be competent with all the development phases of Magento 2 and its most common elements.

    Style and approach

    Step by step guide for real world tasks for Magento users to gain a more advanced insight on managing, extending and designing their e-commerce store to fit their business needs.

    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 Cookbook
      1. Table of Contents
      2. Magento 2 Cookbook
      3. Credits
      4. Foreword
      5. About the Authors
      6. About the Reviewer
      7. www.PacktPub.com
        1. eBooks, discount offers, and more
          1. Why Subscribe?
      8. 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
      9. 1. Installing Magento 2 on Apache and NGINX
        1. Introduction
        2. Installing Apache
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        3. Installing NGINX
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        4. Installing PHP-FPM
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        5. Installing HHVM
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        6. Installing MySQL
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        7. Installing Magento 2
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        8. Installing Magento 2 on Hypernode
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        9. Managing Magento 2 on Docker
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
      10. 2. Magento 2 System Tools
        1. Introduction
        2. Installing Magento 2 sample data via GUI
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        3. Installing Magento 2 sample data via the command line
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        4. Managing Magento 2 indexes via the command line
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        5. Managing Magento 2 cache via the command line
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        6. Managing Magento 2 backup via the command line
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        7. Managing Magento 2 set mode (MAGE_MODE)
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        8. Transferring your Magento 1 database to Magento 2
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
      11. 3. Enabling Performance in Magento 2
        1. Introduction
        2. Configuring Redis for backend cache
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Configuring Memcached for session caching
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Configuring Varnish as the Full Page Cache
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        5. Configuring Magento 2 with CloudFlare
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        6. Configuring optimized images in Magento 2
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        7. Configuring Magento 2 with HTTP/2
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        8. Configuring Magento 2 performance testing
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
      12. 4. Creating Catalogs and Categories
        1. Introduction
        2. Create a Root Catalog
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        3. Create subcategories
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        4. Manage attribute sets
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        5. Create products
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        6. Manage products in a catalog grid
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
      13. 5. Managing Your Store
        1. Introduction
        2. Creating shipping and tax rules
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Managing customer groups
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Configuring inventories
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        5. Configuring currency rates
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        6. Managing advanced pricing
          1. Getting ready
          2. How to do it…
          3. How it works…
      14. 6. Creating a Magento 2 Theme
        1. Introduction
        2. Creating a new theme
          1. Getting ready
          2. How to do it…
          3. How it works…
            1. Adding theme variants
            2. Layout files
            3. Template files
            4. Magento UI library
        3. Changing a layout XML of a Magento 2 module
          1. Getting ready
          2. How to do it…
          3. How it works…
            1. <container>
            2. referenceContainer/referenceBlock
            3. move
            4. remove
            5. update
            6. Overriding template files
        4. Adding CSS/JS to pages
          1. Getting ready
          2. How to do it…
          3. How it works…
            1. External files
            2. JavaScript files
            3. CSS files
            4. Removing a file in the header
        5. Using Grunt for CSS changes
          1. Getting ready
          2. How to do it…
          3. How it works…
            1. LiveReload
        6. Adding static blocks to pages through layout XML
          1. Getting ready
          2. How to do it…
          3. How it works…
            1. Adding a block to a single page
        7. Adding static blocks to pages through widgets
          1. How to do it…
          2. How it works…
            1. Available widgets
              1. CMS Page Link
              2. CMS Static Block
              3. Catalog Category Link
              4. Catalog New Products List
              5. Catalog Product Link
              6. Catalog Product List
              7. Orders and Returns
              8. Recently Compared Products
              9. Recently Viewed Products
        8. Using a dynamic serving theme based on the client browser
          1. Getting ready
          2. How to do it…
          3. How it works…
        9. Creating theme-specific translations
          1. Getting ready
          2. How to do it…
          3. How it works…
            1. Generating a translation file
      15. 7. Creating Magento 2 Extensions – the Basics
        1. Introduction
        2. Initializing extension basics
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Working with database models
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Creating tables using setup scripts
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Data installation
        5. Creating a web route and controller to display data
          1. How to do it…
          2. How it works…
        6. Creating system configuration fields
          1. Getting ready
          2. How to do it…
          3. How it works…
            1. Creating a new tab
            2. Creating a new section
            3. Creating a new group
            4. Creating a new field
          4. There's more…
        7. Creating a backend data grid
          1. How to do it…
          2. How it works…
            1. The uiComponent configuration
              1. Data source
              2. Mass actions for grid
          3. See also
        8. Creating a backend form to add/edit data
          1. Getting ready
          2. How to do it…
          3. How it works…
            1. Building the form
            2. Adding a form field
            3. Loading the data
            4. Saving the data
      16. 8. Creating Magento 2 Extensions – Advanced
        1. Introduction
        2. Using dependency injection to pass classes to your own class
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Modifying functions with the use of plugins – Interception
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Creating your own XML module configuration file
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Creating your own product type
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Working with service layers/contracts
          1. How to do it…
          2. How it works…
            1. DemoRepositoryInterface
            2. DemoInterface
          3. See also
        7. Creating a Magento CLI command option
          1. Getting ready
          2. How to do it…
          3. How it works…
      17. Index