Hey, everyone, welcome back.
We are almost done with the award, the tail section, the only thing we need to do now is just updating
the product image.
So if we inspect this element, we will see that we already have an image tag.
So we have this ID.
Let's copy this so we can use in the code.
And there's the source of this image, which is just using a blank image.
So all we need to do is just updating this attribute.
So let's go back to the code.
And I think updating the photo could be inside the update or the details function, because after all,
this is what we are doing.
I don't think we need a function just for the photo.
So in this case, we just need to.
Select this element and now we are going to use the attribute method or the 8R.
If we pass just one argument, what we are going to be doing here is just getting it, but if we passed
two arguments, we actually change it.
So let's pass a second argument.
And now what we need to do is just let me go back to the page.
So as you can see, we have a much slash something.
So let's use.
IMG slash something, and for now, let's see what we have inside our images folder, so I'm just going
to open it here.
So here we have the IMG folder, so we have some photos inside here.
Let's try to get the V color dot j p g.
So as you can see, we have this photo here, so vivid color that GPG, let's just use this to see what
happens.
Now refreshing the page, we can see that now we were able to send this image here, which is good.
So now what we need to do is just getting the image dynamically.
So this is going to be a bit similar to what we've done with the price.
So let me just copy this.
So now we need to get inside products and using the search programs and then instead of going into the
let me just close this here to the left now, just instead of getting the unit price, we need to get
a property called photo.
So here, instead of the unit price, we need to get the photo, so now we already have a string with
the name of the photo.
The name of the variable is not unit price, let's use photo you, Lorelle, and now we can concatenate
it down here or we can concatenate it when we create the variable.
I prefer to do it here.
So we are going to.
Get this.
Prefix.
Which is the images folder, then we're going to concatenate with the filename that we have inside our
object.
So here we have the file names.
And now we already have what we need inside this variable, so we just need to use it here.
Let's save this.
Let's see what happens.
All right, so now we are showing the correct photo because the filters are set to colored and printed,
which is exactly what we are showing here.
So this part is also done.
And now our job is going to be really easy because we just need to set some events to these filters,
because every time they change, we just have to update the search parameters and then update the information
again.
So since we created functions for everything, this is going to be pretty easy to do.
We don't need to repeat any code.
We just need to call the functions again.
So this is what we are going to start doing in the next video.
I'll see you then.