Skip to content

Commit ff4ea94

Browse files
author
Stanislav Idolov
authored
ENGCOM-3038: Module Catalog: fix issue with custom option price conversion for different base currency on website level #18225
2 parents 1118adc + 8f9e270 commit ff4ea94

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

  • app/code/Magento/Catalog/Model/ResourceModel/Product/Option

app/code/Magento/Catalog/Model/ResourceModel/Product/Option/Value.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,22 @@ protected function _saveValuePrices(AbstractModel $object)
160160
&& isset($objectPrice)
161161
&& $object->getStoreId() != Store::DEFAULT_STORE_ID
162162
) {
163-
$baseCurrency = $this->_config->getValue(
163+
$website = $this->_storeManager->getStore($object->getStoreId())->getWebsite();
164+
165+
$websiteBaseCurrency = $this->_config->getValue(
164166
Currency::XML_PATH_CURRENCY_BASE,
165-
'default'
167+
ScopeInterface::SCOPE_WEBSITE,
168+
$website
166169
);
167170

168-
$storeIds = $this->_storeManager->getStore($object->getStoreId())->getWebsite()->getStoreIds();
171+
$storeIds = $website->getStoreIds();
169172
if (is_array($storeIds)) {
170173
foreach ($storeIds as $storeId) {
171174
if ($priceType == 'fixed') {
172175
$storeCurrency = $this->_storeManager->getStore($storeId)->getBaseCurrencyCode();
173176
/** @var $currencyModel Currency */
174177
$currencyModel = $this->_currencyFactory->create();
175-
$currencyModel->load($baseCurrency);
178+
$currencyModel->load($websiteBaseCurrency);
176179
$rate = $currencyModel->getRate($storeCurrency);
177180
if (!$rate) {
178181
$rate = 1;

0 commit comments

Comments
 (0)