Color swatches as product options in Ecwid API
Last updated
Was this helpful?
Last updated
Was this helpful?
Product options will soon have "Color swatches" options. And now these are available with Ecwid API.
New value for the options[]
-> type
field: SWATCHES
. It allows product option to work as a color swatch.
New field for option object in the options[]
: useImageAsSwatchSelector
. It only works with SWATCHES
options.
New fields for the option[]
-> choices
object: hexCodes
and imageId
.
They allow you to define storefront display options for the swatch: swatches can either be displayed as colored circles or open a specified product image when clicked.
This behavior is controlled by the useImageAsSwatchSelector
field. If it's true
, swatches open specific product image when clicked. If false
, then the swatches are represented as colored circles using provided hexCodes) instead of the radio buttons.
Find swatches and related new fields in product .