Untitled
Anonymous
plain_text
08/28/2023 9:52 PM
1.5 KB
18
Indexable
public function canProductBeReindexed(Mage_Catalog_Model_Product $product, $storeId)
{
if ($product->isDeleted() === true) {
throw (new Algolia_Algoliasearch_Model_Exception_ProductDeletedException())
->withProduct($product)
->withStoreId($storeId);
}
if ($product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
throw (new Algolia_Algoliasearch_Model_Exception_ProductDisabledException())
->withProduct($product)
->withStoreId($storeId);
}
if ($this->shouldIndexProductByItsVisibility($product, $storeId) === false) {
throw (new Algolia_Algoliasearch_Model_Exception_ProductNotVisibleException())
->withProduct($product)
->withStoreId($storeId);
}
if (!$this->config->getShowOutOfStock($storeId)
&& !$product->getStockItem()->getIsInStock()) {
throw (new Algolia_Algoliasearch_Model_Exception_ProductOutOfStockException())
->withProduct($product)
->withStoreId($storeId);
}
return true;
}Editor is loading...