Ir al contenido

"recommendation" event

Esta página aún no está disponible en tu idioma.

Event@tryyoursize/sdk

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;
productstringObligatorio
statusRecommendationStatusObligatorio

ready, computing, none, signed_out or unavailable. See tys.recommendation().

sizestring | nullObligatorio

The recommended size in the store's own label (its size map), or null.

studioSizestring | nullObligatorio

The same size as entered in TryYourSize Studio, or null.

wearableSizesstring[]Opcional

Sizes that can be worn on this body, in the store's labels (when simulated).

let touched = false;
sizePicker.addEventListener("change", () => (touched = true));
guide.on("recommendation", (r) => {
if (r.status === "ready" && !touched) sizePicker.value = r.size;
});

¿Te ha resultado útil esta página?