Commerce - Content Model Design
In order for the Plate Commerce Connector to be able to connect to a site on Plate, the content model of that site needs to adhere to a certain structure. Depending on the desired functionality, you can define more or less content types from this list.
Content Types
The following list of content types should be defined (names can be arbitrary though!):
| Name | Content Type | Required: |
---|---|---|---|
Product | Posts | Always | |
More Product… | Posts | If you want to define multiple product types, and use a custom post types per product type in your site. You should then define as many Product content types within your site as you need to match all product types in your Commerce setup. This is very optional. | |
ProductCategory | Posts | If you want to make use of categories in your site | |
WholesalePrcie | Abstract | If you want to make use of the wholesale price mechanism in your site | |
Attributes | Abstract | If you want to make use of the feature to define custom attributes for your products | |
Options | Abstract | If you want to make use of the feature to define custom options for your products | |
OptionChoice | Abstract | If you use the Option feature as defined above | |
ProductVariation | Abstract | If you want to make use of the product variation feature. | |
SelectedOption | Abstract | If you use the ProductVariation feature as defined above. |
Content Fields
Each content type as defined above has a set of content fields which should be defined for that content type. Again, depending on the desired functionality, some content fields may be omitted. Names can be arbitrary again.
The following sections describe the required content fields per content type, with a description of when they are required, and also how they will be used by the Plate Commerce Connector (PCC).
Product
The Product content type should have the following content fields:
Name | Type | Required: | Comments |
---|---|---|---|
name | String | Always |
|
seoTitle | String | Always |
|
description | String/Text | Always |
|
seoDescription | String/Text | Always |
|
sku | String | Always |
|
quantity* | String (Integer) | If you want to keep track of the stock of certain product in your site | Set to the integer value of the stock by the PCC |
unlimited* | Boolean | If you want to keep track of the stock of certain product in your site, and unlimited stock is an option | Set to true by the PCC if there is unlimited stock |
price | String (Float) | Always | Set to the float price of the product by the PCC |
wholesalePrices* | Reference to WholeSalePrices | If you use the wholesale price functionality within your site | Used to set all wholesale prices by the PCC. |
compareToPrice* | String | If you want to use the ‘compare to price' functionality. |
|
defaultDisplayPrice* | String (Float) | If you want to use this price | The default price that you should display. This is the price which a product has with the default options/variation selected |
defaultDisplayCompareToPrice* | String (Float) | If you want to use this price | The default |
media* | Array of images | If you want to show the images of a product | Will be filled with all images by the PCC. The first image will be the “main” image. |
attributes* | Reference to Attributes | If you use the attribute functionality within your site |
|
categories* | Global Reference to ProductCategories | If you use the category functionality within your site |
|
relatedProducts* | Global Reference to Products | If you want to show related products. (This only works if you have one single post type defined for the products. |
|
options* | Local Reference to Options | If you use the option functionality within your site |
|
combinations* | Local Reference to ProductVariations | If you use the product variation feature within your site |
|
updateTimestamp | String | Always | Will be filled with a timestamp by the PCC, which is required to successfully sync the site with the latest information. |
ecwidID | String | Always | Will be filled with an by the PCC, which is required to successfully sync the site with the latest information. |
Next to that you can define extra Custom Attribute content fields. These should be of type String and can have an arbitrary name. These fields can then be used to map specific single attributes from products to, instead of putting them in the reference field called attributes.
If you want to define custom post types for single product types, each of these post types should follow the exact same content field scheme. The naming can still be arbitrary.
Category
The Category content type should have the following content fields:
Name | Type | Required | Comment |
name | String | Always |
|
description | String | If you want to use the description of a category within your site |
|
image | Image | If you want to show an image related to your category within your site |
|
ecwidID | String | Always | Will be filled with an by the PCC, which is required to successfully sync the site with the latest information. |
WholesalePrice
The WholesalePrice content type should have the following content fields:
Name | Type | Required | Comment |
quantity | String | Always | The quantity starting from which the product will be priced using the corresponding prices. |
price | String (Float) | Always | The price which is used from the corresponding order quantity. |
Attribute
The Attribute content type should have the following content fields:
Name | Type | Required | Comment |
name | String | Always | Name of the attribute |
value | String | Always | Value of the attribute |
Option
The Option content type should have the following content fields:
Name | Type | Required | Comment |
name | String | Always | Name of the Option |
type | String | Always | Type of the option (one of |
choices | Local reference to OptionChoice | Always | Will be filled with options if type is one of |
defaultChoice | String | Always | Will be filled with the index of the default selected options if type is one of |
required | Boolean | Always | Will be set to true if the site user is required to provide an input for this option. |
OptionChoice
The OptionChoice content type should have the following content fields:
Name | Type | Required | Comment |
text | String | Always | Value of this choice |
priceModifier | String(Float) | Always | How much selecting this option will change the price of this product for the user |
priceModifierType | String | Always | Indicates how the value for priceModifier is used. Will be one of |
ProductVariation
The ProductVariation content type should have the following content fields:
Name | Type | Required | Comment |
sku | String | Always |
|
quantity | String | If you want to keep track of the stock of certain product in your site | Set to the integer value of the stock by the PCC |
unlimited | Boolean | If you want to keep track of the stock of certain product in your site, and unlimited stock is an option | Set to true by the PCC if there is unlimited stock |
price | String (Float) |
|
|
wholesalePrices* | Local Reference to WholeSalePrices | If you use the wholesale price functionality within your site | Used to set all wholesale prices by the PCC. |
compareToPrice* | String | If you want to use the ‘compare to price' functionality. |
|
image | Image | If you want to show the image of a product variation |
|
options | Local reference to SelectedOption | Always |
|
ecwidID | String | Always | Will be filled with an by the PCC, which is required to successfully sync the site with the latest information. |
SelectedOption
The SelectedOption content type should have the following content fields:
Name | Type | Required | Comment |
name | String | Always | Name of the selected option |
value | String | Always | Value of the selected option |