-
-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allowed "force enabling" of flat tables use for a product collection #2954
Conversation
Example on how to implement a fast flat table collection while in an area that until now blocks access to flat tables: $productFlatHelper = Mage::helper('catalog/product_flat');
var_dump("<br>\$productFlatHelper->isFlatCollectionDisabled(): ".$productFlatHelper->isFlatCollectionDisabled()); // true if in cart
$productFlatHelper->enableFlatCollection(true); // call to the new method
var_dump("<br>\$productFlatHelper->isFlatCollectionDisabled(): ".$productFlatHelper->isFlatCollectionDisabled()); // false
// Get some products
$_products = Mage::getModel("catalog/product")->setPageSize(12)->setCurPage(1);
var_dump($collection->getSelect()->__toString()); // uses flat table
$productFlatHelper->resetFlatCollection();
var_dump("<br>\$productFlatHelper->isFlatCollectionDisabled(): ".$productFlatHelper->isFlatCollectionDisabled()); // back to true, not breaking anything |
Can you add a space after the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not love this PR because of #2914 (comment) but, at the end of the day, it has to be forces by somebody in his/her own code so it's fine with me
Fixes #2914