I have a site that features certain sustainable brands. I want users to be able to filter brands based on their item price ranges and have it appear as ($, $$, or $$$) with checkboxes in a dropdown and allow more than one box to be checked.
On our current site we had to align numbers with the price ranges since $$$ unfortunately contains $$ and $. So we have 1-$ and 2-$ as options that we manually input in dropdown and linked the dropdown to the field that aligns with text that matches the price range options (1-$, 2-$$ etc). But you can only select one price at a time. Our code is as follows:
import {wixData} from ‘wix-data’ ;
$w.onReady( function () {
});
export function button21_click_1(event) {
let searchCategory = $w( “#dropdown1” ).value;
let searchPrice = $w( “#dropdown3” ).value;
$w( “#dynamicDataset” ).setFilter(wixData.filter().contains( “categories” , searchCategory)
.contains( “price” , searchPrice));
$w( “#listRepeater” ).expand()
}
export function button22_click_1(event) {
$w( ‘#dropdown1’ ).value = “Category” ;
$w( ‘#dropdown3’ ).value = “Price” ;
$w( ‘#dropdown1’ ).resetValidityIndication();
$w( ‘#dropdown3’ ).resetValidityIndication();
}
I would like to set it up simply, should we use boolean data types in our dynamic content manager? I saw this forum about setting up boxes, but was confused on which parts of the content manager were being linked.