Hey again! Here is a possible, albeit ugly, solution. First, edit index.php and add something like:
Code:
if (!empty($_GET['visitor_code']))
$_SESSION['visitor_code'] = trim(htmlspecialchars($_GET['visitor_code']));
Then in includes/modules/order_total/ot_coupon.php
Edit the line:
Code:
'field' => zen_draw_input_field('dc_redeem_code', '', 'id="disc-'.$this->code.'" onchange="submitFunction(0,0)"'),
change the second value sent to the function so that it looks like this:
Code:
'field' => zen_draw_input_field('dc_redeem_code', $_SESSION['visitor_code'], 'id="disc-'.$this->code.'" onchange="submitFunction(0,0)"'),
OK, I'm not much of a programmer, but if you go to yoursite.com/index.php?visitor_code=whatever it definitely puts 'whatever' in the discount coupon field during checkout :) Mostly, I just wanted to see if it was possible. The only problem with doing it this way is that it will make it difficult to do ZenCart upgrades. I'll keep working a more elegant solution.
Kevin
Bookmarks