Skip to content

Commit 04c8007

Browse files
author
Yaroslav Onischenko
committed
MAGETWO-44145: Read and Edit Permissions does not work
1 parent f578e54 commit 04c8007

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Price.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,11 @@ public function getAfterElementHtml()
7171
$addJsObserver = false;
7272
if ($attribute = $this->getEntityAttribute()) {
7373
$store = $this->getStore($attribute);
74-
$html .= '<strong>' . $this->_localeCurrency->getCurrency(
75-
$store->getBaseCurrencyCode()
76-
)->getSymbol() . '</strong>';
74+
if ($this->getType() !== 'hidden') {
75+
$html .= '<strong>'
76+
. $this->_localeCurrency->getCurrency($store->getBaseCurrencyCode())->getSymbol()
77+
. '</strong>';
78+
}
7779
if ($this->_taxData->priceIncludesTax($store)) {
7880
if ($attribute->getAttributeCode() !== 'cost') {
7981
$addJsObserver = true;

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/advanced-pricing-handler.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,26 @@ define([
1010
'use strict';
1111

1212
return {
13+
$initiallyDisabledAttributes: [],
1314
$links: $('[data-ui-id=product-tabs-tab-link-advanced-pricing]'),
1415
$tab: $('[data-tab-panel=advanced-pricing]'),
1516
toggleDisabledAttribute: function (disabled) {
1617
$('input,select', this.$tab).each(function (index, element) {
17-
$(element).attr('disabled', disabled);
18+
if (!$.inArray(element, this.$initiallyDisabledAttributes)) {
19+
$(element).attr('disabled', disabled);
20+
}
1821
});
1922
},
2023
init: function () {
2124
$(document).on('changeTypeProduct', this._initType.bind(this));
25+
this._setInitialState();
2226
this._initType();
2327
},
28+
_setInitialState: function () {
29+
if (this.$initiallyDisabledAttributes.length == 0) {
30+
this.$initiallyDisabledAttributes = $('input:disabled,select:disabled', this.$tab).toArray();
31+
}
32+
},
2433
_initType: function () {
2534
var isConfigurable = productType.type.current === 'configurable';
2635

0 commit comments

Comments
 (0)