1
00:00:06,100 --> 00:00:06,890
Welcome back.

2
00:00:06,910 --> 00:00:14,290
In our shopping cart project now, we are going to learn how to add product to cart by clicking on this

3
00:00:14,290 --> 00:00:20,560
icon, which is just a reminder of our image and make making just our image.

4
00:00:21,550 --> 00:00:25,070
We are going to add a product to cart.

5
00:00:25,120 --> 00:00:29,730
So this is what we're going to see in these are serious in this video.

6
00:00:30,280 --> 00:00:32,980
So we're going to begin to see this in this video.

7
00:00:33,310 --> 00:00:40,040
Different thing I'm going to ask you is to come in our shop Dot Blade, which is in our client folder.

8
00:00:40,980 --> 00:00:42,100
We are going to.

9
00:00:43,290 --> 00:00:47,830
Comp here in our shop dot shop, that blade Dogpatch Pete.

10
00:00:49,330 --> 00:00:57,160
And I'm going to look for images, products, images that I have, I have my products, images here,

11
00:00:57,160 --> 00:01:03,230
price, and I'm going to look for the Likud icon.

12
00:01:03,310 --> 00:01:08,350
OK, so it is the Likud icon.

13
00:01:08,540 --> 00:01:13,450
And here we are going to put our usurer and we're going to say.

14
00:01:17,370 --> 00:01:17,970
Eight.

15
00:01:19,760 --> 00:01:21,350
Add to cart like this.

16
00:01:22,660 --> 00:01:30,370
We going to create a world that's going to credit cards and do not forget to put the ID because you

17
00:01:30,370 --> 00:01:38,470
must get the sophisticated look of the product that we want to add to CART so you can still have it

18
00:01:38,470 --> 00:01:41,350
here and reach.

19
00:01:41,380 --> 00:01:41,980
Yes.

20
00:01:41,980 --> 00:01:43,930
And witness say products.

21
00:01:44,380 --> 00:01:50,090
And we're going to get the idea of the specific product that we want to add to CART.

22
00:01:50,170 --> 00:01:54,120
We're going to say product and hearing us say we're going to take it idea.

23
00:01:54,550 --> 00:01:57,340
So let us back directly in our shopping cart.

24
00:01:57,340 --> 00:02:00,530
Protesters reload a page we are in to shop page.

25
00:02:00,940 --> 00:02:02,040
I'm going to scroll down.

26
00:02:02,290 --> 00:02:04,900
Just click on this click.

27
00:02:06,240 --> 00:02:06,800
Very good.

28
00:02:06,830 --> 00:02:13,050
You want to see we are going to have a two Cartes products, which which has a flaw.

29
00:02:13,450 --> 00:02:18,660
OK, like Idee and we are going to take this information.

30
00:02:18,660 --> 00:02:24,210
If you try to make your acquaintance, I can choose, you know, products, which is just click on it.

31
00:02:24,450 --> 00:02:32,700
You're going to see I have a JD equal to three or four other products and then I'm going to copy these

32
00:02:33,330 --> 00:02:33,900
two cards.

33
00:02:34,860 --> 00:02:36,400
I'm going to come in already.

34
00:02:37,410 --> 00:02:40,970
We are going to create a new route in our client's country.

35
00:02:41,190 --> 00:02:44,550
So I want to fix something before starting this.

36
00:02:44,550 --> 00:02:45,780
It's called Project.

37
00:02:46,110 --> 00:02:48,900
A lot of people's a lack.

38
00:02:48,900 --> 00:02:57,750
So much to ask me, why not use a condom packages so I don't use a pay cut packages?

39
00:02:57,750 --> 00:03:09,650
Because every time the Laravel version will be outdated, like please I am every time, every time the

40
00:03:09,660 --> 00:03:12,270
laugh projects will be upgraded.

41
00:03:12,630 --> 00:03:16,450
So they cut packages outdated.

42
00:03:16,560 --> 00:03:22,870
OK, so you have some difficulties if you're using, for example, package is a cut packages for Laravel,

43
00:03:23,040 --> 00:03:25,110
a saving context, for example.

44
00:03:25,320 --> 00:03:28,470
And when we are not in the Laravel, it's ex.

45
00:03:28,770 --> 00:03:39,440
It is possible that these cards packages in last night's Wake for love, it's OK.

46
00:03:39,750 --> 00:03:41,370
So it is possible.

47
00:03:41,370 --> 00:03:48,180
And in order to avoid problem, reason way, I like to customize my own cards in the large projects

48
00:03:48,520 --> 00:03:49,560
to avoid this fraud.

49
00:03:49,770 --> 00:03:56,790
So we are going to do this part very quickly and I have some solution to make this cut very quickly.

50
00:03:56,850 --> 00:04:02,910
OK, so I need you to customize my own cards in your life for your projects.

51
00:04:03,210 --> 00:04:10,050
So we are going to come to us here in cards before we proceed here.

52
00:04:10,830 --> 00:04:13,560
And we're going to come here and say.

53
00:04:15,160 --> 00:04:15,790
Route's.

