I use this module to allow customers to sign up for plans on my site. If they add plan A, then reconsider, leave, and click on plan B, I want the cart to empty and plan B to be added. Currently, an error message is displayed asking users to please delete existing items, which is less user friendly then doing this for them.

Note that I plan on updating the module code for 6.x-1.1 (the version I am currently deploying) and posting a patch here for (hopefully) adoption to the module code in the next release, unless this already exists and someone can direct me to existing code, patch, or a dev release I should use instead.

CommentFileSizeAuthor
#1 replaceCart.patch3.02 KBCharlie B

Comments

Charlie B’s picture

Status: Needs work » Needs review
StatusFileSize
new3.02 KB

Actually this was easier then I thought. Here's the patch.

-Adds one new option to the admin page (Home » Administer » Store administration » Configuration » Product settings) - a checkbox to enable replacing the cart on add rather then displaying an error message to the user if the limit has been reached.
-Deletes existing cart entries for the given cart ID on cart add if the limit has been reached and the check is enabled.

For 6.x-1.1

I haven't looked at the code in the dev releases, but I imagine this should be able to be manually applied without difficulty.

mrfelton’s picture

Version: 6.x-1.1 » 6.x-2.x-dev
Status: Needs review » Fixed

Committed to latest -dev. Thank you for this. good work.

Status: Fixed » Closed (fixed)
Issue tags: -Ubercart, -single product, -restrict quantity

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