Product catalog page - filter function

WOW, COOL thanks !
SO just to be sure:
if the “user” want to filter for a
phone”, “samsung”, “Android” :Then the filter will not find that?

let shopList = new Vue({
    el: '#shoplist',
    data: {
        currency,
        itemList, //Cykeltur comment: The list with all the items...
        selectedCategory: [] //Cykeltur comment: a array of selections
    },
    computed: {
        filteredCategory() {
            return itemList.filter(item => { //Cykeltur comment: returning a list of the products that match a criteria
                if (item.category.match(this.selectedCategory)) return item.category.indexOf(this.selectedCategory) > -1; //Cykeltur comment: returning this if true and stop the if statement
                else if (item.brand.match(this.selectedCategory)) return item.brand.indexOf(this.selectedCategory) > -1; //Cykeltur comment: returning this if true and stop the if statement
                else if (item.os.match(this.selectedCategory)) return item.os.indexOf(this.selectedCategory) > -1; //Cykeltur comment: returning this if true and stop the if statement
                return;
            })
        }
    }
})

or do i misunderstand the filter? :slight_smile:

U understood it pretty clearly, I just had no time to make it works like that maybe in the future i will make component like that with slider for price etc its not really alot of code for the rest, but i didnt want to bother myself. You could use @kuligaposten solution aswell, but its less complex and requires from you much more configuration in the bootstrap studio. Meanwhile my solution needs from u only configuration in the ShopList.js file in the list of items. I also didnt hard code everything cause i dont think it would be usefull for any website since e-commerce update will be soon and it will have all features like filtering products etc built in, so u can easily understand why i didnt code all :slight_smile:

EDIT: Basically its temporary solution for yaa till the e-commerce update wont appear