A simplified Drupal Commerce workflow with Inline Entity Forms

We love Drupal Commerce!

Its an extremely flexible ecommerce framework largely built on rules which as a site builder makes me very happy.

It is above and beyond our current go-to platform for building ecommerce sites. However if you have ever built a site with Drupal Commerce you know that there are few main components, Product Types, SKU’s and Product Displays.

For those of you who are unfamiliar, when using Drupal Commerce you create a content type as a “Display” which will house certain “Product Types” via a product reference field. You can have multiple product types which will house all of your various SKU’s.

You can think of displays as shelves in a physical retail store. Once you have built your “shelf” you can then place your “shirts” on it. A “shirt” would be an example of a product type. The shirts on your shelf may be different sizes and different colors but they are all shirts. The SKU is what would differentiate the various size and color options. This is a common way we would explain this to new clients who we are building a Drupal Commerce site for that may not be familiar with the platform.

This concept of Displays, Product Types, and SKU's, although very logical, can cause a bit of confusion and can feel cumbersome. This is especially true since the creation of displays and products are managed in two different areas of the site.

Enter the Inline Entity Forms module.

The Inline Entity Form module adds a new widget type to the Product Reference field which when added to a Display allows for streamlined workflow for users to add/manage products all within the display!

To achieve a basic set up for this simply do the following (assuming you have Drupal Commerce installed and configured):

  1. Install and enable the Inline Entity Form module.
  2. Add a product reference field to your Display Content Type.
  3. Select the new “Inline entity form - Multiple values” options as the widget for this field.
  4. Select the product types you want to be referenced for this display.
  5. Select Allow Users to add new products.
  6. Select Unlimited on the number of values
  7. Save 

*There are some other options which are helpful in this set up that you can explore but this is what I would consider the basis to streamlining this process.

Now with this set up a user can add a product to their site by creating a display. Within the display there is a product reference section that will allow them to select a product type and add/configure individual skus of that type, for that display….all in one place :).

If they want to add existing skus to a display they can do that as well with some options selected in the widget set up.

We find this to be a great improvement to the product creation/management workflow and have had a better response from clients when rolling out new systems with this set up. I highly recommend you check out the Inline Entity Form module if you a builing a drupal commerce site. As always a big thanks to Ryan Szrama (rszrama) and all the folks over at Commerce Guys for building/maintaining such an awesome ecommerce framework & contributed modules to extend it!

Mike's picture
Author: 
Mike
Tags: 
Drupal
Site Building