Skip to main content

Creating New Product in Drupal Commerce

Drupal Commerce Kickstart is an all-in-one profile for setting up shopping website or e-shop. Drupal Commerce is built according to the Drupal way. Drupal Commerce is modular and extendable, is based on entities and fields, uses views and taxonomy extensively, and simplifies administrative pages with intuitive menus to ease shop owners.

However, before you can start with Drupal commerce you must first be proficient with the Drupal way. You will not be able to administer your shop if you do not know how Drupal works. You need to get yourself up and running with those Drupal thingy such as entity, field, node, views, taxonomy, menu, module, etc. On top of all that, please take note that Dupal Commerce documentation is very much a work in progress.

Terminology in Drupal can be very confusing. Drupal Commerce adds to the confusion further. You could not have any other way but to learn the actual meaning of all the terms. Never assume anything. Let's start with the product term used in Drupal Commerce. Our basic assumption is that a product is something we are selling in the e-shop. However, in Drupal Commerce we need to precisely check our product assumption.

There is a product type entry where you can define new product type. Well, go define a new product type and be surprised because you cannot immediately add an actual product of the new type that you had just defined. In Drupal Commerce defining a new product is not a single step process.The new product type does not immediately appear in the form for adding new product. Apparently, the new product entry form does not enlist product types but it enlists content types. You have yet to create a content type (which is a basic Drupal thingy) for the product. If you are familiar with Drupal node than you should be familiar with content type. Otherwise, please read Drupal content type. In Drupal Commerce, after you created a product type you must create a content type for the product. The content type must include a field leading to the product type, which is called Product Reference. Suddenly, product type now becomes product reference. And worst, the content type's field name is called Product variations. Well as said earlier, get yourself familiar with the terms. If you are confused then go read this paragraph again.

When you define a product type you are actually define a product variation type. A product itself may have many variations such as colors and sizes. The actual product is a Drupal node which is an entity. The product type is another entity defined by Drupal Commerce. Thus, a product node may refer to one or more product entities.

Steps in creating a product of a new type in Drupal Commerce


  1. Create a new product type, includes all the necessary fields for the product.
  2. Create a new product content type probably with the same name of the product type (1).
  3. Add a Product Reference field in the product content type (2) and point it to the product type (1).
  4. Add a new product node by selecting the newly created product content type (2).
  5. Add a product variation or more, which is based on the newly created product type (1) or existing product types, in the newly created product node (4).
Product image is defined in the product variation. Each product variation may have multiple images. The product gallery view will make use of multiple product images. It is a very good idea to take good photographs of your products in various angles and details.

Every product variation has its own Stock-keeping Unit (SKU) reference for stock control. Drupal Commerce can define SKU automatically but not by default. It is all up to you to manage SKUs.


The five steps mentioned above was simplified to show a larger picture. There are many more details steps you will encounter when you create a new product in Drupal Commerce such as defining product categories and features. You may need to record all the steps you take for you will be doing it again for more new products addition in the future. In fact, you may need to identify all the features of your products and plan ahead before going into Drupal Commerce.

Comments

  1. most of time, i prefer to use Ubercart. even i lost flexibility but it speed up development process. in manner, current ubercart extension modules totally enough to create flexible workflow process totally same like the Drupal Commerce.

    ReplyDelete
    Replies
    1. I agree with you for sake of speed to setup e-shop. In fact there are more specific solutions such as osCommerce and Magento. Drupal Commerce is more for Drupal hardcores and module developers. I find it easier to extend Drupal Commerce because it is designed based on the Drupal way. I believe a successful e-shop will need continuous updating.

      Delete
  2. Drupal is best for ecommerce websites. Good information.

    ReplyDelete

Post a Comment

Popular posts from this blog

Setting Up PyScripter for Quantum GIS

PyScripter is a general purpose Python Integrated Development Environment (IDE). Quantum GIS (QGIS) is a desktop GIS application that can be extended with Python plugins. Both are open source softwares. We intend to use PyScripter as an IDE to build QGIS Python plugin. We are using PyScripter 2.4.1.0 and QGIS 1.6.0 in Windows. PyScripter does not come with Python. On the other hand, QGIS is built in with Python. Thus, we will setup up PyScripter to use the build in Python in QGIS. We assume both PyScripter and QGIS are already installed. Preparing PyScripter batch file We assume that QGIS is installed in C:\OSGeo4W\ folder and PyScripter is installed in C:\Program Files\PyScripter\ . 1. Copy qgis.bat in C:\OSGeo4W\ bin to pyscripter.bat 2. Edit pyscripter.bat to remove the last line that read something like this start "Quantum GIS" /B "%OSGEO4W_ROOT%"\apps\qgis\bin\qgis.exe %* and replace it with this in one line Start "PyScripter" /B "C:\Progr...

Using React in Foundation for Sites

This post was the precursor to the Foundation-React Template . React and Foundation are two different web UI frameworks addressing different needs. They evolve differently. Both of them are powerful on their own accord. Fusing them together may create superpower. We will walk through the process of adding React into Foundation. We will start by installing both Foundation and React through command line interface (CLI). Then we will create a simple Todo web app. Along the way we will highlight the development process. But before all that, let us summarize React and Foundation. The details can be found at their respective websites. Both of them are well documented. React is a run-time UI rendering engine. It renders dynamic UI elements in its own fast virtual DOM, and only update necessary changes to the slow browser DOM. This behaves like a  double buffering DOM which makes any UI update feels fast. React wraps a UI rendering script in a component. A React component can ...

Debugging PHP using Apache Error Log

PHP runs on the server side and behaves like a function that return a value against the given arguments. A remote client may call this function and expect a specified return value and nothing else. So how do we debug this function ? It must not return debugging messages since the client is never designed to handle them. We must never burden any client to handle debugging messages. If we run PHP through Apache server then we can use the error log to keep our debugging messages. It may not be the best way to do it. But we only want to talk about this approach now. Error Logs The Apache error log files generally can be found in the following directory: var/log/apache2 We issue the following command from within the directory to read the latest error messages: # tail error.log The tail command reads the last few lines from the error.log file and prints them on the terminal. If we need to read a specific number of lines from the end of the file then we can specify the -n opti...