I have been using magmi to import products in bulk, but now need to delete some of them.
How can I do this?
Add a column to your import with this as the header name: magmi:delete
1 is to delete the product 0 is to not delete the product
You want to use the Product Deleter v0.0.2 plugin.
First you need to enable the Product Deleter Plugin.
Then you need to create a CSV, with columns "sku" and "magmi:delete". For example:
"sku","magmi:delete"
"00001","1"
"00004","1"
Then run your import.
Click Here to add MAGMI into your module -> https://magento.stackexchange.com/a/351175
Enable Product Deleter plugin.
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