Author |
Topic |
|
andysuch
Starting Member
United Kingdom
7 Posts |
Posted - April 26 2007 : 13:34:48
|
I need to create a coupon that is sent to the customer when they first register.
I think I know how automatically to create the coupons in the database when a new user registers and have the coupon code automatically included in the new registration email, although any assistance here would be useful.
What I don’t know how to do is set up a coupon with my specific needs.
What I need is:
a coupon that can only be used once by the customer who registers (couponcustomers filed)
The coupon should be for 20% up to a maximum value of £200 and this is where I am stuck. You seem to be able to set either a percentage or a value but not a combination of both.
Can anyone help.
Thanks,
Andy.
|
|
Alan F
VP-CART New User
102 Posts |
Posted - April 27 2007 : 05:06:27
|
Hi
I would set up a coupon as normal and then put the details of the coupon in the tmp_welcomeemail.txt
Best Regards
Alan |
|
|
andysuch
Starting Member
United Kingdom
7 Posts |
Posted - April 27 2007 : 06:09:30
|
Hi,
I have worked out how I would create a new one time only use coupon for each new user when they register, that part seems reasonably easy to do with some additions to the asp in to ‘shopcustregister.asp’. Although haven’t attempted this yet.
What I also may implement is disabling the discount coupon until the admin has verified the account details (try and stop someone registering multiple times to get multiple discounts)
What I need to work out is how to set a maximum value for the discount coupon, I have added a new field to the coupons table ‘couponmaxamount’ and this will define the maximum value a percentage based coupon could be used up to i.e. 20% up to the value of £200.
What I need to work out is how to implement the maximum value field when performing the checkout. Can anyone shed any light on this or which asp scripts need to be looked at.
Many thanks,
Andy.
|
|
|
andysuch
Starting Member
United Kingdom
7 Posts |
Posted - March 15 2009 : 07:40:05
|
When I first setup the site we decided not to go with the coupons for the time being as we did not have the plus pack.
Circumstances have changed and I now have to implement this.
The coupon should be a percentage of the value with a maximum capped amount for example 20% up to £200 discount, so £500 would give £100 discount, £1000 would give £200 discount but anything over £1000 would still only give the maximum discount of £200 i.e. £2000 would still give a discount of £200.
The percentage part is obvious, you put the figure 0.2 in the ‘couponpercent’ field.
In preparation I have added the field ‘couponmaxamount’ as mentioned in my post above, what I need to know is where to implement the calculation.
Which script do I need to look at and edit which does the coupon calculations.
Thanks in advance.
|
|
|
andysuch
Starting Member
United Kingdom
7 Posts |
Posted - March 15 2009 : 10:00:04
|
For anyone interested I found the answer:
All the coupon functions are held in the file ‘shopcoupon.asp’
I added the new field to the ‘GetCouponFields’ sub:
couponmaxamount = objrs("couponmaxamount") if isnull(couponmaxamount) then couponmaxamount = 0
then added the check to the discount amount whenever it was calculated based on a percentage
discount=Totalamount*couponPercent (existing code)
if couponmaxamount > 0 and discount > couponmaxamount then discount = couponmaxamount
Hope it helps.
|
|
|
dwight
VP-CART New User
USA
143 Posts |
Posted - May 14 2009 : 00:47:45
|
Andy, does the code you wrote work of "amount" also. And if so could you give more details on where you put the code. I am new and the more info you share the better.
Thanks Dwight |
|
|
|
Topic |
|