[ic] Need help with this coupon/certificate code

Evan Brown interchange-users@icdevgroup.org
Sat Jan 18 14:40:01 2003


Hi Guys:

I am trying to setup a coupon for my site. Basically a customer gets a
coupon code that he or she has to redeem. They redeem that at checkout. They
type in the coupon code and it checks that code with the code in the
gift_certs table. If the code matches then it will invoke the discount tag
and subtract $5 from the total. If the code is incorrect then it should
display an error.

*******The coupon code is in the gift_certs table in the code column******

I included some code I am working on and I can't seem to get the form to do
anything. Can someone help me with the code on the bottom.



[set couponcompare]
[if type="data" term="gift_certs::code::[value coupon]"]
[discount ENTIRE_ORDER] $s - 5 [/discount]
[else]
Your code is invalid
[/else]
[/if]
[/set]

<FORM ACTION="[process secure=1]" METHOD="POST" name="validate">
<input type=hidden name=mv_click value=couponcompare>
<input type=hidden name=mv_todo value=return>
<input type=hidden name=mv_nextpage value=checkout>



<input type="text" size="10" name=coupon value="[value coupon]" size="5">

[button

                src="thumb/validate.jpg"
                hidetext=1
                form=validate
        ]
        [/button]

</form>