In light of the recent UI improvement to replace the "remove" checkboxes with remove buttons, I would like to add a "Clear Cart" button to make it easier to get rid of product kits that are set "As individual products". The problem we have is our product kits might have 20+ products in them, and it only takes 1 click to add the whole thing to the cart. If the customer changes their mind, it now takes them 20 click-waits to get the one kit out of their cart. That seems a bit ridiculous, even for the most sales-conversion oriented website. Furthermore, it might be nice to have it show up optionally for those sites that would rather make it difficult to remove a lot of products from a cart in an effort to increase sales conversion rate / ticket size.
A confirmation for the "Clear Cart" button ("Are you sure?") should also be implemented, to prevent accidental clearing of the cart.
Comment | File | Size | Author |
---|---|---|---|
#7 | 1258982-empty-cart-button.patch | 4.33 KB | longwave |
#5 | uc_emptycart.tgz | 807 bytes | bancarddata |
#3 | uc_emptycart.tgz | 836 bytes | bancarddata |
Comments
Comment #1
SeanA CreditAttribution: SeanA commentedIt's possible to empty the cart (with confirmation) using Cart Links... for all the gory details on that, see the discussion at #881752: Cart Links - Missing code for "Empty cart" function. Or I suppose you could do a form_alter on the cart form and use uc_cart_empty().
Comment #2
bancarddata CreditAttribution: bancarddata commentedThanks for the input, SeanA. I am just going to close this as a duplicate based on the thread you linked to, and perhaps take your 2nd approach. I don't need all the links (and security debate) that Cart Links provides. When/if I come up with my solution, I will post it back here for any who are requiring just a simple empty cart link on the cart page and none of the rest.
Comment #3
bancarddata CreditAttribution: bancarddata commentedAttached is a basic module to add an Empty cart link to the cart page in UC 7.x-3.x.
Comment #4
longwaveNo problem with leaving this open; an "empty cart" button on the cart page is a different feature to cart links and would not present a security risk.
Comment #5
bancarddata CreditAttribution: bancarddata commentedHere is a cleaned up version of the module that better conforms to recommended conventions.
Comment #6
drupalycious CreditAttribution: drupalycious commentedhello,
does your module work with the latest dev version?
I am asking because your latest message is more than one year old.
Thank you
Comment #7
longwaveThis patch adds an optional empty cart button, with confirmation page and test cases. Enable it at /admin/store/settings/cart.
Comment #9
longwaveStrange testbot failure; failed in catalog module testing, with message: exception 'DatabaseSchemaObjectExistsException' with message 'Table variable already exists.' in /var/lib/drupaltestbot/sites/default/files/checkout/includes/database/schema.inc:657
#7: 1258982-empty-cart-button.patch queued for re-testing.
Comment #10
drupalycious CreditAttribution: drupalycious commentedthanks !!!
so far I didn't noticed any bug.
Comment #11
longwaveCommitted #7