Create products

Eventually, after creating attributes and sets, it comes down to adding products. Magento 2 uses the same types of product as Magento 1. This also includes Magento 2 Enterprise.

The product types we can choose from are: Simple Product, Configurable Product, Grouped Product, Virtual Product, Bundle Product, Downloadable Product, and, for the Enterprise Edition (EE), Gift Card.

Depending on the products you would like to sell, you may use one or two of the types. The most used types are Simple and Configurable Products because they rely on one another when you sell shoes, for example.

Product type definitions are as follows:

  • Simple Product: A Simple Product in Magento is a physical product. There are no options such as size or color that the end user can pick during the order. One example of a Simple Product type is a broom or umbrella.
  • Configurable Product: A combination of Simple Products organized with different colors, sizes, or other attributes is called a Configurable Product. One example of a Configurable Product is a shoe or shirt.
  • Grouped Product: A Grouped Product is a collection of Simple Products related to one another. Each Simple Product could be sold separately, but is cheaper as a set. One example of a Grouped Product is a camera plus a photo bag and memory card. This set might offer a special price.
  • Virtual Product: A Virtual Product is a non-physical product. One example of a Virtual Product is a service warranty for your computer or a membership.
  • Bundle Product: A Bundle Product is an extension of a Grouped Product. A Grouped Product does not have the option to configure different choices. But this can be managed using a Bundle Product. One example of a Bundle Product is a building a computer; a customer can choose from a set of different hard disks, monitors, CPUs, memory, and so on.
  • Downloadable Product: A Downloadable Product is a non-physical product. One example of a Downloadable Product is software or an eBook; you can download them online.
  • Gift Card (EE only): A Gift Card can be a physical, virtual, or combined product. This is used as a store credit and can be sold as a gift.

Besides the regular ones, it is possible you may need extra options, depending on your product base. In Magento 1, additional third-party modules, such as Configurable Bundles, Events, Training, Rental, and Recurring, could be bought and installed to manage this.

Using product types is now easier than ever. Magento 2 created a user-friendly flow for configuring Configurable Products on the fly.

Getting ready

To step through this recipe, you will use a Droplet created in Chapter 2, Magento 2 System Tools, at DigitalOcean (https://www.digitalocean.com/). We will be using an NGINX, PHP-FPM, Composer-based setup with a single Magento 2 website, Root Catalog, store view, categories, and attributes preinstalled. No other prerequisites are required.

How to do it...

For the purpose of this recipe, let's assume that we need to create Configurable Product for Magento 2. The following steps will guide you through them:

  1. First, log in to the backend of Magento 2 and go to Products | Catalog. Click on the Add Product button and continue with the following information:

    Product Details

    Name

    Ellis Flat

    SKU

    shw005

    Price

    250.00

    Tax Class

    Taxable Goods

    Images and Videos

    Download the images here: https://github.com/mage2cookbook/chapter4

    Quantity

    100

    Weight

    Yes

    Categories

    Shoes

    Description

    Suede upper. Rubber 0.5" heel. Domestic.

  2. Now hit the Save button. As you can see, you stay in the same screen while your data is being saved. When you want to Save & Close then choose from the drop-down arrow and continue.
  3. Open a new tab in your browser, click the drop-down arrow in the top-right corner, and choose Customer View. This trick will open up a new tab and launch your home page.
  4. Go to your Shoes menu and the newly created product should be visible. In some situations, it is best to clear your cache first if you are having issues.
  5. Congratulations, you just finished creating a Simple Product in Magento 2.

    Now let's go back to our backend and open up the newly created product. Next we are going to set our attribute set we created earlier in this chapter. This option is located above the Product Details title. Here we choose the Shoes attribute set, as shown in the following screenshot:

    How to do it...
  6. After choosing the option, you will see that Magento 2 has loaded a new menu called Shoes under the Search Engine Optimization menu.
  7. Next scroll to the bottom and open up the Configurations drop-down menu. Click the Create Configurations button. This is shown in the following screenshot:
    How to do it...
  8. Next we will use one of the brand new features of Magento 2. This workflow helps to create Configurable Product on the fly. Depending on the attributes, the list of attributes could be long. For now, we pick the shoe_size option. Continue to the next step by hitting the Next button in the top-right corner, as shown in the following screenshot:
    How to do it...
  9. A list shows all the attribute values we created earlier. Click Select All and continue to the next step, as shown in the following screenshot:
    How to do it...
  10. Step 3: Bulk Images, Price, and Quantity to create a Configurable Product is an important step. Commit a price and quantity here, otherwise the product will not show up on the screen (adjusting the value later is straightforward using the same flow). Select Apply single price to all SKUs and Apply single quantity to each SKU and fill in 250 for the Price and 100 for the Quantity. Continue to the next step, as shown in the following screenshot:
    How to do it...
  11. Depending on the values in the attribute list, Associated Products are created. Now click the Generate Products button and all of them are created, as shown in the following screenshot:
    How to do it...
  12. Now save the new setup and check in your browser; the result should be as shown in the following screenshot:
    How to do it...
  13. Congratulations, you just finished creating a Configurable Product in Magento 2.
  14. Now go to https://github.com/mage2cookbook/chapter4#creating-products and continue to the rest of the Shoes and Clothes products. After creating a minimum of two products, our catalog navigation filter (layered navigation) pops up and looks like this:
    How to do it...

How it works…

Let's recap and find out what we did throughout this recipe. In steps 1 through 13, we created a Configurable Product using the new Magento workflow.

In steps 1 through 4, we created a Simple Product and connected it to the attribute set. This product will be the starting point for creating a Configurable Product.

In steps 8 through 11, we used the configurations workflow to select the attributes related to this product and set its values. Depending on the setup, we can apply a single price, image, or quantity to all of the Simple Products created during this process.

There's more…

By default, when creating a product, Magento 2 starts with a Virtual Product. When changing settings such as Weight (Does this have a weight?) to Yes, the product switches to a Simple Product. The same goes for Downloadable and Configurable Product.

This new technique is stunning and a great benefit for store owners. Everybody can now create and change products on the fly.

Bundle and Grouped Products, on the other hand, are more like Magento 1. You first need to choose the product type using the drop-down arrow in the Add Product button and then continue the same flow, as shown in the following screenshot:

There's more…
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.235.79