PHP Class Smile\ElasticsuiteCatalog\Block\Plugin\ResultPlugin

Author: Aurelien FOUCRET ([email protected])
Datei anzeigen Open project: smile-sa/elasticsuite

Protected Properties

Property Type Description
$catalogSearchData Magento\CatalogSearch\Helper\Data Catalog search data
$layer Magento\Catalog\Model\Layer
$queryFactory Magento\Search\Model\QueryFactory
$queryResource Smile\ElasticsuiteCatalog\Model\ResourceModel\Search\Query
$resultCount integer

Public Methods

Method Description
__construct ( Magento\Catalog\Model\Layer\Resolver $layerResolver, Magento\CatalogSearch\Helper\Data $catalogSearchData, Magento\Search\Model\QueryFactory $queryFactory, Query $queryResource ) Constructor.
aroundGetNoteMessages ( Magento\CatalogSearch\Block\Result $resultBlock, Closure $proceed ) : string[] Append the fuzziness alert message + save the search result count.
aroundGetResultCount ( Magento\CatalogSearch\Block\Result $resultBlock, Closure $proceed ) : integer Avoid the search result count to be saved by the original method.
aroundSetListOrders ( Magento\CatalogSearch\Block\Result $resultBlock, Closure $proceed ) : Magento\CatalogSearch\Block\Result Change default behavior of the search result block.

Private Methods

Method Description
getProductCollection ( ) : Magento\Catalog\Model\ResourceModel\Product\Collection Return the current layer product collection.
isSpellcheck ( ) : boolean Indicates if the current search is spellchecked.

Method Details

__construct() public method

Constructor.
public __construct ( Magento\Catalog\Model\Layer\Resolver $layerResolver, Magento\CatalogSearch\Helper\Data $catalogSearchData, Magento\Search\Model\QueryFactory $queryFactory, Query $queryResource )
$layerResolver Magento\Catalog\Model\Layer\Resolver Layer.
$catalogSearchData Magento\CatalogSearch\Helper\Data Catalog search helper.
$queryFactory Magento\Search\Model\QueryFactory Search query factory.
$queryResource Smile\ElasticsuiteCatalog\Model\ResourceModel\Search\Query Search query resource.

aroundGetNoteMessages() public method

Append the fuzziness alert message + save the search result count.
public aroundGetNoteMessages ( Magento\CatalogSearch\Block\Result $resultBlock, Closure $proceed ) : string[]
$resultBlock Magento\CatalogSearch\Block\Result Result block.
$proceed Closure Original method.
return string[]

aroundGetResultCount() public method

Avoid the search result count to be saved by the original method.
public aroundGetResultCount ( Magento\CatalogSearch\Block\Result $resultBlock, Closure $proceed ) : integer
$resultBlock Magento\CatalogSearch\Block\Result Result block.
$proceed Closure Original method.
return integer

aroundSetListOrders() public method

Order has to be set to ASC and not DESC.
public aroundSetListOrders ( Magento\CatalogSearch\Block\Result $resultBlock, Closure $proceed ) : Magento\CatalogSearch\Block\Result
$resultBlock Magento\CatalogSearch\Block\Result Result block.
$proceed Closure Original method.
return Magento\CatalogSearch\Block\Result

Property Details

$catalogSearchData protected_oe property

Catalog search data
protected Data,Magento\CatalogSearch\Helper $catalogSearchData
return Magento\CatalogSearch\Helper\Data

$layer protected_oe property

protected Layer,Magento\Catalog\Model $layer
return Magento\Catalog\Model\Layer

$queryFactory protected_oe property

protected QueryFactory,Magento\Search\Model $queryFactory
return Magento\Search\Model\QueryFactory

$queryResource protected_oe property

protected Query,Smile\ElasticsuiteCatalog\Model\ResourceModel\Search $queryResource
return Smile\ElasticsuiteCatalog\Model\ResourceModel\Search\Query

$resultCount protected_oe property

protected int $resultCount
return integer