We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef95626 commit f02584cCopy full SHA for f02584c
src/Product.php
@@ -164,7 +164,7 @@ public function arraySerialize(): array
164
return [
165
'name' => $this->getName(),
166
'sku' => $this->getSku(),
167
- 'unitPrice' => number_format($this->getUnitPrice(), 2),
+ 'unitPrice' => (null !== $this->getUnitPrice() ? number_format($this->getUnitPrice(), 2) : null),
168
'quantity' => $this->getQuantity(),
169
'additionalDetails' => $this->getAdditionalDetails(),
170
'amount' => (null !== $this->getAmount() ? number_format($this->getAmount(), 2) : null),
0 commit comments