Skip to content

Commit

Permalink
Merge pull request #104 from oliver-norden/hotfix/DiscountableAmount-…
Browse files Browse the repository at this point in the history
…in-extension

feat(Calculator): check for DiscountableAmount using hasMethod
  • Loading branch information
wilr authored Oct 26, 2020
2 parents 32dbc62 + 7e31d41 commit 78fd687
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Calculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ protected function getDiscountableAmount($discount)

foreach ($this->order->Items() as $item) {
if (ItemDiscountConstraint::match($item, $discount)) {
$amount += method_exists($item, 'DiscountableAmount') ?
$amount += $item->hasMethod('DiscountableAmount') ?
$item->DiscountableAmount() :
$item->Total();
}
Expand Down

0 comments on commit 78fd687

Please sign in to comment.