@@ -82,7 +82,8 @@ public function render(DataObject $row)
82
82
$ rate = $ this ->getStoreCurrencyRate ($ currencyCode , $ row );
83
83
$ data = (float ) $ data * $ rate ;
84
84
$ data = sprintf ('%f ' , $ data );
85
- return $ this ->_localeCurrency ->getCurrency ($ currencyCode )->toCurrency ($ data );
85
+ $ displayCurrencyCode = $ this ->getStoreDisplayCurrencyCode ($ row );
86
+ return $ this ->_localeCurrency ->getCurrency ($ displayCurrencyCode )->toCurrency ($ data );
86
87
}
87
88
88
89
/**
@@ -110,6 +111,27 @@ private function getAdminCurrencyCode(): string
110
111
* @throws NoSuchEntityException
111
112
*/
112
113
private function getStoreCurrencyCode (DataObject $ row ): string
114
+ {
115
+ $ catalogPriceScope = $ this ->getCatalogPriceScope ();
116
+ $ storeId = $ this ->_request ->getParam ('store_ids ' );
117
+ if ($ catalogPriceScope != 0 && !empty ($ storeId )) {
118
+ $ currencyCode = $ this ->_storeManager ->getStore ($ storeId )->getBaseCurrencyCode ();
119
+ } elseif ($ catalogPriceScope != 0 ) {
120
+ $ currencyCode = $ this ->_currencyLocator ->getDefaultCurrency ($ this ->_request );
121
+ } else {
122
+ $ currencyCode = $ this ->_getCurrencyCode ($ row );
123
+ }
124
+ return $ currencyCode ;
125
+ }
126
+
127
+ /**
128
+ * Get store display currency code
129
+ *
130
+ * @param DataObject $row
131
+ * @return string
132
+ * @throws NoSuchEntityException
133
+ */
134
+ private function getStoreDisplayCurrencyCode (DataObject $ row ): string
113
135
{
114
136
$ catalogPriceScope = $ this ->getCatalogPriceScope ();
115
137
$ storeId = $ this ->_request ->getParam ('store_ids ' );
0 commit comments