We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 10f29de + 66dea4f commit 091f258Copy full SHA for 091f258
src/Observer/FinalPrice.php
@@ -38,14 +38,14 @@ public function execute(Observer $observer): void
38
$customerId = $this->userContext->getUserType() === UserContextInterface::USER_TYPE_CUSTOMER ? (int) $this->userContext->getUserId() : null;
39
}
40
41
- if ($customerId === null) {
42
- return;
43
- }
44
-
45
/** @var Product $product */
46
$product = $observer->getProduct();
47
$qty = $observer->getQty() ?? 1;
48
+ if ($customerId === null || $product->getId() === null) {
+ return;
+ }
+
49
$price = $this->customerPrice->getCustomerPrice($product->getId(), $customerId, $qty);
50
51
if ($price === null) {
0 commit comments