Phillip
Phillip

Reputation: 4306

Magento - Limit form submission per client

In the site I'm working on, there's a section where the client can rate the website and get a coupon.

In order to prevent them to vote multiple times, how could I limit their submissions to just one time?

I wouldn't like to use cookies because they could be erased, but rather I was thinking about the

Mage::getSingleton('customer/session')->getCustomer();

method, I could set a sort of variable to check if he voted already or not.

Any suggestion appreciated.

Upvotes: 0

Views: 70

Answers (1)

Emi
Emi

Reputation: 1018

And indeed only registered users can vote, I already show the message "You need to be registered to cast a vote" Then you can create a module with a model, and installation sql to add a new table (where you can save the customer id and coupon granted to that customer) and if they cast multiple votes or change their vote, you can give the same coupon every time.

Also if the coupon is generated using a Catalog Rule, then you can limit the number of Uses per Customer to 1 (the customer group can also be specified only for logged in users - depends on what groups you have).

Depending on how far you want to go, you can check if the customer has previous orders, or other stuff like that (maybe the billing/shipping address), since anyone who creates multiple accounts can cast a vote and get a new coupon.

Upvotes: 2

Related Questions