<img src="abc.png" />
    
call to replace anchor tags contains '/admin' in href

Entities

Entities are basic building blocks of the store. There is one entity for the same type of resource e.g. product, order, user etc. 
There are two types of entities:

  1. Global Entities
  2. Store Entities

Global Entities

StoreHippo provides the global pre-defined entities for common functionalities. Global entities are namespaced with (ms.) to separate them from store entities. Examples of global entities are:

  • Products (ms.products)
  • Orders (ms.orders)
  • Users (ms.users)
  • Categories (ms.categories)
  • Brands (ms.brands)
  • Collections (ms.collections)

Store Entities

Store entities are available in Enterprise Plan. 

Stores can extend their functionalities by defining custom entities. Go to Advance Settings > Entities section in StoreHippo Admin Panel to manage store entities.

Adding a new Entity

To add a new entity, click the Add New button in the top right corner. The following page will open:
 

Entity Name

Enter the name of the entity that you want to create.

Entity Settings 

Click on the gear icon next to the Entity Name to edit the entity settings. Following are commonly used entity settings:

Fields

Below the entity name field, there is a table which lists down the fields that are part of this entity.  Enter the name of the field in the Name column and data type of the field in the Type column. Following are the possible data types for the field:

  • String
  • Number
  • Text
  • Array (list of records)
  • Collection (subentity)
  • date
  • datetime
  • object
  • file

Field Settings

Click on the gear icon in the same row as the field to edit the field settings. Following are the commonly used field settings:

Edit Type

Defines the edit type or display type of the field. This edit type is used as input type for the field when a record is added or edited. Following are the available edit types:

  • text 
  • textarea
  • checkbox
  • radio
  • select
  • password
  • email
  • phone
  • autocomplete
  • state
  • country
  • html
  • widget

Validation

Validation field allows you to define the validation rules for the field. You can define more than one validation rules for a field. Following are available validation rules:

  • numeric
  • boolean
  • URL
  • email
  • function
  • zip_code
  • regex
  • min_length
  • max_length
  • greater_than
  • less_than
  • match_other_field

Required

Check this setting to make the field as required.

Hidden

Check this setting to make the field hidden in the add and edit forms.

Default

Specify the default value for the field if no value is passed.

Placeholder

Defines the placeholder for the field in the forms.

Formatter

You can define a function to show the field value in a specifically formatted way on the listing pages in the Admin Panel.

Field Groups

You can group the fields. The grouped fields can be shown together e.g. in a tab or in accordion depending on the form template.

Entity Commands

There are built-in entity commands (get, list, add, edit, delete etc.) available for all entities. Apart from built-in commands, there are custom commands for different entities. For example, Order entity has commands receivePayment, ship etc. 

Metafields

Metafields allows you to add custom fields to a global entity.  

User Entities

User entities can be seen as an extension of Users (ms.users) entity. For example, in a multi-role school applications, there would be user entities for school admin, teachers, students and parents. Every record in a user entity is linked to a record in main Users entity. The main Users entity contains the account related information about the user while the child user entity will contain role specific fields.

 

2018-04-23T13:32:03.882Z