View Full Version : Coupon Problems

01-02-2006, 02:38 PM
This is an urgent issue that must be fixed tonight. In the adminsitration interface of our OSCMax installation, when we go to edit coupons in IE, we get a javascript error. It basically says that 'Init is not defined'.

The offending code is here:
<body OnLoad="init()" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> I was going to just remove the code from the templates, but can't figure out where it's stored (and don't know what it does).

Our second issue is that coupons are not working at all. After creating our new coupon, if a user enters it at checkout, no discount is given at all (and the coupon does have the correct values to give a discount. I've already checked). If we enter an invalid coupon code, we get an error, but if we enter a real coupon code, we are directed to the next step of checkout. This is a major problem.

I am a developer, and this is my client's website. He is going to a trade show tomorrow and wants to give a discount to the attendees there, so we need to get these errors fixed.


01-02-2006, 03:08 PM
1. Just remove the OnLoad-"init()" from the body tag in /admin/coupon_admin.php - line 180

2. This behavior is not present in a default install of osCMax when coupons are properly set up. You most likely have misconfigured the coupon somehow or you have changed the order total modules sort order... You really need to be more specific as to what your coupon settings are and what specifically is the problem.

01-02-2006, 03:28 PM
Thank you for getting back to me. I was brought in on this project tonight in an emergency type situation. Someone else has been configuring (and messing up) this shop before. I have edited to remove the JS error (what is that code for, out of curiosity?) Here is how the Order Total module is set up.

1. Sub-Total
2. Shipping
3. Tax
4. Customer Loyalty Discount
5. Low Order Fee
97. Discount Coupons
740. Gift Vouchers
800. Total

I have no idea why they've skipped from 5 to 97. Could this be causing the problem? Here is how the coupon is set up:

Coupon Name :: CES Show Discount
Coupon Amount :: $15.00
Start Date :: 01/01/2006
End Date :: 01/02/2007
Uses per Coupon :: 0
Uses per Customer :: 2
Valid Product List :: NONE
Valid Categories List :: NONE
Date Created :: 01/02/2006
Date Modified :: 01/02/2006

Can you gather anything from this? Please let me know if you need any more information.

01-03-2006, 10:43 AM
The OT modules order is fine. No problems there.

It looks like your coupon setup. Make sure that Coupon Minimum order is not set. Make sure Free Shipping is NOT checked. For testing, change uses per customer to 0.

Leave valid product list and categories list blank. It should not be set to NONE, but should be blank.

01-03-2006, 10:44 AM
Oh, what payment module are you using? If you are using paypal, it must be set to aggregate mode, not per item mode.

01-03-2006, 12:02 PM
Sure enough, the client had ticked the box for free shipping (even though it plainly states that checking the box will override). All is good now.
Thanks for your help.