diff --git a/code/web/sys/User/Checkout.php b/code/web/sys/User/Checkout.php index acb79b8686..cd43da87ea 100644 --- a/code/web/sys/User/Checkout.php +++ b/code/web/sys/User/Checkout.php @@ -212,6 +212,11 @@ public function update(string $context = '') : int|bool { public function getReplacementCost() : float { require_once ROOT_DIR . '/sys/Utils/GroupingUtils.php'; - return getReplacementCost($this->getRecordDriver(), $this->format, $this->itemId, $this->barcode); + $recordDriver = $this->getRecordDriver(); + if ($recordDriver instanceof GroupedWorkSubDriver) { + return getReplacementCost($this->getRecordDriver(), $this->format, $this->itemId, $this->barcode); + }else{ + return 0; + } } }