Beispiel #1
0
 function _renderTotalRows($cart)
 {
     $trs = '';
     $this->_withGrandTotal = FALSE;
     if ($this->_isShowDiscount($cart)) {
         $trs .= $this->_renderDiscountRows($cart);
         $this->_withGrandTotal = TRUE;
     }
     if ($cart['shipping'] || isset($this->alwaysShowShipping) && $this->alwaysShowShipping) {
         $trs .= $this->_renderShippingRow($cart);
         $this->_withGrandTotal = TRUE;
     }
     if (isset($cart['shipping_discount']) && $cart['shipping_discount']) {
         $trs .= $this->_renderRow(' ', ' ', 'Shipping Discount:', $this->dol($cart['shipping_discount']));
         $this->_withGrandTotal = TRUE;
     }
     if (isset($cart['tax']) && $cart['tax']) {
         $taxVal = $cart['tax'];
         $taxLabel = 'Tax';
         if (isset($this->taxLabel) && $this->taxLabel) {
             $taxLabel = $this->taxLabel;
         }
         $trs .= $this->_renderRow(' ', ' ', "{$taxLabel}: ", $this->dol($taxVal));
         $this->_withGrandTotal = TRUE;
     }
     if ($this->_withGrandTotal) {
         $total_tds = '';
         if ($this->_withImage) {
             $total_tds .= $this->xmlTag('td', ' ', array('class' => 'cart-cell-empty'));
         }
         if ($this->_getTableMode() != 'mini') {
             $total_tds .= $this->xmlTag('td', ' ', array('class' => 'cart-cell-empty'));
             $total_tds .= $this->xmlTag('td', ' ', array('class' => 'cart-cell-empty'));
         }
         $total_tds .= $this->xmlTag('td', $this->xmlTag('strong', 'Total:'), array('class' => 'number'));
         $grandTotal = Helper_Cart::getGrandTotal($cart);
         $total_tds .= $this->xmlTag('td', $this->xmlTag('strong', $this->dol($grandTotal)), array('class' => 'number dollar-value'));
         $trs .= $this->xmlTag('tr', $total_tds, array('class' => 'cart-grand-total-row'));
     }
     return $trs;
 }