Commerce Layer
The Commerce Layer Field Type extension allows users to select products and SKU lists from Commerce Layer and enhance or list the information with Storyblok.
Functionality
Storyblok users can search within the Commerce Layer product catalogue and pick products from a grid:
Additionally, they can switch between different markets and select products that are available in a specific location.
When selecting a product from a specific location, the output will be extended by the market number:
{ "plugin": "sb-commerce-layer", "items": [ { "name": "Black Women T-Shirt with White Logo (L)", "id": "BdplSqQREN", "sku": "TSHIRTWS000000FFFFFFLXXX", "image": "https://data.commercelayer.app/seed/images/skus/TSHIRTWS000000FFFFFFLXXX_FLAT.png", "type": "product", "market": 10460 } ] }
Furthermore, they can also select an SKU list:
Prerequisites
Before diving into the installation process, here are the requirements that need to be met before you start:
Installation
Storyblok's support will install the Field Type to your space upon request. For the setup, certain options are needed that are provided by Commerce Layer.
Integration Credentials
To create an integration application and retrieve the integration API credentials, please follow the instructions provided here.
- Copy the Client ID and Client Secret to the clipboard.
- Navigate to the Storyblok Encryption Service, encrypt the Client Secret, and copy it.
Sales Channel Credentials
In order to create a sales channel application and retrieve the sales channel API credentials, follow the instructions provided here.
- Copy the Client ID and optionally the market number of the Sales Application.
How to setup
After retrieving all necessary credentials, you are ready to configure the Field Type options:
Required options:
apiURL
- HTTPS base endpoint of your Commerce Layer organization (e.g.: https://[organization].commercelayer.io)integrationClientId
- The client_id from your integration API credentialsintegrationClientSecret
- The client_secret from your integration API credentials. The value of this option must be encrypted using the Storyblok Encryption Service.
Optional options:
salesChannelClientId
- The client_id from your sales channel API credentials.salesChannelDefaultMarketNumber
- number of a specific sales channel market (e.g.: 10460). Note that this option must be provided together with salesChannelClientId but can also be omitted.limit
- maximum number of selected itemsselectOnly
- can be defined to limit the selection to just one category (e.g.: product or category)
How to use
You can find more information on how to use the data provided by the extension inside your code inside the Commerce Layer guide documentation.