Ubercart Cart Updates
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Component created
Component changed
Component body
Original author rjl@drupal.org
Following is original documentation:
Allows a user to update (make changes to) the options of an existing item that is already in the user's cart.
This is a work in progress, in response to a need that has been discussed here http://www.ubercart.org/forum/bug_reports/2748/product_links_cart
and here
http://www.ubercart.org/forum/ideas_and_suggestions/2821/change_attribut...
An "update cart" form is placed on the product page just above the "add to cart" form if the user already has the product in his/her cart. Thus there exists both the ability to change the existing items(s) in the cart as well as add new item.
Currently this module only works with single products and not product kits.
If you're a coder, your feed back would be greatly appreciated.
I am using hook_nodeapi with $op='view' to then call the update form. The update form code is pretty much a copy of similar code seen in the uc_cart, uc_product and uc_attributes modules. There are some additional comments in the code itself.
I am not if this is the best route to go. Maybe this is just a proof of concept.
Related threads:
change attributes in the cart
Product Links in Cart
At this point, there are no administrative settings.
It should work like this.
Imagine a product that is a shirt, with a color attribute (red and blue) and a size attribute (small, medium and large). The first time you visit the product page you could order 2 large red shirts and click the "Add to Cart" button. Then in the shopping cart you see the Shirt product as a link to the product page and listed beneath that are Size: Large and Color: Red. If you click the link to go to the shirt page again, you should see a form that says, Currently In Your Cart, the color pulldown should indicate Red, the size pulldown should indicate Large and the Quantity field should indicate 2. The submit button should say "Update Cart" and the background color of the form should be grey. Below this form you should see the normal blank form with the color and size pulldowns and quantity field set at their defaults. The submit button will say "Add To Cart" You should be able to change your existing order of 2 large red shirts - maybe you wanted medium instead - click the "Update Cart" button. You can also order more shirts - such as 1 small blue shirt - click the "Add to Cart" button.