Skip to content

Commit 5a9f923

Browse files
author
Olexii Korshenko
committed
Merge branch 'mainline-develop' into checkout
2 parents 71ff1c9 + 41156cc commit 5a9f923

File tree

22 files changed

+1241
-141
lines changed

22 files changed

+1241
-141
lines changed

app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ protected function _prepareLayout()
6060
* Get header
6161
*
6262
* @return \Magento\Framework\Phrase
63+
* @codeCoverageIgnore
6364
*/
6465
public function getHeader()
6566
{
@@ -70,6 +71,7 @@ public function getHeader()
7071
* Get save button html
7172
*
7273
* @return string
74+
* @codeCoverageIgnore
7375
*/
7476
public function getSaveButtonHtml()
7577
{
@@ -80,6 +82,7 @@ public function getSaveButtonHtml()
8082
* Get reset button html
8183
*
8284
* @return string
85+
* @codeCoverageIgnore
8386
*/
8487
public function getResetButtonHtml()
8588
{
@@ -90,6 +93,7 @@ public function getResetButtonHtml()
9093
* Get import button html
9194
*
9295
* @return string
96+
* @codeCoverageIgnore
9397
*/
9498
public function getImportButtonHtml()
9599
{
@@ -100,6 +104,7 @@ public function getImportButtonHtml()
100104
* Get services html
101105
*
102106
* @return string
107+
* @codeCoverageIgnore
103108
*/
104109
public function getServicesHtml()
105110
{
@@ -110,6 +115,7 @@ public function getServicesHtml()
110115
* Get rates matrix html
111116
*
112117
* @return string
118+
* @codeCoverageIgnore
113119
*/
114120
public function getRatesMatrixHtml()
115121
{
@@ -120,6 +126,7 @@ public function getRatesMatrixHtml()
120126
* Get import form action url
121127
*
122128
* @return string
129+
* @codeCoverageIgnore
123130
*/
124131
public function getImportFormAction()
125132
{

app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Matrix.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ protected function _prepareLayout()
8383
* Get rates form action
8484
*
8585
* @return string
86+
* @codeCoverageIgnore
8687
*/
8788
public function getRatesFormAction()
8889
{

app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ protected function _prepareLayout()
7777
* Returns page header
7878
*
7979
* @return \Magento\Framework\Phrase
80+
* @codeCoverageIgnore
8081
*/
8182
public function getHeader()
8283
{
@@ -87,6 +88,7 @@ public function getHeader()
8788
* Returns URL for save action
8889
*
8990
* @return string
91+
* @codeCoverageIgnore
9092
*/
9193
public function getFormActionUrl()
9294
{
@@ -97,6 +99,7 @@ public function getFormActionUrl()
9799
* Returns website id
98100
*
99101
* @return int
102+
* @codeCoverageIgnore
100103
*/
101104
public function getWebsiteId()
102105
{
@@ -107,6 +110,7 @@ public function getWebsiteId()
107110
* Returns store id
108111
*
109112
* @return int
113+
* @codeCoverageIgnore
110114
*/
111115
public function getStoreId()
112116
{
@@ -130,6 +134,7 @@ public function getCurrencySymbolsData()
130134
* Returns inheritance text
131135
*
132136
* @return \Magento\Framework\Phrase
137+
* @codeCoverageIgnore
133138
*/
134139
public function getInheritText()
135140
{

app/code/Magento/CurrencySymbol/Helper/Data.php

Lines changed: 0 additions & 56 deletions
This file was deleted.

app/code/Magento/CurrencySymbol/Model/Observer.php

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,26 @@
33
* Copyright © 2015 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
namespace Magento\CurrencySymbol\Model;
7+
8+
use Magento\Framework\Locale\Currency;
69

710
/**
811
* Currency Symbol Observer
9-
*
10-
* @author Magento Core Team <core@magentocommerce.com>
1112
*/
12-
namespace Magento\CurrencySymbol\Model;
13-
1413
class Observer
1514
{
1615
/**
17-
* Currency symbol data
18-
*
19-
* @var \Magento\CurrencySymbol\Helper\Data
16+
* @var \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory
2017
*/
21-
protected $_currencySymbolData = null;
18+
protected $symbolFactory;
2219

2320
/**
24-
* @param \Magento\CurrencySymbol\Helper\Data $currencySymbolData
21+
* @param \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolFactory
2522
*/
26-
public function __construct(\Magento\CurrencySymbol\Helper\Data $currencySymbolData)
23+
public function __construct(\Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolFactory)
2724
{
28-
$this->_currencySymbolData = $currencySymbolData;
25+
$this->symbolFactory = $symbolFactory;
2926
}
3027

3128
/**
@@ -38,8 +35,28 @@ public function currencyDisplayOptions(\Magento\Framework\Event\Observer $observ
3835
{
3936
$baseCode = $observer->getEvent()->getBaseCode();
4037
$currencyOptions = $observer->getEvent()->getCurrencyOptions();
41-
$currencyOptions->setData($this->_currencySymbolData->getCurrencyOptions($baseCode));
38+
$currencyOptions->setData($this->getCurrencyOptions($baseCode));
4239

4340
return $this;
4441
}
42+
43+
/**
44+
* Get currency display options
45+
*
46+
* @param string $baseCode
47+
* @return array
48+
*/
49+
protected function getCurrencyOptions($baseCode)
50+
{
51+
$currencyOptions = [];
52+
if ($baseCode) {
53+
$customCurrencySymbol = $this->symbolFactory->create()->getCurrencySymbol($baseCode);
54+
if ($customCurrencySymbol) {
55+
$currencyOptions[Currency::CURRENCY_OPTION_SYMBOL] = $customCurrencySymbol;
56+
$currencyOptions[Currency::CURRENCY_OPTION_DISPLAY] = \Magento\Framework\Currency::USE_SYMBOL;
57+
}
58+
}
59+
60+
return $currencyOptions;
61+
}
4562
}

0 commit comments

Comments
 (0)