Good morning,
I am attempting to create a filter for my repeater but am completely stumped. My main goal is to have the repeater display a product from my Wix Store, based off the results (year, make, and model) which is calculated from the user VIN input.
Also, I would like the repeater to show only ONE product but all products are shown both before and after the query. How do I make it so only one product is shown?
Here is my code:
import {getVINInfo} **from** 'backend/VINModule';
import wixData **from** 'wix-data';
$w.onReady( **function** () {
//TO DO: Write Your Page Related Code Here:
});
export function button1_click(event, $w) {
//Add your code for this event here:
getVINInfo($w("#vininput").value)
.then(VINInfo => {
console.log(VINInfo)
$w("#results").text = VINInfo.Results[8].Value + " " + VINInfo.Results[5].Value + " " + VINInfo.Results[7].Value;
})
}
export function repeater1_viewportEnter(event, $w) {
//Add your code for this event here:
filter ($w("#results").text);
}
**function** filter (title) {
$w('#dataset1').setFilter(wixData.filter().contains('year', 'VINInfo.Results[8].Value'))
$w('#dataset1').setFilter(wixData.filter().contains('make', 'VINInfo.Results[5].Value'))
$w('#dataset1').setFilter(wixData.filter().contains('model', 'VINInfo.Results[7].Value'))
}
}