1 reply [Last post]
8bitplateau's picture
Offline
Joined: 03/10/2010
Juice: 9
Was this information Helpful?

Hi,

I've made a custom form for adding products to cart using uc_cart_add_item hook and id and qty parameters.
This works fine but when the usual method of adding the product to cart is used, such as the 'add to cart' button in the node page another, entry for the same item [nid] is made in the cart rather than updating the quantity for the existing product.
This I can see is because $data column is different in the uc_cart_products table and uc_cart_add_item hook obviously checks $nid and $data to see if they match and therefore updates the quantity or adds another entry.

My question is, how do I get the correct $data to add to my call to of uc_cart_add_item that would be added usually, such as y the standard 'add to cart' buttons ?

thanks

GreyHawk's picture
Offline
Joined: 03/17/2009
Juice: 174
Try looking at the UC Node Checkout code.

I don't have a coding suggestion for you per se, but if you look at code used in uc_node_checkout you might find something worthwhile.

I'd check both the .php and .module...