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

MethodParametersReturns
fetchValuesentity, idsThe metadata values of those entities. entity is the kind, such as 'product'. ids is one id or an array.

Events

EventFires whenArguments
metadata::value.fetchedfetchValues workedresponse
metadata::value.not.fetchedfetchValues failederror

Gotchas

  • fetchValues without an entity or ids rejects at once with "Please provide entity type and entity ids."
  • Old Twig examples import a MetadataApi class. In a theme, call Salla.metadata.fetchValues instead.

See also

On this page