54
00:04:17,790 --> 00:04:22,680
Gates and we're going to say, look at this issue, can't.

55
00:04:24,900 --> 00:04:34,110
And say, say, OK, this is our idea, and here I'm going to create a function that's I'm going to

56
00:04:34,110 --> 00:04:37,480
call it to cut in inside of a client's control.

57
00:04:37,870 --> 00:04:41,280
I'm going to copy and I'm going to pushier.

58
00:04:42,280 --> 00:04:45,590
I'm going to say it cuts, I'm going to take this.

59
00:04:45,940 --> 00:04:50,500
It will be also the name of a function, so do not forget to put this in column.

60
00:04:52,060 --> 00:05:00,480
And I'm going to copy just back in our client's consular case or let us scroll down, just back in oray

61
00:05:00,670 --> 00:05:02,210
clients control.

62
00:05:02,500 --> 00:05:04,910
Yes, you're up there.

63
00:05:05,140 --> 00:05:07,590
Yes, Paris shop probably functioning.

64
00:05:07,610 --> 00:05:10,240
We are set a public.

65
00:05:12,770 --> 00:05:16,910
Function, I can't add to CART, and we're going to get our.

66
00:05:17,390 --> 00:05:26,120
I think that you already know all about this and I'm going to advise you to take two first that we have

67
00:05:26,120 --> 00:05:27,140
in our projects.

68
00:05:27,160 --> 00:05:29,050
OK, so I need to save you 10.

69
00:05:29,060 --> 00:05:31,670
I don't want to do a lot of things.

70
00:05:31,940 --> 00:05:39,230
The first thing we are going to do is to create a PSP file instead of our app folder that we have here,

71
00:05:39,740 --> 00:05:43,010
we are going to create a file here.

72
00:05:43,820 --> 00:05:47,270
And the other thing we are going to.

73
00:05:50,270 --> 00:05:56,450
To take another thought in which would have the functions that we're going to use in our records, we

74
00:05:56,450 --> 00:06:00,920
have the educate function, we're going to have also to remove from Cathcart.

75
00:06:00,980 --> 00:06:08,750
OK, so we're going to have all this or increased, also increased or the quantity we are going to have

76
00:06:08,750 --> 00:06:12,260
or discern these fires.

77
00:06:12,960 --> 00:06:16,520
So we want to take this to the first thing we have the.

78
00:06:18,020 --> 00:06:18,500
OK.

79
00:06:19,190 --> 00:06:24,970
The second thing here, the functions, OK, and they are going to open this.

80
00:06:25,640 --> 00:06:28,190
OK, so we have these two files here.

81
00:06:28,190 --> 00:06:28,940
You can see.

82
00:06:29,880 --> 00:06:30,930
Is this the.

83
00:06:34,720 --> 00:06:42,390
The character to be sadistic, and here he is, the functions, OK, and you're going to see we have

84
00:06:42,400 --> 00:06:45,130
our function here, which is here intercuts.

85
00:06:45,790 --> 00:06:48,510
We have it here, it's called We have it.

86
00:06:49,270 --> 00:06:51,500
And here I hear they use it.

87
00:06:51,500 --> 00:06:54,900
And I read like I have used Lavarack Builder.

88
00:06:54,910 --> 00:06:56,100
So it is not a problem.

89
00:06:56,180 --> 00:06:56,810
No problem.

90
00:06:57,190 --> 00:07:01,060
But here we go, use Laravel eloquence.

91
00:07:01,480 --> 00:07:03,880
And here you can see here, first of all.

92
00:07:04,610 --> 00:07:06,470
Uh, uh.

93
00:07:07,760 --> 00:07:10,460
Half hour cuts, we have to create the.

94
00:07:12,530 --> 00:07:15,850
We have to create the report in which we have this.

95
00:07:15,860 --> 00:07:20,910
OK, so I'm going to come first here in our 8:00 function.

96
00:07:20,950 --> 00:07:27,290
So what I'm going to do, I'm going to select the specific products work on which I have just clicked

97
00:07:27,290 --> 00:07:29,920
in order to be added to CART in this function.

98
00:07:30,490 --> 00:07:41,650
The first thing I'm going to do, I'm going to say, hmm, products, OK, product is equal to products

99
00:07:41,840 --> 00:07:42,320
like.

100
00:07:44,520 --> 00:07:46,970
Product fines.

101
00:07:47,520 --> 00:07:49,290
OK, I like this.

102
00:07:49,320 --> 00:07:51,960
OK, a product ID.

103
00:07:53,850 --> 00:08:02,090
Protest fines and fines, I'd guess, means I'm going to select all properties of this product, these

104
00:08:02,120 --> 00:08:03,300
specific products.

105
00:08:03,840 --> 00:08:08,370
OK, so we have already imported our products model in ordinary products.

106
00:08:09,920 --> 00:08:10,230
And.

107
00:08:13,980 --> 00:08:24,660
So here I am, shop restored is I think that's it must be like these approaches means like.

108
00:08:27,660 --> 00:08:32,220
Yes, and here does come here in a way function.

