Skip to content

Commit f02584c

Browse files
author
Alexey Babak
committed
unitPrice null safe fix
1 parent ef95626 commit f02584c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Product.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function arraySerialize(): array
164164
return [
165165
'name' => $this->getName(),
166166
'sku' => $this->getSku(),
167-
'unitPrice' => number_format($this->getUnitPrice(), 2),
167+
'unitPrice' => (null !== $this->getUnitPrice() ? number_format($this->getUnitPrice(), 2) : null),
168168
'quantity' => $this->getQuantity(),
169169
'additionalDetails' => $this->getAdditionalDetails(),
170170
'amount' => (null !== $this->getAmount() ? number_format($this->getAmount(), 2) : null),

0 commit comments

Comments
 (0)