You are here

function uc_cart_update_item_object in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_cart/uc_cart.module \uc_cart_update_item_object()
  2. 7.3 uc_cart/uc_cart.module \uc_cart_update_item_object()

Updates the quantity of all the items in a cart object

1 call to uc_cart_update_item_object()
uc_cart_view_form_submit in uc_cart/uc_cart.module

File

uc_cart/uc_cart.module, line 2034

Code

function uc_cart_update_item_object($cart) {
  if (is_object($cart)) {
    foreach ($cart->items as $item) {
      if ($item['remove']) {
        module_invoke($item['module'], 'update_cart_item', $item['nid'], unserialize($item['data']), 0);
      }
      else {
        module_invoke($item['module'], 'update_cart_item', $item['nid'], unserialize($item['data']), $item['qty']);
      }
    }
  }
}