WebshopProducts

Add custom product fields

Use the data model to add fields that Nimbu does not put on a product by default.

Audience: Administrator, DeveloperRequired access: Products, Data modellingVerified on Language: English

Nimbu gives every product a name, a price, images, and stock. What comes after that differs per shop. A coffee roaster wants roast level and origin, a clothing shop wants fabric composition. That is what the data model is for.

You find it through ProductsData model. On a Dutch admin the heading reads Producten / Gegevensmodel, with the Productvelden (product fields) section below it.

The product data model screen with the product fields section and four fields in the label, name, and type columns.View full size
Each custom field lists its label, its API name, and its type; the green button top right saves the structure. (Interface shown in Dutch.)

Add a field

  1. Open ProductsData model.
  2. Choose Een nieuw veld toevoegen (add a new field).
  3. Fill in the field label. That is the name editors see on the product form.
  4. Fill in the field name. Your theme or an integration uses that one.
  5. Choose the data type.
  6. Choose Structuur bijwerken (update structure) at the top right.

Get the field name right the first time. Changing it later breaks every piece of theme or integration that already refers to it. The label you can change whenever you like.

The kinds of field

You can choose from these types:

TypeUse it for
stringShort text on one line
textLonger text over several lines
emailAn email address
integerA whole number
floatA number with decimals
booleanYes or no
fileOne file, such as a manual
date, time, date_timeA date, a time, or both
selectOne choice from a list
multi_selectSeveral choices from a list
calculatedA value derived from other fields
belongs_toA reference to one other item
belongs_to_manyA reference to several items
customerA reference to a customer
galleryA set of images
geoA location
jsonStructured data for developers

The type picker shows these under Dutch names. string appears as Tekenreeks, select appears as Enkelvoudige selectie.

Torn between string and select? Pick select as soon as the answers fit on a short list. It saves you cleaning up spelling variants later.

The extra settings

Behind the field-settings toggle sits the rest of the field: a Beschrijving (description) that becomes a hint next to the field, and checkboxes for required, translatable, and unique. Depending on the type, more settings appear.

The language button sits at the top right. Switch language there to translate your field labels.

Options on a select field

You can only add the options of a select field after saving the field once. So the order is:

  1. Create the field with type select and choose Structuur bijwerken.
  2. Open the field settings on that field.
  3. Under the options heading, choose Een nieuwe keuzemogelijkheid toevoegen (add a new option) and fill in the option name.
  4. Choose Structuur bijwerken again.
The field settings of a select field, with the required, translatable, and unique checkboxes and the options Licht, Medium, and Donker.View full size
You add the options of a select field under the options heading, through the link to add a new option. (Interface shown in Dutch.)

If you are adding several options, save in between. When we added three in one go, one of them did not make it.

Where your fields end up

On the product form, your own fields appear in the Aangepaste attributen (custom attributes) section. A select field becomes a picker holding the options you set.

The product form with the custom attributes section holding Herkomst and Branding, and the collections section below it.View full size
Custom product fields appear on the product form under custom attributes; below that, the collections section lists which collections hold the product. (Interface shown in Dutch.)

Fill in the value of a select field through this form. In our testing it was not writable through the API.

Under the search options you can list fields to exclude from search. Use it for content that muddies results, such as internal codes or a technical json field. Leave it empty and Nimbu indexes every field.

Customers have the same data model, with the same field types. See Add custom customer fields.