Color swatches as product options in Ecwid API
What's new
Product options will soon have "Color swatches" options. And now these are available with Ecwid API.
Changes in 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 withSWATCHES
options.New fields for the
option[]
->choices
object:hexCodes
andimageId
. 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 theuseImageAsSwatchSelector
field. If it'strue
, swatches open specific product image when clicked. Iffalse
, then the swatches are represented as colored circles using provided hexCodes) instead of the radio buttons.
Documentation links
Find swatches and related new fields in product options.
Update productLast updated
Was this helpful?