April 6, 2020
#25 Setup Shopping cart | Add to Cart | E=Commerce website in Laravel 5.5 and Ajax

#25 Setup Shopping cart | Add to Cart | E=Commerce website in Laravel 5.5 and Ajax

and you can see my cart is empty I will
try to add product by our listing if I click here you will see information or
product which we define in our controller so go to controller HTTP and
cut controller here we are returning the product but we need to update our cart
so we need to display here information for that you have to add some
information about your product like suppose you copy this this is the github
which we’d installed in the last video here you just put this information in a
variable and add here let me show you so we don’t need this option so I remove
this because we don’t have any sizes so here is price here is ID so foot here
row ID and name of product simply wrote variable and name is Toni and quantity
by default one and price growth price save it now if I go to again products
table I’m in products page and click on any product Add to Cart now product is
add successfully let me check on card information here is your memo product
bellarmin quantity one price 3:02 option empty text subtotal that’s it now we
need to display in our cart wheel where is my car to let me show you I
in folder and inside the team I have a card for PHP we have to grab this code
and we will do fear so for that first of all we need to pass this information cut
and here we say written will cut dot index so God will be our directory
folder name and here you will say data and haircut that’s fine
semicolon save it now create a new folder inside your view here you will
say cut and inside cut you will say new file index dot split it let me reload
this data now if I click on cut let me introduce um my base front master ok not
faster here here we can copy this one ok let’s copy this and inside here and and
section ok reload now let me check my something
like a cockpit fine now is add item and here I think I did something wrong
we don’t need to reject here you just put haircut and CeeLo this who
got this so you don’t need to this we will figure out the gain up later now we
know the cut here is your cut now let me add some yes this bread crumb
container so let me check my count this feels okay I think we can cope with
this row this 12 and this row so we do for our this one here you were close
freedom copy this and it’s there it’s the content and share you will say just
remove this and put haircut let me get design and here is the card
and for my son that’s it now you will put hair your design okay here you will
say design of car eh butcher and yes event
now open your theme folder and where you can see cardboard pieces okay and here
is the shopping cart building you need this type of row second is major
let’s copy this and paste a reload and failure data okay
that’s nice mmm Chanda why do you love your product name everything first of
all just my car oh okay here is the cod roe and ish to product it’s a second
time and yeah here you can check this one and this one let me figure out this is for coupon so
don’t need to ditch one here is the cart road to time so you need to remove this
for your loop the single product and here you will do sphere okay 4-h 4-h and
here doctor yeah it’s end here you will end here for
each okay we have to name let me check
that’s okay there is a add energy dominate so we have such work okay here
is a add energy here you will put your name down since always
I let me check haircut cottage okay yeah we will reload obokata what I it’s
coming okay here is a name not tour name so sorry for that we need to follow that
with you okay and second is want to be price only
price okay so now here is your price it is the name
don’t worry about this image so go to again products add one more product for
checking and go to car page now you can see is two product gulab jamun
strawberry now this time is we will add a total here and subtotal okay so here
is that total we will use here take it cart subtotal save it reload
what is subtotal dysfunction so you’ll like this ok here is why you go to if
your group sales total x60 cemre because it’s your ax
you can see this your with add text open here you put widely oh let me show you
what is this this would be I multiply Row 1 P ok not here is your quantity so
we need to display this so this here is to not try to add this product to time
to see the difference of your total so here it’s glioma add a beam open cut
there is 6:02 and quantity you can show here ok let me
show quantity while do this photo and put quantity this to this one update is
not working now but we can add remove here but first of all before the remove
we have to add here subtotal and no discount actually text we had a text
enter so go to down here subtotal you will put here that sub
total is function and here she will add X next we will check how many percent I
will check and here we will roll X here add a dollar sign it’s your crime scene
so put anything and here also function so that’s one reload here is this total
total is why I think I need a grand total also let me check text subtotal
count grand total I need grand total so maybe I think I have to add this total
so for that it will be subtotal and text so for this subtotal and plus Pro X is
the load only subtotal here a subtotal a subtotal well let me make it subtotal this will
be text and flux subtotal is 200 and you were plus X plus 1 equal to point 3 1 P undefined quantity the quantity the
quantity is not a function okay point is 200 I think I am mistake something also
now just make it total okay I will figure out for now just are they they
move I will figure out what is that I am missing for daughter and I will add in
the next video now if someone click on remove I need to remove that button
product so for that let me show you how to remove is working go to your route web dot PHP here just for testing at
home get function test function and she’ll you have to add cut remove
function with your ID I Beach which riding let me show you what L see ID highly just for testing function okay if
I go to my ID a single my ID ID here this is the ID you need to remove the
product so if you put where it means to remove let me show you first
it’s move now you will see single product here is a single product let me
show you my ID here is remove that also with the button let me add this cart and
here we will pass this remove this remove this also here you will put remove here is the remove it remove
first ID which is side leave paths here okay just think of it close and go
reload if you can see this ID 18 if I click here it will go to car to the mode
which does not exist now here inside the car functions viewport air route but got
three more tidy same we done before adds time here is a remote so you will
make this function inside here card controller may can you function properly
function mol/l town which receiving the ID and here got remove pass ID that’s it
yellow now if done return I think back is work here or not
let me check I think this one we call remote okay card does not contain ID 18
not ID 18 actually not 1890s let me return this ID / stuffer 18 but we need
we need row ID oh I D if I click this is your ID so
about that we need to pass the ID and back okay reload click on remove now
variable Pro undefined so don’t worry I think is working now go to again cut here is the same Pro well let me check
with this array done ok his empty now if I go to products add any product a day
to products now open your card and if God is empty
that’s why is showing error because you can see here we have to check if data
equal to 0 not real that’s why we will show this ok otherwise we can’t show
this Oh Jane this also scenario we load your
card controller ad Adam I think that you miss check on is this your card
eclamptic no problem you go to products add some products is added add to
products go to that and here is your Eddie okay it set a turning right that’s
why you can close this reload now you can see your view click on the move is
the more reload it is now let me try my back button reload click ok now your
heart is empty that’s why is saying the error for that you just come on went this for each commander this reload okay what is the
line number line number here Tex so you have to put this also inside here just make it clear you have to put if
condition flows all of content okay and you will say god this empty here you
will say and or you can stay empty and flop here and you can see if Skott is
empty it will show h1 with empty message if not empty then need to be sure by
default we got okay we have again let me check how we can define our uh 12 count here you will put data okay we have a
error undefined prose where is the pro now I have come at this nope okay dot example we can see here mosquito so you can ask here if God
count equal to not 0 and face your content if this is empty then we will
say it’s empty reload here copies note empty so we load okay it is empty now if
I try to add some products head back and add one more
now go to your cart here we have a three product click on remove this remove at
time you add return back for a note go to your products add one more okay it’s
add go to your cart here you can display your counter resources new front master
find car here inside of 0 you will display part 3 products and put this anchor what design and protect just value will
be Q alright and simply reload look here is your car three programs remove you
know remove card is empty that’s it okay in the next video we will
figure out and behind the scene I will make it more beautiful like a add a new
empty cart image and you can get updated code from my gate so see you in the next
video thank you

3 thoughts on “#25 Setup Shopping cart | Add to Cart | E=Commerce website in Laravel 5.5 and Ajax

  1. Hey,i try download from your github but when i'm install in my computer errors because there is no product model. can you upload full project again in your github? Thanks.

  2. Hey! When i logout and login again all added product in cart remove… Why?
    And how to save. That added product in cart to databasd??
    Plz help me..
    Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *