Created
November 7, 2018 09:05
-
-
Save Beagon/8fde4800a5c8730db728ab647cea72e8 to your computer and use it in GitHub Desktop.
Magento 1, delete products between ID X and ID Y
This file contains hidden or 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 | |
| // Put this in your Magento 1 root, replace the variables with your ID's | |
| // Useful for deleting products when making an importer and starting from scratch. | |
| $idStart = 50000; | |
| $idEnd = 99999; | |
| require_once('app/Mage.php'); | |
| umask(0); | |
| Mage::app('admin'); | |
| $productCollection = Mage::getModel('catalog/product') | |
| ->getCollection() | |
| ->addFieldToFilter('entity_id', array('gteq'=> $idStart, 'lteq' => $idEnd)); | |
| $productCollection->delete(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment