How to Display Total Price for a Cart in Laravel | Laravel E-Ccommerce Project Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone this is Yamin and welcome to L project for beginner so in this tutorial we're going to show the user the total price of the F that the customer added to their card so over here when will show the total price of those product so for it let's go back to our code and we put our my card bl. PHP and here you can see for each dollar card as dollar card so before that we're going to write some P script boort so for it we need to give this Arrow side then question mark then we set here BP then it will in over here like this PP in like this so here inside this PHP let me just declare in varable let's say dollar hell equal to it will be zero and after it we'll go down and here you can see the forest Lo in here so before that let me just write one more PSP opening and we also close this PHP and after this we're going to set here hello equal to and here you can see this okay dollar value equal to it will be dollar value uh value for this is zero so after this we give last side then over here you can see you are getting the product price so I'll just copy this and paste it here so how this do is first of all it will get the portable price for here and add it with zero so the first prodct value is over here 240 so the hand for this varable will be 240 then for the second for the value is 888 so it will add 888 with 240 this way we get the total value or total price of the product that the customer added to their G so after this we need to pin this Val right so here after this t uh the table here after this D we have to give another D here then inside this let's mention H3 T and inside this H3 we are going to set total h of card is and we are going to cing this B so we get to second bracket here and and we're going to say here dollar hello and before this let's skip this dollar sign let's set this and right now if we refresh there you can see we able to see the total Val cap which is 17K let we remove this product from here if I now click on remove there you can see the value changes over here so let's just keep it in the center so for it let's go back to the port and inside this tip let's say here class class and the class will be carore let's hello let's send this let's the top uh in the style we're going to send. carore hello and we'll give to Second bracket let's say here text align it will be Center let's say marging Port it will be 70ps and let's also add some padding let's say padding will be 18 BX save it let's go back to the browser then just refresh and there you get it total value of card is 459 like this so let's go and add some more produ and we go down let's add this one C on add to car and the guive product added to the car let's go to our car and we are to see different value if we just log out for here and log in as a different user uh let's say this time we log in as Yamin let's skip the password here let's click login then let's go to our car then can see we are seeing LIF and help so this how we can show the total T of the card in L if you have any question or suggestion just let me know in the comment section make sure to subscribe and I will for see in the future tutorials
Info
Channel: Web Tech Knowledge
Views: 880
Rating: undefined out of 5
Keywords: laravel for beginners, laravel, how to make add to cart in laravel, how to use shopping cart in laravel, shopping cart in laravel, laravel tutorial for beginners, laravel shopping cart, laravel tutorial, how to make shopping cart in laravel, add to cart in laravel, how to display total price in laravel 9, how to show total price in livewire laravel 9, shopping cart laravel, laravel ecommerce, how to build a laravel ecommerce project, cart item total price in laravel
Id: RNAfsqzdIkk
Channel Id: undefined
Length: 4min 18sec (258 seconds)
Published: Tue May 07 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.