2

I have a site with Magento 2.2.5, with thousands of products imported via Magmi v0.7.23-git with csv.

I tried to delete all these products with the Magmi utility 'Clear Catalog v1.0.4', and then reload the new products with a new csv.

The problem is that the new loaded products do not have the right images, some products have 2, 3 images that have nothing to do with it.

I also tried deleting all the records in these tables: catalog_product_entity_media_gallery catalog_product_entity_media_gallery_value

But the problem remains.

Which method do you recommend to delete all the products and images of these products from Magento correctly to ensure that no data of these products remains?

Thank you all.

1
  • have to tried deleting from the BO? Commented Mar 14, 2019 at 16:07

1 Answer 1

0

Click Here to add MAGMI into your module -> https://magento.stackexchange.com/a/351175

Enable Product Deleter plugin.

enter image description here

Using CSV

"sku","magmi:delete"
"sku1","1"
"sku2","1"

Using Code

    $importData = [];
    $configProduct = new \Magmi_ProductImport_DataPump('productimport');
    $importData['sku'] = "your Product SKU";
    $importData['magmi:delete'] = "1";
    $configProduct->beginImportSession("default", "update");
    $run = $configProduct->ingest($importData);
    $configProduct->endImportSession();

Check catalog_eav_attribute table in your db . If is_configurable column not present then update below code from getConfigurableOptsFromAsId() function in this file .../magmi/plugins/base/itemprocessors/configurables/magmi_configurableprocessor.php

    //$sql .= " JOIN $cea as cea ON cea.attribute_id=ea.attribute_id AND cea.is_global=1 AND cea.is_configurable=1";
    $sql .= " JOIN $cea as cea ON cea.attribute_id=ea.attribute_id AND cea.is_global=1";
} else {
    //$cond .= " AND ea.is_global=1 AND ea.is_configurable=1";
    $cond .= " AND ea.is_global=1";

Note:- magmi:delete : 1 is to delete the product 0 is to not delete the product

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.