Last active
February 21, 2017 01:42
-
-
Save gelanivishal/3cd240753668db9d4987e4fea433382c to your computer and use it in GitHub Desktop.
Clear cache/reindex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'app/Mage.php'; | |
Mage::app(); | |
// clear cache | |
Mage::app()->removeCache('catalog_rules_dirty'); | |
// reindex prices | |
Mage::getModel('index/process')->load(2)->reindexEverything(); | |
/* | |
1 = Product Attributes | |
2 = Product Attributes | |
3 = Catalog URL Rewrites | |
4 = Product Flat Data | |
5 = Category Flat Data | |
6 = Category Products | |
7 = Catalog Search Index | |
8 = Tag Aggregation Data | |
9 = Stock Status | |
*/ | |
// Recreate a single index programmatically | |
Mage::getModel('index/process')->load(Mage_Catalog_Helper_Product_Flat::CATALOG_FLAT_PROCESS_CODE, 'indexer_code')->reindexEverything(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment