If this is your first visit, check our documentation. To post, register or login.

Restrict use of coupon only for return customer

Started by naczyls747 on 4 Jan 2017, 3:48 AM · Views: 1,607

Results 1 to 6 of 6
4 Jan 2017, 3:48 AM
#1
naczyls747 avatar

naczyls747

New Zenner

Join Date:
Feb 2014
Location:
Malaysia
Posts:
24
Plugin Contributions:
0

Post #1 by naczyls747

Hi! I am sorry if this has been asked before, but I did search the forum and google it but to no avail.

I would like to ask if it's possible to restrict coupon only for return customers (ie second purchase onwards)..

Please help me.. thank you!

5 Jan 2017, 8:22 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Post #2 by dbltoe

My quick answer, without delving too deep, would be to create a coupon code and include it in the customer's email verifying a purchase. That way, the customer would never know the code unless they bought something. If it's their second or more purchase, it can remind them of the code.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

6 Jan 2017, 1:12 AM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #3 by mc12345678

I admit that I'm not highly familiar with the coupon aspect of ZC (haven't had to use them), but I think part of the concern (and don't know if it is/can be an issue) is if that coupon code is shared with another individual as to whether they can use it on their first purchase or not. Meaning. Even if it were included on their first email response, would it be linked to their account only or would it be something that anyone could use if they knew it?

Otherwise, in the coupon application "process", would want to allow the use if there is a record of a successful order for that customer, and if not, then deny the use of the coupon. That would likely be something that could be tested against in or by observer of the start of the header file for includes/modules/pages/checkout_payment/header_php.php

Would require some form of sql lookup against the logged in user and the orders table possibly with the orders_history table where the status of the order shows "above" a certain status such as "processing" (typically status of 2). I suggest this check because if the store allows a "purchase" to be made, but there is some sort of "error" that considers the purchase incomplete, then the customer could then make a "second" purchase using the coupon they more than likely just received, and then possibly try to cancel the first order which just makes things messy for everyone...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

6 Jan 2017, 1:46 AM
#4
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,906
Plugin Contributions:
23

Post #4 by dbltoe

MC, I think you might be trying to shoot a fly with a shotgun.

I would like to ask if it's possible to restrict coupon only for return customers (ie second purchase onwards)..
To me that means everyone can use the code, they just don't need to know it UNTIL they've made a purchase.
Adding a paragraph with the coupon code to the Order Confirmation e-mail would seem to be the easiest solution. No one would receive the code until AFTER their first purchase.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

6 Jan 2017, 2:40 AM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #5 by mc12345678

dbltoe:

MC, I think you might be trying to shoot a fly with a shotgun.

I would like to ask if it's possible to restrict coupon only for return customers (ie second purchase onwards)..
To me that means everyone can use the code, they just don't need to know it UNTIL they've made a purchase.
Adding a paragraph with the coupon code to the Order Confirmation e-mail would seem to be the easiest solution. No one would receive the code until AFTER their first purchase.

Call it what you will, but I did and still do read:

I would like to ask if it's possible to restrict coupon only for return customers (ie second purchase onwards)..

To indicate that no matter who the person is, do not permit the use of the coupon until they have made their first purchase... Yes, making the coupon known to a specific individual does reduce the potential use of that coupon by someone else on their first purchase, but it does not prevent that coupon code from being shared at that point and used by someone else on their first purchase (if the coupon is not restricted to an individual)...

Thus, not meeting the (understood) requested action... That said, the above about limiting initial distribution may really be all that was necessary and it is why I didn't dispute the suggestion nor go into and actually write the code to accomplish the pseudo-code described above. Perhaps someone else will want that, but the true current desire has not yet been fully expressed/understood. It could also be that the code has already been limited and an "issue" still exists that is being attempted to resolve.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

6 Jan 2017, 3:01 AM
#6
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Post #6 by carlwhat

naczyls747,
as previously discussed, the short answer is NO, out of the box ZC does not do want you want.

the long answer is yes, if you want to do some custom coding. once could either modify:

includes/modules/order_total/ot_coupon.php

or perhaps make it work with an observer as MC previously suggested.

in addition, you might need to modify the coupons table and the admin section of setting up the coupon to indicate whether new customers could use the coupon code or not.

or there's the workaround that dbltoe offered

i hope that helps.

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.