If an imported catalog xml file does not contain prices, existing prices are removed. This is due to importer using an empty IPriceValue list and saving it using PriceService.SetCatalogEntryPrices(...). That service/method expects to have a complete set of prices, and that combined with an empty list leads to all prices being lost.
However, the same logic does not apply to inventories. Existing inventory rows are kept even if they are not added to the xml. Current implementation is contradictory and confusing. One "just has to know" how importer works with different kinds of data.
One suggestion for a better solution is to e.g. provide boolean flags in the public interface of importer (Mediachase.Commerce.Catalog.ImportExport.CatalogImportExport) for controlling if prices or inventory should be completely ignored by the importer.
I agree that this is a valid case, we will look into it.
The current workaround is to have make your implementation of IPriceService do not delete prices if the price list is null.
And inventories and prices, while have fairly similar characteristics, they are not the same, so there might be difference in the way they behave.
I have started to investigate this issue and cannot reproduce on Commerce 11 (there is a check that prevents prices being saved if the list of prices is empty). Which version are you running on?
Commerce version is 220.127.116.11.
Can you provide me with a sample catalog.xml where you observe this behavior? I'm unable to reproduce the issue on Commerce 11.x
Send by email to magnus(dot)strale(at)episerver(dot)com