On my website, I use hook_add_to_cart_data
to add some extra customization to items. When two identical products are added, but with different $data
, it seems like ubercart squashes the old $data
and stacks the items in the cart, updating $qty
instead of adding a new item.
How can I tell ubercart to treat the new item and the old item as different items in the cart, so they don't get stacked, and can I otherwise control this behavior?
No, it's shouldn't, see
uc_cart_get_contents
function in uc_cart.module, row #1358:One of reason: some other module merge (or clean) these $data for both products, before calling function
uc_cart_get_contents
inuc_cart_add_item
function, inhook_add_to_cart_data
implemention.