2

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?

2

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.

4
  • As Anna has mentioned there is nothing in Store out of the box that would allow you to do something like this. Dec 1 '13 at 20:43
  • cookies are not that secure (clearing browser cache) maybe store IP and item with the remember-me add-on and conditional check? devot-ee.com/add-ons/remember-me
    – GDmac
    Dec 2 '13 at 16:27
  • Store already records the order IP address. So if you want to write something custom it is easy enough to look up the existing order_ip field in the database. Dec 2 '13 at 21:39
  • Edited my answer to add the DB table/column where IP is stored.
    – Anna_MediaGirl
    Dec 3 '13 at 1:51
1

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).

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.