Trait Type Object Reference
On this page
Overview
A specific type of trait such as Width, Height, Color, Size. This belongs to a Trait Category and can have many Trait Values.
| Property | Value |
|---|---|
| API Name | s_c__Trait_Type__c |
| Label | Trait Type |
| Plural Label | Trait Types |
| Type | Custom Object |
Fields
| Field Label | API Name | Type | Required | Description |
|---|---|---|---|---|
| Display As Filter | s_c__Display_As_Filter__c |
Checkbox | No | If checked, the trait type would be displayed as a filter option for product search. |
| Display Name | s_c__Display_Name__c |
Text(255) | Yes | Name of the Trait Type to be displayed to the user. |
| Display on Product Page | s_c__Display_On_Product_Page__c |
Checkbox | No | If set as true, all related Traits for this Trait Type will be included on the Traits collection in liquid. |
| Position | s_c__Position__c |
Number(18,0) | No | The position of this Trait Type. Lower numbers are shown first, objects without a number are sorted alphabetically by name |
| Trait Category | s_c__Trait_Category_Id__c |
Lookup (s_c__Trait_Category__c) | Yes | The Trait Category for this Trait Type belongs to. |
| Unit | s_c__Unit__c |
Picklist | No | Unit provides a way to further clarify what the value of the Trait Type is. For example, the Trait Type Value_Type__c might be a “Number” which is a decimal value, but the unit might be “Centimetres” which then would be displayed on the store as “2.3 cm”. |
| Value Type | s_c__Value_Type__c |
Picklist | Yes | The nature of values for this Trait Type. Examples of valid types are Checkbox, Currency, and Number. |
| StoreConnect External ID | s_c__sC_Id__c |
Text(36) | No | StoreConnect External ID, do not modify in Salesforce |
Relationships
| Field | Type | Related Object | Relationship Name |
|---|---|---|---|
s_c__Trait_Category_Id__c |
Lookup | s_c__Trait_Category__c | Trait_Types |
Referenced by
These objects hold a lookup or master-detail relationship to Trait Type (s_c__Trait_Type__c). Where the referring record exists to join things together, Also links to shows what it connects this object to.
| Object | Field | Type | Relationship Name | Also links to |
|---|---|---|---|---|
| s_c__Product_Trait_Template_Item__c | s_c__Trait_Type_Id__c |
Lookup | Product_Trait_Template_Items | — |
| s_c__Trait__c | s_c__Trait_Type_Id__c |
Lookup | Traits | — |
| s_c__Trait_Value__c | s_c__Trait_Type_Id__c |
Lookup | Trait_Values | — |
On the storefront
Storefront templates read this object through the TraitType Liquid object, written as trait_type in a theme.
| Salesforce field | Liquid attribute |
|---|---|
s_c__Display_Name__c |
trait_type.name |
s_c__Unit__c |
trait_type.unit |
s_c__Value_Type__c |
trait_type.value_type |
Fields you add yourself are not listed above. Expose one with a Custom Data Mapping record, then read it from trait_type.data. See custom data fields in Liquid.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.