Table of Contents for
Magento 2 - Build World-Class online stores

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition Magento 2 - Build World-Class online stores by Jonathan Bownds Published by Packt Publishing, 2017
  1. Cover
  2. Table of Contents
  3. Magento 2 - Build World-Class online stores
  4. Magento 2 - Build World-Class online stores
  5. Credits
  6. Preface
  7. 1. Module 1
  8. 1. Magento Fundamentals
  9. XAMPP installation
  10. Magento
  11. Summary
  12. 2. Magento 2.0 Features
  13. An introduction to the Magento order management system
  14. Magento 2.0 command-line configuration
  15. The command-line utility
  16. Summary
  17. 3. Working with Search Engine Optimization
  18. Store configuration
  19. SEO and searching
  20. SEO catalog configuration
  21. Google Analytics tracking code
  22. Optimizing Magento pages
  23. Summary
  24. 4. Magento 2.0 Theme Development – the Developers' Holy Grail
  25. Magento 2.0 theme structure
  26. The Magento Luma theme
  27. Magento theme inheritance
  28. CMS blocks and pages
  29. Custom variables
  30. Creating a basic Magento 2.0 theme
  31. Summary
  32. 5. Creating a Responsive Magento 2.0 Theme
  33. Composer – the PHP dependency manager
  34. Building the CompStore theme
  35. CSS preprocessing with LESS
  36. Applying new CSS to the CompStore theme
  37. Creating the CompStore logo
  38. Applying the theme
  39. Creating CompStore content
  40. Customizing Magento 2.0 templates
  41. Summary
  42. 6. Write Magento 2.0 Extensions – a Great Place to Go
  43. Using the Zend framework
  44. Magento 2.0 extension structure
  45. Developing your first Magento extension
  46. The Twitter REST API
  47. The TweetsAbout module structure
  48. Using TwitterOAuth to authenticate our extension
  49. Developing the module
  50. Summary
  51. 7. Go Mobile with Magento 2.0!
  52. Adjusting the CompStore theme for mobile devices
  53. The Magento 2.0 responsive design
  54. The Magento UI
  55. Implementing a new CSS mixin media query
  56. Adjusting tweets about extensions for mobile devices
  57. Summary
  58. 8. Speeding up Your Magento 2.0
  59. Indexing and caching Magento
  60. Indexing and re-indexing data
  61. The Magento cron job
  62. Caching
  63. Fine-tuning the Magento hosting server
  64. Selecting the right Magento hosting service
  65. Apache web server deflation
  66. Enabling the expires header
  67. Minifying scripts
  68. Summary
  69. 9. Improving Your Magento Skills
  70. Magento knowledge center
  71. Improving your Magento skills
  72. Summary
  73. 2. Module 2
  74. 1. Magento 2 System Tools
  75. Installing Magento 2 sample data via GUI
  76. Installing Magento 2 sample data via the command line
  77. Managing Magento 2 indexes via the command line
  78. Managing Magento 2 cache via the command line
  79. Managing Magento 2 backup via the command line
  80. Managing Magento 2 set mode (MAGE_MODE)
  81. Transferring your Magento 1 database to Magento 2
  82. 2. Enabling Performance in Magento 2
  83. Configuring Redis for backend cache
  84. Configuring Memcached for session caching
  85. Configuring Varnish as the Full Page Cache
  86. Configuring Magento 2 with CloudFlare
  87. Configuring optimized images in Magento 2
  88. Configuring Magento 2 with HTTP/2
  89. Configuring Magento 2 performance testing
  90. 3. Creating Catalogs and Categories
  91. Create a Root Catalog
  92. Create subcategories
  93. Manage attribute sets
  94. Create products
  95. Manage products in a catalog grid
  96. 4. Managing Your Store
  97. Creating shipping and tax rules
  98. Managing customer groups
  99. Configuring inventories
  100. Configuring currency rates
  101. Managing advanced pricing
  102. 5. Creating Magento 2 Extensions – the Basics
  103. Initializing extension basics
  104. Working with database models
  105. Creating tables using setup scripts
  106. Creating a web route and controller to display data
  107. Creating system configuration fields
  108. Creating a backend data grid
  109. Creating a backend form to add/edit data
  110. 6. Creating Magento 2 Extensions – Advanced
  111. Using dependency injection to pass classes to your own class
  112. Modifying functions with the use of plugins – Interception
  113. Creating your own XML module configuration file
  114. Creating your own product type
  115. Working with service layers/contracts
  116. Creating a Magento CLI command option
  117. 3. Module 3
  118. 1. Planning for Magento
  119. Technical considerations
  120. Global-Website-Store methodology
  121. Planning for multiple stores
  122. Summary
  123. 2. Managing Products
  124. Managing products the customer focused way
  125. Creating products
  126. Managing inventory
  127. Pricing tools
  128. Autosettings
  129. Related products, up-sells, and cross-sells
  130. Importing products
  131. Summary
  132. 3. Designs and Themes
  133. The concept of theme inheritance
  134. Default installation of design packages and themes
  135. Installing third-party themes
  136. Inline translations
  137. Working with theme variants
  138. Customizing themes
  139. Customizing layouts
  140. Summary
  141. 4. Configuring to Sell
  142. Payment methods
  143. Shipping methods
  144. Managing taxes
  145. Transactional e-mails
  146. Summary
  147. 5. Managing Non-Product Content
  148. Summary
  149. 6. Marketing Tools
  150. Promotions
  151. Newsletters
  152. Using sitemaps
  153. Optimizing for search engines
  154. Summary
  155. 7. Extending Magento
  156. The new Magento module architecture
  157. Extending Magento functionality with Magento plugins
  158. Building your own extensions
  159. Summary
  160. 8. Optimizing Magento
  161. Indexing and caching
  162. Caching in Magento 2 – not just FPC
  163. Tuning your server for speed
  164. Summary
  165. 9. Advanced Techniques
  166. Version control
  167. Magento cron
  168. Backing up your database
  169. Upgrading Magento
  170. Summary
  171. 10. Pre-Launch Checklist
  172. System configurations
  173. Design configurations
  174. Search engine optimization
  175. Sales configurations
  176. Product configurations
  177. Maintenance configurations
  178. Summary
  179. Index

Chapter 1. Planning for Magento

It's not difficult to download Magento 2. With some hosting companies, it only takes a simple request or "one-click" to do an initial installation of this powerful e-commerce platform. The question now becomes, "where do you go from here?"

Before you even download and install Magento, it's important that you take some time to plan. The temptation to dive right in and get your feet wet is strong – especially for those of us who enjoy exploring new technologies. However, this is perhaps the primary reason why many people abandon Magento even before they get off the ground. Not only are there lots of wonderful features and configurations to tackle, there are significant installation issues to consider even before you download the installer.

Tip

Avoid the "uninstall-reinstall" syndrome. Plan your installation before you install and you're less likely to have to start all over again at a later date.

In this chapter, the following topics will be covered:

  • How to form a plan for your Magento installation
  • How to analyze and research your hosting alternatives
  • How Magento's powerful Global-Website-Store methodology gives you tremendous power to run more than one website in a single installation
  • How to plan for multiple languages, business entities, and domains

Defining your scope

There are three important areas to consider when defining your e-commerce project:

  • Your project requirements (What do you want to accomplish?)
  • Your users (Who will be using your Magento installation? What are their roles and capabilities?)
  • Your technical resources (What are your own skills? Do you have others on whom you will rely?)

It is never wise to skimp on defining and analyzing any of these, as they all play crucial roles in the successful implementation of any e-commerce project (or any web project). Let's look at each of them in detail.

Project requirements

Magento is a powerful, full-featured e-commerce platform. With that power comes a certain degree of complexity (one very good reason to keep this book handy!). It's important to take your analysis of how to leverage this power one step at a time. As you discover the many facets of Magento, it's easy to become overwhelmed. Don't worry. With proper planning, you'll soon find that Magento is quite manageable for whatever e-commerce project you have in mind.

It is very likely that your e-commerce project is ideal for Magento, particularly if you intend to grow the online business well beyond its initial design and configuration – and who doesn't? Magento's expandability and continued development insures that, as an open source platform, Magento is the ideal technology for both start-up and mature stores.

When considering Magento as a platform, here's what Magneto offers that makes it shine:

  • Large numbers of products, categories, and product types.
  • Multiple stores, languages, and currencies sharing the same product catalog.
  • The ability to add features as needed, whether obtained from third parties or by your own efforts.
  • Large, involved developer community, with thousands of experienced developers around the world. You are now a member of that community and able to share your questions and experiences through forums and blogs hosted by Magento and others, such as MageDaily.com.
  • Robust, yet usable user interface for administering your store.

Where you might find Magento to be more than required is if you have only a small handful of products to offer or expect very few sales.

If you think that Magento might be too complicated to use as an e-commerce platform, think again. Power always involves some level of complexity. With Mastering Magento 2, we feel the challenge of using Magento will quickly become an appreciation for all the ways you can sell more products online.

Requirements checklist

How are you going to be using your Magento installation? This list will help you focus on particular areas of interest in this book. Answer these questions, as they pertain to your single Magento installation:

  • Will you build more than one online store? How many? Will each store share the same products or different catalogs?
  • Will you build different versions of stores in multiple languages and currencies?
  • What types of products will be offered? Hard goods? Downloadable? Subscriptions? How many products will be offered?
  • Will products be entered individually or imported from lists?
  • How many customers do you expect to serve on a monthly basis? What is your anticipated growth rate?
  • Are there particular features you consider to be "must-haves" for your stores, such as social marketing, gift certificates, newsletters, customer groups, telephone orders, and so on?

