Skip to content

Commit 2f90ada

Browse files
committed
ACP2E-3091: [Cloud] Creating the Duplicate website group price customer group in Tier Prices Api.
1 parent bac8a26 commit 2f90ada

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -557,18 +557,18 @@ private function compareWebsiteValue(TierPriceInterface $price, TierPriceInterfa
557557
*/
558558
private function compareWebsiteValueNewPrice(TierPriceInterface $price, TierPriceInterface $tierPrice): bool
559559
{
560-
if ($price->getWebsiteId() != $this->allWebsitesValue ||
561-
$tierPrice->getWebsiteId() != $this->allWebsitesValue
560+
if ($price->getWebsiteId() == $this->allWebsitesValue ||
561+
$tierPrice->getWebsiteId() == $this->allWebsitesValue
562562
) {
563-
return $price->getWebsiteId() == $tierPrice->getWebsiteId();
564-
}
563+
$baseCurrency = $this->scopeConfig->getValue(Currency::XML_PATH_CURRENCY_BASE, 'default');
564+
$websiteId = max($price->getWebsiteId(), $tierPrice->getWebsiteId());
565+
$website = $this->websiteRepository->getById($websiteId);
566+
$websiteCurrency = $website->getBaseCurrencyCode();
565567

566-
$baseCurrency = $this->scopeConfig->getValue(Currency::XML_PATH_CURRENCY_BASE, 'default');
567-
$websiteId = max($price->getWebsiteId(), $tierPrice->getWebsiteId());
568-
$website = $this->websiteRepository->getById($websiteId);
569-
$websiteCurrency = $website->getBaseCurrencyCode();
568+
return $price->getWebsiteId() == $tierPrice->getWebsiteId() && $baseCurrency == $websiteCurrency;
569+
}
570570

571-
return $price->getWebsiteId() == $tierPrice->getWebsiteId() && $baseCurrency == $websiteCurrency;
571+
return $price->getWebsiteId() == $tierPrice->getWebsiteId();
572572
}
573573

574574
/**

0 commit comments

Comments
 (0)