t) { $total += $product['total']; } return $total; } public function getTaxes() { $tax_data = array(); foreach ($this->getProducts() as $product) { if ($product['tax_class_id']) { $tax_rates = $this->tax->getRates($product['total'], $product['tax_class_id']); foreach ($tax_rates as $tax_rate) { $amount = 0; if ($tax_rate['type'] == 'F') { $amount = ($tax_rate['amount'] * $product['quantity']); } elseif ($tax_rate['type'] == 'P') { $amount = $tax_rate['amount']; } if (!isset($tax_data[$tax_rate['tax_rate_id']])) { $tax_data[$tax_rate['tax_rate_id']] = $amount; } else { $tax_data[$tax_rate['tax_rate_id']] += $amount; } } } } return $tax_data; } public function getTotal() { $total = 0; foreach ($this->getProducts() as $product) { $total += $this->tax->calculate($product['total'], $product['tax_class_id'], $this->config->get('config_tax')); } return $total; } public function countProducts() { $product_total = 0; $products = $this->getProducts(); foreach ($products as $product) { $product_total += $product['quantity']; } return $product_total; } public function hasProducts() { return count($this->session->data['cart']); } public function hasStock() { $stock = true; foreach ($this->getProducts() as $product) { if (!$product['stock']) { $stock = false; } } return $stock; } public function hasShipping() { $shipping = false; foreach ($this->getProducts() as $product) { if ($product['shipping']) { $shipping = true; break; } } return $shipping; } public function hasDownload() { $download = false; foreach ($this->getProducts() as $product) { if ($product['download']) { $download = true; break; } } return $download; } } ?>
Fatal error: Class 'Cart' not found in /sata2/home/users/serviceka/www/www.service-kanc.com/index.php on line 214