Event Model for Shopping Cart? AJAX Cart Updates at Checkout?
I'm wondering if there is an event model for the shopping cart that I can plug in to. I read in another thread that is only cookie based right now. Maybe you can give me some code I can use to update the cookie when an item is added, so that I can make sure customers don't end up with 2 of the same item in the cart.
Also it is very lacking that the checkout control doesn't have an integrated ability to update the cart so that customers can, you know, update their order before they pay without having to start the payment process all the way over again. Is this something that is on the immediate horizon? If it is I can get by using some Cart event model to limit customers to one product for now, but if it is not that is pretty lame and I have to try to plan on working on a custom checkout control pretty soon which doesn't sound fun.
Hey Joseph,
Hi Jochem. Thanks for making me take a deeper look. I would have loved to have been able to override OrdersManager within a custom OrdersModule, but that didn't work for me like I'd hoped and I'll have to wait to figure out what may have gone wrong, or if it's even possible, until another day. What I did end up doing is creating an intermediary page between the product description page and the checkout page with the sole job or removing everything but the most recently added item from the cart. Here is the code I used in my custom control.
//This is a workaround to limit users to 1 course registration until SF checkout page improves
OrdersManager ordersManager = new OrdersManager();
CartDetail product = ordersManager.GetCartDetails().OrderByDescending(x => x.CreatedDate).FirstOrDefault();
foreach(CartDetail detail in ordersManager.GetCartDetails())
if(detail.Id != product.Id)
ordersManager.RemoveFromCart(detail.Id);
course.Quantity = 1;
ordersManager.SaveChanges();
Response.Redirect("~/check-out");
I still do want to make the point that the built in Check Out control is horribly incomplete. I've never purchased from a website where I have to enter my credit card information without being able to see specifically what it is I'm ordering at the same time. I know the Preview page is just one step after, and lists what is in the cart, but the user cannot even update their order once they get to that page. What would make sense is having the shopping cart control side by side with the checkout control, so that customers can very clearly see what they are ordering through each step of the process. Most importantly they should be able to update their cart and have the checkout control update seemlessly so that they don't have to re-enter their billing and credit card information if they decide they want 2 widgets instead of 1 just before submitting their payment. I'm really suprised no one has brought this up yet. This is a huge flaw IMHO.
@Joseph,
Thanks for the snippet, always useful! Maybe I'm being a blond here and looking at things way to simple but you can display a shoppingcart summary (see screenshot) next to the checkout no?
(I apologize for the default styling and the shoppingcart/checkout price difference its because I didn't bother to change price settings to show the widget)
Fair enough Jochem, and thanks again for forcing me to look at it a different way. I could require customers view the shopping cart page before going on to checkout, and that does somehwat solve my issue. Still I do think it is a pretty big flaw that if I as a customer get to the screen in your screen shot and decide I no longer want Product B, I will now have to go through the steps of entering my Shipping/Billing/Payment info again after I remove Product B from the order.
@Joseph,
No I should apologize - instead of trying to help you move forward I'm steering you to an off ramp. A problem described in 5-10 lines justifies in no way me telling you (and your client) you're seeing it wrong.
I'm probably spending to much time on this section of the forum :) and have trained my thought-of-mind to follow the step-by-step (cart>order>checkout) approach.
Hi Jochem. No apologies necessary at all. I really appreciate the time you've taken to help me. If anyone owes an apology it is me to Sitefinity for knit picking on one little feature in a fantastic software package.
We are selling courses right now, that is correct, but in the future we will be selling other items. I did try what you outlined, with the shopping cart and checkout widget side by side, and it is that exact refresh and necessary re-entry of shipping/billing/payment info which I am saying I would like to see cleaned up. Integrating the shopping cart and checkout widgets into one widget would do the trick.