Whatever you can conceive for an e-commerce store, it can almost always be accommodated with Magento!

Planning for users

The second stage to defining your scope is to think about "users" – those who will be actually interacting with Magento: customers and store staff. These are people who have no technical expertise, and for whom using the site should be straightforward and intuitive.

Designers and developers may use Magento's administration screens to configure an installation, but it's the ones actually interacting with Magento on a daily basis for which designers and developers must plan. As you use this book to craft a successful Magento store, always keep the end-user in mind.

Who are your users? Basically, your users are divided into two segments: staff and customers.

Staff

Staff refers to those who will be using the Magento administration screens on a daily basis. Magento's administration screens are elegant and fairly easy to use, although you'll want to pay close attention to how you create user permissions. Some users won't need access to all the backend features. By turning off certain features, you can make the administration area much more user-friendly and less overwhelming. Of course, regarding staff managers, additional permissions can give them access to reports, marketing tools, and content management sections. In short, as you work with staff, you can fine tune their back-end experience and maximize their effectiveness.

Tip

One key staff user should be designated as the "Administrator". If you're the one who will be responsible for managing the Magento configurations on an ongoing basis, congratulations! You now have at your fingertips the power to adjust your online business in ways both significant and subtle. You also have in front of you the guidebook to give you a full appreciation of your capabilities.

For store administrators, Packt Publishing offers a companion book, Learning Magento 2 Administration. This book, authored by Bret and Cyndi Williams, is the perfect training and reference book for your staff.

Customers

There are several types of customers, and they are based on their relationship to the vendor: retail and wholesale. Among these customers, you can also have customers that are members of the site – and therefore privy to certain pricing and promotions – both on the retail and wholesale level. You can also subdivide wholesalers into many other levels of manufacturers, jobbers, distributors, and dealers, all operating through the supply chain.

Magento has the ability to handle a variety of different users and user types, including all the ones mentioned above.

Tip

The one caveat to consider when scoping users is that if you are going to use a single Magento installation to operate more than one business – which can certainly be done – you cannot create unique permissions for staff users which restrict them to managing the content, customers, and orders of any one business.

Assessing technical resources

As reviewed in the Preface, there are basically three different types of people who will be involved in any Magento installation: the Administrator, the Designer, and the Developer. Which one, or ones, are you?

As a complete, installable platform, make sure you have sufficient technical resources to handle all aspects of web server configuration and administration. It is not uncommon to find one or maybe two people tackling the installation, configuration, and management of a Magento installation. The web industry is well populated with "Jacks-of-all-Trades." As you analyze your own technical abilities, you may find it necessary to hire outside help. These are the disciplines that can help you maximize your Magento success:

  • User interface design: Even if you use one of the many themes available for Magento stores, you will find the need to adjust and modify layouts to give your users a great online experience. Knowledge of HTML, CSS, and JavaScript is critical, and the use of these across multiple browser types means maximum accessibility. As we'll learn in this book, specific knowledge of the Magento design architecture is a plus.
  • PHP: Many people setting up a Magento store can avoid having to work with the underlying PHP programming code. However, if you want to expand functionality or significantly modify layouts, the ability to at least navigate PHP code is important. Furthermore, a familiarity with programming standards, such as the model-view-controller methodology used in Magento coding (explained in Chapter 5, Managing Non-Product Content), will increase your ability to modify and, when necessary, fix code.

    Tip

    When hiring a developer for your Magento store, make sure you find someone with specific experience with Magento 2. The new architecture and coding standards require particular knowledge. Magento provides a list of certified Magento developers at http://www.magentocommerce.com/certification/directory. Be sure to inquire about Magento 2 qualifications.

  • Sales processes: Selling online is more complex than most newcomers imagine. While it appears fairly simple and straightforward from the buyers point of view, the backend management of orders, shipping, payment gateways, distribution, tracking, and so on requires a good understanding of how products will be priced and offered, inventory managed, orders and returns processed, and shipping handled. Businesses vary as much by how they sell their products as they do by the product categories they offer.
  • Server administration: From domain names and SSL encryption to fine-tuning for performance, the management of your Magento installation involves a thorough understanding of how to configure and manage everything from web and mail servers to databases and FTP accounts. In addition, PCI compliance and security is becoming an increasingly important consideration.

    Tip

    Fortunately, many Magento-friendly hosting providers offer assistance and expertise when it comes to optimizing your Magento installation. In Chapter 8, Optimizing Magento, we explain ways you can perform many of the optimization functions yourself, but don't hesitate to have frank discussions with potential hosting providers to find out just how much and how well they can help you with your installation.

    If you choose to host the installation on your own in-house servers, note that Magento does require certain "tweaks" for performance and reliability, which we cover in Chapter 8, Optimizing Magento.