Skip to content

Commit 78d693d

Browse files
author
Viktor Tymchynskyi
committed
MAGETWO-43503: Currency symbol is displayed outside "Price" input on "create Downloadable Product" Admin page
1 parent 24abff1 commit 78d693d

File tree

2 files changed

+13
-2
lines changed
  • app/code/Magento/Downloadable
    • Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable
    • view/adminhtml/templates/product/edit/downloadable

2 files changed

+13
-2
lines changed

app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,4 +463,13 @@ public function getBaseCurrencyCode($storeId)
463463
{
464464
return $this->_storeManager->getStore($storeId)->getBaseCurrencyCode();
465465
}
466+
467+
/**
468+
* @param null|string|bool|int|\Magento\Store\Model\Store $storeId $storeId
469+
* @return string
470+
*/
471+
public function getBaseCurrencySymbol($storeId)
472+
{
473+
return $this->_storeManager->getStore($storeId)->getBaseCurrency()->getCurrencySymbol();
474+
}
466475
}

app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ require([
107107
'</td>'+
108108
<?php if ($block->getCanReadPrice() !== false) : ?>
109109
'<td class="col-price">'+
110-
'<input type="text" id="downloadable_link_<%- data.id %>_price_value" class="input-text admin__control-text validate-number link-prices<?php if ($block->getCanEditPrice() === false) : ?> disabled<?php endif; ?>" name="downloadable[link][<%- data.id %>][price]" value="<%- data.price %>"<?php if ($block->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?> /> ' +
111-
'<div class="note">[<?php /* @escapeNotVerified */ echo $block->getBaseCurrencyCode($_product->getStoreId()) ?>]</div>' +
110+
'<div class="admin__control-addon">' +
111+
'<input type="text" id="downloadable_link_<%- data.id %>_price_value" class="input-text admin__control-text validate-number link-prices<?php if ($block->getCanEditPrice() === false) : ?> disabled<?php endif; ?>" name="downloadable[link][<%- data.id %>][price]" value="<%- data.price %>"<?php if ($block->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?> /> ' +
112+
'<label class="admin__addon-prefix"><span><?php /* @escapeNotVerified */ echo $block->getBaseCurrencySymbol($_product->getStoreId()) ?></span></label>' +
113+
'</div>' +
112114
<?php if ($_product->getStoreId() && $block->getIsPriceWebsiteScope()) : ?>
113115
'<div class="admin__field admin__field-option">'+
114116
'<input type="checkbox" id="downloadable_link_<%- data.id %>_price" name="downloadable[link][<%- data.id %>][use_default_price]" value="1"<?php if ($block->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?> class="admin__control-checkbox" />'+

0 commit comments

Comments
 (0)