Custom Colour Swatches
Add custom colour swatches for your product options.
Last updated
Add custom colour swatches for your product options.
Last updated
class WishlistProductCard extends WishlistElement {
// Only replace the function below, not the entire file
getColorMap(option) {
if (option.name === "Color") {
return option.values.reduce((colorMap, value) => {
const handle = this.app.utils.url.handlelize(value);
const color = handle.split("_").pop();
const image = this.app.utils.url.getFileUrl(`${handle}.png`);
return {
...colorMap,
[handle]: { image, color },
}
}, {});
}
}
}