Skip to content

Commit 933f4e7

Browse files
authored
Update Product.php
1 parent 1267c36 commit 933f4e7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Entity/Product.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ public function __construct(array $data)
1818
if (isset($this->data['discussion'])) {
1919
$this->discussion = new Discussion($this->data['discussion']);
2020
}
21+
22+
if (!isset($this->data['offerPrice'])) {
23+
$this->data['availability'] = false;
24+
$this->data['offerPrice'] = null;
25+
$this->data['offerPriceDetails'] = [];
26+
}
2127
}
2228

2329
/**
@@ -223,7 +229,7 @@ public function isAvailable()
223229

224230
/**
225231
* Offer or actual/final price of the product.
226-
* @return string
232+
* @return string | null
227233
*/
228234
public function getOfferPrice()
229235
{

0 commit comments

Comments
 (0)