The coupon codes are freely offered on the website, quite prominently
actually. If the person still doesn't use them then that's their loss.

The price is calculated in the cart code so I'm not worried about that. This
is more a check because some people are using the wrong code either on
purpose or accidentally then trying to still get that discount when their
order is price adjusted.

The price range is also clearly marked:
http://www.modernessentials.com/coupon.cfm

Thanks for the input though Dave...those are things that while they don't
apply, I hadn't thought about.

<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Dave Methvin
Sent: Wednesday, November 22, 2006 9:02 AM
To: 'jQuery Discussion.'
Subject: Re: [jQuery] SOT: Function review please?



Do you want to prevent someone with an order over $1500 from using the
save10 coupon code? Why not let them use it? They're leaving more money on
the table for you, so let them have the smaller discount.

If I View Source I can get the coupon codes? :) I would do a hash on the
coupon code (a simple checksum, or even Tiny Encryption Algorithm, Google
for it) to hide it, then look it up in an array that told you the minimum
subtotal where the code was valid. If the code's has wasn't in the array, or
if subtotal was less than the amount in the array, it's not valid.

Where is the discount subtracted? I hope on the server side. Otherwise it
sounds like you're vulnerable to "unauthorized price reductions." If you're
just doing some client-side check that will be reverified at the server,
it's not a problem.

-----Original Message-----

function checkCoupon() {
        /* check the coupon code function */
        var curCoupon = $('#v_code').val();
        var st = parseInt($('#thesubtotal').html());
        if (st < 1499.99) {
                appcode = 'save10';
        } else if (st > 1499.99 && st < 1999.99) {
                appcode = 'save5freeship';
        } else if (st > 1999.99 && st < 2999.99) {
                appcode = 'save10freeship';
        } else if (st > 2999.99 && st < 5999.99) {
                appcode = 'save15freeship';
        } else if (st > 5999.99) {
                appcode = 'save20freeship';
        } else {
                appcode = 'what?';
        }
        if (curCoupon != '' && curCoupon.toLowerCase() !=
appcode.toLowerCase())  {
                alert('You have entered the incorrect coupon code for your
merchandise total. Your code has been updated.');
                $('#v_code').val(appcode);
        }
}


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to