1 00:00:00,870 --> 00:00:01,530 Welcome back. 2 00:00:01,950 --> 00:00:05,710 Now, what we need to do is that we need to add the product to the cart. 3 00:00:05,800 --> 00:00:10,770 So, for example, if the user goes through this product and wants to add this product to their cart 4 00:00:11,490 --> 00:00:13,920 and click on Add to Cart, nothing is going to happen. 5 00:00:13,920 --> 00:00:15,540 And we need to activate this button. 6 00:00:16,320 --> 00:00:23,460 So to activate this button, we need to take data from here and inserted into the cart and store it 7 00:00:23,460 --> 00:00:24,060 into the cart. 8 00:00:24,060 --> 00:00:26,340 And to do this, we need to use sessions. 9 00:00:26,940 --> 00:00:33,330 So what I'm going to do is that here we have this single product page which, which displays this page. 10 00:00:34,020 --> 00:00:40,800 And in order to store that in the cart, once the user clicks on add to cart, we need, as I told you, 11 00:00:40,800 --> 00:00:41,760 we need to use this session. 12 00:00:41,760 --> 00:00:42,360 So we need. 13 00:00:43,790 --> 00:00:46,390 To to go to the cart page. 14 00:00:46,400 --> 00:00:50,090 This is the cart page and let me show you the cart page. 15 00:00:50,090 --> 00:00:51,800 So let me go to the card page first. 16 00:00:51,800 --> 00:01:00,470 I'm going to go through the card that each email and in the cart page we need to display this product. 17 00:01:00,620 --> 00:01:05,960 So for example, if I click on Add to Cart, we need to take the user to this card page and display 18 00:01:05,960 --> 00:01:07,850 the product that they have added to the cart. 19 00:01:08,390 --> 00:01:11,030 And all of this will be done in the cart that email. 20 00:01:11,540 --> 00:01:17,660 But first, we need to convert this card, that B2B into a card that will into B2B. 21 00:01:17,660 --> 00:01:27,260 So I'm going to change the name the extension from email to GA Dot Beach me and then this cart at the 22 00:01:27,260 --> 00:01:27,560 top. 23 00:01:27,800 --> 00:01:29,840 At the top, I'm going to add a B2B cut. 24 00:01:31,580 --> 00:01:32,450 You're at the top. 25 00:01:34,040 --> 00:01:34,610 At the top. 26 00:01:34,610 --> 00:01:35,820 I'm going to add the beach. 27 00:01:35,850 --> 00:01:36,560 Be good. 28 00:01:42,920 --> 00:01:50,930 But before I work on record here, we need to work on the code in the single product that each beat. 29 00:01:51,230 --> 00:01:55,970 But before working on the cart, we need to work on a single product. 30 00:01:55,970 --> 00:02:01,460 That beats me because in a single product, we need to take the product from here all the way to the 31 00:02:01,460 --> 00:02:01,770 card. 32 00:02:01,790 --> 00:02:08,900 So in the single product, remember, we have a product information here and in order to transfer the 33 00:02:08,900 --> 00:02:14,870 product information from here, we need to add a form. 34 00:02:15,350 --> 00:02:17,000 But this form is going to be hidden. 35 00:02:17,630 --> 00:02:21,860 So here what I'm going to do is that I'm going to look for the loop. 36 00:02:21,860 --> 00:02:22,550 Where is the loop? 37 00:02:23,000 --> 00:02:23,680 Here's the loop. 38 00:02:23,730 --> 00:02:25,640 So I'm going to get here a form. 39 00:02:26,390 --> 00:02:27,500 I'm going to say here form. 40 00:02:28,690 --> 00:02:32,620 Form which which should contain the image. 41 00:02:32,630 --> 00:02:34,300 So I'm going to start the form from here. 42 00:02:35,380 --> 00:02:37,360 The form is going to start from you as a form. 43 00:02:38,320 --> 00:02:40,030 And then I'm going to close the form. 44 00:02:40,600 --> 00:02:45,730 Just just above this, this curly bracket. 45 00:02:46,240 --> 00:02:47,380 And then this form. 46 00:02:48,160 --> 00:02:56,110 This form will take first a method, and the method is going to be post and action. 47 00:02:56,620 --> 00:03:00,010 So the action the action is going to be the cart. 48 00:03:00,640 --> 00:03:07,780 So I'm going to say cart that BHP and we need to pass the following first the image. 49 00:03:07,780 --> 00:03:14,140 So in order to pass the image, we need here to create inputs. 50 00:03:14,590 --> 00:03:17,860 So I'm going to get hidden inputs with the data that they want to pass. 51 00:03:17,860 --> 00:03:21,550 So I'm going to take your input and that input type is hidden. 52 00:03:22,480 --> 00:03:23,410 I'm going to say hidden. 53 00:03:25,240 --> 00:03:26,200 And I'm going to store. 54 00:03:26,200 --> 00:03:26,980 I'm going to say name. 55 00:03:27,310 --> 00:03:28,540 The name is going to be image. 56 00:03:29,080 --> 00:03:30,220 Let's say image. 57 00:03:30,550 --> 00:03:30,970 Product. 58 00:03:30,970 --> 00:03:31,300 Image. 59 00:03:31,300 --> 00:03:36,910 I'm going to say product image and product image. 60 00:03:37,540 --> 00:03:40,980 And I'm going to see value. 61 00:03:40,990 --> 00:03:42,100 The value is very important. 62 00:03:42,100 --> 00:03:44,860 We need to store the value so the value is going to be equal to the image. 63 00:03:44,860 --> 00:03:45,700 So I'm going to copy this. 64 00:03:47,650 --> 00:03:48,700 The value is this. 65 00:03:53,770 --> 00:03:55,630 And below. 66 00:03:55,630 --> 00:03:58,300 We need to get another input. 67 00:03:58,330 --> 00:04:02,170 I'm going to say input and then I'm going to say type. 68 00:04:02,830 --> 00:04:10,600 And the type is going to be again hidden and the name is going to be we need to pass the in the cart. 69 00:04:10,600 --> 00:04:11,800 We only need one image. 70 00:04:11,800 --> 00:04:12,910 We don't need all of the images. 71 00:04:12,910 --> 00:04:13,690 So we need the image. 72 00:04:14,080 --> 00:04:16,690 We need the product name and the price and the description. 73 00:04:17,170 --> 00:04:18,310 Let me check one more time. 74 00:04:18,310 --> 00:04:21,370 So here we need the we don't need the description. 75 00:04:21,370 --> 00:04:25,120 We actually need the name and the price. 76 00:04:26,050 --> 00:04:27,100 So the name here. 77 00:04:29,380 --> 00:04:35,380 I'm going to say name, product, name, product, underscore, name, and then the value. 78 00:04:38,050 --> 00:04:39,610 So the value is here. 79 00:04:41,860 --> 00:04:42,520 BHP. 80 00:04:43,500 --> 00:04:46,410 And instead of repeating this, God, let me copy the good. 81 00:04:53,490 --> 00:04:55,890 Alamy place it here, and then I'm going to just change. 82 00:04:58,680 --> 00:05:02,070 I'm just going to change your product name. 83 00:05:05,550 --> 00:05:09,310 Third, we need another input, so I'm going to copy this input now. 84 00:05:09,330 --> 00:05:10,710 There is no need to repeat this. 85 00:05:11,340 --> 00:05:15,960 And then I'm going to pasted below and we need. 86 00:05:18,740 --> 00:05:20,400 We need the price. 87 00:05:20,420 --> 00:05:22,790 Product underscore price. 88 00:05:24,240 --> 00:05:24,960 Project Price. 89 00:05:27,620 --> 00:05:29,330 And let me check one more time. 90 00:05:29,330 --> 00:05:30,170 What else do we need? 91 00:05:30,170 --> 00:05:34,250 So we need the name, the image, the price, the quantity. 92 00:05:34,250 --> 00:05:35,390 So we need the quantity. 93 00:05:36,110 --> 00:05:39,740 So the quantity we can give the quantity. 94 00:05:39,740 --> 00:05:41,450 Remember here, this is the quantity. 95 00:05:41,930 --> 00:05:43,700 So the quantity exists here. 96 00:05:44,630 --> 00:05:49,060 The quantity is tricky because the quantity is is here. 97 00:05:49,070 --> 00:05:50,840 This is the input for the quantity. 98 00:05:51,260 --> 00:05:54,080 So the quantity is the only one that's not going to be hidden. 99 00:05:54,500 --> 00:06:04,400 So we need to say inputs here and then type and then the value, the, the value is, is initially one. 100 00:06:05,120 --> 00:06:16,700 And I'm going to take your name and the name is going to be product, product one T and the value is 101 00:06:16,700 --> 00:06:17,600 going to be here one. 102 00:06:17,600 --> 00:06:20,900 And if the user change, it changes the quantity, it's going to be changed. 103 00:06:20,900 --> 00:06:24,290 So we don't need to use BHP for it. 104 00:06:25,130 --> 00:06:26,480 So this is for the quantity. 105 00:06:27,500 --> 00:06:28,760 What else do we want? 106 00:06:29,450 --> 00:06:31,100 We don't want anything. 107 00:06:31,280 --> 00:06:33,290 I think we are good to go. 108 00:06:33,290 --> 00:06:40,700 So again, we need the image, we need the the quantity, we need the name and the we need the price. 109 00:06:41,120 --> 00:06:43,400 And finally we need a button. 110 00:06:43,400 --> 00:06:44,750 So we need to activate the button. 111 00:06:45,230 --> 00:06:46,070 So this is the button. 112 00:06:46,730 --> 00:06:47,690 This button. 113 00:06:47,690 --> 00:06:57,530 We need to use input for this button or say we can see, we can say here type. 114 00:06:58,750 --> 00:06:59,500 Submit. 115 00:07:00,610 --> 00:07:04,080 You can see types of meat and we need to give it a name as well. 116 00:07:04,090 --> 00:07:09,970 I'm going to say name and the name is is let's say product. 117 00:07:10,390 --> 00:07:11,390 Let's say add to cart. 118 00:07:11,410 --> 00:07:13,630 Add to cart. 119 00:07:17,730 --> 00:07:18,740 Let me save a lady. 120 00:07:19,410 --> 00:07:20,210 Oh, now. 121 00:07:20,450 --> 00:07:26,360 He went over to the browser and let me go back and click on this by now. 122 00:07:27,260 --> 00:07:29,180 But as you can see, you will find nothing here. 123 00:07:29,720 --> 00:07:33,780 And the the the component will be displayed below. 124 00:07:33,800 --> 00:07:34,670 And this is a problem. 125 00:07:35,030 --> 00:07:37,320 So to fix this problem, we need to copy the form. 126 00:07:37,970 --> 00:07:39,200 We need to copy the form. 127 00:07:39,680 --> 00:07:41,600 And then we need to remove it from here. 128 00:07:42,020 --> 00:07:44,000 And then we need to display the form here. 129 00:07:44,960 --> 00:07:46,700 We need to display the form only here. 130 00:07:48,830 --> 00:07:49,190 Here. 131 00:07:49,190 --> 00:07:52,400 I'm going to base the form and then I'm going to close the form here. 132 00:07:53,720 --> 00:07:55,580 I'm going to close the form here. 133 00:07:56,840 --> 00:07:59,160 And then I'm going to I'm going to remove this form from here. 134 00:07:59,180 --> 00:08:00,710 I'm going to remove this closing tag. 135 00:08:01,460 --> 00:08:05,450 So the form let me fix everything so that everything becomes clear. 136 00:08:06,530 --> 00:08:07,780 Let me also add this button. 137 00:08:07,790 --> 00:08:08,150 I'm going to. 138 00:08:09,380 --> 00:08:11,960 David and then I'm going to display it here. 139 00:08:13,580 --> 00:08:15,440 So let me now fix everything and. 140 00:08:16,420 --> 00:08:18,370 Walk you through the card one more time. 141 00:08:19,270 --> 00:08:27,070 So what I did is that I just added a form with hidden inputs and only two inputs that will be displayed. 142 00:08:27,070 --> 00:08:28,540 The apple card and the quantity. 143 00:08:29,020 --> 00:08:29,520 That's it. 144 00:08:29,530 --> 00:08:29,860 Here. 145 00:08:29,860 --> 00:08:30,490 This is the form. 146 00:08:31,760 --> 00:08:33,410 And then I'm going to click on file. 147 00:08:33,410 --> 00:08:34,160 I've been able. 148 00:08:35,330 --> 00:08:38,840 And now let me refresh and this should fix it. 149 00:08:39,500 --> 00:08:41,320 So let me show you this. 150 00:08:41,340 --> 00:08:43,910 As you can see now, it fixed the form. 151 00:08:44,330 --> 00:08:48,200 Now, if you click on Add to Cart, it's going to take me to the Cart page. 152 00:08:48,620 --> 00:08:58,190 But we need now to fetch data from the past parameter because data now has been stored in the past parameter 153 00:08:58,190 --> 00:08:58,640 off each.