Active
Project:
ECO (Extra Customization Options for Ubercart)
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Nov 2010 at 16:00 UTC
Updated:
15 Sep 2011 at 13:43 UTC
Comments
Comment #1
WebNewCastle commentedHi,
Sorry for the delay. This question sounds familiar - maybe I encountered something similar on Ubercart.org. Anyway, if you are still looking - or someone else is - I believe you just need the following to first empty the cart:
- Matt
Comment #2
brightboldA great use case for this (in case other people are looking for such a solution) is to prevent duplicate items getting added to the cart if people use the back button from the cart or checkout to edit the webform. This code will empty the previously added items from the cart before adding them again when the form is submitted. The one caveat is that it won't work with a multi-page form where items are being added on pages other than the last one — items added on earlier pages will get emptied from the cart when the later pages are submitted. But it works beautifully with a single page form!