|
6 | 6 | namespace Magento\Catalog\Model\ResourceModel\Product;
|
7 | 7 |
|
8 | 8 | use Magento\Catalog\Api\Data\ProductInterface;
|
| 9 | +use Magento\Store\Model\ScopeInterface; |
9 | 10 |
|
10 | 11 | /**
|
11 | 12 | * Catalog product custom option resource model
|
@@ -154,21 +155,24 @@ protected function _saveValuePrices(\Magento\Framework\Model\AbstractModel $obje
|
154 | 155 |
|
155 | 156 | $scope = (int)$this->_config->getValue(
|
156 | 157 | \Magento\Store\Model\Store::XML_PATH_PRICE_SCOPE,
|
157 |
| - \Magento\Store\Model\ScopeInterface::SCOPE_STORE |
| 158 | + ScopeInterface::SCOPE_STORE |
158 | 159 | );
|
159 | 160 |
|
160 | 161 | if ($object->getStoreId() != '0' && $scope == \Magento\Store\Model\Store::PRICE_SCOPE_WEBSITE) {
|
161 |
| - $baseCurrency = $this->_config->getValue( |
| 162 | + $website = $this->_storeManager->getStore($object->getStoreId())->getWebsite(); |
| 163 | + |
| 164 | + $websiteBaseCurrency = $this->_config->getValue( |
162 | 165 | \Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE,
|
163 |
| - 'default' |
| 166 | + ScopeInterface::SCOPE_WEBSITE, |
| 167 | + $website |
164 | 168 | );
|
165 | 169 |
|
166 |
| - $storeIds = $this->_storeManager->getStore($object->getStoreId())->getWebsite()->getStoreIds(); |
| 170 | + $storeIds = $website->getStoreIds(); |
167 | 171 | if (is_array($storeIds)) {
|
168 | 172 | foreach ($storeIds as $storeId) {
|
169 | 173 | if ($object->getPriceType() == 'fixed') {
|
170 | 174 | $storeCurrency = $this->_storeManager->getStore($storeId)->getBaseCurrencyCode();
|
171 |
| - $rate = $this->_currencyFactory->create()->load($baseCurrency)->getRate($storeCurrency); |
| 175 | + $rate = $this->_currencyFactory->create()->load($websiteBaseCurrency)->getRate($storeCurrency); |
172 | 176 | if (!$rate) {
|
173 | 177 | $rate = 1;
|
174 | 178 | }
|
|
0 commit comments