You could try this by adding the code in RED by editing the file:
/includes/modules/pages/checkout_payment/header_php.php
Code:
$order_total_modules->collect_posts();
$order_total_modules->pre_confirmation_check();
// 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
// $_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 ...
Bookmarks