[Drupal] How to add custom fields to a product content type in Ubercart?

| | 1 min read

One of our Drupal clients requested us to create an online envelope editor in their Drupal site. The envelope was a product in Ubercart as the site was a Drupal e-commerce site. The envelope was to be edited by the user of the site using a form interface. We needed to add custom fields to the product content type in Ubercart to get the feature up and running. If you want to know how to add custom fields to a product content type in Ubercart, read on to find out how we did it.

Follow the steps below to add custom fields to a product content type in Ubercart

  • First Go to Structure -> Content Type-> Product in admin/structure/types/manage/product.
    Ubercart Product form add fields
  • Next click on the manage fields tab.
    Ubercart Product form add fields
  • In the 'Add New fields' text-box (Refer the image), Give a name for your field. Ubercart Product form add fields
  • This will automatically add a machine-name for the field
  • You many edit the field but the name cannot be changed after the settings are saved
  • Next select the field type for the field you added.
    Ubercart Product form add fields
  • Select the widget mode.
    Ubercart Product form add fields
  • Finally click on save to save your settings

That's all there is to it

If you need professional assistance in configuring Ubercart in your Drupal site get in touch with us.