Skip to content

Commit 40f42a5

Browse files
committed
MC-15094: When switch to specific store view - field Price not disabled but checkbox "Use Default Value" is checked
1 parent 3aac933 commit 40f42a5

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,30 @@
1313
<element name="attributeSetFilterResult" type="input" selector="div[data-index='attribute_set_id'] .action-menu-item._last" timeout="30"/>
1414
<element name="attributeSetFilterResultByName" type="text" selector="//label/span[text() = '{{var}}']" timeout="30" parameterized="true"/>
1515
<element name="productName" type="input" selector=".admin__field[data-index=name] input"/>
16+
<element name="productNameDisabled" type="input" selector=".admin__field[data-index=name] input[disabled=true]"/>
1617
<element name="RequiredNameIndicator" type="text" selector=" return window.getComputedStyle(document.querySelector('._required[data-index=name]&gt;.admin__field-label span'), ':after').getPropertyValue('content');"/>
1718
<element name="RequiredSkuIndicator" type="text" selector=" return window.getComputedStyle(document.querySelector('._required[data-index=sku]&gt;.admin__field-label span'), ':after').getPropertyValue('content');"/>
1819
<element name="productSku" type="input" selector=".admin__field[data-index=sku] input"/>
20+
<element name="productSkuDisabled" type="input" selector=".admin__field[data-index=sku] input[disabled=true]"/>
1921
<element name="enableProductAttributeLabel" type="text" selector="//span[text()='Enable Product']/parent::label"/>
2022
<element name="enableProductAttributeLabelWrapper" type="text" selector="//span[text()='Enable Product']/parent::label/parent::div"/>
2123
<element name="productStatus" type="checkbox" selector="input[name='product[status]']"/>
24+
<element name="productStatusDisabled" type="checkbox" selector="input[name='product[status]'][disabled]"/>
2225
<element name="enableProductLabel" type="checkbox" selector="input[name='product[status]']+label"/>
2326
<element name="productStatusUseDefault" type="checkbox" selector="input[name='use_default[status]']"/>
2427
<element name="productNameUseDefault" type="checkbox" selector="input[name='use_default[name]']"/>
2528
<element name="productPrice" type="input" selector=".admin__field[data-index=price] input"/>
29+
<element name="productPriceDisabled" type="input" selector=".admin__field[data-index=price] input[disabled=true]"/>
30+
<element name="productPriceUseDefault" type="checkbox" selector=".admin__field[data-index=price] [name='use_default[price]']"/>
2631
<element name="productTaxClass" type="select" selector="//*[@name='product[tax_class_id]']"/>
32+
<element name="productTaxClassDisabled" type="select" selector="select[name='product[tax_class_id]'][disabled=true]"/>
2733
<element name="productTaxClassUseDefault" type="checkbox" selector="input[name='use_default[tax_class_id]']"/>
2834
<element name="advancedPricingLink" type="button" selector="button[data-index='advanced_pricing_button']" timeout="30"/>
2935
<element name="categoriesDropdown" type="multiselect" selector="div[data-index='category_ids']"/>
3036
<element name="productQuantity" type="input" selector=".admin__field[data-index=qty] input"/>
3137
<element name="advancedInventoryLink" type="button" selector="//button[contains(@data-index, 'advanced_inventory_button')]" timeout="30"/>
3238
<element name="productStockStatus" type="select" selector="select[name='product[quantity_and_stock_status][is_in_stock]']"/>
39+
<element name="productStockStatusDisabled" type="select" selector="select[name='product[quantity_and_stock_status][is_in_stock]'][disabled=true]"/>
3340
<element name="stockStatus" type="select" selector="[data-index='product-details'] select[name='product[quantity_and_stock_status][is_in_stock]']"/>
3441
<element name="productWeight" type="input" selector=".admin__field[data-index=weight] input"/>
3542
<element name="productWeightSelect" type="select" selector="select[name='product[product_has_weight]']"/>
@@ -47,6 +54,7 @@
4754
<element name="productFormTab" type="button" selector="//strong[@class='admin__collapsible-title']/span[contains(text(), '{{tabName}}')]" parameterized="true"/>
4855
<element name="productFormTabState" type="text" selector="//strong[@class='admin__collapsible-title']/span[contains(text(), '{{tabName}}')]/parent::*/parent::*[@data-state-collapsible='{{state}}']" parameterized="true"/>
4956
<element name="visibility" type="select" selector="//select[@name='product[visibility]']"/>
57+
<element name="visibilityDisabled" type="select" selector="select[name='product[visibility]'][disabled=true]"/>
5058
<element name="visibilityUseDefault" type="checkbox" selector="//input[@name='use_default[visibility]']"/>
5159
<element name="divByDataIndex" type="input" selector="div[data-index='{{var}}']" parameterized="true"/>
5260
<element name="setProductAsNewFrom" type="input" selector="input[name='product[news_from_date]']"/>

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/price-configurable.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ define([
1111

1212
return Abstract.extend({
1313
defaults: {
14+
listens: {
15+
isConfigurable: 'handlePriceValue'
16+
},
1417
imports: {
1518
isConfigurable: '!ns = ${ $.ns }, index = configurable-matrix:isEmpty'
1619
},
@@ -24,10 +27,6 @@ define([
2427
this._super();
2528
// resolve initial disable state
2629
this.handlePriceValue(this.isConfigurable);
27-
// add listener to track "configurable" type
28-
this.setListeners({
29-
isConfigurable: 'handlePriceValue'
30-
});
3130

3231
return this;
3332
},

0 commit comments

Comments
 (0)