Is there a correct way to purge/delete old carts (eg older than X days)? We have a site with a couple of million carts, and this is making for a large database.
I can delete the rows from the database directly easily enough, but is there a "more correct" way of doing this, eg a method in the API?
The "right" way is to use the API to get orders and then .Delete() them. Use a DB reader to get the id's of the orders to delete. Then use OrderService.Instance.Get to get multiple orders and then delete them using the API.
Then a scheduled task calling a Surface controller would be the way to do it :)
Deleting old carts
Is there a correct way to purge/delete old carts (eg older than X days)? We have a site with a couple of million carts, and this is making for a large database.
I can delete the rows from the database directly easily enough, but is there a "more correct" way of doing this, eg a method in the API?
Phil
Hi Phil
The "right" way is to use the API to get orders and then .Delete() them. Use a DB reader to get the id's of the orders to delete. Then use OrderService.Instance.Get to get multiple orders and then delete them using the API.
Then a scheduled task calling a Surface controller would be the way to do it :)
Kind regards
Anders
is working on a reply...