Download & Extend

Optional clear cart button

Project:Ubercart
Version:7.x-3.x-dev
Component:Cart/checkout
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

Comments

#1

It'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().

#2

Status:active» closed (duplicate)

Thanks 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.

#3

Attached is a basic module to add an Empty cart link to the cart page in UC 7.x-3.x.

AttachmentSizeStatusTest resultOperations
uc_emptycart.tgz836 bytesIgnored: Check issue status.NoneNone

#4

Status:closed (duplicate)» active

No 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.

#5

Here is a cleaned up version of the module that better conforms to recommended conventions.

AttachmentSizeStatusTest resultOperations
uc_emptycart.tgz807 bytesIgnored: Check issue status.NoneNone

#6

hello,

does your module work with the latest dev version?
I am asking because your latest message is more than one year old.

Thank you

#7

Status:active» needs review

This patch adds an optional empty cart button, with confirmation page and test cases. Enable it at /admin/store/settings/cart.

AttachmentSizeStatusTest resultOperations
1258982-empty-cart-button.patch4.33 KBIdlePASSED: [[SimpleTest]]: [MySQL] 2,725 pass(es).View details

#8

Status:needs review» needs work

The last submitted patch, 1258982-empty-cart-button.patch, failed testing.

#9

Status:needs work» needs review

Strange 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.

#10

thanks !!!

so far I didn't noticed any bug.

#11

Status:needs review» fixed

Committed #7

#12

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.