metadata
Read the values of the merchant's custom fields for products and other entities.
Use Salla.metadata to read metadata: extra fields the merchant adds to products and other entities, such as a care guide or a material.
const { data } = await Salla.metadata.fetchValues('product', [101, 102, 103]);Methods
| Method | Parameters | Returns |
|---|---|---|
fetchValues | entity, ids | The metadata values of those entities. entity is the kind, such as 'product'. ids is one id or an array. |
Events
| Event | Fires when | Arguments |
|---|---|---|
metadata::value.fetched | fetchValues worked | response |
metadata::value.not.fetched | fetchValues failed | error |
Gotchas
fetchValueswithout an entity or ids rejects at once with "Please provide entity type and entity ids."- Old Twig examples import a
MetadataApiclass. In a theme, callSalla.metadata.fetchValuesinstead.