So let's do it, people we have filtering here and I'll say text, then I'm going to go above the water
and make sure that you don't go below it.
And we're going to go with company here, company, company again, for some reason.
I don't know how that company and or, you know, sorry, I should have won that category.
Probably my bad.
So let me leave this comment.
That is going to be the next one.
And we're going to go with category over here and for the category similar to how we have for text,
if the category is not equal to all that, of course, I would want to filter based on that category.
Correct.
But then if the category is all, I wouldn't want to run that coalition because I would want to see
all the categories same like we have with tax.
So the moment we'll click on all, we'll display all the categories.
Now, there might be some different filters here, but as far as categories, we'll display all of them.
So let's go here with category MyState value.
And I'll just say, if it is not equal to all, only then I would want to filter.
And by the way, this needs to be a string of Alegría, or if it is not equal to all, then of course
I would want to do the filtering based on certain category and we just go here again.
10 product is equal to a ten product.
So if we already filtered based on text.
Now, of course, again, we're just adding to this array because we need to keep in mind that once
I'm done with this condition, if this condition is met, I possibly already have less products.
Correct, because I already filtered.
So now, of course, when I'm grabbing the 10 product, this is going to be filtered already.
If, of course, there was a text file and then one by one, we'll just add more of those conditions.
That's why, again, for this scenario, of course, you would want more products in your array, because
otherwise, again, if you start filtering based on, I don't know, six conditions, of course, you
need to keep in mind that if you only have, I don't know, 17 or 20 products, you might run out of
those product quite quickly, the ones that match your condition.
So we go here with them product again, we set up the filter.
There's going to be quite a few repetition here because the functionality essentially is the same.
We're just changing those conditions over here.
And in this case, I will set up the implicit return.
I'll say that I only want the product whose category value matches to whatever I have in the state.
So in here I'll say product and then category.
That is the property that I can find in the object.
And if it is equal to the category beautiful paternalist product.
If not.
And of course, I'm going to remove them from that.
All right.
And again, we're going to navigate to the bigger screen and we should see that once we click on office.
Now, of course, I'm getting those products that have the value of category equal to the office.
And of course, I can combine these filters where if I change something here as well, for example,
if I say, well, then of course I can see the products that start with l hopefully it's clear and of
course we can add more filters.
Now we don't have an option of clearing the filters yet, that's why.
Or you know what, actually we do my bad.
Let me actually showcase that.
Remember, the only thing we're doing with clear filters, we're just setting back to the default.
Correct.
So we don't need to do anything here in the filter product because we'll change those state voters anyway
the moment we click.
So actually, it is going to work my butt once I click notice.
Now I'm setting back to the default.
So category goes back to the default search goes back to default.
And I'm getting the product, which is actually pretty nifty if you think about it.
And we have a category that is done now would want to do the same thing for the company.
Again, we can pretty much copy and paste in this case because functionality is going to be extremely
similar.
We copy and paste now.
Please, please, please make sure that you change the values, though.
So in this case, I'm not looking for a category, by the way, I can right away select in multiple
places and I just need to say company like so.
So if company is not equal to all, then I would want to filter product based on the company value.
So if the company value matches to whatever I have in a state, yes.
Please return those product.
If not.
And of course, that product is removed from my right and essentially I don't display.
So that's why we can go back here and I can say that I would want to see all the products that are made
by IKEA.
If I want to be more specific, I can say, you know what?
Get me the IKEA company and I would want category of bedroom.
And of course, I have one.
So of course, if I search and if I say, you know, get me the items that start with me, of course
I'm going to have no products.
Why?
Well, because I can see that there's only one product and the name starts with E, correct.
All right.
Can clear the filters.
Pretty nifty.
Now, I would want to work on the colors.
Now there's going to be a gotcha with colors because keep in mind that colors is an array.
So each item has the colors, but the colors is an array.
So you have to run one more callback function inside of the filter.
So in here, let's go with common colors and then I'll say if color is not equal to all again, because
there's an option for all.
So then of course I would want to display all the colors.
So if color, by the way, that kind of doesn't make sense.
I guess in my state I have color, but we know that in the product the name is colors, so I'm not going
to change it right now.
Just keep in mind that it's easy to make a small typo.
And I'm going to say, if the color is not equal to all that is, of course, coming from my state,
then of course, again, I would want to go with that product is equal to whatever I currently have
in the right, and I would want a filter.
Now, this is going to be the case where I'm looking for a product and remember, products is an array
itself.
So you kind of just say product colors is equal to something because product color is an array.
So we need to run.
One more method than that is going to be fine.
Where are we go with a return of one product design colors and then I'll run the fine method on this.
All right.
I'll say check in the array if the color matches to the one that is coming from the state.
So that means that that product has that color.
So of course, I will return it now in order to make it shorter.
I'm just going to reference it.
I say and I'll say F.C. is equal to my color.
And that way can we can navigate to the bigger screen.
And there is now, of course, I can see the different colors as well.
If I want to go back to all, I just go back to all.
And then since we always, always, always start from scratch with all the product, then once I set
all this condition is not met and then I'm returning all the products.
I know I've said this already 20 thousand times, but I think it's extremely important that you understand
that because that pretty much is the whole.
Logic behind this whole filtering, everything else here is just details how we filter it, that's it.
And I would also want a filter based on price and the shipping.
So let's go here with price and the shipping.
Now, as far as the shipping, pretty straightforward.
I just want to check whether the shipping value is true, the one that's coming from the state.
If it is true, then I would want to run it against all my product.
And of course, the ones that have shipping, all those ones will be returned.
So in here, we just say if shipping is true, then again we do.
The whole spiel with certain products is equal to 10 products and products.
That's my trade and filter, not filters.
For some reason I keep typing filters.
I don't know why.
And here I say product.
And if product shipping is true, then of course I would want to get those products back.
So if the shipping is true, then I'm returning the product that how the shipping properly equal the
true, if not again, its condition won't be met.
So we're just returning all the product and the same is going to be with the price over here on certain
products is equal to that product filter.
Again, filters, and then we're going to be looking for product.
I'm guessing it's because I have state value filters, but again, that just be my bad typing.
I don't know.
And I'm going to go for a product and I'll say if the product priced properly is less or equal to the
price that is coming from my state.
So as I'm going to be changing this value.
I'm going to be checking for the price probably on the product, and then if the price is less than
I would want to return those products, if not, then I will be excluded from the array product price,
probably less or equal to my current price.
So I say over here and I should be in good shape or not.
Now, of course, we controlling the virus.
Now, there is a big gap, of course, because I think my biggest one was like three thousand and then
the next one is two thousand and the rest of them are below thousand.
And that's why you'll see this kind of long way of getting the products were not only once I get below
thousand, then I'm kind of rapidly removing the products, but then between three thousand and one
thousand.
The difference is not that big because we only have like three or four products or whatever, something
like that.
And Meyera and hopefully it makes sense once I click on Klinefelter's.
Now, of course, I display all the products.
Just keep in mind that we also have the sorting option where if I had the office and the company is
going to be key, I can still support based on A to Z or Z to a more price, lower or prioritized.
So that still works.
And once we're done setting up our product page and of course I would want to work on my car.