I have a repeater setup for visitors to filter multiple different dropdowns to find exactly what they are looking for. However, I am struggling to add a dropdown for price less than or equal to set values. It somewhat works but dominates the other filters and filters things it shouldn’t be affecting.
import wixData from 'wix-data';
export function searchButton_click(event) {
search();
}
function search() {
wixData.query("Items").contains("brand", String($w('#dropdown1').value))
.and(wixData.query("Items").contains("movement", String($w('#dropdown2').value)))
.and(wixData.query("Items").contains("caseMaterial", String($w('#dropdown3').value)))
.and(wixData.query("Items").contains("diameter", String($w('#dropdown4').value)))
.and(wixData.query("Items").le("price", String($w('#dropdown5').value)))
.find()
.then(results => {
$w('#listRepeater').data = results.items;
})
}
export function resetButton_click(event) {
$w('#dynamicDataset').setFilter(wixData.filter());
$w('#dropdown1').value = undefined;
$w('#dropdown2').value = undefined;
$w('#dropdown3').value = undefined;
$w('#dropdown4').value = undefined;
$w('#dropdown5').value = undefined;
}
Any help would be greatly appreciated.