Re: update_cart_item hook / quantity question

Posts: 72
Joined: 01/02/2008
Bug Finder

I saw hook_add_to_cart() which works great (used it on my first contrib http://www.ubercart.org/contrib/3477), but its not called when you update the quantity of an item on the cart page, only when you add a product, which i sort of understand as your not technically adding a product, just updating it.

Altering the form to make quantity text instead of a form field, does sound like the best solution, or i may just be lazy and use CSS to hide the column.

Still it might be an area that needs looking at - perhaps changing quantity does need use hook_add_to_cart (avoids needing 2 hooks for quantity checking). Also may be a bug on my site, but it doesn't look like the model details are being passed in the $data var on hook_add_to_cart();

update_cart_item hook / quantity question By: a_c_m@drupal.org (3 replies) Thu, 02/28/2008 - 09:49