Welcome back.
Now it's time to fix every a bug that we have in the car.
And it's very important to fix this because we want users to have the best possible user experience.
So the problem is that if you click now, if you go to the website initially and if you click on the
cart, I allow users to be able to to go to the cart, even if there is nothing of the cart.
And if there is nothing in the cart initially you will get this error.
And this error is because the session has not been initialized.
But later, if user add something to the cart and removes it from the cart, it would work and there
will be no problem.
This error would not occur because the reaction would be initialized, but it would be empty and there
is no problem with it.
So the problem is that we need to initialize this or we need to protect the execution of the session
in case the session is not set and to do this here in the cart before using the session.
As I told you, whenever we use a key variables in B2B, we need to check whether they are set or not.
So here in this for each before we use the session, we need to say here.
BHP and then AIF is set.
Session.
Garth.
And then.
Kill him, rocket and then I'm going to close the beach.
Be if that if this Asian court is set, then we execute the four each and display the products and then.
At the end specifically here, I had a record here just just inside the table and above the.
Above the above the tr here.
What we need to do is that we need to close it.
So to close it, we need to close it here because here we are actually, we are using it again.
So let me here close it first.
I'm going to close it here.
We need to close it here.
Link to save HP and then close the bracket.
However, we need to create another protection here.
So here we need to say we need to say if.
BHP if.
Is sex.
If a set session.
Session.
The hotel.
Then we display the total.
However, it's better to say it because we don't want to be told the the total would be actually would
be zero.
There is no problem with it, but it's better to be consistent.
So if the cart is empty, it means that the total is zero.
We already took care of this so we can use cart or two.
It's, it's, it's going to be the same because they are related in some way.
If the cart is empty, it's going to be zero.
Let me now refresh and show you that the air will be gone.
So as you can see, the error is gone and it's perfect now it's perfect.
And another thing that we need to do is that, as you can see, if you refresh, you will get this air.
And this air is because we have this on display twice and we need to remove this and start from here.
And it's it's better to add this issue and start at the head.
So let me open up the header.
Let me open up the header in the layouts.
We have the header and in the header we need to add the session.
We already have the session so we don't have any problems here.
If you you should remove it from here and added in the header because the ending will be included in
every single page, almost in every single page.
And you can even here include the, include the server connection.
You can say you got that event server connection in case you just want to make sure that the server
connection will, will always be here or you can include it in every single file you want.
So it's up to you to do this or to include it in every single file that uses it.
Let me now refresh and show you that the error will be gone.
So as you can see, there is no air, so there is no air and the air will not be there at all.
So it has been removed and every single page now works perfectly and our website is just perfect.