I have this product page where I have a dropdown and some buttons linked to a database to sort/filter the items, I also have some custom coded buttons that sort to specific brands:
export function ecohogButton(event) {
// Add your code for this event here:
$w( “#datasetproducts” ).setFilter( wixData.filter().contains( ‘brand’ , ‘EcoHog’ ))
.cath((error) => {
let errorMsg = error.message;
let code = error.code;
});
}
However the dropdown and “all” button does not effect the brand category filter after its pressed, basically I want it so the user can reset the options via button.
Take a look as its tricky to explain:
https://devsurf-design.editorx.io/css-minimal/products-all
Sidenote I also have this code that isnt working and Im not sure why, basically it just limits the description to only 15 characters, however the description doesnt show up and I have no errors.
$w.onReady( () => {
$w("#datasetproducts").onReady( () => {
$w("#AllItems").onItemReady( ($item, itemData, index) => {
let theItem = itemData.product_description;
var shortDescription = theItem.substr(0,15);
$item("#description").text = shortDescription + " . . . ";
});
});
});