Welcome back.
In our shopping cart project now, we are going to learn how to add product to cart by clicking on this
icon, which is just a reminder of our image and make making just our image.
We are going to add a product to cart.
So this is what we're going to see in these are serious in this video.
So we're going to begin to see this in this video.
Different thing I'm going to ask you is to come in our shop Dot Blade, which is in our client folder.
We are going to.
Comp here in our shop dot shop, that blade Dogpatch Pete.
And I'm going to look for images, products, images that I have, I have my products, images here,
price, and I'm going to look for the Likud icon.
OK, so it is the Likud icon.
And here we are going to put our usurer and we're going to say.
Eight.
Add to cart like this.
We going to create a world that's going to credit cards and do not forget to put the ID because you
must get the sophisticated look of the product that we want to add to CART so you can still have it
here and reach.
Yes.
And witness say products.
And we're going to get the idea of the specific product that we want to add to CART.
We're going to say product and hearing us say we're going to take it idea.
So let us back directly in our shopping cart.
Protesters reload a page we are in to shop page.
I'm going to scroll down.
Just click on this click.
Very good.
You want to see we are going to have a two Cartes products, which which has a flaw.
OK, like Idee and we are going to take this information.
If you try to make your acquaintance, I can choose, you know, products, which is just click on it.
You're going to see I have a JD equal to three or four other products and then I'm going to copy these
two cards.
I'm going to come in already.
We are going to create a new route in our client's country.
So I want to fix something before starting this.
It's called Project.
A lot of people's a lack.
So much to ask me, why not use a condom packages so I don't use a pay cut packages?
Because every time the Laravel version will be outdated, like please I am every time, every time the
laugh projects will be upgraded.
So they cut packages outdated.
OK, so you have some difficulties if you're using, for example, package is a cut packages for Laravel,
a saving context, for example.
And when we are not in the Laravel, it's ex.
It is possible that these cards packages in last night's Wake for love, it's OK.
So it is possible.
And in order to avoid problem, reason way, I like to customize my own cards in the large projects
to avoid this fraud.
So we are going to do this part very quickly and I have some solution to make this cut very quickly.
OK, so I need you to customize my own cards in your life for your projects.
So we are going to come to us here in cards before we proceed here.
And we're going to come here and say.
Route's.
Gates and we're going to say, look at this issue, can't.
And say, say, OK, this is our idea, and here I'm going to create a function that's I'm going to
call it to cut in inside of a client's control.
I'm going to copy and I'm going to pushier.
I'm going to say it cuts, I'm going to take this.
It will be also the name of a function, so do not forget to put this in column.
And I'm going to copy just back in our client's consular case or let us scroll down, just back in oray
clients control.
Yes, you're up there.
Yes, Paris shop probably functioning.
We are set a public.
Function, I can't add to CART, and we're going to get our.
I think that you already know all about this and I'm going to advise you to take two first that we have
in our projects.
OK, so I need to save you 10.
I don't want to do a lot of things.
The first thing we are going to do is to create a PSP file instead of our app folder that we have here,
we are going to create a file here.
And the other thing we are going to.
To take another thought in which would have the functions that we're going to use in our records, we
have the educate function, we're going to have also to remove from Cathcart.
OK, so we're going to have all this or increased, also increased or the quantity we are going to have
or discern these fires.
So we want to take this to the first thing we have the.
OK.
The second thing here, the functions, OK, and they are going to open this.
OK, so we have these two files here.
You can see.
Is this the.
The character to be sadistic, and here he is, the functions, OK, and you're going to see we have
our function here, which is here intercuts.
We have it here, it's called We have it.
And here I hear they use it.
And I read like I have used Lavarack Builder.
So it is not a problem.
No problem.
But here we go, use Laravel eloquence.
And here you can see here, first of all.
Uh, uh.
Half hour cuts, we have to create the.
We have to create the report in which we have this.
OK, so I'm going to come first here in our 8:00 function.
So what I'm going to do, I'm going to select the specific products work on which I have just clicked
in order to be added to CART in this function.
The first thing I'm going to do, I'm going to say, hmm, products, OK, product is equal to products
like.
Product fines.
OK, I like this.
OK, a product ID.
Protest fines and fines, I'd guess, means I'm going to select all properties of this product, these
specific products.
OK, so we have already imported our products model in ordinary products.
And.
So here I am, shop restored is I think that's it must be like these approaches means like.
Yes, and here does come here in a way function.
And where is overfunctioning?
Here and here, finished with here, I have used lava to be a lot of the low points.
OK, so here I have used a lot of security, so it is better to use lava for low points.
OK, so I'm going to grab this cos I'm going to show you what I mean by this.
I'm going to copy.
OK, so just copy these code, which is in order to function.
I'm going to explain you this card in order to save you.
I'm going to pass here.
OK, so here I'm going to commence first of.
So the first thing we need is to create a variable, which is called cards.
And the very well, we're going to ask this question session has cards.
So that means having already added something to cut.
OK, if yes, we are going to say session gets cards, you're going to get this card, OK, and you're
going to load this card in or cards.
A variable either is the order to cut is going to be null.
Can't.
And then after that, we are going to create also a cost variable in which we're going to set new costs
and we are going to pour the, uh, the glass we like we are going to to call the classroom.
We went to court, the glass cut, the glass cuts that we are going to create in our Riccardo's file
in which we are going to have a perimeter parens in our controller, in alre, not in our own structure
place in our construction, which will be a shortcut.
OK, and here we are going to also dysfunction this function, which is Edds, OK, in which to add
product to cut.
So the first thing we are going to do is to take this objects, which contains every property of the
product in which we have decided.
And then we are going to add in other programs, which is going to be cut like that, which is going
to be cut here.
So it is very simple.
Let me show you something.
So we are going to come in array.
Up here, this Schrader's which you to see that they think if things are going to be clear, when we're
going to do where, where we're going to add something inside of a rain.
Cut in cartilage, these things are going to be clear.
OK, so the first thing we are, instead of a recognizability, it is a flesh.
Excuse me.
Like this, like and let us take these codes.
OK?
And was going to say we are create a class which is going to be cut like it does, copy artists and
take arts functions like DeFries functions is we're going to take or so take or and we're going to pass
great projects.
I'm going to learn when explaining these cards.
OK, yes.
And we are going to comment for this for these two functions, these two lost function, which is the
updates quantity and remove from cuts.
OK, so you can see here in our class we have three attributes.
We have items, OK?
Items contains all things that we have in our cart, all products that we have in our records, the
plural and also the total quantity, the total quantity and the items.
We are going to set the items to know.
And we have also the total quantity, the total quantity of different products we have in our records.
We are going also to initialize it to null, OK, we have also the total price and we are going to set
it also equal to.