November Happy Hour will be moved to Thursday December 5th.

Delete all data in price table

Vote:
 

Hello, how to delete all data from pricing programmatically ?
Thank you

#207315
Sep 17, 2019 8:41
Vote:
 

Here is a starting point https://vimvq1987.com/permanently-drop-prices-products/

You can change UpdatePrices to something like this

            var prices = _priceDetailService.List(contentLink);
            _priceDetailService.Delete(newPrices.Select(x => x.PriceValueId));

You can also use IPriceService.SetCatalogEntryPrices() which can delete prices if you pass an empty price list.

It'd be interesting to see which is faster ...

#207427
Sep 19, 2019 16:45
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.