View Single Post
  #11  
Old 12-03-2008, 11:42 AM
 
nacredata nacredata is offline
 

Member
  
Join Date: Jul 2008
Location: Chapel Hill, NC
Posts: 10
 

Default Re: Free Ground Shipping Mod

The following pair of simple hacks seem to work for me (4.1.11)

in /modules/Special_Offers/func.php around line 1330:
Code:
# Part 2: Apply bonuses # $discount = 0.00; $_SESSION['ND_freeshipping'] = NULL; # Apply discount bonus foreach ($products as $pk=>$product) { if (@$product["deleted"]) continue; # for Advanced_Order_Management module if (!empty($apply_bonus[$pk])) { $bonus = $apply_bonus[$pk]; if ($bonus['discount'] > 0.00) { if ($config["Taxes"]["display_taxed_order_totals"] =="Y") $products[$pk]['saved_original_price'] = $products[$pk]['taxed_price']; else $products[$pk]['saved_original_price'] = $products[$pk]['price']; $products[$pk]['price'] -= $bonus['discount']; $products[$pk]['special_price_used'] = true; } if ($bonus['free_shipping']) { // NacreData L.L.C. info@nacredata.com // Need to offer free shipping only on UPS ground, not on all delivery methods // so rather than just mark it all free here, rather set a flag which we can // check later (see /shipping/mod_UPS.php around line 551) // $products[$pk]['free_shipping'] = 'Y'; // $products[$pk]['free_shipping_used'] = true; $_SESSION['ND_freeshipping'] = true; } } }


in /shipping/mod_UPS.php around line 550:

Code:
// NacreData L.L.C. info@nacredata.com // Need to offer free shipping only on UPS ground, not on all delivery methods // so rather than just mark it all free in /modules/Special_Offers/func.php // (around line 1353), rather set a flag there which we can check here // is ground shipping ALWAYS methodid 1?? Appears to come from the database // table xcart_shipping if( isset( $_SESSION['ND_freeshipping'] ) && $subcode == 1 ) { $data = '0.00'; } $_rate_data = array( "methodid"=>$subcode, "rate"=>$data, "currency"=>$mod_UPS_currency, "orig_rate"=>$orig_rate, "warning"=>$RatedShipmentWarning, "service_code"=>$sv["service_code"] );

Also note something we discovered: it seems all items need to have a weight assigned to them. Items without a weight may not trigger a shipping recalculation.
__________________
Devin M. Ceartas
NacreData L.L.C.

X-Cart Gold v4.1.11
Modules: X-Affiliate
Reply With Quote