diff --git a/controllers/customer/OnlineOrderSummeryController.php b/controllers/customer/OnlineOrderSummeryController.php index 0c87c40..7e11b9f 100644 --- a/controllers/customer/OnlineOrderSummeryController.php +++ b/controllers/customer/OnlineOrderSummeryController.php @@ -9,6 +9,7 @@ class OnlineOrderSummeryController extends Controller private $orderTotal; private $deliveryFee; private $itemCounter; + private $vat; function __construct() { @@ -53,11 +54,21 @@ public function getDeliveryFee() } } - public function getTotalOrderFee() + public function getVat() { if ($this->deliveryFee && $this->orderTotal) { //cant keep the order total in double because we are double checking the user's order against DB for any hacks - echo number_format((float)($this->deliveryFee + $this->orderTotal), 2, '.', ''); + $vat_amount = number_format((number_format((float)($this->deliveryFee + $this->orderTotal), 2, '.', '') * 0.15), 2, '.', ''); + $this->vat = $vat_amount; + return $vat_amount; + } + } + + public function getTotalOrderFee() + { + if ($this->deliveryFee && $this->orderTotal && $this->vat) { + //cant keep the order total in double because we are double checking the user's order against DB for any hacks + echo number_format((float)($this->deliveryFee + $this->orderTotal + $this->vat), 2, '.', ''); } } diff --git a/views/customer/Dinein.php b/views/customer/Dinein.php index 03fd6b1..e8c1f3d 100755 --- a/views/customer/Dinein.php +++ b/views/customer/Dinein.php @@ -172,7 +172,7 @@ function addToCart(itemId){