Skip to content

Commit

Permalink
OrderModifiers cannot use dependency injection (#758)
Browse files Browse the repository at this point in the history
use injector instead of `new $class()`
  • Loading branch information
wernerkrauss authored Jan 29, 2021
1 parent f57cb89 commit 5a5ef16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cart/OrderTotalCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function getModifier($className, $forcecreate = false)
}
return $modifier;
}
$modifier = new $className();
$modifier = $className::create();
if ($modifier->required() || $forcecreate) { //create any modifiers that are required for every order
$modifier->OrderID = $this->order->ID;
$modifier->write();
Expand Down

0 comments on commit 5a5ef16

Please sign in to comment.