Welcome back.
Now, what we need to do is that we need to add the product to the cart.
So, for example, if the user goes through this product and wants to add this product to their cart
and click on Add to Cart, nothing is going to happen.
And we need to activate this button.
So to activate this button, we need to take data from here and inserted into the cart and store it
into the cart.
And to do this, we need to use sessions.
So what I'm going to do is that here we have this single product page which, which displays this page.
And in order to store that in the cart, once the user clicks on add to cart, we need, as I told you,
we need to use this session.
So we need.
To to go to the cart page.
This is the cart page and let me show you the cart page.
So let me go to the card page first.
I'm going to go through the card that each email and in the cart page we need to display this product.
So for example, if I click on Add to Cart, we need to take the user to this card page and display
the product that they have added to the cart.
And all of this will be done in the cart that email.
But first, we need to convert this card, that B2B into a card that will into B2B.
So I'm going to change the name the extension from email to GA Dot Beach me and then this cart at the
top.
At the top, I'm going to add a B2B cut.
You're at the top.
At the top.
I'm going to add the beach.
Be good.
But before I work on record here, we need to work on the code in the single product that each beat.
But before working on the cart, we need to work on a single product.
That beats me because in a single product, we need to take the product from here all the way to the
card.
So in the single product, remember, we have a product information here and in order to transfer the
product information from here, we need to add a form.
But this form is going to be hidden.
So here what I'm going to do is that I'm going to look for the loop.
Where is the loop?
Here's the loop.
So I'm going to get here a form.
I'm going to say here form.
Form which which should contain the image.
So I'm going to start the form from here.
The form is going to start from you as a form.
And then I'm going to close the form.
Just just above this, this curly bracket.
And then this form.
This form will take first a method, and the method is going to be post and action.
So the action the action is going to be the cart.
So I'm going to say cart that BHP and we need to pass the following first the image.
So in order to pass the image, we need here to create inputs.
So I'm going to get hidden inputs with the data that they want to pass.
So I'm going to take your input and that input type is hidden.
I'm going to say hidden.
And I'm going to store.
I'm going to say name.
The name is going to be image.
Let's say image.
Product.
Image.
I'm going to say product image and product image.
And I'm going to see value.
The value is very important.
We need to store the value so the value is going to be equal to the image.
So I'm going to copy this.
The value is this.
And below.
We need to get another input.
I'm going to say input and then I'm going to say type.
And the type is going to be again hidden and the name is going to be we need to pass the in the cart.
We only need one image.
We don't need all of the images.
So we need the image.
We need the product name and the price and the description.
Let me check one more time.
So here we need the we don't need the description.
We actually need the name and the price.
So the name here.
I'm going to say name, product, name, product, underscore, name, and then the value.
So the value is here.
BHP.
And instead of repeating this, God, let me copy the good.
Alamy place it here, and then I'm going to just change.
I'm just going to change your product name.
Third, we need another input, so I'm going to copy this input now.
There is no need to repeat this.
And then I'm going to pasted below and we need.
We need the price.
Product underscore price.
Project Price.
And let me check one more time.
What else do we need?
So we need the name, the image, the price, the quantity.
So we need the quantity.
So the quantity we can give the quantity.
Remember here, this is the quantity.
So the quantity exists here.
The quantity is tricky because the quantity is is here.
This is the input for the quantity.
So the quantity is the only one that's not going to be hidden.
So we need to say inputs here and then type and then the value, the, the value is, is initially one.
And I'm going to take your name and the name is going to be product, product one T and the value is
going to be here one.
And if the user change, it changes the quantity, it's going to be changed.
So we don't need to use BHP for it.
So this is for the quantity.
What else do we want?
We don't want anything.
I think we are good to go.
So again, we need the image, we need the the quantity, we need the name and the we need the price.
And finally we need a button.
So we need to activate the button.
So this is the button.
This button.
We need to use input for this button or say we can see, we can say here type.
Submit.
You can see types of meat and we need to give it a name as well.
I'm going to say name and the name is is let's say product.
Let's say add to cart.
Add to cart.
Let me save a lady.
Oh, now.
He went over to the browser and let me go back and click on this by now.
But as you can see, you will find nothing here.
And the the the component will be displayed below.
And this is a problem.
So to fix this problem, we need to copy the form.
We need to copy the form.
And then we need to remove it from here.
And then we need to display the form here.
We need to display the form only here.
Here.
I'm going to base the form and then I'm going to close the form here.
I'm going to close the form here.
And then I'm going to I'm going to remove this form from here.
I'm going to remove this closing tag.
So the form let me fix everything so that everything becomes clear.
Let me also add this button.
I'm going to.
David and then I'm going to display it here.
So let me now fix everything and.
Walk you through the card one more time.
So what I did is that I just added a form with hidden inputs and only two inputs that will be displayed.
The apple card and the quantity.
That's it.
Here.
This is the form.
And then I'm going to click on file.
I've been able.
And now let me refresh and this should fix it.
So let me show you this.
As you can see now, it fixed the form.
Now, if you click on Add to Cart, it's going to take me to the Cart page.
But we need now to fetch data from the past parameter because data now has been stored in the past parameter
off each.