Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
Adds gift card discount deductible from grand total
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberth91 committed Aug 21, 2018
1 parent fec2205 commit 6070c4d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Basket/Basket.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,6 @@ public function getTotal()
{
$total += $item->getTotal()->getBasePrice();
}

if ($this->gift_card_code)
{
$total = ($total - $this->gift_card_code->getDiscount()->getBasePrice());
}

return new MoneyFormatter($total);
}
Expand All @@ -398,6 +393,11 @@ public function getGrandTotal()
// Add any delivery costs
$grand_total += $this->getDeliveryPrice()->getBasePrice();

if ($this->gift_card_code)
{
$grand_total = ($grand_total - $this->gift_card_code->getDiscount()->getBasePrice());
}

return new MoneyFormatter($grand_total);
}

Expand Down

0 comments on commit 6070c4d

Please sign in to comment.