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 4. Configuring to Sell

If you've been following along, chapter by chapter, you've created a working, accessible online store front by now. Are you ready to take orders now?

Not just yet. There's still more to do before you can swing open the virtual doors to your new Magento store. Specifically, we need to:

  • Understand the Magento sales process
  • Configure the payment gateways to allow you to take online credit card payments
  • Set up how your products will be shipped
  • Configure sales tax rules
  • Create customized outgoing e-mails

If you're the developer or designer of a Magento powered site, this is usually the time when you consult with your client – the store owner – to learn how they want to take payments, charge for shipping, and offer promotional discounts. Once you understand the concepts in this chapter, you'll be well prepared to ask the right questions.

For store owners and administrators, this chapter will give you insights into what can be managed with Magento. Fortunately, there are few limitations to Magento; however, we are consistently amazed at the various ways retailers price and vend their products. Hopefully, whatever unique selling programs you currently employ can be replicated online with your Magento store. We're betting they can.

The sales process

If you've shopped online before, you no doubt have some understanding of the usual online sales process:

  1. You browse and find a product you want to purchase.
  2. You "add" the product to your virtual shopping cart.
  3. When you're finished shopping, you go to a checkout page.
  4. In most online stores, you will first enter your billing and shipping addresses.
  5. From this information, various shipping alternatives are presented, from which you choose the most appropriate for your needs and budget.
  6. Next, you choose a payment method – usually a credit card – and enter your payment information.
  7. After reviewing your order details, you commit to the purchase and moments later, you receive confirmation that your order has been processed. You usually receive an e-mail receipt of your purchase.
  8. After a day or so, you receive another e-mail announcing that your order has been shipped. This e-mail may also include package tracking numbers so you can follow the progress of your package from distribution to doorstep.

The Magento sales process

Magento duplicates this sales process in pretty much the same way. For our purposes, though, we need to understand what happens after the customer commits to the order, for that is when the store administrator's participation is required.

The following chart illustrates both the frontend and backend steps of the Magento sales process:

The Magento sales process

The black boxes with white type are steps that generally create an e-mail to the customer.

As we'll see in this chapter, there are occasional variations to this process, but in general, the Magento sales process is pretty straightforward. What you'll find impressive is the scope of Magento's ability to give you a wider latitude on adjusting the sales process to meet your particular needs. For instance, if you're selling downloadable products, such as e-books, music or software, you don't need the shipping process steps. Yet, if you sell proprietary digital media, you will need to manage the distribution of the products to your customers. For instance, to prevent unlimited downloads.

Managing backend orders

Before mapping out the business rules that you will use to configure Magento, it's helpful to see and understand how orders are processed in the Magento backend. Many times, developers and administrators new to Magento rush to configure the myriad of settings (which we will be covering in this chapter) without fully realizing how those choices might impact on the overall sales process. It's understandable because most will want to test the ordering system with all the settings in place. It's a bit of a catch-22: you have no orders to use to understand the configurations, yet without the configurations, you can't test the ordering process.

Fortunately, a basic Magento 2 install with the sample data (again with the sample data? Yes!) gives you the basic configurations to allow you to place some sample orders and review the order process.

Tip

Give it a whirl!

If you've installed the sample data, or you have a store already configured to accept some type of test payments, you should spend time placing and processing orders. Try any number of different combinations. Ask your colleagues to place dummy orders, imagining that they are actual shoppers. You'll soon get a real handle on the process, and if you're a developer, your client will certainly appreciate the added insight you have to the Magento ordering process. This is incredibly important to your client, so it should be important to you!

Logging into the Magento backend, we can see our latest orders listed in the left sidebar of the dashboard:

Managing backend orders

From here we can click on the order we wish to process, or we can go to Sales | Orders in the top navigation bar and then select the order from the list of all orders. Either way, we end up with a detailed view of the order.

Let's take each section of this screen separately and explain what each contributes to the ordering process.

