jeudi 25 février 2016

Woocommerce Limit specific product sales to one per shipping adress

If got a strange question about woocommerce and im aware that there will still be a lot of ways to get around this, but my question is as follow.

My client asked me to make a simple woocommerce website. It looked simple but there are some complications now. There is only one product sold on this website.

But here's the catch. This company also wants visitors to be able to order a sample product. This is in fact the same product as the normal one, but its a bit cheaper and and you ca only order 1 item.

So what the clients wants is a check on shipping address when someone is ordering a sample. So i need to somehow check the shipping address with the database to see if there is already an order for this specific product with this specific address. If false, the order can be continued, if true, the order can not be placed and the user is presented a message.

I know people can easily change addresses to keep buying samples, but this was what the client asked. Im really thinking of a different approach but the problem is that users don't have to make an account so im really not sure what would be the best way to prevent multiple sample orders by one person.

Hope someone has a fresh mind and could put me in the right direction. Other ideas are welcome as wel, but im not able to think of a good way anymore;)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire