No, and here we are going, this is the beginning, and after that, we are going to come in our constructor,
OK, in our construction, we have public functions.
So do not forget to put to underscore, OK, when creating construction and we have public function
construction and this is construct.
And we are going to have a paradigm here which is old.
OK, and here we have a class, a second class and everything.
We are going to be asking a question if all that means if we have already put something truly cut.
OK, because in the beginning the cut is equal to no.
So let us begin already a glance controller.
OK, so this is what I was telling you.
We are here, OK?
The first thing we are going to do is to create the real world, which is Orkut.
And we are going to be asking the question, do you have something to cut for the first time?
We have nearly nothing to cut.
OK, this part is new and then we are going to call the cockroach in order to access our construction,
which is in our account.
OK, so make sure to come, first of all, here in our plants, just in the beginning here, you aides
use up backslash.
OK, cut.
OK, are we cartridges here.
Yes.
Like this.
Do not forget to do that because we are importing the glass in arraying to cut.
Yes.
OK, so for the first thing, all cut is equal to.
So what we're going to do here, we create the rubber which is OK, containing new cuts, orders or
cuts.
And here we call the construction on which we are going to aids our to cut for the first time, which
is equal to nil and when this is going to be called it here in our construction.
This is if condition is going to be force, OK, if all cuts and or cuts is nil and we are going to
keep this condition OK directly, we are going to skip our reconstruction and we are going to take all
these first functions.
So let us come here in Oakland Consolo and out here after calling our construction, OK, we are going
to take the same the same object, OK?
And in order to call the aid to cut a function, because we have also a function inside here is instead
of a record class, which is eight.
OK, so a reason why we have created in it next is OK from this class.
And here we put paren from our controller for our construction.
OK, because the construction allows us to insurors activities.
So reason we can see we have our articles here and here say if we take this Epuron, it is very simple.
So we are going to say you're going to we are going to take the same object that we have, use it in
order to gain that.
We have use it in order to call this class.
We are going to call also the aid function, which is here, OK, because this function allows us to
add product to cart.
OK, this is the importance of this function will be laughing instead of this function.
We have it function.
So we are going to call this function.
And inside of this function, we have two programs.
The first purpose is item and the second is products.
Idy OK, because what adding something in all items.
This is an item in singular, but here you can see we have items in plural, OK, because item is in
plurals is contained needs by different items or item in singular item or about this specific product.
For example I have Mengel in menu, I have to quantity OK.
And if I have several products, each product, it's got its own quantity and they all decide it will
be in items will be the items in plural.
And this is for the specific products as we are allowed the function here.
OK, and we are going to take first of all, the item, OK, all property that we have in our product,
because if we want to get, for example, the product's name in which we have decided you have to use,
this extends because we have a plus in this instance.
OK, the property of our model, our products table, OK, if you want to also have the product image
of things, you are going to use this and reason we can see we have put if Riseborough, which is item
in cartloads here, and the segment which is Idy and.
We have our lady here.
OK, so we can see we have it here products and here we call these products and actually that's directly
are we going to say station ports, OK, cards way because when adding well, calling it dysfunction,
if we try to look inside of dysfunction directly here, we have an error rate which is storing items
and we create an array in which the quantity we are going to ensure as equal to zero the products 80
or so we're going to insurers to zero and hearing a certain product and then we are going to separate
them is going to be equal to item OK, and we're going to fetch products name, because this item is
a program that we have here and e the referrers is here.
In order to take the name, we're going to say products.
It will fetch a product, name and product that we have here is item in this case and here we can get
the products name.
OK, and in this era it is a thing which is the print press.
We're going to say atemporal is press product image also have its own products, image item.
OK, by finishing we're going to say we're going to take our properties.
Those are the item, OK, in order to make them think consistence and we going to put all in instead
of restoring item every in order to content our record.
This is for specific products and we are going to be asking a question here.
We're going to say if, OK, is this items OK in the beginning, our items is no OK.
For the first time, that's we're going to add something to CART.
We are going to keep this condition.
OK, this condition is going to be forced directly.
We are going to come here.
We're going to say storeyed item quantity because we have we have initializes are we quantity to zero
and everything.
We are going to increment to say we have one product to cart and this quantity is going to change is
going to be one reason we can still hear a story, a story, a story item.
And we take this this index in which we have quantity and we are going to increment it directly.
We say also item the story item is going to be equal to product A, Heidi.
OK, now we're going to get the product idea.
And after that, we are going to do the same thing for the product name, which is here.
OK, we have already done this here.
Items like products, name products, press story item.
We have all these products, image, also item, product, image.
OK, so I think that it is very simple, and after that, we are going to say this total quantity because
we have eight different products, the total quantity is going to be also incremented increase each
one.
We are going to say total quantity plus plus.
And after that, we're going to set this total price.
OK, the total price also is going to be increased because in the beginning it was initialized to here.
We have less total price here to tell price and we are going to say the total price is going to be equal
to, yes, this total price.
Plus, I tend to tell price because in the beginning the total press was initializes equal to zero.
OK, so it is very simple and the same thing.
Also, if the total quantity at the beginning, just at the top there, the attributes, the attributes
was initially it's equal to zero, so will increments.
OK, and here we are going to call now these items on the pleura items which contains all single item
in item is for specific products, but items group all item or singular item that's required of all
products.
OK, that means the items is products in plural, but I think is just a single a single product.
And here is a set of items.
These items is going to be now an array, OK, containing products I'd like inside.
Look inside here and we're going to say you are going to be in Iraq and you are going to have products,
a different role like Nidhi, OK, like an index.
And then you're going to take this item, which is this erro in order to a safe OK to allow in these
products idy these value within our radius item.
OK, so after calling this function here, you're going to see this item isn't anymore.
It is not anymore equal to null.
So reason why here we are going to say directly the station put, cut and cut is going to be cut and
then they cut reference.
This is just a next.
There's an object from the hourglass which is in here in Dogpatch and not directly access to the really
value which has been updated.
OK, so we are going to say directly station postcards, OK?
And the second time that we're going to it, another thing we are going to come here, Allcott, we
are going to say session is called yes.
And we are going to say station gift card.
OK, so they are two cards.
We have something and here we are going to call this.
They get the same extents and as new cards.
And we are going to take what we have now in our Ricard's.
All this product that we have just added here in this item.
Yes, in this item, we are going to take all this and we are going to take all this property.
We are going to put it here instead of our construction.
So if we try to make sure that's what we're going to have here, we have our cards here.
And now we are going to say if our cards yes, we have something to cut and now we are going to set
this item is going to be equal to OK or else we can.
Is going to be equal to short cuts and we are going to say Hetson like all kinds of items, and then
we're going to say also here it is total quantity, which is going to be equal to
all cut or cuts equal to total quantity.
OK, I think that you're wondering what this item in the quantity way, because this all cuts research
than to let us come here.
You can see we have created something.
Like.
OK, here's something here you can see.
This is from the values, which is enshrined in the beginning, and this is if we say all items and
this is the current, there are items.
So we are going to allow these items and we're going to do the same thing for the total quantity and
it all be for us.
OK, so now after that, we are going to keep here and we're going to say a cut add to that product.
And here we are going to add in other products like other products.
We are going to say yes, just when we are adding a second product.
OK, you can see in the beginning this item was not OK.
Has we've already added the first products.
We are going to take the first products and a lot different products as item, which was not the same
thing with this total quantity, which is here the same thing for the total price like.