"recommendation" event
The shopper’s recommended size for this product, in your size labels: on mount when the shopper is already connected, and on every change. Sizes only, never measurements.
The size guide element always listens; for other elements, adding a handler starts it. Preselect your picker, but never override a size the shopper picked themselves.
recommendation: Recommendation;Payload
Section titled “Payload”productstringRequiredstatusRecommendationStatusRequiredready, computing, none, signed_out or unavailable. See tys.recommendation().
sizestring | nullRequiredThe recommended size in the store's own label (its size map), or null.
studioSizestring | nullRequiredThe same size as entered in TryYourSize Studio, or null.
wearableSizesstring[]OptionalSizes that can be worn on this body, in the store's labels (when simulated).
Example
Section titled “Example”let touched = false;sizePicker.addEventListener("change", () => (touched = true));guide.on("recommendation", (r) => { if (r.status === "ready" && !touched) sizePicker.value = r.size;});<SizeGuide product="SKU-123" onRecommendation={(r) => { if (r.status === "ready" && !touched) setSize(r.size); }}/>el.addEventListener("tys:recommendation", (e) => { if (e.detail.status === "ready" && !touched) sizePicker.value = e.detail.size;});See also
Section titled “See also”Was this page helpful?
Thank you. We read every answer.