Welcome back.
Now we need to fully protect repayment, which we should only display.
They pay now.
But.
And if there is something to pay for, if there there are products that the user wants to buy and the
user did not pay for it yet.
And here we have total payment is zero and still it displays a year later pay now and this is a problem
to fix this problem here we check the session total if it's set.
However, this is not enough.
We need to say here and.
If the session if the session total is not is not equal to nothing.
It's not equal actually to zero, because if it's equal to zero, it means that there is nothing.
So this now, if I save and refresh, the button will be hidden.
You can display another message.
You can see it if.
And you can see else.
You can, for example, here, say ls here and then curly bracket and then here BHP and then curly bracket
and then in between you can you say.
P.
And then.
E.
You did not.
You don't.
Or you don't have anything.
You don't have.
And or.
Or your your card is empty, whatever, whatever message you want to display.
For example, here it's going to say total payment zero.
And here you can say you don't have an order.
So you can do this.
You can display this message as well.
You don't you don't you're going to have an order or order zero.
You can sleep that the.
It's zero.
You can also say.
And.
Is and session.
Session.
Total.
And this is going to display the total payment only if there's there is something else that's going
to hide it, else it's going to hide it.
So it's up to you whether you want to do this or not.
It's up to you.
But I'm just going to keep it simple.
I'm going to display zero so that the user knows that there's nothing to pay for.
So I'm just going to say total payment zero.
And you have no order.
Pretty simple.
And in case the user comes from another page, for example, let me go to my account.
And Leeming log in.
So let me log in and here let me, for example, click on order.
That has not been paid, for example, of this one, I'm going to click on it here.
It's going to say pay now, but the big now button is is not activated yet.
So we need to activate this in the details.
In the order details, we need to take the user to the payment page from here.
So from here we need to say if order status is not is equal to not paid, then we can display this button.
And then we need to say here we need to take the user to the payment page and and to do this we can
say here form and then method must.
And action is to take the that the repayment that BHP.
Let me save and refresh.
Now if I click on details and then here if I click on P now it should take me to the payment entrance.
Since there is since I did not work on this details yet, it's not going to display anything.
But later.
We need to take the details from here, from the order details page because at this point we have the
details.
We have these.
We need to take them from here to the paying B now button so that the user will be able to pay for for
this.