Untitled
unknown
plain_text
2 years ago
1.2 kB
11
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...