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 2 - Build World-Class online stores

Book Description

Create rich and compelling solutions for Magento 2 by developing and implementing solutions, themes, and extensions

About This Book

  • Be proficient in the main functionalities, resources, and system structure of Magento 2
  • Get to grips with this practical and hands-on guide to raise your web development skills to the next level
  • Packed with several advanced recipes, not just to manage your online store, but to extend and design it as well

Who This Book Is For

The ideal target audience for this course could be anyone who wants to mould their skills in building amazing e-commerce websites using Magento. We begin right from getting you started with Magento to becoming an expert at building your own online stores with it.

What You Will Learn

  • Install and set up the Magento Ecosystem
  • Carry out performance adjustments to speed up your Magento system
  • Transfer your Magento 1 database to Magento 2 using the Magento 2 system tools
  • Build a Magento 2 multi-store by creating a root catalog, subdirectories, and products
  • Design custom themes within the Magento 2 framework
  • Create extensions using Magento 2
  • Discover what makes Magento 2 different and more powerful

In Detail

Magento is the leading e-commerce software trusted by world`s leading organizations. Used by thousands of merchants for their transactions worth billions, it provides the flexibility to customize the content and functionality of your website. Our Magento Course will help you gain knowledge and skills that are required to design & develop world class online stores.

Magento 2 Development Essentials - This book begins by setting up Magento 2 before gradually moving onto setting the basic options of the Sell System. You will learn Search Engine Optimization aspects, create design and customize theme layout, and adjust the Magento System to achieve great performance.

Magento 2 Cookbook – This book is divided into several recipes, which show you which steps to take to complete a specific action. It will cover configuring your categories and products, performance tuning, creating a theme, developing a module etc. At the end of this book, you will gain the knowledge to start building a success website.

Mastering Magento 2 - This is a comprehensive guide to using the all new features and interface of Magento 2 to build, extend, and design online stores. This book is your roadmap to managing your Magento store which teaches advanced and successful techniques. Focusing on Magento's Community version, this book offers you advanced guidance on managing, optimizing, and extending your store while taking advantage of the new features of Magento 2.

This Learning Path combines some of the best that Packt has to offer in one complete, curated package. It includes content from the following Packt products

  • Magento 2 Development Essentials by Fernando J. Miguel
  • Magento 2 Cookbook by Ray Bogman and Vladimir Kerkhoff
  • Mastering Magento 2 by Bret Williams and Jonathan Bownds

Style and approach

This course begins by setting up Magento 2 before gradually moving on to setting the basic options of the Sell System. You will master Search Engine Optimization aspects, create designs and customize theme layouts, develop new extensions, and adjust the Magento System to achieve great performance. The book covers everything from creating and managing multiple stores to fine-tuning Magento for speed and performance.

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 - Build World-Class online stores
    1. Table of Contents
    2. Magento 2 - Build World-Class online stores
    3. Credits
    4. Preface
        1. What this learning path covers
        2. What you need for this learning path
        3. Who this learning path is for
        4. Reader feedback
        5. Customer support
        6. Downloading the example code
        7. Errata
        8. Piracy
        9. Questions
    5. 1. Module 1
      1. 1. Magento Fundamentals
        1. XAMPP PHP development environment
        2. XAMPP installation
          1. XAMPP for Windows installation
          2. XAMPP for Linux installation
          3. XAMPP for OS X installation
        3. Magento
          1. Magento installation
          2. Magento MVC architecture
        4. Summary
      2. 2. Magento 2.0 Features
        1. The revolution of Magento 2.0
        2. An introduction to the Magento order management system
          1. Sales operations
          2. A simplified checkout process
            1. Orders
            2. Payments
            3. Promotions
        3. Magento 2.0 command-line configuration
        4. The command-line utility
        5. Summary
      3. 3. Working with Search Engine Optimization
        1. Magento SEO management
        2. Store configuration
        3. SEO and searching
        4. SEO catalog configuration
          1. XML sitemap manager
        5. Google Analytics tracking code
        6. Optimizing Magento pages
          1. CMS pages
          2. Product pages
          3. Category pages
        7. Summary
      4. 4. Magento 2.0 Theme Development – the Developers' Holy Grail
        1. The basic concepts of Magento themes
        2. Magento 2.0 theme structure
        3. The Magento Luma theme
        4. Magento theme inheritance
        5. CMS blocks and pages
        6. Custom variables
        7. Creating a basic Magento 2.0 theme
          1. Creating and declaring a theme
          2. Simple product image configuration
          3. Creating static files' directories
          4. Creating a theme logo
          5. Applying the theme
        8. Summary
      5. 5. Creating a Responsive Magento 2.0 Theme
        1. The CompStore theme
        2. Composer – the PHP dependency manager
          1. Installing Composer on Unix-like operating systems
          2. Installing Composer on Windows
        3. Building the CompStore theme
        4. CSS preprocessing with LESS
        5. Applying new CSS to the CompStore theme
        6. Creating the CompStore logo
        7. Applying the theme
        8. Creating CompStore content
        9. Customizing Magento 2.0 templates
        10. Summary
      6. 6. Write Magento 2.0 Extensions – a Great Place to Go
        1. Magento development overview
        2. Using the Zend framework
        3. Magento 2.0 extension structure
        4. Developing your first Magento extension
        5. The Twitter REST API
        6. The TweetsAbout module structure
        7. Using TwitterOAuth to authenticate our extension
        8. Developing the module
          1. Controllers
          2. Blocks
          3. Observer
          4. Views
          5. CSS
          6. Deploying the module
          7. Magento Connect
          8. Packaging and publishing your module
        9. Summary
      7. 7. Go Mobile with Magento 2.0!
        1. Testing the website on different devices
          1. The Google Chrome DevTools device mode
            1. Changing the device preset
            2. Network connectivity
            3. Inspecting media queries
            4. Viewing CSS
            5. Adding custom devices
          2. Responsive Web Designer tester
        2. Adjusting the CompStore theme for mobile devices
        3. The Magento 2.0 responsive design
        4. The Magento UI
        5. Implementing a new CSS mixin media query
        6. Adjusting tweets about extensions for mobile devices
        7. Summary
      8. 8. Speeding up Your Magento 2.0
        1. Magento Entity-Attribute-Value
        2. Indexing and caching Magento
        3. Indexing and re-indexing data
        4. The Magento cron job
        5. Caching
        6. Fine-tuning the Magento hosting server
        7. Selecting the right Magento hosting service
        8. Apache web server deflation
        9. Enabling the expires header
          1. PHP memory configuration
          2. Optimizing the MySQL server
        10. Minifying scripts
          1. CDN for Magento
        11. Summary
      9. 9. Improving Your Magento Skills
        1. Magento Connect extensions
          1. Installing a Magento extension
          2. Debugging styles with the Grunt task runner
        2. Magento knowledge center
        3. Improving your Magento skills
        4. Summary
    6. 2. Module 2
      1. 1. 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…
      2. 2. 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…
      3. 3. 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…
      4. 4. 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…
      5. 5. 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
      6. 6. 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…
    7. 3. Module 3
      1. 1. Planning for Magento
        1. Defining your scope
          1. Project requirements
            1. Requirements checklist
          2. Planning for users
            1. Staff
            2. Customers
          3. Assessing technical resources
        2. Technical considerations
          1. Hosting provider
          2. In-house hosting
            1. Servers
          3. The best of both worlds
            1. Setting up a local test installation
        3. Global-Website-Store methodology
          1. Global
          2. Website
          3. Store
        4. Planning for multiple stores
          1. Using multiple domains for effective market segmentation
          2. Using multiple businesses to keep finances separate
          3. Using multiple languages to sell globally
        5. Summary
      2. 2. Managing Products
        1. Catalogs and categories
          1. Creating categories
            1. General information tab
            2. Display Settings tab
            3. Custom Design tab
            4. Category Products tab
          2. Re-ordering categories
          3. Special categories
        2. Managing products the customer focused way
          1. The simple product type
          2. The complex product types
            1. Configurable product type
            2. Grouped product type
            3. Bundle product type
            4. Virtual product type
            5. Downloadable product type
          3. Attributes and attribute sets
            1. Attribute types
              1. Selecting an attribute type
              2. Creating an attribute
                1. Attribute properties
                2. Manage options
                3. Manage Swatch
                4. Advanced attribute properties
                5. Managing labels
                6. Storefront properties
            2. Creating attribute sets
        3. Creating products
          1. The new product screen
            1. Creating a simple product
            2. Creating a configurable product
            3. Creating a grouped product
            4. Creating bundled products
            5. Creating a downloadable product
            6. Creating a virtual product
        4. Managing inventory
          1. Low stock notifications
          2. Product reports
        5. Pricing tools
          1. Pricing by customer group
          2. Quantity-based pricing
        6. Autosettings
        7. Related products, up-sells, and cross-sells
          1. Related products
          2. Upsell products
          3. Cross-sell products
        8. Importing products
          1. The shortcut to importing products
        9. Summary
      3. 3. Designs and Themes
        1. The Magento theme structure
          1. Theme files and directories
        2. The concept of theme inheritance
          1. Configuring a parent theme in theme.xml
          2. Overriding static files
          3. Overriding theme files
        3. Default installation of design packages and themes
        4. Installing third-party themes
        5. Inline translations
        6. Working with theme variants
          1. Assigning themes
          2. Applying theme variants
          3. Scheduling a theme variant
        7. Customizing themes
        8. Customizing layouts
          1. Expertly controlling layouts
            1. Using the reference tag to relocate blocks
          2. Customizing the default layout file
        9. Summary
      4. 4. Configuring to Sell
        1. The sales process
          1. The Magento sales process
          2. Managing backend orders
            1. Convert orders to invoices
            2. Creating shipments
        2. Payment methods
          1. PCI compliance
          2. Classes of payment systems
            1. Off-site payment systems
              1. Pros
              2. Cons
            2. On-site payment systems
              1. Pros
              2. Cons
          3. PayPal
            1. PayPal all-in-one payment solutions
            2. PayPal payment gateways
            3. PayPal Express
          4. Braintree
          5. Check/money order
          6. Bank transfer payment
          7. Cash on delivery payment
          8. Zero subtotal checkout
          9. Purchase order
          10. Authorize.net direct post
        3. Shipping methods
          1. Origin
          2. Handling fee
          3. Allowed countries
          4. Method not available
          5. Free shipping
          6. Flat rate
          7. Table rates
            1. Quantity- and price-based rates
            2. Save your rate table
            3. Table rate settings
            4. Upload rate table
          8. Carrier methods
        4. Managing taxes
          1. How Magento manages taxes
          2. Creating tax rules
          3. Importing tax rates
          4. Value added tax configurations
          5. Setup VAT taxes
        5. Transactional e-mails
          1. Create a new header template
          2. Assign e-mail header and footer
          3. Create new e-mail template
        6. Summary
      5. 5. Managing Non-Product Content
        1. The Magento content management system
          1. Pages
            1. Customizing a CMS page
              1. Modifying the Home Page layout
              2. The Content screen
            2. Creating a CMS page
          2. Using blocks and widgets
            1. Adding a page link
              1. Using WYSIWYG
              2. Using HTML
              3. Using a widget
            2. Using variables
              1. Creating your own variables
            3. Using widgets to insert content onto site pages
        2. Summary
      6. 6. Marketing Tools
        1. Customer groups
          1. Creating a customer group
        2. Promotions
          1. Creating a catalog price rule
          2. Creating cart price rules
            1. Adding the new rule
            2. Defining the rule's conditions
            3. Defining the rule's actions
            4. Modifying the rule's labels
            5. Generating coupon codes
            6. Testing the rule
        3. Newsletters
          1. Subscribing customers
          2. Creating newsletter templates
          3. Scheduling your newsletter
          4. Checking for problems
          5. Managing your subscribers
        4. Using sitemaps
          1. Adding a sitemap
        5. Optimizing for search engines
          1. Using meta fields for search engine visibility
          2. Meta fields in Magento
          3. SEO checklist
        6. Summary
      7. 7. Extending Magento
        1. Magento Connect
          1. Searching Magento Connect
          2. Why developers create free extensions
        2. The new Magento module architecture
        3. Extending Magento functionality with Magento plugins
        4. Building your own extensions
          1. Whether others have gone before
          2. Your extension files
            1. Step one
            2. Step two
            3. Step three
            4. Step four
            5. Step five
            6. Step six
        5. Summary
      8. 8. Optimizing Magento
        1. Exploring the EAV
          1. Entity
          2. Attribute
          3. Value
          4. Putting it all together
          5. The good and bad of EAV
          6. Making it flat
        2. Indexing and caching
          1. Indexing
            1. Flat or no flat
            2. Reindexing
          2. Caching
            1. Core caching
            2. Full page cache
            3. The impact of caching
            4. Managing caching
        3. Caching in Magento 2 – not just FPC
        4. Tuning your server for speed
          1. Deflation
          2. Enabling expires
          3. Increasing PHP memory
          4. Increasing the MySQL cache
          5. Using the Nginx server
          6. Using Varnish cache
          7. Using a CDN
        5. Summary
      9. 9. Advanced Techniques
        1. Setting up a staging environment
          1. A simple approach
          2. The basic staging setup
          3. Don't be tempted to skip
        2. Version control
        3. Magento cron
          1. Magento cron jobs
          2. Triggering cron jobs
          3. Tuning Magento's schedules
            1. Setting your frequency
            2. Creating compatible settings
        4. Backing up your database
          1. The built-in back-up
          2. Using MySQLDump
          3. Setting a cron for back-up
        5. Upgrading Magento
          1. Obtaining Magento Marketplace keys
          2. Upgrading your Magento installation
        6. Summary
      10. 10. Pre-Launch Checklist
        1. A word about scope
        2. System configurations
          1. SSL
          2. Base URLs
          3. Administrative base URL
          4. Reducing file download time
            1. Merging JavaScript files
            2. Merging CSS files
          5. Caching
          6. Cron jobs
          7. Users and roles
        3. Design configurations
          1. Transactional emails
          2. Invoices and packing slips
          3. Favicon
          4. Placeholder images
          5. 404 and error pages
        4. Search engine optimization
          1. Meta tags
          2. Analytics
          3. Sitemap
        5. Sales configurations
          1. Company information
          2. Store e-mail addresses
          3. Contacts
          4. Currency
          5. General sales settings
          6. Customers
          7. Sales emails
          8. Tax rates and rules
          9. Shipping
          10. Payment methods
          11. Newsletters
          12. Terms and conditions
          13. Checkout
        6. Product configurations
          1. Catalog
            1. Storefront panel
            2. Product reviews
            3. Product alerts
            4. Product alerts run settings
            5. Product image placeholders
            6. Recently viewed/compared products
            7. Price
            8. Layered navigation
            9. Category top navigation
            10. Search engine optimizations
            11. Catalog search
          2. RSS feeds
        7. Maintenance configurations
          1. Backups
        8. Summary
    8. Index