Skip to content

Commit 3253506

Browse files
author
OlgaVasyltsun
committed
MC-17694: Inventory Threshold doesn't display for configurable products simple product
1 parent d69c242 commit 3253506

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCreateConfigurationsByAttributeCodeAndNavigateToOptionsQuantityActionGroup" extends="GenerateConfigurationsByAttributeCodeActionGroup">
12+
<annotations>
13+
<description>Selects all Attribute options for the provided Attribute Code and navigates to Options quantity on the Configurable Product creation/edit page.</description>
14+
</annotations>
15+
16+
<remove keyForRemoval="clickOnApplySingleQuantityToEachSku"/>
17+
<remove keyForRemoval="enterAttributeQuantity"/>
18+
<remove keyForRemoval="clickOnNextButton3"/>
19+
<remove keyForRemoval="clickOnNextButton4"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Swatches/Test/Mftf/Metadata/SwatchProductAttributeMeta.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<operation name="CreateSwatchProductAttributeForm" dataType="SwatchProductAttributeForm" type="create"
1212
auth="adminFormKey" url="catalog/product_attribute/save" method="POST" successRegex="/messages-message-success/" returnRegex="">
1313
<contentType>application/x-www-form-urlencoded</contentType>
14+
<field key="attribute_id">string</field>
1415
<field key="frontend_label[0]">string</field>
1516
<field key="frontend_label[1]">string</field>
1617
<field key="frontend_input">string</field>
@@ -43,4 +44,7 @@
4344
<field key="used_in_product_listing">string</field>
4445
<field key="used_for_sort_by">string</field>
4546
</operation>
47+
<operation name="DeleteSwatchProductAttributeForm" dataType="SwatchProductAttributeForm" type="delete" auth="adminOauth" url="/V1/products/attributes/{attribute_code}" method="DELETE">
48+
<contentType>application/json</contentType>
49+
</operation>
4650
</operations>

app/code/Magento/Swatches/view/base/web/js/swatch-renderer.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,17 @@ define([
292292
return _.isArray(products) ? products[0] : null;
293293
},
294294

295+
/**
296+
* Get chosen product id
297+
*
298+
* @returns int|null
299+
*/
300+
getProductId: function () {
301+
var products = this._CalcProducts();
302+
303+
return _.isArray(products) && products.length === 1 ? products[0] : null;
304+
},
305+
295306
/**
296307
* @private
297308
*/

0 commit comments

Comments
 (0)