Hello, friend, welcome back.
In a previous video, we have created one of the function as an to function, and here I have defined
some of the conditions.
Right.
So after that, here we save this data.
So now I want to do want to create one of the Bubis.
So now I just need to save all.
And now if you want to create one of the models for this function, then you have to have to go to your
app order and that your you order and you I have already added our app order in the views.
So do the viewers idea.
I have created all the functions.
Right.
So now I have also defined that app name as an app order.
So now on to the the part.
So our part will be I just named the name of the ad, OK, so that and this type of of the world I have
defined and also in our views and the views area, I have created one of the function.
So I have created one of the function as a add to cart.
So that is our add to cart I have defined and then I define that name for this.
So it will be as an ad say just name it as ad.
OK, and also here we have to do we have to add that means we have to add this product with a specific
one of the idea.
Right.
So for the regions here, I have to do I have to add that idea, because if you go to our view into
the video, you can say define that request along with our primary key Tidey.
So we have to do we have to define the idea.
Just name it as a picture.
OK, sorry.
Here after this, I just name it as a picture and then that it will be our idea and then our function
and the name.
So now I want to do and to display want displayed in our that base that is our product little space
in our app to that area.
So now go to our template again.
So that is our template into the template or app order so that our app shop and the result product details.
So do the product details area I want to do and to define that is link.
You can select our article button.
So here I want to define that link so it shall be as you are.
Well, and then in our app that we see in our in our app order into the app order, I have created one
of the euro.
So that is our app name as rapporteur.
I have created you are as the ad.
So I just simply defined that ad.
And also after that we have to do we have to define our idea that is RPK.
So after that here I want to do with this object.
We can actually defining it.
Right.
So I just named it as a picture and then our object.
So sorry.
So it is with this object.
I want to define art because I just simply defined that picture.
So right now we get all the data with this object, right.
So with this object, I display our preview text, all the things that are of the category.
So now with this object, we can actually access our database table field.
So I want to access our primary field that they are because they are simply defining it.
Perfect.
So now let's check this out.
Now, if you click the save all this together, save all.
And on our server, everything is looking great and now go to our database, then we can well understand
about it, I just refreshed it, open that card and there is our order.
So now everything will be serving our order and also will be serving our card area.
All right.
So here I have defined this part in your model so far.
The results here and I have created a sound that relation.
You can see there is a lower order.
So here I have defined that user, the foreign key to the settings and also in our car they will see
into the character.
I have defined that with the user setting and that is an item that we saw in this product will be added
to in our car area automatically, which will be added another one in our order portion that is in our
order class.
So also here, I want to do it now.
So that is our card and that is our order.
So everything now should be very much clear to you.
Like here I refresh it.
So right now I didn't add this product in our cart.
Right.
So that is actually our first product.
So for the reasons down here, I define that condition when this will be as our in complete order.
So that is all in complete orders, then it will be ale's into the LCD I have defining it.
It will be self destruct.
All right.
So shall we say disorder like check this out.
I just click on the add to cart.
So, you know, showing as the order got an unexpected court argument, as you saw, you can see the
spelling mistake.
So here I defining it in our.
User, that is our order.
You can see the spelling mistake, I understand it, so you can see the regular order.
That will be a user.
OK.
That will be the user.
And the requested user will save all.
And I'll go back to the freshet and here I want to check it in order to save.
I know you can see the card is actually set, but our order is not there because of all here a defense
of the wrong.
So I just better left it.
I just simply deflected again, yes or no, it's empty.
So now I do want to add these products like here right now and refresh it and add to this product is
no different.
Now, showing as this item is added in your card, that means that it's actually our fresh one for the
reasons here.
You can see now actually our sales function is working.
So here are showing our this item as is added in our card area.
And when it should be saved, then it will be redirected to our home.
That means our app shop home.
You can see when this product, Ataka, dangerously addicted to our home page with this message so that
the message is now display.
Right.
So right now, Fred, this product is already safe.
This product is already safe in our car radio.
If you don't go to our auto refresh now, because they have also not the order if you open it so you
can see the regular order item.
And also if you go to your card, because a refresh you can see into the card area that is actually
our card product so that our product is not visible.
So now if you want to buy this product again, like here, I want to go here and now go to our this
product again.
And now here I want to buy this product again.
OK, so here I define this condition when this will be the same, that between this item will will already
exist in our car area that is also already exist in our order item area.
Only our quantity will be updated.
OK, and after that quantity updated, it will be safe, this data, and it should be sure some of the
message as required so that this item quantity is updated and then it should be delivered to our home
base.
Right.
So now let's check this out.
If you now add to this product again.
Yes.
You can see now truing as it is, item quantity is updated.
OK, that was only our quantity field is updated.
So that means here you can see so perfectly the key to our home base and then it's showing our this
message as this item quantity is updated.
OK, so now this is not showing on here.
So now if you go to your cart and if you refresh it, yes.
You can see if an item actually the same item only our this quantity field is updated.
So before there was actually one.
So right now it is updated as a tool.
Right.
And if you go to order, click refresh, you can see it now is actually updated like a second one are
the two and that is our product.
Perfect.
So now friend, I think is very clear to you what exactly the things I did on here.
So now if you want to add another one like here, I add another one added this one click on Add to Cart.
So now consistent showing that this item added in your card.
So here I have added this product.
So now we're showing our this message.
And if you now go to our order directly to the refresh.
Yes, you can see our order is the same.
That means there are already there is only one object.
So into the one object order area, it's added all that our product.
So that is all that our product card.
So for the reasons here, I have defined that relation with our cart.
OK, and also if you go to that piece or Cardinia, did the Kardinia consider is the purchase.
So this packages is not selected.
That means this product is not completed.
Right.
So for the reasons here, I have defined this part.
So for the reasons into the purchase, you can see it in the packages that I make that things are the
false.
That means right now this product is not completed for the reasons you can see just now showing as an
checkmark.
So now I think is very much clear to you.
OK, so here we successfully did the talks right now in our criteria that have the two product.
And also I don't want to take another one like here.
I take this one also click the add to Cart so that the item is added to cart in our successfully refresh
it in the art area you can see that our three product.
But if you go to our order, the order is one, right.
So you can see there is already one.
So into the one other area.
I have purchased our three product.
Right.
So here I have also defined this part and everything is now perfectly working.
OK, that is our cart is working and order is working.
So you our next video, I want to create the template base for our view or all that car product that
means in our car we are right now.
I have already saved some of the product, so I want to do and the visibility in our car that we see
in our car area.
OK, so do the Kataria.
We have to do we have to create the template base so better.
In our next video, I will show you that things with a live example.
So thanks for watching.
I'll see you in the next video.