function renderCartTable($cart, $options = array(), $renderer = NULL) { $this->cart = $cart; $trs = ''; $this->_withImage = FALSE; if (isset($options['with_image']) && $options['with_image']) { $this->_withImage = TRUE; } if (!isset($this->withItemTable) || $this->withItemTable) { $tableMode = $this->_getTableMode(); if ($tableMode != 'mini') { $trs .= $this->_getTableHeadRow($options); } if ($cart['items']) { foreach ($cart['items'] as $item) { if ($item['quantity']) { $trs .= $this->_getTableItemRow($item, $options, $renderer); } } } } if (!isset($this->withTotalRows) || $this->withTotalRows) { $trs .= $this->_getItemTotalRow(); $this->_total = Helper_Cart::getItemTotal($this->cart['items']); $trs .= $this->_renderTotalRows($cart); } $table_content = $trs; $empty_div = $this->xmlDiv('Your shopping cart is empty.'); $cart_table = $empty_div; $is_empty = count($cart['items']) == 0; if (!$is_empty) { $cart_table = $this->xmlTag('table', $table_content, array()); } return $cart_table; }
static function getItemTotalCostOfOrder($obj) { return max(0, Helper_Cart::getItemTotal(Helper_Cart::soldProductsToCartItems($obj->getOrderedProducts()))); }