I need to prevent selling more than 30 items per day by IP address in woocommerce. Basically, it is protection from bots. I think logic must be something like this:
- get IP of a customer on a purchase and store it in the order meta
- check if there are other purchases from that IP at the past 24hr
- if more then 30 - display an error before payment and ask to return later
*user registration is disabled
So I'm not sure where to start and how to follow to woocommerce hooks rules.
Any code examples would be highly appreciated