Hello, friend.
Welcome back.
In our previous video here, we successfully add all that our product and we successfully done this
job right.
So now it's great.
So now, friend, in this video I want to do on to update little bit in our all product page that means
here right now all that are product images is visible.
Product name is visible price quantity discount and also status is visible.
Right?
So first of all, I want to do to add some of the action here.
I want to add that multiple of field here, I want to add the edit button that should be loaded, one
of the delete button.
I want to load it and also load it on the inactive or active button and also the details.
That means when you click as a details specific, this product will be related to the detail space.
Okay, so this type upon of the button first of all, and to add here, if I use that things like that
way, that will be not enough.
But I want to use some of the icon.
If you go to that Google and here if you start with the font or some CD and icon, I want to use some
of the font or some if you go to that screen that is a font or some library I simply go to here and
right now I only want to do on to add that our all means CSS.
Okay, so that will be needed.
I simply copy it and copy that URL or embedded code.
I copy it.
And now if you go here, I want to add it in or back in.
So back in related everything, I have already created our main page that is in our view admin and that
is our admin dashboard.
Right?
So you do the admin dashboard I want to do, I want to simply load it that font.
Awesome.
So here that is a color font or some clean on the link.
I simply load it.
So now we are able to use all that our font or some icon.
Now let's create it.
I click as a save all and now if you go to our all product page, that means our product and that is
our product.
All page, right?
So into the product, all page before I have used it like that way here I have loaded that edit button.
That is a delete button.
So now how to do how to change it a little bit here.
I better put some the one of the title with the title title that will be for the edit.
Okay.
Make it as the edit data.
That will be for the edit data.
And here I don't want to use any text here.
I want to load on the icon.
That means the font of some icon if you want to load it.
That is I tag I want to do and to close the sci-tech here I am to close it and into this position I
want to put on the class.
I here for the edit to use it as a far far and then pencil and paper pencil.
So here you will get everything in front of some icon area.
So that is pretty much basic things.
So now I want to do undo check it, click as I save all I want to check it or font some is working or
not.
If you go to your admin I want to refresh it.
Yeah.
You can see it's not successfully display our font or some icon for the edit.
Great.
So also on to do the same things for that select.
Okay.
Here.
That is for the delete.
I want to use the same things.
First of all, I want to add all of the icon here.
After that, I'd want to use that as I'm title title actually is means for if you put your cursor here,
it will be displayed on the text as it is.
What exactly that for?
That is for the edit data.
And I want to also do that.
Thanks for the direct data.
So I make it as a dialect.
So that is a dialect data.
I make it as a direct data.
And for the direct data, I don't want to use that text here.
I want to do I want to use one of the trash that is also another font of some icon.
I simply load it this icon.
I want to close this icon here that will be on the class and I want to use that class as a file and
then file trash.
So that will be our other font or some icons should be loaded.
Now if you want to check it, click as a save all.
And now if you go refresh it now that should be changes.
Yeah, you can see there is a font, some icon is loaded for the select and you can see it's also display
as a data.
Now I want to add another to here.
If you want to add it like I want to do or to better copy this one, I copy it and after that I paste
it.
So that will be our another one for the detail space.
Okay, so now I'm going to use it as a details for the details I want to use as a file for.
So that will be as a detailed data, make it as a details, details a little space.
I want to make it as a detail space so that will be the detail space.
And here I want to use that another font or some icon that will be as far that is a far far and I want
to do and to use it as I so that will be as I step upon the icon.
And also here I want to do to add another one that will be as a thumbs up and thumbs down, that will
be for the active or inactive or status.
So for the reasons here, I want to do, I want to use another one that will be the title title I want
to update and that will be for the inactive by default.
That will be displays, inactive and inactive.
I want to do to use it as a file for that is also another icon I want to do and use it.
So that will be the file and then solid.
That is a fast solid and then file thumbs, thumbs and then down, down.
And also that is another one as app.
So first of all, I to check.
Also here, I want to do the change that that will be as a primary.
I make it as a BTN primary.
Now that will be another button.
I'll click the Save all.
Now if you go refresh it.
Hmm.
Because it's not displayed that things like that way.
So now there is ah.
Edit That will be for the dialect, that will be for the eye.
That is, that is for our detail space and that will be for the inactive or the active OC.
That means by default here or is status as a one also wanted to update that status event to update it
like that is actually our status.
Right?
So here I want to do I want to add on the condition I have already get all that our product data and
I want to access it.
I have access it by the item, right?
So now with this item I want to do, I won't be able to access our estrus field.
So I simply added one of the condition here right now, I don't need this, I close remove it and into
the study area here.
I want to use all the if condition at the at the rate if and also we have to do we have to end it.
I want to do and end it that is will be at the rate and if okay so if here I want to add that condition
here when if you want to access the status, will we have to access it by the item?
And then I want to do anti access our filename as a status.
Right.
So that is our status when this is status will be equal, equal one because of all here.
If you go by default I insert it as a one value right here.
If you go in our product table that is already status field by default I insert as a one.
So I want to do when that will be as a one, then that will be as active rather than that will be inactive.
Like a simple condition that I have already done before.
Now when our item is status will be equal equal one then here I want to do to use one of these pen.
I want to use all of this pen and this is to put on the color here on the user, the bar color that
that will be the word Z.
And I want to use it as a it that will be the rounded, rounded pill.
And here I want to use it as a bead success.
So this step of one of the bars I want to use and here it will be display the active then that always
display active and else I make it as ls lc which will be displayed or another one as inactive.
I copied that so that will be as a zero.
Then that will be as display inactive I want to do to make it as a in active weight and for the inactive,
but to make it as a danger so that that always a danger.
Great.
Now if you click as a save all here I want to do click the save vol and now that should be display active
rather than the inactive.
So right now our both of these as the active now that should be displayed as the active because of a
lot of value as a one.
Yes you can see it's not successfully display as the active and also here it's display as active right
here also it's not successfully displayed and also if you want to change it like I want to change that
the status is status as a different one, as a zero.
Now that should be a display as inactive.
They show you like here.
Now if you click the refresh now that should be displayed as inactive, right?
So that is the our simple condition.
When our status will be as a one, then that will display the active else.
This will be displayed in active grid.
So now I want to do the same condition for the thumbs up and for the thumbs down.
So here I want to do to use the same condition, but I copy it and now after that I paste it.
So now when our status will be as a one, then I want to do how to make it as inactive.
That means here that will be displayed as a thumbs down and else I want to copy it and else.
So that will be the ILS.
And also I want to make it as a and if and if condition and else this will be displayed or another one
that will be as active.
I make it as active.
And if the active, I want to make it as a thumbs up.
Okay.
So then that will be the thumbs up.
Great.
So now if you click as a save all and now I hope it's very clear to you now if you click the save refresh
now we can see now here, if you put your browser, that means this post, the product is already active.
And now if you want to inactivate here, you have to click it right.
All right, then that product is already inactive.
If you now want to activate, you have to do have to click it in here.
So that is the simple process.
I want to do this step by step.
We have to also cover it.
Now, first of all, I want to get around to actually to use the different color or to use the different
colors info.
There is a primary I have use it.
There is a danger and there is the info, right?
I want to use it as a warning for this.
As a warning.
Okay.
Our.
So that will be as a warning.
Now, let's check this out like I save all.
Now, if you refresh it.
Now, that should be as a warning color.
Great.
So which is fine.
I often it's very clear to you.
And now also on to update our another part.
The discount.
Right now it's display the discount or total amount.
Read your price as a 300 and our another price is a 500.
So now it's displayed direct our price.
Right.
So I want to do on some of the time you made add any discount price for this product.
Right so then that will be display some of the value in particular that area.
So I want to do how to make it as a dynamic because I have already make this discount field as a non
able.
You may also don't want to add any discount in particular at that position.
So in that case, I want to add another conditions like here that is for our product discount, right?
That is a discount price.
So if the discount price area here I want to do on to work in particular that position that will be
calculated, all that our data then that will be very interactive like I want to do on the ad or on
the if condition that is our if condition into the if condition that is pretty much very basic like
I want to do on to access our discount field.
If you want to access it right now we are already into the for each loop so now we can able to access
it by the item and that is our filename as a discount price when this discount price will be equal.
Equal null.
Okay.
When that will be as a null here, I make it as a null because of all when that will be as empty.
All that are empty value that should be added.
This type upon the text that is actually null null value.
Right?
So I make it as a win that will be as a equal equal null.
Then here I want to display one of the bar where I copy.
That is when I copy that is spent and I want to do on the pasted.
So that will be I make it as a bid, not success info to use and that will be the info.
So into the info here then that will be displayed as a no discount.
I hope it's very clear when our discount price will be equal null then that will be displayed or spent
as a no discount and else else is will be do another things.
That means here that should be some of the discount.
Right.
So make it else.
So that is our else.
And also we have to end it.
That means that is our and okay and if condition great great and that is our tree is ended so right
now I close it remove it.
Okay so when that will be as a null, then that will be displayed in no discount and else I want to
do on to calculate it this data.
That means here I want to display all that our percentage value, not that our direct value.
That means how many percentages you have added for the discount.
So that is the percentage result.
I want to visible it in here.
So even to get that percentage result, what exactly the calculation will be like if you go to that
our structure and into this structure, our selling price.
Right.
So here, first of all we have to do that is our selling price.
So the selling price will be minus our discount price.
And then we have to do we have to divide it by the selling price and also we have to multiple with the
100.
Then we'll get that our percentage value.
So that is the simple calculation.
So now I want to use the same calculation in here that is our endive and better on to use on the block,
first of all, and calculated that that will be our and BSP.
So this PHP block area, I want to take all of the variable as the amount.
So I simply take one of the variable as the amount.
And here right now with this our item amount to access our filename or filename as a selling price,
the selling price will be minus.
Minus will be from our discount price.
Right?
So that will be as a discount price.
So I simply minus from our discount price and here I get that thing.
So with our variable as the amount, that means our selling price will be minus promote discount price
at target with our amount, which is fine.
And now I want to do how to calculate the discount.
So for the calculate discount, I take another variable as a discount.
Okay, so that will be the discount.
And here I want to do calculated it.
So that means our it will be minus our discount amount.
I take the things with this variable now with this amount that will be divided by divided by our selling
price.
Right.
So now that will be divided by our selling price.
And then that should be multiple.
Multiple will be with our 100.
Then we'll get that our percentage value.
So that is the simple calculation.
So I simply take it and that will be divided by our selling price and equal to our that means multiple
with the 100, then that will be our discount price.
So now that is the discount price I want to do on the visible it.
Okay, here I want to visible it with the beta, copy it and then I paste it.
So now that will be as another part Z.
I want to use that as a danger.
Then that will be the danger and into this danger area I want to do to display or that is the discount.
Okay, so now that will be totally dynamic here.
I want to do I want to use out the rounded value also.
So that will be the round means if you if they have the our calculation value like as five point something
like that.
So it will be make it as a round that.
Should we make it as a five or four?
So that is actually a calculated value.
So now I'm going to make it as a round it and that will be round and round will be our which one here?
I have already calculated this data and I take that things with this variable now that will be our total
discount price.
So I make it as a this will be displayed by the percentage, right.
So I make it as a person this great grade.
So that's all.
And that's all you have to do.
Now let's check this out.
Our calculation also should be updated for the discount if we now go.
And here now if you refresh it now, yeah, you can see for a specific this product now it's not display
our total amount is not display.
I have added the 33% and for this product I have added that 20%.
Right.
If this field is empty, then that will be displayed over another part party as in no discount.
Great.
So now is very interactive.
Okay, so in our next video, I want to do how to complete our edit functionality.
So if you want to edit this product, how can edit it?
In our next video?
I'll show you that things with the live example.
So thanks for watching.
I will see you in the next video.