3

Our client uses Magento CSV import/export functionality to import and export stocks and pricing regularly.

Special prices for the products keeps changing. While importing special prices, if we keep the special price row as blank it won't replace the special pricing in the product. Also, if we pass NULL the special pricing becomes 0 and we start giving customer freebies.

we need to remove the special price when customer imports using CSV. It is fine to pass some parameters if required.

Can anyone guide me how this needs to be done?

2

Good question, unfortunately it's impossible with default Magento. If you absolutely need it, you can extend the method Mage_ImportExport_Model_Import_Entity_Product::_filterRowData or its Enterprise counterpart. Add something like the following lines:

foreach($rowData as $key => $fieldValue) {
    if (!trim($fieldValue) && $key == 'special_price') {
        $rowData[$key] = NULL;
    } 
}

We have done something similar for AvS_FastSimpleImport, see https://github.com/avstudnitz/AvS_FastSimpleImport/blob/master/src/app/code/community/AvS/FastSimpleImport/Model/Import/Entity/Product.php#L1283. We remove the value if a special value ("###EMPTY###") is found in the import.

Please, don't put that code into the core class directly, but make a rewrite or at least copy the whole file to app/code/local/Mage/ImportExport/Model/Import/Entity/Product.php.

1

If the import file includes all the catalog/products you have on website, or you can filter priducts with common criteria,then you cans use mass update as a workaround in order to unset special price. After that import your file so only given special prices will be updated.

enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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