Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once __DIR__ . '/app/Mage.php';
- Mage::app('admin');
- //Getting all prdoucts collection
- $collection = Mage::getResourceModel('productslider/product_collection')
- ->addAttributeToSelect('*');
- foreach($collection as $prod){
- $prodId = $prod->getId();
- $_product = Mage::getModel('catalog/product')->load($prodId);
- $categoryIds = $_product->getCategoryIds();
- if(count($categoryIds) == 0){
- //Delete prdouct
- //$_product->delete();
- echo $prodId;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement