COD only if Coupon is live
Buy Gary A Beer?
Buying me a "beer" helps me to keep my contributions updated and keep this blog alive - and you get a link from my homepage to your site. Cheers!
A previous post introduced the idea of making modules in osCommerce "interactive" based upon other inputs...
Stefan asks;
What I need is for the COD Method of payment to work only with a valid voucher. In other words you cannot use the COD Method of payment without first entering a valid voucher code.
I had already installed my Discount Coupon modification onto Stefans store, which was seen to work very well, then Stefan posed that question to me. I was sure that this should be really quite simple to get working...and after a bit of lateral thinking, all it took was the following code (added to the COD module):
-
if (!tep_session_is_registered('coupon_code')) $this_enabled = false;
Which basically says;
if a session called "coupon_code" is NOT present, then disable the "Cash On Delivery" module. This works as my coupon module sets a number of sessions, one of them being "coupon_code", when a coupon is live.
Easy as 123. Can you think of ways to make your site more interactive for your shoppers?


