Skip to main content

Example : Shorter Size Selector Options

Logic

Format the size selector to only display size options

JS Code:

customization.js
function hooks() {
// before: XL (8-9) => after: XL
window.SerpOptions.registerHook("format-serp-size-variant-selector-options", (item) => {
return item.split(" (")[0];
});
}
// execution here
if (window.SerpOptions) {
hooks();
} else {
window.addEventListener('fast-serp-ready', function () {
hooks();
});
}