Before we can start working on a page nation filtering logic we would need to add more fields to our
product content type and also just create more product.
Technically you don't have to do it but just think about it.
If you're just gonna have two products there's not going to be much filtering as well as your nation.
Now there is a catch though remember we could not create a new content type or update our current content
type in production when it's essentially on Heroku.
So first we would need to add our fields to our local strappy project and only then push it to production.
And of course after that we can add more product.
If you haven't deployed your project of course then you'd need to add everything locally.
Just please keep in mind that if you're going to add more products and eventually you're gonna push
it to production all your data is gonna be wiped out.
So technically you don't have to do this if you're just using a local setup.
However if you have already production setup you need to first get the local project add extra fields
then we're going to be adding and also then you would need to push it to production and add more products.
Then one more thing that I would like to add if for some reason you don't have the local project anymore.
Let's say you deleted it.
You can access the project that was deployed on Heroku with a command of Heroku get colon clone and
then whatever is your app name.
Now you can find the app name if you had to Heroku then this is gonna be the app name.
So in my case this is going to be vintage tech store react API and just to underscore the fact that
we wouldn't be able to do this in production if we had to.
My production application you can notice that the text is gonna say this plugin is only available in
development so I cannot add extra fields when my project is already in production.
So we would need to first get our local project.
And again if you have your local project awesome you can right away start working on it but I'm going
to show you how we can run the command and that way we can get the same exact project which is already
in deployment.
So what I'm gonna do is I'm going to navigate the desktop.
You know what let me start from scratch.
So I'm going to click on Terminal.
I'm gonna zoom in.
I'm gonna type C D stop and then the command was Heroku get call and clone Roku get clone.
Then we have dash a and and then whatever is your app name again.
Let me go back to actual dashboard in Heroku then copy and paste my app and then of course I'm gonna
have access to the app.
OK.
Once the app has been downloaded to your machine course you would need to open up the text editor drag
and drop.
I'm going to maximize this right now and then we would need to install all the dependencies again so
npm install and right away I'm going to set up my admin so I'm gonna write NPM run develop.
Now that might take a bit of time.
So what I'm going to do is I'm going to resume the video once my admin is available.
Once our admin has been set up I'm gonna bravely navigate to local host thirteen thirty seven forward
slash admin and we can quickly do that by command.
Clicking There you go.
And then again if you follow the same steps as I did essentially when we got the new project from the
actual Heroku then you would need to set up a new ad then of course if you just kept your local project
then you wouldn't need to do that.
But in my case I would need to set up a new admin again.
So John some kind of simple user name and password.
Here we go.
Dummy e-mail.
John Doe at a gene mental dot com.
We're gonna click on already to start and then we're looking for the content type.
I have to tell you honestly that I already added to my product a category on the type and free shipping.
So this is essentially you'd need to do now I'm just gonna show you with some kind of dummy extra field
how that would work but please keep in mind you're going to be looking for category which is a string
and then we're gonna be looking for free shipping which is going to be boolean.
All that is going to look like well for the category I'm gonna add either phone computer and radio.
So as I'm adding new product these are gonna be my category options and also open display all.
So then once we have our filtering if I want to see the phones of course I'm gonna be able to see the
phones if I want to see the computers that I'm going to be able to see the computers so that again is
a category and I just added type of string.
And then for it be shivering we just have a boolean.
So in that case if I click on free shipping then that shows me only the phones in this case that have
free shipping.
If I'm going to select Category 2 all product then this is just going to show me all the products that
have these free shipping.
And again this was added as a boolean and my name was free shipping but of course you can call this
how well you'd want.
Just remember when we're going to be setting up the logic to use your naming.
So I'm going to show you if you'd would want to add extra field again I'm going to go with string but
you'd need to add both of them to category as well as a free shipping and I'm just going to call this
extra extra underscore field because I'm not going to use it I just want to show you how it's gonna
look like once we push this back to production I'm gonna click it done then it is important that you
save it so make sure that you save it.
This is going to restart of course.
So we're just going to wait a bit and then once everything has been set up then again we're going to
have to push this back to her.
OK.
And the way it's gonna look like I'm gonna navigate back to my project I'm going to stop the dev server
then we're going to add our changes so get add we're gonna add everything.
And by the way we can clear just so we can have the brand new terminal and then I'm gonna go with get
commit.
Then the message is gonna be extra fields added and then the command was get push Heroku master so get
push you roll call master mages double check whether that was the correct command.
Yep we have get push that you Heroku master again this might take a bit of time so I'm going to resume
the video once my project has been successfully pushed to production and once our project has been successfully
pushed to Heroku then we can close.
I guess our local admin because we're not going to use this anymore than we can of course navigate to
our admin that is in the production.
So let's click on admin again we're gonna open up the admin and then if you'd want to add a new product
which we can do if we navigate the content types and then products you can notice that as you're going
to be adding a new product you're gonna have these extra fields you're going to have one for free shipping
you're going to have one for category and then you're going to have one for extra field.
Now of course don't use the extra field items just to show you how everything is going to work but most
importantly work with free shipping and then the category not just to show you what I did.
Let's say if this was the radio then my category was radio and free shipping for this guy was on.
Now if let's say we're gonna go to I don't know.
One of the computers I guess can navigate to a next page and then I had a computer.
Then of course this one again had free shipping was on but the category was in this case computer.
Again let me save that one and I don't know let me maybe check the phone where in this case the free
shipping was off but then the category was phone.
So once you have the setup once you add as many products you would want.
And again the more products you're going to add the more interesting is going to be filtering.
Once you do that once you have the product then you're ready to proceed to next videos where we're going
to set up our logic.