Skip to content

Commit 1c7bc19

Browse files
committed
ACP2E-748: Layered navigation filters don't work when "show out of stock" is enabled
1 parent 9a42825 commit 1c7bc19

File tree

11 files changed

+11
-526
lines changed

11 files changed

+11
-526
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
interface OutOfStockInterface
1313
{
1414
/**
15+
* Check if, admin setting for automatic sorting is set to 'move out of stock to bottom'
16+
*
1517
* @param Category $category
1618
* @param Collection $collection
1719
* @return bool

app/code/Magento/CatalogSearch/Plugin/Model/ResourceModel/Fulltext/CollectionPlugin.php

Lines changed: 0 additions & 140 deletions
This file was deleted.

app/code/Magento/CatalogSearch/etc/frontend/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
</arguments>
2323
</virtualType>
2424
<type name="Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection">
25-
<plugin name="is_salable_filter" type="Magento\CatalogSearch\Plugin\Model\ResourceModel\Fulltext\CollectionPlugin"/>
25+
<plugin name="out_of_stock_sorting" type="Magento\InventoryCatalogSearch\Plugin\Model\ResourceModel\Fulltext\CollectionPlugin"/>
2626
</type>
2727
</config>

app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/IsOutOfStockFieldsProvider.php

Lines changed: 0 additions & 113 deletions
This file was deleted.

app/code/Magento/Elasticsearch/Model/Adapter/DataMapper/Stock.php

Lines changed: 0 additions & 59 deletions
This file was deleted.

app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/DynamicField.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,6 @@ public function getFields(array $context = []): array
156156
];
157157
}
158158

159-
$isOutOfStockAttribute = $this->attributeAdapterProvider->getByAttributeCode('is_out_of_stock');
160-
$groupStockItemKey = $this->fieldNameResolver->getFieldName(
161-
$isOutOfStockAttribute,
162-
$ctx
163-
);
164-
$allAttributes[$groupStockItemKey] = [
165-
'type' => $this->fieldTypeConverter->convert(FieldTypeConverterInterface::INTERNAL_DATA_TYPE_INT),
166-
'store' => true
167-
];
168-
169159
return $allAttributes;
170160
}
171161
}

app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/FieldName/Resolver/IsOutOfStock.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)