Hi there,
I’m trying to have my selection tags autopopulate depending on what product options (color, size, etc.) are available in the dataset. I have seen that others are able to assign selection tags their values by using the following code, but the example does not go deep enough into the results in order to demonstrate accessing the product options:
$w.onReady(function () {
wixData.query(productsDatabaseName)
.find({appOptions: {
// Include product variants in the query. Default is `false`.
includeVariants: true
}
})
.then((results) => {
console.log(results.items);
let options = []
options = results.items.map(item => {
return {
label: item,
value: item
}
})
coloursForTags = options;
Any help on this would be very much appreciated.
Many thanks!