简体   繁体   中英

Shoppingcart open in multiple tabs

I am looking for tips on solving the following problem in a web store:

I have an online store where customers can buy bus tickets. Sometimes the customers have the website open in several tabs and while planning a trip they search for tickets and prices in all tabs, sometimes adding different tickets to the shopping cart in different tabs. When they are ready to finish the order in one tab, the selections made in other tabs will also be included in the final order.

Edit: The problem is that the shoppingcart is being populated from all tabs and if the user checks out from for example the first tab he opened then all tickets added in all tabs are included in the order even if the shoppingcart in the tab is just showing two tickets (if the user refreshes the shoppingcart it updates and there is no problem). If the user does not pay attention to the sub total when paying then he or she might be buying more tickets than intended...

The solution that I am working on is an "old" one ( .Net/C# ) so I am unfortunately building a solution from scratch. When the users add a ticket to the shopping cart a cartId (cookie) is created and this is being used across all browser windows/tabs.

I guess there are several ways to solve this problem, and currently I am very unsure how to do it in an effective and smart way.

You can create an ASP.NET session for this. Each time user adds or delete an item on shopping cart, update your session. When user checks out, retrieve the data from the Session, which will always have all the items added in different tabs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM