[Drupal 7] How to convert a custom content type in a Drupal site into an Ubercart product ?

| | 1 min read

In one of my Drupal based shopping cart site powered by Ubercart, the products were customizable(ie, end users had the permission to edit the product). So in order not to overwrite the existing product and to save the changes made by the end user, I had to create a new node with all the values of the product. So I created a new content type and related this to the product content type and saved the node as a new one. If you want to know how to convert a custom content type in a Drupal site into an Ubercart product, read on.

The steps I followed to convert a custom content type into an Ubercart product are,

  1. I created a new content type(admin/structure/types/add) called 'New product'.
  2. I added the required fields for the content type.
  3. Next I created a new product class with the name 'product_new'.
  4. To create this
    1. Go to admin/store/products/classes.
    2. Add a class ID.
    3. The Class ID is the machine readable name of the above content type.
    4. There add a class name: Class name is the human readable name of the content type.


Now if you try to add a content to the new content type, you can see the Ubercart fields too.

Hope that helps