Skip to content

Commit c491bef

Browse files
author
Oleksandr Iegorov
committed
MC-38995: Customer group price is not working in product query graphql
1 parent 77ec450 commit c491bef

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/code/Magento/CustomerGraphQl/Model/Context/AddCustomerGroupToContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ public function execute(ContextParametersInterface $contextParameters): ContextP
5656
$customer = $this->customerRepository->getById($contextParameters->getUserId());
5757
$customerGroupId = (int) $customer->getGroupId();
5858
} catch (LocalizedException $e) {
59-
$customerGroupId = null;
59+
$customerGroupId = Group::NOT_LOGGED_IN_ID;
6060
}
6161
}
6262
if ($customerGroupId !== null) {
6363
$customerSession->setCustomerGroupId($customerGroupId);
64-
$contextParameters->addExtensionAttribute('customer_group_id', $customerGroupId);
64+
$contextParameters->addExtensionAttribute('customer_group', (int) $customerGroupId);
6565
}
6666
return $contextParameters;
6767
}

app/code/Magento/CustomerGraphQl/etc/extension_attributes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
99
<extension_attributes for="Magento\GraphQl\Model\Query\ContextInterface">
1010
<attribute code="is_customer" type="boolean"/>
11-
<attribute code="customer_group_id" type="integer"/>
11+
<attribute code="customer_group" type="integer"/>
1212
</extension_attributes>
1313
</config>

0 commit comments

Comments
 (0)