View Single Post
  #1  
Old 05-14-2009, 10:31 AM
 
mikeslye mikeslye is offline
 

Member
  
Join Date: Feb 2009
Posts: 18
 

Default Free Shipping Mod

This mod allows selecting one or more shipping methods as to be free, while the rest of the shipping methods are calculated as normal...

located in /includes/func.cart.php

Replace:

PHP Code:
# Calculate total_cost and total_+weight for selection condition
            
if ($product["free_shipping"] != "Y" || $config['Shipping']['free_shipping_weight_select'] == 'Y') {
                
$total_shipping_valid += $product["subtotal"];
                
$total_weight_shipping_valid += $product["weight"] * $product["amount"];
            }

            
# Calculate total_cost and total_+weight for shipping calculation
            
if ($product["free_shipping"] == "Y")
                continue; 

With:

PHP Code:
# Calculate total_cost and total_+weight for selection condition
            # Dirks Free Shipping Mod Part 1
            
if ($config['Shipping']['free_shipping_weight_select'] == 'Y') {
            
# End Mod Part 1
                
$total_shipping_valid += $product["subtotal"];
                
$total_weight_shipping_valid += $product["weight"] * $product["amount"];
            }
            
            
# Calculate total_cost and total_+weight for shipping calculation
            #Dirks Free Shipping Mod Part2 -- updated 5-18-09
            #shipping_id 52 is USPS Priority, replace with selected free shipping medthod
                        
if ($product["free_shipping"] == "Y" && $shipping_id == 52)
            continue;
            
# End Mod Part 2 

After trying other mods and searching for hours and hours, and tracing through code... yuck (im not a programmer, LOL) This code works for me, hope it works for you...

--Dirk (Main Tech Guy for http://www.theharddriveexperts.com)
__________________
-------------------------------
http://www.theharddriveexperts.com
New, Refurbished, Re-manufactured, Re-Certified Hard Drives -- ATA, SATA, SCSI, SAS, etc...

x-Cart Version 4.1.11
Reply With Quote