Managing backend orders

The first section, shown in the preceding image on the left, summarizes key order information, including the timestamp of the order (date and time), the current status (which by default is pending), and from which Magento store the purchase was made.

New orders, by default, are marked as pending. This means the order is awaiting your attention. The customer has already been charged and has received an e-mail confirmation of their order, but it's now up to you to complete the order, eventually taking it to a stage of complete.

The box on the right tells us the name of the customer, their e-mail address, and the fact that they checked out without registering (more on customer groups later in this chapter).

Managing backend orders

The next row of boxes shows the billing and shipping addresses for the purchaser. Notice that these are editable. Sometimes a customer, upon receiving their e-mail receipt, will see that they made an error in either or both of these. If the customer contacts you with corrected information, you can easily make the changes here.

Managing backend orders

The third row of boxes give you information about the payment method and the buyer's choice of shipping for the order.

Managing backend orders

On row four, you'll find the list of products ordered by the customer, the amount charged and the amount of sales tax applicable for each line item.

Managing backend orders

The final row of boxes are quite interesting and important. First, on the left in the preceding image, is how you can keep notes on an order and update the customer. Let's say, as in this case, that you have discovered that you only have one remaining chair and that more chairs won't arrive for another two weeks. By filling in this information here, and checking the Notify Customer by Email box, you can update the customer ("Would you like us to hold your order, or cancel it?") and have the update sent automatically to the buyer. Furthermore, by checking the Visible on Storefront box, the customer – if they are registered – can view the update in the Account Information section of your store.

All comments entered will be appended to the list at the bottom of the box.

The box to the right is the transaction summary of the order.

Convert orders to invoices

The next step for you, as the person who is processing orders, is to invoice this order. In Magento, this means that you are confirming the order, and proceeding with processing.

Note

You can go straight to shipping for an order without having to generate an invoice. However, it is good practice to go from Order to Invoice to Shipping. In this manner, you are tracking not only the products, but the payments, as well.

To convert an order into an invoice, click the button at the top of the page labeled Invoice. The resulting page is similar to the order page, except that it allows you to perform certain additional functions:

  • Create Shipment: In the box titled Shipping Information, you can check the box labeled Create Shipment and add any tracking numbers to the invoice.
  • Change the Quantity of Products to Invoice: As in our first example, if you have less products in stock than actually on hand, you may want to alter the number of products you are invoicing. Any remaining products will cause the order to remain open for future invoicing.
  • Add Comments: As on the Order page, you can add a comment to the invoice and select whether the comment should be appended to the Invoice. Otherwise, the comment will be added to the order history.

Once you have made any of the preceding changes, you can click on Submit Invoice, which will convert the order to an invoice, and record the order as an actual sale. This is key, as your analysis of sales for your store rely on the analysis of invoices, not orders. If you have not shipped the items yet, the status of the order is now shown as Processing.

Note

Orders are not Sales. Invoices are Sales.

Now that we have converted an order into an invoice, the box on the Dashboard screen, titled Lifetime Sales, is now updated showing the total sales for the chosen period, less shipping and sales taxes, as shown in the following screenshot.

Convert orders to invoices

Creating shipments

Now that we have created our invoice, and once we have shipped the purchased products, we can create one or more shipments. To do this, open the order as before and click the Ship button near the top of the screen.

On this screen, you can add tracking numbers for your shipments, as well as indicate the quantity of each product shipped. In the following image, I have added a sample UPS tracking number. You can add as many as required (you may need to ship an order in more than one box, for instance).

Creating shipments

Lower on the page, you will find each line item of the order, with a field allowing you to change the number of products shipped, as shown in the following screenshot:

Creating shipments

Once you have made any changes, including adding any comments, you can click Submit Shipment. If you ship all ordered items, the status of the order will change to Complete; otherwise, the order will remain Processing.

Once you become familiar with the sales process, you'll have a much better understanding of how various system configurations affect how orders are moved through Magento.