0

we have created a custom category sort order which uses a new product attribute with numerical value. This works great generally, but we are getting front end errors during any time when the Flat Product Data index is being reindexed.
We have flat catalog product enabled.
We have the attribute enabled for 'Used for Sorting in Product Listing'.
We've tried to use the isBuilt() value to detect when an index is being run and skip our sorting code during reindexing, but isBuilt() always returns true whether a reindex is being run or not.

How is this usually done? It seems magento blocks access to the value from the flat table whilst it is reindexing it. Do we need to define an alternative way of pulling the attribute value or is there a simple check to see if the index is running which we can include in an if statement, so that our code is bypassed whilst the reindex is occuring?

front end error

0

we have sidestepped the issue now by including

$process = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_flat');  
if ($process->getStatus() != "working") {

around our code. This means that our fancy sorting code is not active when the reindex is happening, so no more errors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.