Skip to content

Commit 902b655

Browse files
committed
MC-31395: Unexpected behavior of counts for prices in Layered navigation block
1 parent adc70c4 commit 902b655

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed

app/code/Magento/Catalog/Model/ProductRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,8 @@ private function joinPositionField(
914914
foreach ($searchCriteria->getFilterGroups() as $filterGroup) {
915915
foreach ($filterGroup->getFilters() as $filter) {
916916
if ($filter->getField() === 'category_id') {
917-
$categoryIds[] = explode(',', $filter->getValue());
917+
$filterValue = $filter->getValue();
918+
$categoryIds[] = is_array($filterValue) ? $filterValue : explode(',', $filterValue);
918919
}
919920
}
920921
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AssertStorefrontAttributeOptionQuantityInLayeredNavigationActionGroup" extends="AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup">
12+
<annotations>
13+
<description>Asserts visible attribute option quantity</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attributeOptionQuantity" type="string" defaultValue="1"/>
17+
</arguments>
18+
<see selector="{{StorefrontCategorySidebarSection.visibleOptionQty(attributeOptionPosition)}}" userInput="{{attributeOptionQuantity}}" after="assertAttributeOptionInLayeredNavigation" stepKey="assertOptionQuantity"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="StorefrontAssertSubCategoryNameIsNotShownInMenuActionGroup" extends="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup">
12+
<annotations>
13+
<description>Validate that the subcategory is not present in menu on Frontend.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="parentCategoryName" type="string"/>
17+
</arguments>
18+
<moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(parentCategoryName)}}" before="doNotSeeCatergoryInStoreFront" stepKey="showSubCategories"/>
19+
</actionGroup>
20+
</actionGroups>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
<element name="filterOptionByLabel" type="button" selector=" div.filter-options-item div[data-option-label='{{optionLabel}}']" parameterized="true"/>
1717
<element name="removeFilter" type="button" selector="div.filter-current .remove" timeout="30"/>
1818
<element name="activeFilterOptions" type="text" selector=".filter-options-item.active .items"/>
19-
<element name="activeFilterOptionItemByPosition" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a" parameterized="true"/>
19+
<element name="activeFilterOptionItemByPosition" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a" parameterized="true" timeout="30"/>
2020
<element name="enabledFilterOptionItemByLabel" type="text" selector="//div[@class='filter-options']//li[@class='item']//a[contains(text(), '{{optionLabel}}')]" parameterized="true" timeout="30"/>
2121
<element name="disabledFilterOptionItemByLabel" type="text" selector="//div[@class='filter-options']//li[@class='item' and contains(text(), '{{optionLabel}}')]" parameterized="true" timeout="30"/>
22+
<element name="visibleOptionQty" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a .count" parameterized="true" timeout="30"/>
2223
</section>
2324
</sections>

0 commit comments

Comments
 (0)