RealCart UNIVERSITY
Courses [Home]  [Search]  [Index]  [Help]  [Help]

Higher Learning for the Internet’s most effective shopping cart - Attend On-line.

<<prev | 1 | 2 | 3 | 4 | 5 | next>>

FREE Shipping based on Order Total - Method 2

This variation of our jsship.snp file will only make the first (default) shipping method FREE. Any subsequent method(s) will remain at regular price. This is handy if you offer Priority Mail or Parcel Post as your default shipping method but also offer FedEx, UPS 2nd day or some other more expensive method(s) as well.

All of the modifications described on the previous page are used as well as an addition to the “if statement” as described below:

The lines of code we added before are as follows:

  // RealCartUniversity FREE Shipping if order is
  // over $100.00 added following 8 lines

  if(nOrderTtl >= 100)   // <<- change the "100" to other
  {                      //number here if desired.
    nShipCharge = 0.00;
    return nShipCharge;
  }

  // end RealCartUniversity FREE shipping routine #1.

This time we are going to use a slightly different version of the “if statement”. To force RealCart to make only the default method of shipping FREE we will add: “ && (nIndex == 0)” to the if statement. The original modification is shown below in navy while the new version of the if statement is shown in bright blue.

function GetShippingCharge(nIndex)
{
  // RealCartUniversity FREE Shipping if order is
  // over $100.00 added following 8 lines
  // This changes first shipping method only!

  if((nOrderTtl >= 100) && (nIndex == 0))   // 1st method only
  {
    nShipCharge = 0.00;
    return nShipCharge;
  }

  // end RealCartUniversity FREE shipping routine #2.

  // make a copy so value doesn't change in calling function.
  var nIdx = nIndex;

  // Assign values of selected shipType object to
  // variable for easier readability.
  var nID = shipOption[nIndex].ID;
  var nType = shipOption[nIndex].Type;
  var nShipCharge = 0;
  var nMatchVal = 0;
  var bFound = false;
  var nLastIndex = -1;

Since some of the lines of code displayed above may wrap due to the length of the lines and your current font size setting please view this file to see which lines are to remain intact without wrapping. To see the entire modified jsship.snp file please click here. The changes are highlighted with red type. You may download this modified jsship2.zip file, extract it and then save the new jsship.snp file to your current theme folder called jsship.snp. Rebuild Checkout, republish and enjoy.

On orders LESS than $100.00 your shipping pull-down menu on your checkout page will resemble this:

Select shipping:

On orders MORE than $100.00 your shipping pull-down menu on your checkout page will resemble this:

Select shipping:

You could change any shipping method you desire by simply changing the value in the addition to the if statement as follows:

  if((nOrderTtl >= 100) && (nIndex == 1))   // 2nd method only

Changing nIndex == 0 to nIndex == 1 causes the 2nd shipping method to be FREE instead of the first one. This is because JavaScript counts starting at 0 therefore the first method is 0, 2nd method is 1, 3rd method is 2 and so on. Using this method your shipping pull-down menu on your checkout page will resemble this on all orders $100.00 or more:

Select shipping:

Use caution when advertising FREE shipping for orders over $100.00 if you are going to change the non-default (2nd) method to FREE instead of the default method. Most customers will not notice that they have to intentionally select the second shipping method to receive FREE shipping. You may want to consider making your premium (more expensive) shipping method FREE if orders are over $200.00 and standard shipping FREE if orders are over $100.00. This way your shopper will not feel “short changed” if he or she neglects to select the non-default (or 2nd) shipping method after being promised FREE shipping.

The next page shows how to achieve multiple levels of free shipping based on two different order totals.

<<prev | 1 | 2 | 3 | 4 | 5 | next>>


About RealCart U | Courses | Admissions | Administration | Alumni | Directories | Case Studies | Help

Contact the Webmaster staff
Copyright information
Privacy statement

Copyright © 1995-2002, RealCartUniversity.com