Skip to content

Commit 29bc319

Browse files
authored
Merge pull request #24 from landofcoder/fix-gallery-image-url
fix missing guest email
2 parents 606eaa5 + bed93df commit 29bc319

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Model/PostProductReviews.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,12 @@ public function execute(int $customerId, string $sku, ReviewInterface $review):
145145
$countryCode = $foundAddress ? $foundAddress->getCountryId() : "";
146146
}
147147
$review->setCustomerId($customerId);
148+
$review->setGuestEmail($customerData->getEmail());
149+
}
150+
if (!$review->getGuestEmail()) {
151+
throw new NoSuchEntityException(__('Missing required Field Guest Email Address.'));
148152
}
149153
$review->setReviewEntity("product");
150-
$review->setGuestEmail($customerData->getEmail());
151154
$review->setCountry($countryCode);
152155
$review->setId(0);
153156
$review->setReviewStatus(self::STATUS_PENDING);

0 commit comments

Comments
 (0)