Skip to content

Commit 5d4170d

Browse files
committed
temp commit
1 parent 51fd7d3 commit 5d4170d

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Helper/ConfigHelper.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class ConfigHelper
9494
public const MAKE_SEO_REQUEST = 'algoliasearch_advanced/advanced/make_seo_request';
9595
public const REMOVE_BRANDING = 'algoliasearch_advanced/advanced/remove_branding';
9696
public const AUTOCOMPLETE_SELECTOR = 'algoliasearch_autocomplete/autocomplete/autocomplete_selector';
97+
public const INCLUDE_NON_VISIBLE_PRODUCTS_IN_INDEX = 'algoliasearch_products/products/include_non_visible_products_in_index';
9798
public const IDX_PRODUCT_ON_CAT_PRODUCTS_UPD = 'algoliasearch_advanced/advanced/index_product_on_category_products_update';
9899
public const PREVENT_BACKEND_RENDERING = 'algoliasearch_advanced/advanced/prevent_backend_rendering';
99100
public const PREVENT_BACKEND_RENDERING_DISPLAY_MODE =
@@ -234,6 +235,21 @@ public function getAutocompleteSelector($storeId = null)
234235
return $this->configInterface->getValue(self::AUTOCOMPLETE_SELECTOR, ScopeInterface::SCOPE_STORE, $storeId);
235236
}
236237

238+
/**
239+
* Returns config value
240+
*
241+
* @param $storeId
242+
* @return mixed
243+
*/
244+
public function includeNonVisibleProductsInIndex($storeId = null)
245+
{
246+
return $this->configInterface->getValue(
247+
self::INCLUDE_NON_VISIBLE_PRODUCTS_IN_INDEX,
248+
ScopeInterface::SCOPE_STORE,
249+
$storeId
250+
);
251+
}
252+
237253
/**
238254
* @param $storeId
239255
* @return mixed

Helper/Data.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ public function rebuildStoreProductIndex(int $storeId, array $productIds): void
376376
$this->logger->start('Indexing');
377377
try {
378378
$this->logger->start('ok');
379-
$collection = $this->productHelper->getProductCollectionQuery($storeId, $productIds);
379+
$onlyVisible = $this->configHelper->includeNonVisibleProductsInIndex();
380+
$collection = $this->productHelper->getProductCollectionQuery($storeId, $productIds, $onlyVisible);
380381
$size = $collection->getSize();
381382
if (!empty($productIds)) {
382383
$size = max(count($productIds), $size);

0 commit comments

Comments
 (0)