Simple Shopping Cart Using Session Variables Using AJAX
Feb 5, 2011
I know there are a million questions out there on how to implement a shopping cart in your site. However, I think my problem may be somewhat different. I currently have a working shopping cart that I wrote back in the 1.1 days that uses ASP.NET session variables to keep track of everything. This has been in place for about 6 years and has served its purpose well. However, it has come time to upgrade the site and part of what I have been tasked with is creating a more, erm, user-friendly site. Part of this is removing updatepanels and implementing real AJAX solutions.
My problem comes in where I need to persist this shopping cart over several pages. Sure I could use cookies, but I would like to keep track of carts for statistical purposes (abandonment stats, items added but not bought, those kinds of stats) as well as ser-friendliness, like persisting their cart so that if they come back it is remembered. This is easy enough if a user is logged in, but I don't want to force a user to create an account if they don't want. Additionally, the way we were processing orders was a bit, ehh, slapped-together. All of the details (color selected, type selected, etc) are passed to paypal via their description string which for the most part is ok, but if a product has selections that are too long for the string (255 chars i believe), they are cut off and we have to call the customer to confirm what they bought. If I were to implement a more "solid" shopping cart, we wouldn't have to do that because all the customer's choices would be stored, in addition to the order automatically being entered into the order processing system (they're manually entered into an excel spreadsheet. i know, right).
I want to do this the right way, but I don't want to use any sort of overblown software that won't really work with our current business model. Do I use a cookie to "label" each visitor to match them with their cart (give them a cookie with a GUID) across pages, keep their whole cart client side, keep the cart server side and just pull it from the db on each page refresh?
View 2 Replies
Similar Messages:
Feb 25, 2011
How to create a simple shopping cart in asp.net/c#
View 4 Replies
May 1, 2010
I'm creating a shopping cart application and I'm having some issues with implementing a session state for my arraylist.
in my page load i declared
if (Session["Cart"] == null)
{
Session["Cart"] = new ArrayList();
}
else
{
ArrayList cart = (ArrayList)Session["Cart"];
}
to create the session if it doesn't exist yet.
then i have an event handler for a button to add items to the arraylist
protected void onClick_AddBooking(object sender, EventArgs e)
{
int ClassID = Convert.ToInt32(Request.QueryString.Get("Class_Id"));
ArrayList cart1 = new ArrayList();
cart1 = Session["Cart"];
cart1.Add(ClassID);
I'm essentially storing the class_ID then when the student confirms i'll store that to the DB and associate that ID with the Class Details.
View 1 Replies
Mar 8, 2011
i am currently storing my shopping cart in a datatable assigned to the session. but i wanted to know is it a good idea to store the GUID for the session shopping cart?
View 6 Replies
May 7, 2015
In my online shop, users can search products,each product have a link called add to shopping cart, users can add to the list many products like anonymous user, the question is.How can i do,for not to lose the product list, when user make Log in or create one account in my site
View 1 Replies
Feb 25, 2010
I want to develop function shopping cart using ajax.I have just googled but don't found wish result.
View 2 Replies
Nov 1, 2010
how can i cart items for shopping cart application ...i am really new to web development and i want to create a shopping cart and want to cart items in it. how should i cart items.
View 2 Replies
May 11, 2010
can i get a good example.. in order to get started with shopping cart.. how long it's gonna take while implementing it..?
View 5 Replies
Feb 7, 2010
What is the easy way to create shopping cart?
View 8 Replies
Apr 25, 2010
offer a good shopping cart tutorial?This looked like just the thing: http://net.tutsplus.com/tutorials/other/build-a-shopping-cart-in-aspnet/There are postive and negative comments though.I'm a C# beginner so know how to put it mostly together, but I'm not experience enough to know anything about "singletons" and other performance issues that above code may have.
View 5 Replies
Jun 28, 2012
What is the most common or preferred control to build the shopping cart? By this, I mean the actual control that contains the product image, description, price & checkbox to select the item.
View 8 Replies
Dec 11, 2010
I am making progress on my shopping cart page. I want to show the contents of my shopping cart but I am puzzled on how to do this.
Here is the code :
Cart Class (Cart.cs)
[Code]....
Default.aspx ( I would like the cart to show up on a label on this page at the bottom)
[Code]....
[Code]....
View 3 Replies
Feb 28, 2011
I'm looking for a free shopping cart source code to start creating customized chart.MSC Musicstore sample code is too simple. NOPCommerce requires adding link into it in every page.Where so find such source code ?
View 4 Replies
Nov 21, 2010
Say i have a Laptop for 600.00. Say i change it to $650.00. How do shopping carts handle that? Like do they store the price in the cart or the item? How do they make sure they get the price they wanted but not bill the customer the new change without asking them? Or do most store them in both?
I was thinking maybe i could store it in both.So if the current price is over the cart price for a item, don't remove it/bill them from their cart. Then after, tell them what was billed/email a receipt for the items that didn't change that was billed(say they had more then one item) and remove it from the cart. For the items that did change, say something like "Items left in cart due to price change, check if you still want to buy the items at the new price." So leave the items that changed in the cart but update the price in the cart.
I don't think the language should matter. Guess this is more of a logical type question. Do most shopping carts do it this way or is there a better way?
View 3 Replies
Apr 2, 2011
I have a master page where in one ContentPlaceHolder I put my shopping cart:
<asp:ContentPlaceHolder ID="continutMeniuContulMeu" runat="server">
asp:UpdatePanel runat="server" ID="updatePanelCos" UpdateMode="Conditional">
<ContentTemplate>
<user:ShoppingCart ID="shoppingCartControl" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:ContentPlaceHolder>
View 1 Replies
Jul 9, 2010
I had done a shoppingcart in asp.net and i have to connect it to Authorize.net for payment process.
I dont know anything about this.
View 2 Replies
Mar 7, 2010
I am working on building a new shopping cart applicaiton. When i checked many shopping card applications, i found that the cateogry pages and product pages seems to be dynamically created. eg: http://shopping.sify.com/cadbury-bournville-almond/chocolates/CHOC24112009TTL14.htm
How this is being done? Is this page is created while adding product itself?
View 2 Replies
Mar 24, 2010
I am looking for a drag & drop shopping cart, which I can use with asp.net & can save the details in sql server 2005 database. I don't bother if it from ajax, javascript or jquery.Actually I have a grid, in which I am having picture, product name & price (say), so either I could be able to drag the row to the cart to add or increase the product quantity. or on click on the add to cart button, it will flow to the shopping cart.
View 10 Replies
Mar 28, 2011
How to implement shopping cart in asp.net. Provide with step by step procedures
View 3 Replies
Oct 20, 2010
I am working on a Railway Portal and would require maintaining a shopping cart of components user has selected, there could be multiple components of different type in the cart. I don't see a value in storing the cart in database, would like to store the final order in DB. Where can I store/hold (temporary) the cart data per user session in MVC? All MVC samples I saw online save the cart data in DB - not sure why.
MVC presentation layer will be communicating with external web services for pricing and availability of these components, so I can't store only the product IDs to do a lookup for actual product descriptions/prices during the shopping process... I have to store everything in the cart (Product IDs, Descriptions, Prices etc) some place in memory. My application will be running in WEB FARM environment and cannot use in-process session storage.
Options come to my mind are:
SESSION STATE in SQL SERVER Using some kind of Distributed Caching Mechanism to store Session data such as "Windows Server AppFabric"
View 4 Replies
Mar 3, 2011
How to create search box for shopping cart: textbox with search button. Clicking in search button or pressing enter should call search method in controller.
Where to find sample style and code for this for MVC application ?
View 3 Replies
Oct 2, 2013
How to design shoping cart in ASP.Net?
View 1 Replies
Apr 9, 2010
how to make shopping cart with the help of PayPal using asp.net with c#, and i am using sql server 2005 as back end
View 1 Replies
Aug 17, 2010
I having problem in adding the variable into linkedlist.
<div id="one" style="display: block; ">
<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1"
GroupItemCount="3" OnItemCommand="ListView1_OnItemCommand">
<EmptyItemTemplate> <td runat="server" /> </EmptyItemTemplate> <ItemTemplate>
<td runat="server" style="">
<asp:Label ID="foodnameLabel" runat="server" Text='<%# Eval("foodname") %>' />
<br /> <asp:Label ID="foodimgLabel" runat="server" Text='<%# Eval("foodimg") %>' />
<br /> <asp:Label ID="priceLabel" runat="server" Text='<%# String.Format("{0:0.00}", Eval("price")) %>' />
<br /> <asp:Label ID="stallidLabel" runat="server" Text='<%# Eval("stallid") %>' Visible="false"/>
<br />
<asp:Button ID="addtocart" runat="server" Text='Add to cart' CommandName="addtocart" CommandArgument='<%# Eval("foodname")+ " " + Eval("price")%>' />
</td> </ItemTemplate> <AlternatingItemTemplate> <td runat="server" style="">
<asp:Label ID="foodnameLabel" runat="server" Text='<%# Eval("foodname") %>' />
<br /> <asp:Label ID="foodimgLabel" runat="server" Text='<%# Eval("foodimg") %>' />
<br /> <asp:Label ID="priceLabel" runat="server" Text='<%# String.Format("{0:0.00}", Eval("price")) %>' />
<br /> <asp:Label ID="stallidLabel" runat="server" Text='<%# Eval("stallid") %>' Visible="false"/>
<br /> <asp:Button ID="addtocart" runat="server" Text='Add to cart' CommandName="addtocart" CommandArgument='<%# Eval("foodname")%>' />
</td> </AlternatingItemTemplate> <EmptyDataTemplate> <table runat="server" style="">
<tr> <td> No data was returned.</td> </tr> </table> </EmptyDataTemplate> <LayoutTemplate>
<table runat="server"> <tr runat="server"> <td runat="server">
<table ID="groupPlaceholderContainer" runat="server" border="0" style="">
<tr ID="groupPlaceholder" runat="server"> </tr> </table> </td> </tr>
<tr runat="server"> <td runat="server" style="">
<asp:DataPager ID="DataPager1" runat="server" PageSize="12">
<Fields> <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
</Fields> </asp:DataPager> </td> </tr> </table> </LayoutTemplate> <GroupTemplate>
<tr ID="itemPlaceholderContainer" runat="server">
<td ID="itemPlaceholder" runat="server"> </td> </tr> </GroupTemplate>
</asp:ListView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:foodcourtConnectionString %>" SelectCommand="SELECT [foodname], [foodimg], [price], [stallid] FROM [foodtbl] WHERE ([stallid] = @stallid)"> <SelectParameters>
<asp:QueryStringParameter DefaultValue="1" Name="stallid" QueryStringField="stallid" Type="Decimal" /> </SelectParameters> </asp:SqlDataSource> </div>
How can I add all the variable (foodname, price) into linkedlist when I click addtocart button?
View 6 Replies
Jan 12, 2010
the purpose of using Profile in asp.net. I would like to know the usage of profile in shopping cart based sites.I could see from some of the cart websites that profile plays a major role for online shopping projects.It is better to know how this profile to create opnline website and which websites or example to reach the technologies as well.
View 1 Replies