Skip to main content

Confirm Size

info

To automatically select the frame size suggested in the widget on the product page (e.g. in a dropdown menu), you can set up a custom function triggered by the confirmSize callback.

We also got that example covered in our CodePen example as well. Here how you would configure that:

const myVariantSelectionFunction = (payload) => {
const { code, id, displaySize01, codeType } = payload;
// here goes YOUR code that will select the recommended size.
// you can use the payload variables to identify the correct bike in your shop.
};

const OZ_CONFIG = {
settings: {
// config options here
},
events: {
confirmSize: {
callback: myVariantSelectionFunction, // don't add parentheses here, otherwise the funtion will execute immediately instead of waiting for invocation
},
},
};
caution

We explicitely recommend that you use the product code passed in the payload to your function to select the correct bike in your shop. Passed size information is not consistent and should not be used as an identifier.

tip

Depending on your function you may want to change the label of the result button from Select size to something else. Here you find how you can do this in the global configuration for every widget on the page or in the local configuration for single widgets.