Bestsellers are determined based on all confirmed orders. The information how often a product was purchased is stored in the search engine. The shop owner can specify from which point a product counts as a bestseller.
Bestsellers can be displayed on Landing Pages and a bestseller page.
To enable bestsellers, set the following parameter to true:
Eshop/Resources/views/Bestsellers/bestsellers.html.twigrenders a bestseller page, available by default under the
Eshop/Resources/views/Bestsellers/bestsellers_box.html.twigrenders a slider for the Bestseller Page block.
Eshop/Resources/views/Bestsellers/bestsellers_catalog.html.twigrenders a slider for the catalog page.
Eshop/Resources/views/Bestsellers/bestsellers_box_esi.html.twigcreates an Edge Side Includes tag and calls the controller for Landing Page bestsellers.
Catalog bestsellers are cached independently of the rest of the page using ESI.
Ibexa\Bundle\Commerce\Search\Api\Engine\BestsellerService.php fetches bestsellers from the search engine.
Ibexa\Bundle\Commerce\Search\Service\EcontentBestsellerIndexerPlugin.php adds an additional search index field with a sum of basket lines.