Product Links in Cart.

Posts: 16
Joined: 10/30/2007

I am not sure that this is a bug, but it is at the very least a usability issue.

Product links display in the user cart, but a product link takes you back to that product, not to the item in the cart (attributes are not persistent).

Simple solution - remove product links from the cart. This makes it obvious that there is no edit functionality.

Ideal Solution - Add edit capability to the cart so users can edit item attributes for items in the cart.
1. Add edit or update item link to cart which opens an item edit form.
2. The item edit form defaults all attributes to the current state and has an update button instead of an add to cart button.
3. Clicking on the edit button updates the attributes for the item being edited.

I was really surprised when I noticed that there wasn't any update functionality.

Posts: 5367
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

I'm a little divided... on the one hand, the way it is now seems logical to me. It's familiar (other systems like osC/Amazon.com include links to product pages in their carts). It's also handy to review the page for products in your cart with a simple click of the product. Of course, just because it's the way it's been done doesn't mean it's the way we should do it.

Regarding editing, though, I'm just not sure of the feasibility of an edit cart product form. Primarily, this is because any module can hook into the add to cart form, the attributes module included. But adding yet another form will require another point of integration not just for these modules but then for others that may need to hook into cart actions (adding, removing, updating items in the cart).

The cart block's contents are made in a theme function, though, so at the theme level you can copy/rename the function theme_uc_cart_block_content() and adjust the display so it does not include product links.

Posts: 16
Joined: 10/30/2007

I didn't realize that Amazons cart was like this, but then I have never ordered a product with attributes from Amazon. I think modeling your self after Amazon is a good idea. I also understand the difficulties involved in adding edit functionality with attributes. I am currently working on a uc_attribute / kit bug.

That said I sure would love the functionality. The store I am working on now uses flash to preview the attributes, so I would be some additional challenges for me there as well.

Thanks for the the theme hint. That gives me a quick option.

Posts: 5367
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Aye, and for custom sites, having a cart product edit form actually shouldn't be too difficult. In fact, maybe it wouldn't be too difficult in core either if we we were able to implement something like this in the future...

  1. Edit link takes you to a page that rebuilds the add to cart form.
  2. If user hits cancel, no action is taken.
  3. If user submits but doesn't change anything, no action is taken.
  4. If user makes changes, then totally remove the old item from the cart and let the add to cart form work from scratch. This involves a custom submit handler that has to fire off before the default one to make sure the old cart item is removed. Letting it add itself back like normal will then allow all the other modules hooking into this process to fire off.

If you get a proof of concept working that satisfies the above requirements, I can see this working out great in core. Then the question would be where/how to include the edit link. Sticking out tongue

A module like this can be created totally in a contributed module using the appropriate hooks, most specifically hook_form_alter(). This will make it public even if we aren't able to include it in core, and it will keep you from having to hack core to get it done (and thereby breaking your upgrade path).

Posts: 195
Joined: 12/28/2007
Uber DonorBug Finder

In a few months I'm having a case where I could see this edit -functionality really useful. Also, as a general feature, I feel it's an useful & needed feature.

Unfortunately, I have no idea of coding to be able to help... but as a 2cents opinion anyway of the feature.

Posts: 195
Joined: 12/28/2007
Uber DonorBug Finder

As an example, please take a look at here:
http://www.santaclauschristmasletter.com

...imagine you've taken the time to order some letters (or whatever presents) ...and then, before check out, viewing the cart, you realize there are some stupid mistakes or typos in the product attribute details...

...what to do? ...delete the product(s) from cart and start everything over again... OR... just edit the simple tiny mistakes in the attributes and continue to check out?

Just my 2 cents...

Posts: 931
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

I am in full agreement that the attributes of a product should be editable on the cart page. And on the checkout page, there should be a message to the effect of "to change attributes go back to the cart page". Viewing the cart or checking out is when your customer sees everything down in black and white and looks for errors - you want to keep your customer on these pages - forcing them to delete from cart then go back and re-enter a product with different attributes is a sure way to lose some customers who will never end up completing the checkout. You really want them to pay as soon as possible, without a chance for second thoughts, and the best way to do that is to give them what they need on the view cart and checkout pages.

--

<tr>.

Posts: 195
Joined: 12/28/2007
Uber DonorBug Finder

Well said TR! I'm new to Ubercart and have no idea how to code this kind of things, but from customer and shop owner point of view this kind of usability & business improvement is more than welcome!

Sorry I can't help in coding, but just made one more donation to Ubercart project to show some appreciation. Keep up the great work guys!

Posts: 6
Joined: 01/18/2008

I had a need for this functionality so I gave it shot. There is some code to download in the contributions section if you want to try it out.

http://www.ubercart.org/contrib/2881

Hope this is helpful to someone.

Posts: 195
Joined: 12/28/2007
Uber DonorBug Finder

rjl@drupal.org wrote:
...Hope this is helpful to someone.

THANKS, works great! Maybe from usability point of view there should also be an "edit" -link beside the products in the cart?