109
00:08:33,770 --> 00:08:35,840
And where is overfunctioning?

110
00:08:38,070 --> 00:08:43,530
Here and here, finished with here, I have used lava to be a lot of the low points.

111
00:08:43,600 --> 00:08:51,160
OK, so here I have used a lot of security, so it is better to use lava for low points.

112
00:08:51,180 --> 00:08:56,690
OK, so I'm going to grab this cos I'm going to show you what I mean by this.

113
00:08:56,700 --> 00:08:57,660
I'm going to copy.

114
00:08:58,110 --> 00:09:04,110
OK, so just copy these code, which is in order to function.

115
00:09:05,590 --> 00:09:08,530
I'm going to explain you this card in order to save you.

116
00:09:08,920 --> 00:09:10,030
I'm going to pass here.

117
00:09:11,110 --> 00:09:13,780
OK, so here I'm going to commence first of.

118
00:09:14,590 --> 00:09:19,870
So the first thing we need is to create a variable, which is called cards.

119
00:09:20,620 --> 00:09:26,070
And the very well, we're going to ask this question session has cards.

120
00:09:26,680 --> 00:09:31,340
So that means having already added something to cut.

121
00:09:32,010 --> 00:09:39,310
OK, if yes, we are going to say session gets cards, you're going to get this card, OK, and you're

122
00:09:39,310 --> 00:09:41,470
going to load this card in or cards.

123
00:09:41,470 --> 00:09:45,700
A variable either is the order to cut is going to be null.

124
00:09:46,150 --> 00:09:46,480
Can't.

125
00:09:48,090 --> 00:09:54,720
And then after that, we are going to create also a cost variable in which we're going to set new costs

126
00:09:54,720 --> 00:10:01,270
and we are going to pour the, uh, the glass we like we are going to to call the classroom.

127
00:10:03,370 --> 00:10:12,190
We went to court, the glass cut, the glass cuts that we are going to create in our Riccardo's file

128
00:10:13,810 --> 00:10:25,360
in which we are going to have a perimeter parens in our controller, in alre, not in our own structure

129
00:10:25,390 --> 00:10:28,870
place in our construction, which will be a shortcut.

130
00:10:29,070 --> 00:10:38,800
OK, and here we are going to also dysfunction this function, which is Edds, OK, in which to add

131
00:10:38,800 --> 00:10:39,520
product to cut.

132
00:10:39,590 --> 00:10:45,400
So the first thing we are going to do is to take this objects, which contains every property of the

133
00:10:45,400 --> 00:10:47,410
product in which we have decided.

134
00:10:47,830 --> 00:10:54,400
And then we are going to add in other programs, which is going to be cut like that, which is going

135
00:10:54,400 --> 00:10:55,160
to be cut here.

136
00:10:55,210 --> 00:10:56,170
So it is very simple.

137
00:10:56,680 --> 00:10:57,980
Let me show you something.

138
00:10:58,270 --> 00:11:00,430
So we are going to come in array.

139
00:11:02,140 --> 00:11:10,060
Up here, this Schrader's which you to see that they think if things are going to be clear, when we're

140
00:11:10,060 --> 00:11:16,240
going to do where, where we're going to add something inside of a rain.

141
00:11:19,130 --> 00:11:23,590
Cut in cartilage, these things are going to be clear.

142
00:11:23,660 --> 00:11:29,160
OK, so the first thing we are, instead of a recognizability, it is a flesh.

143
00:11:29,300 --> 00:11:30,200
Excuse me.

144
00:11:36,200 --> 00:11:40,990
Like this, like and let us take these codes.

145
00:11:41,340 --> 00:11:41,700
OK?

146
00:11:42,970 --> 00:11:50,410
And was going to say we are create a class which is going to be cut like it does, copy artists and

147
00:11:50,410 --> 00:11:59,130
take arts functions like DeFries functions is we're going to take or so take or and we're going to pass

148
00:11:59,450 --> 00:12:00,460
great projects.

149
00:12:00,580 --> 00:12:04,590
I'm going to learn when explaining these cards.

150
00:12:04,850 --> 00:12:06,460
OK, yes.

151
00:12:07,430 --> 00:12:14,270
And we are going to comment for this for these two functions, these two lost function, which is the

152
00:12:14,510 --> 00:12:17,310
updates quantity and remove from cuts.

153
00:12:17,450 --> 00:12:23,010
OK, so you can see here in our class we have three attributes.

154
00:12:23,030 --> 00:12:24,710
We have items, OK?

155
00:12:24,890 --> 00:12:34,060
Items contains all things that we have in our cart, all products that we have in our records, the

156
00:12:34,100 --> 00:12:38,750
plural and also the total quantity, the total quantity and the items.

157
00:12:38,750 --> 00:12:41,930
We are going to set the items to know.

158
00:12:42,560 --> 00:12:47,930
And we have also the total quantity, the total quantity of different products we have in our records.

159
00:12:48,200 --> 00:12:56,630
We are going also to initialize it to null, OK, we have also the total price and we are going to set

160
00:12:56,630 --> 00:12:57,830
it also equal to.
