Zen Cart Logo

only one per customer...

Locked

Views: 984

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
15 Nov 2006, 4:41 AM
#1
ripper avatar

ripper

Zen Follower

Join Date:
Jul 2005
Posts:
295
Plugin Contributions:
0

only one per customer...

I posted this before, but maybe there are some new members who possibly made this happen, you never know.....

I have a cart owner who wants to limit the sale of one particular item to "One per customer" (not just one per order, that's easy). I know, he can go in if they order a second time and just delete the order, but this is something he wants to work on it's own. I currently have that one item outside of the cart system, using a cookie to track the buyer (I would try to do it within the cart system, but I have had no success integrating non-cart cookies into the cart system), but if the buyer is savvy, they can delete the cookie to circumvent the lockout. I need something that can be added to the database that says "already bought" so the user cannot possibly bypass the system to buy a second one.
I have tried a few things, but nothing has worked so far. I usually figure these things out eventually, but I'm tired of hitting my head against the wall on this one.

15 Nov 2006, 4:43 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: only one per customer...

You could build a test in that checks when the product is added to the cart is it set to 1 per customer ... then not allow it to be added and post a message ...

This would require some custom coding but it can be done ...

15 Nov 2006, 4:58 AM
#3
ripper avatar

ripper

Zen Follower

Join Date:
Jul 2005
Posts:
295
Plugin Contributions:
0

Re: only one per customer...

That's what I am attempting to do, but my experience is limited..... I was hoping for a few places to start looking for where I can hijack the cart process for this one item.

15 Nov 2006, 5:21 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: only one per customer...

/includes/main_cart_actions.php manages all the cart actions ...

You need to catch the products_id on the way in ...

Then do a check on the orders the customer has made to see if they purchased this product before ... as in do any of the orders have orders_products that match the products_id for this product ...

If so, stop the add to cart before it happens and toss out a message that says: no way jelly bean ...

15 Nov 2006, 5:30 AM
#5
ripper avatar

ripper

Zen Follower

Join Date:
Jul 2005
Posts:
295
Plugin Contributions:
0

Re: only one per customer...

Thanks, I'm sure I'll be back on this one.....
It's the most involved edit I've done yet.