Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,11 @@ public function getCurrencySymbolsData()
*/
public function setCurrencySymbolsData($symbols = [])
{
foreach ($this->getCurrencySymbolsData() as $code => $values) {
if (isset($symbols[$code]) && ($symbols[$code] == $values['parentSymbol'] || empty($symbols[$code]))) {
unset($symbols[$code]);
if (!$this->_storeManager->isSingleStoreMode()) {
foreach ($this->getCurrencySymbolsData() as $code => $values) {
if (isset($symbols[$code]) && ($symbols[$code] == $values['parentSymbol'] || empty($symbols[$code]))) {
unset($symbols[$code]);
}
}
}
$value = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@
</label>
<div class="admin__field-control">
<input id="custom_currency_symbol<?= /* @escapeNotVerified */ $code ?>"
class="required-entry admin__control-text"
class="required-entry admin__control-text <?= $data['inherited'] ? 'disabled' : '' ?>"
type="text"
value="<?= $block->escapeHtmlAttr($data['displaySymbol']) ?>"
<?= $data['inherited'] ? ' disabled="disabled"' : '' ?>
name="custom_currency_symbol[<?= /* @escapeNotVerified */ $code ?>]">
<div class="admin__field admin__field-option">
<input id="custom_currency_symbol_inherit<?= /* @escapeNotVerified */ $code ?>"
Expand All @@ -49,16 +48,18 @@ require(['jquery', "mage/mage", 'prototype'], function(jQuery){

function toggleUseDefault(code, value)
{
checkbox = $('custom_currency_symbol_inherit'+code);
input = $('custom_currency_symbol'+code);
if (checkbox.checked) {
input.value = value;
input.disabled = true;
checkbox = jQuery('#custom_currency_symbol_inherit'+code);
input = jQuery('#custom_currency_symbol'+code);

if (checkbox.is(':checked')) {
input.addClass('disabled');
input.val(value);
input.prop('readonly', true);
} else {
input.disabled = false;
input.removeClass('disabled');
input.prop('readonly', false);
}
}

window.toggleUseDefault = toggleUseDefault;
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@
.admin__control-text,
.admin__control-textarea {
width: 100%;
&.disabled {
background-color: #e9e9e9;
border-color: #adadad;
color: #303030;
cursor: not-allowed;
opacity: .5;
}
}
}

Expand Down