Skip to content

Commit

Permalink
Fix issue when adding fixed discount to a product in the cart
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewis-everley committed Nov 25, 2014
1 parent 003207e commit 488c8b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/extensions/CustomisableProductShoppingCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function augmentSetup() {

if($item->Price && $this->owner->discount) {
if($item->Price->RAW() && $this->owner->discount->Type == "Fixed" && $this->owner->discount->Amount)
$item->Discount->setValue($this->owner->discount->Amount / $items->count());
$item->Discount->setValue($this->owner->discount->Amount / $this->owner->Items->count());
elseif($item->Price && $this->owner->discount->Type == "Percentage" && $this->owner->discount->Amount)
$item->Discount->setValue(($item->Price->RAW() / 100) * $this->owner->discount->Amount);
} else
Expand Down

0 comments on commit 488c8b0

Please sign in to comment.