View Single Post
  #43  
Old 07-20-2005, 10:16 PM
 
soundtek888 soundtek888 is offline
 

Newbie
  
Join Date: Apr 2005
Location: So San Francisco, CA
Posts: 6
 

Default Re: same mod for 4.0.4

Quote:
Originally Posted by inksticks
Thanks so much for the mod. It works great! I just wanted to make a small change for those of you using version 4.0.3. myshipper.php is set up a little differently so the 4.0.3 mod would be as follows:

Code:
<? // Custom shipping methods // // Free shipping over $X mod // Add an entry to table xcart_shipping like this: // INSERT INTO xcart_shipping VALUES (103, 'Free Shipping - Orders Over $200', '', 'L', 'FREEOVERX', '201', 5, 'Y', '', '0.00', 0); // I picked "201" subcode arbitrarily, but it seems like a good number to start as to not conflict with predefined shipping methods // The "5" is the orderby. "Y" is active or not. Replace "0.00" with a weight limit if you don't want this available for heavy orders. // This will show up as a Real-Time shipping method in "Shipping Options" // // Edit the file shipping/myshipper.php and under this line // include $xcart_dir."/shipping/mod_ARB.php"; // ADD THIS LINE to include this file: // include $xcart_dir."/shipping/mod_CUSTOM.php" // // You can also include other custom shipping files here so that myshipper.php is left alone. // // Edit the amount valid for free shipping below. $freeOverAmount=201; // That's all! if ( !defined('XCART_SESSION_START') ) { header("Location: ../"); die("Access denied"); } global $products, $cart, $userinfo, $current_area, $login; // Make sure this shipping method is available foreach ($allowed_shipping_methods as $key=>$value) if ($value["code"] == "FREEOVERX") $FREEOVERX_FOUND = true; if ($FREEOVERX_FOUND) { $tempcart = func_calculate($cart, $products, $login, $current_area); if ($userinfo["s_country"] == $config["General"]["default_country"]) $dest = "L"; else $dest = "I"; $row = func_query_first("SELECT shippingid, subcode FROM $sql_tbl[shipping] WHERE code='FREEOVERX' AND active='Y' and destination = '$dest'"); if ($row && ($tempcart["subtotal"] >= $freeOverAmount)) { $rate = 0; $intershipper_rates[] = array("methodid" => $row['subcode'], "rate" => $rate); } } ?>

Thanks again for the great mod!


MANY THANKS to all of you's for contributing such as great mod. One last step would make this mod prefect if someone can add couple lines of codes to make the $X amount changeable in admin area for convenience instead of going into SQL database to modify the $X. -- e.g. If I want to change the $X from $200 to $500 or whatever...Just enter the difference amount like entering the Period or Weight Limit. Thanks in advance for all your helps!

Regards,
Andy
www.soundtekmusic.com/
__________________
SoundTek Music
Xcart/Gold 4.013
Unix
http://www.soundtekmusic.com/
Reply With Quote