You could try this by adding the code in **RED **by editing the file:
/includes/modules/pages/checkout_payment/header_php.php
$order_total_modules->collect_posts();
$order_total_modules->pre_confirmation_check();
[B]// bof: change shipping for free shipping discount coupon
$chk_coupon = $db->Execute("select * from " . TABLE_COUPONS . " where coupon_id = '" . (int)$_SESSION['cc_id'] . "'");
//echo 'Coupon ORIGINAL $_SESSION[shipping][id]: ' . $_SESSION['shipping']['id'] . '<br>';
if ($chk_coupon->fields['coupon_type'] == 'S' or $chk_coupon->fields['coupon_type'] == '0') {
//echo 'Discount Coupon: Free Shipping! Country: ' . $order->delivery['country']['id'] . ' $_SESSION[shipping][id]: ' . $_SESSION['shipping']['id'] . '<br>';
//echo '<pre>'; echo var_dump($_SESSION['shipping']); echo '</pre>';
if ($order->delivery['country']['id'] == '223') {
if ($_SESSION['shipping']['id'] != 'usps_PRIORITY') {
$_SESSION['shipping']['id'] = 'usps_PRIORITY';
$messageStack->add_session('header', 'Shipping changed for Free Coupon - Please continue checkout', 'caution');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}
} else {
if ($_SESSION['shipping']['id'] != 'usps_Priority Mail International') {
$_SESSION['shipping']['id'] = 'usps_Priority Mail International';
$messageStack->add_session('header', 'Shipping changed for Free Coupon - Please continue checkout', 'caution');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}
}
}
//echo 'Coupon CHANGED $_SESSION[shipping][id]: ' . $_SESSION['shipping']['id'] . '<br>';
// eof: change shipping for free shipping discount coupon
[/B]
// $_SESSION['comments'] = '';
$comments = $_SESSION['comments'];
This assumes you want to use Priority mail for both US and the Rest of the World ...
You can adjust which shipping methods you want to use based on your needs ...
Linda McGrath
If you have to think ... you haven't been zenned ...
**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!