Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-catalog-inventory
Model
Plugin
ProductSearch.php
Go to the documentation of this file.
1
<?php
7
declare(strict_types=1);
8
9
namespace
Magento\CatalogInventory\Model\Plugin
;
10
11
use
Magento\CatalogInventory\Helper\Stock
;
12
14
class
ProductSearch
15
{
19
private
$stockHelper;
20
24
public
function
__construct
(
Stock
$stockHelper)
25
{
26
$this->stockHelper = $stockHelper;
27
}
28
37
public
function
afterPrepareCollection
(
38
\
Magento
\Catalog\Model\ProductLink\Search $subject,
39
\
Magento
\Catalog\Model\
ResourceModel
\Product\
Collection
$collection
40
): \
Magento
\Catalog\Model\
ResourceModel
\Product\
Collection
{
41
$this->stockHelper->addIsInStockFilterToCollection(
$collection
);
42
return
$collection
;
43
}
44
}
Magento\CatalogInventory\Model\Plugin
Definition:
ProductSearchTest.php:9
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
Magento\CatalogInventory\Helper\Stock
Definition:
Stock.php:26
Magento\CatalogInventory\Model\Plugin\ProductSearch\__construct
__construct(Stock $stockHelper)
Definition:
ProductSearch.php:24
Magento\CatalogInventory\Model\Plugin\ProductSearch
Definition:
ProductSearch.php:14
Magento
Magento\CatalogInventory\Model\Plugin\ProductSearch\afterPrepareCollection
afterPrepareCollection(\Magento\Catalog\Model\ProductLink\Search $subject, \Magento\Catalog\Model\ResourceModel\Product\Collection $collection)
Definition:
ProductSearch.php:37
Magento\Catalog\Model\ResourceModel\Product\Link\Collection
Definition:
Collection.php:15
$collection
$collection
Definition:
catalog_category_with_apostrophe_rollback.php:17