1 00:00:00,840 --> 00:00:01,530 Welcome back. 2 00:00:01,860 --> 00:00:08,100 Now, what I'm going to do is that I'm going to take the ordering information, the order that the user 3 00:00:08,100 --> 00:00:09,120 did not pay for. 4 00:00:09,600 --> 00:00:16,080 And if the user clicks on pay now, I'm going to get the total amount from here and then I'm going to 5 00:00:16,410 --> 00:00:20,670 display it here, and then I'm going to display the button so that the user will be able to pay for 6 00:00:20,670 --> 00:00:21,540 any order they have. 7 00:00:21,570 --> 00:00:25,050 So for example, this is my account and I have these orders not paid. 8 00:00:25,500 --> 00:00:31,680 And if, for example, I want to the I want for for for some reason I want to pay. 9 00:00:31,680 --> 00:00:36,540 Now I can click on details and then pay now and pay for this and get this product. 10 00:00:37,260 --> 00:00:43,510 So to do this, we need remember in the order details, we have uniform and we need to pass the the 11 00:00:43,530 --> 00:00:44,730 total just the total. 12 00:00:44,730 --> 00:00:50,670 We aren't interested in the entire data because the data is already displayed. 13 00:00:50,700 --> 00:00:52,800 So, for example, Amy, show you this order. 14 00:00:54,150 --> 00:00:55,170 This order has. 15 00:00:55,650 --> 00:00:56,430 Not this one. 16 00:00:56,460 --> 00:00:57,350 Actually, this one. 17 00:00:57,720 --> 00:00:58,680 This order has. 18 00:01:00,520 --> 00:01:06,310 I think this one yes, this one has two products and the user already knows that at this point, if 19 00:01:06,310 --> 00:01:12,310 the user wants to check the order details, he or she would come to this page and they would be able 20 00:01:12,310 --> 00:01:13,390 to check the details. 21 00:01:13,750 --> 00:01:20,530 And if you if they click on pay now, they already know that the the price is going to be for this juice 22 00:01:20,830 --> 00:01:24,190 is going to be 155 and for this bag is going to be 250. 23 00:01:24,490 --> 00:01:28,780 And if they click on pay now, we just need to display the total and the pay button. 24 00:01:28,790 --> 00:01:29,320 That's it. 25 00:01:29,890 --> 00:01:39,160 So to do this here in the order details, remember we have we have here the image and they name the 26 00:01:39,160 --> 00:01:43,810 price and the quantity and all we need to do is that we need to give the total. 27 00:01:44,170 --> 00:01:46,150 So here this is going to get us the products. 28 00:01:46,540 --> 00:01:52,870 All we need to do now is that we need to get the total and to get the total we need to add the total. 29 00:01:53,830 --> 00:01:55,420 We need to calculate the total. 30 00:01:56,020 --> 00:01:58,210 And fortunately we already have the code. 31 00:01:58,270 --> 00:02:02,620 If you go to the cards, you will find that they have a function called calculate total. 32 00:02:02,620 --> 00:02:08,800 So we can copy this function, we can copy it from here and the order details. 33 00:02:09,520 --> 00:02:14,800 And then in the order details specifically you can base this function and use it. 34 00:02:15,310 --> 00:02:21,910 But we need to fix this function because this function now is going to get data from not from this session. 35 00:02:21,910 --> 00:02:28,330 And instead it's going to get these are from here from from the order, price and quantity. 36 00:02:28,330 --> 00:02:31,150 So we need to get the order price and the quantity. 37 00:02:31,540 --> 00:02:33,430 So we have the order details. 38 00:02:33,430 --> 00:02:43,540 Remember this order details is a is a is is going to is going to be on our day so we can copy this line 39 00:02:43,540 --> 00:02:43,960 of code. 40 00:02:45,430 --> 00:02:48,220 Which actually we can't copy the entire loop. 41 00:02:48,220 --> 00:02:49,780 We can copy this while. 42 00:02:51,790 --> 00:02:59,200 And then in the in the in the cart in the calculate the total cart here, I'm going to say calculate 43 00:02:59,200 --> 00:03:03,640 total order, order price. 44 00:03:04,600 --> 00:03:06,940 Because this is now this is not the cart now. 45 00:03:07,240 --> 00:03:08,080 This is an order. 46 00:03:08,090 --> 00:03:09,410 This is a delayed order. 47 00:03:09,430 --> 00:03:15,430 This is an order that the user placed sometime in the past and they did not pay for it. 48 00:03:15,700 --> 00:03:21,130 So this order has been placed, as you can see here in the account, the order date has been placed 49 00:03:21,340 --> 00:03:22,840 some time in the past. 50 00:03:23,200 --> 00:03:30,550 And then if the user clicks on details and want to pay, then they will be able to pay today. 51 00:03:30,730 --> 00:03:33,790 That day that they clicked on the button. 52 00:03:35,050 --> 00:03:37,030 So here in the calculate total order price. 53 00:03:37,570 --> 00:03:44,320 So here in the calculate total price, then I'm going to save, which I'm going to say while raw order 54 00:03:44,320 --> 00:03:47,800 details which are source and I'm going to close the loop. 55 00:03:48,320 --> 00:03:59,200 And instead of doing this instead of instead of using the V this code, I'm going to remove this. 56 00:04:00,010 --> 00:04:01,180 I'm going to remove this code. 57 00:04:01,630 --> 00:04:06,340 Instead, I'm going to get I'm going to get the year raw. 58 00:04:07,030 --> 00:04:12,970 And then when do we want to get we want to get the remember, we need to get the product. 59 00:04:12,970 --> 00:04:15,070 Price and quantity. 60 00:04:15,430 --> 00:04:16,240 Price and quantity. 61 00:04:18,990 --> 00:04:23,250 So here I'm going to say product underscore price. 62 00:04:24,830 --> 00:04:28,430 And then I'm going to store it in a valuable cold product. 63 00:04:29,240 --> 00:04:29,660 Rice. 64 00:04:31,730 --> 00:04:32,300 And then. 65 00:04:34,670 --> 00:04:37,460 Product quantity. 66 00:04:39,710 --> 00:04:43,990 Is equal to ra ra ra ect. 67 00:04:46,200 --> 00:04:47,040 Product. 68 00:04:48,640 --> 00:04:49,390 One. 69 00:04:56,230 --> 00:04:56,970 We wanted. 70 00:04:59,410 --> 00:05:02,890 And then we need to multiply the price by the quantity. 71 00:05:02,890 --> 00:05:03,520 We need to say 72 00:05:06,550 --> 00:05:07,180 like the year. 73 00:05:07,180 --> 00:05:09,460 We need to multiply the price by the quantity. 74 00:05:09,460 --> 00:05:11,620 We need to say price. 75 00:05:13,020 --> 00:05:17,400 Product price multiplied by product quantity. 76 00:05:18,810 --> 00:05:26,310 And then add these inside brackets and then last year less total. 77 00:05:28,510 --> 00:05:29,660 Is equal. 78 00:05:29,680 --> 00:05:31,530 Everything now is going to be equal to the total. 79 00:05:31,720 --> 00:05:32,410 Total. 80 00:05:33,190 --> 00:05:34,510 Total is going to be equal. 81 00:05:35,860 --> 00:05:37,960 Total is going to now be equal to the total. 82 00:05:38,410 --> 00:05:40,120 And we can now remove this. 83 00:05:40,720 --> 00:05:41,770 We can remove this. 84 00:05:42,250 --> 00:05:47,650 And finally, we need to store that in a valuable well already there. 85 00:05:47,680 --> 00:05:51,460 We can either return for it or store that in a valuable. 86 00:05:53,110 --> 00:05:58,830 We can here say return, for example, daughter. 87 00:06:00,670 --> 00:06:02,950 And here we need to pass the order details. 88 00:06:03,400 --> 00:06:05,800 So where can we get the or details from? 89 00:06:06,160 --> 00:06:08,110 We should get the order details from here. 90 00:06:08,710 --> 00:06:09,340 So here. 91 00:06:10,510 --> 00:06:10,870 Here. 92 00:06:10,870 --> 00:06:11,560 We need to call. 93 00:06:11,740 --> 00:06:13,330 After we execute this. 94 00:06:14,410 --> 00:06:19,510 After we execute the code, we need to say calculate order. 95 00:06:20,590 --> 00:06:21,670 Calculate total. 96 00:06:22,360 --> 00:06:26,200 Total order the price. 97 00:06:26,200 --> 00:06:28,180 And then pass the order. 98 00:06:28,180 --> 00:06:30,400 Details, order, details. 99 00:06:30,850 --> 00:06:33,940 And this is going to return the total. 100 00:06:37,320 --> 00:06:38,310 Total order. 101 00:06:39,630 --> 00:06:40,260 Total order. 102 00:06:40,260 --> 00:06:41,730 Now the total order is here. 103 00:06:42,450 --> 00:06:43,350 We can use it. 104 00:06:44,470 --> 00:06:46,210 And by the way, we need to pass the parameter. 105 00:06:46,210 --> 00:06:48,760 We need to pass the order details. 106 00:06:48,820 --> 00:06:49,750 Don't forget to pass it. 107 00:06:50,230 --> 00:06:50,790 And that's it. 108 00:06:50,800 --> 00:06:52,240 The function now is fine. 109 00:06:52,450 --> 00:06:55,930 Just calls the function and you don't have to worry about this function ever again. 110 00:06:56,500 --> 00:06:59,590 This function will be called here and that's it. 111 00:07:01,120 --> 00:07:03,550 And here you can say total order. 112 00:07:05,480 --> 00:07:05,730 Right. 113 00:07:06,080 --> 00:07:08,340 Just to make sure that you understand. 114 00:07:09,050 --> 00:07:10,100 Now at the bottom. 115 00:07:11,190 --> 00:07:11,910 At the bottom. 116 00:07:12,270 --> 00:07:13,500 We can use it. 117 00:07:13,980 --> 00:07:14,850 So at the bottom. 118 00:07:15,830 --> 00:07:18,110 We can use it here in an input. 119 00:07:18,500 --> 00:07:25,370 In a hidden input, we can say input and then type text. 120 00:07:26,480 --> 00:07:35,660 And then I type actually not text here then because we don't want to show this here hidden. 121 00:07:44,870 --> 00:07:50,420 And then the value is going to be equal to BHP. 122 00:07:51,980 --> 00:07:52,970 And then echo. 123 00:07:54,380 --> 00:07:56,660 Echo dot tell. 124 00:07:58,930 --> 00:07:59,530 Order. 125 00:08:01,050 --> 00:08:05,720 Rice semicolon and the name here went to give it a name. 126 00:08:05,730 --> 00:08:08,370 I'm going to say your name is equal to total. 127 00:08:09,790 --> 00:08:10,300 Rice. 128 00:08:15,470 --> 00:08:16,370 Total order price. 129 00:08:16,970 --> 00:08:25,880 And for this for this button we need to say name is equal to pay now pay underscore now or be order 130 00:08:26,270 --> 00:08:32,300 or order let's say order pay button and. 131 00:08:33,890 --> 00:08:35,830 Lastly, we need to get order status. 132 00:08:35,830 --> 00:08:37,670 So also the order status is very important. 133 00:08:37,680 --> 00:08:41,390 I'm going to give you another input input type. 134 00:08:42,080 --> 00:08:44,210 He then name. 135 00:08:45,810 --> 00:08:50,430 Order starters value. 136 00:08:52,770 --> 00:08:53,460 BHP. 137 00:08:55,440 --> 00:08:56,010 Echo. 138 00:08:59,450 --> 00:09:00,320 Order starters. 139 00:09:02,750 --> 00:09:05,550 Or semicolon. 140 00:09:05,750 --> 00:09:06,290 That's it. 141 00:09:08,790 --> 00:09:10,020 Now in the. 142 00:09:11,350 --> 00:09:12,100 In the payment. 143 00:09:12,100 --> 00:09:16,480 We need to receive these parameters here. 144 00:09:16,480 --> 00:09:19,020 We set payment that BHP and post. 145 00:09:19,540 --> 00:09:24,580 So in the payment that BHP would need to receive the order status. 146 00:09:24,590 --> 00:09:33,640 And here at the top we can you say order a first if. 147 00:09:36,360 --> 00:09:37,870 Is set. 148 00:09:38,890 --> 00:09:39,490 Lost. 149 00:09:42,720 --> 00:09:43,200 Lost. 150 00:09:45,060 --> 00:09:47,940 Order may be be. 151 00:09:50,190 --> 00:09:51,450 Then we need to get. 152 00:09:52,530 --> 00:09:53,820 What do we want to get? 153 00:09:53,820 --> 00:09:59,850 We want to get the boss order status. 154 00:10:01,810 --> 00:10:05,230 And we need to get the past. 155 00:10:07,820 --> 00:10:08,540 Order. 156 00:10:10,810 --> 00:10:11,620 Don't tell. 157 00:10:12,930 --> 00:10:13,530 Order. 158 00:10:15,210 --> 00:10:17,870 Rice and let me rename this because I want to be consistent. 159 00:10:17,910 --> 00:10:19,410 It's very important to be consistent. 160 00:10:20,010 --> 00:10:24,180 So at the top here, I said I said total rice. 161 00:10:24,240 --> 00:10:25,470 Total total ordered rice. 162 00:10:25,500 --> 00:10:26,070 Let me say. 163 00:10:26,640 --> 00:10:28,020 Order, total price. 164 00:10:29,460 --> 00:10:30,600 Order total. 165 00:10:31,930 --> 00:10:33,850 Right at the bottom. 166 00:10:33,850 --> 00:10:37,170 Also, I'm going to say, I think this is going to be consistent and better. 167 00:10:37,930 --> 00:10:39,100 I'm going to say in order. 168 00:10:40,990 --> 00:10:44,650 Underscore total price. 169 00:10:45,160 --> 00:10:48,970 Similarly with the echo here, I'm going to say total order. 170 00:10:48,970 --> 00:10:50,020 Total order. 171 00:10:53,300 --> 00:10:55,720 Total price. 172 00:10:57,140 --> 00:10:59,570 And he order, order status. 173 00:10:59,570 --> 00:11:00,830 Very, very consistent. 174 00:11:01,820 --> 00:11:04,520 So in the here I'm going to say order. 175 00:11:07,120 --> 00:11:07,660 Order. 176 00:11:08,500 --> 00:11:09,100 Well, tell. 177 00:11:10,150 --> 00:11:10,540 Grace. 178 00:11:12,280 --> 00:11:13,000 And read the story. 179 00:11:13,000 --> 00:11:14,140 This a variable I'm going to say. 180 00:11:14,140 --> 00:11:14,570 Order. 181 00:11:16,090 --> 00:11:16,570 Order! 182 00:11:16,840 --> 00:11:20,200 Status and order. 183 00:11:23,370 --> 00:11:23,880 Order. 184 00:11:25,020 --> 00:11:25,680 Go tell. 185 00:11:26,810 --> 00:11:27,290 Bryce. 186 00:11:30,330 --> 00:11:32,850 And in the bottom, we need to display them. 187 00:11:33,360 --> 00:11:43,560 So to display them, we need here we need to say, remember here I said order status and order status. 188 00:11:44,400 --> 00:11:52,890 We need to say we need to use the past instead of get because here I used it get let's say fast. 189 00:11:53,910 --> 00:12:00,030 So if the order status is is is equal to not paid, we need to display the button. 190 00:12:00,840 --> 00:12:07,800 And also here, let me move this line of goods and pasted about this. 191 00:12:11,830 --> 00:12:13,950 And here if a forced. 192 00:12:16,470 --> 00:12:18,920 Order status is set. 193 00:12:18,930 --> 00:12:19,980 We need to say order. 194 00:12:19,980 --> 00:12:21,450 Status here must. 195 00:12:23,880 --> 00:12:24,630 Order starters. 196 00:12:25,680 --> 00:12:27,060 Similarly with the. 197 00:12:29,240 --> 00:12:30,440 Total payment. 198 00:12:31,340 --> 00:12:35,030 A physician is is a physician total. 199 00:12:35,060 --> 00:12:36,350 They need to display the total. 200 00:12:36,710 --> 00:12:42,110 And we need to say else we need to say you don't have an honor, but I'm going to work on this later 201 00:12:42,110 --> 00:12:44,480 because it's going to it's going to get complicated. 202 00:12:44,480 --> 00:12:52,940 Let me now say and let me refresh and now let me click on details and then let me hear.