Custom attribute configuration

This commit is contained in:
Vesa Luusua 2017-12-19 19:26:22 +02:00
parent aa55b028c1
commit 8fc4ce1b9c

View file

@ -200,6 +200,34 @@ const stripeSupportedCountries = [
},
];
// Custom attributes are marketplace specific listing data (e.g. listing could have a category).
// Custom attributes can be defined through management console and code related to custom
// attributes should be changed accordingly.
//
// Here's an example what custom attributes might look like for bicycle listings. This code
// assumes that a custom attribute, called 'category', is created through management console
// with 4 possible values: 'road', 'mountain', 'track', and 'other'.
//
// When listing information is queried customAttributes is returned among other attributes:
// {
// id: 1,
// type: 'listing',
// attributes: {
// title: 'sauna',
// // and description, closed, deleted, price, etc.
// customAttributes: {
// category: "mountain",
// // and other added custom attributes as "key: value" pairs
// },
// },
// }
const customAttributes = {
category: {
type: 'singleChoice', // possible values: 'singleChoice' (only type supported atm.)
values: ['road', 'mountain', 'track', 'other'],
},
};
// Address information is used in SEO schema for Organization (http://schema.org/PostalAddress)
const addressCountry = 'FI';
const addressRegion = 'Helsinki';
@ -237,6 +265,7 @@ const config = {
sdk: { clientId: sdkClientId, baseUrl: sdkBaseUrl },
currency,
currencyConfig,
customAttributes,
stripe: { publishableKey: stripePublishableKey, supportedCountries: stripeSupportedCountries },
canonicalRootURL,
address: {