Zen Cart Logo
Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / how can I code in a default coupon code into checkout page redeem, then auto-refresh?

how can I code in a default coupon code into checkout page redeem, then auto-refresh?

Locked

Views: 5,014

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
29 Nov 2008, 2:10 AM
#1
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

how can I code in a default coupon code into checkout page redeem, then auto-refresh?

I'm looking at the code in tpl_checkout_default trying to figure out the right place add hard code a default discount coupon code and then auto refresh the page to redeem the coupon without the customer even noticing?

Using the storewide sale with the MSRP and MAP mods creates 2 sets of discount displays on every product price - the msrp discount and then the sale discount. I think I can change this in the function_price script, I changed it to account for the same thing happening with specials, but would prefer to use the discount route so I can track the efficacy of our marketing campaigns.

Any help would be much appreciated.

Matt

29 Nov 2008, 3:56 AM
#2
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: how can I code in a default coupon code into checkout page redeem, then auto-refresh?

OK, so I figured out where to put the default coupon code into the text box. It's in includes>modules>order_total>ot_coupon.php on line 89. You enter the default text in the second set of quotes(which are empty) like this, where the coupon code is HolidaySale:

zen_draw_input_field('dc_redeem_code', 'HolidaySale', 'id="disc-'.$this->code.'" onchange="submitFunction(0,0)"'),

Now I am trying to remember how to auto refresh the page so the user doesn't even notice it, before the page is rendered.

And also, is there a way to add a conditional that only shows the default code until the first page refresh, and for the "success" message displayed after the coupon is redeemed so it only shows after the first redemption?