17 August, 2019 at 12:30 pm #44321mia3Participant
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.
thanks17 August, 2019 at 12:39 pm #44328OllyAdmin & Mod
You’ll have to write some sort of cronjob (or WP Cron)
you could base this on the getting and deleting orders functions here
or of course use WP_Query itself or even your own sql statement
essentially 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
- The topic ‘Delete Order History after one day automaticly’ is closed to new replies.