Hi all,

I'm trying to add an extra cart action that will allow my visitors to update the parameters assigned to a product after it is already in the cart. At the moment, they have to delete it and add it again.

My goal was to keep this as simple as possible, so while I'm sure there are better ways of doing this, what I have done is this
1. Create a new page that just shows the product and the attribute controls.
a. This is just a copy of product_info_display with the unwanted bits deleted.
b. I've also copied the required language and modules/pages files
c. Added an "update" button that calls my new action (see 3)

2. Put a new link in the shopping cart from the attribute fields to my new page

3. Create an extra cart action called update_product_attributes in the extra_cart_actions directory.

1 and 2 are working OK, but 3 is a problem. I had just planned to make my extra action do a delete of the current product and add a new instance with the updated parameters. I went for this plan because it would use existing functions delete and add functions. My extra_cart_action looks like:
Code:
if ($_GET['action'] == 'update_product_attributes') {
$_SESSION['cart']->actionRemoveProduct($goto, $parameters);
$_SESSION['cart']->actionAddProduct($goto, $parameters);
}
I know this is wrong, but don't know how to correct it. Any pointers that you could give would be greatly appreciated.

Thanks,

Possum



http://www.zen-cart.com/forum/showthread.php?t=80758