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

Sending Emails via SMTP

msmtp  requires a minimal setup for sending emails via SMTP compared to sendmail. Here is a configuration for you to send emails from a web host to an external SMTP server. Prior to doing that, you must check whether there is a clear communication channel between your web host and the SMTP server. You can use Telnet . Set up msmtp You are going to set msmtp as an MTA . Hence, you need to remove all other MTAs such as postfix and sendmail: $ sudo apt-get --purge autoremove postfix sendmail Install msmtp and related utilities: $ sudo apt-get install msmtp msmtp-mta mailutils Configure msmtp: $ sudo nano /etc/msmtprc # Set default values for all following accounts. defaults # Use the mail submission port 587 instead of the SMTP port 25. port 587 # Always use TLS. tls on # Set a list of trusted CAs for TLS. The default is to use system settings, but # you can select your own file. tls_trust_file /etc/ssl/certs/ca-certificates.crt # The SMTP server account mx host mail.mx.example

fatal: Couldn't find remote ref master

If you are using Github then  master is now known as main . Whatever you want to do with a master must now be referred to a main . If you search for this error message on the Internet then you will encounter with a lot of old discussions on how to set up your master properly which is probably not what you are looking for. The master  is your problem. Rename it to main . I wrote Git My Way about two years ago. Today I created another Github repository. I got this  "fatal: Couldn't find remote ref master"  error message when I wanted to sync the new repo for the first time with my notebook using the notes I wrote in the blog. All the discussions around the error message I found on the Internet were perplexing. Then I recalled that Github had renamed master to main  due to the master-slave connotation. We always have a master copy of a code, never a slave copy. Now suddenly a word context has been diminished for good. What is going to happen to the existing vast documen