Hello, friend, welcome back.
In a previous video, we successfully complete our production, that is all that our product is now
visible and also here and I have created one of the filter for display all that hour order.
Right.
So right now, there are the four products.
So right now we're showing our four product card on here.
So now I want to do want to work for our Distomo card, because if you click on the remove card, then
automatically it will be removed from from two of displays if you will be removed from our order.
And also it should be removed from our card right through the card that the full product right now.
And also, if you refresh it like it is to the order and the order, there is a four products automatically
it will be removed from here and also will be removed from this position.
So for doing this, we have to do have to create one of the functions for this one.
So now go to our view.
That was in our app order into the airport that there is a view.
So right now we don't need this.
There is a card filter.
We don't need this.
No, we don't need this.
OK, there is a model will be needed.
There is a view perfect into the view area.
I want to do after this.
I want to create another one, which will be also as a logging liquid.
So here after this, I just simply defended the logging record and then I define the function name as
a dev and then I name it as a remove, OK, remove underscore from GOC, so I just name it as a remove
from cart.
And then also here we have to do we have to remove it with a specific one died because of all every
product that have some of the specific IP.
Right.
So we have to also remove it with a specific commodity.
So for the reasons here, we have to define the request and then our idea just name it with the picture.
That is our primary key.
I think you already know about it.
And then also here we have to do first of all, we have to check this item object is our appropriate
idea, object or not.
So here I take on the variable as it item, OK, item.
And then here I already found the already from the function so that the cloud function class at the
gate object our four zero four.
Right.
If you get that object then it should be for that four zero four.
So now with this, with this we can actually defining it.
So get object our four zero four here.
With this I define our product model because frankly, the product model, we have to get it.
So there is a product model and then here to be our primary key and this is our database will fill them
as ID and it'll be equal to our distinguished it.
So I just simply defining it.
And after that I want to do I want to get all the tower ordered object data.
So that is our in order because in the order object, as I told you, I wanted to be delectably to be
letter from two of this area.
It should also be looked at from our order and also somebody like it from our cart.
Right.
So for the reasons here we have to do we have to define our order.
That means so with this order class, I want to get all that our object and also I want to filter it.
So here I take one of the variable as the order.
OK, order underscore underscore cubists.
So here defining it and then our order, our order object and we decide object that if another object.
So with this object on the filter it's just really want to filter OK and filter our user so that the
user will be our requested user.
So should we check it?
And also our order file will be as a false.
That means our disorder will be as a false.
OK, so just simply defined as ordered so that they are ordered and ordered will be as a false say,
just simply defined as a false.
So here I take all that, our incomplete order and I take the things with this variable.
So now here I want to define some of the condition.
OK, so after this, how to define the condition as if our disorder is already exist.
OK, if these orders exist, then we have to do, first of all, take the things to convert it to our
object, say just simply define the order and disorder, all the data I converted it that we are all
the pending, that I take the things with this here.
I don't want to convert it and convert with our zero object.
So I just simply define that zero.
And then also we have to get our all the talk card for product data.
So far, this is here at another condition of the if our order and with this order, that is our order
item and we decide item here.
I have already called the man to man relationship.
But so this management relationship, I want to access our another one.
That means this order so aspecific for this order that have signed the card in the product area.
Right.
So now I want to access it.
So if you want to access it, we have to define that things with our distillation.
So here our model relationship, I have defined that name with our order item.
So now here I want to do and we define our with this sort.
Our order item, so here I define a water filter, OK, with this, I want to filter it and I want the
filter it with our item item will be at the same as item.
OK, that means our this item will be matched with our this item.
OK, that means this item will be match.
So I just simply defend both of these.
And here after this I want to do to defend that as they exist.
If it exists then I want to do I want to get all the tower card of the data.
So just name it the order underscore item.
I just name it as order item.
And here with our card model, be the card model, I get all the other objects and then I want to filter
it.
So I want to fill out to filter it and filter it with our item will be the same that this item will
be our item and also our user user will be our requested user.
So requested user perfect.
And also into the.
Order area that was know Khateeb, if you go here also they have the parties, the parties will be as
a false.
Right.
Also here we have to defining it.
So I just simply defined the parties.
Parties will be as a false.
OK, this will be as a false.
And here also under the underpass over this object data that this object I got this order auroral,
that object data here, I just simply pass it a friend and then I don't want to remove it.
That is when our card.
So here I have already defined all that object card data.
So when it should be matched then I want to do and to remove this.
OK, that means when you move it forward to check this data in our order.
And how many of these items will be matched with our discard item, that means that electrocardiogram
product right there is also considered to the item one.
It shall be matched then I want to remove it.
So for the reasons here, I already get our all that object data with the filtering with with our item
will be matched with our same item use that will be our requested user and also purchase will be as
a false.
That means this product is a pending process.
Boundaries are parties is not completed, so I don't want to remove it.
So here with our order, so with our order, I have defined the relationship with our order items.
So the regular order items.
So these are the items I want to define on not one of the function as a remote.
So to simply define the remote.
So here I want to do and remove it.
OK, remove our this ordered item.
That means these are items I just simply pass it on here.
And after that I want to do under directive.
That means our order, this order item like this or that item will be delectables.
I just simply defined the direct set as simply defined as the direct.
And I want to be accounted for some of the message with our messages.
So this message is better here.
OK, with these messages I want to show on the morning tag warning tag and the warning tag will be at
the request.
And with this request and the source of the message of this item was removed, OK, removed from your
card.
So this type of want the message to display and also after that is to be written, I define a return,
redirect, redirect, OK, return, redirect and it will be returned redirect to our same.
That means our discard base like that in this card base.
So here I have already created that order.
So here I just simply defined that position.
So it'll be in our app order.
Let me see your app order I have created as a vehicle to you or else I have created as the app ordered
that your card.
Right.
So now I just simply defined I was a card.
Perfect.
And we know what this condition will be.
False.
Then it will be written on another message.
So here I just simply somebody the else ok ls that is in our D.C. condition will be as a false then
it will be show another message.
I just simply the messages and then I take the info tag right now and then with the request I want to
do and the pass on the message as a this item was not in your cart.
So this of one of the message visible, OK, and after that I returned it, I return redirect, I return
redirect to our home base, seems to be addicted to our app underscore shop and then our home.
OK, a friend and also else we have to do have to define another thing that means our D if conditioned
area seem to this only scenario defined as the ls ls it mean sexually when I want to do when this our
total order will be removed.
That means that they have the right now the for order.
So if you remove past one second one third one and the fourth one and then it will be as empty.
Right.
Someone else will be as empty.
I want to do.
And to make the things to return to our home page.
OK, so here I want to define that conditioning or else area that this area so should be just like the
same as the messages.
And here I define that in foregoing info and then request.
And if this request I want to pass on the message as a you don't sorry, you don't have an active active
order, so just name it as a you don't have active order.
It should be done, be done and then redirect.
It should be as a return redirect to our form.
So here in our app shop and then our form.
Right.
And after that we have to do we have to create one on the wall for this one for X says DSR.
This function so good for you all, that means in our app order and really you are right.
So did the app order you all here?
I wanted to create another one.
So here also we have to define all the ID because of all.
If you go our view here, you can certainly find all the requested on the I.D..
We also have to do final data and here I name it as a remote, OK, it be as removed with the idea and
then a different name is removed.
And in our view area, I have played around the function name as a remove from card, so I just simply
name it as a view and are removed from card.
Right.
So now we can actually access this link.
I want to access this link.
You know what this card piece that means here.
So here in Texas, that is in our app order and then I name it as it is.
OK, now go to our Carlesimo and then that is our card button.
So here I want to define this link.
So I just simply define that link will be as you wartell.
And then in our app Underscore Order, the app order I have created already what a name or even a name
have defined as a remove.
So to simply define the remote and also after that they have one of the items right here.
Also you have to do have to define that ID, so you have to be as a picture.
OK, should be the case equal to do so.
That is right for loop.
That is your card.
So into the card, the item.
So here before I have it you will see that with the card.
I have accessed that item name.
So now I want to do want to use our discussed item, our ID.
That means if you go to our card.
So here that is your card.
So the card, the items in the item maybe I have already defined our foreign key with our products right
now and to do on to access our this product ID.
So that means here that is our product.
So that is our app shop model.
So if you go to our app shop, everything is actually interconnected.
You can see.
So there is a Klapperich.
So for this product that I'm also one of the specific ideas.
So here we have to pass it.
So now I want to do to define the same things as a card item and before I using that name now I do want
to use our our name I.D. So I just need to define as id as a picture like that in the primary.
So here you have to defining it.
So that's all we have to do.
So now let's check this out.
If everything OK now should be worked, I just have to save all.
First of all, I have to check it somewhere is running perfectly.
And now I want to refresh that piece.
And now I want to remove it like here there is actually one, so I want to do I want to remove it because
I can't.
Yes, you can see friend now perfectly remove and also showing us that this item was removed from your
cart.
And here you can see our car is also updated if you go to our order because a refresh now, because
it's now gone from here.
And also if you go, you can see that now they have the three product.
OK, so now I don't want to remove everything, everyone.
So that is another one is gone.
Another one is gone and the last one is gone.
And here you can see when our last one is gone, then have already found this part.
This message will be displayed.
You do not have any item in your car.
So here I have defined this thing.
So you know, our locking that means here, when our this condition be, then it will be sure that message
as this item was not in your cart.
Right.
So far, the business is not perfectly visible.
I think you can well understand about it.
So now if you.
By any products, so here I have to cut this product now, he's perfectly at it so that he actually
had it right.
And also I take another one that you can't go here that is all shattered.
And now I take this one go add to cart to get this product and now it's perfectly at it.
So now if you want to remove it, you can remove it from here.
Next video on to discuss about if you want to update this quantity.
That means right now there is a one quantity, so there is a one.
So if you click, the minuses will be reduced.
That will decrease it.
And if you click on the plans, then it will be increment.
So how can do that work?
In our next video, I will show you that things with a live example.
So thanks for watching and I'll see you in the next video.