Skip to content

Commit bba955b

Browse files
committed
ACP2E-2689: No Appropriate error message when website id is wrong in the request
- Fixed the CR comments.
1 parent 35e49f1 commit bba955b

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

app/code/Magento/Catalog/Model/Product/Price/Validation/TierPriceValidator.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -373,14 +373,9 @@ private function checkWebsite(TierPriceInterface $price, $key, Result $validatio
373373
{
374374
try {
375375
$this->websiteRepository->getById($price->getWebsiteId());
376-
$isGlobalConfig = $this->scopeConfig->getValue(
377-
Data::XML_PATH_PRICE_SCOPE,
378-
ScopeInterface::SCOPE_STORE
379-
);
380-
$isGlobalConfig = isset($isGlobalConfig) ? (int) $isGlobalConfig : null;
381-
if ($isGlobalConfig === Data::PRICE_SCOPE_GLOBAL &&
382-
(int) $this->allWebsitesValue !== $price->getWebsiteId()
383-
) {
376+
$isWebsiteScope = $this->scopeConfig
377+
->isSetFlag(Data::XML_PATH_PRICE_SCOPE,ScopeInterface::SCOPE_STORE);
378+
if (!$isWebsiteScope && (int) $this->allWebsitesValue !== $price->getWebsiteId()) {
384379
throw NoSuchEntityException::singleField('website_id', $price->getWebsiteId());
385380
}
386381
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {

0 commit comments

Comments
 (0)