WPPizza – A Restaurant Plugin for WordPress › Support › General Support › Delete Order History after one day automaticly
- AuthorPosts
- 17 August, 2019 at 12:30 pm #44321
Hall Olli,
is it possible to delete or clear orderhistory atomaticly after one day. i have edit a adminpage and the admins only have a look in frontend for orders. Especialy i do not want the possibility to enter in backend for admins. so my wish is to track the hole summery and the orders have to clear automaticliy after 24 hours.
hope you can help me very quick.
thanks
17 August, 2019 at 12:39 pm #44328You’ll have to write some sort of cronjob (or WP Cron)
you could base this on the getting and deleting orders functions here
https://docs.wp-pizza.com/developers/?section=function-wppizza_get_orders
or of course use WP_Query itself or even your own sql statementessentially you need to query the [yourprefix]_wppizza_orders table by orde_date and delete the entries as you require
be aware that every order id in that table might also have associated metadata in [yourprefix]_wppizza_orders_meta
so you will want to get those too and delete the rows in that table as well or you will end up with orphaned entries in the meta table.alternatively – if you are really quite sure you want to delete all entries, simply truncate those 2 tables at whatever time is appropriate
- AuthorPosts
- The topic ‘Delete Order History after one day automaticly’ is closed to new replies.