create smarty attribute for cart

This commit is contained in:
Manuel Raynaud
2013-09-13 15:17:43 +02:00
parent ea1ee4932d
commit 50a5fd166b
3 changed files with 32 additions and 1 deletions

View File

@@ -76,4 +76,17 @@ class Cart extends BaseCart
{
}
public function getTotalAmount()
{
$total = 0;
foreach($this->getCartItems() as $cartItem) {
$total += $cartItem->getPrice()-$cartItem->getDiscount();
}
$total -= $this->getDiscount();
return $total;
}
}