Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Free Shipping if over $X, not with a coupon

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #41  
Old 05-09-2005, 03:19 PM
 
markwhoo markwhoo is offline
 

X-Adept
  
Join Date: Nov 2003
Posts: 799
 

Default Re: Free Shipping if over $X, not with a coupon

Quote:
Originally Posted by andyng
Hi,

I would like to add the feature when check out:-

1) Free Shipping if over $X locally (exclusive oversea delivery).

2) To allow user to redeem the coupon during check out and to be considered to deduct from the total order amount.

Please show details.

Thanks and regards,

Andy Ng

So make a coupon for end user to submit at checkout for free shipping and be done with it. All you need to do is add text good for oversea shipments only!
__________________
vs 4.1.12
Reply With Quote
  #42  
Old 05-09-2005, 07:11 PM
 
andyng andyng is offline
 

Senior Member
  
Join Date: Mar 2004
Posts: 151
 

Default Free Shipping if over $X, not with a coupon

Hi markwhoo,

How to write the code to check if the buyer is local and if the amount over $X, then no shipping charge include in the check out. If the buyer to redeem the coupon during the check out, then the total amount will also deduct the coupon amount as well.

e.g.
Case user=local and total_amt>=$100
total_amt=total_amt
if coupon="Y"
net_amt=(total_amt) - (coupon_amt)
else
net_amt=total_amt
Case user not=local or (user=local and total_amt <$100)
total_amt=total_amt+shipping charge
if coupon="Y"
net_amt=(total_amt) - (coupon_amt)
else
net_amt=total_amt


Above only my logic and I don't know whether the logic is OK or not. Besides, I don't know how to programming and intergrated with the checkout module to make it working.

Please give advise.

Thanks and regards,

Andy
X-cart 4.0.13
Reply With Quote
  #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
  #44  
Old 07-21-2005, 09:18 AM
 
rossco rossco is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 97
 

Default

Sorry but I must be missing something here.

How do you turn this on in the admin section?

Allan
__________________
How loud do you want it?

X-Cart Gold 4.0.12 & 17
Reply With Quote
  #45  
Old 07-21-2005, 09:19 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

You don't...that is what the last poster was asking for.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #46  
Old 07-23-2005, 04:32 AM
 
rossco rossco is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 97
 

Default

All sorted and working nicely
__________________
How loud do you want it?

X-Cart Gold 4.0.12 & 17
Reply With Quote
  #47  
Old 08-12-2005, 07:34 AM
 
spacetoast spacetoast is offline
 

Member
  
Join Date: May 2005
Posts: 29
 

Default

This is a great mod and I've been using it for sometime now without problem, but I just got nailed by a customer who used a %off coupon and got the free shipping based on the subtotal before the discount.

I'd like to set it up so that the free shipping applies to the discounted subtotal. However, if a customer does not use a coupon it should apply to the undiscounted subtotal.
Below is a snippet of the code where it bases whether or not free shipping applies on the "subtotal"

Code:
if ($row && ($tempcart["subtotal"] >= $freeOverAmount)) { $rate = 0;

Does anyone know what I would add so the conditions above are met?

Thanks!
Curtis
__________________
Curtis Durham
4.6.4
www.bathnation.com
Reply With Quote
  #48  
Old 08-12-2005, 05:49 PM
  shipmerchant's Avatar 
shipmerchant shipmerchant is offline
 

eXpert
  
Join Date: Mar 2005
Posts: 361
 

Default Almost got it!

We would like to offer free USPS shipping over $100us. I added the above patch and it updated successfully, and created the .php file and added the lines to the myshipper.php.


INSERT INTO xcart_shipping VALUES (150, 'Free Shipping - Orders Over $100', '', 'L', 'FREEOVERX', '201', 5, 'Y', '', '0.00', 0)

When I add products above $100, all calculates properly, but the pull down window reads " free shipping on order over $200" I would like to change it to state free shipping over $100.

Here is a snippet of myshipper.php file:

# Shipping modules depend on XML parser (EXPAT extension)
#
if( test_expat() != "" ) {
if ($ups_rates_only)
include $xcart_dir."/shipping/mod_UPS.php";

else {
include $xcart_dir."/shipping/mod_USPS.php";
include $xcart_dir."/shipping/mod_CPC.php";
include $xcart_dir."/shipping/mod_ARB.php";
#Added this line below for free shipping over $ 100
include $xcart_dir."/shipping/mod_CUSTOM.php";
}

Here is my mod_CUSTOM.php:

<?
// 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 "../shipping/mod_DHL.php";
// ADD THIS LINE to include this file:
// include "../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=100;

// 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);
}
}

?>



Can someone please tell me how to nake the change, to read for Order over $200, to for order over $100? We only use USPS realtime shipper.

Thanks in advance.




[/u]
__________________
Mil Mascaras
Live Xcart Site #1-V- 4.1.8
Live Xcart site # 2-V 4.4.3
CDSEO Mod - Firetank MM30 - 7DANA- The bestTemplates!
Linux - EWD Host Servers awesome service!
AlteredCart One Page Checkout
Reply With Quote
  #49  
Old 08-13-2005, 01:00 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

You need to change the entry in the database.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #50  
Old 09-05-2005, 10:18 AM
 
syndicatelabs syndicatelabs is offline
 

Member
  
Join Date: Aug 2005
Posts: 29
 

Default Help with database

I am using phpmyadmin

does anyone know the steps or where i should enter this code

INSERT INTO xcart_shipping VALUES (103, 'Free Shipping - Orders Over $200', '', 'L', 'FREEOVERX', '201', 5, 'Y', '', '0.00', 0);

I tried to create a field but that does not work becasue i do not konw wha to enter into the value. Please help

Using v4.0 xcart
__________________
learnxcart
4.1.6
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:23 AM.

   

 
X-Cart forums © 2001-2020