Is it possible with Expresso Store to check (in a template) if a certain ip address has ordered the same article within the last 24 hours? I have a website where someone can order maxiumum 1 piece of each item. I don't want people to just buy one, then go to the homepage again and be able to buy another ne of the same article. So I need some kind of (possibly ip) check. Is this possible?
I doubt this is something Expresso supports as it's so project specific.
One option is to use jQuery Cookie to track this: http://plugins.jquery.com/cookie/
Set a cookie on the success page and have it expire after 24 hrs or whatever time limit you want... Then on the purchase page, write a conditional against the cookie to determine if you should let them purchase the article or not.
Or if you specifically want IP address, store the buyers IP in a hidden field on the product page and submit it to the database when an order is complete. Then write a conditional that checks the database before allowing the buyers to make a purchase.
Or if you specifically want IP, it is stored in the
exp_store_orders table in the
ip_address column. There is also an
order_completed_date column. You can use the Query Module to build your query... then conditionally show the ability to purchase as needed.
You would most definitely need to develop something of your own. Asides from cross-checking IP you could also tie item purchases to an account, maybe even billing/shipping address, etc. depending on the nature of the product and to what extent you're willing to prevent purchases (you'd be blocking more or other than you intended).
You can certainly try and prevent this, but given how the internet works, you're going to have a hard time. People can always sign up for a new account, or use a different internet connection (their phone/ipad on 3G) to get around your check.
Probably the best method is a manual one: just state clearly that it is strictly one item per customer, and follow up with/refund customers who try to break the rules.