1

Is there away i can delete all product or at least find them in the backend interface ?

There must be away to export products with no images in dataflow and then import them back in but this time delete entries ?

Thank you

2 Answers 2

3

To my knowledge there is no way of deleting a product via Dataflow. However, if you're comfortable running a script - the following standalone script will delete all products that don't have images*:

<?php
require('app/Mage.php');
Mage::app();

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->getSelect()
    ->joinLeft(
        array('_gallery_table' => $collection->getTable('catalog/product_attribute_media_gallery')),
        'e.entity_id = _gallery_table.entity_id',
        array()
    )
    ->where('_gallery_table.value IS NULL');
$collection->delete();

Do not run this on your production database without having tested it thoroughly first.


* Disclaimer: I am not responsible for any damage caused to your system. This code is untested. You alone are responsible for running code that you copied and pasted from a random person on the internet.

Sources:

https://stackoverflow.com/questions/16892513/magento-get-products-without-images-using-collections

https://stackoverflow.com/questions/5486350/how-do-i-delete-data-using-collection-in-magento-orm

1

Absolutely, Heres the logic:

Decide what type of product you are using Run a mage.app (or other) Programatic code to run all the filters, then using the API delete process you will be able to delete the product based on ID

I use it all the time myself for updating product statuses, and disabling/deleting bundles that have 0 stock.

6
  • Thanks for the reply, I am a complete novice to magento, How do i do this ? Thanks Michael
    – Michael
    Commented Sep 19, 2013 at 17:44
  • All I can reccomend is reading into dealing with magento programatically and have a read through this: magentocommerce.com/api/soap/introduction.html I cant help much unfortunately if your new to magento, however the functions you are looking for are just a script away :) As soon as you write that one you can do allsorts! Commented Sep 19, 2013 at 17:53
  • If you would like a quick tutorial that can set you off please let me know and I'll be happy to write one out for you :) Commented Sep 19, 2013 at 21:11
  • Also good to familiarize yourself with working with collections. magentocommerce.com/wiki/1_-_installation_and_configuration/…
    – pspahn
    Commented Sep 19, 2013 at 22:05
  • Hi Adam, Yeah sure if you dont mind that would be a massive help for me :) thanks
    – Michael
    Commented Sep 20, 2013 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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