1 00:00:00,930 --> 00:00:01,620 Welcome back. 2 00:00:02,250 --> 00:00:06,540 Now we need to fully protect repayment, which we should only display. 3 00:00:06,540 --> 00:00:07,290 They pay now. 4 00:00:07,290 --> 00:00:07,500 But. 5 00:00:07,500 --> 00:00:13,590 And if there is something to pay for, if there there are products that the user wants to buy and the 6 00:00:13,590 --> 00:00:15,270 user did not pay for it yet. 7 00:00:15,720 --> 00:00:22,920 And here we have total payment is zero and still it displays a year later pay now and this is a problem 8 00:00:23,280 --> 00:00:28,860 to fix this problem here we check the session total if it's set. 9 00:00:29,280 --> 00:00:30,900 However, this is not enough. 10 00:00:31,230 --> 00:00:33,060 We need to say here and. 11 00:00:34,250 --> 00:00:43,070 If the session if the session total is not is not equal to nothing. 12 00:00:44,160 --> 00:00:48,540 It's not equal actually to zero, because if it's equal to zero, it means that there is nothing. 13 00:00:49,170 --> 00:00:54,210 So this now, if I save and refresh, the button will be hidden. 14 00:00:54,660 --> 00:00:57,150 You can display another message. 15 00:00:57,450 --> 00:00:58,410 You can see it if. 16 00:00:58,890 --> 00:01:00,030 And you can see else. 17 00:01:00,660 --> 00:01:14,130 You can, for example, here, say ls here and then curly bracket and then here BHP and then curly bracket 18 00:01:15,450 --> 00:01:18,840 and then in between you can you say. 19 00:01:21,810 --> 00:01:22,140 P. 20 00:01:24,530 --> 00:01:25,340 And then. 21 00:01:27,140 --> 00:01:27,500 E. 22 00:01:31,330 --> 00:01:34,870 You did not. 23 00:01:37,610 --> 00:01:38,080 You don't. 24 00:01:38,090 --> 00:01:39,290 Or you don't have anything. 25 00:01:39,410 --> 00:01:41,210 You don't have. 26 00:01:42,570 --> 00:01:43,890 And or. 27 00:01:45,700 --> 00:01:49,720 Or your your card is empty, whatever, whatever message you want to display. 28 00:01:50,980 --> 00:01:53,290 For example, here it's going to say total payment zero. 29 00:01:53,770 --> 00:01:56,290 And here you can say you don't have an order. 30 00:01:58,090 --> 00:01:59,920 So you can do this. 31 00:02:00,520 --> 00:02:02,650 You can display this message as well. 32 00:02:03,100 --> 00:02:08,140 You don't you don't you're going to have an order or order zero. 33 00:02:08,140 --> 00:02:09,490 You can sleep that the. 34 00:02:11,490 --> 00:02:12,700 It's zero. 35 00:02:12,970 --> 00:02:14,290 You can also say. 36 00:02:14,800 --> 00:02:15,490 And. 37 00:02:17,070 --> 00:02:19,560 Is and session. 38 00:02:21,120 --> 00:02:21,660 Session. 39 00:02:24,060 --> 00:02:24,690 Total. 40 00:02:27,840 --> 00:02:34,470 And this is going to display the total payment only if there's there is something else that's going 41 00:02:34,470 --> 00:02:37,770 to hide it, else it's going to hide it. 42 00:02:38,220 --> 00:02:40,350 So it's up to you whether you want to do this or not. 43 00:02:40,350 --> 00:02:41,070 It's up to you. 44 00:02:41,490 --> 00:02:43,110 But I'm just going to keep it simple. 45 00:02:43,260 --> 00:02:47,430 I'm going to display zero so that the user knows that there's nothing to pay for. 46 00:02:48,210 --> 00:02:50,100 So I'm just going to say total payment zero. 47 00:02:50,100 --> 00:02:50,910 And you have no order. 48 00:02:51,360 --> 00:02:52,050 Pretty simple. 49 00:02:52,470 --> 00:02:58,350 And in case the user comes from another page, for example, let me go to my account. 50 00:03:00,250 --> 00:03:01,870 And Leeming log in. 51 00:03:02,740 --> 00:03:07,240 So let me log in and here let me, for example, click on order. 52 00:03:07,240 --> 00:03:11,060 That has not been paid, for example, of this one, I'm going to click on it here. 53 00:03:11,110 --> 00:03:16,750 It's going to say pay now, but the big now button is is not activated yet. 54 00:03:16,750 --> 00:03:19,420 So we need to activate this in the details. 55 00:03:19,420 --> 00:03:24,670 In the order details, we need to take the user to the payment page from here. 56 00:03:24,670 --> 00:03:31,900 So from here we need to say if order status is not is equal to not paid, then we can display this button. 57 00:03:31,900 --> 00:03:39,940 And then we need to say here we need to take the user to the payment page and and to do this we can 58 00:03:40,960 --> 00:03:47,440 say here form and then method must. 59 00:03:48,450 --> 00:03:55,860 And action is to take the that the repayment that BHP. 60 00:04:02,300 --> 00:04:03,650 Let me save and refresh. 61 00:04:07,130 --> 00:04:14,590 Now if I click on details and then here if I click on P now it should take me to the payment entrance. 62 00:04:14,600 --> 00:04:20,600 Since there is since I did not work on this details yet, it's not going to display anything. 63 00:04:20,600 --> 00:04:21,140 But later. 64 00:04:21,140 --> 00:04:28,280 We need to take the details from here, from the order details page because at this point we have the 65 00:04:28,280 --> 00:04:28,670 details. 66 00:04:28,670 --> 00:04:29,330 We have these. 67 00:04:29,690 --> 00:04:36,410 We need to take them from here to the paying B now button so that the user will be able to pay for for 68 00:04:36,410 --> 00:04:36,650 this.