Hello This is Rakesh Nagekar,

i faced a problem in PHP
when we create a shopping cart and click on Add to cart button
i require the explanation and code for view cart .


Thanks in advance

Hello..

When ever you click on the addtocart button,the product id will redirect to the addtocart.php page..
And there, we are creating a temp_ses var with random number and ref_id with (our code like BNB and one increment value like 1212) ,then we are going to insert the whole variables like temp_ses,ref_id,prod_id,qty as 1,currdate into temp orders...
then in viewcart page .we will get the selected item info from the temporders table,then we can print into our cart..

If we select same product again ,then we are going to check the qty in temp orders table with same prod_id,ref_id,temp_ses..
if the qty found,then we will go to increment the qty whti same prod_id,temp_ses,ref_id...other wise we will insert into temporders again...

Any more queries,
ask me again...

ShantI.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.